/* Student web app styles. Served at /student/app.css; edited directly, no build step. */

/* Blueprint design system — technical/architectural identity, light + dark.
   Components read these tokens, so the whole app reskins from here. */
:root {
  --bg: #f5f8fc; --panel: #ffffff; --panel-2: #eef3fa; --ink: #0f2038; --muted: #5a6b84;
  --line: #d7e1ef; --line-strong: #c2d0e4;
  --accent: #1f5fd6; --accent-bg: #e7effb;
  --good: #0f7a5c; --bad: #c1352e; --warn: #b26a1e;
  --good-bg: #e3f4ee; --bad-bg: #fbe9e7; --warn-bg: #f6ecda;
  --hover: #eef3fb; --track: #dbe4f0;
  --grid: rgba(31,95,214,.05); --grid-major: rgba(31,95,214,.09);
  --shadow: 0 1px 2px rgba(16,32,56,.06), 0 8px 24px rgba(16,32,56,.06);
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --f-display: "Funnel Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-body: "Funnel Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --f-mono: var(--mono);
  --ease: cubic-bezier(.2,.7,.2,1);
  --ring: color-mix(in srgb, var(--accent) 22%, transparent);
  --on-accent: #fff;   /* text on an accent fill */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1524; --panel: #101d31; --panel-2: #16243a; --ink: #e7eefb; --muted: #93a4c2;
    --line: #22324c; --line-strong: #2c3f5e;
    --accent: #5c93ff; --accent-bg: #16273f;
    --good: #3fce9f; --bad: #ff6f66; --warn: #e0a55e;
    --good-bg: #0f2a24; --bad-bg: #2c1614; --warn-bg: #2a2113;
    --hover: #16243a; --track: #22324c;
    --grid: rgba(120,160,255,.06); --grid-major: rgba(120,160,255,.10);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
    --on-accent: #071730;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1524; --panel: #101d31; --panel-2: #16243a; --ink: #e7eefb; --muted: #93a4c2;
  --line: #22324c; --line-strong: #2c3f5e;
  --accent: #5c93ff; --accent-bg: #16273f;
  --good: #3fce9f; --bad: #ff6f66; --warn: #e0a55e;
  --good-bg: #0f2a24; --bad-bg: #2c1614; --warn-bg: #2a2113;
  --hover: #16243a; --track: #22324c;
  --grid: rgba(120,160,255,.06); --grid-major: rgba(120,160,255,.10);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.45);
  --on-accent: #071730;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --on-accent: #fff;
  --bg: #f5f8fc; --panel: #ffffff; --panel-2: #eef3fa; --ink: #0f2038; --muted: #5a6b84;
  --line: #d7e1ef; --line-strong: #c2d0e4;
  --accent: #1f5fd6; --accent-bg: #e7effb;
  --good: #0f7a5c; --bad: #c1352e; --warn: #b26a1e;
  --good-bg: #e3f4ee; --bad-bg: #fbe9e7; --warn-bg: #f6ecda;
  --hover: #eef3fb; --track: #dbe4f0;
  --grid: rgba(31,95,214,.05); --grid-major: rgba(31,95,214,.09);
  --shadow: 0 1px 2px rgba(16,32,56,.06), 0 8px 24px rgba(16,32,56,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 var(--f-body); background: var(--bg); color: var(--ink);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 26px 26px, 26px 26px, 130px 130px, 130px 130px;
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
header { display: flex; align-items: center; gap: 8px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
header h1 { font: 650 17px/1 var(--f-display); letter-spacing: -.01em; margin: 0 12px 0 0; }
header .brand { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; color: inherit; font: inherit; border-radius: 8px; }
header .brand:hover h1 { color: var(--accent); }
header .me-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 99px; background: var(--panel); color: var(--ink); cursor: pointer; padding: 0; }
header .me-btn svg { width: 22px; height: 22px; }
header .me-btn:hover, header .me-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-bg); }
header .brand-mark g { fill: var(--accent); }
/* headings + big numbers use the display face; body text stays in Funnel Sans */
h1, h2, h3, .stat b, .diag-hero .band { font-family: var(--f-display); }
h2 { letter-spacing: -.015em; }
.brand-mark { width: 24px; height: 24px; flex: none; display: block; }
.brand-mark-lg { width: 56px; height: 56px; margin: 0 auto 14px; }
nav button { background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--muted); }
nav button.active { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
header .spacer { flex: 1; }
header .who { color: var(--muted); font-size: 13px; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { padding: 20px 16px 60px; max-width: 860px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 12px; font-size: 18px; font-weight: 650; }
h3 { font-size: 13px; margin: 16px 0 6px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
tr.link { cursor: pointer; }
tr.link:hover { background: var(--hover); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--muted); }
.good { color: var(--good); } .bad { color: var(--bad); } .warn { color: var(--warn); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--track); color: var(--muted); }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.bar { height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; min-width: 70px; position: relative; }
.bar i { display: block; height: 100%; float: left; }
.bar .c { background: var(--good); } .bar .m { background: var(--bad); }
.acc-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.abar { flex: 1; height: 6px; background: var(--track); border-radius: 3px; overflow: hidden; min-width: 50px; }
.abar i { display: block; height: 100%; }
.abar i.good { background: var(--good); } .abar i.warn { background: var(--warn); } .abar i.bad { background: var(--bad); } .abar i.muted { background: var(--line-strong); }
/* Collapsible domain → skill → subskill performance tree. */
.perf-overall { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin: 4px 0 16px; }
.perf-overall-bar { flex: 1 1 220px; min-width: 0; }
.perf-overall-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.perf-overall-head b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.perf-overall-head b.good { color: var(--good); } .perf-overall-head b.warn { color: var(--warn); } .perf-overall-head b.bad { color: var(--bad); }
.perf-overall .abar { height: 10px; border-radius: 5px; }
.perf-overall-stats { display: flex; gap: 18px; }
.perf-tree { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 8px; }
.perf-item { border-top: 1px solid var(--line); }
.perf-tree > .perf-item:first-child { border-top: none; }
details.perf-item > summary, .perf-leaf { display: flex; align-items: center; gap: 8px; padding: 9px 12px; }
details.perf-item > summary { cursor: pointer; list-style: none; }
details.perf-item > summary::-webkit-details-marker { display: none; }
details.perf-item > summary::before { content: "▸"; color: var(--muted); font-size: 11px; width: 9px; flex: none; }
details.perf-item[open] > summary::before { content: "▾"; }
details.perf-item > summary:hover { background: var(--hover); }
/* Per-section performance block with a Domain/Rule/Difficulty segmented selector.
   Tabs are CSS-only: hidden radios drive which panel and which label are active. */
.perf-sec { margin-top: 20px; }
.perf-sec > input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.perf-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.perf-sec-head h3 { margin: 0; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg label { padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--muted); cursor: pointer; user-select: none; }
.seg label + label { border-left: 1px solid var(--line); }
.seg label:hover { background: var(--hover); }
.perf-panel { display: none; }
.perf-sec > .tab-domain:checked ~ .perf-panels .p-domain,
.perf-sec > .tab-rule:checked ~ .perf-panels .p-rule,
.perf-sec > .tab-diff:checked ~ .perf-panels .p-diff { display: block; }
.perf-sec > .tab-domain:checked ~ .perf-sec-head label[for$="-domain"],
.perf-sec > .tab-rule:checked ~ .perf-sec-head label[for$="-rule"],
.perf-sec > .tab-diff:checked ~ .perf-sec-head label[for$="-diff"] { background: var(--accent); color: var(--on-accent); }
.perf-sec > input:focus-visible ~ .perf-sec-head .seg { outline: 2px solid var(--accent); outline-offset: 2px; }
.perf-name { flex: 1; min-width: 0; font-size: 14px; }
.perf-item .perf-name { overflow: hidden; text-overflow: ellipsis; }
.perf-nums { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; white-space: nowrap; }
button, .btn { font: inherit; font-weight: 550; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--panel); cursor: pointer; color: var(--ink); text-decoration: none; -webkit-tap-highlight-color: transparent; transition: transform .14s var(--ease), border-color .2s, background-color .2s, box-shadow .25s var(--ease); }
button:hover:not(:disabled) { border-color: var(--accent); }
button:active:not(:disabled) { transform: scale(.98); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
button.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 650; box-shadow: 0 6px 16px -8px var(--accent); }
button.primary:hover:not(:disabled) { box-shadow: 0 2px 4px rgba(16,32,56,.08), 0 12px 26px color-mix(in srgb, var(--accent) 30%, transparent); }
button.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
button:disabled { opacity: .5; cursor: default; }
/* :where() keeps these at element specificity so component rules (e.g. .au-field input) win */
:where(input:not([type=radio],[type=checkbox]), select, textarea) { font: inherit; padding: 11px 13px; border: 1px solid var(--line-strong); border-radius: 12px; background-color: var(--panel); color: var(--ink); transition: border-color .2s, box-shadow .25s var(--ease); }
:where(input:not([type=radio],[type=checkbox]), select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
:where(select) { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%237d8ca6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
label { display: block; font-size: 12px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
.error { color: var(--bad); margin: 8px 0; min-height: 1em; }
.stat { display: inline-block; margin: 0 24px 8px 0; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; }
.lb-row { display: grid; grid-template-columns: 28px 1fr auto auto auto; gap: 10px; align-items: center; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: 0; }
.lb-row.me { background: var(--accent-bg); border-radius: 8px; border-bottom-color: transparent; }
.lb-rank { color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; font-weight: 700; }
.lb-row.me .lb-rank { color: var(--accent); }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-streak, .lb-acc { font-size: 13px; white-space: nowrap; }
.lb-xp { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, 94vw); background: var(--panel); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(8,16,30,.45); }
dialog[open] { animation: sheet-in .28s var(--ease); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(16px); } }
/* confirm sheet: centered card on desktop, bottom sheet on phones */
#confirm-dialog .inner { display: grid; gap: 6px; padding: 22px 22px 18px; }
#confirm-dialog h2 { margin: 0; font-size: 19px; font-weight: 650; }
#confirm-dialog p { margin: 0; color: var(--muted); }
#confirm-dialog .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
#confirm-dialog button.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 650; }
@media (max-width: 560px) {
  #confirm-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #confirm-dialog .actions { flex-direction: column-reverse; }
  #confirm-dialog .actions button { width: 100%; padding: 14px; }
}
/* toast: short status/error messages, bottom-center, clear of the mobile tab bar */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); font-size: 14.5px; box-shadow: var(--shadow); animation: toast-in .3s var(--ease); }
.toast.error { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 820px) { #toasts { bottom: calc(76px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) {
  dialog[open], .toast { animation: none; }
  button, :where(input, select, textarea) { transition: none; }
  button:active:not(:disabled) { transform: none; }
}
dialog .inner { padding: 20px; }
.wrap { overflow-x: auto; }

/* SAT scores */
#score-dialog { width: min(580px, 95vw); }
#score-dialog .inner { max-height: 90vh; overflow: auto; }
.kind-pill { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--track); color: var(--muted); }
.kind-pill.official { background: var(--accent-bg); color: var(--accent); }
.bd-head, .bd-row { display: grid; grid-template-columns: 1fr 84px 84px 26px; gap: 8px; align-items: center; }
.bd-head { font-size: 11px; color: var(--muted); font-weight: 600; margin: 8px 0 4px; }
.bd-row { margin-bottom: 6px; }
.bd-row input, .bd-row select { width: 100%; }
.bd-row .rm { border: 0; background: none; color: var(--bad); cursor: pointer; font-size: 18px; padding: 0; }
#score-chart svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); margin-top: 6px; }
.chart-legend b { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.bd-list { margin: 2px 0 0; padding-left: 0; list-style: none; font-size: 12px; color: var(--muted); }

/* ---------- public screens: landing + sign in / create account (body.bp) ----------
   Own type for the logged-out funnel: Funnel Display (headlines), Funnel Sans (text),
   Geist Mono (small labels). Motion is deliberately restrained: one staggered .pub-rise
   entrance (CSS animations restart whenever a view goes display:none → shown, so this
   replays on every visit to the view), the sample-report count-up + bar fill, and
   press/hover feedback on buttons. All of it is off under prefers-reduced-motion. */
body.bp { font-size: 16px; }
body.bp main { max-width: 1040px; padding: 0 20px 40px; }
.pub-rise { animation: pub-rise .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + 60ms); }
@keyframes pub-rise { from { opacity: 0; transform: translateY(12px); } }

.pub-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 0 0; }
.pub-brand { display: inline-flex; align-items: center; gap: 8px; font: 650 18px/1 var(--f-display); letter-spacing: -.01em; color: var(--ink); }
.pub-brand .brand-mark { width: 28px; height: 28px; }
.pub-brand .brand-mark g { fill: var(--accent); }
.pub-link { background: none; border: 0; padding: 8px 4px; border-radius: 6px; font: 600 15px var(--f-body); color: var(--accent); cursor: pointer; text-decoration: none; }
.pub-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.pub-back { width: 40px; height: 40px; margin-left: -10px; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--ink); display: grid; place-items: center; }
.pub-back:hover { background: var(--panel-2); }
.pub-back svg { width: 22px; height: 22px; }
.pub-link:focus-visible, .pub-back:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pub-btn { position: relative; width: 100%; height: 54px; padding: 0 18px; border-radius: 14px; font: 650 16.5px var(--f-body); letter-spacing: -.005em; display: inline-flex; align-items: center; justify-content: center; gap: 8px; -webkit-tap-highlight-color: transparent; transition: transform .14s var(--ease), box-shadow .25s var(--ease), background-color .2s, border-color .2s; }
.pub-btn:active:not(:disabled) { transform: scale(.975); }
.pub-btn:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--ring); }
.pub-btn svg { width: 18px; height: 18px; flex: none; }
.pub-btn-primary { border: 0; background: var(--accent); color: var(--on-accent); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 6px 16px -6px var(--accent); }
.pub-btn-primary:hover { box-shadow: 0 2px 4px rgba(16,32,56,.08), 0 14px 32px color-mix(in srgb, var(--accent) 30%, transparent); }
.pub-btn-primary .arrow { transition: transform .25s var(--ease); }
.pub-btn-primary:hover .arrow { transform: translateX(3px); }
.pub-btn-ghost { border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); }
.pub-btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.pub-btn .pub-btn-label, .pub-btn .spinner { transition: opacity .2s, transform .25s var(--ease); }
.pub-btn .spinner { position: absolute; width: 20px; height: 20px; border-radius: 99px; border: 2px solid color-mix(in srgb, var(--on-accent) 35%, transparent); border-top-color: var(--on-accent); opacity: 0; transform: scale(.6); animation: pub-spin .7s linear infinite; }
@keyframes pub-spin { to { rotate: 360deg; } }
.pub-btn.loading { pointer-events: none; }
.pub-btn.loading .pub-btn-label { opacity: 0; transform: translateY(-6px); }
.pub-btn.loading .spinner { opacity: 1; transform: none; }

/* landing (value-prop hero for logged-out visitors) */
.lp-hero { display: grid; gap: 30px; padding: 36px 0 8px; }
.lp-eyebrow { margin: 0 0 14px; font: 500 11px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lp-hero h1 { margin: 0; max-width: 14ch; font: 700 clamp(35px, 6.4vw, 58px)/1.04 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
.lp-hero h1 em { font-style: normal; color: var(--accent); }
.lp-sub { margin: 14px 0 24px; max-width: 40ch; color: var(--muted); font-size: clamp(16.5px, 2vw, 19px); line-height: 1.5; text-wrap: pretty; }
.lp-cta-wrap { max-width: 380px; }
.lp-fine { margin: 10px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.lp-report { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.lp-report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.lp-tag { font: 500 10.5px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 4px 8px; white-space: nowrap; }
.lp-mono-label { font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.lp-score { margin-top: 6px; font: 700 46px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lp-score small { margin-left: 6px; font: 500 13px var(--f-mono); letter-spacing: 0; color: var(--muted); }
.lp-skills { display: grid; gap: 11px; margin: 0; padding: 14px 0 0; list-style: none; border-top: 1px solid var(--line); }
.lp-skill { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; font-size: 14.5px; }
.lp-skill .pct { font: 500 13px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.lp-bar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.lp-bar i { display: block; height: 100%; width: var(--w); border-radius: inherit; background: var(--accent); transform-origin: left; animation: lp-fill 1s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 700ms); }
@keyframes lp-fill { from { transform: scaleX(0); } }
.lp-steps { list-style: none; margin: 34px 0 0; padding: 0; display: grid; counter-reset: lp-step; }
.lp-step { position: relative; display: grid; align-content: start; grid-template-columns: 30px 1fr; gap: 0 14px; padding-bottom: 20px; }
.lp-step::before { counter-increment: lp-step; content: counter(lp-step); width: 30px; height: 30px; border-radius: 99px; display: grid; place-items: center; font: 600 13px var(--f-mono); color: var(--accent); background: var(--accent-bg); border: 1px solid var(--line); }
.lp-step:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 34px; bottom: 4px; width: 1px; background: var(--line-strong); }
.lp-step h3 { margin: 4px 0 2px; font: 650 16px/1.3 var(--f-body); }
.lp-step p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.lp-cta-end { margin: 10px 0 26px; }
.lp-trust { margin: 14px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font: 12px/1.7 var(--f-mono); color: var(--muted); }
.lp-legal { margin: 14px 0 0; font-size: 13px; }
.lp-legal a { color: var(--muted); text-decoration: none; }
.lp-legal a:hover { color: var(--accent); }
.lp-tm { margin: 8px 0 0; font-size: 12px; color: var(--muted); }
@media (min-width: 860px) {
  .lp-hero { grid-template-columns: 1.15fr .85fr; align-items: center; gap: 56px; padding-top: 80px; }
  .lp-steps { grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 64px; }
  .lp-step { grid-template-columns: 1fr; gap: 10px; padding: 0; }
  .lp-step:not(:last-child)::after { display: none; }
  .lp-cta-end { margin: 44px 0 40px; }
}

/* sign in / create account */
#signin { max-width: 440px; margin: 0 auto; }
.au-panel { padding: 30px 0 8px; }
@media (min-width: 561px) {
  .au-panel { margin-top: 28px; padding: 32px 30px 26px; background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
}
#si-title { margin: 0; font: 700 clamp(29px, 5vw, 34px)/1.1 var(--f-display); letter-spacing: -.03em; text-wrap: balance; }
#signin .tagline { margin: 10px 0 24px; color: var(--muted); font-size: 16px; line-height: 1.5; text-wrap: pretty; }
.au-stack { display: grid; gap: 12px; }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font: 500 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; margin: 6px 0; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
#si-social-wrap { margin-bottom: 12px; }
.au-field { position: relative; }
.au-field input { width: 100%; height: 58px; margin: 0; padding: 24px 15px 8px; font: 500 16px/1.25 var(--f-body); color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong); border-radius: 14px; outline: none; -webkit-appearance: none; transition: border-color .2s, box-shadow .25s var(--ease); }
.au-field input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.au-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }
/* floating label: sits in the box like a placeholder, slides up + shrinks once focused or filled
   (inputs carry placeholder=" " so :placeholder-shown means "empty") */
.au-field label { position: absolute; left: 16px; top: 19px; margin: 0; font: 400 16px/20px var(--f-body); color: var(--muted); pointer-events: none; transform-origin: left top; transition: transform .22s var(--ease), color .2s; }
.au-field input:focus + label,
.au-field input:not(:placeholder-shown) + label,
.au-field input:-webkit-autofill + label { transform: translateY(-11px) scale(.76); font-weight: 500; }
.au-field input:focus + label { color: var(--accent); }
.au-field.has-toggle input { padding-right: 72px; }
.au-toggle { position: absolute; right: 8px; top: 11px; height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: 600 13.5px var(--f-body); }
.au-toggle:hover { color: var(--accent); background: var(--accent-bg); }
.au-toggle:focus-visible { outline: 2px solid var(--accent); }
.au-msg { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .25s var(--ease); }
.au-msg > span { overflow: hidden; padding-left: 4px; font-size: 13.5px; color: var(--bad); }
.au-field.invalid input { border-color: var(--bad); }
.au-field.invalid input:focus { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 20%, transparent); }
.au-field.invalid .au-msg { grid-template-rows: 1fr; }
.au-field.invalid .au-msg > span { padding-top: 6px; }
.au-field.shake { animation: au-shake .32s var(--ease); }
@keyframes au-shake { 25% { transform: translateX(-4px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
.au-hint { display: flex; align-items: center; gap: 6px; padding: 6px 0 0 4px; font-size: 13.5px; color: var(--muted); transition: color .2s; }
.au-hint .dot { width: 16px; height: 16px; border-radius: 99px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background-color .25s var(--ease), border-color .25s; }
.au-hint .dot svg { width: 10px; height: 10px; opacity: 0; transform: scale(.4); transition: opacity .2s, transform .3s cubic-bezier(.34,1.4,.64,1); }
.au-hint .dot path { stroke: var(--panel); }
.au-hint.ok { color: var(--good); }
.au-hint.ok .dot { background: var(--good); border-color: var(--good); }
.au-hint.ok .dot svg { opacity: 1; transform: none; }
.au-hint.bad { color: var(--bad); }
#signin .si-forgot-row { text-align: right; margin: -4px 0 0; }
#signin .si-forgot-row .pub-link { font-size: 14px; padding: 4px 2px; }
#si-error { margin: 0; min-height: 0; font-size: 14px; }
#si-error:empty { display: none; }
#signin .note { margin: 0; padding: 10px 12px; border-radius: 10px; color: var(--good); background: var(--good-bg); font-size: 14px; }
#si-alt { margin-top: 12px; }
#si-code-row { margin-top: 12px; }
#si-terms { margin: 14px 0 0; text-align: center; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: balance; }
#si-terms a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 2px; }
#signin .swap { margin: 22px 0 0; text-align: center; font-size: 15px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) {
  .pub-rise, .lp-bar i, .au-field.shake { animation: none; }
  .pub-btn, .pub-btn *, .au-field input, .au-field label, .au-msg, .au-hint, .au-hint * { transition: none; }
}
/* blueprint background — full-page technical graph-paper, logged-out landing only (body.bp).
   Two-tier grid (24px minor / 120px major = 5:1) tinted brand-blue and kept subliminal,
   with a radial mask that clears it behind the hero and strengthens it toward the edges,
   plus a faint baked feTurbulence paper grain. Fixed layers behind content (z-index:-1). */
body.bp { background-color: var(--bg); background-image: none; overscroll-behavior: none; }   /* drop the app-wide 26/130 grid so only the blueprint grid shows */
body.bp header { display: none; }   /* no top bar on the public landing */
/* stop the rubber-band bounce on the landing so the fixed grid never detaches
   or reveals a color band past the content; match the root bg for good measure */
html:has(body.bp) { overscroll-behavior: none; }   /* NO bg here — an opaque html bg hides the z-index:-1 grid */
body.bp::before, body.bp::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  -webkit-mask-image: radial-gradient(ellipse 74% 60% at 50% 40%, transparent 0%, transparent 12%, #000 62%);
          mask-image: radial-gradient(ellipse 74% 60% at 50% 40%, transparent 0%, transparent 12%, #000 62%);
}
body.bp::before {
  background-image:
    linear-gradient(to right,  rgba(39,121,250,.28) 1.5px, transparent 1.5px),
    linear-gradient(to bottom, rgba(39,121,250,.28) 1.5px, transparent 1.5px),
    linear-gradient(to right,  rgba(39,121,250,.13) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(39,121,250,.13) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: 0 0;
}
@media (min-resolution: 2dppx) {
  body.bp::before {
    background-image:
      linear-gradient(to right,  rgba(39,121,250,.28) 1px, transparent 1px),
      linear-gradient(to bottom, rgba(39,121,250,.28) 1px, transparent 1px),
      linear-gradient(to right,  rgba(39,121,250,.13) .5px, transparent .5px),
      linear-gradient(to bottom, rgba(39,121,250,.13) .5px, transparent .5px);
  }
}
body.bp::after {
  opacity: .06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

/* skills tree */
.tree details { margin: 4px 0; }
.tree summary { cursor: pointer; padding: 6px 8px; border-radius: 8px; display: flex; align-items: center; gap: 10px; list-style: none; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--hover); }
.tree summary .caret { color: var(--muted); font-size: 11px; width: 12px; transition: transform .12s; }
.tree details[open] > summary .caret { transform: rotate(90deg); }
.tree .name { flex: 1; }
.tree .kids { padding-left: 22px; }
.node-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.node-row:hover { background: var(--hover); }
.node-row .name { flex: 1; }
.node-stats { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; cursor: pointer; background: var(--panel); font: inherit; text-align: left; }
.chip:hover { border-color: var(--accent); }
.chip b { display: block; font-size: 13px; }
.chip span { font-size: 12px; color: var(--muted); }
.chip.sel { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.start-form { max-width: 460px; margin: 24px auto; }
/* home ("Today"): greeting, streak strip, next-step card, custom form */
/* You */
.me-row { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.avatar { width: 48px; height: 48px; flex: none; border-radius: 99px; display: grid; place-items: center; background: var(--accent-bg); color: var(--accent); font: 700 19px var(--f-display); }
.me-id { display: grid; min-width: 0; }
.me-id b { font: 650 18px var(--f-display); }
.me-id .muted { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0 16px; border-top: 1px solid var(--line); }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 13.5px; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(16,32,56,.12); }
.sec-title { margin: 26px 0 10px; font-size: 20px; }
.set-row.share-row { display: block; }
.set-row.share-row > span { display: block; margin-bottom: 8px; }
.set-row.share-row .share-note { font-size: 12.5px; margin: 8px 0 0; }
#nick-box { flex-wrap: wrap; gap: 8px; }
.role-seg { display: flex; }
.role-seg button { flex: 1; padding: 10px 12px; font-size: 14.5px; }
#signin #si-invite { margin: 0 0 14px; color: var(--accent); background: var(--accent-bg); }
/* parent home */
.kid-card h2 { margin: 0 0 2px !important; }
.kid-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0 16px; }
.kid-stats > div { padding: 12px; border-radius: 14px; background: var(--panel-2); display: grid; gap: 2px; min-width: 0; }
.kid-stats b { font: 700 20px/1.15 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kid-stats span { font-size: 12.5px; color: var(--muted); }
.kid-card button.primary { width: 100%; min-height: 48px; }
.opp-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.shared-row { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.shared-row:first-child { border-top: 0; }
.shared-row .sess { flex: 1; min-width: 0; border-top: 0; }
.shared-row .pub-link { flex: none; white-space: nowrap; font-size: 14px; }
.shared-row .sess-main .muted { overflow: hidden; text-overflow: ellipsis; }
/* session history as tappable rows (was a wide table) */
.sess-list { display: grid; }
.sess { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 4px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; text-align: left; }
.sess:first-child { border-top: 0; }
.sess:hover:not(:disabled) { background: var(--hover); }
.sess-main { display: grid; gap: 2px; min-width: 0; }
.sess-main b { font-weight: 600; }
.sess-main .muted { font-size: 13px; font-weight: 400; }
.sess-score { display: grid; justify-items: end; gap: 1px; flex: none; }
.sess-score b { font: 700 17px var(--f-display); font-variant-numeric: tabular-nums; }
.sess-score span { font: 500 12px var(--mono); color: var(--muted); }
.home-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 8px 0 14px; }
.home-head h1 { margin: 0; font: 700 28px/1.1 var(--f-display); letter-spacing: -.03em; }
.streak-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); font-size: 14px; }
.streak-row svg { width: 20px; height: 20px; flex: none; color: var(--warn); }
.streak-row.cold svg { color: var(--muted); }
.streak-row b { font-weight: 650; }
.streak-row .nudge { flex: 1; min-width: 150px; color: var(--muted); }
.streak-row .nudge.warn { color: var(--warn); }
.streak-row .xp { font: 500 12.5px var(--mono); color: var(--muted); white-space: nowrap; }
.next-card { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: linear-gradient(160deg, var(--accent-bg), var(--panel) 70%); }
.card .eyebrow { display: block; margin-bottom: 8px; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.next-card h2 { font-size: 22px !important; margin-bottom: 4px !important; letter-spacing: -.02em; }
.next-card p { margin: 0 0 16px; color: var(--muted); }
.next-card button.primary { width: 100%; min-height: 50px; font-size: 16px; }
.next-card .next-plan { display: block; margin: 6px auto 0; }

/* question screen */
/* session focus mode: no header or tab bar while answering (body.in-session, set by showOnly) */
body.in-session header, body.in-session #nav { display: none !important; }
body.in-session main { padding-bottom: 24px; }
.q-top { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 12px; margin: 0 -16px 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.q-close { flex: none; width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 12px; color: var(--muted); }
.q-close svg { width: 18px; height: 18px; }
.q-progress { flex: 1; height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.q-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--accent); transition: width .45s var(--ease); }
.q-count { flex: none; min-width: 48px; text-align: right; font: 600 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
#q-title { display: none; }   /* the card's meta line already names the skill */
/* answer actions: sit under the choices, and stay pinned to the bottom while a long passage or explanation scrolls */
.q-actions { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 10px; margin: 16px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 92%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-top: 1px solid var(--line); border-radius: 0 0 16px 16px; }
.q-actions button { min-height: 50px; font-size: 16px; }
.q-actions .primary { flex: 1; }
.q-actions .ghost { border-color: transparent; background: none; color: var(--muted); }
#q-card { padding-bottom: 18px; }
#q-feedback { scroll-margin-bottom: 90px; }
.passage { font-size: 17px; line-height: 1.65; margin: 0 0 14px; white-space: pre-wrap; }
.figure { display: block; max-width: 100%; margin: 0 auto 14px; }
.stim { margin: 0 0 14px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.stim .stim-title { font-weight: 600; font-size: 13px; margin-bottom: 8px; text-align: center; }
.stim table { font-size: 13px; }
.stim th, .stim td { padding: 6px 8px; }
.stim td { font-variant-numeric: tabular-nums; }
.numeric-input { font-size: 17px; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; width: min(320px, 100%); }
.numeric-input.right { border-color: var(--good); background: var(--good-bg); }
.numeric-input.wrong { border-color: var(--bad); background: var(--bad-bg); }
.passage .blank { border-bottom: 2px solid var(--ink); padding: 0 2px; min-width: 60px; display: inline-block; text-align: center; }
/* reader highlight (select passage text → Highlight; tap a highlight to remove) */
.passage mark.hl { background: #ffe89a; color: inherit; border-radius: 2px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.passage.selectable { -webkit-user-select: text; user-select: text; }
.hl-pop { position: absolute; z-index: 50; background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 7px 12px; font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; box-shadow: 0 6px 18px rgba(0,0,0,.28); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.hl-pop::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: #ffe89a; }
.hl-pop.hidden { display: none; }
.prompt { font-weight: 600; margin: 0 0 14px; }
.options { display: grid; gap: 10px; margin-bottom: 16px; }
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 11px; background: var(--panel); cursor: pointer; font: inherit; text-align: left; width: 100%; transition: border-color .12s, background .12s; }
.opt .key { font-family: var(--mono); font-weight: 700; font-size: 13px; width: 24px; height: 24px; flex: none; display: grid; place-items: center; border-radius: 7px; background: var(--accent-bg); color: var(--accent); border: 1px solid var(--line); }
.opt:hover { border-color: var(--accent); background: var(--accent-bg); }
.opt.selected { border-color: var(--accent); background: var(--accent-bg); }
.opt.selected .key { background: var(--accent); color: #fff; border-color: var(--accent); }
.opt.right { border-color: var(--good); background: var(--good-bg); }
.opt.right .key { background: var(--good); color: #fff; border-color: var(--good); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt.wrong .key { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt:disabled { cursor: default; opacity: 1; }
/* Cross-out (eliminate) aid: a private, temporary toggle beside each choice. */
.opt-row { position: relative; display: flex; }
.opt-row .opt { flex: 1; padding-right: 50px; }
.opt-strike { position: absolute; right: 8px; top: 50%; translate: 0 -50%; z-index: 1; width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid transparent; border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font: inherit; font-size: 16px; line-height: 1; padding: 0; display: flex; align-items: center; justify-content: center; }
.opt-strike:hover:not(:disabled) { border-color: var(--line-strong); color: var(--bad); background: var(--panel); }
.opt-strike.active { background: var(--bad-bg); border-color: var(--bad); color: var(--bad); }
.opt-strike:disabled { display: none; }
.opt-row.struck .opt { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .5; cursor: default; }
.opt-row.struck .opt:hover { border-color: var(--line); }
.verdict { border-radius: 10px; padding: 12px 14px; font-weight: 600; margin-bottom: 12px; }
/* explanations carry newline-separated steps and bullet lists — keep the line breaks */
.explain { white-space: pre-line; }
.verdict.good { background: var(--good-bg); color: var(--good); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.feedback h4 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.feedback p { margin: 0 0 6px; }
.feedback details { margin-top: 10px; }
.feedback summary { cursor: pointer; color: var(--accent); font-size: 14px; }
/* Learning cards — the structured "learn this" lesson shown after answering. */
.lcards { margin-top: 16px; }
.lcard { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 11px; padding: 13px 15px; margin: 8px 0; background: linear-gradient(180deg, var(--accent-bg), transparent 140%); }
.lcard-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.lcard-body { white-space: pre-line; margin: 0 0 6px; }
.lcard-formula { font-family: var(--mono); font-size: 13px; background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 9px 12px; margin: 10px 0 2px; overflow-x: auto; }
.lcard-concepts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lcard-concepts .chip { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; }
/* concepts: mastery colors shared by the meter, dots, and tags */
.m-mastered { --m: var(--good); } .m-learning { --m: var(--accent); } .m-weak { --m: var(--bad); } .m-new { --m: var(--line-strong); }
.c-summary { display: grid; gap: 12px; }
.c-sum-top { display: flex; align-items: baseline; gap: 8px; }
.c-sum-top b { font: 700 34px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.c-sum-top span { color: var(--muted); }
.c-meter { display: flex; gap: 3px; height: 10px; }
.c-meter i { display: block; border-radius: 99px; background: var(--m); min-width: 6px; }
.c-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); }
.c-legend span { display: inline-flex; align-items: center; gap: 6px; }
.c-dot { width: 10px; height: 10px; flex: none; border-radius: 99px; background: var(--m); display: inline-block; }
.c-tag { justify-self: start; display: inline-block; padding: 3px 9px; border-radius: 99px; font: 600 11.5px var(--f-body); color: var(--m); background: color-mix(in srgb, var(--m) 14%, transparent); }
.m-new.c-tag { color: var(--muted); background: var(--panel-2); }
.c-focus { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.c-fcard { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0; }
.c-fcard button.primary { width: 100%; }
.c-fterm { all: unset; cursor: pointer; font: 650 18px/1.2 var(--f-display); letter-spacing: -.01em; }
.c-fterm:hover { color: var(--accent); }
.c-fterm:focus-visible { outline: 2px solid var(--accent); border-radius: 4px; }
.c-fdef { margin: 0 0 6px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.c-fcard button.primary { margin-top: auto; }
/* phones: focus cards become a swipeable row so the list stays near the top */
@media (max-width: 640px) {
  .c-focus { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -16px; padding: 0 16px 6px; scrollbar-width: none; }
  .c-focus::-webkit-scrollbar { display: none; }
  .c-fcard { flex: 0 0 82%; scroll-snap-align: start; }
}
.c-filters { display: flex; gap: 6px; overflow-x: auto; margin: 22px 0 6px; padding-bottom: 2px; }
.c-filters button { flex: none; padding: 7px 13px; border-radius: 99px; font-size: 14px; }
.c-filters button span { color: var(--muted); font-weight: 400; margin-left: 2px; }
.c-filters button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.c-filters button[aria-selected="true"] span { color: inherit; opacity: .7; }
.c-group { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 18px 2px 8px; font-size: 16px; }
.c-group span { font: 500 12px var(--mono); color: var(--muted); }
.c-list { padding: 4px 6px; }
.c-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 10px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; text-align: left; }
.c-row:first-child { border-top: 0; }
.c-row:hover:not(:disabled) { background: var(--hover); border-radius: 10px; }
.c-row-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.c-row-main b { font-weight: 600; }
.c-row-main span { color: var(--muted); font-size: 13.5px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-row-acc { font: 500 13px var(--mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.c-row svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
/* concept detail sheet */
#concept-dialog { width: min(560px, 94vw); }
#concept-dialog .inner { display: grid; gap: 12px; padding: 18px 22px 22px; max-height: 88vh; overflow: auto; }
.c-sheet-head { display: flex; justify-content: space-between; align-items: center; }
#concept-dialog h2 { margin: 0; font-size: 26px; letter-spacing: -.025em; }
.c-crumb { margin: -8px 0 0; font: 500 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.c-lesson { display: grid; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--panel-2); }
.c-lesson p { margin: 0; }
.c-examples { display: grid; gap: 6px; }
.c-examples p { position: relative; padding: 8px 12px 8px 34px; border-radius: 10px; background: var(--panel); font-size: 15px; }
.c-examples p::before { position: absolute; left: 12px; top: 8px; font-weight: 700; }
.c-examples p.ok::before { content: "✓"; color: var(--good); }
.c-examples p.no::before { content: "✗"; color: var(--bad); }
#concept-dialog .sum-stats { margin: 4px 0 0; }
.lcard-open { display: inline-block; margin-top: 8px; padding: 0; font-size: 14px; }
@media (max-width: 560px) {
  #concept-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  #concept-dialog .inner { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
/* Test chooser + switcher (SAT / ARE) */
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.test-choose { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.test-pick { flex: 1; min-width: 140px; font: inherit; font-size: 16px; font-weight: 700; color: var(--accent); background: var(--accent-bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 18px 16px; cursor: pointer; }
.test-pick:hover { border-color: var(--accent); }
.test-switch { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.test-switch select { font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.review-item { border-top: 1px solid var(--line); padding: 12px 0; }
.review-item > details > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; }
.review-item > details > summary::-webkit-details-marker { display: none; }
.review-item > details > summary::before { content: "▸"; color: var(--muted); font-size: 11px; }
.review-item > details[open] > summary::before { content: "▾"; }
.meta-line { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.sum-head { display: grid; gap: 4px; margin-bottom: 16px; }
.sum-head .eyebrow { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.sum-head h2 { margin: 6px 0 0 !important; font-size: 26px !important; letter-spacing: -.025em; }
.sum-head .muted { font-size: 14px; }
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 18px; }
.sum-stats > div { padding: 14px 12px; border-radius: 14px; background: var(--panel-2); display: grid; gap: 2px; }
.sum-stats b { font: 700 26px/1.1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.sum-stats span { font-size: 12.5px; color: var(--muted); }
.sum-actions { display: grid; gap: 10px; margin-bottom: 8px; }
.sum-actions button { min-height: 50px; font-size: 16px; }

/* diagnostic onboarding */
/* S0 intro: the header is hidden and the card sits in the middle of the viewport. */
body.diag-intro header { display: none; }
body.diag-intro main { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 20px 16px; }
body.diag-intro #view-diag-intro { width: 100%; }
body.diag-intro #diag-intro-card { margin: 0 auto; text-align: center; padding: 28px 24px; }
#diag-scope { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: left; }
#diag-scope .chip { padding: 12px 14px; }
#diag-scope .chip b { font-size: 14px; margin-bottom: 2px; }
@media (max-width: 480px) { #diag-scope { grid-template-columns: 1fr; } }
.unlock-card { border-style: dashed; }
.plan-hero .plan { margin-top: 4px; }
.plan-hero .plan-score-label { font-size: 13px; margin: -2px 0 2px; }
.plan-hero .plan-score-when { font-size: 12.5px; margin-top: 2px; }
.plan-hero .plan-score { display: flex; align-items: center; justify-content: space-between; gap: 12px 18px; flex-wrap: wrap; margin: 2px 0 16px; }
.plan-hero .plan-score .band { font-size: 40px; font-weight: 800; line-height: 1.1; letter-spacing: -.5px; }
.plan-hero .plan-score .muted { font-size: 13px; }
.plan-hero .plan-next-retake { font-size: 13px; }
.plan-hero .plan-step { border-top-color: color-mix(in srgb, var(--accent) 18%, var(--line)); }
.plan-hero .plan-step.done .plan-num { background: var(--good-bg, var(--accent-bg)); color: var(--good); }
.plan-hero .plan-step.done .plan-title { color: var(--muted); }
.plan-hero button.plan-go, .plan-hero button.plan-go.primary { width: auto; min-height: 34px; font-size: 13.5px; padding: 6px 14px; }
.plan-hero .plan-meta { font-size: 12.5px; }
.plan-hero .plan-do { margin-top: 4px; }
.home-tabs { display: flex; border-bottom: 2px solid var(--line); margin: 4px 0 18px; }
.home-tabs button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 8px; margin-bottom: -2px; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 14.5px; font-weight: 650; color: var(--muted); cursor: pointer; }
.home-tabs button:hover { color: var(--ink); }
.home-tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.home-tabs button svg { width: 15px; height: 15px; opacity: .7; }
.diag-brand { display: flex; justify-content: center; margin: 0 0 18px; }
.diag-foot { text-align: center; margin: 14px 0 0; }
.diag-foot .pub-link { color: var(--muted); font-size: 13px; }
.diag-brand .pub-brand { font-size: 20px; }
.diag-brand .brand-mark { width: 32px; height: 32px; }
body.diag-intro #diag-intro-card h2 { margin-top: 0; }
body.diag-intro #diag-intro-card p.muted { max-width: 40ch; margin: 10px auto 0; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; margin: 0 auto 16px; animation: dg-spin .8s linear infinite; }
@keyframes dg-spin { to { transform: rotate(360deg); } }
.diag-hero { text-align: center; padding: 10px 0 2px; }
.diag-hero .band { font-size: 44px; font-weight: 800; line-height: 1.1; margin: 4px 0; letter-spacing: -.5px; }
/* the report as a training plan */
.plan { list-style: none; margin: 14px 0 0; padding: 0; }
.plan-step { display: grid; grid-template-columns: 34px 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 0; border-top: 1px solid var(--line); }
.plan-step:last-child { padding-bottom: 0; }
.plan-num { width: 34px; height: 34px; border-radius: 99px; display: grid; place-items: center; font: 600 14px var(--f-mono); color: var(--accent); background: var(--accent-bg); }
.plan-step.first .plan-num { color: var(--on-accent); background: var(--accent); }
.plan-title { font-weight: 650; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.plan-meta { font-size: 12.5px; margin-top: 2px; }
.plan-do { font-size: 13.5px; margin-top: 4px; }
.plan-lede { margin: -6px 0 0; }
.plan-mail { margin: 12px 0 0; font-size: 13px; text-align: center; }
.plan-tip { margin: 10px 0 0; }
.plan-help { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.plan-deeper { margin: 12px 0 0; font-size: 13.5px; }
.plan-deeper .pub-link { padding: 0; font-size: inherit; }
.plan-other { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; border-color: var(--accent); }
.plan-other h2 { margin-bottom: 4px; }
.plan-other p { margin: 0; max-width: 46ch; }
.plan-missing { justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13.5px; }
details.plan-breakdown > summary { cursor: pointer; font-weight: 650; }
details.plan-breakdown[open] > summary { margin-bottom: 10px; }
@media (max-width: 560px) {
  .plan-step { grid-template-columns: 34px 1fr; }
  .plan-go { grid-column: 2; justify-self: start; margin-top: 6px; }
  .plan-other button { width: 100%; }
}

/* ---------- Mobile (≤820px): header nav becomes a fixed bottom tab bar ----------
   The desktop header can't fit brand + 5 nav items + theme + email + sign-out below
   ~820px, so the same #nav element is reflowed into a thumb-friendly bottom bar.
   Tab icons (.tab-ico) live inside each button and only render here. */
.tab-ico { display: none; }
@media (max-width: 820px) {
  header { padding: 10px 14px; gap: 8px; }
  /* #nav is normally a header flex child; here it's lifted out to a fixed bottom bar.
     `.hidden` still wins (logged-out, diagnostic flow) because it is display:none !important. */
  #nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; gap: 0; padding: 0 0 env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--line);
    box-shadow: 0 -1px 2px rgba(16,32,56,.05), 0 -8px 24px rgba(16,32,56,.07);
  }
  #nav button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 3px; padding: 7px 2px 7px;
    min-height: 54px; border-radius: 0; font-size: 11px; font-weight: 600; line-height: 1;
    color: var(--muted); background: none; -webkit-tap-highlight-color: transparent;
  }
  #nav button .tab-ico { display: block; width: 23px; height: 23px; stroke: currentColor; }
  #nav button .tab-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #nav button.active { background: none; color: var(--accent); box-shadow: inset 0 2px 0 var(--accent); }
  /* content must clear the fixed bar (bar ≈54px + home-indicator inset) */
  body:has(#nav:not(.hidden)) main { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  /* form controls ≥16px so iOS Safari doesn't auto-zoom the page on focus */
  input, select, textarea { font-size: 16px; }
}
@media (max-width: 560px) {
  header .who { display: none; }   /* email would crowd the compact top bar; it's on Account */
  header h1 { margin-right: 4px; }
}
