/* Layout idea: a bright lab notebook. Cool paper, ink-navy text, cobalt for action, marigold for rewards. */
:root {
  color-scheme: light;
  --page: #f4f6fb; --surface: #ffffff; --soft: #e9edf7; --line: #d3d9e8;
  --ink: #141b33; --muted: #56607c;
  --accent: #2f5bea; --accent-ink: #ffffff; --accent-soft: #e3e9fd;
  --c1: #e8930c; --c2: #2f8fd8; --gold: #f2a71b; --gold-soft: #fdf1d6;
  --good: #0d8a68; --good-soft: #dff4ec; --bad: #d63a40; --bad-soft: #fde6e6;
  --dark: #141b33; --on-dark: #f4f6fb;
  --font-display: "Bricolage Grotesque", "Trebuchet MS", "Segoe UI", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", Verdana, sans-serif;
  --font-mono: "JetBrains Mono", Consolas, monospace;
  --r: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e1325; --surface: #171e36; --soft: #212a48; --line: #323d61;
    --ink: #eef1fb; --muted: #a3acc8;
    --accent: #7d9bff; --accent-ink: #0b1026; --accent-soft: #232e58;
    --c1: #f5b040; --c2: #62b6f2; --gold: #f5b83d; --gold-soft: #3a3016;
    --good: #46cfa6; --good-soft: #143a31; --bad: #ff7b7f; --bad-soft: #43202a;
    --dark: #070a16; --on-dark: #eef1fb;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e1325; --surface: #171e36; --soft: #212a48; --line: #323d61;
  --ink: #eef1fb; --muted: #a3acc8;
  --accent: #7d9bff; --accent-ink: #0b1026; --accent-soft: #232e58;
  --c1: #f5b040; --c2: #62b6f2; --gold: #f5b83d; --gold-soft: #3a3016;
  --good: #46cfa6; --good-soft: #143a31; --bad: #ff7b7f; --bad-soft: #43202a;
  --dark: #070a16; --on-dark: #eef1fb;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.6 var(--font-body); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.12; margin: 0; text-wrap: balance; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); font-weight: 800; }
h2 { font-size: 1.45rem; font-weight: 800; }
h3 { font-size: 1.12rem; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: fixed; left: 12px; top: -60px; background: var(--surface); padding: 8px 12px; border-radius: 8px; z-index: 20; }
.skip:focus { top: 12px; }
.frame { max-width: 1120px; margin-inline: auto; padding-inline: 20px; }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.small { font-size: .88rem; color: var(--muted); }
.lead { color: var(--muted); max-width: 60ch; }
code, .mono { font-family: var(--font-mono); font-size: .9em; }
code { background: var(--soft); padding: 1px 6px; border-radius: 5px; }

/* header */
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-in { display: flex; align-items: center; gap: 12px 20px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: flex; align-items: center; gap: 10px; font: 800 1.1rem var(--font-display); color: var(--ink); text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 6px; }
.brand-mark i { background: var(--accent-ink); border-radius: 2px; height: 40%; }
.brand-mark i:nth-child(2) { height: 70%; } .brand-mark i:nth-child(3) { height: 100%; background: var(--gold); }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { padding: 6px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: .95rem; }
.nav a:hover { background: var(--soft); color: var(--ink); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav b { background: var(--bad); color: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; margin-left: 2px; }
.chips { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .92rem; }
.chip.icon { padding-inline: 10px; }
.flame { width: 12px; height: 15px; background: var(--gold); border-radius: 60% 60% 55% 55% / 75% 75% 40% 40%; transform: rotate(4deg); }
.bolt { font-size: .68rem; background: var(--accent); color: var(--accent-ink); border-radius: 5px; padding: 1px 5px; letter-spacing: .04em; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-block: 28px 36px; color: var(--muted); font-size: .88rem; }
body.in-lesson .foot, body.in-lesson .nav { display: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 10px 18px; font-weight: 700; text-decoration: none; background: var(--surface); color: var(--ink); transition: transform .12s, box-shadow .12s; }
.btn.primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn.quiet { border-color: var(--line); }
.btn.quiet:hover:not(:disabled) { background: var(--soft); }
.btn.big { padding: 14px 24px; font-size: 1.05rem; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* home */
main { padding-block: 28px 12px; display: flex; flex-direction: column; gap: 44px; min-height: 60vh; }
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 28px; align-items: start; }
.hero-main { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.hero-main p { color: var(--muted); font-size: 1.1rem; max-width: 52ch; }
.hero-sub { font-size: .88rem; color: var(--muted); }
.hero-side { display: grid; gap: 10px; }
.stat-card { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; color: var(--ink); text-decoration: none; }
.stat-card.link { border-color: var(--gold); background: var(--gold-soft); }
.stat-card div { display: flex; flex-direction: column; line-height: 1.3; }
.stat-card span { font-size: .86rem; color: var(--muted); }
.big-num { font: 800 1.9rem var(--font-display); width: 56px; text-align: center; color: var(--accent); font-variant-numeric: tabular-nums; }
.ring { width: 56px; height: 56px; flex: none; }
.ring-bg { fill: none; stroke: var(--soft); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--gold); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s; }
.ring text { font: 800 16px var(--font-display); fill: var(--ink); }
.sec-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
.sec-head p { color: var(--muted); max-width: 70ch; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.course-card { display: flex; flex-direction: column; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; color: var(--ink); text-decoration: none; transition: transform .15s, border-color .15s; }
.course-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.course-card p { color: var(--muted); font-size: .95rem; flex: 1; }
.bar { display: block; height: 8px; background: var(--soft); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 8px; transition: width .6s; }
.bar.wide { max-width: 520px; height: 12px; } .bar.wide i { background: var(--gold); }
.card-foot { display: flex; justify-content: space-between; font-size: .88rem; color: var(--muted); }
.go { color: var(--accent); font-weight: 700; }
.tracks { display: grid; gap: 12px; }
.track { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 20px; display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 12px 24px; }
.track-head { display: flex; gap: 12px; }
.track-head p { color: var(--muted); font-size: .88rem; line-height: 1.4; margin-top: 3px; }
.track-num { font: 500 .8rem var(--font-mono); color: var(--muted); padding-top: 4px; }
.track-courses { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }
.pill { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: .86rem; color: var(--muted); text-decoration: none; }
.pill.open { border-color: var(--accent); color: var(--ink); background: var(--accent-soft); font-weight: 700; }
.pill b { font-size: .7rem; background: var(--accent); color: var(--accent-ink); padding: 0 6px; border-radius: 6px; text-transform: uppercase; letter-spacing: .05em; }
.dots { font-size: .5rem; letter-spacing: 1px; color: var(--c1); } .dots i { font-style: normal; color: var(--line); }

/* course page */
.back { font-weight: 700; text-decoration: none; font-size: .92rem; margin-bottom: -28px; }
.course-head { display: flex; flex-direction: column; gap: 10px; }
.course-head p { color: var(--muted); max-width: 62ch; font-size: 1.08rem; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta span { background: var(--soft); border-radius: 8px; padding: 3px 10px; font-size: .86rem; font-weight: 700; }
.path { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.path a { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none; }
.path a:hover { border-color: var(--accent); }
.path .up a { border: 2px solid var(--accent); }
.node { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--soft); font: 800 1.05rem var(--font-display); }
.path .done .node { background: var(--good); color: #fff; } .path .up .node { background: var(--accent); color: var(--accent-ink); animation: pulse 2s infinite; }
.path-text { flex: 1; display: flex; flex-direction: column; line-height: 1.35; } .path-text span { color: var(--muted); font-size: .9rem; }
.path-side { display: flex; flex-direction: column; align-items: flex-end; font-size: .86rem; color: var(--muted); white-space: nowrap; }
.stars { color: var(--gold); letter-spacing: 2px; } .stars i { font-style: normal; color: var(--line); }
.stars.huge { font-size: 3rem; line-height: 1; }

/* lesson player */
.player { max-width: 760px; width: 100%; margin-inline: auto; display: flex; flex-direction: column; gap: 22px; }
.player-top { display: flex; align-items: center; gap: 14px; }
.close { color: var(--muted); text-decoration: none; font-size: 1.2rem; padding: 2px 8px; border-radius: 8px; } .close:hover { background: var(--soft); }
.segs { flex: 1; display: flex; gap: 4px; } .segs i { flex: 1; height: 9px; background: var(--soft); border-radius: 6px; transition: background .3s; }
.segs i.full { background: var(--good); } .segs i.now { background: var(--accent); }
.earned { font-weight: 700; color: var(--c1); font-variant-numeric: tabular-nums; white-space: nowrap; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: clamp(20px, 4vw, 36px); display: flex; flex-direction: column; gap: 16px; animation: stepin .35s ease both; outline: none; }
.step p { max-width: 64ch; }
.step h2.q { font-size: 1.3rem; }
.player-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 0; background: linear-gradient(transparent, var(--page) 30%); padding-block: 14px; }
.foot-hint { font-size: .88rem; color: var(--muted); text-align: center; flex: 1; }
.term { background: none; border: 0; padding: 0; color: inherit; font: inherit; font-weight: 700; border-bottom: 2px dotted var(--accent); cursor: help; }
.term:hover { background: var(--accent-soft); }
.pop { position: absolute; z-index: 30; background: var(--dark); color: var(--on-dark); border-radius: 14px; padding: 14px 16px; box-shadow: 0 12px 30px rgba(10, 15, 40, .3); font-size: .95rem; line-height: 1.45; animation: stepin .18s ease both; }
.pop-name { font: 800 1.02rem var(--font-display); color: var(--gold); margin-bottom: 4px; text-transform: capitalize; }
.pop .term { border-bottom-color: var(--gold); }
.callout { border-radius: 14px; padding: 14px 16px; background: var(--soft); display: flex; flex-direction: column; gap: 4px; border-left: 5px solid var(--muted); }
.callout b { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.callout.analogy { background: var(--gold-soft); border-color: var(--gold); }
.callout.example { background: var(--accent-soft); border-color: var(--accent); }
.callout.task { background: var(--good-soft); border-color: var(--good); }
.lab-tag { color: var(--good); }
.goal { color: var(--good); font-weight: 700; background: var(--good-soft); border-radius: 10px; padding: 8px 14px; animation: stepin .4s ease both; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; transition: border-color .12s, transform .12s; }
.option:hover:not(:disabled) { border-color: var(--accent); transform: translateX(3px); }
.option kbd { font: 500 .8rem var(--font-mono); width: 26px; height: 26px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); }
.option.right { border-color: var(--good); background: var(--good-soft); opacity: 1; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); animation: shake .35s; }
.option:disabled { cursor: default; } .option:disabled:not(.right):not(.wrong) { opacity: .55; }
.feedback { border-radius: 12px; } .feedback:empty { display: none; }
.feedback.good { background: var(--good-soft); padding: 12px 16px; } .feedback.bad { background: var(--bad-soft); padding: 12px 16px; }
.feedback p { display: inline; }
.finish { align-items: center; text-align: center; padding-block: 24px; }
.finish-stats { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.finish-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 22px; display: flex; flex-direction: column; min-width: 120px; }
.finish-stats b { font: 800 1.8rem var(--font-display); color: var(--accent); } .finish-stats span { font-size: .86rem; color: var(--muted); }
.recap { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 24px; width: 100%; }
.recap ul { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; }
.finish-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.empty { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; padding-block: 30px; } .empty .finish-actions { justify-content: flex-start; }

/* animated diagrams */
.art { margin: 0; background: var(--page); border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow-x: auto; }
.art-svg { display: block; width: 100%; min-width: 440px; height: auto; font-family: var(--font-body); }
.art-svg text { fill: var(--ink); font-size: 15px; font-weight: 700; }
.art-svg text.sub { fill: var(--muted); font-size: 12px; font-weight: 400; } .art-svg text.cap { fill: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.art-svg text.big { font-size: 20px; } .art-svg .blank { fill: var(--accent); } .art-svg text.onfill { fill: #fff; font-size: 13px; }
.art-svg rect, .art-svg .node { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.art-svg .k1 rect { fill: var(--gold-soft); stroke: var(--gold); } .art-svg .k2 rect { fill: var(--accent-soft); stroke: var(--accent); }
.art-svg .dark rect { fill: var(--dark); stroke: var(--dark); } .art-svg .dark text { fill: var(--on-dark); } .art-svg .dark text.sub { fill: #aab3d4; }
.art-svg rect.k0f { fill: var(--accent); stroke: none; } .art-svg rect.k1f { fill: var(--c1); stroke: none; }
.art-svg rect.band1 { fill: var(--accent-soft); stroke: var(--accent); stroke-dasharray: 5 4; } .art-svg rect.band2 { fill: var(--gold-soft); stroke: var(--gold); stroke-dasharray: 5 4; }
.art-svg .rule { stroke: var(--line); stroke-width: 1.5; }
.art-svg .a-arrow { stroke: var(--muted); stroke-width: 2.5; } .art-svg .a-head { fill: var(--muted); }
.art-svg .ring1 { fill: var(--surface); stroke: var(--line); stroke-width: 2; } .art-svg .ring2 { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 2; } .art-svg .ring3 { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 2; }
.art-svg .node.pick { fill: var(--gold-soft); stroke: var(--gold); stroke-width: 4; }
.art-svg .pkt.down, .art-svg .pkt-key.down { fill: var(--accent); } .art-svg .pkt.up, .art-svg .pkt-key.up { fill: var(--c1); }
.a-pop { animation: pop .5s ease both; transform-box: fill-box; transform-origin: center; }
.a-grow { animation: grow .8s ease both; transform-box: fill-box; transform-origin: left center; }
.a-flow { stroke-dasharray: 7 6; animation: pop .5s ease both, flow 1s linear infinite; }
.a-step rect { animation: lit 4.8s ease infinite; animation-delay: inherit; }
.a-orbit { fill: var(--c1); animation: orbit 4s linear infinite; transform-origin: 300px 112px; }
.pkt.down { animation: travel 4s ease-in-out infinite; } .pkt.up { animation: travel 4s ease-in-out infinite; animation-delay: 2s; opacity: 0; }
@keyframes pop { from { opacity: 0; transform: scale(.85); } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes flow { to { stroke-dashoffset: -13; } }
@keyframes lit { 0%, 30%, 100% { stroke: var(--line); } 8%, 20% { stroke: var(--accent); stroke-width: 3.5; } }
@keyframes orbit { from { transform: rotate(0) translateY(-34px); } to { transform: rotate(360deg) translateY(-34px); } }
@keyframes travel { 0% { transform: translate(0, 0); opacity: 0; } 8% { opacity: 1; } 42% { transform: translate(var(--dx), var(--dy)); opacity: 1; } 50%, 100% { transform: translate(var(--dx), var(--dy)); opacity: 0; } }
@keyframes stepin { from { opacity: 0; transform: translateY(10px); } }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 22%, transparent); } }

/* widgets */
.widget { border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: var(--page); }
.w-canvas { width: 100%; display: block; background: var(--surface); border-radius: 12px; border: 1px solid var(--line); touch-action: manipulation; }
.w-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.w-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 18px; }
.w-ctl { display: flex; flex-direction: column; gap: 4px; }
.w-ctl-head { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; font-weight: 700; }
.w-ctl output { font-family: var(--font-mono); background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0 8px; }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 26px; }
select { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; }
.w-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 5px 12px; display: flex; flex-direction: column; line-height: 1.25; }
.w-stat span { font-size: .74rem; color: var(--muted); } .w-stat b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.w-note { font-size: .9rem; color: var(--muted); max-width: none !important; }
.widget .btn { padding: 7px 13px; font-size: .9rem; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 7px 13px; font-weight: 700; font-size: .9rem; } .seg button.on { background: var(--accent); color: var(--accent-ink); }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: .92rem; } .check input { width: 18px; height: 18px; accent-color: var(--bad); }
.fl { display: grid; grid-template-columns: minmax(210px, 250px) 1fr; gap: 16px; }
.fl-ctl, .fl-out { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.fl-tables { display: flex; flex-direction: column; gap: 10px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .84rem; background: var(--surface); border-radius: 10px; }
caption { text-align: left; font-weight: 700; padding: 4px 2px; }
th, td { padding: 6px 9px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
th:first-child { text-align: left; } thead th { color: var(--muted); font-size: .76rem; }
tr.sel { background: var(--accent-soft); } td.warn { color: var(--bad); font-weight: 700; }

/* glossary, progress, support */
.search input { width: 100%; max-width: 440px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.glossary { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.glossary > div { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.glossary dt { font: 800 1.02rem var(--font-display); text-transform: capitalize; } .glossary dd { margin: 4px 0 0; font-size: .94rem; }
.glossary dd a { display: block; font-size: .8rem; margin-top: 6px; }
.progress-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.days { display: flex; gap: 5px; align-items: flex-end; height: 120px; width: 100%; }
.days div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.days i { width: 100%; background: var(--gold); border-radius: 5px 5px 2px 2px; min-height: 3px; } .days span { font: 500 .68rem var(--font-mono); color: var(--muted); }
.badges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; width: 100%; }
.badges li { display: flex; gap: 12px; align-items: center; opacity: .55; } .badges li.got { opacity: 1; }
.badges b { font-size: 1.5rem; color: var(--gold); width: 28px; text-align: center; } .badges span { display: flex; flex-direction: column; font-size: .86rem; color: var(--muted); line-height: 1.3; } .badges strong { color: var(--ink); font-size: .96rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.plan { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.plan.hot { border: 2px solid var(--gold); }
.plan ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .95rem; display: grid; gap: 4px; }
.price { font: 800 2rem var(--font-display); } .price small { font: 400 .9rem var(--font-body); color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px); background: var(--dark); color: var(--on-dark); padding: 12px 20px; border-radius: 12px; font-weight: 700; transition: transform .35s; z-index: 40; border: 1px solid var(--gold); }
.toast.show { transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

@media (max-width: 760px) {
  .hero, .track, .fl { grid-template-columns: 1fr; }
  .nav { order: 3; flex-basis: 100%; }
  .chips { margin-left: auto; }
  .path-side .go { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .pkt { opacity: 0; }
}
.option.picked { border-color: var(--accent); background: var(--accent-soft); opacity: 1 !important; }
.plan .btn { align-self: stretch; }
.toast { opacity: 0; } .toast.show { opacity: 1; }
.player-foot { background: var(--page); border-top: 1px solid var(--line); }
.fl { grid-template-columns: 1fr; }
.fl-ctl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 18px; align-items: end; }

/* in-page code editor */
.ide { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.ide-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: var(--soft); border-bottom: 1px solid var(--line); }
.ide-bar .btn { padding: 6px 13px; font-size: .9rem; }
.ide-lang { font: 500 .78rem var(--font-mono); background: var(--dark); color: var(--on-dark); padding: 3px 9px; border-radius: 7px; }
.ide-status { font-size: .84rem; color: var(--muted); margin-left: auto; }
.ide-edit textarea { width: 100%; min-height: 180px; border: 0; padding: 12px; font: 500 .95rem/1.55 var(--font-mono); background: var(--surface); color: var(--ink); resize: vertical; }
.ide .CodeMirror { height: auto; min-height: 130px; font: 500 .95rem/1.55 var(--font-mono); background: var(--surface); color: var(--ink); }
.ide .CodeMirror-scroll { min-height: 130px; max-height: 420px; }
.ide .CodeMirror-gutters { background: var(--page); border-right: 1px solid var(--line); }
.ide .CodeMirror-linenumber { color: var(--muted); }
.ide .CodeMirror-cursor { border-left-color: var(--ink); }
.ide .CodeMirror-selected { background: var(--accent-soft) !important; }
.ide .cm-keyword { color: var(--accent); font-weight: 700; } .ide .cm-string { color: var(--good); } .ide .cm-number { color: var(--c1); }
.ide .cm-comment { color: var(--muted); font-style: italic; } .ide .cm-builtin { color: var(--c2); } .ide .cm-def { color: var(--c1); font-weight: 700; }
.ide .cm-variable, .ide .cm-operator, .ide .cm-property { color: var(--ink); }
.ide .CodeMirror-matchingbracket { color: var(--good) !important; outline: 1px solid var(--good); }
.ide-out-head { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #aab3d4; background: var(--dark); padding: 8px 14px 0; }
.ide-out { margin: 0; background: var(--dark); color: var(--on-dark); font: 500 .9rem/1.5 var(--font-mono); padding: 6px 14px 14px; min-height: 64px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.ide-msg { padding: 10px 14px; font-size: .95rem; } .ide-msg p { display: inline; }
.ide-msg.good { background: var(--good-soft); } .ide-msg.bad { background: var(--bad-soft); } .ide-msg.hint { background: var(--gold-soft); }
.gate-out { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font: 800 1.3rem var(--font-display); border: 3px solid var(--line); background: var(--surface); transition: background .2s, box-shadow .2s; }
.gate-out.on { background: var(--gold); color: #1a1300; border-color: var(--gold); box-shadow: 0 0 22px var(--gold); }
.bit { width: 100%; aspect-ratio: 1; max-height: 64px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font: 800 1.4rem var(--font-mono); transition: background .15s, transform .1s; }
.bit.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); } .bit:active { transform: scale(.93); }
.bits { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; } .bits small { display: block; text-align: center; font: 500 .72rem var(--font-mono); color: var(--muted); margin-top: 3px; }
.big-read { font: 800 2.2rem var(--font-display); font-variant-numeric: tabular-nums; }
tr.now { background: var(--gold-soft); font-weight: 700; }
.art-svg .a-arrow.thin { stroke-width: 1.2; opacity: .7; }
.stage { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.stage-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.stage-head p { color: var(--muted); font-size: .92rem; }
.stage-num { font: 500 .76rem var(--font-mono); background: var(--ink); color: var(--page); border-radius: 6px; padding: 2px 8px; text-transform: uppercase; letter-spacing: .05em; }
.numline { display: grid; grid-template-columns: repeat(50, 1fr); gap: 2px; }
.numline i { height: 16px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--line); }
.numline i.out { background: var(--soft); opacity: .45; } .numline i.low, .numline i.high { background: var(--muted); } .numline i.hit { background: var(--good); }
.sortbars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.sortbars div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 2px; }
.sortbars i { width: 100%; background: var(--accent); border-radius: 5px 5px 2px 2px; transition: height .25s; }
.sortbars div.cmp i { background: var(--c1); } .sortbars div.fixed i { background: var(--good); }
.sortbars span { font: 500 .75rem var(--font-mono); color: var(--muted); }

/* paths, prerequisites, accounts, legal */
.paths { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.path-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.path-card.on { border: 2px solid var(--accent); }
.path-card p { color: var(--muted); font-size: .95rem; }
.path-card ol { margin: 4px 0 0; padding-left: 20px; font-size: .92rem; display: grid; gap: 3px; flex: 1; }
.path-card li small { color: var(--muted); font-size: .76rem; } .path-card li.fin a { color: var(--good); }
.path-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.prereq { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .92rem; }
.report-btn { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: .8rem; color: var(--muted); min-height: 30px; }
.report-btn:hover { color: var(--ink); background: var(--soft); }
.report-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.report-box textarea, .auth-form input, .field, .ide-in textarea { width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface); font: inherit; }
.ide-in textarea { font-family: var(--font-mono); font-size: .9rem; }
.field { width: auto; flex: 1; min-width: 180px; }
.save-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; width: 100%; text-align: left; background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--r); padding: 16px 20px; }
.save-card div { display: flex; flex-direction: column; gap: 2px; max-width: 52ch; } .save-card span { color: var(--muted); font-size: .92rem; }
.auth { max-width: 520px; display: flex; flex-direction: column; gap: 12px; }
.auth-form { display: flex; flex-direction: column; gap: 10px; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; }
.auth-form label { font-weight: 700; } .auth-form .check { font-weight: 400; }
#auth-code { font: 700 1.6rem var(--font-mono); letter-spacing: .4em; text-align: center; }
.auth-msg { min-height: 1.4em; font-weight: 700; color: var(--bad); }
.linklike { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; }
.panel.danger { border-color: var(--bad); }
.legal { max-width: 860px; display: flex; flex-direction: column; gap: 12px; }
.legal h2 { font-size: 1.15rem; margin-top: 12px; } .legal p { max-width: 75ch; }
.legal-table { font-size: .86rem; } .legal-table th, .legal-table td { white-space: normal; text-align: left; vertical-align: top; }
.legal { overflow-x: auto; }
.foot-links { display: flex; gap: 14px; flex-wrap: wrap; }
.ide-help { font-size: .78rem; color: var(--muted); padding: 4px 12px; margin: 0; border-top: 1px solid var(--line); }
.ide-help kbd, .ide-in kbd { font: 500 .75rem var(--font-mono); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.ide-in { padding: 8px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; font-size: .85rem; }
.wall h1 { max-width: 20ch; }
.static { display: flex; flex-direction: column; gap: 36px; padding-block: 28px; }
.recap-list { display: grid; gap: 6px; padding-left: 20px; max-width: 75ch; }
.auth-form .check input { width: 20px; height: 20px; flex: none; padding: 0; }
.auth-form .check { flex-direction: row; display: flex; align-items: center; gap: 10px; }
h1[tabindex="-1"]:focus { outline: none; }
