/* WFRP 5e Companion — one stylesheet, light + dark, mobile first. */

/* Headings: Alegreya (SIL OFL 1.1, static/vendor/fonty), variable weight, vendored so the app works offline.
   Polish letters other than „ó” live in the latin-ext file; the browser fetches a file only when a page needs it. */
@font-face {
  font-family: "Alegreya"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url("/static/vendor/fonty/alegreya-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
                 U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya"; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url("/static/vendor/fonty/alegreya-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
                 U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Palette taken from the WFRP cover: teal-grey stone and navy shadows, the gold-to-orange logo
   with its blood-red outline, the parchment banner and the sickly green sky. */
:root {
  --bg: #ebe4d3;
  --surface: #fbf8ef;
  --surface-2: #f1ebdc;
  --ink: #1b2a30;
  --muted: #56646a;
  --border: #d5cbb5;
  --accent: #9f2317;
  --accent-ink: #fff8ea;
  --accent-soft: #f3dcd4;
  /* picked, current, hovered, focused: the stone's teal; the red is a view's main action, failure and danger */
  --wybor: #2c6468;
  --wybor-soft: #d3e5e1;
  --wybor-ink: #fff8ea;
  --gold: #a8620a;
  --postronni: #86744f;     /* the bystanders' side (a token's ring, a face, a row, a chip): muted, not the gold of one's own */
  --teal: #2c6468;
  --teal-soft: #dbe7e4;
  --krawedz-karty: color-mix(in srgb, var(--teal) 55%, var(--border));  /* a card's top edge */
  --ok: #2f6a34;
  --ok-soft: #e0ecd9;
  --bad: #a4251c;
  --bad-soft: #f6ddd8;
  --warn: #8a5800;
  --warn-soft: #f6e9cc;
  --info-soft: #dde8e6;
  --chaos: #4d7a27;         /* Corruption and mutations: Morrslieb's sickly green */
  --chaos-soft: #e4eed8;
  /* a weapon's range bands on the battle map, nearest first ([walka] pasma_zasiegu: the test's bonus to its penalty) */
  --pasmo-0: var(--ok); --pasmo-1: var(--ok); --pasmo-2: var(--wybor); --pasmo-3: var(--warn); --pasmo-4: var(--bad);
  /* what the load is made of (karta_akcji.html pasek_udzwigu): weapons, armour, gear, coins */
  --obc-bron: #7b4777; --obc-pancerz: #4a6fa5; --obc-wyposazenie: var(--wybor); --obc-monety: var(--gold);
  --nav-bg: #1c3338;
  --nav-ink: #e7e2d3;
  --nav-muted: #9fb4b1;
  --nav-hover: rgb(255 255 255 / 7%);
  --nav-active: #f4bd3a;
  --nav-active-bg: rgb(244 189 58 / 14%);
  --logo-a: #f9d648;
  --logo-b: #e9791c;
  --logo-edge: #7d140c;
  --shadow: 0 1px 2px rgb(20 35 40 / 10%), 0 4px 16px rgb(20 35 40 / 7%);
  --radius: 10px;
  --radius-sm: 6px;
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans", Roboto, sans-serif;
  --font-head: "Alegreya", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --nav-w: 232px;
  --tabbar-h: 60px;
  color-scheme: light;
}

/* Dark: the script in <head> (web.SKRYPT_MOTYWU) always sets data-theme — the user's choice, or the system's
   setting for "auto" — so the dark palette is written once. */
:root[data-theme="dark"] {
  --bg: #0e191d;
  --surface: #15252a;
  --surface-2: #1c3035;
  --ink: #e9e4d5;
  --muted: #93a8a6;
  --border: #2a4147;
  --accent: #e5553b;
  --accent-ink: #1b0906;
  --accent-soft: #3b1f1a;
  --wybor: #7cbab6;
  --wybor-soft: #1d4246;
  --wybor-ink: #0e191d;
  --gold: #f2b830;
  --postronni: #bcab83;
  --teal: #72b0ac;
  --teal-soft: #1b3539;
  --ok: #9bcf6e;
  --ok-soft: #1f3322;
  --bad: #f07d68;
  --bad-soft: #3d1f1b;
  --warn: #f2b830;
  --warn-soft: #3a2f16;
  --info-soft: #1b3036;
  --chaos: #a3d96f;
  --chaos-soft: #1f3320;
  --obc-bron: #c58fc0; --obc-pancerz: #86a8dc;
  --nav-bg: #0a1316;
  --nav-ink: #e2ddcf;
  --nav-muted: #8aa09e;
  --nav-hover: rgb(255 255 255 / 6%);
  --nav-active: #f4bd3a;
  --nav-active-bg: rgb(244 189 58 / 12%);
  --shadow: 0 1px 2px rgb(0 0 0 / 35%), 0 4px 16px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }
/* „Skala” in the settings: a CSS zoom of the whole page, like the browser's own (the script in <head> sets --zoom;
   90% until a device picks one).
   A zoom shrinks viewport units too, so every vh/vw here is written calc(Nvh / var(--zoom)) (tests/test_ikony.py) */
html { --zoom: .9; zoom: var(--zoom); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 var(--font);
  min-height: calc(100dvh / var(--zoom));
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.7rem; color: var(--teal); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75em; }
a { color: var(--accent); }
small, .muted { color: var(--muted); }
.muted { font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
code, kbd { font-size: .9em; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 .3em; }
ul.plain { list-style: none; padding: 0; margin: 0; }

/* ---- layout ---------------------------------------------------------------------- */
.app { min-height: calc(100dvh / var(--zoom)); }
.main { padding: 16px 16px calc(var(--tabbar-h) + 88px); max-width: 1180px; margin: 0 auto; }
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: .5rem;
  padding: .55rem max(16px, env(safe-area-inset-right)) .55rem max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--nav-bg) 94%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--logo-edge);
  color: var(--nav-ink);
}
.topbar .btn.ghost { color: var(--nav-ink); }
.topbar .btn.ghost:hover { background: var(--nav-hover); }
/* an account in no campaign (base.html): no side menu, its three links in the bar; a phone keeps the links alone */
.pasek-bez-kampanii .brand { display: none; }
.pasek-bez-kampanii nav { gap: .25rem; }
.topbar.pasek-bez-kampanii .btn[aria-current="page"] .napis { font-weight: 600; text-decoration: underline 2px; text-underline-offset: .35em; }
@media (min-width: 900px) {
  .app:has(> .pasek-bez-kampanii) { padding-left: 0; }
  .pasek-bez-kampanii .brand { display: inline-flex; align-items: center; font-size: 1.2rem; }
}
/* the app's name: the side menu's top, the phone's „Więcej” */
.brand { font-family: var(--font-head); font-weight: 700; white-space: nowrap; }
/* the sigil carries the icon's gap, so the side menu's connection dot sits on the icon's corner, ringed in the menu's
   colour */
.brand .sigil { color: var(--logo-b); position: relative; display: inline-flex; margin-right: .3em; }
.brand .sigil .ikona { margin: 0; }
.brand .sigil .polaczenie { position: absolute; right: -.2rem; bottom: -.15rem; margin: 0; width: .5rem; height: .5rem;
  box-shadow: 0 0 0 2px var(--nav-bg); }
.brand .logo {
  background: linear-gradient(180deg, var(--logo-a) 25%, var(--logo-b) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 1px 0 var(--logo-edge)) drop-shadow(0 -1px 0 var(--logo-edge));
  letter-spacing: .03em;
}
/* the campaign's game system under the app's name: small, so the menu keeps its width */
.brand .marka { display: inline-flex; flex-direction: column; line-height: 1.1; }
.brand .marka-systemu { font-family: var(--font); font-size: .55em; font-weight: 600; letter-spacing: .03em;
  color: var(--nav-muted); }
.menu-wiecej .brand .marka-systemu { color: var(--muted); }

.sidenav { display: none; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--nav-bg); border-top: 2px solid var(--logo-edge);
}
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--nav-muted); text-decoration: none; font-size: .72rem; background: none; border: 0; font-family: inherit;
  cursor: pointer; min-width: 0;
}
.tabbar .ikona.ico { width: 1.45rem; height: 1.45rem; }
.tabbar a.active, .tabbar button.active { color: var(--nav-active); font-weight: 600; }

@media (min-width: 900px) {
  .sidenav {
    display: flex; flex-direction: column;
    position: fixed; top: 0; bottom: 0; left: 0; width: var(--nav-w);
    padding: 1rem .75rem; gap: 2px;
    background: var(--nav-bg); border-right: 2px solid var(--logo-edge); color: var(--nav-ink);
    overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--nav-muted) transparent;  /* a very short window */
  }
  .sidenav .brand { font-family: var(--font-head); font-weight: 700; font-size: 1.35rem; color: var(--nav-ink); text-decoration: none; padding: .25rem .5rem 1rem; }
  .sidenav a, .sidenav button.navlink {
    display: flex; align-items: center; gap: .65rem; width: 100%;
    padding: .5rem .6rem; border-radius: var(--radius-sm);
    color: var(--nav-ink); text-decoration: none; background: none; border: 0; font: inherit; text-align: left; cursor: pointer;
  }
  .sidenav a:hover, .sidenav button.navlink:hover { background: var(--nav-hover); }
  .sidenav a.active { background: var(--nav-active-bg); color: var(--nav-active); font-weight: 600; box-shadow: inset 3px 0 0 var(--nav-active); }
  .sidenav .ikona { width: 1.15rem; height: 1.15rem; opacity: .9; }
  .sidenav .section { margin: 1rem .6rem .25rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--nav-muted); }
  .sidenav .muted, .sidenav .kbd-hint { color: var(--nav-muted); }
  .sidenav .spacer { flex: 1; }
  /* the account row: „Moje konto” with who is logged in, then settings and logout as icons */
  .konto-nav { display: flex; align-items: center; gap: 2px; margin-top: .4rem; padding-top: .5rem;
    border-top: 1px solid color-mix(in srgb, var(--nav-muted) 35%, transparent); }
  .sidenav .konto-nav > a, .konto-gosc { flex: 1; min-width: 0; width: auto; padding-right: .3rem; white-space: nowrap; }
  .konto-gosc { display: flex; align-items: center; gap: .65rem; padding: .5rem .6rem; }
  .konto-nav .grow { overflow: hidden; text-overflow: ellipsis; }
  .sidenav .konto-nav button.navlink { width: auto; padding: .5rem .45rem; }
  /* a laptop with a short window: the same menu, denser, so it still fits without a scrollbar */
  @media (max-height: 860px) {
    .sidenav { padding-top: .6rem; padding-bottom: .6rem; }
    .sidenav .brand { padding-bottom: .6rem; }
    .sidenav a, .sidenav button.navlink { padding-top: .38rem; padding-bottom: .38rem; }
    .sidenav .section { margin-top: .7rem; }
    .kampania-nav { margin-bottom: .6rem; }
    .kampania-nav select { min-height: 34px; padding-top: .25rem; padding-bottom: .25rem; }
  }
  @media (max-height: 740px) {  /* 1366×768 with the browser's bars */
    .sidenav a, .sidenav button.navlink { padding-top: .3rem; padding-bottom: .3rem; }
    .sidenav .section { margin-top: .5rem; }
    .kampania-nav label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  }
  .kampania-nav { margin: -.4rem .5rem .9rem; }
  .kampania-nav label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--nav-muted); margin-bottom: .2rem; }
  .kampania-nav select { width: 100%; background: var(--nav-hover); color: var(--nav-ink); border-color: var(--nav-muted); }
  .kampania-nav select option { color: CanvasText; background: Canvas; }  /* the open list is not dark */
  .app { padding-left: var(--nav-w); }
  .tabbar { display: none; }
  .topbar .tytul-paska { display: none; }  /* the side menu marks the entry; the bar names the page */
  .topbar .tytul-strony { display: block; }
  .topbar .stan-zapisu { display: inline; }
  .naglowek-imie .save-state { display: none; }  /* the sheet's save state moves to the bar */
  .topbar { background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--border); color: var(--ink); }
  .topbar .btn.ghost { color: var(--ink); }
  .topbar .btn.ghost:hover { background: var(--surface-2); }
  .topbar .szukaj-pasek { min-width: 15rem; justify-content: flex-start; gap: .5rem; padding: .3rem .45rem .3rem .65rem;
    border-color: var(--border); background: var(--surface); color: var(--muted); font-weight: 400; }
  .topbar .szukaj-pasek:hover { border-color: var(--muted); background: var(--surface); }
  .topbar .szukaj-pasek .szukaj-napis { display: inline; flex: 1; text-align: left; }
  .topbar .szukaj-pasek kbd { display: inline; font-family: inherit; font-size: .75rem; color: var(--muted); }
  .topbar .btn:is(.popros-pasek, .pd-pasek) { padding: .3rem .65rem; }
  .topbar :is(.popros-pasek, .pd-pasek) .napis { display: inline; }
  .tabs.zakladki-stron { margin: 0 0 1.25rem; padding: 0; }  /* the content's own edge, not the phone's full bleed */
  .main { padding: 24px 32px 96px; }
  /* a scene's page over its map, and the map's own window, keep the menu to icons, the map wider; „Rozwiń menu”
     widens it (base.html, stores/app.js `przelaczMenu`, data-menu set before the first paint) — the names are the
     links' titles */
  .sidenav button.menu-szerokosc { display: none; }
  html:is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav button.menu-szerokosc { display: flex; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) { --nav-w: 64px; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav { padding-inline: .5rem; overflow-x: hidden; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav .brand { justify-content: center; padding: .25rem 0 .8rem; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav :is(.brand .marka, .kampania-nav) { display: none; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav .section {
    height: 1px; margin: .5rem .4rem; overflow: hidden; font-size: 0; background: color-mix(in srgb, var(--nav-muted) 35%, transparent);
  }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav :is(a, button.navlink) { position: relative; justify-content: center; padding-inline: 0; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav :is(a, button.navlink, .konto-gosc) > .grow {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav a .badge { position: absolute; top: 0; right: 2px; padding: 0 .3rem; font-size: .62rem; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav .ikona { width: 1.3rem; height: 1.3rem; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .konto-nav { flex-direction: column; }
  html:not([data-menu]):is(:has(.walka-strona):not(:has(.scena.bez-mapy)), :has(.main > .mapa-okno)) .sidenav :is(.konto-nav > a, .konto-gosc, .konto-nav button.navlink) {
    flex: none; width: 100%; padding-inline: 0; justify-content: center;
  }
}

/* ---- components ------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; box-shadow: var(--shadow);
  border-top: 3px solid var(--krawedz-karty);
}
.card + .card, .stack > * + * { margin-top: 1rem; }
/* in a grid the gap does the spacing; that margin stretched the first tile by its height */
:is(.grid, .grid-2, .grid-auto) > .card + .card { margin-top: 0; }
.card h2, .card h3 { margin-top: 0; }
.card-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2, .card-head h3 { margin: 0; flex: 1; }
/* a „?” (partials/strona.html podpowiedz) stays by its heading, what else the head holds goes right */
.card-head > :is(h2, h3):has(+ .podpowiedz) { flex: 0 1 auto; }
.card-head > .podpowiedz { margin-right: auto; }
.btn.podpowiedz { color: var(--muted); }
.grid { display: grid; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
[hidden] { display: none !important; }  /* .badge and friends set their own display */
.grid-auto { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap > .btn:not(.grow) { flex: none; white-space: nowrap; }  /* „＋ Dodaj” by a field keeps one line */
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.center { text-align: center; }
.hide-mobile { display: none; }
@media (min-width: 700px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 40px; padding: .4rem .85rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  touch-action: manipulation; user-select: none;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:is(.primary, .on) small { color: inherit; opacity: .85; }  /* a note in a chosen button (the creator's swap) */
.btn.danger { color: var(--bad); }
.btn.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, var(--border)); }
.btn.small { min-height: 32px; padding: .2rem .55rem; font-size: .88rem; }
.btn.icon { min-width: 40px; padding: .3rem; }
.btn.small.icon { min-width: 32px; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.big { min-height: 52px; font-size: 1.1rem; padding: .6rem 1.4rem; }
.btn.block { width: 100%; }

input, select, textarea {
  font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .45rem .6rem; min-height: 40px; width: 100%;
}
textarea { min-height: 90px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid color-mix(in srgb, var(--wybor) 60%, transparent); outline-offset: 1px; }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; min-height: 0; accent-color: var(--wybor); }
input[type="range"] { accent-color: var(--wybor); }
/* numbers are typed (or stepped with the − / + buttons), the tiny spinner arrows only get in the way on a phone */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input.num { width: 4.2rem; text-align: center; padding-left: .2rem; padding-right: .2rem; }
input.num-s { width: 3.2rem; text-align: center; padding-left: .1rem; padding-right: .1rem; }
input.inline, textarea.inline { border-color: transparent; background: transparent; }
input.inline:hover, textarea.inline:hover { border-color: var(--border); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
label.check { display: inline-flex; align-items: center; gap: .4rem; color: var(--ink); font-size: .95rem; cursor: pointer; margin: 0; }
label.check > input { flex: none; }  /* a label of two lines does not squeeze its box */
.field { margin-bottom: .75rem; }
.fields { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
/* a section's values as text while its pencil is off (partials/strona.html edycja_sekcji), laid out like its fields */
dl.fields { margin: 0; }
dl.fields dt { font-size: .85rem; color: var(--muted); margin-bottom: .2rem; }
dl.fields dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.badge {
  display: inline-block; padding: .05rem .45rem; border-radius: 999px;
  font-size: .75rem; font-weight: 600; line-height: 1.5;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border);
  white-space: nowrap;
}
button.badge { cursor: pointer; font-family: inherit; position: relative; }
/* a badge is ~20 px tall: a finger gets 28+ px around it, the layout stays */
button.badge::after { content: ""; position: absolute; inset: -5px -3px; }
button.badge:disabled { cursor: default; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
/* a Creature Trait an effect gives: outlined, next to the effect's filled chip */
.badge.cecha-efektu { background: transparent; color: var(--accent); border-color: var(--accent); }
.badge.cecha-efektu.sytuacyjna { border-style: dashed; }  /* only when it fits (a Ward against magic) */
/* a creature's own trait, the GM's chip (partials/cechy_stworzen.html): a reminder in ink, what the app applies muted
   with its cog; „+N” shows the rest */
.badge.cecha-stworzenia { color: var(--ink); font-weight: 500; cursor: pointer; }
.badge.cecha-stworzenia.automat { color: var(--muted); }
.badge.wiecej-cech { background: transparent; border-style: dashed; cursor: pointer; }
/* a manifested mutation, the GM's chip in the tracker: Chaos green, its kind's icon */
.badge.chip-mutacji { background: var(--chaos-soft); color: var(--chaos); border-color: var(--chaos); font-weight: 500; }
/* an NPC's talent (npc.html), the trait chip's sibling with room for ✕: a reminder in ink, what the app applies muted
   with its cog, a name talenty.csv lacks in warning colours */
.talenty-npc { display: flex; flex-wrap: wrap; gap: .35rem; }
.talent-npc {
  display: inline-flex; max-width: 100%; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font-size: .85rem; line-height: 1.25;
}
.talent-npc > button {
  display: inline-flex; align-items: center; gap: .3rem; min-width: 0; min-height: 32px; padding: .2rem .3rem .2rem .7rem;
  background: none; border: 0; border-radius: 999px 0 0 999px; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.talent-npc > button.usun { padding: 0 .65rem 0 .4rem; border-radius: 0 999px 999px 0; color: var(--muted); }
.talent-npc > button:only-child { padding-right: .7rem; border-radius: 999px; }  /* an effect's: no ✕ */
.talent-npc > button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.talent-npc > button.usun:hover { color: var(--bad); }
.talent-npc.automat { color: var(--muted); }
.talent-npc.nieznany { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.teal { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.badge.gold { color: var(--gold); border-color: var(--gold); background: transparent; }
.badge.dodaj-efekt { background: transparent; border-style: dashed; cursor: pointer; }  /* „＋ Efekt” in the header */

.alert { padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--info-soft); margin-bottom: 1rem; }
.alert.bad { background: var(--bad-soft); color: var(--bad); }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.ok { background: var(--ok-soft); color: var(--ok); }

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-bottom: 1px solid var(--border); }
.list > li:last-child { border-bottom: 0; }
.list-link { display: flex; align-items: center; gap: .6rem; padding: .7rem .2rem; color: var(--ink); text-decoration: none; }
.list-link:hover { background: var(--surface-2); }
.list-link .title { font-weight: 600; }
.list-link.moja { border-left: 3px solid var(--gold); padding-left: .5rem; background: color-mix(in srgb, var(--gold) 10%, transparent); }

table.t { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.t th, table.t td { padding: .35rem .4rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
table.t th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
table.t td.n, table.t th.n { text-align: center; white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.hl td { background: var(--wybor-soft); font-weight: 600; }
.table-wrap { overflow-x: auto; margin: 0 -.25rem; padding: 0 .25rem; }

details.acc { border-bottom: 1px solid var(--border); }
details.acc > summary {
  list-style: none; cursor: pointer; padding: .7rem .2rem; display: flex; align-items: center; gap: .5rem;
  flex-wrap: wrap;  /* a row of badges must wrap on a phone instead of pushing the page sideways */
}
details.acc > summary > * { min-width: 0; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.acc[open] > summary::before { transform: rotate(90deg); }
details.acc > .acc-body { padding: 0 .2rem .9rem 1.2rem; }
details.wpis-dziennika { scroll-margin-top: calc(var(--topbar-h, 58px) + .5rem); }  /* a Ctrl K link's entry, under the bar */
.prose :first-child { margin-top: 0; }
.prose :last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose :is(h1, h2, h3, h4) { margin-top: 1em; }  /* a heading stands off the text above it */
.prose > :is(ul, ol) { margin: 0 0 .75em; }  /* like a paragraph, also inside a list (the plan's points) that zeroes it */
/* a link to the story's thing (app/odnosniki.py): the text's own colour, underlined in gold like a tracker's name */
.prose a.odnosnik { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold);
                    text-decoration-thickness: 2px; text-underline-offset: 3px; }
.prose a.odnosnik:hover { color: var(--accent); }
.odnosnik-brak { color: var(--muted); text-decoration: line-through; }  /* the GM's: what it led to is deleted */

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--border); margin: 0 -16px 1rem; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs :is(button, a) {
  background: none; border: 0; border-bottom: 3px solid transparent; padding: .6rem .7rem; font: inherit;
  color: var(--muted); cursor: pointer; white-space: nowrap; text-decoration: none;
}
.tabs :is(button, a).active { color: var(--ink); border-bottom-color: var(--wybor); font-weight: 600; }
/* A row scrolling sideways with no scrollbar (`.tabs`, a participant's chips on a touch screen) fades on the side where
   more waits: the right edge at the start, the left one at the end, both in between. A scroll-driven animation; without
   one, or when the row fits, there is simply no fade. The mask cuts whatever is drawn past the row's box. */
@property --zanik-lewy { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --zanik-prawy { syntax: "<length>"; inherits: false; initial-value: 0px; }
@keyframes zanik-bokow {
  0% { --zanik-lewy: 0px; --zanik-prawy: 2.5rem; } 15% { --zanik-lewy: 2.5rem; }
  85% { --zanik-prawy: 2.5rem; } 100% { --zanik-lewy: 2.5rem; --zanik-prawy: 0px; }
}
.zanik-bokow { mask-image: linear-gradient(to right, transparent, #000 var(--zanik-lewy), #000 calc(100% - var(--zanik-prawy)), transparent); }
@supports (animation-timeline: scroll()) {
  .zanik-bokow { animation: zanik-bokow linear both; animation-timeline: scroll(self inline); }
}
/* tabs that are pages of their own (the GM's „Gracze i kampanie”) */
.zakladki-stron a { display: inline-flex; align-items: center; gap: .45rem; }
.zakladki-stron a:hover { color: var(--ink); }
.zakladki-stron .ikona { width: 1.1rem; height: 1.1rem; }
@media (max-width: 480px) {  /* all three names on a phone's width */
  .zakladki-stron a { padding-left: .5rem; padding-right: .5rem; }
  .zakladki-stron .ikona { display: none; }
}
.szukaj-pasek .szukaj-napis, .szukaj-pasek kbd, .popros-pasek .napis, .pd-pasek .napis { display: none; }  /* a phone: the icon alone */
/* a phone's full bar: the cheat sheet's button takes the magnifier's place („Szukaj” is in „Więcej”) */
@media (max-width: 899px) { .topbar:has(.otworz-sciage) .szukaj-pasek { display: none; } }
/* the GM's bar on a narrow phone has two buttons more (a request, „＋ PD”): tighter, so the date and the settlement
   keep their names */
@media (max-width: 389px) {
  .topbar:has(.pd-pasek) { gap: .3rem; }
  .topbar:has(.pd-pasek) > .btn.icon { min-width: 36px; padding-inline: .2rem; }
}

.stat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: .45rem .3rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  min-width: 0;
}
.stat .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stat .val { font-size: 1.35rem; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: .75rem; color: var(--muted); }
.stat .sub.zmieniony { color: var(--warn); }  /* a Condition or an effect moves the value now (an NPC's Movement) */
.stat .val.slowo { font-size: 1rem; line-height: 1.6; }  /* a word, not a number (an NPC's Size, build) */
/* a tile as tall as a button beside it (the roll dialog's threshold by „Test | Kości”) */
.stat.w-linii { flex-direction: row; align-items: baseline; gap: .4rem; padding: .15rem .65rem; min-height: 36px; }
.stat.w-linii .val { font-size: 1.2rem; }
/* a low tile, three in a row on a 360 px phone (the sheet's Movement): the label still above the value */
.stat.niski { padding: .2rem .3rem; }
.stat.niski .val { font-size: 1.1rem; }
.stepper { display: inline-flex; align-items: center; gap: .15rem; }
.stepper .btn { min-width: 34px; min-height: 34px; padding: 0; font-size: 1.1rem; }
.stepper .v { min-width: 2.2rem; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

/* characteristics grid on the sheet */
.cechy { display: grid; grid-template-columns: repeat(5, 1fr); gap: .45rem; }
@media (max-width: 420px) { .cechy { grid-template-columns: repeat(5, 1fr); gap: .3rem; } }
.cecha { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; position: relative; }
.cecha:has(.cecha-rzut:enabled:hover) { border-color: var(--wybor); }
.cecha-rzut {
  display: flex; flex-direction: column; align-items: center; width: 100%; padding: .35rem .2rem;
  background: none; border: 0; border-radius: inherit; font: inherit; color: inherit; cursor: pointer;
}
.cecha-rzut:disabled { cursor: default; }
.cecha > div { padding: 0 .2rem .3rem; }
.cecha .kod { font-size: .78rem; font-weight: 700; color: var(--muted); }
.cecha .w { font-size: 1.45rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cecha .b { font-size: .72rem; color: var(--muted); }
.cecha.prof::after { content: "●"; position: absolute; top: 2px; right: 5px; font-size: .6rem; color: var(--gold); }

.skill-row { display: flex; align-items: center; gap: .4rem; padding: .35rem 0; border-bottom: 1px solid var(--border); }
.skill-row:last-child { border-bottom: 0; }
.skill-row .name { flex: 1; min-width: 0; }
.skill-row .name button { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
.skill-row .name button:hover { text-decoration: underline; }
.dot-prof { color: var(--gold); font-size: .7rem; }
.dim { opacity: .55; }

/* compact skill grid */
.cells { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.cells.edycja { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
@media (max-width: 480px) {
  .cells { grid-template-columns: 1fr 1fr; gap: .3rem; }
  .cells.edycja { grid-template-columns: 1fr; }
  .cell { padding-left: .4rem; }
  :is(.cell-name > span, div.cell-name > button:not(.notatka)) { font-size: .84rem; }
  .cell-val { min-width: 2.5rem; font-size: 1rem; }
}
.cell {
  display: flex; align-items: center; gap: .3rem; min-width: 0;
  padding: .2rem .2rem .2rem .5rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
}
.cell.grupowa { border-style: dashed; }  /* „Skradanie (…)”: the Specialisations the card lacks (5e s. 110) */
.cell.prof { border-left: 3px solid var(--gold); }
.cell-name {
  flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2;
  background: none; border: 0; padding: .15rem 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.cell-name > span { font-size: .92rem; overflow-wrap: break-word; hyphens: auto; }
.cell-name small { font-size: .72rem; }
.cell-name:hover > span { text-decoration: underline; }
/* an NPC's skill (npc.html): the name and the Creature Trait it comes from, each a button opening its description */
div.cell-name { cursor: auto; padding: 0; }
div.cell-name > button {
  background: none; border: 0; padding: .15rem 0; font: inherit; font-size: .92rem; color: var(--ink); text-align: left;
  cursor: pointer; overflow-wrap: break-word; hyphens: auto;
}
div.cell-name > button.notatka { padding: 0; font-size: .72rem; font-style: italic; color: var(--muted); }
div.cell-name > button:hover { text-decoration: underline; }
.cell-val { min-width: 2.9rem; min-height: 36px; padding: .1rem .3rem; font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
/* the sheet: an advanced skill (rolled most) has its value marked */
.cell.rozw .cell-val { border: 1.5px solid color-mix(in srgb, var(--ink) 55%, var(--border)); font-weight: 800; }
.cell .stepper .btn { min-width: 28px; min-height: 28px; font-size: 1rem; }
.cell .stepper .v { min-width: 1.5rem; }

/* the sheet's gear (karta.html „Wyposażenie”, wyposazenie.js): sections by place — „Założone”, „Luzem”, a framed box a
   container, „Zostawione” folded and greyed with weapons and armour. A row on one line as the weapons' (.karta-akcji):
   the name and badges, „×3”, Encumbrance, the pencil (−/+ and „Gdzie” in its panel); the note and price beside the
   name from 1200 px. Two columns (the boxes at the right) once the card is 46rem wide: a column of rows each, so an open
   panel moves nothing beside it */
.karta-wyposazenia { container-type: inline-size; }
.wyposazenie-uklad, .wyposazenie-kolumna { display: grid; gap: .9rem; align-content: start; }
@container (min-width: 46rem) {
  .wyposazenie-uklad.z-pojemnikami { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: start; }
}
.naglowek-wyposazenia { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.naglowek-wyposazenia h4.grupa-wyposazenia { margin: 0; }
h4.grupa-wyposazenia .ikona { margin-right: .3em; }
.karta-akcji.przedmiot { padding: .3rem 0; }
.przedmiot .karta-akcji-glowa { gap: .3rem; min-height: 34px; }
.przedmiot .karta-akcji-glowa > .grow { overflow-wrap: anywhere; }  /* a long word on a 360 px phone breaks, not overlaps */
@media (max-width: 420px) { .przedmiot .karta-akcji-glowa > .grow { font-size: .93rem; } }
.przedmiot .karta-akcji-glowa > .btn.icon { min-width: 30px; padding: .15rem; }
.przedmiot .karta-akcji-glowa > .btn.icon:not(.on) { color: var(--muted); }
.ilosc-przedmiotu { flex: none; min-width: 2.1rem; min-height: 28px; padding: 0 .35rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: inherit; font-size: .85rem;
  font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
@media (hover: hover) { .ilosc-przedmiotu:not(:disabled):hover { border-color: var(--muted); } }
.ilosc-przedmiotu:disabled { border-color: transparent; background: none; cursor: default; }  /* someone else's card: text */
.obciazenie-przedmiotu { flex: none; min-width: 2.1rem; text-align: right; font-size: .78rem; color: var(--muted); white-space: nowrap; }
/* „Wypij”: the „Użyj” dialog; a long verb („Podsuń pod nos”) wraps inside on a 360 px phone, not over „×3” */
.przedmiot .przycisk-uzycia { flex: 0 1 auto; max-width: 100%; min-height: 30px; padding: .15rem .5rem; font-size: .85rem; white-space: normal; }
.lista-uzycia { margin: 0; padding-left: 1.1rem; }
.lista-uzycia li + li { margin-top: .2rem; }
.dopisek-przedmiotu { display: none; margin: 0 0 0 .3rem; }
@media (min-width: 1200px) { .dopisek-przedmiotu { display: inline; } }
.zostawiony .karta-akcji-glowa > .grow { opacity: .6; }
.pole-gdzie { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-size: .88rem; color: var(--muted); }
.pole-gdzie select { width: auto; min-width: 9rem; color: var(--ink); }
/* a container's box: the header row on --surface-2 (its icon, „założony”, the capacity bar, ▾), what it holds below */
.pojemnik-ramka { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.pojemnik-ramka.ponad { border-color: color-mix(in srgb, var(--bad) 55%, var(--border)); }
.karta-akcji.glowa-pojemnika { padding: .35rem .3rem .35rem .55rem; border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: var(--surface-2); }
.glowa-pojemnika .karta-akcji-glowa > .ikona { color: var(--muted); }
.glowa-pojemnika .karta-akcji-glowa > .grow > :first-child { font-weight: 600; }
.glowa-pojemnika > .karta-akcji-edycja { background: var(--surface); }
.glowa-pojemnika .galaz-rozwin { flex: none; width: 1.5rem; height: 1.75rem; }
.glowa-pojemnika .obciazenie-przedmiotu { margin-left: .5rem; }  /* its own weight apart from „2/4 Obc.” inside */
/* the encumbrance bar (pasek_udzwigu): a part a kind of gear in its colour; in a kind's own card the others grey, its
   legend bold; past the capacity a red edge and a mark where the capacity ends */
.pasek-zyw.czesci-obciazenia { position: relative; display: inline-flex; }  /* over .pasek-zyw, written later */
.pasek-zyw.czesci-obciazenia.ponad { border-color: var(--bad); }
.czesci-obciazenia > span { flex: none; transition: width .3s; }
.obc-bron { --obc: var(--obc-bron); }
.obc-pancerz { --obc: var(--obc-pancerz); }
.obc-wyposazenie { --obc: var(--obc-wyposazenie); }
.obc-monety { --obc: var(--obc-monety); }
.przygaszona:not(.wlasna) { --obc: color-mix(in srgb, var(--muted) 55%, var(--surface-2)); }
.czesci-obciazenia > span { background: var(--obc); }
.czesci-obciazenia > span + span { box-shadow: inset 1px 0 0 var(--surface); }  /* a hairline between two kinds */
.granica-udzwigu { position: absolute; top: -1px; bottom: -1px; width: 2px; margin-left: -1px; background: var(--bad); }
.legenda-obciazenia { display: inline-flex; flex-wrap: wrap; gap: .1rem .7rem; font-size: .78rem; color: var(--muted); }
.legenda-obciazenia > span { white-space: nowrap; }
.legenda-obciazenia > span::before { content: ""; display: inline-block; width: .6rem; height: .6rem; margin-right: .3rem;
  border-radius: 2px; background: var(--obc); vertical-align: -.02rem; }
.legenda-obciazenia > .wlasna { color: var(--ink); font-weight: 600; }
.zapelnienie { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; color: var(--muted); white-space: nowrap; }
.zapelnienie.text-bad { color: var(--bad); font-weight: 600; }
.zapelnienie .pasek-zyw { width: 3rem; height: 6px; }
.pojemnik-zawartosc { padding: 0 .55rem; border-top: 1px solid var(--border); }
.pojemnik-pusty { margin: .45rem 0; font-size: .88rem; font-style: italic; }
details.zostawione > summary { margin-top: .4rem; }
details.zostawione > .karta-akcji:first-of-type { border-top: 0; }
details.zostawione > .pojemnik-ramka { margin: .5rem 0; }
/* dragging a thing onto a place (wyposazenie.js `chwyc`): the grip at a row's left (a finger's only hold: it does not
   scroll), the row left faded, a ghost of its line under the pointer, every place it may go dashed, the one under the
   pointer lit ([data-upusc], the folders' too) */
.uchwyt { flex: none; display: grid; place-items: center; width: 22px; min-height: 30px; margin: 0 -.15rem 0 -.3rem;
  color: var(--muted); opacity: .6; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; }
.uchwyt .ikona { width: 1.05rem; height: 1.05rem; margin: 0; }
@media (hover: hover) {
  .karta-wyposazenia:not(.przeciaganie) .przedmiot > .karta-akcji-glowa:hover > .uchwyt { opacity: 1; color: var(--ink); }
}
.przedmiot.ciagniety:not(.glowa-pojemnika), .pojemnik-ramka:has(> .glowa-pojemnika.ciagniety) { opacity: .35; }
html.ciagniecie, html.ciagniecie * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.duch-przedmiotu { position: fixed; left: 0; top: 0; z-index: 70; margin: 0; padding: .3rem .5rem; pointer-events: none;
  border: 1px solid var(--wybor); border-radius: var(--radius-sm); background: var(--surface); opacity: .95;
  box-shadow: 0 2px 4px rgb(20 35 40 / 14%), 0 12px 28px rgb(20 35 40 / 22%); }
.duch-przedmiotu .uchwyt { opacity: 1; color: var(--wybor); }
.przeciaganie .cel-upuszczenia { outline: 1.5px dashed color-mix(in srgb, var(--wybor) 55%, transparent); outline-offset: 4px;
  border-radius: var(--radius-sm); }
.przeciaganie .cel-upuszczenia[data-upusc] { outline: 2px solid var(--wybor); background: var(--wybor-soft);
  box-shadow: 0 0 0 4px var(--wybor-soft); }  /* the tint reaches the outline */
.upusc-tutaj { margin: .2rem 0 .4rem; padding: .55rem; border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: .88rem; font-style: italic; text-align: center; }
.btn.done { border-color: var(--gold); color: var(--gold); opacity: 1; }

.ticks { display: flex; flex-wrap: wrap; gap: 4px; }
.tick { width: 22px; height: 22px; border-radius: 4px; border: 1.5px solid var(--border); background: var(--surface); }
.tick.on { background: linear-gradient(180deg, var(--logo-a), var(--logo-b)); border-color: var(--logo-edge); }

.silhouette { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }

/* ---- dialogs ------------------------------------------------------------------------ */
.overlay {
  position: fixed; inset: 0; z-index: 60; background: rgb(10 6 3 / 45%);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 700px) { .overlay { align-items: center; padding: 1rem; } }
.sheet {
  background: var(--surface); color: var(--ink); width: 100%; max-width: 560px;
  max-height: calc(92dvh / var(--zoom)); overflow-y: auto; overscroll-behavior: contain; scroll-padding-bottom: 5.5rem;
  border-radius: 16px 16px 0 0; padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .sheet { border-radius: 14px; } }
.sheet.wide { max-width: 760px; }
.sheet-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .75rem; }
/* the main action of a dialog stays at the bottom edge while the sheet scrolls */
.sheet-foot {
  position: sticky; bottom: calc(-1rem - env(safe-area-inset-bottom)); z-index: 2;
  margin: .75rem -1rem calc(-1rem - env(safe-area-inset-bottom));
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--border);
}
.sheet .razem { margin: .4rem 0 .5rem; }
#rzut-wynik { scroll-margin-top: .5rem; }
.sheet details.wiecej { margin-bottom: 0; padding-top: .35rem; padding-bottom: .35rem; }
.sheet details.wiecej > summary { padding: .3rem .2rem; }
.sheet-head h2 { margin: 0; flex: 1; font-size: 1.2rem; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: .35rem .7rem; font: inherit; cursor: pointer; color: var(--muted); min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }

.hint { display: flex; align-items: center; gap: .5rem; padding: .35rem .5rem; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: .3rem; font-size: .92rem; }
.hint.off { opacity: .5; text-decoration: line-through; }

/* roll result */
.roll { border-radius: var(--radius); padding: .8rem; border: 1px solid var(--border); background: var(--surface-2); }
.roll.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: var(--ok-soft); }
.roll.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.roll .big { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.roll .dice { font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.roll .sl { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.roll .liczba { display: inline-flex; flex-direction: column; align-items: center; line-height: 1; }
.roll .liczba small { margin-top: 3px; font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.roll details.detail > summary { cursor: pointer; }
.roll .verdict { font-weight: 700; }
.roll .detail { font-size: .88rem; color: var(--muted); margin-top: .3rem; }
.roll .extra { margin-top: .5rem; font-size: .95rem; }
.roll .extra > div + div { margin-top: .2rem; }
.roll-compact { display: flex; gap: .6rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--border); }
.roll-compact:last-child { border-bottom: 0; }
.roll-compact .res { min-width: 3.2rem; text-align: center; font-weight: 800; font-size: 1.1rem; border-radius: var(--radius-sm); padding: .1rem .2rem; }
.res.ok { background: var(--ok-soft); color: var(--ok); }
.res.bad { background: var(--bad-soft); color: var(--bad); }
.res.neutral { background: var(--surface-2); }

/* floating dice button */
.fab {
  position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); z-index: 45;
  width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: var(--nav-bg); color: var(--nav-ink); font-size: 1.6rem;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nav-ink) 22%, transparent), 0 4px 14px rgb(0 0 0 / 28%); cursor: pointer;
}
@media (min-width: 900px) { .fab { bottom: 24px; right: 24px; } }
/* the battle map's own window (not the chronicle's map dialog, also `.mapa-okno`): over the zoom at the map's
   bottom right */
body:has(.main > .mapa-okno) .fab { bottom: calc(var(--tabbar-h) + 128px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) { body:has(.main > .mapa-okno) .fab { bottom: 128px; } }
.fab:hover { filter: brightness(1.15); }

/* 3D dice layer: kept laid out (visibility, not display) so the WebGL canvas keeps its size */
.kosci-3d {
  position: fixed; inset: 0; z-index: 70; pointer-events: none;
  visibility: hidden; opacity: 0; transition: opacity .25s ease, visibility 0s linear .25s;
}
.kosci-3d.widoczne {
  visibility: visible; opacity: 1; pointer-events: auto; cursor: pointer; transition: opacity .15s ease;
  background: radial-gradient(ellipse at center, rgb(8 14 16 / 12%), rgb(8 14 16 / 45%));
}
/* someone else's roll: the dice fly over the page, which stays usable */
.kosci-3d.widoczne.cudzy { pointer-events: none; cursor: default; background: radial-gradient(ellipse at center, transparent, rgb(8 14 16 / 22%)); }
.kosci-3d canvas { display: block; }

/* toasts at the top, the newest first (a tap takes one away): a phone's bottom holds the bar, the dice and the tracker's
   panel, and the sheet's header sticks under its top bar, so there they lie over the bar itself; a wide screen's under it */
.toasts {
  position: fixed; right: 12px; left: 12px; top: calc(6px + env(safe-area-inset-top)); z-index: 80;
  display: flex; flex-direction: column; gap: .5rem; pointer-events: none; align-items: flex-end;
}
@media (min-width: 900px) { .toasts { top: calc(var(--topbar-h, 58px) + 8px); } }
/* a scene's page, wide: at the bottom left over the map or the rows (above the map's tools), the newest at the edge —
   the bar's right end holds the GM's „Następna tura”, the right side the participant's panel; a phone's stay over the
   top bar */
@media (min-width: 900px) {
  body:has(.walka-strona) .toasts { top: auto; bottom: 4.5rem; left: calc(var(--nav-w) + 16px); right: auto; width: 380px;
    flex-direction: column-reverse; align-items: stretch; }
}
.toast {
  pointer-events: auto; max-width: 380px; width: 100%;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--teal);
  border-radius: var(--radius-sm); padding: .55rem .7rem; box-shadow: var(--shadow); font-size: .92rem;
}
.toast.ok { border-left-color: var(--ok); }
.toast.bad { border-left-color: var(--bad); }
.toast.warn { border-left-color: var(--warn); }
.toast.z-akcja { display: flex; align-items: center; gap: .6rem; justify-content: space-between; }

/* palette */
.palette-results { max-height: calc(55dvh / var(--zoom)); overflow-y: auto; margin-top: .5rem; }
.palette-results a { cursor: pointer; display: flex; gap: .5rem; align-items: center; padding: .55rem .5rem; border-radius: var(--radius-sm); color: var(--ink); text-decoration: none; }
.palette-results a.sel, .palette-results a:hover { background: var(--wybor-soft); }

.save-state { font-size: .78rem; color: var(--muted); min-width: 5.5rem; text-align: right; }
.save-state.err { color: var(--bad); }

.empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.qr svg { width: min(320px, calc(80vw / var(--zoom))); height: auto; background: #fff; border-radius: 8px; padding: 6px; }
.kbd-hint { font-size: .75rem; color: var(--muted); }
.problem-blad { color: var(--bad); }
.problem-ostrzezenie { color: var(--warn); }
.spinner.zajete { opacity: 1; }
.spinner { opacity: 0; transition: opacity .2s; }

/* ---- combat tracker ---------------------------------------------------------------------- */
/* the GM's countdowns in the scene's bar: a chip each (a phone's the clock and the Rounds), its −/+ and „Usuń” a tap
   away in its menu */
.chip-licznika { display: inline-flex; align-items: center; gap: .3rem; max-width: 14rem; padding: .15rem .55rem;
  font-size: .85rem; color: var(--ink); }
.chip-licznika > span { overflow: hidden; text-overflow: ellipsis; }
.chip-licznika .ikona { margin-right: 0; color: var(--muted); }
.menu-tytul { display: block; padding: .45rem .6rem .2rem; }
.menu-kroki { padding: .2rem .6rem .35rem; }
.licznik-sceny .stepper .v { white-space: nowrap; padding: 0 .3rem; }  /* „za 12 rund” on one line */
/* the scene's name in its bar; the GM's is a field: a dashed line under it and a pencil say it can be typed over */
.nazwa-sceny { display: flex; align-items: center; gap: .3rem; flex: 1 1 10rem; min-width: 0; margin: 0; cursor: text;
  font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
h1.nazwa-sceny { display: block; cursor: auto; }
.nazwa-sceny input { flex: 1; min-width: 0; font-size: inherit; border-radius: 0; border-bottom: 1px dashed var(--muted); }
.nazwa-sceny input:hover, .nazwa-sceny input:focus { border-bottom-style: solid; }
.walka-box { padding: .55rem .6rem; border-radius: var(--radius-sm); background: var(--accent-soft); }
/* the heading line: what the chips pick, the scene and its round after it (cut short on a phone) */
.walka-box .etykieta-pola { font-size: 1rem; color: var(--accent); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walka-box .etykieta-pola small { font-weight: 400; }
/* Qualities and Flaws in a fight (partials/cechy_oreza.html cechy_walki): one line of names folded, chips open */
details.cechy-walki { font-size: .85rem; margin: 0 0 .5rem; }
details.cechy-walki > summary {
  list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: .4rem; min-width: 0; padding: .1rem 0;
}
details.cechy-walki > summary::-webkit-details-marker { display: none; }
details.cechy-walki > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.cechy-walki[open] > summary::before { transform: rotate(90deg); }
.cechy-walki .tytul { color: var(--muted); font-weight: 600; white-space: nowrap; }
.cechy-walki .skrot { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cechy-walki[open] .skrot { display: none; }
.cechy-walki .wada { color: var(--warn); }
.cechy-walki .siatka {
  display: grid; grid-template-columns: minmax(4rem, max-content) 1fr; gap: .3rem .5rem; align-items: center;
  padding: .3rem 0 0 1.05rem;
}
.cechy-walki .wiersz { display: contents; }
.cechy-walki .wiersz .nazwa { color: var(--muted); overflow-wrap: anywhere; }
.cechy-walki .chipy { display: flex; flex-wrap: wrap; gap: .3rem; }

/* ---- roll dialog: difficulty chips, scene targets, the folded configuration, the result's actions ---- */
.trudnosci { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.8rem, 1fr)); gap: .3rem; }
/* „Problematyczny” fits three to a row on a phone */
.trudnosci button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 46px; padding: .3rem .2rem; line-height: 1.15;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--ink); font: inherit; font-size: .86rem; cursor: pointer; touch-action: manipulation;
}
.trudnosci button span { max-width: 100%; overflow-wrap: anywhere; }
.trudnosci button small { font-size: .74rem; color: var(--muted); }
.trudnosci button:hover { border-color: var(--wybor); }
.trudnosci button.on { border-color: var(--wybor); background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }
/* a phone: the roll dialog's difficulty chips in smaller type, the name over the SL, stretched over two rows */
@media (max-width: 699px) {
  .trudnosci.zwarte { display: flex; flex-wrap: wrap; }
  .trudnosci.zwarte button { flex: 1 1 auto; min-height: 38px; padding: .15rem .3rem; font-size: .82rem; white-space: nowrap; }
  .trudnosci.zwarte button small { font-size: .7rem; }
}
.podsumowanie-rzutu {
  display: block; width: 100%; margin-bottom: .6rem; padding: .4rem .6rem;
  border: 1px dashed var(--border); border-radius: var(--radius-sm); background: transparent;
  color: var(--ink); font: inherit; font-size: .9rem; text-align: left; cursor: pointer;
}
.podsumowanie-rzutu:disabled { cursor: default; }
.stepery-rzutu { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.9rem, 1fr)); gap: .5rem .75rem; }
.stepery-rzutu label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.akcje-wyniku { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }
.akcje-wyniku:not(:has(> :not(template))) { display: none; }
/* the attack going on under a scene's result (stores/rzut/walka.js): the defence awaited, a row per hit with its state
   or its one button, its Critical Wounds under it */
.ciag-ataku { display: grid; gap: .5rem; padding: .5rem .75rem; border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); }
.ciag-ataku > .btn { justify-self: start; }
.ciag-obrona { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--muted); }
.ciag-wiersz + .ciag-wiersz { padding-top: .5rem; border-top: 1px solid var(--border); }
.ciag-wiersz.przepadlo { opacity: .6; }
.ciag-cel { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ciag-cel small { color: var(--muted); font-size: .8rem; }
.ciag-stan { font-weight: 700; }
.trafienie { padding: .55rem 0; border-bottom: 1px solid var(--border); }
.trafienie:last-child { border-bottom: 0; }
.trafienie.zadane { opacity: .7; }
.uczestnik { display: flex; gap: .5rem; align-items: flex-start; padding: .45rem .4rem; border-bottom: 1px solid var(--border); border-left: 4px solid transparent; }
.uczestnik:last-child { border-bottom: 0; }
.uczestnik.wrog { border-left-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.uczestnik.postronny { border-left-color: color-mix(in srgb, var(--postronni) 60%, transparent); }
.uczestnik.aktywny { background: var(--wybor-soft); border-left-color: var(--wybor); border-radius: var(--radius-sm); }
.uczestnik.moj .nazwa { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }
/* one's own characters must jump out of the list at a glance, and their turn is the red alarm */
.uczestnik.moj { background: color-mix(in srgb, var(--gold) 12%, transparent); border-left-color: var(--gold); }
.uczestnik.moj.aktywny { background: var(--accent-soft); border-left-color: var(--gold); }
.uczestnik.wylaczony { opacity: .5; }
/* „Bez mapy”: a tap picks the row for the panel (walka.html), the one in it marked as in the queue */
.uczestnik.wybieralny { cursor: pointer; }
.uczestnik.w-panelu { box-shadow: inset -3px 0 0 var(--wybor); }
.uczestnik .ini { min-width: 2.5rem; text-align: center; }
.uczestnik .ini .v { font-size: 1.4rem; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.uczestnik .nazwa { font-weight: 700; font-size: 1.02rem; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* a player's NPC whose Chronicle person is revealed: the name opens the entry */
.uczestnik button.nazwa { padding: 0; border: 0; background: none; font-family: inherit; text-align: left; cursor: pointer;
  text-decoration: underline dotted; text-underline-offset: 3px; min-height: 32px; }
.uczestnik .strzalka { color: var(--wybor); font-weight: 800; }
.uczestnik .strzalka .ikona { fill: currentColor; }  /* the one taking its turn: a filled triangle */
.u-glowa { display: flex; align-items: center; gap: .4rem; min-width: 0; min-height: 32px; }
.zdrowie { display: inline-flex; align-items: center; gap: .3rem; flex: none; font-size: .9rem; font-variant-numeric: tabular-nums; }
.pasek-zyw { display: inline-block; width: 3.4rem; height: 7px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.pasek-zyw > span { display: block; height: 100%; transition: width .3s; }
.pasek-zyw .ok { background: var(--ok); }
.pasek-zyw .warn { background: var(--gold); }
.pasek-zyw .bad { background: var(--bad); }
.uczestnik .znaczniki { gap: .25rem; margin-top: .1rem; }
.znaczniki .badge { white-space: normal; }  /* a long one (Frenzy's effect) wraps on a phone instead of widening the page */
/* Movement by the Wounds: „Sz 4 · 8/16 m” (a phone keeps „Sz 4”), gold while a Condition or an effect moves it */
.ruch-u { display: inline-flex; align-items: center; gap: .35rem; flex: none; min-height: 28px; padding: 0 .25rem; border: 0;
  border-radius: 6px; background: none; color: var(--muted); font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums; cursor: pointer; }
.ruch-u:hover { background: var(--surface-2); }
.ruch-u.zmieniony, .ruch-panel .zmieniony { color: var(--warn); }
.ruch-panel { gap: .3rem .5rem; margin: .5rem 0 0; font-size: .9rem; }
@media (max-width: 520px) { .ruch-u .ruch-m { display: none; } }
/* A participant's action chips in the panel (partials/panel_postaci.html): they wrap onto more lines, a row scrolling
   sideways hid its last chips (the wheel scrolls down and there is no scrollbar to see) */
.akcje { gap: .3rem; }
.chip-grupa { display: inline-flex; gap: .2rem; flex: none; max-width: 100%; }
/* spells and prayers: their chips flow in the row; on a narrow screen enough of them hide behind one „Modlitwy (6) ▾” */
.grupa-czarow { display: contents; }
.grupa-czarow > .grupa-przelacz { display: none; }
@media (max-width: 699px) {
  .grupa-czarow.zwijana > .grupa-przelacz { display: inline-flex; }
  .grupa-czarow.zwijana:not(.rozwinieta) > .chip-akcji:not(.grupa-przelacz) { display: none; }
}
.btn.chip-akcji { flex: none; min-height: 34px; border-radius: 999px; white-space: nowrap; max-width: 100%; }
/* a chip longer than the row (a spell with its Conditions) breaks its text instead of running out of the row */
.panel-postaci .akcje .btn.chip-akcji { white-space: normal; text-align: left; }
.wiecej { margin-top: .5rem; padding: .6rem; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.wiecej > * + * { margin-top: .5rem; }
.wiecej select { max-width: 100%; }  /* a stance's long option names must not widen a phone's page */
.opcje-sceny { border-top: 1px solid var(--border); padding-top: .5rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* hits: one card each, the Wounds it will cost in large print and one main button */
.karta-trafienia { padding: .6rem .7rem; margin-bottom: .5rem; border: 1px solid var(--border); border-left: 4px solid var(--warn); border-radius: var(--radius-sm); background: var(--surface); }
.karta-trafienia.zadane { border-left-color: var(--border); opacity: .8; }
.karta-trafienia.odparte { border-left-color: var(--ok); }
.kt-ochrona, .kt-cechy { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; margin-top: .45rem; }
.kt-ochrona .btn, .kt-cechy .btn { text-align: left; }
.kt-cechy .badge { white-space: normal; }  /* an Immunity's note is a sentence */
.karta-trafienia:is(.odrzucone, .unikniete) { border-left-color: var(--border); opacity: .6; }
.kt-glowa { display: flex; flex-wrap: wrap; gap: .1rem .5rem; align-items: baseline; }
.kt-podglad { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; margin-top: .35rem; }
.kt-podglad .rany { font-size: 1.5rem; font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.kt-wzor { flex-basis: 100%; }
.kt-edycja { padding: .5rem; border-radius: var(--radius-sm); background: var(--surface-2); }
/* „Obrażenia” (komponenty/walka/obrazenia.js): what and who side by side, then the dice, the targets */
.obr-skad > label { flex: 1 1 11rem; }
.okno-obrazen .sheet-head h2, .okno-licznika .sheet-head h2 { display: flex; align-items: center; gap: .4rem; }
/* „Dodaj uczestników” (partials/dodawanie_walki.html): the cards by group; the sheet keeps its height between the tabs,
   its button at the bottom */
.sheet.okno-dodawania { display: flex; flex-direction: column; min-height: min(calc(80dvh / var(--zoom)), 34rem); }
.sheet.okno-dodawania > * { flex-shrink: 0; }
.okno-dodawania > form { flex: 1 0 auto; display: flex; flex-direction: column; }
.okno-dodawania form > .sheet-foot { margin-top: auto; }
.grupa-dodawania .wybor-monet { margin-top: .25rem; }
.grupy-dodawania { display: flex; flex-direction: column; gap: .15rem; }
.przelacznik-grupy {  /* a group's name folds it; the party's and a search's stay open (disabled) */
  display: flex; align-items: baseline; gap: .4rem; padding: .5rem 0; border: 0; background: none;
  font: inherit; font-size: .9rem; font-weight: 600; color: var(--ink); text-align: left; cursor: pointer;
}
.przelacznik-grupy:disabled { cursor: default; }
.przelacznik-grupy::before { content: "▸" / ""; color: var(--muted); }
.przelacznik-grupy[aria-expanded="true"]::before { transform: rotate(90deg); }
.przelacznik-grupy small { font-size: .8rem; font-weight: 400; color: var(--muted); font-variant-numeric: tabular-nums; }
.wybrani-dodawania { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .4rem; }
.wybrani-dodawania .ikona { width: .9em; height: .9em; }
/* the GM's picker (partials/wybor_okno.html): the kinds, the groups of rows; a ticked row teal with its check. The sheet
   keeps its height while groups fold, „Gotowe” at the bottom */
.sheet.okno-wyboru { display: flex; flex-direction: column; gap: .6rem; min-height: min(calc(80dvh / var(--zoom)), 34rem); }
.sheet.okno-wyboru > * { flex-shrink: 0; }
.okno-wyboru > .sheet-head { margin-bottom: 0; }
.okno-wyboru > .pole-szukania { flex: none; max-width: none; }  /* its row basis would be a column's height */
.okno-wyboru > .sheet-foot { margin-top: auto; }
.okno-wyboru .przelacznik-grupy { width: 100%; }
.wiersz-wyboru {
  display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 44px; padding: .4rem .5rem;
  border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { .wiersz-wyboru:hover { background: var(--surface-2); } }  /* a finger's tap leaves no hover behind */
.wiersz-wyboru.on { background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }
.wiersz-wyboru > .ikona { flex-shrink: 0; color: var(--muted); }
.wiersz-wyboru.on > .ikona { color: inherit; }
.wiersz-wyboru .badge { flex-shrink: 0; font-weight: 400; }
.wiersz-wyboru .znak-wyboru { flex-shrink: 0; visibility: hidden; }
.wiersz-wyboru.on .znak-wyboru { visibility: visible; }
@media (max-width: 699px) {
  .okno-wyboru .wybor-rodzaje { flex-wrap: wrap; }  /* six kinds: two rows of three, past the chronicle's one row */
  .okno-wyboru .wybor-rodzaje .chip-moneta { flex: 1 1 30%; }
}
/* a scene being prepared („Przygotowanie”: the GM's steps to „Rozpocznij walkę”) */
.przygotowanie { border-top: 2px solid var(--wybor); }
/* „Inne działania ▾” (partials/dzialania_walki.html): the groups' bar stuck on top, the rules by group, a thin line
   between them; an entry without a button now greyed; on a laptop a group's entries in two columns, row by row */
.skok-dzialan { position: sticky; top: -1rem; z-index: 2; display: flex; flex-wrap: wrap; gap: .3rem;
  margin: -.25rem -1rem 0; padding: .25rem 1rem .5rem; background: var(--surface); border-bottom: 1px solid var(--border); }
.grupa-dzialan { scroll-margin-top: 3.25rem; }  /* a jump leaves its heading under the bar */
.grupa-dzialan h3 { margin: .8rem 0 .2rem; font-size: 1rem; color: var(--teal); }
.dzialanie { padding: .45rem 0; border-bottom: 1px solid var(--border); }
.dzialanie:last-of-type { border-bottom: 0; }
.dzialanie-glowa { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.dzialanie-glowa > b { flex: 1 1 auto; }
.dzialanie-przyciski { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; margin-left: auto; }
.dzialanie.bierne .dzialanie-glowa > b { color: var(--muted); font-weight: 600; }
.dzialanie p { margin: .15rem 0 0; }
.dzialanie p small { white-space: nowrap; }  /* „5e s. 169” in one piece */
@media (min-width: 900px) {
  .sheet.okno-dzialan { max-width: 980px; }
  .lista-dzialan { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.75rem; }
  .dzialanie:nth-last-of-type(2):nth-of-type(odd) { border-bottom: 0; }  /* the last row's left one */
}

/* Critical Wounds (komponenty/walka/krytyczne.js): folded in a settled hit with the table's text, and the big card
   that comes up when one is rolled — a blood-red band, the roll and the wound's name large, the row in the book's
   font, a stamp for a death. The card sits over the roll dialog („Zadaj” from there), under a Condition's description
   (its badges open it) and the dice. */
.kt-krytyk { margin-top: .45rem; border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent); border-left: 3px solid var(--bad);
  border-radius: var(--radius-sm); background: var(--bad-soft); }
.kt-krytyk > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; }
.kt-krytyk > summary::-webkit-details-marker { display: none; }
.kt-krytyk > summary::after { content: "▸"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.kt-krytyk[open] > summary::after { transform: rotate(90deg); }
.kt-krytyk > summary > .ikona { flex: none; width: 1.3rem; height: 1.3rem; color: var(--bad); }
.kt-krytyk-nazwa { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.kt-krytyk-nazwa b { font-family: var(--font-head); font-size: 1.06rem; }
.kt-krytyk-nazwa small { font-size: .8rem; }
.kt-krytyk.smierc .kt-krytyk-nazwa b { color: var(--bad); }
.kt-krytyk-tresc { padding: .1rem .6rem .6rem; font-size: .93rem; }
/* Strike to Injure: the wound's two rolls side by side (stacked on a phone), each with its pick */
.kt-wybor { margin-top: .5rem; display: grid; gap: .4rem; }
.kt-wybor-glowa { display: flex; align-items: center; gap: .4rem; font-size: .93rem; }
.kt-wybor-glowa > .ikona { flex: none; color: var(--bad); }
.kt-wybor-opcje { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: .45rem; }
.kt-wybor-opcja { display: flex; flex-direction: column; gap: .45rem; padding: .5rem .6rem; font-size: .93rem;
  border: 1px solid color-mix(in srgb, var(--bad) 28%, transparent); border-left: 3px solid var(--bad);
  border-radius: var(--radius-sm); background: var(--bad-soft); }
.kt-wybor-opcja > .btn { align-self: flex-start; margin-top: auto; }
.kt-wybor-opcja.smierc .kt-krytyk-nazwa b { color: var(--bad); }
.kt-krytyk-tresc > * + *, .rana > * + * { margin-top: .5rem; }
.kt-wybor-opcja > :is(.prose, p) { margin: 0; }
.rana-opis, .rana-na-karcie { margin-bottom: 0; }

.overlay.rana-okno { z-index: 61; align-items: center; padding: 12px;
  background: radial-gradient(ellipse at center, rgb(60 6 3 / 48%), rgb(10 3 2 / 84%)); }
.overlay.rana-okno::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, rgb(200 24 12 / 0%) 15%, rgb(200 24 12 / 60%)); }
.rana-arkusz { position: relative; max-width: 540px; border-radius: 14px; padding-top: 0; overflow-x: hidden;  /* the stamp's scale */
  border: 1px solid color-mix(in srgb, var(--bad) 55%, transparent);
  box-shadow: 0 24px 70px rgb(0 0 0 / 55%), 0 0 90px rgb(170 20 10 / 35%); }
.rana-pasmo { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: .5rem; margin: 0 -1rem .8rem;
  padding: .6rem 1rem; color: #fff1e0; font-family: var(--font-head); font-size: 1.05rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; background: linear-gradient(100deg, #5e0d07, #a4251c 55%, #7d140c); }
.rana-pasmo .ikona { width: 1.35rem; height: 1.35rem; }
.rana-arkusz.smierc .rana-pasmo { background: linear-gradient(100deg, #140807, #3b0e0a 55%, #1d0a08); }
.rana-trafienie + .rana-trafienie { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.rana-kto { color: var(--muted); }
.rana-kto b { color: var(--ink); }
.rana { margin-top: .7rem; }
.rana + .rana { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px dashed var(--border); }
.rana-wynik { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .9rem; }
.rana-liczba { flex: none; display: inline-flex; flex-direction: column; align-items: center; line-height: 1;
  padding-right: .9rem; border-right: 2px solid color-mix(in srgb, var(--bad) 35%, transparent); }
.rana-liczba > span { font-size: 2.6rem; font-weight: 800; color: var(--bad); font-variant-numeric: tabular-nums; }
.rana-liczba small { margin-top: 3px; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; }
.rana-tytul { flex: 1 1 10rem; min-width: 0; }
.rana-miejsce { display: block; color: var(--muted); font-size: .76rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.rana-nazwa { margin: .1rem 0 0; font-size: clamp(1.55rem, calc(5.5vw / var(--zoom)), 2.15rem); font-weight: 800; line-height: 1.1; overflow-wrap: anywhere; }
.rana.smierc .rana-nazwa { color: var(--bad); }
.rana-pieczec { flex: none; margin: .35rem 0 .35rem auto; display: inline-flex;  /* room for its tilt when it wraps */ align-items: center; gap: .3rem; padding: .15rem .55rem; border: 3px double var(--bad);
  border-radius: 6px; color: var(--bad); font-family: var(--font-head); font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; transform: rotate(-9deg); }
.rana-pieczec .ikona { width: 1.2rem; height: 1.2rem; }
.rana .rana-wynik + .rana-rzut { margin-top: .3rem; }
.rana-rzut { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.rana .rana-opis { font-family: var(--font-head); font-size: 1.14rem; line-height: 1.5; }
/* the blow lands: the page flashes red, the card strikes and shakes, the name comes up, a death is stamped */
@media (prefers-reduced-motion: no-preference) {
  .overlay.rana-okno { animation: rana-tlo .35s ease-out; }
  .overlay.rana-okno::before { animation: rana-blysk .9s ease-out; }
  .rana-arkusz { animation: rana-cios .6s cubic-bezier(.2, .9, .3, 1.2); }
  .rana-nazwa { animation: rana-nazwa .5s .2s both cubic-bezier(.2, .9, .3, 1); }
  .rana-pieczec { animation: rana-pieczec .45s .55s both cubic-bezier(.3, 1.4, .5, 1); }
}
@keyframes rana-tlo { from { opacity: 0; } }
@keyframes rana-blysk { from { opacity: 1; } }
@keyframes rana-cios {
  0% { opacity: 0; transform: scale(1.14); }
  45% { opacity: 1; transform: scale(.985); }
  60% { transform: translateX(-7px) rotate(-.4deg); }
  72% { transform: translateX(6px) rotate(.3deg); }
  84% { transform: translateX(-3px); }
}
@keyframes rana-nazwa { from { opacity: 0; transform: translateY(.35em); } }
@keyframes rana-pieczec { from { opacity: 0; transform: rotate(-9deg) scale(2.6); } }

/* ---- the death screen (partials/smierc_okno.html, stores/smierc.js): a character „u Bram Morra”, over every dialog
   but the dice, a double's flash and the toasts (its „↶ Cofnij”). Dark in both themes. Morr's seal falls and the glass
   cracks from behind it, the edges beat like a heart that slows down and stops (the store's vibration keeps its time),
   then the words and the choice come up; the buttons only once they can be read. „Nie dziś!” breaks the seal in a
   light, „Przyjmuję los” lets the dark close in. ---- */
.overlay.smierc-okno { --pieczec: clamp(8rem, calc(34vw / var(--zoom)), 12rem); z-index: 68; align-items: stretch; padding: 0; overflow: hidden;
  color: #f1e4dc; background: radial-gradient(ellipse at 50% 27%, #2c0a07, #130403 55%, #050101); }
.overlay.smierc-okno:focus { outline: none; }
.smierc-okno::before, .smierc-okno::after { content: ""; position: absolute; inset: 0; pointer-events: none; }
.smierc-okno::before { opacity: .3; background: radial-gradient(ellipse at 50% 27%, transparent 30%, rgb(196 22 10 / 62%)); }
.smierc-okno::after { opacity: 0; background: radial-gradient(circle at 50% 27%, rgb(255 90 60 / 95%), rgb(200 20 8 / 85%) 70%); }
.smierc-pekniecia { position: absolute; inset: 0; pointer-events: none; transition: opacity 1s ease-out; }
/* centred where the seal is (27% down, as .smierc-scena puts it); a size in px keeps the lines as thin everywhere */
.smierc-pekniecia svg { position: absolute; left: 50%; top: 27%; width: 2600px; height: 2600px; transform: translate(-50%, -50%);
  fill: none; stroke: rgb(255 226 214 / 36%); stroke-width: 1; stroke-linejoin: round; }
.smierc-pekniecia path { stroke-dasharray: 1; }
.smierc-pekniecia .kregi { stroke: rgb(255 226 214 / 22%); }
.smierc-scena { position: relative; z-index: 1; display: flex; flex-direction: column; width: 100%; height: 100%;
  overflow-y: auto; overscroll-behavior: contain;
  padding: max(calc(16px + env(safe-area-inset-top)), calc(calc(27dvh / var(--zoom)) - var(--pieczec) / 2)) 16px calc(20px + env(safe-area-inset-bottom)); }
.smierc-tresc { margin: 0 auto auto; width: min(100%, 32rem); display: flex; flex-direction: column; align-items: center;
  text-align: center; text-shadow: 0 0 3px rgb(18 4 3 / 90%), 0 0 12px rgb(18 4 3 / 80%); }  /* readable over the cracks */
.smierc-pieczec { position: relative; flex: none; width: var(--pieczec); aspect-ratio: 1; margin-bottom: .9rem; transform: rotate(-6deg);
  filter: drop-shadow(0 10px 16px rgb(0 0 0 / 65%)) drop-shadow(0 0 26px rgb(205 32 16 / 50%)); }
.smierc-pieczec::before, .smierc-pieczec .pol { content: ""; position: absolute; inset: 0;
  background: url("../img/pieczec_morra.svg") center / contain no-repeat; }
.smierc-pieczec .pol { opacity: 0; }  /* the halves the seal breaks into */
.smierc-pieczec .lewa { clip-path: polygon(0 0, 53% 0, 47% 21%, 56% 40%, 45% 61%, 54% 79%, 48% 100%, 0 100%); }
.smierc-pieczec .prawa { clip-path: polygon(53% 0, 100% 0, 100% 100%, 48% 100%, 54% 79%, 45% 61%, 56% 40%, 47% 21%); }
.smierc-naglowek { margin: 0; color: #d97b69; font-family: var(--font-head); font-size: .85rem; font-weight: 700;
  letter-spacing: .32em; text-transform: uppercase; }
.smierc-imie { margin: .15rem 0 0; color: #fff3ea; font-size: clamp(2.1rem, calc(9vw / var(--zoom)), 3.2rem); font-weight: 800; line-height: 1.05;
  overflow-wrap: anywhere; text-shadow: 0 0 3px rgb(18 4 3 / 90%), 0 2px 22px rgb(205 32 16 / 60%); }
.smierc-przyczyna { margin: .45rem 0 0; color: #e6c9be; font-family: var(--font-head); font-size: 1.15rem; font-style: italic; }
.smierc-przyczyna:empty { display: none; }
.smierc-decyzja { width: 100%; display: flex; flex-direction: column; align-items: center; }
.smierc-przyciski { width: min(100%, 21rem); display: flex; flex-direction: column; gap: .65rem; }
.smierc-pytanie { margin: 1.5rem 0 .25rem; color: #bfa197; font-family: var(--font-head); font-size: 1.05rem; letter-spacing: .03em; }
.smierc-nie-dzis, .smierc-przyjmij { min-height: 52px; border-radius: 12px; font: inherit; cursor: pointer; }
.smierc-nie-dzis { display: grid; text-shadow: none; grid-template-columns: auto 1fr; align-items: center; column-gap: .75rem; padding: .7rem 1.1rem;
  text-align: left; color: #2b1604; border: 1px solid #f7dc98; background: linear-gradient(180deg, #f1d385, #c2932f);
  box-shadow: 0 0 0 1px rgb(0 0 0 / 35%), 0 6px 22px rgb(240 190 80 / 28%); }
.smierc-nie-dzis .ikona { grid-row: span 2; width: 1.9rem; height: 1.9rem; }
.smierc-nie-dzis .napis { font-family: var(--font-head); font-size: 1.4rem; font-weight: 800; line-height: 1.1; }
.smierc-nie-dzis .koszt { font-size: .85rem; font-weight: 600; opacity: .85; font-variant-numeric: tabular-nums; }
.smierc-nie-dzis:hover:not(:disabled) { filter: brightness(1.08); }
.smierc-nie-dzis:disabled { cursor: not-allowed; filter: grayscale(1) brightness(.75); box-shadow: none; }
.smierc-przyjmij { text-shadow: none; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .6rem 1rem;
  color: #dcc7bf; font-weight: 600; border: 1px solid rgb(255 236 228 / 24%); background: rgb(0 0 0 / 30%);
  transition: background-color .2s, border-color .2s, color .2s; }
.smierc-przyjmij .ikona { width: 1.25rem; height: 1.25rem; }
.smierc-przyjmij:hover:not(:disabled) { border-color: rgb(255 236 228 / 45%); }
.smierc-przyjmij.upewnij { color: #fff; border-color: #d4412f; background: #74140c; }
.smierc-nie-dzis:focus-visible, .smierc-przyjmij:focus-visible, .smierc-pozniej:focus-visible { outline: 2px solid #f7dc98; outline-offset: 3px; }
.smierc-kto { margin: 1.1rem 0 0; max-width: 24rem; color: #bfa197; font-size: .9rem; }
.smierc-pozniej { margin-top: .8rem; min-height: 44px; padding: .4rem 1rem; border: 0; background: none; color: #a98c83;
  font: inherit; font-size: .92rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.smierc-pozniej:hover { color: #e6c9be; }
.smierc-wynik-napis { margin: 1.3rem 0 .2rem; font-family: var(--font-head); font-weight: 800; line-height: 1.1; }
.po-nie_dzis .smierc-wynik-napis { color: #f6d77f; font-size: clamp(2.4rem, calc(12vw / var(--zoom)), 3.8rem); text-shadow: 0 0 26px rgb(255 205 100 / 60%); }
.po-zmarla .smierc-wynik-napis { color: #d4cbc7; font-size: clamp(1.6rem, calc(7vw / var(--zoom)), 2.3rem); letter-spacing: .03em; }
.smierc-wynik-opis, .smierc-wynik-koszt { margin: 0; color: #f3e3da; }
.smierc-wynik-opis:empty { display: none; }
.smierc-wynik-koszt { margin-top: .2rem; color: #f6d77f; font-weight: 600; font-variant-numeric: tabular-nums; }
/* the decision: the beat stops; „Nie dziś!” — the cracks go, a dawn, the seal breaks; „Przyjmuję los” — the dark */
.smierc-okno:is(.po-nie_dzis, .po-zmarla)::before { opacity: 0; transition: opacity .8s; }
.po-nie_dzis .smierc-pekniecia { opacity: 0; }
.po-nie_dzis::after { opacity: .35; background: radial-gradient(circle at 50% 27%, rgb(255 224 150 / 75%), rgb(255 190 90 / 0%) 65%); }
.po-nie_dzis .smierc-pieczec::before { opacity: 0; }
.po-zmarla .smierc-pekniecia { opacity: .25; }
.po-zmarla::after { opacity: .8; background: radial-gradient(ellipse at 50% 27%, rgb(0 0 0 / 40%), #000 70%); }
.po-zmarla .smierc-pieczec { filter: grayscale(1) brightness(.55) drop-shadow(0 10px 16px rgb(0 0 0 / 65%)); }
.po-zmarla :is(.smierc-naglowek, .smierc-imie, .smierc-przyczyna) { color: #9d9390; text-shadow: none; }
.smierc-znacznik { position: fixed; z-index: 44; left: 50%; top: calc(var(--topbar-h, 58px) + 10px); transform: translateX(-50%);
  max-width: calc(100% - 32px); min-height: 44px; display: inline-flex; align-items: center; gap: .45rem; padding: .4rem 1rem .4rem .75rem;
  border: 1px solid #b3261a; border-radius: 999px; background: #2a0806; color: #f6e4da; font: inherit; font-weight: 700;
  box-shadow: 0 4px 16px rgb(0 0 0 / 35%); cursor: pointer; }
.smierc-znacznik .ikona { flex: none; width: 1.3rem; height: 1.3rem; color: #ef8a76; }
.smierc-znacznik .tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) {
  .overlay.smierc-okno { animation: smierc-tlo .3s ease-out; }
  .smierc-okno::after { animation: smierc-blysk .9s .4s ease-out both; }
  .smierc-okno::before { animation: smierc-serce 9s .7s linear both; }
  .smierc-pieczec { animation: smierc-stempel .45s cubic-bezier(.55, 0, .8, .2) both; }
  .smierc-pieczec::before { animation: smierc-bije 9s .7s linear both; }
  .smierc-tresc { animation: smierc-wstrzas .5s .42s; }
  .smierc-pekniecia path { animation: smierc-peka .5s .42s ease-out both; }
  .smierc-pekniecia .odnogi path { animation-delay: .62s; animation-duration: .35s; }
  .smierc-pekniecia .kregi path { animation-delay: .72s; animation-duration: .3s; }
  .smierc-naglowek { animation: smierc-wejscie .6s .8s both; }
  .smierc-imie { animation: smierc-wejscie .7s 1s both; }
  .smierc-przyczyna { animation: smierc-wejscie .7s 1.35s both; }
  .smierc-decyzja { animation: smierc-wejscie .7s 2s both; }
  .smierc-wynik-napis { animation: smierc-napis .6s cubic-bezier(.2, .9, .3, 1.2) both; }
  .smierc-wynik :is(.smierc-wynik-opis, .smierc-wynik-koszt) { animation: smierc-wejscie .7s .5s both; }
  .po-zmarla .smierc-wynik-napis { animation: smierc-wejscie 1.4s .3s ease-out both; }
  .po-nie_dzis::after { animation: smierc-swit 2.6s ease-out both; }
  .po-nie_dzis .smierc-pieczec { animation: smierc-pekanie .35s ease-in-out both; }
  .po-nie_dzis .smierc-pieczec .lewa { animation: smierc-pol-lewa 1.3s .3s cubic-bezier(.3, .1, .6, 1) both; }
  .po-nie_dzis .smierc-pieczec .prawa { animation: smierc-pol-prawa 1.3s .3s cubic-bezier(.3, .1, .6, 1) both; }
  .po-zmarla::after { animation: smierc-mrok 2.6s ease-in both; }
  .po-zmarla .smierc-pieczec { transition: filter 1.6s; animation: none; }
  .po-zmarla .smierc-tresc > :not(.smierc-wynik) { transition: color 1.6s, text-shadow 1.6s; }
  .smierc-znacznik { animation: smierc-znacznik 1.8s ease-out infinite; }
}
@media (prefers-reduced-motion: reduce) { .po-nie_dzis .smierc-pieczec { opacity: 0; } }
@keyframes smierc-tlo { from { opacity: 0; } }
@keyframes smierc-blysk { 0% { opacity: .9; } 100% { opacity: 0; } }
@keyframes smierc-stempel { from { opacity: 0; transform: scale(3.2) rotate(-24deg); } 40% { opacity: 1; } }
@keyframes smierc-wstrzas {
  15% { transform: translate(-9px, 5px); } 30% { transform: translate(8px, -5px); } 45% { transform: translate(-5px, 3px); }
  60% { transform: translate(4px, -2px); } 80% { transform: translate(-2px, 1px); }
}
@keyframes smierc-peka { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes smierc-wejscie { from { opacity: 0; transform: translateY(.5em); visibility: hidden; } }
/* a heart that slows down and stops: lub-dub at 0 s, 1.8 s, 4 s and 6.7 s, each weaker (BICIE_SERCA in the store) */
@keyframes smierc-serce {
  0% { opacity: .3; } 2% { opacity: 1; } 4% { opacity: .55; } 6% { opacity: .9; } 13%, 20% { opacity: .25; }
  22% { opacity: .8; } 24% { opacity: .45; } 26% { opacity: .68; } 34%, 44% { opacity: .2; }
  46% { opacity: .55; } 48% { opacity: .32; } 50% { opacity: .44; } 60%, 74% { opacity: .14; }
  76% { opacity: .3; } 78% { opacity: .18; } 80% { opacity: .22; } 90%, 100% { opacity: .08; }
}
@keyframes smierc-bije {
  0%, 13%, 20%, 34%, 44%, 60%, 74%, 90%, 100% { scale: 1; } 2% { scale: 1.06; } 6% { scale: 1.04; }
  22% { scale: 1.045; } 26% { scale: 1.03; } 46% { scale: 1.03; } 50% { scale: 1.02; } 76% { scale: 1.015; }
}
@keyframes smierc-napis { from { opacity: 0; transform: scale(1.7); letter-spacing: .3em; } }
@keyframes smierc-swit { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: .35; } }
@keyframes smierc-pekanie { 25% { translate: -4px 0; } 50% { translate: 4px 0; } 75% { translate: -2px 0; } }
@keyframes smierc-pol-lewa { 0% { opacity: 1; } 100% { opacity: 0; transform: translate(-55%, 18%) rotate(-26deg); } }
@keyframes smierc-pol-prawa { 0% { opacity: 1; } 100% { opacity: 0; transform: translate(55%, 22%) rotate(22deg); } }
@keyframes smierc-mrok { from { opacity: 0; } }
@keyframes smierc-znacznik { from { box-shadow: 0 4px 16px rgb(0 0 0 / 35%), 0 0 0 0 rgb(205 32 16 / 60%); }
  to { box-shadow: 0 4px 16px rgb(0 0 0 / 35%), 0 0 0 12px rgb(205 32 16 / 0%); } }
/* the card's banner (karta.html): „u Bram Morra” or dead, dark in both themes as the screen is; a dead character's
   portrait goes grey on its card and in the lists (postacie.html, start.html, druzyna.html) */
.baner-smierci { display: flex; align-items: center; gap: .75rem; margin-bottom: calc(16px + .6rem); padding: .65rem .85rem;  /* the header comes 16px up */
  border: 1px solid #b3261a; border-radius: var(--radius-sm); color: #f1e4dc;
  background: radial-gradient(ellipse at 0% 50%, #45100b, #170605 75%); }
.baner-smierci.zmarla { border-color: #4a403c; background: radial-gradient(ellipse at 0% 50%, #2e2725, #0e0b0a 75%); }
.baner-smierci .pieczec { flex: none; width: 2.75rem; aspect-ratio: 1; transform: rotate(-6deg);
  background: url("../img/pieczec_morra.svg") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgb(0 0 0 / 70%)) drop-shadow(0 0 10px rgb(205 32 16 / 55%)); }
.baner-smierci.zmarla .pieczec { filter: drop-shadow(0 2px 6px rgb(0 0 0 / 70%)) drop-shadow(0 0 8px rgb(255 236 228 / 22%)); }
.baner-smierci b { font-family: var(--font-head); font-size: 1.1rem; letter-spacing: .03em; color: #fff3ea; }
.baner-smierci p { margin: .1rem 0 0; color: #d9bfb5; font-size: .9rem; }
.baner-smierci.zmarla p { color: #b9aeaa; }
.baner-smierci.zmarla { flex-wrap: wrap; }
.baner-smierci.zmarla > .grow { flex: 1 1 13rem; }  /* a phone: the buttons under the text */
.baner-smierci .epitafium { margin-top: .3rem; color: #e4d9d2; font-family: var(--font-head); font-style: italic; overflow-wrap: anywhere; }
.zmarla :is(.portret, .awatar) { filter: grayscale(1); }
/* put away (app/druzyna.py): calm, apart from the death's banner */
.baner-odlozonej { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: calc(16px + .6rem);
  padding: .65rem .85rem; border: 1px solid var(--teal); border-radius: var(--radius-sm); background: var(--teal-soft); color: var(--ink); }
.baner-odlozonej > .ikona { width: 1.9rem; height: 1.9rem; color: var(--teal); }
.baner-odlozonej > div { flex: 1 1 14rem; }  /* a phone: the button under the text */
.baner-odlozonej > .btn { margin-left: auto; }
.baner-odlozonej b { font-family: var(--font-head); font-size: 1.05rem; letter-spacing: .02em; }
.baner-odlozonej p { margin: .1rem 0 0; color: var(--muted); font-size: .9rem; }
.badge.zmarla { background: #2e2725; color: #efe3dc; border-color: #6b5f5a; }
.kafel-postaci.zmarla { opacity: .8; }

/* ---- the scene's page (walka.html): one layout on every screen, the window's height — the page never scrolls. The
   bar, the initiative queue, the map or the rows „Bez mapy” (they scroll), and the side (the panel, defences, hits,
   the log): a column of its own from 1024 px and on a phone held sideways (no bottom bar there: `--tabbar-h` 0), below
   that a sheet from the bottom over the map (panel.js `arkusz`, `KOLUMNA` the same media: folded to the panel's head,
   half, full), the map leaving it only the folded sheet's room (--arkusz-h) ---- */
.main:has(> .walka-strona) {
  display: flex; flex-direction: column; max-width: none; padding: 0 env(safe-area-inset-right) 0 env(safe-area-inset-left);
  height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px) - var(--tabbar-h) - env(safe-area-inset-bottom));
}
.main:has(> .walka-strona) > .alert { margin: 8px 16px 0; }
.walka-strona { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.walka-strona > .stack { padding: 16px; }  /* the skeleton while it loads */
.scena {
  flex: 1; min-height: 0; display: grid; grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr);
  padding-bottom: var(--arkusz-h, 72px);
}
.scena-pasek {
  grid-area: 1 / 1 / 2 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; min-width: 0;
  padding: .45rem 16px; background: var(--surface); border-bottom: 1px solid var(--border);
}
.scena-tura { display: inline-flex; align-items: center; gap: .3rem; min-width: 0; font-weight: 600; }
.scena-tura > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scena-tura .ikona { color: var(--wybor); fill: currentColor; }
.scena-tura.moja { color: var(--accent); }
.scena-tura.moja .ikona { color: inherit; }
/* a phone: one line — the name cut short, the Round „R1”, the buttons icons; whose turn it is the queue says (and a
   player's panel, „Twoja tura”), the defence mode is in „Scena ▾”. Held sideways it keeps the line (`.tylko-szeroki`
   goes by the width only: the scene's own here). A tablet upright drops the turn alone. */
@media (max-width: 1023px) { .scena-tura { display: none; } }
@media (max-width: 699px), (orientation: landscape) and (max-height: 500px) {
  .scena-pasek { gap: .3rem; padding: .3rem 12px; }
  .scena-pasek .nazwa-sceny { flex-basis: 6rem; font-size: 1.05rem; }
  .nazwa-sceny > .ikona, .scena-pasek > .grow { display: none; }  /* the name takes the room */
}
@media (orientation: landscape) and (max-height: 500px) {
  .walka-strona .tylko-szeroki { display: none !important; }
  .scena-pasek .badge .tylko-waski { display: inline !important; }
  .menu-postaci-lista > label.check.tylko-waski { display: flex !important; }
}
/* a phone held sideways: no bottom bar under the scene (its „←” goes back to the scenes), the side a column; the top
   bar shares the scene bar's line, its buttons at the right end (the scene's bar leaves it `--topbar-w`, okna.js),
   the page's name dropped (the scene's bar names it), the date and the settlement as two short lines */
@media (orientation: landscape) and (max-height: 500px) and (max-width: 899px) {
  html:has(.walka-strona) { --tabbar-h: 0px; --topbar-h: 0px !important; }
  body:has(.walka-strona) .tabbar { display: none; }
  body:has(.walka-strona) .topbar {
    position: fixed; left: auto; right: 0; height: 3.2rem; gap: .3rem; padding: 0 max(12px, env(safe-area-inset-right)) 0 .5rem;
    background: none; backdrop-filter: none; border: 0; color: var(--ink);
  }
  body:has(.walka-strona) .topbar .btn.ghost { color: var(--ink); }
  body:has(.walka-strona) .topbar .btn.ghost:hover { background: var(--surface-2); }
  body:has(.walka-strona) :is(.tytul-paska .tekst, .kampania-mini) { display: none; }
  body:has(.walka-strona) .tytul-paska { min-width: 0; }
  body:has(.walka-strona) .data-gry:hover { background: var(--surface-2); }
  body:has(.walka-strona) .data-gry.noc { color: var(--gold); }
  .scena-pasek { padding-right: calc(var(--topbar-w, 0px) - env(safe-area-inset-right)); }
}
.menu-postaci-lista > label.check select { width: auto; margin-left: auto; }
/* the GM's defence mode: a select dressed as a chip */
.chip-obrony { display: inline-flex; align-items: center; gap: .3rem; flex: none; margin: 0; padding: 0 0 0 .55rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: .9rem; white-space: nowrap; }
.chip-obrony select { width: auto; min-height: 34px; border: 0; border-radius: 999px; background: transparent; padding-left: .2rem; }
/* the bar's menus („Scena ▾”, „⋯”, „↶”): karta.html's, with group names and settings' checkboxes */
.scena-pasek .menu-postaci > .btn:not(.icon) { font-size: inherit; }
.scena-pasek .menu-postaci-lista { min-width: 16rem; max-height: calc(calc(80dvh / var(--zoom)) - var(--topbar-h, 58px)); overflow-y: auto; }
.menu-grupa { display: block; margin: .5rem .6rem .15rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu-grupa:first-child { margin-top: .2rem; }
.menu-postaci-lista > label.check { display: flex; padding: .45rem .6rem; }
.menu-postaci-lista > hr { margin: .3rem 0; }
.menu-postaci-lista > button:disabled { opacity: .5; cursor: default; }
.scena-kolejka { grid-area: 2 / 1; min-width: 0; background: var(--surface); border-bottom: 1px solid var(--border); }
/* a player's line over the queue while the GM has paused the scene (`w.wstrzymana`) */
.scena-wstrzymana { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .4rem 16px;
  background: var(--warn-soft); color: var(--warn); font-size: .92rem; font-weight: 600; }
/* an observer's bar (`obserwujeZ`): a player looks at a scene its characters are not in */
.scena-podglad { display: flex; align-items: center; gap: .45rem; margin: 0; padding: .4rem 16px;
  background: var(--info-soft); font-size: .92rem; }
.scena-podglad a { font-weight: 600; }
/* the GM's switch to the other running scenes, by the name: a dot where something waits (`czeka`) */
.przelacznik-scen { position: relative; }
.przelacznik-scen > .kropka-nowe { position: absolute; top: 4px; right: 2px; background: var(--warn); }
/* its list hangs from the bar's left edge (not the button's, mid-bar on a phone), wide enough for a scene's name */
.scena-pasek { position: relative; }
.scena-pasek .menu-postaci.menu-scen { position: static; }
.scena-pasek .menu-postaci.menu-scen .menu-postaci-lista { left: 12px; right: auto; top: calc(100% - 2px); min-width: 0;
  width: 22rem; max-width: calc(100% - 24px); }
.menu-scen .menu-postaci-lista a { gap: .6rem; }
.menu-scen .poziom-menu { padding-left: 1.4rem; }  /* a building's level under its name */
.menu-scen .menu-postaci-lista a > .kropka-nowe { background: var(--warn); }
.menu-scen .kropka-nowe.pusta { visibility: hidden; }  /* its place kept: the badges stay in a column */
.menu-scen .menu-postaci-lista .badge .ikona { color: inherit; }
/* „W innych scenach”: one gone to another scene, a link there and „Wróć tutaj” */
.nieobecny + .nieobecny { margin-top: .5rem; }
.scena-kolejka:not(:has(> :not(template, [style*="none"]))) { display: none; }
.scena-glowna { grid-area: 3 / 1; min-height: 0; display: flex; flex-direction: column; }
.scena-glowna > .mapa-walki { flex: 1; min-height: 0; }
.scena.bez-mapy .scena-glowna { overflow-y: auto; padding: 12px 16px; }
.scena-glowna .card { margin: 0; }
/* the side: cards one under another, scrolling on their own */
.scena-bok {
  display: flex; flex-direction: column; gap: .75rem; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  padding: 0 12px 12px; background: var(--bg);
}
.scena-bok > .card, .scena-bok > .blok-poscig > .card { margin: 0; }
.blok-poscig { display: flex; flex-direction: column; gap: .75rem; }
.blok-poscig:not(:has(> :not(template))) { display: none; }
/* „Czeka”: what waits for a decision, heading the GM's side (a player's after the panel), its edge yellow as the
   panel's of a player with something waiting */
.scena-czeka { border-top: 2px solid var(--warn); }
.scena-czeka > h3 { margin-bottom: .25rem; }
.arkusz-uchwyt {
  position: sticky; top: 0; z-index: 2; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .1rem; flex: none; min-height: 1.6rem;  /* a finger's grip: it drags the sheet */
  margin: 0 -12px; padding: .35rem 16px .25rem; border: 0; background: var(--bg); font: inherit; cursor: grab;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;
}
.arkusz-uchwyt .kreska { width: 3rem; height: 5px; border-radius: 3px; background: var(--border); }
/* a finger dragging the handle (or the folded head) moves the sheet, never scrolls it (panel.js `ciagnijArkusz`) */
.arkusz-uchwyt, .scena-bok.arkusz-zwiniety .panel-glowa { touch-action: none; }
@media (max-width: 1023px) and (min-height: 501px), (max-width: 1023px) and (orientation: portrait) {
  .scena-bok {
    position: fixed; z-index: 35; left: 0; right: 0; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    max-height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px) - var(--tabbar-h) - env(safe-area-inset-bottom));
    border-top: 2px solid var(--border); box-shadow: 0 -4px 16px rgb(20 35 40 / 14%);
  }
  .scena-bok.arkusz-polowa { height: calc(52dvh / var(--zoom)); }
  .scena-bok :is(.card, [data-cel]) { scroll-margin-top: 2rem; }  /* brought into sight under the sticky handle */
  .scena-bok.arkusz-pelny { height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px) - var(--tabbar-h) - env(safe-area-inset-bottom)); }
  /* folded: the panel's head alone */
  .scena-bok.arkusz-zwiniety { overflow: hidden; padding-bottom: 0; }
  .scena-bok.arkusz-zwiniety > :not(.arkusz-uchwyt, .panel-postaci), .scena-bok.arkusz-zwiniety .panel-tresc { display: none; }
  .scena-bok.arkusz-zwiniety > .panel-postaci { border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
  body:has(.scena-bok) .fab { bottom: calc(var(--tabbar-h) + var(--scena-bok-h, 72px) + 12px + env(safe-area-inset-bottom)); }
  /* the rows scroll up past the sheet over them, the last one too */
  .scena.bez-mapy .scena-glowna { padding-bottom: calc(var(--scena-bok-h, 72px) + 12px); }
}
@media (min-width: 900px) {
  .main:has(> .walka-strona) { height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px)); }
  .scena-glowna { padding: 12px 0 12px 16px; }
  .scena-glowna > .mapa-walki { border: 1px solid var(--border); border-radius: var(--radius); }
  .scena.bez-mapy .scena-glowna { padding-right: 16px; }
}
@media (min-width: 900px) and (max-width: 1023px) and (min-height: 501px) {
  .scena-glowna { padding-right: 16px; }
  .scena-bok { left: var(--nav-w); bottom: 0; max-height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px)); }
  .scena-bok.arkusz-pelny { height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 58px)); }
  body:has(.scena-bok) .fab { bottom: calc(var(--scena-bok-h, 72px) + 16px); }
}
@media (min-width: 1024px), (orientation: landscape) and (max-height: 500px) {
  .scena { grid-template: auto auto minmax(0, 1fr) / minmax(0, 1fr) minmax(min(340px, calc(42vw / var(--zoom))), 30%);
    padding-bottom: 0; }
  .scena-bok { grid-area: 2 / 2 / 4 / 3; padding: 12px 16px 16px 12px; }
  .arkusz-uchwyt, .panel-glowa .zwin { display: none; }
  .panel-glowa { cursor: default; }
  /* a GM's request's pill floats at the bottom left, over the map's tools: the map ends above it while it shows */
  body:has(.prosby-znacznik:not([style*="none"])) .scena-glowna { padding-bottom: 62px; }
}

/* ---- the battle map (partials/mapa_walki.html, lib/mapa_widok.js): the scene page's cell (app.css § the scene's
   page); its own window (walka_mapa.html) keeps it over the page between the bars ---------------------------------- */
.mapa-walki { display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.mapa-okno .mapa-walki {
  position: fixed; z-index: 28; top: var(--topbar-h, 58px); left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .mapa-okno .mapa-walki { left: var(--nav-w); bottom: 0; } }
/* the map's box, and what floats over it (the tray, the tools' dock, the zoom, the GM's background): those are its
   siblings, so the map's pointer never takes their taps */
.mapa-obszar { position: relative; flex: 1; min-height: 0; }
/* a finger on the map moves the map, never the page; a long press is a ping, not the picture's menu */
.mapa-pole {
  position: absolute; inset: 0; overflow: hidden; cursor: grab;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.mapa-pole:active { cursor: grabbing; }
.mapa-pole.rysuje, .mapa-pole.rysuje:active, .mapa-pole.rysuje .zeton { cursor: crosshair; }
.mapa-scena { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.mapa-walki.papier .mapa-scena { background: var(--surface); box-shadow: var(--shadow); }
.mapa-tlo, .mapa-siatka, .mapa-gpu, .mapa-gpu canvas { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; pointer-events: none; }
/* --skala: the zoom (lib/mapa_widok.js), so a line keeps its screen width; a dark line on a light one shows on any
   picture, the paper's grid is fainter */
.mapa-siatka path { fill: none; stroke: var(--ink); stroke-width: calc(1px / var(--skala, 1)); opacity: .65; }
.mapa-siatka path.jasna { stroke: var(--surface); stroke-width: calc(3px / var(--skala, 1)); opacity: .45; }
.mapa-walki.papier .mapa-siatka { opacity: .55; }
/* floating over the map: the tray at the top left; the tools' dock at the bottom's middle (a phone's at the left), its
   hint and options and the drawing's flyout over it; the zoom at the bottom right — each a card of its own, the gaps
   between them the map's */
.mapa-tacka, .mapa-dok, .mapa-zoom { position: absolute; z-index: 3; display: flex; pointer-events: none; }
:is(.mapa-tacka, .mapa-dok, .mapa-zoom) > * { pointer-events: auto; }
.mapa-tacka { left: .5rem; top: .5rem; right: 3.5rem; flex-direction: column; align-items: flex-start; gap: .35rem; }
.mapa-tacka .btn { box-shadow: var(--shadow); }
/* max-content: from the middle, a shrink-to-fit box got only the half right of it, and its options wrapped early */
.mapa-dok { left: 50%; bottom: .5rem; width: max-content; max-width: calc(100% - 7rem); transform: translateX(-50%); flex-direction: column; align-items: center; gap: .35rem; }
.mapa-zoom { right: .5rem; bottom: .5rem; flex-direction: column; gap: .25rem; }
/* the aiming bar (mapa.js `ulozCelowanie`): over the token or the place the system aims from, its bars a card each
   edged in the accent (their main button filled: `.btn.primary`); a phone's above the sheet */
.mapa-celowanie {
  position: absolute; z-index: 3; left: var(--celowanie-x, 50%); top: var(--celowanie-y, 50%); display: flex;
  flex-direction: column; align-items: center; gap: .35rem; width: max-content; max-width: min(36rem, calc(100% - 1rem));
  pointer-events: none;
}
.mapa-celowanie > * { pointer-events: auto; }
.mapa-celowanie .mapa-opcje { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.tacka-lista, .mapa-opcje, .mapa-wysuwka, .mapa-przyciski, .mapa-zoom > .btn {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tacka-lista, .mapa-opcje, .mapa-mgla-pasek { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.tacka-lista { max-width: min(36rem, 100%); padding: .4rem; }
.mapa-opcje { padding: .3rem .5rem; }
.mapa-wysuwka { display: flex; flex-direction: column; gap: .3rem; padding: .35rem; }
.mapa-przyciski { display: flex; align-items: center; gap: .25rem; padding: .3rem; }
.mapa-przyciski > .btn:not(.icon) { min-width: 32px; padding-inline: .3rem; gap: 0; }
/* a thin line between the dock's groups of tools (and the eraser from the shapes) */
:is(.mapa-przyciski, .mapa-wysuwka) .sep { flex: none; align-self: stretch; width: 1px; margin: .2rem .15rem; background: var(--border); }
.menu-postaci.w-gore .menu-postaci-lista { top: auto; bottom: calc(100% + 8px); white-space: nowrap; }
@media (hover: none) { .mapa-zoom .na-mysz { display: none; } }  /* a touch screen pinches */
/* a building's levels (poziomy.js): ↑, the level's name, ↓ in one plate at the map's top right */
.mapa-poziomy { position: absolute; z-index: 3; top: .5rem; right: .5rem; display: flex; flex-direction: column;
  align-items: center; gap: .1rem; padding: .15rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.mapa-poziomy > .btn { border-color: transparent; background: none; box-shadow: none; font-weight: 700; font-size: 1.05rem; }
.poziom-mapy { max-width: 4.5rem; padding: .1rem .2rem; font-size: .72rem; font-weight: 600; line-height: 1.2; text-align: center;
  overflow-wrap: anywhere; }
.walka-karta.budynek-karta { grid-column: 1 / -1; max-width: 34rem; }  /* a building: a row of its own */
.poziomy-budynku { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.poziomy-budynku a { gap: .4rem; padding: .25rem 0; }
.poziom-numer { min-width: 1.6rem; padding: .05rem .3rem; border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: .78rem; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.lista-poziomow { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .6rem; }
.lista-poziomow li { align-items: flex-start; }
@media (max-width: 699px) {
  .mapa-dok { left: .5rem; width: auto; max-width: calc(100% - 3.5rem); transform: none; align-items: flex-start; }
  /* the GM's tools wrap: one row ran under the view's group on a phone */
  .mapa-przyciski { flex-wrap: wrap; gap: .15rem; padding: .2rem; }
}
/* „Ustawienia mapy” (mapa_walki.html): a dialog docked beside the map with no shade, the map in sight and movable
   under it while the grid or the darkness is set; a phone's at the bottom, the map's top over it */
.overlay.mapa-ustawienia-okno { background: none; pointer-events: none; }
.mapa-ustawienia-okno .sheet { pointer-events: auto; display: flex; flex-direction: column; gap: .6rem; max-height: calc(60dvh / var(--zoom)); }
.mapa-ustawienia > h3 { margin: .6rem 0 0; font-size: 1rem; }
.mapa-ustawienia > h3:first-of-type { margin-top: 0; }
.mapa-ustawienia :is(.field, p) { margin-block: 0; }
.mapa-ustawienia .przelaczniki { display: grid; gap: .55rem; justify-items: start; }
.mapa-ustawienia .przelaczniki > .field { justify-self: stretch; }  /* „Mrok sceny”: its words never move the slider */
@media (min-width: 700px) {
  .overlay.mapa-ustawienia-okno { justify-content: flex-end; align-items: flex-start; padding: calc(var(--topbar-h, 58px) + .5rem) .5rem .5rem; }
  .mapa-ustawienia-okno .sheet { max-width: 24rem; max-height: calc(100dvh / var(--zoom) - var(--topbar-h, 58px) - 1rem); }
}
/* a token: a portrait or initials in a ring of its side's colour; sized in px of the map, its ring and words in px of
   the screen (--skala). The ring is an arc of the Wounds left (--zyw, a percent: mapa.js `stylZetonu`), the rest of
   it pale. The turn glows, the panel's pick is dashed, who is out of the fight is grey and
   crossed, the GM's hidden one faded. */
.zeton {
  --pierscien: min(calc(4px / var(--skala, 1)), .32em); --strona: var(--teal);
  position: relative; display: grid; place-items: center; box-sizing: border-box; border-radius: 50%; overflow: visible;
  padding: var(--pierscien); background: var(--surface-2); color: var(--ink); font-weight: 700; line-height: 1; white-space: nowrap;
}
.zeton.wrog { --strona: var(--bad); }
.zeton.postronny { --strona: var(--postronni); }
.zeton::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--strona) calc(var(--zyw, 100) * 1%), color-mix(in srgb, var(--strona) 22%, var(--surface-2)) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--pierscien)), #000 calc(100% - var(--pierscien) + .5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--pierscien)), #000 calc(100% - var(--pierscien) + .5px));
}
.mapa-scena > .zeton { position: absolute; }
/* square: a grid item's 100% height would follow a tall picture (a bestiary illustration) past the token's ring */
.zeton img { width: 100%; height: 100%; aspect-ratio: 1; border-radius: 50%; object-fit: cover; pointer-events: none; }
.zeton.chwytny { cursor: grab; }
.zeton.aktywny { z-index: 1; box-shadow: 0 0 0 calc(3px / var(--skala, 1)) var(--gold), 0 0 calc(16px / var(--skala, 1)) calc(4px / var(--skala, 1)) var(--gold); }
/* mounted combat (5e s. 168): the rider over its mount's token, one token; the mount on its turn stays under it */
.zeton.jedzie { z-index: 1; }
.zeton.niesie.aktywny { z-index: auto; }
.zeton.poza { filter: grayscale(1); opacity: .55; }
.zeton.ukryty { opacity: .5; }
.zeton.zaznaczony { outline: calc(2px / var(--skala, 1)) dashed var(--ink); outline-offset: calc(3px / var(--skala, 1)); }
.zeton.wybrany { outline: calc(2px / var(--skala, 1)) dashed var(--wybor); outline-offset: calc(3px / var(--skala, 1)); }
/* the GM's group (mapa_grupa.js): solid, unlike the tapped one's and the panel's dashed rings; it wins over them */
.zeton.w-zaznaczeniu { outline: calc(3px / var(--skala, 1)) solid var(--wybor); outline-offset: calc(3px / var(--skala, 1)); }
/* one out of the fight (a system's `klasyZetonuSystemu` ``poza``): greyed and crossed */
.zeton.poza::after {
  content: ""; position: absolute; inset: 20%; pointer-events: none;
  background: linear-gradient(45deg, transparent calc(50% - .06em), var(--ink) 0 calc(50% + .06em), transparent 0),
              linear-gradient(-45deg, transparent calc(50% - .06em), var(--ink) 0 calc(50% + .06em), transparent 0);
}
/* two Conditions on its bottom edge („+N” the rest), on the screen's scale; the name goes under them */
.zeton-stany {
  position: absolute; left: 50%; top: 100%; z-index: 1; display: flex; align-items: center; gap: 2px; padding: 1px 4px;
  transform: translate(-50%, -50%) scale(calc(1 / var(--skala, 1))); border-radius: 999px; pointer-events: none;
  background: var(--surface); color: var(--warn); box-shadow: 0 1px 3px rgb(0 0 0 / 35%); font-size: 11px; font-weight: 700;
}
.zeton-stany > span { display: inline-flex; align-items: center; }
.zeton-stany .ikona { width: 13px; height: 13px; }
.zeton:has(> .zeton-stany:not([style*="none"])) .zeton-podpis { margin-top: calc(10px / var(--skala, 1)); }
/* the name under the token, over the next token down (side by side on a grid, it hid the name) */
.zeton-podpis {
  display: none; position: absolute; z-index: 2; top: 100%; left: 50%; transform: translateX(-50%) scale(calc(1 / var(--skala, 1)));
  transform-origin: top center; margin-top: 2px; padding: 0 .3rem; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 12px; font-weight: 600; pointer-events: none;
}
.z-podpisami .zeton-podpis, .zeton.zaznaczony .zeton-podpis { display: block; }
/* what waits on a token (partials/mapa_walki.html): a defence's shield pulsing, a waiting hit's bubble („−5” for the
   GM); over its top right on the screen's scale, a tap brings its card in sight */
.zeton-czeka {
  position: absolute; left: 80%; bottom: 80%; z-index: 1; display: flex; gap: 2px;
  transform: scale(calc(1 / var(--skala, 1))); transform-origin: bottom left;
}
.zeton-czeka > span {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 12px; background: var(--warn); color: var(--surface); font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 35%);
}
.zeton-czeka > .czeka-trafienie { background: var(--accent); color: var(--accent-ink); }
.zeton .zeton-czeka .ikona { width: 14px; height: 14px; margin: 0; }  /* over `span > .ikona`'s margin */
@media (prefers-reduced-motion: no-preference) { .zeton-czeka > .czeka-obrona { animation: puls 1.6s ease-in-out infinite; } }
/* Momentum on a token (partials/mapa_walki.html): a gold disc over its top left, on the screen's scale */
.zeton-momentum {
  position: absolute; right: 80%; bottom: 80%; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px;
  transform: scale(calc(1 / var(--skala, 1))); transform-origin: bottom right; border-radius: 50%; pointer-events: none;
  background: var(--gold); color: var(--surface); box-shadow: 0 0 0 1.5px var(--surface), 0 1px 3px rgb(0 0 0 / 35%);
}
.zeton .zeton-momentum .ikona { width: 14px; height: 14px; margin: 0; }  /* likewise; even, as the disc */
/* a player's token waiting in an exit for the GM (partials/mapa_walki.html): a warn disc on its right edge, clear of
   the exit's „→ Karczma” under it and of the corners' marks */
.zeton-prosi {
  position: absolute; left: 88%; top: 50%; z-index: 1; display: grid; place-items: center; width: 22px; height: 22px;
  transform: translateY(-50%) scale(calc(1 / var(--skala, 1))); transform-origin: left center; border-radius: 50%; cursor: pointer;
  background: var(--warn); color: var(--surface); box-shadow: 0 0 0 1.5px var(--surface), 0 1px 3px rgb(0 0 0 / 35%);
}
.zeton .zeton-prosi .ikona { width: 14px; height: 14px; margin: 0; }
/* a token hooked to another (mapa_podpiecia.js): a chain on its left edge, clear of the corners' marks; a tap opens
   its popover. The rope dotted between it and its leader while either is picked, along the column while dragged; the
   dragged leader's column follows a moment behind */
.zeton-za {
  position: absolute; right: 88%; top: 50%; z-index: 1; display: grid; place-items: center; width: 20px; height: 20px;
  transform: translateY(-50%) scale(calc(1 / var(--skala, 1))); transform-origin: right center; border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1.5px var(--wybor), 0 1px 3px rgb(0 0 0 / 35%);
}
.zeton .zeton-za .ikona { width: 13px; height: 13px; margin: 0; }
.liny-podpiec :is(line, polyline) { fill: none; stroke: var(--wybor); stroke-linecap: round; stroke-linejoin: round;
  stroke-width: calc(3px / var(--skala, 1)); stroke-dasharray: 0 calc(7px / var(--skala, 1));
  filter: drop-shadow(0 0 calc(1px / var(--skala, 1)) rgb(0 0 0 / 60%)); }
@media (prefers-reduced-motion: no-preference) { .podaza-teraz { transition: transform .18s ease-out, translate .18s ease-out; } }
.prosba-przejscia { align-items: center; }
.prosba-przejscia .ikona { width: 14px; height: 14px; vertical-align: -2px; margin-right: 4px; }
/* what lies under a token's disc (partials/mapa_walki.html): the thing's look (a gold ring, `.mapa-przedmiot`) over its
   bottom right, the count beside a box for more; on the screen's scale, a tap opens the token's popover */
.zeton-przedmioty {
  position: absolute; left: 80%; top: 80%; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 1px;
  box-sizing: border-box; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; cursor: pointer;
  transform: scale(calc(1 / var(--skala, 1))); transform-origin: top left;
  background: var(--surface); color: var(--ink); font-size: 11px; font-weight: 700;
  box-shadow: 0 0 0 1.5px var(--gold), 0 1px 3px rgb(0 0 0 / 35%);
}
.zeton .zeton-przedmioty .ikona { width: 13px; height: 13px; margin: 0; }  /* over `span > .ikona`'s margin */
/* the fog (komponenty/walka/mapa_mgla.js), lines on the screen's scale: the canvas drawn on the page (the GM's half
   seen through, a player's whole); the GM's areas shaded, dashed once uncovered, the one picked ringed, taken by a tap
   only with the fog tool's areas (the tokens let it through); the area on its way, its corners dots. „Jak gracze”:
   the GM's fog opaque, with the covered areas as players have them (the svg's only take the taps and ring the one
   picked). A brush stroke's trace (in .mapa-szkic) light where it uncovers; the brush's ring over the tokens where a
   pointer hovers. */
.mapa-mgla { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mapa-gpu.mg { opacity: .6; }
.jak-gracze .mapa-gpu, .mapa-gpu.podglad { opacity: 1; }
.jak-gracze .mapa-mgla polygon:not(.zaznaczony) { fill-opacity: 0; stroke: none; }
.jak-gracze .mapa-mgla polygon.zaznaczony { fill-opacity: 0; }
.mapa-szkic .pedzel { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mapa-szkic .pedzel.odkrywa { stroke: #e9e4d5; stroke-opacity: .55; }
.kursor-pedzla {
  fill: none; stroke: var(--ink); stroke-width: calc(1.5px / var(--skala, 1));
  stroke-dasharray: calc(4px / var(--skala, 1)) calc(3px / var(--skala, 1));
}
.kursor-pedzla:not(.widoczny) { visibility: hidden; }
@media (hover: none) { .kursor-pedzla { visibility: hidden; } }
.mapa-mgla polygon { fill-opacity: .6; stroke: #e9e4d5; stroke-opacity: .7; stroke-width: calc(1.5px / var(--skala, 1)); }
.mapa-mgla polygon.odkryty {
  fill-opacity: 0; stroke: #1f1b16; stroke-opacity: .85; stroke-width: calc(2px / var(--skala, 1));
  stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1));
}
.mapa-mgla polygon.zaznaczony { stroke: var(--accent); stroke-opacity: 1; stroke-width: calc(3px / var(--skala, 1)); }
.mapa-pole.zakrywa .mapa-mgla polygon[data-oid] { pointer-events: all; cursor: pointer; }
.mapa-pole.zakrywa .zeton { pointer-events: none; }
.mapa-scena .mgla-nowa { fill: var(--accent); fill-opacity: .25; stroke: var(--accent); stroke-width: calc(2px / var(--skala, 1)); }
.mapa-scena .zaznaczanie {
  fill: var(--wybor); fill-opacity: .12; stroke: var(--wybor); stroke-width: calc(1.5px / var(--skala, 1));
  stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1));
}
.mapa-mgla .rogi { fill: none; stroke: var(--accent); stroke-linecap: round; stroke-width: calc(10px / var(--skala, 1)); }
.mapa-mgla-pasek .zaznaczony { outline: 2px solid var(--wybor); outline-offset: 1px; }
.mapa-mgla-pasek .seg button, .mapa-ustawienia .seg button { min-height: 32px; padding: .2rem .55rem; font-size: .88rem; white-space: nowrap; gap: .25em; }  /* as .btn.small; the gap a space */
.mapa-mgla-pasek input[type="range"], .mapa-swiatlo-pasek input[type="range"] { width: 6rem; }
/* an imported map's walls (komponenty/walka/mapa_sciany.js), the GM's alone, lines on the screen's scale: one path, a
   light line under a violet one, so they show on any picture; a light's pale circle and its dot; a door a bar across
   its gap, solid while closed, dashed once open, tapped with the moving tool (its wide band); a window a thin line,
   tapped only with the layer shown and not „Jak gracze” (its popover changes it). „Jak gracze” hides them (below), as
   players never get them; a player's layer has the doors marked for players its characters see. */
.mapa-sciany { --sciana: #6d3fd8; position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mapa-sciany > path { fill: none; stroke: var(--sciana); stroke-width: calc(2.5px / var(--skala, 1)); stroke-linecap: round; stroke-linejoin: round; }
.mapa-sciany > path.jasna { stroke: #fff; stroke-width: calc(5px / var(--skala, 1)); opacity: .8; }
.mapa-sciany .zasieg { fill-opacity: .1; stroke-opacity: .7; stroke-width: calc(1.5px / var(--skala, 1));
  stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1)); }
.mapa-sciany .zrodlo { stroke: #1f1b16; stroke-width: calc(1.5px / var(--skala, 1)); }
.mapa-sciany .jasne { fill: none; stroke-opacity: .7; stroke-width: calc(1px / var(--skala, 1)); }  /* a light's bright part */
/* the GM's own lights (mapa_swiatla.js): taken by a wide invisible disc only with the tool „Światło” (.swietli), dimmed once
   put out, the picked one's reach ringed solid */
.mapa-sciany .uchwyt { fill: transparent; stroke: none; }
.mapa-pole.swietli .mapa-sciany .uchwyt { pointer-events: all; cursor: pointer; }
.mapa-sciany .zgaszone { opacity: .35; }
.mapa-sciany .wybrane .zasieg { stroke-dasharray: none; stroke-opacity: 1; }
.mapa-sciany .drzwi line { stroke: var(--gold); stroke-linecap: butt; }
.mapa-sciany .drzwi.gracze line:first-child { stroke: #3faa5c; }  /* players open it (a player's layer has these alone) */
.mapa-sciany .drzwi.otwarte line:first-child { stroke-dasharray: calc(var(--kratka, 64px) * .12); }
.mapa-sciany .drzwi.okno line:first-child { stroke: #4aa8d8; stroke-width: calc(4px / var(--skala, 1)); stroke-linecap: round; }
.mapa-sciany .drzwi .obrys { stroke: transparent; stroke-width: calc(20px / var(--skala, 1)); }
.mapa-pole:not(.rysuje) :is(.mapa-sciany .drzwi:not(.okno), .mapa-walki:not(.jak-gracze) .mapa-sciany:not(.ukryte) .drzwi) .obrys { pointer-events: stroke; cursor: pointer; }
.mapa-sciany .drzwi.wybrane line:first-child { stroke: var(--wybor); }  /* the GM's popover's (mapa_sciany.js `drzwiU`) */
/* the GM's group of doors (mapa_sciany.js `drzwiZaznaczone`): its band shows in the picking colour; with „Drzwi i okna” every band takes a tap */
.mapa-sciany .ramka-drzwi { stroke: var(--wybor); stroke-linecap: round; stroke-width: calc(var(--kratka, 64px) * .2 + 8px / var(--skala, 1)); }
.mapa-sciany .ramka-drzwi.jasna { stroke: #fff; stroke-width: calc(var(--kratka, 64px) * .2 + 3px / var(--skala, 1)); }
.mapa-sciany .ramka-drzwi.okno { stroke-width: calc(12px / var(--skala, 1)); }
.mapa-sciany .ramka-drzwi.okno.jasna { stroke-width: calc(7px / var(--skala, 1)); }
.mapa-sciany.drzwiami .drzwi .obrys { pointer-events: stroke; cursor: pointer; }
/* the GM's hidden markers (mapa_znaczniki.js): a dashed circle of its reach, its icon a screen's size in the middle */
.mapa-znacznik { position: absolute; width: 0; height: 0; pointer-events: none; --znacznik: #d35400; }
.mapa-znacznik .krag { position: absolute; left: calc(-1 * var(--r)); top: calc(-1 * var(--r)); width: calc(2 * var(--r)); height: calc(2 * var(--r));
  border-radius: 50%; border: calc(2px / var(--skala, 1)) dashed var(--znacznik); background: color-mix(in srgb, var(--znacznik) 10%, transparent); }
.mapa-znacznik .ikona-znacznika { position: absolute; --b: calc(28px / var(--skala, 1)); width: var(--b); height: var(--b); left: calc(var(--b) / -2); top: calc(var(--b) / -2);
  display: grid; place-items: center; border-radius: 50%; background: var(--znacznik); color: #fff; pointer-events: auto; cursor: pointer;
  box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) #fff; }
.mapa-znacznik .ikona-znacznika .ikona { width: 62%; height: 62%; margin: 0; }  /* over `span > .ikona`'s margin */
.mapa-znacznik.wybrany { --znacznik: var(--wybor); }
.mapa-znacznik.zuzyty { opacity: .45; }
/* one set off: a halo round its icon pulses — opacity alone, which the compositor animates without painting the map */
.mapa-znacznik.czeka::before { content: ""; position: absolute; --h: calc(40px / var(--skala, 1)); width: var(--h); height: var(--h);
  left: calc(var(--h) / -2); top: calc(var(--h) / -2); border-radius: 50%; background: color-mix(in srgb, var(--znacznik) 40%, transparent); opacity: 0; }
@media (prefers-reduced-motion: no-preference) { .mapa-znacznik.czeka::before { animation: puls-znacznika 1.4s ease-in-out infinite; } }
@keyframes puls-znacznika { 50% { opacity: 1; } }
.mapa-znacznik-pasek :is(select, input), .mapa-swiatlo-pasek input:not(.kolor-mapy) { width: auto; }
/* the lit places' glow (lib/mapa_gpu.js `barwa`): the picture multiplied by the lights' colour, as Dungeondraft lights */
.mapa-gpu .barwa { mix-blend-mode: multiply; }
.mapa-znacznik-pasek .opis-znacznika { width: 14rem; }
/* the passages' ends (mapa_przejscia.js): a dashed circle, its icon a screen's size in the middle (as a marker's); the
   picked passage's ends teal, the tapped end's circle solid, a dashed line between them; the first end of a new one
   fainter, and its circle while it is dragged out. A player's end is the circle alone. */
.mapa-przejscie, .szkic-przejscia { --przejscie: #2f6fd6; }
.mapa-przejscie { position: absolute; width: 0; height: 0; pointer-events: none; }
.mapa-przejscie .krag { position: absolute; left: calc(-1 * var(--r)); top: calc(-1 * var(--r)); width: calc(2 * var(--r)); height: calc(2 * var(--r));
  border-radius: 50%; border: calc(2px / var(--skala, 1)) dashed var(--przejscie); background: color-mix(in srgb, var(--przejscie) 12%, transparent); }
.mapa-przejscie .ikona-przejscia { position: absolute; --b: calc(26px / var(--skala, 1)); width: var(--b); height: var(--b); left: calc(var(--b) / -2); top: calc(var(--b) / -2);
  display: grid; place-items: center; border-radius: 50%; background: var(--przejscie); color: #fff; pointer-events: auto; cursor: pointer;
  box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) #fff; }
.mapa-przejscie .ikona-przejscia .ikona { width: 62%; height: 62%; margin: 0; }
.mapa-przejscie .dokad-przejscia { position: absolute; top: calc(16px / var(--skala, 1)); left: 0; transform: translateX(-50%); white-space: nowrap;
  font-size: calc(12px / var(--skala, 1)); font-weight: 600; line-height: 1.4; padding: 0 calc(6px / var(--skala, 1));
  border-radius: calc(9px / var(--skala, 1)); background: var(--przejscie); color: #fff; box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) #fff; }
.mapa-przejscie .podpis-przejscia { position: absolute; top: calc(var(--r) + 4px / var(--skala, 1)); left: 0; transform: translateX(-50%);
  white-space: nowrap; font-size: calc(12px / var(--skala, 1)); font-weight: 600; line-height: 1.4; padding: 0 calc(6px / var(--skala, 1));
  border-radius: calc(9px / var(--skala, 1)); background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) var(--przejscie); }
/* a hidden passage, the GM's alone: its circle fainter, an eye-off disc on its icon's corner */
.mapa-przejscie.ukryte .krag { border-style: dotted; background: color-mix(in srgb, var(--przejscie) 6%, transparent); }
.mapa-przejscie .ukryte-przejscie { position: absolute; right: -32%; top: -32%; display: grid; place-items: center; width: 58%; height: 58%;
  border-radius: 50%; background: var(--ink); color: var(--surface); box-shadow: 0 0 0 calc(1px / var(--skala, 1)) #fff; }
.mapa-przejscie .ikona-przejscia .ukryte-przejscie .ikona { width: 74%; height: 74%; margin: 0; }
.mapa-przejscie.wybrany { --przejscie: var(--wybor); }
.mapa-przejscie.koniec .krag { border-style: solid; }
.mapa-przejscie.szkic { opacity: .6; }
.mapa-przejscie.szkic .ikona-przejscia { pointer-events: none; }
.szkic-przejscia { fill: color-mix(in srgb, var(--przejscie) 12%, transparent); stroke: var(--przejscie); stroke-width: calc(2px / var(--skala, 1));
  stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1)); }
.mapa-przejscie-linia { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mapa-przejscie-linia line { stroke: var(--wybor); stroke-width: calc(2.5px / var(--skala, 1)); stroke-dasharray: calc(8px / var(--skala, 1)) calc(5px / var(--skala, 1)); }
.mapa-przejscie-pasek input { width: auto; }
.mapa-przejscie-pasek .nazwa-przejscia { width: 12rem; }
.mapa-przejscie-pasek .dokad-wyjscia { max-width: 10rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the things lying on the map (mapa_przedmioty.js): an icon on a disc a screen's size, ringed gold to show on any
   picture; the tapped one teal, the GM's hidden one faded */
.mapa-przedmiot { position: absolute; width: 0; height: 0; pointer-events: none; }
.mapa-przedmiot .ikona-przedmiotu { position: absolute; --b: calc(28px / var(--skala, 1)); width: var(--b); height: var(--b);
  left: calc(var(--b) / -2); top: calc(var(--b) / -2); display: grid; place-items: center; border-radius: 50%;
  background: var(--surface); color: var(--ink); pointer-events: auto; cursor: pointer;
  box-shadow: 0 0 0 calc(2px / var(--skala, 1)) var(--gold), 0 calc(1px / var(--skala, 1)) calc(4px / var(--skala, 1)) rgb(0 0 0 / 45%); }
.mapa-przedmiot .ikona-przedmiotu .ikona { width: 58%; height: 58%; margin: 0; }
.mapa-przedmiot.wybrany .ikona-przedmiotu { box-shadow: 0 0 0 calc(3px / var(--skala, 1)) var(--wybor), 0 calc(1px / var(--skala, 1)) calc(4px / var(--skala, 1)) rgb(0 0 0 / 45%); }
.mapa-przedmiot.ukryty { opacity: .5; }
.okno-przedmiotu { max-width: 30rem; }
/* the GM's objects (mapa_obiekty.js): a picture in a rounded square of its size in squares (`--bok`, px of the map),
   squared off so it never reads as a token's disc, a thin rim a screen's width; the tapped one ringed teal, the GM's
   hidden one faded */
.mapa-obiekt { position: absolute; width: var(--bok); height: var(--bok); margin: calc(var(--bok) / -2) 0 0 calc(var(--bok) / -2);
  border-radius: 12%; overflow: hidden; background: var(--surface-2); cursor: pointer;
  box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) var(--surface), 0 calc(1px / var(--skala, 1)) calc(5px / var(--skala, 1)) rgb(0 0 0 / 45%); }
.mapa-obiekt img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.mapa-obiekt.wybrany { box-shadow: 0 0 0 calc(3px / var(--skala, 1)) var(--wybor), 0 calc(1px / var(--skala, 1)) calc(5px / var(--skala, 1)) rgb(0 0 0 / 45%); }
.mapa-obiekt.ukryty { opacity: .5; }
/* a system's object with no picture (D&D's chest): its action's icon, no rim nor ground — seen, not glaring */
.mapa-obiekt.akcja { background: none; box-shadow: none; overflow: visible; display: grid; place-items: center;
  color: color-mix(in srgb, var(--gold) 70%, #3b2a12); }
.mapa-obiekt.akcja svg { width: 78%; height: 78%; pointer-events: none;
  filter: drop-shadow(0 0 calc(1px / var(--skala, 1)) rgb(255 255 255 / 55%)); }
.mapa-obiekt.akcja.wybrany { box-shadow: none; outline: calc(2px / var(--skala, 1)) dashed var(--wybor); outline-offset: calc(2px / var(--skala, 1)); }
.okno-obiektu { max-width: 30rem; }
.podglad-obiektu { flex: none; display: grid; place-items: center; width: 6rem; height: 6rem; border-radius: 12%; overflow: hidden;
  background: var(--surface-2); box-shadow: 0 0 0 1px var(--border); }
.podglad-obiektu img { width: 100%; height: 100%; object-fit: cover; }
.podglad-obiektu .ikona { width: 2rem; height: 2rem; }
/* „Dokąd prowadzi” (mapa_przejscia.js `otworzCel`): scenes as rows with their map's thumbnail, then the target map's
   preview, its walls and exits a thin layer, a tap the place of arrival */
.okno-celu { max-width: 34rem; }
.naglowek-celu { margin: .5rem 0 0; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cel-przejscia { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .4rem .6rem .4rem .4rem; text-align: left; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font: inherit; }
.cel-przejscia:hover { border-color: var(--wybor); }
.cel-przejscia.wybrany { border-color: var(--wybor); box-shadow: inset 0 0 0 1px var(--wybor); }
.grupa-celu { display: flex; flex-direction: column; gap: .4rem; }
.opis-celu { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.cel-przejscia strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.miniatura-celu { flex: none; display: grid; place-items: center; width: 4.5rem; height: 3rem; border-radius: 6px; overflow: hidden;
  background: var(--surface-2); color: var(--muted); }
.miniatura-celu > span { display: contents; }
.miniatura-celu img { width: 100%; height: 100%; object-fit: cover; }
.miniatura-celu .ikona { width: 1.4rem; height: 1.4rem; margin: 0; }
.podglad-celu { position: relative; align-self: center; width: min(100%, calc(50dvh / var(--zoom) * var(--proporcja))); aspect-ratio: var(--proporcja);
  border-radius: 8px; overflow: hidden; cursor: crosshair; background: var(--bg); border: 1px solid var(--border); }
.podglad-celu.papier { background-color: var(--surface); background-image: linear-gradient(var(--border) 1px, transparent 1px),
  linear-gradient(90deg, var(--border) 1px, transparent 1px); background-size: 6% calc(6% * var(--proporcja)); }
.podglad-celu img, .podglad-celu svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.podglad-celu .sciany-celu { fill: none; stroke: #fff; stroke-width: 1.5px; opacity: .8; }
.podglad-celu .wyjscie-celu { fill: color-mix(in srgb, #2f6fd6 18%, transparent); stroke: #2f6fd6; stroke-width: 1.5px; stroke-dasharray: 4 3; }
.znak-celu { position: absolute; display: grid; place-items: center; width: 2.2rem; height: 2.2rem; transform: translate(-50%, -50%); pointer-events: none;
  border-radius: 50%; background: var(--wybor); color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--wybor) 35%, transparent), var(--shadow); }
.znak-celu .ikona { width: 1.4rem; height: 1.4rem; margin: 0; }
.opis-obiektu { white-space: pre-line; }
.mapa-pole:not(.rysuje) .mapa-sciany .drzwi:hover line:first-child { stroke: var(--wybor); }
/* as players see it, or with the layer off (.ukryte): the GM's walls and lights hidden — with „Światło” its lights' dots
   (the picked one's reach too), to drag over the players' view —, a door only under a mouse, to click; on a touch
   screen none (a finger brushing one unseen would turn it); „Drzwi i okna” (.drzwiami) shows the layer whole */
:is(.jak-gracze .mapa-sciany:not(.drzwiami), .mapa-sciany.ukryte) > path, .mapa-pole:not(.swietli) :is(.jak-gracze .mapa-sciany:not(.drzwiami), .mapa-sciany.ukryte) > .swiatla,
:is(.jak-gracze .mapa-sciany:not(.drzwiami), .mapa-sciany.ukryte) :not(.wybrane) > :is(.zasieg, .jasne) { display: none; }
:is(.jak-gracze .mapa-sciany:not(.drzwiami), .mapa-sciany.ukryte) .drzwi:not(:hover) line:first-child { visibility: hidden; }
@media (hover: none) { :is(.jak-gracze .mapa-sciany:not(.drzwiami), .mapa-sciany.ukryte) .drzwi { display: none; } }
/* drawings (komponenty/walka/mapa_rysunki.js), in px of the map: each with a wide invisible band (.obrys, its width on
   the screen) that the eraser hits, only over what the session may rub out; the tokens let the eraser through. What
   measures (.mapa-miary) is over the tokens. */
.mapa-rysunki, .mapa-miary { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.mapa-miary { z-index: 2; }
.mapa-rysunki text, .mapa-miary text {
  font-weight: 700; text-anchor: middle; dominant-baseline: middle;
  paint-order: stroke; stroke: color-mix(in srgb, var(--surface) 85%, transparent); stroke-width: .2em; stroke-linejoin: round;
}
.mapa-rysunki .obrys { fill: none; stroke: transparent; stroke-width: calc(20px / var(--skala, 1)); }
/* an area template walls cut (mapa_rysunki.js `zaSciana`): its whole outline dashed under what they leave of it */
.mapa-rysunki .za-sciana {
  fill: none; stroke-opacity: .7; stroke-width: calc(2px / var(--skala, 1));
  stroke-dasharray: calc(8px / var(--skala, 1)) calc(6px / var(--skala, 1));
}
.mapa-pole.gumka .zmazywalny .obrys { pointer-events: stroke; cursor: pointer; }
.mapa-pole.gumka .zmazywalny text.obrys { pointer-events: all; }
.mapa-pole.gumka .zmazywalny:hover { opacity: .45; }
.mapa-pole.gumka .zeton { pointer-events: none; }
.mapa-szkic { opacity: .7; }
.mapa-pole.gumka .zmazywalny.obszar .obrys { pointer-events: all; }  /* an area is rubbed out from inside it too */
/* an area template's middle dot, which drags it with „Przesuwanie” and „Obszar” (.szablon): its colour on a white ring, seen
   on a dark theme and a dark colour too */
.mapa-rysunki .srodek-szablonu path { stroke-linecap: round; stroke-width: calc(9px / var(--skala, 1)); }
.mapa-rysunki .srodek-szablonu path:first-child { stroke: rgb(255 255 255 / 85%); stroke-width: calc(13px / var(--skala, 1)); }
.mapa-pole:is(:not(.rysuje), .szablon) .mapa-rysunki .srodek-szablonu path:first-child { pointer-events: stroke; cursor: move; }
/* what measures, its lines and words on the screen's scale: the ruler, a dragged token's distance and its rings of
   what is left of Walk, Run and Sprint, an area's caption; the engagement lines between tokens and the mark between each two
   (its size on the screen, at most half a square); a token an area covers is ringed */
.mapa-scena text.podpis { font-size: calc(13px / var(--skala, 1)); fill: var(--ink); }
.miarka line, .miarka .krag, .mapa-zwiazania line { fill: none; stroke-width: calc(2px / var(--skala, 1)); }
.miarka line { stroke: var(--ink); stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1)); }
.miarka .krag.chod { stroke: var(--ok); }
.miarka .krag.bieg { stroke: var(--warn); }
.miarka .krag.sprint { stroke: var(--bad); }
.miarka .za-scianami .krag { stroke-dasharray: calc(6px / var(--skala, 1)) calc(5px / var(--skala, 1)); opacity: .6; }
/* „Ruch wszystkich” (mapa_rysunki.js `narysujRuchWszystkich`), under the tokens: the turn's token's rings as dragged, the
   others' faint, so twenty of them do not drown the map */
.ruch-wszystkich .miarka:not(.teraz) .krag { opacity: .55; stroke-width: calc(1.5px / var(--skala, 1)); }
.ruch-wszystkich .miarka:not(.teraz) .za-scianami .krag { opacity: .35; }
.ruch-wszystkich .miarka:not(.teraz) text.podpis { font-size: calc(11px / var(--skala, 1)); fill: var(--muted); }
/* a wall stopped the dragged token: a thin dashed line on from it to a cross where the pointer is */
.miarka line.za-sciana { stroke: var(--bad); stroke-width: calc(1.5px / var(--skala, 1)); }
.miarka .krzyzyk line { stroke: var(--bad); stroke-dasharray: none; stroke-linecap: round; stroke-width: calc(2.5px / var(--skala, 1)); }
.mapa-zwiazania line { stroke: var(--bad); opacity: .8; }
.mapa-zwiazanie {
  --bok: min(calc(22px / var(--skala, 1)), calc(var(--kratka, 64px) / 2));
  position: absolute; z-index: 2; width: var(--bok); height: var(--bok); margin: calc(var(--bok) / -2) 0 0 calc(var(--bok) / -2);
  display: grid; place-items: center; border-radius: 50%; pointer-events: none;
  background: var(--bad); color: var(--surface); box-shadow: 0 0 0 calc(1.5px / var(--skala, 1)) var(--surface);
}
.mapa-zwiazanie .ikona { width: 70%; height: 70%; }
/* a free attack on one who fled (5e s. 163): dashed, Momentum's gold */
.mapa-zwiazania line.wolny-atak { stroke: var(--gold); opacity: 1; stroke-dasharray: calc(8px / var(--skala, 1)) calc(5px / var(--skala, 1)); }
.mapa-zwiazanie.wolny-atak { background: var(--gold); }
.zeton.w-obszarze::after, .zeton.pod-szkicem::after, .zeton.pod-obszarem::after {
  content: ""; position: absolute; inset: calc(-6px / var(--skala, 1)); border-radius: 50%; pointer-events: none;
  border: calc(3px / var(--skala, 1)) solid var(--warn);
}
.promien-mapy, .skala-mapy { display: inline-flex; flex: none; align-items: center; gap: .3rem; white-space: nowrap; }
.promien-mapy input, .skala-mapy input { width: 4.5rem; }
/* a ping: a ring of a screen's size that pulses (still, with reduced motion), the name of who called */
.mapa-ping { position: absolute; z-index: 2; pointer-events: none; }
.mapa-ping::before {
  content: ""; position: absolute; box-sizing: border-box; border-radius: 50%;
  left: calc(-28px / var(--skala, 1)); top: calc(-28px / var(--skala, 1)); width: calc(56px / var(--skala, 1)); height: calc(56px / var(--skala, 1));
  border: calc(4px / var(--skala, 1)) solid var(--gold); box-shadow: 0 0 calc(12px / var(--skala, 1)) var(--gold);
}
.mapa-ping > span {
  position: absolute; left: 0; top: calc(32px / var(--skala, 1)); transform: translateX(-50%) scale(calc(1 / var(--skala, 1)));
  transform-origin: top center; padding: 0 .3rem; border-radius: var(--radius-sm); white-space: nowrap;
  background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 12px; font-weight: 600;
}
@media (prefers-reduced-motion: no-preference) { .mapa-ping::before { animation: mapa-ping 1s ease-out infinite; } }
@keyframes mapa-ping { from { transform: scale(.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
/* the tapped token's popover (mapa.js `ulozDymek`): under the token, or over it where the box ends; a phone's a card
   at the map's bottom. A row with nothing shown takes no room (Alpine's x-show hides with an inline style) */
.zeton-dymek {
  position: absolute; z-index: 4; left: var(--dymek-x, .5rem); top: var(--dymek-y, .5rem); margin: 0;
  display: flex; flex-direction: column; gap: .35rem; width: max-content; max-width: min(24rem, calc(100% - 1rem));
  max-height: calc(100% - 1rem); overflow-y: auto; padding: .45rem .6rem; box-shadow: var(--shadow);
}
.zeton-dymek > .row:not(:has(> :not(template, [style*="none"]))) { display: none; }
.zeton-dymek .znaczniki { gap: .25rem; }
/* its „Leży tu” (mapa_przedmioty.js `podZetonem`): the label, then a line per thing — its name, its „Weź” */
.lezy-tu { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .25rem .4rem; }
.lezy-tu > .muted { grid-column: 1; grid-row: 1; }
.lezy-tu .rzecz-pod-zetonem { display: contents; }
.lezy-tu .rzecz-pod-zetonem > .ghost { grid-column: 2; justify-self: start; max-width: 100%; }
.lezy-tu .rzecz-pod-zetonem > .ghost > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lezy-tu .rzecz-pod-zetonem > :last-child { grid-column: 3; }
.swiatlo-zetonu { display: contents; }  /* its buttons in the row it stands in (znaczniki_walki.html) */
@media (max-width: 699px) { .zeton-dymek { left: .5rem; right: .5rem; top: auto; bottom: .5rem; width: auto; max-width: none; max-height: 60%; } }
/* the panel's character's aim (mapa_cel.js): the target's crosshair over its token, a weapon's rings around the
   character in its bands' colours, the line to the target (dashed: the token under the mouse); while rings show, each
   token it may aim at is ringed in its band's colour, out of range faded */
/* the reticle: lock-on corners around the token (its own ring is the side's: a second ring read as one thick one),
   their lines in screen px, a light halo keeping them on any picture; they lock on (scale in) unless motion is
   reduced. The target needs no tapped token's dashes */
.zeton-celownik {
  --ramie: 24%; --gruby: calc(2.5px / var(--skala, 1)); --kolor: var(--bad);
  position: absolute; z-index: 1; inset: calc(-7px / var(--skala, 1)); pointer-events: none;
  background:
    linear-gradient(var(--kolor) 0 0) left top / var(--ramie) var(--gruby), linear-gradient(var(--kolor) 0 0) left top / var(--gruby) var(--ramie),
    linear-gradient(var(--kolor) 0 0) right top / var(--ramie) var(--gruby), linear-gradient(var(--kolor) 0 0) right top / var(--gruby) var(--ramie),
    linear-gradient(var(--kolor) 0 0) left bottom / var(--ramie) var(--gruby), linear-gradient(var(--kolor) 0 0) left bottom / var(--gruby) var(--ramie),
    linear-gradient(var(--kolor) 0 0) right bottom / var(--ramie) var(--gruby), linear-gradient(var(--kolor) 0 0) right bottom / var(--gruby) var(--ramie);
  background-repeat: no-repeat;
  filter: drop-shadow(0 0 calc(1px / var(--skala, 1)) var(--surface)) drop-shadow(0 0 calc(2px / var(--skala, 1)) var(--surface));
}
.zeton.cel { outline: none; }
@media (prefers-reduced-motion: no-preference) { .zeton-celownik { animation: namierz .25s ease-out; } }
@keyframes namierz { from { transform: scale(1.4); opacity: 0; } }
.zeton[data-pasmo] { box-shadow: 0 0 0 calc(4px / var(--skala, 1)) var(--pasmo, var(--ok)); }
.zeton[data-pasmo="poza"] { box-shadow: none; opacity: .4; }
.mapa-zasieg .krag { fill: var(--pasmo, var(--ok)); fill-opacity: .06; stroke: var(--pasmo, var(--ok)); stroke-width: calc(2px / var(--skala, 1)); }
.mapa-zasieg .krag.p0, .zeton[data-pasmo="0"] { --pasmo: var(--pasmo-0); }
.mapa-zasieg .krag.p1, .zeton[data-pasmo="1"] { --pasmo: var(--pasmo-1); }
.mapa-zasieg .krag.p2, .zeton[data-pasmo="2"] { --pasmo: var(--pasmo-2); }
.mapa-zasieg .krag.p3, .zeton[data-pasmo="3"] { --pasmo: var(--pasmo-3); }
.mapa-zasieg .krag.p4, .zeton[data-pasmo="4"] { --pasmo: var(--pasmo-4); }
.mapa-zasieg line { stroke: var(--bad); stroke-width: calc(2px / var(--skala, 1)); stroke-linecap: round; }
/* an armed area (mapa_cel.js): its circle where it was put, dashed while it follows the mouse, red beyond the range;
   the GM's template tapped inside, in the picked colour */
.mapa-zasieg .obszar { fill: var(--warn); fill-opacity: .14; stroke: var(--warn); stroke-width: calc(2.5px / var(--skala, 1)); }
.mapa-zasieg .obszar.podglad { stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1)); fill-opacity: .08; }
.mapa-zasieg .obszar.poza { fill: var(--bad); stroke: var(--bad); }
/* an Overcast's larger area: faint and dashed while armed, plain once its step is picked under the roll */
.mapa-zasieg .obszar.wiekszy { fill: none; stroke-width: calc(1.5px / var(--skala, 1)); stroke-dasharray: calc(3px / var(--skala, 1)) calc(5px / var(--skala, 1)); opacity: .7; }
.mapa-zasieg .obszar.wiekszy.wybrany { fill: var(--warn); fill-opacity: .06; stroke-width: calc(2.5px / var(--skala, 1)); opacity: 1; }
.mapa-rysunki .rysunek.zaznaczony > circle:first-child { stroke: var(--wybor); fill: var(--wybor); }
.mapa-zasieg line.podglad { stroke-dasharray: calc(6px / var(--skala, 1)) calc(4px / var(--skala, 1)); opacity: .7; }
/* WFRP's armed area walls cut (wfrp mapa_cel.js `kolaObszaru`, as a drawn one's `.za-sciana`) */
.mapa-zasieg .obszar.za-sciana { fill: none; stroke-opacity: .7; stroke-dasharray: calc(8px / var(--skala, 1)) calc(6px / var(--skala, 1)); }
.zeton-tacki {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .45rem .15rem .15rem; max-width: 11rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--ink);
  font: inherit; font-size: .85rem; cursor: grab; touch-action: none;
}
.zeton-tacki > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zeton-tacki.on { border-color: var(--wybor); background: var(--wybor-soft); }
.zeton-tacki .zeton { --pierscien: 2px; width: 1.6rem; height: 1.6rem; flex: none; font-size: .65rem; }
/* the drawing's colours and widths („Rysuj ▾”) */
.kolor-mapy, .grubosc-mapy {
  display: grid; place-items: center; flex: none; width: 2rem; height: 2rem; padding: 0; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink);
}
.kolor-mapy { border-radius: 50%; border-width: 3px; background: var(--kolor); }
.kolor-mapy.on, .grubosc-mapy.on { border-color: var(--wybor); box-shadow: 0 0 0 2px var(--wybor-soft); }
/* one's own colour: a dot of it in a rainbow ring (the whole rainbow until one is picked); the native swatch hidden */
.kolor-mapy.wlasny {
  appearance: none; -webkit-appearance: none; min-height: 0;
  background: radial-gradient(circle closest-side, var(--kolor, transparent) 0 60%, transparent 64%),
    conic-gradient(#e74c3c, #f1c40f, #2ecc71, #1abc9c, #3498db, #9b59b6, #e74c3c);
}
.kolor-mapy.wlasny::-webkit-color-swatch-wrapper { padding: 0; opacity: 0; }
.kolor-mapy.wlasny::-moz-color-swatch { opacity: 0; }
@media (max-width: 699px) { .kolor-mapy, .grubosc-mapy { width: 1.75rem; height: 1.75rem; } }  /* a phone's nine colours in a row */
.grubosc-mapy > span { width: min(calc(var(--g) * 1px), 18px); aspect-ratio: 1; border-radius: 50%; background: currentColor; }

/* the picked character's panel (partials/panel_postaci.html), heading the side: a one-line head over its sections; a
   player's turn reddens its edge, something waiting yellows it */
body:has(.panel-postaci) .fab { display: none; }  /* the panel has its own dice button */
.panel-postaci { flex: none; padding: 0; overflow: clip; }  /* clip, not hidden: „Koniec tury” sticks in the side's scroll */
.panel-postaci.tura { border-top: 2px solid var(--accent); }
.panel-postaci.pilny:not(.tura) { border-top: 2px solid var(--warn); }
.panel-glowa {
  display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; width: 100%; min-height: 52px; padding: .4rem 12px;
  background: none; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;  /* a tap folds, never Chrome's Touch to Search */
}
.panel-postaci.tura .panel-glowa { background: var(--accent-soft); }
.panel-znaki { display: flex; gap: .4rem; flex-basis: 100%; }  /* a line of its own, so the name keeps its room */
.panel-imie { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--ink); }
a.panel-imie { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.panel-glowa .zwin { flex: none; min-width: 34px; min-height: 34px; margin-right: -6px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; }
.panel-glowa .nowrap { white-space: nowrap; }
@media (max-width: 480px) { .panel-glowa .pasek-zyw { display: none; } }  /* the numbers stay; the name needs the room */
.tura-znak { flex: none; padding: .15rem .5rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: .85rem; }
.tura-znak.czeka { background: var(--warn); color: var(--surface); }
.tura-znak.bad { background: var(--bad); color: var(--surface); }  /* dying (5e s. 172) */
.panel-tresc { padding: .2rem 12px .8rem; }
.panel-sekcja { margin-top: .75rem; }
.panel-sekcja > h4 { margin: 0 0 .35rem; font-family: inherit; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
/* a section with nothing shown goes, its heading too: no shown child but its heading, or a row of hidden chips only
   (Alpine's x-show hides with an inline style) */
.panel-sekcja:not(:has(> :not(h4, template, .row, [style*="none"]), > .row:not([style*="none"]) > :not(template, [style*="none"]))) { display: none; }
/* an effect's chip with its Rounds' −/+ and „Zdejmij” in „Stan” */
.chip-krok { display: inline-flex; align-items: center; gap: .1rem; flex: none; max-width: 100%; }
.chip-krok .stepper { gap: 0; }
.chip-krok .stepper .btn, .chip-krok .btn.icon { min-width: 30px; min-height: 30px; font-size: 1rem; }
/* a player's „Koniec tury”: at the panel's bottom while it scrolls, right under the head on the folded sheet */
.panel-stopka { position: sticky; bottom: 0; z-index: 1; padding: .5rem 12px; background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 16px 0 var(--surface); }  /* stuck, it covers the side's bottom padding too (the panel clips it otherwise) */
.panel-stopka .btn { min-height: 44px; font-size: 1.05rem; }
.panel-tresc .znaczniki { gap: .25rem; margin-bottom: .5rem; }
/* a row of badges with none shown takes no room (Alpine's x-show hides with an inline style) */
.panel-tresc .znaczniki:not(:has(> :not(template, [style*="none"]))) { display: none; }
/* the initiative queue (partials/kolejka_walki.html, kolejka.js): one row to swipe, first to last, never rotated. The
   turn glows gold, as its token does, and is larger; the next one's chip is dashed gold; the Round's line under the
   chips fills gold up to the turn and ends at the end of the Round's mark, lit when it comes next and while its
   proposals wait. Faces ringed in the side's colour (the tokens'), the panel's pick in --wybor, a marked token's
   chip dashed ink, out of the fight grey. */
.kolejka { position: relative; min-width: 0; }  /* the popover hangs from it */
.kolejka-walki {
  position: relative; display: flex; min-height: 4.3rem; margin: 0; padding: .35rem 16px .4rem;
  list-style: none; overflow-x: auto; scrollbar-width: none;
}
.kolejka-walki > li { position: relative; flex: none; display: flex; align-items: center; padding: 0 .35rem 8px 0; }
.kolejka-walki > li::before, .kolejka-walki > li::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--border);
}
.kolejka-walki > li::after { background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .35s ease-out; }
.kolejka-walki > li.zrobil::after { transform: scaleX(1); }
.kolejka-walki > li.aktywny::after { transform: scaleX(.5); transition-delay: .3s; }  /* the line flows on to the turn */
.kolejka-walki > li.k-koniec { padding-inline: .35rem 0; }
.kolejka-walki > li.k-koniec.aktywny::after { transform: scaleX(1); }
.k-chip {
  display: flex; align-items: center; gap: .4rem; max-width: 15rem; padding: .25rem .55rem .25rem .35rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: inherit; font-size: .82rem; line-height: 1.2; text-align: left; cursor: pointer;
  transition: padding .2s, box-shadow .2s, background-color .2s;
  -webkit-touch-callout: none; user-select: none; -webkit-user-select: none;  /* a long press tells, not copies */
}
.k-ini { display: flex; flex-direction: column; align-items: center; min-width: 1.3rem; }
.k-ini b { font-variant-numeric: tabular-nums; }
.k-ini small { color: var(--warn); font-size: .62rem; font-weight: 600; }
.k-twarz { position: relative; display: inline-grid; }
.k-twarz .awatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--teal); transition: width .2s, height .2s; }
.wrog .k-twarz .awatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bad); }
.postronny .k-twarz .awatar { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--postronni); }
.k-kona { position: absolute; right: -.4rem; bottom: -.3rem; display: grid; place-items: center; width: 1.05rem; height: 1.05rem;
  border-radius: 50%; background: var(--bad); color: var(--surface); }
.k-kona .ikona { width: .72rem; height: .72rem; }
.k-tresc { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.k-imie { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.moj .k-imie::before { content: "★ "; color: var(--gold); }
.k-stan { display: flex; align-items: center; gap: .3rem; min-height: .95rem; color: var(--warn); }
.k-stan .pasek-zyw { width: 2.4rem; height: 5px; }
.k-zdrowie { flex: none; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .72rem; }
.k-stan-ikona { display: inline-flex; align-items: center; gap: 1px; font-size: .68rem; font-weight: 700; }
.k-stan .ikona { width: .9rem; height: .9rem; }
.k-wiecej { font-size: .68rem; font-weight: 700; }
.k-znak { display: inline-flex; color: var(--muted); }
.kolejka-walki .zrobil .k-chip { background: var(--surface-2); }
.kolejka-walki .aktywny .k-chip {
  padding-block: .35rem; border-color: var(--gold); font-size: .9rem;
  background: color-mix(in srgb, var(--gold) 10%, var(--surface));
  box-shadow: 0 0 0 1px var(--gold), 0 0 14px 2px color-mix(in srgb, var(--gold) 40%, transparent);
}
.kolejka-walki .aktywny .awatar { width: 2.1rem; height: 2.1rem; font-size: .85rem; }
.kolejka-walki .nastepny .k-chip { border: 1px dashed var(--gold); }
.kolejka-walki .poza .k-chip { opacity: .5; }
.kolejka-walki .poza .awatar { filter: grayscale(1); }
.kolejka-walki .pomija:not(.aktywny) .k-chip { opacity: .6; border-style: dashed; }
.kolejka-walki .w-panelu .k-chip { outline: 2px solid var(--wybor); outline-offset: 1px; }
.kolejka-walki .zaznaczony .k-chip { outline: 2px dashed var(--ink); outline-offset: 1px; }
/* the end of the Round: a quiet mark, gold when it comes next, lit while its proposals wait */
.k-runda {
  display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .7rem; white-space: nowrap;
  border: 1px dashed var(--border); border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: .8rem; font-weight: 600;
}
button.k-runda { cursor: pointer; }
button.k-runda:hover:not(:disabled) { border-style: solid; color: var(--ink); }
.k-koniec.nastepny .k-runda { border: 1px solid var(--gold); color: var(--ink); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.k-koniec.aktywny .k-runda {
  border: 1px solid var(--warn); background: var(--warn); color: var(--surface);
  box-shadow: 0 0 14px 2px color-mix(in srgb, var(--warn) 45%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .k-koniec.aktywny .k-runda { animation: koniec-rundy 1.8s ease-in-out infinite; }
}
@keyframes koniec-rundy { 50% { box-shadow: 0 0 4px 0 color-mix(in srgb, var(--warn) 30%, transparent); } }
@media (prefers-reduced-motion: reduce) { .kolejka-walki > li::after, .k-chip, .k-twarz .awatar { transition: none; } }
/* a participant in words (a mouse over a chip, a long press): under the queue, over the map and the sheet (z 35) */
.kolejka-podglad, .dymek-czaru {
  position: absolute; z-index: 36; overflow-y: auto; padding: .6rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.kolejka-podglad {
  top: calc(100% - 4px); left: clamp(8px, var(--x, 0px), calc(100% - min(20rem, 100% - 16px) - 8px));
  width: min(20rem, calc(100% - 16px)); max-height: calc(60dvh / var(--zoom));
}
/* a spell's or prayer's description over its chip in the panel (panel.js `dymekCzaru`): fixed, out of the panel's
   clip and over the sheet and the map; above the chip in the window's lower half, else under it */
.dymek-czaru {
  --w: min(22rem, calc(100vw / var(--zoom) - 16px));
  position: fixed; left: clamp(8px, var(--x), calc(100vw / var(--zoom) - var(--w) - 8px)); width: var(--w);
  max-height: min(var(--h), calc(60dvh / var(--zoom)));
}
.dymek-czaru.nad { bottom: calc(var(--y) + 4px); }
.dymek-czaru:not(.nad) { top: calc(var(--y) + 4px); }
.dymek-czaru dl.fields { gap: .2rem; grid-template-columns: 1fr; font-size: .88rem; }  /* a field a line: „Zasięg 6 m” */
.dymek-czaru dl.fields > div { display: flex; gap: .5rem; align-items: baseline; }
.dymek-czaru dl.fields dt { flex: none; margin: 0; }
.kolejka-podglad .zdrowie { display: flex; }
.kolejka-podglad .pasek-zyw.szeroki { flex: 1; max-width: none; }
.kolejka-podglad .znaczniki { gap: .25rem; }
.kolejka-podglad .znaczniki:not(:has(> :not(template, [style*="none"]))) { display: none; }
.mapa-okno .kolejka { flex: none; background: var(--surface); border-bottom: 1px solid var(--border); }
@media (prefers-reduced-motion: no-preference) {
  .panel-postaci.tura .tura-znak { animation: puls 1.6s ease-in-out infinite; }
}
.wpis-walki { padding: .25rem 0; border-bottom: 1px solid var(--border); font-size: .93rem; }
.wpis-walki:last-child { border-bottom: 0; }

/* ---- dice options ------------------------------------------------------------------------------ */
.ustawienia { z-index: 65; }  /* opens from inside the roll dialog too */
.ustawienia h3 { margin: 0 0 .5rem; }
.kosci-podpis {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 1;
  max-width: min(calc(92vw / var(--zoom)), 560px); padding: .35rem .8rem; border-radius: 999px; pointer-events: none;
  background: color-mix(in srgb, var(--nav-bg) 88%, transparent); color: var(--nav-ink);
  font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kosci-presety { display: grid; gap: .45rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kosc-preset {
  display: flex; align-items: center; gap: .55rem; padding: .4rem .5rem; min-height: 48px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2);
  font: inherit; color: var(--ink); text-align: left; cursor: pointer;
}
.kosc-preset:hover { border-color: var(--wybor); }
.kosc-preset.wybrany { border-color: var(--wybor); box-shadow: 0 0 0 2px var(--wybor-soft); font-weight: 600; }
.kosc-probka {
  flex: none; width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: .9rem; box-shadow: inset 0 0 0 1px rgb(0 0 0 / 18%), 0 1px 2px rgb(0 0 0 / 25%);
}
.ustawienia .przelaczniki { display: grid; gap: .55rem; justify-items: start; }

/* ---- character sheet (karta.html) ---- */
/* a longer text (partials/strona.html tekst_karty): its Markdown, a pencil under it */
.tekst-karty { margin-top: .75rem; }
.card > .tekst-karty:first-child { margin-top: 0; }
.tekst-karty .prose { overflow-wrap: anywhere; }
/* the header (name, Conditions, the four numbers of play, tabs) stays in sight right under the top bar */
.karta-naglowek {
  position: sticky; top: var(--topbar-h, 0px); z-index: 25;
  margin: -16px -16px .6rem; padding: .45rem 16px 0;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .karta-naglowek { margin: -24px -32px .8rem; padding: .6rem 32px 0; } }
.naglowek-imie { display: flex; align-items: center; gap: .5rem; }
.naglowek-imie input { font-size: 1.3rem; padding: .1rem .3rem; margin-left: -.3rem; }
/* the name and, under it, its rest (surname, byname, clan): the NPC's header */
.imie-pola { display: flex; flex-direction: column; }
.imie-pola input.nazwisko { font-size: .85rem; color: var(--muted); padding-block: 0; min-height: 0; line-height: 1.35; }
/* the sheet's: the name and its rest in one row, wrapping when long; under them who the character is */
.imie-wiersz { display: flex; flex-wrap: wrap; align-items: baseline; }
.imie-wiersz input { width: auto; max-width: 100%; field-sizing: content; }
.imie-wiersz input.nazwisko { font-weight: 400; color: var(--muted); }
.naglowek-opis { margin: .1rem 0 0; font-size: .85rem; line-height: 1.35; }
.naglowek-imie .save-state { flex: none; font-size: .8rem; }
/* „⋯” by the name: what concerns the whole character (its rolls; the GM's lock, hiding, deleting) */
.menu-postaci { position: relative; flex: none; }
.menu-postaci > .btn { font-size: 1.3rem; line-height: 1; }
.menu-postaci-lista { position: absolute; right: 0; top: calc(100% + 4px); z-index: 25; min-width: 14rem; padding: .3rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
:is(.menu-postaci-lista, .menu-postaci-lista > .d-contents) > :is(a, button) { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .55rem .6rem;
  border: 0; border-radius: var(--radius-sm); background: none; font: inherit; color: var(--ink); text-align: left;
  text-decoration: none; cursor: pointer; }
:is(.menu-postaci-lista, .menu-postaci-lista > .d-contents) > :is(a, button):hover { background: var(--surface-2); }
.menu-postaci-lista > .danger { color: var(--bad); }
.menu-postaci-lista .ikona { color: var(--muted); }
.menu-postaci-lista > .danger .ikona { color: inherit; }
.stany-plakietki { display: flex; flex-wrap: wrap; gap: .3rem; margin: .15rem 0 .1rem; }
.chipy { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin-top: .35rem; }
.chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 0; min-height: 50px; padding: .25rem .2rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  font: inherit; color: var(--ink); cursor: pointer; touch-action: manipulation;
}
.chip:hover { border-color: var(--wybor); }
.chip.otwarty { border-color: var(--wybor); box-shadow: 0 0 0 2px var(--wybor-soft); }
.chip .lbl { max-width: 100%; font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip .lbl .ikona { width: 1.1em; height: 1.1em; margin-right: .25em; vertical-align: -.2em; }
/* the short label ([etykiety] *_skrot) where the whole one would be cut: a narrow screen beside an icon, folded */
.chip .krotka { display: none; }
@media (max-width: 559px) {
  .chip .ikona + .pelna { display: none; }
  .chip .ikona ~ .krotka { display: inline; }
}
.chip .val { font-size: 1.15rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chip .val small { font-size: .75rem; font-weight: 500; color: var(--muted); }
:is(.chip, .stat).momentum .val { color: var(--muted); opacity: .45; }  /* out; lit while the character has it (an NPC's tile too) */
:is(.chip, .stat).momentum.aktywne { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
:is(.chip, .stat).momentum.aktywne .val { color: var(--gold); opacity: 1; }
.chip .pasek { display: block; width: 80%; height: 4px; margin-top: 2px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.chip .pasek > span { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.chip .pasek.warn > span { background: var(--warn); }
.chip .pasek.bad > span { background: var(--bad); }
.chip-popover { margin-top: .4rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); box-shadow: var(--shadow); }
.stepper.duzy .btn { min-width: 46px; min-height: 46px; font-size: 1.35rem; }
.stepper.duzy .v { min-width: 3.6rem; font-size: 1.1rem; }
.karta-naglowek .tabs { margin: .35rem -16px 0; border-bottom: 0; }
@media (min-width: 900px) {
  .karta-naglowek .tabs { margin: .45rem -32px 0; padding: 0 32px; }
  .chipy { max-width: 760px; }
}
/* folded on a phone while the page is scrolled (naglowek.js zwijajNaglowek): a smaller name row, the Conditions in one
   swiping row, the chips one thin line each (label beside value, no Wounds bar); no animation, the height it loses is
   measured and kept under it as margin */
.karta-naglowek.zwiniety { margin-bottom: calc(.6rem + var(--zwiniecie, 0px)); padding-top: .25rem; }
.zwiniety .portret { width: 1.8rem; height: 1.8rem; border-width: 1.5px; }
.zwiniety .portret { font-size: .8rem; }
.zwiniety .portret-dodaj { display: none; }
.zwiniety .naglowek-imie input { font-size: 1.1rem; }
.zwiniety .imie-wiersz input.nazwisko:not(:focus) { display: none; }
.zwiniety .naglowek-opis { display: none; }
.zwiniety .menu-postaci > .btn { min-height: 32px; }
.zwiniety .stany-plakietki { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.zwiniety .stany-plakietki::-webkit-scrollbar { display: none; }
.zwiniety .stany-plakietki > * { flex: none; }
.zwiniety .stany-plakietki .dodaj-efekt { display: none; }
.zwiniety .chipy { margin-top: .2rem; }
.zwiniety .chip { flex-direction: row; gap: .25rem; min-height: 0; padding: .1rem .3rem; }
.zwiniety .chip .lbl { flex: 0 1 auto; min-width: 0; font-size: .58rem; }
.zwiniety .chip .pelna { display: none; }
.zwiniety .chip .krotka { display: inline; }
.zwiniety .chip .ikona ~ .krotka, .zwiniety .chip.momentum .lbl { display: none; }  /* an icon says it there */
.zwiniety .chip .val { flex: none; font-size: .95rem; }
.zwiniety .chip .pasek { display: none; }
.zwiniety .tabs { margin-top: .2rem; }
.zwiniety .tabs :is(button, a) { padding-block: .4rem; }

.grupa-umiejetnosci + .grupa-umiejetnosci { margin-top: .9rem; }
.skill-row .notatka, .skill-row .name button.notatka { font-size: .88rem; color: var(--muted); font-style: italic; }
.skill-row .name button.notatka { margin-left: .3rem; }  /* „z cechy Skryty” on an NPC's skill: opens the trait */

/* a weapon, spell or prayer: what it is on the left, the big button that uses it on the right */
.karta-akcji { padding: .6rem 0; }
.karta-akcji + .karta-akcji { border-top: 1px solid var(--border); }
.karta-akcji-glowa { display: flex; align-items: center; gap: .5rem; }
.check.podpisany { flex-direction: column; gap: .1rem; font-size: .7rem; color: var(--muted); }  /* its word under the box: a phone shows no title */
.karta-akcji-info { margin-top: .1rem; font-size: .85rem; color: var(--muted); }
.karta-akcji-info .ikona { margin-right: .25em; vertical-align: -.15em; }  /* an effect's line on a weapon */
.karta-akcji-edycja { margin-top: .6rem; padding: .6rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.wybor-cech { align-items: center; }  /* a weapon's or armour's Qualities (partials/cechy_oreza.html) */
.nazwa-opis { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.nazwa-opis:hover { text-decoration: underline; }
.przycisk-akcji { flex: none; flex-direction: column; gap: 0; min-width: 4.8rem; min-height: 54px; padding: .3rem .6rem; line-height: 1.15; }
.przycisk-akcji .w { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.btn.on { border-color: var(--wybor); background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }  /* picked: as `.chip-moneta.on` */
/* damaged armour (5e s. 164): a row a location — its name, the points' stepper, the AP left — in natural size */
.uszkodzenia-edycja { display: grid; gap: .3rem; max-width: 26rem; }
.uszkodzenie-lokacji { display: flex; align-items: center; gap: .6rem; }

/* someone else's character: values read as plain text and nothing that would change the card is shown
   (the server refuses such changes anyway; karta.zablokujPole makes a touched field read-only) */
.tylko-odczyt :is(input:not([type=checkbox]), textarea, select) { border-color: transparent; background: transparent; box-shadow: none; resize: none; }
.tylko-odczyt :is(input, textarea)::placeholder { color: transparent; }
.tylko-odczyt :is(input, textarea, select):focus { outline: none; }
.tylko-odczyt :is(.stepper .btn, .btn.danger, .tylko-edycja) { display: none !important; }
.tylko-odczyt .chip { cursor: default; }
.tylko-odczyt .chip:hover { border-color: var(--border); }
/* a career's alternate levels (DPG s. 52) under the level they replace: the career page's table and level blocks,
   the version tiles of advancing (partials/wersje_poziomu.html) */
tr.wariant-poziomu td:first-child { padding-left: .9rem; box-shadow: inset 3px 0 0 var(--wybor-soft); }
div.wariant-poziomu { margin: .5rem 0 0 .3rem; padding-left: .8rem; border-left: 3px solid var(--wybor-soft); }
.wersje-poziomu { grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr)); }
.wersje-poziomu .kafel-wyboru:has(input:checked) .badge.accent { background: var(--surface); }
/* a dialog's main action over what it acts on: „Awansuj (100 PD)”, the version's name under it */
.btn.dwie-linie { flex-direction: column; gap: 0; line-height: 1.25; }
.btn.dwie-linie small { font-size: .85rem; font-weight: 400; opacity: .9; }

/* ---- pursuit (5e s. 158–159, partials/panel_poscigu.html): the rules' three steps, the two sides, the Factors with the
   table of s. 159, the party's Obstacles as a row of slots (the one that meets the requirement is marked), the outcome */
.form-poscigu select { max-width: 100%; }  /* a terrain's long name must not widen a phone's page */
/* ---- steps: a pursuit's, a journey day's, the break's, the creator's (buttons back to a step done), healing's
   (`.pionowe`, one under another): a number in a circle, gold once done, the picked colour at the current step ---- */
.etapy { display: flex; gap: .3rem; margin: 0 0 .9rem; padding: 0; list-style: none; }
.etapy > li { flex: 1; display: flex; align-items: center; gap: .45rem; min-width: 0; padding: .4rem .1rem 0;
  border-top: 3px solid var(--border); color: var(--muted); font-size: .9rem; }
.etapy .nr { flex: none; display: grid; place-items: center; width: 1.45rem; height: 1.45rem; border-radius: 50%;
  border: 1.5px solid var(--border); font-size: .78rem; font-weight: 700; }
.etapy .nazwa { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.etapy > li.zrobiony { border-top-color: var(--gold); color: var(--ink); }
.etapy li.zrobiony .nr { background: var(--gold); border-color: var(--gold); color: var(--accent-ink); }
.etapy > li.teraz { border-top-color: var(--wybor); color: var(--wybor); font-weight: 600; }
.etapy li.teraz .nr { background: var(--wybor); border-color: var(--wybor); color: var(--wybor-ink); }
.etapy > li > button { display: flex; align-items: center; gap: .45rem; width: 100%; min-width: 0; padding: 0; border: 0;
  background: none; color: inherit; font: inherit; cursor: pointer; }
.etapy > li > button:disabled { cursor: default; }
.etapy > li.zrobiony > button:hover .nazwa { text-decoration: underline; }
.etapy.pionowe { display: grid; gap: .55rem; margin: 0; }
.etapy.pionowe > li { align-items: flex-start; gap: .55rem; padding: 0; border-top: 0; line-height: 1.4; }
.etapy.pionowe b { color: var(--ink); }
.etapy.pionowe > li.teraz { color: var(--ink); font-weight: 400; }
.etapy.pionowe > li.teraz b { color: var(--wybor); }
@media (max-width: 560px) {  /* a phone: the numbers, and the name of the current step */
  .etapy:not(.pionowe) > li.teraz { flex: 3; }
  .etapy:not(.pionowe) > li:not(.teraz) .nazwa { display: none; }
}

.poscig-strony { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: .6rem; }
.poscig-strona { border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem .6rem; background: var(--surface); }
.poscig-strona.scigani { border-top: 3px solid var(--teal); }
.poscig-strona.scigajacy { border-top: 3px solid var(--accent); }
.poscig-strona header { display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.poscig-strona header b { font-family: var(--font-head); font-size: 1.08rem; }
.poscig .biegacze { list-style: none; margin: 0; padding: 0; }
.poscig .biegacze > li { padding: .35rem .4rem; margin: 0 -.4rem; border-radius: var(--radius-sm); }
.poscig .biegacze > li + li { border-top: 1px solid var(--border); }
.poscig .biegacze > li.w-tescie { background: var(--wybor-soft); }
.poscig .biegacz { display: flex; align-items: center; gap: .5rem; }
.poscig .biegacz .nazwa { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poscig .biegacz small { display: block; }  /* not .d-block: its !important would beat x-show */
.poscig .biegacz .los { color: var(--ink); }
.poscig .szybkosc { flex: none; padding: .15rem .55rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--ink); font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
button.szybkosc { cursor: pointer; min-height: 32px; }
button.szybkosc:hover, button.szybkosc[aria-expanded="true"] { border-color: var(--wybor); }
.poscig .szybkosc.wlasna { border-color: var(--gold); color: var(--gold); font-weight: 600; }
.poscig .biegacz-edycja { margin-top: .45rem; padding: .5rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.poscig .biegacz-edycja .kwota-wiersz { background: var(--surface); }

.poscig-krok { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--border); }
.poscig-krok h4 { margin: 0 0 .5rem; font-size: 1.05rem; }
.poscig-krok h4 small { font-family: var(--font); font-size: .85rem; font-weight: 400; }
.poscig-test-wynik { margin: .8rem 0 0; padding: .45rem .7rem; border-radius: var(--radius-sm); background: var(--info-soft); }

.poscig .czynniki { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .3rem; }
.poscig .czynniki li { display: flex; align-items: baseline; gap: .5rem; }
.poscig .czynniki .znak { flex: none; width: 1.3rem; height: 1.3rem; display: inline-grid; place-items: center; border-radius: 50%;
  font-size: .75rem; font-weight: 700; transform: translateY(.1rem); }
.poscig .czynniki .tak .znak { background: var(--ok-soft); color: var(--ok); }
.poscig .czynniki .nie { color: var(--muted); }
.poscig .czynniki .nie .znak { background: var(--surface-2); }
.poscig .czynniki .czeka { color: var(--muted); font-style: italic; }
.poscig .czynniki .czeka .znak { border: 1.5px dashed var(--border); font-style: normal; }
.poscig .skala { display: flex; flex-wrap: wrap; gap: .4rem; }
.poscig .stopien { flex: 1 1 7rem; display: flex; flex-direction: column; gap: .1rem; padding: .4rem .6rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); }
.poscig .stopien.teraz { border-color: var(--wybor); background: var(--wybor-soft); color: var(--wybor); }
.poscig .stopien.teraz .muted { color: inherit; }

.poscig .licznik { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; }
.poscig .sloty { display: flex; flex-wrap: wrap; gap: .35rem; }
.poscig .slot { position: relative; display: flex; flex-direction: column; align-items: center; gap: .15rem; width: 4.2rem; }
.poscig .slot .znak { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 2px dashed var(--border); font-weight: 700; }
.poscig .slot small { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .75rem; }
.poscig .slot.ok .znak { border: 2px solid var(--ok); background: var(--ok-soft); color: var(--ok); }
.poscig .slot.zle .znak { border: 2px solid var(--bad); background: var(--bad-soft); color: var(--bad); }
/* the requirement: this many slots from the left must be beaten (a gold bar after the last one needed) */
.poscig .slot.prog::after { content: ""; position: absolute; top: .1rem; right: -.28rem; width: 3px; height: 1.9rem;
  border-radius: 2px; background: var(--gold); }

.poscig .przeszkody { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: .6rem; }
.poscig .przeszkoda { display: flex; flex-direction: column; gap: .35rem; padding: .6rem .7rem; border: 1px solid var(--border);
  border-left: 4px solid var(--warn); border-radius: var(--radius-sm); background: var(--surface); }
.poscig .przeszkoda.ok { border-left-color: var(--ok); }
.poscig .przeszkoda.zle { border-left-color: var(--bad); }
.poscig .przeszkoda header { display: flex; align-items: center; gap: .4rem; }
.poscig .przeszkoda h5 { margin: 0; font-size: 1rem; font-family: var(--font-head); }
.poscig .przeszkoda h5 small { font-family: var(--font); font-weight: 400; font-size: .8rem; }
.poscig .przeszkoda p { margin: 0; }
.poscig .przeszkoda .link-maks { align-self: flex-start; }
.poscig .pomoc { padding: .35rem .55rem; border-radius: var(--radius-sm); background: var(--ok-soft); color: var(--ok); font-size: .9rem; }

.poscig-wynik { margin-top: 1rem; padding: .8rem .9rem; border-radius: var(--radius); border: 1px solid var(--border); border-left-width: 4px; }
.poscig-wynik.ok { border-left-color: var(--ok); background: color-mix(in srgb, var(--ok-soft) 70%, var(--surface)); }
.poscig-wynik.zle { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad-soft) 70%, var(--surface)); }
.poscig-wynik h4 { margin: 0 0 .25rem; font-size: 1.2rem; }

/* the new chase form (poscig.html): terrain as tiles saying whom it favours, the other side's rows */
.wybor-terenu { display: flex; flex-wrap: wrap; gap: .4rem; }
.wybor-terenu button { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; flex: 0 1 15rem; padding: .45rem .7rem;
  text-align: left; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font: inherit; cursor: pointer; }
.wybor-terenu button small { color: var(--muted); font-size: .82rem; }
.wybor-terenu button:hover { border-color: var(--wybor); }
.wybor-terenu button.on { border-color: var(--wybor); background: var(--wybor-soft); }
.wybor-terenu button.on b { color: var(--wybor); }
.biegacz-npc { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; margin-bottom: .5rem; padding: .45rem .55rem;
  border-radius: var(--radius-sm); background: var(--surface-2); }

.tabela-przeszkod { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.tabela-przeszkod button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .45rem .6rem; text-align: left;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.tabela-przeszkod button:hover:enabled, .tabela-przeszkod button.on { border-color: var(--wybor); }
.tabela-przeszkod button.on { background: var(--wybor-soft); }
.tabela-przeszkod .nr { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--surface-2); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- campaigns ---- */
/* the top bar's fills its free space and shows only when the whole name fits there: else it wraps under the empty
   ::before to a line cut off, so the date and the settlement are never shortened for it (the menu's switcher names it) */
.kampania-mini { display: flex; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; height: 1lh;
  overflow: hidden; font-size: .8rem; color: var(--muted); }
.kampania-mini::before { content: ""; height: 100%; }  /* the first line, full height: the name below it is cut off */
.kampania-mini > span { flex: none; max-width: 11rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kampania-menu { margin-bottom: .75rem; }
.kampania-menu label { display: block; font-size: .8rem; color: var(--muted); margin-bottom: .2rem; }
.kampania-menu select { width: 100%; }

/* ---- connection and confirmations ---- */
.polaczenie { display: inline-block; flex: none; width: .55rem; height: .55rem; margin-left: .45rem; border-radius: 50%;
  background: var(--muted); vertical-align: middle; }
.polaczenie.polaczono { background: var(--ok); }
.polaczenie.lacze { background: var(--warn); animation: puls 1.2s ease-in-out infinite; }
.polaczenie.offline { background: var(--bad); }
@keyframes puls { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .polaczenie.lacze { animation: none; } }
.save-state.err { font-weight: 600; }
.overlay.opis { z-index: 62; }  /* a description opens from inside other dialogs (roll, tracker) */
/* over a chip's description: what the app counts with it by itself (the cog), what is left to the table */
.opis-dopisek { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .35rem; }
.opis-dopisek li {
  display: flex; align-items: flex-start; gap: .45rem; padding: .45rem .65rem; border-radius: var(--radius-sm);
  background: var(--surface-2); border-left: 3px solid var(--border); font-size: .9rem;
}
.opis-dopisek li .ikona { margin-top: .1em; vertical-align: 0; }
.opis-dopisek li.automat { border-left-color: var(--ok); }
.opis-dopisek li.warn { background: var(--warn-soft); border-left-color: var(--warn); }
/* a Condition's −/+ over its description (the card's editors) */
.opis-stan { margin: 0 0 .75rem; padding: .35rem .5rem .35rem .75rem; border-radius: var(--radius-sm); background: var(--surface-2);
  font-weight: 600; }
.potwierdzenie { z-index: 90; }
.potwierdzenie .sheet { max-width: 420px; }
.potwierdzenie h2 { margin-top: 0; font-size: 1.15rem; }
.potwierdzenie .sheet > p { white-space: pre-line; }  /* a question's lines (a repair's two ways) */

/* ---- music from the GM's PC (stores/muzyka.js, docs/dev/muzyka.md): a player's button on the top bar (heard: the
   accent; muted, paused or on its way: dimmed; no window yet: a dot) with its narrow „▾” and menu, the GM's (paused:
   dimmed), the player's window without the app's bars, the GM's transmitter ---- */
.topbar .muzyka-pasek { display: flex; align-items: center; }
.topbar .muzyka-pasek > .btn { font-size: inherit; }
.topbar .muzyka-przycisk { position: relative; }
.topbar :is(.muzyka-przycisk, .muzyka-mg).gra { color: var(--accent); }
.topbar :is(.muzyka-przycisk, .muzyka-mg).cicho { opacity: .55; }
.topbar .muzyka-przycisk.wlacz::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent); }
.topbar .muzyka-strzalka { min-width: 20px; width: 20px; padding-inline: 0; margin-left: -.4rem; font-size: .8rem; }
.muzyka-menu { min-width: 15rem; color: var(--ink); }
.muzyka-menu-stan { margin: 0; padding: .45rem .6rem .15rem; font-size: .85rem; color: var(--muted); }
.muzyka-menu-stan.gra { color: var(--ok); }
.muzyka-glosnosc { display: flex; align-items: center; gap: .6rem; padding: .35rem .6rem .45rem; }
.muzyka-glosnosc input { flex: 1; min-width: 0; }
:is(.muzyka-glosnosc, .odtwarzacz-okno) output { min-width: 2.6rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
html:has(.main > .odtwarzacz-okno) :is(.sidenav, .topbar, .tabbar, .fab, .prosby-znacznik) { display: none; }
html:has(.main > .odtwarzacz-okno) .app { padding-left: 0; }
.main:has(> .odtwarzacz-okno) { padding: 12px; max-width: none; }
.odtwarzacz-okno { display: grid; place-items: center; min-height: calc(100dvh / var(--zoom) - 24px); }
.odtwarzacz-okno > .card { width: 100%; max-width: 360px; }
.odtwarzacz-naglowek { display: flex; align-items: center; gap: .5rem; font-family: var(--font-head); font-weight: 700; }
.odtwarzacz-naglowek .ikona { color: var(--accent); }
.odtwarzacz-stan { margin: .3rem 0 .6rem; color: var(--muted); }
.odtwarzacz-stan.gra { color: var(--ok); }
.odtwarzacz-okno .btn:not(.icon) { width: 100%; margin-bottom: .6rem; }
.nadajnik .grid-2 { align-items: start; }
.nadajnik .fields { grid-template-columns: minmax(0, 2fr) minmax(7rem, 1fr); }  /* a source's name is long */
/* the level: the whole gradient laid out, uncovered up to --poziom (0–1), so its colour says how loud */
.nadajnik-poziom { height: 10px; margin-bottom: .7rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.nadajnik-poziom > span { display: block; height: 100%; --poziom: 0;
  background: linear-gradient(90deg, var(--ok) 0 65%, var(--warn) 85%, var(--bad));
  clip-path: inset(0 calc(100% - var(--poziom) * 100%) 0 0 round 999px); }
.nadajnik .nadajnik-podtytul { margin: 1.1rem 0 .5rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.nadajnik-sluchacze { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.nadajnik-sluchacze li { padding: .2rem .65rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.nadajnik-sluchacze li.slucha { background: var(--ok-soft); color: var(--ok); }
.nadajnik-przewodnik > summary { display: flex; align-items: center; gap: .5rem; list-style: none; cursor: pointer; }
.nadajnik-przewodnik > summary::-webkit-details-marker { display: none; }
.nadajnik-przewodnik > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.nadajnik-przewodnik[open] > summary::before { transform: rotate(90deg); }
.nadajnik-przewodnik > summary h2 { margin: 0; }
.nadajnik-przewodnik[open] > summary { margin-bottom: .6rem; }
.nadajnik-kroki { margin: 0; padding-left: 1.3rem; }
.nadajnik-kroki > li + li { margin-top: .9rem; }
.nadajnik-kroki p { margin: 0 0 .4rem; }
/* a command to copy: its lines scroll sideways (a phone), its button beside them */
.polecenie { display: flex; align-items: flex-start; gap: .35rem; }
.polecenie pre { flex: 1; min-width: 0; margin: 0; padding: .6rem .75rem; overflow-x: auto; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .82rem; line-height: 1.5; }
.polecenie pre code { padding: 0; border: 0; background: none; font-size: inherit; }
/* „Moje konto” → „Serwer”: the end of the last update's log */
.log-aktualizacji { max-height: 20rem; margin: .5rem 0 0; padding: .6rem .75rem; overflow: auto; white-space: pre-wrap;
  overflow-wrap: anywhere; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .78rem; line-height: 1.45; }

/* ---- the cheat sheet (sciaga.html, and the dialog the top bar's „Ściąga” opens) ---- */
.sciaga-pasek {
  position: sticky; top: var(--topbar-h, 0px); z-index: 15;
  margin: 0 -16px .75rem; padding: .5rem 16px .45rem;
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
@media (min-width: 900px) { .sciaga-pasek { margin: 0 -32px .9rem; padding: .6rem 32px .5rem; } }
.w-panelu .sciaga-pasek { top: -1rem; margin: -1rem -1rem .75rem; padding: .75rem 1rem .45rem; background: var(--surface); }
.sciaga-chipy { display: flex; gap: .3rem; margin-top: .45rem; overflow-x: auto; scrollbar-width: none; }
.sciaga-chipy::-webkit-scrollbar { display: none; }
.chip-sekcji {
  flex: none; display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: .2rem .75rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: inherit; font-size: .9rem; white-space: nowrap; cursor: pointer; touch-action: manipulation;
}
.chip-sekcji:hover { border-color: var(--wybor); }
.chip-sekcji.on { background: var(--wybor); border-color: var(--wybor); color: var(--wybor-ink); font-weight: 600; }
.sciaga-sekcja-tytul { margin: .75rem 0 .5rem; }
/* cards of different heights pack into columns (top to bottom), a card never split between two */
.sciaga-karty { column-gap: 1rem; }
@media (min-width: 760px) { .sciaga:is(.k2, .k3) .sciaga-karty { columns: 2; } }
@media (min-width: 1200px) { .sciaga.k3:not(.w-panelu) .sciaga-karty { columns: 3; } }
.karta-sciagi {
  display: block; break-inside: avoid; margin: 0 0 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  border-top: 3px solid var(--krawedz-karty);
  scroll-margin-top: calc(var(--topbar-h, 58px) + 7rem);
}
.w-panelu .karta-sciagi { scroll-margin-top: 7rem; }
.karta-sciagi.wlasna { border-top-color: var(--gold); }
.karta-sciagi-glowa { display: flex; align-items: center; gap: .5rem; padding: .7rem .9rem; list-style: none; cursor: pointer; }
.karta-sciagi-glowa::-webkit-details-marker { display: none; }
.karta-sciagi-glowa::before { content: "▸"; color: var(--muted); transition: transform .15s; }
.karta-sciagi[open] > .karta-sciagi-glowa::before { transform: rotate(90deg); }
.karta-sciagi-glowa h3 { flex: 1; min-width: 0; margin: 0; font-size: 1.05rem; }
.karta-sciagi-tresc { padding: 0 .9rem .85rem; font-size: .95rem; }
.karta-sciagi-tresc .zrodlo { margin: .5rem 0 0; font-size: .8rem; color: var(--muted); text-align: right; }
.karta-sciagi .prose :is(ul, ol) { margin: .3rem 0 .6rem; }
.karta-sciagi .prose li + li { margin-top: .2rem; }
.karta-sciagi .auto { color: var(--teal); cursor: help; }
.edytor-sciagi { padding: .9rem; background: var(--surface-2); }
.lista-tabel { list-style: none; margin: 0; padding: 0; }
.lista-tabel li { display: flex; align-items: center; gap: .5rem; padding: .2rem 0; }
.lista-tabel li > :first-child { flex: 0 1 auto; min-width: 0; text-align: left; }
.sheet.sciaga-arkusz { max-width: 980px; height: calc(92dvh / var(--zoom)); }  /* full height: a section or a filter never resizes it */
/* tables written in Markdown (compendium, session journal, the cheat sheet) look like the app's own */
.prose table { width: 100%; border-collapse: collapse; margin: .5rem 0 .75rem; font-size: .92rem; }
.prose :is(th, td) { padding: .3rem .4rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; }
.prose tr:last-child td { border-bottom: 0; }

/* ---- spacing scale and helpers, instead of style="…" in the templates. Like the inline styles they replace,
   they win over component rules (!important). Scale: 1 = .25rem, 2 = .5rem, 3 = .75rem, 4 = 1rem, 5 = 1.5rem. ---- */
.m-0 { margin: 0 !important; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .25rem !important; } .mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: .75rem !important; } .mt-4 { margin-top: 1rem !important; } .mt-5 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .25rem !important; } .mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: .75rem !important; } .mb-4 { margin-bottom: 1rem !important; } .mb-5 { margin-bottom: 1.5rem !important; }
.my-1 { margin-top: .25rem !important; margin-bottom: .25rem !important; }
.my-2 { margin-top: .5rem !important; margin-bottom: .5rem !important; }
.my-3 { margin-top: .75rem !important; margin-bottom: .75rem !important; }
.my-4 { margin-top: 1rem !important; margin-bottom: 1rem !important; }
.mx-auto { margin-left: auto !important; margin-right: auto !important; }
.mt-12vh { margin-top: calc(12vh / var(--zoom)) !important; }
.p-0 { padding: 0 !important; } .p-2 { padding: .5rem !important; } .pl-0 { padding-left: 0 !important; }
.py-1 { padding-top: .25rem !important; padding-bottom: .25rem !important; }
.py-2 { padding-top: .5rem !important; padding-bottom: .5rem !important; }
.pt-1 { padding-top: .25rem !important; } .pb-3 { padding-bottom: .75rem !important; } .pt-10vh { padding-top: calc(10vh / var(--zoom)) !important; }
.gap-tight { gap: .15rem !important; } .gap-2 { gap: .5rem !important; } .gap-3 { gap: .75rem !important; } .gap-4 { gap: 1rem !important; }
.w-auto { width: auto !important; }
.w-5 { width: 5rem !important; } .w-6 { width: 6rem !important; } .w-7 { width: 7rem !important; } .w-8 { width: 8rem !important; }
.min-w-0 { min-width: 0 !important; } .d-contents { display: contents !important; } .w-9 { width: 9rem !important; } .w-10 { width: 10rem !important; } .w-12 { width: 12rem !important; }
.w-14 { width: 14rem !important; } .w-16 { width: 16rem !important; }
.min-w-4 { min-width: 4rem !important; } .min-w-5 { min-width: 5rem !important; } .min-w-10 { min-width: 10rem !important; } .min-w-12 { min-width: 12rem !important; }
.min-h-0 { min-height: 0 !important; }
.mw-14 { max-width: 14rem !important; } .mw-16 { max-width: 16rem !important; } .mw-18 { max-width: 18rem !important; } .mw-22 { max-width: 22rem !important; }
.mw-24 { max-width: 24rem !important; } .mw-320 { max-width: 320px !important; } .mw-380 { max-width: 380px !important; }
.mw-520 { max-width: 520px !important; } .mw-640 { max-width: 640px !important; } .mw-820 { max-width: 820px !important; }
.d-block { display: block !important; } .d-inline { display: inline !important; }
.niewidoczny { visibility: hidden !important; }  /* keeps its place in the layout */
.dla-czytnika { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }  /* a screen reader's only */
.flex-wrap { flex-wrap: wrap !important; } .items-start { align-items: flex-start !important; } .items-end { align-items: flex-end !important; }
.justify-start { justify-content: flex-start !important; } .justify-between { justify-content: space-between !important; }
.justify-end { justify-content: flex-end !important; }
.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
.cols-150 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; }
.cols-160 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important; }
.cols-180 { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important; }
.cols-220 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; }
.span-2 { grid-column: span 2 !important; }
.span-all { grid-column: 1 / -1 !important; } .flex-11 { flex: 1 1 11rem !important; }
.text-sm { font-size: .85rem !important; } .text-md { font-size: 1.05rem !important; } .text-xl { font-size: 1.5rem !important; }
.text-hero { font-size: 3rem !important; }
.text-hero .ikona { width: 3.5rem; height: 3.5rem; color: var(--logo-b); }
.fw-bold { font-weight: 700 !important; } .font-head { font-family: var(--font-head) !important; }
.text-left { text-align: left !important; } .text-center { text-align: center !important; } .text-nowrap { white-space: nowrap !important; } .break-all { word-break: break-all !important; }
.link-plain { text-decoration: none !important; color: inherit !important; } .text-inherit { color: inherit !important; }
.text-bad { color: var(--bad) !important; } .text-ok { color: var(--ok) !important; } .bg-2 { background: var(--surface-2) !important; }
.cursor-pointer { cursor: pointer !important; } .rounded-lg { border-radius: 14px !important; }

/* ---- money: coins, the purse on a sheet and the party page, the „Handel” dialog (stores/handel.js) ---- */
/* the coins are our own drawings (static/img): the crown, Sigmar's hammer, the twin-tailed comet */
.moneta { display: inline-block; flex: none; width: 1.2em; height: 1.2em; vertical-align: -.25em;
  background: center / contain no-repeat; filter: drop-shadow(0 1px 1px rgb(0 0 0 / 25%)); }
.moneta.duza { width: 2rem; height: 2rem; }
.moneta-zk { background-image: url("../img/moneta-zk.svg"); }
.moneta-s { background-image: url("../img/moneta-s.svg"); }
.moneta-p { background-image: url("../img/moneta-p.svg"); }
/* three tiles of their natural size on a laptop, sharing the width on a phone; the dialog's small row fills it */
.sakiewka { display: grid; grid-template-columns: repeat(3, minmax(0, 8.5rem)); gap: .5rem; flex: none; max-width: 100%;
  padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; }
.sakiewka.mala { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.majatek { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem; }
.majatek .opis { flex: 1 1 14rem; margin: 0; }
button.sakiewka:enabled { cursor: pointer; }
button.sakiewka:enabled:hover .moneta-kafel { border-color: var(--wybor); }
.moneta-kafel { display: flex; align-items: center; gap: .55rem; min-width: 0; padding: .6rem .75rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.moneta-kafel .moneta { width: 2.3rem; height: 2.3rem; }
.moneta-kafel .ile { display: flex; align-items: baseline; gap: .3rem; min-width: 0; }
.moneta-kafel b { font-size: 1.45rem; line-height: 1; font-variant-numeric: tabular-nums; }
.moneta-kafel small { color: var(--muted); }
.sakiewka.mala .moneta-kafel { padding: .35rem .55rem; }
.sakiewka.mala .moneta { width: 1.6rem; height: 1.6rem; }
.sakiewka.mala b { font-size: 1.1rem; }
@media (max-width: 560px) {  /* a phone: three tiles share ~360 px, so four-digit sums must still fit */
  .sakiewka { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .moneta-kafel { gap: .3rem; padding: .45rem .4rem; }
  .moneta-kafel .moneta { width: 1.55rem; height: 1.55rem; }
  .moneta-kafel .ile { flex-direction: column; align-items: flex-start; gap: .1rem; }  /* the number above its coin's name */
  .moneta-kafel b { font-size: 1.15rem; }
  .sakiewka.mala .ile { flex-direction: row; align-items: baseline; gap: .3rem; }
}
.seg.pelny { display: flex; }
.seg.pelny button { flex: 1; white-space: nowrap; padding-left: .3rem; padding-right: .3rem; }
.kwota { display: grid; gap: .35rem; }
.kwota-wiersz { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; padding: .3rem .4rem .3rem .6rem;
  border-radius: var(--radius-sm); background: var(--surface-2); }
.kwota-wiersz .nazwa { flex: 1 1 5rem; min-width: 0; font-weight: 600; }
.krokomierz input.v { width: 4.4rem; min-height: 46px; padding: .2rem; text-align: center; font-size: 1.15rem; }
.krokomierz:not(.duzy) input.v { width: 3.2rem; min-height: 34px; font-size: 1rem; }
/* the preview keeps one size whatever it says (two lines, the „wyczyść” button always holding its place): a bottom
   sheet grows upwards, so a taller box would move the coin rows away from the finger tapping + */
.podglad-kwoty { display: flex; align-items: center; gap: .5rem; margin-top: .75rem; padding: .45rem .5rem .45rem .75rem;
  min-height: calc(2lh + .9rem); border-radius: var(--radius-sm); background: var(--info-soft); line-height: 1.35; }
.podglad-kwoty .btn { flex: none; }
.podglad-kwoty [role=status] { min-height: calc(2lh + 1px); }  /* one line holds two lines' place (+1px: zoomed line boxes snap a hair taller) */
.podglad-kwoty.pusto { background: var(--surface-2); color: var(--muted); }
.podglad-kwoty.zle { background: var(--bad-soft); color: var(--bad); }
/* „Sakiewka”: the reasons received and spent in one grid cell (the taller holds the place, the amount's sign shows
   one); the calculator's result on a line of its own, kept when empty: nothing under the coins changes height */
.stos-powodow { display: grid; }
.stos-powodow > * { grid-area: 1 / 1; }
.kalkulator-monet { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .5rem; margin-top: .6rem; }
.kalkulator-monet output { grid-column: 1 / -1; min-height: 1lh; padding-left: .2rem; font-weight: 600; }
.kalkulator-monet output.muted { font-weight: 400; }
/* the party's shared gear: a row per thing, a weapon's or armour's kind where a stack has its number; in a narrow
   column (a phone, a small screen's half) the name and 🗑 on a line, the price, number, „Weź” and „Sprzedaj” under it */
.wiersz-wspolny > .badge { min-width: 3.2rem; text-align: center; }
.wspolne-wyposazenie { container-type: inline-size; }
@container (max-width: 30rem) {
  .row.nowrap.wiersz-wspolny { flex-wrap: wrap; padding-bottom: .4rem; border-bottom: 1px solid var(--border); }
  .wiersz-wspolny > .nazwa-wspolna { flex: 1 1 calc(100% - 3rem); order: -2; }
  .wiersz-wspolny > .btn.danger { order: -1; }
}
/* a price button (the coins' dialog) in an edit panel's field or a shared gear row: its text from the left, one width
   at least so the rows' numbers line up */
.btn.przycisk-ceny { justify-content: flex-start; min-width: 6.5rem; }
.fields .przycisk-ceny { width: 100%; }
/* one height for every mode, so switching tabs does not move them either; the button stays at the bottom („Handel”
   and „Sakiewka”) */
.sheet.handel, .sheet.sakiewka-okno { display: flex; flex-direction: column; min-height: min(calc(92dvh / var(--zoom)), 43rem); }
.sheet.handel > *, .sheet.sakiewka-okno > * { flex-shrink: 0; }
.sheet.sakiewka-okno > .odstep { flex: 1 0 0; }
/* „Sakiewka”'s history: by the day in the game (its name stays on top while scrolling), what came in green and what
   went out red, an entry taken back struck through */
.historia-sakiewki { height: min(calc(55dvh / var(--zoom)), 27rem); overflow-y: auto; overscroll-behavior: contain; padding: 0 .75rem .5rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.dzien-historii { position: sticky; top: 0; z-index: 1; margin: 0; padding: .55rem 0 .3rem; background: var(--surface);
  font-size: .85rem; font-weight: 600; color: var(--muted); }
.wpis-pieniedzy { display: flex; align-items: baseline; gap: .75rem; padding: .4rem 0; border-top: 1px solid var(--border); }
.zmiana-wpisu { flex: none; min-width: 5.2rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.zmiana-wpisu.plus { color: var(--ok); }
.zmiana-wpisu.minus { color: var(--bad); }
.wpis-pieniedzy.cofniety :is(.zmiana-wpisu, .opis-wpisu) { text-decoration: line-through; opacity: .6; }
@media (max-width: 380px) {  /* five tabs on the narrowest phones */
  .sakiewka-okno .seg.pelny button { padding-left: .15rem; padding-right: .15rem; font-size: .9rem; }
}
.link-maks { padding: 0; border: 0; background: none; font: inherit; font-size: .85rem; color: var(--accent); cursor: pointer; text-decoration: underline; }
.etykieta-pola { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
.wybor-monet { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip-moneta { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .3rem .8rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.chip-moneta:hover:enabled { border-color: var(--wybor); }
.chip-moneta.on { border-color: var(--wybor); background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }
.chip-moneta > .w-scenie { color: var(--muted); font-weight: 400; }  /* „w: Karczma”: the scene a card would leave */
.chip-moneta:disabled { opacity: .4; cursor: default; }
.chip-moneta.maly { min-height: 32px; padding: .15rem .65rem; font-size: .9rem; }  /* a dense row: filters, tags, categories */
/* a picked chip's check (partials/wybor.html): shown only once picked */
.chip-moneta .znak-wyboru { display: none; margin: 0 -.15rem 0 -.2rem; }
.chip-moneta.on .znak-wyboru { display: inline-block; }
.chip-moneta.reczna { border-style: dashed; }  /* the GM's word against the labels' guess (the tracker's groups) */
.grupy-mg input { min-height: 32px; height: 32px; }  /* as tall as the small chips beside it */
.sciaga-monet { margin: .45rem 0 0; font-size: .8rem; color: var(--muted); }  /* krokomierz.html sciaga_monet */
/* ---- the one picker of characters and targets (partials/wybor.html) ---- */
.naglowek-wyboru { display: flex; align-items: baseline; gap: .5rem; }
.naglowek-wyboru .etykieta-pola { flex: 1; min-width: 0; }
.wybor-postaci .chip-moneta .znaczniki { font-size: .74rem; font-weight: 400; color: var(--muted); }
.wybor-postaci .bez-celu { align-self: center; }
/* a picked character filled: the picked colour, an ally's green, a bystander's muted gold (faintly so until picked) */
.wybor-postaci .chip-moneta.on { background: var(--wybor); color: var(--wybor-ink); }
.wybor-postaci .chip-moneta.on .znaczniki { color: inherit; }
.chip-moneta.sojusznik { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: var(--ok-soft); }
.chip-moneta.sojusznik:hover:enabled { border-color: var(--ok); }
.wybor-postaci .chip-moneta.sojusznik.on { border-color: var(--ok); background: var(--ok); color: var(--surface); }
/* the GM's Damage: a picker per side, its name small under „Kogo trafia” */
.cele-obrazen { display: grid; gap: .4rem; }
.cele-obrazen > .etykieta-pola { margin-bottom: 0; }
.cele-obrazen .wybor-postaci .etykieta-pola { margin-bottom: .2rem; font-size: .76rem; }
.chip-moneta.postronny { border-color: color-mix(in srgb, var(--postronni) 45%, var(--border)); background: color-mix(in srgb, var(--postronni) 12%, var(--surface)); }
.chip-moneta.postronny:hover:enabled { border-color: var(--postronni); }
.wybor-postaci .chip-moneta.postronny.on { border-color: var(--postronni); background: var(--postronni); color: var(--surface); }
.wybor-postaci .chip-moneta.zwijacz { background: transparent; color: var(--muted); }  /* „Sojusznicy (N) ▾” */
/* the roll dialog's target picked on the battle map: one line, „Zmień” at its end */
.cel-z-mapy { display: flex; align-items: center; gap: .5rem; min-height: 40px; font-weight: 600; }
.cel-z-mapy .btn { margin-left: auto; }
.sztuczki .chip-moneta.on:disabled { opacity: 1; }  /* a read-only sheet's trick: shown, not removable */
/* a button and its note under a line, below what it changes (the purse's change, the card's Income) */
.pod-kreska { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .75rem; margin-top: .9rem; padding-top: .8rem;
  border-top: 1px solid var(--border); }
.handel details.acc { border-bottom: 0; }
.handel .acc-body > * + * { margin-top: .4rem; }
.handel .acc-body.wybor-monet > * + * { margin-top: 0; }
/* buying: the categories in one sideways row and the trappings in a box of their own height, so the dialog keeps one
   size whatever the search leaves; a row is the name and price, then what it is and the chance to find it */
.wybor-monet.przewijany { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
.wybor-monet.przewijany .chip-moneta { flex: none; }
.lista-towarow { height: min(calc(50dvh / var(--zoom)), 24rem); margin: 0; padding: 0; list-style: none; overflow-y: auto;
  overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lista-towarow li + li { border-top: 1px solid var(--border); }
.towar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .15rem .6rem; width: 100%;
  padding: .5rem .75rem; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.towar:hover:enabled { background: var(--surface-2); }
.towar .nazwa { min-width: 0; font-weight: 600; }
.towar .cena { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.towar .meta { grid-column: 1; min-width: 0; font-size: .85rem; }
.towar .badge { justify-self: end; }
.towar-wybrany { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; padding: .5rem .5rem .5rem .75rem;
  border-radius: var(--radius-sm); background: var(--surface-2); }
.towar.on { background: var(--wybor-soft); }
.chip-moneta.wada { border-style: dashed; }
/* „Handel”: a height of its own whatever it shows, so a line growing never moves another under the finger; the goods
   (the things to sell) and the cart (the sale) side by side on a laptop, one in the other's place on a phone, where
   the purse's tiles give way to the cart. The lists scroll in their boxes, the button stays at the bottom. */
.sheet.handel { height: min(calc(92dvh / var(--zoom)), 46rem); }
.handel-gora { display: grid; gap: .6rem; margin-bottom: .6rem; }
.sheet.handel > .handel-uklad { display: flex; flex-direction: column; flex: 1 1 0; min-height: 0; }
.handel-uklad > * { display: flex; flex: 1 1 0; flex-direction: column; min-width: 0; min-height: 0; }
.handel .lista-towarow { flex: 1 1 0; height: auto; min-height: 8rem; }
.towar .plus { grid-column: 3; grid-row: 1 / span 2; display: grid; place-items: center; width: 2rem; height: 2rem;
  border: 1px solid var(--border); border-radius: 999px; color: var(--wybor); font-weight: 600; font-variant-numeric: tabular-nums; }
.towar .plus.on { border-color: var(--wybor); background: var(--wybor); color: var(--wybor-ink); font-size: .85rem; }
.towar:has(.plus) { grid-template-columns: minmax(0, 1fr) auto auto; }
.naglowek-koszyka { display: flex; align-items: center; gap: .5rem; min-height: 2rem; margin-bottom: .3rem; }
.naglowek-koszyka h3 { flex: 1; margin: 0; font-size: 1rem; }
.pozycje-koszyka { flex: 1 1 0; min-height: 6rem; margin: 0; padding: 0; list-style: none; overflow-y: auto;
  overscroll-behavior: contain; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.pozycja-koszyka { display: grid; gap: .3rem; padding: .45rem .5rem .45rem .7rem; }
.pozycja-koszyka + .pozycja-koszyka { border-top: 1px solid var(--border); }
.pozycja-koszyka > .row { gap: .4rem .6rem; }
.nazwa-pozycji { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font: inherit; font-weight: 600; color: inherit;
  text-align: left; overflow-wrap: anywhere; }
button.nazwa-pozycji { cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: .2em; }
.cena-pozycji { flex: none; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dostepnosc-pozycji { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin-left: auto; }
.link-jakosci { padding: .2rem 0; border: 0; background: none; font: inherit; font-size: .9rem; color: var(--muted); cursor: pointer;
  white-space: nowrap; }
.link-jakosci:hover { color: var(--accent); }
.rachunek details.acc > summary { padding: .25rem 0; }
.rachunek { display: grid; gap: .35rem; padding-top: .5rem; }
.linia-rachunku { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.linia-rachunku b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.linia-rachunku.do-zaplaty { font-size: 1.1rem; }
.rachunek .podglad-kwoty { margin-top: .15rem; }
.targowanie { gap: .4rem .6rem; min-height: 2.4rem; }
.pasek-koszyka { display: block; width: 100%; margin: -.2rem 0 .5rem; padding: .45rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); font: inherit; font-weight: 600; color: inherit; text-align: left; cursor: pointer; }
@media (max-width: 899px) {
  .handel-uklad.otwarty > .kup-lista, .handel-uklad:not(.otwarty) > :is(.koszyk, .sprzedaz-panel),
  .sheet.handel.rozlozony .handel-gora > .sakiewka { display: none; }
  .handel-uklad > :is(.koszyk, .sprzedaz-panel) { overflow-y: auto; }
  .koszyk .pozycje-koszyka { flex: none; min-height: 0; overflow: visible; }
}
@media (min-width: 900px) {
  .sheet.handel { max-width: 960px; }
  .handel-gora { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; column-gap: 1rem; }
  .handel-gora > .seg { order: -1; }
  .sheet.handel > .handel-uklad { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 1rem; }
  .handel .waski, .pasek-koszyka { display: none; }
  .sprzedaz-panel { overflow-y: auto; }
}
.dostepnosc-towaru { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .6rem; margin: .5rem 0 .25rem; }
.dostepnosc-towaru > .badge { flex: 1 1 100%; padding: .4rem .65rem; border-radius: var(--radius-sm); font-size: .9rem;
  white-space: normal; text-align: left; }

/* ---- icons (static/vendor/ikony, Lucide, ISC): drawn with the text colour ---- */
.ikona { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.fab .ikona { width: 2.1rem; height: 2.1rem; }  /* the d10 has more lines than a plain glyph */
.btn.icon .ikona { width: 1.25rem; height: 1.25rem; }
.badge .ikona { width: 1.15em; height: 1.15em; margin-right: .25em; vertical-align: -.2em; }
.badge.sama-ikona .ikona { margin-right: 0; }
:is(h2, h3, h4) > .ikona { margin-right: .35em; color: var(--teal); }
.alert > .ikona:first-child { margin-right: .4em; }
/* an icon before text where no flex gap spaces them */
:is(p, small, b, dt, span, label:not(.check), .etykieta-pola, .nazwa-opis) > .ikona { margin-right: .3em; }
.cell-name .ikona { color: var(--ok); }  /* an earning skill (Income) */
/* Luck, Fate… as icon + number in a line */
.zasoby .ikona { margin: 0 .15em 0 .45em; }
.zasoby .ikona:first-child { margin-left: 0; }
.ikona-pusta { width: 2.4rem; height: 2.4rem; color: var(--muted); }  /* an empty list's sign */

/* ---- top bar: the page's name and the save state on a wide screen, the menu's entry on a phone ---- */
.tytul-strony { display: none; font-family: var(--font-head); font-weight: 600; font-size: 1.15rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
/* a phone: cut short before the date and the settlement are, its dot kept */
.tytul-paska { display: flex; align-items: center; flex: 0 3 auto; min-width: 3rem; font-family: var(--font-head);
  font-weight: 700; font-size: 1.15rem; }
.tytul-paska .tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-wiecej .brand { font-size: 1.3rem; }
.menu-wiecej .brand .logo { background: none; color: var(--ink); filter: none; }  /* the gradient is for the dark menu */
/* a phone: a page's heading the bar already says (base.html tytul_paska) goes, for screen readers too little to see */
@media (max-width: 899px) {
  .tytul-glowny { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .row:has(> .tytul-glowny) { justify-content: flex-end; }  /* the page's buttons keep their side */
  .row:has(> .tytul-glowny:only-child) { margin: 0 !important; }
}
.stan-zapisu { display: none; font-size: .85rem; color: var(--muted); white-space: nowrap; }

/* ---- the phone's „Więcej”: groups of big rows ---- */
.menu-wiecej .section { margin: .9rem .2rem .3rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.menu-lista { display: flex; flex-direction: column; }
.menu-lista a, .menu-lista button {
  display: flex; align-items: center; gap: .75rem; width: 100%; min-height: 48px; padding: .55rem .5rem;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; text-align: left;
  text-decoration: none; cursor: pointer;
}
/* a tap on „Więcej” would leave the row under the finger („Wyloguj”) marked */
@media (hover: hover) { .menu-lista a:hover, .menu-lista button:hover { background: var(--surface-2); } }
.menu-lista a.active { color: var(--wybor); font-weight: 600; }
/* under „Wyloguj”: who is logged in, one line, a long nick cut with an ellipsis */
.nazwa-konta { overflow-wrap: anywhere; }  /* a long name without spaces must not stretch the card */
.kto { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; color: var(--muted); }
.sidenav .kto { color: var(--nav-muted); }
.menu-lista .ikona { width: 1.3rem; height: 1.3rem; color: var(--muted); }
.menu-lista a.active .ikona { color: var(--wybor); }

/* ---- loading: grey shapes of what is coming ---- */
.szkielet { display: flex; flex-direction: column; gap: .8rem; }
.sz-linia, .sz-blok { border-radius: var(--radius-sm); background: var(--surface-2); }
.sz-linia { height: .95rem; margin: .45rem 0; }
.szkielet .card .sz-linia:nth-child(3n+1) { width: 88%; }
.szkielet .card .sz-linia:nth-child(3n+2) { width: 66%; }
.szkielet .card .sz-linia:nth-child(3n) { width: 78%; }
.sz-tytul { height: 1.8rem; width: 45%; }
.sz-rzad { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; }
.sz-blok { height: 3.2rem; }
@media (prefers-reduced-motion: no-preference) {
  .sz-linia, .sz-blok { animation: puls 1.4s ease-in-out infinite; }
}

/* ---- the session's XP sheet (arkusz_pd.html, partials/pd_okno.html: the presets, an amount and a reason, the tiles,
   the lines) and „Zestawienie” (zestawienie.html: the characters' cards, the comparison's tables) ---- */
/* the presets wrap under a mouse; on a touch screen one row to swipe, fading where more wait (as a participant's chips) */
.nagrody-sesji { gap: .3rem; }
@media (pointer: coarse) {
  .nagrody-sesji { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nagrody-sesji .btn { flex: none; white-space: nowrap; }
}
@media not all and (pointer: coarse) { .nagrody-sesji.zanik-bokow { mask-image: none; animation: none; } }
.linia-pd { align-items: flex-end; gap: .5rem .75rem; margin: .75rem 0; }
.linia-pd > .grow { flex: 1 1 12rem; }
.kafle-pd { display: grid; grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); gap: .4rem; }
.kafle-pd .chip[aria-pressed=true] { border-color: var(--wybor); background: var(--wybor-soft); }
.kafle-pd .chip.poza, .odbiorcy-pd .badge.poza { border-style: dashed; }
.pozycja-pd { display: flex; align-items: flex-start; gap: .5rem; padding: .55rem 0; }
.pozycja-pd > .badge { margin-top: .1rem; }
.odbiorcy-pd { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .25rem; }
.edycja-pd { padding: .6rem 0; }
.podsumowanie-pd > li { padding: .45rem 0; }
.sheet.pd-okno > .odstep, .sheet.przyznanie-pd > .odstep { flex: 1 0 0; }
/* „Zakończ sesję”: a ticked step's details under its line */
.sheet.koniec-sesji { max-width: 640px; }
.koniec-sesji .lista-propozycji li { flex-wrap: wrap; }
.krok-konca { flex: 1 0 100%; min-width: 0; padding: 0 .5rem .5rem 2rem; }
.krok-konca .podsumowanie-pd { margin: 0 0 .25rem; }
.krok-konca textarea { width: 100%; }
.przycisk-konca { display: flex; flex-direction: column; line-height: 1.2; }
.przycisk-konca small { font-weight: 400; }
/* „Nowa scena”: the background picked, a thumbnail on its line */
.sheet.nowa-scena { max-width: 560px; }
.wybrane-tlo img { width: 4.5rem; height: 3rem; flex: none; object-fit: cover; border: 1px solid var(--border); border-radius: var(--radius-sm); }
/* „Zestawienie” (zestawienie.html): a card per character, then the comparison — a table each, a narrow column per
   character, its head sticking under the top bar (the page scrolls, not the table); a phone's table takes the card's
   width, its columns sharing what the names leave */
.karty-zestawienia { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: .75rem; margin-bottom: 1.75rem; }
.karta-zestawienia {
  display: flex; flex-direction: column; gap: .65rem; padding: .85rem .95rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); box-shadow: var(--shadow);
}
.karta-zestawienia.moja { border-left-color: var(--gold); }
.karta-zestawienia > header { display: flex; align-items: center; gap: .6rem; }
.karta-zestawienia .twarz { flex: none; display: grid; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.karta-zestawienia .twarz:disabled { cursor: default; opacity: 1; }
.karta-zestawienia > header .awatar { width: 2.6rem; height: 2.6rem; font-size: 1.05rem; }
.karta-zestawienia > header .badge { margin-left: .3rem; vertical-align: .15em; }
.karta-zestawienia .imie { font-family: var(--font-head); font-size: 1.2rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.karta-zestawienia .imie:hover { text-decoration: underline; }
.zywotnosc-postaci { display: flex; align-items: center; gap: .6rem; font-size: .85rem; }
.zywotnosc-postaci .zdrowie { flex: 1; gap: .5rem; font-size: .95rem; }
.zywotnosc-postaci .pasek-zyw.szeroki { flex: 1; max-width: none; height: 10px; }
.karta-zestawienia .znaczniki { gap: .25rem; }
/* six numbers in a hairline grid */
.liczby-postaci { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 0; overflow: hidden;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.liczby-postaci > div { min-width: 0; padding: .3rem .5rem .35rem; background: var(--surface); }
.liczby-postaci dt { overflow: hidden; color: var(--muted); font-size: .75rem; white-space: nowrap; text-overflow: ellipsis; }
.liczby-postaci dd { display: flex; align-items: center; gap: .35rem; margin: 0; font-size: 1.05rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.liczby-postaci dd .ikona { color: var(--muted); }
.liczby-postaci .zle { background: var(--bad-soft); }
.liczby-postaci .zle dd { color: var(--bad); }
.karta-zestawienia > footer { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: auto; font-size: .9rem; }
/* below a laptop's width one of the two at a time */
.seg.widoki-zestawienia { margin-bottom: 1rem; }
@media (min-width: 900px) { .seg.widoki-zestawienia { display: none; } }
@media (max-width: 899px) {
  .widok-porownanie .karty-zestawienia, .widok-postacie .porownanie, .porownanie-glowa h2 { display: none; }
}
.porownanie-glowa { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: .5rem; }
.porownanie-glowa h2 { margin: 0; }
.legenda-porownania { display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; margin: 0 0 .8rem; font-size: .85rem; }
.legenda-porownania > span { display: flex; align-items: baseline; gap: .4rem; }  /* a phone: the text wraps beside its sample */
.legenda-porownania b { flex: none; padding: 0 .4rem; border-radius: var(--radius-sm); font-variant-numeric: tabular-nums; }
.bloki-porownania { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1rem; }
.bloki-porownania > .card { margin: 0; padding: .2rem .75rem .45rem; }
.blok-porownania h3 { margin: 0; font-size: 1rem; }
.przelacznik-sekcji {
  display: flex; align-items: center; gap: .4rem; width: 100%; min-height: 2.6rem; padding: .35rem .1rem;
  background: none; border: 0; font: inherit; font-family: var(--font-head); font-size: 1.1rem; font-weight: 700;
  color: var(--ink); text-align: left; cursor: pointer;
}
.przelacznik-sekcji:disabled { cursor: default; }  /* a search keeps it open */
.przelacznik-sekcji::before { content: "▸" / ""; color: var(--muted); }  /* no transition: the state comes after load */
.przelacznik-sekcji[aria-expanded="true"]::before { transform: rotate(90deg); }
.przelacznik-sekcji small { font-family: var(--font); font-size: .8rem; font-weight: 400; }
table.porownania { border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.porownania th, .porownania td { padding: .3rem .35rem; border-bottom: 1px solid var(--border); }
.porownania tbody tr:last-child > * { border-bottom: 0; }
.porownania thead th {
  position: sticky; top: var(--topbar-h, 0px); z-index: 2; background: var(--surface); vertical-align: bottom;
  color: var(--muted); font-size: .78rem; font-weight: 600; text-align: center;
}
.porownania thead th + th { width: 4.25rem; max-width: 4.25rem; padding-inline: .2rem; }
.imie-kolumny { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.porownania thead th.moja { color: var(--ink); }
.porownania thead .awatar { display: grid; margin: 0 auto .2rem; }
.porownania tbody th { min-width: 9.5rem; color: var(--ink); font-size: .9rem; font-weight: 500; text-align: left; }
.porownania tbody th .nazwa-opis { font-weight: 500; }
.porownania td { text-align: center; font-weight: 650; }
.porownania .moja { background: color-mix(in srgb, var(--gold) 10%, var(--surface)); }
:is(.porownania td, .legenda-porownania b).najlepsza { background: var(--ok-soft); color: var(--ok); font-weight: 800; }
:is(.porownania td, .legenda-porownania b).ostrzezenie { color: var(--bad); }
.legenda-porownania b.ostrzezenie { background: var(--bad-soft); }
.porownania td.brak { color: var(--muted); font-weight: 400; }
.porownania td .ikona { color: var(--teal); }
/* ponytail: a phone's columns share the width; past ~6 characters they get too narrow (a sideways scroll then) */
@media (max-width: 599px) {
  .bloki-porownania > .card { flex: 1 1 100%; padding-inline: .5rem; }
  table.porownania { width: 100%; table-layout: fixed; }
  .porownania thead th:first-child { width: 8.5rem; }
  .porownania thead th + th { width: auto; max-width: none; padding-inline: .1rem; font-size: .72rem; }
  .porownania tbody th { min-width: 0; overflow-wrap: anywhere; }
}

/* ---- start page: a dashboard ---- */
.scena-trwa {
  display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; border-radius: var(--radius);
  background: var(--info-soft); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
  color: var(--ink); text-decoration: none;
}
.scena-trwa:hover { border-color: var(--teal); }
.scena-trwa .scena-ikona { color: var(--teal); }
.scena-trwa.tura { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scena-trwa.tura .scena-ikona { color: inherit; }
.scena-trwa.tura .muted { color: inherit; opacity: .85; }
.scena-trwa .scena-ikona { width: 1.6rem; height: 1.6rem; }
.szybkie-akcje { gap: .4rem; }
.plan-pozycje b, .tytul-punktu { flex: 1 1 12rem; }  /* a phone puts the state and the buttons under a name, not beside a squeezed one */
.plan-akcje { margin-left: auto; }
.plan-punkt { display: grid; gap: .5rem; }
.plan-punkty > li { padding: .5rem 0 .5rem .5rem; border-left: 3px solid transparent; }
.plan-punkty > li.teraz { border-left-color: var(--gold); }
.plan-punkty > li.zrobiony > .row .tytul-punktu { color: var(--muted); text-decoration: line-through; }
.tytul-punktu { background: none; border: 0; padding: .25rem 0; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.plan-tresc { padding: .25rem 0 0 1.6rem; }  /* under the title, past the checkbox */
.stan-sesji > .grow, .plan-archiwalny .row > .grow { flex: 1 1 12rem; }  /* a phone: the buttons under the text */
.prose li.zadanie { list-style: none; margin-left: -1.3rem; }  /* the checkbox stands where the bullet was */
.prose li.zadanie > :is(ul, ol) { padding-left: 2.6rem; }  /* a nested list makes up for that margin */
.zadanie input { margin: 0 .35rem 0 0; vertical-align: -.1em; }
.kafle-postaci { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .6rem; }
.kafel-postaci {
  display: flex; flex-direction: column; gap: .3rem; padding: .75rem .85rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.kafel-postaci.moja { border-left-color: var(--gold); }  /* one's own (first in a list shared with the others) */
.kafel-postaci:hover { border-color: var(--wybor); }
.kafel-postaci b { font-family: var(--font-head); font-size: 1.15rem; }
.pasek-zyw.szeroki { width: 100%; max-width: 12rem; height: 8px; }
/* the party list's lines under the tiles (druzyna.html): the characters put away, hidden, dead */
.linijki-postaci { margin-top: .75rem; }
.linijka-postaci > summary, a.linijka-postaci {
  display: flex; align-items: center; gap: .4rem; padding: .55rem .2rem; border-top: 1px solid var(--border);
  color: var(--muted); text-decoration: none; cursor: pointer; list-style: none;
}
.linijka-postaci > summary::-webkit-details-marker { display: none; }
.linijka-postaci > summary::after { content: "▸"; transition: transform .15s; }
.linijka-postaci[open] > summary::after { transform: rotate(90deg); }
a.linijka-postaci::after { content: "→"; }
:is(.linijka-postaci > summary, a.linijka-postaci):hover { color: var(--ink); }
.linijka-postaci > .kafle-postaci { padding: .2rem 0 .8rem; }

/* ---- the GM's requests for a test (stores/prosby.js): the pill over the bottom bar, the sheet it opens, the GM's
   dialog. The pill sits left of the dice button, and above a player's docked panel in the tracker. ---- */
.prosby-znacznik {
  position: fixed; z-index: 44; left: 16px; bottom: calc(var(--tabbar-h) + 22px + env(safe-area-inset-bottom));
  max-width: calc(100% - 16px - 96px); min-height: 46px;
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem 1rem .45rem .7rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent), 0 4px 14px rgb(0 0 0 / 22%);
  font: inherit; font-weight: 600; cursor: pointer;
}
.prosby-znacznik .ikona { width: 1.5rem; height: 1.5rem; }
.prosby-znacznik .tekst { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prosby-znacznik:hover { border-color: var(--wybor); }
.prosby-znacznik.pilny { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); animation: prosba-puls 2s ease-out infinite; }
.prosby-znacznik.gotowe { border-color: var(--ok); color: var(--ok); }
@keyframes prosba-puls {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 0 4px 14px rgb(0 0 0 / 22%); }
  70%, 100% { box-shadow: 0 0 0 14px transparent, 0 4px 14px rgb(0 0 0 / 22%); }
}
@media (prefers-reduced-motion: reduce) { .prosby-znacznik.pilny { animation: none; } }
/* over a scene's sheet (app.css § the scene's page), whose panel has its own dice button: the round one hides, the pill
   may be wider */
@media (max-width: 1023px) and (min-height: 501px), (max-width: 1023px) and (orientation: portrait) {
  body:has(.scena-bok) .prosby-znacznik { bottom: calc(var(--tabbar-h) + var(--scena-bok-h, 72px) + 12px + env(safe-area-inset-bottom));
    max-width: calc(100% - 32px); }
}
@media (min-width: 900px) {
  .prosby-znacznik { left: calc(var(--nav-w) + 24px); bottom: 28px; max-width: min(28rem, calc(100% - var(--nav-w) - 130px)); }
}
@media (min-width: 900px) and (max-width: 1023px) and (min-height: 501px) {
  body:has(.scena-bok) .prosby-znacznik { bottom: calc(var(--scena-bok-h, 72px) + 14px); max-width: min(28rem, calc(100% - var(--nav-w) - 48px)); }
}

.prosba-karta { padding: .75rem .85rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.prosba-karta + .prosba-karta { margin-top: .75rem; }
.prosba-karta.ukryta { border-style: dashed; }
.prosba-glowa { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.prosba-glowa h3 { margin: 0; font-size: 1.15rem; }
.prosba-powod { margin: .5rem 0 0; padding: .35rem .7rem; border-left: 3px solid var(--gold); background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; font-family: var(--font-head); font-style: italic; font-size: 1.05rem; }
.prosba-postacie { list-style: none; margin: .6rem 0 0; padding: 0; }
.prosba-postacie li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-height: 44px; padding: .3rem .5rem;
  border-radius: var(--radius-sm); border-left: 4px solid var(--border); background: var(--surface-2); }
.prosba-postacie li + li { margin-top: .3rem; }
.prosba-kto { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; min-width: 0; }
.prosba-postacie .prosba-kto { flex: 1 1 10rem; }  /* a long opposed answer goes under the name rather than squeeze it */
.prosba-kto b { font-size: 1.05rem; }
.prosba-postacie .uwaga { color: var(--warn); }
.prosba-postacie li.sukces { border-left-color: var(--ok); }
.prosba-postacie li.porazka { border-left-color: var(--bad); }
.prosba-postacie li.krytyk { border-left-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface-2)); }
.prosba-postacie li.pech { border-left-color: var(--bad); background: var(--bad-soft); }
.prosba-wynik { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; font-weight: 600; }
.prosba-postacie li.sukces .prosba-wynik, .prosba-postacie li.krytyk .prosba-wynik { color: var(--ok); }
.prosba-postacie li.porazka .prosba-wynik, .prosba-postacie li.pech .prosba-wynik { color: var(--bad); }
.prosba-postep { margin-top: .6rem; }
.pasek-postepu { height: 8px; margin: .3rem 0 .15rem; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pasek-postepu > span { display: block; height: 100%; background: var(--teal); transition: width .3s; }
.prosba-postep.osiagniety { color: var(--ok); }
.prosba-postep.osiagniety .pasek-postepu > span { background: var(--ok); }
.prosba-postep.porazka { color: var(--bad); }
.prosba-progi { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.prog-postaci { display: inline-flex; align-items: baseline; gap: .35rem; padding: .15rem .6rem; border-radius: 999px;
  background: var(--teal-soft); font-size: .9rem; }
.prog-postaci b { font-variant-numeric: tabular-nums; }
.prog-postaci.ostrzezenie { background: var(--warn-soft); color: var(--warn); }
.sheet.prosba-nowa { display: flex; flex-direction: column; }
.sheet.prosba-nowa > * { flex-shrink: 0; }
.sheet.prosba-nowa > .odstep { flex: 1 0 0; }
.prosba-w-rzucie { margin-bottom: .75rem; padding: .5rem .75rem; border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-2); }
.prosba-dostarczona, .zajecie-zapisane { margin: .4rem 0 0; color: var(--ok); font-size: .9rem; }
.trudnosci button:disabled { cursor: default; opacity: .5; }
.trudnosci button.on:disabled { opacity: 1; }

/* ---- social tests, haggling, carousing and Psychology (5e s. 140–145, 183–184) ---- */
.trudnosci button.sugerowana { border-color: var(--wybor); border-style: dashed; box-shadow: 0 0 0 2px var(--wybor-soft); }
.rozmowca .wybor-monet { align-items: center; }
.osoba-rozmowcy { min-height: 32px; max-width: 100%; }  /* beside `.chip-moneta.maly` */
.osoba-rozmowcy.on { border-color: var(--wybor); color: var(--wybor); font-weight: 600; }
.czynniki .czynnik { display: grid; grid-template-columns: 4.6rem 1fr; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.czynniki .czynnik .nazwa { font-weight: 600; font-size: .88rem; }
.czynniki .seg button { padding-top: .25rem; padding-bottom: .25rem; }
.czynniki .seg button > span { font-weight: 700; }
.czynniki .seg button.minus.on { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.hulanka { padding: .5rem .75rem; border-left: 3px solid var(--gold); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft); }
.naloz-efekt { padding: .5rem .75rem; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft); }
.licznik-celow { flex: none; font-variant-numeric: tabular-nums; }
.licznik-celow.pelny { background: var(--wybor); color: var(--wybor-ink); border-color: transparent; }
.licznik-celow.zle { background: var(--bad); color: #fff; border-color: transparent; }  /* more picked than may be */
.naloz-efekt .etykieta-pola { font-size: 1rem; color: var(--ink); }
/* a character the effect already went on: done, not unavailable */
.naloz-efekt .chip-moneta.on:disabled { opacity: 1; background: var(--ok-soft); color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.wzmocnienie .stepery-rzutu { grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); }
.wzmocnienie .stepper .v { min-width: 3.4rem; white-space: nowrap; }
.psychologia-wiersz { padding: .35rem 0; border-bottom: 1px solid var(--border); }
.psychologia-wiersz:last-of-type { border-bottom: 0; }
.nowa-psychologia { padding: .6rem; border: 1px dashed var(--border); border-radius: var(--radius-sm); }
.nowa-psychologia .seg.pelny button { flex: auto; }  /* widths by their names: three fit a 360 px phone */

/* ---- healing (karta.html's „Zdrowie”, across the tab, karta/zdrowie.js): the Wounds with their bar (.wartosc-pasek,
   the Movement card's Encumbrance too) and the last wound's pill (its menu sets it by hand), one line of what to do
   now, care and rest as tiles — an action with its effect in one line and its options under it — and „Jak to
   działa?” as three steps, the one to do now lit as in the pursuit ---- */
.stan-leczenia { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; }
.wartosc-pasek { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .5rem; flex: 1 1 13rem; min-width: 0; }
.wartosc-pasek .lbl { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wartosc-pasek b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.wartosc-pasek .pasek-zyw { flex: 1 1 5rem; }
.wartosc-pasek .do-ilu { color: var(--warn); font-weight: 600; }
.menu-postaci.od-lewej .menu-postaci-lista { left: 0; right: auto; min-width: 12rem; }
.pigulka-rany { font-size: .82rem; padding: .15rem .6rem; }
.podpowiedz-leczenia { margin: .5rem 0 0; padding-left: .6rem; border-left: 3px solid var(--teal); font-size: .92rem; }
:is(.grupa-umiejetnosci, .blok-leczenia) h4, h4.grupa-wyposazenia { margin: 0 0 .4rem; font-size: .78rem; font-family: var(--font);
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.naglowek-leczenia { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; min-height: 34px;
  margin-bottom: .4rem; }  /* as tall as with „Leczy ▾”: side by side, the tiles under both start level */
.naglowek-leczenia h4 { flex: 1; margin: 0; }
.naglowek-leczenia select { width: auto; min-height: 34px; padding-block: .2rem; }
.kafle-leczenia { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(min(13rem, 100%), 1fr)); }
/* the block spans the tab: from 760 px the care's two tiles and the rest's one in a row, the rest kept on the right */
@media (min-width: 760px) {
  .dzialania-leczenia { display: grid; grid-template-columns: 2fr 1fr; column-gap: .5rem; }
  .dzialania-leczenia .kafle-leczenia { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; }
  .odpoczynek-leczenia { grid-column: 2; }
}
.kafel-leczenia { display: flex; flex-direction: column; gap: .35rem; padding: .4rem; border-radius: var(--radius-sm);
  background: var(--surface-2); }
.kafel-leczenia label.check { padding: 0 .2rem; font-size: .88rem; }
.kafel-leczenia .powod { padding: 0 .2rem; color: var(--muted); line-height: 1.3; }
.kafel-akcja { display: flex; align-items: center; gap: .6rem; width: 100%; min-height: 54px; padding: .45rem .55rem;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: var(--ink);
  text-align: left; cursor: pointer; touch-action: manipulation; }
.kafel-akcja:hover:enabled { border-color: var(--wybor); }
.kafel-akcja:disabled { opacity: .5; cursor: not-allowed; }
.kafel-akcja > .ikona { flex: none; width: 1.6rem; height: 1.6rem; color: var(--teal); }
.kafel-akcja .tresc { display: flex; flex-direction: column; min-width: 0; }
.kafel-akcja b { font-family: var(--font-head); font-size: 1.05rem; }
.kafel-akcja small { font-size: .82rem; line-height: 1.3; color: var(--muted); }
.blok-leczenia details.acc { border-bottom: 0; }

/* ---- handouts and whispers (stores/materialy.js, kronika.html): a shown handout full screen — a picture that
   zooms where it is tapped, a letter on parchment under a wax seal (static/img/pieczec.svg, our own drawing) — the
   rumour list, the GM's editor, and the conversation's bubbles (the page's rows: § the campaign chronicle). ---- */
.tabbar :is(a, button) { position: relative; }
.tabbar .kropka { position: absolute; top: 8px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--nav-bg); }
.tabbar .kropka.spokojna { background: var(--nav-active); }  /* a scene without turns: the character is there, nothing urgent */
.tabs :is(button, a) .badge { margin-left: .1rem; }
.tabs button .ikona { margin-right: .15rem; }

.overlay.material-okno { z-index: 64; background: rgb(8 6 4 / 82%); padding: 0; }
.material-arkusz {
  display: flex; flex-direction: column; width: 100%; height: calc(100dvh / var(--zoom)); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow);
}
@media (min-width: 700px) { .material-arkusz { max-width: 1100px; height: min(calc(94dvh / var(--zoom)), 1100px); border-radius: 14px; overflow: hidden; } }
.material-glowa { display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem 1rem; border-bottom: 1px solid var(--border);
  padding-top: calc(.6rem + env(safe-area-inset-top)); }
.material-glowa h2 { margin: 0; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.material-glowa small { color: var(--muted); }
.material-ikona { width: 1.6rem; height: 1.6rem; color: var(--gold); }
.material-tresc { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  background: var(--surface-2); padding-bottom: env(safe-area-inset-bottom); }
/* a picture as tall as it needs (a landscape map on a phone leaves room for the text under it), at most most of the
   screen; alone, it fills the window. Zoomed in, it takes the whole window and scrolls: the text waits under it. */
.material-obraz { flex: none; }
.material-obraz img { max-height: calc(72dvh / var(--zoom)); }
.material-obraz.sam, .material-obraz.zoom { flex: 1 1 0; min-height: 0; }
.material-obraz.sam img { max-height: 100%; }
/* a picture zoomed with a tap (lib/powiekszenie.js: a handout's, a map full screen): fitted in the middle of its box,
   zoomed from the box's top left (where the scroll counts from) */
.powiekszenie { display: flex; align-items: center; justify-content: center; overflow: hidden;
  background: #120d09; cursor: zoom-in; touch-action: manipulation; }
.powiekszenie img { display: block; max-width: 100%; object-fit: contain; user-select: none; -webkit-user-select: none; }
.powiekszenie.zoom { display: block; overflow: auto; cursor: zoom-out; touch-action: auto; }
.powiekszenie.zoom img { max-width: none; max-height: none; height: auto; }
.material-tresc:has(> .material-obraz.zoom) > :not(.material-obraz) { display: none; }
/* text alone sits in the middle of the window; the spacers shrink away when it is longer than the window */
.material-tresc.bez-obrazu::before, .material-tresc.bez-obrazu::after { content: ""; flex: 1 0 0; }
.material-stopka { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; padding: .6rem 1rem;
  padding-bottom: calc(.6rem + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); font-size: .92rem; }
.material-akcje { margin-left: auto; justify-content: flex-end; }
.material-kronika { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem .5rem; padding: .5rem 1rem;
  border-top: 1px solid var(--border); font-size: .92rem; }
.material-kronika:last-child { padding-bottom: calc(.5rem + env(safe-area-inset-bottom)); }

/* a letter: parchment stays parchment in the dark theme too, only a little dimmer */
.pergamin {
  position: relative; width: calc(100% - 24px); max-width: 40rem; margin: 1.25rem auto 3rem; padding: 1.8rem 1.6rem 3.2rem;
  color: #3b2a16; font-family: var(--font-head); font-size: 1.18rem; line-height: 1.55; border-radius: 3px;
  background:
    radial-gradient(ellipse at 18% 8%, rgb(255 252 240 / 55%), transparent 55%),
    radial-gradient(ellipse at 85% 95%, rgb(128 84 34 / 24%), transparent 60%),
    radial-gradient(ellipse at 5% 90%, rgb(128 84 34 / 16%), transparent 45%),
    linear-gradient(100deg, #ecd8a6, #f5e7c2 38%, #f0dfb4 68%, #e5cc93);
  box-shadow: inset 0 0 42px rgb(120 78 28 / 38%), inset 0 0 5px rgb(96 58 18 / 45%), 0 12px 30px rgb(0 0 0 / 28%);
}
.pergamin .prose :is(p, li) { margin-bottom: .7em; }
.pergamin .prose a { color: #7d140c; }
.pergamin .prose :is(h1, h2, h3) { color: #5a2a10; }
.pergamin .pieczec { position: absolute; right: 1.4rem; bottom: -1.9rem; width: 4.8rem; height: 4.8rem;
  background: url("../img/pieczec.svg") center / contain no-repeat; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 35%)); transform: rotate(-9deg); }
:root[data-theme="dark"] .pergamin { filter: brightness(.9) saturate(.95); }
/* the text to a character who cannot read (app/materialy.py ``belkot``): a hurried hand, a little smudged */
.prose.belkot { font-style: italic; letter-spacing: .015em; word-spacing: .08em; filter: blur(.35px); }
.notatka-mg { width: calc(100% - 24px); max-width: 44rem; margin: 1.25rem auto 2rem; padding: 1.2rem 1.3rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); font-size: 1.05rem; }
/* a laptop or a screen on the table (the guest): read from further away */
@media (min-width: 900px) {
  .pergamin { max-width: 46rem; font-size: 1.4rem; padding: 2.4rem 2.4rem 3.6rem; }
  .notatka-mg { font-size: 1.3rem; padding: 1.6rem 1.8rem; }
}

/* a rumour list: the GM's bar („Losuj”, how many heard) stays on top while the list scrolls; the rumour drawn sits
   above the list with its note; heard ones are marked green, a player's new one like a new handout */
.plotki { width: calc(100% - 24px); max-width: 44rem; margin: 1.25rem auto 2rem; }
.material-tresc:has(> .plotki) > .notatka-mg { margin-bottom: 0; }
.plotki-pasek { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  margin: 0 -.5rem .75rem; padding: .6rem .5rem; background: var(--surface-2); }
.plotki-lista, .plotki-edytor { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.plotka { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .5rem .75rem; padding: .8rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); font-size: 1.05rem; }
.plotka .prose > :last-child { margin-bottom: 0; }
.plotka-tresc { flex: 1 1 16rem; min-width: 0; }  /* on a phone the GM's buttons go under the text */
.plotka-nr { flex: none; display: grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--surface-2); color: var(--muted); font-size: .85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.plotka-notatka { display: block; margin-top: .35rem; color: var(--muted); }
.plotka-akcje { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .35rem; margin-left: auto; }
.plotka-akcje .row { justify-content: flex-end; }  /* „Ujawnij” and „Ujawnij: Liesel” under who heard it */
.plotka-stan { color: var(--ok); white-space: nowrap; }
.plotka.uslyszana { background: var(--surface-2); }
.plotka.uslyszana .plotka-nr { background: var(--ok-soft); color: var(--ok); }
.plotka.wybrana { border-color: var(--wybor); box-shadow: 0 0 0 1px var(--wybor); }
.plotka.nowa { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.plotka.wylosowana { margin-bottom: 1rem; border: 2px solid var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow);
  scroll-margin-top: 4.5rem; }
@media (min-width: 900px) { .plotka { font-size: 1.2rem; } }
.plotka-ed { display: flex; align-items: flex-start; gap: .5rem; padding: .5rem; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); }
.plotka-ed textarea { width: 100%; }
.przyciski-plotki { display: flex; flex-direction: column; gap: .35rem; }  /* „Wstaw link” over „Usuń” */
.plotka-ed textarea + textarea { min-height: 0; margin-top: .35rem; font-size: .92rem; }
.plotki-edytor { margin-bottom: .6rem; }

.sheet.material-edytor { display: flex; flex-direction: column; }
.sheet.material-edytor > * { flex-shrink: 0; }
.sheet.material-edytor > .odstep { flex: 1 0 0; }
.obraz-wybor { display: flex; align-items: flex-start; gap: .75rem; }
.obraz-podglad { flex: none; width: 6.5rem; height: 6.5rem; border-radius: var(--radius-sm); overflow: hidden; background: #1d1611;
  border: 1px solid var(--border); }
.obraz-podglad img { width: 100%; height: 100%; object-fit: cover; display: block; }
.uwaga-tekst { color: var(--warn); }

/* portraits: by the name on a sheet, on the dashboard and the character list */
/* a face (partials/kafel_postaci.html awatar): the portrait over the initials, a colour of its own by the card's id */
.awatar { position: relative; flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; overflow: hidden; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border);
  font: 700 .9rem/1 var(--font-head); }
.awatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.awatar.maly { width: 1.7rem; height: 1.7rem; border-width: 1px; font-size: .72rem; }
.awatar-kolor-0 { background: var(--surface-2); color: var(--gold); }
.awatar-kolor-1 { background: var(--teal-soft); color: var(--teal); }
.awatar-kolor-2 { background: var(--ok-soft); color: var(--ok); }
.awatar-kolor-3 { background: var(--nav-bg); color: var(--nav-ink); }
.postac-w-tabeli { display: inline-flex; align-items: center; gap: .4rem; }
.postac-w-tabeli a { min-width: 0; }
.btn.szepnij { min-height: 28px; min-width: 28px; padding: 0 .3rem; color: var(--muted); }
.btn.szepnij:hover { color: var(--wybor); }
.portret { position: relative; flex: none; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%; overflow: hidden;
  cursor: pointer; border: 2px solid var(--gold); display: grid; place-items: center; font: 700 1.05rem/1 var(--font-head); }
.portret:disabled { cursor: default; opacity: 1; }
.portret-dodaj { position: absolute; right: 0; bottom: 0; display: grid; place-items: center; width: 1rem; height: 1rem;
  border-radius: 50%; background: var(--surface); color: var(--ink); }
.portret img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portret.pusty { border: 1.5px dashed var(--border); }
.portret.pusty:hover { border-color: var(--wybor); color: var(--wybor); }
.portret .ikona { width: .7rem; height: .7rem; }
.portret-arkusz { max-width: 440px; }
.portret-duzy { display: grid; place-items: center; min-height: 12rem; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); }
.portret-duzy img { display: block; width: 100%; max-height: calc(60dvh / var(--zoom)); object-fit: contain; }
.portret-duzy.pusty { aspect-ratio: 1; min-height: 0; max-height: 16rem; text-align: center; }
.portret-duzy.pusty .ikona { width: 2.5rem; height: 2.5rem; }
/* a bestiary entry's illustration (partials/wpis_bestiariusz.html): the art whole at the block's top right, a tap opens it big;
   the badges, the profile and the fields beside it, and in a narrow block (a phone, the description popover) smaller,
   with the profile under it */
.stwor { container-type: inline-size; }
.stwor > .stwor-ilustracja { float: right; margin: 0 0 .75rem 1rem; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2); }
.stwor > :is(template, .stwor-ilustracja) + * { margin-top: 0; }  /* the x-if's template is no gap */
.stwor-ilustracja img { display: block; max-width: 10rem; max-height: 10rem; }
@container (max-width: 36rem) {
  .stwor-ilustracja img { max-width: 6rem; max-height: 6rem; }
  .stwor > .table-wrap { clear: right; }
}

/* whispers: the GM's list of players, a conversation's bubbles (mine on the right), the field at the bottom */
.overlay.rozmowa-nakladka { z-index: 62; }
.sheet.rozmowa-okno { display: flex; flex-direction: column; height: min(calc(86dvh / var(--zoom)), 42rem); overflow: hidden; }
.rozmowa-ramka, .rozmowa-karta { display: flex; flex-direction: column; min-height: 0; }
.rozmowa-ramka { flex: 1; }
/* on the page: the field and its button end above the round dice button and the bottom bar */
.rozmowa-karta { height: clamp(18rem, calc(calc(100dvh / var(--zoom)) - 23.5rem), 40rem); }
.rozmowa-glowa { display: flex; align-items: center; gap: .5rem; margin-bottom: .5rem; }
.rozmowa-glowa h2 { margin: 0; font-size: 1.2rem; }
.rozmowa-podtytul { display: block; }
.watki { overflow-y: auto; min-height: 0; margin: 0 -.25rem; padding: 0 .25rem; }
.watek { display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 58px; padding: .5rem .5rem; border: 0;
  border-bottom: 1px solid var(--border); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.watek:hover { background: var(--surface-2); }
.watek-litera { flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--teal-soft); color: var(--teal); font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.watek.nowe .watek-litera { background: var(--accent); color: var(--accent-ink); }
.watek.nowe .watek-skrot { color: var(--ink); font-weight: 600; }
.watek-postacie, .watek-skrot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.watek-meta { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.rozmowa { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wiadomosci { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: .45rem;
  padding: .6rem .5rem; margin: 0 -.25rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.wiadomosci .empty { margin: auto 0; padding: 1rem; }
.dymek { max-width: 85%; align-self: flex-start; padding: .45rem .7rem .3rem; border-radius: 14px 14px 14px 4px;
  background: var(--surface); border: 1px solid var(--border); }
.dymek.moj { align-self: flex-end; border-radius: 14px 14px 4px 14px; background: var(--wybor-soft);
  border-color: color-mix(in srgb, var(--wybor) 30%, transparent); }
.dymek p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.dymek-stopka { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .1rem .4rem; margin-top: .15rem; font-size: .75rem; color: var(--muted); }
.dymek-cofnij { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; }
.pisz { display: flex; align-items: flex-end; gap: .5rem; padding-top: .6rem; }
.pisz textarea { flex: 1; min-height: 44px; max-height: 8rem; resize: vertical; }
.pisz .btn { min-height: 44px; min-width: 48px; }

/* ---- the campaign chronicle (kronika.html, partials/kronika_okno.html, stores/kronika.js): the views and the
   folders' tree beside dense rows of people (their initials on a wax-coloured disc), places, threads and handouts;
   the entry window, the editor and the quick story NPC on parchment. ---- */
.justify-center { justify-content: center !important; }
.flex-none { flex: none !important; }
.imie-los { max-width: 38rem; padding: .6rem .7rem; }
.pole-szukania { display: block; position: relative; flex: 1 1 13rem; max-width: 22rem; margin: 0; font-size: 1rem; }  /* a label: not its small grey text */
.pole-szukania .ikona { position: absolute; left: .65rem; top: 50%; width: 1rem; height: 1rem; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.pole-szukania input { width: 100%; padding-left: 2.1rem; }
/* a list's filter: the search field with a select per column (the compendium), tags as chips (the chronicle, NPCs) */
.filtr-listy { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.filtr-listy .pole-szukania { max-width: none; }
.filtr-listy select { width: auto; }
.tagi-filtra { display: flex; flex-wrap: wrap; gap: .35rem; }
@media (max-width: 699px) {
  .pole-szukania { max-width: none; }
  .filtr-listy select { flex: 1 1 0; }
  .tylko-szeroki { display: none !important; }
}
@media (min-width: 700px) { .tylko-waski { display: none !important; } }

/* the page: a laptop's column of views and folders beside the list, under the top bar while the list scrolls; a
   phone's in a sheet from „folder ▾” */
.kronika-boczna { display: none; }
@media (min-width: 900px) {
  .kronika-uklad { display: grid; grid-template-columns: 14.5rem minmax(0, 1fr); gap: 1.5rem; align-items: start; }
  .kronika-boczna { display: block; position: sticky; top: calc(var(--topbar-h, 0px) + .75rem);
    max-height: calc(calc(100dvh / var(--zoom)) - var(--topbar-h, 0px) - 1.5rem); overflow-y: auto; }
  .kronika-foldery { display: none !important; }
}
.kronika-nav { display: flex; flex-direction: column; gap: .1rem; }
.nav-widok { display: flex; align-items: center; gap: .5rem; width: 100%; min-height: 36px; padding: .3rem .55rem; border: 0;
  border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.nav-widok span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-widok .ikona { flex: none; color: var(--muted); }
.nav-widok small { color: var(--muted); font-variant-numeric: tabular-nums; }
.nav-widok.on { background: var(--wybor-soft); color: var(--wybor); font-weight: 600; }
.nav-widok.on .ikona { color: var(--wybor); }
@media (hover: hover) { .nav-widok:not(.on):hover { background: var(--surface-2); } }
.drzewo { list-style: none; margin: 0; padding: 0; }
.galaz { display: grid; grid-template-columns: 1.5rem minmax(0, 1fr); align-items: center; padding-left: calc(var(--g, 0) * .9rem); }
.galaz > .nav-widok { grid-column: 2; }
.galaz-rozwin { width: 1.5rem; height: 1.75rem; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.nav-archiwum { margin-top: .5rem; padding-top: .4rem; border-top: 1px solid var(--border); }
.nav-archiwum > summary { display: flex; align-items: center; gap: .5rem; min-height: 36px; padding: 0 .55rem; color: var(--muted); cursor: pointer; }
.nav-widok.nav-nowy { color: var(--muted); }
.kropka-nowe { flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }  /* something „nowe” inside */
.nav-widok:disabled { opacity: .45; cursor: default; }
.sheet.kronika-nav-arkusz { max-width: 26rem; }

/* over the list: where one is (a phone: the sheet's button, the crumbs under it), the GM's „＋ Nowy ▾”; the filters */
.kronika-glowa { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.kronika-foldery { flex: 1 1 auto; min-width: 0; justify-content: flex-start; }
.kronika-foldery span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.okruszki { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .4rem; min-width: 0; }
.okruszki > :not(template) ~ :not(template)::before { content: "›"; margin-right: .4rem; color: var(--muted); font-size: 1rem; font-weight: 400; }
.okruszek { padding: 0; border: 0; background: none; color: var(--wybor); font: inherit; cursor: pointer; }
.okruszki h2 { margin: 0; font-size: 1.35rem; overflow-wrap: anywhere; }
.kronika-nowy { margin-left: auto; }
.menu-naglowek { display: block; padding: .3rem .6rem .2rem; }
@media (max-width: 899px) {
  .okruszki h2 { display: none; }  /* the button says it */
  .okruszki:not(:has(.okruszek)) { display: none; }
  .okruszki, .kronika-glowa > .row { order: 1; flex-basis: 100%; }
}
.kronika-pasek { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.kronika-rodzaje, .kronika-filtry { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.kronika-rodzaje small { font-weight: 500; font-variant-numeric: tabular-nums; opacity: .75; }
.kronika-filtry select { width: auto; }
@media (max-width: 699px) {
  .kronika-rodzaje { width: 100%; flex-wrap: nowrap; }
  .kronika-rodzaje .chip-moneta { flex: 1 1 0; justify-content: center; padding-left: .3rem; padding-right: .3rem; }
  .kronika-rodzaje .ikona { display: none; }  /* four kinds in a phone's width: the names say it */
}

/* the list: dense rows in a card, a section per kind; a hidden entry or a draft greyed, something new marked red */
.sekcja-kroniki h3 { display: flex; align-items: center; gap: .45rem; margin: .25rem 0 .5rem; font-size: 1.05rem; }
.sekcja-kroniki h3 small { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.lista-kroniki { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.lista-kroniki > div + div, .lista-kroniki > button + button { border-top: 1px solid var(--border); }
.lista-kroniki > :is(div, button):first-of-type { border-top-left-radius: var(--radius); border-top-right-radius: var(--radius); }
.lista-kroniki > :is(div, button):last-of-type { border-bottom-left-radius: var(--radius); border-bottom-right-radius: var(--radius); }
.wiersz-kroniki { display: flex; align-items: center; gap: .15rem; min-height: 56px; padding-right: .35rem; }
.wiersz-otworz, .wiersz-folderu { display: flex; align-items: center; gap: .75rem; min-width: 0; padding: .45rem .5rem .45rem .75rem;
  border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.wiersz-otworz { flex: 1; align-self: stretch; }
.wiersz-folderu { width: 100%; min-height: 52px; padding-right: .9rem; }
.wiersz-folderu b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-head); font-size: 1.08rem; }
@media (hover: hover) { .wiersz-kroniki:hover, .wiersz-folderu:hover { background: var(--surface-2); } }
.wiersz-kroniki.ukryty .wiersz-otworz { opacity: .62; }
.wiersz-kroniki.nowy { box-shadow: inset 3px 0 0 var(--accent); }
.wiersz-znak { flex: none; display: grid; place-items: center; width: 2.5rem; height: 2.5rem; overflow: hidden; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--muted); font: 700 .95rem/1 var(--font-head); }
.wiersz-znak img { width: 100%; height: 100%; object-fit: cover; display: block; }
span.wiersz-znak .ikona { width: 1.25rem; height: 1.25rem; margin: 0; }
.wiersz-znak.rodzaj-miejsce { color: var(--accent); background: var(--accent-soft); }
.wiersz-znak.rodzaj-watek { color: var(--teal); background: var(--teal-soft); }
.wiersz-znak.rodzaj-material { color: #6f5530; background: linear-gradient(100deg, #ecd8a6, #f4e5bf 45%, #e6cf98); }
.wiersz-znak.rodzaj-folder { width: 2rem; color: var(--gold); background: none; }
.wiersz-tresc { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; }
.wiersz-tytul { display: flex; align-items: center; gap: .4rem; min-width: 0; }
.wiersz-tytul b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-head); font-size: 1.08rem; }
.wiersz-ukryty { display: inline-flex; align-items: center; gap: .2rem; flex: none; color: var(--muted); font-size: .82rem; }
/* one line: the kind's own words, then the description's start, cut where the row ends */
.wiersz-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; color: var(--muted); }
.wiersz-meta > :not(template) ~ :not(template)::before { content: "·"; margin: 0 .4rem; color: var(--muted); font-weight: 400; }
.wiersz-meta .ikona { width: .95em; height: .95em; margin-right: .2rem; vertical-align: -.12em; }
.wiersz-meta .ton-ok, .wiersz-czytelnicy.wszyscy { color: var(--ok); }
.wiersz-meta .ton-warn, .wiersz-czytelnicy { color: var(--warn); }
.wiersz-meta .ton-bad { color: var(--bad); }
.wiersz-meta .ton-accent { color: var(--ink); }  /* an open thread: not red, red is for alarms */
.wiersz-akcje { display: flex; align-items: center; gap: .25rem; flex: none; }

/* the GM's folders: a row picked by „Zaznacz” (a box before its face), a folder a drag hovers, the bar of what is
   picked (over the phone's tab bar), „Przenieś do…”'s tree */
span.wiersz-pole { flex: none; display: grid; place-items: center; width: 1.35rem; height: 1.35rem; margin: 0;
  border: 2px solid var(--muted); border-radius: 5px; }
span.wiersz-pole .ikona { width: .95rem; height: .95rem; margin: 0; visibility: hidden; }
.zaznaczony span.wiersz-pole { border-color: var(--wybor); background: var(--wybor); color: #fff; }
.zaznaczony span.wiersz-pole .ikona { visibility: visible; }
.wiersz-kroniki.zaznaczony, .wiersz-folderu.zaznaczony { background: var(--wybor-soft); }
[data-upusc] { outline: 2px dashed var(--wybor); outline-offset: -2px; background: var(--wybor-soft); }
.obraz-ciagniecia { position: fixed; top: -100px; left: 0; max-width: 16rem; padding: .3rem .65rem; overflow: hidden;
  border: 1px solid var(--wybor); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
  font-size: .875rem; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }  /* a drag's label beside the pointer */
.pasek-zaznaczenia { position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .5rem); z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; padding: .55rem .75rem; border: 1px solid var(--wybor);
  border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.pasek-zaznaczenia b { flex: 1 1 auto; }
@media (min-width: 900px) { .pasek-zaznaczenia { bottom: .75rem; } }
body:has(.kronika-strona.zaznaczanie) .fab { display: none; }  /* it would cover the bar's end */
.sheet.przenies-okno { max-width: 28rem; }
.lista-celow { display: flex; flex-direction: column; gap: .1rem; max-height: calc(55dvh / var(--zoom)); overflow-y: auto; }
.cel-przenoszenia { padding-left: calc(.55rem + var(--g, 0) * 1.1rem); }

/* the round mark in the entry's window: a portrait, a person's initials (also a row's), a place's pin, a thread's route */
.kronika-znak, .wiersz-znak.rodzaj-osoba { border-radius: 50%; border: 2px solid var(--gold); color: #5b3a12; font-family: var(--font-head);
  font-weight: 700; letter-spacing: .02em; background: radial-gradient(circle at 35% 28%, #f8ebcb, #dcc28c 70%, #c9a86a); }
.kronika-znak { flex: none; display: grid; place-items: center; overflow: hidden; width: 3.4rem; height: 3.4rem; font-size: 1.25rem; }
.kronika-znak img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* span.: outweighs the text icon's margin (`span > .ikona`), which pushed the pin off centre */
span.kronika-znak .ikona { width: 1.5rem; height: 1.5rem; margin: 0; }
.kronika-znak.rodzaj-watek { border-radius: 12px; border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.kronika-znak.rodzaj-miejsce { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.status-statusu { display: inline-flex; align-items: center; gap: .3rem; color: var(--ink); font-weight: 600; }

/* the entry's window */
.overlay.kronika-okno { z-index: 63; }
.sheet.kronika-arkusz { padding-top: .8rem; }
.kronika-pokaz { margin: 0 0 .6rem; text-align: center; font-family: var(--font-head); font-size: 1.1rem; font-weight: 700; color: var(--gold); letter-spacing: .03em; }
.kronika-glowa { display: flex; align-items: center; gap: .75rem; margin-bottom: .8rem; }
.kronika-glowa h2 { margin: 0; font-size: 1.5rem; line-height: 1.15; overflow-wrap: anywhere; }
.kronika-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin-top: .25rem; font-size: .92rem; }
/* over an entry's or a handout's name: its folders in „Kronika”, each a link there */
.okno-sciezka { display: flex; flex-wrap: wrap; align-items: center; gap: 0 .35rem; margin-bottom: .1rem; font-size: .85rem; color: var(--muted); }
.okno-sciezka .ikona { width: .95em; height: .95em; margin: 0; }
.okno-sciezka a { color: var(--wybor); text-decoration: none; }
.okno-sciezka a + a::before { content: "›"; display: inline-block; margin-right: .35rem; color: var(--muted); }
@media (hover: hover) { .okno-sciezka a:hover { text-decoration: underline; } }
.stack > .sciezka-karty + * { margin-top: .2rem; }  /* an NPC card's folders, right over its name */
.kronika-znak { width: 3.6rem; height: 3.6rem; }
.kronika-ukryty { margin-bottom: .8rem; }
.kronika-portret-duzy { display: block; width: min(100%, 18rem); margin: 0 auto 1rem; border-radius: 12px; overflow: hidden;
  border: 3px solid var(--gold); box-shadow: var(--shadow); background: var(--surface-2); }
.kronika-portret-duzy img { display: block; width: 100%; max-height: calc(46dvh / var(--zoom)); object-fit: cover; }
@media (min-width: 700px) {
  .kronika-tresc.z-portretem { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1.25rem; align-items: start; }
  .kronika-tresc.z-portretem .kronika-portret-duzy { width: 100%; margin: 0; }
  .kronika-tresc.z-portretem .kronika-portret-duzy img { max-height: 24rem; }
  .kronika-opisy > :first-child { margin-top: 0; }
}
/* the box is the picture's own size, so a pin's left/top in % of it lands where the GM tapped */
.kronika-obraz { position: relative; width: fit-content; max-width: 100%; margin: 0 auto 1rem; }
.kronika-obraz > a { display: block; }
.kronika-obraz img { display: block; max-width: 100%; max-height: calc(45dvh / var(--zoom)); border-radius: var(--radius); background: #1d1611; }
/* a pin covers as little of the map as it can: the kind's icon only (the name in its title), see-through till hovered;
   dark in both themes (the dark theme's surface and ink), as it reads best on a picture */
.pinezka { position: absolute; transform: translate(-50%, -50%); justify-content: center; width: 1.75rem; height: 1.75rem;
  min-height: 0; padding: 0; opacity: .5; background: #15252a; border-color: #2a4147; color: #e9e4d5;
  box-shadow: var(--shadow); transition: opacity .15s; }
.pinezka svg { width: 1rem; height: 1rem; }
.pinezka:hover, .pinezka:focus-visible { opacity: 1; z-index: 1; }
/* the name only on a map zoomed full screen, where it has room (fitted on a phone, names would cover the map) */
.pinezka-podpis { display: none; }
.mapa-okno .zoom .pinezka-podpis { display: block; position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%);
  padding: 0 .45rem; border-radius: 999px; background: inherit; white-space: nowrap; font-size: .82rem; }
.kronika-wstecz { margin-bottom: .4rem; }
.edytor-mapy img { cursor: crosshair; }
.edytor-mapy .pinezka { pointer-events: none; }
.pinezka.nowa { width: 1.1rem; height: 1.1rem; opacity: 1; background: var(--accent); border: 2px solid var(--surface); }
.pinezka.nowa.punkt { width: .7rem; height: .7rem; }
/* the GM's fog areas (partials/mgla.html) in the players' fog colour, see-through; an uncovered one only outlined */
.kronika-obraz .mgla { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mgla polygon { fill-opacity: .6; stroke: #e9e4d5; stroke-opacity: .7; stroke-width: 1.5; }
.mgla polygon.odkryty { fill-opacity: 0; stroke: #1f1b16; stroke-opacity: .85; stroke-width: 2; stroke-dasharray: 6 4; }
.mgla polygon.rysowany { fill: var(--accent); fill-opacity: .25; stroke: var(--accent); stroke-opacity: 1; stroke-width: 2; }
.mgla-obszary { align-items: center; margin-bottom: 1rem; }
.kronika-obraz .na-ekran { position: absolute; top: .4rem; right: .4rem; background: #15252a; border-color: #2a4147; color: #e9e4d5; }
/* the map full screen: a handout's sheet filled by the picture; over the entry's window (the same z-index, later in
   the page) but under a handout (64), and under the window while a pin's entry is open there (`pod`). Fitted, the
   picture is as big as its box allows (the box's own units: a % height would not reach the picture's box) */
.overlay.mapa-okno { z-index: 63; background: rgb(8 6 4 / 82%); padding: 0; }
.overlay.mapa-okno.pod { z-index: 62; }
.mapa-okno .powiekszenie { flex: 1 1 0; min-height: 0; container-type: size; }
.mapa-okno .kronika-obraz { margin: 0; }
.mapa-okno .zoom .kronika-obraz { max-width: none; }
.mapa-okno .kronika-obraz img { border-radius: 0; }
.mapa-okno :not(.zoom) > .kronika-obraz img { max-width: 100cqw; max-height: 100cqh; }
.kronika-sekcja { margin-top: 1.1rem; }
.kronika-sekcja h3 { margin: 0 0 .45rem; font-size: 1.05rem; }
.cele-lista { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.cele-lista li { display: flex; align-items: center; gap: .5rem; }
.cele-lista li .check { flex: 1; min-width: 0; }
.cele-lista li.zrobiony span:not(.badge):not(.cel-znak) { text-decoration: line-through; color: var(--muted); }
.cele-lista li.ukryty { opacity: .85; }
.cel-znak { flex: none; width: 1.2rem; text-align: center; color: var(--ok); font-weight: 700; }
.przyslugi-tytul { margin: .5rem 0 .3rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.przyslugi-lista { list-style: none; padding: 0; margin: 0 0 .4rem; display: grid; gap: .35rem; }
.przyslugi-lista li { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.przyslugi-lista li.splacona { opacity: .6; }
.przyslugi-lista li.splacona .grow { text-decoration: line-through; }
.kronika-zjednani { margin: 1rem 0 0; padding: .5rem .7rem; border-radius: var(--radius-sm); background: var(--ok-soft); }
.powiazania { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-moneta.ukryty { border-style: dashed; }
.notatki-tekst { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 .6rem; padding: .55rem .75rem; border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--teal-soft); }
.sekrety-mg { padding: .6rem .8rem; border: 1px dashed var(--gold); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--gold) 8%, var(--surface)); }
.sekrety-mg .prose > :last-child { margin-bottom: 0; }
.kronika-karta { margin: 1rem 0 0; }
.kronika-akcje .row { flex-wrap: wrap; }
@media (max-width: 499px) { .kronika-akcje .btn.primary { order: -1; flex-basis: 100%; } }

/* the GM's editor */
.sheet.kronika-edytor { display: flex; flex-direction: column; }
.sheet.kronika-edytor > * { flex-shrink: 0; }
.sheet.kronika-edytor > .odstep { flex: 1 0 0; }
.obraz-podglad.okragly { border-radius: 50%; border: 2px solid var(--gold); }
.status-wybor { align-items: flex-end; gap: .75rem 1.25rem; }
.status-pozycja .krokomierz { margin: 0; }
.relacje-wybor .chip-moneta.on.ok { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.relacje-wybor .chip-moneta.on.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.relacje-wybor .chip-moneta.on.bad { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.cele-edytor { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .35rem; }
.cele-edytor li { display: flex; align-items: center; gap: .4rem; }
.cele-edytor li input:not([type="checkbox"]) { min-width: 0; }
.przysluga-edytor { display: flex; flex-direction: column; margin-bottom: .6rem; padding: .6rem .7rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface-2); }
.przysluga-edytor .seg.pelny button { white-space: normal; line-height: 1.2; font-size: .9rem; }
.przysluga-edytor .seg.pelny + .seg.pelny { margin-top: .5rem; }
.przysluga-edytor select { min-width: 0; }
.sekrety-pole textarea { border-color: color-mix(in srgb, var(--gold) 55%, var(--border)); background: color-mix(in srgb, var(--gold) 5%, var(--surface)); }

/* the quick story NPC: its lines on parchment, each with its own 🎲 */
.sheet.generator-arkusz { max-width: 620px; }
.generator-wynik { position: relative; padding: .7rem 1rem .8rem; color: #3b2a16; border-radius: 4px; transition: opacity .15s;
  background:
    radial-gradient(ellipse at 18% 8%, rgb(255 252 240 / 55%), transparent 55%),
    radial-gradient(ellipse at 85% 95%, rgb(128 84 34 / 22%), transparent 60%),
    linear-gradient(100deg, #ecd8a6, #f5e7c2 38%, #f0dfb4 68%, #e5cc93);
  box-shadow: inset 0 0 30px rgb(120 78 28 / 32%), inset 0 0 4px rgb(96 58 18 / 40%); }
:root[data-theme="dark"] .generator-wynik { filter: brightness(.9) saturate(.95); }
.generator-wynik.laduje { opacity: .55; }
.generator-wynik dl { margin: 0; }
.generator-wynik .muted { color: #6f5530; }
.gen-wiersz { display: grid; grid-template-columns: 7.2rem 1fr auto; align-items: center; gap: .1rem .6rem; padding: .3rem 0;
  border-bottom: 1px dashed rgb(90 60 20 / 28%); }
.gen-wiersz:last-child { border-bottom: 0; }
.gen-wiersz dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: #7a5a2e; }
.gen-wiersz dd { margin: 0; min-width: 0; }
.gen-wiersz .btn.ghost { color: #5b3a12; }
.gen-wiersz .status-statusu { margin-left: .5rem; color: #3b2a16; }
.gen-imie { grid-template-columns: 1fr auto; }
.gen-imie dd { font-family: var(--font-head); font-size: 1.65rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.gen-wiersz.sekret dd { font-style: italic; }
@media (max-width: 499px) {
  .gen-wiersz { grid-template-columns: 1fr auto; }
  .gen-wiersz dt { grid-column: 1 / -1; }
}

/* ---- the campaign's calendar (partials/kalendarz_okno.html): the date on the top bar and its window ---- */
.data-gry { display: inline-flex; align-items: center; gap: .35rem; min-height: 36px; min-width: 0; padding: .2rem .65rem .2rem .45rem;
  border: 1px solid color-mix(in srgb, var(--nav-ink) 30%, transparent); border-radius: 999px; background: transparent;
  color: inherit; font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap; }
.data-gry:hover { background: var(--nav-hover); }
.data-gry .tekst { overflow: hidden; text-overflow: ellipsis; }
.data-gry.noc { border-color: var(--nav-active); color: var(--nav-active); }
.data-gry.pusta { border-style: dashed; }
.ksiezyc-chip { display: inline-flex; flex: none; gap: .15rem; }
.ksiezyc-chip .ksiezyc { width: 1.2rem; height: 1.2rem; }
@media (min-width: 900px) {
  .data-gry { border-color: var(--border); background: var(--surface); color: var(--ink); }
  .data-gry:hover { background: var(--surface-2); border-color: var(--muted); }
  .data-gry.noc { border-color: var(--gold); color: var(--gold); }
}
@media (max-width: 380px) { .data-gry { padding-right: .5rem; font-size: .8rem; } }
/* the settlement (stores/osada.js) wears the date's chip: its name, its size after it; a player's is no button */
.osada-gry .ikona { flex: none; width: 1.05rem; height: 1.05rem; }
.osada-gry .wielkosc { flex: none; opacity: .7; }
.osada-gry .wielkosc::before { content: "· "; }
span.osada-gry { cursor: default; }
span.osada-gry:hover { background: transparent; }
@media (min-width: 900px) { span.osada-gry:hover { background: var(--surface); } }
/* both side by side on a laptop; on a phone two short lines, the date on top, so neither is cut short (held sideways
   too: the scene's bar shares its line with the top bar's) */
.stan-gry { display: flex; align-items: center; gap: .5rem; min-width: 0; }
@media (max-width: 600px), (orientation: landscape) and (max-height: 500px) and (max-width: 899px) {
  .stan-gry { flex-direction: column; align-items: flex-start; gap: .05rem; max-width: calc(64vw / var(--zoom)); }
  /* two lines take the bar's own margin, so it keeps its height (--topbar-h) */
  .topbar:has(.stan-gry > .data-gry:not([style*="none"]) ~ .data-gry:not([style*="none"])) { padding-block: .3rem; }
  .stan-gry > .data-gry:not(.osada-gry) { order: -1; }
  .stan-gry > .data-gry { max-width: 100%; min-height: 24px; padding: 0 .3rem; border: 0; border-radius: 4px;
    font-size: .8rem; line-height: 1.2; }
  .stan-gry .ksiezyc-chip .ksiezyc, .stan-gry .data-gry .ikona { width: 1rem; height: 1rem; }
  .stan-gry .data-gry.pusta .tekst { text-decoration: underline dashed; text-underline-offset: 3px; }
}
.osada-okno { max-width: 440px; }
.field.osada .row > input { flex: 1 1 12rem; }  /* the party page: the name above the sizes on a phone */

/* the moons: Mannslieb silver, Morrslieb the sickly green of the cover's sky; the lit part is drawn from the phase */
.ksiezyc { width: 2.6rem; height: 2.6rem; flex: none; overflow: visible; }
/* the unlit part is the night sky's own dark disc, so a new moon still reads as a moon */
.ksiezyc .ciemna { fill: #243238; stroke: #5b6b70; stroke-width: .7; }
.ksiezyc .jasna { fill: #ece6d2; }
.ksiezyc.mannslieb .jasna { fill: #f3eedd; stroke: #b9b19a; stroke-width: .5; }
.ksiezyc.morrslieb .ciemna { fill: #1f2a1c; stroke: #4e6a3d; }
.ksiezyc.morrslieb .jasna { fill: #a3d96f; stroke: #5d8f33; stroke-width: .5; filter: drop-shadow(0 0 2.5px rgb(140 214 80 / 70%)); }
:root[data-theme="dark"] .ksiezyc .ciemna { fill: #0a1215; stroke: #56696d; }

.sheet.kalendarz-okno { display: flex; flex-direction: column; min-height: min(calc(92dvh / var(--zoom)), 44rem); }
.sheet.kalendarz-okno > * { flex-shrink: 0; }
.sheet.kalendarz-okno > .odstep { flex: 1 0 0; }
.dzis-gry { display: grid; gap: .6rem; margin-bottom: .9rem; }
.data-duza { font-family: var(--font-head); font-size: 1.45rem; font-weight: 700; line-height: 1.15; color: var(--teal); }
.dzis-data .znaczenia { margin-top: .15rem; }
.noc-swieta { margin: 0; }
.opis-swieta { margin: 0; font-style: italic; }
.ksiezyce { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: .5rem; }
.ksiezyc-kafel { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: var(--radius-sm);
  background: var(--surface-2); line-height: 1.25; }
.ksiezyc-kafel > span:first-child { display: inline-flex; }
button.ksiezyc-kafel { width: 100%; border: 1px solid transparent; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.ksiezyc-kafel:hover, button.ksiezyc-kafel[aria-expanded="true"] { border-color: var(--border); }
.wybor-fazy .wybor-monet { gap: .3rem; }
.nastepne-swieto { margin: 0; }

.miesiac-glowa { display: flex; align-items: center; gap: .4rem; margin-bottom: .4rem; }
.miesiac-glowa .btn.icon { font-size: 1.5rem; line-height: 1; }
.swieto-przed { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .4rem; margin-bottom: .4rem; padding: .35rem .6rem;
  border-radius: var(--radius-sm); background: var(--warn-soft); font-size: .92rem; }
.swieto-przed.dzis { outline: 2px solid var(--wybor); outline-offset: -2px; }
.siatka-miesiaca { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.siatka-miesiaca th { font-size: .72rem; font-weight: 600; color: var(--muted); text-align: center; padding: .1rem 0; overflow: hidden; }
.siatka-miesiaca td { position: relative; height: 2.35rem; text-align: center; vertical-align: middle; border-radius: 6px;
  background: var(--surface-2); font-variant-numeric: tabular-nums; }
.siatka-miesiaca td.pusty { background: none; }
.siatka-miesiaca td.dzis { background: var(--wybor-soft); color: var(--wybor); font-weight: 700; box-shadow: inset 0 0 0 2px var(--wybor); }
.znak-ksiezyca { display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; vertical-align: middle; }
.siatka-miesiaca .znak-ksiezyca { position: absolute; bottom: 3px; left: 50%; width: .45rem; height: .45rem; transform: translateX(-50%); }
.znak-ksiezyca { width: .6rem; height: .6rem; }
.znak-ksiezyca.pelnia { background: #f3eedd; box-shadow: 0 0 0 1.5px #b39a5c; }
.znak-ksiezyca.now { background: #243238; box-shadow: 0 0 0 1px #5b6b70; }
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; margin: .5rem 0 0; }

.uplyw-czasu .kwota { margin-top: .2rem; }
.propozycja-czasu { margin-top: .8rem; transition: opacity .15s; }
.propozycja-czasu.laduje { opacity: .55; }
.propozycja-czasu h3 { margin-bottom: .2rem; }
.odpoczynek-czasu { margin-bottom: .6rem; padding: .6rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lista-propozycji { list-style: none; margin: .4rem 0; padding: 0; display: grid; gap: .25rem; }
.lista-propozycji li { display: flex; align-items: center; gap: .4rem; border-radius: var(--radius-sm); background: var(--surface-2); }
.lista-propozycji li .check { flex: 1; display: flex; align-items: flex-start; gap: .5rem; padding: .35rem .5rem; line-height: 1.3; }
.lista-propozycji li .check :is(input, .ikona) { margin-top: .15rem; flex: none; }
.lista-propozycji li > .btn { margin-right: .4rem; }
.lista-propozycji li.off .check > .grow { opacity: .55; text-decoration: line-through; }
/* the end of a Round's dialog (walka.html): a participant's name over its items; a test rolled dims, its result stays */
.propozycje-osoby h3 { margin: .7rem 0 0; font-size: .95rem; }
.propozycje-osoby:first-of-type h3 { margin-top: 0; }
.lista-propozycji li > .badge { margin-right: .5rem; }
.lista-propozycji li:has(.wynik-testu) .check > .grow { opacity: .6; }
.data-pulpit { display: inline-flex; align-items: center; gap: .45rem; margin-top: .35rem; padding: .2rem .7rem .2rem .3rem;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit;
  font-size: .95rem; text-align: left; cursor: pointer; }
@media (max-width: 560px) { .data-pulpit { border-radius: 14px; font-size: .9rem; } }
.data-pulpit .ksiezyc { width: 1.5rem; height: 1.5rem; }
.data-pulpit .ksiezyc-chip .ksiezyc { width: 1.5rem; height: 1.5rem; }
.data-pulpit:hover { border-color: var(--muted); }
.data-wpisu { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: .2rem 0 .75rem; padding: .35rem .6rem;
  border-radius: var(--radius-sm); background: var(--surface); }
.czas-mod { flex: none; max-width: 9.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.czas-mod.czasowy { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.sheet.czas-efektu-okno { max-width: 460px; }
/* an own modifier on a phone: checkbox, name, ⏳ and 🗑 on one line, the modifier's text on the next */
@media (max-width: 560px) {
  .row.nowrap.wiersz-mod { flex-wrap: wrap; }
  /* own dice on a phone: the number and „Rozlicz wynik” on one line, the way back to the app's dice under them */
  .row.nowrap.stopka-rzutu { flex-wrap: wrap; }
  .stopka-rzutu .za-mnie { flex: 1 0 100%; }
  .wiersz-mod .w-9 { flex: 1 1 6rem; width: auto; min-width: 0; }
  .wiersz-mod .wpis-mod { order: 5; flex-basis: 100%; }
}

/* ---- printing („Drukuj” on a sheet and an NPC, or the browser's own): the page's content in ink on white, whatever
   the theme; every tab of a sheet one after another; no menus, bars, buttons, view switches (a card head's checks, a
   filter) or anything that changes the card. A `.btn` that is the data stays: a name as a bare `.btn.p-0`, a
   skill's value `.btn.cell-val`. ---- */
@media print {
  :root[data-theme] { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --ink: #000; --muted: #444; --border: #bbb;
    --shadow: none; color-scheme: light; }
  body { background: #fff; }
  :is(.sidenav, .tabbar, .topbar, .fab, .toasts, .prosby-znacznik, .overlay, .kosci-3d, .tabs,
    .menu-postaci, .save-state, .chip-popover, .tylko-edycja, .btn:not(.p-0, .cell-val), .card-head label.check,
    .talent-npc > button.usun, input[type="search"]) { display: none !important; }
  .app { padding-left: 0; }
  .main { padding: 0; max-width: none; }
  .karta-naglowek { position: static; margin: 0 0 .6rem; padding: 0; backdrop-filter: none; }
  [role="tabpanel"] { display: block !important; }
  [role="tabpanel"] + [role="tabpanel"] { margin-top: 1rem; }
  :is(.card, .karta-akcji, .stat, .chip, tr) { break-inside: avoid; }
  :is(h1, h2, h3) { break-after: avoid; }
  ::placeholder { color: transparent; }
}
