/* 67Challenger — "night trail" design.
   Type: Fredoka for headings and numbers, Lexend (designed for reading fluency) for everything else.
   Color: navy base, indigo surfaces, cyan actions, gold only for rewards, pink for streaks.
   Reading content always sits on white paper for maximum contrast. */

@font-face { font-family: 'Lexend'; src: url('/assets/fonts/lexend-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fredoka'; src: url('/assets/fonts/fredoka-latin-wght-normal.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }

:root {
  --navy: #0E0025;
  --indigo: #2D0080;
  --surface: #1C0050;
  --surface-2: #2D0080;
  --surface-3: #4A10AA;
  --line: rgba(255, 255, 255, 0.1);
  --ink: #F5F3FF;
  --muted: #CDB8F5;
  --cyan: #00C8F0;
  --blue: #6B21E8;
  --pink: #E8218A;
  --gold: #FFD000;
  --amber: #F5A623;
  --good: #00E676;
  --bad: #FF7A9A;
  --paper: #FFFFFF;
  --paper-ink: #140B3A;
  --accent: var(--cyan);
  --r-sm: 10px;
  --r: 18px;
  --r-lg: 28px;
  --display: 'Fredoka', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --body: 'Lexend', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--navy);
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.55), transparent 60%),
    radial-gradient(1px 1px at 72% 9%, rgba(255,255,255,.45), transparent 60%),
    radial-gradient(1.5px 1.5px at 88% 34%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1px 1px at 33% 66%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(ellipse 160% 80% at 8% 4%, rgba(107,33,232,.42) 0%, transparent 48%),
    radial-gradient(ellipse 95% 130% at 92% 96%, rgba(232,33,138,.28) 0%, transparent 48%),
    linear-gradient(168deg, #05000F 0%, #1C0050 30%, #0A001E 55%, #1C0050 80%, #05000F 100%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 8px 16px 96px; outline: none; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; line-height: 1.15; margin: 0.2em 0 0.45em; letter-spacing: 0.01em; }
h1 { font-size: clamp(34px, 7vw, 56px); }
h2 { font-size: clamp(24px, 4.5vw, 32px); }
h3 { font-size: 21px; }
h4 { font-size: 17px; color: var(--cyan); }
p { margin: 0.35em 0 0.7em; }
a { color: var(--cyan); }
code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 0.9em; word-break: break-all; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: var(--gold); color: var(--navy); padding: 8px; z-index: 50; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.small { font-size: 14px; }
.muted { color: var(--muted); }
.error { color: var(--bad); }
.num { font-family: var(--display); font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.row.space { justify-content: space-between; }
.center-row { justify-content: center; }
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 8px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.narrow { max-width: 460px; margin: 24px auto; }
.big-emoji { font-size: 56px; line-height: 1; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }

/* ── Top bar ───────────────────────────────────────────────────────────── */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; max-width: 1080px; width: 100%; margin: 0 auto; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 22px; }
.logo { width: 42px; height: 42px; border-radius: 50%; background: radial-gradient(circle, #2D0080 0%, #0E0025 70%); box-shadow: 0 0 0 2px rgba(196,146,255,.55), 0 0 16px rgba(155,80,255,.45); object-fit: contain; padding: 3px; }
.welcome-logo { display: block; width: min(300px, 72vw); height: auto; margin: 0 auto 8px; filter: drop-shadow(0 10px 30px rgba(107,33,232,.45)); }
.hud { display: flex; gap: 8px; align-items: center; }
.hud-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: 16px; }
.hud-chip.streak { color: #ffb3d6; }
.hud-chip.stars { color: var(--gold); }
.footer { text-align: center; padding: 16px 16px 88px; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn { font: 600 16px var(--body); border: 0; border-radius: 999px; padding: 12px 22px; min-height: 46px; cursor: pointer; transition: transform .08s ease, filter .15s ease; color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--cyan); color: var(--navy); box-shadow: 0 4px 0 #0098b5; }
.btn-primary:active { box-shadow: 0 1px 0 #0098b5; }
.btn-secondary { background: var(--surface-2); border: 1px solid var(--line); }
.btn-ghost { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.btn-danger { background: transparent; color: var(--bad); border: 1px solid rgba(255,122,154,.4); }
.btn.big { font-size: 20px; padding: 16px 30px; min-height: 58px; }
.btn.small { padding: 6px 14px; min-height: 34px; font-size: 14px; }
.btn.block { width: 100%; }
.icon-btn { font-size: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 46px; height: 46px; cursor: pointer; flex: none; }
.link-btn { background: none; border: 0; color: var(--cyan); font: inherit; text-decoration: underline; cursor: pointer; padding: 4px 0; }

/* ── Surfaces ──────────────────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 12px 0; }
.card.paper { background: var(--paper); color: var(--paper-ink); }
.card input[type=text], .card input[type=email], .card input[type=password], .card input[type=number], .card input[type=time], .card select, dialog input, dialog select, .field {
  font: inherit; color: var(--ink); background: var(--navy); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; width: 100%; margin: 6px 0;
}
.input-sm { width: 96px !important; }
label.field-label { display: block; font-size: 14px; color: var(--muted); margin-top: 10px; }
.notice { background: rgba(251, 157, 2, .12); border: 1px solid rgba(251,157,2,.6); padding: 10px 14px; border-radius: 12px; }
.notice.good { background: rgba(59, 232, 160, .12); border-color: rgba(59,232,160,.6); }

/* ── Welcome ───────────────────────────────────────────────────────────── */
.hero { text-align: center; padding: 28px 8px 8px; }
.hero h1 { margin-bottom: 0; }
.hero h1 .six7 { color: var(--cyan); }
.tagline { font-size: 19px; color: var(--muted); margin-top: 6px; }
.companions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 26px 0; }
.companion { width: 120px; padding: 14px 10px; border-radius: var(--r); background: var(--surface); border: 2px solid var(--accent); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.companion strong { font-family: var(--display); font-size: 18px; }

/* ── Kid home ──────────────────────────────────────────────────────────── */
.continue { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px; border-radius: var(--r-lg); background: linear-gradient(135deg, var(--surface-3), var(--surface)); border: 2px solid var(--accent); margin: 8px 0 18px; }
.continue .who { font-size: 64px; }
.continue h2 { margin: 0; }
.continue p { margin: 2px 0 0; color: var(--muted); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 22px 0 6px; }
.section-title h3 { margin: 0; }
.tiles-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.cat-tile { position: relative; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.cat-tile:hover { border-color: var(--accent); }
.cat-tile .cat-icon { font-size: 34px; }
.cat-tile strong { font-family: var(--display); font-size: 18px; line-height: 1.15; }
.cat-tile .meta { margin-top: auto; display: flex; justify-content: space-between; align-items: center; font-size: 14px; color: var(--muted); }
.ring { --p: 0; width: 42px; height: 42px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-3) 0); display: grid; place-items: center; }
.ring::after { content: attr(data-label); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface); font: 600 11px var(--display); color: var(--ink); }

/* ── Path (trail) ──────────────────────────────────────────────────────── */
.path-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.path-head .cat-icon { font-size: 44px; }
.unit { margin: 26px 0 8px; }
.unit-banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 18px; border-radius: var(--r); background: var(--accent); color: var(--navy); }
.unit-banner h3 { margin: 0; font-size: 20px; }
.unit-banner .small { color: rgba(10,3,34,.75); }
.unit.locked .unit-banner { background: var(--surface-2); color: var(--muted); }
.unit.locked .unit-banner .small { color: var(--muted); }
.unit .stretch-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: rgba(10,3,34,.18); margin-left: 6px; }
.trail { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 18px 0 6px; }
.node { --x: 0px; transform: translateX(var(--x)); width: 74px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; font: 600 22px var(--display); color: var(--navy); background: var(--surface-3); box-shadow: 0 6px 0 rgba(0,0,0,.35); position: relative; display: grid; place-items: center; }
.node.core { width: 88px; height: 82px; font-size: 28px; }
.node.done { background: var(--gold); }
.node.started { background: var(--accent); }
.node.new { background: var(--surface-3); color: var(--ink); }
.node.locked { background: var(--surface); color: var(--muted); cursor: not-allowed; box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.node.next { outline: 4px solid var(--ink); outline-offset: 5px; }
.node .stars { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: -1px; color: var(--gold); white-space: nowrap; }
.node .badge-core { position: absolute; top: -8px; right: -8px; font-size: 18px; }
.more-btn { margin: 4px auto 0; display: block; }

/* lesson sheet */
.sheet { position: fixed; inset: auto 0 0 0; z-index: 30; background: var(--surface); border-top: 2px solid var(--accent); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 20px 20px 28px; max-width: 640px; margin: 0 auto; box-shadow: 0 -20px 60px rgba(0,0,0,.5); }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 29; }

/* ── Lesson player ─────────────────────────────────────────────────────── */
.session-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 0; background: linear-gradient(var(--navy) 70%, transparent); }
.time-track { flex: 1; height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.time-fill { height: 100%; width: 0; background: var(--cyan); transition: width .5s linear; }
.time-fill.warn { background: var(--amber); }
.time-text { font: 600 15px var(--display); color: var(--muted); min-width: 78px; text-align: right; font-variant-numeric: tabular-nums; }
.player { max-width: 760px; margin: 0 auto; }
.progress-dots { display: flex; gap: 6px; margin: 4px 0 14px; }
.progress-dots span { flex: 1; height: 8px; border-radius: 999px; background: var(--surface-2); }
.progress-dots span.done { background: var(--good); }
.progress-dots span.now { background: var(--accent); }
.stage { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; min-height: 360px; }
.phase-label { font-size: 14px; color: var(--accent); margin: 0 0 6px; font-weight: 600; }
.prompt { display: flex; align-items: flex-start; gap: 10px; font-size: 21px; font-weight: 500; }
.prompt p { margin: 0; flex: 1; white-space: pre-line; }
.prompt.mono p { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 18px; background: var(--navy); padding: 12px 14px; border-radius: 12px; }
.model { display: flex; gap: 16px; align-items: center; }
.model-line { font-size: 22px; margin: 0; }
.feedback { font: 600 20px var(--display); min-height: 1.6em; margin: 12px 0 0; }
.feedback.good { color: var(--good); }
.feedback.try { color: var(--gold); }
.hint { background: rgba(252,236,71,.08); border-left: 4px solid var(--gold); padding: 8px 12px; border-radius: 8px; }
.explain { color: var(--muted); font-size: 15px; }

.tiles { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; justify-content: center; }
.tile { font: 600 42px var(--body); min-width: 72px; height: 82px; padding: 0 10px; border-radius: 16px; border: 3px solid transparent; background: var(--paper); color: var(--paper-ink); cursor: pointer; box-shadow: 0 5px 0 #b8b3d9; }
.tile.vowel { background: #FFF6B8; box-shadow: 0 5px 0 #d6c75a; }
.tile.silent { color: #9a96b5; }
.tile.touched { border-color: var(--cyan); }
.tile.lit { border-color: var(--cyan); transform: translateY(-4px); }
.tile:disabled { opacity: .3; }
.tile.small { font-size: 22px; min-width: 40px; height: 44px; box-shadow: none; }
.tile.small.on { background: var(--bad); color: #fff; }
.tiles.large .tile, .slots.large .slot { font-size: 58px; min-width: 100px; height: 112px; margin: 0 6px; }
.blend-slider { width: 100%; max-width: 420px; display: block; margin: 0 auto 12px; accent-color: var(--cyan); height: 34px; }
.slots { display: flex; justify-content: center; gap: 10px; margin: 16px 0; }
.slot { width: 72px; height: 82px; border-bottom: 4px solid var(--cyan); font: 600 42px var(--body); display: grid; place-items: center; }
.choices { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 16px 0; }
.btn-choice { font: 500 19px var(--body); color: var(--ink); background: var(--surface-2); border: 2px solid var(--line); border-radius: 16px; padding: 14px 18px; min-width: 110px; min-height: 58px; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.35); text-align: center; }
.btn-choice:hover { border-color: var(--accent); }
.btn-choice.big-text { font-size: 30px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 4px 0 #b8b3d9; min-width: 120px; }
.btn-choice.mono { font-family: ui-monospace, Menlo, monospace; }
.btn-choice.right { border-color: var(--good); background: rgba(59,232,160,.18); }
.btn-choice.big-text.right { background: #dcfff0; }
.btn-choice.wrong { border-color: var(--bad); }
.btn-choice.picture .pic { font-size: 46px; }
.listen-choice { display: flex; gap: 6px; align-items: center; background: var(--surface-2); padding: 8px; border-radius: 16px; }
.memory-card { font-size: 34px; text-align: center; background: var(--paper); color: var(--paper-ink); border-radius: var(--r); padding: 26px; margin: 16px 0; letter-spacing: .06em; }
.seq-list { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 8px; }
.seq-item { display: flex; gap: 10px; align-items: center; background: var(--surface-2); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.seq-item.picked { border-color: var(--accent); }
.seq-item .n { font: 600 18px var(--display); width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); flex: none; }
.find-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; margin: 16px 0; }
.find-cell { font-size: 36px; height: 68px; border-radius: 14px; border: 3px solid transparent; background: var(--paper); cursor: pointer; }
.find-cell.on { border-color: var(--cyan); background: #e6fbff; }

.fact { font: 600 46px var(--display); text-align: center; margin: 16px 0; }
.answer { font: 600 44px var(--display); width: 150px; text-align: center; background: var(--navy); color: var(--ink); border: 3px solid var(--cyan); border-radius: 14px; }
.numpad { display: grid; grid-template-columns: repeat(3, 76px); gap: 8px; justify-content: center; }
.key { font: 600 26px var(--display); height: 60px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.ten-frame { display: grid; grid-template-columns: repeat(5, 50px); gap: 6px; justify-content: center; margin: 14px 0; }
.dot { width: 50px; height: 50px; border-radius: 10px; border: 2px solid var(--line); }
.dot.on::after { content: ''; display: block; width: 30px; height: 30px; margin: 8px; border-radius: 50%; background: var(--amber); }
.bar-model { width: 100%; max-width: 420px; display: block; margin: 10px auto; }
.bar-model rect { stroke: var(--ink); stroke-width: 2; }
.bar-model .shaded { fill: var(--amber); }
.bar-model .empty { fill: transparent; }
.line { max-width: 480px; margin: 20px auto; }
.line-slider { width: 100%; accent-color: var(--amber); height: 34px; }
.ticks { display: flex; justify-content: space-between; color: var(--muted); }
.readout { display: block; text-align: center; font: 600 24px var(--display); min-height: 1.4em; }
.passage { font-size: 26px; line-height: 1.85; background: var(--paper); color: var(--paper-ink); padding: 20px 24px; border-radius: var(--r); }
.passage.large { font-size: 34px; letter-spacing: .04em; word-spacing: .2em; }
.passage .reading { background: var(--gold); border-radius: 6px; }
.strategy-card { display: flex; gap: 16px; align-items: center; font-size: 23px; font-weight: 500; background: var(--surface-2); border-radius: var(--r); padding: 22px; }
.steps { font-size: 20px; }
.vocab-list li { margin: 8px 0; }

/* celebration — the one orchestrated motion moment */
.celebrate { text-align: center; padding: 34px 12px; }
.celebrate .stars-row { font-size: 64px; letter-spacing: 6px; }
.celebrate .stars-row span { display: inline-block; opacity: .25; filter: grayscale(1); }
.celebrate .stars-row span.on { opacity: 1; filter: none; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; }
.celebrate .stars-row span.on:nth-child(2) { animation-delay: .25s; }
.celebrate .stars-row span.on:nth-child(3) { animation-delay: .5s; }
@keyframes pop { from { transform: scale(.2) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.xp-gain { font: 600 28px var(--display); color: var(--gold); }

.breathe { width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(circle, var(--cyan), var(--blue)); animation: breathe 8s ease-in-out infinite; margin: 16px; }
@keyframes breathe { 0%, 100% { transform: scale(.6); } 50% { transform: scale(1.1); } }
.breathe-label { font: 600 22px var(--display); }

/* ── Trophies ──────────────────────────────────────────────────────────── */
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 16px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.badge .b-icon { font-size: 40px; }
.badge.locked { opacity: .45; }
.tier { font: 600 26px var(--display); color: var(--gold); }

/* ── Bottom nav (kids) ─────────────────────────────────────────────────── */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; display: flex; justify-content: center; gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); background: rgba(10,3,34,.94); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
.bottom-nav a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 14px; color: var(--muted); text-decoration: none; font-size: 13px; }
.bottom-nav a .ni { font-size: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }

/* ── Grown-up dashboard ────────────────────────────────────────────────── */
.dashboard h2 { margin-bottom: 4px; }
.learner-tabs, .tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.learner-tab, .tab { font: 500 15px var(--body); background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; cursor: pointer; }
.learner-tab.on, .tab.on { background: var(--surface-3); color: var(--ink); border-color: var(--cyan); }
.tab .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 999px; background: var(--pink); color: #fff; font-size: 12px; margin-left: 6px; padding: 0 6px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat .v { font: 600 30px var(--display); }
.stat .k { color: var(--muted); font-size: 14px; }
.progress-list { list-style: none; padding: 0; margin: 0; }
.progress-list li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.bar > span { display: block; height: 100%; background: var(--cyan); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input { flex: 1; accent-color: var(--cyan); height: 32px; }
.minutes { font: 600 30px var(--display); color: var(--gold); min-width: 96px; text-align: right; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.chip { font: inherit; font-size: 15px; background: var(--navy); color: var(--ink); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.chip.on { background: var(--cyan); color: var(--navy); font-weight: 600; }
.strand-group h4 { margin-top: 16px; }
.strand, .toggle { display: flex; gap: 10px; align-items: flex-start; padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.strand small, .toggle small { display: block; color: var(--muted); }
.strand.other-band { opacity: .6; }
.strand input, .toggle input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--cyan); flex: none; }
.sound-sets { display: flex; flex-direction: column; gap: 6px; }
.sound-set { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sound-set .link-btn { width: 56px; }
.letter { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--navy); border: 1px solid var(--line); font: 600 20px var(--body); cursor: pointer; }
.letter.on { background: var(--cyan); color: var(--navy); }
.letter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.letter:focus-within { outline: 3px solid var(--gold); }
.goal-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.goal-row select { max-width: 360px; }
.inline { display: inline-flex; gap: 6px; align-items: center; }
.check-list { display: flex; flex-direction: column; gap: 10px; }
.check-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--surface-2); border-radius: 14px; padding: 10px; }
.check-word { font: 600 40px var(--body); min-width: 120px; background: var(--paper); color: var(--paper-ink); border-radius: 12px; text-align: center; letter-spacing: .05em; }
.marks { display: flex; gap: 6px; }
.mark { font: 600 15px var(--body); border-radius: 10px; border: 1px solid var(--line); background: var(--navy); color: var(--ink); padding: 8px 12px; cursor: pointer; min-width: 48px; }
.mark-correct.on { background: var(--good); color: var(--navy); }
.mark-prompted.on { background: var(--gold); color: var(--navy); }
.mark-incorrect.on { background: var(--bad); color: #fff; }
.miss-letters { display: flex; gap: 4px; }
.fluency-words { display: flex; flex-wrap: wrap; gap: 6px; background: var(--paper); border-radius: 14px; padding: 14px; }
.fluency-words.nonsense .fw { font-size: 26px; min-width: 76px; }
.fw { font: inherit; font-size: 22px; background: transparent; border: 0; color: var(--paper-ink); padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.fw.err { background: var(--bad); color: #fff; }
.fw.after { opacity: .25; }
.clock { font: 600 32px var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.big-result { font: 600 30px var(--display); color: var(--gold); }
.summary-lines li { margin: 6px 0; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.trend { width: 100%; max-width: 360px; }
.trend .axis { stroke: var(--line); }
.trend-line { fill: none; stroke: var(--cyan); stroke-width: 3; }
.trend-dot { fill: var(--gold); }
.trend-label { fill: var(--ink); font-size: 12px; }
.learner-list { list-style: none; padding: 0; }
.learner-list li { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.code-input { font: 600 36px var(--display) !important; text-align: center; letter-spacing: .2em; text-transform: uppercase; }
.code { font: 600 46px var(--display); letter-spacing: .2em; color: var(--gold); text-align: center; }
.secret { font-family: ui-monospace, Menlo, monospace; font-size: 14px; background: var(--navy); border: 1px dashed var(--cyan); padding: 12px; border-radius: 12px; word-break: break-all; }
.day-chips .chip { min-width: 52px; }
.inbox-item { border-bottom: 1px solid var(--line); padding: 12px 0; }
.inbox-item.unread h4::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--pink); margin-right: 8px; vertical-align: middle; }
.plan-card { display: grid; gap: 6px; padding: 16px; border-radius: var(--r); border: 2px solid var(--line); background: var(--surface-2); }
.plan-card .price { font: 600 28px var(--display); color: var(--gold); }
.dialog { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; max-width: 460px; width: calc(100% - 32px); }
.dialog::backdrop { background: rgba(0,0,0,.6); }
.summary .xp { font: 600 24px var(--display); color: var(--gold); }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%) translateY(160px); background: var(--surface-3); color: var(--ink); border: 1px solid var(--line); padding: 12px 18px; border-radius: 14px; transition: transform .25s ease; z-index: 40; max-width: calc(100% - 32px); }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.good { border-color: var(--good); }
.toast.bad { border-color: var(--bad); }
.toast.warn { border-color: var(--amber); }
.offline { position: fixed; top: 0; left: 0; right: 0; background: var(--amber); color: var(--navy); text-align: center; padding: 6px; font-weight: 600; z-index: 60; }

body.calm .time-fill { transition: none; }
body.calm * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media (max-width: 640px) {
  main { padding: 4px 12px 96px; }
  .continue { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .tile { min-width: 60px; height: 72px; font-size: 34px; }
  .stage { padding: 16px; }
  .hud-chip { padding: 5px 9px; font-size: 14px; }
  .brand span:last-child { display: none; }
}
@media print {
  body { background: #fff; color: #000; }
  .topbar, .footer, .tabs, .learner-tabs, .row, .btn, .bottom-nav { display: none !important; }
  .card { border: 0; background: #fff; color: #000; }
  .trend-line { stroke: #000; } .trend-label { fill: #000; }
}

/* Welcome: grown-up positioning block */
.for-grownups { max-width: 960px; margin: 40px auto 8px; padding: 0 16px; }
.for-grownups h2 { font-size: clamp(1.4rem, 3.2vw, 2rem); margin: 0 0 16px; max-width: 30ch; }
.gu-points { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.gu-points > div { background: var(--surface, rgba(255,255,255,.06)); border-radius: 18px; padding: 18px; }
.gu-points h3 { margin: 0 0 6px; font-size: 1.05rem; }
.gu-points p { margin: 0; line-height: 1.5; }
.trust-line { margin-top: 16px; font-weight: 600; }
.starting-point .row { flex-wrap: wrap; }
.placement { max-width: 560px; margin: 0 auto; }

/* School-meeting report: a white page on screen and on paper */
.meeting-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.meeting-controls input[type=date] { width: auto; }
.paper { background: #fff; color: #1b1838; border-radius: 12px; padding: 32px; max-width: 820px; margin: 0 auto; font-size: 14px; line-height: 1.45; }
.paper h1 { font-size: 22px; margin: 0 0 4px; color: #2D0080; }
.paper h2 { font-size: 15px; margin: 20px 0 8px; color: #2D0080; border-bottom: 2px solid #e6e3f5; padding-bottom: 4px; }
.paper-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.paper-head p { margin: 0; }
.paper-brand { text-align: right; font-weight: 700; color: #6B21E8; }
.paper-brand span { font-weight: 400; color: #5d5a78; font-size: 12px; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.paper .pstat { background: #fff; border: 1px solid #e6e3f5; border-radius: 8px; padding: 8px 10px; }
.paper .pstat strong { display: block; font-size: 20px; color: #2D0080; }
.paper .pstat span { font-size: 12px; color: #5d5a78; }
.paper-table { width: 100%; border-collapse: collapse; }
.paper-table th, .paper-table td { text-align: left; vertical-align: top; padding: 6px 8px; border-bottom: 1px solid #e6e3f5; }
.paper-table thead th { font-size: 12px; color: #5d5a78; font-weight: 600; }
.paper .small { font-size: 12px; }
.focus-tag { margin-left: 6px; font-size: 11px; background: #e8f0ff; color: #0047b8; border-radius: 999px; padding: 1px 7px; }
.status { font-size: 12px; font-weight: 600; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.s-strong { background: #e3f7ea; color: #13642f; }
.s-building { background: #fff4d6; color: #7a5200; }
.s-needs { background: #fde6ee; color: #8f0b44; }
.s-not { background: #eeedf5; color: #5d5a78; }
.notes .lines span { display: block; border-bottom: 1px solid #cfcbe6; height: 26px; }
.paper-foot { margin-top: 20px; font-size: 11px; color: #5d5a78; }
@media (max-width: 640px) {
  .paper { padding: 18px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .paper-table { font-size: 12px; }
  .paper-head { flex-direction: column; }
  .paper-brand { text-align: left; }
}
@media print {
  .no-print, .meeting-cta { display: none !important; }
  .paper { padding: 0; max-width: none; border-radius: 0; font-size: 11.5px; }
  .paper h2 { break-after: avoid; }
  .paper-table tr { break-inside: avoid; }
  @page { margin: 14mm; }
}
