/* Moon Lab styles. Colors come from tokens.css (see DESIGN.md for the rules). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ml-ground);
  color: var(--ml-ink);
  font-family: var(--ml-font-body);
  font-size: 1.0625rem;
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--ml-font-display); line-height: 1.2; margin: 0; }
p { margin: 0; }
a { color: var(--ml-teal-700); }
button { font: inherit; color: inherit; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 10;
  background: var(--ml-surface); color: var(--ml-ink); padding: 10px 16px; border-radius: 12px;
}
.skip:focus { top: 12px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.noscript { padding: 24px; }

:focus-visible { outline: 3px solid var(--ml-teal-700); outline-offset: 3px; border-radius: 6px; }
.stage :focus-visible, .topbar :focus-visible { outline-color: var(--ml-accent-soft); }

.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.2em; }

/* ---------- Top bar (night sky) ---------- */
.topbar {
  background:
    radial-gradient(1.5px 1.5px at 8% 30%, #fff, transparent),
    radial-gradient(1px 1px at 22% 70%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 41% 25%, #fff, transparent),
    radial-gradient(1px 1px at 63% 65%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 82% 35%, #fff, transparent),
    var(--ml-stage);
  color: var(--ml-stage-text);
}
.topbar-inner {
  max-width: 980px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 12px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--ml-font-display); font-weight: 700; font-size: 1.35rem;
  color: var(--ml-stage-text); text-decoration: none; letter-spacing: 0.01em;
}
.brand { min-height: 44px; display: inline-flex; align-items: center; }
.brand .logo { width: 36px; height: 36px; border-radius: 9px; display: block; }

main { max-width: 980px; margin: 0 auto; padding: 28px 20px 64px; outline: none; }
.crumb {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px;
  font-family: var(--ml-font-display); font-weight: 500; font-size: 0.95rem; text-decoration: none;
}
.crumb:hover { text-decoration: underline; }
.page-title { font-size: clamp(1.7rem, 5vw, 2.4rem); color: var(--ml-teal-800); font-weight: 700; }
.lede { color: var(--ml-muted); margin-top: 8px; max-width: 46ch; }
.section-gap { margin-top: 28px; }

/* ---------- Tiles and cards ---------- */
.tile-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.tile {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: var(--ml-surface); border: 2px solid var(--ml-teal-200);
  border-radius: var(--ml-radius-card); padding: 20px; min-height: 132px;
  color: var(--ml-ink); text-decoration: none;
  box-shadow: 0 6px 18px rgba(22, 25, 58, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
a.tile:hover { border-color: var(--ml-teal-700); transform: translateY(-2px); }
.tile h2, .tile h3 { font-size: 1.3rem; color: var(--ml-teal-800); }
.tile p { color: var(--ml-muted); }
.tile .meta { margin-top: auto; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ml-teal-700); }
.tile.is-soon { background: var(--ml-teal-50); border-style: dashed; box-shadow: none; }
.tile.is-soon h2, .tile.is-soon h3 { color: var(--ml-muted); }
.badge {
  align-self: flex-start; display: inline-block; padding: 3px 12px; border-radius: var(--ml-radius-pill);
  background: var(--ml-teal-100); color: var(--ml-teal-800);
  font-family: var(--ml-font-display); font-weight: 600; font-size: 0.8rem;
}

/* ---------- Level ladder ---------- */
.ladder { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 22px; padding: 0; list-style: none; }
.level {
  position: relative; display: flex; flex-direction: column; gap: 4px; height: 100%;
  background: var(--ml-surface); border: 2px solid var(--ml-teal-200); border-radius: var(--ml-radius-card);
  padding: 18px 18px 16px; color: var(--ml-ink); text-decoration: none;
  box-shadow: 0 6px 18px rgba(22, 25, 58, 0.06);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
a.level:hover { border-color: var(--ml-teal-700); transform: translateY(-2px); }
.level .num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  background: var(--ml-accent); color: var(--ml-on-accent);
  font-family: var(--ml-font-display); font-weight: 700; margin-bottom: 6px;
}
.level h3 { font-size: 1.05rem; color: var(--ml-teal-800); }
.level .skill { color: var(--ml-muted); font-size: 0.95rem; }
.level .foot { margin-top: auto; padding-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.level.is-locked { background: var(--ml-teal-50); border-style: dashed; box-shadow: none; }
.level.is-locked h3, .level.is-locked .skill { color: var(--ml-muted); }
.level.is-locked .num { background: var(--ml-line); color: var(--ml-ink); }
.lock { color: var(--ml-muted); width: 1.4em; height: 1.4em; }

.stars { display: inline-flex; gap: 2px; }
.star { width: 22px; height: 22px; fill: var(--ml-surface); stroke: var(--ml-muted); stroke-width: 1.6; stroke-linejoin: round; }
.star.on { fill: var(--ml-accent); stroke: var(--ml-accent-edge); }
.stage .star { fill: transparent; stroke: var(--ml-stage-edge); }
.stage .star.on { fill: var(--ml-accent); stroke: var(--ml-accent-soft); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 24px; border: 0; border-radius: var(--ml-radius-pill); cursor: pointer;
  font-family: var(--ml-font-display); font-weight: 600; font-size: 1rem; text-decoration: none;
  background: var(--ml-accent); color: var(--ml-on-accent);
  box-shadow: 0 3px 0 var(--ml-accent-edge);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--ml-accent-edge); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ml-accent-edge); }
.btn-secondary {
  background: var(--ml-surface); color: var(--ml-teal-700); border: 2px solid var(--ml-teal-200); box-shadow: none;
}
.btn-secondary:hover { border-color: var(--ml-teal-700); box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--ml-teal-700); box-shadow: none; padding: 8px 14px; min-height: 44px;
}
.btn-ghost:hover { background: var(--ml-teal-100); box-shadow: none; transform: none; }
.btn-stage {
  background: transparent; color: var(--ml-stage-text); border: 2px solid var(--ml-stage-edge); box-shadow: none;
  min-height: 44px; padding: 6px 18px;
}
.btn-stage:hover { border-color: var(--ml-accent-soft); box-shadow: none; }
.btn-link {
  background: none; border: 0; padding: 13px 10px; min-height: 44px; cursor: pointer; color: var(--ml-muted);
  font-size: 0.95rem; text-decoration: underline;
}
.footer-row { margin-top: 40px; display: flex; justify-content: flex-end; }

/* ---------- Round ---------- */
.round-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.round-count { font-family: var(--ml-font-display); font-weight: 600; color: var(--ml-teal-800); }
.dots { display: flex; gap: 8px; list-style: none; padding: 0; margin: 0 0 14px; }
.dots li {
  flex: 1; height: 8px; border-radius: 6px; background: var(--ml-teal-100);
  border: 1px solid var(--ml-teal-200);
}
.dots li.is-right { background: var(--ml-correct-text); border-color: var(--ml-correct-text); }
.dots li.is-wrong { background: var(--ml-tryagain-text); border-color: var(--ml-tryagain-text); }
.dots li.is-now { background: var(--ml-accent); border-color: var(--ml-accent-edge); }

.stage {
  position: relative; overflow: hidden; color: var(--ml-stage-text);
  border-radius: var(--ml-radius-panel); padding: clamp(18px, 4vw, 30px);
  background:
    radial-gradient(circle at 94% 6%, rgba(250, 171, 111, 0.22), transparent 38%),
    radial-gradient(1.6px 1.6px at 7% 14%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 19% 78%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 33% 36%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 52% 88%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 68% 22%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 81% 70%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 92% 52%, #fff, transparent),
    linear-gradient(180deg, var(--ml-stage-raised) 0%, var(--ml-stage) 55%);
  box-shadow: 0 10px 28px rgba(22, 25, 58, 0.25);
}
.chip {
  display: inline-block; padding: 3px 14px; border-radius: var(--ml-radius-pill);
  background: var(--ml-stage-edge); color: var(--ml-stage-text);
  font-family: var(--ml-font-display); font-weight: 600; font-size: 0.8rem;
}
.chip.practice { background: var(--ml-accent); color: var(--ml-on-accent); margin-left: 8px; }
.prompt {
  margin: 14px 0 22px; font-size: clamp(1.25rem, 3.6vw, 1.7rem); font-weight: 600; line-height: 1.35; outline: none;
}
.options { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
.opt {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; width: 100%;
  padding: 12px 16px; text-align: left; cursor: pointer;
  background: var(--ml-stage-raised); color: var(--ml-stage-text);
  border: 2px solid var(--ml-stage-edge); border-radius: 18px;
  font-family: var(--ml-font-display); font-weight: 600; font-size: clamp(1.05rem, 3vw, 1.3rem);
  transition: border-color 0.12s ease, transform 0.12s ease;
}
.opt:hover:not(:disabled) { border-color: var(--ml-accent-soft); transform: translateY(-1px); }
.opt:disabled { cursor: default; }
.opt .key {
  display: inline-grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px;
  background: var(--ml-stage); color: var(--ml-stage-text); font-size: 0.85rem; border: 1px solid var(--ml-stage-edge);
}
.opt .opt-text { flex: 1; overflow-wrap: anywhere; }
.opt .mark { display: none; align-items: center; gap: 6px; font-size: 0.85rem; }
.opt.is-right {
  background: var(--ml-correct-fill); color: var(--ml-correct-text); border-color: var(--ml-neon-correct);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.45), 0 0 26px rgba(57, 255, 20, 0.5);
}
.opt.is-right .key { background: var(--ml-correct-text); color: var(--ml-correct-fill); border-color: var(--ml-correct-text); }
.opt.is-wrong { background: var(--ml-tryagain-fill); color: var(--ml-tryagain-text); border-color: var(--ml-tryagain-fill); }
.opt.is-wrong .key { background: var(--ml-tryagain-text); color: var(--ml-tryagain-fill); border-color: var(--ml-tryagain-text); }
.opt.is-right .mark, .opt.is-wrong .mark { display: inline-flex; }
.opt.is-dim { opacity: 0.55; }
.hintrow { margin-top: 18px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; min-height: 44px; }
.hint { color: var(--ml-neon-hint); font-weight: 600; }

.feedback {
  margin-top: 18px; background: var(--ml-surface); border: 2px solid var(--ml-line);
  border-radius: var(--ml-radius-card); padding: 18px 20px 20px; outline: none;
  box-shadow: 0 6px 18px rgba(22, 25, 58, 0.06);
}
.feedback.is-right { border-color: var(--ml-correct-text); }
.feedback.is-wrong { border-color: var(--ml-tryagain-text); }
.verdict {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 16px; border-radius: var(--ml-radius-pill);
  font-family: var(--ml-font-display); font-weight: 700;
}
.is-right .verdict { background: var(--ml-correct-fill); color: var(--ml-correct-text); }
.is-wrong .verdict { background: var(--ml-tryagain-fill); color: var(--ml-tryagain-text); }
.worked { margin: 12px 0 0; padding-left: 1.3em; display: grid; gap: 4px; }
.worked li::marker { color: var(--ml-teal-700); font-weight: 700; }
.feedback .btn { margin-top: 16px; }
.feedback .lead { margin-top: 10px; color: var(--ml-muted); }

/* ---------- Results ---------- */
.results { text-align: center; }
.results .stars { gap: 8px; margin: 14px 0 6px; }
.results .star { width: 52px; height: 52px; }
.results h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.results p { color: var(--ml-stage-text); margin-top: 6px; }
.actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.results .btn-secondary { background: transparent; color: var(--ml-stage-text); border-color: var(--ml-stage-edge); }
.results .btn-secondary:hover { border-color: var(--ml-accent-soft); }
.results .btn-ghost { color: var(--ml-stage-text); }
.results .btn-ghost:hover { background: var(--ml-stage-raised); }

/* ---------- Motion ---------- */
@keyframes pop { 0% { transform: scale(0.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
.opt.is-right { animation: pop 0.35s ease; }
.results .star.on { animation: pop 0.5s ease backwards; }
.results .star.on:nth-child(2) { animation-delay: 0.15s; }
.results .star.on:nth-child(3) { animation-delay: 0.3s; }

@media (max-width: 560px) {
  .options { grid-template-columns: 1fr; }
  main { padding: 20px 14px 48px; }
  .topbar-inner { padding: 12px 14px; }
  .ladder { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .level { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Mode switch and typed answers */
.seg-group { display: inline-flex; border: 2px solid var(--ml-teal-700); border-radius: var(--ml-radius-pill); overflow: hidden; background: var(--ml-surface); }
.seg {
  min-height: 40px; padding: 0 16px; border: 0; background: transparent; cursor: pointer;
  font-family: var(--ml-font-display); font-weight: 600; font-size: 0.9rem; color: var(--ml-teal-800);
}
.seg.is-on { background: var(--ml-teal-700); color: var(--ml-on-strong); }
.typed { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.typed-box {
  display: flex; align-items: center; gap: 8px; flex: 1 1 200px; min-height: 68px; padding: 0 16px;
  background: var(--ml-stage-raised); border: 2px solid var(--ml-stage-edge); border-radius: 18px;
  font-family: var(--ml-font-display); font-weight: 600; font-size: clamp(1.2rem, 3.4vw, 1.5rem); color: var(--ml-stage-text);
}
.typed-box:focus-within { border-color: var(--ml-accent-soft); }
.typed-box.is-right {
  background: var(--ml-correct-fill); color: var(--ml-correct-text); border-color: var(--ml-neon-correct);
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.45), 0 0 26px rgba(57, 255, 20, 0.5);
}
.typed-box.is-wrong { background: var(--ml-tryagain-fill); color: var(--ml-tryagain-text); border-color: var(--ml-tryagain-fill); }
.typed-input {
  flex: 1; min-width: 0; width: 100%; border: 0; outline: none; background: transparent; color: inherit;
  font: inherit; padding: 12px 0;
}
.typed-input:disabled { opacity: 1; -webkit-text-fill-color: currentColor; }
.typed-affix { color: inherit; opacity: 0.8; white-space: nowrap; }
.typed-mark { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 0.9rem; color: var(--ml-stage-text); }
.typed-mark .icon { width: 18px; height: 18px; }

/* Drift mode: choices float gently around the arena. Tap the right one. */
.options.is-drift { display: block; position: relative; height: 310px; }
.is-drift .opt {
  position: absolute; width: 47%; min-height: 76px; z-index: 1;
  animation: drift-a 5.5s ease-in-out infinite alternate;
}
.is-drift .opt:nth-child(1) { left: 0; top: 0; }
.is-drift .opt:nth-child(2) { right: 0; top: 24px; animation-name: drift-b; animation-duration: 6.5s; }
.is-drift .opt:nth-child(3) { left: 0; top: 156px; animation-name: drift-b; animation-duration: 7s; animation-delay: -2s; }
.is-drift .opt:nth-child(4) { right: 0; top: 180px; animation-duration: 6s; animation-delay: -3s; }
.is-drift .opt:hover:not(:disabled) { transform: none; }
.is-drift .opt { flex-wrap: wrap; align-content: center; }
.is-drift .opt .opt-text { flex: 1 1 auto; white-space: nowrap; }
.is-drift .opt .mark { flex-basis: 100%; padding-left: 40px; font-size: 0.8rem; }
.is-drift.is-done .opt { animation-play-state: paused; }
.is-drift .opt.is-right { z-index: 2; animation: drift-pop 0.5s ease-out 1 both; }
.is-drift .opt.is-wrong { animation: drift-shake 0.4s ease-in-out 1 both; }
@keyframes drift-a { from { transform: translate(-4px, -8px); } to { transform: translate(6px, 12px); } }
@keyframes drift-b { from { transform: translate(5px, 10px); } to { transform: translate(-6px, -10px); } }
@keyframes drift-pop { 0% { transform: scale(1); } 50% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes drift-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) {
  .is-drift .opt, .is-drift .opt.is-right, .is-drift .opt.is-wrong { animation: none; }
}

/* Hop mode: a number-line game for Integers */
.hop { display: grid; gap: 10px; }
.hop-help { margin: 0; color: var(--ml-stage-text); opacity: 0.85; font-size: 0.95rem; }
.hop-svg { width: 100%; height: auto; display: block; cursor: pointer; touch-action: manipulation; }
.hop-axis { stroke: var(--ml-stage-text); stroke-width: 3; stroke-linecap: round; }
.hop-tick { stroke: var(--ml-stage-text); stroke-width: 2; opacity: 0.7; }
.hop-tick.is-zero { stroke: var(--ml-accent-soft); stroke-width: 3; opacity: 1; }
.hop-label { fill: var(--ml-stage-text); font: 600 12px var(--ml-font-display); }
.hop-label.is-zero { fill: var(--ml-accent-soft); }
.hop-start { stroke: var(--ml-neon-hint); stroke-width: 2; stroke-dasharray: 3 4; }
.hop-startlabel { fill: var(--ml-neon-hint); font: 600 11px var(--ml-font-display); }
.hop-answer { fill: none; stroke: var(--ml-neon-correct); stroke-width: 3; }
.hop-rover circle { fill: var(--ml-accent); stroke: var(--ml-on-accent); stroke-width: 2; }
.hop-rover .hop-shine { fill: #fff; stroke: none; opacity: 0.8; }
.hop-rover { transition: transform 0.18s ease-out; }
.hop-rover.is-right circle:first-child { fill: var(--ml-correct-fill); stroke: var(--ml-neon-correct); }
.hop-rover.is-wrong circle:first-child { fill: var(--ml-tryagain-fill); stroke: var(--ml-tryagain-text); }
.hop-badge { margin: 0; text-align: center; font-family: var(--ml-font-display); font-weight: 600; font-size: 1.15rem; color: var(--ml-stage-text); }
.hop-controls { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@media (prefers-reduced-motion: reduce) { .hop-rover { transition: none; } }

/* Play mode: balance, plot and bar games */
.bal-svg, .plot-svg, .bar-svg { width: 100%; height: auto; display: block; }
.bal-stand { fill: var(--ml-stage-edge); }
.bal-bar { stroke: var(--ml-stage-text); stroke-width: 6; stroke-linecap: round; }
.bal-hub { fill: var(--ml-accent); stroke: var(--ml-on-accent); stroke-width: 2; }
.bal-string { stroke: var(--ml-stage-text); stroke-width: 1.5; opacity: 0.7; }
.bal-plate { fill: var(--ml-stage-raised); stroke: var(--ml-accent-soft); stroke-width: 2; }
.bal-val { fill: var(--ml-stage-text); font: 700 20px var(--ml-font-display); }
.bal-lab { fill: var(--ml-neon-hint); font: 600 12px var(--ml-font-display); }
.bal-beam, .bal-pan { transition: transform 0.25s ease-out; }
.bal-readout, .bar-readout { margin: 0; text-align: center; font-family: var(--ml-font-display); font-weight: 600; font-size: 1.15rem; color: var(--ml-stage-text); }
.bal-slider { width: 100%; accent-color: var(--ml-accent); min-height: 44px; }
.plot-grid { stroke: var(--ml-stage-edge); stroke-width: 1; }
.plot-axis { stroke: var(--ml-stage-text); stroke-width: 2.5; }
.plot-num { fill: var(--ml-stage-text); font: 600 10px var(--ml-font-display); opacity: 0.85; }
.plot-axis-label { fill: var(--ml-accent-soft); font: 700 12px var(--ml-font-display); }
.plot-mark { fill: var(--ml-neon-hint); }
.plot-marklabel { fill: var(--ml-neon-hint); font: 600 11px var(--ml-font-display); }
.plot-cursor { fill: var(--ml-accent); stroke: var(--ml-on-accent); stroke-width: 2; }
.plot-cursor.is-right { fill: var(--ml-correct-fill); stroke: var(--ml-neon-correct); }
.plot-cursor.is-wrong { fill: var(--ml-tryagain-fill); stroke: var(--ml-tryagain-text); }
.plot-svg { cursor: crosshair; touch-action: manipulation; }
.nudge { min-width: 48px; padding-left: 14px; padding-right: 14px; }
.bar-part { fill: var(--ml-stage-raised); stroke: var(--ml-stage-text); stroke-width: 2; cursor: pointer; }
.bar-part.is-on { fill: var(--ml-accent); stroke: var(--ml-on-accent); }
.bar-part.is-right.is-on { fill: var(--ml-correct-fill); stroke: var(--ml-neon-correct); }
.bar-part.is-wrong.is-on { fill: var(--ml-tryagain-fill); stroke: var(--ml-tryagain-text); }
@media (prefers-reduced-motion: reduce) { .bal-beam, .bal-pan { transition: none; } }

/* Play: Moon Shot and Order */
.launch-svg { width: 100%; height: auto; display: block; }
.launch-planet circle { fill: var(--ml-stage-raised); stroke: var(--ml-stage-text); stroke-width: 2; cursor: pointer; }
.launch-planet text { fill: var(--ml-stage-text); font: 700 16px var(--ml-font-display); pointer-events: none; }
.launch-planet.is-aimed circle { stroke: var(--ml-accent); stroke-width: 4; }
.launch-planet.is-right circle { fill: var(--ml-correct-fill); stroke: var(--ml-neon-correct); }
.launch-planet.is-wrong circle { fill: var(--ml-tryagain-fill); stroke: var(--ml-tryagain-text); }
.launch-beam { stroke: var(--ml-neon-hint); stroke-width: 2; stroke-dasharray: 4 5; }
.launch-rocket path { fill: var(--ml-accent); stroke: var(--ml-on-accent); stroke-width: 2; stroke-linejoin: round; }
.launch-rocket { transition: transform 0.2s ease-out; }
.launch-window { fill: var(--ml-stage-text); }
.launch-list, .order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.launch-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--ml-stage-edge); background: var(--ml-stage-raised); color: var(--ml-stage-text); cursor: pointer; }
.launch-row.is-aimed { border-color: var(--ml-accent); }
.launch-row.is-right { border-color: var(--ml-neon-correct); background: var(--ml-correct-fill); }
.launch-row.is-wrong { border-color: var(--ml-tryagain-text); background: var(--ml-tryagain-fill); }
.launch-row.is-dim { opacity: 0.6; }
.order-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--ml-stage-edge); background: var(--ml-stage-raised); color: var(--ml-stage-text); font: inherit; text-align: left; cursor: pointer; }
.order-item.is-picked { border-color: var(--ml-accent); opacity: 0.85; }
.order-item.is-right { border-color: var(--ml-neon-correct); background: var(--ml-correct-fill); }
.order-item.is-wrong { border-color: var(--ml-tryagain-text); background: var(--ml-tryagain-fill); }
@media (prefers-reduced-motion: reduce) { .launch-rocket { transition: none; } }

/* Pictures in questions: flags, animals, fruit */
.art { display: grid; place-items: center; margin: 0 0 20px; }
.art.is-svg svg { width: min(100%, 210px); height: auto; border-radius: 6px; box-shadow: 0 0 0 2px var(--ml-stage-edge), 0 6px 16px rgba(0, 0, 0, 0.3); }
.art:not(.is-svg) { font-size: clamp(3.5rem, 16vw, 5rem); line-height: 1.1; }

/* Sort game */
.sort-now { display: grid; place-items: center; min-height: 96px; margin: 6px 0 12px; }
.sort-item { font-size: clamp(3rem, 14vw, 4.5rem); line-height: 1.1; text-align: center; }
.sort-bins { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.sort-tally { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; font-size: 0.95rem; }
.sort-tally .is-right { color: var(--ml-correct-text); }
.sort-tally .is-wrong { color: var(--ml-tryagain-text); }
/* Options that are pictures (pick the flag) */
.opt .opt-flag { width: 100%; max-width: 150px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px var(--ml-stage-edge); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.options.has-flags { grid-template-columns: repeat(2, 1fr); }
.options.has-flags .opt { flex-direction: column; justify-content: center; min-height: 96px; padding: 10px; }
.options.has-flags .opt .key { position: absolute; top: 6px; left: 6px; }
.options.has-flags .opt-flag { max-width: 130px; }

/* Lumi and sound */
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sound-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--ml-radius-pill);
  background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer;
  font-family: var(--ml-font-display); font-weight: 600; font-size: 0.85rem;
}
.sound-btn .icon { width: 18px; height: 18px; }
.sound-btn:hover { border-color: var(--ml-accent-soft); }
.sound-btn:focus-visible { outline-color: var(--ml-accent-soft); }
.lumi-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.lumi-row.center { justify-content: center; }
.lumi { display: inline-block; width: 64px; height: 64px; flex: none; }
.lumi svg { width: 100%; height: 100%; overflow: visible; }
.lumi.is-happy { animation: lumi-hop 0.6s ease-out 1; }
.lumi.is-oops { animation: lumi-tilt 0.7s ease-out 1; }
@keyframes lumi-hop { 0% { transform: translateY(0) scale(1); } 35% { transform: translateY(-12px) scale(1.06); } 70% { transform: translateY(0) scale(0.97); } 100% { transform: translateY(0) scale(1); } }
@keyframes lumi-tilt { 0% { transform: rotate(0); } 30% { transform: rotate(-9deg); } 65% { transform: rotate(6deg); } 100% { transform: rotate(0); } }
.listen { margin: 10px 10px 0 0; }
@media (prefers-reduced-motion: reduce) { .lumi.is-happy, .lumi.is-oops { animation: none; } }

/* Check my work */
.chk-form { display: grid; gap: 8px; margin-top: 16px; max-width: 560px; }
.chk-form label { font-family: var(--ml-font-display); font-weight: 600; color: var(--ml-ink); }
.chk-form textarea, .chk-form input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1.1rem; color: var(--ml-ink);
  background: var(--ml-surface); border: 2px solid var(--ml-teal-200); border-radius: 14px;
}
.chk-form textarea:focus-visible, .chk-form input:focus-visible { outline: 3px solid var(--ml-teal-700); outline-offset: 2px; }
.chk-examples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 0.95rem; }
.chk-ex { font-size: 0.95rem; }
.chk-form .btn { justify-self: start; margin-top: 4px; }
.chk-note { margin: 8px 0 0; font-weight: 600; }
.chk-privacy { margin-top: 24px; font-size: 0.9rem; color: var(--ml-muted); }
#app .feedback { margin-top: 16px; max-width: 560px; }
.chk-review h3, .chk-h { margin: 14px 0 6px; font-size: 1.05rem; color: var(--ml-ink); }
.chk-review ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chk-review li { padding: 8px 12px; border-radius: 12px; border: 2px solid var(--ml-teal-200); background: var(--ml-teal-50); }
.chk-review li.is-bad { border-color: var(--ml-tryagain-text); background: var(--ml-bad-fill); }
.chk-tick { font-weight: 700; font-family: var(--ml-font-display); margin-right: 4px; }
.chk-review li.is-good .chk-tick { color: var(--ml-correct-text); }
.chk-review li.is-bad .chk-tick { color: var(--ml-tryagain-text); }
.chk-line { font-weight: 600; }
.chk-why { display: block; margin-top: 2px; font-size: 0.95rem; }

/* Accounts */
.auth { max-width: 460px; margin: 0 auto; display: grid; gap: 12px; }
.auth-lumi { width: 96px; margin: 0 auto; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--ml-teal-50); padding: 5px; border-radius: 14px; }
.auth-tab { font: inherit; font-weight: 700; min-height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ml-ink); cursor: pointer; }
.auth-tab[aria-selected="true"] { background: var(--ml-ink); color: var(--ml-ground); }
.auth-form { display: grid; gap: 8px; }
.auth-form label { font-weight: 700; }
.auth-form input[type="email"], .auth-form input[type="password"], .auth-form input[type="text"] { font: inherit; min-height: 48px; padding: 8px 12px; border: 2px solid var(--ml-teal-200); border-radius: 12px; background: var(--ml-surface); color: var(--ml-ink); width: 100%; box-sizing: border-box; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500 !important; }
.auth-check input { width: 22px; height: 22px; margin-top: 2px; flex: none; }
.auth-up { display: grid; gap: 8px; }
.auth-up[hidden], .auth-form [hidden] { display: none; }
.auth-msg { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; border: 2px dashed var(--ml-teal-200); }
.auth-msg[hidden] { display: none; }
.auth-msg p { margin: 0 0 6px; }
.auth-msg.is-bad { color: var(--ml-tryagain-text); font-weight: 700; border-style: solid; }
.auth-msg .btn { margin-top: 4px; }
.auth-form input[aria-invalid='true'] { outline: 3px solid var(--ml-tryagain-text); }
.auth-small { text-align: center; }
.acct { margin-top: 18px; padding-top: 12px; border-top: 2px solid var(--ml-teal-200); text-align: center; }
.acct-mail { opacity: 0.75; }
.acct-status { min-height: 1.3em; margin: 4px 0 0; }
.prose { max-width: 60ch; }
.prose h2 { font-size: 1.1rem; margin: 18px 0 4px; }
.topbar-end { display: flex; align-items: center; gap: 8px; }
.acct-links { display: flex; gap: 6px; }
.acct-links a, .acct-chip { color: #fff; font-weight: 700; font-size: 0.9rem; text-decoration: none; padding: 8px 10px; min-height: 40px; display: inline-flex; align-items: center; border-radius: 999px; border: 2px solid rgba(255,255,255,0.35); box-sizing: border-box; }
.acct-links a.is-up { background: var(--ml-orange, #ffb27a); color: #0f1228; border-color: transparent; }
.acct-chip { max-width: 9em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-or { display: flex; align-items: center; gap: 10px; color: var(--ml-ink); opacity: 0.7; }
.auth-or::before, .auth-or::after { content: ''; flex: 1; height: 2px; background: var(--ml-teal-200); }
.btn-quiet { background: transparent; color: var(--ml-ink); border: 2px solid var(--ml-ink); text-align: center; text-decoration: none; justify-content: center; }
@media (max-width: 430px) { .topbar-end .sound-btn span { display: none; } }

/* ---------- Grade badge and filter ---------- */
.grade-badge {
  display: block; width: fit-content; align-self: flex-start; padding: 3px 12px; margin: 10px 0 4px; border-radius: var(--ml-radius-pill);
  background: var(--ml-teal-100); color: var(--ml-teal-800); font-family: var(--ml-font-display); font-weight: 600; font-size: 0.8rem;
}
.tile .grade-badge { margin: 0 0 4px; }
.grade-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip {
  padding: 6px 14px; border-radius: var(--ml-radius-pill); border: 2px solid var(--ml-teal-200); background: var(--ml-surface);
  color: var(--ml-teal-800); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.chip[aria-pressed='true'] { background: var(--ml-teal-700); border-color: var(--ml-teal-700); color: var(--ml-on-strong); }
.tile[hidden] { display: none; }

/* ---------- Idea Lab ---------- */
.idea { margin-top: 22px; max-width: 640px; }
.idea-card { background: var(--ml-surface); border: 2px solid var(--ml-teal-200); border-radius: var(--ml-radius-card); padding: 20px; box-shadow: 0 6px 18px rgba(22, 25, 58, 0.06); }
.idea-title { font-size: 1.35rem; color: var(--ml-teal-800); }
.idea-tip { color: var(--ml-muted); margin: 6px 0 14px; }
.idea-ask { font-weight: 600; margin-bottom: 10px; }
.idea-body label { display: block; font-weight: 600; margin: 12px 0 6px; }
.idea-input { width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--ml-ink); border: 2px solid var(--ml-teal-200); border-radius: 14px; background: var(--ml-surface); }
.idea-input:focus { outline: 3px solid var(--ml-accent); outline-offset: 2px; }
.idea-choices { display: grid; gap: 10px; }
.idea-choice { display: flex; flex-direction: column; gap: 4px; text-align: left; min-height: 56px; padding: 12px 16px; font: inherit; color: var(--ml-ink); background: var(--ml-surface); border: 2px solid var(--ml-teal-200); border-radius: 14px; cursor: pointer; }
.idea-choice span { color: var(--ml-muted); font-size: 0.92rem; }
.idea-choice[aria-checked="true"] { border-color: var(--ml-correct-text); background: var(--ml-teal-50); }
.idea-live, .idea-msg { margin-top: 12px; color: var(--ml-teal-800); font-weight: 600; min-height: 1.4em; }
.idea .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
.idea-pitch { font-size: 1.15rem; font-weight: 600; margin: 12px 0; }
.idea-stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); margin: 14px 0; }
.idea-stat { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--ml-teal-50); border-radius: 12px; }
.idea-stat span { color: var(--ml-muted); font-size: 0.85rem; }
.idea-stat strong { font-size: 1.25rem; color: var(--ml-teal-800); }
.idea-sketch h3 { margin-top: 16px; }
.idea-sketch ul { padding-left: 20px; margin-top: 6px; }
@media print { .topbar, .crumbs, .crumb, .actions, .chk-privacy, .skip { display: none !important; } .idea-card { box-shadow: none; } }
.idea-field + .idea-field { margin-top: 18px; }
.idea-sec { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--ml-line); }
.idea-sec p { margin-top: 6px; }
.idea-sec h3 { color: var(--ml-teal-800); }
.idea-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 0.95rem; }
.idea-table th, .idea-table td { padding: 8px 10px; border-bottom: 1px solid var(--ml-line); text-align: right; }
.idea-table th:first-child, .idea-table td:first-child, .idea-table tbody th { text-align: left; font-weight: 600; }
.idea-table thead th { background: var(--ml-teal-50); color: var(--ml-teal-800); }
.idea-scroll { overflow-x: auto; }
.idea-forecast { font-size: 0.78rem; }
.idea-forecast th, .idea-forecast td { padding: 6px 3px; }
.idea-svgwrap { max-width: 320px; margin: 10px auto 0; }
.idea-svg { width: 100%; height: auto; }
.idea-c1 { fill: var(--ml-teal-100); stroke: var(--ml-teal-200); stroke-width: 2; }
.idea-c2 { fill: var(--ml-teal-200); stroke: var(--ml-teal-700); stroke-width: 1.5; }
.idea-c3 { fill: var(--ml-accent); stroke: var(--ml-accent-edge); stroke-width: 1.5; }
.idea-svg-a { font: 700 12px var(--ml-font-display, sans-serif); fill: var(--ml-ink); }
.idea-svg-b { font: 500 10px var(--ml-font-display, sans-serif); fill: var(--ml-ink); }
@media print { .idea-sec { break-inside: avoid; } .idea-scroll { overflow: visible; } }

/* ---------- Progress ---------- */
.prog-cards { display: grid; gap: 12px; margin-top: 12px; }
.prog-card { background: var(--ml-surface); border: 2px solid var(--ml-teal-200); border-radius: var(--ml-radius-card); padding: 12px 16px; }
.prog-card summary { display: grid; gap: 6px; cursor: pointer; list-style: none; }
.prog-card summary::-webkit-details-marker { display: none; }
.prog-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-family: var(--ml-font-display); font-weight: 700; font-size: 1.1rem; color: var(--ml-teal-800); }
.prog-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 10px; }
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.prog-row a { color: var(--ml-teal-800); font-weight: 600; }
.prog-row progress { grid-column: 1 / -1; grid-row: 2; }
.prog-n { color: var(--ml-muted); font-size: 0.9rem; }
progress { width: 100%; height: 10px; accent-color: var(--ml-correct-text); }

/* ---------- Floating Lumi chat ---------- */
.lc { position: fixed; right: 14px; bottom: 14px; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; max-width: calc(100vw - 28px); }
.lc-fab { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--ml-accent-edge); background: var(--ml-accent); color: var(--ml-on-accent); border-radius: var(--ml-radius-pill); padding: 6px 16px 6px 8px; font-weight: 700; cursor: pointer; box-shadow: 0 4px 0 var(--ml-accent-edge); min-height: 48px; }
.lc-fab:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--ml-accent-edge); }
.lc-fab-face { width: 36px; height: 36px; display: inline-flex; }
.lc-fab-face .lumi, .lc-face .lumi { width: 100%; height: 100%; animation: none; }
.lc.is-open .lc-fab-text { display: none; }
.lc.is-open .lc-fab { padding: 6px; }
.lc-panel { width: min(360px, calc(100vw - 28px)); height: min(70vh, 520px); display: flex; flex-direction: column; background: var(--ml-surface); color: var(--ml-ink); border: 2px solid var(--ml-line); border-radius: var(--ml-radius-panel); box-shadow: 0 10px 30px rgba(22, 25, 58, 0.25); overflow: hidden; }
.lc-panel[hidden] { display: none; }
.lc-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--ml-teal-100); font-family: var(--ml-font-display); }
.lc-head strong { flex: 1; color: var(--ml-teal-800); }
.lc-face { width: 36px; height: 36px; display: inline-flex; }
.lc-close { border: 0; background: transparent; font-size: 1.8rem; line-height: 1; width: 44px; height: 44px; border-radius: 12px; cursor: pointer; color: var(--ml-teal-800); }
.lc-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.lc-msg { max-width: 88%; padding: 10px 14px; border-radius: 18px; font-size: 1rem; }
.lc-msg.is-lumi { align-self: flex-start; background: var(--ml-teal-50); border: 1px solid var(--ml-teal-200); }
.lc-msg.is-you { align-self: flex-end; background: var(--ml-tryagain-fill); color: var(--ml-ink); }
.lc-link { margin-top: 8px; border: 2px solid var(--ml-teal-700); background: var(--ml-surface); color: var(--ml-teal-800); border-radius: var(--ml-radius-pill); padding: 6px 14px; font-weight: 700; cursor: pointer; min-height: 40px; }
.lc-note { padding: 4px 14px; font-size: 0.8rem; color: var(--ml-muted); }
.lc-form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--ml-line); }
.lc-input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border: 2px solid var(--ml-line); border-radius: var(--ml-radius-pill); color: var(--ml-ink); background: var(--ml-surface); }
.lc-send { border: 2px solid var(--ml-accent-edge); background: var(--ml-accent); color: var(--ml-on-accent); font-weight: 700; border-radius: var(--ml-radius-pill); padding: 0 18px; min-height: 44px; cursor: pointer; }
@media print { .lc { display: none; } }
@media (prefers-reduced-motion: reduce) { .lc-fab:active { transform: none; } }
.lc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 12px 6px; max-height: 176px; overflow-y: auto; }
.lc-chips[hidden] { display: none; }
.lc-chip { border: 2px solid var(--ml-teal-700); background: var(--ml-surface); color: var(--ml-teal-800); border-radius: var(--ml-radius-pill); padding: 6px 12px; font-size: 0.92rem; font-weight: 600; cursor: pointer; min-height: 40px; text-align: left; }

.theme-btn { font: inherit; font-family: var(--ml-font-display); font-weight: 600; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px; border-radius: 999px; background: transparent; color: #fff; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; }
.theme-btn .icon { width: 18px; height: 18px; }
.theme-btn:hover { border-color: var(--ml-accent-soft); }
.theme-btn:focus-visible { outline-color: var(--ml-accent-soft); }
@media (max-width: 430px) { .topbar-end .theme-btn span { display: none; } }
@media print { .theme-btn { display: none; } }

/* The page area is focused by script after each screen change; it should not draw a ring around everything. */
main:focus, main:focus-visible { outline: none; }
.brand, .acct-links a, .acct-chip, .theme-btn, .sound-btn { white-space: nowrap; }
@media (max-width: 430px) {
  .topbar-inner { padding: 12px 12px; gap: 8px; }
  .brand { font-size: 1.1rem; gap: 8px; }
  .brand .logo { width: 30px; height: 30px; border-radius: 8px; }
  .topbar-end { gap: 6px; margin-left: auto; }
  .acct-links a, .acct-chip { padding: 6px 9px; font-size: 0.85rem; }
  .theme-btn, .sound-btn { padding: 8px 10px; }
}
.idea-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.idea-tools .btn { min-height: 44px; padding: 8px 14px; }
.idea-tools .btn[aria-pressed="true"] { background: var(--ml-teal-100); border-color: var(--ml-teal-700); }
.idea-slide { border: 2px solid var(--ml-teal-200); border-radius: var(--ml-radius-card); padding: 14px 18px; margin-top: 12px; background: var(--ml-surface); }
.idea-slide h3 { color: var(--ml-teal-800); margin: 4px 0 8px; font-size: 1.3rem; }
.idea-slide ul { padding-left: 20px; }
.idea-slide-n { color: var(--ml-muted); font-size: 0.85rem; }
.idea-range { width: 100%; min-height: 44px; accent-color: var(--ml-teal-700); }
.idea-sub { margin-top: 18px; color: var(--ml-teal-800); }
.idea-compare { font-size: 0.85rem; }
.idea-compare td, .idea-compare th { text-align: left; vertical-align: top; }
.idea-why { font-weight: 400; }
@media print { .idea-tools { display: none !important; } .idea-slide { break-after: page; break-inside: avoid; } .idea-deck h2 { break-after: avoid; } }
.mock-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; color: var(--ml-teal-800); }
.mock-clock { font-weight: 700; margin: 0; }
.mock-check { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.mock-check input { width: 22px; height: 22px; accent-color: var(--ml-teal-700); }
.mock-map { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mock-dot { min-width: 40px; min-height: 40px; border-radius: 10px; border: 2px solid var(--ml-teal-200); background: var(--ml-surface); color: var(--ml-ink); font: inherit; font-weight: 600; cursor: pointer; }
.mock-dot.is-done { background: var(--ml-teal-100); border-color: var(--ml-teal-700); }
.mock-dot.is-now { outline: 3px solid var(--ml-accent); outline-offset: 1px; }
.mock-prompt { font-size: 1.15rem; font-weight: 600; margin: 8px 0 14px; }
.mock-rev.is-ok { border-color: var(--ml-correct-text); }
.mock-rev.is-miss { border-color: var(--ml-teal-200); }
@media print { .mock-bar, .mock-map { display: none; } }
.crumbs { margin-bottom: 14px; max-width: 100%; }
.crumbs-list { display: flex; flex-wrap: nowrap; align-items: center; list-style: none; margin: 0; padding: 0; font-family: var(--ml-font-display); font-weight: 500; font-size: 0.95rem; min-width: 0; }
.crumbs.is-measuring .crumbs-list { width: max-content; }
.crumbs.is-open .crumbs-list { flex-wrap: wrap; row-gap: 2px; }
.crumb-item { display: inline-flex; align-items: center; min-width: 0; white-space: nowrap; }
.crumb-item + .crumb-item::before { content: "\203A"; margin: 0 8px; color: var(--ml-muted); }
.crumbs .crumb { margin: 0; display: inline-flex; align-items: center; min-height: 44px; text-decoration: none; }
.crumbs .crumb:hover { text-decoration: underline; }
.crumb-here { color: var(--ml-ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: inline-block; max-width: 60vw; }
.crumb-more { min-width: 44px; min-height: 44px; border: 2px solid var(--ml-teal-200); border-radius: 10px; background: var(--ml-surface); color: var(--ml-teal-800); font: inherit; font-weight: 700; cursor: pointer; }
.crumb-more:focus-visible, .crumbs .crumb:focus-visible { outline: 3px solid var(--ml-accent); outline-offset: 2px; }

/* ---------- Reading and comfort settings ---------- */
html[data-text="large"] { font-size: 120%; }
html[data-text="xlarge"] { font-size: 140%; }
:root[data-font="easy"] { --ml-font-body: "Atkinson Hyperlegible", system-ui, sans-serif; --ml-font-display: "Atkinson Hyperlegible", system-ui, sans-serif; }
:root[data-font="dyslexia"] { --ml-font-body: "OpenDyslexic", "Comic Sans MS", system-ui, sans-serif; --ml-font-display: "OpenDyslexic", "Comic Sans MS", system-ui, sans-serif; }
html[data-font="dyslexia"] body { font-size: 0.95rem; }
html[data-space="wide"] body { line-height: 1.9; letter-spacing: 0.04em; word-spacing: 0.16em; }
html[data-space="wide"] p, html[data-space="wide"] li { margin-bottom: 0.6em; }
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html[data-contrast="high"] { --ml-muted: var(--ml-ink); --ml-teal-200: var(--ml-teal-700); --ml-line: var(--ml-teal-700); }
.a11y-prev { margin-top: 18px; padding: 14px 16px; border: 2px dashed var(--ml-teal-200); border-radius: var(--ml-radius-card); }
.a11y-group { margin-top: 18px; }
.a11y-group h2 { font-size: 1.1rem; color: var(--ml-teal-800); margin-bottom: 8px; }
.a11y-row { display: flex; flex-wrap: wrap; gap: 8px; }
.a11y-row .idea-choice { flex: 1 1 150px; min-height: 52px; }
/* Larger text or wide spacing: let the top bar wrap instead of running off the screen. */
html[data-text] .topbar-inner, html[data-space="wide"] .topbar-inner, html[data-font="dyslexia"] .topbar-inner { flex-wrap: wrap; row-gap: 6px; }
html[data-text] .topbar-end, html[data-space="wide"] .topbar-end, html[data-font="dyslexia"] .topbar-end { flex-wrap: wrap; justify-content: flex-end; }
html[data-space="wide"] .topbar, html[data-font="dyslexia"] .topbar, html[data-space="wide"] .brand, html[data-font="dyslexia"] .brand { letter-spacing: 0.01em; }
.offline-note { margin-top: 20px; color: var(--ml-muted); font-size: 0.95rem; }
.offline-note:empty { display: none; }
.offline-note .btn { margin-top: 8px; }
@media print { .offline-note { display: none; } }
.arc-card { max-width: 420px; }
.arc-hud { margin: 6px 0; font-weight: 600; color: var(--ml-teal-800); font-size: 0.95rem; white-space: pre-wrap; }
.arc-prompt { font-size: 1.1rem; font-weight: 600; margin: 6px 0 10px; min-height: 2.8em; }
.arc-canvas { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 16px; display: block; touch-action: manipulation; background: #16193a; }
.arc-controls { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.arc-btn { min-width: 76px; min-height: 56px; }
.arc-msg { margin-top: 10px; min-height: 3em; color: var(--ml-teal-800); font-weight: 600; }
.arc-stage { position: relative; }
.arc-pause { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: stretch; justify-content: center; padding: 24px; background: rgba(22, 25, 58, 0.88); border-radius: 16px; color: #f7f5ff; }
.arc-pause[hidden] { display: none; }
.arc-pause h2 { text-align: center; margin: 0 0 6px; color: #d7f7f2; }
.arc-craft { margin: 0 0 4px; font-size: 0.9rem; color: var(--ml-teal-800); }
.wg-grid { display: grid; gap: 6px; justify-content: center; margin: 12px 0; }
.wg-row { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px; }
.wg-cell { height: 52px; display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; border: 2px solid #b9c3e6; border-radius: 10px; background: #fff; color: #16193a; position: relative; }
.wg-cell.wg-g, .wg-key.wg-g { background: #b7f5c4; border-color: #5fc27a; }
.wg-cell.wg-y, .wg-key.wg-y { background: #ffd9b8; border-color: #f0a060; }
.wg-cell.wg-x, .wg-key.wg-x { background: #dcd6f0; border-color: #b9aee0; color: #4a4570; }
.wg-cell.wg-g::after { content: '✓'; position: absolute; right: 4px; top: 0; font-size: 0.7rem; }
.wg-cell.wg-y::after { content: '•'; position: absolute; right: 5px; top: 0; font-size: 1rem; }
.wg-kb { display: grid; gap: 6px; margin-top: 8px; }
.wg-krow { display: flex; gap: 4px; justify-content: center; }
.wg-key { min-width: 30px; height: 48px; padding: 0 4px; flex: 1; max-width: 40px; border: 2px solid #b9c3e6; border-radius: 8px; background: #fff; font-weight: 700; font-size: 1rem; text-transform: uppercase; color: #16193a; cursor: pointer; }
.wg-key.wg-wide { min-width: 54px; max-width: 70px; font-size: 0.75rem; }
.mm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.mm-card { min-height: 78px; padding: 6px; border-radius: 14px; border: 2px solid #b9c3e6; background: #c9b8ff; color: #16193a; font-weight: 700; font-size: 0.95rem; cursor: pointer; overflow-wrap: anywhere; }
.mm-card.mm-up { background: #fff2d6; border-color: #f0a060; }
.mm-card.mm-done { background: #b7f5c4; border-color: #5fc27a; cursor: default; }
.sp-pic { display: grid; place-items: center; height: 190px; border-radius: 16px; background: linear-gradient(#e8f7f4, #c9e8ff); margin: 8px 0 12px; overflow: hidden; }
.sp-emoji { font-size: 6rem; line-height: 1; }
.sp-sea { background: linear-gradient(#7fd6f4, #3a7ac8); box-shadow: inset 0 0 0 6px #8a9ac8; }
.sp-sea[data-zone="1"] { background: linear-gradient(#3a7ac8, #2a3f8a); }
.sp-sea[data-zone="2"] { background: linear-gradient(#2a3f8a, #16193a); }
.sp-sea .sp-emoji { animation: sp-drift 5s ease-in-out infinite alternate; }
@keyframes sp-drift { from { transform: translateX(-34px) translateY(-6px); } to { transform: translateX(34px) translateY(6px); } }
[data-motion="reduce"] .sp-sea .sp-emoji { animation: none; }
@media (prefers-reduced-motion: reduce) { .sp-sea .sp-emoji { animation: none; } }
.sp-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sp-opt { min-height: 52px; text-align: center; }
.sp-opt.sp-right { background: #b7f5c4; border-color: #5fc27a; }
.sp-opt.sp-wrong { background: #dcd6f0; border-color: #b9aee0; }
/* Puzzle games */
.sd-grid, .ws-grid, .mn-grid, .cw-grid { display: grid; gap: 0; justify-content: center; margin: 12px 0; }
.sd-row, .cw-row { display: flex; justify-content: center; }
.sd-cell { width: 38px; height: 38px; border: 1px solid #b9c3e6; background: #fff; color: #16193a; font-weight: 700; font-size: 1.1rem; cursor: pointer; padding: 0; }
.sd-n4 .sd-cell { width: 56px; height: 56px; font-size: 1.5rem; }
.sd-n6 .sd-cell { width: 46px; height: 46px; font-size: 1.3rem; }
.sd-cell.sd-given { background: #eef0fb; color: #3d4a8a; }
.sd-cell.sd-sel { background: #fff2d6; outline: 3px solid #f0a060; outline-offset: -3px; }
.sd-cell.sd-bad { color: #6a4fb0; background: #ece6ff; text-decoration: underline wavy #b9aee0; }
.sd-cell.sd-vr { border-right: 3px solid #5a6ab0; }
.sd-cell.sd-hr { border-bottom: 3px solid #5a6ab0; }
.sd-pad { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sd-key { min-width: 44px; min-height: 44px; padding: 0 8px; }
.mk-items, .mk-ops { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 12px 0; }
.mk-num, .mk-op { min-width: 64px; min-height: 64px; border-radius: 16px; border: 2px solid #b9c3e6; background: #fff; color: #16193a; font-size: 1.6rem; font-weight: 800; cursor: pointer; }
.mk-op { background: #eef0fb; min-width: 56px; min-height: 56px; }
.mk-on { background: #fff2d6; border-color: #f0a060; }
.mg-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 320px; margin: 12px auto; padding: 8px; background: #dcd6f0; border-radius: 14px; touch-action: none; }
.mg-tile { aspect-ratio: 1; display: grid; place-items: center; border-radius: 10px; font-weight: 800; font-size: 1.4rem; background: #eee9fa; color: #16193a; }
.mg-v2 { background: #fff2d6; } .mg-v4 { background: #ffe0c0; } .mg-v8 { background: #ffd0a8; } .mg-v16 { background: #ffc08a; } .mg-v32 { background: #c9b8ff; } .mg-v64 { background: #b8a0f5; }
.mg-v128 { background: #bfe9ff; font-size: 1.2rem; } .mg-v256 { background: #8fd6f0; font-size: 1.2rem; } .mg-v512 { background: #7fd6c4; font-size: 1.2rem; } .mg-v1024 { background: #b7f5c4; font-size: 1rem; } .mg-v2048 { background: #ffe9a8; font-size: 1rem; } .mg-vbig { background: #ffe9a8; font-size: 0.9rem; }
.mg-pad { display: flex; gap: 8px; justify-content: center; }
.ws-cell { width: 34px; height: 34px; border: 1px solid #d0d6ee; background: #fff; color: #16193a; font-weight: 700; font-size: 1rem; cursor: pointer; padding: 0; }
.ws-cell.ws-found { background: #b7f5c4; }
.ws-cell.ws-start { background: #fff2d6; outline: 2px solid #f0a060; outline-offset: -2px; }
.ws-list { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; padding: 0; justify-content: center; font-weight: 700; letter-spacing: 0.05em; }
.ws-done { color: #3f8a5a; text-decoration: line-through; }
.hm-balloons { font-size: 1.6rem; text-align: center; margin: 8px 0; }
.hm-word { font-size: 2rem; font-weight: 800; letter-spacing: 0.2em; text-align: center; margin: 8px 0; }
.sc-row { display: flex; gap: 8px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.sc-slot { width: 46px; height: 52px; border-bottom: 3px solid #5a6ab0; display: grid; place-items: center; font-weight: 800; font-size: 1.6rem; }
.sc-slot.sc-win { color: #3f8a5a; }
.sc-tile { width: 50px; height: 56px; border-radius: 12px; border: 2px solid #b9aee0; background: #c9b8ff; font-weight: 800; font-size: 1.4rem; color: #16193a; cursor: pointer; }
.sc-tile:disabled { opacity: 0.35; cursor: default; }
.cw-cell { position: relative; width: 36px; height: 36px; display: inline-block; }
.cw-block { display: inline-block; width: 36px; height: 36px; background: transparent; }
.cw-in { width: 36px; height: 36px; border: 1px solid #5a6ab0; text-align: center; font-weight: 800; font-size: 1.1rem; text-transform: uppercase; background: #fff; color: #16193a; padding: 8px 0 0; border-radius: 0; }
.cw-in:focus { background: #fff2d6; outline: 2px solid #f0a060; }
.cw-in.cw-bad { background: #ece6ff; color: #6a4fb0; }
.cw-num { position: absolute; top: 1px; left: 3px; font-size: 0.6rem; color: #5a6ab0; pointer-events: none; z-index: 1; }
.cw-clues { margin: 4px 0 12px; padding-left: 26px; font-size: 0.95rem; }
.mn-cell { width: 34px; height: 34px; border: 1px solid #b9c3e6; background: #c9b8ff; font-weight: 800; font-size: 1rem; cursor: pointer; padding: 0; border-radius: 6px; margin: 1px; }
.mn-cell.mn-open { background: #f4f6fd; cursor: default; }
.mn-cell.mn-rock { background: #ffd9b8; }
.mn-1 { color: #3a7ac8; } .mn-2 { color: #3f8a5a; } .mn-3 { color: #b0602a; } .mn-4 { color: #6a4fb0; } .mn-5 { color: #8a5a2a; } .mn-6 { color: #2a8a8a; } .mn-7 { color: #4a4570; } .mn-8 { color: #4a4570; }
.lp-canvas { max-width: 300px; margin: 0 auto; aspect-ratio: auto; }
.arc-stage .lp-canvas { display: block; }
.cw-cell, .cw-block, .cw-in { width: 24px; height: 24px; }
.cw-in { font-size: 0.95rem; padding: 5px 0 0; }
.cw-num { font-size: 0.5rem; left: 2px; }
.cw-grid { max-width: 100%; overflow-x: auto; }
.lp-controls { flex-wrap: wrap; gap: 6px; }
.lp-controls .arc-btn { min-width: 52px; padding-left: 10px; padding-right: 10px; }
.sp-in { display: block; width: 100%; max-width: 320px; min-height: 48px; margin: 10px 0; padding: 8px 12px; border: 2px solid #5a6ab0; border-radius: 12px; background: #fff; color: #16193a; font-size: 1.25rem; font-weight: 700; letter-spacing: 0.05em; }
.sp-in:focus { background: #fff2d6; outline: 2px solid #f0a060; }
.ws-select { display: block; width: 100%; max-width: 360px; min-height: 44px; padding: 8px 10px; border: 2px solid #5a6ab0; border-radius: 10px; background: #fff; color: #16193a; font-size: 1rem; }
.ws-list { padding-left: 1.4rem; display: grid; gap: 16px; }
.ws-q .art { max-width: 220px; }
.ws-setup { font-style: italic; color: var(--ml-ink-soft, #4a4f7a); }
.ws-opts { margin: 4px 0 0; padding-left: 1.6rem; display: grid; gap: 2px; list-style-type: upper-alpha; }
.ws-line { margin: 8px 0 12px; }
.ws-why { color: var(--ml-ink-soft, #4a4f7a); font-size: 0.9rem; }
@media print { .ws-q { break-inside: avoid; } .ws-key { break-before: page; } .ws .btn, .ws .actions { display: none !important; } }
.ws-list { list-style: none; padding-left: 0; }
.ws-prompt { font-weight: 700; }
@media print { .lc-fab, .lc-panel { display: none !important; } }
.ty-line { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.3rem; line-height: 1.7; margin: 10px 0; word-break: break-word; }
.ty-ok { color: #2a8c86; }
.ty-bad { background: #ece6ff; color: #6a4fb0; border-radius: 3px; }
.ty-todo { color: #16193a; }
.ty-cur { border-bottom: 3px solid #f0a060; }
.ch-passage { background: var(--ml-teal-50, #eefaf9); border: 2px solid var(--ml-teal-200, #cfeeea); border-radius: 14px; padding: 12px 14px; margin: 8px 0 12px; }
.ch-passage h3 { margin: 0 0 6px; color: var(--ml-teal-800, #0f4f4b); }
.ch-q { font-weight: 700; font-size: 1.1rem; margin: 8px 0; }
.ch-opts { display: grid; gap: 8px; }
.ch-opt { text-align: left; justify-content: flex-start; }
.ch-right { background: #d6f3ee !important; border-color: #2a8c86 !important; }
.ch-wrong { background: #ece6ff !important; border-color: #6a4fb0 !important; }
.cert-sheet { margin-top: 14px; padding: 28px 18px; text-align: center; background: #fffdf8; border: 6px double #2a8c86; border-radius: 16px; }
.cert-top { letter-spacing: 0.2em; text-transform: uppercase; color: #2a8c86; font-weight: 800; margin: 0; }
.cert-title { font-size: 1.7rem; margin: 8px 0 16px; color: #16193a; }
.cert-name { font-size: 2rem; font-weight: 800; margin: 8px 0 12px; color: #6a4fb3; border-bottom: 2px solid #ffb27a; display: inline-block; padding: 0 16px 4px; }
.cert-date { margin-top: 18px; color: #4a4f7a; }
@media print { .cert .cert-form, .cert .lede, .cert .page-title { display: none !important; } .cert-sheet { margin: 0; } }
.px-wrap { display: flex; justify-content: center; margin: 10px 0; }
.px-canvas { width: 100%; max-width: 320px; aspect-ratio: 1; touch-action: none; border: 3px solid #5a6ab0; border-radius: 10px; background: #fffdf8; image-rendering: pixelated; }
.px-canvas:focus { outline: 3px solid #f0a060; }
.px-pal { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0; }
.px-sw { width: 40px; height: 40px; border-radius: 50%; border: 2px solid #16193a; cursor: pointer; }
.px-sw[aria-pressed="true"] { outline: 3px solid #f0a060; outline-offset: 2px; }
.actions .btn[aria-pressed="true"] { background: #d6f3ee; border-color: #2a8c86; }
.px-size { width: auto; }
.rh-grid { display: grid; gap: 8px; margin: 10px 0; }
.rh-row { min-width: 390px; display: grid; grid-template-columns: 58px repeat(8, 1fr); gap: 4px; align-items: center; }
.rh-name { font-size: 0.8rem; font-weight: 700; color: #16193a; }
.rh-cell { aspect-ratio: 1; min-height: 28px; min-width: 0; border: 2px solid #5a6ab0; border-radius: 8px; background: #fffdf8; cursor: pointer; padding: 0; }
.rh-cell[aria-pressed="true"].rh-drum { background: #6a4fb3; }
.rh-cell[aria-pressed="true"].rh-clap { background: #ffb27a; }
.rh-cell[aria-pressed="true"].rh-tick { background: #2a8c86; }
.rh-cell[aria-pressed="true"].rh-bell { background: #ffd36b; }
.rh-cell[aria-pressed="true"].rh-snare { background: #9fd3e6; }
.rh-cell[aria-pressed="true"].rh-shaker { background: #c9e6c0; }
.rh-cell[aria-pressed="true"].rh-tom { background: #e2c391; }
.rh-cell[aria-pressed="true"].rh-bass { background: #3a3f8f; }
.rh-cell[aria-pressed="true"].rh-chime { background: #f7c6e0; }
.rh-cell.rh-now { outline: 3px solid #f0a060; outline-offset: 1px; }
.mp-wrap { margin: 8px 0; }
.mp-svg { width: 100%; height: auto; display: block; background: #eaf6fb; border-radius: 12px; }
.mp-rest { fill: #dfe6d8; stroke: #fff; stroke-width: 0.5; }
.mp-shape { fill: #c9e6c0; stroke: #fff; stroke-width: 1; cursor: pointer; transition: fill 0.15s; }
.mp-shape:hover { fill: #a2e1dd; }
.mp-shape:focus { outline: none; stroke: #f0a060; stroke-width: 3; }
.mp-shape.mp-right { fill: #2a8c86 !important; }
.mp-shape.mp-wrong { fill: #b9a7ff !important; }
.st-story { margin-top: 14px; padding: 14px; background: #fffdf8; border: 2px solid #a2e1dd; border-radius: 14px; line-height: 1.6; }
.st-story:empty { display: none; }
@media print { .st .idea-field, .st .sp-in, .st .idea-pitch { display: none !important; } .st-story { border: none; font-size: 1.2rem; } }
.st-saved { margin-top: 14px; }
.st-item { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--ml-line, #e3e6f3); }
.st-item span { flex: 1 1 160px; font-weight: 600; }
@media print { .st-saved, .st .actions, .st .arc-msg { display: none !important; } }
.rh-grid { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rh-16 .rh-row { gap: 4px; min-width: 700px; }
.rh-16 .rh-cell { border-radius: 6px; }

/* ---------- Rewards ---------- */
.rw-lumi { width: 120px; height: 120px; margin: 30px auto 14px; }
.rw-lumi svg { width: 100%; height: 100%; overflow: visible; }
.rw-list { list-style: none; padding: 0; margin: 0; }
.rw-list li { padding: 10px 0; border-bottom: 1px solid var(--ml-line, #e3e6f3); }
.rw-off { color: var(--ml-muted); }
.reward-toast { position: fixed; left: 12px; right: 12px; bottom: 84px; z-index: 50; background: #fff3c4; border: 2px solid #f3c969; color: #16193a; border-radius: 14px; padding: 12px 14px; text-align: center; box-shadow: 0 6px 18px rgba(22,25,58,0.18); }
.reward-toast a { color: #16193a; font-weight: 700; }

/* ---------- Joy: streaks, pop, confetti ---------- */
.streak { margin: 10px 0 0; font-family: var(--ml-font-display); font-weight: 700; color: #8a5a00; background: #fff3c4; border-radius: var(--ml-radius-pill); display: inline-block; padding: 4px 14px; animation: pop-in 0.35s ease-out 1; }
.streak.big { background: #ffe3cc; color: #7a3d00; animation: pop-in 0.5s ease-out 1; }
.opt.is-right { animation: pop-in 0.35s ease-out 1; }
@keyframes pop-in { 0% { transform: scale(0.8); opacity: 0.4; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti span { position: absolute; top: -12px; width: 9px; height: 13px; border-radius: 2px; opacity: 0.9; animation: confetti-fall 1.6s ease-in forwards; }
@keyframes confetti-fall { to { transform: translateY(105vh) rotate(540deg); opacity: 0.2; } }
@media (prefers-reduced-motion: reduce) { .streak, .opt.is-right, .confetti { animation: none; } .confetti { display: none; } }

/* ---------- Bigger squares option for dense puzzles ---------- */
.is-big { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.is-big > * { width: max-content; margin-inline: auto; }
.is-big .sd-cell, .is-big .ws-cell, .is-big .mn-cell { width: 44px; height: 44px; font-size: 1.2rem; }
.is-big .cw-cell, .is-big .cw-block, .is-big .cw-in { width: 44px; height: 44px; }
.is-big .cw-in { font-size: 1.2rem; padding: 10px 0 0; }
.is-big .cw-num { font-size: 0.65rem; left: 3px; }

.goal-line { color: #8a5a00; font-weight: 600; }

.chip.boss { background: #ffe3cc; color: #7a3d00; border-color: #f0a060; }

/* ---------- Quests ---------- */
.qs-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 14px; }
.qs-list li { display: grid; gap: 6px; }
.qs-bar { display: block; height: 10px; border-radius: 6px; background: var(--ml-teal-100, #d6f3ee); overflow: hidden; }
.qs-fill { display: block; height: 100%; background: #2a8c86; border-radius: 6px; }
.qs-done strong::after { content: ' ✓'; color: #2a8c86; }

.timer-note { color: #8a5a00; font-weight: 600; margin: 8px 0 0; }
.mix-light { display: flex; align-items: center; gap: 8px; margin: 14px 0; min-height: 44px; }
.mix-light input { width: 22px; height: 22px; }
/* Badges */
.bd-card { display: grid; gap: 8px; }
.bd-bar { display: block; height: 10px; border-radius: 6px; background: var(--ml-teal-100, #d6f3ee); overflow: hidden; }
.bd-fill { display: block; height: 100%; background: #2a8c86; border-radius: 6px; }
.bd-chips { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.bd-chip { display: grid; gap: 2px; min-width: 96px; padding: 8px 12px; border-radius: 14px; border: 2px solid var(--ml-line, #e3e6f3); font-size: 0.85rem; color: var(--ml-muted); }
.bd-chip strong { font-size: 0.95rem; }
.bd-chip.is-earned { border-color: #2a8c86; background: var(--ml-teal-100, #d6f3ee); color: var(--ml-teal-800); }
.bd-chip.is-earned strong::after { content: ' ✓'; }
.bd-chip.is-next { border-style: dashed; border-color: var(--ml-teal-200, #9fdcd5); color: var(--ml-ink); }
.bd-chip.is-later { opacity: 0.6; border-style: dotted; }
