/* =========================================================================
   Prepora — app.css
   Identity per KB 02: daylight, clinical-clean, energetic confidence.
   Deep teal #0F766E · warm coral #F97362 · off-white ground · light-first.
   No cross emblems, no caduceus anywhere in this stylesheet or its markup.
   ========================================================================= */

/* ------------------------------------------------------------- tokens -- */
:root {
  /* brand ramps */
  --teal-900: #0A4A45;
  --teal-800: #0B5F58;
  --teal-700: #0F766E;   /* primary */
  --teal-600: #129086;
  --teal-400: #2DBFB2;
  --teal-100: #D6EDEA;
  --teal-050: #EFF8F6;

  --coral-800: #A93524;  /* AA-safe coral text on the coral tint */
  --coral-700: #C6412F;  /* AA-safe coral ground under white text */
  --coral-600: #E4553F;
  --coral-500: #F97362;  /* accent */
  --coral-100: #FDE4DF;

  /* status */
  --red-700: #B0271A;
  --red-500: #DC4436;
  --amber-700: #9A5B08;
  --amber-500: #D9880F;
  --green-700: #14713F;
  --green-500: #1E9E58;

  /* surfaces */
  --bg: #FAF8F5;
  --bg-alt: #F3F1EC;
  --surface: #FFFFFF;
  --surface-2: #FBFAF8;
  --tint: var(--teal-050);
  --line: #E3E0D9;
  --line-strong: #CFCBC1;

  /* ink */
  --ink: #14211F;
  --ink-2: #3D4A47;
  --muted: #5F6C68;
  --on-teal: #FFFFFF;

  --primary: var(--teal-700);
  --primary-hover: var(--teal-800);
  --accent: var(--coral-500);
  --accent-ink: var(--coral-800);

  /* readable brand-tinted text on tinted chips (flips in dark) */
  --brand-text: var(--teal-800);

  --focus: #0F766E;
  --shadow-1: 0 1px 2px rgba(20, 33, 31, .05), 0 2px 8px rgba(20, 33, 31, .05);
  --shadow-2: 0 2px 4px rgba(20, 33, 31, .06), 0 12px 28px rgba(20, 33, 31, .09);
  /* the one deep elevation, reserved for things that float above the page:
     the device mockup, the stats card, the licence sheet */
  --shadow-3: 0 6px 14px rgba(20, 33, 31, .06), 0 28px 64px rgba(20, 33, 31, .14);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 26px;
  --r-2xl: 34px;

  /* one spacing ladder, so a "generous" gap is a decision and not a guess */
  --s-1: 8px;
  --s-2: 14px;
  --s-3: 20px;
  --s-4: 28px;
  --s-5: 40px;
  --s-6: 64px;
  --band-gap: clamp(52px, 8vw, 104px);

  /* landing atmospherics + the hero device, tokenised so dark mode is a
     value change rather than a second set of rules */
  --fx-glow-op: .55;
  --fx-grid-op: .5;
  --device-frame: #16221F;
  --device-bezel: #05100E;

  --pad: clamp(16px, 4vw, 28px);
  --maxw: 1080px;
  --text-scale: 1;

  --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --read-font: var(--ui-font);
  --dur: 180ms;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* Dark palette. Applied two ways so dark mode never depends on JS:
   1. html[data-theme="dark"]                      — explicit user choice
   2. [data-theme="auto"] + prefers-color-scheme    — system preference
   The values are identical; keep the two blocks in sync when editing. */
html[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0B1413;
  --bg-alt: #101B19;
  --surface: #13201E;
  --surface-2: #172624;
  --tint: #122724;
  --line: #243431;
  --line-strong: #354844;

  --ink: #E9F1EF;
  --ink-2: #C2D0CD;
  --muted: #93A5A1;

  --teal-100: #16403B;
  --teal-050: #12302C;
  --coral-100: #3D211C;

  --primary: var(--teal-400);
  --primary-hover: #47D3C6;
  --accent: #FF8B7B;
  --accent-ink: #FF9E8F;
  --on-teal: #04201D;

  --red-700: #FF8A7B;
  --red-500: #E4574A;
  --amber-700: #F0B44B;
  --green-700: #4BD08A;

  --brand-text: var(--teal-400);
  --focus: #2DBFB2;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .28);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .42);
  --shadow-3: 0 6px 18px rgba(0, 0, 0, .45), 0 30px 70px rgba(0, 0, 0, .6);

  /* glows that read as light in daylight read as smog after dark, so they
     come down; the phone bezel goes the other way and lightens, or it would
     vanish into the page it is supposed to sit on top of */
  --fx-glow-op: .3;
  --fx-grid-op: .35;
  --device-frame: #2C4642;
  --device-bezel: #060D0C;
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    color-scheme: dark;

    --bg: #0B1413;
    --bg-alt: #101B19;
    --surface: #13201E;
    --surface-2: #172624;
    --tint: #122724;
    --line: #243431;
    --line-strong: #354844;

    --ink: #E9F1EF;
    --ink-2: #C2D0CD;
    --muted: #93A5A1;

    --teal-100: #16403B;
    --teal-050: #12302C;
    --coral-100: #3D211C;

    --primary: var(--teal-400);
    --primary-hover: #47D3C6;
    --accent: #FF8B7B;
    --accent-ink: #FF9E8F;
    --on-teal: #04201D;

    --red-700: #FF8A7B;
    --red-500: #E4574A;
    --amber-700: #F0B44B;
    --green-700: #4BD08A;

    --brand-text: var(--teal-400);
    --focus: #2DBFB2;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .28);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 14px 32px rgba(0, 0, 0, .42);
    --shadow-3: 0 6px 18px rgba(0, 0, 0, .45), 0 30px 70px rgba(0, 0, 0, .6);

    --fx-glow-op: .3;
    --fx-grid-op: .35;
    --device-frame: #2C4642;
    --device-bezel: #060D0C;
  }
}

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

/* The UA's `[hidden] { display: none }` loses to any class that sets a display
   value, and most components here set one — so a hidden .btn, .chip or
   .q-actions would stay on screen. This makes the attribute mean what every
   caller assumes it means. */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui-font);
  font-size: calc(16px * var(--text-scale));
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-dyslexia="on"] {
  --ui-font: "Atkinson Hyperlegible", "Comic Sans MS", Verdana, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .012em;
  line-height: 1.72;
}

/* One fluid ladder. Every step is clamp()ed so the jump from a 375px phone to
   a 1440px desktop is continuous rather than a set of breakpoint cliffs. */
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: clamp(1.8rem, 1.15rem + 2.6vw, 2.7rem); }
h2 { font-size: clamp(1.3rem, 1.05rem + 1.1vw, 1.75rem); }
h3 { font-size: clamp(1rem, .96rem + .2vw, 1.1rem); }

/* the single largest thing on the site, and the only place it is used */
.display {
  font-size: clamp(2.5rem, 1.5rem + 4.8vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.038em;
}
p { margin: 0 0 1em; }
a { color: var(--primary); text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
ul { margin: 0 0 1em; padding-left: 1.15em; }
button, input, select, textarea { font: inherit; color: inherit; }

.tnum, .timer, .stat-num, .ring-num, .price-num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--primary); color: var(--on-teal);
  padding: 12px 18px; border-radius: 0 0 var(--r-md) 0; font-weight: 600;
}
.skip-link:focus { left: 0; }

.ico { width: 1.15em; height: 1.15em; flex: none; display: inline-block; vertical-align: -.18em; }
.ico-lg { width: 28px; height: 28px; color: var(--primary); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------ chrome --- */
/* The frosted pane is a pseudo-element rather than the bar itself, and that is
   load-bearing: `backdrop-filter` on an element makes it the containing block
   for every `position: fixed` descendant, which would pin the phone tab bar
   (a child of this header) to the bottom of the HEADER instead of the bottom
   of the screen. Blurring a child leaves the bar itself unstyled in that
   sense, so the tab bar resolves against the viewport as intended. */
.chrome {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 10px var(--pad);
  background: transparent;
  border-bottom: 1px solid var(--line);
}
.chrome::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}

.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand-mark { color: var(--primary); display: inline-flex; }
.brand-word { font-weight: 800; font-size: 1.16rem; letter-spacing: -.02em; }

.chrome-nav { display: flex; gap: 4px; margin-left: auto; }
.chrome-nav a {
  padding: 8px 13px; border-radius: 999px; text-decoration: none;
  color: var(--ink-2); font-weight: 600; font-size: .93rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.chrome-nav a:hover { background: var(--tint); color: var(--primary); }
.chrome-nav a[aria-current="page"] { background: var(--tint); color: var(--primary); }
/* The glyph belongs to the phone tab bar; the desktop bar stays text pills. */
.chrome-nav .ico { display: none; }

.chrome-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px;
  background: transparent; border: 1px solid var(--line);
  color: var(--ink-2); cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { background: var(--tint); border-color: var(--primary); color: var(--primary); }
.icon-btn .ico { width: 19px; height: 19px; }


/* "I have a key" — visible only while something is locked, and never styled to
   shout. On a narrow phone the label shortens to fit beside the ring. */
.key-btn { white-space: nowrap; }
@media (max-width: 400px) {
  .key-btn { font-size: 0; padding: 8px 12px; }
  .key-btn::after { content: "Key"; font-size: .88rem; }
}

.mini-ring { display: inline-flex; text-decoration: none; line-height: 0; }
.mini-ring svg { display: block; }
.mini-ring:hover { opacity: .85; }

/* On a phone the nav drops to a thumb-reachable bar at the bottom of the
   screen: same markup, same routes, one-hand reach. The top bar keeps only
   the brand, the Readiness Ring and the theme switch, which fits 320px. */
@media (max-width: 640px) {
  .chrome { padding: 8px 14px; gap: 10px; }
  .chrome-actions { margin-left: auto; }

  .chrome-nav {
    position: fixed; inset: auto 0 0 0; z-index: 45;
    margin: 0; gap: 4px; justify-content: space-around;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px);
    border-top: 1px solid var(--line);
  }
  .chrome-nav a {
    flex: 1 1 0; text-align: center; border-radius: var(--r-md);
    padding: 6px 2px; font-size: .74rem; min-height: 48px; line-height: 1.25;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  }
  /* Glyph over label: four tabs still fit their labels at 320px. */
  .chrome-nav .ico { display: block; width: 21px; height: 21px; vertical-align: 0; }

  /* keep the legal footer and toasts clear of the bar */
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .toast-region { bottom: calc(82px + env(safe-area-inset-bottom, 0px)); }
}

@media (max-width: 360px) {
  .brand-word { display: none; }
}

/* ------------------------------------------------------------- views --- */
main { flex: 1 0 auto; }
.view { max-width: var(--maxw); margin: 0 auto; padding: clamp(20px, 4vw, 40px) var(--pad) 56px; }
.view-play { max-width: 780px; padding-top: 12px; }
.view[hidden] { display: none !important; }

.view-head { margin-bottom: 22px; }
.view-head h1 { margin-bottom: 6px; }
.view-sub { color: var(--muted); margin: 0; max-width: 62ch; }

.section-h { margin-bottom: 16px; }
.band { margin-top: clamp(40px, 7vw, 72px); }
.band-tint {
  background: var(--tint);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: clamp(22px, 4vw, 36px);
}

/* --------------------------------------------------------------- hero -- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 16px; padding: 6px 14px;
  background: var(--surface); color: var(--brand-text);
  border: 1px solid color-mix(in srgb, var(--primary) 24%, transparent);
  border-radius: 999px;
  font-size: .84rem; font-weight: 700; letter-spacing: .02em;
  box-shadow: var(--shadow-1);
}

.lede { font-size: clamp(1.06rem, .98rem + .5vw, 1.28rem); color: var(--ink-2); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 12px; }
.hero-note { color: var(--muted); font-size: .9rem; margin: 0; }

/* ------------------------------------------------------------ buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 12px 20px; min-height: 46px;
  border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: .97rem; cursor: pointer;
  text-decoration: none; text-align: center;
  transition: transform 120ms var(--ease), background var(--dur) var(--ease),
              border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary { background: var(--primary); color: var(--on-teal); box-shadow: var(--shadow-1); }
.btn-primary:hover:not([disabled]) { background: var(--primary-hover); }

/* Coral-700, not the brighter coral-500, so white label text clears AA (5.0:1). */
.btn-coral { background: var(--coral-700); color: #fff; box-shadow: var(--shadow-1); }
.btn-coral:hover:not([disabled]) { background: var(--coral-800); }

.btn-outline { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-outline:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); background: var(--tint); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }

.btn-quiet { background: transparent; color: var(--muted); border-color: transparent; padding: 8px 12px; min-height: 38px; }
.btn-quiet:hover:not([disabled]) { color: var(--primary); background: var(--tint); }

.btn-danger { background: transparent; border-color: var(--line-strong); color: var(--red-700); }
.btn-danger:hover:not([disabled]) { border-color: var(--red-700); background: color-mix(in srgb, var(--red-500) 10%, transparent); }

.btn-lg { padding: 15px 26px; min-height: 54px; font-size: 1.03rem; }
.btn-sm { padding: 8px 15px; min-height: 38px; font-size: .88rem; }
.btn-block { width: 100%; }

/* -------------------------------------------------------------- cards -- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(18px, 2.6vw, 24px);
  box-shadow: var(--shadow-1);
}

.grid-4 { display: grid; gap: 16px; grid-template-columns: 1fr; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

.feature h3 { margin: 12px 0 6px; }
.feature p { margin: 0; color: var(--ink-2); font-size: .95rem; }

.pledge { display: flex; gap: 18px; align-items: flex-start; }
.pledge-list { margin: 0; padding-left: 1.15em; color: var(--ink-2); }
.pledge-list li { margin-bottom: 6px; }

.price-card { display: flex; flex-direction: column; }
.price-card-lead { border-color: var(--primary); box-shadow: var(--shadow-2); }
.price-tier { font-weight: 700; color: var(--muted); margin: 0 0 4px; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.price-num { font-size: 2.3rem; font-weight: 800; margin: 0 0 12px; letter-spacing: -.03em; }
.price-sub { font-size: .95rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.tick-list { list-style: none; padding: 0; margin: 0 0 18px; flex: 1; }
.tick-list li { position: relative; padding-left: 26px; margin-bottom: 8px; color: var(--ink-2); font-size: .95rem; }
.tick-list li::before {
  content: ""; position: absolute; left: 0; top: .42em;
  width: 15px; height: 8px; border-left: 2.4px solid var(--primary); border-bottom: 2.4px solid var(--primary);
  transform: rotate(-45deg);
}
.micro { font-size: .84rem; color: var(--muted); margin: 10px 0 0; }

/* ------------------------------------------------------- practice hub -- */
.grid-mode { display: grid; gap: 14px; grid-template-columns: 1fr; margin-bottom: 26px; }
@media (min-width: 620px) { .grid-mode { grid-template-columns: repeat(2, 1fr); } }

.mode-card {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  width: 100%; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  transition: border-color var(--dur) var(--ease), transform 140ms var(--ease), box-shadow var(--dur) var(--ease);
}
.mode-card:hover:not([disabled]) { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.mode-card[disabled] { opacity: .55; cursor: not-allowed; }
.mode-card .ico-lg { margin-top: 2px; }
.mode-card-body { min-width: 0; }
.mode-card h3 { margin: 0 0 4px; font-size: 1.04rem; }
.mode-card p { margin: 0; color: var(--muted); font-size: .9rem; }
.mode-card.mode-lead { border-color: var(--coral-500); }
.mode-card.mode-lead .ico-lg { color: var(--coral-600); }
.badge-pill {
  display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px;
  background: var(--coral-100); color: var(--accent-ink);
  font-size: .74rem; font-weight: 700; vertical-align: 2px;
}

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(18px, 2.6vw, 24px); margin-bottom: 20px;
}
.panel-h { margin: 0 0 4px; font-size: 1.1rem; }
.panel-sub { color: var(--muted); font-size: .9rem; margin: 0 0 16px; }

.filter-row { display: grid; gap: 12px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 620px) { .filter-row { grid-template-columns: 2fr 1.4fr .8fr; } }
.field { display: block; }
.field-label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 5px; letter-spacing: .02em; }
.select {
  width: 100%; padding: 11px 14px; min-height: 46px;
  background: var(--surface-2); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  cursor: pointer;
}
.select:hover { border-color: var(--primary); }
.filter-actions { display: flex; flex-wrap: wrap; gap: 10px; }

.domain-list { display: grid; gap: 10px; }
.domain-row {
  display: grid; gap: 4px 12px; align-items: center;
  grid-template-columns: 1fr auto;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
}
.domain-name { font-weight: 600; font-size: .95rem; }
.domain-figure { font-size: .9rem; color: var(--muted); }
.domain-bar { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.domain-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width 500ms var(--ease); }
.domain-bar > i.is-weak { background: var(--coral-600); }
.domain-row .btn-sm { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }

/* --------------------------------------------------------- continue --- */
.continue-chip {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--tint); border: 1px solid var(--teal-100);
  border-radius: var(--r-lg); padding: 14px 18px; margin: 18px 0 4px;
}
.continue-chip p { margin: 0; font-size: .94rem; }
.continue-chip strong { color: var(--brand-text); }
.continue-chip .btn { margin-left: auto; }

/* ------------------------------------------------------------- player -- */
.player-root { display: block; }

.player-bar {
  position: sticky; top: 58px; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; margin-bottom: 18px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.player-progress { flex: 1; min-width: 0; }
.player-count { font-size: .84rem; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.progress-track { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 5px; }
.progress-fill { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width 260ms var(--ease); }
.timer {
  font-weight: 700; font-size: 1.02rem; padding: 5px 11px; border-radius: var(--r-sm);
  background: var(--bg-alt); color: var(--ink);
}
.timer.is-low { background: color-mix(in srgb, var(--red-500) 16%, transparent); color: var(--red-700); }
.mode-tag {
  font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  padding: 4px 10px; border-radius: 999px; background: var(--tint); color: var(--brand-text);
}
.mode-tag.tag-exam { background: var(--coral-100); color: var(--accent-ink); }

.q-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(18px, 3vw, 28px);
  box-shadow: var(--shadow-1);
  animation: qIn 220ms var(--ease) both;
}
@keyframes qIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.q-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--bg-alt); color: var(--ink-2);
  font-size: .78rem; font-weight: 650;
}
.chip-format { background: var(--tint); color: var(--brand-text); }

.case-panel {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2); margin-bottom: 18px; overflow: hidden;
}
.case-panel > summary {
  cursor: pointer; padding: 12px 16px; font-weight: 700; font-size: .92rem;
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.case-panel > summary::-webkit-details-marker { display: none; }
.case-panel > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform var(--dur) var(--ease); }
.case-panel[open] > summary::after { transform: rotate(180deg); }
.case-body { padding: 0 16px 14px; font-size: .95rem; color: var(--ink-2); white-space: pre-wrap; }
.case-steps { display: flex; gap: 5px; margin-bottom: 14px; flex-wrap: wrap; }
.case-step-dot {
  width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center;
  font-size: .74rem; font-weight: 800; background: var(--bg-alt); color: var(--muted);
  border: 1.5px solid var(--line);
}
.case-step-dot.is-done { background: var(--teal-100); color: var(--teal-800); border-color: var(--teal-100); }
.case-step-dot.is-now { background: var(--primary); color: var(--on-teal); border-color: var(--primary); }

.q-stem { font-size: 1.06rem; line-height: 1.62; margin-bottom: 6px; }
.q-stem strong { font-weight: 800; }
.q-instruction { font-size: .88rem; color: var(--muted); font-style: italic; margin: 0 0 16px; }

/* option lists — big one-hand targets */
.options { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
.opt {
  display: flex; gap: 13px; align-items: flex-start;
  width: 100%; text-align: left; cursor: pointer;
  padding: 14px 16px; min-height: 56px;
  background: var(--surface-2); border: 1.5px solid var(--line);
  border-radius: var(--r-md); color: var(--ink);
  transition: border-color 140ms var(--ease), background 140ms var(--ease);
}
.opt:hover:not([disabled]) { border-color: var(--primary); background: var(--tint); }
.opt[disabled] { cursor: default; }
.opt-key {
  flex: none; width: 28px; height: 28px; border-radius: 999px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 800;
  background: var(--bg-alt); color: var(--ink-2); border: 1.5px solid var(--line-strong);
}
.opt-box {
  flex: none; width: 26px; height: 26px; border-radius: 7px;
  border: 2px solid var(--line-strong); display: grid; place-items: center;
  background: var(--surface);
}
.opt-box .ico { width: 17px; height: 17px; opacity: 0; color: var(--on-teal); }
.opt-text { flex: 1; min-width: 0; }

.opt[aria-pressed="true"], .opt[aria-checked="true"] { border-color: var(--primary); background: var(--tint); }
.opt[aria-pressed="true"] .opt-key, .opt[aria-checked="true"] .opt-key { background: var(--primary); color: var(--on-teal); border-color: var(--primary); }
.opt[aria-checked="true"] .opt-box { background: var(--primary); border-color: var(--primary); }
.opt[aria-checked="true"] .opt-box .ico { opacity: 1; }

.opt.is-correct { border-color: var(--green-700); background: color-mix(in srgb, var(--green-500) 12%, transparent); }
.opt.is-correct .opt-key { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.opt.is-wrong { border-color: var(--red-700); background: color-mix(in srgb, var(--red-500) 10%, transparent); }
.opt.is-wrong .opt-key { background: var(--red-700); color: #fff; border-color: var(--red-700); }
.opt.is-missed { border-color: var(--amber-700); border-style: dashed; }

.opt-order-badge {
  flex: none; width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
  border: 2px dashed var(--line-strong); color: var(--muted); background: var(--surface);
}
.opt[data-ordered="yes"] .opt-order-badge { border-style: solid; border-color: var(--primary); background: var(--primary); color: var(--on-teal); }

/* matrix grid */
.matrix-wrap { overflow-x: auto; margin: 0 0 18px; -webkit-overflow-scrolling: touch; }
.matrix {
  width: 100%; border-collapse: separate; border-spacing: 0; min-width: 420px;
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
}
.matrix th, .matrix td { padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line); font-size: .92rem; }
.matrix thead th { background: var(--bg-alt); font-size: .82rem; font-weight: 800; letter-spacing: .02em; }
.matrix tbody th { text-align: left; font-weight: 600; min-width: 180px; background: var(--surface-2); }
.matrix tr:last-child th, .matrix tr:last-child td { border-bottom: 0; }
.matrix-cell { display: grid; place-items: center; }
.matrix-radio {
  width: 26px; height: 26px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--line-strong); background: var(--surface); display: grid; place-items: center;
}
.matrix-radio[aria-checked="true"] { border-color: var(--primary); }
.matrix-radio[aria-checked="true"]::after { content: ""; width: 13px; height: 13px; border-radius: 999px; background: var(--primary); }
.matrix td.cell-correct { background: color-mix(in srgb, var(--green-500) 13%, transparent); }
.matrix td.cell-wrong { background: color-mix(in srgb, var(--red-500) 11%, transparent); }

/* bowtie */
.bowtie { display: grid; gap: 14px; margin-bottom: 18px; }
@media (min-width: 760px) { .bowtie { grid-template-columns: 1fr 1fr 1fr; align-items: start; } }
.bowtie-zone { border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 13px; background: var(--surface-2); }
.bowtie-zone.zone-mid { border-color: var(--primary); }
.bowtie-h { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 4px; }
.bowtie-sub { font-size: .78rem; color: var(--muted); margin: 0 0 10px; }
.bowtie .options { gap: 8px; margin: 0; }
.bowtie .opt { padding: 11px 13px; min-height: 48px; font-size: .93rem; }

/* highlight / cloze */
.highlight-passage {
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  padding: 16px; background: var(--surface-2); margin-bottom: 18px; line-height: 1.85;
}
.hl-seg {
  display: inline; cursor: pointer; padding: 3px 2px; border-radius: 5px;
  border: 0; background: transparent; color: inherit; font: inherit; text-align: left;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  border-bottom: 2px dotted var(--line-strong);
}
.hl-seg:hover:not([disabled]) { background: var(--tint); }
.hl-seg[aria-pressed="true"] { background: color-mix(in srgb, var(--coral-500) 30%, transparent); border-bottom-color: var(--coral-600); }
.hl-seg.is-correct { background: color-mix(in srgb, var(--green-500) 24%, transparent); border-bottom: 2px solid var(--green-700); }
.hl-seg.is-wrong { background: color-mix(in srgb, var(--red-500) 20%, transparent); border-bottom: 2px solid var(--red-700); }
.hl-seg.is-missed { border-bottom: 2px dashed var(--amber-700); }

/* actions + rationale */
.q-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.q-actions .spacer { flex: 1; }

.verdict {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-radius: var(--r-md); margin: 18px 0 0;
  font-weight: 700;
}
.verdict-good { background: color-mix(in srgb, var(--green-500) 14%, transparent); color: var(--green-700); }
.verdict-bad { background: color-mix(in srgb, var(--amber-500) 16%, transparent); color: var(--amber-700); }

.rationale {
  margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface-2); padding: 18px;
  animation: qIn 200ms var(--ease) both;
}
.rationale h4 { margin: 0 0 8px; font-size: .82rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.rationale p { margin: 0 0 12px; font-size: .95rem; color: var(--ink-2); }
.rationale p:last-child { margin-bottom: 0; }
.why-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.why-list li { display: flex; gap: 10px; font-size: .93rem; color: var(--ink-2); }
.why-key {
  flex: none; width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center;
  font-size: .76rem; font-weight: 800; background: var(--bg-alt); color: var(--ink-2);
}
.tip {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--tint); color: var(--ink-2); font-size: .92rem; margin-bottom: 12px;
}
.tip .ico { color: var(--primary); }
.concept-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 999px; background: var(--bg-alt); color: var(--muted);
  font-size: .78rem; font-weight: 700; letter-spacing: .03em;
}

.streak-line { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--muted); }
.streak-flame { color: var(--coral-600); font-weight: 800; }

/* results */
.results-hero { text-align: center; padding: 8px 0 22px; }
.results-hero h1 { margin-bottom: 6px; }
.results-msg { color: var(--ink-2); max-width: 52ch; margin: 0 auto 4px; }
.score-big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin: 14px 0 4px; }
.stat-strip { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 22px 0; }
@media (min-width: 620px) { .stat-strip { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; text-align: center;
}
.stat-num { font-size: 1.5rem; font-weight: 800; display: block; line-height: 1.2; }
.stat-label { font-size: .78rem; color: var(--muted); font-weight: 650; letter-spacing: .03em; }

.breakdown { display: grid; gap: 10px; }
.bd-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.bd-name { font-size: .93rem; font-weight: 600; }
.bd-fig { font-size: .88rem; color: var(--muted); }
.bd-bar { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.bd-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.bd-bar > i.lo { background: var(--red-500); }
.bd-bar > i.mid { background: var(--amber-500); }
.bd-bar > i.hi { background: var(--green-500); }

.review-item {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 14px; background: var(--surface-2); margin-bottom: 10px;
}
.review-item p { margin: 0 0 6px; font-size: .93rem; }

/* --------------------------------------------------------- readiness --- */
.ring-hero {
  display: grid; gap: clamp(18px, 4vw, 34px); align-items: center;
  grid-template-columns: 1fr; text-align: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: clamp(22px, 4vw, 34px); box-shadow: var(--shadow-1);
}
@media (min-width: 720px) { .ring-hero { grid-template-columns: auto 1fr; text-align: left; } }
.ring-svg { display: block; margin: 0 auto; }
.ring-state { font-size: 1.35rem; font-weight: 800; margin: 0 0 6px; }
.ring-state.state-building { color: var(--red-700); }
.ring-state.state-approaching { color: var(--amber-700); }
.ring-state.state-ready { color: var(--green-700); }
.ring-explain { color: var(--ink-2); margin: 0 0 12px; font-size: .96rem; }
.ring-hero .btn { margin-right: 8px; }
.ring-num { font-weight: 800; }

.ready-pulse { animation: readyPulse 2.6s var(--ease) 1; transform-origin: center; }
@keyframes readyPulse {
  0%, 100% { filter: none; }
  35% { filter: drop-shadow(0 0 14px color-mix(in srgb, var(--green-500) 60%, transparent)); }
}

.radar-wrap { display: grid; place-items: center; }
.radar { width: min(100%, 420px); height: auto; }
.radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.radar-axis { stroke: var(--line); stroke-width: 1; }
.radar-shape { fill: color-mix(in srgb, var(--teal-700) 26%, transparent); stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; }
.radar-label { font-size: 9.5px; fill: var(--muted); font-family: var(--ui-font); }

.trend { width: 100%; height: 90px; }
.trend-line { fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.trend-dot { fill: var(--coral-600); }
.trend-base { stroke: var(--line); stroke-width: 1; }

.history-list { display: grid; gap: 8px; }
.history-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2);
}
.history-when { color: var(--muted); font-size: .86rem; margin-left: auto; }
.history-score { font-weight: 800; }

/* ---------------------------------------------------------- settings --- */
.set-row {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-copy { flex: 1; min-width: 220px; }
.set-copy h3 { margin: 0 0 3px; font-size: 1rem; }
.set-copy p { margin: 0; color: var(--muted); font-size: .89rem; }

.seg { display: inline-flex; background: var(--bg-alt); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-2);
  padding: 9px 16px; min-height: 40px; border-radius: 999px; font-weight: 650; font-size: .89rem;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--primary); box-shadow: var(--shadow-1); }

.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 999px; background: var(--muted); margin-right: 7px; }
.status-dot.on { background: var(--green-500); }
.status-dot.off { background: var(--amber-500); }

/* ------------------------------------------------------------ licence -- */
/* The licence card in Settings, and the one upsell panel in the app. Both are
   deliberately quiet: no gradient, no pulse, no countdown (KB 08 §3). */
.lic-card {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface-2);
}
.lic-card.is-held { border-color: var(--primary); background: var(--tint); }
.lic-card-copy { flex: 1; min-width: 220px; }
.lic-headline { margin: 0 0 3px; font-weight: 700; font-size: 1rem; }
.lic-card .micro { margin: 0; }

.lock-panel {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; margin-bottom: 22px;
  background: var(--surface); color: var(--ink-2);
}
.lock-panel h3 { margin: 0 0 5px; font-size: 1rem; color: var(--ink); }
.lock-panel p { margin: 0 0 12px; font-size: .93rem; }
.lock-panel .ico-lg { color: var(--primary); }
.lock-panel .q-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------- sheets -- */
/* One native <dialog> serves both licence flows: focus trapping, Escape and
   the backdrop come from the platform rather than from us. */
.sheet {
  width: min(92vw, 480px);
  padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-2);
}
.sheet::backdrop { background: color-mix(in srgb, #04100E 55%, transparent); }
.sheet-inner { padding: clamp(18px, 4vw, 26px); margin: 0; }
.sheet-title { margin: 0 0 8px; font-size: 1.2rem; }
.sheet-blurb { margin: 0 0 16px; color: var(--ink-2); font-size: .95rem; }
.sheet .field { margin-bottom: 12px; }
.sheet-input {
  width: 100%; padding: 12px 14px;
  background: var(--surface-2); color: var(--ink);
  border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  font: inherit; font-size: .95rem; min-height: 48px;
}
.sheet-input:focus-visible { border-color: var(--primary); }
.sheet-status { margin: 0 0 4px; font-size: .89rem; color: var(--muted); min-height: 1.2em; }
.sheet-status.is-good { color: var(--green-700); font-weight: 650; }
.sheet-status.is-bad { color: var(--red-700); font-weight: 650; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
@media (max-width: 420px) {
  .sheet-actions { flex-direction: column-reverse; }
  .sheet-actions .btn { width: 100%; }
}

/* ------------------------------------------------------------ notices -- */
.notice {
  display: flex; gap: 14px; align-items: flex-start;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg);
  padding: 18px; background: var(--surface-2); color: var(--ink-2);
}
.notice h3 { margin: 0 0 5px; font-size: 1rem; color: var(--ink); }
.notice p { margin: 0 0 10px; font-size: .93rem; }
.notice .ico-lg { color: var(--muted); }

/* -------------------------------------------------- companions shelf --- */
.shelf-group + .shelf-group { margin-top: 30px; }
.shelf-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 620px) { .shelf-grid { grid-template-columns: repeat(2, 1fr); } }

.shelf-card {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 18px;
  color: var(--ink); text-decoration: none;
  transition: border-color var(--dur) var(--ease), transform 140ms var(--ease), box-shadow var(--dur) var(--ease);
}
.shelf-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.shelf-card .ico-lg { margin-top: 2px; }
.shelf-card-body { min-width: 0; }
.shelf-card h3 { margin: 0 0 4px; font-size: 1.04rem; }
.shelf-card p { margin: 0 0 8px; color: var(--muted); font-size: .9rem; }
.shelf-open { display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 650; font-size: .88rem; }

/* -------------------------------------------------- companion viewer --- */
.doc-wrap { min-width: 0; }
.doc-back {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 0; margin-bottom: 10px; min-height: 40px;
  color: var(--muted); text-decoration: none; font-weight: 650; font-size: .9rem;
}
.doc-back:hover { color: var(--primary); }
.ico-flip { transform: scaleX(-1); }
.doc-head { margin-bottom: 16px; }
.doc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.doc-hint { margin: 8px 0 20px; }

/* The fragment carries its own scoped `comp-` styles, so the shell supplies a
   surface and overflow safety and nothing else.

   `overflow-x: auto` is the guarantee: whatever width a fragment's own table
   or figure claims, it scrolls inside this card and the page never scrolls
   sideways at 375px. The box has no fixed height, so the implied
   `overflow-y: auto` never produces an inner vertical scrollbar.

   The two rules below it are a nicety on top, and are deliberately limited to
   elements the fragment left unclassed — a styled `comp-` table or code block
   is never overridden from out here. */
.doc-body {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: clamp(18px, 3vw, 30px);
  color: var(--ink); max-width: 100%; overflow-wrap: break-word;
  overflow-x: auto; overscroll-behavior-x: contain;
}
.doc-body > :last-child { margin-bottom: 0; }
.doc-body img, .doc-body svg, .doc-body video { max-width: 100%; height: auto; }
.doc-body table:not([class]), .doc-body pre:not([class]) { display: block; max-width: 100%; overflow-x: auto; }

/* ------------------------------------------------------------- footer -- */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 22px var(--pad) 34px;
  background: var(--bg-alt);
}
.site-footer p {
  max-width: var(--maxw); margin: 0 auto;
  font-size: .81rem; color: var(--muted); text-align: center; line-height: 1.65;
}

/* ------------------------------------------------------------- toasts -- */
.toast-region {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 90; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg);
  padding: 12px 18px; border-radius: 999px; font-size: .9rem; font-weight: 600;
  text-align: center; box-shadow: var(--shadow-2);
  opacity: 0; transform: translateY(10px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.toast.show { opacity: 1; transform: none; }

/* =========================================================================
   PART TWO — the marketing surface, the app chrome, and the polish pass.
   Everything below is additive: it re-uses the tokens above and never
   introduces a colour, radius or shadow that is not one of them.
   ========================================================================= */

/* ----------------------------------------------------- view transitions -- */
/* Views are swapped by toggling [hidden], and going from display:none back to
   display:block restarts CSS animations — so this one rule is the whole
   transition system. 190ms is under the perceptual threshold the design brief
   asks for, and the reduced-motion blocks at the end of the file kill it. */
@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.view { animation: viewIn 190ms var(--ease) both; }

/* ---------------------------------------------- marketing view scaffold -- */
/* The landing page opts out of the shared reading column so its bands can run
   edge to edge; `.wrap` puts the column back inside each one. */
.view-marketing {
  max-width: none;
  margin: 0;
  padding: 0 0 clamp(48px, 8vw, 96px);
}
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad);
}
.view-marketing .band { margin-top: var(--band-gap); }

.section-head { margin-bottom: clamp(20px, 3vw, 32px); }
.section-head .section-h { margin-bottom: 8px; }
.section-sub { color: var(--muted); margin: 0; font-size: .97rem; max-width: 64ch; }

/* ------------------------------------------------------------ hero band -- */
.hero-band {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(24px, 4vw, 56px) 0 clamp(64px, 9vw, 116px);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--tint) 88%, var(--bg)) 0%,
    color-mix(in srgb, var(--tint) 30%, var(--bg)) 46%,
    var(--bg) 100%
  );
}

/* Three stacked atmospherics — a hairline grid that fades out, two soft
   brand glows, and a wave that hands the eye down to the next band. All
   decorative, all pointer-transparent, all behind the content. */
.hero-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }

.fx-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--primary) 14%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--primary) 14%, transparent) 1px, transparent 1px);
  background-size: 38px 38px;
  opacity: var(--fx-grid-op);
  -webkit-mask-image: radial-gradient(125% 92% at 50% 0%, #000 0%, transparent 70%);
  mask-image: radial-gradient(125% 92% at 50% 0%, #000 0%, transparent 70%);
}

/* The blur is expensive to rasterise, so each glow is promoted to its own
   compositor layer and painted once instead of on every scroll frame. */
.fx-glow {
  position: absolute; border-radius: 50%;
  filter: blur(64px);
  opacity: var(--fx-glow-op);
  transform: translateZ(0);
  will-change: transform;
}
.fx-glow-teal {
  width: min(52vw, 620px); aspect-ratio: 1;
  right: -10%; top: -26%;
  background: radial-gradient(circle, color-mix(in srgb, var(--teal-400) 62%, transparent) 0%, transparent 70%);
}
.fx-glow-coral {
  width: min(40vw, 460px); aspect-ratio: 1;
  left: -12%; bottom: -20%;
  background: radial-gradient(circle, color-mix(in srgb, var(--coral-500) 32%, transparent) 0%, transparent 70%);
}

.fx-wave {
  position: absolute; left: 0; right: 0; bottom: -1px;
  width: 100%; height: clamp(44px, 6.5vw, 110px);
  display: block;
}
.fx-wave path { fill: var(--bg); }

.hero {
  position: relative;
  display: grid; gap: clamp(24px, 4vw, 52px);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 900px) { .hero { grid-template-columns: 1.04fr .96fr; } }

.hero-chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.chip-action {
  cursor: pointer;
  padding: 9px 15px; min-height: 40px;
  background: var(--surface); color: var(--brand-text);
  border: 1.5px solid color-mix(in srgb, var(--primary) 45%, transparent);
  font-size: .85rem; font-weight: 700;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.chip-action:hover { background: var(--tint); border-color: var(--primary); }
.chip-quiet {
  padding: 9px 15px; min-height: 40px;
  background: transparent; color: var(--muted);
  border: 1px solid var(--line);
  font-size: .85rem; font-weight: 600;
}

/* ---------------------------------------------------- the device mockup -- */
/* Built from elements rather than an image: it stays sharp at any zoom, it
   follows the live theme, and it cannot go stale the way a screenshot does.
   Everything inside it is a scaled-down twin of a real player rule above. */
.hero-stage { display: none; }
@media (min-width: 760px) { .hero-stage { display: block; position: relative; justify-self: center; } }

.device {
  position: relative;
  width: clamp(258px, 25vw, 316px);
  aspect-ratio: 100 / 203;
  padding: 9px;
  border-radius: 42px;
  background: linear-gradient(158deg, var(--device-frame) 0%, var(--device-bezel) 100%);
  box-shadow: var(--shadow-3), 0 0 0 1px color-mix(in srgb, var(--ink) 22%, transparent);
  margin-inline: auto;
}
/* the speaker pill; the only ornament on the frame */
.device::before {
  content: ""; position: absolute; z-index: 2;
  top: 17px; left: 50%; transform: translateX(-50%);
  width: 68px; height: 6px; border-radius: 999px;
  background: color-mix(in srgb, #000 45%, var(--device-frame));
}

.device-screen {
  height: 100%;
  display: flex; flex-direction: column;
  border-radius: 34px; overflow: hidden;
  background: var(--bg);
}

.device-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 26px 13px 9px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.device-mark { color: var(--primary); display: inline-flex; flex: none; }
.device-progress { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; }
.device-progress > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.device-count { font-size: 9px; font-weight: 800; color: var(--muted); flex: none; }

.device-card {
  flex: 1; min-height: 0; overflow: hidden;
  margin: 9px; padding: 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-1);
}
.device-meta { display: flex; gap: 5px; margin-bottom: 9px; }
.device-chip {
  font-size: 8px; font-weight: 800; letter-spacing: .03em;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-alt); color: var(--muted);
}
.device-chip-brand { background: var(--tint); color: var(--brand-text); }

.device-stem { font-size: 10px; line-height: 1.45; margin: 0 0 9px; color: var(--ink); }
.device-stem b { font-weight: 800; }

.device-opts { list-style: none; margin: 0 0 9px; padding: 0; display: grid; gap: 5px; }
.device-opt {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 9px;
  background: var(--surface-2); border: 1.2px solid var(--line);
  font-size: 9px; line-height: 1.35; color: var(--ink-2);
}
.device-key {
  flex: none; width: 15px; height: 15px; border-radius: 999px;
  display: grid; place-items: center; font-size: 8px; font-weight: 800;
  background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line-strong);
}
.device-opt.is-correct {
  border-color: var(--green-700); color: var(--ink);
  background: color-mix(in srgb, var(--green-500) 13%, transparent);
}
.device-opt.is-correct .device-key { background: var(--green-700); color: #fff; border-color: var(--green-700); }
.device-tick { width: 11px; height: 11px; flex: none; margin-left: auto; color: var(--green-700); }

.device-verdict {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; margin-bottom: 8px; border-radius: 9px;
  background: color-mix(in srgb, var(--green-500) 15%, transparent);
  color: var(--green-700); font-size: 9px; font-weight: 800;
}
.device-verdict svg { width: 11px; height: 11px; flex: none; }

.device-rationale {
  display: grid; gap: 5px; padding: 8px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.device-rationale-h {
  font-size: 7.5px; font-weight: 800; letter-spacing: .09em;
  text-transform: uppercase; color: var(--muted);
}
.device-line { display: block; height: 4px; border-radius: 999px; background: var(--line); }

.device-tabs {
  display: flex; padding: 6px 4px 12px;
  background: var(--surface); border-top: 1px solid var(--line);
}
.device-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 7.5px; font-weight: 700; color: var(--muted);
}
.device-tab .ico {
  width: 13px; height: 13px; box-sizing: content-box;
  padding: 2px 9px; border-radius: 999px; vertical-align: 0;
}
.device-tab.is-on { color: var(--primary); }
.device-tab.is-on .ico { background: var(--tint); }

/* Floating proof chips. They need room to breathe outside the phone, so they
   only appear once the viewport can actually give it to them. */
.float-chip { display: none; }
@media (min-width: 1040px) {
  .float-chip {
    position: absolute; z-index: 2;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 15px; border-radius: 999px;
    background: var(--surface); border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
    font-size: .82rem; font-weight: 650; color: var(--ink-2); white-space: nowrap;
    /* transform-only, so the drift runs on the compositor and never repaints */
    animation: floatY 6.5s var(--ease) infinite;
    will-change: transform;
  }
  .float-chip b { color: var(--ink); font-weight: 800; }
  /* Anchored to the phone's own edges rather than to a percentage of the
     column, so a chip always sits beside the device and never lands on top of
     the question it is there to advertise. */
  .float-chip-1 { top: 4%;      right: calc(100% - 44px); animation-delay: -.4s; }
  .float-chip-2 { bottom: 34%;  left: calc(100% - 38px);  animation-delay: -3.2s; }
  /* hangs off the bottom corner, so it clears the mock tab bar entirely */
  .float-chip-3 { bottom: -24px; right: calc(100% - 74px); color: var(--green-700); animation-delay: -1.8s; }
  .float-chip-3 b { color: var(--green-700); }
  .float-chip-3 b { color: var(--green-700); }
}
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}

/* ----------------------------------------------------------- stats band -- */
/* Lifted into the hero's lower edge so the two read as one composition. */
.stats-band {
  position: relative; z-index: 2;
  list-style: none; padding: clamp(10px, 2vw, 16px); margin: 0;
  margin-top: clamp(-46px, -4vw, -26px);
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
}
@media (min-width: 760px) { .stats-band { grid-template-columns: repeat(4, 1fr); } }
.stats-band li { text-align: center; padding: clamp(10px, 2vw, 18px) 8px; }
.stats-band li + li { border-top: 1px solid var(--line); }
.stats-band li:nth-child(2n) { border-left: 1px solid var(--line); }
.stats-band li:nth-child(-n+2) { border-top: 0; }
@media (min-width: 760px) {
  .stats-band li + li { border-top: 0; border-left: 1px solid var(--line); }
}
.stat-big {
  display: block;
  font-size: clamp(1.85rem, 1.1rem + 2.6vw, 2.9rem);
  font-weight: 800; letter-spacing: -.04em; line-height: 1.04; color: var(--ink);
}
.stat-cap { display: block; margin-top: 5px; font-size: .79rem; font-weight: 650; color: var(--muted); }

/* ----------------------------------------------------------- live demo -- */
/* Capped and centred: an option row 1000px wide is not what the player looks
   like, and a 110-character stem is not what a question reads like. */
.demo-card {
  max-width: 820px; margin-inline: auto;
  border-color: color-mix(in srgb, var(--primary) 30%, var(--line));
  box-shadow: var(--shadow-2);
}
.demo-card .q-stem { font-size: 1.04rem; }
.demo-after { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
#demo-hint { margin: 0; }

/* --------------------------------------------------------- icon plates -- */
/* One treatment for every "icon beside a heading" in the app: a tinted, gently
   outlined square. Applied by selector so no JS had to change to get it. */
.feature-ico,
.mode-card > .ico-lg,
.shelf-card > .ico-lg,
.lock-panel > .ico-lg,
.notice > .ico-lg {
  flex: none;
  width: 46px; height: 46px;
  box-sizing: border-box; padding: 11px;
  display: inline-grid; place-items: center;
  border-radius: 14px;
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary);
  margin-top: 0;
}
.feature-ico .ico-lg { width: 24px; height: 24px; }

.mode-card.mode-lead > .ico-lg {
  background: var(--coral-100);
  border-color: color-mix(in srgb, var(--coral-500) 30%, transparent);
  color: var(--accent-ink);
}
.notice > .ico-lg { background: var(--bg-alt); border-color: var(--line); color: var(--muted); }

.feature { display: flex; flex-direction: column; }
.feature h3 { margin: 16px 0 6px; }

.pledge { gap: 20px; }

/* ------------------------------------------------------ format gallery -- */
.format-gallery {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}
.format-tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.4vw, 22px);
  box-shadow: var(--shadow-1);
  transition: border-color var(--dur) var(--ease), transform 140ms var(--ease), box-shadow var(--dur) var(--ease);
}
.format-tile:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-2); }
/* Seven tiles in a four-column grid leave a hole; the case study — the widest
   idea of the seven — fills it. */
@media (min-width: 1040px) { .format-tile:last-child { grid-column: span 2; } }
.format-tile h3 { margin: 0 0 4px; }
.format-tile p { margin: 0; font-size: .88rem; color: var(--muted); }

.format-art { display: block; width: 100%; max-width: 152px; height: auto; margin-bottom: 14px; }
/* The schematic vocabulary: an outlined box is an unchosen thing, a tinted one
   is chosen, coral is a highlight the student made. */
.fa-box  { fill: var(--surface-2); stroke: var(--line-strong); stroke-width: 1.6; }
.fa-box.fa-on { fill: var(--tint); stroke: var(--primary); }
.fa-dot  { fill: none; stroke: var(--line-strong); stroke-width: 1.6; }
.fa-dot-on { fill: var(--primary); stroke: var(--primary); }
.fa-sq   { fill: none; stroke: var(--line-strong); stroke-width: 1.6; }
.fa-sq-on { fill: var(--primary); stroke: var(--primary); }
.fa-num  { fill: var(--bg-alt); stroke: var(--line-strong); stroke-width: 1.6; }
.fa-num-on { fill: var(--primary); stroke: var(--primary); }
.fa-link { fill: none; stroke: var(--line-strong); stroke-width: 1.5; stroke-dasharray: 3 3; }
.fa-rule { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
.fa-text { stroke-width: 3.4; stroke-linecap: round; opacity: .5; }
.fa-mark { fill: color-mix(in srgb, var(--coral-500) 42%, transparent); }
.fa-step { fill: var(--bg-alt); stroke: var(--line-strong); stroke-width: 1.6; }
.fa-step-on { fill: var(--teal-100); stroke: var(--teal-100); }
.fa-step-now { fill: var(--primary); stroke: var(--primary); }

/* -------------------------------------------------------- comparison -- */
/* The table is allowed to be wider than a phone; it scrolls inside its own
   box so the page itself never scrolls sideways. */
.compare-wrap {
  overflow-x: auto; overscroll-behavior-x: contain;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
}
.compare { width: 100%; min-width: 580px; border-collapse: collapse; }
.compare th, .compare td {
  padding: 15px 18px; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); font-size: .93rem;
}
.compare thead th {
  font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); background: var(--bg-alt); border-bottom-color: var(--line-strong);
}
.compare tbody th { width: 24%; font-weight: 700; color: var(--ink); }
.compare tbody td { color: var(--muted); }
.compare tbody tr:last-child th,
.compare tbody tr:last-child td { border-bottom: 0; }
.compare .col-us { background: color-mix(in srgb, var(--tint) 60%, var(--surface)); }
.compare thead .col-us { background: var(--tint); color: var(--brand-text); }
.compare tbody .col-us { color: var(--ink-2); }
.compare .col-us b { color: var(--ink); font-weight: 800; }
.cell-sub { display: block; margin-top: 4px; font-size: .81rem; color: var(--muted); }

/* ---------------------------------------------------------- pricing -- */
.price-card { position: relative; }
.price-flag {
  position: absolute; top: -12px; right: 20px;
  padding: 5px 13px; border-radius: 999px;
  background: var(--primary); color: var(--on-teal);
  font-size: .71rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
  box-shadow: var(--shadow-1);
}

/* ----------------------------------------------- reviews placeholder -- */
/* There are no reviews, so this says so. It is a slot, not a testimonial. */
.review-slot {
  text-align: center;
  padding: clamp(26px, 4vw, 44px);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r-xl);
  background: var(--surface-2);
}
.review-badge {
  display: inline-block; margin-bottom: 14px;
  padding: 5px 14px; border-radius: 999px;
  background: var(--coral-100); color: var(--accent-ink);
  font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase;
}
.review-slot p { max-width: 56ch; margin-inline: auto; color: var(--ink-2); }
.review-slot .micro { margin-top: 12px; }

/* ================================================== APP-FEEL, NOT WEBSITE == */

/* --------------------------------------------------- install affordance -- */
.install-btn {
  white-space: nowrap;
  border-color: color-mix(in srgb, var(--primary) 50%, transparent);
  color: var(--primary);
}
.install-btn:hover:not([disabled]) { background: var(--tint); border-color: var(--primary); }

/* The short-label trick for "I have a key" needs to out-rank `.btn-sm`, which
   is declared later in the file and was quietly restoring the font size —
   leaving the button reading "I have a keyKey" on a narrow phone. */
@media (max-width: 400px) {
  .btn.key-btn { font-size: 0; padding: 8px 12px; }
  .btn.key-btn::after { content: "Key"; font-size: .88rem; }
}

@media (max-width: 620px) {
  .install-label {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  .install-btn { padding: 8px 13px; }
}

/* ------------------------------------------------------ app top bar -- */
.chrome { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
.chrome::before {
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
}

/* Once the app is actually installed the browser's own chrome is gone, so
   ours tightens up to match, and every "install me" affordance retires. */
@media (display-mode: standalone) {
  .chrome { padding-top: calc(6px + env(safe-area-inset-top, 0px)); padding-bottom: 6px; }
  .install-btn, #hero-install { display: none !important; }
  .site-footer { padding: 16px var(--pad) 26px; }
  html { scroll-behavior: auto; }
  body { overscroll-behavior-y: none; }
  .hero-band { padding-top: clamp(12px, 2vw, 26px); }
}
/* Belt and braces for engines that do not match the media feature; app.js
   sets this attribute from the same signal. */
body[data-standalone="yes"] .install-btn,
body[data-standalone="yes"] #hero-install { display: none !important; }
body[data-standalone="yes"] .chrome { padding-block: 6px; }

/* ----------------------------------------------------- phone tab bar -- */
@media (max-width: 640px) {
  .chrome { padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .chrome-nav {
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
  }
  /* The pill moves off the whole tab and onto the glyph, which is the shape
     every native tab bar uses and the reason the old one read as a web nav. */
  .chrome-nav a,
  .chrome-nav a:hover,
  .chrome-nav a[aria-current="page"] { background: transparent; }
  .chrome-nav a[aria-current="page"] { color: var(--primary); }
  .chrome-nav .ico {
    box-sizing: content-box;
    padding: 3px 13px; border-radius: 999px;
    transition: background var(--dur) var(--ease);
  }
  .chrome-nav a[aria-current="page"] .ico { background: var(--tint); }
  .nav-label { display: block; }
}

/* ---------------------------------------------- sticky mobile CTA dock -- */
/* Phone-only, landing-only. It docks flush above the tab bar so the two read
   as one surface rather than two competing bars. */
.cta-dock { display: none; }
@media (max-width: 640px) {
  body[data-view="landing"] .cta-dock {
    position: fixed; z-index: 44; left: 0; right: 0;
    bottom: calc(66px + env(safe-area-inset-bottom, 0px));
    display: flex; align-items: center; gap: 10px;
    padding: 10px var(--pad);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.6) blur(16px);
    -webkit-backdrop-filter: saturate(1.6) blur(16px);
    border-top: 1px solid var(--line);
  }
  .cta-dock .btn-block { width: auto; flex: 1 1 auto; }
  .cta-dock-link { flex: none; white-space: nowrap; font-weight: 700; color: var(--ink-2); }

  /* room for both bars, and toasts that clear them */
  body[data-view="landing"] { padding-bottom: calc(142px + env(safe-area-inset-bottom, 0px)); }
  body[data-view="landing"] .toast-region { bottom: calc(158px + env(safe-area-inset-bottom, 0px)); }
}

/* =============================================== GLOBAL POLISH PASS ====== */

/* ------------------------------------------------------- microreactions -- */
/* Dignified: a settle and a small nudge. Nothing bounces, nothing confettis. */
@keyframes optSettle {
  0%   { transform: none; }
  45%  { transform: scale(1.008); }
  100% { transform: none; }
}
@keyframes optNudge {
  0%, 100% { transform: none; }
  28%      { transform: translateX(-3px); }
  64%      { transform: translateX(2px); }
}
.opt.is-correct { animation: optSettle 320ms var(--ease) both; }
.opt.is-wrong   { animation: optNudge 300ms var(--ease) both; }
.opt.is-correct .opt-key { animation: optSettle 320ms var(--ease) 60ms both; }
.verdict { animation: viewIn 240ms var(--ease) both; }

/* ----------------------------------------------------------- surfaces -- */
/* One elevation language: panels match cards, sheets sit a level above. */
.panel { box-shadow: var(--shadow-1); }
.card, .panel, .format-tile, .mode-card, .shelf-card { border-radius: var(--r-lg); }
.q-card, .ring-hero, .band-tint, .compare-wrap, .stats-band, .review-slot { border-radius: var(--r-xl); }

.sheet { border-radius: var(--r-xl); box-shadow: var(--shadow-3); }
.sheet::backdrop { backdrop-filter: blur(3px); }
.lic-card { border-radius: var(--r-lg); padding: 18px; }
.lock-panel { border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.notice { border-radius: var(--r-lg); }

.seg { border: 1px solid var(--line); }
.seg button[aria-pressed="true"] { font-weight: 700; }

/* --------------------------------------------------------- empty states -- */
.notice-empty {
  flex-direction: column; align-items: center; text-align: center;
  gap: 4px; padding: clamp(26px, 4vw, 40px);
  border-style: solid; border-color: var(--line);
  background: var(--surface);
}
.notice-empty > div { display: contents; }
.notice-empty p { max-width: 52ch; }
.empty-art {
  display: block;
  width: clamp(104px, 20vw, 138px); height: auto;
  margin-bottom: 6px;
  color: var(--primary); opacity: .5;
}

/* ------------------------------------------------------------- focus -- */
/* Big, brand-coloured, and never clipped by an overflow box. */
.btn:focus-visible,
.opt:focus-visible,
.mode-card:focus-visible,
.shelf-card:focus-visible,
.chip-action:focus-visible,
.icon-btn:focus-visible,
.chrome-nav a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* --------------------------------------------------- reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
body[data-motion="reduced"] *, body[data-motion="reduced"] *::before, body[data-motion="reduced"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important;
}

/* ----------------------------------------------------------- printing -- */
@media print {
  .chrome, .toast-region, .q-actions, .site-footer { display: none !important; }

  /* A companion prints as a document, not as a screenshot of an app. The
     shell chrome goes, the fragment keeps its own scoped styling and gets the
     whole page, and the palette is forced back to ink-on-paper so a student
     reading in dark mode does not print a black rectangle. These overrides
     sit last in the file so they win the specificity tie with the two dark
     blocks near the top. */
  @page { margin: 14mm; }

  html[data-theme] {
    color-scheme: light;
    --bg: #FFFFFF; --bg-alt: #FFFFFF; --surface: #FFFFFF; --surface-2: #FFFFFF;
    --tint: #F2F4F3; --line: #CCCCCC; --line-strong: #B0B0B0;
    --ink: #101414; --ink-2: #23292A; --muted: #4A5250;
    --primary: #0B5F58; --on-teal: #FFFFFF;
    --shadow-1: none; --shadow-2: none;
  }

  body { padding-bottom: 0 !important; background: #FFFFFF; }
  .skip-link, .doc-back, .doc-actions, .doc-hint, .doc-head .eyebrow { display: none !important; }
  .view { max-width: none; padding: 0; }
  .doc-head { margin-bottom: 10mm; }
  /* overflow must go back to visible on paper, or a wide figure is clipped
     at the page edge instead of being scaled by the print engine. */
  .doc-body { border: 0; border-radius: 0; padding: 0; background: transparent; overflow: visible; }
  .doc-body a { text-decoration: underline; }
}
