/* Joey Math -- design system. Palette and figure tokens are lifted from
   bank/make_review.py so the figures render identically here as they did in
   the review tool. Defined on :root, redefined for dark, never inline. */

:root {
  --paper: #F8F5EE; --paper-2: #EFEAE0; --card: #FDFBF7; --ground: #EFEAE0;
  --ink: #1A1918; --ink-2: #383633; --ink-3: #78736A;
  --gold: #C2382C; --gold-deep: #A62B21; --gold-tint: #F8ECE9;
  --teal: #1F7A6C; --teal-tint: #E2F2EF;
  --coral: #C2553F; --coral-tint: #F9E9E3;
  --rule: #E2DCD1; --line: #E2DCD1;

  --fig-fill: #F8ECE9; --fig-stroke: #A62B21; --fig-faint: #E2DCD1;
  --fig-accent-fill: #E2F2EF; --fig-accent-stroke: #1F7A6C; --fig-label: #383633;
  --fig-top: #F8ECE9; --fig-left: #EDD9D3; --fig-right: #E0C1B8;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --mincho: 'Shippori Mincho', serif;
  --sans: 'Zen Kaku Gothic New', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Deliberately not following prefers-color-scheme -- the washi/sumi/
   vermilion palette is the whole point, and an auto-inverted dark mode
   read as a different, worse app rather than a "dark version" of this
   one. :root[data-theme="dark"] stays defined below as an opt-in-only
   hook, reachable only by something explicitly setting that attribute
   (nothing does today). */
:root[data-theme="dark"] {
  --paper: #1A1918; --paper-2: #232220; --card: #242220; --ground: #121110;
  --ink: #F8F5EE; --ink-2: #C9C4B8; --ink-3: #938D80;
  --gold: #E2685A; --gold-deep: #EF8A7E; --gold-tint: #35211E;
  --teal: #52D6C0; --teal-tint: #10332E;
  --coral: #FF8A72; --coral-tint: #391D16;
  --rule: #3A3733; --line: #35322D;

  --fig-fill: #35211E; --fig-stroke: #E2685A; --fig-faint: #3A3733;
  --fig-accent-fill: #10332E; --fig-accent-stroke: #52D6C0; --fig-label: #C9C4B8;
  --fig-top: #3E2925; --fig-left: #2E1E1B; --fig-right: #241512;
}

* { box-sizing: border-box; }

html {
  color-scheme: light;
  /* iOS Safari auto-boosts font size on text it decides reads as a
     "block" needing help -- most visible in narrow table cells with
     short content (a one-word note like "neat" or "D" sitting next to
     a longer, already-small .muted cell), inflating some cells but not
     others in the same table with no class difference between them.
     Pinning this stops the browser silently overriding sizes we set. */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0; background: var(--ground); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background-image: repeating-linear-gradient(to bottom, transparent 0 31px, color-mix(in srgb, var(--ink-2) 9%, transparent) 31px 32px);
}

img { max-width: 100%; }

/* Every number the kid reads is lining, tabular figures -- Garamond's
   default old-style digits dip below the baseline and jitter on timers. */
.num, .choice .val, .dots .n, dd.ans, .streak-count, .stat-num, table td, table th {
  font-variant-numeric: lining-nums tabular-nums;
}

a { color: var(--gold-deep); }

/* The ruled paper is nice as an ambient page texture but hard to read text
   over -- so the main content sits on its own solid sheet, the same way
   the settings form does, and the ruling only shows in the margin around it. */
.wrap {
  max-width: 720px; margin: 20px auto; padding: 28px 24px 40px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 6px;
}
.wrap.wide { max-width: 1040px; }
@media (max-width: 520px) {
  .wrap { margin: 0; border-width: 0 0 1.5px; border-radius: 0; padding: 22px 20px 36px; }
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0 0 10px; }
h1 { font-size: 2.1rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 12px; }
.deck { color: var(--ink-2); }

/* Header / chrome */
.topbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  padding: 14px 20px; border-bottom: 2px solid var(--ink); background: var(--paper);
  font-family: var(--sans); font-size: .8rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}
.topbar .wordmark { display: inline-flex; align-items: center; gap: 10px; text-transform: none; }
.topbar .wordmark .hanko {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 24px; height: 24px; border-radius: 3px; border: 1.5px solid var(--gold);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--gold) 12%, transparent);
  background: var(--gold-tint); color: var(--gold); font-family: var(--mincho); font-size: .7rem;
}
.topbar .wordmark .word { font-family: var(--serif); font-size: 1.05rem; font-weight: 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.topbar .wordmark em { font-style: italic; color: var(--gold-deep); }
.topbar nav { display: flex; gap: 18px; align-items: center; }
.topbar nav a { color: var(--ink-2); text-decoration: none; }
.topbar nav a:hover { color: var(--gold-deep); }
.topbar nav a.btn { color: var(--paper); }
.topbar nav a.btn.secondary { color: var(--ink); }
.topbar nav a.btn:hover { color: var(--paper); }
.topbar nav a.btn.secondary:hover { color: var(--ink); }
.nav-toggle {
  display: none; flex: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 4px; width: 34px; height: 34px; padding: 0; border: 1.5px solid var(--line); border-radius: 4px;
  background: var(--paper); cursor: pointer;
}
.nav-toggle span { display: block; width: 16px; height: 2px; background: var(--ink); }
/* Below this width the guest buttons (or the signed-in badge + sign out)
   no longer fit beside the wordmark without wrapping onto an awkward
   second line mid-button, so they collapse behind the hamburger instead --
   full width, one per row, revealed by nav-menu_controller.js. */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .topbar nav { display: none; width: 100%; flex-direction: column; align-items: stretch;
    gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1.5px solid var(--line); }
  .topbar nav.open { display: flex; }
  .topbar nav form { display: contents; }
  .topbar nav .btn, .topbar nav .kid-badge { width: 100%; text-align: center; }
}
.kid-badge { display: inline-flex; align-items: center; gap: 7px; }
.kid-icon { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: var(--paper-2);
  border: 1.5px solid var(--line); object-fit: contain; box-sizing: content-box; }
.kid-icon.kid-icon-lg { width: 44px; height: 44px; padding: 6px; }

/* Coach > Kids: icon/name/password/edit all lined up on one baseline per
   row, and Edit pushed to the row's far edge instead of just sitting in
   its own narrow column. */
.kids-table td { vertical-align: middle; }
.kids-table td:last-child { text-align: right; }

/* Kid-facing top nav -- always visible, so there's never a screen (mid-run
   included) a kid can't get back out of. */
.kid-nav {
  display: flex; gap: 0; flex-wrap: nowrap; align-items: center;
  padding: 0 20px; background: var(--paper-2); border-bottom: 1.5px solid var(--line);
  font-family: var(--sans); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
/* Even spacing -- each item carries its own padding rather than a flex
   gap, so the rhythm is the same regardless of label length. The
   button_to items are wrapped in a <form>, which is the flex child here,
   not the button inside it. */
.kid-nav .navlink {
  display: inline-flex; align-items: center; flex: none; white-space: nowrap;
  color: var(--ink-2); text-decoration: none; background: none; border: none;
  border-bottom: 2px solid transparent; padding: 13px 16px 11px;
  font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
/* Gated to real pointer devices -- on a touch scroll, swiping the nav
   sideways starts the drag on whatever item is under the finger, and iOS
   Safari leaves that item's :hover state visually stuck afterwards. With
   :hover using the same gold as .active, that reads as two nav items
   selected at once. Real mice don't have this problem, so only they get
   the hover color. */
@media (hover: hover) {
  .kid-nav .navlink:hover { color: var(--gold-deep); }
}
.kid-nav .navlink.active { color: var(--gold-deep); border-bottom-color: var(--gold-deep); }

.flash { max-width: 720px; margin: 16px auto 0; padding-inline: 20px; }
.flash .msg {
  border-left: 3px solid var(--gold); background: var(--gold-tint); color: var(--ink);
  padding: 11px 15px; border-radius: 0 5px 5px 0; margin-bottom: 10px; font-size: .92rem;
}
.flash .msg.alert { border-left-color: var(--coral); background: var(--coral-tint); }

/* Cards -- 2px borders, small radius, left border carries status */
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: 5px;
  padding: 20px 22px; margin-bottom: 16px;
}
.card.now { border-left: 5px solid var(--gold); }
.card.done { border-left: 5px solid var(--teal); }
.team-question .figure { margin-top: 12px; }
.team-question .notes { background: var(--paper-2); border-color: var(--rule); margin: 16px 0 0; }

/* The four doors on /today */
.doors { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
@media (max-width: 520px) { .doors { grid-template-columns: 1fr; } }
.door {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 2px solid var(--line); border-radius: 5px;
  padding: 22px 20px; min-height: 44px; transition: border-color .15s;
}
.door:hover { border-color: var(--gold); }
button.door { width: 100%; text-align: left; font: inherit; cursor: pointer; }
.door.disabled { opacity: .5; cursor: not-allowed; }
.door .label { font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin-bottom: 4px; }
.door .label .pill { font-family: var(--sans); vertical-align: middle; margin-left: 6px; }
.door .sub { color: var(--ink-2); font-size: .86rem; }
.door-icon { width: 28px; height: 28px; object-fit: contain; margin-bottom: 10px; }

/* Kid picker on / */
.kid-doors { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
@media (max-width: 480px) { .kid-doors { grid-template-columns: 1fr; } }
.kid-door {
  display: block; background: var(--card); border: 2px solid var(--line); border-radius: 5px; padding: 20px;
  text-align: center; text-decoration: none; color: inherit; transition: border-color .15s;
}
a.kid-door:hover { border-color: var(--gold); }
.kid-door .name { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-bottom: 10px; }
.kid-door input[type="password"] { width: 100%; margin-bottom: 10px; }
.kid-door input[type="submit"] { width: 100%; }

/* Forms */
label { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 5px; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"],
input[type="email"], select, textarea {
  font: inherit; font-size: 1rem; width: 100%; padding: 10px 12px; min-height: 44px;
  border: 1.5px solid var(--rule); border-radius: 4px; background: var(--paper); color: var(--ink);
  text-align: left;
}
textarea { min-height: 80px; }
/* iOS Safari styles date inputs natively: it centres the value and gives
   the control an intrinsic width it won't shrink below, so this one field
   sat wider than -- and misaligned against -- every other input in the
   same form. Opting out of the native appearance puts it back in line. */
input[type="date"] {
  -webkit-appearance: none; appearance: none;
  min-width: 0; max-width: 100%; display: block;
}
.field { margin-bottom: 14px; }
.field-label-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.field-label-row label { margin-bottom: 0; }
.copy-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 22px; height: 22px; padding: 0; border: 1.5px solid var(--rule); border-radius: 4px;
  background: var(--card); color: var(--ink-2); cursor: pointer;
}
.copy-btn:hover { border-color: var(--gold-deep); color: var(--gold-deep); }
.copy-btn .icon-check { display: none; }
[data-controller="clipboard"].copied .copy-btn { border-color: var(--teal); color: var(--teal); }
[data-controller="clipboard"].copied .copy-btn .icon-copy { display: none; }
[data-controller="clipboard"].copied .copy-btn .icon-check { display: block; }

/* Buttons default to a compact size everywhere (coach area, nav, chrome).
   Kid-facing gameplay controls (Go, Check, Try again, Next question...)
   opt into .lg, which is the one guaranteed to meet the 44px tap-target
   rule -- two of these will be tapped on an iPad, on the floor. .xs is for
   dense inline row actions (reorder/remove in the coach question list),
   which are mouse-driven admin controls, not something a kid taps. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .76rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; text-decoration: none; cursor: pointer;
  padding: 7px 14px; min-height: 34px; border-radius: 4px; border: 1.5px solid var(--ink);
  background: var(--ink); color: var(--paper);
}
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn.danger { background: var(--coral); border-color: var(--coral); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.lg { padding: 12px 22px; min-height: 44px; font-size: .86rem; }
#answer_actions .btn.lg { display: flex; width: 100%; }
.btn.xs { padding: 3px 9px; min-height: 26px; font-size: .66rem; letter-spacing: .02em; }
.btn-row { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.btn-row form { display: contents; }
/* Coach > Review: prev/next, status filters and a jump-to-ID box. */
.btn-row.review-nav { margin: 12px 0; }
.btn-row.review-nav form { display: inline-flex; gap: 6px; }
/* Rows that scroll sideways on a phone instead of wrapping; buttons keep
   their label on one line. */
.btn-row.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.btn-row.scroll > *, .btn-row.scroll form { flex: none; }
.btn-row.scroll .btn { flex: none; white-space: nowrap; }

/* Icon buttons: icon only on phones (square 44px tap target), icon + label
   from tablet width up. */
.ui-icon { width: 1.25em; height: 1.25em; flex: none; }
.btn.icon-btn { min-width: 44px; padding-left: 14px; padding-right: 14px; }
.btn.icon-btn .btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (min-width: 640px) {
  .btn.icon-btn { padding-left: 22px; padding-right: 22px; }
  .btn.icon-btn .btn-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}
.review-nav input[type="text"] { width: 7.5em; min-height: 34px; padding-top: 4px; padding-bottom: 4px; }

/* Question screen -- dots double as navigation: any question, answered or
   not, is one tap away, so a kid can skip around or go back and see an
   old one. The visual dot stays small; the link itself is a bigger tap
   target around it (kid-facing tap targets are 44px minimum elsewhere in
   this app -- see the .btn.lg/.choice rule below -- so this follows suit). */
.progress-dots { display: flex; gap: 2px; margin-bottom: 20px; flex-wrap: wrap; }
.progress-dots .dot {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; text-decoration: none;
}
.progress-dots .dot::before {
  content: ""; display: block; width: 12px; height: 12px; border-radius: 50%;
  border: 1.5px solid var(--rule); background: var(--card);
}
.progress-dots .dot.done::before { background: var(--teal); border-color: var(--teal); }
.progress-dots .dot.current::before { background: var(--gold); border-color: var(--gold); }

.setup { font-family: var(--serif); font-size: 1.15rem; line-height: 1.55; margin-bottom: 16px; }
.ask { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; line-height: 1.45; margin: 16px 0; }

.figure {
  background: var(--card); border: 1px solid var(--rule); border-radius: 4px; padding: 16px;
  margin-bottom: 18px;
}
.figure svg { display: block; width: 100%; height: auto; max-width: 100%; }
.fig-fill { fill: var(--fig-fill); }
.fig-stroke { stroke: var(--fig-stroke); fill: none; }
.fig-fill.fig-stroke { fill: var(--fig-fill); stroke: var(--fig-stroke); }
.fig-faint { stroke: var(--fig-faint); fill: none; }
.fig-accent-fill { fill: var(--fig-accent-fill); }
.fig-accent-stroke { stroke: var(--fig-accent-stroke); }
.fig-label { fill: var(--fig-label); font-family: var(--sans); }
.fig-face-top { fill: var(--fig-top); stroke: var(--fig-stroke); }
.fig-face-left { fill: var(--fig-left); stroke: var(--fig-stroke); }
.fig-face-right { fill: var(--fig-right); stroke: var(--fig-stroke); }
.fig-num { fill: var(--ink-3); font-family: var(--serif); font-variant-numeric: lining-nums tabular-nums; }

.choices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--card); border: 1.5px solid var(--rule); border-radius: 4px;
  padding: 12px 16px; min-height: 44px; font: inherit; cursor: pointer; color: var(--ink);
}
.choice .ltr {
  font-family: var(--sans); font-size: .78rem; font-weight: 700; width: 26px; height: 26px;
  border-radius: 50%; flex: none; display: grid; place-items: center;
  border: 1.5px solid var(--rule); color: var(--ink-2);
}
.choice .val { font-family: var(--serif); font-size: 1.25rem; }
.choice[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-tint); }
.choice[aria-pressed="true"] .ltr { background: var(--gold); border-color: var(--gold); color: var(--card); }
.choice.correct { border-color: var(--teal); background: var(--teal-tint); }
.choice.correct .ltr { background: var(--teal); border-color: var(--teal); color: var(--card); }
.choice.wrong { border-color: var(--coral); background: var(--coral-tint); }
.choice.wrong .ltr { background: var(--coral); border-color: var(--coral); color: var(--card); }

.fillin input { font-family: var(--serif); font-size: 1.3rem; text-align: center; }

.help-check { display: flex; align-items: center; gap: 10px; margin: 6px 0 20px; font-size: .92rem; color: var(--ink-2); }
.help-check input { width: 20px; height: 20px; flex: none; }

.feedback { display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 18px; border-radius: 5px; margin-bottom: 16px; border-left: 4px solid var(--teal); background: var(--teal-tint); }
.feedback.not-yet { border-left-color: var(--coral); background: var(--coral-tint); }
.feedback .headline { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; margin-bottom: 6px; }
.feedback .solution { color: var(--ink-2); font-size: .95rem; }
.feedback-icon { width: 36px; height: 36px; flex: none; object-fit: contain; }

/* The mini social layer -- only ever shown on a correct answer. */
.notes { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 16px 18px; margin-bottom: 16px; }
.notes h3 { font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin: 0 0 12px; }
.note-list { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.note-list li { display: flex; align-items: center; gap: 10px; }
.note-icon { width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: var(--paper-2);
  border: 1.5px solid var(--line); object-fit: contain; box-sizing: content-box; flex: none; }
.note-text { font-size: .92rem; line-height: 1.5; }
.note-text strong { color: var(--ink-2); }
.note-form label { margin-bottom: 8px; }
.note-form-row { display: flex; flex-direction: column; gap: 8px; }
.note-form-row input[type="submit"] { width: 100%; }
.note-hint { margin: 8px 0 0; font-size: .78rem; }

/* A soft build-out: each block settles in a beat after the one before it. */
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.reveal { animation: reveal .4s ease-out both; }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* A disabled demo-only button's whole response to a click -- see
   demo_lock_controller.js, which prevents the actual edit/delete and
   plays this instead. */
@keyframes demo-lock-pulse { 0% { opacity: 1; } 40% { opacity: .15; } 100% { opacity: 1; } }
.demo-lock-pulse { animation: demo-lock-pulse .35s ease; }
@media (prefers-reduced-motion: reduce) { .demo-lock-pulse { animation: none; } }

.stamp {
  display: inline-flex; align-items: center; gap: 6px; font-size: .66rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--gold-deep);
  background: var(--gold-tint); border: 1px solid var(--gold); border-radius: 100px; padding: 4px 11px;
}

/* Awards */
.award-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.award {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 5px; padding: 16px;
  text-align: center; opacity: .35;
}
.award.earned { opacity: 1; border-color: var(--gold); }
.award .icon { width: 48px; height: 48px; margin-bottom: 8px; object-fit: contain; }
.award:not(.earned) .icon { filter: grayscale(1); }
.award .label { font-family: var(--serif); font-weight: 600; font-size: .95rem; }

/* Team chart */
.chart-wrap { background: var(--card); border: 1px solid var(--line); border-radius: 5px; padding: 20px; overflow-x: auto; }

/* A visible break between "how the team is scoring" and "what the team has
   conquered together" -- two different questions, so the page should read
   as two rooms, not one long scroll. */
.team-section + .team-section { margin-top: 36px; padding-top: 32px; border-top: 2px solid var(--ink); }

/* Tables (mostly coach area) */
table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: .9rem; }
th, td { text-align: left; padding: 9px 11px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); border-bottom: 1.5px solid var(--rule); }
/* A table forced to width:100% inside a narrow .tw scroller has nowhere
   to put wide content but wrap/squeeze it -- .tw never actually gets to
   scroll. Let it size to its content instead (still filling the width
   when there's room to) so columns keep their natural width and .tw's
   overflow-x does the work it's there for. */
.tw { overflow-x: auto; }
.tw table { width: max-content; min-width: 100%; }

.pill { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .04em;
  border-radius: 100px; padding: 2px 10px; background: var(--paper-2); color: var(--ink-2); }
.pill.help { background: var(--coral-tint); color: var(--coral); }
.pill.verified { background: var(--teal-tint); color: var(--teal); }
.pill.draft { background: var(--gold-tint); color: var(--gold-deep); }
.pill.needs-work { background: var(--coral-tint); color: var(--coral); }

.seg { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 14px; }
.seg a, .seg button { flex: none; font-size: .78rem; font-weight: 600; padding: 7px 13px; border-radius: 100px;
  border: 1.5px solid var(--rule); background: var(--card); color: var(--ink-2); text-decoration: none; cursor: pointer; }
.seg a.active, .seg button.active { border-color: var(--gold); background: var(--gold-tint); color: var(--gold-deep); }

/* Coach question rows: current questions + add-question candidates. Each
   row is its own <tbody> so a hidden preview row can sit right under it. */
.qrow-actions { display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.qrow-preview td { background: var(--paper-2); padding: 14px 16px; }
/* Capped to a readable measure -- and, just as important, capped at all:
   a .tw table sizes to its content's natural width (see .tw table above),
   so an uncapped question/setup paragraph in a preview row would stretch
   the whole table to fit one unbroken line the moment the row toggles
   open, shifting every other (collapsed) row's columns as a side effect. */
.q-preview { max-width: 640px; }
.figure.small { padding: 10px; max-width: 320px; }
.q-preview .ask { font-size: 1.05rem; margin: 8px 0; }
.q-preview .setup { font-size: .95rem; margin-bottom: 8px; }
.q-preview-choices { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.q-preview-choices li { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.q-preview-choices .ltr {
  font-size: .65rem; font-weight: 700; width: 20px; height: 20px; border-radius: 50%;
  display: inline-grid; place-items: center; border: 1.5px solid var(--rule); color: var(--ink-2); flex: none;
}
.q-preview-choices li.is-answer { color: var(--teal); font-weight: 600; }
.q-preview-choices li.is-answer .ltr { background: var(--teal); border-color: var(--teal); color: var(--card); }

/* Homework-complete celebration screen */
.celebration { text-align: center; padding: 8px 0 20px; }
.celebration-icon { width: 120px; height: 120px; object-fit: contain; margin-bottom: 8px; }
.celebration h1 { margin-bottom: 6px; }

.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.stat {
  flex: 1 1 120px; text-align: center; background: var(--card); border: 2px solid var(--line);
  border-radius: 5px; padding: 14px 10px;
}
.stat-num { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; color: var(--ink); }
.stat-label { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }

/* Per-question review rows on the homework-complete screen -- a plain-div
   version of the coach/team question row (those are <tbody>-based, for a
   table); same collapsed-summary + toggle-to-reveal shape. */
.qrow { border: 1.5px solid var(--line); border-radius: 5px; margin-bottom: 10px; overflow: hidden; }
.qrow-summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.qrow-ask { flex: 1; }
.qrow-preview { padding: 0 14px 14px; }
/* Review row (/homework's per-question review list): question above its
   Got it/Needs practice pill, both left-aligned in their own column, the
   Review button pinned to the right by the sibling column taking the
   rest of the row's width. */
.review-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.review-info .qrow-ask { flex: none; }

/* The kid-facing homework list (/homework) -- every assignment, done or
   not, so she can revisit an old one's celebration screen. */
.hw-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  background: var(--card); border: 1.5px solid var(--line); border-radius: 5px;
  padding: 10px 14px; margin-bottom: 8px;
}
.hw-info { flex: 1 1 180px; min-width: 0; }
.hw-title { font-family: var(--serif); font-size: 1rem; font-weight: 600; }
.hw-sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-size: .82rem; color: var(--ink-2); }
/* margin-left: auto so the button still lands on the right even when it
   wraps to its own line under .hw-info on a narrow screen -- a lone
   flex-wrap line otherwise starts at the left despite justify-content. */
.hw-row .btn.lg { flex: none; margin-left: auto; }

.coach-nav {
  display: flex; gap: 16px; flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1.5px solid var(--line);
}
.coach-nav a { text-decoration: none; color: var(--ink-2); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em; flex: none; white-space: nowrap; }
.coach-nav a.active { color: var(--gold-deep); }

.coach-login input[type="submit"] { width: 100%; }

.muted { color: var(--ink-3); }
.mt { margin-top: 18px; }

/* Kid icon picker -- coach/kids/edit and, read-only, next to each name
   on the sign-in doors. */
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; margin-bottom: 16px; }
.icon-option { display: flex; flex-direction: column; align-items: center; gap: 5px;
  border: 1.5px solid var(--rule); border-radius: 5px; padding: 10px 6px; cursor: pointer; }
.icon-option img { width: 44px; height: 44px; border-radius: 50%; background: var(--paper-2); object-fit: cover; }
.icon-option span { font-size: .64rem; color: var(--ink-2); text-transform: capitalize; }
.icon-option:has(input:checked) { border-color: var(--gold); background: var(--gold-tint); }
.icon-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.kid-door .icon-tag { width: 56px; height: 56px; padding: 8px; border-radius: 50%; background: var(--paper-2);
  border: 1.5px solid var(--line); object-fit: contain; box-sizing: content-box; margin-bottom: 10px; }
.kid-door.single { max-width: 320px; margin: 0 auto; }
.kid-door.single .icon-tag { width: 88px; height: 88px; padding: 14px; }

.site-footer { max-width: 720px; margin: 40px auto 0; padding: 16px 20px 30px;
  font-size: .72rem; color: var(--ink-3); text-align: center; }
.site-footer a { color: var(--ink-3); text-decoration: underline; }

/* Marketing landing page (/) -- the front door before a coach has signed
   in or up. Centered, generous whitespace, no chrome beyond the shared
   topbar -- this is the one page in the app that isn't a worksheet. */
.landing-hero { max-width: 560px; margin: 48px auto; padding: 0 20px; text-align: center; color: var(--ink); }
.landing-hero h1 { font-family: var(--serif); font-size: 3rem; font-weight: 500; letter-spacing: -.01em; margin-bottom: 8px; }
.landing-kangaroo { width: 220px; height: 220px; margin: 20px auto; }
.landing-kangaroo img { width: 100%; height: 100%; border-radius: 50%; }
.landing-quote { font-family: var(--mincho); font-size: 1.4rem; font-weight: 500; letter-spacing: .04em; margin: 8px 0 2px; }
.landing-quote-translit { font-family: var(--serif); font-style: italic; font-size: .85rem; color: var(--ink-3); margin-bottom: 10px; }
.landing-divider { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 14px; }
.landing-divider span { width: 20px; height: 1px; background: var(--rule); }
.landing-divider .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--gold); flex: none; }
.landing-quote-meaning { font-size: .92rem; line-height: 1.6; color: var(--ink-2); max-width: 420px; margin: 0 auto; }
