/* public/css/app.css — layout and type for doing ✱ math (ux.md §1, BUILD-SPEC §10). Colors come only from the tokens in
   themes.css. A modern Craigslist: hairlines, lists, system fonts, one accent (asterisk violet) that means "asterisks". */

/* Zero specificity, so a theme's --font-ui / --font-display in themes.css (loaded first) still wins. */
:where(:root) {
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --font-display: var(--font-ui);
}
:root {
  --fs-meta: 0.8125rem; --fs-list: 0.9375rem; --fs-body: 1.0625rem; --fs-h2: 1.125rem; --fs-h1: 1.5rem; --fs-story: 1.125rem;
  --fs-problem: clamp(2rem, 7vw, 3.5rem); --fs-answer: clamp(1.75rem, 6vw, 2.5rem); --fs-hero: clamp(2rem, 6vw, 3.25rem);
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --gutter: 16px;
}
@media (min-width: 641px) { :root { --gutter: 24px; } }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
html[data-text="large"] { font-size: 112.5%; }
html[data-text="larger"] { font-size: 125%; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; font: 400 var(--fs-body)/1.5 var(--font-ui); font-variant-numeric: tabular-nums; overflow-wrap: break-word; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 var(--s2); }
h1 { font-size: var(--fs-h1); font-weight: 700; }
p { margin: 0 0 var(--s3); }
ul, ol { margin: 0 0 var(--s3); padding-left: 1.4em; }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1[tabindex="-1"]:focus { outline: none; } /* a heading focused on load, for screen readers: not a control, so no ring */
img { max-width: 100%; height: auto; }
table { border-collapse: collapse; }
kbd { font-family: var(--font-mono); font-size: var(--fs-meta); border: 1px solid var(--rule); border-radius: 3px; padding: 0 4px; }
pre { font-family: var(--font-mono); white-space: pre-wrap; }
details > summary { cursor: pointer; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: var(--s2); top: -3em; background: var(--bg); padding: var(--s2); z-index: 10; }
.skip-link:focus { top: var(--s2); }
.meta { color: var(--muted); font-size: var(--fs-meta); }
.error { color: var(--ink); font-weight: 600; }
.notice { border: 1px dashed var(--muted); padding: var(--s2) var(--s3); }
.plain { list-style: none; padding: 0; }
.inline { display: inline; }
.inline-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.rows { list-style: none; padding: 0; }
.rows > li { padding: var(--s1) 0; border-bottom: 1px solid var(--rule); }
.title-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--s2) var(--s4); }
.stack > * + * { margin-top: var(--s2); }
.row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }

/* The ✱ and money-ish amounts. Violet only for asterisks (DECISIONS §2). */
svg.ast { width: 0.8em; height: 0.8em; vertical-align: -0.05em; color: var(--accent); overflow: visible; }
.amt-ast, .mark-review, .fn-mark, .name-ast { color: var(--accent); }
.amt-ast svg.ast { color: inherit; }
.amt-spend, .amt-xp { color: var(--ink); }
.amt-spend svg.ast, .amt-zero svg.ast { color: inherit; }
.button.primary svg.ast { color: inherit; } /* the claim button: violet on ink would be unreadable (DECISIONS 2: no accent on buttons) */
.amt-zero { color: var(--muted); }
.ok { color: var(--ok); }

/* Buttons: primary (one per screen), secondary, and buttons that look like links. */
.button { display: inline-block; font: 600 var(--fs-body)/1.2 var(--font-ui); padding: 8px 16px; min-height: 44px; border-radius: 3px;
  border: 1px solid var(--ink); background: var(--bg); color: var(--ink); cursor: pointer; text-decoration: none; }
a.button, a.button:visited { color: var(--ink); }
.button.primary, a.button.primary, a.button.primary:visited { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.button.block { display: block; width: 100%; text-align: center; }
.button:disabled { opacity: 0.6; cursor: default; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
input, textarea, select { font: inherit; font-size: max(16px, 1rem); color: var(--ink); background: var(--field); border: 2px solid var(--muted); border-radius: 3px; padding: 6px 8px; max-width: 100%; }
input:focus, textarea:focus { border-color: var(--focus); }
::placeholder { color: var(--muted); opacity: 1; }

/* ---------------------------------------------------------------- header */
.site-header { border-bottom: 1px solid var(--rule); }
.strip { max-width: 1400px; margin: 0 auto; padding: var(--s4) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s6); }
.wordmark, .wordmark:visited { font: 800 clamp(1.5rem, 5vw, 2.25rem)/1 var(--font-ui); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.wordmark svg.ast { width: 0.8em; height: 0.8em; vertical-align: -0.02em; }
.stats { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); }
.stat { display: flex; align-items: center; gap: var(--s2); }
.stat b { font-size: var(--fs-body); font-weight: 700; white-space: nowrap; }
.claim-link { font-weight: 700; white-space: nowrap; } /* DECISIONS 35: "Claim bonus" while a complete block waits */
.bar { display: block; width: 8rem; height: 10px; border: 1px solid var(--ink); }
.bar > span { display: block; height: 100%; background: var(--ink); }
.wallet, .wallet:visited { display: inline-flex; align-items: center; gap: var(--s2); border: 2px solid var(--ink); padding: var(--s2) var(--s3);
  color: var(--ink); text-decoration: none; font: 800 1.5rem/1 var(--font-ui); position: relative; }
.wallet svg.ast { width: 0.85em; height: 0.85em; }
.wallet-delta { position: absolute; right: -0.2em; top: -1.2em; font: 600 var(--fs-meta)/1 var(--font-ui); color: var(--accent); }
.nav { max-width: 1400px; margin: 0 auto; padding: var(--s2) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s2) var(--s4); border-top: 1px solid var(--rule); }
.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.nav-list a, .nav-list a:visited { color: var(--link); }
.nav-list a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }
.nav-user { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s3); font-size: var(--fs-list); }
.name-ast svg.ast { width: 0.7em; height: 0.7em; margin-left: 2px; }
.signin-link { font-weight: 600; }
.site-header.focus .strip { flex-wrap: nowrap; padding-top: var(--s3); padding-bottom: var(--s3); gap: var(--s3); }
.site-header.focus .wordmark { font-size: 1.25rem; }
.focus-title { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.site-header.focus .wallet { font-size: 1.125rem; padding: var(--s1) var(--s2); }
@media (max-width: 480px) { /* phones: the wordmark shrinks to its ✱ so the course name keeps the room */
  .site-header.focus .wordmark { font-size: 0; }
  .site-header.focus .wordmark svg.ast { width: 1.25rem; height: 1.25rem; }
}
.quit { font-size: var(--fs-list); }
.quit-confirm { display: block; position: absolute; left: var(--gutter); right: var(--gutter); margin-top: var(--s2); padding: var(--s2) var(--s3);
  background: var(--bg); border: 1px solid var(--ink); z-index: 5; white-space: normal; }
.quit-confirm[hidden] { display: none; }
.site-header.focus { position: relative; }
.flash { max-width: 1400px; margin: var(--s3) auto 0; padding: var(--s2) var(--gutter); border-left: 3px solid var(--ink); }

/* ---------------------------------------------------------------- footer and dev bar */
.site-footer { max-width: 1400px; margin: var(--s7) auto 0; padding: var(--s4) var(--gutter) var(--s6); border-top: 1px solid var(--rule); color: var(--muted); font-size: var(--fs-meta); }
.site-footer .stub { border: 1px dashed var(--muted); padding: var(--s1) var(--s2); display: inline-block; }
.footer-links { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: flex-start; }
.kbd-help dl { margin: var(--s2) 0 0; display: grid; gap: var(--s1); }
.kbd-help dl div { display: flex; gap: var(--s2); }
.kbd-help dt { min-width: 4.5em; } .kbd-help dd { margin: 0; }
/* On answering pages the problem is the largest thing: only the keyboard help (and the dev bar) stay in the footer. */
.site-header.focus ~ .site-footer { margin-top: var(--s5); }
.site-header.focus ~ .site-footer .stub, .site-header.focus ~ .site-footer .footer-links > a { display: none; }
.dev-bar { margin-top: var(--s3); padding-top: var(--s2); border-top: 1px dashed var(--muted); font-family: var(--font-mono); display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }

/* ---------------------------------------------------------------- pages */
.page { max-width: 760px; margin: 0 auto; padding: var(--s5) var(--gutter); }
.page.narrow { max-width: 560px; }
.page.wide { max-width: 1100px; }
.sec-h { font-size: var(--fs-h2); font-weight: 700; margin-top: var(--s6); padding-bottom: var(--s1); border-bottom: 1px solid var(--rule); }
.moment { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: var(--s3) 0; margin: 0 0 var(--s3); }
.moment + .moment { border-top: 0; }
.moment-big { font: 800 1.75rem/1.1 var(--font-display); margin-bottom: var(--s1); }
.table { width: 100%; font-size: var(--fs-list); margin-bottom: var(--s4); }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: var(--fs-meta); border-bottom: 1px solid var(--rule); padding: var(--s1) var(--s2) var(--s1) 0; }
.table td { border-bottom: 1px solid var(--rule); padding: var(--s1) var(--s2) var(--s1) 0; vertical-align: top; }
.table .num { text-align: right; white-space: nowrap; }
.dots { letter-spacing: 1px; }

/* landing */
.hero { padding: var(--s7) 0 var(--s5); max-width: 46rem; }
.hero-title { font: 800 var(--fs-hero)/1.05 var(--font-display); letter-spacing: -0.02em; margin-bottom: var(--s4); }
.hero-title svg.ast { width: 0.45em; height: 0.45em; vertical-align: 0.4em; margin-left: 0.04em; }
.hero-sub { font-size: 1.25rem; max-width: 38rem; }
.how li { margin-bottom: var(--s2); max-width: 44rem; }
.learn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--s4) var(--s6); }
.learn-track { font-size: var(--fs-list); }
.group-name { font-size: var(--fs-meta); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 var(--s2); }
.footnote { margin-top: var(--s7); padding-top: var(--s3); border-top: 1px solid var(--rule); max-width: 44rem; }
.about .meme { margin: var(--s5) 0; max-width: 320px; }
.about figcaption { font-size: var(--fs-meta); color: var(--muted); margin-top: var(--s1); }

/* ---------------------------------------------------------------- home (DECISIONS 23): the index, and one side column.
   Phones first, one column: status strip, the bonus to claim, start here, box, reviews due, index, your week, receipts, friends. */
.home { max-width: 1400px; margin: 0 auto; padding: var(--s5) var(--gutter); display: flex; flex-direction: column; gap: var(--s6); }
.home-main, .home-side { display: contents; }
.home .payday, .home .sec-claim { order: 0; } .home .start-here { order: 1; } .home .sec-welcome { order: 2; } .home .sec-box { order: 3; }
.home .sec-reviews { order: 4; } .home .home-index { order: 5; } .home .sec-week { order: 6; } .home .sec-receipts { order: 7; }
.home .sec-friends { order: 8; }
.rail-h { font-size: var(--fs-h2); font-weight: 700; color: var(--ink); padding-bottom: var(--s1); border-bottom: 1px solid var(--rule); margin-bottom: var(--s3); }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); border-bottom: 1px solid var(--rule); margin-bottom: var(--s3); }
.rail-head .rail-h { border-bottom: 0; margin-bottom: 0; }
.rail-head a { font-size: var(--fs-list); }
.rail-sec p { margin-bottom: var(--s2); }
.rows.compact > li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--s3); padding: 6px 0; }
.rows.compact .meta { font-size: var(--fs-list); }
.start-here { border: 2px solid var(--ink); padding: var(--s4); }
.start-here p { font-size: var(--fs-story); }
.home .sec-welcome { margin-top: calc(var(--s4) - var(--s6)); } /* sits close under start here */
.sec-welcome p { margin-bottom: var(--s1); }
.payday { font-size: var(--fs-story); font-weight: 600; }
.share { font-size: var(--fs-list); margin: 0 0 var(--s2); }
.week { list-style: none; padding: 0; display: flex; gap: 6px; margin-bottom: var(--s3); }
.day { display: flex; flex-direction: column; align-items: center; gap: var(--s1); flex: 1; max-width: 2.5rem; }
.day-label { font-size: var(--fs-meta); color: var(--muted); }
.sq { display: block; width: 100%; aspect-ratio: 1; border: 2px solid var(--ink); }
.day.is-counted .sq { background: var(--ink); }
.day.is-missed .sq { border-color: var(--muted); }
.day.is-today .sq { border-style: dashed; }
.day.is-future .sq { border-color: var(--rule); }
.rules { padding-left: 1.3em; }
.rules li { margin-bottom: var(--s2); }
.receipts { list-style: none; padding: 0; font-size: 1rem; }
.receipts li { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 0 var(--s3); padding: 6px 0; border-bottom: 1px solid var(--rule); }
.rid { font-family: var(--font-mono); font-size: var(--fs-meta); align-self: baseline; }
.rid, .rid:visited { color: var(--muted); }
.ramt { white-space: nowrap; font-weight: 600; }
@media (max-width: 480px) { /* phones: the reason gets its own line under the amount */
  .receipts li { grid-template-columns: auto minmax(0, 1fr); }
  .receipts .rwhy { grid-column: 2; }
}
@media (min-width: 1025px) {
  .home { display: grid; grid-template-columns: minmax(0, 2fr) minmax(20rem, 1fr); grid-template-areas: "pay pay" "main side";
    column-gap: var(--s7); row-gap: 0; align-items: start; }
  .home .payday { grid-area: pay; margin-bottom: var(--s5); }
  .home-main, .home-side { display: flex; flex-direction: column; gap: var(--s6); }
  .home-main { grid-area: main; } .home-side { grid-area: side; }
}

/* the course index (Craigslist columns) */
.index-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s2) var(--s4); margin-bottom: var(--s4); }
.index-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.cat-group { margin-bottom: var(--s7); }
.index .group-name { font-size: 1.5rem; font-weight: 800; text-transform: none; letter-spacing: 0; color: var(--ink); margin: 0 0 var(--s4); }
.tracks { column-width: 15rem; column-gap: var(--s6); }
.home .tracks { columns: 2 17rem; column-gap: var(--s7); }
.cat-track { break-inside: avoid; margin-bottom: var(--s6); }
.cat-group:last-child, .cat-track:last-child { margin-bottom: 0; }
.track-title { font-size: var(--fs-h2); font-weight: 700; text-transform: lowercase; padding-bottom: var(--s1); border-bottom: 1px solid var(--rule); margin-bottom: var(--s1); }
.courses { list-style: none; padding: 0; margin: 0; font-size: var(--fs-body); }
.course-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 6px 0; line-height: 1.4; }
.course-row .mark { flex: none; font: 0.875rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.course-row .mark-review { color: var(--accent); font-weight: 700; }
.course-row.is-locked a, .course-row.is-soon a { color: var(--muted); text-decoration-style: dotted; }
.course-row.has-key a { color: var(--link); text-decoration-style: solid; }
.course-row .mark-key { color: var(--ink); }
.course-row .mark-review svg.ast { width: 0.9em; height: 0.9em; }
.lock { width: 0.8em; height: 0.8em; vertical-align: -0.05em; }
@media (max-width: 640px) { .course-row { padding: var(--s2) 0; } }

/* ---------------------------------------------------------------- course page */
.crumbs { margin-bottom: var(--s2); }
.status { font-weight: 600; }
.start { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); margin-bottom: var(--s3); }
.start p { flex-basis: 100%; margin: 0; }
.skills { list-style: none; padding: 0; }
.skill { padding: var(--s2) 0; border-bottom: 1px solid var(--rule); }
.skill-line { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: baseline; margin: 0; }
.skill-now { margin-left: auto; font-family: var(--font-mono); font-size: var(--fs-meta); }
.example { margin-top: var(--s1); font-size: var(--fs-list); }
.example-body { padding: var(--s2) 0 0 var(--s3); border-left: 1px solid var(--rule); margin-top: var(--s1); }
.example .prompt { font-size: var(--fs-story); white-space: pre-line; }
.ladder { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); font-size: var(--fs-list); }
.ladder .step { display: flex; flex-direction: column; }
.ladder .is-current b { text-decoration: underline; }
.ladder .is-ahead b { color: var(--muted); }
.ptable { margin: var(--s2) 0 var(--s3); font-family: var(--font-mono); font-size: var(--fs-list); }
.ptable th, .ptable td { border: 1px solid var(--rule); padding: var(--s1) var(--s2); text-align: left; }
.ptable td { text-align: right; }

/* ---------------------------------------------------------------- the player (round and box card) */
.player { max-width: 560px; margin: 0 auto; padding: var(--s4) var(--gutter); }
.progress, .box-ladder { list-style: none; padding: 0; margin: 0 0 var(--s4); display: flex; flex-wrap: wrap; gap: 4px; }
.progress li, .box-ladder li { width: 20px; height: 20px; display: grid; place-items: center; font-size: 0.75rem; color: var(--muted); border: 1px solid transparent; }
.progress li::before { content: "·"; }
.progress li[data-state="correct"]::before { content: "✓"; color: var(--ink); }
.progress li[data-state="missed"]::before { content: "✗"; color: var(--ink); }
.progress li[data-state="current"], .box-ladder li[data-state="current"] { border-color: var(--ink); background: var(--mark); }
.progress li[data-state="current"]::before, .box-ladder li[data-state="current"]::before { content: ""; }
.box-ladder li::before { content: "·"; }
/* The same ✱ drawing as the SVG everywhere else, as a mask so it takes the accent color. */
.box-ladder li[data-state="solved"]::before { content: ""; width: 12px; height: 12px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M4.2 7.5l15.6 9M4.2 16.5l15.6-9' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M4.2 7.5l15.6 9M4.2 16.5l15.6-9' stroke='black' stroke-width='3.5' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.box-ladder li[data-state="solved-over-par"]::before { content: "+"; color: var(--ink); }
.box-ladder li[data-state="missed"]::before { content: "✗"; color: var(--ink); }
.box-ladder li[data-state="tossed"]::before { content: "○"; }
.card-meta { margin-bottom: var(--s3); }
.prompt { font: 500 var(--fs-problem)/1.15 var(--font-ui); white-space: pre-line; margin: var(--s4) 0 var(--s5); }
.prompt.story { font: 400 var(--fs-story)/1.45 var(--font-ui); max-width: 60ch; }
.answer-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.answer-input { font: 500 var(--fs-answer)/1.2 var(--font-ui); width: 11ch; min-width: 0; flex: 1 1 8rem; max-width: 100%; padding: 4px 8px; }
.affix { font-size: var(--fs-answer); color: var(--muted); }
.affix.unit { font-size: var(--fs-body); }
.sign { min-width: 44px; }
.hint { margin-top: var(--s2); }
.skip-confirm { display: block; margin: var(--s2) 0; }
.skip-confirm[hidden] { display: none; }
.choices { list-style: none; padding: 0; display: grid; gap: var(--s2); }
.choice { width: 100%; text-align: left; font: 500 1.125rem/1.3 var(--font-ui); padding: var(--s3); min-height: 44px; border: 1px solid var(--ink); border-radius: 3px; background: var(--bg); color: var(--ink); cursor: pointer; }
.choice .key { font-family: var(--font-mono); color: var(--muted); margin-right: var(--s2); }
.fb { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--rule); }
.fb.soft { font-weight: 600; animation: none !important; } /* shown while the problem is still open: nothing may move (R2) */
.verdict { font-size: 1.25rem; }
.verdict > span { white-space: nowrap; }
.bonus { font-weight: 700; }
.explain { font-size: var(--fs-list); }
.next-row { margin-top: var(--s3); }
.ready { margin: var(--s4) 0; }  /* R19: before the first problem, nothing is timed */
.ready-title { font: 700 1.25rem/1.2 var(--font-ui); margin-bottom: var(--s2); }
.report textarea { width: 100%; display: block; margin: var(--s2) 0; }
.notice { font-size: var(--fs-list); }

/* ---------------------------------------------------------------- results, wallet, receipt */
.summary { font-size: 1.25rem; font-weight: 600; margin-bottom: var(--s1); }
.award { font-size: 1.25rem; font-weight: 700; }
.why { font-size: var(--fs-story); font-weight: 600; border-left: 3px solid var(--ink); padding-left: var(--s3); margin: var(--s2) 0 var(--s4); } /* DECISIONS 33 */
.again { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin: var(--s4) 0; }
.prompt-cell { white-space: pre-line; }
.answer-receipts { margin-top: var(--s2); font-size: var(--fs-list); }
.answer-receipts > summary { color: var(--muted); }
.wallet-balance { font: 800 1.75rem/1 var(--font-ui); margin: 0; }
.filters a[aria-current="page"] { color: var(--ink); font-weight: 700; text-decoration: none; }
.wallet-table .when { white-space: nowrap; }
.sum-check { margin-top: var(--s3); font-size: var(--fs-list); }
.lines { display: grid; gap: var(--s1); margin: var(--s3) 0; }
.lines div { display: flex; justify-content: space-between; gap: var(--s4); border-bottom: 1px solid var(--rule); padding: var(--s1) 0; }
.lines dt { color: var(--muted); } .lines dd { margin: 0; font-weight: 600; }
.paid { font-size: 1.25rem; font-weight: 700; }
@media (max-width: 640px) {
  .opt { display: none; }
  .wallet-table td, .wallet-table th { padding-right: var(--s1); }
  .wallet-table [data-testid="receipt-reason"] { overflow-wrap: anywhere; hyphens: auto; } /* 320 px at 125% text: no sideways scroll */
  .stats { gap: var(--s2) var(--s4); }
  .bar { width: 4rem; }
  .wallet { font-size: 1.25rem; }
}

/* ---------------------------------------------------------------- motion (flight.js). Flyers are fixed and never block input. */
.ast-fly { position: fixed; left: 0; top: 0; width: 18px; height: 18px; font: 700 18px/18px var(--font-ui); text-align: center; color: var(--accent);
  pointer-events: none; z-index: 50; will-change: transform, opacity; }
.ast-fly svg.ast { width: 18px; height: 18px; display: block; }
.sparkle-ray { position: fixed; width: 1.5px; height: 5px; margin: -2.5px 0 0 -0.75px; background: var(--accent); pointer-events: none; z-index: 51; }
.mini-wallet { position: fixed; top: var(--s2); right: var(--s2); z-index: 49; display: inline-flex; align-items: center; gap: var(--s1);
  border: 2px solid var(--ink); background: var(--bg); padding: var(--s1) var(--s2); font: 800 1rem/1 var(--font-ui); pointer-events: none; }
.mini-wallet svg.ast { width: 0.9em; height: 0.9em; }
@media (prefers-reduced-motion: no-preference) {
  html:not([data-motion="reduce"]) .fb { animation: rise 120ms ease-out; }
}
html[data-motion="full"] .fb { animation: rise 120ms ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- v2 (V2-SPEC §12.3; REVIEW-NOTES R32 (6)): the home side column
   gains the note, next up and where you are before the box; on phones they follow start-here (same order value keeps DOM order). */
.home .sec-note, .home .sec-next-up, .home .sec-where { order: 3; }
.home .sec-note .first-note { margin: 0; }
.course-row .learned { font-size: var(--fs-meta); margin-right: auto; }
.course-row.has-key .mark { white-space: normal; text-align: right; line-height: 1.3; }
.find-level { margin-top: var(--s3); }
.testout.has-key .sec-h { margin-top: var(--s4); }
.testout-offer { margin: var(--s4) 0; padding: var(--s3) 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.box-pay .table { margin: var(--s2) 0; }
.box-closed .why { font-weight: 700; }

/* ---------------------------------------------------------------- Round 5 (DECISIONS 40-49) */
.icon { display: inline-block; vertical-align: -0.1em; flex: none; }
.icon-key { width: 1.5em; height: 0.75em; vertical-align: 0; }
.icon-tip { width: 1em; height: 1em; }
.icon-unlock { width: 0.9em; height: 0.9em; }
.icon-ext { width: 0.8em; height: 0.8em; margin-left: 0.2em; vertical-align: -0.02em; }
.key-line { display: inline-flex; align-items: baseline; gap: var(--s2); }
.key-line .icon-key { align-self: center; }
/* A labelled note: "(i) Good to know" / "(i) Note" / "(i) Tip" leads the text, so it never reads as part of a result. */
.tip-label { display: inline-flex; align-items: center; gap: var(--s1); font-weight: 700; margin-right: var(--s2); color: var(--ink); white-space: nowrap; }
.tip-line { border-left: 3px solid var(--rule); padding: var(--s1) 0 var(--s1) var(--s3); margin: var(--s2) 0; }
.tip-line.meta .tip-label { font-size: var(--fs-meta); }
.first-note .tip-label { display: flex; margin: 0 0 var(--s1); }
/* The verdict leads with a mark: ✓ right, ✗ wrong, ○ tossed or skipped, ⏱ time's up. */
.verdict-mark { display: inline-block; min-width: 1.1em; font-weight: 800; }
.verdict .miss-word { font-weight: 700; }
/* The header: the streak's compact multiplier and its tooltip (hover, focus, tap). */
.streak-stat { position: relative; }
.streak-mult { font: inherit; font-weight: 600; background: none; border: 0; padding: 2px 4px; margin: -2px 0; color: var(--ink); cursor: help;
  text-decoration: underline dotted; text-underline-offset: 3px; min-height: 32px; }
.tip-pop { display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; width: min(18rem, calc(100vw - 32px)); padding: var(--s2) var(--s3);
  background: var(--bg); color: var(--ink); border: 1px solid var(--ink); border-radius: 3px; font-size: var(--fs-list); font-weight: 400; line-height: 1.4; }
.streak-stat:not(.js-tip):hover .tip-pop, .streak-stat:not(.js-tip):focus-within .tip-pop, .tip-pop.open { display: block; }
/* XP beside the level bar, with its marker: where flying XP lands. */
.xp-mark { display: inline-block; font: 800 0.625rem/1 var(--font-ui); letter-spacing: 0.04em; border: 1.5px solid currentColor; border-radius: 3px; padding: 2px 3px; vertical-align: 0.15em; }
.xp-num { font: 600 var(--fs-meta)/1 var(--font-mono); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.level-stat.compact { gap: var(--s1) var(--s2); }
.level-stat.compact b { font-size: var(--fs-list); }
.level-stat.compact .bar { width: 3.5rem; }
@media (max-width: 480px) { .level-stat.compact .bar, .level-stat.compact b { display: none; } }
.xp-fly { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 50; font: 800 0.75rem/1 var(--font-ui); color: var(--ink); background: var(--bg);
  border: 1.5px solid var(--ink); border-radius: 3px; padding: 2px 4px; white-space: nowrap; will-change: transform, opacity; }
.xp-delta { font: 600 var(--fs-meta)/1 var(--font-ui); color: var(--ink); margin-left: 2px; }
/* How to work a problem (DECISIONS 45): one quiet line in the player, the course page and the Learn page. */
.work-mode { display: inline-flex; align-items: baseline; gap: var(--s1); font-size: var(--fs-meta); color: var(--muted); margin: 0 0 var(--s2); }
.work-mode b { color: var(--ink); font-weight: 700; }
/* The lesson, inside a round (DECISIONS 49): a dialog over the player, so the round stays where it is. */
.lesson-open { font-size: var(--fs-list); white-space: nowrap; }
.lesson-dialog { width: min(40rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: var(--s4); border: 1px solid var(--ink); border-radius: 3px;
  background: var(--bg); color: var(--ink); }
.lesson-dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.lesson-dialog .dialog-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
.lesson-dialog h2 { font-size: var(--fs-h1); margin: 0; }
/* Summaries (DECISIONS 47): the misses first, each with its method and help. */
.review-list { list-style: none; padding: 0; margin: 0 0 var(--s4); }
.review-item { border: 1px solid var(--rule); border-left: 3px solid var(--ink); padding: var(--s3); margin-bottom: var(--s3); }
.review-item .prompt-cell { font-size: var(--fs-story); margin-bottom: var(--s2); }
.review-item .explain { margin-bottom: var(--s2); }
.review-item .help { font-size: var(--fs-list); }
.review-item .help > * { margin-bottom: var(--s2); }
/* The box bonus, claimed on the summary (DECISIONS 46). */
.box-claim { border: 2px solid var(--ink); padding: var(--s3) var(--s4); margin: var(--s3) 0; }
.box-claim p { margin-bottom: var(--s2); }
.bonus-line { font-weight: 700; }
.lesson-brief .technique, .course-lesson .technique { margin-bottom: var(--s4); }
.tech-example-box { margin: 0 0 var(--s3); }
.tech-example-box .tech-example { padding: var(--s2) 0 0 var(--s3); border-left: 1px solid var(--rule); margin-top: var(--s1); }
.lesson-brief h3 { margin-top: var(--s4); }
.lesson-fold > summary { padding: var(--s2) 0; }
/* A keyed course row at phone width: the key text wraps under the level instead of pushing the page sideways. */
.course-row.has-key .mark { flex: 0 1 auto; min-width: 0; }
.course-row.has-key .mark-key { white-space: normal; }
.course-row .mark .icon-key { vertical-align: -0.05em; }
