/* css/sheets.css (WP4a) — bottom sheets (half / full / Stół QC panel), segmented control, cards, Orders tab,
   calendar, modals (naming card, Welcome Back), toasts, tutorial overlay. Tokens from css/main.css.
   Layers ignore pointer events and their direct children take them (main.css), so wrappers that must not block
   the scene set pointer-events:none themselves. */

/* ------------------------------------------------------------------ sheets */
.sheet-scrim {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 16, 0.45);
  animation: fade-in var(--mo-med) var(--mo-out);
}

/* the panel's dim never closes it (a click there shakes the ✕, js/ui/sheet.js): no pointer hand over it */
.sheet-scrim--panel {
  background: rgba(5, 8, 16, 0.2);
  cursor: default;
}

/* visual pass 2 (2026-10-15): a flat panel with THE 2 px border, no shadow, no gradient, no inset highlight */
.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: var(--nav-space, 0px); /* ends at the top edge of the always-visible bottom nav (css/hud.css) */
  display: flex;
  flex-direction: column;
  padding: 0 max(16px, var(--safe-right)) 16px max(16px, var(--safe-left));
  border: 2px solid var(--line);
  border-bottom: 0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  background: var(--panel);
  color: var(--text);
  transform: translateY(calc(100% + var(--nav-space, 0px)));
  transition: transform var(--mo-med) var(--mo-out);
}

.sheet.is-in { transform: translateY(0); }
.sheet.is-out { transform: translateY(calc(100% + var(--nav-space, 0px))); transition-duration: 180ms; }
.sheet.is-dragging { transition: none; }

.sheet--half { height: min(60%, calc(100% - var(--nav-space, 0px) - max(8px, var(--safe-top)) - 64px)); }
.sheet--full { height: calc(100% - var(--nav-space, 0px) - max(8px, var(--safe-top)) - 64px); }
/* Stół QC panel: slides up to just under the top bar (owner 2026-10-11: „wysuń to wyżej”) — max room for photos. */
.sheet--panel { height: calc(100% - var(--nav-space, 0px) - max(8px, var(--safe-top)) - 72px); }

/* a finger's drag handle (swipe down closes; a mouse never drags it — js/ui/sheet.js), so no grab cursor */
.sheet__handle {
  flex: none;
  display: grid;
  place-items: center;
  height: 20px;
  touch-action: none;
}

.sheet__handle span {
  width: 40px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line);
}

.sheet__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 8px;
  touch-action: none;
}

.sheet__head:has(> .sheet__title) { min-height: 52px; }

/* one title style with the screens' .scr__title (css/screens.css): 20 / 900 on every sheet, phones too */
.sheet__title {
  flex: 1;
  font-weight: 900;
  font-size: var(--fs-title);
  line-height: var(--lh-tight);
}

/* screens (kit.js) put their title in the body: a head holding only the ✕ would be an empty ~40 px row, so the ✕
   floats top-right next to the screen title instead — phones and the desktop side panel alike (÷ --ui: on a big
   screen the head is zoomed, its offsets too, css „wide screens” below) */
.sheet:not(.sheet--panel) > .sheet__head:not(:has(.sheet__title)) {
  position: absolute;
  top: calc(12px / var(--ui, 1));
  right: calc(max(14px, var(--safe-right)) / var(--ui, 1));
  z-index: 5; /* above the sticky screen title band (css/screens.css) */
  min-height: 0;
}

/* playtest (no way back): a sheet opened from another one (a station card in Rozwój, Menedżerowie in Ja) shows
   „‹ Rozwój” (js/ui/sheet.js) — its head is then a row of its own above the screen: the chip left, the ✕ right */
.sheet.has-back:not(.sheet--panel) > .sheet__head {
  position: relative;
  top: auto;
  right: auto;
  min-height: 40px;
  padding: 0 calc(max(14px, var(--safe-right)) / var(--ui, 1)) 0 calc(max(6px, var(--safe-left)) / var(--ui, 1));
}
.sheet__back { flex: none; }
.sheet.has-back .sheet__body > .scr > .scr__title:first-child,
.sheet.has-back .sheet__body > .scr > .scr-st__head:first-child { padding-right: 0; }

/* the ✕ = a ghost sm icon button (css/main.css .btn--ghost.btn--sm.btn--icon): 36 px, --raised-2, the 3 px edge */
.sheet__close {
  position: relative;
  margin-left: auto;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--raised-2);
  color: var(--text);
  box-shadow: var(--sh-edge-sm);
  cursor: var(--cur-hand);
  transition: transform var(--mo-fast) var(--mo-out), box-shadow var(--mo-fast) var(--mo-out);
}

.sheet__close:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--edge-c);
}

/* a click on the panel's dim: the ✕ shakes once — „close it here” (js/ui/sheet.js; the QC panel does the same) */
.sheet__close.is-nope {
  animation: sheet-nope var(--mo-slow) var(--mo-out);
}

@keyframes sheet-nope {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  45% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
}

/* finger-sized hit areas (≥ 44 px): the ✕ (36 px on phones) and the Zlecenia tabs (36 px tall) grow an invisible box */
.sheet__close::before,
.seg > .seg__btn::before {
  content: '';
  position: absolute;
  top: min(0px, calc((100% - 44px) / 2));
  bottom: min(0px, calc((100% - 44px) / 2));
  left: min(0px, calc((100% - 44px) / 2));
  right: min(0px, calc((100% - 44px) / 2));
}

/* --sheet-body-pt: the body's top padding, also read by the sticky screen title (css/screens.css), which covers it.
   A thin dark scrollbar in a fixed gutter: the classic Windows bar (arrows, 15 px) clashed with the panel and moved
   the cards whenever a list grew long enough to scroll. */
.sheet__body {
  --sheet-body-pt: 8px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-top: var(--sheet-body-pt);
}

.sheet__body,
.modal {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.sheet__body { scrollbar-gutter: stable; }

.sheet__body::-webkit-scrollbar,
.modal::-webkit-scrollbar { width: 8px; }
.sheet__body::-webkit-scrollbar-track,
.modal::-webkit-scrollbar-track { background: transparent; }
.sheet__body::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--r-xs); background: var(--line) padding-box; }

.sheet button,
.modal button,
.tut button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* the font reset skips the segmented-control tabs: they size their own labels (css/screens.css --seg-fs, kit.js
   fitSegLabels). At (0,1,1) it beat their font-size (0,1,0) and froze every tab label at the sheet's 16 px — the
   5-tab Zlecenia row cut „Calendar” / „Boss requests” (2026-10-12). :where keeps this reset at (0,1,1). */
:is(.sheet, .modal, .tut) button:not(:where(.seg__btn, .scr-seg__btn)) { font: inherit; }

/* ------------------------------------------------------------------ segmented control (Zlecenia tabs)
   The look (track, equal tabs, sliding pill, focus ring) is shared with every screen switcher: css/screens.css
   „segmented control”. Here only the gap under it and the count riding on the tab's corner (out of the flow, so
   the tabs keep equal widths when „3” / „1/3” / „!” show; inside the track's 4 px padding, never clipped). */
.seg { margin-bottom: 12px; }

/* .scr-seg__count: the same badge on a screen switcher's tab (kit.js segmented badge — „Budowa” with ready builds) */
/* = the §4 count badge: min 20 × 20, pill, red, white 12 / 900, the --ring-new ring; a „!” is a 10 px dot (is-dot) */
.seg__count,
.scr-seg__count {
  position: absolute;
  z-index: 2;
  top: -6px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--red);
  color: #fff;
  font-size: var(--fs-12);
  font-weight: var(--fw-num);
  line-height: 20px;
  text-align: center;
  box-shadow: var(--ring-new);
  pointer-events: none;
}

.seg__count.is-dot,
.scr-seg__count.is-dot {
  top: -2px;
  right: 0;
  min-width: 0;
  width: 10px;
  height: 10px;
  padding: 0;
  overflow: hidden;
  color: transparent;
}

.seg__count:empty,
.scr-seg__count:empty { display: none; }

/* ------------------------------------------------------------------ cards
   Zlecenia rows = the §4 row (css/screens.css .scr-row): --raised fill, --r-md, no border; 52 px (dense 44); leading
   an icon well 32 (.card__well: --panel, a 20 px --text-2 glyph) or the buyer's avatar 40 (32 in dense rows, without
   its corner badge in lists); title 16 / 800 one line, sub 12 / 700 --text-2; trailing a value, a tag, a sm button or a
   chevron. Inside .scr-list--group the rows touch through 2 px gaps (radius 0). A state = the 4 px left bar. */
.cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cards.scr-list--group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; border-radius: var(--r-md); overflow: hidden; }
.cards.scr-list--group > .card { border-radius: 0; }
.cards.scr-list--group > [hidden] { display: none; }

.card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--raised);
  color: var(--text);
  text-align: left;
}

.card--dense { min-height: 44px; padding-top: 6px; padding-bottom: 6px; }

button.card { cursor: var(--cur-hand); }
button.card:not(:disabled):active { background: var(--raised-2); }
button.card:disabled { cursor: default; }

/* the row's icon well (§4) */
.card__well,
.card__tile {
  flex: none;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background: var(--panel);
  color: var(--text-2);
}

/* the buyer's avatar (ui/avatars.js avatarTile): a 40 px disc with the --line ring; its category badge stays out of
   list rows (§6: no overlapping corner badges — the sub-line names the category) */
.card__tile--avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--raised-2);
  color: #fff;
  font-weight: 900;
  font-size: var(--fs-16);
}

.card--dense > .card__tile--avatar { width: 32px; height: 32px; }
.cards .card__tile--avatar > .ava-badge { display: none; }

.card__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card__title {
  font-weight: 800;
  font-size: var(--fs-16);
  line-height: var(--lh-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card__sub {
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* the trailing value (×2 on a Tablica row) */
.card__val {
  flex: none;
  font-size: var(--fs-14);
  font-weight: 800;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.card__val[hidden] { display: none; }
.card__chev { flex: none; display: grid; place-items: center; color: var(--text-dim); }

/* „+n kolejnych”: a dense muted row of the group (Tablica: a line; Do roboty: a button that unfolds the queue) */
.cards > .card__more,
.card--more {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  background: var(--raised);
  color: var(--text-2);
  font-weight: 800;
  font-size: var(--fs-14);
  text-align: left;
}

.card--more > .card__title { flex: 1; font-size: var(--fs-14); color: var(--text-2); }
.cards > .card__more[hidden] { display: none; }

.card__more,
.empty:not(.kim-line),
.hint {
  padding: 8px 0;
  color: var(--text-dim);
  font-weight: 700;
  font-size: var(--fs-14);
  text-align: left;
}

.empty--lock {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 0;
  color: var(--text-2);
}

.card.is-claimed { opacity: 0.5; }

/* a request's type = a §4 tag on the right (orders.js REQUEST_TAG: VIP = best + crown, Detal = camera, …) */
.boss-card > .scr-tag { flex: none; }

/* ------------------------------------------------------------------ Orders tab */
.orders__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.orders__h {
  font-weight: 900;
  font-size: var(--fs-16);
}

/* a section heading (§4: 14 / 900 --text-2, 16 above / 8 below) */
.orders__sub {
  margin: 16px 0 8px;
  font-weight: 900;
  font-size: var(--fs-14);
  color: var(--text-2);
}

.orders__accept,
.orders__sticky {
  margin-top: 12px;
}

.orders__sticky {
  position: sticky;
  bottom: 0;
}

.chip--muted {
  background: var(--raised-2);
  color: var(--text-2);
}

/* the seller lane's timer: a trailing value, grey and tabular (not yellow) */
.lane__time {
  flex: none;
  font-size: var(--fs-14);
  font-weight: 800;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* packed, waiting for room on the pallet: a word, not a frozen 0:00 */
.lane__time.is-wait { color: var(--text-dim); font-weight: 700; }
.lane__note { padding: 0 0 8px; }
.lane__note[hidden] { display: none; }

.lane-card.is-exchange,
.returns-card { box-shadow: inset 4px 0 0 var(--red); }
.returns-card { margin-top: 12px; }

.find-card {
  margin-top: 8px;
  align-items: flex-start;
  padding-top: 12px;
  padding-bottom: 12px;
}

.find__thumb {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg);
}

.find__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.find__badge { align-self: flex-start; }

/* a finger-sized link: the text line alone was 17 px tall — an invisible box grows it to ~44 px without moving the card */
.find__link::before {
  content: '';
  position: absolute;
  top: -14px;
  bottom: -13px;
  left: -8px;
  right: -8px;
}

.find__link {
  position: relative;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-12);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.daily-card { align-items: center; }

.daily__reward {
  flex: none;
  color: var(--text-2);
  font-weight: 800;
  font-size: var(--fs-14);
}

.daily__done { flex: none; display: grid; place-items: center; color: var(--green); }

.bonus-card { margin-top: 8px; }

/* Paczka dnia ready: the green left bar (no pulsing glow) */
.parcel-card.is-ready { box-shadow: inset 4px 0 0 var(--green); }

/* Zlecenia › Pakowanie: the bench's carton as ONE 8 px bar (cardboard on the recess) + „4/5” in 24 / 900 — the same
   numbers as the hall bubble */
.pack-bar {
  position: relative;
  display: block;
  height: 8px;
  margin: 4px 0 2px;
  border-radius: var(--r-pill);
  background: var(--bg);
  overflow: hidden;
}

.pack-bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--cardboard-1);
  transition: width var(--mo-med) var(--mo-out);
}

.pack-fill {
  flex: none;
  min-width: 56px;
  font-weight: 900;
  font-size: var(--fs-24);
  line-height: var(--lh-tight);
  text-align: right;
}

.pack-card.is-full { box-shadow: inset 4px 0 0 var(--green); }
.pack-card.is-full .pack-fill { color: var(--green); }
.pack-card.is-full .pack-bar__fill { background: var(--green); }
.pack-card .card__sub:empty { display: none; }
.pack-ship__acts { flex: none; display: flex; gap: 8px; }

/* Zlecenia › Do roboty (2026-10-12, owner „scal to w jeden guzik”): „Zlecenia dla szefa” + „Pakowanie” as two compact
   sections — a section heading with its count tag; an empty section is one muted line */
.todo-sec + .todo-sec { margin-top: 16px; }

.todo__head { justify-content: flex-start; }
.todo__head > .orders__h { font-size: var(--fs-14); color: var(--text-2); }

.todo__n:empty { display: none; }
.todo-sec .orders__sub { margin: 12px 0 8px; }
.todo-sec .card__more { padding: 0; }

.empty--line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-size: var(--fs-14);
  text-align: left;
}

.empty--line > svg { flex: none; }
.todo-empty__t { color: var(--text); font-weight: 900; }

.cal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cal__day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--raised);
  color: var(--gem-light);
  text-align: center;
}

.cal__day--big { grid-column: span 2; }
.cal__day.is-claimed { opacity: 0.5; }
.cal__day.is-today { box-shadow: var(--ring-go); }

.cal__n {
  font-size: var(--fs-12);
  font-weight: 800;
  color: var(--text-2);
}

.cal__r {
  font-size: var(--fs-14);
  font-weight: 900;
  color: var(--text);
}

.cal__check {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--green);
}

/* Staż (2026-10-13): each cell = „5. dzień gry” over the reward as icons („[gem] +10 [mat]”), 3 per row on a phone —
   the calendar's cell rules (css/popups.css .cgrid__day): --raised, --r-md, no border; ready = the static green ring
   („claim me”), claimed = the cell at .5 with the green check */
.tenure {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

/* `.tenure >` outranks the sheet's `button { font: inherit }` reset, so a claimable cell keeps the same size */
.tenure > .tenure__d {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
  padding: 8px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--raised);
  color: var(--text-2);
  font-weight: 800;
  font-size: var(--fs-12);
  text-align: left;
}

.tenure__n { white-space: nowrap; }

.tenure__r {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  color: var(--text);
  font-size: var(--fs-14);
  font-weight: 900;
}

.tenure__bit { display: inline-flex; align-items: center; gap: 2px; }
.tenure__bit > svg { flex: none; }
/* a cosmetic (cap / mat / sign) is a plain glyph in --text-2; gem and gift keep their own colours */
.tenure__bit > svg:is([data-icon='cap'], [data-icon='mat'], [data-icon='sign'], [data-icon='star']) { color: var(--text-2); }

.tenure__check {
  position: absolute;
  top: 4px;
  right: 4px;
  color: var(--green);
}

.tenure__d.is-claimed { opacity: 0.5; }

.tenure__d.is-ready {
  background: var(--raised);
  color: var(--text);
  box-shadow: var(--ring-go);
  cursor: var(--cur-hand);
}


/* ------------------------------------------------------------------ Stół QC panel */
.sheet--table .sheet__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  --sheet-body-pt: 0px;
  padding-top: 0;
  overflow: hidden;
}

.sheet--table .sheet__head {
  position: absolute;
  top: 18px;
  right: max(16px, var(--safe-right));
}

.panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding-right: 52px;
}

.panel__title {
  font-weight: 900;
  font-size: var(--fs-20);
  line-height: var(--lh-tight);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* a title with a second line (van loading: „Załadunek” over the vehicle's name) */
.panel__titles { display: flex; flex-direction: column; min-width: 0; }
.panel__subtitle {
  font-size: var(--fs-14);
  font-weight: 800;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* the buyer's chat chip: a plain §4 chip (navy, grey text) */
.chip--chat {
  flex: none;
  background: var(--raised-2);
  color: var(--text-2);
  font-size: var(--fs-12);
}

/* the host ticket (Stół QC while the parcel is unpacked, before the QC stage mounts and hides it) = the QC stage's own
   ticket (css/qc.css .qc-ticket): --panel, THE 2 px border, --r-md, no shadow; the batch as a §4 tag (no caps) */
.panel__ticket {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel-solid);
  color: var(--text);
}

.panel__ticket .badge {
  flex: none;
  min-width: 0;
  height: 20px;
  padding: 0 6px;
  border: 0;
  border-radius: var(--r-xs);
  box-shadow: none;
  font-size: var(--fs-12);
  font-weight: 800;
  line-height: 20px;
}

/* batch tiers = the tag variants (budget = dim, mid / top = default, god = best) */
.panel__ticket .badge--budget { background: transparent; color: var(--text-dim); }
.panel__ticket .badge--mid,
.panel__ticket .badge--top { background: var(--raised-2); color: var(--text-2); }
.panel__ticket .badge--god { background: var(--yellow); color: var(--ink); }

.ticket__row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ticket__item {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 900;
  font-size: var(--fs-16);
  line-height: var(--lh-tight);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* the size = a default tag (= .qc-size) */
.ticket__size {
  flex: none;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--raised-2);
  color: var(--text-2);
  font-weight: 800;
  font-size: var(--fs-12);
  line-height: 20px;
}

.ticket__cw {
  flex: none;
  max-width: 30%;
  font-size: var(--fs-14);
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket__row--sub { justify-content: space-between; }

/* the buyer line: 12 / 700 --text-dim, upright (= .qc-comment) */
.ticket__comment {
  min-width: 0;
  font-size: var(--fs-12);
  font-weight: 700;
  line-height: var(--lh-tight);
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

/* a streak = a default tag (the flame lives in the QC stage's own ticket) */
.chip--streak {
  flex: none;
  min-height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--raised-2);
  color: var(--text-2);
  font-size: var(--fs-12);
}

.panel__stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* the mat = the same cutting mat as the QC photo and the hall's QC tables (js/qc/photo-defaults.js DEFAULT_MAT:
   #2f7d4a, a 1 cm grid #3f9a5e every 18 px, a heavier line every 5 cm, the #f2c21b ruler on the left and bottom
   edges) with a 6 px front edge 30 % darker. Hard-stop pattern art, no shading. The visual-pass capture showed the flat
   #3fa34d version as a bare action-green slab that matched neither the photo nor the tables (2026-10-15). */
.mat {
  position: relative;
  flex: 1;
  min-height: 160px;
  margin-bottom: 6px;
  border-radius: var(--r-md);
  border: 0;
  background-color: #2f7d4a;
  background-image:
    linear-gradient(#f2c21b, #f2c21b),
    linear-gradient(#f2c21b, #f2c21b),
    linear-gradient(rgba(255, 255, 255, 0.14) 2px, transparent 2px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.14) 2px, transparent 2px),
    linear-gradient(#3f9a5e 1px, transparent 1px),
    linear-gradient(90deg, #3f9a5e 1px, transparent 1px);
  background-size: 100% 10px, 10px 100%, 90px 90px, 90px 90px, 18px 18px, 18px 18px;
  background-position: 0 100%, 0 0, 10px 0, 10px 0, 10px 0, 10px 0;
  background-repeat: no-repeat, no-repeat, repeat, repeat, repeat, repeat;
  box-shadow: 0 6px 0 #215834;
  overflow: hidden;
}

.unpack {
  display: grid;
  place-items: center;
  cursor: var(--cur-hand);
  color: #fff;
}

/* the parcel: flat cardboard (base / flap / side tones, §6) with the 3-tone box edge */
.unpack__parcel {
  position: relative;
  width: 132px;
  height: 104px;
  border-radius: var(--r-sm);
  background: var(--cardboard-1);
  box-shadow: 0 8px 0 var(--cardboard-3);
  transition: transform var(--mo-fast) var(--mo-out);
}

.unpack__parcel.is-god {
  background: #2a2a2e;
  box-shadow: 0 8px 0 #000;
}

.unpack__tape {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 22px;
  transform: translateX(-50%);
  background: var(--cardboard-2);
}

.unpack__parcel.is-god .unpack__tape { background: var(--yellow); }

.unpack__flap {
  position: absolute;
  top: 0;
  width: 50%;
  height: 26px;
  background: var(--cardboard-2);
  transition: transform var(--mo-med) var(--mo-out);
}

.unpack__flap--l { left: 0; transform-origin: 0 0; }
.unpack__flap--r { right: 0; transform-origin: 100% 0; }

.unpack.beat-1 .unpack__tape { height: 0; opacity: 0.4; }
.unpack.beat-1 .unpack__parcel { animation: squash var(--mo-fast) var(--mo-out); }
.unpack.beat-2 .unpack__flap--l { transform: rotate(-35deg) translateY(-10px); }
.unpack.beat-2 .unpack__flap--r { transform: rotate(35deg) translateY(-10px); }
.unpack.beat-3 .unpack__parcel { transform: translateY(120%) scale(0.7); opacity: 0; transition: transform var(--mo-slow) var(--mo-out), opacity var(--mo-slow) var(--mo-out); }

/* „Stuknij, żeby rozpakować”: a §4 chip over the mat */
.unpack__hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  background: var(--panel);
  box-shadow: var(--sh-edge-sm);
  font-weight: 800;
  font-size: var(--fs-14);
  white-space: nowrap;
}

@keyframes squash {
  0% { transform: scale(1, 1); }
  50% { transform: scale(1.08, 0.9); }
  100% { transform: scale(1, 1); }
}

.panel__step {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 28px;
  font-weight: 900;
}

.unpack__dots {
  display: inline-flex;
  gap: 8px;
}

.unpack__dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--green);
}

.unpack__dots i.is-on { background: var(--green); }

.review {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
}

.review__item { color: var(--ink); filter: drop-shadow(0 4px 0 rgba(0, 0, 0, 0.25)); }
.review__name { font-weight: 900; text-shadow: var(--num-shadow); }

/* the buyer's slip: paper + ink in the game's own face (no cursive), turned a little */
.review__slip {
  position: absolute;
  right: 16px;
  bottom: 20px;
  padding: 2px 8px;
  border-radius: var(--r-xs);
  background: var(--paper);
  color: var(--ink);
  font: 900 var(--fs-12)/var(--lh-tight) var(--font);
  transform: rotate(-6deg);
}

.panel__stamp {
  position: absolute;
  top: 40%;
  left: 50%;
  padding: 2px 12px;
  border: 4px solid currentColor;
  border-radius: var(--r-md);
  font-weight: 900;
  font-size: var(--fs-32);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1.6);
}

.panel__stamp.is-on {
  opacity: 0.92;
  transform: translate(-50%, -50%) rotate(-12deg) scale(1);
  transition: transform var(--mo-fast) var(--mo-out), opacity var(--mo-fast) var(--mo-out);
}

.panel__stamp--gl { color: var(--green); }
.panel__stamp--rl { color: var(--red); }

.panel__actions {
  flex: none;
  display: flex;
  gap: 8px;
}

.panel__send {
  flex: 1 1 48%;
  min-height: 52px;
}

.panel__empty {
  margin: auto;
  font-weight: 900;
  color: var(--text-2);
}


/* ------------------------------------------------------------------ modals
   §4: --panel, THE 2 px border, --r-lg, 20 padding, the one modal shadow, max 360 wide, the --scrim behind. Title
   20 / 900; body 16 / 700 --text-2 left; one lg primary, other actions as text buttons. */
.modal-backdrop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 16px calc(var(--nav-space, 0px) + 8px);
  background: var(--scrim);
  animation: fade-in var(--mo-med) var(--mo-out);
}

.modal {
  width: min(100%, 360px);
  max-height: calc(100% - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--panel);
  box-shadow: var(--sh-modal);
  animation: modal-in var(--mo-med) var(--mo-spring);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal__titles {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.modal__title {
  font-weight: 900;
  font-size: var(--fs-20);
  line-height: var(--lh-tight);
}

/* chunky pass (2026-10-20): every sheet / screen / modal title and the big reward numbers sit on a hard dark lip —
   the letters read as raised, like the buttons (one hard 2 px shadow in --edge-c, no blur) */
.sheet__title,
.scr__title,
.modal__title,
.scr-me__name,
.scr-shop__gemv,
.scr-crate__head,
.cloud-pick__title,
.loading__title {
  text-shadow: var(--tx-lip);
}

/* modals: a chunkier frame — the 3 px border and a hard lip under the card (on top of the one modal shadow) */
.modal {
  border-width: 3px;
  box-shadow: 0 var(--btn-lip) 0 var(--edge-c), var(--sh-modal);
}

.modal__sub {
  color: var(--text-2);
  font-weight: 700;
  font-size: var(--fs-16);
  line-height: var(--lh-body);
}

.modal__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal__actions > .btn--primary { flex: 1; }

.modal__actions--stack {
  flex-direction: column;
  gap: calc(8px + var(--btn-lip)); /* 2026-10-22: the 6 px lip under a stacked button ate the gap (they touched) */
}

/* naming card */
.naming__row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.naming__field {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
}

.naming__input {
  flex: 1;
  min-width: 0;
  height: 52px;
  padding: 0 52px 0 12px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg);
  color: #fff;
  font: inherit;
  font-weight: 900;
  font-size: var(--fs-20);
  outline: none;
}

.naming__input:focus { border-color: var(--green); }
.naming__input.is-shake { animation: nudge var(--mo-slow) var(--mo-out); border-color: var(--red); }

.naming__count {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--fs-12);
  font-weight: 800;
  color: var(--text-dim);
}

.naming__count.is-over { color: var(--red); }

.naming__dice {
  width: 52px;
  min-height: 52px;
}

.naming__dice.is-roll .icon { animation: dice-roll var(--mo-slow) var(--mo-out); }

@keyframes dice-roll {
  from { transform: rotate(-200deg) scale(0.7); }
  to { transform: none; }
}

.naming__err {
  min-height: 1.2em;
  margin: 8px 0 0;
  color: var(--red);
  font-weight: 800;
  font-size: var(--fs-14);
}

.naming__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

/* a name suggestion = a §4 chip as a button (the small edge) */
.chip--pick {
  border: 0;
  background: var(--raised-2);
  color: var(--text);
  box-shadow: var(--sh-edge-sm);
  cursor: var(--cur-hand);
}

.naming__label {
  margin: 16px 0 8px;
  font-weight: 900;
  color: var(--text-2);
  font-size: var(--fs-14);
}

.naming__logos {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.naming__pick {
  display: grid;
  place-items: center;
  padding: 4px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--bg);
  cursor: var(--cur-hand);
}

.naming__pick.is-on {
  background: var(--raised-2);
  box-shadow: var(--ring-go);
}

/* Welcome Back */
.welcome__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.welcome__badge {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--bg);
  color: var(--cardboard-1);
}

.welcome__main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 12px;
  border-radius: var(--r-md);
  background: var(--bg);
  text-align: center;
}

.welcome__main--locked {
  flex-direction: row;
  gap: 12px;
  text-align: left;
  color: var(--text-2);
  font-weight: 800;
  font-size: var(--fs-14);
}

.welcome__cash {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
  font-size: var(--fs-32);
  color: var(--green);
}

.welcome__line {
  font-weight: 800;
}

.welcome__cap {
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--text-dim);
}

/* „+N fanów” earned while away (js/ui/welcome.js): a white number + the pink fans glyph */
.welcome__fans {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  color: var(--text);
}

.welcome__fans .icon {
  flex: none;
  color: var(--fans);
}

.welcome__list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 2px;
  border-radius: var(--r-md);
  overflow: hidden;
}

.welcome__row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--raised);
  font-weight: 800;
  font-size: var(--fs-14);
}

.welcome__row .icon { flex: none; color: var(--text-2); }

.welcome__sprint {
  flex-wrap: wrap;
  gap: 4px 8px;
}

.welcome__sprintSub {
  flex-basis: 100%;
  font-size: var(--fs-12);
  font-weight: 700;
  color: var(--text-2);
}


/* ------------------------------------------------------------------ buy button
   The level / buy pill (ui/buy-button.js) is a .btn: green when affordable, the navy secondary when short (§4: row
   buys are green or not), the disabled look when locked. No rims, no blurred drops, no glow. */
.buy {
  flex-direction: column;
  gap: 2px;
  min-height: 44px;
}

.buy__row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.buy__cur { display: inline-flex; }

.buy__delta {
  font-size: var(--fs-12);
  font-weight: 800;
}

.buy.is-poor {
  --btn-bg: var(--raised-2);
  --btn-edge: var(--edge-c);
  --btn-hi: var(--btn-shine-soft);
}

/* not enough cash (owner 2026-10-11): navy, cash icon + „Brakuje ¥X” + a thin fill bar; turns green when affordable.
   Shared by the buy pill (the line replaces the Δ preview) and every kit.js btn({ cost }). */
.btn > .short,
.btn > .short__bar { display: none; }

/* owner 2026-10-12 („nie wygląda jak guzik”): the navy secondary button — lighter than the row under it, the 3D edge —
   with the price in clear white; only the affordable state is green */
.btn.is-short {
  --btn-bg: var(--raised-2);
  --btn-edge: var(--edge-c);
  --btn-fg: var(--text);
  --btn-hi: var(--btn-shine-soft);
  flex-wrap: wrap;
  row-gap: 2px;
  padding-bottom: 12px;
}

.btn.is-short:has(> .scr-price) .short__cur { display: none; } /* the price already shows the currency */

.btn.is-short > .short {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  order: 3;
  font-size: var(--fs-12);
  font-weight: 800;
  color: var(--text-2);
}

.btn.is-short:not(.buy) > .short { flex-basis: 100%; }
.btn.is-short .short__cur { display: inline-flex; }
.buy.is-short .buy__delta { display: none; }

.btn.is-short > .short__bar {
  display: block;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 4px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--bg);
  overflow: hidden;
}

.short__fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width var(--mo-med) var(--mo-out);
}

.btn.is-ready { animation: claim-pop var(--mo-slow) var(--mo-spring); }

.buy.is-bought { animation: claim-pop var(--mo-med) var(--mo-spring), buy-flash var(--mo-slow) var(--mo-out); }

@keyframes buy-flash {
  0% { filter: brightness(1.3); }
  100% { filter: none; }
}

/* a buy that would not raise income right now stays GREEN when affordable (BACKLOG 16) — only the second line turns
   into a soft note („Teraz bez efektu — hamuje: X →”). Non-green states: .is-short (Brakuje ¥X) and :disabled (locked). */
.buy.is-dim .buy__delta { color: #fff; font-weight: 700; opacity: 0.85; }

/* maxed (owner 2026-10-15, „+ Kup ¥∞ / Brakuje ¥∞”): the navy button that only says „Maksymalnie ulepszone” in the
   level yellow — no price, no „Brakuje” line or bar, no plus (ui/buy-button.js, kit.js btn's last resort) */
.btn.is-max {
  --btn-bg: var(--panel);
  --btn-edge: var(--edge-c);
  --btn-fg: var(--yellow);
  --btn-hi: var(--btn-shine-off);
  cursor: default;
  filter: none;
}
.btn.is-max :is(.buy__plus, .buy__cur, .buy__price, .buy__delta),
.btn.is-max > :is(.short, .short__bar, .scr-price) { display: none; }
.btn.is-max::before,
.btn.is-max::after { content: none; animation: none; }

/* ------------------------------------------------------------------ toasts
   §4: under the goal cards (--toast-top, measured by js/ui/hud.js placeToasts: they covered goal card 1 — again in the
   visual-pass capture), else under the top bar (safe + 8 + 52 + 8); 8 px from both edges on a phone; a 360 px column
   left-aligned to the HUD on a wide screen (never centred over it). --panel, THE 2 px border, --r-md, the small edge;
   a 28 px well filled by role (good green, gem purple, bad red, info navy) with a white 16 px glyph; text 14 / 800; a
   merge = an „×3” tag. */
#layer-toasts > .toast-stack {
  pointer-events: none;
}

.toast-stack {
  position: absolute;
  top: var(--toast-top, calc(max(8px, var(--safe-top)) + 68px));
  left: max(8px, var(--safe-left));
  right: max(8px, var(--safe-right));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}

/* owner 2026-10-12: nothing covers the QC photos / buttons. While a QC session, the Stół QC panel or the packing
   panel is open, js/ui/toasts.js holds new toasts until it closes; a toast already on screen steps aside here.
   Separate rules on purpose: a browser without :has() drops only the sheet ones. */
#layer-qc.qc-open ~ #layer-toasts > .toast-stack { visibility: hidden; }
#layer-sheets:has(> .sheet--table.is-in) ~ #layer-toasts > .toast-stack { visibility: hidden; }
#layer-sheets:has(> .sheet--pack.is-in) ~ #layer-toasts > .toast-stack { visibility: hidden; }
/* an open sheet starts right under the top bar and a modal sits mid-screen: a toast under the top bar covered the
   Zlecenia header / the Rozwój tabs, or the modal (toasts paint above modals). It drops into the top-bar strip above
   them instead. */
#layer-sheets:has(> .sheet.is-in) ~ #layer-toasts > .toast-stack { top: max(8px, var(--safe-top)); }
/* polish 2 (owner: that strip put the toast over the cash / gem pills): a phone sheet takes the toast as a compact pill
   centred right under its header row (--toast-sheet-top, js/ui/hud.js sheetToastTop); wide screens keep the column
   under the goal cards (the side panel is on the right) */
@media not all and (min-width: 900px) and (orientation: landscape) {
  #layer-sheets:has(> .sheet.is-in) ~ #layer-toasts > .toast-stack {
    top: var(--toast-sheet-top, max(8px, var(--safe-top)));
    align-items: center;
    gap: 6px;
  }
  #layer-sheets:has(> .sheet.is-in) ~ #layer-toasts > .toast-stack > .toast {
    min-height: 36px;
    padding: 4px 14px 4px 4px;
    gap: 8px;
    border-radius: var(--r-pill);
    font-size: var(--fs-12);
  }
  #layer-sheets:has(> .sheet.is-in) ~ #layer-toasts > .toast-stack > .toast .toast__icon { width: 26px; height: 26px; border-radius: 50%; }
}
@media (min-width: 900px) and (orientation: landscape) {
  #layer-sheets:has(> .sheet.is-in) ~ #layer-toasts > .toast-stack { top: var(--toast-top, calc(max(8px, var(--safe-top)) + 68px * var(--ui, 1))); }
}
#layer-modals:has(> .modal-backdrop) ~ #layer-toasts > .toast-stack { top: max(8px, var(--safe-top)); }

.toast {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 12px 8px 8px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: var(--panel);
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-14);
  line-height: var(--lh-tight);
  text-align: left;
  box-shadow: var(--sh-edge-sm);
  animation: toast-in var(--mo-med) var(--mo-out);
}

/* identical toast within 2 s: one toast with a „×n” tag that pops (js/ui/toasts.js) */
.toast__count {
  flex: none;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-xs);
  background: var(--raised-2);
  color: var(--text-2);
  font-size: var(--fs-12);
  font-weight: 800;
  line-height: 20px;
}

.toast__count[hidden] { display: none; }
.toast.is-merged { animation: toast-merge var(--mo-med) var(--mo-spring); }

@keyframes toast-merge {
  0% { transform: scale(1); }
  45% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity var(--mo-med) var(--mo-out), transform var(--mo-med) var(--mo-out);
}

.toast__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  background: var(--raised-2);
  color: #fff;
}

.toast__icon > .ava { width: 28px; height: 28px; }
.toast__icon:has(> .ava) { background: transparent; }
/* roles: (0,3,0) — css/motion.css paints the old gem toast later in the cascade */
.toast-stack > .toast--good .toast__icon,
.toast-stack > .toast--achievement .toast__icon { background: var(--green); color: #fff; }
.toast-stack > .toast--gem .toast__icon { background: var(--gem); color: #fff; }
.toast-stack > .toast--warn .toast__icon { background: var(--red); color: #fff; }
.toast-stack > .toast--gem { border-color: var(--line); background: var(--panel); }
.toast-stack > .toast .toast__gems { color: var(--gem-light); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------------ tutorial overlay (in #layer-toasts) */
/* id-qualified to beat main.css "#layer-toasts > * { pointer-events: auto }" */
#layer-toasts > .tut {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tut__hand,
.tut__bubble {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  transition: opacity var(--mo-med) var(--mo-out);
}

.tut.is-on .tut__hand,
.tut.is-on .tut__bubble {
  opacity: 1;
}

/* the teaching hand: white with a 1.6 px ink-navy outline and a hard drop from the top light */
.tut__hand {
  color: #ffffff;
  filter: drop-shadow(1.6px 0 0 var(--panel)) drop-shadow(-1.6px 0 0 var(--panel)) drop-shadow(0 1.6px 0 var(--panel))
    drop-shadow(0 -1.6px 0 var(--panel)) drop-shadow(0 4px 0 rgba(0, 0, 0, 0.35));
  will-change: transform;
}

/* owner 2026-10-16: the hand „breathes” — a slow swell (1 → 1.08) with a small press toward the point, 1.6 s
   ease-in-out; the hall's hand (js/render/tap-hints.js breath) uses the same timing. Reduce motion: still. */
.tut__hand .icon {
  display: block;
  animation: tut-tap 1.6s ease-in-out infinite;
  transform-origin: 46% 4%;
}

@keyframes tut-tap {
  0%, 100% { transform: translateY(4px) scale(1); }
  50% { transform: translateY(0) scale(1.08); }
}

/* the plain tutorial bubble = the speech-bubble shape of the game (paper + ink, --r-lg, the 4 px ink edge) */
.tut__bubble {
  max-width: 240px;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: var(--fs-16);
  line-height: var(--lh-tight);
  box-shadow: 0 4px 0 var(--ink);
  will-change: transform;
}

/* „Pomiń” = a ghost sm button over the hall */
.tut__skip {
  position: absolute;
  top: calc(max(8px, var(--safe-top)) + 68px);
  right: max(8px, var(--safe-right));
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--raised-2);
  color: var(--text);
  font-weight: 800;
  font-size: var(--fs-14);
  box-shadow: var(--sh-edge-sm);
  cursor: var(--cur-hand);
  pointer-events: auto;
}

.tut.is-modal .tut__skip {
  display: none;
}

/* „Pomiń” never lies on an open sheet (js/ui/tutorial.js placeSkip; bug hunt 2026-10-15: on a phone it covered the
   Stół QC panel's ✕): in the strip right above a bottom sheet / the panel, left of a wide-screen side panel, or above
   the nav when the sheet leaves no strip above it. --tut-skip = its top (above) or the panel's width (side). */
.tut[data-skip='above'] .tut__skip {
  top: var(--tut-skip, 8px);
  bottom: auto;
}

.tut[data-skip='side'] .tut__skip {
  right: calc(var(--tut-skip, 0px) + 12px);
}

.tut[data-skip='low'] .tut__skip {
  top: auto;
  bottom: calc(var(--nav-space, 0px) + 8px);
}

/* „Pominąć samouczek?” — the skip asks first (js/ui/tutorial.js askSkip) */
.modal.modal--tut-skip { width: min(100%, 340px); }

@media (prefers-reduced-motion: reduce) {
  .sheet { transition: none; }
  .tut__hand .icon { animation: none; }
}

/* Integration (2026-10-11): once WP3's QC stage is mounted in the Stół QC panel it brings its own compact ticket;
   hide the host ticket and the stage's duplicate title row so the photo gets the room. */
.sheet--table:has(.qc--panel) .panel__ticket { display: none; }
.sheet--table .qc--panel .qc-top--panel { display: none; }

/* Polish (2026-10-11): one hint bubble at a time — while the onboarding runs, its bubble is the only one (WP3's own
   coach tips are hidden; its pulsing hand on the stain stays). The tutorial layer never takes taps except „Pomiń”. */
.is-tut .qc-coach { display: none !important; }
#layer-toasts > .tut,
#layer-toasts > .tut .tut__hand,
#layer-toasts > .tut .tut__bubble { pointer-events: none; }
#layer-toasts > .tut .tut__skip { pointer-events: auto; }

/* ------------------------------------------------------------------ wide screens (BACKLOG 17)
   Desktop / big monitor in landscape: sheets (incl. the Stół QC panel) open as a right-side panel (~460 px) from
   under the top bar down to the bottom nav, sliding in from the right, so the hall stays visible. */
@media (min-width: 900px) and (orientation: landscape) {
  /* --ui / --ui-hud (js/ui/nav.js, defaults in css/hud.css): 1 / 0.95 up to 1440×900, growing to 1.8 on big screens.
     The panel starts under the (zoomed) top bar and ends at the (zoomed) nav's top edge, and gets wider with --ui. */
  .sheet,
  .sheet--half,
  .sheet--full,
  .sheet--panel {
    left: auto;
    right: max(12px, var(--safe-right));
    top: calc(max(8px, var(--safe-top)) + 58px * var(--ui, 1));
    bottom: calc(var(--nav-space, 0px) * var(--ui-hud, 0.95) + 6px);
    width: min(calc(460px * var(--ui, 1)), max(460px, 42vw), calc(100% - 24px));
    height: auto;
    padding: 12px 16px;
    border-bottom: 2px solid var(--line);
    border-radius: var(--r-lg);
    transform: translateX(calc(100% + 24px));
  }
  /* a side panel has no drag handle (it slides in from the right; a mouse drag never closes it) — the panels' own
     header rows (Stół QC, packing, loading: an absolute ✕ at 18 px) keep the room the handle gave them */
  .sheet__handle { display: none; }
  .sheet--panel { padding-top: 20px; }
  /* Stół QC: the photo grows with the screen height, like the QC session panel (css/qc.css .qc--full) */
  .sheet--table { width: clamp(460px, calc(100dvh - 380px), min(780px, 42vw)); }
  /* what is IN a menu panel scales with the screen (not the positioned panel itself, whose offsets would scale too).
     The mini-game panels (Stół QC, packing, loading) only get wider: their canvases map pointers 1:1. */
  .sheet:not(.sheet--panel) > * { zoom: var(--ui, 1); }
  .modal { zoom: var(--ui, 1); }
  /* toasts: a 360 px column on the HUD's left edge, under the goal cards (--toast-top is measured in real pixels) */
  .toast-stack { right: auto; width: min(calc(100% - 16px), calc(360px * var(--ui, 1))); top: var(--toast-top, calc(max(8px, var(--safe-top)) + 68px * var(--ui, 1))); }
  .toast-stack > .toast { zoom: var(--ui, 1); }
  /* the QC session panel shares the panel frame (its width / look: css/qc.css) */
  #layer-qc > .qc--full {
    top: calc(max(8px, var(--safe-top)) + 58px * var(--ui, 1));
    bottom: calc(var(--nav-space, 0px) * var(--ui-hud, 0.95) + 6px);
  }
  .tut__skip { top: calc(max(8px, var(--safe-top)) + 68px * var(--ui, 1)); }
  .sheet.is-in { transform: none; }
  .sheet.is-out { transform: translateX(calc(100% + 24px)); }
  .sheet-scrim { background: rgba(5, 8, 16, 0.22); }
  .sheet-scrim--panel { background: rgba(5, 8, 16, 0.1); }
}

/* ------------------------------------------------------------------ phones (BACKLOG 32)
   Everything that is NOT the wide landscape desktop above (js/ui/nav.js PHONE_QUERY): the sheet top loses its empty
   close-button row (the ✕ floats top-right next to the screen title), one-line tabs. */
@media not all and (min-width: 900px) and (orientation: landscape) {
  .sheet__handle { height: 16px; }
  .sheet__body { --sheet-body-pt: 4px; }
}

/* ------------------------------------------------------------------ sign finish (owner 2026-10-22, css/main.css tokens)
   Sheets and modals: a soft lit band across the top of the panel (the sign's highlight, 96 px, no blur) and the titles
   lettered like the station signs — white 900 on a hard 4-way outline + the lip. The segmented tabs' sliding pill and
   the toasts take the navy finish. */
.sheet,
.modal { background-image: var(--sign-gloss-panel); }
.sheet__title,
.scr__title,
.modal__title {
  text-shadow: 0 3px 0 var(--edge-c), 0 -1px 0 var(--edge-c), 1px 0 0 var(--edge-c), -1px 0 0 var(--edge-c), 2px 2px 0 var(--edge-c), -2px 2px 0 var(--edge-c);
}
.toast { background-image: var(--sign-gloss-soft); }

/* ------------------------------------------------------------------ empty Tablica (polish 2, js/ui/orders.js boardEmpty)
   One friendly card in the sign finish (navy): Kim waving on a round --bg stage, the sign title, one muted line, the
   chunky „Więcej klientów” button. Centred; the copy and the stage never scroll sideways at 360 px. */
.board-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 16px 16px 20px;
  border-radius: var(--r-lg);
  text-align: center;
}
.board-empty[hidden] { display: none; }
.board-empty__stage {
  display: grid;
  place-items: end center;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: inset 0 0 0 2px var(--line), inset 0 -6px 0 var(--edge-c);
  overflow: hidden;
}
.board-empty__kim { display: block; margin-bottom: -4px; }
.board-empty__title {
  margin: 4px 0 0;
  font-size: var(--fs-20);
  font-weight: 900;
  line-height: var(--lh-tight);
}
.board-empty__t {
  max-width: 30ch;
  margin: 0;
  color: var(--text-2);
  font-size: var(--fs-14);
  font-weight: 700;
  line-height: var(--lh-body);
  text-shadow: none;
}
.board-empty__go { margin-top: 8px; }
