/* Cradlers Ed — 8-bit arcade UI with pro-website polish.
   Pixel type: Press Start 2P (labels, numbers, buttons, kickers).
   Reading type: system sans (lessons, prose, descriptions). */

:root{
  --paper:#FAFBF7; --ink:#0E1512; --ink-2:#55625B; --ink-3:#5E6A62;
  --edge:#0E1512; --shadow:#0E1512; --line:#E2E8E2; --card:#FFFFFF; --card-2:#F2F6F1;
  --brand:#9A34D6; --brand-deep:#6E1C9E; --brand-soft:#F3E6FB; --on-brand:#FFFFFF;
  --coin:#FFC02E; --coin-deep:#8a5e00; --red:#FF5A5F; --amber:#FFB020; --amber-deep:#7a4d00;
  --cyan:#24D0E0; --purple:#8B6CFF; --blue:#3B82F6;
  --font-sans:"Inter Tight",-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;
  --font-pixel:"Press Start 2P","Courier New",monospace;
  --font-mono:ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --maxw:1080px;
}

/* ===================== UNIVERSAL TYPE SYSTEM =====================
   ONE type system for every page, with the arcade look as an opt-in.

   It used to work the other way round: Press Start 2P was the default on 35
   selectors here, and themes.css had to undo it one selector at a time for
   every pack. Twelve of them were never undone anywhere, which is why the
   sign-in screen and the status pills were 8-bit while the page around them
   was not, and why anything added later inherited the pixel font by accident.

   Now --font-ui and --ui-scale carry it. Modern type is the default, so a new
   page is consistent without anybody remembering anything, and the arcade
   pack sets both back to get exactly what it had before.

   The sizes throughout this file are still authored in their pixel-tuned
   numbers and multiplied by --ui-scale, because Press Start 2P sets about
   1.45x wider per character. Keeping the authored numbers means arcade is
   unchanged at scale 1, and tuning the modern look is one number here rather
   than 35 edits.

   Pixel ART is untouched. Byte, the icon sprites and the arcade mini-games
   are canvas drawn by pixel.js, not type, and they render identically under
   every pack. */
:root{
  --font-ui:var(--font-sans);
  --ui-scale:1.45;
}
:root[data-pack="arcade"]{
  --font-ui:var(--font-pixel);
  --ui-scale:1;
}

@media (prefers-color-scheme:dark){
  :root{ --paper:#0A110D; --ink:#EAF3EC; --ink-2:#94A79D; --ink-3:#7E9088;
    --edge:#EAF3EC; --shadow:#000000; --line:#202C25; --card:#0F1813; --card-2:#0C130F;
    --brand:#A040DE; --brand-deep:#D7A6F2; --brand-soft:#241033; --on-brand:#FFFFFF; }
}
:root[data-theme="light"]{ --paper:#FAFBF7; --ink:#0E1512; --ink-2:#55625B; --ink-3:#5E6A62;
  --edge:#0E1512; --shadow:#0E1512; --line:#E2E8E2; --card:#FFFFFF; --card-2:#F2F6F1;
  --brand:#9A34D6; --brand-deep:#6E1C9E; --brand-soft:#F3E6FB; }
:root[data-theme="dark"]{ --paper:#0A110D; --ink:#EAF3EC; --ink-2:#94A79D; --ink-3:#7E9088;
  --edge:#EAF3EC; --shadow:#000000; --line:#202C25; --card:#0F1813; --card-2:#0C130F;
  --brand:#A040DE; --brand-deep:#D7A6F2; --brand-soft:#241033; }

:root{ --focus:#1550c8; }
@media (prefers-color-scheme:dark){ :root{ --focus:#8ab4ff; } }
:root[data-theme="light"]{ --focus:#1550c8; }
:root[data-theme="dark"]{ --focus:#8ab4ff; }

/* ---------- AURORA ----------
   A third real theme, not a filter over dark mode. Since 2026-11-21 it wears
   the logo's colours: violet and lavender light over the night plate
   (#0E0B1E), lavender as the accent, and amber kept for the one thing
   that should stand out — coins, finished ticks and the focus ring — the
   way the logo has a single amber square (#aurorabg, further down; black
   and gold before). Surfaces are held translucent over the night base so
   the aurora reads *through* the page without any text pairing dropping
   below AA.
   Each pack overrides the accent in themes.css; this block is the base (and
   the arcade pack, which has no token block of its own). */
:root[data-theme="aurora"]{
  --paper:#0E0B1E; --ink:#F3EEFF; --ink-2:#CFC4EA; --ink-3:#A397C4;
  --line:#2B2448; --edge:#3B3260; --shadow:transparent;
  --card:rgba(22,17,44,.9); --card-2:rgba(33,26,62,.9);
  --brand:#C79AFF; --brand-deep:#DCC2FF; --brand-soft:#2A1C47; --on-brand:#0E0B1E;
  --coin:#FFB548; --coin-deep:#FFB548; --amber:#33240F; --amber-deep:#FFC978;
  --focus:#FFB548;
}

*{ box-sizing:border-box; margin:0; padding:0; }
html{ scroll-behavior:smooth; }

/* ---------- accessibility ---------- */
.sr-only{ position:absolute!important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
:where(a,button,input,textarea,select,[tabindex]):focus-visible{
  outline:3px solid var(--focus); outline-offset:2px; }
.task-item.clickable:focus-visible,.lesson-link:focus-visible{ outline:3px solid var(--focus); outline-offset:-1px; }
.quiz-opt:focus-within{ outline:3px solid var(--focus); outline-offset:2px; }
#app:focus{ outline:none; }
.skip-link{ position:fixed; left:10px; top:-70px; z-index:200; background:var(--brand); color:var(--on-brand);
  border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow); padding:11px 15px; cursor:pointer;
  font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); text-transform:uppercase; transition:top .14s; }
.skip-link:focus{ top:12px; outline:3px solid var(--focus); outline-offset:2px; }
@media (prefers-reduced-motion:reduce){ html{ scroll-behavior:auto; } }
html{ background:var(--paper); }
body{
  font-family:var(--font-sans); color:var(--ink); background:transparent;
  line-height:1.6; -webkit-font-smoothing:antialiased; overflow-x:hidden;
}
a{ color:inherit; text-decoration:none; }
canvas{ image-rendering:pixelated; display:block; }
.spr{ display:inline-flex; line-height:0; }
.icon-inline{ vertical-align:-4px; margin-right:8px; }
.card .icon-lg .spr,.seal .spr{ display:inline-block; }

/* pixel type helper */
.px,.section-label,.kicker,.pill,.badge,.btn,.brand-name,.role,.soon-tag,
.tier-node,.task-node,.hint-num,.status-pill{
  font-family:var(--font-ui); font-weight:400; letter-spacing:.5px;
}
h1,h2,h3,h4{ font-family:var(--font-sans); font-weight:900; letter-spacing:-.5px; text-wrap:balance; }

/* ---------- chunky panel + button primitives ---------- */
.card,.panel,.certificate{
  background:var(--card); border:3px solid var(--edge); border-radius:0;
  box-shadow:6px 6px 0 var(--shadow); transition:transform .14s cubic-bezier(.2,.7,.3,1), box-shadow .14s cubic-bezier(.2,.7,.3,1);
}
a.card:hover,.card.hoverable:hover{ transform:translate(-3px,-3px); box-shadow:9px 9px 0 var(--shadow); }
.card.dim{ opacity:.6; box-shadow:none; }

.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-size:11px; text-transform:uppercase; line-height:1.4; cursor:pointer;
  color:var(--ink); background:var(--card); border:3px solid var(--edge); border-radius:0;
  box-shadow:4px 4px 0 var(--shadow); padding:12px 16px; transition:transform .1s, box-shadow .1s;
}
.btn:hover{ filter:brightness(1.03); }
.btn:active{ transform:translate(4px,4px); box-shadow:0 0 0 var(--shadow); }
.btn:disabled{ opacity:.5; cursor:not-allowed; box-shadow:4px 4px 0 var(--shadow); transform:none; }
.btn-primary{ background:var(--brand); color:var(--on-brand); }
.btn-ghost{ background:var(--card); }
.btn-sm{ font-size:9px; padding:9px 12px; box-shadow:3px 3px 0 var(--shadow); }

/* ---------- auth: login / register ----------
   Split layout — brand story on the left, the form on the right — used only
   by these two routes, so .field and its friends are scoped here rather than
   made a site-wide primitive. Below 900px the brand panel drops out entirely
   rather than stacking above the form, which would push the fields below
   the fold on a phone. */
.split-layout{ display:flex; min-height:calc(100vh - 66px); background:var(--paper); }
.auth-brand{
  width:440px; flex:none; background:var(--brand-deep); color:#fff;
  position:relative; overflow:hidden; box-sizing:border-box;
  padding:48px; display:flex; flex-direction:column; justify-content:space-between;
  border-right:3px solid var(--edge);
}
.auth-brand::before{ content:""; position:absolute; top:110px; right:-40px; width:120px; height:120px;
  background:rgba(255,255,255,.08); transform:rotate(12deg); }
.auth-brand::after{ content:""; position:absolute; bottom:200px; left:-30px; width:90px; height:90px;
  background:rgba(255,255,255,.06); transform:rotate(-8deg); }
.auth-brand-top{ display:flex; align-items:center; gap:10px; position:relative; }
.auth-brand-top img{ width:36px; height:36px; display:block; border-radius:9px; }
.auth-brand-top span{ font-weight:800; font-size:18px; }
.auth-brand-top em{ font-style:normal; color:var(--coin); }
.auth-kicker{ font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); letter-spacing:.5px; text-transform:uppercase;
  color:rgba(255,255,255,.65); margin-bottom:16px; }
.auth-brand h1{ margin:0 0 14px; font-size:32px; line-height:1.2; color:#fff; }
.auth-brand p{ margin:0; font-size:15px; line-height:1.6; color:rgba(255,255,255,.8); max-width:340px; }
.auth-stats{ display:flex; gap:10px; position:relative; }
.auth-stat{ flex:1; background:rgba(255,255,255,.08); border:2px solid rgba(255,255,255,.25); padding:12px 14px; }
.auth-stat b{ display:block; font-size:20px; }
.auth-stat span{ display:block; font-size:11px; color:rgba(255,255,255,.65); margin-top:2px; }
.auth-form-col{ flex:1; display:flex; flex-direction:column; padding:32px 40px; box-sizing:border-box; }
.auth-back{ font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); letter-spacing:.5px; text-transform:uppercase;
  color:var(--ink-2); text-decoration:none; }
.auth-back:hover{ color:var(--ink); }
.split-main{ flex:1; display:flex; align-items:center; justify-content:center; }
.split-main .auth-inner{ width:100%; }
.auth-eyebrow{ font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); letter-spacing:.5px; text-transform:uppercase;
  color:var(--brand-deep); margin-bottom:10px; }
.auth-sub{ margin:0 0 28px; font-size:15px; color:var(--ink-2); }

.field{ margin-bottom:18px; }
.field label{ display:block; font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); letter-spacing:.5px;
  text-transform:uppercase; color:var(--ink); margin-bottom:8px; }
.field input[type="text"],.field input[type="email"],.field input[type="password"],
.field input[type="date"],.field select{
  width:100%; box-sizing:border-box; padding:13px 14px; font-size:15px; font-family:var(--font-sans);
  color:var(--ink); background:var(--card); border:3px solid var(--edge); border-radius:0; outline:none;
}
.field input:focus-visible,.field select:focus-visible{ box-shadow:0 0 0 3px var(--brand-soft); border-color:var(--brand); }
.field input:disabled{ color:var(--ink-3); background:var(--card-2); }
.field-row{ display:flex; gap:16px; }
.field-row .field{ flex:1; min-width:0; }
.field-help{ font-size:12.5px; color:var(--ink-3); margin-top:7px; }
.field-hint{ display:inline-flex; align-items:center; gap:5px; font-size:12px; font-weight:700; }
.field-hint.ok{ color:#1F8A4C; }
.field-hint.bad{ color:var(--red); }
/* :not([hidden]) rather than a bare display rule — this stylesheet has no
   global [hidden]{display:none}, so a plain display:flex here would win over
   the hidden attribute the same way .hdr-wallet's does. */
.field-err{ display:none; align-items:center; gap:6px; color:var(--red); font-size:12.5px; font-weight:600; margin-top:7px; }
.field-err:not([hidden]){ display:flex; }

.pw-field{ display:flex; border:3px solid var(--edge); background:var(--card); }
.pw-field.is-err{ border-color:var(--red); background:rgba(255,90,95,.06); }
.pw-field input{ border:0 !important; flex:1; background:transparent !important; }
.pw-field .eye-btn{ display:grid; place-items:center; width:44px; flex:none; padding:0; margin:0;
  background:transparent; border:0; border-left:3px solid var(--edge); color:var(--ink-2); cursor:pointer; }
.pw-field .eye-btn:hover{ color:var(--ink); background:var(--card-2); }
.pw-field .eye-btn:focus-visible{ outline:3px solid var(--brand); outline-offset:-3px; }
.pw-field .eye-btn svg{ width:17px; height:17px; display:block; fill:none; stroke:currentColor;
  stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.auth-disclosure{
  display:flex; align-items:center; gap:8px; width:100%; box-sizing:border-box;
  background:var(--card-2); border:3px dashed var(--line); padding:14px 16px;
  font-family:var(--font-sans); font-size:14px; font-weight:700; color:var(--ink);
  cursor:pointer; text-align:left; margin:4px 0 20px;
}
.auth-disclosure:hover{ border-color:var(--brand); color:var(--brand-deep); }
.auth-disclosure svg{ width:14px; height:14px; flex:none; transition:transform .12s; }
.auth-disclosure[aria-expanded="true"] svg{ transform:rotate(90deg); }
.auth-optional{ border:3px solid var(--line); padding:20px; margin-bottom:4px; }
.auth-optional-kicker{ font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); letter-spacing:.5px;
  text-transform:uppercase; color:var(--ink-3); margin-bottom:16px; }

.chk-row{ display:flex; align-items:center; gap:8px; }
.chk-row input[type="checkbox"]{ width:18px; height:18px; accent-color:var(--brand); }
.chk-row label{ font-size:14px; color:var(--ink-2); }

@media (max-width:900px){
  .auth-brand{ display:none; }
  .auth-form-col{ padding:28px 22px; }
}

/* Register: one form, student or professor picked at the top */
.auth-inner--wide{ max-width:480px; margin:0 auto; }

.auth-role-pick{ border:0; padding:0; margin:0 0 20px; min-width:0; }
.auth-role-pick legend{ padding:0; margin-bottom:10px; font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale));
  letter-spacing:.5px; text-transform:uppercase; color:var(--ink); }
.auth-role-pick legend .req{ color:var(--red); margin-left:2px; font-weight:800; }
.auth-role-pick .field-err{ margin-top:10px; }
.auth-role-opts{ display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:420px){ .auth-role-opts{ grid-template-columns:1fr; } }
/* The radio stays in the page (focusable, arrow keys move between the two)
   but invisible; the card shows its state. */
.auth-role-opt{
  position:relative; display:flex; align-items:center; gap:12px; padding:14px; cursor:pointer;
  background:var(--card); border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow);
  transition:transform .12s, box-shadow .12s, border-color .12s;
}
.auth-role-opt:hover{ border-color:var(--brand); }
.auth-role-opt input{ position:absolute; opacity:0; width:1px; height:1px; margin:0; pointer-events:none; }
.auth-role-opt:has(input:focus-visible){ outline:3px solid var(--brand); outline-offset:3px; }
.auth-role-opt:has(input:checked){
  border-color:var(--brand); background:var(--brand-soft);
  transform:translate(2px,2px); box-shadow:2px 2px 0 var(--shadow);
}
.auth-role-ic{
  width:38px; height:38px; flex:none; display:grid; place-items:center;
  border:2px solid var(--line); background:var(--card-2); color:var(--brand-deep);
}
.auth-role-ic svg{ width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.7; }
.auth-role-txt{ display:flex; flex-direction:column; gap:3px; min-width:0; }
.auth-role-txt b{ font-size:15px; line-height:1.2; color:var(--ink); }
.auth-role-txt small{ font-size:12.5px; line-height:1.4; color:var(--ink-2); }

.auth-form-card{
  background:var(--card); border:3px solid var(--edge); padding:26px 24px 22px;
  box-shadow:8px 8px 0 var(--shadow); margin-bottom:8px;
}
.auth-form-card .field:last-of-type{ margin-bottom:0; }
.auth-form-note{
  font-size:13px; line-height:1.55; color:var(--ink-2); margin:0 0 20px; padding:12px 14px;
  border-left:4px solid var(--brand); background:var(--card-2);
}
.field label .req{ color:var(--red); margin-left:2px; font-weight:800; }

/* ---------- top bar ---------- */
.topbar{
  position:sticky; top:0; z-index:50; display:flex; align-items:center; gap:18px;
  padding:0 26px; height:66px; background:color-mix(in srgb,var(--paper) 90%,transparent);
  backdrop-filter:blur(8px); border-bottom:3px solid var(--edge);
}
.brand{ display:flex; align-items:center; gap:11px; }
/* The logo keeps its own night plate (logo-mark.svg): the squares are drawn
   for that dark ground, so the plate reads correctly in every theme. */
.brand-logo{ width:34px; height:34px; display:block; border-radius:9px;
  box-shadow:3px 3px 0 var(--shadow); }
.brand-name{ font-size:15px; }
.brand-name em{ font-style:normal; color:var(--brand); }
.topnav{ display:flex; gap:6px; margin-left:8px; }
.topbar .spacer{ flex:1; }
.topnav a{ font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); text-transform:uppercase;
  padding:9px 12px; color:var(--ink-2); border:3px solid transparent; }
.topnav a:hover{ color:var(--ink); }
.topnav a.active{ color:var(--ink); border-color:var(--edge); background:var(--card-2); }

.hdr-role{
  font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); letter-spacing:.45px;
  text-transform:uppercase; font-weight:800; padding:8px 11px; border:2px solid var(--line);
  background:var(--card-2); color:var(--ink-2); white-space:nowrap;
}
.hdr-role.is-prof{ border-color:color-mix(in srgb,var(--brand) 45%,var(--edge)); background:var(--brand-soft); color:var(--brand-deep); }
/* Phones (2026-11-14): a signed-in header squeezed the theme switch to 2px
   wide and pushed its buttons past the right edge, so every page scrolled
   sideways. The account-type pill gives way first, and the switch never
   shrinks. */
@media (max-width:520px){
  .topbar{ gap:8px; padding:0 14px; }
  .hdr-role{ display:none !important; }
  .theme-seg{ flex:none; }
}
/* The smallest phones: "Log out" keeps its icon and its accessible name. */
@media (max-width:400px){
  .topbar{ gap:6px; padding:0 10px; }
  .hdr-logout > span{ position:absolute; width:1px; height:1px; overflow:hidden;
    clip:rect(0 0 0 0); white-space:nowrap; }
  .theme-seg button{ width:28px; }
}

/* ---------- header wallet: coins + total XP ----------
   Both are single per-learner totals, so they belong in the global chrome.
   The per-LEVEL XP band stays inside the course, where it gates promotion.

   :not([hidden]) rather than a bare display rule: this stylesheet has no
   global [hidden]{display:none}, so a plain display:flex here would win
   over the hidden attribute set in index.html and by app.js's
   setLoggedInChrome() — which is exactly why the wallet used to show
   "0 coins / 0 XP" on the login page before a session existed. */
.hdr-wallet{ display:none; align-items:center; gap:8px; }
.hdr-wallet:not([hidden]){ display:flex; }
.hdr-stat{
  display:inline-flex; align-items:center; gap:6px; white-space:nowrap;
  font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); line-height:1;
  padding:8px 10px; color:var(--ink);
  background:var(--card); border:3px solid var(--edge);
  box-shadow:3px 3px 0 var(--shadow);
}
.hdr-stat b{ font-weight:400; font-variant-numeric:tabular-nums; }
/* Coin and XP marks (curIcon in app.js): the same line icon on every page,
   sized to the text it sits in, never smaller than 12px. */
.cur-ic{
  display:inline-block; flex:none; width:max(1em, 12px); height:max(1em, 12px);
  vertical-align:-.15em; overflow:visible;
}
.hdr-stat-ic{ display:inline-flex; line-height:1; }
.hdr-stat-ic .cur-ic{ width:14px; height:14px; }
#hdr-coins b, #hdr-coins .hdr-stat-ic{ color:var(--coin-deep); }
#hdr-xp b, #hdr-xp .hdr-stat-ic{ color:var(--brand-deep); }
.hdr-stat-u{ color:var(--ink-3); }
/* A total that just changed should be noticed once, not pulse forever. */
.hdr-stat.bumped{ animation:hdr-bump .5s cubic-bezier(.2,.7,.3,1); }
@keyframes hdr-bump{
  0%{ transform:none; } 35%{ transform:translateY(-3px) scale(1.06); } 100%{ transform:none; }
}

/* ---------- header logout button ----------
   Uses :not([hidden]) rather than a bare .hdr-logout{display:...} rule
   because this stylesheet has no [hidden]{display:none} of its own — the
   UA default loses to any same-specificity class rule that runs after it,
   which is exactly what makes .hdr-wallet ignore its `hidden` attribute
   today. Scoping display to :not([hidden]) sidesteps that without touching
   the wallet's existing (separately broken) behaviour. */
.hdr-logout{ display:none; }
.hdr-logout:not([hidden]){
  display:inline-flex; align-items:center; gap:6px; margin-left:8px;
  padding:8px 10px; cursor:pointer;
  font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); text-transform:uppercase;
  color:var(--ink); background:var(--card); border:3px solid var(--edge);
  box-shadow:3px 3px 0 var(--shadow);
}
.hdr-logout:hover{ color:var(--on-brand); background:var(--brand); border-color:var(--brand); }
.hdr-logout svg{
  width:15px; height:15px; display:block;
  fill:none; stroke:currentColor; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round;
}

/* ---------- theme: light / dark / aurora ----------
   Three real modes, so a two-state toggle can't express it. A segmented group
   also means any mode is one click away instead of up to two. */
.theme-seg{ display:inline-flex; margin-left:2px; border:3px solid var(--edge);
  box-shadow:3px 3px 0 var(--shadow); background:var(--card); }
.theme-seg button{
  display:grid; place-items:center; width:34px; height:34px; padding:0;
  font-size:calc(13px * var(--ui-scale)); line-height:1; cursor:pointer; color:var(--ink-3);
  background:transparent; border:0; border-left:2px solid var(--line);
  font-family:var(--font-ui);
}
.theme-seg button:first-child{ border-left:0; }
.theme-seg button:hover{ color:var(--ink); background:var(--card-2); }
.theme-seg button[aria-pressed="true"]{ background:var(--brand); color:var(--on-brand); }
.theme-seg svg{
  width:17px; height:17px; display:block;
  fill:none; stroke:currentColor; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round;
}
/* The sun's disc is the one filled shape — an outlined circle reads as a
   hollow ring next to the solid crescent. */
.theme-seg svg circle{ fill:currentColor; stroke:none; }
.theme-seg button[data-theme-set="dark"] svg path{ fill:currentColor; stroke:none; }

/* ---------- India news ticker ----------
   Sits above the header, full width. Headlines scroll; hovering, focusing or
   the pause button stops them, because a link that moves is a link you can't
   click. Honours prefers-reduced-motion by not moving at all. */
/* Uses the page's own surface tokens rather than inverting to var(--ink):
   an inverted strip turns into a glaring white band at the top of the dark
   theme, and the token colours here are already contrast-checked. */
.newsbar{
  position:relative; z-index:60; display:flex; align-items:center; gap:0;
  height:34px; background:var(--card-2); color:var(--ink);
  border-bottom:3px solid var(--edge); overflow:hidden;
}
.newsbar-tag{
  flex:none; align-self:stretch; display:flex; align-items:center;
  padding:0 12px; font-size:8px; letter-spacing:.5px;
  background:var(--brand); color:var(--on-brand);
}
.newsbar-window{ flex:1; overflow:hidden; -webkit-mask-image:linear-gradient(
  to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image:linear-gradient(to right, transparent, #000 28px,
    #000 calc(100% - 28px), transparent); }
.newsbar-track{
  display:flex; width:max-content;
  animation:news-scroll var(--news-duration,60s) linear infinite;
}
.newsbar-seq{ display:flex; align-items:center; flex:none; }
.newsbar.hovered .newsbar-track,
.newsbar.paused .newsbar-track{ animation-play-state:paused; }
@keyframes news-scroll{ from{ transform:translateX(0); }
                        to{ transform:translateX(-50%); } }
.newsbar-item{ display:inline-flex; align-items:baseline; gap:9px;
  padding:0 16px; white-space:nowrap; color:var(--ink); }
.newsbar-item:hover .newsbar-hl{ text-decoration:underline; }
/* Attribution has to stay legible — it is the part that tells the reader whose
   headline this is. --ink-2 is contrast-checked against the page surface. */
.newsbar-src{ font-family:var(--font-ui); font-size:calc(7px * var(--ui-scale)); letter-spacing:.4px;
  color:var(--ink-2); text-transform:uppercase; flex:none; }
/* Deliberate exception to the arcade pack's universal pixel font: these are
   long prose headlines that MOVE, and Press Start 2P sets ~1.6x wider, which
   makes them genuinely hard to scan in a ticker. The pixel face is kept for
   the short chrome (the INDIA tag and the source label). */
.newsbar-hl{ font-size:13px; font-family:var(--font-warm,system-ui),
  system-ui,-apple-system,"Segoe UI",sans-serif; letter-spacing:0; }
.newsbar-dot{ opacity:.35; flex:none; }
.newsbar-pause{ flex:none; align-self:stretch; width:34px; border:0;
  border-left:2px solid var(--line); background:transparent; color:var(--ink-2);
  font-size:9px; cursor:pointer; }
.newsbar-pause:hover{ background:var(--card); color:var(--ink); }
@media (prefers-reduced-motion: reduce){
  .newsbar-track{ animation:none; }
  .newsbar-window{ overflow-x:auto; }
}
@media (max-width:700px){
  .newsbar-tag{ display:none; }
  .newsbar-hl{ font-size:12px; }
}

/* ---------- layout ---------- */
.page{ max-width:var(--maxw); margin:0 auto; padding:34px 24px 84px; min-height:70vh; }
.footer{ border-top:3px solid var(--edge); padding:24px; text-align:center;
  color:var(--ink-3); font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); line-height:2; }
/* Breadcrumbs are a real <ol> so a screen reader announces the depth; the
   separator is drawn in CSS so it is never read out as content. */
.crumbs{ font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); text-transform:uppercase;
  color:var(--ink-3); margin-bottom:18px; letter-spacing:.5px; }
.crumbs ol{ display:flex; flex-wrap:wrap; align-items:center; gap:8px;
  list-style:none; margin:0; padding:0; }
.crumbs li{ display:flex; align-items:center; gap:8px; min-width:0; }
.crumbs li + li::before{ content:"/"; color:var(--ink-3); opacity:.6; }
.crumbs a{ color:var(--ink-2); }
.crumbs a:hover{ color:var(--brand-deep); text-decoration:underline; }
/* The leaf is where you are: it should read as the strongest item, and it
   must never look clickable. */
.crumbs [aria-current="page"]{ color:var(--ink); max-width:46ch;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.skeleton{ color:var(--ink-3); padding:70px 0; text-align:center; font-family:var(--font-ui); font-size:calc(12px * var(--ui-scale)); line-height:2; }

/* ---------- course tabs ----------
   Path · Competencies · Achievements · Glossary. Everything that is a report
   on what you've already done lives off the path, so the path itself is only
   the next thing to do. */
.course-hero{ padding:10px 0 22px; }
/* Sub-tabs keep the course's name for orientation and nothing else — the
   pitch is the path tab's job. */
.course-head-slim{ margin:0 0 18px; }
.course-head-slim h1{ font-size:clamp(22px,3vw,30px); }
.course-tabs{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 26px;
  border-bottom:3px solid var(--edge); padding-bottom:0; }
.course-tab{
  font-family:var(--font-ui); font-size:calc(9.5px * var(--ui-scale)); text-transform:uppercase;
  letter-spacing:.5px; padding:12px 15px; color:var(--ink-2);
  border:3px solid transparent; border-bottom:0; margin-bottom:-3px;
}
.course-tab:hover{ color:var(--ink); background:var(--card-2); }
.course-tab.active{
  color:var(--ink); background:var(--card);
  border-color:var(--edge); border-bottom:3px solid var(--card);
}
.tab-intro{ margin:0 0 22px; max-width:680px; }
.tab-intro h2{ display:flex; align-items:center; flex-wrap:wrap; gap:10px;
  font-size:24px; margin-bottom:8px; }
.tab-intro p{ color:var(--ink-2); font-size:15px; }

/* ---------- hero ---------- */
.hero{ text-align:center; padding:40px 0 44px; position:relative; }
.hero .byte-hero{ display:flex; justify-content:center; margin-bottom:12px; }
.hero h1{ font-size:clamp(30px,5.4vw,52px); line-height:1.22; }
.hero h1 .accent{ color:var(--brand); text-shadow:3px 3px 0 var(--edge); }
.hero p{ max-width:640px; margin:18px auto 0; font-size:18px; color:var(--ink-2); }
.hero-badges{ display:flex; gap:10px; justify-content:center; margin-top:24px; flex-wrap:wrap; }
.badge{ font-size:9px; text-transform:uppercase; padding:8px 11px; background:var(--card);
  border:2px solid var(--edge); color:var(--ink-2); }
.badge.green{ background:var(--brand); color:var(--on-brand); border-color:var(--edge); }

/* ---------- foe strip ---------- */
.foe-strip{ display:flex; gap:12px; flex-wrap:wrap; }
.foe-chip{ display:flex; flex-direction:column; align-items:center; gap:8px; padding:14px 16px;
  background:var(--card); border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow); min-width:92px;
  transition:transform .12s, box-shadow .12s; }
.foe-chip:hover{ transform:translate(-2px,-2px); box-shadow:6px 6px 0 var(--shadow); }
.foe-nm{ font-size:8px; text-transform:uppercase; color:var(--ink-2); }

/* ---------- tier header ---------- */
.tier-head{ display:flex; gap:16px; align-items:flex-start; }
.tier-byte{ flex-shrink:0; margin-top:4px; }

/* ---------- section labels ---------- */
.section-label,.ladder-label{ font-size:11px; text-transform:uppercase; color:var(--ink-2);
  margin:34px 0 16px; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.ladder-label{ color:var(--ink); }
.ladder-label::before{ content:""; width:8px; height:20px; background:var(--brand); }
.doc-head{ margin-bottom:8px; }
.doc-head .kicker,.kicker{ font-size:10px; text-transform:uppercase; color:var(--brand-deep);
  margin-bottom:12px; display:block; letter-spacing:.5px; }
.doc-head h1{ font-size:clamp(24px,3.6vw,34px); }

/* ---------- grids & cards ---------- */
.grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:22px; }
.card{ padding:22px; }
.card .icon-lg{ font-size:38px; line-height:1; }
.card h3{ font-size:20px; margin:12px 0 6px; }
.card h4{ font-size:16px; }
.card p{ color:var(--ink-2); font-size:14.5px; }
.card .meta{ margin-top:14px; display:flex; gap:12px 16px; flex-wrap:wrap;
  font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); line-height:1.8; }
.soon-tag{ font-size:8px; text-transform:uppercase; background:var(--amber); color:var(--amber-deep);
  border:2px solid var(--edge); padding:5px 8px; }

/* ---------- pills ---------- */
.pill{ font-size:8px; text-transform:uppercase; padding:5px 8px; border:2px solid var(--edge);
  display:inline-block; line-height:1.4; }
.pill.green{ background:var(--brand); color:var(--on-brand); }
.pill.amber{ background:var(--amber); color:var(--amber-deep); }
.pill.blue{ background:var(--blue); color:#04204a; }
.pill.red{ background:var(--red); color:#3a0c0d; }
.lock{ font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); text-transform:uppercase; }

/* ---------- tier path ---------- */
.tier-path{ margin-top:8px; }
.tier-row{ display:flex; gap:22px; padding-bottom:28px; }
.tier-rail{ display:flex; flex-direction:column; align-items:center; width:58px; flex-shrink:0; }
.tier-node{ width:54px; height:54px; border:3px solid var(--edge); background:var(--card-2);
  color:var(--ink-3); display:grid; place-items:center; font-size:16px; box-shadow:3px 3px 0 var(--shadow); }
.tier-node.done{ background:var(--brand); color:var(--on-brand); }
.tier-node.open{ background:var(--card); color:var(--brand-deep); }
.tier-rail .rail{ flex:1; width:6px; background:var(--line); margin-top:6px; }
.tier-rail .rail.done{ background:var(--brand); }
.tier-row .card,.tier-row .card.dim{ flex:1; }
.role{ font-size:8px; text-transform:uppercase; color:var(--ink-3); }
.tier-row h3{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:8px 0 6px; }
.progressbar{ height:14px; border:2px solid var(--edge); background:var(--line); margin-top:14px; overflow:hidden; }
.progressbar>div{ height:100%; background:repeating-linear-gradient(90deg,var(--brand) 0 12px,var(--brand-deep) 12px 14px); transition:width .35s; }
.tier-stats{ display:flex; gap:10px 14px; margin-top:12px; flex-wrap:wrap;
  font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); line-height:1.9; }

/* ---------- module cards / lessons ---------- */
.module-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:18px; }
.module-card{ display:flex; flex-direction:column; padding:20px; }
.module-card.cleared{ border-color:var(--brand); }
.mod-top{ display:flex; justify-content:space-between; align-items:flex-start; }
.module-card h4{ font-size:16px; margin:12px 0 4px; }
.lesson-list{ margin:12px 0; display:flex; flex-direction:column; gap:5px; flex:1; }
.lesson-link{ display:flex; align-items:center; gap:10px; padding:9px 10px; font-size:14px; font-weight:700;
  color:var(--ink-2); border:2px solid transparent; }
.lesson-link:hover{ background:var(--card-2); color:var(--ink); border-color:var(--line); }
.lesson-check{ width:20px; height:20px; border:2px solid var(--edge); background:var(--card);
  display:grid; place-items:center; font-size:11px; color:var(--on-brand); flex-shrink:0; }
.lesson-check.done{ background:var(--brand); }
.quiz-btn{ align-self:flex-start; margin-top:6px; }
/* .quiz-btn is align-self:flex-start inside a flex COLUMN, so a second control
   beside it needs its own row wrapper or it stacks. */
.mod-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:6px; }
.mod-actions .quiz-btn{ margin-top:0; }
.mod-recap-locked{ font-size:8px; color:var(--ink-3); border:2px dashed var(--line);
  padding:8px 10px; }
.mod-game{ display:flex; align-items:center; gap:9px; margin:2px 0 10px; padding:8px 10px;
  border:2px solid var(--brand); background:var(--brand-soft); }
.mod-game-tag{ font-size:7px; color:var(--on-brand); background:var(--brand); border:2px solid var(--edge); padding:4px 6px; flex-shrink:0; }
.mod-game-nm{ font-size:13px; font-weight:800; color:var(--brand-deep); }

/* ---------- task ladder ---------- */
.task-list{ display:flex; flex-direction:column; }
.task-item{ display:flex; align-items:center; gap:15px; padding:14px 12px; border:3px solid transparent; }
.task-item + .task-item{ border-top:2px solid var(--line); }
.task-item.clickable:hover{ background:var(--card-2); border-color:var(--edge); }
.task-item.locked,.task-item.pending{ opacity:.55; }
.task-item.pending .task-node{ border-style:dashed; }
.task-node{ width:44px; height:44px; border:3px solid var(--edge); background:var(--card-2);
  color:var(--ink-3); display:grid; place-items:center; font-size:13px; flex-shrink:0; box-shadow:3px 3px 0 var(--shadow); }
.task-node.done{ background:var(--brand); color:var(--on-brand); }
.task-node.open{ background:var(--card); color:var(--brand-deep); }
.task-node.final{ color:var(--purple); font-size:18px; }
.task-node.final.done{ background:var(--purple); color:#fff; }
.task-info{ flex:1; }
.t-title{ font-weight:800; font-size:15.5px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.t-sub{ font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); margin-top:6px; line-height:1.8; }
.dots{ color:var(--amber); letter-spacing:2px; }
.difficulty{ color:var(--amber); letter-spacing:3px; }
.ai-note{ margin:14px 0; padding:14px 18px; border:3px solid var(--edge); background:var(--brand-soft);
  box-shadow:4px 4px 0 var(--shadow); font-size:13.5px; font-weight:700; color:var(--ink);
  display:flex; gap:14px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.ai-note .btn{ flex-shrink:0; }

/* ---------- wallet / coin bar ---------- */
.wallet{ display:flex; align-items:center; gap:14px; padding:16px 20px; margin:18px 0;
  background:var(--card); border:3px solid var(--edge); box-shadow:6px 6px 0 var(--shadow); }
.wallet .coin{ font-size:24px; }
.wallet b{ font-family:var(--font-ui); font-size:calc(18px * var(--ui-scale)); }
.wallet .wsub{ font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); line-height:1.9; display:block; margin-top:4px; }
.wallet .spacer{ flex:1; }

/* ---------- doc / prose (readable) ---------- */
.doc{ max-width:780px; margin:0 auto; background:color-mix(in srgb,var(--paper) 94%,transparent);
  border:3px solid var(--edge); box-shadow:8px 8px 0 var(--shadow); padding:28px 32px; }
.doc .crumbs{ margin-bottom:16px; }
.doc-nav{ display:flex; justify-content:space-between; gap:12px; margin-top:36px; }
.prose{ margin-top:20px; font-size:16.5px; color:var(--ink); }
.prose h2{ font-size:22px; margin:26px 0 10px; }
.prose h3{ font-size:18px; margin:22px 0 8px; }
.prose p{ margin:12px 0; color:var(--ink); }
.prose ul,.prose ol{ margin:12px 0 12px 26px; }
.prose li{ margin:6px 0; }
.prose code{ background:var(--card-2); border:2px solid var(--line); padding:1px 6px; font-family:var(--font-mono); font-size:87%; }
.prose pre{ background:#1A0A24; color:#E9C2FF; padding:16px 18px; border:3px solid var(--edge);
  overflow-x:auto; margin:14px 0; font-size:13px; line-height:1.6; box-shadow:4px 4px 0 var(--shadow); }
.prose pre code{ background:none; border:none; padding:0; color:inherit; }
.prose table{ border-collapse:collapse; width:100%; margin:14px 0; font-size:14px; }
.prose th,.prose td{ border:2px solid var(--line); padding:9px 12px; text-align:left; }
.prose th{ background:var(--card-2); font-weight:800; }
.prose blockquote{ border-left:6px solid var(--brand); background:var(--brand-soft); padding:12px 18px; margin:14px 0; }
.prose blockquote p{ margin:0; }

/* ---------- Byte callout (in-lesson speech bubble) ---------- */
.byte-callout{ display:flex; gap:14px; align-items:flex-start; margin:18px 0;
  padding:14px 16px; background:var(--brand-soft); border:3px solid var(--edge);
  box-shadow:5px 5px 0 var(--shadow); border-radius:0; }
.byte-callout-avatar{ flex-shrink:0; }
.byte-callout-body{ font-size:15.5px; color:var(--ink); line-height:1.55; }
.byte-callout-body strong{ color:var(--brand-deep); }

/* ---------- interactive Byte's Checkpoint ---------- */
.checkpoint{ margin:26px 0; padding:20px 22px; background:var(--card);
  border:3px solid var(--brand); box-shadow:6px 6px 0 var(--shadow); border-radius:0; }
.cp-head{ display:flex; gap:14px; align-items:center; margin-bottom:14px; }
.cp-head .spr{ flex-shrink:0; }
.cp-label{ font-size:10px; text-transform:uppercase; color:var(--brand-deep); margin-bottom:6px; }
.cp-q{ font-size:16.5px; font-weight:800; color:var(--ink); }
.cp-options{ display:flex; flex-direction:column; gap:9px; }
.cp-opt{ text-align:left; font-family:var(--font-sans); font-size:15px; font-weight:700;
  color:var(--ink); background:var(--card-2); border:2px solid var(--edge); border-radius:0;
  padding:12px 14px; cursor:pointer; transition:background .12s, transform .05s; }
.cp-opt:hover:not(:disabled){ background:var(--brand-soft); }
.cp-opt:active:not(:disabled){ transform:translateY(1px); }
.cp-opt:disabled{ cursor:default; }
.cp-opt.correct-opt{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand-deep); }
.cp-opt.wrong-opt{ background:#fdeaea; border-color:var(--red); color:var(--red); }
.cp-feedback{ margin-top:14px; padding:12px 14px; border:2px solid var(--edge); font-size:14.5px; line-height:1.5; }
.cp-feedback.ok{ background:var(--brand-soft); color:var(--ink); }
.cp-feedback.bad{ background:var(--amber); color:var(--amber-deep); }
:root[data-theme="dark"] .cp-opt.wrong-opt{ background:#3a1414; }
@media (prefers-color-scheme:dark){ .cp-opt.wrong-opt{ background:#3a1414; } }

/* ---------- panels (task / quiz) ---------- */
.panel{ padding:22px 24px; margin:18px 0; }
.panel h4{ font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); text-transform:uppercase; color:var(--ink-2); margin-bottom:12px; }
.panel.scenario{ background:var(--card-2); }

/* ---------- quiz ---------- */
.quiz-q h4{ font-family:var(--font-ui); font-size:calc(9px * var(--ui-scale)); color:var(--ink-3); }
.quiz-opt{ display:flex; align-items:center; gap:12px; padding:12px 14px; border:2px solid var(--edge);
  margin-bottom:8px; cursor:pointer; font-size:15px; background:var(--card); transition:background .12s; }
.quiz-opt:hover{ background:var(--card-2); }
.quiz-opt input{ width:18px; height:18px; accent-color:var(--brand); }
.quiz-opt.correct-opt{ background:var(--brand-soft); border-color:var(--brand); }
.quiz-feedback{ margin-top:12px; padding:12px 14px; font-weight:700; font-size:14.5px; border:2px solid var(--edge); }
.quiz-feedback.ok{ background:var(--brand-soft); color:var(--brand-deep); }
.quiz-feedback.bad{ background:#fdeaea; color:var(--red); }
.quiz-result{ padding:14px 18px; font-weight:800; margin-bottom:14px; border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow); }
.quiz-result.pass{ background:var(--brand-soft); color:var(--brand-deep); }
.quiz-result.fail{ background:var(--amber); color:var(--amber-deep); }

/* ---------- task layout: main column + hint sidebar ---------- */
.task-layout{ display:flex; gap:22px; align-items:flex-start; max-width:1060px; margin:0 auto; }
.task-main{ flex:1; min-width:0; margin:0; }
.task-side{ width:236px; flex-shrink:0; position:sticky; top:88px; }
@media (max-width:900px){
  .task-layout{ flex-direction:column; }
  .task-side{ width:100%; position:static; }
}

/* ---------- hints (sidebar) ---------- */
.hint-card{ background:var(--card); border:3px solid var(--edge); box-shadow:6px 6px 0 var(--shadow); padding:16px; }
.hint-card-t{ font-size:10px; color:var(--brand-deep); margin-bottom:10px; }
.hint-wallet{ font-size:7px; color:var(--ink-3); line-height:1.9; margin-bottom:12px; }
.hint-list{ display:flex; flex-direction:column; gap:8px; margin-bottom:12px; }
.hint-slot{ display:flex; align-items:center; gap:10px; }
.hint-n{ width:26px; height:26px; flex-shrink:0; display:grid; place-items:center; font-size:9px;
  background:var(--card-2); border:2px solid var(--edge); color:var(--ink-3); }
.hint-slot.owned .hint-n{ background:var(--brand); color:var(--on-brand); border-color:var(--brand); }
/* The stage name (Memory / Direction / Clue / Reasoning / Teacher) sits between
   the number and the button, so the ladder reads as a ladder. */
.hint-lvl-nm{ flex:1; font-size:7px; color:var(--ink-3); }
.hint-slot.owned .hint-lvl-nm{ color:var(--brand-deep); }
.hint-slot .btn{ flex:0 0 76px; font-size:8px; }
.hint-slot .hint-locked{ flex:0 0 76px; }
.hint-open-all{ width:100%; font-size:8px; }
.hint-note{ font-size:11px; color:var(--ink-3); line-height:1.7; margin-top:12px; }
.hint-none{ font-size:12px; color:var(--ink-3); line-height:1.7; }
.hint-modal-k{ font-size:9px; color:var(--brand-deep); margin-bottom:10px; }
.hint-modal-body{ font-size:15.5px; line-height:1.6; color:var(--ink); text-align:left;
  background:var(--brand-soft); border:2px solid var(--brand); padding:14px 16px; }
.hint-pager{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-top:14px; font-size:8px; color:var(--ink-3); }
.hint-locked{ font-size:8px; color:var(--ink-3); text-align:center;
  border:2px dashed var(--line); padding:9px 6px; }

/* ---- Preview (unlock-all) banner ---- */
.preview-banner{ display:flex; align-items:center; gap:14px; margin:18px 0;
  padding:14px 18px; background:var(--amber); border:3px solid var(--edge);
  box-shadow:6px 6px 0 var(--shadow); }
/* Scoped to the title (.px) on purpose: a bare `.preview-banner b` also caught
   inline <b> inside the body copy and broke each one onto its own line. */
.preview-banner b.px{ display:block; font-size:9px; color:var(--amber-deep); margin-bottom:6px; }
.preview-banner span{ font-size:13px; line-height:1.65; color:var(--ink); }
.preview-banner span b{ font-weight:700; color:inherit; }
.preview-banner > .spr{ flex:none; align-self:flex-start; margin-top:2px; }
.preview-banner code{ font-size:12px; background:var(--card); border:1px solid var(--edge);
  padding:1px 5px; }

/* ---- Skill mastery ---- */
.mastery-card{ padding:18px 20px; }
.mastery-note{ font-size:13.5px; line-height:1.7; color:var(--ink-2); margin-bottom:16px; }
.mastery-note em{ font-style:normal; color:var(--brand-deep); }
.mastery-row{ display:flex; align-items:center; gap:12px; padding:5px 0; }
.mastery-name{ flex:0 0 170px; font-size:8px; color:var(--ink-2); }
.mastery-bar{ flex:1; height:14px; background:var(--card-2); border:2px solid var(--edge); }
.mastery-bar > div{ height:100%; background:var(--brand); transition:width .4s ease; }
.mastery-pct{ flex:0 0 46px; text-align:right; font-size:9px; color:var(--brand-deep); }
@media (max-width:640px){ .mastery-name{ flex-basis:110px; font-size:7px; } }
.hint-stale{ font-size:9.5px; line-height:1.8; color:var(--amber-deep);
  background:var(--amber); border:2px solid var(--edge); padding:9px 11px; margin-top:12px; }
.hint-card em{ font-style:normal; color:var(--brand-deep); }

/* tier XP band */
.xpband{ display:flex; align-items:center; gap:14px; padding:14px 18px; margin:18px 0;
  background:var(--card); border:3px solid var(--edge); box-shadow:6px 6px 0 var(--shadow);
  flex-wrap:wrap; }
.xpband-n{ font-size:16px; }
.xpband-n b{ color:var(--brand-deep); }
.xpband-sub{ font-size:8px; color:var(--ink-3); line-height:1.9; display:block; margin-top:5px; }
.xpband-bar{ flex:1; min-width:180px; height:16px; border:2px solid var(--edge);
  background:var(--line); position:relative; overflow:hidden; }
.xpband-bar>div{ height:100%; background:repeating-linear-gradient(90deg,var(--brand) 0 12px,var(--brand-deep) 12px 14px); transition:width .35s; }
.xpband-mark{ position:absolute; top:-3px; bottom:-3px; width:3px; background:var(--red); }
.xpband.met{ border-color:var(--brand); }

/* ---------- forms ---------- */
textarea.submission{ width:100%; min-height:150px; border:3px solid var(--edge); background:var(--card);
  color:var(--ink); padding:14px 16px; font-family:var(--font-sans); font-size:15.5px; resize:vertical;
  outline:none; border-radius:0; box-shadow:inset 3px 3px 0 rgba(0,0,0,.05); }
textarea.submission:focus{ border-color:var(--brand); }
.deliverable textarea{ min-height:120px; }
.deliverable h4{ font-family:var(--font-sans); text-transform:none; font-size:16px; color:var(--ink); }

/* ---------- engine ---------- */
.status-dot{ width:11px; height:11px; display:inline-block; margin-right:8px; border:2px solid var(--edge); }
.status-dot.on{ background:var(--brand); }
.status-dot.off{ background:var(--red); }

.mono{ font-family:var(--font-mono); font-size:13px; }

/* ---------- certificate ---------- */
.certificate{ text-align:center; padding:40px; margin:24px 0; background:var(--brand-soft); border-color:var(--brand); }
.certificate .seal{ font-size:52px; }
.certificate h2{ font-size:26px; margin:12px 0 4px; }
.certificate .cname{ font-family:var(--font-ui); font-size:calc(20px * var(--ui-scale)); color:var(--brand-deep); margin:14px 0; }

/* ---------- toast & modal ---------- */
.toast{ position:fixed; bottom:26px; left:50%; transform:translateX(-50%); z-index:100;
  background:var(--ink); color:var(--paper); border:3px solid var(--edge); box-shadow:5px 5px 0 var(--shadow);
  padding:13px 22px; font-weight:700; font-size:14px; max-width:90vw; }
.toast.error{ background:var(--red); color:#2a0808; }
.modal-backdrop{ position:fixed; inset:0; background:rgba(6,10,8,.6); z-index:90; display:grid; place-items:center; padding:20px; }
.modal{ background:var(--card); border:3px solid var(--edge); box-shadow:10px 10px 0 var(--shadow);
  padding:34px; max-width:520px; width:100%; text-align:center; }
.modal .big{ font-size:50px; }
.modal .byte-modal{ display:flex; justify-content:center; margin-bottom:6px; }
.modal h2{ font-size:24px; margin:8px 0; }
.modal p{ color:var(--ink-2); }
.modal .actions{ display:flex; gap:12px; justify-content:center; margin-top:22px; flex-wrap:wrap; }

/* ---------- Task Labs (hands-on workplace simulation) ---------- */
.tasklab{ margin:22px 0; }

@media (max-width:640px){

}

/* reflection / debrief */
.debrief-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; margin-top:14px; }
.debrief-f{ display:flex; flex-direction:column; }
.debrief-f > .px{ font-size:8px; color:var(--ink-3); margin-bottom:7px; line-height:1.8; }
.debrief-f textarea{ min-height:82px; }
.scale{ display:flex; gap:6px; flex-wrap:wrap; }
.scale button{ flex:1; min-width:44px; font-size:9px; padding:10px 6px; }
.scale button.on{ background:var(--brand); color:var(--on-brand); }
.debrief-hint{ font-size:13px; color:var(--ink-3); margin-top:6px; line-height:1.5; }

/* retake */
.retake-note{ margin-top:14px; padding:12px 14px; border:2px solid var(--amber);
  background:var(--amber); color:var(--amber-deep); font-size:14px; line-height:1.55; }
@media (max-width:640px){ }

/* ---------- Byte's Practice (in-lesson mini-games) ---------- */
.lgame{ margin:28px 0; padding:20px 22px; background:var(--card);
  border:3px solid var(--brand); box-shadow:6px 6px 0 var(--shadow); }
.lg-head{ display:flex; gap:14px; align-items:flex-start; margin-bottom:16px; }
.lg-byte{ flex-shrink:0; }
.lg-headtext{ flex:1; }
.lg-kicker{ font-size:9px; text-transform:uppercase; color:var(--brand-deep); margin-bottom:6px; }
.lg-name{ font-size:18px; font-weight:900; color:var(--ink); letter-spacing:-.3px; }
.lg-prompt{ font-size:14.5px; color:var(--ink-2); margin-top:5px; line-height:1.5; }
.lg-score{ font-size:11px; color:var(--brand-deep); background:var(--brand-soft);
  border:2px solid var(--edge); padding:6px 9px; flex-shrink:0; white-space:nowrap; }
.lg-fb{ margin-top:14px; padding:12px 14px; border:2px solid var(--edge); font-size:14.5px; line-height:1.55; }
.lg-fb.ok{ background:var(--brand-soft); color:var(--ink); }
.lg-fb.bad{ background:var(--amber); color:var(--amber-deep); }
.lg-fb-act{ margin-top:10px; }
.lg-prog{ font-size:8px; color:var(--ink-3); margin-top:12px; }
.lg-done{ margin-top:16px; padding:14px 16px; border:3px solid var(--edge);
  background:var(--card-2); box-shadow:4px 4px 0 var(--shadow); }
.lg-done.perfect{ background:var(--brand-soft); border-color:var(--brand); }
.lg-done-t{ font-size:11px; color:var(--brand-deep); margin-bottom:8px; }
.lg-done p{ font-size:14.5px; color:var(--ink-2); margin-bottom:12px; }

/* jeopardy board */
.lg-jboard{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.lg-jcat{ font-size:8px; text-align:center; color:var(--on-brand); background:var(--brand);
  border:2px solid var(--edge); padding:8px 4px; margin-bottom:8px; line-height:1.5; min-height:38px;
  display:flex; align-items:center; justify-content:center; }
.lg-jtile{ display:block; width:100%; font-family:var(--font-ui); font-size:calc(13px * var(--ui-scale));
  color:var(--brand-deep); background:var(--card-2); border:3px solid var(--edge);
  box-shadow:3px 3px 0 var(--shadow); padding:16px 4px; margin-bottom:8px; cursor:pointer;
  transition:transform .1s, box-shadow .1s; }
.lg-jtile:hover:not(:disabled){ transform:translate(-2px,-2px); box-shadow:5px 5px 0 var(--shadow); }
.lg-jtile:active:not(:disabled){ transform:translate(3px,3px); box-shadow:0 0 0 var(--shadow); }
.lg-jtile.used{ cursor:default; box-shadow:none; }
.lg-jtile.used.ok{ background:var(--brand); color:var(--on-brand); }
.lg-jtile.used.bad{ background:var(--amber); color:var(--amber-deep); }
.lg-clue-cat{ font-size:9px; color:var(--ink-3); margin-bottom:10px; }
.lg-clue-q{ font-size:17px; font-weight:800; color:var(--ink); margin-bottom:14px; line-height:1.45; }
.lg-opts{ display:flex; flex-direction:column; gap:9px; }
.lg-opt{ text-align:left; font-family:var(--font-sans); font-size:15px; font-weight:700;
  color:var(--ink); background:var(--card-2); border:2px solid var(--edge);
  padding:12px 14px; cursor:pointer; transition:background .12s; }
.lg-opt:hover:not(:disabled){ background:var(--brand-soft); }
.lg-opt:disabled{ cursor:default; }
.lg-opt.good{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand-deep); }
.lg-opt.wrong{ background:#fdeaea; border-color:var(--red); color:var(--red); }

/* sort */
.lg-card{ border:3px solid var(--edge); background:var(--card-2); box-shadow:4px 4px 0 var(--shadow);
  padding:18px 20px; font-size:16px; font-weight:700; line-height:1.5; margin-bottom:16px; }
.lg-bins{ display:flex; gap:10px; flex-wrap:wrap; }
.lg-bin{ font-size:9px; flex:1; min-width:120px; }
.lg-bin.good{ background:var(--brand); color:var(--on-brand); }
.lg-bin.wrong{ background:var(--red); color:#2a0808; }

/* order + build */
.lg-seq{ list-style:none; margin:0 0 14px; padding:0; }
.lg-seq-item{ counter-increment:lgstep; display:block; border:2px solid var(--brand);
  background:var(--brand-soft); padding:11px 14px; margin-bottom:8px; }
.lg-seq-item b{ display:block; font-size:14.5px; color:var(--ink); }
.lg-seq-item span{ display:block; font-size:13px; color:var(--ink-2); margin-top:4px; line-height:1.5; }
.lg-pool{ display:flex; flex-direction:column; gap:9px; }
.lg-step,.lg-token{ text-align:left; justify-content:flex-start; font-family:var(--font-sans);
  font-size:14.5px; font-weight:700; text-transform:none; letter-spacing:0; padding:12px 14px; }
.lg-token{ font-family:var(--font-mono); font-size:13.5px; }
.lg-step.wrong,.lg-token.wrong{ background:var(--red); color:#2a0808; }
.lg-built{ background:#1A0A24; color:#E9C2FF; border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow);
  padding:14px 16px; margin-bottom:14px; min-height:64px; font-size:13px; line-height:1.7;
  white-space:pre-wrap; overflow-x:auto; }

/* match */
.lg-match{ display:grid; grid-template-columns:1fr 1.3fr; gap:10px; }
.lg-mcol{ display:flex; flex-direction:column; gap:8px; }
.lg-m{ text-align:left; font-family:var(--font-sans); font-size:14px; font-weight:700; color:var(--ink);
  background:var(--card-2); border:2px solid var(--edge); padding:11px 13px; cursor:pointer;
  transition:background .12s; }
.lg-ml{ font-family:var(--font-mono); font-size:13px; }
.lg-m:hover:not(:disabled){ background:var(--brand-soft); }
.lg-m.sel{ background:var(--brand); color:var(--on-brand); }
.lg-m.locked{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand-deep); cursor:default; opacity:.85; }
.lg-m.wrong{ background:#fdeaea; border-color:var(--red); color:var(--red); }
@keyframes lgshake{ 0%,100%{transform:translateX(0)} 25%{transform:translateX(-5px)} 75%{transform:translateX(5px)} }
.shake{ animation:lgshake .28s; }
:root[data-theme="dark"] .lg-opt.wrong,:root[data-theme="dark"] .lg-m.wrong{ background:#3a1414; }
@media (prefers-color-scheme:dark){ .lg-opt.wrong,.lg-m.wrong{ background:#3a1414; } }
@media (max-width:640px){
  .lg-jboard{ grid-template-columns:1fr; }
  .lg-match{ grid-template-columns:1fr; }
}

/* ---------- Byte's Arcade (readiness mini-games) ---------- */
.arcade{ border-color:var(--brand); }
.ar-head{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:14px; }
.ar-brand{ font-size:8px; color:var(--on-brand); background:var(--brand); border:2px solid var(--edge); padding:5px 8px; }
.ar-title{ font-size:12px; color:var(--ink); }
.ar-scene{ width:100%; border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow); background:#0C1016; margin-bottom:14px; }
.ar-tag{ font-weight:800; color:var(--brand-deep); margin-bottom:8px; }
.ar-how{ font-size:14.5px; color:var(--ink-2); margin-bottom:12px; }
.ar-meta{ display:flex; gap:14px 20px; align-items:center; flex-wrap:wrap; font-size:9px;
  color:var(--ink-2); margin:12px 0; line-height:2; }
.ar-hearts{ letter-spacing:3px; }
.ar-heart{ color:var(--red); font-size:13px; }
.ar-heart.gone{ color:var(--line); }
.ar-clock{ color:var(--amber-deep); }
.ar-timer{ height:12px; border:2px solid var(--edge); background:var(--line); margin-bottom:14px; overflow:hidden; }
.ar-timer>div{ height:100%; background:repeating-linear-gradient(90deg,var(--brand) 0 10px,var(--brand-deep) 10px 12px); transition:width .1s linear; }
.ar-timer>div.low{ background:repeating-linear-gradient(90deg,var(--red) 0 10px,#a02024 10px 12px); }
.ar-rules{ border:2px solid var(--edge); background:var(--card-2); padding:12px 16px; margin-bottom:14px; }
.ar-rules-t{ font-size:8px; color:var(--ink-3); margin-bottom:8px; }
.ar-rules ul{ margin-left:18px; font-size:13.5px; }
.ar-rules li{ margin:3px 0; }
.ar-card{ border:3px solid var(--edge); background:var(--card); box-shadow:4px 4px 0 var(--shadow);
  padding:14px 18px; margin-bottom:14px; font-family:var(--font-mono); font-size:13.5px; line-height:1.7; }
.ar-card-t{ font-family:var(--font-ui); font-size:calc(8px * var(--ui-scale)); color:var(--ink-3); text-transform:uppercase; margin-bottom:8px; }
.ar-line.hd{ font-weight:800; }
.ar-choices{ display:flex; gap:12px; flex-wrap:wrap; }
.ar-choice{ font-size:10px; }
.ar-choice.good{ background:var(--brand); color:var(--on-brand); }
.ar-choice.bad{ background:var(--red); color:#2a0808; }
.ar-fb{ margin-top:14px; padding:12px 14px; border:2px solid var(--edge); font-size:14.5px; line-height:1.55; }
.ar-fb.ok{ background:var(--brand-soft); }
.ar-fb.bad{ background:var(--amber); color:var(--amber-deep); }
.ar-fb-act{ margin-top:10px; }
.ar-result{ font-size:13px; padding:14px 18px; border:3px solid var(--edge); box-shadow:4px 4px 0 var(--shadow);
  margin-bottom:8px; line-height:1.9; }
.ar-result.ok{ background:var(--brand-soft); color:var(--brand-deep); }
.ar-result.bad{ background:var(--amber); color:var(--amber-deep); }
.ar-rev-t{ font-size:9px; color:var(--ink-2); margin:14px 0 10px; }
.ar-review{ display:flex; flex-direction:column; gap:0; border:2px solid var(--line); margin-bottom:16px; }
.ar-rev-row{ display:flex; gap:12px; padding:11px 14px; font-size:13.5px; align-items:flex-start; }
.ar-rev-row + .ar-rev-row{ border-top:2px solid var(--line); }
.ar-rev-mark{ font-size:11px; flex-shrink:0; margin-top:2px; }
.ar-rev-mark.ok{ color:var(--brand-deep); }
.ar-rev-mark.bad{ color:var(--red); }
.ar-rev-why{ color:var(--ink-2); font-size:13px; margin-top:3px; }

@media (max-width:640px){
  .topnav{ display:none; }
  .tier-row{ gap:14px; }
  .hero h1{ font-size:30px; }
}
@media (prefers-reduced-motion:reduce){
  *{ transition:none !important; animation:none !important; }
}

[data-pack="arcade"] body{ font-size:11px; line-height:2.0; letter-spacing:0; }

[data-pack="arcade"] h1,
[data-pack="arcade"] h2,
[data-pack="arcade"] h3,
[data-pack="arcade"] h4,
[data-pack="arcade"] h5,
[data-pack="arcade"] h6{ font-weight:400; letter-spacing:0; line-height:1.55; }
[data-pack="arcade"] .hero h1{ font-size:clamp(17px,3.1vw,27px); line-height:1.5; }
[data-pack="arcade"] .hero p{ font-size:12px; line-height:2.0; max-width:560px; }
[data-pack="arcade"] .doc-head h1{ font-size:clamp(15px,2.2vw,20px); line-height:1.5; }
[data-pack="arcade"] .card h3{ font-size:13px; line-height:1.6; }

[data-pack="arcade"] .modal h2,
[data-pack="arcade"] .certificate h2{ font-size:15px; line-height:1.6; }
[data-pack="arcade"] .prose h2{ font-size:14px; margin:26px 0 12px; }
[data-pack="arcade"] .prose h3{ font-size:12px; margin:22px 0 10px; }

/* running text */
[data-pack="arcade"] .prose,
[data-pack="arcade"] .prose p,
[data-pack="arcade"] .prose li{ font-size:11px; line-height:2.05; }
[data-pack="arcade"] .prose ul,
[data-pack="arcade"] .prose ol{ margin:14px 0 14px 22px; }
[data-pack="arcade"] .prose li{ margin:9px 0; }
[data-pack="arcade"] .prose table,
[data-pack="arcade"] .prose th,
[data-pack="arcade"] .prose td{ font-size:10px; line-height:1.8; }
[data-pack="arcade"] .prose pre{ font-size:10px; line-height:1.9; }
[data-pack="arcade"] .prose code{ font-size:95%; }
[data-pack="arcade"] .card p{ font-size:10.5px; line-height:1.95; }
[data-pack="arcade"] .tier-row p,
[data-pack="arcade"] .module-card p{ font-size:10.5px; line-height:1.95; }

[data-pack="arcade"] .cp-q{ font-size:11.5px; line-height:1.8; }

[data-pack="arcade"] .hint-modal-body{ font-size:11px; line-height:1.95; }
[data-pack="arcade"] .hint-note,
[data-pack="arcade"] .hint-none,
[data-pack="arcade"] .debrief-hint{ font-size:9.5px; line-height:1.9; }

[data-pack="arcade"] .lesson-link{ font-size:10.5px; line-height:1.8; }
[data-pack="arcade"] .wallet .wsub,
[data-pack="arcade"] .tier-stats,
[data-pack="arcade"] .card .meta{ line-height:2.1; }
[data-pack="arcade"] .toast{ font-size:10px; line-height:1.9; }
[data-pack="arcade"] .modal p{ font-size:10.5px; line-height:1.95; }
[data-pack="arcade"] .certificate p{ font-size:10.5px; line-height:2.0; }
[data-pack="arcade"] .certificate .cname{ font-size:15px; }
[data-pack="arcade"] .skeleton{ font-size:10px; line-height:2.1; }

/* long prose gets a touch more room to breathe than chrome does */
[data-pack="arcade"] .doc.reading .prose{ line-height:2.15; }
@media (max-width:640px){
[data-pack="arcade"] body{ font-size:10px; }
[data-pack="arcade"] .prose,
[data-pack="arcade"] .prose p,
[data-pack="arcade"] .prose li{ font-size:10px; }
[data-pack="arcade"] .hero h1{ font-size:16px; }
}

/* The pixel face is ~1.6x wider per character, so the arcade top bar runs out
   of room well before the 640px breakpoint the modern packs need. */
@media (max-width:900px){
  [data-pack="arcade"] .topnav{ display:none; }
}

/* ================= MISSION PLAYER =================
   One step on screen at a time. Nothing here reveals an answer: the options
   arrive from the server without a correct flag, and the explanation block is
   empty until the step is solved. */
.mission-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(330px,1fr));
  gap:18px; margin-bottom:12px; }
.mission-card{ display:block; }
.mission-card.boss{ border-color:var(--brand); box-shadow:6px 6px 0 var(--brand-deep); }
.mn-card-top{ display:flex; align-items:center; justify-content:space-between; gap:10px;
  margin-bottom:10px; }
.mn-card-k{ font-size:8px; color:var(--brand-deep); }
.mission-card.boss .mn-card-k{ color:var(--red); }
.mn-card-role{ font-size:12.5px; color:var(--ink-3); margin:2px 0 8px; }
.mn-card-meta{ display:flex; flex-wrap:wrap; gap:12px; margin-top:12px;
  font-size:11.5px; color:var(--ink-3); }

.mn-wrap{ max-width:860px; margin:0 auto; }
.mn-head{ display:flex; gap:16px; align-items:flex-start; margin-bottom:18px; }
.mn-kicker{ font-size:9px; color:var(--brand-deep); }
.mn-wrap.boss .mn-kicker{ color:var(--red); }
.mn-head h1{ font-size:32px; font-weight:900; margin:6px 0 8px; }
.mn-meta{ display:flex; flex-wrap:wrap; gap:14px; font-size:12.5px; color:var(--ink-3); }
.mn-story{ background:var(--card-2); border:3px solid var(--edge); padding:18px 20px;
  margin-bottom:16px; font-size:15px; line-height:1.75; }
.mn-story p{ margin:0 0 10px; }
.mn-story p:last-child{ margin-bottom:0; }
.mn-objective{ display:flex; gap:14px; align-items:baseline; padding:14px 18px;
  border-left:5px solid var(--brand); background:var(--brand-soft); margin-bottom:20px; }
.mn-objective .px{ font-size:8px; color:var(--brand-deep); flex:none; }
.mn-objective p{ margin:0; font-size:14.5px; }

.mn-progress{ display:flex; gap:8px; margin-bottom:14px; flex-wrap:wrap; }
.mn-pip{ width:34px; height:34px; border:3px solid var(--edge); background:var(--card);
  font-family:var(--font-ui); font-size:calc(10px * var(--ui-scale)); color:var(--ink-3); cursor:pointer; }
.mn-pip.done{ background:var(--brand); border-color:var(--brand); color:var(--on-brand); }
.mn-pip.on{ outline:3px solid var(--brand-deep); outline-offset:2px; }
.mn-pip:disabled{ opacity:.4; cursor:not-allowed; }

.mn-step{ padding:22px 24px; }
.mn-step-head{ display:flex; justify-content:space-between; align-items:center;
  margin-bottom:10px; }
.mn-kind{ font-size:8px; color:var(--brand-deep); }
.mn-xp{ font-size:8px; color:var(--coin-deep); }
.mn-step h3{ font-size:20px; margin-bottom:8px; }
.mn-prompt{ font-size:15px; line-height:1.7; color:var(--ink-2); margin-bottom:16px; }
.mn-evidence{ margin-bottom:18px; }
.mn-ev-t{ font-size:8px; color:var(--ink-3); margin-bottom:6px; }
.mn-evidence pre{ background:#1A0A24; color:#E9C2FF; padding:14px 16px; overflow-x:auto;
  font-size:12.5px; line-height:1.85; white-space:pre; border:2px solid var(--edge); }

.mn-options{ display:flex; flex-direction:column; gap:10px; }
.mn-opt{ display:flex; gap:12px; align-items:flex-start; text-align:left; padding:14px 16px;
  border:3px solid var(--edge); background:var(--card); cursor:pointer; font-size:14.5px;
  line-height:1.6; color:var(--ink); }
.mn-opt:hover{ background:var(--card-2); }
.mn-opt.on{ border-color:var(--brand); background:var(--brand-soft); }
.mn-opt-k{ font-size:9px; width:22px; height:22px; flex:none; display:grid;
  place-items:center; border:2px solid var(--edge); background:var(--card-2); }
.mn-opt.on .mn-opt-k{ background:var(--brand); color:var(--on-brand); border-color:var(--brand); }

.mn-sub{ font-size:8px; color:var(--ink-3); margin-bottom:8px; }
.mn-order{ display:grid; gap:18px; }
.mn-slot,.mn-pool{ display:flex; gap:10px; align-items:center; width:100%; text-align:left;
  padding:11px 14px; border:3px solid var(--edge); background:var(--card); cursor:pointer;
  font-size:14px; margin-bottom:8px; color:var(--ink); }
.mn-slot{ background:var(--brand-soft); border-color:var(--brand); }
.mn-slot-n{ font-size:9px; width:22px; height:22px; flex:none; display:grid;
  place-items:center; background:var(--brand); color:var(--on-brand); }
.mn-x{ margin-left:auto; color:var(--ink-3); }
.mn-pool:hover{ background:var(--card-2); }
.mn-empty{ font-size:13px; color:var(--ink-3); padding:12px 0; }

.mn-match{ display:grid; gap:10px; }
.mn-match-row{ display:grid; grid-template-columns:1fr 1fr; gap:12px; align-items:center; }
.mn-match-l{ font-size:14px; padding:10px 12px; background:var(--card-2);
  border:2px solid var(--edge); }
.mn-match-s{ padding:10px 12px; border:3px solid var(--edge); background:var(--card);
  font-size:13.5px; color:var(--ink); width:100%; }

.mn-feedback{ margin-top:18px; padding:14px 18px; border:3px solid var(--edge); }
.mn-feedback.ok{ background:var(--brand-soft); border-color:var(--brand); }
.mn-feedback.no{ background:var(--amber); }
.mn-fb-t{ font-size:9px; margin-bottom:8px; }
.mn-feedback.ok .mn-fb-t{ color:var(--brand-deep); }
.mn-feedback.no .mn-fb-t{ color:var(--amber-deep); }
.mn-feedback p{ margin:0; font-size:14.5px; line-height:1.7; }
.mn-actions{ margin-top:20px; display:flex; justify-content:flex-end; }

.mn-done-k{ font-size:10px; color:var(--brand-deep); margin-bottom:8px; }
.mn-unaided{ font-size:13px; color:var(--ink-3); }
.mn-debrief{ max-width:760px; margin:0 auto; }
.mn-db-step{ padding:16px 18px; border-left:5px solid var(--brand);
  background:var(--card-2); margin-bottom:12px; }
.mn-db-n{ font-size:8px; color:var(--brand-deep); margin-bottom:6px; }
.mn-db-step h4{ font-size:16px; margin-bottom:6px; }
.mn-db-step p{ margin:0; font-size:14.5px; line-height:1.7; color:var(--ink-2); }

@media (max-width:640px){
  .mn-match-row{ grid-template-columns:1fr; gap:6px; }
  .mn-head h1{ font-size:24px; }
}

/* ---- Mission tutor (§18) ---- */
.mn-tutor{ margin-top:20px; padding:16px 18px; background:var(--card-2);
  border:3px solid var(--edge); }
.mn-tutor-head{ display:flex; gap:12px; align-items:flex-start; margin-bottom:12px; }
.mn-tutor-t{ font-size:9px; color:var(--brand-deep); margin-bottom:5px; }
.mn-tutor-sub{ font-size:12.5px; line-height:1.65; color:var(--ink-3); }
.mn-hint-list{ display:flex; flex-direction:column; gap:7px; }
.mn-hint-row{ display:flex; align-items:center; gap:10px; }
.mn-hint-n{ width:24px; height:24px; flex:none; display:grid; place-items:center;
  font-size:9px; background:var(--card); border:2px solid var(--edge); color:var(--ink-3); }
.mn-hint-row.owned .mn-hint-n{ background:var(--brand); color:var(--on-brand);
  border-color:var(--brand); }
.mn-hint-name{ flex:1; font-size:13px; color:var(--ink-2); }
.mn-hint-locked{ font-size:8px; color:var(--ink-3); border:2px dashed var(--line);
  padding:7px 10px; }
.mn-hint-row .btn{ font-size:8px; }

/* ---- Skill map (§30) ---- */
.skillmap{ display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
  gap:18px; }
.skillmap-col{ background:var(--card); border:3px solid var(--edge); padding:16px 18px;
  box-shadow:6px 6px 0 var(--shadow); }
.skillmap-cat{ font-size:9px; color:var(--brand-deep); margin-bottom:12px; }
.skill-row{ display:grid; grid-template-columns:22px 1fr auto; gap:10px;
  align-items:center; padding:7px 0; }
.skill-ic{ font-size:15px; }
.skill-nm{ font-size:13.5px; }
.skill-nm small{ display:block; font-size:11px; color:var(--ink-3); margin-top:2px; }
.skill-state{ font-size:7.5px; padding:5px 8px; border:2px solid var(--edge);
  white-space:nowrap; }
.skill-state.locked{ color:var(--ink-3); border-style:dashed; }
.skill-state.introduced{ background:var(--card-2); color:var(--ink-2); }
.skill-state.practiced{ background:var(--amber); color:var(--amber-deep); border-color:var(--amber-deep); }
.skill-state.developing{ background:var(--amber); color:var(--amber-deep); border-color:var(--amber-deep); }
.skill-state.competent{ background:var(--brand-soft); color:var(--brand-deep); border-color:var(--brand); }
.skill-state.strong{ background:var(--brand); color:var(--on-brand); border-color:var(--brand); }
.skill-state.mastered{ background:var(--brand-deep); color:var(--on-brand); border-color:var(--brand-deep); }
.skill-legend{ display:flex; flex-wrap:wrap; gap:8px; margin:0 0 16px; }

/* ---- Readiness check: the non-MCQ question kinds ---- */
.quiz-kind{ font-size:8px; color:var(--brand-deep); }
.quiz-evidence{ background:#1A0A24; color:#E9C2FF; padding:13px 15px; overflow-x:auto;
  font-size:12.5px; line-height:1.85; white-space:pre; border:2px solid var(--edge);
  margin-bottom:14px; }
.quiz-order{ display:grid; gap:16px; }
.quiz-slots{ display:block; }

/* ---- Season 2 lesson scaffold ---- */
.lesson-objective{ display:flex; gap:14px; align-items:baseline; padding:14px 18px;
  background:var(--brand-soft); border-left:5px solid var(--brand); margin-bottom:22px; }
.lesson-objective .px{ font-size:8px; color:var(--brand-deep); flex:none; }
.lesson-objective p{ margin:0; font-size:15px; line-height:1.7; }
.lesson-real{ display:flex; gap:14px; align-items:baseline; padding:14px 18px;
  background:var(--card-2); border-left:5px solid var(--ink-3); margin:22px 0; }
.lesson-real .px{ font-size:8px; color:var(--ink-3); flex:none; }
.lesson-real p{ margin:0; font-size:14.5px; line-height:1.7; color:var(--ink-2); }

/* ---- Lesson diagrams ---- */
.vz{ margin:24px 0; padding:18px; border:3px solid var(--edge); background:var(--card);
  box-shadow:6px 6px 0 var(--shadow); }
.vz-t{ font-size:9px; color:var(--brand-deep); margin-bottom:14px; display:block; }
.vz-note{ margin-top:14px; font-size:12.5px; line-height:1.65; color:var(--ink-3); }
.vz-flow{ display:flex; flex-wrap:wrap; align-items:stretch; gap:8px; }
.vz-node{ flex:1 1 130px; min-width:120px; display:flex; flex-direction:column; gap:5px;
  padding:11px 13px; background:var(--card-2); border:2px solid var(--edge); }
.vz-node-l{ font-size:13.5px; font-weight:700; }
.vz-node-d{ font-size:11.5px; color:var(--ink-3); line-height:1.55; }
.vz-arrow{ align-self:center; color:var(--brand); font-size:16px; flex:none; }
.vz-stack{ display:flex; flex-direction:column; gap:6px; }
.vz-row{ display:grid; grid-template-columns:minmax(120px,1fr) 2fr; gap:14px;
  padding:11px 13px; background:var(--card-2); border-left:4px solid var(--brand); }
.vz-row-l{ font-size:13.5px; font-weight:700; }
.vz-row-d{ font-size:12.5px; color:var(--ink-3); line-height:1.6; }
.vz-compare{ width:100%; border-collapse:collapse; font-size:13px; }
.vz-compare th,.vz-compare td{ padding:9px 11px; border:2px solid var(--edge);
  text-align:left; vertical-align:top; }
.vz-compare thead th{ background:var(--brand-soft); color:var(--brand-deep);
  font-size:12px; }
.vz-compare tbody td:first-child{ background:var(--card-2); font-weight:600; }
@media (max-width:640px){
  .vz-flow{ flex-direction:column; }
  .vz-arrow{ transform:rotate(90deg); }
  .vz-row{ grid-template-columns:1fr; gap:4px; }
}

/* ---- Achievements (§36) ---- */
.badge-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:12px; margin-bottom:8px; }
.badge-card{ display:flex; gap:12px; align-items:flex-start; padding:13px 15px;
  background:var(--card); border:3px solid var(--edge); opacity:.5; }
.badge-card.earned{ opacity:1; border-color:var(--brand);
  box-shadow:4px 4px 0 var(--brand-deep); }
.badge-ic{ font-size:22px; flex:none; line-height:1.2; }
.badge-t{ font-size:14px; font-weight:800; margin-bottom:3px; }
.badge-d{ font-size:12px; line-height:1.55; color:var(--ink-3); }
.badge-coin{ font-size:8px; color:var(--coin-deep); flex:none; align-self:center; }

/* ---- Glossary (§66) ---- */
.gl-search{ display:flex; gap:14px; align-items:center; margin-bottom:20px; }
.gl-search input{ flex:1; padding:13px 16px; font-size:15px; color:var(--ink);
  background:var(--card); border:3px solid var(--edge); }
.gl-search .px{ font-size:8px; color:var(--ink-3); flex:none; }
.gl-term{ padding:18px 20px; background:var(--card); border:3px solid var(--edge);
  box-shadow:6px 6px 0 var(--shadow); margin-bottom:14px; }
.gl-term h3{ font-size:19px; margin-bottom:12px; }
.gl-pair{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.gl-side{ padding:12px 14px; background:var(--card-2); border-left:4px solid var(--brand); }
.gl-side:last-child{ border-left-color:var(--ink-3); }
.gl-l{ font-size:7.5px; color:var(--ink-3); display:block; margin-bottom:6px; }
.gl-side p{ margin:0; font-size:13.5px; line-height:1.65; }
.gl-eg{ margin-top:12px; font-size:13px; }
.gl-eg .px{ font-size:7.5px; color:var(--ink-3); }
.gl-eg p{ margin:4px 0 0; color:var(--ink-2); line-height:1.6; }
.gl-rel{ display:flex; flex-wrap:wrap; gap:6px; margin-top:12px; }
/* The simple glossary (2026-11-14): a two-column grid of short cards. */
.gl-grid{ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.gl-grid .gl-term{ margin:0; padding:16px 18px; }
.gl-grid .gl-term h3{ font-size:17px; margin:0 0 6px; }
.gl-simple{ margin:0; font-size:15px; line-height:1.6; color:var(--ink); }
.gl-more{ margin-top:10px; font-size:14px; color:var(--ink-2); }
.gl-more summary{ cursor:pointer; font-weight:600; color:var(--ink-3); width:fit-content; }
.gl-more summary:hover{ color:var(--ink); }
.gl-more p{ margin:8px 0 0; line-height:1.6; }
@media (max-width:640px){ .gl-grid{ grid-template-columns:1fr; } }

/* ---- Project (§55) ---- */
.project-card{ display:block; margin-bottom:18px; }
.pj-reqs{ margin:0 0 8px 20px; font-size:14.5px; line-height:1.9; }
.pj-rubric{ width:100%; border-collapse:collapse; font-size:14px; margin-bottom:8px; }
.pj-rubric td{ padding:10px 12px; border:2px solid var(--edge); }
.pj-w{ width:70px; text-align:right; font-weight:700; color:var(--brand-deep); }
.pj-text{ min-height:280px; }
.pj-feedback{ padding:14px 16px; background:var(--brand-soft);
  border-left:5px solid var(--brand); margin-bottom:14px; }
.pj-feedback .px{ font-size:8px; color:var(--brand-deep); }
.pj-feedback p{ margin:6px 0 0; font-size:14.5px; line-height:1.7; }
.pj-actions{ display:flex; align-items:center; gap:12px; margin-top:14px; }
.pj-actions .px{ font-size:8px; color:var(--ink-3); }
.pj-actions .spacer{ flex:1; }
@media (max-width:640px){ .gl-pair{ grid-template-columns:1fr; } }

/* ---- Professor dashboard (§57-§60) ---- */
.tstats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
  gap:12px; margin-bottom:22px; }
.tstat{ padding:16px 18px; background:var(--card); border:3px solid var(--edge);
  box-shadow:5px 5px 0 var(--shadow); }
.tstat.warn{ background:var(--amber); }
.tstat-v{ font-size:28px; font-weight:900; line-height:1.1; }
.tstat-l{ font-size:7.5px; color:var(--ink-3); margin-top:6px; }
.troster{ width:100%; border-collapse:collapse; font-size:14px; }
.troster th{ text-align:left; padding:10px 12px; font-size:11px;
  text-transform:uppercase; color:var(--ink-3); border-bottom:3px solid var(--edge); }
.troster td{ padding:11px 12px; border-bottom:2px solid var(--line); }
.troster tr:last-child td{ border-bottom:none; }
.mark-grid{ display:grid; grid-template-columns:1fr 380px; gap:18px; align-items:start; }
.mark-text{ white-space:pre-wrap; font-size:14px; line-height:1.75; max-height:70vh;
  overflow-y:auto; margin:0; }
.mark-score{ width:100%; padding:11px 13px; font-size:18px; font-weight:800;
  color:var(--ink); background:var(--card-2); border:3px solid var(--edge);
  margin:6px 0 14px; }
.mark-fb{ min-height:170px; margin:6px 0 14px; }
@media (max-width:900px){ .mark-grid{ grid-template-columns:1fr; } }

/* ---- Season 2 task blocks (§16) ---- */
.task-env{ display:flex; gap:14px; align-items:baseline; padding:12px 16px;
  background:var(--card-2); border-left:5px solid var(--ink-3); margin-bottom:16px; }
.task-env .px{ font-size:7.5px; color:var(--ink-3); flex:none; }
.task-env p{ margin:0; font-size:14px; line-height:1.65; }
.task-val{ margin-top:10px; font-size:13px; color:var(--ink-3); line-height:1.6; }
.task-explain{ border-color:var(--brand); background:var(--brand-soft); }

/* ---- The Cradlers browser lab ---- */
.clab{ border:3px solid var(--edge); box-shadow:6px 6px 0 var(--shadow);
  margin-bottom:20px; background:#12081C; overflow:hidden; }
.clab-bar{ display:flex; align-items:center; gap:10px; padding:9px 12px;
  background:#1F0F2E; border-bottom:2px solid var(--edge); }
.clab-dots{ display:flex; gap:5px; }
.clab-dots i{ width:9px; height:9px; border-radius:50%; background:#5A3B77; }
.clab-title{ font-size:7.5px; color:#B98FD8; flex:1; }
.clab-help{ font-size:7.5px; background:transparent; color:#B98FD8; cursor:pointer;
  border:2px solid #4A2C66; padding:4px 8px; }
.clab-help:hover{ color:#F0DCFF; border-color:#7A4FA0; }
.clab-note{ padding:9px 14px; background:#1A0C26; color:#C9A8E4;
  font-size:12.5px; border-bottom:2px solid var(--edge); line-height:1.6; }
.clab-screen{ padding:14px; height:300px; overflow-y:auto; color:#E9C2FF;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px;
  line-height:1.75; white-space:pre-wrap; word-break:break-word; }
.clab-screen:focus{ outline:none; }
.clab-echo{ color:#8E6BAE; }
.clab-err{ color:#FF8A8A; }
.clab-input{ display:flex; align-items:center; gap:0; padding:10px 14px;
  border-top:2px solid var(--edge); background:#1A0C26; }
.clab-ps1{ color:#9D6BC9; font-family:ui-monospace,Menlo,monospace;
  font-size:12.5px; white-space:pre; flex:none; }
.clab-cmd{ flex:1; background:transparent; border:none; outline:none;
  color:#E9C2FF; font-family:ui-monospace,Menlo,monospace; font-size:12.5px; }

/* ---- Clean-room marks (drawn by cleanroom.js) ---- */
.cr-byte, .cr-icon{ display:block; }
.spr.cr-swapped canvas{ display:none !important; }
.spr.cr-swapped{ display:inline-flex; align-items:center; justify-content:center; }
[data-pack="cleanroom"] .icon-lg .spr{ display:inline-flex !important; }
[data-pack="cleanroom"] .byte-callout{
  background:transparent; border:1px solid var(--line); border-left:2px solid var(--brand);
  border-radius:var(--rad); }

/* ---- Clean room: the ladder marks ONE level ---- */
[data-pack="cleanroom"] .tier-rail{ display:flex; flex-direction:column;
  align-items:center; gap:6px; }
[data-pack="cleanroom"] .tier-here-byte{ margin-bottom:2px; }
[data-pack="cleanroom"] .tier-here-label{ font-size:9.5px; color:var(--brand);
  letter-spacing:.09em; white-space:nowrap; }
[data-pack="cleanroom"] .tier-here-label.muted{ color:var(--ink-3); }
[data-pack="cleanroom"] .tier-node.locked{ color:var(--ink-3); opacity:.65; }
[data-pack="cleanroom"] .tier-row.here > .card{ border-color:var(--brand); }
[data-pack="cleanroom"] .tier-row.passed > .card{ opacity:.72; }
[data-pack="cleanroom"] .tier-row.passed h3{ color:var(--ink-2); }

/* =====================================================================
   AURORA BACKDROP
   Shown only when data-theme="aurora". Five blurred colour fields drift
   over a night sky and a curtain of light sweeps across them. Pure CSS
   and pointer-events:none — it sits at z-index -1 behind the content
   exactly like #citybg, and app.js switches every other ambient layer
   off while it is up so two animations are never fighting for the same
   pixels.

   The global prefers-reduced-motion rule above kills the animations, and
   the result is a static painted sky rather than a blank page.
   ===================================================================== */
#aurorabg{
  display:none; position:fixed; inset:0; z-index:-1;
  overflow:hidden; pointer-events:none; contain:strict;
  background:
    radial-gradient(140% 110% at 50% 120%, #2A1450 0%, #120D28 45%, #0E0B1E 100%);
}
:root[data-theme="aurora"] #aurorabg{ display:block; }

/* The logo's colours (2026-11-21; black and gold before): violet and
   lavender fields with one amber, kept dim so text over the translucent
   cards stays AA. glass.css paints the live backdrop and hides these. */
.au{
  position:absolute; border-radius:50%;
  filter:blur(80px); mix-blend-mode:screen; opacity:.32;
  will-change:transform, opacity;
}
.au1{ width:48vw; height:48vw; left:-8vw;  top:-12vw;    background:#7D2BB1;
      animation:au-drift-a 27s ease-in-out infinite alternate; }
.au2{ width:56vw; height:40vw; left:22vw;  top:-18vw;    background:#C79AFF;
      animation:au-drift-b 34s ease-in-out infinite alternate; }
.au3{ width:42vw; height:42vw; right:-10vw; top:4vw;     background:#FFB548;
      opacity:.2; animation:au-drift-c 31s ease-in-out infinite alternate; }
.au4{ width:46vw; height:32vw; left:12vw;  bottom:-18vw; background:#5A1F86;
      opacity:.3; animation:au-drift-d 38s ease-in-out infinite alternate; }
.au5{ width:36vw; height:36vw; right:8vw;  bottom:-14vw; background:#9E62E0;
      animation:au-drift-e 24s ease-in-out infinite alternate; }

/* The curtain is what makes it read as moving light rather than as
   lava-lamp blobs: soft parallel bands, tilted and slowly swept. */
.au-curtain{
  position:absolute; inset:-25% -35%; mix-blend-mode:screen;
  filter:blur(22px); opacity:.8;
  background:repeating-linear-gradient(101deg,
    transparent 0 58px,
    rgba(199,154,255,.05) 58px 104px,
    transparent 104px 176px,
    rgba(125,43,177,.05) 176px 236px,
    transparent 236px 320px);
  animation:au-sweep 46s ease-in-out infinite alternate;
}

@keyframes au-drift-a{
  0%  { transform:translate3d(0,0,0) scale(1);      opacity:.26; }
  100%{ transform:translate3d(14vw,9vh,0) scale(1.2); opacity:.4; }
}
@keyframes au-drift-b{
  0%  { transform:translate3d(0,0,0) scale(1.05);     opacity:.24; }
  100%{ transform:translate3d(-16vw,13vh,0) scale(.9); opacity:.38; }
}
@keyframes au-drift-c{
  0%  { transform:translate3d(0,0,0) scale(.95);      opacity:.18; }
  100%{ transform:translate3d(-11vw,16vh,0) scale(1.22); opacity:.12; }
}
@keyframes au-drift-d{
  0%  { transform:translate3d(0,0,0) scale(1);        opacity:.2; }
  100%{ transform:translate3d(17vw,-11vh,0) scale(1.15); opacity:.32; }
}
@keyframes au-drift-e{
  0%  { transform:translate3d(0,0,0) scale(1.1);      opacity:.22; }
  100%{ transform:translate3d(-9vw,-14vh,0) scale(.92); opacity:.36; }
}
@keyframes au-sweep{
  0%  { transform:translateX(-9%) skewY(-1.5deg); }
  100%{ transform:translateX(9%)  skewY(1.5deg); }
}

/* Surfaces float ON the sky rather than blocking it out. The blur is what
   keeps long prose comfortable over a moving background. */
:root[data-theme="aurora"] .card,
:root[data-theme="aurora"] .panel,
:root[data-theme="aurora"] .doc,
:root[data-theme="aurora"] .certificate,
:root[data-theme="aurora"] .wallet,
:root[data-theme="aurora"] .xpband,
:root[data-theme="aurora"] .hint-card,
:root[data-theme="aurora"] .gl-term,
:root[data-theme="aurora"] .badge-card,
:root[data-theme="aurora"] .mission-card,
:root[data-theme="aurora"] .modal,
:root[data-theme="aurora"] .hdr-stat,
:root[data-theme="aurora"] .theme-seg{
  backdrop-filter:blur(14px) saturate(1.15);
  -webkit-backdrop-filter:blur(14px) saturate(1.15);
}
/* The city and the helix/gears are switched off in JS, but belt and braces:
   nothing else animates behind the aurora. */
:root[data-theme="aurora"] #citybg,
:root[data-theme="aurora"] #scenebg{ display:none !important; }

/* =====================================================================
   RECAPS — AI revision summaries (see views.js recapHTML)
   The surface is `.panel`, deliberately: it already degrades correctly in
   all five packs and all three themes on tokens alone, so everything here
   is inner rhythm only and needs no themes.css counterpart.
   ===================================================================== */
.recap{ margin:26px 0 6px; }
.recap-tag{ display:inline-block; font-size:7.5px; padding:4px 7px; margin-right:6px;
  color:var(--on-brand); background:var(--ink-3); border:2px solid var(--edge); }
.recap-note{ font-size:12.5px; line-height:1.7; color:var(--ink-2); margin-bottom:14px; }
.recap-sub{ font-size:8px; color:var(--ink-3); margin:16px 0 8px; display:block; }
.recap-points{ margin:0; padding-left:20px; }
.recap-points li{ font-size:14.5px; line-height:1.7; margin-bottom:7px; }

.recap-terms{ display:grid; gap:7px; }
.recap-term{ display:flex; gap:10px; align-items:baseline; font-size:13.5px; line-height:1.6; }
.recap-term-t{ flex:0 0 34%; font-weight:800; color:var(--brand-deep); }
.recap-term-m{ flex:1; color:var(--ink-2); }

.recap-lessons{ display:grid; gap:6px; }
.recap-lesson{ display:block; padding:10px 12px; background:var(--card-2);
  border:2px solid var(--line); }
.recap-lesson:hover{ border-color:var(--brand); }
.recap-lesson-t{ display:block; font-size:13px; font-weight:800; }
.recap-lesson-p{ display:block; font-size:13px; color:var(--ink-2); margin-top:3px; line-height:1.6; }

.recap-one{ display:flex; gap:14px; align-items:baseline; margin-top:18px;
  padding:14px 16px; background:var(--brand-soft); border-left:5px solid var(--brand); }
.recap-one .px{ font-size:8px; color:var(--brand-deep); flex:none; }
.recap-one p{ margin:0; font-size:14.5px; line-height:1.7; }
/* The recap saying, in its own body, what it is not. */
.recap-gap{ margin-top:14px; font-size:12.5px; line-height:1.7; color:var(--ink-3);
  font-style:italic; }

/* Shown, not hidden — the learner should know the recap exists and what
   opens it. */
.recap-locked{ margin:26px 0 6px; padding:16px 18px; border:3px dashed var(--line);
  background:transparent; }
.recap-locked .px{ font-size:8px; color:var(--ink-3); display:block; margin-bottom:7px; }
.recap-locked p{ margin:0; font-size:13.5px; line-height:1.7; color:var(--ink-3); }

@media (max-width:640px){
  .recap-term{ flex-direction:column; gap:1px; }
  .recap-term-t{ flex:none; }
}

/* The modal is text-align:center for the small confirm dialogs it was built
   for. A revision sheet is a document — bullets and a definition list — so it
   opts out, and gets more width and a scroll cap since it can run long. */
.modal:has(.recap){ max-width:640px; text-align:left; }
.modal:has(.recap) h3{ text-align:center; margin-bottom:4px; }
.modal .recap{ margin:14px 0 0; max-height:62vh; overflow-y:auto; }
.modal .recap-term-t{ flex:0 0 32%; }

/* Revision-sheet offer on the readiness-check page. */
.recap-cta{ display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  margin:18px 0 4px; padding:12px 16px; border:2px dashed var(--line); }
.recap-cta .px{ font-size:8px; color:var(--ink-3); }

/* =====================================================================
   ORIGIN — the founders' story under the course list (views.js originHTML)
   Two columns on desktop, stacked on mobile. Built only from tokens, so it
   inherits every pack and every theme without an override.
   ===================================================================== */
.origin{ display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);
  gap:34px; align-items:start; margin:0 0 20px; }
.origin-body p{ font-size:16px; line-height:1.78; color:var(--ink-2);
  margin-bottom:14px; max-width:62ch; }
.origin-body p:last-child{ margin-bottom:0; }
.origin-lead{ font-size:19px !important; line-height:1.6 !important;
  color:var(--ink) !important; font-weight:700; }

/* The word off the first poster, given the room it earned. */
.origin-mark{ margin:0; padding:24px 26px; background:var(--card-2);
  border:3px solid var(--edge); box-shadow:6px 6px 0 var(--shadow); }
.origin-word{ font-family:var(--font-ui); font-size:calc(26px * var(--ui-scale)); line-height:1.1;
  letter-spacing:.02em; color:var(--brand-deep); word-break:break-word;
  margin-bottom:14px; }
.origin-mark figcaption{ font-size:13.5px; line-height:1.7; color:var(--ink-3); }

@media (max-width:820px){
  .origin{ grid-template-columns:1fr; gap:22px; }
  .origin-word{ font-size:22px; }
}

/* The first poster. Present only once scripts/redact_poster.py has written it.
   Hidden until it actually loads and removed outright on error, so a missing
   file leaves no trace — an earlier version used loading="lazy", which meant
   the browser never attempted the fetch, onerror never fired, and a 2px
   bordered stub sat in the panel. */
.origin-photo{ display:none; width:100%; height:auto; margin-bottom:16px;
  border:3px solid var(--edge); }
.origin-photo.loaded{ display:block; }

/* ===================== ADMIN PANEL =====================
   Built from the same tokens as everything else — --paper, --card, --ink,
   --brand, --line — so it inherits light, dark and aurora, and every course
   theme pack, without a single hard-coded colour. The one new idea is the
   sidebar layout; the cards, panels, pills and buttons are the app's own. */

[data-view="admin"] .topbar,
[data-view="admin"] .menu-3dot-btn,
[data-view="admin"] .mobile-drawer,
[data-view="admin"] .mobile-drawer-backdrop,
[data-view="admin"] .footer {
  display: none !important;
}

.admin-wrap { display: flex; gap: 18px; align-items: flex-start; }

.admin-side {
  position: sticky; top: 12px; flex: 0 0 196px; width: 196px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 12px; display: flex; flex-direction: column; gap: 10px;
}
.admin-brand { font-size: 12px; color: var(--ink-3); letter-spacing: .08em; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; }
.admin-navlink {
  display: block; padding: 8px 10px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
.admin-navlink:hover { background: var(--card-2); color: var(--ink); }
.admin-navlink.on { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.admin-side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.admin-main { flex: 1 1 auto; min-width: 0; }
.admin-menu { display: none; margin-bottom: 10px; }

.admin-h { font-size: 13px; color: var(--ink-2); margin: 18px 0 8px; }
.admin-grid {
  display: grid; gap: 12px; margin-bottom: 8px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.admin-stat { padding: 12px 14px; }
.admin-stat-k { font-size: 11.5px; color: var(--ink-3); letter-spacing: .06em; }
.admin-stat-v { font-size: 26px; font-weight: 800; color: var(--ink); line-height: 1.2; }
.admin-stat-v.na { font-size: 15px; font-weight: 600; color: var(--ink-3); }
.admin-stat-na { border-style: dashed; }

.admin-cols { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.admin-chart { width: 100%; height: auto; display: block; }
.admin-chart .ax { stroke: var(--line); stroke-width: 1; }
.admin-chart .line { fill: none; stroke: var(--brand); stroke-width: 2; }
.admin-chart .fill { fill: var(--brand); opacity: .12; stroke: none; }
.admin-chart .dot { fill: var(--brand); }
.admin-chart .bar { fill: var(--brand); opacity: .85; }
.admin-chart .bar.warn { fill: var(--ink-3); opacity: .55; }
.admin-chart .lbl { fill: var(--ink-3); font-size: 10px; }

.admin-tablewrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td {
  text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.admin-table td.num, .admin-table th.num { text-align: right; }
.admin-table tbody tr { cursor: pointer; }
.admin-table tbody tr:hover { background: var(--card-2); }
.admin-sort { background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font: inherit; letter-spacing: inherit; }
.admin-sort.on { color: var(--brand); }

.admin-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-input {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 14px;
  min-width: 0;
}
.admin-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.admin-lbl { display: block; font-size: 11.5px; color: var(--ink-3); margin: 10px 0 4px; }

.admin-pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 14px 0; }
.admin-state { text-align: center; padding: 28px 16px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-crumbs { margin-bottom: 8px; font-size: 13px; }
.admin-crumbs a { color: var(--ink-2); }

.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 12px; flex-wrap: wrap; }
.admin-tab {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 8px 12px; cursor: pointer; color: var(--ink-2); font: inherit; font-size: 14px;
}
.admin-tab.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

.admin-dl { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: 14px; margin: 0; }
.admin-dl dt { color: var(--ink-3); }
.admin-dl dd { margin: 0; color: var(--ink); }

.admin-timeline { list-style: none; margin: 0; padding: 0; }
.admin-timeline li {
  display: grid; grid-template-columns: 120px 1fr auto; gap: 10px;
  padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline;
  font-size: 14px;
}
.admin-tl-kind { font-size: 11px; color: var(--ink-3); }
.admin-tl-title { color: var(--ink); }
.admin-tl-detail { grid-column: 2 / -1; font-size: 12px; }

.admin-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-note { background: var(--card-2); }
.admin-login { max-width: 400px; margin: 48px auto; }
.admin-err { color: var(--on-brand); background: #b2334a; padding: 8px 10px;
  border-radius: 8px; font-size: 14px; }
.pill.pill-warn { background: var(--ink-3); }

@media (max-width: 900px) {
  .admin-cols { grid-template-columns: 1fr; }
  .admin-dl { grid-template-columns: 1fr; }
  .admin-dl dt { margin-top: 6px; }
}
@media (max-width: 720px) {
  /* Stretch, not flex-start: a column sized to its content grew as wide as
     its widest table and pushed the whole page sideways on a phone. The
     tables scroll inside .admin-tablewrap instead. */
  .admin-wrap { flex-direction: column; align-items: stretch; }
  .admin-main { width: 100%; }
  .admin-menu { display: inline-block; }
  .admin-side { position: static; width: 100%; flex-basis: auto; display: none; }
  .admin-side.open { display: flex; }
  .admin-timeline li { grid-template-columns: 1fr; gap: 2px; }
  .admin-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ===================== FOOTER + LEGAL PAGES =====================
   Built from the existing tokens, so it follows light, dark, aurora and every
   course pack without a hard-coded colour. */

.footer-inner{ max-width:1040px; margin:0 auto; display:flex; flex-direction:column;
  gap:14px; align-items:center; }
.footer-tag{ max-width:540px; }
.footer-links{ display:flex; flex-wrap:wrap; gap:6px 18px; justify-content:center; }
.footer-links a{ color:var(--ink-2); text-decoration:none; }
.footer-links a:hover{ color:var(--brand); text-decoration:underline; }
.footer-meta{ display:flex; align-items:center; gap:16px; flex-wrap:wrap;
  justify-content:center; color:var(--ink-3); }
/* The staff link is quiet, not concealed — low contrast until you look for
   it, full contrast on hover and always reachable by keyboard. Hiding it
   would be pretending the footer is a security boundary, which it is not. */
.footer-admin{ color:var(--ink-3); opacity:.55; text-decoration:none;
  letter-spacing:.5px; }
.footer-admin:hover, .footer-admin:focus-visible{ opacity:1; color:var(--brand); }

.legal-page{ max-width:760px; margin:0 auto; }
.legal-page h2{ margin:26px 0 8px; font-size:17px; }
.legal-page h3{ margin:16px 0 4px; font-size:14px; color:var(--ink-2); }
.legal-page ul{ margin:8px 0 8px 20px; }
.legal-page li{ margin:4px 0; }
.legal-draft{ border-left:4px solid var(--brand); margin-bottom:18px;
  font-size:14px; line-height:1.6; }
/* An unfinished placeholder has to look unfinished. */
.legal-todo{ background:var(--brand-soft); color:var(--brand-deep);
  padding:1px 5px; border-radius:4px; font-size:.92em; white-space:normal; }
.legal-foot{ margin-top:28px; padding-top:14px; border-top:1px solid var(--line); }

@media (max-width:640px){
  .footer-links{ gap:4px 12px; }
}

/* One learner's courses, inside the admin profile. */
.admin-course + .admin-course { margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--line); }
.admin-course h3 { font-size: 15px; color: var(--ink); }

/* A table whose rows carry their own buttons must not also be one big link —
   clicking "Block" should block, not navigate away mid-decision. */
.admin-table.admin-noclick tbody tr { cursor: default; }
.admin-table.admin-noclick td a { color: var(--ink); text-decoration: none; }
.admin-table.admin-noclick td a:hover { color: var(--brand); text-decoration: underline; }
.admin-rowacts { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table .btn { white-space: nowrap; }

/* ---- 2026-11 admin pass: explained cards, readable charts, filters ---- */

/* The signed-in email wraps inside the sidebar instead of running past it. */
.admin-side-k { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }
.admin-side-email { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 8px;
  overflow-wrap: anywhere; line-height: 1.35; }
.admin-break { overflow-wrap: anywhere; }

/* A stat card that opens the list behind its number. */
.admin-stat-link { display: block; width: 100%; text-align: left; font: inherit;
  color: inherit; cursor: pointer; position: relative; }
.admin-stat-link:hover { border-color: var(--brand); }
.admin-stat-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.admin-stat-go { display: block; margin-top: 6px; font-size: 12px; color: var(--brand);
  font-weight: 600; }
.admin-stat .wsub { font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.admin-cap { margin: -2px 0 10px; font-size: 13px; }
.admin-grid-wide { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.admin-grid-wide .admin-stat .btn { margin: 6px 6px 0 0; }

/* Charts drawn at real width: 12px labels stay 12px. */
.admin-chartbox { width: 100%; min-height: 210px; }
.admin-chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 4; }
.admin-chart .lbl { font-size: 12px; }
.admin-chart .lbl.val { fill: var(--ink-2); font-weight: 700; }
.admin-chart .hit { fill: transparent; }
.admin-chart .hit:hover { fill: var(--brand); opacity: .08; }
.admin-chartbar { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; }
.admin-chartbar .admin-h { margin: 14px 0 8px; }

/* Segmented buttons: chart period, activity filter, score source. */
.admin-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line);
  border-radius: 9px; overflow: hidden; }
.admin-segbtn { background: var(--card); color: var(--ink-2); border: 0; font: inherit;
  font-size: 13px; padding: 6px 12px; cursor: pointer; border-left: 1px solid var(--line); }
.admin-segbtn:first-child { border-left: 0; }
.admin-segbtn:hover { background: var(--card-2); color: var(--ink); }
.admin-segbtn.on { background: var(--brand); color: var(--on-brand); font-weight: 600; }
.admin-segbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Labelled filters on the Users page. */
.admin-filters { align-items: flex-end; }
.admin-field { display: flex; flex-direction: column; min-width: 120px; }
.admin-field .admin-lbl { margin: 0 0 4px; }
.admin-field-wide { flex: 1 1 200px; }
.admin-field-btns { flex-direction: row; gap: 8px; flex-wrap: wrap; min-width: 0; }
.admin-date { cursor: pointer; min-width: 150px; }
.admin-input-sm { padding: 4px 6px; font-size: 13px; margin-left: 4px; }
.admin-input-block { width: 100%; box-sizing: border-box; }
.admin-filters-inline { display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }
.admin-filters-inline .admin-lbl { margin: 0; }
.admin-table td.nowrap, .admin-table .nowrap { white-space: nowrap; }

.admin-pager { flex-wrap: wrap; justify-content: space-between; }
.admin-pages { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }

/* Forms inside the shared modal, which centres its text. */
.admin-form { text-align: left; }
/* Referral codes: the three fields and the button on one row. */
.admin-ref-form{ display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1.3fr) minmax(0,1fr) auto;
  gap:10px 12px; align-items:end; }
.admin-ref-form .admin-err{ grid-column:1 / -1; margin:0; }
@media (max-width:760px){ .admin-ref-form{ grid-template-columns:1fr; } }
.admin-hint { margin: 4px 0 0; font-size: 12.5px; }
.admin-show { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.admin-rules { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px;
  color: var(--ink-3); text-align: left; }
.admin-rules li { padding: 2px 0; }
.admin-rules li::before { content: "○ "; }
.admin-rules li.ok { color: var(--ink); }
.admin-rules li.ok::before { content: "✓ "; color: var(--brand); font-weight: 700; }
.modal:has(#sess-box) { max-width: 760px; }
#sess-box .admin-table { font-size: 13px; }
.admin-audit td { font-size: 13.5px; }

/* Charts that answer the pointer, a finger and the arrow keys. */
.admin-chartbox { position: relative; touch-action: pan-y; border-radius: 8px; }
.admin-chartbox:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
.admin-chart .guide { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 3 3; }
.admin-chart .focus { fill: var(--card); stroke: var(--brand); stroke-width: 2.5; }
.admin-chart .band { fill: transparent; }
.admin-chart .band.on { fill: var(--brand); opacity: .07; }
.admin-chart .bar { transition: opacity .15s; }
.admin-chart .bar.on { opacity: 1; stroke: var(--ink); stroke-width: 1.5; }
.admin-tip { position: absolute; transform: translateX(-50%); pointer-events: none;
  background: var(--ink); color: var(--paper); border-radius: 8px; padding: 6px 10px;
  font-size: 12.5px; line-height: 1.3; white-space: nowrap; z-index: 2;
  box-shadow: 0 4px 14px rgba(0,0,0,.18); text-align: center; }
.admin-tip b { display: block; font-size: 14px; }
.admin-tip span { opacity: .8; }

/* Drawn in once when a page opens. */
.admin-anim .fill { animation: admin-fade .9s ease-out both; }
.admin-anim .dot { animation: admin-fade .4s .6s ease-out both; }
.admin-anim .bar { transform-box: fill-box; transform-origin: bottom;
  animation: admin-grow .6s cubic-bezier(.2,.7,.3,1) both; }
@keyframes admin-fade { from { opacity: 0; } }
@keyframes admin-grow { from { transform: scaleY(0); } }

/* Live pages: the badge, and a flash on any number that just changed. */
.admin-head-live { display: flex; justify-content: space-between; align-items: flex-start;
  gap: 12px; flex-wrap: wrap; }
.admin-live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px;
  color: var(--ink-2); background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 6px 4px 12px; margin-top: 6px; }
.admin-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #1f9d55;
  box-shadow: 0 0 0 0 rgba(31,157,85,.5); animation: admin-pulse 2s infinite; }
.admin-live.stale .admin-live-dot { background: var(--ink-3); animation: none; }
@keyframes admin-pulse { 70% { box-shadow: 0 0 0 7px rgba(31,157,85,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,157,85,0); } }
.admin-stat.admin-changed { animation: admin-flash 2.4s ease-out; }
@keyframes admin-flash { 0%, 30% { border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); } }

@media (prefers-reduced-motion: reduce) {
  .admin-anim .fill, .admin-anim .dot, .admin-anim .bar,
  .admin-live-dot, .admin-stat.admin-changed { animation: none; }
}

/* =====================================================================
   PROFESSOR DASHBOARD (frontend/professor.js, profcharts.js,
   professorpages.js). It renders in the "home" pack, like every page outside
   a course, so it inherits that pack's blue accent, hairlines and radii — and
   its rule that pixel sprites belong to the arcade pack only; icons here are
   inline SVG on currentColor. Tokens only, so light, dark and aurora work
   with no themes.css block.

   The --pf-* ramp is the one new colour: three steps of the home blue for
   the ordered work states (not started < in progress < done), run through
   the dataviz palette validator per theme — monotone lightness, visible step
   gaps, light end >= 2:1 against that theme's card. In the dark themes
   "more" is lighter, so the ramp runs the other way.
   ===================================================================== */
:root{ --pf-1:#E2C27E; --pf-2:#A86A0C; --pf-3:#5C3A00; }
@media (prefers-color-scheme:dark){
  :root:not([data-theme]){ --pf-1:#5A4412; --pf-2:#C9962E; --pf-3:#F5D78E; }
}
:root[data-theme="light"]{ --pf-1:#E2C27E; --pf-2:#A86A0C; --pf-3:#5C3A00; }
:root[data-theme="dark"],:root[data-theme="aurora"]{ --pf-1:#5A4412; --pf-2:#C9962E; --pf-3:#F5D78E; }

.topnav a[hidden]{ display:none; }
.page:has(> .prof-wrap){ max-width:1320px; }
.prof-wrap{ display:grid; grid-template-columns:228px minmax(0,1fr); gap:24px; align-items:start; }
.prof-wrap .wsub{ color:var(--ink-2); }

/* --- sidebar --- */
.prof-side{ position:sticky; top:96px; display:flex; flex-direction:column; gap:16px;
  background:var(--card); border:1px solid var(--line); border-radius:var(--rad,16px);
  box-shadow:var(--lift,none); padding:16px 12px; }
.prof-ic{ width:20px; height:20px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round; }
.prof-brand{ display:flex; align-items:center; gap:10px; padding:4px 6px 12px;
  border-bottom:1px solid var(--line); }
.prof-brand .prof-tile-ic{ color:var(--brand); }
.prof-brand b{ display:block; font-size:16px; line-height:1.2; }
.prof-brand span{ display:block; font-size:12.5px; color:var(--ink-2); line-height:1.3; }
.prof-nav{ display:flex; flex-direction:column; gap:2px; }
.prof-navlink{ display:flex; align-items:center; gap:11px; padding:10px 12px;
  border-radius:var(--rad-sm,10px); color:var(--ink-2); font-size:14.5px; font-weight:600; }
.prof-navlink:hover{ background:var(--card-2); color:var(--ink); }
.prof-navlink.on{ background:var(--brand); color:var(--on-brand); }
.prof-count{ margin-left:auto; min-width:22px; text-align:center; padding:1px 7px;
  border-radius:999px; background:var(--brand-soft); color:var(--brand-deep);
  font-size:12px; font-weight:700; line-height:1.6; }
.prof-navlink.on .prof-count{ background:var(--on-brand); color:var(--brand-deep); }
.prof-side-foot{ margin-top:auto; padding-top:12px; border-top:1px solid var(--line);
  display:flex; flex-direction:column; gap:8px; font-size:13.5px; }
.prof-who b{ display:block; color:var(--ink); }
.prof-who span{ color:var(--ink-3); font-size:12.5px; }
.prof-help{ color:var(--brand-deep); font-weight:600; font-size:13px; }

/* --- top bar: search, class, notifications --- */
.prof-top{ display:flex; gap:10px; align-items:center; margin-bottom:22px; }
.prof-search{ flex:1; max-width:480px; }
.prof-search input{ width:100%; border-radius:999px; padding:10px 16px; }
.prof-select{ padding:9px 12px; border-radius:10px; max-width:280px; }
.prof-menu{ display:none; }
.prof-bell{ position:relative; margin-left:auto; }
.prof-bell summary{ list-style:none; cursor:pointer; width:42px; height:42px; display:grid;
  place-items:center; border:1px solid var(--line); border-radius:999px;
  background:var(--card); color:var(--ink-2); position:relative; }
.prof-bell summary::-webkit-details-marker{ display:none; }
.prof-bell summary:hover{ color:var(--ink); border-color:var(--brand); }
.prof-bell svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.6;
  stroke-linecap:round; stroke-linejoin:round; }
.prof-bell summary .prof-count{ position:absolute; top:-5px; right:-6px; margin:0;
  background:var(--red); color:#3a0c0d; }
.prof-bell-pop{ position:absolute; right:0; top:50px; width:330px; z-index:30;
  padding:10px !important; display:flex; flex-direction:column; gap:2px; }
.prof-bell-pop a{ display:flex; flex-direction:column; padding:9px 10px; border-radius:10px;
  font-size:13.5px; }
.prof-bell-pop a:hover{ background:var(--card-2); }
.prof-bell-pop a span{ color:var(--ink-2); font-size:12.5px; }

/* --- greeting --- */
.prof-hello{ display:flex; justify-content:space-between; align-items:flex-end; gap:18px;
  flex-wrap:wrap; margin-bottom:12px; }
.prof-hello h1,.prof-head h1{ font-size:30px; margin:4px 0; }
.prof-today{ display:flex; flex-direction:column; align-items:flex-start; gap:8px; }
.prof-byte{ display:flex; gap:12px; align-items:center; max-width:440px; padding:10px 16px;
  border-radius:var(--rad-sm,10px); background:var(--brand-soft); color:var(--brand-deep); }
.prof-byte p{ margin:0; font-size:14px; line-height:1.5; color:var(--brand-deep); font-weight:600; }
.prof-reasons{ align-items:flex-start; }
.prof-reasons b{ color:var(--brand-deep); }
.prof-reasons ul{ margin:4px 0 0 18px; font-size:13.5px; color:var(--brand-deep); }
.prof-crumbs{ font-size:13.5px; color:var(--ink-2); margin-bottom:8px; }
.prof-crumbs a{ color:var(--brand-deep); font-weight:600; }

/* --- the filter row: scopes everything below it --- */
.prof-filters{ display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin:8px 0 18px; }
.prof-fl{ font-size:12px; color:var(--ink-3); text-transform:uppercase; letter-spacing:.06em; }
.prof-seg{ display:inline-flex; border:1px solid var(--line); border-radius:999px; padding:3px;
  background:var(--card); }
.prof-seg button{ border:0; background:none; padding:6px 13px; border-radius:999px; cursor:pointer;
  color:var(--ink-2); font:inherit; font-size:13px; font-weight:600; }
.prof-seg button:hover{ color:var(--ink); }
.prof-seg button[aria-pressed="true"]{ background:var(--brand); color:var(--on-brand); }
.prof-gen{ margin-left:auto; font-size:12.5px; }

/* --- stat tiles --- */
/* Flex, not grid: a wrapped last row stretches instead of leaving a hole. */
.prof-kpis{ display:flex; flex-wrap:wrap; gap:14px; margin-bottom:18px; }
.prof-kpis > .prof-tile{ flex:1 1 170px; }
.prof-wrap .prof-tile{ display:flex; gap:12px; align-items:flex-start; padding:16px; margin:0; }
.prof-tile-body{ min-width:0; flex:1; }
.prof-tile-ic{ flex:0 0 40px; height:40px; border-radius:12px; background:var(--brand-soft);
  color:var(--brand-deep); display:grid; place-items:center; }
.prof-tile-k{ font-size:13px; font-weight:600; color:var(--ink-2); }
.prof-tile-v{ font-size:28px; font-weight:800; line-height:1.15; margin:2px 0 2px; color:var(--ink); }
.prof-tile-v .na{ font-size:15px; font-weight:600; color:var(--ink-3); }
.prof-delta{ font-size:12.5px; color:var(--ink-2); line-height:1.4; }
.prof-meter{ height:8px; margin-top:8px; border-radius:999px; background:var(--brand-soft); overflow:hidden; }
.prof-meter > div{ height:100%; border-radius:999px; background:var(--brand); }

/* --- cards and rows --- */
/* Rows respond to the width of the main column, not the window: with the
   sidebar open, a 1024px window leaves ~560px, too narrow for two tables. */
.prof-main{ min-width:0; container-type:inline-size; }
.prof-row{ display:grid; gap:18px; margin-bottom:18px; align-items:start; }
.prof-row-21{ grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.prof-row-11{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
/* After the two rules above, which it must beat at equal specificity. */
@container (max-width:780px){
  .prof-row-21,.prof-row-11{ grid-template-columns:minmax(0,1fr); }
}
.prof-wrap .prof-card{ padding:20px 22px; margin:0 0 18px; min-width:0; }
.prof-row > .prof-card{ margin:0; }
.prof-card-h{ display:flex; align-items:center; justify-content:space-between; gap:10px; flex-wrap:wrap; }
.prof-card-h h2{ font-size:18px; margin:0; }
.prof-card-sub{ font-size:13px; margin:4px 0 12px; }
.prof-link{ font-size:13.5px; font-weight:600; color:var(--brand-deep); }
.prof-empty{ color:var(--ink-2); font-size:14px; padding:12px 0; }
.prof-loading{ opacity:.55; transition:opacity .2s; }

/* --- charts --- */
.prof-chartbox{ position:relative; }
.prof-chartbox[data-chart="line"]{ min-height:230px; }
.prof-chartbox[data-chart="hist"]{ min-height:220px; }
.prof-chart{ display:block; overflow:visible; max-width:100%; }
.prof-chart:focus-visible{ outline:3px solid var(--focus); outline-offset:4px; border-radius:8px; }
.prof-chart .grid{ stroke:var(--line); stroke-width:1; }
.prof-chart .tick{ fill:var(--ink-3); font-size:11px; font-family:var(--font-sans); }
.prof-chart .line{ fill:none; stroke:var(--brand); stroke-width:2; stroke-linejoin:round; stroke-linecap:round; }
.prof-chart .area{ fill:var(--brand); opacity:.1; }
.prof-chart .end,.prof-chart .hover{ fill:var(--brand); stroke:var(--card); stroke-width:2; }
.prof-chart .endlbl{ fill:var(--ink); font-size:12px; font-weight:700; font-family:var(--font-sans);
  paint-order:stroke; stroke:var(--card); stroke-width:4px; stroke-linejoin:round; }
.prof-chart .cross{ stroke:var(--ink-3); stroke-width:1; }
.prof-bars .bar{ fill:var(--brand); }
.prof-bars .band:hover .bar,.prof-bars .band:focus-within .bar{ opacity:.78; }
.prof-bars .hit{ fill:transparent; }
.prof-bars .hit:focus{ outline:none; }
.prof-bars .band:focus-within .hit{ stroke:var(--focus); stroke-width:2; }
.prof-bars .cap{ fill:var(--ink-2); font-size:11px; font-weight:700; font-family:var(--font-sans); }
.prof-bars .ref + .tick{ fill:var(--ink-2); }
.prof-bars .ref{ stroke:var(--ink-3); stroke-width:1; }
.prof-tip{ position:absolute; z-index:5; transform:translate(-50%,-100%); pointer-events:none;
  display:flex; gap:8px; align-items:baseline; white-space:nowrap; padding:6px 10px;
  border-radius:8px; background:var(--ink); color:var(--paper); font-size:12.5px;
  box-shadow:var(--lift,none); }
.prof-tip b{ font-size:14px; }
.prof-tip[hidden]{ display:none; }
.prof-datatable{ margin-top:10px; font-size:13px; }
.prof-datatable summary{ cursor:pointer; color:var(--ink-2); font-size:12.5px; }
.prof-datatable table{ margin-top:8px; }

.prof-donut{ display:flex; align-items:center; justify-content:center; gap:20px; flex-wrap:wrap; padding:6px 0; }
.prof-donut .prof-chartbox{ width:176px; }
.prof-donut-svg{ width:176px; height:176px; display:block; }
.prof-donut-svg .track{ fill:none; stroke:var(--card-2); stroke-width:22; }
.prof-donut-svg .seg{ fill:none; stroke-width:22; }
.prof-donut-svg .seg:focus{ outline:none; stroke-width:27; }
.prof-donut-svg .seg.pf-1{ stroke:var(--pf-1); }
.prof-donut-svg .seg.pf-2{ stroke:var(--pf-2); }
.prof-donut-svg .seg.pf-3{ stroke:var(--pf-3); }
.prof-donut-svg .big{ fill:var(--ink); font-size:28px; font-weight:800; font-family:var(--font-sans); }
.prof-donut-svg .sub{ fill:var(--ink-2); font-size:12px; font-family:var(--font-sans); }
.prof-legend{ list-style:none; padding:0; margin:0; display:grid; gap:9px; font-size:14px; min-width:170px; }
.prof-legend li{ display:grid; grid-template-columns:14px 1fr auto 42px; gap:8px; align-items:center; }
.prof-legend .wsub{ font-size:12.5px; text-align:right; }
.prof-legend .sw{ width:12px; height:12px; border-radius:3px; }
.sw.pf-1{ background:var(--pf-1); } .sw.pf-2{ background:var(--pf-2); } .sw.pf-3{ background:var(--pf-3); }

/* --- tables, lists --- */
.prof-table td{ vertical-align:middle; }
.prof-table a{ font-weight:600; }
.prof-table a:hover{ color:var(--brand-deep); }
.prof-rank{ display:inline-grid; place-items:center; width:24px; height:24px; border-radius:999px;
  background:var(--card-2); font-size:12px; font-weight:700; }
.prof-rank.r1{ background:var(--coin); color:#3d2a00; }
.prof-attn{ list-style:none; padding:0; margin:0; display:grid; gap:8px; }
.prof-attn li{ display:flex; flex-direction:column; gap:2px; padding:10px 12px;
  border-radius:10px; background:var(--card-2); }
.prof-attn span{ font-size:13px; color:var(--ink-2); }
.prof-chips{ display:flex; flex-wrap:wrap; gap:8px; margin-bottom:14px; }
.prof-chip{ border:1px solid var(--line); background:var(--card); border-radius:999px; cursor:pointer;
  padding:7px 14px; color:var(--ink-2); font:inherit; font-size:13.5px; font-weight:600; }
.prof-chip b{ margin-left:4px; color:var(--ink); }
.prof-chip[aria-pressed="true"]{ background:var(--brand-soft); color:var(--brand-deep); border-color:transparent; }
.prof-workcell{ display:flex; align-items:center; gap:8px; min-width:140px; }
.prof-workcell .prof-meter{ flex:1; margin:0; }
.prof-workcell span{ font-size:12.5px; color:var(--ink-2); white-space:nowrap; }
.prof-levelrow{ display:grid; grid-template-columns:110px 1fr auto; gap:12px; align-items:center; padding:7px 0; font-size:14px; }
.prof-levelrow .prof-meter{ margin:0; }
.prof-wrap .mastery-name{ flex-basis:150px; font-size:13px; }
.prof-wrap .mastery-state{ flex:0 0 92px; font-size:12.5px; color:var(--ink-2); text-align:right; }
.prof-below{ flex:0 0 118px; font-size:12px; text-align:right; }
.prof-feed{ list-style:none; padding:0; margin:0; }
.prof-feed li{ display:grid; grid-template-columns:96px 1fr auto; gap:10px; padding:9px 0;
  border-bottom:1px solid var(--line); font-size:14px; }
.prof-feed li:last-child{ border-bottom:0; }
.prof-proj{ display:flex; flex-direction:column; gap:2px; padding:12px 14px; margin-top:8px;
  border:1px solid var(--line); border-radius:10px; }
.prof-proj:hover{ border-color:var(--brand); }
.prof-dl{ display:flex; flex-wrap:wrap; gap:8px; }
.prof-actions{ display:flex; flex-wrap:wrap; gap:14px; }
.prof-actions > .prof-action{ flex:1 1 220px; }
.prof-wrap .prof-action{ display:flex; gap:12px; padding:18px; margin:0; }
.prof-wrap .prof-action h3{ font-size:16px; margin:0 0 4px; }
.prof-wrap .prof-action p{ font-size:13.5px; margin:0 0 12px; color:var(--ink-2); }
.prof-gate{ max-width:520px; margin:48px auto; text-align:center; }
.prof-gate h1{ font-size:24px; margin:10px 0 6px; }
.prof-gate .prof-tile-ic,.prof-none .prof-tile-ic{ margin:0 auto; width:52px; height:52px; }
.prof-gate .actions{ display:flex; gap:10px; justify-content:center; margin-top:16px; flex-wrap:wrap; }

@media (max-width:980px){
  .prof-wrap{ grid-template-columns:1fr; }
  .prof-side{ position:static; display:none; }
  .prof-side.open{ display:flex; }
  .prof-menu{ display:inline-flex; }
}
@media (max-width:640px){
  .prof-top{ flex-wrap:wrap; }
  .prof-search{ order:3; flex-basis:100%; max-width:none; }
  .prof-hello h1,.prof-head h1{ font-size:24px; }
  .prof-today{ align-items:flex-start; }
  .prof-gen{ margin-left:0; }
  .prof-feed li{ grid-template-columns:1fr; gap:2px; }
  .prof-bell-pop{ width:min(330px, calc(100vw - 32px)); }
}

/* ---------- the professors' Teaching tab (index.html #nav-teach) ----------
   Hidden for everyone until app.js sees role "professor". Unlike the rest of
   the top nav it survives narrow screens — there it is a professor's only
   way back to their classes — so it collapses to its icon instead of
   disappearing. These rules sit at the end of the file on purpose: they must
   beat the earlier ".topnav{display:none}" breakpoints at equal specificity. */
.topnav a.nav-teach:not([hidden]){ display:inline-flex; align-items:center; gap:7px; }
.nav-teach-ic{ width:17px; height:17px; flex:0 0 auto; fill:none; stroke:currentColor;
  stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round; }
@media (max-width:900px){
  [data-pack="arcade"] .topnav{ display:flex; }
  [data-pack="arcade"] .topnav a:not(.nav-teach){ display:none; }
}
@media (max-width:640px){
  .topnav{ display:flex; margin-left:0; }
  .topnav a:not(.nav-teach){ display:none; }
  .topnav a.nav-teach:not([hidden]){ padding:8px; }
  .nav-teach-t{ position:absolute; width:1px; height:1px; overflow:hidden;
    clip:rect(0 0 0 0); white-space:nowrap; }
}

/* ---- Task grading (grading.js, profgrading.js) ----
   Tokens only, so it follows whichever course pack and theme is active. */
.gr-intro{ font-size:14.5px; color:var(--ink-2); margin-bottom:12px; line-height:1.6; }
.gr-answer{ min-height:240px; width:100%; }
.gr-actions{ display:flex; gap:14px; align-items:center; flex-wrap:wrap; margin-top:12px; }
.gr-count{ font-size:13px; color:var(--ink-3); }
.gr-count.gr-short{ color:var(--amber-deep, var(--ink-2)); font-weight:700; }
.gr-rubric, .gr-history, .gr-points{ margin-top:16px; font-size:14px; }
.gr-rubric summary, .gr-history summary, .gr-points summary{ cursor:pointer; font-weight:700; padding:6px 0; }
.gr-rubric .pj-rubric{ margin-top:10px; }
.gr-rubric .pj-rubric th{ text-align:left; padding:8px 12px; font-size:12px; color:var(--ink-2); }
.gr-explain{ margin:10px 0 0 20px; line-height:1.65; color:var(--ink-2); }
.gr-explain li{ margin-bottom:6px; }
.gr-result{ margin-top:18px; padding:18px 20px; border:3px solid var(--edge); background:var(--card-2); }
.gr-result.gr-passed{ border-color:var(--brand); }
.gr-result.gr-revise{ border-color:var(--amber); }
.gr-result.gr-not_graded{ border-color:var(--red); }
.gr-result-h{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.gr-score{ font-size:15px; color:var(--ink-2); }
.gr-score b{ font-size:24px; color:var(--ink); font-variant-numeric:tabular-nums; }
.gr-when{ margin-left:auto; font-size:12.5px; color:var(--ink-3); }
.gr-how{ margin:12px 0 0; font-size:14px; line-height:1.6; color:var(--ink-2); }
.gr-issues, .gr-notes{ margin:12px 0 0 20px; font-size:14px; line-height:1.6; }
.gr-notes{ color:var(--ink-2); }
.gr-flag{ margin-top:12px; font-size:14px; font-weight:700; }
.gr-crits{ list-style:none; padding:0; margin:14px 0 0; }
.gr-crit{ padding:14px 0; border-top:2px solid var(--line, var(--edge)); }
.gr-crit-h{ display:flex; gap:10px; align-items:baseline; flex-wrap:wrap; }
.gr-weight{ font-size:12.5px; color:var(--ink-3); }
.gr-level{ margin-left:auto; display:inline-flex; gap:8px; align-items:center; font-size:13.5px; font-weight:700; }
.gr-level-none{ font-weight:500; color:var(--ink-3); }
.gr-pips{ display:inline-flex; gap:3px; }
.gr-pips i{ width:14px; height:10px; border:2px solid var(--edge); background:transparent; }
.gr-pips i.on{ background:var(--brand); }
.gr-looks{ margin:4px 0 0; font-size:13px; color:var(--ink-3); line-height:1.5; }
.gr-fb{ margin:8px 0 0; font-size:14.5px; line-height:1.6; }
.gr-by{ display:inline-block; margin-top:8px; font-size:12px; color:var(--ink-3); }
.gr-review{ margin-top:14px; padding:14px 16px; border-left:5px solid var(--brand); background:var(--brand-soft); }
.gr-review .px{ font-size:8px; color:var(--ink-2); }
.gr-review p{ margin:8px 0 0; font-size:14.5px; line-height:1.65; white-space:pre-wrap; }
.gr-small{ font-size:13px; color:var(--ink-3); line-height:1.55; margin-top:10px; }
.gr-points ul{ list-style:none; padding:0; margin:8px 0 0; }
.gr-points li{ display:flex; gap:10px; padding:6px 0; line-height:1.5; }
.gr-pt-mark{ flex:none; width:18px; font-weight:800; }
.gr-pt-missing{ color:var(--ink-2); }
.gr-history ol{ margin:8px 0 0 22px; line-height:1.7; color:var(--ink-2); }
#gr-ask{ margin-top:14px; }
.gr-rev{ display:flex; flex-direction:column; gap:4px; margin:0 0 14px; font-size:14px; }
.gr-rev select{ padding:9px 10px; font-size:14px; color:var(--ink); background:var(--card-2); border:2px solid var(--edge); }
.gr-rev-auto{ font-style:italic; }
.mark-grid details.mark-work{ margin-top:14px; }
.mark-grid details.mark-work summary{ cursor:pointer; }

/* --- hover glossary (lesson pages, 2026-11-17) -----------------------
   hoverglossary.js marks the first use of each term; the card lives in
   #gloss-layer on <body>. Tokens only, so it follows every pack and theme.
   The card's background stacks --card over --paper: aurora's --card is
   translucent, and lesson text showing through a definition is unreadable. */
.gloss{
  cursor:help; border-radius:2px;
  text-decoration:underline dotted var(--brand); text-decoration-thickness:1.5px;
  text-underline-offset:3px; -webkit-text-decoration:underline dotted var(--brand);
}
.gloss:hover, .gloss.is-open{ background:var(--brand-soft); text-decoration-style:solid; }
.gloss:focus-visible{ outline:2px solid var(--focus); outline-offset:2px; }
.gloss-sample{
  text-decoration:underline dotted var(--brand); text-decoration-thickness:1.5px;
  text-underline-offset:3px;
}
.gloss-note{ margin:0 0 18px; font-size:13px; line-height:1.55; color:var(--ink-3); }
#gloss-layer{ position:absolute; top:0; left:0; width:0; height:0; z-index:80; }
.gloss-tip{
  position:absolute; box-sizing:border-box; width:max-content;
  max-width:min(340px, calc(100vw - 24px)); padding:14px 16px;
  background:linear-gradient(var(--card), var(--card)), var(--paper);
  color:var(--ink); border:1px solid var(--line-strong, var(--line));
  border-radius:var(--rad-sm, 8px); box-shadow:0 14px 36px rgba(0,0,0,.28);
  font-family:var(--font-sans); font-size:14px; line-height:1.5; text-align:left;
}
.gloss-tip[hidden]{ display:none; }
.gloss-tip dl{ margin:0; }
.gloss-tip dt{ margin-top:10px; font-size:12px; font-weight:600; color:var(--ink-3); }
.gloss-tip dt:first-child{ margin-top:0; }
.gloss-tip dd{ margin:2px 0 0; color:var(--ink-2); }
.gloss-tip dd.gloss-tip-term{ font-size:16px; font-weight:700; color:var(--ink); }

