/* Akili: warm paper and ink, one teal accent, drawn art. Light and dark. */
:root {
  --bg: #F7F2E9; --surface: #FFFDF8; --surface-2: #F1EADD; --surface-3: #E8DFCF;
  --ink: #22292B; --ink-2: #4E575A; --ink-3: #636B6E; --line: #E2D8C6;
  --accent: #1F6F68; --accent-2: #2A8C82; --accent-ink: #FFFDF8; --accent-soft: #DDEFEA;
  --sun: #F2B33D; --coral: #E07A5F; --leaf: #5E9E61; --sky: #4F8CC9; --berry: #C2577A;
  --good: #2C6E44; --good-bg: #E2F1E3; --warm: #8A5310; --warm-bg: #FBEBCF; --show: #2C5A86; --show-bg: #E3EEF8;
  --soft-red: #b4392f;
  --shadow: 0 1px 2px rgba(60, 45, 20, .06), 0 6px 20px rgba(60, 45, 20, .07);
  --r: 18px; --r-sm: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #15191A; --surface: #1D2325; --surface-2: #262E31; --surface-3: #313B3E;
  --ink: #EEE8DC; --ink-2: #BDC3C0; --ink-3: #8D9693; --line: #333D40;
  --accent: #5FB8AE; --accent-2: #74C6BC; --accent-ink: #0F1F1D; --accent-soft: #1F3936;
  --good: #93D3A0; --good-bg: #1D3326; --warm: #F1C27D; --warm-bg: #3A2E1B; --show: #9CC4EA; --show-bg: #1E2E3F;
  --soft-red: #ee8a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
} }
:root[data-theme="dark"] {
  --bg: #15191A; --surface: #1D2325; --surface-2: #262E31; --surface-3: #313B3E;
  --ink: #EEE8DC; --ink-2: #BDC3C0; --ink-3: #8D9693; --line: #333D40;
  --accent: #5FB8AE; --accent-2: #74C6BC; --accent-ink: #0F1F1D; --accent-soft: #1F3936;
  --good: #93D3A0; --good-bg: #1D3326; --warm: #F1C27D; --warm-bg: #3A2E1B; --show: #9CC4EA; --show-bg: #1E2E3F;
  --soft-red: #ee8a80;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3 { font-family: var(--round); line-height: 1.2; margin: 0; letter-spacing: -.01em; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.ic { width: 22px; height: 22px; flex: none; }
.ic.big { width: 36px; height: 36px; }
.muted { color: var(--ink-3); margin: 4px 0 0; font-size: 15px; }
.note { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.err { color: var(--soft-red); min-height: 1.2em; margin: 0; font-size: 15px; }
.err:empty { display: none; }
[hidden] { display: none !important; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 14px; border: 0; font-weight: 650; font-size: 17px; background: var(--surface-2); color: var(--ink); transition: transform .12s, background .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.btn.primary:disabled { opacity: .38; cursor: default; transform: none; }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); }
.btn.wide { width: 100%; }
.iconbtn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; color: var(--ink-2); flex: none; }
.iconbtn:hover { background: var(--surface-2); }

/* ---------- top bar ---------- */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 8px; padding: 10px max(16px, env(safe-area-inset-left)); padding-top: max(10px, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 8px; font: 800 20px var(--round); min-height: 44px; }
.brand .logo { width: 32px; height: 32px; }
.top-mid { flex: 1; min-width: 0; }
.top-title { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.streak { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border-radius: 12px; color: var(--ink-3); font-weight: 750; }
.streak.on { color: #D9822B; }
.streak b { font-size: 17px; }
.me .avatar.sm { width: 40px; height: 40px; display: block; }
.net { color: var(--warm); display: inline-grid; place-items: center; width: 36px; height: 36px; }

.avatar { display: block; border-radius: 50%; }
.avatar.sm { width: 40px; height: 40px; } .avatar.md { width: 52px; height: 52px; } .avatar.xl { width: 112px; height: 112px; } .avatar.xxl { width: 140px; height: 140px; }

/* ---------- start / picker ---------- */
.loading { min-height: 100vh; display: grid; place-items: center; } .loading .logo { width: 64px; height: 64px; opacity: .6; }
.picker { max-width: 760px; margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 16px 32px; min-height: 100vh; display: flex; flex-direction: column; }
.picker-head { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 24px 0 28px; }
.picker-head .logo { width: 48px; height: 48px; }
.picker-head h1 { font-size: 30px; }
.people { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (min-width: 760px) { .people { grid-template-columns: repeat(4, 1fr); } }
.person { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 12px 18px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); min-height: 180px; transition: transform .15s; }
.person:hover, .person:focus-visible { transform: translateY(-3px); }
.person:active { transform: scale(.97); }
.pname { font: 750 18px var(--round); text-align: center; }
.picker-foot { margin-top: auto; padding-top: 28px; display: flex; justify-content: center; }

.welcome-main { min-height: 100vh; max-width: 1040px; margin: 0 auto; padding: 24px 16px; display: grid; gap: 24px; align-content: center; }
@media (min-width: 900px) { .welcome-main { grid-template-columns: 1.1fr 1fr; align-items: center; } }
.hero-art { border-radius: 28px; overflow: hidden; }
.hero-art .hero { width: 100%; height: auto; display: block; }
.welcome-card { background: var(--surface); border-radius: 24px; padding: 28px 22px; box-shadow: var(--shadow); }
.brandline { display: flex; align-items: center; gap: 10px; font: 800 22px var(--round); margin-bottom: 14px; }
.brandline .logo { width: 36px; height: 36px; }
.welcome-card h1 { font-size: 28px; margin-bottom: 20px; }

.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: 15px; color: var(--ink-2); }
.form input:not([type="radio"]), .form select { min-height: 50px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); padding: 0 14px; font-size: 17px; color: var(--ink); }
.form input:focus, .form select:focus { border-color: var(--accent); outline: none; }
.form fieldset { border: 1.5px solid var(--line); border-radius: 14px; padding: 12px; margin: 0; }
.form legend { font-weight: 600; font-size: 15px; color: var(--ink-2); padding: 0 6px; }

/* ---------- picture PIN ---------- */
.pinpage, .pwpage { max-width: 520px; margin: 0 auto; padding: 8px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.pin-who { display: flex; flex-direction: column; align-items: center; gap: 10px; } .pin-who h1 { font-size: 26px; }
.pindots { display: flex; gap: 14px; }
.pindot { width: 64px; height: 64px; border-radius: 18px; border: 3px dashed var(--line); display: grid; place-items: center; }
.pindot.on { border-style: solid; border-color: var(--accent); background: var(--surface); }
.pindot .pic { width: 48px; height: 48px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; width: 100%; }
.pinbtn { aspect-ratio: 1; min-height: 88px; border-radius: 22px; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; transition: transform .1s; }
.pinbtn:active { transform: scale(.93); }
.pinbtn .pic { width: 64%; height: 64%; }
.pindots.small .pindot { width: 48px; height: 48px; } .pindots.small .pic { width: 36px; height: 36px; }
.pinpad.small { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; } .pinpad.small .pinbtn { min-height: 48px; min-width: 0; border-radius: 12px; } .pinpad.small .pic { max-width: 100%; }
.pwpage form { width: 100%; }
.speak { color: var(--accent); }
.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- home ---------- */
.home-main, .map-main, .prog-main, .parent-main { max-width: 1040px; margin: 0 auto; padding: 4px 16px 48px; }
.hello { margin: 10px 0 16px; } .hello h1 { font-size: 30px; }
.today { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; margin-bottom: 14px; } .today > * { min-width: 0; }
@media (min-width: 760px) { .today { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.practice-card { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: 24px; background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); min-height: 124px; transition: transform .15s; }
.practice-card:active { transform: scale(.985); }
.practice-card h2 { font-size: 24px; } .practice-card p { margin: 4px 0 0; opacity: .85; }
.pc-text { flex: 1; }
.pc-go { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex: none; }
.ringwrap { position: relative; width: 88px; height: 88px; flex: none; }
.ring { width: 88px; height: 88px; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .22); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--sun); stroke-width: 9; stroke-linecap: round; }
.ringnum { position: absolute; inset: 0; display: grid; place-items: center; font: 800 24px var(--round); }
.ringnum small { font-size: 14px; opacity: .7; margin-left: 1px; }
.ringnum { grid-auto-flow: column; justify-content: center; align-items: center; }
.streak-card { padding: 18px 20px; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.streak-card p { margin: 0; color: var(--ink-2); } .streak-card b { color: var(--ink); font-size: 20px; }
.week { display: flex; justify-content: space-between; gap: 6px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; }
.wd i { width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 50%; background: var(--surface-2); display: block; }
.wd.on i { background: var(--sun); }
.wd.today i { box-shadow: inset 0 0 0 2.5px var(--accent); }
.wd small { font-size: 12px; color: var(--ink-3); }
.continue { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); margin-bottom: 8px; }
.continue-art { width: 56px; height: 56px; flex: none; } .continue-art svg { width: 100%; height: 100%; display: block; }
.continue div:nth-child(2) { flex: 1; min-width: 0; }
.continue small { color: var(--ink-3); font-weight: 600; }
.continue h3 { font-size: 18px; }
.continue .pc-go { background: var(--accent-soft); color: var(--accent); }
.sect { font-size: 20px; margin: 26px 0 12px; }
.courses { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 600px) { .courses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .courses { grid-template-columns: repeat(3, 1fr); } }
.course { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); min-height: 96px; transition: transform .15s; }
.course:hover { transform: translateY(-2px); }
.course-art { width: 68px; height: 68px; flex: none; } .course-art svg { width: 100%; height: 100%; display: block; }
.course-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.course h3 { font-size: 17px; }
.course small { color: var(--ink-3); font-size: 13.5px; }
.bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 4px; }

/* little learners: everything bigger, nothing to read */
.t-pre .hello h1 { font-size: 34px; }
.t-pre .courses { grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 760px) { .t-pre .courses { grid-template-columns: repeat(3, 1fr); } }
.t-pre .course { flex-direction: column; text-align: center; padding: 16px 10px; min-height: 170px; border-radius: 26px; }
.t-pre .course-art { width: 96px; height: 96px; }
.t-pre .course-body { width: 100%; }
.t-pre .course h3 { font-size: 17px; }
.t-pre .course small { display: none; }
.t-pre .practice-card { min-height: 140px; }
.t-pre .pc-text h2 .ic.big { width: 54px; height: 54px; }

/* ---------- course map ---------- */
.map-main { max-width: 640px; }
.map-head { display: flex; align-items: center; gap: 16px; margin: 6px 0 20px; }
.map-art { width: 76px; height: 76px; flex: none; } .map-art svg { width: 100%; height: 100%; display: block; }
.map-head h1 { font-size: 26px; } .map-count { margin: 4px 0 0; color: var(--ink-3); font-weight: 600; }
.trail { position: relative; margin: 0 auto; max-width: 520px; }
.map-main { overflow-x: clip; }
.trail-line { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-bg, .tl-done { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.tl-bg { stroke: var(--surface-3); stroke-width: 10; stroke-dasharray: 2 16; }
.tl-done { stroke: var(--accent-2); stroke-width: 10; stroke-opacity: .5; }
.stop { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
.node { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow), inset 0 -4px 0 var(--surface-3); color: var(--ink-3); font: 800 22px var(--round); position: relative; z-index: 1; transition: transform .15s; }
.stop.done .node { background: var(--accent-2); color: var(--accent-ink); box-shadow: var(--shadow), inset 0 -4px 0 rgba(0, 0, 0, .15); }
.stop.next .node { background: var(--sun); color: #3A2A08; width: 80px; height: 80px; box-shadow: 0 0 0 8px color-mix(in srgb, var(--sun) 28%, transparent), var(--shadow), inset 0 -5px 0 rgba(0, 0, 0, .12); animation: bob 2.4s ease-in-out infinite; }
.stop.locked .node { opacity: .65; }
a.node:hover { transform: scale(1.06); }
.node .ic { width: 28px; height: 28px; }
.node svg.vis, .node .shape { width: 56%; height: 56%; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .stop.next .node { animation: none; } }
.stop-label { position: absolute; top: 50%; left: calc(100% + 12px); transform: translateY(-50%); width: max-content; max-width: min(200px, 34vw); display: grid; gap: 2px; font-weight: 650; font-size: 15px; line-height: 1.25; }
.stop-label.left { left: auto; right: calc(100% + 12px); text-align: right; justify-items: end; }
.stop.locked .stop-label { color: var(--ink-3); }
.stars { display: inline-flex; gap: 1px; } .stars i { color: var(--surface-3); } .stars i.on { color: var(--sun); } .stars .ic { width: 16px; height: 16px; fill: currentColor; }
.t-pre .node { width: 84px; height: 84px; } .t-pre .stop.next .node { width: 96px; height: 96px; }
.t-pre .stop-label { font-size: 14px; }

/* ---------- player ---------- */
.screen.player { min-height: 100vh; }
.pl { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 760px; margin: 0 auto; }
.pl-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); position: sticky; top: 0; background: var(--bg); z-index: 4; }
.pl-progress { flex: 1; height: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.pl-progress i { display: block; height: 100%; width: 0; background: var(--accent-2); border-radius: 6px; transition: width .35s ease; }
.pl-body { flex: 1; padding: 8px 16px 24px; }
.pl-body.enter { animation: enter .28s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { .pl-body.enter { animation: none; } }
.pl-foot { position: sticky; bottom: 0; padding: 12px 16px; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); z-index: 4; }
.pl-actions { display: flex; gap: 10px; }
.pl-foot .btn { min-height: 54px; font-size: 18px; border-radius: 16px; }
.t-pre .pl-foot .btn { min-height: 72px; border-radius: 22px; }
.step-title, .prompt { font-size: 23px; margin: 10px 0 16px; font-weight: 750; }
.t-pre .prompt, .t-pre .step-title { font-size: 26px; text-align: center; }
.t-adult .prompt, .t-adult .step-title { font-size: 21px; }
.step-text { font-size: 18px; color: var(--ink-2); max-width: 62ch; }
.step-text strong { color: var(--ink); }
.step-text p { margin: 0 0 10px; }
.step-vis { display: flex; justify-content: center; margin: 8px 0 18px; }
.step-vis > .vis { max-width: 100%; height: auto; max-height: 260px; color: var(--ink); }
.step-vis > .vis.things { max-height: 230px; max-width: 100%; height: auto; }
.step-vis > .vis.numeral { width: 150px; }
.step-vis > .vis.shape { width: 150px; height: 150px; }
.step-vis > .vis.numline, .step-vis > .vis.bars { width: 100%; max-width: 560px; }
.step-vis > .vis.clock { width: 200px; }
.step-vis > .vis.frac { width: min(100%, 360px); }
.step-vis > .vis.frac[viewBox^="0 0 180"] { width: 200px; }
.step-vis > .vis.row { width: min(100%, 460px); }
.step-vis > .vis.tenframe { width: min(100%, 240px); }
.step-vis > .vis.base10 { width: min(100%, 420px); }
code { font: 600 .92em ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }
.fr { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; line-height: 1.05; font-size: .82em; margin: 0 2px; font-weight: 700; }
.fr span:first-child { border-bottom: 2px solid currentColor; padding: 0 3px; }
.tapcount { cursor: pointer; } .tapzone { fill: transparent; } .tapcount.counted .tapzone { fill: var(--sun); fill-opacity: .28; }
.tapnum { font: 800 22px var(--round); fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-width: 5px; pointer-events: none; }

/* feedback */
.fb { border-radius: 18px; padding: 14px 16px; margin-bottom: 12px; animation: rise .22s ease-out; max-height: 45vh; overflow: auto; }
@keyframes rise { from { transform: translateY(10px); opacity: 0; } }
.fb-head { display: flex; align-items: center; gap: 8px; font: 800 19px var(--round); }
.fb-text, .fb-ans { margin-top: 6px; font-size: 16.5px; }
.fb-vis { margin-top: 8px; display: flex; justify-content: center; } .fb-vis .vis { max-height: 160px; max-width: 100%; color: var(--ink); }
.fb.good { background: var(--good-bg); color: var(--good); } .fb.good .fb-text { color: var(--ink-2); }
.fb.warm { background: var(--warm-bg); color: var(--warm); } .fb.warm .fb-text { color: var(--ink-2); }
.fb.show { background: var(--show-bg); color: var(--show); } .fb.show .fb-text, .fb.show .fb-ans { color: var(--ink-2); }
.t-pre .fb { text-align: center; } .t-pre .fb-head { justify-content: center; font-size: 26px; } .t-pre .fb-text { display: none; }

/* choices */
.opts { display: grid; gap: 12px; }
.opts.text { grid-template-columns: 1fr; }
@media (min-width: 600px) { .opts.text.n4, .opts.text.n2 { grid-template-columns: 1fr 1fr; } }
.opts.pics { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 600px) { .opts.pics.n3 { grid-template-columns: repeat(3, 1fr); } .opts.pics.n4 { grid-template-columns: repeat(4, 1fr); } }
.opt { min-height: 56px; padding: 12px 16px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); text-align: left; display: flex; align-items: center; justify-content: flex-start; gap: 10px; font-size: 18px; font-weight: 600; transition: border-color .15s, background .15s, transform .1s, opacity .2s; box-shadow: 0 2px 0 var(--line); }
.opts.pics .opt { flex-direction: column; justify-content: center; text-align: center; min-height: 110px; }
.opt .vis { max-width: 100%; max-height: 120px; height: auto; color: var(--ink); }
.opt .vis.numeral { width: 90px; } .opt .vis.shape { width: 84px; height: 84px; } .opt .vis.things { max-height: 110px; } .opt .vis.frac { width: 100%; }
.opt:active { transform: scale(.97); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 0 var(--accent); }
.opt.out { opacity: .35; }
.opt.right { border-color: var(--good); background: var(--good-bg); box-shadow: 0 2px 0 var(--good); }
.opts.locked .opt { cursor: default; }
.t-pre .opts.pics .opt, .t-pre .opt { min-height: 120px; border-radius: 26px; font-size: 26px; justify-content: center; }
.t-pre .opts.text { grid-template-columns: repeat(2, 1fr); }
.t-pre .opts.n3 { grid-template-columns: repeat(3, 1fr); }
.t-pre .opts.n3 .opt { padding: 10px 6px; }
.t-pre .opt .lbl { font: 800 34px var(--round); }

/* numbers */
.numin { display: grid; gap: 14px; justify-items: center; }
.numrow { display: flex; align-items: center; gap: 10px; }
.numfield { width: min(260px, 70vw); min-height: 60px; font: 800 30px var(--round); text-align: center; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 10px; }
.numfield:focus { outline: none; border-color: var(--accent); }
.affix { font: 700 20px var(--round); color: var(--ink-2); }
.keypad { display: grid; grid-template-columns: repeat(3, 72px); gap: 10px; }
.key { height: 60px; border-radius: 16px; border: 0; background: var(--surface); box-shadow: 0 2px 0 var(--line), var(--shadow); font: 800 24px var(--round); display: grid; place-items: center; }
.key:active { transform: translateY(2px); box-shadow: none; }
.key.back { color: var(--ink-3); }
.t-adult .numfield { font: 700 24px var(--font); }

/* drag and sort */
.sorter, .orderer { display: grid; gap: 14px; }
.pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; min-height: 76px; padding: 10px; border-radius: 18px; background: var(--surface-2); }
.pool.empty { min-height: 0; padding: 0; background: transparent; }
.chip { min-width: 64px; min-height: 64px; padding: 8px 12px; border-radius: 16px; background: var(--surface); box-shadow: 0 2px 0 var(--line), var(--shadow); display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 700; font-size: 17px; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .1s, opacity .2s; }
.chip .vis { width: 54px; height: 54px; color: var(--ink); }
.chip .vis.things { width: auto; height: 50px; }
.chip.picked { outline: 3px solid var(--sun); transform: translateY(-3px); }
.chip.dragging { opacity: .3; }
.chip.misplaced { box-shadow: 0 0 0 3px var(--warm); }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none; opacity: .92; transform-origin: center; box-shadow: 0 12px 30px rgba(0, 0, 0, .25); }
.bins { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.bins.n3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 480px) { .bins { gap: 8px; } .bin { min-height: 116px; padding: 8px 6px; } .bins.n3 .chip { min-width: 0; max-width: 100%; padding: 6px 8px; font-size: 15px; } }
.bin { min-height: 130px; border-radius: 20px; border: 2.5px dashed var(--line); padding: 10px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, background .15s; }
.bin.over, .picking .bin:hover { border-color: var(--accent); background: var(--accent-soft); }
.binhead { display: flex; align-items: center; justify-content: center; gap: 8px; font: 750 17px var(--round); text-align: center; }
.binhead .vis { width: 44px; height: 44px; }
.binbody { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.slot { min-width: 72px; min-height: 76px; border-radius: 16px; border: 2.5px dashed var(--line); display: grid; place-items: center; position: relative; padding: 4px; }
.slot.over { border-color: var(--accent); background: var(--accent-soft); }
.slotn { position: absolute; top: 3px; left: 7px; font-size: 12px; font-weight: 700; color: var(--ink-3); }
.slot .chip { box-shadow: none; }
.orderer.locked .chip, .sorter.locked .chip { cursor: default; }
.t-pre .chip { min-width: 84px; min-height: 84px; } .t-pre .chip .vis { width: 68px; height: 68px; }
.t-pre .slot { min-width: 92px; min-height: 96px; }

/* shading fractions */
.shader { display: grid; justify-items: center; gap: 10px; }
.vis.frac .part { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.vis.frac .part.on { fill: var(--coral); }
.vis.frac.big { width: min(100%, 420px); height: auto; }
.vis.frac.big[viewBox^="0 0 180"] { width: 240px; }
.part.tap { cursor: pointer; }
.shadecount { font-weight: 700; color: var(--ink-2); }

/* robot */
.robo { display: grid; gap: 12px; justify-items: center; }
.board { width: 100%; display: flex; justify-content: center; }
.board .vis.robot { width: min(100%, 400px); height: auto; }
.cell { fill: var(--surface); } .cell.alt { fill: var(--surface-2); }
.program { width: 100%; display: grid; gap: 8px; }
.lane { border-radius: 16px; border: 2px solid var(--line); padding: 8px 10px; background: var(--surface); }
.lane.active { border-color: var(--accent); }
.lanehead { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.lanehead span:first-child { flex: 1; }
.times { font: 800 16px var(--round); min-width: 28px; text-align: center; color: var(--ink); }
.mini { width: 44px; height: 44px; border-radius: 10px; border: 0; background: var(--surface-2); display: grid; place-items: center; }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; min-height: 48px; align-items: center; margin-top: 6px; }
.tok { min-width: 48px; height: 48px; border-radius: 12px; border: 0; background: var(--sky); color: #fff; display: inline-flex; align-items: center; justify-content: center; gap: 2px; padding: 0 8px; font-weight: 800; }
.tok.loop { background: var(--berry); }
.hint-empty { color: var(--ink-3); }
.budget { font-weight: 700; color: var(--ink-2); text-align: right; font-size: 15px; }
.budget.over { color: var(--warm); }
.palette { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pbtn { width: 64px; height: 64px; border-radius: 18px; border: 0; background: var(--sky); color: #fff; display: grid; place-items: center; box-shadow: 0 3px 0 #2E5E8F; }
.pbtn .ic { width: 30px; height: 30px; }
.pbtn.loop { background: var(--berry); box-shadow: 0 3px 0 #8A3555; }
.pbtn.ghostb { background: var(--surface-2); color: var(--ink-2); box-shadow: 0 3px 0 var(--line); }
.pbtn:active { transform: translateY(2px); box-shadow: none; }

/* graphs */
.grapher { display: grid; gap: 14px; }
@media (min-width: 700px) { .grapher { grid-template-columns: 1fr 1fr; align-items: center; } }
.pic { display: flex; justify-content: center; }
.vis.plane { width: min(100%, 340px); height: auto; background: var(--surface); border-radius: 14px; }
.gl { stroke: var(--line); stroke-width: 1; } .gl.ax { stroke: var(--ink-3); stroke-width: 1.6; }
.gt { font-size: 11px; fill: var(--ink-3); }
.ucurve { fill: none; stroke: var(--accent-2); stroke-width: 3.5; stroke-linecap: round; }
.tcurve { fill: none; stroke: var(--coral); stroke-width: 3; stroke-dasharray: 7 6; }
.tpt { fill: var(--coral); }
.sliders { display: grid; gap: 12px; }
.formula { font: 700 20px ui-monospace, Menlo, monospace; text-align: center; padding: 8px; border-radius: 12px; background: var(--surface-2); }
.slider { display: grid; grid-template-columns: minmax(70px, max-content) 1fr 48px; align-items: center; gap: 12px; font-weight: 700; }
.sname { white-space: nowrap; }
.slider input { width: 100%; height: 44px; accent-color: var(--accent); }
.sval { text-align: right; font-variant-numeric: tabular-nums; }

/* explore models */
.model { margin: 6px 0 16px; display: grid; gap: 12px; justify-items: center; }
.model .vis { max-width: 100%; height: auto; color: var(--ink); }
.model .ctrls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.model .readout { font: 750 20px var(--round); text-align: center; font-variant-numeric: tabular-nums; }
.model .slider { width: min(100%, 460px); }
.toggle { min-height: 48px; min-width: 48px; padding: 0 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; }
.toggle.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------- done ---------- */
.done-main { max-width: 520px; margin: 0 auto; min-height: 100vh; padding: 32px 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.done-art { position: relative; display: grid; justify-items: center; gap: 12px; }
.bigstars { display: flex; gap: 8px; } .bigstars i { color: var(--surface-3); } .bigstars i.on { color: var(--sun); }
.bigstars .ic { width: 48px; height: 48px; fill: currentColor; }
.bigstars i.on { animation: pop .5s both; } .bigstars i:nth-child(2) { animation-delay: .15s; } .bigstars i:nth-child(3) { animation-delay: .3s; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.15); } }
.done-main h1 { font-size: 26px; }
.done-stats, .stats3, .kstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.done-stats div, .stats3 div, .kstats div { background: var(--surface); border-radius: 16px; padding: 12px 6px; display: grid; gap: 2px; text-align: center; }
.done-stats b, .stats3 b, .kstats b { font: 800 24px var(--round); font-variant-numeric: tabular-nums; }
.done-stats small, .stats3 small, .kstats small { color: var(--ink-3); font-size: 13px; }
.done-actions { display: grid; gap: 10px; width: 100%; }
.t-pre .done-actions .btn { min-height: 76px; border-radius: 24px; }

/* ---------- progress ---------- */
.prog-main { max-width: 680px; }
.prog-head { display: flex; align-items: center; gap: 16px; margin: 8px 0 18px; }
.prog-head h1 { font-size: 26px; } .prog-head p { margin: 2px 0 0; color: var(--ink-3); }
.skills { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.skillrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: 14px; }
.lvl { display: inline-flex; gap: 4px; flex: none; } .lvl i { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); } .lvl i.on { background: var(--accent-2); }
.prog-actions, .parent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- parent ---------- */
.parent-main.narrow { max-width: 560px; }
.ph { font-size: 24px; margin: 8px 0 16px; }
.kids { display: grid; gap: 16px; }
@media (min-width: 900px) { .kids { grid-template-columns: 1fr 1fr; align-items: start; } }
.kidcard { background: var(--surface); border-radius: 22px; padding: 16px; box-shadow: var(--shadow); display: grid; gap: 14px; min-width: 0; align-content: start; }
.kidcard header { display: flex; align-items: center; gap: 12px; }
.kidcard header div { flex: 1; min-width: 0; }
.kidcard h2 { font-size: 19px; } .kidcard header small { color: var(--ink-3); }
.kstats { grid-template-columns: repeat(5, 1fr); gap: 6px; }
.kstats div { background: var(--surface-2); padding: 8px 2px; border-radius: 12px; }
.kstats b { font-size: 19px; } .kstats small { font-size: 11.5px; }
.kstats b.warm { color: var(--warm); }
.chart14 { display: grid; grid-template-columns: repeat(14, 1fr); gap: 4px; height: 76px; align-items: end; }
.c14 { height: 100%; display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.c14 i { display: block; width: 100%; background: var(--accent-2); border-radius: 5px 5px 0 0; min-height: 0; }
.c14.today { box-shadow: inset 0 0 0 2px var(--sun); }
.chart14-axis { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: -8px; }
.sk h3 { font-size: 14px; color: var(--ink-3); font-family: var(--font); font-weight: 650; margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 5px 11px; border-radius: 999px; font-size: 14px; font-weight: 600; }
.pill.good { background: var(--good-bg); color: var(--good); }
.pill.warm { background: var(--warm-bg); color: var(--warm); }
.avpick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.avopt { display: grid; place-items: center; padding: 6px; border-radius: 14px; cursor: pointer; min-height: 64px; }
.avopt input { position: absolute; opacity: 0; }
.avopt:has(input:checked) { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.avopt:has(input:focus-visible) { outline: 3px solid var(--sun); }
.secret { display: grid; gap: 10px; justify-items: start; }
dialog.sheet { border: 0; border-radius: 22px; padding: 22px 18px 18px; width: min(460px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
dialog.sheet::backdrop { background: rgba(20, 20, 16, .45); }
.sheet h2 { font-size: 21px; margin-bottom: 14px; }
.sheet-x { position: absolute; right: 8px; top: 8px; }

html.offline .net { display: inline-grid; }

/* ---------- v2: levels ---------- */
.lvl { display: grid; gap: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 14px; }
.seg-b { min-height: 44px; border: 0; border-radius: 11px; background: transparent; font-weight: 650; font-size: 15px; color: var(--ink-2); }
.seg-b.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.lvl-stat { margin: 0; font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ink-3); }
.dot.s-strong { background: var(--leaf); } .dot.s-steady { background: var(--sun); } .dot.s-hard { background: var(--soft-red); }
.suggest { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); font-weight: 600; font-size: 15px; }
.btn.small { min-height: 44px; padding: 0 14px; font-size: 15px; background: var(--accent); color: var(--accent-ink); }
.lvl-focus { margin: -4px 0 12px; color: var(--ink-2); }
.lvl-courses { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; max-height: 46vh; overflow: auto; }
.lvl-courses li { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.lvl-courses li svg { width: 34px; height: 34px; flex: none; border-radius: 9px; }
.lvl-courses li span { flex: 1; font-weight: 600; }
.lvl-courses li small { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.lvl-hist h3 { font-size: 15px; color: var(--ink-3); font-family: var(--font); font-weight: 650; margin: 4px 0 6px; }
.lvl-hist ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lvl-hist li { display: flex; justify-content: space-between; gap: 10px; font-size: 15px; }
.lvl-hist li span { color: var(--ink-3); }

/* ---------- v2: player scaffolding ---------- */
.pl-actions .hintbtn { flex: none; }
.t-pre .pl-actions .hintbtn span { display: none; }
.worked-ans { font-size: 19px; font-weight: 700; padding: 10px 14px; border-radius: 14px; background: var(--good-bg); color: var(--good); }
.challenge-tag { display: inline-block; align-self: flex-start; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: var(--warm-bg); color: var(--warm); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.stop.again .node { background: var(--warm-bg); color: var(--warm); }
.numrow .sign { font: 700 22px var(--round); color: var(--ink-2); background: var(--surface-2); }
.shader .part.shown.on { stroke: var(--good); stroke-width: 3; }
.chip.right { outline: 2px solid var(--good); }
.opts .opt.sel { outline-offset: 2px; }
.misses { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.misses li { display: grid; gap: 1px; font-size: 15px; }
.misses small { color: var(--ink-3); font-size: 13px; }
details.sk summary { cursor: pointer; list-style: none; min-height: 32px; display: flex; align-items: center; }
details.sk summary::-webkit-details-marker { display: none; }
details.sk summary h3 { margin: 0; }
details.sk summary::after { content: '›'; margin-left: 8px; color: var(--ink-3); transition: transform .2s; }
details.sk[open] summary::after { transform: rotate(90deg); }
.nextup { margin: 0; display: grid; gap: 1px; } .nextup span { color: var(--ink-3); font-size: 14px; }
.pill:not(.good):not(.warm) { background: var(--surface-2); color: var(--ink-2); }
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-weight: 600; max-width: calc(100vw - 32px); }
.voice-note { padding: 10px 14px; border-radius: 14px; background: var(--warm-bg); color: var(--warm); margin: 0 0 12px; }

/* ---------- v2: placement check, puzzle of the day ---------- */
.place-main { max-width: 520px; margin: 0 auto; padding: 16px 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.place-what { margin: 0; color: var(--ink-2); }
.place-bands { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 6px; }
.place-bands li { display: flex; justify-content: space-between; padding: 12px 16px; border-radius: 14px; background: var(--surface); font-weight: 600; }
.place-bands b { font-variant-numeric: tabular-nums; }
.place-link { justify-self: start; min-height: 44px; display: inline-flex; align-items: center; color: var(--accent); font-weight: 650; font-size: 15px; }
.daily { display: flex; align-items: center; gap: 14px; padding: 12px 14px; margin: 14px 0 0; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); min-height: 64px; }
.daily > span:nth-child(2) { flex: 1; display: grid; }
.daily small { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.daily b { font: 750 18px var(--round); }
.daily-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--warm-bg); color: var(--warm); }
.daily.done .daily-ic { background: var(--good-bg); color: var(--good); }
.t-pre .daily { min-height: 88px; } .t-pre .daily-ic { width: 64px; height: 64px; }

/* light/dark switch in the top bars: a moon while light, a sun while dark */
.theme-btn .t-sun { display: none; }
:root[data-theme="dark"] .theme-btn .t-sun { display: block; }
:root[data-theme="dark"] .theme-btn .t-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .t-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .t-moon { display: none; }
  :root:not([data-theme="light"]) .hero-sky { fill: #2C3548; }
  :root:not([data-theme="light"]) .hero-sun { fill: #F2D27A; }
  :root:not([data-theme="light"]) .hero-hill { fill: #6E6457; }
}
:root[data-theme="dark"] .hero-sky { fill: #2C3548; }
:root[data-theme="dark"] .hero-sun { fill: #F2D27A; }
:root[data-theme="dark"] .hero-hill { fill: #6E6457; }

/* learner photos (instead of a drawn animal) */
.avatar.photo { border-radius: 50%; object-fit: cover; display: block; }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
