:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #faf9f6;
  --ink: #1c2230;
  --muted: #555e6e;
  --line: #e2ded4;
  --accent: #2b59c3;
  --accent-ink: #ffffff;
  --accent-soft: #e8eefb;
  --good: #176b45;
  --good-soft: #e3f3ea;
  --bad: #a8321f;
  --bad-soft: #fbe9e6;
  --warn: #7f5608;
  --warn-soft: #fbf1dc;
  --shadow: 0 1px 2px rgba(20, 24, 33, .06), 0 4px 16px rgba(20, 24, 33, .05);
  --radius: 14px;
  --read: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --read-scale: 1;
  --on-good: #ffffff; --on-bad: #ffffff;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11141a; --surface: #1a1f28; --surface-2: #161a22; --ink: #e7eaf0; --muted: #a2abba;
    --line: #2a313d; --accent: #7ea3ff; --accent-ink: #0d1220; --accent-soft: #1e2a46;
    --good: #6fd3a3; --good-soft: #15302a; --bad: #ff9a8b; --bad-soft: #3a1d1b;
    --warn: #f0c46d; --warn-soft: #33290f; --shadow: 0 1px 2px rgba(0,0,0,.3);
    --on-good: #0d1f17; --on-bad: #2a0c09;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.bad-text { color: var(--bad); }
.grow { flex: 1; }
.center { text-align: center; }
mark { background: color-mix(in srgb, #ffd54a 55%, transparent); color: inherit; padding: 0 .1em; border-radius: 3px; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1080px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.brand { font-weight: 700; display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: .8rem; font-weight: 800; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; font-size: .92rem; }
.nav a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
main { max-width: 1080px; margin: 0 auto; padding: 20px 16px 110px; }
.tabbar { display: none; }
.score-strip { display: none; }
@media (max-width: 720px) {
  .nav { display: none; }
  .tabbar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface);
    border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; padding: 4px 0; }
  .tabbar a .ic { display: block; font-size: 1.15rem; line-height: 1.2; }
  .tabbar a.on { color: var(--accent); font-weight: 600; }
  main { padding-top: 14px; }
  h1 { font-size: 1.35rem; }
  .score-strip { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 12px; font-size: .9rem; }
  .score-strip strong { font-size: 1.1rem; }
}
body.in-session .tabbar, body.in-session .nav { display: none; }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card + .card, .stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1.15fr 1fr; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
details > summary { cursor: pointer; }
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.fold > summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); }
details.fold[open] > summary::after { content: "\2212"; }
details.fold > summary h2 { margin: 0; }
details.fold[open] > summary { margin-bottom: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line);
  background: var(--surface); padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600;
  text-decoration: none; color: var(--ink); min-height: 44px;
}
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.big { padding: 13px 22px; font-size: 1.05rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small-btn { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn.tiny-btn { min-height: 32px; padding: 4px 8px; font-size: .78rem; }
.btn.flag-on { color: var(--warn); }
.linkish { background: none; border: 0; padding: 6px 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------- forms ---------- */
label.field, div.field { display: block; margin-bottom: 14px; }
label.field > span, div.field > span { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
input[type=text], input[type=number], input[type=date], input[type=password], select {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; min-height: 44px;
}
input[type=file] { font: inherit; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
input:focus, select:focus, .btn:focus-visible, .choice:focus-visible, .linkish:focus-visible, summary:focus-visible, .skill-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.pair { display: grid; grid-template-columns: 1fr 70px auto 70px; align-items: center; gap: 8px; margin-bottom: 8px; font-size: .9rem; }
.pair input { min-height: 38px; padding: 6px 8px; }
@media (max-width: 420px) { .pair { grid-template-columns: 1fr 58px auto 58px; } }

/* ---------- coach voice ---------- */
.coach-line { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.coach-line .avatar { flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: .62rem; font-weight: 800; margin-top: 3px; }
.coach-line p { margin: 0; }
.coach-says { font-family: var(--read); font-size: 1.04rem; line-height: 1.55; }

/* ---------- coach dashboard ---------- */
.score-big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.score-sub { color: var(--muted); font-size: .9rem; }
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.bar.good > i { background: var(--good); } .bar.low > i { background: color-mix(in srgb, var(--warn) 80%, var(--accent)); }
.bar.neutral > i { background: color-mix(in srgb, var(--accent) 65%, var(--line)); }
.next-card { border: 1.5px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(180deg, var(--accent-soft), var(--surface) 70%); }
.next-card h2 { font-size: 1.3rem; }
.options { margin-top: 10px; }
.skill-row { display: grid; grid-template-columns: 1fr 120px auto; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); cursor: pointer; }
.skill-row:first-child, h2 + .skill-row, p + .skill-row { border-top: 0; }
.skill-row .name { font-weight: 600; }
@media (max-width: 520px) { .skill-row { grid-template-columns: 1fr 70px; } .skill-row .chips { grid-column: 1 / -1; } }
.spark { width: 100%; height: 70px; margin-top: 6px; }
.week-dots { display: flex; gap: 8px; margin: 10px 0 6px; }
.week-dots .dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 700;
  border: 1.5px solid var(--line); color: var(--muted); transition: background .3s, color .3s; }
.week-dots .dot.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.leak { padding: 10px 0; border-top: 1px solid var(--line); }
.leak:first-of-type { border-top: 0; }
.then-now { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: linear-gradient(180deg, var(--good-soft), var(--surface) 80%); }
.calib { display: grid; gap: 8px; margin-bottom: 8px; }
.calib-row { display: grid; grid-template-columns: 48px 1fr 110px; align-items: center; gap: 10px; }
.calib-level { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- session ---------- */
.session-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.session-bar .grow { min-width: 0; }
.session-bar .exit-btn { white-space: nowrap; padding-left: 8px; padding-right: 8px; }
.sess-title { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; min-width: 0; }
.sess-title strong { flex-shrink: 0; }
.sess-focus { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sess-count { margin-left: auto; flex-shrink: 0; font-variant-numeric: tabular-nums; }
button.timer { font: inherit; font-weight: 700; color: inherit; cursor: pointer; min-height: 36px; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); white-space: nowrap; }
.timer.low { color: var(--bad); border-color: var(--bad); }
.qlayout { display: grid; gap: 16px; }
.qlayout.rc { grid-template-columns: 1fr 1fr; align-items: start; }
.passage { position: sticky; top: 72px; max-height: calc(100vh - 170px); overflow: auto; }
.passage .text, .stimulus { font-family: var(--read); font-size: calc(1.06rem * var(--read-scale)); line-height: 1.65; }
.passage .text p, .stimulus p { margin: 0 0 .9rem; }
.passage h3 { font-family: var(--ui); }
.rc-tabs { display: none; }
@media (max-width: 860px) {
  .qlayout.rc { grid-template-columns: 1fr; }
  .passage { position: static; max-height: none; }
  .rc-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
  .rc-tabs .btn { flex: 1; }
  .qlayout.rc.show-q .passage { display: none; }
  .qlayout.rc.show-p .qpane { display: none; }
}
.stem { font-weight: 650; margin: 14px 0 12px; font-size: calc(1.02rem * var(--read-scale)); }
.choices { display: grid; gap: 8px; }
.choice {
  display: grid; grid-template-columns: 32px 1fr 40px; gap: 10px; align-items: start; text-align: left; width: 100%;
  padding: 12px 8px 12px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
  line-height: 1.45; font-size: calc(1rem * var(--read-scale));
}
.choice:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.choice .letter { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem;
  border: 1.5px solid var(--line); color: var(--muted); }
.choice .tag { display: inline-block; margin-left: 8px; font-family: var(--ui); font-size: .72rem; font-weight: 700; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 999px; padding: 0 8px; }
.choice.sel { border-color: var(--accent); background: var(--accent-soft); }
.choice.sel .letter { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice.struck .ctext { text-decoration: line-through; color: var(--muted); opacity: .7; }
.choice.first-pick { border-style: dashed; opacity: .75; cursor: default; }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.right .letter { background: var(--good); border-color: var(--good); color: var(--on-good); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.wrong .letter { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.choice.wrong.second { border-style: dashed; }
.strike { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; width: 36px; height: 36px; border-radius: 8px; }
.strike:hover { background: var(--surface-2); }
.choice.locked { cursor: default; }
.qnav { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.qnav button { width: 38px; height: 38px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: .85rem; }
.qnav button.done { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.qnav button.cur { outline: 2px solid var(--accent); }
.qnav button.flag { box-shadow: inset 0 -3px 0 var(--warn); }

/* sticky actions: the next step is always one thumb away */
.actionbar { position: sticky; bottom: 0; z-index: 15; margin: 16px -16px 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.actionbar-inner { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.conf { display: flex; gap: 6px; flex-wrap: wrap; }
.conf-btn { flex-direction: column; gap: 0; min-width: 76px; padding: 6px 10px; line-height: 1.15; }
.conf-btn .tiny { font-weight: 500; opacity: .85; }
@media (max-width: 520px) {
  .conf { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
  .conf-btn { min-width: 0; padding: 6px 4px; }
  .conf-label { width: 100%; }
}
/* small phones: give the answer text the width */
@media (max-width: 420px) {
  main { padding-left: 10px; padding-right: 10px; }
  .card { padding: 14px 12px; }
  .choice { grid-template-columns: 26px 1fr 30px; gap: 8px; padding: 10px 4px 10px 8px; }
  .choice .letter { width: 24px; height: 24px; font-size: .8rem; }
  .strike { width: 30px; height: 30px; }
}

.second-look { margin-top: 14px; border-radius: var(--radius); padding: 14px 16px; border: 1.5px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.feedback { margin-top: 16px; border-radius: var(--radius); padding: 16px; border: 1px solid var(--line); background: var(--surface-2); }
.feedback.ok { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); }
.feedback.no { border-left: 3px solid var(--warn); }
.verdict { font-weight: 800; font-size: 1.1rem; margin-bottom: 6px; }
.verdict.ok { color: var(--good); } .verdict.no { color: var(--ink); }
.layer { margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); padding: 12px 14px; }
details.layer > summary { list-style: none; }
details.layer > summary::-webkit-details-marker { display: none; }
details.layer > summary::before { content: "\25B8"; display: inline-block; margin-right: 6px; color: var(--muted); transition: transform .15s; }
details.layer[open] > summary::before { transform: rotate(90deg); }
details.layer[open] > summary { margin-bottom: 8px; }
.trap-card { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warn-soft); }
.trap-card .eyebrow { color: var(--warn); }
.walk { padding-left: 1.3rem; margin: 6px 0 10px; font-family: var(--read); }
.walk li { margin-bottom: 8px; }
.irl { margin-top: 6px; border-left: 3px solid var(--accent); padding: 8px 12px; background: var(--accent-soft); border-radius: 0 10px 10px 0; font-family: var(--read); }
.irl .eyebrow { color: var(--accent); font-family: var(--ui); }
.irl .maps { font-family: var(--ui); font-weight: 600; margin-top: 6px; }
.takeaway { margin-top: 10px; font-weight: 600; }
.probe { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.probe.ok { border-color: color-mix(in srgb, var(--good) 50%, var(--line)); background: var(--good-soft); }
.probe.no { border-color: color-mix(in srgb, var(--warn) 50%, var(--line)); background: var(--warn-soft); }
.probe-opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.probe-opt { flex-direction: column; align-items: flex-start; text-align: left; gap: 2px; padding: 10px 12px; }
.probe-opt .tiny { font-weight: 400; color: var(--muted); }
.reasons { margin-top: 14px; }
.nudge { margin-top: 14px; border: 1.5px dashed var(--warn); background: var(--warn-soft); border-radius: var(--radius); padding: 12px 14px; }
.nudge > summary { list-style: none; }
.nudge > summary .eyebrow { color: var(--warn); }
.notes-list .coach-line + .coach-line { margin-top: 10px; }
.headline { font-family: var(--read); font-size: 1.25rem; font-weight: 700; }
.rough .headline { font-weight: 600; }
details.qreview { border-top: 1px solid var(--line); padding: 10px 0; }
details.qreview > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; list-style: none; }
details.qreview > summary::-webkit-details-marker { display: none; }
details.qreview[open] > summary { margin-bottom: 10px; }
.mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.mark.ok { background: var(--good-soft); color: var(--good); } .mark.no { background: var(--bad-soft); color: var(--bad); }
.note-line { font-size: .92rem; margin: 4px 0; }

/* ---------- moments: celebrations the data earned ---------- */
.moment { border: 1.5px solid color-mix(in srgb, var(--good) 55%, var(--line)); background: linear-gradient(180deg, var(--good-soft), var(--surface) 75%); }
.moment .eyebrow { color: var(--good); }
.moment.target h2 { font-size: 1.5rem; }

/* ---------- lessons ---------- */
.lesson h1 { font-family: var(--read); font-size: 1.9rem; }
.lesson .summary { font-family: var(--read); font-size: 1.15rem; color: var(--muted); }
.lesson ol.method { padding-left: 1.25rem; } .lesson ol.method li { margin-bottom: 8px; }
.example { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--surface-2); margin-top: 10px; }
.example .title { font-weight: 700; margin-bottom: 4px; }
.example .scenario { font-family: var(--read); }
.example .maps { margin-top: 6px; color: var(--accent); font-weight: 600; font-size: .95rem; }
.kv dt { font-weight: 700; margin-top: 10px; } .kv dd { margin: 2px 0 0; color: var(--muted); }
.signals { display: flex; flex-wrap: wrap; gap: 6px; }
.lesson-list a { display: block; text-decoration: none; color: inherit; padding: 12px 0; border-top: 1px solid var(--line); }
.lesson-list a:first-child { border-top: 0; }

.center-screen { min-height: 70vh; display: grid; place-items: center; }
.welcome { max-width: 520px; width: 100%; }
.toast { position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; z-index: 50; max-width: calc(100% - 32px); }
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 14, 22, .45); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal { max-width: 460px; width: 100%; }

/* ---------- motion, only when wanted ---------- */
@media (prefers-reduced-motion: no-preference) {
  .bar > i { transition: width .7s cubic-bezier(.2, .8, .2, 1); }
  .choice.right .letter { animation: pop .28s ease-out 1; }
  .choice.right { animation: ring .6s ease-out 1; }
  .moment { animation: rise .4s ease-out both; }
  .second-look, .feedback, .probe { animation: rise .25s ease-out both; }
  .spark polyline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1s ease-out .1s forwards; }
  .spark circle.newest { animation: pulse 1.4s ease-out 1; transform-origin: center; transform-box: fill-box; }
}
@keyframes pop { 50% { transform: scale(1.15); } }
@keyframes ring {
  from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 45%, transparent); }
  to { box-shadow: 0 0 0 8px transparent; }
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pulse { 0% { transform: scale(1); } 40% { transform: scale(1.6); } 100% { transform: scale(1); } }

/* ---------- highlight and underline, as on the LawHub test ---------- */
.stimulus p, .passage .text p, .stem p { -webkit-user-select: text; user-select: text; }
.stem p { margin: 0; }
span.hl, mark.hl { background: color-mix(in srgb, #8fd0ff 55%, transparent); border-radius: 2px; }
.ul { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; text-decoration-color: var(--accent); }
.markbar { position: fixed; z-index: 70; display: flex; gap: 6px; padding: 6px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow); }
.qnav-sep { width: 100%; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ---------- phone sign-in codes ---------- */
.qr-box { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.qr-box:empty { display: none; }
.qr { margin: 6px 0; text-align: center; }
.qr svg { width: 190px; height: 190px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
.qr figcaption { margin-top: 4px; color: var(--muted); }

/* ---------- color themes (generated by a script; contrast checked for every palette) ---------- */
:root[data-theme="goth"] {
  --bg: #110b11; --surface: #1c131c; --surface-2: #170f17; --ink: #f7eaf2; --muted: #c9adc0;
  --line: #3b2737; --accent: #ff5ca8; --accent-ink: #1b0612; --accent-soft: #3b1631; --accent-2: #c79bff;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ff8fa3; --bad-soft: #3d1622; --warn: #f5c76e; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(255, 92, 168, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(255, 92, 168, 0.1); --glow-2: rgba(199, 155, 255, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #ff5ca8 25%, #f7eaf2) 0%, #ff5ca8 55%, #c79bff 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="crimson"] {
  --bg: #100a0b; --surface: #1b1214; --surface-2: #160e10; --ink: #f6e8ea; --muted: #c7a9ae;
  --line: #3a2529; --accent: #ff5468; --accent-ink: #1d0509; --accent-soft: #3d1419; --accent-2: #ff9a62;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ffa06e; --bad-soft: #3a2210; --warn: #f5c76e; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(255, 84, 104, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(255, 84, 104, 0.1); --glow-2: rgba(255, 154, 98, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #ff5468 25%, #f6e8ea) 0%, #ff5468 55%, #ff9a62 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="violet"] {
  --bg: #0e0b14; --surface: #18131f; --surface-2: #130f19; --ink: #efe9f7; --muted: #b9abcc;
  --line: #2f2640; --accent: #b48cff; --accent-ink: #140a26; --accent-soft: #2b1f45; --accent-2: #ff8fd1;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ff8fa3; --bad-soft: #3d1622; --warn: #f5c76e; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(180, 140, 255, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(180, 140, 255, 0.1); --glow-2: rgba(255, 143, 209, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #b48cff 25%, #efe9f7) 0%, #b48cff 55%, #ff8fd1 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="emerald"] {
  --bg: #0a100d; --surface: #121a16; --surface-2: #0e1612; --ink: #e7f3ec; --muted: #a6c2b3;
  --line: #22342b; --accent: #3ddc97; --accent-ink: #04150d; --accent-soft: #133325; --accent-2: #9be7ff;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ff8fa3; --bad-soft: #3d1622; --warn: #f5c76e; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(61, 220, 151, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(61, 220, 151, 0.1); --glow-2: rgba(155, 231, 255, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #3ddc97 25%, #e7f3ec) 0%, #3ddc97 55%, #9be7ff 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="ocean"] {
  --bg: #0a0f13; --surface: #111a20; --surface-2: #0d151a; --ink: #e6f1f6; --muted: #a3bcc9;
  --line: #213440; --accent: #4fc8e8; --accent-ink: #04141b; --accent-soft: #12303c; --accent-2: #9aa5ff;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ff8fa3; --bad-soft: #3d1622; --warn: #f5c76e; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(79, 200, 232, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(79, 200, 232, 0.1); --glow-2: rgba(154, 165, 255, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #4fc8e8 25%, #e6f1f6) 0%, #4fc8e8 55%, #9aa5ff 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="gold"] {
  --bg: #0f0d09; --surface: #1a1610; --surface-2: #15120c; --ink: #f5eedf; --muted: #c6b796;
  --line: #362e1f; --accent: #e9b949; --accent-ink: #1a1203; --accent-soft: #3a2d10; --accent-2: #ff8a5c;
  --good: #86e2b6; --good-soft: #12291f; --bad: #ff8fa3; --bad-soft: #3d1622; --warn: #ffd27a; --warn-soft: #34270f;
  --on-good: #0b1f15; --on-bad: #2a0710;
  --shadow: inset 0 1px 0 rgba(233, 185, 73, .10), 0 8px 28px rgba(0, 0, 0, .45);
  --glow-1: rgba(233, 185, 73, 0.1); --glow-2: rgba(255, 138, 92, 0.1);
  --title: linear-gradient(95deg, color-mix(in srgb, #e9b949 25%, #f5eedf) 0%, #e9b949 55%, #ff8a5c 100%); --web-alpha: .16;
  color-scheme: dark;
}
:root[data-theme="goth-light"] {
  --bg: #fbeff5; --surface: #fffafd; --surface-2: #fdf4f9; --ink: #1a0f17; --muted: #6b4f62;
  --line: #efd3e2; --accent: #c2185b; --accent-ink: #ffffff; --accent-soft: #fbe0ee; --accent-2: #6d35b8;
  --good: #17694a; --good-soft: #e2f4ea; --bad: #a3203a; --bad-soft: #fbe4ea; --warn: #7d5507; --warn-soft: #fbf0d9;
  --on-good: #ffffff; --on-bad: #ffffff;
  --shadow: 0 1px 2px rgba(40, 20, 50, .06), 0 6px 20px rgba(40, 20, 60, .07);
  --glow-1: rgba(194, 24, 91, 0.07); --glow-2: rgba(109, 53, 184, 0.07);
  --title: linear-gradient(95deg, #1a0f17 0%, #1a0f17 45%, #c2185b 100%); --web-alpha: .12;
  color-scheme: light;
}
:root[data-theme="lavender"] {
  --bg: #f5f0fb; --surface: #fdfbff; --surface-2: #f9f5fe; --ink: #1b1426; --muted: #5f5274;
  --line: #e3d8f2; --accent: #6d35b8; --accent-ink: #ffffff; --accent-soft: #ece2fa; --accent-2: #c2185b;
  --good: #17694a; --good-soft: #e2f4ea; --bad: #a3203a; --bad-soft: #fbe4ea; --warn: #7d5507; --warn-soft: #fbf0d9;
  --on-good: #ffffff; --on-bad: #ffffff;
  --shadow: 0 1px 2px rgba(40, 20, 50, .06), 0 6px 20px rgba(40, 20, 60, .07);
  --glow-1: rgba(109, 53, 184, 0.07); --glow-2: rgba(194, 24, 91, 0.07);
  --title: linear-gradient(95deg, #1b1426 0%, #1b1426 45%, #6d35b8 100%); --web-alpha: .12;
  color-scheme: light;
}
:root[data-theme="mint"] {
  --bg: #edf7f2; --surface: #fbfefc; --surface-2: #f4fbf7; --ink: #0f1f18; --muted: #4d6559;
  --line: #d3e8dd; --accent: #0f7350; --accent-ink: #ffffff; --accent-soft: #dcf2e7; --accent-2: #2b6cb0;
  --good: #17694a; --good-soft: #e2f4ea; --bad: #a3203a; --bad-soft: #fbe4ea; --warn: #7d5507; --warn-soft: #fbf0d9;
  --on-good: #ffffff; --on-bad: #ffffff;
  --shadow: 0 1px 2px rgba(40, 20, 50, .06), 0 6px 20px rgba(40, 20, 60, .07);
  --glow-1: rgba(15, 115, 80, 0.07); --glow-2: rgba(43, 108, 176, 0.07);
  --title: linear-gradient(95deg, #0f1f18 0%, #0f1f18 45%, #0f7350 100%); --web-alpha: .12;
  color-scheme: light;
}
:root[data-theme]:not([data-theme="classic"]) body {
  background: radial-gradient(900px 500px at 0% 0%, var(--glow-1), transparent 70%),
    radial-gradient(800px 600px at 100% 100%, var(--glow-2), transparent 70%), var(--bg);
  background-attachment: fixed; min-height: 100vh;
}
:root[data-theme]:not([data-theme="classic"]) .btn.primary {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, white), color-mix(in srgb, var(--accent) 88%, black));
  border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 25%, transparent), 0 4px 16px color-mix(in srgb, var(--accent) 22%, transparent);
}
:root[data-theme]:not([data-theme="classic"]) .card { border-top-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
:root[data-theme]:not([data-theme="classic"]) ::selection { background: color-mix(in srgb, var(--accent) 40%, transparent); }
:root[data-theme]:not([data-theme="classic"]) mark { background: color-mix(in srgb, var(--accent) 32%, transparent); }
:root[data-theme]:not([data-theme="classic"]) .topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); }

/* ---------- gothic touches: a switch, separate from the colors ---------- */
:root[data-deco="on"] {
  --display: "Palatino Linotype", "Book Antiqua", Palatino, "Iowan Old Style", Georgia, serif;
  --web: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 260 260%22%3E%3Cpath d=%22M260,0L260.0,256.0M260,0L193.7,247.3M260,0L132.0,221.7M260,0L79.0,181.0M260,0L38.3,128.0M260,0L12.7,66.3M260,0L4.0,0.0M260.0,34.0Q256.0,30.3 251.2,32.8M251.2,32.8Q248.3,28.3 243.0,29.4M243.0,29.4Q241.4,24.3 236.0,24.0M236.0,24.0Q235.7,18.6 230.6,17.0M230.6,17.0Q231.7,11.7 227.2,8.8M227.2,8.8Q229.7,4.0 226.0,0.0M260.0,70.0Q251.8,62.5 241.9,67.6M241.9,67.6Q235.9,58.2 225.0,60.6M225.0,60.6Q221.6,50.0 210.5,49.5M210.5,49.5Q210.0,38.4 199.4,35.0M199.4,35.0Q201.8,24.1 192.4,18.1M192.4,18.1Q197.5,8.2 190.0,0.0M260.0,108.0Q247.3,96.4 232.0,104.3M232.0,104.3Q222.8,89.8 206.0,93.5M206.0,93.5Q200.8,77.1 183.6,76.4M183.6,76.4Q182.9,59.2 166.5,54.0M166.5,54.0Q170.2,37.2 155.7,28.0M155.7,28.0Q163.6,12.7 152.0,0.0M260.0,148.0Q242.6,132.1 221.7,143.0M221.7,143.0Q209.0,123.1 186.0,128.2M186.0,128.2Q178.9,105.7 155.3,104.7M155.3,104.7Q154.3,81.1 131.8,74.0M131.8,74.0Q136.9,51.0 117.0,38.3M117.0,38.3Q127.9,17.4 112.0,0.0M260.0,190.0Q237.7,169.5 210.8,183.5M210.8,183.5Q194.6,158.0 165.0,164.5M165.0,164.5Q155.9,135.7 125.6,134.4M125.6,134.4Q124.3,104.1 95.5,95.0M95.5,95.0Q102.0,65.4 76.5,49.2M76.5,49.2Q90.5,22.3 70.0,0.0M260.0,236.0Q232.3,210.6 198.9,228.0M198.9,228.0Q178.7,196.2 142.0,204.4M142.0,204.4Q130.7,168.5 93.1,166.9M93.1,166.9Q91.5,129.3 55.6,118.0M55.6,118.0Q63.8,81.3 32.0,61.1M32.0,61.1Q49.4,27.7 24.0,0.0%22 fill=%22none%22 stroke=%22%23000%22 stroke-width=%221.1%22 stroke-linecap=%22round%22/%3E%3C/svg%3E"); --bat: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 24 12%22%3E%3Cpath d=%22M12 3.2c-.8 0-1.3.8-1.3.8L10.1 2l-.5 2.1C8 4.1 6.4 3 5 1c.4 3-1.2 4.6-4 4.6 2 1 3 2.6 3 4.4 1.5-1.5 3.6-1.5 5 0 .8-1.4 2-2 3-.4 1-1.6 2.2-1 3 .4 1.4-1.5 3.5-1.5 5 0 0-1.8 1-3.4 3-4.4-2.8 0-4.4-1.6-4-4.6-1.4 2-3 3.1-4.6 3.1L13.9 2l-.6 2s-.5-.8-1.3-.8z%22 fill=%22%23000%22/%3E%3C/svg%3E");
}
[data-deco="on"] body::before {
  content: ""; position: absolute; top: 58px; right: 0; width: min(300px, 60vw); aspect-ratio: 1; z-index: -1;
  pointer-events: none; background: var(--accent); opacity: var(--web-alpha, .14);
  -webkit-mask: var(--web) no-repeat top right / contain; mask: var(--web) no-repeat top right / contain;
}
[data-deco="on"] h1, [data-deco="on"] h2 { font-family: var(--display); letter-spacing: .01em; }
[data-deco="on"]:not([data-theme="classic"]) h1 { background: var(--title); -webkit-background-clip: text; background-clip: text; color: transparent; }
[data-deco="on"] .brand { font-family: var(--display); letter-spacing: .02em; }
[data-deco="on"] .brand::after { content: ""; width: 22px; height: 11px; background: var(--accent); opacity: .9;
  -webkit-mask: var(--bat) center / contain no-repeat; mask: var(--bat) center / contain no-repeat; }
[data-deco="on"] .brand-mark { background: var(--surface); color: var(--accent); border: 1px solid var(--accent);
  font-family: var(--display); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); }
[data-deco="on"] .nav a.on, [data-deco="on"] .tabbar a.on { text-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.theme-grid .btn { justify-content: flex-start; gap: 8px; }
.swatch { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex: none; border: 1px solid rgba(127,127,127,.45); }

/* ---------- the coach's sense of humor ---------- */
.quip { font-style: italic; color: var(--muted); margin: 4px 0 0; }
.pron-row .btn, .look-step .theme-grid .btn { min-height: 38px; }

/* ---------- reading help (practice only) ---------- */
.read-help { gap: 6px; margin-top: 8px; }
.read-help .btn.on { color: var(--accent); background: var(--accent-soft); }
.tip-box { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: .92rem; }
.tip-box p { margin: 0 0 .4rem; } .tip-box p:last-child { margin: 0; }
.sig-c { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; font-weight: 600; }
.sig-p { text-decoration: underline dotted; text-decoration-color: var(--good); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.sig-t { background: var(--warn-soft); color: var(--warn); border-radius: 3px; padding: 0 2px; font-weight: 600; }
.sig-v { font-style: italic; text-decoration: underline dashed; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.sig-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; color: var(--muted); }
.time-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.time-row:first-of-type { border-top: 0; }

/* ---------- mini games ---------- */
.game-hud { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.game-hud .stat { font-variant-numeric: tabular-nums; font-weight: 700; }
.game-prompt { font-family: var(--read); font-size: calc(1.15rem * var(--read-scale)); line-height: 1.55; min-height: 4.5em; }
.game-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (max-width: 520px) { .game-opts { grid-template-columns: 1fr; } }
.game-opts .btn { justify-content: flex-start; text-align: left; min-height: 52px; white-space: normal; }
.game-opts .btn .k { opacity: .6; font-size: .8rem; margin-right: 6px; }
.game-opts .btn.right { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.game-opts .btn.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.sig-target { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 3px; font-weight: 700; }
.wrong-choice { border-left: 3px solid var(--bad); padding: 6px 10px; background: var(--bad-soft); border-radius: 6px; margin: 10px 0; }
.time-bar { height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.time-bar > span { display: block; height: 100%; background: var(--accent); transition: width .2s linear; }

/* ---------- tour ---------- */
.tour ul { margin: 0 0 .75rem; padding-left: 1.2rem; }
.tour li + li { margin-top: 6px; }
.tour-dots { display: flex; gap: 6px; justify-content: center; margin: 4px 0 2px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.tour-dots span.on { background: var(--accent); }
