/* Layout: one centered column for home; play is a full-height stage (written work + live equation on a balance beam) over a touch tray. */
:root {
  --font-display: 'Bricolage Grotesque', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Lexend', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --font-math: 'STIX Two Text', 'Cambria Math', Cambria, 'Times New Roman', serif;
  --r: 14px;
}
/* colors:start (written by tools/apply-scheme.mjs) — scheme: Navy & Marigold */
:root {
  --paper: #F4F6FB;
  --card: #FFFFFF;
  --ink: #14213D;
  --muted: #5B6478;
  --line: #D5DBE8;
  --x: #C26100;
  --y: #C2187A;
  --move: #2546C7;
  --on-move: #FFFFFF;
  --good: #A86B00;
  --bad: #C81E4A;
  --key: #FFFFFF;
  --key-edge: #C6CEDF;
  --key-press: #E8ECF5;
  --beam: #9AA6BE;
  --move-bg: rgba(37, 70, 199, 0.12);
  --sel-bg: rgba(20, 33, 61, 0.08);
  --bad-bg: rgba(200, 30, 74, 0.1);
  --shadow: 0 1px 0 rgba(20, 24, 40, .04), 0 8px 24px -12px rgba(20, 24, 40, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1629;
    --card: #18213A;
    --ink: #EEF1F8;
    --muted: #9AA3B8;
    --line: #2A3552;
    --x: #FFB23E;
    --y: #F06BB5;
    --move: #7C9BFF;
    --on-move: #0F1629;
    --good: #F5C451;
    --bad: #FF7A90;
    --key: #1E2945;
    --key-edge: #0A0F1E;
    --key-press: #27345A;
    --beam: #3A4668;
    --move-bg: rgba(124, 155, 255, 0.15);
    --sel-bg: rgba(238, 241, 248, 0.1);
    --bad-bg: rgba(255, 122, 144, 0.13);
    --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 10px 28px -14px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1629;
  --card: #18213A;
  --ink: #EEF1F8;
  --muted: #9AA3B8;
  --line: #2A3552;
  --x: #FFB23E;
  --y: #F06BB5;
  --move: #7C9BFF;
  --on-move: #0F1629;
  --good: #F5C451;
  --bad: #FF7A90;
  --key: #1E2945;
  --key-edge: #0A0F1E;
  --key-press: #27345A;
  --beam: #3A4668;
  --move-bg: rgba(124, 155, 255, 0.15);
  --sel-bg: rgba(238, 241, 248, 0.1);
  --bad-bg: rgba(255, 122, 144, 0.13);
  --shadow: 0 1px 0 rgba(0, 0, 0, .25), 0 10px 28px -14px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
/* colors:end */

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; touch-action: manipulation; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--move); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.1; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

#app { min-height: 100%; }
#app.playing { height: 100%; overflow: hidden; user-select: none; -webkit-user-select: none; }

/* ---------- shared bits ---------- */
.wrap { max-width: 980px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 20px 48px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; border-radius: 12px; padding: 12px 20px; font-weight: 600; font-size: 16px; text-decoration: none; }
.btn.primary { background: var(--move); color: var(--on-move); box-shadow: 0 3px 0 color-mix(in srgb, var(--move) 60%, #000); }
.btn.primary:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--move) 60%, #000); }
.btn.ink { background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; border: 1px solid var(--line); }
.btn.big { font-size: 20px; padding: 16px 30px; border-radius: 14px; }
.btn[disabled] { opacity: .45; cursor: default; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--sel-bg); color: var(--muted); white-space: nowrap; }
.pill.good { background: color-mix(in srgb, var(--good) 16%, transparent); color: var(--good); }
.pill.move { background: var(--move-bg); color: var(--move); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.x { background: color-mix(in srgb, var(--x) 14%, transparent); color: var(--x); }

/* ---------- math ---------- */
.m { font-family: var(--font-math); font-variant-numeric: lining-nums; }
.m .x, .x, .m .y, .y { font-family: var(--font-math); font-style: italic; color: var(--x); padding-right: .04em; }
.m .y, .y { color: var(--y); }
.m .o { margin: 0 .28em; }
.m .p { color: var(--muted); }
.m .xv { color: var(--x); }
.m .frac { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; font-size: .78em; line-height: 1.05; margin: 0 .08em; }
.m .frac .fn { display: inline-flex; align-items: center; padding: 0 .18em .06em; border-bottom: .07em solid currentColor; }
.m .frac .fd { padding-top: .06em; }
.m .it, .m .tok { display: inline-flex; align-items: center; }

/* ---------- home ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.brand svg { width: 38px; height: 38px; }
.hello { margin-bottom: 22px; }
.hello h1 { font-size: clamp(34px, 6vw, 54px); font-weight: 800; letter-spacing: -.03em; }
.hello p { margin: 8px 0 0; color: var(--muted); }

.today { display: grid; grid-template-columns: 1fr auto; gap: 20px 28px; align-items: center; padding: 26px 28px; margin-bottom: 36px; }
.today h2 { font-size: 30px; font-weight: 750; margin: 6px 0 6px; }
.today p { margin: 0; color: var(--muted); }
.today .show { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; padding: 18px 8px 4px; border-top: 1px dashed var(--line); font-size: clamp(30px, 6vw, 48px); }
.today .actions { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h3 { font-size: 22px; font-weight: 750; }
.skills { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.skill { width: 100%; display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; align-items: center; text-align: left; padding: 14px 16px; cursor: pointer; }
.skill .ring { grid-row: 1 / span 3; width: 52px; height: 52px; position: relative; }
.skill .ring svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.skill .ring .num { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.skill .name { font-weight: 600; line-height: 1.25; }
.skill .sample { font-size: 20px; color: var(--ink); }
.skill.locked { cursor: default; opacity: .55; box-shadow: none; background: transparent; border-style: dashed; }
.ring-track { stroke: var(--line); }
.ring-fill { stroke: var(--move); transition: stroke-dashoffset .6s ease; }
.s-mastered .ring-fill, .s-review .ring-fill { stroke: var(--good); }
.s-rusty .ring-fill { stroke: var(--bad); }

.onboard { padding: 26px 28px; margin-bottom: 36px; }
.onboard h2 { font-size: 30px; font-weight: 750; margin-bottom: 16px; }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.how div { padding: 14px; border-radius: 12px; background: var(--sel-bg); }
.how b { display: block; font-family: var(--font-display); font-size: 18px; margin-bottom: 4px; }
.how p { margin: 0; color: var(--muted); font-size: 15px; }
.how .m { font-size: 22px; margin-bottom: 8px; display: block; color: var(--ink); }
.place { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* ---------- play ---------- */
.play { height: 100%; display: flex; flex-direction: column; }
.bar { display: flex; align-items: center; gap: 12px; padding-block: 12px 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.track { flex: 1; display: flex; gap: 6px; min-width: 0; }
.track i { flex: 1; height: 8px; border-radius: 4px; background: var(--line); max-width: 64px; }
.track i.done { background: var(--good); }
.track i.rough { background: var(--x); }
.track i.now { background: var(--move); }
.bar .pill { font-size: 13px; }
.hint-btn { width: auto; padding: 0 14px; gap: 6px; font-weight: 600; color: var(--x); }

.stage { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.work { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; -webkit-overflow-scrolling: touch; }
.eqgrid { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: .1em; padding-block: 8px 0; }
.eqgrid > .l { justify-self: end; }
.eqgrid > .r { justify-self: start; }
.eqgrid > .e { justify-self: center; font-family: var(--font-math); padding: 0 .3em; }
.eqgrid .h { font-size: var(--hs, 26px); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.eqgrid .h .x { color: color-mix(in srgb, var(--x) 75%, var(--muted)); }
.eqgrid .h .y { color: color-mix(in srgb, var(--y) 75%, var(--muted)); }
.eqgrid .mv { font-size: calc(var(--hs, 26px) * .78); color: var(--move); font-family: var(--font-math); white-space: nowrap; line-height: 1.2; padding-bottom: 4px; }
.eqgrid .mv .x, .eqgrid .mv .y { color: var(--move); }
.eqgrid .mv.l { border-bottom: 2px solid color-mix(in srgb, var(--move) 45%, transparent); }
.eqgrid .mv.r { border-bottom: 2px solid color-mix(in srgb, var(--move) 45%, transparent); }
.eqgrid .c { font-size: var(--cs, 72px); white-space: nowrap; line-height: 1.35; padding-top: .12em; }
.eqgrid .sc { display: inline-flex; align-items: center; }
.eqgrid .beam { grid-column: 1 / -1; position: relative; height: 34px; margin-top: 2px; }
.beam .bar-line { position: absolute; left: 4%; right: 4%; top: 4px; height: 6px; border-radius: 3px; background: var(--beam); transform-origin: 50% 50%; }
.beam .pivot { position: absolute; left: 50%; top: 10px; width: 34px; height: 22px; transform: translateX(-50%); background: var(--beam); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.beam.wobble .bar-line { animation: wobble .9s cubic-bezier(.3, 1.6, .5, 1); }
.beam.won .bar-line, .beam.won .pivot { background: var(--good); }
@keyframes wobble { 0% { transform: rotate(0) } 25% { transform: rotate(-2.2deg) } 50% { transform: rotate(1.6deg) } 75% { transform: rotate(-.6deg) } 100% { transform: rotate(0) } }

.c .tok { all: unset; display: inline-flex; align-items: center; cursor: pointer; padding: .02em .1em; border-radius: .16em; transition: background .15s, box-shadow .15s; }
.c .tok:focus-visible { outline: 3px solid var(--move); outline-offset: 2px; }
.c .tok.fresh { color: var(--move); }
.c .tok.pending { color: var(--move); background: var(--move-bg); box-shadow: inset 0 -0.06em 0 var(--move); }
.c .tok.pending .p { color: var(--move); }
.c .tok.sel { background: var(--sel-bg); box-shadow: inset 0 0 0 .05em var(--ink); }
.c .tok.hinted { animation: glow 1.1s ease-in-out infinite; }
.c .tok.born { animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 .04em var(--x); background: transparent } 50% { box-shadow: inset 0 0 0 .06em var(--x); background: color-mix(in srgb, var(--x) 16%, transparent) } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0 } 100% { transform: scale(1); opacity: 1 } }

.status { min-height: 52px; margin: 0; padding: 10px 0 12px; text-align: center; font-size: 18px; line-height: 1.35; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 8px; text-wrap: balance; }
.status.bad { color: var(--bad); }
.status.good { color: var(--good); }
.status.info { color: var(--ink); }
.status .m { font-size: 1.1em; }

/* ---------- tray ---------- */
.tray { --k: clamp(54px, 7.6vw, 76px); --kh: clamp(46px, 6.8vh, 64px); flex: none; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(0, 0, 0, .35); padding-block: 16px max(16px, env(safe-area-inset-bottom, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.panel { max-width: 940px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 28px; align-items: start; }
.panel-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.panel-head { display: flex; flex-direction: column; gap: 2px; }
.panel-head .lead { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.panel.locked .ops, .panel.locked .preview, .panel.locked .keypad, .panel.locked .go { opacity: .35; pointer-events: none; }

.ops { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.op { height: clamp(56px, 8vh, 72px); border-radius: 14px; border: 2px solid var(--line); background: var(--key); font-family: var(--font-math); font-size: 34px; cursor: pointer; box-shadow: 0 3px 0 var(--key-edge); }
.op:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); }
.op.on { border-color: var(--move); background: var(--move-bg); color: var(--move); }

.preview { display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 6px 16px; border-radius: 14px; border: 2px dashed var(--line); }
.preview .m { font-size: 38px; color: var(--move); }
.preview .m .x, .preview .m .y { color: var(--move); }
.preview .ghost { color: var(--muted); font-size: 16px; }
.preview .both { margin-left: auto; font-size: 13px; color: var(--muted); text-align: right; line-height: 1.3; }

.keypad { display: grid; grid-template-columns: repeat(3, var(--k, 72px)); gap: 9px; }
.keypad.withx { grid-template-columns: repeat(4, var(--k, 72px)); }
.key { height: var(--kh, 60px); border-radius: 14px; border: 1px solid var(--line); background: var(--key); font-family: var(--font-math); font-size: 30px; cursor: pointer; box-shadow: 0 3px 0 var(--key-edge); display: grid; place-items: center; }
.key:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); background: var(--key-press); }
.key.fn { font-family: var(--font-body); font-size: 18px; color: var(--muted); }
.key.xk { color: var(--x); font-style: italic; font-size: 34px; }
.key.xk.on { background: color-mix(in srgb, var(--x) 16%, var(--key)); border-color: var(--x); }
.key.yk { color: var(--y); font-style: italic; font-size: 34px; }
.key.yk.on { background: color-mix(in srgb, var(--y) 16%, var(--key)); border-color: var(--y); }
.key.wide { grid-column: span 2; }
.go { width: 100%; }

.calc-expr { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: clamp(34px, 5.5vw, 52px); padding: 6px 0; }
.slot { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5em; height: 1.2em; padding: 0 .2em; margin: 0 .1em; border-radius: .16em; border: .05em solid var(--move); background: var(--move-bg); color: var(--ink); }
.slot.empty { color: var(--muted); }
.part-dots { display: flex; gap: 6px; }
.part-dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.part-dots i.done { background: var(--good); }
.part-dots i.now { background: var(--move); }
.help { border-radius: 12px; padding: 10px 14px; background: var(--sel-bg); font-size: 16px; line-height: 1.4; }
.help.bad { background: var(--bad-bg); color: var(--bad); }
.help svg { display: block; width: 100%; max-width: 520px; height: auto; margin-top: 6px; }
.nl-axis { stroke: var(--muted); }
.nl-tick { stroke: var(--muted); }
.nl-label { fill: var(--muted); font: 12px var(--font-body); }
.nl-zero { fill: var(--ink); font-weight: 700; }
.nl-arc { stroke: var(--move); fill: none; }
.nl-head { fill: var(--move); }
.nl-start { fill: var(--ink); }
.nl-step { fill: var(--move); font: 600 13px var(--font-body); }

.shake { animation: shake .4s; }
@keyframes shake { 0%, 100% { transform: translateX(0) } 20% { transform: translateX(-8px) } 40% { transform: translateX(7px) } 60% { transform: translateX(-5px) } 80% { transform: translateX(3px) } }

.solved-panel { max-width: 940px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; }
.solved-panel h2 { font-size: 32px; font-weight: 800; color: var(--good); }
.solved-panel .answer { font-size: 40px; }
.checkline { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 14px; font-size: 22px; color: var(--muted); }
.checkline .lbl { font: 600 12px var(--font-body); letter-spacing: .08em; text-transform: uppercase; align-self: center; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.intro-panel { max-width: 940px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 28px; align-items: center; }
.intro-panel h2 { font-size: 28px; font-weight: 800; }
.intro-panel p { margin: 6px 0 0; font-size: 18px; color: var(--muted); max-width: 60ch; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(10, 20, 22, .45); }
.modal .card { max-width: 420px; width: 100%; padding: 24px; }
.modal h3 { font-size: 22px; margin-bottom: 8px; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- summary & grown-ups ---------- */
.summary h1, .parent h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; letter-spacing: -.02em; margin-bottom: 8px; }
.lede { color: var(--muted); margin: 0 0 24px; font-size: 18px; }
.banner { padding: 16px 20px; border-radius: var(--r); margin-bottom: 14px; display: flex; gap: 14px; align-items: center; font-size: 17px; }
.banner.good { background: color-mix(in srgb, var(--good) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--good) 35%, transparent); }
.banner.warn { background: color-mix(in srgb, var(--x) 12%, var(--card)); border: 1px solid color-mix(in srgb, var(--x) 30%, transparent); }
.banner b { font-family: var(--font-display); }
.results { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
.results li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; }
.results .dot { width: 14px; height: 14px; border-radius: 50%; }
.results .eqs { font-size: 22px; overflow-x: auto; white-space: nowrap; }
.dot.clean { background: var(--good); } .dot.ok { background: var(--move); } .dot.rough { background: var(--x); }
.row-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 28px; }
.tile { padding: 16px 18px; }
.tile .v { font-family: var(--font-display); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile .k { font-size: 13px; color: var(--muted); }
.panelbox { padding: 20px 22px; margin-bottom: 20px; }
.panelbox h3 { font-size: 20px; margin-bottom: 4px; }
.panelbox > p { margin: 0 0 16px; color: var(--muted); }
.bars { display: grid; gap: 10px; }
.barrow { display: grid; grid-template-columns: minmax(130px, 220px) minmax(0, 1fr) 44px; gap: 12px; align-items: center; font-size: 15px; }
.barrow .track2 { height: 12px; border-radius: 6px; background: var(--sel-bg); overflow: hidden; }
.barrow .fill { height: 100%; border-radius: 6px; background: var(--x); }
.barrow .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
table.sk { width: 100%; border-collapse: collapse; font-size: 15px; }
table.sk th { text-align: left; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.sk td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.tablewrap { overflow-x: auto; }
.mini { display: inline-block; width: 90px; height: 8px; border-radius: 4px; background: var(--sel-bg); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--move); }
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select, .field textarea { font: inherit; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); max-width: 100%; }
.field textarea { min-height: 80px; font: 13px/1.4 ui-monospace, Menlo, Consolas, monospace; resize: vertical; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: transparent; padding: 8px 16px; cursor: pointer; font-weight: 600; }
.seg button.on { background: var(--move); color: var(--on-move); }
.note { font-size: 14px; color: var(--muted); }

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ---------- two equations ---------- */
.tag { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border-radius: 50%; border: .09em solid currentColor; font: 700 .62em/1 var(--font-body); font-style: normal; flex: none; }
.eqgrid .tag { margin-right: .7em; font-size: .42em; color: var(--muted); }
.eqgrid .b { font-size: var(--bs, 52px); white-space: nowrap; line-height: 1.45; }
.eqgrid .snote { margin-left: .7em; font: 600 .36em var(--font-body); color: var(--move); }
.eqgrid .rule { grid-column: 1 / -1; border-top: 2px dashed var(--line); margin: 10px 0 6px; }
.eqgrid .found { grid-column: 1 / -1; justify-self: center; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-bottom: 4px; }
.found .pill { font-size: max(14px, calc(var(--hs, 26px) * .6)); padding: 4px 14px; }
.sysrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sysrow > .eyebrow { width: 100%; }
.sysbtn { min-height: clamp(52px, 7vh, 64px); padding: 0 18px; border-radius: 14px; border: 2px solid var(--line); background: var(--key); box-shadow: 0 3px 0 var(--key-edge); font-size: 18px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.sysbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--key-edge); }
.sysbtn.on { border-color: var(--move); background: var(--move-bg); color: var(--move); }
.sysbtn.hinted, .op.hinted { animation: glowbtn 1.1s ease-in-out infinite; }
.sysbtn .tag { font-size: 15px; }
.sysbtn .m { font-size: 22px; }
@keyframes glowbtn { 0%, 100% { box-shadow: 0 3px 0 var(--key-edge), 0 0 0 0 transparent } 50% { box-shadow: 0 3px 0 var(--key-edge), 0 0 0 4px color-mix(in srgb, var(--x) 45%, transparent) } }

/* ---------- smaller screens ---------- */
@media (max-width: 760px) {
  .today { grid-template-columns: 1fr; }
  .how { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel, .solved-panel, .intro-panel { grid-template-columns: 1fr; }
  .keypad { justify-content: center; }
  .barrow { grid-template-columns: 110px minmax(0, 1fr) 36px; }
}
@media (max-height: 700px) and (min-width: 761px) {
  .panel-head .lead { font-size: 18px; }
  .preview { min-height: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
