/* Mewmentum (iq.gmcat.io). GmCat's own look: lilac paper, deep purple ink, periwinkle "badge" shadows, a peach mug accent.
   Night keeps the same shapes in plum. Blend of Pixel's Muglight Mile and Claude's lesson player, 2026-11-22. */
:root {
  --bg: #efeaf5; --bg2: #e5ddf0; --card: #fffdfb; --ink: #2f2340; --muted: #675c7c; --line: #dcd3e8;
  --brand: #5f56b8; --brand-ink: #ffffff; --peach: #ef9a76; --peach-ink: #3a1e12; --shadow: #9aa3dd;
  --ok: #1f7446; --ok-bg: #dff4e7; --ok-line: #8fd0aa; --miss: #8f5412; --miss-bg: #fdeed9; --miss-line: #eebf85; --danger: #b3382f;
  --c: var(--brand); --glow: rgba(239, 154, 118, .28);
  --font: ui-rounded, "Nunito", "Quicksand", "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #17131d; --bg2: #1e1826; --card: #241d2e; --ink: #f1ecf7; --muted: #b3a9c3; --line: #3b3149;
  --brand: #aab1f2; --brand-ink: #1b1730; --peach: #f2a582; --peach-ink: #2a1626; --shadow: #4d5596;
  --ok: #7ddba3; --ok-bg: #1b3829; --ok-line: #2f6b4a; --miss: #f3c56a; --miss-bg: #382d1a; --miss-line: #77602c; --danger: #ff8f84;
  --glow: rgba(255, 216, 150, .10);
  color-scheme: dark;
}
[data-skill="patterns"] { --c: #8a62c4; } [data-skill="numbers"] { --c: #2f8c5c; } [data-skill="words"] { --c: #cf5a80; }
[data-skill="memory"] { --c: #4f79c9; } [data-skill="space"] { --c: #c47a1c; } [data-skill="speed"] { --c: #d85a3d; }
[data-skill="links"] { --c: #23898f; } [data-skill="clear"] { --c: #99673a; } [data-skill="start"] { --c: #5f56b8; }
html[data-theme="dark"] [data-skill="patterns"] { --c: #b592ea; } html[data-theme="dark"] [data-skill="numbers"] { --c: #6fd09a; }
html[data-theme="dark"] [data-skill="words"] { --c: #f08fae; } html[data-theme="dark"] [data-skill="memory"] { --c: #8fb0f2; }
html[data-theme="dark"] [data-skill="space"] { --c: #f0b25c; } html[data-theme="dark"] [data-skill="speed"] { --c: #ff9076; }
html[data-theme="dark"] [data-skill="links"] { --c: #62cdd3; } html[data-theme="dark"] [data-skill="clear"] { --c: #d9a877; }
html[data-theme="dark"] [data-skill="start"] { --c: #aab1f2; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; color: var(--ink); background: var(--bg);
  font: 17px/1.55 var(--font);
  background-image: radial-gradient(circle at 50% 120px, var(--glow), transparent 360px), radial-gradient(var(--line) 1px, transparent 1.3px);
  background-size: 100% 100%, 22px 22px; background-attachment: fixed;
}
a { color: var(--brand); text-underline-offset: .18em; }
h1, h2, h3, p { margin: 0 0 .6em; }
h1 { font-size: clamp(1.45rem, 4.4vw, 2rem); line-height: 1.18; letter-spacing: -.01em; }
h2 { font-size: 1.22rem; line-height: 1.25; }
h3 { font-size: 1rem; margin-top: 1.1em; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
img.cat, img.ted { image-rendering: auto; user-select: none; }
img.ted { image-rendering: pixelated; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 50; background: var(--brand); color: var(--brand-ink); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; border-radius: 6px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; } .grow { flex: 1; min-width: 0; }
.eyebrow { font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); margin-bottom: .35em; }

/* ---- top bar and tabs ---- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 8px max(14px, env(safe-area-inset-left)) 8px max(14px, env(safe-area-inset-right)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 900; font-size: 1.1rem; }
.brand small { font-size: .62rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--peach); color: var(--peach-ink); padding: 2px 6px; border-radius: 99px; }
.tabs { display: flex; gap: 2px; margin: 0 auto; }
.tabs a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 12px; text-decoration: none; color: var(--muted); font-weight: 800; font-size: .95rem; }
.tabs a i { font-style: normal; }
.tabs a.on { color: var(--ink); background: var(--card); box-shadow: 0 2px 0 var(--shadow); }
.tabs a:hover { color: var(--ink); }
.chips { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.chip { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 99px; background: var(--card); border: 1.5px solid var(--line); color: var(--muted); font-weight: 800; font-size: .88rem; text-decoration: none; white-space: nowrap; }
.chip.lit { color: var(--peach-ink); background: var(--peach); border-color: transparent; }
.themebtn { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--card); }
.themebtn .moon, html[data-theme="dark"] .themebtn .sun { display: none; } html[data-theme="dark"] .themebtn .moon { display: inline; }
.update { position: sticky; top: 56px; z-index: 19; background: var(--peach); color: var(--peach-ink); padding: 8px 14px; text-align: center; font-weight: 800; }
.update button { margin-left: 8px; border: 0; border-radius: 99px; padding: 4px 12px; background: var(--peach-ink); color: #fff; font-weight: 800; }
@media (max-width: 960px) {
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; margin: 0; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
  .tabs a { flex-direction: column; gap: 0; padding: 4px 6px; font-size: .7rem; min-width: 56px; }
  .tabs a i { font-size: 1.15rem; line-height: 1.2; }
  .tabs a.on { box-shadow: none; background: transparent; color: var(--brand); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .top { backdrop-filter: none; background: var(--bg); }   /* a blurred bar would trap the fixed tab bar inside it */
  .brand span { font-size: 1rem; }
  .brand img { width: 32px; height: 32px; }
  .chip { padding: 4px 8px; font-size: .82rem; }
  .themebtn { width: 32px; height: 32px; }
}
body.in-lesson .top, body.in-lesson .foot, body.in-lesson .update { display: none; }
body.in-lesson { padding-bottom: 0; }

/* ---- pages and cards ---- */
#view { flex: 1; outline: none; }
.page { width: min(760px, 100% - 24px); margin: 18px auto 30px; display: grid; gap: 16px; }
.page > *, .doc > * { min-width: 0; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: clamp(16px, 4vw, 24px); box-shadow: 0 4px 0 var(--line); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding: 16px max(16px, env(safe-area-inset-left)); color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.foot a { color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: center; }
.btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 44px; padding: 9px 16px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; text-decoration: none; box-shadow: 0 3px 0 var(--line); transition: transform .06s, box-shadow .06s; line-height: 1.2; text-align: center; }
.btn small { font-size: .7rem; font-weight: 700; opacity: .85; letter-spacing: .02em; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: transparent; box-shadow: 0 4px 0 var(--shadow); }
.btn.primary:active:not(:disabled) { box-shadow: 0 1px 0 var(--shadow); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: transparent; }
.btn.big { min-height: 54px; padding: 12px 22px; font-size: 1.05rem; border-radius: 16px; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ticks { list-style: none; padding: 0; margin: 0 0 .8em; display: grid; gap: 10px; }
.ticks li { padding-left: 30px; position: relative; }
.ticks li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); font-weight: 900; text-align: center; line-height: 22px; font-size: .85rem; }
.nudge { background: var(--bg2); border-radius: 12px; padding: 10px 12px; font-size: .95rem; margin: 10px 0 0; }
.goalbar { height: 12px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.goalbar i { display: block; height: 100%; border-radius: 99px; background: var(--peach); transition: width .4s; }

/* ---- welcome ---- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.hero-art img { display: block; animation: floaty 4s ease-in-out infinite; }
.lead { font-size: 1.06rem; color: var(--muted); }
@keyframes floaty { 50% { transform: translateY(-7px); } }
@media (max-width: 620px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero-art img { margin: 0 auto; width: 132px; height: 132px; } .hero .actions { justify-content: center; } }
.goalpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.goalpick button { display: flex; flex-direction: column; gap: 2px; align-items: center; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); }
.goalpick button small { color: var(--muted); font-size: .75rem; }
.goalpick button.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); box-shadow: 0 3px 0 var(--shadow); }

/* ---- today ---- */
.today { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.today h1 { font-size: clamp(1.2rem, 3.8vw, 1.55rem); }
.today .goalbar { margin: 4px 0 6px; }
@media (max-width: 560px) { .today { grid-template-columns: 1fr; } .today-cat { display: flex; justify-content: center; } .today-cat img { width: 92px; height: 92px; } .today .actions .btn { flex: 1 1 100%; } }

/* ---- the Mile ---- */
.mile-title { text-align: center; margin: 8px 0 -4px; font-size: 1.05rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.mile { display: grid; }
.stop { background: var(--card); border: 1.5px solid var(--line); border-top: 6px solid var(--c); border-radius: 20px; padding: 16px; box-shadow: 0 4px 0 var(--line); }
.stop.closed { opacity: .72; }
.stop-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.stop-head h2 { margin: 0; } .stop-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.stop-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: color-mix(in srgb, var(--c) 16%, var(--card)); color: var(--c); font-size: 1.3rem; font-weight: 900; flex: none; }
.stop-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.stop-count { font-weight: 900; color: var(--c); }
.grade { border: 0; border-radius: 99px; padding: 3px 9px; font-size: .72rem; font-weight: 800; white-space: nowrap; background: var(--bg2); color: var(--muted); }
.grade-real { background: var(--ok-bg); color: var(--ok); } .grade-score, .grade-maybe { background: var(--miss-bg); color: var(--miss); }
.path-join { width: 0; height: 26px; margin: 0 auto; border-left: 4px dotted var(--shadow); }
.trail { list-style: none; margin: 16px 0 4px; padding: 0; display: grid; justify-items: center; gap: 10px; }
.trail li + li::before { content: ""; display: block; width: 0; height: 12px; margin: 0 auto 8px; border-left: 4px dotted var(--line); }
.trail li:nth-child(4n+2) { transform: translateX(54px); } .trail li:nth-child(4n+4) { transform: translateX(-54px); }
.node { position: relative; display: grid; justify-items: center; gap: 4px; background: none; border: 0; padding: 0; text-decoration: none; color: var(--ink); width: 150px; }
.node .dot { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; font-weight: 900; font-size: 1.25rem; background: color-mix(in srgb, var(--c) 14%, var(--card)); color: var(--c); border: 3px solid var(--c); box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, var(--line)); transition: transform .08s; }
.node .lab { font-size: .82rem; font-weight: 800; text-align: center; line-height: 1.2; }
.node.done .dot { background: var(--c); color: #fff; } html[data-theme="dark"] .node.done .dot { color: #1b1730; }
.node.locked .dot { border-color: var(--line); background: var(--bg2); color: var(--muted); box-shadow: 0 5px 0 var(--line); font-size: 1rem; }
.node.locked .lab { color: var(--muted); }
.node:active .dot { transform: translateY(4px); }
.node.next .dot { animation: pulse 1.8s ease-in-out infinite; }
.node .here { position: absolute; top: -8px; left: calc(50% + 26px); animation: floaty 2.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 5px 0 color-mix(in srgb, var(--c) 55%, var(--line)), 0 0 0 9px color-mix(in srgb, var(--c) 22%, transparent); } }
.closed-note, .stop-foot { text-align: center; margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 420px) { .stop-head { grid-template-columns: auto 1fr; } .stop-side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; } }

/* ---- practice ---- */
.walkcard, .ckintro, .level { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; }
.skillgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.skillcard { border-top: 6px solid var(--c); display: grid; gap: 10px; align-content: start; }
.skillcard header { display: flex; gap: 12px; align-items: center; } .skillcard h2, .skillcard header p { margin: 0; }
.lvl { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; font-size: .85rem; font-weight: 800; color: var(--muted); }
.lvl .goalbar i, .skillrow .goalbar i { background: var(--c); }
.honest { font-size: .9rem; color: var(--muted); margin: 0; }
@media (max-width: 560px) { .walkcard, .ckintro { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* ---- lesson shell ---- */
#stage { position: fixed; inset: 0; z-index: 30; background: var(--bg); }
.lesson { position: relative; height: 100%; display: grid; grid-template-rows: auto 1fr auto; max-width: 680px; margin: 0 auto; }
.l-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 8px; }
.xbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.15rem; flex: none; }
.xbtn:hover { background: var(--bg2); }
.bar { flex: 1; height: 14px; border-radius: 99px; background: var(--bg2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--peach); transition: width .35s; }
.l-count { min-width: 3.2em; text-align: right; font-size: .82rem; font-weight: 800; color: var(--muted); }
.l-scroll { overflow-y: auto; padding: 8px 18px 20px; -webkit-overflow-scrolling: touch; }
.l-body { display: grid; gap: 16px; align-content: start; }
.l-foot { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1.5px solid var(--line); background: var(--card); display: grid; gap: 8px; }
.l-foot .btn { width: 100%; }
.lesson.finished .l-foot { grid-template-columns: 1fr; }
.q { font-size: clamp(1.15rem, 4.2vw, 1.4rem); margin: 4px 0 0; outline: none; }
.q-long { font-size: clamp(1.02rem, 3.7vw, 1.2rem); font-weight: 700; line-height: 1.4; }
.hint { color: var(--muted); font-size: .95rem; margin: 0; text-align: center; }

/* stems */
.stem { display: grid; justify-items: center; }
.stem-pic svg { width: min(100%, 250px); height: auto; color: var(--ink); display: block; }
.stem-pic.wide svg { width: min(100%, 300px); }
.stem-pic.small svg { width: min(60%, 170px); }
.stem-pic, .worked .stem-pic { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 12px; }
.iso .iso-top { fill: color-mix(in srgb, currentColor 9%, var(--card)); } .iso .iso-left { fill: color-mix(in srgb, currentColor 28%, var(--card)); } .iso .iso-right { fill: color-mix(in srgb, currentColor 48%, var(--card)); }
.iso polygon { stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.stem-series, .stem-grid { gap: 8px; }
.stem-series { display: flex; flex-wrap: wrap; justify-content: center; }
.stem-series span, .stem-grid span { display: grid; place-items: center; min-width: 50px; height: 50px; padding: 0 10px; border-radius: 14px; background: var(--card); border: 1.5px solid var(--line); font-weight: 900; font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.stem-grid { display: grid; grid-template-columns: repeat(3, 62px); justify-content: center; }
.stem-grid span { min-width: 0; height: 56px; }
.stem .gap { border: 2px dashed var(--brand); color: var(--brand); background: transparent; }
.stem-big { font-size: clamp(1.9rem, 9vw, 2.6rem); font-weight: 900; padding: 14px 10px; letter-spacing: .01em; }
.stem-quote { font-size: 1.25rem; font-weight: 800; text-align: center; padding: 10px; }
.stem-analogy { gap: 8px; font-size: 1.2rem; }
.stem-analogy div, .stem-pair { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.stem-analogy b, .stem-pair b { padding: 6px 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line); font-weight: 900; }
.stem-analogy i, .stem-pair i, .stem-facts .then i { font-style: normal; color: var(--muted); font-size: .9rem; font-weight: 700; }
.stem-pair { font-size: 1.2rem; }
.stem-facts { justify-items: stretch; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; font-size: 1.08rem; font-weight: 700; }
.stem-facts p { margin: 0; } .stem-facts .then { border-top: 1.5px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.tedline { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; background: color-mix(in srgb, #f5b54a 16%, var(--card)); border: 1.5px solid color-mix(in srgb, #f5b54a 45%, var(--line)); border-radius: 16px; padding: 10px 12px; }
.tedline p { margin: 0; font-weight: 700; } .tedline .ted { grid-row: span 2; } .tedcheck { font-size: .82rem; color: var(--muted); font-weight: 700; }

/* options */
.opts { display: grid; gap: 10px; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--card); box-shadow: 0 3px 0 var(--line); text-align: left; font-weight: 700; transition: transform .05s; }
.opt .num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; border: 1.5px solid var(--line); color: var(--muted); font-size: .75rem; font-weight: 800; flex: none; }
.opt .txt { flex: 1; }
.opt.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, var(--card)); box-shadow: 0 3px 0 var(--shadow); }
.opt.on .num { border-color: var(--brand); color: var(--brand); }
.opt:active:not(:disabled) { transform: translateY(2px); }
.opt.good { border-color: var(--ok-line); background: var(--ok-bg); box-shadow: 0 3px 0 var(--ok-line); color: var(--ok); }
.opt.miss { border-color: var(--miss-line); background: var(--miss-bg); box-shadow: 0 3px 0 var(--miss-line); color: var(--miss); }
.opt:disabled { cursor: default; }
.opts-short, .opts-chips { grid-template-columns: repeat(2, 1fr); }
.opts-row { grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); }
.opts-row .opt, .opts-chips .opt, .opts-short .opt { justify-content: center; text-align: center; font-size: 1.08rem; font-weight: 800; }
.opts-row .txt, .opts-chips .txt, .opts-short .txt { flex: none; }
.opts-pic { grid-template-columns: repeat(2, 1fr); }
.opts-pic.n6 { grid-template-columns: repeat(3, 1fr); }
.opts-pic .opt { padding: 8px; justify-content: center; }
.opts-pic.compact.n4 { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.opts-pic.compact .opt { padding: 5px; border-radius: 14px; min-height: 0; }
.opts-pic.compact .num { display: none; }
.opts-pic.compact .pic { width: 100%; }
.opts-pic .num { position: absolute; left: 7px; top: 7px; }
.opts-pic .pic { display: block; width: min(100%, 118px); color: var(--ink); }
.opts-pic .pic svg, .worked-ans .pic svg { display: block; width: 100%; height: auto; }
.opts-pic .opt.good .pic { color: var(--ok); } .opts-pic .opt.miss .pic { color: var(--miss); }
@media (hover: none) { .opt .num { display: none; } }
.confrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.conf-label { grid-column: 1 / -1; text-align: center; font-size: .8rem; font-weight: 800; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.btn.conf { min-height: 50px; }
.btn.conf-sure:not(:disabled) { background: var(--brand); color: var(--brand-ink); border-color: transparent; box-shadow: 0 4px 0 var(--shadow); }
.btn.conf-maybe:not(:disabled) { border-color: var(--brand); color: var(--brand); }

/* typed answers */
.answerbox { min-height: 62px; display: grid; place-items: center; border-radius: 16px; border: 2px solid var(--line); background: var(--card); font-size: 1.9rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.answerbox .ph { font-size: 1rem; font-weight: 700; color: var(--muted); }
.answerbox.good { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); } .answerbox.miss { border-color: var(--miss-line); background: var(--miss-bg); color: var(--miss); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; width: 100%; margin: 0 auto; }
.key { height: 52px; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-size: 1.3rem; font-weight: 900; box-shadow: 0 3px 0 var(--line); }
.key:active { transform: translateY(3px); box-shadow: none; }
.key-del { color: var(--muted); } .keypad .key:nth-child(11) { grid-column: 2; } .keypad .key-del { grid-column: 1; grid-row: 4; }

/* memory */
.spanstage, .nbstage, .sprintstage { display: grid; justify-items: center; gap: 12px; padding: 10px 0; min-height: 150px; align-content: center; }
.flash { display: grid; place-items: center; width: 124px; height: 124px; border-radius: 28px; background: var(--card); border: 2px solid var(--line); font-size: 4rem; font-weight: 900; color: var(--muted); }
.flash.pop { color: var(--ink); border-color: var(--brand); box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 14%, transparent); }
.slots { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.slots span { display: grid; place-items: center; width: 40px; height: 50px; border-radius: 12px; border: 2px dashed var(--line); font-size: 1.5rem; font-weight: 900; }
.slots span.filled { border-style: solid; border-color: var(--brand); background: var(--card); }
.slots span.good { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok); } .slots span.miss { border-color: var(--miss-line); background: var(--miss-bg); color: var(--miss); }
.memgrid { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; width: min(100%, 320px); margin: 0 auto; }
.memgrid .cell { aspect-ratio: 1; border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 900; font-size: 1.2rem; color: var(--brand-ink); }
.memgrid .cell.lit { background: var(--peach); border-color: var(--peach); }
.memgrid .cell.on { background: var(--brand); border-color: var(--brand); }
.memgrid .cell.good { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); } .memgrid .cell.miss { background: var(--miss-bg); border-color: var(--miss); color: var(--miss); }
.memgrid .cell:disabled { cursor: default; }
.nbdots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; } .nbdots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); } .nbdots i.on { background: var(--brand); }
.matchbtn.pressed { background: var(--ok); box-shadow: 0 1px 0 var(--ok-line); transform: translateY(3px); }
.tally { font-size: 1.2rem; text-align: center; } .tally b { font-size: 2.2rem; display: block; line-height: 1.1; } .tally.bigt b { font-size: 3.4rem; color: var(--brand); }

/* sprints */
.clock { height: 12px; border-radius: 99px; background: var(--bg2); overflow: hidden; } .clock i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 99px; }
.sprintstage { min-height: 190px; font-size: 1.5rem; font-weight: 900; }
.sprintstage .line { padding: 6px 14px; border-radius: 12px; background: var(--card); border: 1.5px solid var(--line); }
.sprintstage .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .2em; font-size: 1.55rem; }
.sprintstage .target b { font-size: 2.2rem; color: var(--brand); } .sprintstage .row { font-size: 1.8rem; letter-spacing: .12em; }
.sprintstage.shake { animation: shake .25s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.sprintrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sprintbtn { min-height: 64px; font-size: 1.15rem; }
.sprintbtn.yes { background: var(--brand); color: var(--brand-ink); border-color: transparent; box-shadow: 0 4px 0 var(--shadow); }
.sprintrow.sides .sprintbtn { font-size: 1.6rem; background: var(--card); color: var(--ink); border: 2px solid var(--brand); box-shadow: 0 4px 0 var(--shadow); }

/* the rule lab */
.lablog { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.lablog li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; font-weight: 800; }
.lablog .fits { background: var(--ok-bg); color: var(--ok); } .lablog .nofit { background: var(--miss-bg); color: var(--miss); }
.labform { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 8px; }
.labnum { min-width: 0; width: 100%; height: 50px; text-align: center; font-size: 1.3rem; font-weight: 900; border-radius: 12px; border: 2px solid var(--line); background: var(--card); }
@media (max-width: 420px) { .labform { grid-template-columns: repeat(3, 1fr); } .labform .btn { grid-column: 1 / -1; } }

/* how-to cards */
.teach { display: grid; gap: 6px; background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; }
.teach h2 { font-size: 1.35rem; outline: none; } .teach p { margin: 0 0 .5em; }
.teachtop { display: flex; align-items: flex-end; gap: 8px; }
.worked { margin-top: 8px; padding: 14px; border-radius: 16px; background: var(--bg2); display: grid; gap: 10px; }
.worked .stem-pic { background: var(--card); } .worked .stem-pic svg { width: min(100%, 230px); }
.worked-ans { display: flex; align-items: center; gap: 10px; font-weight: 800; } .worked-ans .pic { width: 72px; padding: 4px; border-radius: 12px; border: 2px solid var(--ok-line); background: var(--ok-bg); color: var(--ok); } .worked-ans b { padding: 4px 12px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); }
.worked .why { font-size: .95rem; margin: 0; }

/* feedback */
.fb { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid; border-radius: 22px 22px 0 0; display: grid; gap: 8px; max-height: 78%; overflow-y: auto; animation: rise .18s ease-out; }
.fb.ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); } .fb.miss { background: var(--miss-bg); border-color: var(--miss-line); color: var(--miss); }
.fb-head { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; } .fb p { margin: 0; color: var(--ink); } .fb-extra { font-size: .93rem; font-weight: 700; }
.fb .btn { width: 100%; border-color: transparent; margin-top: 4px; }
.okbtn { background: var(--ok); color: var(--ok-bg); box-shadow: 0 4px 0 var(--ok-line); } .missbtn { background: var(--miss); color: var(--miss-bg); box-shadow: 0 4px 0 var(--miss-line); }
@keyframes rise { from { transform: translateY(30px); opacity: 0; } }
.lesson.answered .l-scroll { padding-bottom: 240px; }

/* done */
.finish { display: grid; justify-items: center; gap: 12px; text-align: center; padding: 8px 0 20px; }
.finish h2 { font-size: 1.6rem; margin: 0; outline: none; } .finish > .cat { animation: floaty 3s ease-in-out infinite; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.stats div { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 10px 4px; } .stats b { display: block; font-size: 1.35rem; } .stats span { font-size: .78rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.lines { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; width: 100%; text-align: left; } .lines li { display: flex; gap: 10px; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 10px 12px; font-weight: 700; }
.recap, .straight, .newbadges { width: 100%; text-align: left; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 14px; } .recap p, .straight p { margin: 0 0 .3em; }
.straight { background: var(--bg2); border-style: dashed; font-size: .93rem; }
.badge { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); opacity: .6; }
.badge.got { opacity: 1; border-color: var(--peach); background: color-mix(in srgb, var(--peach) 12%, var(--card)); }
.badge .ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg2); font-size: 1.3rem; flex: none; } .badge b { display: block; line-height: 1.2; } .badge small { color: var(--muted); font-size: .8rem; line-height: 1.25; display: block; }
.newbadges { display: grid; gap: 8px; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; } .confetti i { position: absolute; top: -14px; width: 9px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105%; transform: rotate(720deg); } }

/* me */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; max-width: 280px; margin: 10px 0; } .cal i { aspect-ratio: 1; border-radius: 8px; background: var(--bg2); } .cal i.on { background: var(--peach); } .cal i.nap { background: var(--shadow); }
.skillrows { display: grid; gap: 10px; margin-bottom: 10px; } .skillrow { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; font-size: .86rem; } .skillrow b { font-size: .98rem; } .skillrow .stop-ico { width: 36px; height: 36px; font-size: 1.05rem; border-radius: 11px; }
@media (max-width: 520px) { .skillrow { grid-template-columns: auto 1fr auto; } .skillrow > span:last-child { display: none; } }
.confline { display: grid; grid-template-columns: 56px 1fr 46px; gap: 4px 10px; align-items: center; margin: 8px 0; } .confline small { grid-column: 2 / -1; } .confline .goalbar i { background: var(--brand); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.ckhist { overflow-x: auto; } .ckhist table { width: 100%; border-collapse: collapse; font-size: .92rem; } .ckhist caption { text-align: left; color: var(--muted); font-size: .85rem; padding-bottom: 6px; }
.ckhist th, .ckhist td { text-align: left; padding: 7px 8px 7px 0; border-bottom: 1px solid var(--line); white-space: nowrap; } .delta { font-weight: 800; color: var(--muted); }
.spark { display: inline-flex; align-items: flex-end; gap: 3px; height: 24px; } .spark i { width: 7px; background: var(--brand); border-radius: 2px; }
.ckres { display: grid; gap: 8px; width: 100%; text-align: left; } .ckrow { display: grid; grid-template-columns: 110px 1fr 34px; gap: 2px 10px; align-items: center; background: var(--card); border: 1.5px solid var(--line); border-radius: 14px; padding: 9px 12px; } .ckrow small { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; } .ckrow b { text-align: right; font-size: 1.15rem; } .ckname { font-weight: 800; } .ckrow .goalbar i { background: var(--brand); }

/* dialogs */
.dlg-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; background: rgba(20, 14, 30, .55); }
.dlg { width: min(430px, 100%); background: var(--card); border: 1.5px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 8px 0 rgba(0, 0, 0, .18); display: grid; gap: 4px; justify-items: start; animation: rise .15s ease-out; }
.dlg h2 { margin-top: 6px; } .dlg-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; width: 100%; margin-top: 10px; } .dlg-row .btn { flex: 1 1 120px; }

/* evidence and how-it-works pages */
.doc { width: min(780px, 100% - 24px); margin: 18px auto 34px; display: grid; gap: 16px; }
.doc .card h1 { margin-top: 0; } .doc h2 { margin-top: .2em; }
.claim { border-left: 6px solid var(--line); } .claim.v-yes { border-left-color: var(--ok); } .claim.v-part { border-left-color: #c9962b; } .claim.v-unproven { border-left-color: var(--shadow); } .claim.v-no { border-left-color: var(--danger); }
.claim h2 { font-size: 1.12rem; } .verdict { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: .76rem; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; margin-bottom: 8px; }
.v-yes .verdict { background: var(--ok-bg); color: var(--ok); } .v-part .verdict { background: var(--miss-bg); color: var(--miss); } .v-unproven .verdict { background: var(--bg2); color: var(--muted); } .v-no .verdict { background: color-mix(in srgb, var(--danger) 14%, var(--card)); color: var(--danger); }
.claim .we { background: var(--bg2); border-radius: 12px; padding: 10px 12px; font-size: .94rem; } .claim .src { font-size: .84rem; color: var(--muted); margin: 8px 0 0; padding-left: 18px; } .claim .src li { margin: 3px 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; } .toc a { padding: 4px 10px; border-radius: 99px; background: var(--bg2); font-size: .84rem; font-weight: 700; text-decoration: none; color: var(--ink); }
.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; } .steps li { counter-increment: s; position: relative; padding-left: 44px; } .steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 900; display: grid; place-items: center; }
.stopslist { display: grid; gap: 10px; padding: 0; list-style: none; } .stopslist li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; } .stopslist p { margin: 0; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 480px) { .brand small { display: none; } .top { gap: 6px; } }
