/* =============================================================================
   Kwizzo: Crossfade — client/app.css
   Component and layout styles, plus the host presentation. Owner: author B.

   VOCABULARY RECONCILIATION (drift repair)
   The original draft of this file was written against the architect contract
   (.kz-btn--primary, .kz-prompt, .kz-lane as a button, .kz-seat rows,
   .kz-verdict, [data-urgency="rising|expired"], [data-surface]) while
   screens.mjs / app.mjs / dom.mjs shipped the same concepts under their own
   names (.kz-primary, .kz-question__prompt, .kz-lane__btn, .kz-scoreboard__row,
   .kz-reveal__outcome, [data-urgency="mid|over"], [data-kz-surface]). This
   revision re-points every component rule at the vocabulary the modules
   actually emit. Contract-era selectors that a11y.css also names — .kz-btn,
   .kz-seat, .kz-answer[data-verdict], .kz-clock__text, .kz-ghost__seg,
   .kz-crossfade, .kz-bands, the verdict/ledger block — are KEPT alongside the
   emitted spellings so a11y.css's forced-colors / contrast / motion blocks keep
   matching whichever spelling renders. Markup is proven by the smoke tests and
   is not changed.

   OWNERSHIP BOUNDARY (ARCHITECTURE_CONTRACT / module_map)
   This file holds layout, components and the design tokens. It contains NO
   `prefers-reduced-motion`, `prefers-contrast`, `forced-colors` or
   `:focus-visible` rule — those belong to client/a11y.css (author D), which
   loads after this file and overrides it by source order. Everything those
   rules need is exposed here as a token, so a11y.css adapts the whole app by
   flipping tokens rather than by re-styling components:

     --kz-motion-scale   1 -> 0        kills every duration and delay
     --kz-anim-beat      name -> none  kills the reveal's entrance stagger
     --kz-anim-ghost     name -> none  kills the Signal Ghost pressure pulse
     --kz-font-scale     user text scale, multiplies the whole type ramp
     --kz-focus / --kz-focus-halo / --kz-focus-w / --kz-focus-offset
                         the focus ring, already contrast-verified in both themes
     --kz-line-strong    the >=3:1 border used on every meaning-bearing surface

   MARKUP CONTRACT — the DOM these selectors expect, as screens.mjs emits it
     #kz-app.kz-app > .kz-screen.kz-screen--<id>[data-kz-screen]
     .kz-card.kz-question[data-kz-surface="host|player"]
       > .kz-question__counter + .kz-host + .kz-question__prompt
         + .kz-ceiling > .kz-ceiling__line + .kz-ceiling__ladder
             > .kz-ceiling__rung[data-state="spent|current|available"]
                 > .kz-ceiling__mark + .kz-ceiling__text + .kz-ceiling__tag
         + .kz-clock[data-urgency="low|mid|high|over|none"]
             > .kz-clock__line > .kz-clock__label + .kz-clock__value + .kz-clock__state
             + .kz-clock__track > .kz-clock__fill   (width written inline per tick)
             + .kz-clock__profile
         + .kz-lane > .kz-lane__title + .kz-lane__hint
             + .kz-lane__row > button.kz-target.kz-lane__btn[data-kz-slot="tune-a|b"]
                 [data-lane-state="open|yours|closed|spent|off"]
                 > .kz-lane__mark + .kz-lane__name + .kz-lane__state
             + .kz-lane__clues-title + .kz-lane__empty
             + ol.kz-clue-list > li.kz-clue[data-step][data-pending?]
                 > .kz-clue__n + .kz-clue__text
         + .kz-answers > .kz-answers__title + .kz-answers__hint
             + .kz-answers__grid > button.kz-target.kz-answer[data-chosen?][aria-checked?]
                 > .kz-answer__mark + .kz-answer__label + .kz-answer__state
             + button.kz-target.kz-lock + .kz-answers__lock-state + .kz-answers__locked
         + .kz-question__error + .kz-question__footer
     .kz-host (p) > .kz-host__who + .kz-host__text
     .kz-card.kz-reveal[data-outcome="correct|wrong|none|pending"]
       > .kz-reveal__outcome > .kz-reveal__mark + span
       + .kz-reveal__score + .kz-reveal__meta + .kz-host
       + dl.kz-reveal__facts > .kz-reveal__row > dt + dd.kz-reveal__yours|__right
       + .kz-reveal__explanation + .kz-reveal__source > a.kz-reveal__source-link
       + .kz-reveal__lanes > .kz-reveal__lane[data-taken?]
       + .kz-reveal__wait-hint + .kz-actions > .kz-primary + .kz-link-btn
     .kz-scoreboard > table.kz-scoreboard__table
       > tr.kz-scoreboard__row[data-you?][data-simulated?]
     .kz-ghost[data-pressure="quiet|rising|locked"] > .kz-ghost__line + .kz-ghost__pulse
     .kz-shield > .kz-shield__title + .kz-shield__body + .kz-primary + .kz-shield__note
     .kz-banner.kz-banner--sim|--degraded > .kz-glyph + span
     .kz-screen__title/.kz-screen__body/.kz-screen__detail/.kz-screen__meta
     .kz-actions, .kz-picker__list/__row/__name/__reason, .kz-check/.kz-radio,
     .kz-report/__reasons/__option/__radio/__detail(-label)/__saved,
     .kz-results__mine/__timing, .kz-share__status, .kz-locale*, .kz-split
   Inert-but-focusable state is [aria-disabled="true"] + [data-kz-inert] +
   .is-inert, written together by screens.mjs inert().

   MOTION POLICY
   Motion is decoration here and never information. The reveal's comic rhythm is
   built from layout — measure, size contrast, rule lines and the size of the
   silence between beats — so a reduced-motion player reads the same joke with
   the same timing. The optional entrance is a <=460ms opacity/2px-translate
   stagger that is simply absent when --kz-anim-beat is `none`; the unanimated
   state is the final state, never a hidden one.

   NO TEXT LIVES HERE
   Nothing in this file renders a word a player reads. Every string comes from
   data/question_groups.json or client/strings/<locale>.json (author E). The
   single exception is the locale-aware quotation table for the host line —
   punctuation, defined for all four locales, which belongs to the typography
   and not to a strings file.

   STATE COMES FROM ARIA AND DATA, NOT FROM BARE CLASSES
   Selected / pressed / disabled are styled from `[aria-checked]`,
   `[data-chosen]`, `[disabled]`, `[aria-disabled]` and `[data-kz-inert]` so the
   visual state and the accessible state cannot drift apart. `is-*` classes are
   used only for states ARIA does not express. There is no selector anywhere
   that could expose the correct answer: `[data-outcome]` is written by
   screens.mjs at reveal and does not exist in the document before then.

   CONTRAST, MEASURED (sRGB, WCAG 2.x ratios, computed not assumed)
     light  ink/bg 16.6  ink/surface 18.7  ink-2/bg 7.1  focus/bg 16.6
            focus/surface 18.7  line-strong/surface 4.4  line-strong/bg 3.9
            ok/surface 7.9  bad/surface 7.9  urgent-fill/track 5.0
            lane-a/bg 6.4  lane-b/bg 8.0  white-on-signal 7.8
     dark   ink/bg 16.7  ink/surface 15.3  ink-2/surface 8.0  focus/bg 11.9
            focus/surface 11.0  line-strong/surface 4.4  line-strong/2 3.8
            ok/surface 9.3  bad/surface 8.0  urgent-fill/track 8.5
            lane-a/surface 9.0  lane-b/surface 9.0  bg-on-signal 9.2
   Every meaning-bearing border and mark is >=3:1; every text pair is >=4.5:1.
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. TOKENS — light is the base palette; dark is a token swap, nothing else.
   -------------------------------------------------------------------------- */

:root {
  color-scheme: light;

  /* ink and ground */
  --kz-bg: #f4f1e9;
  --kz-surface: #ffffff;
  --kz-surface-2: #e8e3d6;
  --kz-surface-inset: #f9f7f1;
  --kz-ink: #141210;
  --kz-ink-2: #55504a;
  --kz-line: #c9c2b2;          /* decorative hairline only — 1.6:1, never load-bearing */
  --kz-line-strong: #7e7768;   /* every border that carries meaning — 4.4:1 on surface */

  /* signal (primary action) */
  --kz-signal: #1b44c8;
  --kz-signal-ink: #ffffff;

  /* semantics — always paired with a glyph and a word in the DOM */
  --kz-ok: #1a5d33;
  --kz-ok-ink: #ffffff;
  --kz-bad: #9c231c;
  --kz-bad-ink: #ffffff;
  --kz-urgent: #a63e00;
  --kz-urgent-ink: #ffffff;

  /* the two clue lanes */
  --kz-lane-a: #0f5c86;
  --kz-lane-b: #7a2570;

  /* focus — owned here, applied by a11y.css :focus-visible */
  --kz-focus: #141210;
  --kz-focus-halo: #ffffff;
  --kz-focus-w: 3px;
  --kz-focus-offset: 2px;

  --kz-shadow: 0 1px 0 rgb(20 18 16 / 0.06), 0 2px 10px rgb(20 18 16 / 0.06);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --kz-bg: #0d0f12;
    --kz-surface: #16191e;
    --kz-surface-2: #212630;
    --kz-surface-inset: #11141a;
    --kz-ink: #f2efe8;
    --kz-ink-2: #b4ae9f;
    --kz-line: #333a45;
    --kz-line-strong: #79808d;
    --kz-signal: #8ab4ff;
    --kz-signal-ink: #0d0f12;
    --kz-ok: #6fd08c;
    --kz-ok-ink: #0d0f12;
    --kz-bad: #ff9080;
    --kz-bad-ink: #0d0f12;
    --kz-urgent: #ffb25a;
    --kz-urgent-ink: #0d0f12;
    --kz-lane-a: #6fc3f0;
    --kz-lane-b: #f0a0da;
    --kz-focus: #ffc24a;
    --kz-focus-halo: #16191e;
    --kz-shadow: 0 1px 0 rgb(0 0 0 / 0.5), 0 2px 12px rgb(0 0 0 / 0.45);
  }
}

/* The explicit toggle wins over the system preference in both directions. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --kz-bg: #0d0f12;
  --kz-surface: #16191e;
  --kz-surface-2: #212630;
  --kz-surface-inset: #11141a;
  --kz-ink: #f2efe8;
  --kz-ink-2: #b4ae9f;
  --kz-line: #333a45;
  --kz-line-strong: #79808d;
  --kz-signal: #8ab4ff;
  --kz-signal-ink: #0d0f12;
  --kz-ok: #6fd08c;
  --kz-ok-ink: #0d0f12;
  --kz-bad: #ff9080;
  --kz-bad-ink: #0d0f12;
  --kz-urgent: #ffb25a;
  --kz-urgent-ink: #0d0f12;
  --kz-lane-a: #6fc3f0;
  --kz-lane-b: #f0a0da;
  --kz-focus: #ffc24a;
  --kz-focus-halo: #16191e;
  --kz-shadow: 0 1px 0 rgb(0 0 0 / 0.5), 0 2px 12px rgb(0 0 0 / 0.45);
}

:root {
  /* type — no webfont, no download, no layout shift */
  --kz-font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --kz-font-host: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --kz-font-mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "SF Mono", Menlo, Consolas, monospace;

  /* raw ramp. The vw term is what makes the shared screen readable from a sofa;
     the rem floor is what keeps it sane at 320px and at 200% zoom. */
  --kz-fs-100-raw: 0.8125rem;
  --kz-fs-200-raw: 0.9375rem;
  --kz-fs-300-raw: 1.0625rem;
  --kz-fs-400-raw: clamp(1.125rem, 1.02rem + 0.5vw, 1.375rem);
  --kz-fs-500-raw: clamp(1.375rem, 1.14rem + 1.2vw, 2rem);
  --kz-fs-600-raw: clamp(1.75rem, 1.3rem + 2.2vw, 3rem);
  --kz-fs-700-raw: clamp(2.25rem, 1.5rem + 3.8vw, 4.5rem);

  --kz-lh-tight: 1.05;
  --kz-lh-snug: 1.25;
  --kz-lh-body: 1.55;
  --kz-lh-host: 1.35;

  --kz-measure: 62ch;
  --kz-measure-host: 30ch;   /* the punchline breaks itself into beats */

  /* space */
  --kz-s1: 0.25rem;
  --kz-s2: 0.5rem;
  --kz-s3: 0.75rem;
  --kz-s4: 1rem;
  --kz-s5: 1.5rem;
  --kz-s6: 2rem;
  --kz-s7: 3rem;
  --kz-s8: 4rem;

  /* reveal rhythm: setup, pause, landing. These three numbers are the joke. */
  --kz-beat-setup: 0.5rem;
  --kz-beat-pause: 1.75rem;
  --kz-beat-land: 2.75rem;

  /* targets: 44x44 minimum, 12px apart (requirement is >=8) */
  --kz-target: 44px;
  --kz-target-comfort: 56px;
  --kz-gap-target: 12px;

  --kz-radius: 10px;
  --kz-radius-lg: 16px;
  --kz-border: 1px;
  --kz-border-thick: 3px;

  /* motion. a11y.css sets --kz-motion-scale: 0 and both names to none. */
  --kz-motion-scale: 1;
  --kz-anim-beat: kz-beat-in;
  --kz-anim-ghost: kz-ghost-pulse;
  --kz-dur-fast: calc(120ms * var(--kz-motion-scale));
  --kz-dur: calc(200ms * var(--kz-motion-scale));
  --kz-beat-step: 80ms;

  --kz-font-scale: 1;
}

/* Manual reduced-motion hooks. The *preference* media query is a11y.css's;
   these are the toggle the player flips in settings, and they are plain
   attribute/class selectors, so the ownership boundary holds. */
:root.reduced-motion,
:root[data-motion="reduced"],
.kz-app.is-reduced-motion {
  --kz-motion-scale: 0;
  --kz-anim-beat: none;
  --kz-anim-ghost: none;
}

/* -----------------------------------------------------------------------------
   2. BASE
   -------------------------------------------------------------------------- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--kz-bg);
  color: var(--kz-ink);
  font-family: var(--kz-font-ui);
  font-size: var(--kz-fs-300);
  line-height: var(--kz-lh-body);
}

h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { max-inline-size: 100%; block-size: auto; }

/* screens.mjs show()/hidden drives visibility with the hidden attribute; author
   display values on the same elements must never resurrect a hidden node. */
[hidden] { display: none !important; }

/* Long French and Portuguese clue sentences must not push a 320px controller
   into horizontal scrolling. Nothing here is allowed to establish a min width. */
.kz-prompt,
.kz-question__prompt,
.kz-clue__step,
.kz-clue__text,
.kz-host__line,
.kz-host__text,
.kz-answer__label,
.kz-reveal__explain,
.kz-reveal__explanation,
.kz-banner__text,
.kz-banner__body,
.kz-screen__body {
  overflow-wrap: break-word;
  hyphens: auto;
}

/* The one sanctioned escape hatch for genuinely wide content (the scoreboard on
   a narrow controller). Scrolls inside itself; the page never scrolls sideways. */
.kz-scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable;
}

/* Self-contained skip link: works even if a11y.css never loads. */
#kz-skip {
  position: absolute;
  inset-inline-start: var(--kz-s3);
  inset-block-start: -100vh;
  z-index: 20;
  padding: var(--kz-s3) var(--kz-s4);
  min-block-size: var(--kz-target);
  display: inline-flex;
  align-items: center;
  background: var(--kz-surface);
  color: var(--kz-ink);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  font-weight: 700;
  text-decoration: underline;
}
#kz-skip:focus { inset-block-start: var(--kz-s3); }

/* Baseline focus ring. a11y.css narrows this to :focus-visible; if it is
   missing, a visible ring still exists — outline is never removed without an
   equal replacement. Ring 3px at 2px offset, plus a halo that guarantees a
   contrasting edge even when the control's own face is light-on-dark. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus {
  outline: var(--kz-focus-w) solid var(--kz-focus);
  outline-offset: var(--kz-focus-offset);
  box-shadow: 0 0 0 var(--kz-focus-offset) var(--kz-focus-halo);
}

/* -----------------------------------------------------------------------------
   3. SHELL AND LAYOUT
   -------------------------------------------------------------------------- */

/* :where() so this whole defaults block has ZERO specificity: the id selector
   would otherwise outrank the host-surface rules and silently kill the host
   type scale. Every state rule below is a plain attribute selector and wins. */
:where(#kz-app, .kz-app) {
  --kz-surface-scale: 1;
  --kz-type-scale: calc(var(--kz-surface-scale) * var(--kz-font-scale));

  --kz-fs-100: calc(var(--kz-fs-100-raw) * var(--kz-type-scale));
  --kz-fs-200: calc(var(--kz-fs-200-raw) * var(--kz-type-scale));
  --kz-fs-300: calc(var(--kz-fs-300-raw) * var(--kz-type-scale));
  --kz-fs-400: calc(var(--kz-fs-400-raw) * var(--kz-type-scale));
  --kz-fs-500: calc(var(--kz-fs-500-raw) * var(--kz-type-scale));
  --kz-fs-600: calc(var(--kz-fs-600-raw) * var(--kz-type-scale));
  --kz-fs-700: calc(var(--kz-fs-700-raw) * var(--kz-type-scale));

  display: block;
  min-block-size: 100vh;
  min-block-size: 100dvh;
  min-inline-size: 0;
  font-size: var(--kz-fs-300);
}

/* Same ramp for anything mounted outside #kz-app (banner, live regions). */
:root {
  --kz-type-scale: var(--kz-font-scale);
  --kz-fs-100: calc(var(--kz-fs-100-raw) * var(--kz-type-scale));
  --kz-fs-200: calc(var(--kz-fs-200-raw) * var(--kz-type-scale));
  --kz-fs-300: calc(var(--kz-fs-300-raw) * var(--kz-type-scale));
  --kz-fs-400: calc(var(--kz-fs-400-raw) * var(--kz-type-scale));
  --kz-fs-500: calc(var(--kz-fs-500-raw) * var(--kz-type-scale));
  --kz-fs-600: calc(var(--kz-fs-600-raw) * var(--kz-type-scale));
  --kz-fs-700: calc(var(--kz-fs-700-raw) * var(--kz-type-scale));
}

/* Across a room: the host surface is read at three metres, so it gets a bigger
   ramp, a wider measure and more air. screens.mjs writes data-kz-surface on the
   question card; the ramp is re-derived there so the bigger scale actually
   reaches the subtree. [data-surface] is the contract-era spelling, kept. */
[data-surface="host"] { --kz-surface-scale: 1.35; }
[data-surface="host"] .kz-screen { --kz-measure: 46ch; max-inline-size: 72rem; }

[data-kz-surface="host"] {
  --kz-surface-scale: 1.35;
  --kz-type-scale: calc(var(--kz-surface-scale) * var(--kz-font-scale));
  --kz-fs-100: calc(var(--kz-fs-100-raw) * var(--kz-type-scale));
  --kz-fs-200: calc(var(--kz-fs-200-raw) * var(--kz-type-scale));
  --kz-fs-300: calc(var(--kz-fs-300-raw) * var(--kz-type-scale));
  --kz-fs-400: calc(var(--kz-fs-400-raw) * var(--kz-type-scale));
  --kz-fs-500: calc(var(--kz-fs-500-raw) * var(--kz-type-scale));
  --kz-fs-600: calc(var(--kz-fs-600-raw) * var(--kz-type-scale));
  --kz-fs-700: calc(var(--kz-fs-700-raw) * var(--kz-type-scale));
  --kz-measure: 46ch;
  font-size: var(--kz-fs-300);
}

.kz-screen {
  display: flow-root;
  inline-size: 100%;
  max-inline-size: 56rem;
  min-inline-size: 0;
  margin-inline: auto;
  padding: var(--kz-s5) var(--kz-s4) var(--kz-s8);
}
.kz-screen > * + * { margin-block-start: var(--kz-s4); }

/* Screen headline: the serif show voice, with a short signal underline so
   every screen opens like a title card and not like a form heading. */
.kz-screen__title {
  font-family: var(--kz-font-host);
  font-size: var(--kz-fs-600);
  font-weight: 800;
  line-height: var(--kz-lh-tight);
  letter-spacing: -0.01em;
  text-wrap: balance;
  max-inline-size: var(--kz-measure);
}
.kz-screen__title::after {
  content: "";
  display: block;
  inline-size: 3.5rem;
  block-size: 4px;
  margin-block-start: var(--kz-s3);
  background: var(--kz-signal);
  border-radius: 999px;
}

.kz-screen__body {
  max-inline-size: var(--kz-measure);
  font-size: var(--kz-fs-300);
  line-height: var(--kz-lh-body);
}

.kz-screen__meta {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}

/* Diagnostic detail (fatal / unmounted screens): scrolls inside itself. */
.kz-screen__detail {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  background: var(--kz-surface-inset);
  border: var(--kz-border) solid var(--kz-line);
  border-radius: var(--kz-radius);
  padding: var(--kz-s3) var(--kz-s4);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  white-space: pre-wrap;
  margin: 0;
}

.kz-screen--fatal .kz-screen__title { color: var(--kz-bad); }
.kz-screen--fatal .kz-screen__title::after { background: var(--kz-bad); }
.kz-screen--unmounted .kz-screen__title::after { background: var(--kz-line-strong); }

/* Boot placeholder and the no-JS card. */
.kz-boot {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-200);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  text-align: center;
  padding: var(--kz-s8) var(--kz-s4);
}
.kz-noscript {
  max-inline-size: 56rem;
  margin: var(--kz-s5) auto;
  padding: var(--kz-s5);
  background: var(--kz-surface);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius-lg);
}

.kz-stack > * + * { margin-block-start: var(--kz-s4); }
.kz-stack--tight > * + * { margin-block-start: var(--kz-s2); }
.kz-stack--loose > * + * { margin-block-start: var(--kz-s6); }
.kz-stack > * { min-inline-size: 0; }

.kz-card {
  background: var(--kz-surface);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius-lg);
  padding: var(--kz-s5) var(--kz-s4);
  box-shadow: var(--kz-shadow);
}

.kz-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kz-gap-target);
  align-items: center;
}
.kz-row > * { min-inline-size: 0; }

/* Action rows. a11y.css re-asserts the flex/gap for reflow; the margin and the
   full-bleed behaviour on narrow screens live here. */
.kz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kz-gap-target);
  align-items: stretch;
  margin-block-start: var(--kz-s5);
}
.kz-actions > * { min-inline-size: 0; }
.kz-actions > .kz-input { flex: 1 1 14rem; }

.kz-kicker,
.kz-question__counter {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  font-weight: 600;
}

.kz-rule {
  block-size: 0;
  border: 0;
  border-block-start: var(--kz-border) solid var(--kz-line);
}

/* The signal-lab motif: a band of frequency ticks. Decorative, aria-hidden,
   and made of borders so it survives a palette override as a row of marks. */
.kz-bands {
  display: flex;
  gap: 3px;
  block-size: 10px;
  align-items: end;
}
.kz-bands > i {
  display: block;
  inline-size: 3px;
  block-size: 100%;
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: 1px;
}
.kz-bands > i:nth-child(3n) { block-size: 60%; }
.kz-bands > i:nth-child(4n) { block-size: 80%; }

/* Zone labels: the mono micro-heading over every panel section. The bare h3s
   inside the scoreboard, ghost and reveal panels get the same voice. */
.kz-lane__title,
.kz-lane__clues-title,
.kz-answers__title,
.kz-scoreboard > h3,
.kz-ghost > h3,
.kz-reveal > h3 {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  margin-block: 0 var(--kz-s2);
}

/* Generic aria-hidden glyph (banners, scoreboard identity marks). */
.kz-glyph {
  font-family: var(--kz-font-mono);
  font-weight: 700;
  margin-inline-end: 0.5ch;
}

/* -----------------------------------------------------------------------------
   4. TARGETS AND CONTROLS
   44x44 minimum with 12px separation, everywhere, at every viewport.
   The modules emit button.kz-target [+ kz-primary | kz-secondary | kz-link-btn
   | kz-lock | kz-answer | kz-lane__btn]; .kz-btn* is the contract-era spelling
   a11y.css also names, kept pointing at the same design.
   -------------------------------------------------------------------------- */

.kz-target {
  min-block-size: var(--kz-target);
  min-inline-size: var(--kz-target);
}

.kz-targets {
  display: flex;
  flex-wrap: wrap;
  gap: var(--kz-gap-target);
}

.kz-btn,
button.kz-target {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--kz-s2);
  min-block-size: var(--kz-target);
  min-inline-size: var(--kz-target);
  padding: var(--kz-s3) var(--kz-s5);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
  color: var(--kz-ink);
  font: inherit;
  font-weight: 650;
  line-height: var(--kz-lh-snug);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--kz-dur-fast) linear,
              border-color var(--kz-dur-fast) linear,
              box-shadow var(--kz-dur-fast) linear;
}
.kz-btn:hover,
button.kz-target:hover { background: var(--kz-surface-2); }
.kz-btn:active,
button.kz-target:active { transform: translateY(1px); }

/* Primary: the one loud control on a surface. */
.kz-btn--primary,
.kz-target.kz-primary {
  background: var(--kz-signal);
  border-color: var(--kz-signal);
  color: var(--kz-signal-ink);
  box-shadow: var(--kz-shadow);
}
.kz-target.kz-primary:hover { background: var(--kz-signal); filter: brightness(1.08); }

/* Secondary: present, quiet, clearly a button. */
.kz-btn--quiet,
.kz-target.kz-secondary {
  border-color: var(--kz-line-strong);
  background: transparent;
}

/* Utility link-buttons (report / settings / leave): text-weight controls that
   keep the full 44px target but do not compete with the play surface. */
.kz-target.kz-link-btn {
  border-color: transparent;
  background: transparent;
  color: var(--kz-ink-2);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  padding-inline: var(--kz-s3);
}
.kz-target.kz-link-btn:hover { background: var(--kz-surface-2); color: var(--kz-ink); }

.kz-btn--danger {
  background: var(--kz-surface);
  border-color: var(--kz-bad);
  color: var(--kz-bad);
}

/* The lock-in control: big enough to hit with a thumb while a clock runs. */
.kz-btn--advance,
.kz-target.kz-lock {
  min-block-size: var(--kz-target-comfort);
  font-size: var(--kz-fs-400);
  inline-size: 100%;
  background: var(--kz-signal);
  border-color: var(--kz-signal);
  color: var(--kz-signal-ink);
}
.kz-target.kz-lock:hover { background: var(--kz-signal); filter: brightness(1.08); }

.kz-btn[disabled],
.kz-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 1;                      /* dimming alone is not a state */
  background: var(--kz-surface-2);
  border-style: dashed;            /* the state is a pattern, not a shade */
  color: var(--kz-ink-2);
}

/* Anchors that are targets (source link, home link) are links, not buttons. */
a.kz-target {
  display: inline-flex;
  align-items: center;
  gap: var(--kz-s2);
  color: var(--kz-signal);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* Text fields, the alias input and the report detail box. */
.kz-input,
.kz-report__detail,
textarea.kz-target,
input[type="text"].kz-target {
  display: block;
  font: inherit;
  color: var(--kz-ink);
  background: var(--kz-surface-inset);
  border: 2px solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  padding: var(--kz-s2) var(--kz-s3);
  min-block-size: var(--kz-target);
  max-inline-size: 100%;
}
.kz-report__detail { inline-size: 100%; resize: vertical; }

.kz-label {
  display: block;
  font-size: var(--kz-fs-200);
  font-weight: 700;
  margin-block-start: var(--kz-s4);
}

/* Checkbox and radio rows: one full-width tappable band per choice. */
.kz-target.kz-check,
.kz-target.kz-report__option {
  display: flex;
  align-items: center;
  gap: var(--kz-s3);
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-line);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
}
.kz-target.kz-check:hover,
.kz-target.kz-report__option:hover { border-color: var(--kz-line-strong); }
.kz-check > label,
.kz-report__option > label { flex: 1 1 auto; min-inline-size: 0; cursor: pointer; }

/* The input itself is a focusable target: a11y.mjs auditTargets() measures its
   own box against 44x44, so the glyph is sized to the target token rather than
   relying on the 44px row around it. */
.kz-check__input,
.kz-radio,
.kz-report__radio {
  inline-size: var(--kz-target);
  block-size: var(--kz-target);
  flex: none;
  accent-color: var(--kz-signal);
  margin: 0;
}

.kz-fieldset {
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  padding: var(--kz-s3) var(--kz-s4) var(--kz-s4);
  margin: 0;
  display: grid;
  gap: var(--kz-s2);
  min-inline-size: 0;
}
.kz-fieldset > legend {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  padding-inline: var(--kz-s2);
}

/* -----------------------------------------------------------------------------
   5. BANNERS — the simulation notice is text in the flow, never a badge.
   index.html's #kz-banner mount also carries .kz-banner; the id resets the box
   so only real notices inside it draw one.
   -------------------------------------------------------------------------- */

#kz-banner:empty { display: none; }
#kz-banner {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  max-inline-size: 56rem;
  margin-inline: auto;
}
#kz-banner > * { margin-block-start: var(--kz-s2); }

.kz-banner {
  display: flex;
  gap: var(--kz-s3);
  align-items: baseline;
  max-inline-size: 56rem;
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-2);
  color: var(--kz-ink);
  font-size: var(--kz-fs-200);
}
.kz-banner + .kz-banner { margin-block-start: var(--kz-s2); }
.kz-banner__mark,
.kz-banner > .kz-glyph {
  font-family: var(--kz-font-mono);
  font-weight: 700;
  border: var(--kz-border) solid currentColor;
  border-radius: 999px;
  padding-inline: 0.5em;
  margin-inline-end: 0;
  flex: none;
}
.kz-banner__text { min-inline-size: 0; }
.kz-banner[data-kind="sim"],
.kz-banner--sim { border-color: var(--kz-urgent); }
.kz-banner[data-kind="sim"] .kz-banner__mark,
.kz-banner--sim > .kz-glyph {
  background: var(--kz-urgent);
  border-color: var(--kz-urgent);
  color: var(--kz-urgent-ink);
}
.kz-banner[data-kind="degraded"],
.kz-banner--degraded { border-style: dashed; }

/* Boot-level notice card written by app.mjs into #kz-banner. */
.kz-banner__notice {
  display: grid;
  gap: var(--kz-s1);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-2);
}
.kz-banner__title { font-size: var(--kz-fs-300); font-weight: 700; }
.kz-banner__body { font-size: var(--kz-fs-200); min-inline-size: 0; }

/* -----------------------------------------------------------------------------
   6. QUESTION SURFACE — written once, reused by all six contexts.
   -------------------------------------------------------------------------- */

.kz-question { display: flow-root; }
.kz-question > * + * { margin-block-start: var(--kz-s4); }
.kz-question > .kz-host { margin-block-start: var(--kz-s3); }

.kz-prompt,
.kz-question__prompt {
  max-inline-size: var(--kz-measure);
  margin-block: var(--kz-s2) var(--kz-s4);
  font-size: var(--kz-fs-500);
  font-weight: 650;
  line-height: var(--kz-lh-snug);
  letter-spacing: -0.005em;
  text-wrap: pretty;
}
[data-surface="host"] .kz-prompt,
[data-kz-surface="host"] .kz-question__prompt {
  font-size: var(--kz-fs-600);
  font-weight: 700;
}

.kz-question__error {
  border-inline-start: 6px solid var(--kz-bad);
  padding: var(--kz-s2) var(--kz-s3);
  color: var(--kz-bad);
  font-weight: 600;
  background: var(--kz-surface-inset);
  border-radius: 0 var(--kz-radius) var(--kz-radius) 0;
}

/* Host-projection extras: lane names and the lock roster, read from a sofa. */
.kz-question__host-lanes { font-size: var(--kz-fs-500); font-weight: 700; }
.kz-question__host-roster {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-400);
}
.kz-question__host-note { color: var(--kz-ink-2); font-size: var(--kz-fs-200); }

.kz-question__footer {
  margin-block-start: var(--kz-s6);
  padding-block-start: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line);
}
.kz-question__footer-hint { font-size: var(--kz-fs-100); color: var(--kz-ink-2); }
.kz-question__footer .kz-actions { margin-block-start: var(--kz-s2); }
.kz-question__footer .kz-target.kz-link-btn { padding-inline: var(--kz-s2); }

/* --- the host voice --------------------------------------------------------
   screens.mjs emits p.kz-host > .kz-host__who + .kz-host__text; the contract
   spelling (.kz-host__intent/__line/__attrib) shares the rules. A different
   typeface at a narrow measure: the line breaks the way a joke is written. */
.kz-host {
  display: grid;
  gap: var(--kz-s1);
  padding-inline-start: var(--kz-s4);
  border-inline-start: 6px solid var(--kz-signal);
}
.kz-host__intent,
.kz-host__attrib,
.kz-host__who {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-host__line,
.kz-host__text {
  font-family: var(--kz-font-host);
  font-size: var(--kz-fs-400);
  line-height: var(--kz-lh-host);
  max-inline-size: var(--kz-measure-host);
  text-wrap: pretty;
  hanging-punctuation: first;
}
.kz-host__line::before,
.kz-host__text::before { content: open-quote; }
.kz-host__line::after,
.kz-host__text::after { content: close-quote; }
.kz-host__text:empty::before,
.kz-host__text:empty::after { content: none; }
/* On the shared screen the host line is the whole point of the room. */
[data-surface="host"] .kz-host__line,
[data-kz-surface="host"] .kz-host__text {
  font-size: var(--kz-fs-500);
  max-inline-size: 26ch;
}
/* Beat-specific weighting (contract attribute, harmless when absent). */
.kz-host[data-beat="correct-reveal"] { border-inline-start-color: var(--kz-ok); }
.kz-host[data-beat="wrong-reveal"] { border-inline-start-color: var(--kz-bad); }
.kz-host[data-beat="tune-tease"],
.kz-host[data-beat="early-lock"] { border-inline-start-style: dashed; }

/* Locale-aware quotation marks for the host line. This is the only four-locale
   string table in the stylesheet, and it is punctuation: the corpus stores
   host_correct / host_wrong unquoted and screens.mjs must not add quotes. */
.kz-host__line,
.kz-host__text { quotes: "\201C" "\201D" "\2018" "\2019"; }
:lang(fr) .kz-host__line,
:lang(fr) .kz-host__text { quotes: "\00AB\00A0" "\00A0\00BB" "\201C" "\201D"; }
:lang(es) .kz-host__line,
:lang(es) .kz-host__text { quotes: "\00AB" "\00BB" "\201C" "\201D"; }
:lang(pt) .kz-host__line,
:lang(pt) .kz-host__text { quotes: "\201C" "\201D" "\2018" "\2019"; }
:lang(en) .kz-host__line,
:lang(en) .kz-host__text { quotes: "\201C" "\201D" "\2018" "\2019"; }

/* --- ceiling: the price ladder ---------------------------------------------
   The readout line plus three rungs. State is a word (.kz-ceiling__tag), a
   glyph (.kz-ceiling__mark) and a border treatment — never colour alone. */
.kz-ceiling {
  display: grid;
  gap: var(--kz-s3);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-inset);
}
.kz-ceiling__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--kz-s2) var(--kz-s4);
}
.kz-ceiling__level {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-ceiling__now,
.kz-ceiling__value {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-500);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
}
.kz-ceiling__ladder {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: var(--kz-s2);
}
.kz-ceiling__rung {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--kz-s1) var(--kz-s2);
  align-items: baseline;
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
  font-size: var(--kz-fs-200);
}
.kz-ceiling__mark { font-family: var(--kz-font-mono); font-weight: 700; }
.kz-ceiling__text { min-inline-size: 0; font-variant-numeric: tabular-nums; }
.kz-ceiling__tag {
  grid-column: 2;
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-ceiling__rung[data-state="current"] {
  background: var(--kz-surface-2);
  box-shadow: inset 0 0 0 2px var(--kz-ink);
  font-weight: 700;
}
.kz-ceiling__rung[data-state="current"] .kz-ceiling__mark { color: var(--kz-signal); }
.kz-ceiling__rung[data-state="spent"] {
  border-style: dotted;
  color: var(--kz-ink-2);
}

/* -----------------------------------------------------------------------------
   7. LANES AND CLUES
   screens.mjs emits section.kz-lane as the CONTAINER (title, hint, tuner row,
   clue list); the tappable tuner is button.kz-lane__btn with a lane slot.
   Tuning replaces clue TEXT and updates the ceiling; it never adds or removes
   a control, so the tab order is identical at every reveal level.
   -------------------------------------------------------------------------- */

.kz-lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--kz-gap-target);
}

.kz-lane {
  display: grid;
  gap: var(--kz-s2);
  margin-block-start: var(--kz-s5);
  padding-block-start: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line);
}
.kz-lane__hint { font-size: var(--kz-fs-200); color: var(--kz-ink-2); }
.kz-lane__row { margin-block: var(--kz-s1) var(--kz-s2); }
.kz-lane__clues-title { margin-block-start: var(--kz-s3); }

.kz-target.kz-lane__btn {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--kz-s1) var(--kz-s3);
  align-items: center;
  justify-content: start;
  min-block-size: var(--kz-target-comfort);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
  color: var(--kz-ink);
  text-align: start;
}
/* The lane glyph (◐ / ◑) is the non-colour carrier of lane identity; the
   coloured spine is the second signal. */
.kz-lane__mark {
  grid-row: 1 / span 2;
  display: inline-grid;
  place-items: center;
  inline-size: 1.8em;
  block-size: 1.8em;
  border: var(--kz-border) solid currentColor;
  border-radius: 6px;
  font-family: var(--kz-font-mono);
  font-size: 1em;
  line-height: 1;
}
.kz-lane__name { font-weight: 700; line-height: var(--kz-lh-snug); min-inline-size: 0; }
.kz-lane__state {
  grid-column: 2;
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-target.kz-lane__btn[data-kz-slot="tune-a"] {
  border-inline-start-color: var(--kz-lane-a);
  border-inline-start-width: 8px;
}
.kz-target.kz-lane__btn[data-kz-slot="tune-a"] .kz-lane__mark { color: var(--kz-lane-a); }
.kz-target.kz-lane__btn[data-kz-slot="tune-b"] {
  border-inline-start-color: var(--kz-lane-b);
  border-inline-start-width: 8px;
}
.kz-target.kz-lane__btn[data-kz-slot="tune-b"] .kz-lane__mark { color: var(--kz-lane-b); }
/* The lane you committed to: ground and edge change, geometry does not. */
.kz-lane__btn[data-lane-state="yours"] {
  background: var(--kz-surface-2);
  border-block-color: var(--kz-ink);
  border-inline-end-color: var(--kz-ink);
}
.kz-lane__btn[data-lane-state="yours"] .kz-lane__name { font-weight: 800; }
.kz-lane__btn[data-lane-state="closed"],
.kz-lane__btn[data-lane-state="spent"] { border-style: dashed; }

/* Legacy contract spellings for the tuner internals, kept for a11y.css. */
.kz-lane__glyph {
  display: inline-grid;
  place-items: center;
  inline-size: 1.6em;
  block-size: 1.6em;
  margin-inline-end: 0.4em;
  border: var(--kz-border) solid currentColor;
  border-radius: 4px;
  font-family: var(--kz-font-mono);
  font-size: 0.85em;
  line-height: 1;
}
.kz-lane__label { font-weight: 700; line-height: var(--kz-lh-snug); }
.kz-lane__cost {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-variant-numeric: tabular-nums;
  color: var(--kz-ink-2);
}
.kz-lane__reason { font-size: var(--kz-fs-100); color: var(--kz-ink-2); }
.kz-lane__reason:empty { display: none; }

/* Clue text: one bordered block per revealed step, number in the DOM. */
.kz-clue-list {
  display: grid;
  gap: var(--kz-s2);
  max-inline-size: var(--kz-measure);
}
li.kz-clue {
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-line);
  border-inline-start: 6px solid var(--kz-line-strong);
  border-radius: 0 var(--kz-radius) var(--kz-radius) 0;
  background: var(--kz-surface-inset);
  font-size: var(--kz-fs-400);
  line-height: var(--kz-lh-body);
}
li.kz-clue[data-pending] { border-style: dotted; color: var(--kz-ink-2); }
.kz-clue__n {
  display: block;
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-clue__step { font-size: var(--kz-fs-400); line-height: var(--kz-lh-body); }
.kz-clue__text { font-size: inherit; }
.kz-lane__empty {
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) dotted var(--kz-line-strong);
  border-radius: var(--kz-radius);
  color: var(--kz-ink-2);
  font-size: var(--kz-fs-200);
}

/* -----------------------------------------------------------------------------
   8. ANSWER GRID — large tappable cards. One column at 320px, two from ~36rem:
   never 2D scroll. Chosen state is [data-chosen] (both modes) and
   [aria-checked="true"] (confirm mode); both are styled identically.
   -------------------------------------------------------------------------- */

.kz-answers {
  display: grid;
  gap: var(--kz-s2);
  margin-block-start: var(--kz-s5);
  padding-block-start: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line);
}
.kz-answers__hint { font-size: var(--kz-fs-200); color: var(--kz-ink-2); }
.kz-answers__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--kz-gap-target);
  margin-block: var(--kz-s2);
}
.kz-answers__lock-state {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.06em;
  color: var(--kz-ink-2);
}
.kz-answers__locked {
  font-weight: 700;
  padding: var(--kz-s2) var(--kz-s3);
  border-inline-start: 6px solid var(--kz-ink);
  background: var(--kz-surface-inset);
  border-radius: 0 var(--kz-radius) var(--kz-radius) 0;
}

.kz-target.kz-answer {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--kz-s1) var(--kz-s3);
  align-items: center;
  justify-content: start;
  min-block-size: var(--kz-target-comfort);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
  color: var(--kz-ink);
  font-size: var(--kz-fs-400);
  text-align: start;
  transition: background-color var(--kz-dur) linear, border-color var(--kz-dur) linear;
}
.kz-answer__mark {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  inline-size: 1.6em;
  block-size: 1.6em;
  border: var(--kz-border-thick) solid currentColor;
  border-radius: 999px;
  font-family: var(--kz-font-mono);
  font-size: 0.8em;
  line-height: 1;
  flex: none;
}
.kz-answer__label { font-weight: 600; line-height: var(--kz-lh-snug); min-inline-size: 0; }
.kz-answer__state {
  grid-column: 2;
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-answer__state:empty { display: none; }

.kz-answer[aria-checked="true"],
.kz-answer[data-chosen] {
  background: var(--kz-surface-2);
  border-color: var(--kz-ink);
}
.kz-answer[aria-checked="true"] .kz-answer__mark,
.kz-answer[data-chosen] .kz-answer__mark {
  background: var(--kz-ink);
  color: var(--kz-bg);
  border-color: var(--kz-ink);
}
/* Locked keeps the 3px border width on purpose: a thicker border would move the
   label, and nothing may shift while a player is aiming at it. */
.kz-answer.is-locked { border-style: double; }
.kz-answer.is-locked .kz-answer__mark { border-width: 5px; }

/* Verdicts exist in the DOM only from phase=reveal (contract spelling; the
   emitted reveal carries [data-outcome] on the panel instead — both kept so
   a11y.css's forced-colors carriers match whichever renders). */
.kz-answer[data-verdict="correct"] {
  border-color: var(--kz-ok);
  background: var(--kz-surface);
}
.kz-answer[data-verdict="correct"] .kz-answer__mark { background: var(--kz-ok); color: var(--kz-ok-ink); border-color: var(--kz-ok); }
.kz-answer[data-verdict="correct"] .kz-answer__state { color: var(--kz-ok); font-weight: 700; }
.kz-answer[data-verdict="wrong"] {
  border-color: var(--kz-bad);
  border-style: dashed;
}
.kz-answer[data-verdict="wrong"] .kz-answer__mark { background: var(--kz-bad); color: var(--kz-bad-ink); border-color: var(--kz-bad); }
.kz-answer[data-verdict="wrong"] .kz-answer__state { color: var(--kz-bad); font-weight: 700; }

/* -----------------------------------------------------------------------------
   9. CLOCK — urgency is text first, a bordered track second, colour third.
   screens.mjs writes the fill width INLINE each tick and sets
   data-urgency="low|mid|high|over|none"; the contract spellings
   (calm|rising|expired) are kept beside them. No pulse, no flash.
   -------------------------------------------------------------------------- */

.kz-clock {
  --kz-clock-progress: 1;
  display: grid;
  gap: var(--kz-s2);
  margin-block: var(--kz-s4);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-inset);
}
.kz-clock__line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--kz-s2) var(--kz-s3);
}
.kz-clock__label {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-clock__text,
.kz-clock__value {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-500);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: var(--kz-lh-tight);
}
.kz-clock__state {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-200);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.kz-clock__profile { font-size: var(--kz-fs-100); color: var(--kz-ink-2); }
[data-surface="host"] .kz-clock__text,
[data-kz-surface="host"] .kz-clock__value { font-size: var(--kz-fs-600); }
.kz-clock__track {
  block-size: 14px;
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: 999px;
  background: var(--kz-surface-2);
  overflow: hidden;
  display: block;
}
.kz-clock__fill {
  display: block;
  block-size: 100%;
  background: var(--kz-ink-2);
  border-radius: inherit;
  /* NO transition and NO width here, ever: screens.mjs writes this element's
     width inline on every clock tick. A transition on that property would
     re-tween several times a second for the life of every question, and
     a11y.css would have to kill it under reduced motion anyway. The readout
     above the track is the real clock; the bar just gets shorter. */
}
.kz-clock[data-urgency="rising"] .kz-clock__fill,
.kz-clock[data-urgency="mid"] .kz-clock__fill { background: var(--kz-urgent); }
/* At high urgency the fill also becomes hatched, so the last seconds read
   without colour and without motion. */
.kz-clock[data-urgency="high"] .kz-clock__fill {
  background: repeating-linear-gradient(
    135deg,
    var(--kz-urgent) 0 6px,
    var(--kz-surface-2) 6px 12px
  );
}
.kz-clock[data-urgency="high"] .kz-clock__text,
.kz-clock[data-urgency="high"] .kz-clock__value { color: var(--kz-urgent); }
.kz-clock[data-urgency="expired"] .kz-clock__track,
.kz-clock[data-urgency="over"] .kz-clock__track { border-style: dashed; }
.kz-clock[data-urgency="expired"] .kz-clock__fill { inline-size: 0; }
.kz-clock[data-urgency="over"] .kz-clock__state,
.kz-clock[data-urgency="over"] .kz-clock__value { color: var(--kz-urgent); }

/* -----------------------------------------------------------------------------
   10. GHOST — callout-async only. Words first; the pulse bar is optional
   decoration and a11y.css removes its animation in every reduced-motion path.
   -------------------------------------------------------------------------- */

.kz-ghost {
  display: grid;
  gap: var(--kz-s2);
  margin-block-start: var(--kz-s4);
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-inset);
}
.kz-ghost__words,
.kz-ghost__line { font-size: var(--kz-fs-200); }
.kz-ghost__graphic {
  display: flex;
  gap: 4px;
  block-size: 12px;
}
.kz-ghost__seg {
  flex: 1 1 0;
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: 2px;
}
.kz-ghost__seg.is-on { background: var(--kz-ink-2); }
.kz-ghost__pulse {
  display: block;
  block-size: 10px;
  max-inline-size: 10rem;
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: 999px;
  background: var(--kz-ink-2);
}
/* The pressure pulse is the one animation the accessibility matrix names by
   hand. It is opacity-only, slow, and gone the moment --kz-anim-ghost is none. */
.kz-ghost[data-pressure="rising"] .kz-ghost__seg.is-on,
.kz-ghost[data-pressure="rising"] .kz-ghost__pulse {
  background: var(--kz-urgent);
  animation: var(--kz-anim-ghost, none) calc(1400ms * var(--kz-motion-scale)) ease-in-out infinite alternate;
}
.kz-ghost[data-pressure="locked"] .kz-ghost__pulse { background: var(--kz-ink); }
.kz-ghost[data-text-only="true"] .kz-ghost__graphic { display: none; }

@keyframes kz-ghost-pulse {
  from { opacity: 1; }
  to { opacity: 0.55; }
}

/* -----------------------------------------------------------------------------
   11. SCOREBOARD
   screens.mjs renders a real table (.kz-scoreboard__table / __row); identity is
   an alias plus a DOM glyph, and "(you)" / "(simulated)" are words in the row.
   The contract-era .kz-seat rules are kept below for a11y.css.
   -------------------------------------------------------------------------- */

.kz-scoreboard {
  display: block;
  margin-block-start: var(--kz-s5);
  padding: var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius-lg);
  background: var(--kz-surface);
  box-shadow: var(--kz-shadow);
}
.kz-scoreboard__table {
  inline-size: 100%;
  border-collapse: collapse;
  font-size: var(--kz-fs-300);
}
.kz-scoreboard__table th {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  text-align: start;
  padding: var(--kz-s2) var(--kz-s3);
  border-block-end: var(--kz-border-thick) solid var(--kz-line-strong);
}
.kz-scoreboard__table td {
  padding: var(--kz-s3);
  border-block-end: var(--kz-border) solid var(--kz-line);
}
.kz-scoreboard__table td:first-child {
  font-family: var(--kz-font-mono);
  font-weight: 700;
  color: var(--kz-ink-2);
}
.kz-scoreboard__table td:nth-child(3),
.kz-scoreboard__table td:nth-child(4) {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.kz-scoreboard__row[data-you] { background: var(--kz-surface-2); }
.kz-scoreboard__row[data-you] td:nth-child(2) { font-weight: 700; }
.kz-scoreboard__row[data-simulated] td:nth-child(2) { color: var(--kz-ink-2); }
.kz-scoreboard__note {
  margin-block-start: var(--kz-s3);
  font-size: var(--kz-fs-100);
  color: var(--kz-ink-2);
}

/* Contract-era seat rows (a11y.css names .kz-seat; harmless when unrendered). */
.kz-seat {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--kz-s3);
  align-items: center;
  min-block-size: var(--kz-target);
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-inline-start-width: 8px;
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
}
.kz-seat__glyph { font-family: var(--kz-font-mono); font-weight: 700; }
.kz-seat__alias { font-weight: 600; min-inline-size: 0; overflow-wrap: break-word; }
.kz-seat__score {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-400);
  font-weight: 700;
}
.kz-seat[data-seat="1"] { border-inline-start-style: solid; border-inline-start-color: var(--kz-lane-a); }
.kz-seat[data-seat="2"] { border-inline-start-style: dashed; border-inline-start-color: var(--kz-lane-b); }
.kz-seat[data-seat="3"] { border-inline-start-style: dotted; border-inline-start-color: var(--kz-ok); }
.kz-seat[data-seat="4"] { border-inline-start-style: double; border-inline-start-color: var(--kz-urgent); }
.kz-seat[data-seat="5"] { border-inline-start-style: solid; border-inline-start-color: var(--kz-signal); }
.kz-seat[data-seat="6"] { border-inline-start-style: dashed; border-inline-start-color: var(--kz-ink-2); }
.kz-seat[aria-current="true"] { box-shadow: inset 0 0 0 var(--kz-border-thick) var(--kz-ink); }

/* -----------------------------------------------------------------------------
   12. SHIELD — a phase, not an overlay. It fills the screen because it *is*
   the screen; there is nothing behind it to reveal.
   -------------------------------------------------------------------------- */

.kz-shield {
  display: grid;
  place-content: center;
  gap: var(--kz-s5);
  min-block-size: 70dvh;
  padding: var(--kz-s6) var(--kz-s4);
  text-align: center;
  background: var(--kz-surface-2);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius-lg);
}
.kz-shield__name,
.kz-shield__title {
  font-family: var(--kz-font-host);
  font-size: var(--kz-fs-600);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
  text-wrap: balance;
}
.kz-shield__body { font-size: var(--kz-fs-400); max-inline-size: 34ch; margin-inline: auto; }
.kz-shield__note { color: var(--kz-ink-2); max-inline-size: 34ch; margin-inline: auto; font-size: var(--kz-fs-200); }
.kz-shield .kz-btn,
.kz-shield button.kz-target { min-block-size: var(--kz-target-comfort); justify-self: center; }

/* =============================================================================
   13. REVEAL — the Station Voice's landing.

   The comedy is delivered by layout, in beats:
     1  OUTCOME  glyph-in-a-ring plus one oversized serif word, plus the answer.
     2  LEDGER   score / level / time, in mono.
     3  LANDING  the host line, serif, at a 30ch measure so it breaks into
                 short lines the way a joke is written.
     4  FACTS    your answer vs the right answer, dt/dd.
     5  TAG      the explanation, small and factual, deflating the joke.
     6  LANES    both clue ladders, in full, once the phase allows it.
   Everything above is static. A reduced-motion player gets the identical
   rhythm, because the rhythm is space and size, not time.
   ========================================================================== */

.kz-reveal { display: flow-root; }
.kz-reveal > * + * { margin-block-start: var(--kz-s3); }
.kz-reveal > h3 { margin-block-start: var(--kz-s5); }

/* The stagger is opt-out, not opt-in: every direct child of a reveal is a beat.
   The unanimated state is the final state — with --kz-anim-beat: none nothing
   is hidden, it is simply all there. */
.kz-reveal > *,
.kz-beat {
  animation: var(--kz-anim-beat, none) calc(240ms * var(--kz-motion-scale)) ease-out both;
  animation-delay: calc(var(--kz-beat-index, 0) * var(--kz-beat-step) * var(--kz-motion-scale));
}

@keyframes kz-beat-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}

.kz-reveal__outcome {
  --kz-beat-index: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kz-s3);
  font-family: var(--kz-font-host);
  font-size: var(--kz-fs-600);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.kz-reveal__mark {
  display: grid;
  place-items: center;
  inline-size: 1.15em;
  block-size: 1.15em;
  font-size: var(--kz-fs-500);
  font-family: var(--kz-font-mono);
  line-height: 1;
  border: var(--kz-border-thick) solid currentColor;
  border-radius: 999px;
  flex: none;
}
.kz-reveal__score {
  --kz-beat-index: 1;
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-500);
  font-weight: 700;
}
.kz-reveal__meta {
  --kz-beat-index: 2;
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-200);
  color: var(--kz-ink-2);
}
.kz-reveal .kz-host { --kz-beat-index: 3; margin-block: var(--kz-beat-pause) var(--kz-beat-setup); }

/* Outcome colouring: the word and the glyph carry it; colour is the third
   signal, and the card's own border repeats it as a pattern. */
.kz-reveal[data-outcome="correct"] { border-color: var(--kz-ok); }
.kz-reveal[data-outcome="correct"] .kz-reveal__outcome,
.kz-reveal[data-outcome="correct"] .kz-reveal__mark { color: var(--kz-ok); }
.kz-reveal[data-outcome="correct"] .kz-host { border-inline-start-color: var(--kz-ok); }
.kz-reveal[data-outcome="wrong"] { border-color: var(--kz-bad); border-style: dashed; }
.kz-reveal[data-outcome="wrong"] .kz-reveal__outcome,
.kz-reveal[data-outcome="wrong"] .kz-reveal__mark { color: var(--kz-bad); }
.kz-reveal[data-outcome="wrong"] .kz-host { border-inline-start-color: var(--kz-bad); }
.kz-reveal[data-outcome="none"] { border-style: dotted; }
.kz-reveal[data-outcome="none"] .kz-reveal__outcome,
.kz-reveal[data-outcome="none"] .kz-reveal__mark,
.kz-reveal[data-outcome="pending"] .kz-reveal__outcome,
.kz-reveal[data-outcome="pending"] .kz-reveal__mark { color: var(--kz-ink-2); }

/* THE FACTS. Your answer vs the right one, as a mono ledger. */
.kz-reveal__facts {
  --kz-beat-index: 4;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--kz-gap-target);
  margin-block-start: var(--kz-beat-pause);
  padding-block-start: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line-strong);
}
.kz-reveal__row { display: grid; gap: 2px; min-inline-size: 0; }
.kz-reveal__facts dt {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-reveal__yours,
.kz-reveal__right {
  margin: 0;
  font-size: var(--kz-fs-400);
  font-weight: 700;
  line-height: var(--kz-lh-snug);
  overflow-wrap: break-word;
}
.kz-reveal__right { color: var(--kz-ok); }

/* THE TAG. Small, sourced, deliberately flat after the punchline. */
.kz-reveal__explain,
.kz-reveal__explanation {
  --kz-beat-index: 5;
  font-size: var(--kz-fs-300);
  line-height: var(--kz-lh-body);
  max-inline-size: var(--kz-measure);
}
.kz-reveal__source {
  --kz-beat-index: 6;
  font-size: var(--kz-fs-100);
  color: var(--kz-ink-2);
}
/* The source link is a .kz-target: it keeps a real 44px box (min-block-size
   does not apply to a non-replaced inline, so display stays inline-flex). */
.kz-reveal__source a,
a.kz-target.kz-reveal__source-link {
  color: inherit;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--kz-target);
  text-decoration: underline;
}

/* Both lanes, in full, after the phase allows it. */
.kz-reveal__lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: var(--kz-gap-target);
}
.kz-reveal__lane {
  min-inline-size: 0;
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-inset);
}
.kz-reveal__lane[data-taken] { box-shadow: inset 0 0 0 2px var(--kz-ink); }
.kz-reveal__lane-name { font-weight: 700; font-size: var(--kz-fs-300); }
.kz-reveal__lane-tag {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  margin-block-end: var(--kz-s2);
}
.kz-reveal__lane .kz-clue-list { margin-block-start: var(--kz-s2); }
.kz-reveal__wait-hint { font-size: var(--kz-fs-200); color: var(--kz-ink-2); }

/* Contract-era reveal beats (verdict / pause / ledger / advance), kept: the
   spellings a11y.css names and any panel still authored against the contract. */
.kz-reveal__cue {
  --kz-beat-index: 0;
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  margin-block-end: var(--kz-beat-setup);
}
.kz-verdict {
  --kz-beat-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--kz-s3);
}
.kz-verdict__mark {
  display: grid;
  place-items: center;
  align-self: center;
  inline-size: 1.15em;
  block-size: 1.15em;
  font-size: var(--kz-fs-500);
  font-family: var(--kz-font-mono);
  line-height: 1;
  border: var(--kz-border-thick) solid currentColor;
  border-radius: 999px;
  flex: none;
}
.kz-verdict__word {
  font-family: var(--kz-font-host);
  font-size: var(--kz-fs-600);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
  letter-spacing: -0.02em;
  text-transform: uppercase;
  text-wrap: balance;
}
.kz-verdict__answer {
  font-size: var(--kz-fs-400);
  font-weight: 600;
  color: var(--kz-ink-2);
}
.kz-reveal[data-verdict="correct"] .kz-verdict__mark,
.kz-reveal[data-verdict="correct"] .kz-verdict__word { color: var(--kz-ok); }
.kz-reveal[data-verdict="wrong"] .kz-verdict__mark,
.kz-reveal[data-verdict="wrong"] .kz-verdict__word { color: var(--kz-bad); }
.kz-reveal[data-verdict="unlocked"] .kz-verdict__mark,
.kz-reveal[data-verdict="unlocked"] .kz-verdict__word { color: var(--kz-ink-2); }

.kz-reveal__pause {
  --kz-beat-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--kz-s3);
  margin-block: var(--kz-beat-pause);
}
.kz-reveal__pause::before,
.kz-reveal__pause::after {
  content: "";
  block-size: 0;
  border-block-start: var(--kz-border) solid var(--kz-line-strong);
}
.kz-reveal__pause .kz-bands { justify-content: center; }

[data-surface="host"] .kz-host__line { font-size: var(--kz-fs-600); max-inline-size: 26ch; }
[data-surface="host"] .kz-verdict__word { font-size: var(--kz-fs-700); }

.kz-host[data-beat="result"] .kz-host__line { font-size: var(--kz-fs-600); }

/* Results: the one number a room reads from the doorway. */
.kz-final-score {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-700);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
  letter-spacing: -0.03em;
}
.kz-results__mine {
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-500);
  font-weight: 700;
  line-height: var(--kz-lh-snug);
}
.kz-results__timing { font-size: var(--kz-fs-200); color: var(--kz-ink-2); }

/* THE LEDGER (contract spelling). Timing text, in every motion profile. */
.kz-ledger {
  --kz-beat-index: 5;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  gap: var(--kz-gap-target);
  margin-block-start: var(--kz-beat-pause);
  padding-block-start: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line-strong);
}
.kz-ledger__row { display: grid; gap: 2px; }
.kz-ledger dt {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
}
.kz-ledger dd {
  margin: 0;
  font-family: var(--kz-font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--kz-fs-500);
  font-weight: 700;
  line-height: var(--kz-lh-tight);
}
.kz-ledger__row[data-emphasis="points"] dd { font-size: var(--kz-fs-600); }

.kz-reveal__advance {
  --kz-beat-index: 7;
  margin-block-start: var(--kz-s5);
  display: grid;
  gap: var(--kz-s2);
}
.kz-reveal__advance-note {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-variant-numeric: tabular-nums;
  color: var(--kz-ink-2);
}

/* -----------------------------------------------------------------------------
   14. CONTEXT PICKER, REPORT, SHARE, LOCALE CHROME
   -------------------------------------------------------------------------- */

.kz-picker__list {
  display: grid;
  gap: var(--kz-gap-target);
  margin-block-start: var(--kz-s4);
}
.kz-picker__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--kz-s1) var(--kz-s4);
  align-items: center;
  min-inline-size: 0;
  padding: var(--kz-s3) var(--kz-s4);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-inline-start: 8px solid var(--kz-signal);
  border-radius: var(--kz-radius);
  background: var(--kz-surface);
  box-shadow: var(--kz-shadow);
}
.kz-picker__name {
  grid-column: 1;
  font-size: var(--kz-fs-400);
  font-weight: 700;
  line-height: var(--kz-lh-snug);
  min-inline-size: 0;
}
.kz-picker__reason {
  grid-column: 1;
  font-size: var(--kz-fs-100);
  color: var(--kz-ink-2);
  min-inline-size: 0;
}
.kz-picker__row > button.kz-target {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}
.kz-picker__row[data-refused] {
  border-style: dashed;
  border-inline-start-color: var(--kz-line-strong);
  color: var(--kz-ink-2);
  box-shadow: none;
}

.kz-report {
  display: grid;
  gap: var(--kz-s4);
  margin-block-start: var(--kz-s4);
  max-inline-size: var(--kz-measure);
}
.kz-report__reasons {
  display: grid;
  gap: var(--kz-gap-target);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  padding: var(--kz-s3) var(--kz-s4) var(--kz-s4);
  margin: 0;
  min-inline-size: 0;
}
.kz-report__reasons > legend {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-100);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kz-ink-2);
  padding-inline: var(--kz-s2);
}
.kz-report__detail-label { font-size: var(--kz-fs-200); font-weight: 700; }
.kz-report__saved {
  color: var(--kz-ok);
  font-weight: 700;
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-ok);
  border-radius: var(--kz-radius);
  background: var(--kz-surface-inset);
}

.kz-share__status {
  font-family: var(--kz-font-mono);
  font-size: var(--kz-fs-200);
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) dotted var(--kz-line-strong);
  border-radius: var(--kz-radius);
  color: var(--kz-ink-2);
  max-inline-size: var(--kz-measure);
}

/* Shell chrome: the locale switcher footer, quiet and off the play surface. */
.kz-chrome {
  max-inline-size: 56rem;
  margin-inline: auto;
  margin-block-start: var(--kz-s6);
  padding: var(--kz-s4);
  border-block-start: var(--kz-border) solid var(--kz-line);
  color: var(--kz-ink-2);
  font-size: var(--kz-fs-200);
}
.kz-locale {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--kz-s2) var(--kz-s3);
}
.kz-locale__label { font-weight: 700; color: var(--kz-ink); }
.kz-locale__select,
select.kz-target {
  font: inherit;
  color: var(--kz-ink);
  background: var(--kz-surface);
  border: 2px solid var(--kz-line-strong);
  border-radius: var(--kz-radius);
  padding: var(--kz-s2) var(--kz-s3);
  min-block-size: var(--kz-target);
}
.kz-locale__hint { flex-basis: 100%; font-size: var(--kz-fs-100); margin: 0; }
.kz-locale__fallback { flex-basis: 100%; font-size: var(--kz-fs-100); color: var(--kz-urgent); margin: 0; }

/* -----------------------------------------------------------------------------
   15. SPLIT LAYOUT — single-device, exactly two players.
   Each half is one contiguous region in DOM order. No `order`, no dense flow,
   no positive tabindex: reading order is DOM order on every surface.
   a11y.css withholds the second column via [data-kz-split-allowed="no"].
   -------------------------------------------------------------------------- */

.kz-split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: var(--kz-s5);
}
[data-split="on"] .kz-split { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kz-split__half {
  min-inline-size: 0;
  padding: var(--kz-s4);
  border: var(--kz-border-thick) solid var(--kz-line-strong);
  border-radius: var(--kz-radius-lg);
  background: var(--kz-surface);
}
.kz-split__half[data-seat="1"] { border-inline-start-color: var(--kz-lane-a); }
.kz-split__half[data-seat="2"] { border-inline-start-color: var(--kz-lane-b); border-style: dashed; }

/* -----------------------------------------------------------------------------
   16. CROSSFADE MOTIF (contract components, kept for a11y.css and any panel
   still authored against the contract; unrendered selectors cost nothing).
   -------------------------------------------------------------------------- */

.kz-crossfade {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--kz-gap-target);
  margin-block: var(--kz-s4);
}
.kz-crossfade__band {
  display: flex;
  align-items: center;
  gap: var(--kz-s2);
  padding: var(--kz-s2) var(--kz-s3);
  border: var(--kz-border) solid var(--kz-line-strong);
  border-inline-start-width: 6px;
  border-radius: var(--kz-radius);
  font-size: var(--kz-fs-200);
  background: var(--kz-surface-inset);
}
.kz-crossfade__band[data-lane="a"] { border-inline-start-color: var(--kz-lane-a); }
.kz-crossfade__band[data-lane="b"] { border-inline-start-color: var(--kz-lane-b); }
.kz-crossfade__band[data-state="committed"] { font-weight: 700; }
.kz-crossfade__band[data-state="closed"] {
  border-style: dotted;
  color: var(--kz-ink-2);
}
.kz-crossfade__glyph {
  font-family: var(--kz-font-mono);
  flex: none;
}
.kz-crossfade__label { min-inline-size: 0; overflow-wrap: break-word; }

/* -----------------------------------------------------------------------------
   17. INERT / DISABLED STATE LAYER — last, so it wins every tie.
   screens.mjs inert() writes aria-disabled + data-kz-inert + .is-inert
   together; `disabled` appears only on the report submit. The state is a
   pattern (dashed) and a word elsewhere in the DOM, never a shade alone.
   -------------------------------------------------------------------------- */

button.kz-target[disabled],
button.kz-target[aria-disabled="true"],
.kz-target[data-kz-inert],
.kz-target.is-inert,
.kz-lane[disabled],
.kz-answer[disabled],
.kz-answer[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 1;                      /* dimming alone is not a state */
  background: var(--kz-surface-2);
  border-style: dashed;
  color: var(--kz-ink-2);
  box-shadow: none;
  filter: none;
  transform: none;
}
button.kz-target[aria-disabled="true"]:hover,
.kz-target[data-kz-inert]:hover,
.kz-target.is-inert:hover { background: var(--kz-surface-2); filter: none; }

/* -----------------------------------------------------------------------------
   18. REFLOW — 320px equivalent and 200% zoom, no two-dimensional scrolling.
   Width queries only; preference queries live in a11y.css.
   -------------------------------------------------------------------------- */

@media (max-width: 30rem) {
  .kz-screen { padding: var(--kz-s4) var(--kz-s3) var(--kz-s7); }
  .kz-card { padding: var(--kz-s4) var(--kz-s3); border-radius: var(--kz-radius); }
  .kz-host { padding-inline-start: var(--kz-s4); }
  .kz-host__line,
  .kz-host__text { max-inline-size: none; }
  .kz-reveal__pause { margin-block: var(--kz-s5); }
  .kz-ledger { grid-template-columns: 1fr 1fr; }
  .kz-ceiling__ladder { grid-template-columns: 1fr; }
  .kz-reveal__facts { grid-template-columns: 1fr 1fr; }
  .kz-btn { inline-size: 100%; }
  .kz-row > .kz-btn { inline-size: auto; }
  .kz-picker__row { grid-template-columns: 1fr; }
  .kz-picker__row > button.kz-target { grid-column: 1; grid-row: auto; inline-size: 100%; }
  /* Split is withheld below the threshold rather than degraded. */
  [data-split="on"] .kz-split { grid-template-columns: 1fr; }
}

@media (max-width: 22.5rem) {
  .kz-screen { padding-inline: var(--kz-s2); }
  .kz-ledger { grid-template-columns: 1fr; }
  .kz-reveal__facts { grid-template-columns: 1fr; }
  .kz-crossfade { grid-template-columns: 1fr; }
  /* The results table is the one sanctioned internal scroller (a11y.css 7c);
     tighter cells shrink how far it has to scroll on a 320px controller. */
  .kz-scoreboard { padding: var(--kz-s3) var(--kz-s2); }
  .kz-scoreboard__table th,
  .kz-scoreboard__table td { padding: var(--kz-s2); }
}

@media (min-width: 64rem) {
  [data-surface="host"] .kz-screen,
  [data-kz-surface="host"] .kz-screen { padding-inline: var(--kz-s6); }
}
