/* The hidden attribute always wins (step-by-step reveal relies on it, even for blocks that set their own display). */
[hidden] { display: none !important; }
/* Layout concept: a winding "road" of lesson stops per map, lessons open full-screen with a Brilliant-style check bar at the bottom. */
:root {
  --bg: #F3F6FB; --surface: #FFFFFF; --raised: #F8FAFE; --ink: #13203B; --muted: #5B6680; --line: #DCE3EF; --soft: #E9EEF8;
  --primary: #2457F5; --primary-ink: #FFFFFF; --good: #11924A; --good-bg: #E3F6EA; --bad: #D93A3F; --bad-bg: #FCE8E8; --gold: #E89B0C; --gold-bg: #FFF3D9;
  --c-sql: #2457F5; --c-design: #E4572E; --c-er: #0E9488; --c-ra: #7A45E6; --c-dl: #4D8A00; --c-exam: #B45309; --c-misc: #64748B;
  --code-bg: #0F1A33; --code-ink: #E6ECFF; --kw: #7FB0FF; --str: #FFC66D; --num: #9BE59B; --cm: #7D8AA8;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --tint-a: #5CC8E8; --tint-b: #FFD6E7; --tint-c: #FFB86B; --hub-a: #3B82F6; --hub-b: #8B5CF6;
  --radius: 14px; --shadow: 0 1px 2px rgba(19,32,59,.06), 0 6px 20px rgba(19,32,59,.06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0D1322; --surface: #151D31; --raised: #1A2339; --ink: #E7ECF7; --muted: #9AA6C2; --line: #29334D; --soft: #1F2942;
  --primary: #6E8DFF; --primary-ink: #0B1020; --good: #36CF7E; --good-bg: #123323; --bad: #FF6E72; --bad-bg: #3A1A1E; --gold: #FFB547; --gold-bg: #3A2C10;
  --c-sql: #6E8DFF; --c-design: #FF7A52; --c-er: #2CC7B8; --c-ra: #A57BFF; --c-dl: #86C33A; --c-exam: #F59E0B; --c-misc: #94A3B8;
  --code-bg: #0A1020; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0D1322; --surface: #151D31; --raised: #1A2339; --ink: #E7ECF7; --muted: #9AA6C2; --line: #29334D; --soft: #1F2942;
  --primary: #6E8DFF; --primary-ink: #0B1020; --good: #36CF7E; --good-bg: #123323; --bad: #FF6E72; --bad-bg: #3A1A1E; --gold: #FFB547; --gold-bg: #3A2C10;
  --c-sql: #6E8DFF; --c-design: #FF7A52; --c-er: #2CC7B8; --c-ra: #A57BFF; --c-dl: #86C33A; --c-exam: #F59E0B; --c-misc: #94A3B8;
  --code-bg: #0A1020; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25); color-scheme: dark; }
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); }
body { background: transparent; color: var(--ink); margin: 0; }
body { font-family: var(--font-body); font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; text-wrap: balance; margin: 0; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
a { color: var(--primary); }
code, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
:not(pre) > code { background: var(--soft); padding: 1px 6px; border-radius: 6px; }
.wrap { max-width: 1060px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.chip.exam { background: var(--gold-bg); color: var(--gold); }
.chip.not { background: var(--soft); color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.chip.good { background: var(--good-bg); color: var(--good); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); padding: 9px 16px; border-radius: 12px; font-weight: 600; transition: transform .08s ease, background .15s; }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); box-shadow: 0 3px 0 color-mix(in srgb, var(--primary) 60%, #000); }
.btn.primary:disabled { background: var(--soft); border-color: var(--line); color: var(--muted); box-shadow: none; cursor: not-allowed; }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--good) 60%, #000); }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 3px 0 color-mix(in srgb, var(--bad) 60%, #000); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.small { padding: 5px 10px; font-size: 13px; border-radius: 10px; }
.icon { width: 20px; height: 20px; flex: none; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 19px; text-decoration: none; color: var(--ink); background: none; border: 0; padding: 0; }
.brand-mark { width: 36px; height: 36px; }
.brand em { font-style: normal; color: var(--c-er); }
.brand span { white-space: nowrap; }
/* Surf Steve, the mascot (js/steve.js), and the light undersea theme */
.hero-main { background: linear-gradient(180deg, var(--surface) 55%, color-mix(in srgb, var(--tint-a) 16%, var(--surface))); }
.steve-bubbles .sb { animation: seabubble 3.2s ease-in infinite; transform-box: fill-box; transform-origin: center; }
.steve-bubbles .sb1 { animation-delay: .7s; } .steve-bubbles .sb2 { animation-delay: 1.5s; } .steve-bubbles .sb3 { animation-delay: 1.1s; } .steve-bubbles .sb4 { animation-delay: 2.2s; }
@keyframes seabubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-60px); opacity: 0; } }
.sandbox .lab-room { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-er); }
.steve { display: block; overflow: visible; }
.bob { animation: stevebob 2.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes stevebob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
.bubble { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 10px 13px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); box-shadow: var(--shadow); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) 160px; gap: 18px; align-items: end; position: relative; z-index: 1; }
.steve-hello { display: grid; gap: 12px; justify-items: center; }
.steve-hello .steve { width: 128px; }
.steve-hello .bubble::after, .done-steve .bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; margin-left: -7px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
@media (max-width: 1100px) {
  .hero-grid { grid-template-columns: 1fr; }
  .steve-hello { order: -1; grid-template-columns: 64px 1fr; justify-items: start; align-items: center; }
  .steve-hello .steve { width: 64px; grid-row: 1; grid-column: 1; }
  .steve-hello .bubble { grid-column: 2; }
  .steve-hello .bubble::after { left: -9px; top: 50%; bottom: auto; margin: -7px 0 0; transform: rotate(135deg); }
}
.talkcard { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.talkcard .talk-steve { width: 64px; flex: none; }
.talkcard > .grow { flex: 1 1 320px; }
.map-steve { position: absolute; top: -6px; width: 58px; pointer-events: none; z-index: 2; }
.map-steve.left { left: -28px; } .map-steve.right { right: -28px; }
.fb .badge.steve-badge { width: 54px; height: 54px; padding: 3px; overflow: hidden; }
.fb .badge.steve-badge .steve { width: 100%; height: 100%; }
.done-steve { display: grid; justify-items: center; gap: 10px; }
.done-steve .bubble { order: -1; max-width: 34ch; }
.done-steve .steve { width: 120px; }
@media (prefers-reduced-motion: reduce) { .bob, .steve-bubbles .sb { animation: none; } }
.stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-variant-numeric: tabular-nums; padding: 5px 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; }
.stat .icon { width: 18px; height: 18px; }
.stat.predict { color: var(--c-design); } .stat.xp { color: var(--gold); } .stat.due { color: var(--primary); }
.topbar nav { display: flex; gap: 4px; margin-left: 8px; }
.topbar nav button { border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.topbar nav .nav-sep { width: 1.5px; align-self: stretch; margin: 6px 8px; border-radius: 1px; background: var(--muted); opacity: .45; }
.topbar nav button[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
@media (max-width: 760px) { .topbar nav { margin-left: 0; } .topbar nav button { padding: 7px 8px; } .brand span { display: none; } }

/* ---------- home ---------- */
.home { padding-block: 28px 64px; display: grid; gap: 26px; }
.hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: stretch; }
.hero-main { padding: 28px; position: relative; overflow: hidden; }
.hero-main h1 { font-size: clamp(28px, 4.2vw, 42px); font-weight: 800; }
.hero-main p { max-width: 46ch; color: var(--muted); }
.hero-road { position: absolute; right: 10px; bottom: 6px; width: 150px; opacity: .55; pointer-events: none; }
.hero-main p, .hero-main h1 { position: relative; z-index: 1; }
.hero-main .row { position: relative; z-index: 1; }
.hero-side { padding: 22px; display: grid; gap: 12px; align-content: start; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { padding: 12px 14px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.kpi b { display: block; font-family: var(--font-display); font-size: 26px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 12px; color: var(--muted); }
.maps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mapcard { text-align: left; padding: 20px; display: grid; gap: 10px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); position: relative; overflow: hidden; transition: transform .15s ease; }
.mapcard:hover { transform: translateY(-2px); }
.mapcard h3 { font-size: 22px; }
.mapcard .band { position: absolute; inset: 0 0 auto 0; height: 6px; }
.prog { height: 8px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 99px; background: var(--good); transition: width .4s ease; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 22px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.panel { padding: 20px; }
.panel h3 { font-size: 18px; margin-bottom: 8px; }
.examlist { display: grid; gap: 8px; margin: 10px 0 0; padding: 0; list-style: none; }
.examlist li { display: flex; gap: 10px; align-items: flex-start; }
.dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 8px; flex: none; }
.sandboxes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 10px; }
.sandbox { text-align: left; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--raised); display: grid; gap: 4px; }
.sandbox b { font-family: var(--font-display); }
@media (max-width: 1100px) { .hero-road { display: none; } }
@media (max-width: 900px) { .hero, .grid2 { grid-template-columns: 1fr; } .maps { grid-template-columns: 1fr; } .hero-road { display: none; } }
@media (max-width: 520px) { .sandboxes { grid-template-columns: 1fr; } }

/* ---------- lab doors (Lab page) ---------- */
.labs-main { max-width: 1280px; padding-block: 24px 40px; }
.labs-page { display: grid; gap: 22px; min-height: calc(100dvh - 58px - 64px); grid-template-rows: auto 1fr; }
.labs-head h1 { margin: 6px 0 4px; font-size: clamp(26px, 3.2vw, 38px); }
.labs-head p { margin: 0; }
.lab-doors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lab-door { -webkit-appearance: none; appearance: none; --lab: var(--c-sql); --lab2: #6E3BFF; position: relative; display: grid; grid-template-rows: minmax(220px, 1fr) auto; text-align: left; padding: 0; border-radius: 22px; overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); color: var(--ink); cursor: pointer; transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.lab-door.lab-datalog { --lab: var(--c-dl); --lab2: #0E9488; }
.lab-door.lab-ra { --lab: var(--c-ra); --lab2: #E4572E; }
.lab-door:hover, .lab-door:focus-visible { transform: translateY(-6px); box-shadow: 0 18px 40px color-mix(in srgb, var(--lab) 30%, transparent); border-color: color-mix(in srgb, var(--lab) 45%, var(--line)); }
.lab-door:focus-visible { outline: 3px solid var(--lab); outline-offset: 3px; }
.lab-art { position: relative; overflow: hidden; min-height: 220px; height: 100%; background: linear-gradient(140deg, var(--lab), var(--lab2)); background: radial-gradient(120% 90% at 15% 10%, color-mix(in srgb, var(--lab) 70%, #fff) 0%, transparent 60%), linear-gradient(140deg, var(--lab), var(--lab2)); }
.lab-art::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.22) 1px, transparent 1.4px); background-size: 18px 18px; mask-image: linear-gradient(to bottom, #000, transparent 85%); pointer-events: none; }
.lab-art svg { position: absolute; inset: 0; width: 100%; height: 100%; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.lab-door:hover .lab-art svg { transform: scale(1.05); }
.lab-body { display: grid; gap: 8px; padding: 20px 22px 22px; }
.lab-room { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lab); }
.lab-title { font-family: var(--font-display); font-size: 26px; font-weight: 800; line-height: 1.1; }
.lab-blurb { font-size: 15px; line-height: 1.45; }
.lab-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lab-tags .chip { background: color-mix(in srgb, var(--lab) 12%, var(--surface)); color: color-mix(in srgb, var(--lab) 80%, var(--ink)); }
.lab-enter { justify-self: start; display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 10px 18px; border-radius: 12px; font-weight: 700; background: var(--lab); color: #fff; transition: gap .2s; }
.lab-door:hover .lab-enter { gap: 14px; }
/* art motion */
.lab-art .la-float { animation: laFloat 5s ease-in-out infinite; }
.lab-art .la-float2 { animation: laFloat 6s ease-in-out -2s infinite; }
.lab-art .la-caret { animation: laBlink 1s steps(1) infinite; }
.lab-art .la-type { opacity: 0; animation: laIn .5s ease var(--d) forwards; }
.lab-art .la-rows { opacity: 0; animation: laIn .6s ease 1.5s forwards; }
.lab-art .la-pop { opacity: 0; transform-box: fill-box; transform-origin: center; animation: laPop .45s cubic-bezier(.3,1.6,.5,1) var(--d) forwards; }
.lab-art .la-dash { animation: laDash 1.2s linear infinite; }
.lab-art .la-slide-l { animation: laSlideL 4s ease-in-out infinite; }
.lab-art .la-slide-r { animation: laSlideR 4s ease-in-out infinite; }
.lab-art .la-pulse { transform-box: fill-box; transform-origin: center; animation: laPulse 2s ease-in-out infinite; }
@keyframes laFloat { 50% { transform: translateY(-8px); } }
@keyframes laBlink { 50% { opacity: 0; } }
@keyframes laIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes laPop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes laDash { to { stroke-dashoffset: -24; } }
@keyframes laSlideL { 50% { transform: translateX(10px); } }
@keyframes laSlideR { 50% { transform: translateX(-10px); } }
@keyframes laPulse { 50% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .lab-art *, .lab-door, .lab-art svg { animation: none !important; transition: none !important; } .lab-art .la-type, .lab-art .la-rows, .lab-art .la-pop { opacity: 1; } }
@media (max-width: 900px) { .lab-doors { grid-template-columns: 1fr; } .labs-page { min-height: 0; } .lab-door { grid-template-rows: 200px auto; } .lab-art { min-height: 200px; } }

/* ---------- map ---------- */
.mapview { padding-block: 20px 80px; }
.road-toggle { display: inline-flex; flex: none; align-self: flex-start; gap: 4px; padding: 4px; background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 12px; }
.road-toggle-dock { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 74px); z-index: 19; height: 0; display: flex; justify-content: flex-end; pointer-events: none; }
.road-toggle-dock .road-toggle { pointer-events: auto; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border: 2px solid var(--ink); box-shadow: var(--shadow); }
.maphead.has-toggle { padding-right: 420px; }
@media (max-width: 600px) { .maphead.has-toggle { padding-right: 0; padding-top: 52px; } }
.road-toggle { gap: 6px; padding: 5px; border-radius: 14px; }
.road-toggle button { border: 0; background: transparent; padding: 11px 22px; border-radius: 10px; font-size: 17px; font-weight: 800; color: var(--muted); transition: background .15s, color .15s, transform .15s; }
.road-toggle button:hover:not([aria-selected="true"]) { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.road-toggle button[aria-selected="true"] { background: var(--ink); color: var(--surface); box-shadow: 0 4px 14px color-mix(in srgb, var(--ink) 35%, transparent); transform: scale(1.04); }
.maphead { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.maphead-prog { max-width: 420px; margin-top: 12px; }
.section-jump { display: contents; }
.section-jump .jump-btn { position: fixed; left: 24px; z-index: 20; width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--primary); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 8px 24px color-mix(in srgb, var(--primary) 40%, transparent); transition: transform .15s, opacity .15s; }
.section-jump .jump-btn .icon { width: 40px; height: 40px; stroke-width: 2.6; }
.section-jump .jump-btn:hover:not(:disabled) { transform: scale(1.06); }
.section-jump .jump-btn:disabled { opacity: .3; cursor: default; box-shadow: none; }
.section-jump .jump-up { top: 96px; }
.section-jump .jump-down { bottom: 28px; }
@media (max-width: 760px) { .section-jump .jump-btn { width: 60px; height: 60px; left: 12px; } .section-jump .jump-btn .icon { width: 28px; height: 28px; } }
.maphead h1 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; }
.unit { margin: 26px auto 0; max-width: 640px; }
.unit-band { border-radius: 16px; padding: 16px 18px; color: #fff; display: grid; gap: 4px; position: relative; overflow: hidden; }
.unit-band h2 { font-size: 20px; font-weight: 700; }
.unit-band .sub { opacity: .92; font-size: 14px; }
.unit-band .chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.unit-band .chip { background: rgba(255,255,255,.2); color: #fff; }
.unit-band .slides-link { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,.95); color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; }
.unit-band .slides-link:hover { background: #fff; }
.unit-band .slides-link .icon { width: 16px; height: 16px; }
.slides-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(620px, 100vw); z-index: 60; background: var(--surface); border-left: 1px solid var(--line); box-shadow: -8px 0 30px rgba(19,32,59,.18); display: grid; grid-template-rows: auto 1fr; padding-top: env(safe-area-inset-top, 0px); }
.slides-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.slides-panel iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.slides-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.slides-links .slides-link { margin-top: 0; border: 0; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; }
.notes-panel { grid-template-rows: auto minmax(0, 1fr); }
.notes-body { overflow-y: auto; padding: 18px 22px 28px; }
.sources-list { display: grid; gap: 8px; margin: 4px 0 14px; }
.sources-item { justify-content: flex-start; text-align: left; }
.sources-note { font-size: 13px; margin: 8px 0 0; }
.sources-note .linkish { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.notes-title { font-size: 22px; margin: 4px 0 12px; }
.notes-prose { font-size: 15px; line-height: 1.6; }
.notes-prose h4 { font-family: var(--font-display); font-size: 16px; margin: 18px 0 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.notes-prose ul, .notes-prose ol { margin: 0 0 10px; }
.notes-prose pre.code { font-size: 12.5px; margin: 6px 0 10px; white-space: pre; }
.notes-prose .nt-tldr { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--line)); padding: 10px 14px; border-radius: 12px; font-weight: 500; }
.notes-prose .nt-not { font-family: var(--font-body); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: var(--soft); padding: 2px 8px; border-radius: 99px; }
.notes-prose table.nt-t { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 6px 0 12px; display: block; overflow-x: auto; }
.notes-prose table.nt-t th, .notes-prose table.nt-t td { border: 1px solid var(--line); padding: 6px 9px; text-align: left; vertical-align: top; }
.notes-prose table.nt-t th { background: var(--raised); font-size: 12px; color: var(--muted); }
.notes-prose table.nt-t code { white-space: pre-wrap; }
@media (max-width: 620px) {
  .notes-body { padding: 14px 14px 24px; }
  .notes-prose table.nt-t, .notes-prose table.nt-t tbody, .notes-prose table.nt-t tr, .notes-prose table.nt-t td { display: block; width: 100%; }
  .notes-prose table.nt-t tr:first-child:has(th) { display: none; }
  .notes-prose table.nt-t tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
  .notes-prose table.nt-t td { border: 0; border-bottom: 1px solid var(--line); }
  .notes-prose table.nt-t td:last-child { border-bottom: 0; }
  .notes-prose table.nt-t td:first-child { background: var(--raised); font-weight: 600; }
}
.notes-prose code { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.notes-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.unit-band .count { position: absolute; right: 16px; top: 14px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0,0,0,.18); border-radius: 99px; padding: 2px 10px; font-size: 13px; }
.path { position: relative; width: 340px; max-width: 100%; margin: 0 auto; }
.path.highway .stop.extra { width: 128px; margin-left: -64px; }
.path.highway .stop.extra .label { max-width: 128px; }
.path.highway .stop.extra .node { transform: scale(.78); opacity: .92; }
.path.highway .stop.extra .label { font-weight: 500; color: var(--muted); font-size: 12px; }
.path.highway .stop.extra .stars { display: none; }
.extra-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: -4px; }
.road-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.road-legend span { display: block; }
.road-legend b { color: var(--ink); }
.road-legend i { display: inline-block; vertical-align: middle; margin: -2px 6px 0 0; width: 26px; border-radius: 4px; background: var(--soft); border: 1px solid var(--line); }
.road-legend .lg-hw { height: 10px; } .road-legend .lg-side { height: 5px; border-style: dashed; }
.path svg.road { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.stop { position: absolute; width: 150px; margin-left: -75px; display: grid; justify-items: center; gap: 6px; text-align: center; }
.node { width: 66px; height: 66px; border-radius: 50%; border: 0; display: grid; place-items: center; position: relative; color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.18); transition: transform .12s ease; }
.node:hover { transform: translateY(-2px) scale(1.03); }
.node:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.node .icon { width: 28px; height: 28px; }
.node.locked { background: var(--soft) !important; color: var(--muted); box-shadow: 0 5px 0 var(--line); }
.node.review { border-radius: 20px; }
.node.current::after { content: ""; position: absolute; inset: -9px; border-radius: inherit; border: 3px solid currentColor; opacity: .35; animation: pulse 1.6s ease-out infinite; color: var(--ink); }
.node.done::before { content: ""; position: absolute; inset: -5px; border-radius: inherit; border: 3px solid var(--gold); }
@keyframes pulse { 0% { transform: scale(.92); opacity: .55; } 100% { transform: scale(1.18); opacity: 0; } }
.stop .label { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--ink); max-width: 150px; }
.stop .stars { display: flex; gap: 2px; height: 14px; }
.stop .stars svg { width: 14px; height: 14px; }
.start-flag { position: absolute; top: -34px; left: 50%; transform: translateX(-50%); background: var(--surface); color: var(--ink); border: 2px solid var(--line); font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 10px; letter-spacing: .06em; white-space: nowrap; animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }
/* back on the road map after a lesson */
.maphead-prog.slow > i { transition: width 1.1s cubic-bezier(.3,.9,.3,1); }
.eyebrow.tick, .unit-band .count.tick { animation: tickpop .6s cubic-bezier(.2,1.6,.4,1); display: inline-block; }
@keyframes tickpop { 40% { transform: scale(1.3); } }
.stop.just-done .node { animation: donepop .75s cubic-bezier(.2,1.6,.4,1); }
.stop.just-done .node.done::before { animation: ringburst .9s ease-out both; }
.stop.just-done .stars svg { animation: starpop .5s cubic-bezier(.2,1.6,.4,1) both; }
.stop.just-done .stars svg:nth-child(2) { animation-delay: .15s; } .stop.just-done .stars svg:nth-child(3) { animation-delay: .3s; }
@keyframes donepop { 0% { transform: scale(1); } 35% { transform: scale(1.28) rotate(-6deg); } 65% { transform: scale(.94) rotate(3deg); } 100% { transform: none; } }
@keyframes ringburst { 0% { transform: scale(1.9); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); opacity: 1; } }
.path svg.road .trail { fill: none; stroke: var(--gold); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 0; opacity: .85; }
.path svg.road .trail.wait { stroke-dashoffset: 1; }
.path svg.road .trail.go { transition: stroke-dashoffset 1s ease-in-out; }
.stop.arriving .start-flag, .stop.arriving .map-steve { visibility: hidden; }
.stop.arrive .map-steve { animation: stevein .7s cubic-bezier(.3,1.5,.5,1) both, stevebob 2.6s .7s ease-in-out infinite; }
@keyframes stevein { from { translate: 0 -90px; opacity: 0; } 60% { opacity: 1; } }
.stop.arrive .node { animation: nodecall 1.2s ease-in-out .2s 3; }
@keyframes nodecall { 0%, 100% { transform: none; } 20% { transform: translateY(-10px) scale(1.08); } 40% { transform: none; } 55% { transform: translateY(-4px); } 70% { transform: none; } }
.stop.arrive .node.current::after { animation: pulse 1.4s ease-out infinite; }
.start-flag.call { background: var(--gold); border-color: color-mix(in srgb, var(--gold) 70%, #000); color: #1b1b1b; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: flagin .45s cubic-bezier(.2,1.6,.4,1) both, flagbob .9s .45s ease-in-out infinite; z-index: 3; }
.tap-hand { position: absolute; top: 14px; font-size: 30px; line-height: 1; pointer-events: none; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0,0,0,.2)); }
.tap-hand.from-right { left: calc(50% + 40px); animation: flagin .4s cubic-bezier(.2,1.6,.4,1) both, pokeL .8s .4s ease-in-out infinite; }
.tap-hand.from-left { right: calc(50% + 40px); animation: flagin .4s cubic-bezier(.2,1.6,.4,1) both, pokeR .8s .4s ease-in-out infinite; }
@keyframes pokeL { 50% { transform: translateX(-9px); } }
@keyframes pokeR { 50% { transform: translateX(9px); } }
@keyframes flagin { from { scale: 0; opacity: 0; } }
.intro-callout { position: absolute; top: -18px; display: flex; align-items: center; gap: 2px; z-index: 4; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--ink); animation: flagin .45s cubic-bezier(.2,1.6,.4,1) both; }
.intro-callout.on-left { right: calc(50% + 40px); }
.intro-callout.on-right { left: calc(50% + 40px); flex-direction: row-reverse; }
.intro-bubble { display: grid; gap: 3px; width: 210px; text-align: left; background: var(--surface); border: 2px solid var(--gold); border-radius: 14px; padding: 10px 13px; box-shadow: 0 8px 22px rgba(0,0,0,.14); font-size: 13px; line-height: 1.3; }
.intro-bubble .eyebrow { color: color-mix(in srgb, var(--gold) 70%, #000); }
.intro-bubble b { font-size: 16px; line-height: 1.2; }
.intro-bubble em { font-style: normal; font-weight: 700; }
.intro-callout:hover .intro-bubble { transform: translateY(-2px); }
.intro-arrow { width: 72px; color: var(--gold); flex: none; animation: pokeR .8s .45s ease-in-out infinite; }
.intro-callout.on-right .intro-arrow { animation-name: pokeL; }
.intro-callout.on-right .intro-arrow svg { transform: scaleX(-1); }
.intro-arrow svg { display: block; width: 100%; }
@media (max-width: 720px) {
  .intro-callout, .intro-callout.on-left, .intro-callout.on-right { left: 50%; right: auto; top: auto; bottom: calc(100% + 34px); translate: -50% 0; flex-direction: column; }
  .intro-arrow { width: 40px; rotate: 90deg; animation: none; }
  .intro-callout.on-right .intro-arrow svg { transform: none; }
}
@keyframes flagbob { 50% { transform: translate(-50%, -7px); } }
.pop { position: fixed; z-index: 60; inset: auto 0 0 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); display: flex; justify-content: center; pointer-events: none; }
.pop .card { pointer-events: auto; width: min(520px, 100%); padding: 18px; display: grid; gap: 10px; animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(14px); opacity: 0; } }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(10,16,32,.28); }

/* ---------- lesson ---------- */
.lesson { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: grid; grid-template-rows: auto 1fr auto; padding-top: env(safe-area-inset-top, 0px); }
.lesson-top { display: flex; align-items: center; gap: 14px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); max-width: 1100px; width: 100%; margin: 0 auto; }
.lesson-top .prog { flex: 1; height: 14px; }
.lesson.with-topbar { padding-top: 0; }
.lesson.with-topbar .topbar { position: static; }
.lesson-top .prog > i { background: var(--good); }
.lesson-body { overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
.lesson-body::-webkit-scrollbar { display: none; }
.lesson-inner { max-width: 820px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); display: grid; gap: 16px; }
.lesson-inner.wide { max-width: 1100px; }
.lesson-title { display: grid; gap: 4px; }
.lesson-title h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 800; }
.footer { border-top: 2px solid var(--line); background: var(--surface); padding: 14px max(16px, env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); transition: background .15s; }
.footer.good { background: var(--good-bg); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.footer.bad { background: var(--bad-bg); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.footer-in { max-width: 1100px; margin: 0 auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.fb { flex: 1; min-width: 220px; display: flex; gap: 12px; align-items: flex-start; }
.fb .badge { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; }
.footer.good .fb .badge { background: var(--good); } .footer.bad .fb .badge { background: var(--bad); }
.fb h4 { font-size: 18px; } .footer.good h4 { color: var(--good); } .footer.bad h4 { color: var(--bad); }
.fb .why { font-size: 14px; color: var(--ink); max-height: 30vh; overflow: auto; }
.footer .main { min-width: 150px; padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.prose { font-size: 16px; line-height: 1.65; }
.prose p { margin: 0 0 12px; max-width: 70ch; }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 22px; } .prose li { margin: 4px 0; }
.prose h3 { font-size: 20px; margin: 14px 0 8px; }
.prose .callout { border-left: 4px solid var(--primary); background: var(--raised); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 12px 0; }
.prose .callout.warn { border-color: var(--gold); }
.prose .callout.exam { border-color: var(--c-exam); }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); max-width: 100%; }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.t th, table.t td { padding: 7px 12px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.t th { background: var(--raised); font-weight: 700; font-size: 12px; letter-spacing: .03em; color: var(--muted); }
table.t tr:last-child td { border-bottom: 0; }
table.t td.null { color: var(--muted); font-style: italic; }
table.t tr.dim td { opacity: .35; text-decoration: line-through; }
table.t tr.hl td { background: var(--gold-bg); }
pre.code { background: var(--code-bg); color: var(--code-ink); padding: 14px 16px; border-radius: 12px; overflow-x: auto; margin: 0; line-height: 1.55; font-size: 14px; white-space: pre; }
pre.code .k { color: var(--kw); font-weight: 600; } pre.code .s { color: var(--str); } pre.code .n { color: var(--num); } pre.code .c { color: var(--cm); font-style: italic; } pre.code .v { color: #FF9EC7; }

/* question options */
.qtext { font-size: 18px; font-weight: 600; line-height: 1.45; }
.opts { display: grid; gap: 10px; }
.opt { text-align: left; border: 2px solid var(--line); border-bottom-width: 4px; background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; gap: 12px; align-items: flex-start; font-size: 15px; transition: border-color .12s, background .12s; }
.opt:hover { background: var(--raised); }
.opt .key { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); flex: none; }
.opt[aria-pressed="true"] { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.opt[aria-pressed="true"] .key { border-color: var(--primary); color: var(--primary); }
.opt.right { border-color: var(--good); background: var(--good-bg); } .opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt:disabled { cursor: default; }
.opt code { white-space: pre-wrap; }
.fill { width: 100%; font: inherit; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }

/* editors */
.editor { width: 100%; min-height: 150px; resize: vertical; font-family: var(--font-mono); font-size: 14.5px; line-height: 1.55; padding: 14px 16px; border-radius: 12px; border: 2px solid var(--line); background: var(--code-bg); color: var(--code-ink); tab-size: 2; caret-color: var(--gold); }
.editor:focus { border-color: var(--primary); outline: none; }
.split { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }
.schema { padding: 12px; display: grid; gap: 6px; font-size: 13px; max-height: 70vh; overflow: auto; }
.schema details { border-radius: 10px; }
.schema summary { cursor: pointer; font-weight: 700; padding: 6px 8px; border-radius: 8px; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.schema summary::-webkit-details-marker { display: none; }
.schema summary:hover { background: var(--raised); }
.schema .cols { padding: 2px 8px 8px 14px; font-family: var(--font-mono); color: var(--muted); display: grid; gap: 1px; }
.schema .cols .pk { color: var(--gold); font-weight: 600; }
.prompt { padding: 16px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); font-size: 16px; }
.prompt b.task { color: var(--primary); }
.results { display: grid; gap: 8px; }
.err { background: var(--bad-bg); color: var(--bad); padding: 10px 14px; border-radius: 12px; font-size: 14px; white-space: pre-wrap; }
.ok-note { background: var(--good-bg); color: var(--good); padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.hint { background: var(--gold-bg); color: var(--ink); padding: 10px 14px; border-radius: 12px; font-size: 14px; border-left: 4px solid var(--gold); }
.symkeys { display: flex; flex-wrap: wrap; gap: 6px; }
.symkeys button { min-width: 40px; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 17px; font-family: var(--font-mono); }
.symkeys button small { display: block; font-size: 9px; color: var(--muted); font-family: var(--font-body); }
.ra-preview { padding: 12px 16px; border-radius: 12px; background: var(--surface); border: 1px dashed var(--line); font-size: 20px; font-family: "Cambria Math", "STIX Two Math", Georgia, serif; min-height: 52px; overflow-x: auto; }
.ra-preview sub { font-size: .62em; }
.ra-op { color: var(--c-ra); font-weight: 700; padding: 0 1px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); border-radius: 99px; padding: 5px 12px; font-size: 13px; font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* flashcards */
.flash { perspective: 1200px; }
.flash-card { position: relative; min-height: 260px; transition: transform .45s cubic-bezier(.2,.8,.2,1); transform-style: preserve-3d; cursor: pointer; }
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 20px; padding: 26px; display: grid; place-items: center; text-align: center; font-size: 19px; border: 2px solid var(--line); background: var(--surface); box-shadow: var(--shadow); overflow: auto; }
.flash-face.back { transform: rotateY(180deg); background: var(--raised); text-align: left; place-items: start; font-size: 16px; }
.flash-face .tag { position: absolute; top: 12px; left: 16px; }
.flash { position: relative; }
.flash-edit-btn { position: absolute; top: 12px; right: 14px; z-index: 2; }
.flash-edit-box { min-height: 60px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 16px; line-height: 1.5; margin-top: 6px; }
.flash-edit-box:focus { outline: none; border-color: var(--primary); }
.grade { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade button { padding: 10px 6px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); font-weight: 700; display: grid; gap: 2px; }
.grade button small { font-weight: 500; color: var(--muted); font-size: 11px; }
.grade .again { color: var(--bad); } .grade .hard { color: var(--gold); } .grade .goodb { color: var(--good); } .grade .easy { color: var(--primary); }

/* list + order */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.slot { border: 2px dashed var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; }
.slot.found { border-style: solid; border-color: var(--good); background: var(--good-bg); color: var(--ink); animation: pop .3s ease; }
.slot.revealed { border-style: solid; border-color: var(--gold); background: var(--gold-bg); color: var(--ink); }
@keyframes pop { 50% { transform: scale(1.05); } }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.pool button, .seq button { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 9px 12px; background: var(--surface); text-align: left; font-size: 14px; }
.seq { display: grid; gap: 8px; min-height: 60px; padding: 10px; border-radius: 14px; background: var(--raised); border: 2px dashed var(--line); }
.seq button { display: flex; gap: 10px; align-items: center; width: 100%; }
.seq .n { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.seq button.right { border-color: var(--good); background: var(--good-bg); } .seq button.wrong { border-color: var(--bad); background: var(--bad-bg); }

/* listen */
.script { display: grid; gap: 8px; font-size: 17px; line-height: 1.6; }
.script p { margin: 0; padding: 6px 10px; border-radius: 10px; transition: background .2s, color .2s; color: var(--muted); }
.script p.now { background: var(--gold-bg); color: var(--ink); }
.script p.read { color: var(--ink); }
.player { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.wave { display: flex; gap: 3px; align-items: center; height: 26px; }
.wave i { width: 4px; border-radius: 3px; background: var(--primary); height: 6px; }
.wave.on i { animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 50% { height: 24px; } }

/* explain */
.concepts { display: flex; flex-wrap: wrap; gap: 8px; }
.concept { padding: 6px 12px; border-radius: 99px; border: 2px solid var(--line); font-size: 13px; font-weight: 600; color: var(--muted); }
.concept.hit { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.concept.miss { border-color: var(--bad); color: var(--bad); }

/* ER editor */
.er-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .er-wrap { grid-template-columns: 1fr; } }
.er-canvas { border-radius: 14px; border: 1px solid var(--line); background-color: var(--surface); background-image: radial-gradient(var(--line) 1px, transparent 1px); background-size: 22px 22px; overflow: hidden; touch-action: none; }
.er-canvas svg { display: block; width: 100%; height: auto; user-select: none; }
.er-tools { display: flex; gap: 6px; flex-wrap: wrap; }
.er-side { padding: 14px; display: grid; gap: 10px; font-size: 14px; }
.er-side label { display: grid; gap: 4px; font-weight: 600; font-size: 13px; }
.er-side input[type=text] { font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.er-side .check { display: flex; gap: 8px; align-items: center; font-weight: 500; }
.er-legend { font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
svg .er-shape { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
svg .er-shape.ent { fill: color-mix(in srgb, var(--c-er) 10%, var(--surface)); }
svg .er-shape.rel { fill: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
svg .er-text { fill: var(--ink); font: 600 14px var(--font-body); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
svg .er-edge { stroke: var(--ink); stroke-width: 2; fill: none; }
svg .er-edge-hit { stroke: transparent; stroke-width: 14; fill: none; cursor: pointer; }
svg .er-arrow { fill: var(--ink); }
svg .sel .er-shape, svg .er-edge.sel { stroke: var(--primary); stroke-width: 3; }
svg .er-node { cursor: grab; }
svg .pending .er-shape { stroke: var(--gold); stroke-dasharray: 5 4; stroke-width: 3; }
.checklist { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist .ok { color: var(--good); font-weight: 700; } .checklist .no { color: var(--bad); font-weight: 700; }

/* viz */
.viz { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); display: grid; gap: 12px; }
.viz-title { font-weight: 700; font-family: var(--font-display); font-size: 16px; }
/* RA expression tree explorer */
.rat-tree { overflow-x: auto; padding: 6px 0 2px; }
.rat-tree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; }
.rat-tree > ul { min-width: max-content; }
.rat-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 6px; }
.rat-tree li > ul { padding-top: 22px; }
.rat-tree li ul > li::before { content: ''; height: 11px; border-left: 2px solid var(--line); position: absolute; top: -11px; left: 50%; }
.rat-tree li ul > li::after { content: ''; width: 100%; border-top: 2px solid var(--line); position: absolute; top: -11px; }
.rat-tree li ul > li:first-child::after { width: 50%; left: 50%; }
.rat-tree li ul > li:last-child::after { width: 50%; right: 50%; }
.rat-tree li ul > li:only-child::after { display: none; }
.rat-tree li:has(> ul) > .rat-node::after { content: ''; height: 11px; border-left: 2px solid var(--line); position: absolute; top: 100%; left: 50%; }
.rat-node { position: relative; display: grid; justify-items: center; gap: 2px; padding: 6px 12px; border: 2px solid color-mix(in srgb, var(--c-ra) 45%, var(--line)); border-radius: 12px; background: var(--surface); color: var(--ink); font: 600 16px var(--font-mono); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; max-width: 260px; }
.rat-node:hover { transform: translateY(-1px); border-color: var(--c-ra); }
.rat-node.leaf { border-style: dashed; background: var(--raised); }
.rat-node.sel { border-color: var(--c-ra); background: color-mix(in srgb, var(--c-ra) 14%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-ra) 22%, transparent); }
.rat-node.pending { opacity: .45; cursor: default; border-style: dotted; }
.rat-node.fresh { animation: rise .35s ease; }
.rat-node sub { font-size: 11px; font-weight: 500; white-space: normal; text-align: left; }
.rat-op { color: var(--c-ra); font-size: 19px; }
.rat-count { font: 500 11px var(--font-body); color: var(--muted); }
.rat-note { font-size: 15px; min-height: 22px; }
.rat-detail { display: grid; gap: 10px; min-width: 0; }
/* SQL step-through */
.sqs-rail { display: flex; flex-wrap: wrap; gap: 6px; }
.sqs-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--muted); font: 600 13px var(--font-mono); cursor: pointer; }
.sqs-pill + .sqs-pill::before { content: '→'; margin: 0 4px 0 -2px; color: var(--muted); font-family: var(--font-body); }
.sqs-n { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--soft); font-size: 11px; }
.sqs-pill.past { color: var(--ink); }
.sqs-pill.on { background: var(--c-sql); border-color: var(--c-sql); color: #fff; }
.sqs-pill.on .sqs-n { background: rgba(255,255,255,.25); }
.sqs-body { display: grid; gap: 8px; min-width: 0; animation: rise .25s ease; }
.sqs-clause { font-family: var(--font-mono); font-size: 14px; padding: 8px 12px; border-radius: 10px; background: var(--code-bg); color: var(--code-ink); overflow-x: auto; white-space: pre-wrap; }
.sqs-clause b { color: var(--kw); }
.sqs-clause code { background: none; color: inherit; padding: 0; font: inherit; }
.sqs-text { margin: 0; font-size: 15px; }
.sqs-predict { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--gold-bg); }
.sqs-guess { width: 90px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--surface); color: var(--ink); }
.sqs-miss { padding: 8px 12px; border-radius: 10px; background: var(--bad-bg); color: var(--ink); font-size: 14px; }
.sqs-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sqs-wrap { display: grid; gap: 10px; justify-items: start; }
.sqs-wrap > div { width: 100%; min-width: 0; }
table.t tr.grp0 td { background: color-mix(in srgb, #2457F5 10%, transparent); }
table.t tr.grp1 td { background: color-mix(in srgb, #E89B0C 14%, transparent); }
table.t tr.grp2 td { background: color-mix(in srgb, #11924A 12%, transparent); }
table.t tr.grp3 td { background: color-mix(in srgb, #7A45E6 12%, transparent); }
table.t tr.grp4 td { background: color-mix(in srgb, #E4572E 12%, transparent); }
table.t tr.grp5 td { background: color-mix(in srgb, #0E9488 12%, transparent); }
.setchips { display: flex; gap: 6px; flex-wrap: wrap; min-height: 36px; }
.setchips span { padding: 5px 12px; border-radius: 10px; background: var(--soft); font-family: var(--font-mono); font-weight: 600; }
.setchips span.new { background: var(--good); color: #fff; animation: pop .35s ease; }
.fdlist { display: grid; gap: 4px; font-family: var(--font-mono); }
.fdlist div { padding: 4px 10px; border-radius: 8px; }
.fdlist div.used { background: var(--gold-bg); }
.fdlist div.fired { opacity: .5; }
.scan-rows { display: grid; gap: 3px; font-family: var(--font-mono); font-size: 13px; }
.scan-rows div { padding: 3px 10px; border-radius: 6px; background: var(--raised); transition: background .1s; }
.scan-rows div.look { background: var(--gold-bg); } .scan-rows div.hit { background: var(--good); color: #fff; }
.tv { display: grid; grid-template-columns: repeat(3, auto) 1fr; gap: 8px; align-items: center; }
.tv select { font: inherit; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.tv .out { font-family: var(--font-display); font-size: 22px; font-weight: 800; }
.ai-visual { margin-top: 10px; min-width: 0; overflow-wrap: anywhere; }
.ai-visual .viz { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px; }
.ai-visual .grid2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 8px; }
.ai-viz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.ai-viz-grid > div { min-width: 0; }
.ai-visual .t td, .ai-visual .t th { padding: 5px 8px; font-size: .85em; }
.ai-viz-tree { overflow-x: auto; padding: 4px 0; }
.ai-visual .ai-viz-tree ul { display: flex; justify-content: center; list-style: none; margin: 0; padding: 0; }
.ai-visual .ai-viz-tree > ul { min-width: max-content; }
.ai-viz-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 0 4px; }
.ai-visual .ai-viz-tree li > ul { padding-top: 12px; }
.ai-viz-tree li ul > li::before { content: ''; height: 7px; border-left: 1px solid var(--line); position: absolute; top: -7px; left: 50%; }
.ai-viz-tree li ul > li::after { content: ''; width: 100%; border-top: 1px solid var(--line); position: absolute; top: -7px; }
.ai-viz-tree li ul > li:first-child::after { width: 50%; left: 50%; }
.ai-viz-tree li ul > li:last-child::after { width: 50%; right: 50%; }
.ai-viz-tree li:has(> ul) > .ai-viz-keys::after { content: ''; height: 6px; border-left: 1px solid var(--line); position: absolute; top: 100%; left: 50%; }
.ai-viz-keys { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); font-family: var(--font-mono); }
.ai-viz-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.ai-viz-steps li:last-child { animation: rise .35s ease; }
.ai-viz-keys > span { padding: 2px 6px; }
.ai-viz-keys > span + span { border-left: 1px solid var(--line); }
.ai-viz-keys.visited { border-color: var(--primary); background: var(--soft); }
.ai-viz-keys .found { background: var(--primary); color: var(--primary-ink); border-radius: inherit; }

/* completion */
.done-screen { display: grid; justify-items: center; text-align: center; gap: 14px; padding-top: 30px; }
.done-screen h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; }
.bigstars { display: flex; gap: 10px; }
.bigstars svg { width: 54px; height: 54px; }
.bigstars svg.on { animation: starpop .5s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes starpop { from { transform: scale(0) rotate(-40deg); } }
.done-kpis { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.done-kpis .kpi { min-width: 120px; }
canvas.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; width: 100%; height: 100%; }
.exam-timer { font-variant-numeric: tabular-nums; font-weight: 700; padding: 5px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.exam-timer.low { color: var(--bad); border-color: var(--bad); }
.scenario { padding: 16px 18px; border-radius: 14px; background: color-mix(in srgb, var(--c-exam) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c-exam) 30%, var(--line)); }
.scenario summary { cursor: pointer; font-weight: 700; }
.parts { display: grid; gap: 6px; }
.parts div { display: flex; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--raised); font-size: 14px; }
.parts div.cur { outline: 2px solid var(--c-exam); }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; z-index: 90; font-weight: 600; animation: rise .2s ease-out; }
.switch { display: flex; align-items: center; gap: 10px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
/* leaderboard + profile */
.topbar .nav-lb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; font-weight: 600; color: var(--muted); }
.topbar .nav-lb[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.topbar .nav-lb .icon { width: 16px; height: 16px; color: var(--gold); }
.kpi-btn { text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .15s ease; }
.kpi-btn:hover { transform: translateY(-2px); }
@media (max-width: 760px) { .topbar .nav-lb .lbl { display: none; } }
.social h3 .icon { width: 20px; height: 20px; vertical-align: -4px; color: var(--gold); }
.profile .avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--primary); flex: none; }
.profile .avatar .icon { width: 22px; height: 22px; }
.profile .avatar.gen { overflow: hidden; }
.profile .avatar.gen svg { width: 100%; height: 100%; display: block; }
.profile-more { margin-top: 10px; }
.profile-more summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); padding: 4px 6px; margin-left: -6px; border-radius: 8px; }
.profile-more summary::-webkit-details-marker { display: none; }
.profile-more summary:hover { background: var(--raised); color: var(--ink); }
.profile-more .chev { display: inline-block; transition: transform .15s ease; }
.profile-more[open] .chev { transform: rotate(90deg); }
.field { font: inherit; flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.field:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.lb { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line); }
.lb-row.me { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 9%, var(--surface)); }
.lb-row .rk { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--soft); color: var(--ink); }
.lb-row .rk.medal { color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.25); }
.lb-row .lb-av { width: 32px; height: 32px; flex: none; border-radius: 8px; overflow: hidden; }
.lb-row .lb-av svg { width: 100%; height: 100%; display: block; }
.lb-row .lb-av img, .profile .avatar.gen img { width: 100%; height: 100%; display: block; object-fit: cover; }
.shop-card { width: min(760px, 100%) !important; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.shop-tile { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 14px 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--raised); }
.shop-tile.on { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 30%, transparent); }
.shop-tile.locked .shop-av { filter: grayscale(1) opacity(.45); }
.shop-tile small { font-size: 12px; min-height: 1.3em; }
.shop-tile .btn { margin-top: 6px; }
.shop-av { width: 64px; height: 64px; border-radius: 50%; overflow: hidden; margin-bottom: 4px; }
.shop-av svg, .shop-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
.shop-btns { display: flex; gap: 6px; justify-content: center; }
.shop-status { min-height: 1.4em; margin: 12px 0 0; font-size: 13px; }
.lb-row .nm { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.lb-row .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.lb-row .nm small { flex-basis: 100%; font-size: 12.5px; }
.lb-row .you { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-ink); background: var(--primary); padding: 1px 7px; border-radius: 99px; }
.lb-row .pts { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--gold); white-space: nowrap; }
.lb-row .pts small { color: var(--muted); font-weight: 600; }
.lb-row .pts.up { color: var(--good); }
.lb-row .pts.down { color: var(--bad); }
.lb-gap { text-align: center; color: var(--muted); line-height: 1; margin-top: 6px; }
.lb-foot { font-size: 13px; margin: 10px 0 0; }
.lb-empty { margin-top: 12px; }
.lb-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lb-actions { display: grid; justify-items: end; gap: 8px; flex: none; }
.lb-title-row { align-items: center; margin-top: 6px; }
.lb-title-row .btn { flex: none; }
.lb-period { flex: none; gap: 6px; cursor: pointer; white-space: nowrap; font-size: 13px; font-weight: 600; color: var(--muted); }
.lb-period:not(:has(input:checked)) .lb-period-total,
.lb-period input:checked + .lb-period-daily { color: var(--ink); }
.lb-period input { appearance: none; width: 34px; height: 20px; margin: 0; border: 1px solid var(--muted); border-radius: 99px; background: var(--raised); cursor: inherit; display: grid; align-items: center; padding: 2px; }
.lb-period input::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); }
.lb-period input:checked { background: var(--primary); border-color: var(--primary); }
.lb-period input:checked::before { justify-self: end; background: var(--primary-ink); }
.lb-period input:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.lb-tabs { margin: 12px 0 10px; }
.lb-tabs button { --tc: var(--primary); display: inline-flex; align-items: center; gap: 6px; color: var(--tc); background: color-mix(in srgb, var(--tc) 9%, var(--surface)); border-color: color-mix(in srgb, var(--tc) 35%, var(--line)); transition: background .15s, transform .15s; }
.lb-tabs button:hover { background: color-mix(in srgb, var(--tc) 18%, var(--surface)); transform: translateY(-1px); }
.lb-tabs button[aria-selected="true"] { background: var(--tc); border-color: var(--tc); color: #fff; box-shadow: 0 4px 12px color-mix(in srgb, var(--tc) 35%, transparent); }
.lb-emo { font-size: 1.05em; line-height: 1; }
.lb-tabs .lb-t-all { --tc: var(--gold); } .lb-tabs .lb-t-predicted { --tc: var(--primary); } .lb-tabs .lb-t-gamble { --tc: var(--c-ra); }
.lb-card { --bc: var(--gold); position: relative; overflow: hidden; border-top: 5px solid var(--bc); background: linear-gradient(160deg, color-mix(in srgb, var(--bc) 10%, var(--surface)) 0%, var(--surface) 45%); transition: border-color .2s; }
.lb-card h1 { color: color-mix(in srgb, var(--bc) 55%, var(--ink)); }
.lb-card .lb-eyebrow { color: var(--bc); }
.lb-card .lb-row .pts { color: var(--bc); }
.lb-card .lb-row .pts.up { color: var(--good); } .lb-card .lb-row .pts.down { color: var(--bad); }
.lb-card .lb-row.me { border-color: var(--bc); background: color-mix(in srgb, var(--bc) 10%, var(--surface)); }
.lb-empty-box { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px dashed color-mix(in srgb, var(--bc, var(--primary)) 45%, var(--line)); background: color-mix(in srgb, var(--bc, var(--primary)) 7%, var(--surface)); color: var(--muted); }
.lb-empty-emo { font-size: 26px; }
.lb-side { display: grid; gap: 18px; }
.predict-big { font-size: 30px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.predict-big small { font-size: 13px; font-weight: 600; }
.predict-areas { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.predict-areas li { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr auto; align-items: center; gap: 10px; }
.predict-areas b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.predict-areas .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.predict-areas .prog { margin: 0; }
.lb-page { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .lb-page { grid-template-columns: 1fr; } }
@media (max-width: 600px) { .maphead .prog { display: none; } .maphead h1 { font-size: 30px; } }
.topbar nav button.nav-slots { display: inline-flex; align-items: center; gap: 6px; }
.slots-page { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .slots-page { grid-template-columns: 1fr; } }
.slot-machine { display: grid; gap: 14px; }
.slot-frame { background: linear-gradient(#7A5232, #4E3320); border-radius: 18px; padding: 14px; box-shadow: inset 0 2px 0 rgba(255,255,255,.15), 0 4px 0 #2E1E12; }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reel { background: #FFF8EC; border-radius: 12px; aspect-ratio: 1; display: grid; place-items: center; box-shadow: inset 0 3px 8px rgba(0,0,0,.25); overflow: hidden; transition: box-shadow .2s; }
.reel.spinning .slot-face { filter: blur(2px); transform: translateY(4px); }
.reel.hit { box-shadow: inset 0 3px 8px rgba(0,0,0,.2), 0 0 0 4px var(--gold); }
.reel .slot-face { font-size: clamp(40px, 9vw, 72px); width: 70%; height: 70%; }
.slot-face { display: inline-grid; place-items: center; line-height: 1; }
.slot-face .wombat { width: 100%; height: 100%; }
.slot-67 { font-family: var(--font-display); font-weight: 800; font-size: .9em; letter-spacing: -.04em; background: linear-gradient(135deg, #FF5C7A, #E89B0C 55%, #2457F5); -webkit-background-clip: text; background-clip: text; color: transparent; }
.slot-pay .slot-67 { font-size: 15px; }
.slot-msg { font-family: var(--font-display); font-size: 20px; font-weight: 700; text-align: center; min-height: 1.4em; }
.slot-msg.win { color: var(--good); } .slot-msg.lose { color: var(--bad); }
.slot-msg.big { color: var(--gold); font-size: 26px; animation: rise .3s ease-out; }
.slot-stats { font-size: 13px; }
.slot-xpbox { position: relative; }
.slot-xp { display: inline-block; font-variant-numeric: tabular-nums; }
.xp-float { position: absolute; left: 100%; top: -4px; margin-left: 8px; font-family: var(--font-display); font-weight: 800; font-size: 18px; white-space: nowrap; pointer-events: none; animation: xpfloat 1.3s ease-out forwards; }
.xp-float.gain { color: var(--good); } .xp-float.loss { color: var(--bad); }
@keyframes xpfloat { 0% { opacity: 0; transform: translateY(8px) scale(.8); } 15% { opacity: 1; transform: translateY(0) scale(1.15); } 70% { opacity: 1; } 100% { opacity: 0; transform: translateY(-26px) scale(1); } }
.bump-gain { animation: bumpgain .6s ease-out; } .bump-loss { animation: bumploss .45s ease-out; }
@keyframes bumpgain { 30% { transform: scale(1.25); color: var(--good); } }
@keyframes bumploss { 30% { transform: translateX(-3px); color: var(--bad); } 60% { transform: translateX(3px); } }
.slot-spin { width: 100%; padding: 14px; font-size: 17px; }
.slot-pay { width: 100%; border-collapse: collapse; margin-top: 8px; }
.slot-pay td { padding: 6px 4px; border-top: 1px solid var(--line); font-size: 14px; }
.slot-pay td:last-child { text-align: right; font-weight: 700; }
.slot-pay .slot-face { width: 24px; height: 24px; font-size: 20px; }
@media (max-width: 460px) { .stat.predict .lbl { display: none; } .topbar .wrap { gap: 6px; } .stat { padding: 5px 7px; gap: 4px; } }

/* ---------- colourful background, Western Gateway drawings, audio controls (js/fx.js) ---------- */
.bgfx { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, color-mix(in srgb, #5CC8E8 22%, var(--bg)) 0%, var(--bg) 38%, color-mix(in srgb, #FFB86B 18%, var(--bg)) 72%, color-mix(in srgb, #FF6F9C 16%, var(--bg)) 100%); }
.bgfx .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; animation: blobdrift 26s ease-in-out infinite alternate; }
.bgfx .b1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; background: #4FD1C5; }
.bgfx .b2 { width: 38vmax; height: 38vmax; right: -10vmax; top: 6vh; background: #A78BFA; animation-duration: 31s; animation-delay: -8s; }
.bgfx .b3 { width: 34vmax; height: 34vmax; left: 22vw; bottom: -16vmax; background: #FFB347; animation-duration: 29s; animation-delay: -15s; }
.bgfx .b4 { width: 26vmax; height: 26vmax; right: 8vw; bottom: 4vh; background: #FF7EB6; animation-duration: 23s; animation-delay: -4s; opacity: .38; }
.bgfx .b5 { width: 22vmax; height: 22vmax; left: 6vw; top: 42vh; background: #60A5FA; animation-duration: 35s; animation-delay: -20s; opacity: .4; }
@keyframes blobdrift { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(6vw, 4vh) scale(1.12); } 100% { transform: translate(-4vw, 7vh) scale(.92); } }
:root[data-theme="dark"] .bgfx .blob { opacity: .22; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bgfx .blob { opacity: .22; } }
.bg-skyline { position: absolute; left: 50%; bottom: -6px; width: max(900px, 70vw); transform: translateX(-50%); color: var(--c-er); opacity: .16; }
body.no-skyline .bg-skyline { display: none; }
.bg-skyline .wgb { width: 100%; height: auto; display: block; }
.bg-skyline .wgb * { fill: currentColor !important; stroke: none !important; }
.wgb { display: block; width: 100%; height: auto; overflow: visible; }
.wgb-cloud { animation: wgbcloud 38s linear infinite; }
.wgb-cloud.c2 { animation-duration: 52s; animation-delay: -20s; } .wgb-cloud.c3 { animation-duration: 44s; animation-delay: -32s; }
@keyframes wgbcloud { from { transform: translateX(-120px); } to { transform: translateX(440px); } }
.wgb-lit { animation: wgblit 6s ease-in-out infinite; }
@keyframes wgblit { 0%, 40% { opacity: 1; } 50%, 85% { opacity: .15; } 100% { opacity: 1; } }
.wgb-sun { animation: wgbsun 4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes wgbsun { 50% { transform: scale(1.08); } }
.wgb-bird { animation: wgbbird 18s linear infinite; }
.wgb-bird.b2 { animation-duration: 22s; animation-delay: -9s; }
@keyframes wgbbird { 0% { transform: translate(-30px, 40px); } 50% { transform: translate(200px, 22px); } 100% { transform: translate(430px, 34px); } }
.wgb-flag { animation: wgbflag 1.4s ease-in-out infinite; }
@keyframes wgbflag { 50% { transform: skewY(6deg) scaleX(.9); } }
.wgb-tree { animation: wgbtree 5s ease-in-out infinite; }
@keyframes wgbtree { 50% { transform: rotate(1.6deg); } }
.wgb-photo { object-fit: cover; aspect-ratio: 920 / 590; }
.wgb-banner { padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: stretch; }
.wgb-banner .wgb { border-radius: var(--radius) 0 0 var(--radius); height: 100%; object-fit: cover; }
.wgb-banner .wgb-copy { padding: 20px 22px; display: grid; gap: 8px; align-content: center; }
.wgb-banner h3 { font-size: 20px; }
.campus-row { align-items: stretch; }
.campus-row .wgb-banner { grid-template-columns: 1fr; align-content: start; }
.campus-row .wgb-banner .wgb { border-radius: var(--radius) var(--radius) 0 0; height: auto; }
.campus-row .wgb-banner .wgb-copy { padding: 14px 18px 18px; gap: 6px; }
.campus-row .wgb-banner h3 { font-size: 18px; }
.slot-machine.compact { gap: 10px; align-content: start; }
.slot-machine.compact .slot-frame { padding: 10px; border-radius: 14px; }
.slot-machine.compact .reel .slot-face { font-size: clamp(32px, 5vw, 52px); }
.slot-machine.compact .slot-msg { font-size: 17px; }
.slot-machine.compact .slot-spin { padding: 11px; font-size: 15px; }
.slot-machine.compact > .btn.ghost { justify-self: center; }
.slot-preview { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform .12s ease, box-shadow .15s; }
.slot-preview:hover { transform: translateY(-2px); box-shadow: var(--shadow), 0 0 0 2px var(--gold); }
.slot-preview:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.slot-preview .slot-spin { pointer-events: none; }
.slot-timer { position: fixed; right: calc(max(16px, env(safe-area-inset-right, 0px)) + 80px); bottom: calc(var(--sc-bottom, 16px) + 16px); z-index: 59; display: grid; justify-items: end; gap: 8px; }
.slot-clock { background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); }
.slot-clock b { color: var(--ink); }
.slot-timer.warn .slot-clock { border-color: var(--gold); background: var(--gold-bg); }
.slot-timer.over .slot-clock { border-color: var(--bad); color: var(--bad); animation: rise .3s ease-out; }
.slot-timer.over .slot-clock b { color: var(--bad); }
.slot-nag { width: min(280px, calc(100vw - 120px)); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: 0 10px 30px rgba(19,32,59,.22); animation: rise .25s ease-out; }
.slot-nag[hidden] { display: none; }
.slot-nag p { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
@media (max-width: 640px) { .slot-timer { right: calc(max(16px, env(safe-area-inset-right, 0px)) + 68px); } }
@media (max-width: 760px) { .wgb-banner { grid-template-columns: 1fr; } .wgb-banner .wgb { border-radius: var(--radius) var(--radius) 0 0; } }
.map-wgb { width: 170px; flex: none; border-radius: 14px; box-shadow: var(--shadow); }
@media (max-width: 600px) { .map-wgb { display: none; } }
.lab-wgb { margin: -4px 0 12px; border-radius: 12px; overflow: hidden; }
.done-wgb { width: min(320px, 80vw); margin-top: 6px; border-radius: 14px; box-shadow: var(--shadow); }
.lesson { background: linear-gradient(170deg, color-mix(in srgb, var(--tint-a) 12%, var(--bg)), var(--bg) 45%, color-mix(in srgb, var(--tint-c) 10%, var(--bg))); }
.hero-main { background: linear-gradient(135deg, color-mix(in srgb, var(--tint-b) 40%, var(--surface)), var(--surface) 45%, color-mix(in srgb, var(--tint-a) 22%, var(--surface))); }
.mapcard { background: linear-gradient(180deg, var(--surface) 60%, color-mix(in srgb, var(--surface) 88%, var(--tint-a))); }
.audio-ctl { display: inline-flex; gap: 2px; }
.audio-btn { border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.audio-btn:hover { background: var(--surface); color: var(--ink); }
.audio-btn[aria-pressed="true"] { color: var(--c-er); }
.audio-btn .icon { width: 19px; height: 19px; }
.audio-btn.invite { animation: invite 2.4s ease-in-out infinite; }
@keyframes invite { 0%, 70%, 100% { transform: none; } 78% { transform: rotate(-12deg) scale(1.12); } 86% { transform: rotate(10deg) scale(1.12); } }
@media (max-width: 460px) { .audio-btn { width: 30px; } }
.study-stack { display: grid; gap: 12px; min-width: 0; }
.study-part-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.mock-launch { margin-bottom: 12px; }
.paper-photo { display: grid; gap: 8px; justify-items: start; }
.paper-photo input { display: block; max-width: 100%; margin-top: 6px; }
.paper-photo img { display: block; max-width: 100%; max-height: 65vh; object-fit: contain; }
.written-answer { white-space: pre-wrap; overflow-wrap: anywhere; }
.sprint-overview, .sprint-drill { padding: clamp(18px, 3vw, 32px); font-size: 1rem; }
.mapview > .sprint-overview, .mapview > .sprint-drill { margin-block: 18px; }
#sprint-title, .mapview .unit h2 { scroll-margin-top: 120px; }
.sprint-overview { background: linear-gradient(125deg, var(--surface) 30%, color-mix(in srgb, var(--surface) 85%, var(--c-er))); }
#sprint-title { font-size: clamp(2rem, 5vw, 3.2rem); }
.sprint-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.sprint-intro p { max-width: 62ch; }
.sprint-steve { width: clamp(80px, 15vw, 145px); flex: none; align-self: center; }
.sprint-stack { display: grid; gap: 12px; min-width: 0; }
.sprint-stack p, .sprint-intro p { margin: 0; }
.sprint-grid, .sprint-data-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sprint-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.sprint-area { display: grid; align-content: start; text-align: left; gap: 5px; background: var(--surface); padding: 14px; border: 1px solid var(--line); border-top: 3px solid var(--topic); border-radius: 12px; min-width: 0; }
.sprint-area:hover { background: var(--raised); border-color: var(--topic); }
.sprint-area-label { display: inline-flex; gap: 6px; align-items: center; font-size: .875rem; font-weight: 600; }
.sprint-area-label .icon { flex: none; color: var(--topic); width: 18px; height: 18px; }
.sprint-area .muted { font-size: .875rem; }
.sprint-drill { display: grid; gap: 14px; max-width: 850px; margin-inline: auto; border-top: 4px solid var(--topic); }
.sprint-stage { margin-top: 6px; }
.sprint-stage .viz { margin: 0; min-width: 0; }
.sprint-stage .btn[aria-pressed="true"] { border-color: var(--primary); background: var(--soft); color: var(--primary); }
.sprint-stage .code { white-space: pre-wrap; overflow-wrap: anywhere; }
.sprint-stage .sprint-skip { justify-self: start; }
.sprint-feedback, .sprint-question { padding: 12px 16px; border-radius: 10px; background: var(--soft); }
.sprint-field { display: grid; gap: 3px; min-width: 0; padding: 12px; margin: 0; border: 1px solid var(--line); border-radius: 10px; }
.sprint-field legend { font-weight: 700; padding-inline: 5px; }
.sprint-field label { display: flex; gap: 10px; align-items: baseline; padding: 6px; cursor: pointer; }
.sprint-field input { flex: none; accent-color: var(--primary); }
.sprint-missed { margin: 0; padding-left: 24px; }
.sprint-relations { display: grid; gap: 7px; font-family: var(--font-mono); overflow-wrap: anywhere; }
.exam-dock { position: fixed; right: max(18px, env(safe-area-inset-right, 0px)); top: calc(env(safe-area-inset-top, 0px) + 82px); z-index: 45; display: grid; gap: 8px; justify-items: stretch; max-width: min(300px, calc(100vw - 110px)); }
.mock-pill { border-top-color: var(--c-er, var(--primary)); }
.mock-pill .icon { color: var(--c-er, var(--primary)); }
.sprint-pill strong, .sprint-pill small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sprint-pill span { min-width: 0; }
.sprint-pill { display: flex; align-items: center; gap: 10px; padding: 10px 16px 10px 12px; border: 1px solid var(--line); border-top: 3px solid var(--primary); border-radius: 14px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; text-align: left; font: inherit; animation: rise .25s ease-out; }
.sprint-pill:hover { background: var(--raised); border-color: var(--primary); }
.sprint-pill .icon { width: 22px; height: 22px; color: var(--primary); flex: none; }
.sprint-pill span { display: grid; line-height: 1.2; }
.sprint-pill small { color: var(--muted); font-size: .78rem; }
.sprint-modal { position: fixed; inset: 0; z-index: 56; background: rgba(10,16,32,.35); display: grid; place-items: center; padding: 16px; overflow-y: auto; }
.sprint-modal .sprint-modal-card { position: relative; width: min(1100px, 100%); margin: 0; max-height: calc(100vh - 32px); overflow-y: auto; animation: rise .2s ease-out; }
.sprint-modal-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: var(--soft); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; z-index: 1; }
.sprint-modal-close:hover { background: var(--raised); }
@media (max-width: 760px) { .sprint-pill { padding: 8px 12px 8px 10px; } }
@media (max-width: 520px) { .exam-dock { top: calc(env(safe-area-inset-top, 0px) + 96px); } }
@media (max-width: 820px) { .sprint-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .topbar .wrap { height: auto; min-height: 58px; flex-wrap: wrap; row-gap: 2px; padding-block: 4px; }
  .topbar nav { order: 1; flex: 1 0 100%; justify-content: center; }
  .sprint-steve { display: none; }
  .sprint-area { padding: 10px; }
  .sprint-data-grid { grid-template-columns: 1fr; }
}

.tour { padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: stretch; }
.tour-video { display: block; width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #0F1A33; border-radius: var(--radius) 0 0 var(--radius); }
.tour-copy { padding: 20px 24px; display: grid; gap: 8px; align-content: center; }
.tour-copy h2 { margin: 0; }
@media (max-width: 760px) { .tour { grid-template-columns: 1fr; } .tour-video { border-radius: var(--radius) var(--radius) 0 0; height: auto; } }
.home-next { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.home-next h1 { margin:6px 0; }
.home-next p { margin:4px 0 12px; }
.home-mascot { width:clamp(72px,12vw,135px); flex:none; }
.home-mascot-wrap { position:relative; flex:none; display:flex; flex-direction:column; align-items:center; }
.steve-pop { position:absolute; bottom:100%; right:55%; margin-bottom:-14px; white-space:nowrap; background:var(--surface); color:var(--ink, inherit); font-weight:700; font-size:14px; padding:6px 12px; border-radius:14px; border:2px solid currentColor; box-shadow:0 4px 12px rgba(0,0,0,.12); z-index:2; transform-origin:bottom right; animation:stevepop .55s cubic-bezier(.34,1.56,.64,1) .6s both; }
.steve-pop::after { content:''; position:absolute; right:10px; bottom:-8px; width:12px; height:12px; background:var(--surface); border-right:2px solid currentColor; border-bottom:2px solid currentColor; transform:rotate(45deg); }
@keyframes stevepop { 0% { opacity:0; transform:scale(.3) rotate(-8deg); } 70% { opacity:1; transform:scale(1.08) rotate(2deg); } 100% { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .steve-pop { animation:none; } }
.home-community { display:grid; gap:14px; }
.home-community > h2 { margin:0; }
.home-fun { gap:12px; }
.home-fun .btn { padding:14px 24px; font-size:17px; border-radius:14px; gap:10px; }
.home-fun .btn > span { font-size:22px; }
.home-tools { overflow:hidden; }
.home-fold + .home-fold { border-top:1px solid var(--line); }
.home-fold > summary { cursor:pointer; padding:16px 20px; font-weight:650; }
summary:focus-visible { outline:3px solid var(--primary); outline-offset:-3px; }
.fold-body { display:grid; gap:14px; padding:0 20px 20px; }
.bgfx .blob, .audio-btn.invite { animation:none; }
.bgfx { opacity:.32; }
.node.current::after { animation:none; }
@media (max-width:560px) {
  .home { gap:16px; }
  .home-next { padding:18px; }
  .home-mascot, .home-mascot-wrap { display:none; }
  .fold-body { padding-inline:12px; }
}
/* the campus photo on the home page */
.spotted { margin: 0; padding: 0; overflow: hidden; display: grid; grid-template-columns: minmax(120px, 220px) 1fr; align-items: center; }
.spotted-img { padding: 0; border: 0; background: none; cursor: zoom-in; height: 100%; }
.spotted-img img { display: block; width: 100%; height: 100%; max-height: 260px; object-fit: cover; object-position: center 30%; }
.spotted figcaption { padding: 16px 20px; display: grid; gap: 6px; }
.spotted figcaption h3 { margin: 0; }
.spotted-full { display: grid; place-items: center; cursor: zoom-out; padding: 20px; z-index: 80; background: rgba(10,16,32,.75); }
.spotted-full img { max-width: min(92vw, 640px); max-height: 90vh; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
@media (max-width: 520px) { .spotted { grid-template-columns: 1fr; } .spotted-img img { max-height: 320px; } }
.cinema { --strip: 14px; position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: calc(var(--strip) + 22px) 26px; border: 0; color: #F4ECD8;
  background: radial-gradient(120% 90% at 0% 0%, rgba(255,170,60,.22), transparent 55%), radial-gradient(90% 80% at 100% 100%, rgba(220,40,60,.25), transparent 60%), linear-gradient(160deg, #1B1426, #0E0B16); }
.cinema::before, .cinema::after { content: ""; position: absolute; left: 0; right: 0; height: var(--strip); background: #08060C repeating-linear-gradient(90deg, transparent 0 8px, rgba(255,240,210,.85) 8px 18px, transparent 18px 26px); background-size: 26px 6px; background-repeat: repeat-x; background-position: 0 center; }
.cinema::before { top: 0; } .cinema::after { bottom: 0; }
.cinema-copy { display: grid; gap: 10px; align-content: center; max-width: 46ch; }
.cinema-badge { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #1B1426; background: linear-gradient(180deg, #FFD978, #F0A93B); box-shadow: 0 0 18px rgba(255,190,80,.45); }
.cinema-copy h3 { margin: 0; font-size: clamp(22px, 2.6vw, 30px); line-height: 1.1; color: #FFE7B0; text-shadow: 0 2px 18px rgba(255,170,60,.35); }
.cinema-copy p { margin: 0; color: rgba(244,236,216,.78); }
.cinema-ticket { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border: 1.5px dashed rgba(255,217,120,.6); border-radius: 8px; font-size: 13px; font-weight: 700; color: #FFD978; }
.cinema-tip { font-size: 12px; color: rgba(244,236,216,.5); }
.poster-grid { display: grid; grid-template-columns: repeat(2, 170px); gap: 18px; }
.poster { margin: 0; display: grid; gap: 8px; text-align: center; }
.poster-img { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,217,120,.35), 0 14px 30px rgba(0,0,0,.55); transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s; }
.poster-img:hover, .poster-img:focus-visible { transform: translateY(-4px) rotate(-1deg); box-shadow: 0 0 0 2px #FFD978, 0 18px 40px rgba(255,160,60,.35); }
.poster-img img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: center top; }
.poster figcaption { display: grid; gap: 2px; }
.poster figcaption strong { font-size: 14px; color: #F4ECD8; }
.poster-stars { font-size: 13px; letter-spacing: .12em; color: #FFC94D; }
@media (max-width: 720px) { .cinema { grid-template-columns: 1fr; padding: calc(var(--strip) + 18px) 18px; } .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.news-head { justify-content: space-between; align-items: center; gap: 12px; }
.news-head h2 { margin: 0; }
.news-actions { gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.home-joke { padding: 10px 18px; font-size: 15px; border-radius: 14px; gap: 8px; }
.home-joke > span { font-size: 20px; }
.home-joke { position: relative; overflow: visible; }
.home-joke.buzz { animation: jokeBuzz .45s ease-out; }
.home-joke .joke-ring { position: absolute; inset: -2px; border-radius: inherit; border: 3px solid var(--primary); pointer-events: none; animation: jokeRing .8s ease-out forwards; font-size: 0; }
.home-joke .joke-ring::after { content: ''; position: absolute; inset: -2px; border-radius: inherit; border: 2px solid var(--primary); animation: jokeRing .8s .15s ease-out forwards; opacity: 0; }
@keyframes jokeBuzz { 0%,100% { transform: none; } 15% { transform: translateX(-3px) rotate(-1.5deg) scale(.97); } 30% { transform: translateX(3px) rotate(1.5deg) scale(.97); } 45% { transform: translateX(-2px) rotate(-1deg); } 60% { transform: translateX(2px) rotate(1deg); } 75% { transform: translateX(-1px); } }
@keyframes jokeRing { 0% { opacity: .85; transform: scale(1); } 100% { opacity: 0; transform: scale(1.35, 1.7); } }
@media (prefers-reduced-motion: reduce) { .home-joke.buzz, .home-joke .joke-ring, .home-joke .joke-ring::after { animation: none; display: none; } }
.surf-scene { cursor: default; display: block; }
.surf-svg { display: block; width: 100%; height: 100%; max-height: 260px; }
.surf-svg .steve { overflow: visible; }
@media (prefers-reduced-motion: no-preference) { .surf-rider { animation: surfBob 2.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center bottom; } }
@keyframes surfBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
.explain-thinking { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.explain-thinking .who-steve, .steve-verdict .who-steve, .row > .who-steve { width: 30px; height: 30px; flex: none; }
.explain-thinking .who-steve { animation: vbreath 1.2s ease-in-out infinite; }
@keyframes vbreath { 50% { transform: scale(.92); } }
/* where you are in a lesson's section */
.unit { scroll-margin-top: 80px; }
.lesson-where { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 1100px; width: 100%; margin: -4px auto 0; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 8px max(16px, env(safe-area-inset-left, 0px)); font-size: 13px; color: var(--muted); }
.lesson-where[hidden] { display: none; }
.lesson-where .where-map { flex: none; }
.lesson-where .where-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 200px; }
.lesson-where .where-text b { color: var(--ink); font-weight: 650; }
.where-dots { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.where-dot { width: 13px; height: 13px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .12s; }
.where-dot:not(:disabled):hover { transform: scale(1.25); border-color: var(--primary); }
.where-dot.done { background: var(--good); border-color: var(--good); }
.where-dot.review { border-radius: 3px; }
.where-dot.talk { border-style: dashed; }
.where-dot.locked { opacity: .45; cursor: default; }
.where-dot.here { width: 17px; height: 17px; background: var(--primary); border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); cursor: default; }
.section-done { display: flex; align-items: center; gap: 6px; justify-content: center; font-weight: 600; color: var(--good); }
.lesson-top .audio-ctl { flex: none; }
@media (max-width: 640px) { .lesson-where .where-text { flex-basis: 100%; order: 3; } .where-map span { display: none; } }
#session-usage {
  position: fixed; right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(var(--sc-bottom, 16px) + 76px); z-index: 57;
  width: min(212px, calc(100vw - 32px)); padding: 10px 12px;
  display: grid; gap: 4px; background: var(--surface); color: var(--muted);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  font-size: 12px; font-variant-numeric: tabular-nums;
}
#session-usage strong { color: var(--ink); }
#session-usage > span { display: flex; justify-content: space-between; gap: 8px; }
#session-usage .session-total { margin-top: 2px; padding-top: 5px; border-top: 1px solid var(--line); }
#session-usage { width: min(250px, calc(100vw - 32px)); }
#session-usage[hidden] { display: none; }
#session-usage .session-head { align-items: center; }
#session-hide { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 700; padding: 2px 6px; border-radius: 6px; cursor: pointer; }
#session-hide:hover { background: var(--soft); color: var(--ink); }
#session-show { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(var(--sc-bottom, 16px) + 76px); z-index: 57; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; box-shadow: var(--shadow); cursor: pointer; }
#session-show[hidden] { display: none; }
#session-show:hover { color: var(--ink); border-color: var(--primary); }
body:has(.sc-fab[aria-expanded="true"]) #session-show { visibility: hidden; }
@media (max-width: 640px) { #session-show { bottom: calc(var(--sc-bottom, 16px) + 66px); } }
@media print { #session-show { display: none; } }
body:has(.sc-fab[aria-expanded="true"]) #session-usage { visibility: hidden; }
@media (max-width: 640px) { #session-usage { bottom: calc(var(--sc-bottom, 16px) + 66px); } }
@media print { #session-usage { display: none; } }
/* ---------- phone fixes ---------- */
@media (max-width: 600px) {
  /* Map: the By lecture / By topic switch sits in the flow above the title instead of floating over cards */
  .road-toggle-dock { position: static; height: auto; margin: 4px 0 10px; justify-content: flex-start; }
  .road-toggle-dock .road-toggle { box-shadow: none; backdrop-filter: none; }
  .road-toggle button { padding: 9px 14px; font-size: 15px; }
  .road-toggle-dock .road-toggle { max-width: 100%; } .road-toggle button { flex: 1 1 auto; min-width: 0; white-space: nowrap; }
  .maphead.has-toggle { padding-top: 0; }
  /* Map: stack the up arrow above the down arrow, clear of the heading */
  .section-jump .jump-up { top: auto; bottom: 100px; }
  /* Exam map: mock and sprint cards go in the flow under the top bar, not over the heading */
  .exam-dock { position: static; max-width: none; margin: 14px max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); }
  .exam-dock .sprint-pill { padding: 8px 12px; }
  /* Lesson top bar: buttons on one line, progress bar on its own line below */
  .lesson-top { flex-wrap: wrap; row-gap: 8px; gap: 8px; }
  .lesson-top .prog { order: 5; flex-basis: 100%; height: 10px; }
  .lesson-top .lesson-extra { flex-wrap: nowrap; gap: 6px; margin-right: auto; }
  .lesson-top .lesson-extra .btn.small { padding: 6px 9px; font-size: 13px; gap: 5px; }
  .lesson-top .lesson-extra .btn.small .icon { width: 16px; height: 16px; }
  .lesson-top > .btn.ghost { padding-inline: 6px; }
}
/* Phones: nothing in a lesson may be wider than the screen. Grid children shrink, code and tables wrap instead of scrolling sideways. */
.lesson, .lesson-inner { grid-template-columns: minmax(0, 1fr); }
.lesson-inner > *, .lesson-inner .card, .lesson-inner .panel { min-width: 0; }
@media (max-width: 860px) { .split { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) {
  pre.code, .notes-prose pre.code { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: hidden; font-size: 13px; padding: 12px 13px; }
  .editor { font-size: 14px; padding: 12px 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .lesson-inner table.t th, .lesson-inner table.t td { white-space: normal; padding: 6px 8px; }
  .lesson-inner table.t { font-size: 13px; }
  .lesson-inner .prose { overflow-wrap: anywhere; }
  .lesson-inner img, .lesson-inner svg { max-width: 100%; }
}

/* ---- UCC CS: link back to the module picker */

.lesson-video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #0F1A33; border-radius: var(--radius); }

/* ---------- site logo (to the ucc-cs.org main page) and profile chip ---------- */
.site-logo { flex: none; display: grid; place-items: center; text-decoration: none; padding-right: 12px; margin-right: -2px; border-right: 1.5px solid var(--line); align-self: stretch; }
.site-logo i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; font: 700 13px/1 var(--font-mono); font-style: normal; background: linear-gradient(135deg, var(--hub-a), var(--hub-b)); box-shadow: 0 4px 14px -6px var(--hub-b); transition: transform .2s; }
.site-logo:hover i { transform: rotate(-6deg) scale(1.06); }
.topbar .wrap > .site-logo { margin-block: 12px; }
.me-chip { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; padding: 2px; background: linear-gradient(135deg, var(--primary), var(--tint-a)); text-decoration: none; transition: transform .15s; }
.me-chip:hover { transform: scale(1.07); }
.me-chip .lb-av { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; display: block; background: var(--surface); }
.me-chip .lb-av svg, .me-chip .lb-av img { width: 100%; height: 100%; display: block; object-fit: cover; }
@media (max-width: 520px) {
  .site-logo { padding-right: 8px; }
  .site-logo i { width: 26px; height: 26px; font-size: 11px; border-radius: 8px; }
  .me-chip { width: 32px; height: 32px; } .me-chip .lb-av { width: 28px; height: 28px; }
}
/* module home: readiness + leaderboard, then the campus banner */
.home-community > .wgb-banner { margin: 0; }
@media (max-width: 520px) {
  .topbar .wrap > .site-logo { margin-block: 10px; }
  .topbar .stat.xp .lbl { display: none; }
  .topbar .audio-btn { width: 30px; }
  .topbar .wrap { gap: 5px; }
  .topbar .nav-lb { padding: 7px 6px; }
}
@media (max-width: 360px) { .topbar .audio-ctl { display: none; } }

/* Big bouncing arrow pointing at "Start practice" on a first visit (COURSE.startArrow). */
.start-arrow { display: inline-flex; align-items: center; gap: 8px; color: var(--gold, #FACC15); pointer-events: none; animation: startPoke .8s ease-in-out infinite; }
.start-arrow svg { width: 96px; height: 48px; display: block; filter: drop-shadow(0 0 10px currentColor); }
.start-arrow b { font: 800 20px/1 "Bricolage Grotesque", system-ui, sans-serif; white-space: nowrap; text-shadow: 0 0 12px currentColor; }
@keyframes startPoke { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-14px); } }
@media (max-width: 560px) { .start-arrow svg { width: 64px; height: 32px; } .start-arrow b { font-size: 16px; } }
@media (prefers-reduced-motion: reduce) { .start-arrow { animation: none; } }

/* ---------- map stops: stars sit as a badge on the node, so a two-line label clears the next stop ---------- */
.stop .stars { position: absolute; top: 54px; left: 50%; transform: translateX(-50%); padding: 2px 5px; border-radius: 99px; background: var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.14); z-index: 1; }
.stop:not(:has(.node.done)) .stars { display: none; }
.stop .label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 2px; }
.stop .node:active + .stars { transform: translate(-50%, 2px); }
@media (hover: none) { .hover-only { display: none; } }

/* ---------- phones: smaller floating buttons, full topic names on readiness ---------- */
@media (max-width: 600px) {
  .section-jump .jump-btn { width: 46px; height: 46px; left: max(8px, env(safe-area-inset-left, 0px)); box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 35%, transparent); }
  .section-jump .jump-btn .icon { width: 22px; height: 22px; }
  .section-jump .jump-down { bottom: max(16px, env(safe-area-inset-bottom, 0px)); }
  .section-jump .jump-up { bottom: calc(max(16px, env(safe-area-inset-bottom, 0px)) + 56px); }
  .section-jump .jump-btn:disabled { opacity: 0; pointer-events: none; }
  .mapview { padding-bottom: 120px; }
  .predict-areas li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .predict-areas b { white-space: normal; grid-column: 1 / -1; line-height: 1.3; }
}
@media (max-width: 640px) { .sc-fab { width: 52px !important; height: 52px !important; } }

/* FIG diagrams on lesson pages (core/js/fig.js) */
.fig { margin: 6px 0 14px; }
.fig svg { display: block; width: 100%; height: auto; overflow: visible; }
.fig figcaption { color: var(--muted); font-size: 14px; margin-top: 6px; max-width: 70ch; }
.fig .b { fill: var(--surface); stroke: var(--ink); stroke-width: 1.6; }
.fig .b.sq { stroke-width: 1.4; }
.fig .b.hl { fill: color-mix(in srgb, var(--primary) 18%, var(--surface)); stroke: var(--primary); stroke-width: 2.4; }
.fig .b.em { fill: var(--raised); stroke-dasharray: 4 3; }
.fig .b.dm { fill: var(--soft); stroke-dasharray: 5 3; }
.fig .bar { fill: color-mix(in srgb, var(--primary) 55%, var(--surface)); }
.fig .bar.hl { fill: var(--primary); }
.fig .t { fill: var(--ink); font: 600 14px var(--font-body); }
.fig .t.sm { font-size: 13px; }
.fig .t.hd { font: 700 15px var(--font-display, var(--font-body)); }
.fig .t.mono { font-family: var(--font-mono); font-weight: 600; }
.fig .s { fill: var(--muted); font: 500 12px var(--font-body); }
.fig .s.em { fill: var(--primary); font-weight: 700; }
.fig .a, .fig .e { stroke: var(--ink); stroke-width: 1.6; fill: none; }
.fig .ah { fill: var(--ink); }
.fig .a.hl { stroke: var(--primary); } .fig .a.hlh, .fig .ahl { fill: var(--primary); }
.fig .ring { fill: none; stroke: var(--line); stroke-width: 6; }

/* GPT-built interactive visuals (core/js/ai-visuals.js) */
.ai-widget { margin-top: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; min-width: 0; }
.ai-widget-frame { display: block; width: 100%; height: 320px; border: 0; background: var(--surface); }
.ai-widget-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-top: 1px solid var(--line); font-size: 12px; background: var(--raised); }
.ai-widget-bar .grow { flex: 1; }
.ai-widget-wait { display: flex; align-items: center; gap: 10px; padding: 18px 14px; color: var(--muted); font-size: 14px; flex-wrap: wrap; }
.ai-widget-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--primary); animation: ai-spin .8s linear infinite; flex: none; }
@keyframes ai-spin { to { transform: rotate(360deg); } }
.ai-widget.big { position: fixed; inset: 4vh 4vw; z-index: 2000; margin: 0; display: flex; flex-direction: column; box-shadow: 0 20px 80px rgba(0,0,0,.45); }
.ai-widget.big .ai-widget-frame { flex: 1; height: auto !important; }
body.ai-widget-open::after { content: ""; position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1999; }
.read-widget { margin-top: 4px; }
.read-widget > .eyebrow { margin-bottom: 6px; }
@media (max-width: 360px) { .road-toggle button { padding: 9px 10px; font-size: 14px; } }
