/* =========================================================================
   THE FILTER AI · design system (Console theme)
   Tokens + components. Mobile-first, responsive at 640px / 1100px.

   One accent colour: green. Calm near-black ground, no starfield, no moon.
   Signal colours (green safe, red threat, amber cost) survive only inside the
   game's own feedback, never as UI chrome. Nothing renders below 14px and
   body copy is 18px. No dividers: sections are separated by space and
   surface, never by rules.
   ========================================================================= */

:root{
  /* Colour */
  --bg:#0B0D11;
  --bg-raised:#0E1116;
  --surface:#12151B;
  --surface-2:#1A1F27;
  --surface-3:#1F242D;
  --surface-current:#141A1A;
  --border:#232935;
  --border-strong:#2E3542;
  --line:#232935;
  --line-soft:#1A1F27;
  --text:#ECEEF2;
  --text-2:#B4BBC7;
  --text-3:#8F98A7;
  --read:#B4BBC7;
  --muted:#8F98A7;
  --accent:#5FE3A1;
  --accent-hover:#9AF2C6;
  --accent-ink:#05261A;
  --accent-soft:#11281E;
  --accent-line:#2C5E47;

  /* Legacy names, all mapped onto the one accent */
  --brand:#5FE3A1;
  --brand-hi:#9AF2C6;
  --brand-lo:#5FE3A1;
  --violet:#5FE3A1;
  --on-accent:#05261A;

  /* Signal colours, used only inside the game's own feedback */
  --safe:#4ade8a;
  --threat:#ff5a72;
  --amber:#e8b33c;

  --radius-sm:8px;
  --radius:12px;
  --radius-lg:16px;
  --shadow:none;
  --tap:44px;

  /* Type */
  --mono:"IBM Plex Mono",ui-monospace,"SF Mono",Menlo,Consolas,monospace;
  --display:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --body:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --text-xs:.875rem;
  --text-sm:1rem;
  --text-base:1.125rem;
  --text-md:1.25rem;
  --text-lg:1.375rem;
  --text-xl:1.75rem;
  --text-2xl:2.25rem;
  --text-3xl:3rem;
  --leading-body:1.6;
  --leading-tight:1.15;
  --text-body:var(--text-base);
  --text-prompt:1.25rem;
  --text-display:var(--text-lg);
  --text-mono:var(--text-xs);

  /* Layout */
  --container:1280px;
  --gutter:32px;
  --header-h:72px;

  /* Component surfaces only. Page background and theme effects stay above. */
  --card-panel:#171B1A;
  --reading-panel:#171B1A;
  --prompt-inset:#101512;
  --reading-text:#F5F7F5;
  --supporting-text:#BFC9C2;
  --component-border:#2A4437;
  --component-accent:#00ED8A;
  --component-accent-hover:#59FFBB;
  --component-ink:#062116;
  --component-glow:radial-gradient(ellipse 85% 115% at 100% 100%,rgba(0,237,138,.09) 0%,rgba(0,237,138,.025) 42%,transparent 74%);
}
@media (max-width:640px){
  :root{--gutter:20px;--text-2xl:1.875rem;--text-3xl:2.25rem;--text-prompt:1.125rem}
}

/* ---------- reset ---------- */
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{margin:0;min-height:100vh}
body{
  color:var(--text);
  font-family:var(--body);
  font-size:var(--text-base);
  line-height:var(--leading-body);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
}
button{font-family:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
[hidden]{display:none!important}


.skip{
  position:absolute;left:-9999px;top:0;z-index:100;
  background:var(--brand);color:var(--on-accent);
  padding:.8rem 1.2rem;border-radius:0 0 10px 0;font-weight:600;text-decoration:none;
}
.skip:focus{left:0}

/* ---------- layout ---------- */
.app{
  position:relative;z-index:1;
  max-width:620px;margin:0 auto;padding:32px var(--gutter) 80px;
}
.stage{min-width:0}
.levelmap{display:none}

/* Wide views break out of the reading column. */
body.view-hub .app,body.view-range .app,body.view-lab .app,body.view-certificate .app,body.view-syllabus .app{max-width:var(--container)}

@media (min-width:1024px){
  body.view-course .app{
    max-width:960px;display:grid;grid-template-columns:104px minmax(0,620px);
    justify-content:center;gap:32px;align-items:start;padding-top:28px;
  }
  body.view-course .levelmap{
    display:flex;flex-direction:column;gap:6px;position:sticky;top:96px;
  }
  .levelmap .lm-title{
    font-family:var(--mono);font-size:14px;letter-spacing:.1em;text-transform:uppercase;
    color:var(--muted);margin-bottom:6px;padding-left:2px;
  }
  .lm-item{
    display:flex;align-items:center;gap:8px;
    font-family:var(--mono);font-size:14px;color:var(--muted);
    padding:5px 8px;border-radius:8px;border:1px solid transparent;
  }
  .lm-item .n{width:20px;text-align:right;font-weight:700}
  .lm-item.done{color:var(--safe)}
  .lm-item.done .n::after{content:" ✓"}
  .lm-item.current{color:var(--text);border-color:var(--line);background:var(--surface)}
  .lm-item.locked{opacity:.45}
  .lm-item .tier{font-size:14px;letter-spacing:.05em;text-transform:uppercase}
}

/* ---------- course HUD line (course view only) ---------- */
.course-hud{margin-bottom:22px}
.course-hud .row{
  display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px;
  font-family:var(--mono);font-size:14px;color:var(--muted);letter-spacing:.04em;
}
.course-hud .row b{color:var(--text);font-weight:600}
.progress-track{height:6px;background:var(--surface-2);border-radius:99px;overflow:hidden}
.progress-fill{
  height:100%;width:0;background:var(--accent);
  transition:width .45s ease;
}

.kbd{font-family:var(--mono);font-size:14px;color:var(--muted);margin-left:6px}
@media (max-width:639px){ .kbd{display:none} }

/* ---------- shared headings ---------- */
.prompt-line{font-family:var(--display);font-weight:600;font-size:var(--text-prompt);margin:2px 0 12px;line-height:1.4}
.hint{font-family:var(--mono);font-size:var(--text-mono);color:var(--muted);margin-bottom:16px}

/* ---------- TYPE 1: allow / block ---------- */
.inbox{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.inbox-head{
  display:flex;align-items:center;gap:8px;padding:11px 14px;background:var(--surface-2);
  font-family:var(--mono);font-size:14px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);
}
.inbox-head .live{
  width:8px;height:8px;border-radius:50%;background:var(--brand);
  box-shadow:0 0 0 0 rgba(61,219,163,.5);animation:pulse 2s infinite;
}
@keyframes pulse{
  0%{box-shadow:0 0 0 0 rgba(61,219,163,.5)}
  70%{box-shadow:0 0 0 7px rgba(61,219,163,0)}
  100%{box-shadow:0 0 0 0 rgba(61,219,163,0)}
}
.inbox-body{padding:16px 15px}
.meta{font-family:var(--mono);font-size:14px;color:var(--muted);margin-bottom:9px}
.ptext{font-size:var(--text-prompt);line-height:1.6;white-space:pre-wrap;word-break:break-word}

.card{margin-top:12px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:12px 13px}
.card .from{font-family:var(--mono);font-size:14px;color:var(--muted);margin-bottom:6px}
.card .body{font-size:16px;line-height:1.55;white-space:pre-wrap;word-break:break-word;color:var(--text)}

.verdict-row{display:grid;grid-template-columns:1fr;gap:10px;margin-top:16px}
.vbtn{
  font-family:var(--display);font-weight:600;font-size:16px;
  min-height:56px;padding:14px;border-radius:12px;cursor:pointer;
  border:1px solid var(--line);background:var(--surface-2);color:var(--text);
  transition:transform .1s,border-color .15s,background .15s;touch-action:manipulation;
}
@media (hover:hover){
  .vbtn:hover{transform:translateY(-1px)}
  .vbtn.allow:hover{border-color:var(--safe);background:rgba(74,222,138,.1)}
  .vbtn.block:hover{border-color:var(--threat);background:rgba(255,90,114,.1)}
}

/* ---------- TYPE 2: tap the injection ---------- */
.doc{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);overflow:hidden}
.doc-head{
  display:flex;align-items:center;gap:8px;padding:11px 14px;background:var(--surface-2);
  font-family:var(--mono);font-size:14px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);
}
.doc-head .dot{width:8px;height:8px;border-radius:50%;background:var(--amber)}
.doc-body{padding:16px 15px;font-size:var(--text-prompt);line-height:1.9}

.seg{
  border-radius:6px;padding:2px 3px;cursor:pointer;
  transition:background .12s,box-shadow .12s;
  -webkit-tap-highlight-color:transparent;touch-action:manipulation;
}
.seg:focus-visible{outline:2px solid var(--brand)}
.seg.pick-wrong{background:rgba(255,90,114,.22);box-shadow:inset 0 0 0 1px var(--threat)}
.seg.pick-right{background:rgba(74,222,138,.24);box-shadow:inset 0 0 0 1px var(--safe)}
.seg.reveal{background:rgba(74,222,138,.14);box-shadow:inset 0 0 0 1px rgba(74,222,138,.5)}
.locked .seg{cursor:default}
@media (hover:hover){
  .seg:hover{background:rgba(61,219,163,.12)}
  .locked .seg:hover{background:transparent}
  .locked .seg.pick-wrong:hover{background:rgba(255,90,114,.22)}
  .locked .seg.pick-right:hover,.locked .seg.reveal:hover{background:rgba(74,222,138,.2)}
}
@media (max-width:639px){
  .doc-body{line-height:1.6}
  .seg{display:block;padding:12px;margin:6px 0;min-height:44px;border:1px solid var(--line);background:var(--surface-2)}
}

/* ---------- TYPE 3: name the technique ---------- */
.scenario{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 15px;font-size:var(--text-prompt);line-height:1.6;margin-bottom:16px;white-space:pre-wrap;
}
.opts{display:flex;flex-direction:column;gap:10px}
.opt{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  background:var(--surface);border:1px solid var(--line);border-radius:12px;
  padding:14px 15px;color:var(--text);font-family:var(--mono);font-size:16px;
  cursor:pointer;min-height:52px;transition:border-color .15s,background .15s;touch-action:manipulation;
}
.opt .radio{flex:0 0 auto;width:16px;height:16px;border-radius:50%;border:2px solid var(--muted)}
.opt.sel .radio{border-color:var(--brand);background:radial-gradient(circle,var(--brand) 42%,transparent 46%)}
.opt.correct{border-color:var(--safe);background:rgba(74,222,138,.1)}
.opt.correct .radio{border-color:var(--safe);background:radial-gradient(circle,var(--safe) 42%,transparent 46%)}
.opt.wrong{border-color:var(--threat);background:rgba(255,90,114,.1)}
.opt.wrong .radio{border-color:var(--threat);background:radial-gradient(circle,var(--threat) 42%,transparent 46%)}
.opt.dim{opacity:.5}
.opt[disabled]{cursor:default}
@media (hover:hover){ .opt:not([disabled]):hover{border-color:var(--brand)} }
.retry-note{font-family:var(--mono);font-size:14px;color:var(--amber);margin-top:12px;min-height:1px}

/* ---------- feedback ---------- */
.fb{margin-top:16px;border-radius:12px;border:1px solid var(--line);padding:14px 15px;font-size:var(--text-body);line-height:1.6}
.fb.right{background:rgba(74,222,138,.07);border-color:rgba(74,222,138,.3)}
.fb.wrong{background:rgba(255,90,114,.07);border-color:rgba(255,90,114,.35)}
.fb .head{
  font-family:var(--mono);font-weight:700;font-size:14px;letter-spacing:.05em;
  text-transform:uppercase;margin-bottom:9px;display:flex;flex-wrap:wrap;gap:8px;align-items:center;
}
.fb.right .head .res{color:var(--safe)}
.fb.wrong .head .res{color:var(--threat)}
.chip{
  font-family:var(--mono);font-size:14px;letter-spacing:.04em;text-transform:uppercase;
  padding:2px 8px;border-radius:999px;border:1px solid var(--line);color:var(--muted);
}
.chip.tech{color:var(--brand);border-color:rgba(61,219,163,.4)}
.chip.safe{color:var(--safe);border-color:rgba(74,222,138,.4)}
.chip.xp{color:var(--amber);border-color:rgba(232,179,60,.4)}

.fb-why{margin-top:2px}
.fb-label{font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:5px}
.fb-text{font-size:var(--text-body);line-height:1.6}
.impact{margin-top:14px;background:var(--surface-2);border-radius:10px;padding:12px 13px}
.impact-label{font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:5px}
.impact-headline{font-family:var(--display);font-weight:700;font-size:16px;line-height:1.35;margin-bottom:5px}
.impact.threat .impact-headline{color:var(--threat)}
.impact.benign .impact-headline{color:var(--amber)}
.impact-detail{font-size:14px;line-height:1.55;color:var(--read)}

/* ---------- exercise topline ---------- */
.ex-topline{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.ex-count{font-family:var(--mono);font-size:var(--text-mono);color:var(--muted);letter-spacing:.04em}
.ex-diff{
  font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;
  padding:3px 9px;border-radius:999px;border:1px solid var(--line);color:var(--muted);
}
.ex-diff.easy{color:var(--safe);border-color:rgba(74,222,138,.4)}
.ex-diff.medium{color:var(--amber);border-color:rgba(232,179,60,.4)}
.ex-diff.hard{color:var(--threat);border-color:rgba(255,90,114,.4)}

/* ---------- teach / concept card ---------- */
.unit-tag{font-family:var(--mono);font-size:var(--text-mono);color:var(--violet);letter-spacing:.05em;margin-bottom:10px}
.teach{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:22px 20px;box-shadow:none}
.teach-label{font-family:var(--mono);font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.teach-heading{
  font-family:var(--display);font-weight:700;font-size:clamp(19px,4.5vw,24px);
  line-height:1.25;letter-spacing:-.01em;margin:0 0 14px;
}
.teach-body{color:var(--read);font-size:var(--text-body);line-height:1.7}
.teach-body p{margin:0 0 12px}
.teach-body p:last-child{margin-bottom:0}
.teach-body b,.teach-body strong{color:var(--text)}
.teach-example{margin:16px 0 4px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:13px 14px}
.teach-example .ex-label{font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;color:var(--brand);margin-bottom:6px}
.teach-example .ex-body{font-size:var(--text-body);line-height:1.55;color:var(--text);white-space:pre-wrap}
.teach-key{
  margin-top:16px;background:var(--surface-2);border-left:3px solid var(--brand);
  border-radius:0 8px 8px 0;padding:11px 14px;font-style:italic;color:var(--text);
  font-size:var(--text-body);line-height:1.5;
}

/* ---------- unit complete ---------- */
.unit-complete{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:26px 20px;text-align:center}
.uc-badge{
  display:inline-block;font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--safe);border:1px solid rgba(74,222,138,.4);border-radius:999px;padding:4px 11px;margin-bottom:14px;
}
.unit-complete h2{font-family:var(--display);font-weight:700;font-size:var(--text-display);margin:0 0 6px}
.uc-sub{color:var(--read);font-size:var(--text-body);margin:0 0 4px}

/* ---------- intro / gate / complete panels ---------- */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:24px 20px;box-shadow:none}
.panel h1{font-family:var(--display);font-weight:700;font-size:clamp(26px,7vw,36px);letter-spacing:-.02em;margin:0 0 14px}
.panel h1 .b{color:var(--brand)}
.panel h2{font-family:var(--display);font-weight:700;font-size:var(--text-display);margin:0 0 12px}
.panel p{color:var(--read);font-size:var(--text-body);line-height:1.7;margin:0 0 14px}
.panel p b,.panel p strong{color:var(--text)}
.panel p a{color:var(--brand)}
.panel .lede{color:var(--text);font-size:var(--text-prompt);line-height:1.6}
.tagline{font-family:var(--mono);font-size:14px;color:var(--violet);letter-spacing:.04em;margin-bottom:18px}

.howto{list-style:none;padding:0;margin:4px 0 20px;display:grid;gap:8px}
.howto li{
  display:flex;gap:12px;align-items:flex-start;padding:11px 12px;border-radius:11px;
  background:var(--surface-2);font-size:var(--text-body);color:var(--read);line-height:1.5;
}
.howto .ic{
  flex:0 0 auto;width:26px;height:26px;border-radius:8px;background:var(--surface-3);
  display:grid;place-items:center;font-family:var(--mono);font-size:14px;color:var(--brand);font-weight:700;
}
.howto b{color:var(--text)}

.gate-badge{
  display:inline-block;font-family:var(--mono);font-size:14px;letter-spacing:.08em;text-transform:uppercase;
  color:var(--safe);border:1px solid rgba(74,222,138,.4);border-radius:999px;padding:4px 11px;margin-bottom:14px;
}
.gate-badge.pro{color:var(--violet);border-color:rgba(95,227,161,.45)}
.covers{display:flex;flex-wrap:wrap;gap:7px;margin:6px 0 22px}
.covers .t{font-family:var(--mono);font-size:14px;color:var(--violet);border:1px solid rgba(95,227,161,.35);border-radius:999px;padding:4px 10px}
.key-row{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.key-row input{
  width:100%;background:var(--surface-2);border:1px solid var(--line);border-radius:11px;
  padding:13px 14px;color:var(--text);font-family:var(--mono);font-size:16px;min-height:48px;
}
.key-row input::placeholder{color:var(--muted)}
.key-msg{font-family:var(--mono);font-size:14px;margin-top:2px;min-height:16px}
.key-msg.err{color:var(--threat)}
.key-msg.ok{color:var(--safe)}
.btn-stack{display:flex;flex-direction:column;gap:10px;margin-top:18px}
.have-key{font-family:var(--mono);font-size:14px;color:var(--muted);text-align:center;margin-top:16px}
.have-key a{color:var(--violet)}

.end{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:26px 20px;text-align:center}
.end .rating{font-family:var(--display);font-weight:700;font-size:clamp(22px,6vw,28px);margin:2px 0 4px}
.end .rating.good{color:var(--safe)}
.end .rating.mid{color:var(--amber)}
.end .rating.bad{color:var(--threat)}
.end .line{font-family:var(--mono);font-size:14px;color:var(--muted);margin:14px 0}
.end .line b{color:var(--text)}
.end p{color:var(--read);font-size:var(--text-body);line-height:1.65;max-width:44ch;margin:12px auto}
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:18px 0}
.stat-cell{background:var(--surface-2);border:1px solid var(--line);border-radius:12px;padding:12px 8px}
.stat-cell .v{font-family:var(--mono);font-weight:700;font-size:22px}
.stat-cell .k{font-family:var(--mono);font-size:14px;letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin-top:4px}
.stat-cell.caught .v{color:var(--safe)}
.stat-cell.breach .v{color:var(--threat)}
.stat-cell.false .v{color:var(--amber)}

/* ---------- certificate ---------- */
.cert-wrap{width:100%}
.cert-wrap svg{width:100%;height:auto;display:block;border-radius:var(--radius);border:1px solid var(--line)}
.cert-actions{display:flex;flex-direction:column;gap:10px;margin-top:16px}
.next-step{margin-top:22px;padding:18px 16px;text-align:center;background:var(--surface);border-radius:var(--radius)}
.ns-label{font-family:var(--mono);font-size:14px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.next-step p{font-family:var(--display);font-weight:600;font-size:var(--text-prompt);margin:0}

/* =========================================================================
   HUB
   ========================================================================= */

.ring{flex:none;width:64px;height:64px;position:relative}
.ring svg{width:64px;height:64px;transform:rotate(-90deg)}
.ring .trk{fill:none;stroke:var(--surface-3);stroke-width:6}
.ring .val{fill:none;stroke:var(--brand);stroke-width:6;stroke-linecap:round;transition:stroke-dashoffset .6s ease}
.ring.violet .val{stroke:var(--violet)}
.ring.amber .val{stroke:var(--amber)}
.ring .pct{position:absolute;inset:0;display:grid;place-items:center;font-family:var(--mono);font-weight:700;font-size:16px}

.badges{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
@media (min-width:640px){ .badges{grid-template-columns:repeat(3,1fr)} }
@media (min-width:1024px){ .badges{grid-template-columns:repeat(5,1fr)} }
.badge{
  display:flex;gap:11px;align-items:flex-start;
  background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:13px 12px;
}
.badge .medal{
  flex:none;width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  font-family:var(--mono);font-weight:700;font-size:14px;
  background:var(--surface-3);color:var(--muted);
}
.badge.earned{border-color:var(--accent-line);background:var(--surface)}
.badge.earned .medal{background:var(--accent-soft);color:var(--accent)}
.badge.earned.lab{border-color:rgba(95,227,161,.45);background:var(--surface)}
.badge.earned.lab .medal{background:var(--accent-soft);color:var(--accent)}
.badge .t{font-family:var(--display);font-weight:600;font-size:16px;line-height:1.3}
.badge .d{font-size:14px;color:var(--muted);line-height:1.45;margin-top:2px}
.badge:not(.earned) .t{color:var(--read)}

.lessons{display:grid;gap:10px;grid-template-columns:1fr}
@media (min-width:760px){ .lessons{grid-template-columns:repeat(2,1fr)} }
.lesson-unit{background:var(--surface);border:1px solid var(--line);border-radius:13px;padding:14px 14px 10px}
.lesson-unit .uh{display:flex;align-items:center;gap:10px;margin-bottom:8px}
.lesson-unit .un{
  flex:none;width:26px;height:26px;border-radius:8px;background:var(--surface-3);display:grid;place-items:center;
  font-family:var(--mono);font-size:14px;font-weight:700;color:var(--brand);
}
.lesson-unit.done .un{color:var(--on-accent);background:var(--safe)}
.lesson-unit .ut{font-family:var(--display);font-weight:600;font-size:16px}
.lesson-unit .uo{font-family:var(--mono);font-size:14px;color:var(--violet);margin-left:auto;flex:none}
.lesson-unit ul{list-style:none;margin:0;padding:0}
.lesson-unit li a{
  display:flex;align-items:center;min-height:40px;padding:6px 8px;border-radius:8px;
  color:var(--read);text-decoration:none;font-size:16px;line-height:1.35;
}
.lesson-unit li a::before{content:"›";font-family:var(--mono);color:var(--muted);margin-right:8px}
@media (hover:hover){ .lesson-unit li a:hover{background:var(--surface-2);color:var(--text)} }

/* review screen */
.review-bar{display:flex;flex-wrap:wrap;gap:10px;margin-top:16px}
.review-bar .btn{margin-top:0;flex:1 1 180px}

/* =========================================================================
   PRACTICE RANGE
   ========================================================================= */
.range-head{margin-bottom:22px}
.range-label{font-family:var(--mono);font-size:14px;letter-spacing:.14em;text-transform:uppercase;color:var(--violet);margin-bottom:10px}
.range-head h2{font-family:var(--display);font-weight:700;font-size:clamp(24px,5.5vw,34px);letter-spacing:-.025em;margin:0 0 12px}
.range-intro{color:var(--read);font-size:var(--text-body);line-height:1.7;margin:0 0 20px;max-width:70ch}


.range-filter{
  position:sticky;top:104px;z-index:20;display:flex;flex-direction:column;gap:10px;
  padding:12px 0;margin-bottom:20px;background:linear-gradient(180deg,var(--bg) 82%,transparent);
}
@media (min-width:900px){ .range-filter{top:62px} }
.rf-search{position:relative}
.rf-icon{position:absolute;left:13px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:18px;pointer-events:none}
.range-filter input{
  width:100%;min-height:46px;padding:12px 14px 12px 36px;background:var(--surface);
  border:1px solid var(--line);border-radius:11px;color:var(--text);font-family:var(--body);font-size:18px;
}
.range-filter input::placeholder{color:var(--muted)}
.range-filter input::-webkit-search-cancel-button{filter:invert(.6)}
.rf-pills{display:flex;flex-wrap:wrap;gap:7px}
.r-pill{
  display:inline-flex;align-items:center;gap:7px;font-family:var(--mono);font-size:14px;letter-spacing:.04em;
  color:var(--read);background:var(--surface);border:1px solid var(--line);border-radius:999px;
  padding:7px 12px;min-height:34px;cursor:pointer;touch-action:manipulation;transition:color .15s,border-color .15s,background .15s;
}
.r-pill .n{font-size:14px;font-weight:700;color:var(--muted);background:var(--surface-2);border-radius:999px;padding:1px 6px}
.r-pill.on{color:var(--brand);border-color:rgba(61,219,163,.45);background:rgba(61,219,163,.08)}
.r-pill.on .n{color:var(--brand);background:rgba(61,219,163,.14)}
@media (hover:hover){ .r-pill:not(.on):hover{color:var(--text);border-color:var(--muted)} }

.r-empty{text-align:center;padding:36px 0 44px;color:var(--muted)}
.r-empty p{font-family:var(--display);font-size:var(--text-prompt);margin:0 0 4px;color:var(--text)}

.range-sec{margin-bottom:34px;scroll-margin-top:200px}
.rs-head{display:flex;align-items:center;gap:11px;margin-bottom:8px}
.rs-n{
  flex:0 0 auto;width:26px;height:26px;border-radius:8px;background:var(--surface-2);
  border:1px solid var(--line);display:grid;place-items:center;
  font-family:var(--mono);font-size:14px;font-weight:700;color:var(--brand);
}
.rs-head h3{font-family:var(--display);font-weight:700;font-size:var(--text-display);margin:0;letter-spacing:-.015em}
.rs-count{margin-left:auto;flex:0 0 auto;font-family:var(--mono);font-size:14px;color:var(--muted);letter-spacing:.04em}
.rs-count b{color:var(--text);font-weight:700}
.rs-intro{color:var(--read);font-size:var(--text-body);line-height:1.6;margin:0 0 16px;max-width:72ch}

.r-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:1fr;gap:12px;align-items:stretch}
@media (min-width:660px){ .r-list{grid-template-columns:repeat(2,1fr)} }
@media (min-width:1140px){ .r-list{grid-template-columns:repeat(3,1fr)} }
.r-item{
  display:flex;flex-direction:column;
  background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);
  padding:16px 16px 14px 18px;position:relative;overflow:hidden;
  transition:border-color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.r-item::before{
  content:"";position:absolute;left:0;top:0;bottom:0;width:2px;
  background:linear-gradient(180deg,var(--brand),transparent 85%);opacity:.65;
}
.r-item.flagged::before{background:linear-gradient(180deg,var(--amber),transparent 85%);opacity:.8}
.r-item.done{border-color:rgba(74,222,138,.35)}
.r-item.done::before{background:linear-gradient(180deg,var(--safe),transparent 85%);opacity:1}
@media (hover:hover){
  .r-item:hover{border-color:rgba(61,219,163,.4);transform:translateY(-2px);box-shadow:0 18px 40px -26px rgba(0,0,0,.9)}
}
.r-title{
  font-family:var(--display);font-weight:600;font-size:18px;color:var(--text);text-decoration:none;
  display:flex;align-items:baseline;gap:6px;touch-action:manipulation;
}
.r-title::after{content:"↗";font-family:var(--mono);font-size:14px;color:var(--muted);flex:0 0 auto}
@media (hover:hover){ .r-title:hover{color:var(--brand)} }
.r-tags{display:flex;flex-wrap:wrap;gap:6px;margin:9px 0 10px}
.r-tag{font-family:var(--mono);font-size:14px;letter-spacing:.05em;text-transform:uppercase;padding:2px 8px;border-radius:999px;border:1px solid var(--line);color:var(--muted)}
.r-tag.level{color:var(--brand);border-color:rgba(61,219,163,.3)}
.r-tag.host{color:var(--violet);border-color:rgba(95,227,161,.3)}
.r-note{margin:0;color:var(--read);font-size:14px;line-height:1.6}
.r-foot{margin-top:auto;padding-top:12px;display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.r-flag{
  display:inline-block;font-family:var(--mono);font-size:14px;letter-spacing:.05em;text-transform:uppercase;
  padding:3px 9px;border-radius:999px;color:var(--amber);border:1px solid rgba(232,179,60,.4);background:rgba(232,179,60,.07);
}
.r-done{
  margin-left:auto;display:inline-flex;align-items:center;gap:7px;
  font-family:var(--mono);font-size:14px;letter-spacing:.04em;color:var(--read);
  background:transparent;border:1px solid var(--line);border-radius:999px;padding:0 12px;min-height:36px;cursor:pointer;
  touch-action:manipulation;
}
.r-done .box{width:14px;height:14px;border-radius:4px;border:1.5px solid var(--muted);display:grid;place-items:center;font-size:14px;line-height:1}
.r-done[aria-pressed="true"]{color:var(--safe);border-color:rgba(74,222,138,.45);background:rgba(74,222,138,.07)}
.r-done[aria-pressed="true"] .box{border-color:var(--safe);background:var(--safe);color:var(--on-accent)}
.r-locked-sec{
  background:var(--surface);border:1px dashed rgba(95,227,161,.35);border-radius:var(--radius);
  padding:16px;display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;
}
.r-locked-sec p{margin:0;color:var(--read);font-size:16px;flex:1 1 260px}
.r-locked-sec .btn{margin-top:0}

.range-credit{margin-top:26px;padding:14px 15px;background:var(--surface-2);border-radius:10px;border-left:3px solid var(--violet)}
.range-credit p{margin:0 0 6px;font-size:14px;line-height:1.6;color:var(--read)}
.range-credit p:last-child{margin-bottom:0}
.range-credit a{color:var(--violet)}

@media (max-width:639px){
  .r-title{min-height:44px;align-items:center;padding-right:2px}
  .r-pill{min-height:44px;padding:0 14px}
  .r-done{min-height:44px}
}

/* ---------- responsive: tablet+ ---------- */
@media (min-width:640px){
  .verdict-row{grid-template-columns:1fr 1fr}
  .vbtn{min-width:0}
  .cert-actions{flex-direction:row}
  .cert-actions .btn{margin-top:0}
  .btn-stack .btn{margin-top:0}
  .hub-hero{padding:30px 28px}
}
@media (min-width:1024px){ .vbtn{min-width:180px} }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion:reduce){
  *{animation:none!important;transition:none!important}
}

/* The screen container takes focus after a route change so keyboard and
   screen-reader users land at the top of the new view. It is not a control,
   so it needs no focus ring. */
#screen:focus{outline:none}

/* Practice Range on phones. The filter bar used to stay stuck under the
   header while you scrolled, and with nine filter pills stacked it grew to
   two thirds of the screen and let pills spill over the cards. On phones and
   small tablets it now scrolls away with the page, and the pills sit in one
   row you swipe sideways. The sticky bar stays on wide screens, where the
   header is one row and the pills fit. */
@media (max-width:899px){
  .range-filter{position:static;background:none;padding:0 0 6px;margin-bottom:14px;z-index:auto}
  .rf-pills{
    flex-wrap:nowrap;overflow-x:auto;gap:8px;padding:2px 2px 8px;margin:0 -2px;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
    -webkit-mask-image:linear-gradient(90deg,#000 92%,transparent);
            mask-image:linear-gradient(90deg,#000 92%,transparent);
  }
  .rf-pills::-webkit-scrollbar{display:none}
  .r-pill{flex:none;white-space:nowrap}
  .range-sec{scroll-margin-top:120px}
  .range-stats{margin-bottom:4px}
}

/* =========================================================================
   CONSOLE THEME · header (shell.js renders the markup on every page)
   The header's inner box uses the same max-width and side padding as the
   page content, so the logo lines up with the content's left edge and the
   account button with its right edge. One fixed 72px row, items centred.
   ========================================================================= */
.site-header{position:sticky;top:0;z-index:40;background:var(--bg-raised)}
.site-header__inner{
  max-width:var(--container);margin:0 auto;padding:0 var(--gutter);
  min-height:var(--header-h);display:grid;
  grid-template-columns:auto 1fr auto;grid-template-areas:"brand nav right";
  align-items:center;column-gap:32px;
}
.brand{grid-area:brand;display:flex;align-items:center;gap:12px;min-height:var(--tap);color:var(--text);text-decoration:none}
.brand:hover{color:var(--text)}
.brand__name{font-weight:600;font-size:var(--text-md);letter-spacing:-.01em;white-space:nowrap}
.tier-chip{
  font-family:var(--mono);font-size:var(--text-xs);font-weight:500;letter-spacing:.06em;line-height:1;
  color:var(--accent);border:1px solid var(--accent-line);border-radius:6px;padding:5px 8px;
}
.tier-chip--free{color:var(--text-2);border-color:var(--border-strong)}
.site-nav{grid-area:nav;display:flex;justify-content:center;align-items:center;gap:4px}
.site-nav a{position:relative;
  display:flex;align-items:center;gap:6px;min-height:var(--tap);padding:0 12px;border-radius:var(--radius-sm);
  color:var(--text-2);text-decoration:none;font-size:var(--text-sm);font-weight:500;white-space:nowrap;
}
.site-nav a:hover{color:var(--text);background:var(--surface)}
.site-nav a[aria-current="page"]{color:var(--text);background:var(--surface-2)}
.site-nav .lock{color:var(--text-3);flex:none}
.header-right{grid-area:right;display:flex;align-items:center;justify-content:flex-end;gap:14px;position:relative}
.xp{font-family:var(--mono);font-size:var(--text-xs);color:var(--text-2);white-space:nowrap}
.icon-btn{
  width:var(--tap);height:var(--tap);border-radius:50%;background:var(--surface-2);
  border:1px solid var(--border-strong);color:var(--text);display:inline-flex;align-items:center;
  justify-content:center;padding:0;cursor:pointer;
}
.icon-btn:hover{background:var(--surface)}
.acct-menu{
  position:absolute;right:0;top:calc(100% + 10px);min-width:232px;z-index:50;
  background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius);
  padding:6px;display:flex;flex-direction:column;box-shadow:0 18px 40px -20px rgba(0,0,0,.9);
}
.acct-menu[hidden]{display:none}
.acct-menu a,.acct-menu button{
  display:flex;align-items:center;gap:10px;min-height:var(--tap);padding:0 12px;border-radius:var(--radius-sm);
  background:transparent;border:0;color:var(--text);font:inherit;font-size:var(--text-sm);font-weight:500;
  text-align:left;text-decoration:none;cursor:pointer;width:100%;
}
.acct-menu a:hover,.acct-menu button:hover{background:var(--surface-2);color:var(--text)}
.acct-menu .acct-note{padding:10px 12px 6px;font-size:var(--text-xs);color:var(--text-3)}
@media (max-width:1100px){
  .site-header__inner{grid-template-columns:1fr auto;grid-template-areas:"brand right" "nav nav"}
  .site-nav{
    justify-content:flex-start;overflow-x:auto;scrollbar-width:none;
    margin:0 calc(var(--gutter) * -1);padding:0 var(--gutter) 10px;
  }
  .site-nav::-webkit-scrollbar{display:none}
}
@media (max-width:640px){ .xp{display:none} }

/* ---------- buttons (one system for the whole app) ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:var(--tap);
  padding:10px 22px;border-radius:10px;font:inherit;font-family:var(--display);font-size:var(--text-sm);font-weight:600;
  text-decoration:none;cursor:pointer;border:1px solid transparent;margin-top:16px;
  background:var(--accent);color:var(--accent-ink);box-shadow:none;
  touch-action:manipulation;transition:background .15s;
}
.btn:hover{background:var(--accent-hover);color:var(--accent-ink)}
.btn:active{transform:none}
.btn.ghost,.btn--secondary{background:transparent;color:var(--text);border-color:var(--border-strong)}
.btn.ghost:hover,.btn--secondary:hover{background:var(--surface-2);color:var(--text)}
.btn--quiet{background:var(--surface-2);color:var(--text);border-color:var(--border-strong)}
.btn--quiet:hover{background:var(--surface);color:var(--text)}
.btn.pro,.btn--primary{background:var(--accent);color:var(--accent-ink)}
.btn.full,.btn--block{display:flex;width:100%}
.btn.small{min-height:var(--tap);padding:9px 16px;font-size:var(--text-sm);margin-top:0}
.btn[disabled]{opacity:.5;cursor:not-allowed}
.console .btn{margin-top:0}

/* CONSOLE-COMPONENTS */
.console .page{display:flex;flex-direction:column;gap:64px}
.console .stack{display:flex;flex-direction:column}
.console .eyebrow{font-family:var(--mono);font-size:var(--text-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--text-3)}
.console .page-title{font-size:var(--text-3xl);font-weight:600;letter-spacing:-.02em;margin:0}
.console .section-title{font-size:var(--text-xl);font-weight:600;letter-spacing:-.01em;margin:0}
.console .lede{font-size:var(--text-md);color:var(--text-2);max-width:680px;margin:0}
.console .muted{color:var(--text-2)}
.console .meta{font-family:var(--mono);font-size:var(--text-xs);color:var(--text-3);margin:0}
.console .placeholder{color:var(--text);border-bottom:1px dashed var(--accent)}
.console .section-head{display:flex;flex-direction:column;gap:6px;margin-bottom:24px}
.console .split{display:flex;flex-wrap:wrap;gap:24px;align-items:stretch}
.console .split__main{flex:999 1 560px;min-width:0}
.console .split__side{flex:1 1 340px;min-width:0}
.console .grid-2{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(540px,100%),1fr));gap:24px}
.console .grid-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(220px,100%),1fr));gap:12px}
.console .card{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);
  padding:32px;display:flex;flex-direction:column;gap:20px;margin:0;
}
.console .card--current{background:var(--surface-current);border-color:var(--accent-line)}
.console .card--ghost{background:transparent;border-style:dashed;border-color:var(--border-strong)}
.console .card__head{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}
.console .card__title{font-size:var(--text-lg);font-weight:600;margin:0}
.console .card__icon{
  flex:0 0 auto;width:48px;height:48px;border-radius:10px;background:#171B22;border:1px solid var(--border);
  color:var(--accent);display:flex;align-items:center;justify-content:center;
}
.console .chip{
  display:inline-flex;align-items:center;font-family:var(--mono);font-size:var(--text-xs);color:var(--text-2);
  background:var(--surface-2);border:0;border-radius:6px;padding:4px 10px;white-space:nowrap;text-transform:none;letter-spacing:0;
}
.console .chip--accent{color:var(--accent);background:var(--accent-soft)}
.console .next-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:auto;padding:14px 18px;
  min-height:64px;background:var(--bg-raised);border:1px solid var(--border);border-radius:10px;
  color:var(--text);text-decoration:none;
}
.console .next-row:hover{color:var(--text);border-color:var(--accent-line)}
.console .next-row__label{display:block;font-size:var(--text-xs);color:var(--text-3)}
.console .next-row__value{display:block;font-size:var(--text-sm);font-weight:500}
.console .stage-track{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}
.console .stage-track__seg{display:flex;flex-direction:column;gap:8px;font-size:var(--text-xs);color:var(--text-3)}
.console .stage-track__bar{height:8px;border-radius:99px;background:#1F242D;overflow:hidden}
.console .stage-track__bar>span{display:block;height:100%;background:var(--accent)}
.console .stage-track__seg--done .stage-track__bar{background:var(--accent)}
.console .stage-track__seg--current{color:var(--text);font-weight:500}
.console .progress{height:8px;border-radius:99px;background:#1F242D;overflow:hidden}
.console .progress>span{display:block;height:100%;background:var(--accent);border-radius:99px}
.console .tile{
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:18px;
  min-height:136px;display:flex;flex-direction:column;gap:8px;
}
.console .tile__id{font-family:var(--mono);font-size:var(--text-xs);color:var(--accent)}
.console .tile__name{font-size:var(--text-sm);font-weight:500;line-height:1.35}
.console .tile__where{margin-top:auto;font-size:var(--text-xs);color:var(--text-3)}
.console .tile--out{background:transparent;border-style:dashed;border-color:var(--border-strong)}
.console .tile--out .tile__id{color:var(--text-3)}
.console .tile--out .tile__name{color:var(--text-2)}
.console .syllabus{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.console .unit{
  display:flex;flex-wrap:wrap;align-items:center;gap:16px 20px;padding:20px 22px;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);
}
.console .unit__num{
  flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:var(--surface-2);display:flex;
  align-items:center;justify-content:center;font-family:var(--mono);font-size:var(--text-sm);
}
.console .unit__body{flex:999 1 320px;min-width:0;display:flex;flex-direction:column;gap:2px}
.console .unit__title{font-size:var(--text-md);font-weight:600}
.console .unit__desc{font-size:var(--text-sm);color:var(--text-2)}
.console .unit__tags{display:flex;flex-wrap:wrap;gap:6px}
.console .unit__count{font-size:var(--text-xs);color:var(--text-3);min-width:170px}
.console .unit__status{min-width:110px;text-align:right}
.console .tag{font-family:var(--mono);font-size:var(--text-xs);color:var(--accent);background:var(--accent-soft);border-radius:6px;padding:3px 8px}
.console .tag--plain{color:var(--text-2);background:var(--surface-2)}
.console .stages{display:flex;flex-direction:column;gap:14px}
.console .stage{
  display:flex;gap:20px;align-items:flex-start;padding:24px 26px;background:var(--surface);
  border:1px solid var(--border);border-radius:14px;
}
.console .stage--current{background:var(--surface-current);border-color:var(--accent-line)}
.console .stage--locked{background:transparent;border-style:dashed;border-color:var(--border-strong)}
.console .stage__marker{
  flex:0 0 auto;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  font-family:var(--mono);font-size:var(--text-sm);
}
.console .stage__marker--done{background:var(--accent-soft);color:var(--accent)}
.console .stage__marker--current{border:2px solid var(--accent);color:var(--accent)}
.console .stage__marker--todo{border:1.5px solid #3A414E;color:var(--text-2)}
.console .stage__marker--locked{background:var(--surface-2);color:var(--text-2)}
.console .stage__body{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:8px}
.console .stage__title{font-size:var(--text-lg);font-weight:600;margin:0}
.console .stage__next{margin-top:6px;background:#0E1314;border-radius:10px;padding:14px 16px}
.console .stage>.btn{align-self:center;margin-top:0;flex:0 0 auto}
.console .segmented{display:flex;gap:4px;background:var(--bg);border:1px solid var(--border);border-radius:12px;padding:4px}
.console .segmented button{
  min-height:52px;padding:8px 20px;border-radius:9px;border:1px solid transparent;background:transparent;
  color:var(--text-2);font:inherit;font-size:var(--text-sm);font-weight:500;cursor:pointer;display:flex;
  flex-direction:column;align-items:flex-start;line-height:1.3;
}
.console .segmented button[aria-pressed="true"]{background:#1F2630;border-color:#2E3744;color:var(--text)}
.console .segmented small{font-family:var(--mono);font-size:var(--text-xs);color:var(--text-3)}
.console .segmented button[aria-pressed="true"] small{color:var(--accent)}
.console .checklist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.console .checklist li{display:flex;gap:12px;font-size:var(--text-sm);color:var(--text-2)}
.console .checklist svg{flex:0 0 auto;margin-top:3px;color:var(--accent)}
.console .checklist li.todo svg{color:var(--text-3)}
.console .author{display:flex;flex-wrap:wrap;align-items:center;gap:24px;flex-direction:row}
.console .author__photo{
  flex:0 0 auto;width:80px;height:80px;border-radius:50%;background:var(--surface-2);border:1px dashed #3A414E;
  display:flex;align-items:center;justify-content:center;font-family:var(--mono);color:var(--text-2);overflow:hidden;
}
.console .author__photo img{width:100%;height:100%;object-fit:cover}
.console .backup{
  display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px;padding:22px 26px;
  border:1px solid var(--border);border-radius:14px;
}
.console .breadcrumb{display:flex;align-items:center;gap:8px;font-size:var(--text-sm);color:var(--text-3)}
.console .breadcrumb a{color:var(--text-2);text-decoration:none}
.console .pill-row{list-style:none;margin:4px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.console .pill-row li{font-size:var(--text-sm);color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:99px;padding:8px 16px}
.console .big-pct{font-family:var(--mono);font-size:2.75rem;font-weight:500;line-height:1}
.console .empty-state{text-align:left}
.console .field{display:flex;flex-direction:column;gap:8px}
.console .field label{font-size:var(--text-sm);font-weight:500;color:var(--text)}
.console .field input[type=text]{
  min-height:var(--tap);padding:10px 14px;background:var(--bg);border:1px solid var(--border-strong);border-radius:10px;
  color:var(--text);font:inherit;font-size:var(--text-base);
}
.console .range-check{display:inline-flex;align-items:center;gap:10px;min-height:var(--tap);cursor:pointer;font-size:var(--text-sm);color:var(--text-2)}
.console .range-check input{width:22px;height:22px;accent-color:var(--accent);flex:0 0 auto;margin:0}
@media (max-width:640px){.console .card{padding:24px}
.console .stage{padding:20px;gap:14px;flex-wrap:wrap}
.console .stage>.btn{align-self:stretch;flex:1 1 100%}
.console .page{gap:48px}}

/* ---------- dialog (progress import) ---------- */
.cx-dialog{
  max-width:min(460px,calc(100vw - 40px));background:var(--surface);color:var(--text);
  border:1px solid var(--border-strong);border-radius:var(--radius-lg);padding:28px;
}
.cx-dialog::backdrop{background:rgba(5,6,9,.72)}
.cx-dialog h2{font-size:var(--text-lg);margin:0 0 10px}
.cx-dialog p{color:var(--text-2);margin:0 0 4px}
.cx-dialog__row{display:flex;flex-wrap:wrap;gap:10px;justify-content:flex-end;margin-top:22px}
.cx-dialog .btn{margin-top:0}
.sr-only{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ---------- Practice Range, Console treatment ---------- */
.range-filter{top:calc(var(--header-h) + 8px)}
.range-filter input{min-height:var(--tap);padding-left:44px;background:var(--surface);border-color:var(--border-strong);font-size:var(--text-sm)}
.rf-icon{left:14px;display:flex;color:var(--text-3)}
.r-pill{font-family:var(--body);font-size:var(--text-sm);letter-spacing:0;text-transform:none;min-height:var(--tap);padding:0 16px;background:var(--surface);border-color:var(--border)}
.r-pill .n{font-size:var(--text-xs)}
.r-pill.on{color:var(--text);border-color:var(--accent-line);background:var(--accent-soft)}
.r-pill.on .n{color:var(--accent);background:transparent}
.range-sec{margin-bottom:40px;scroll-margin-top:200px}
.rs-head h3{font-size:var(--text-lg)}
.r-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:22px;gap:2px}
.r-item::before{display:none}
.r-item.done{border-color:var(--accent-line)}
@media (hover:hover){ .r-item:hover{border-color:var(--border-strong);transform:none;box-shadow:none} }
.r-title{font-size:var(--text-md);font-weight:600}
.r-title::after{content:"";width:16px;height:16px;flex:0 0 auto;align-self:center;background:currentColor;opacity:.6;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E") center/contain no-repeat}
.r-title{min-height:var(--tap);align-items:center}
.r-tag{font-size:var(--text-xs);letter-spacing:0;text-transform:none;border-radius:6px;padding:3px 8px}
.r-tag.level{color:var(--accent);border-color:transparent;background:var(--accent-soft)}
.r-tag.host{color:var(--text-2);border-color:transparent;background:var(--surface-2)}
.r-note{font-size:var(--text-sm);color:var(--text-2)}
.r-flag{font-size:var(--text-xs);letter-spacing:0;text-transform:none;border-radius:6px}
.r-done{margin-left:auto;border:0;background:transparent;padding:0;min-height:var(--tap);border-radius:8px}
.r-done[aria-pressed]{border:0}
.r-locked-sec{border:1px dashed var(--border-strong);background:transparent}
.r-locked-sec p{font-size:var(--text-sm)}
.range-credit{border-left:3px solid var(--accent-line);background:var(--surface);border-radius:0 var(--radius) var(--radius) 0}
.range-credit p{font-size:var(--text-sm)}
.range-credit a{color:var(--accent)}
.r-empty{color:var(--text-2)}

/* ---------- badges, lessons and the course flow ---------- */
.badge .medal{background:var(--surface-2);color:var(--text-3)}
.badge .medal svg{display:block}
.badge.earned .medal{background:var(--accent-soft);color:var(--accent)}
.badge .t{font-size:var(--text-sm)}
.badge .d{font-size:var(--text-xs)}
.lessons{display:grid;gap:12px}
.lesson-unit{border-radius:var(--radius);padding:18px 18px 10px}
.lesson-unit li a{min-height:var(--tap);font-size:var(--text-sm)}
.lesson-unit.done .un{color:var(--accent-ink);background:var(--accent)}
.course-hud .row{letter-spacing:0}
.unit-tag,.tagline{letter-spacing:0}
.stat-xp,.stat-streak{color:inherit}

/* ---------- certificate preview ---------- */
.cert-preview{
  background:#12151B;border:1px solid var(--border-strong);border-radius:var(--radius-lg);padding:32px 24px;
  display:flex;flex-direction:column;align-items:center;text-align:center;gap:10px;aspect-ratio:1.414/1;justify-content:center;
}
.cert-preview.is-locked{opacity:.45;filter:grayscale(1)}
.cert-preview__kick{font-family:var(--mono);font-size:var(--text-xs);letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}
.cert-preview__name{font-size:var(--text-xl);font-weight:600;border-bottom:1px solid var(--border-strong);padding:0 14px 4px;word-break:break-word}
.cert-preview__line{font-size:var(--text-sm);color:var(--text-2)}

/* ---------- leftover chrome from the old design ---------- */
.tb-nav,.topbar{display:none}

/* Console views: no browser-default heading and paragraph margins */
.console h1,.console h2,.console h3,.console p{margin:0}
.console ul,.console ol{margin:0;padding:0}
.console a{color:var(--accent)}
.console a.btn,.console a.next-row,.console .breadcrumb a{color:inherit}
.console a.btn--primary,.console a.btn.pro{color:var(--accent-ink)}

/* Content surfaces. The page, header and decorative theme rules are unchanged. */
.console .card,.console .tile,.console .unit,.lesson-unit,.badge,.r-item,
.stage-card,.lab-pick,.kit-dl,.panel,.unit-complete,.end{
  background:var(--card-panel);border-color:var(--component-border);
}
.console .card--ghost,.console .tile--out,.console .stage--locked{background:transparent}
.console .card--current,.console .stage--current,.teach,.inbox,.doc,.scenario,
.fb.right,.fb.wrong,.lab-teaser .panel{background:var(--reading-panel)}
.teach,.inbox,.doc,.scenario{border-color:var(--component-border)}
.inbox .card,.teach-example,.teach-key,.impact,.inbox-head,.doc-head,
body .codeblock,body .replay,body .turn,.sample-finding code{background:var(--prompt-inset)}
.teach-body,.teach-example .ex-body,.fb-text,.ptext,.doc-body,.scenario,.impact-detail,
.panel p,.r-note,.sample-finding,.assignment-body{color:var(--reading-text)}
.console .muted,.console .meta,.feedback-lesson,.sample-label{color:var(--supporting-text)}
.teach-body,.fb-text,.panel p,.sample-finding,.assignment-body{line-height:1.7}
.teach-body,.fb-text{max-width:72ch}
.review-col{max-width:760px}
.journey-actions{display:flex;align-items:center;flex-wrap:wrap;gap:16px 24px}
.console .learning-path{list-style:none;display:grid;gap:18px;max-width:72ch;margin-bottom:24px}
.learning-path li{padding-left:18px;border-left:3px solid var(--accent-line);color:var(--reading-text)}
.console .offering-note{margin-top:24px;max-width:76ch}
.console .milestone{padding:14px 16px;border-left:3px solid var(--accent);background:var(--prompt-inset);color:var(--reading-text);font-size:var(--text-sm);line-height:1.65}
.feedback-lesson{margin:16px 0 0;font-size:var(--text-sm);line-height:1.65}
.feedback-lesson a{color:var(--accent)}
.range-assignment{margin:18px 0 8px;border:1px solid var(--component-border);border-radius:10px;overflow:hidden}
.range-assignment>summary,.assignment-hint>summary{min-height:var(--tap);padding:12px 16px;cursor:pointer;color:var(--accent);font-weight:500;line-height:1.5}
.range-assignment[open]{background:var(--reading-panel)}
.range-assignment>summary:focus-visible,.assignment-hint>summary:focus-visible{outline-offset:-3px}
.assignment-body{padding:0 18px 18px;font-size:var(--text-base);overflow-wrap:anywhere}
.assignment-body dl,.sample-finding dl{margin:10px 0 22px;display:grid;gap:20px}
.assignment-body dt,.sample-finding dt{font-weight:600;color:var(--text);margin-bottom:4px}
.assignment-body dd,.sample-finding dd{margin:0;max-width:72ch}
.assignment-body h4{font-size:var(--text-base);margin:22px 0 8px}
.console .assignment-body ul{padding-left:22px;margin:0 0 18px}
.assignment-body li{margin:8px 0}
.console .assignment-body p{margin:16px 0 0}
.assignment-hint{background:var(--prompt-inset);border-radius:8px;margin-top:16px}
.console .assignment-hint p{padding:0 16px 16px;margin:0}
.sample-finding{padding:28px 24px;background:var(--reading-panel);border:1px solid var(--component-border);border-radius:var(--radius);margin-top:32px;font-size:var(--text-base);overflow-wrap:anywhere}
.sample-finding h2{font-size:var(--text-xl);line-height:1.25;margin:8px 0 14px;color:var(--text)}
.sample-finding .eyebrow{font:var(--text-xs) var(--mono);color:var(--accent);text-transform:uppercase;letter-spacing:.06em;margin:0}
.sample-finding p{max-width:72ch;margin:0 0 20px}
.sample-finding button{margin-top:4px}
@media (min-width:1101px) and (max-width:1380px){
  .site-header__inner{grid-template-columns:1fr auto;grid-template-areas:"brand right" "nav nav"}
  .site-nav{justify-content:flex-start;overflow-x:auto;padding-bottom:10px;min-width:0}
}
@media (max-width:640px){
  .journey-actions .btn{width:100%}
  .sample-finding{padding:24px 20px}
  .assignment-body{padding-left:14px;padding-right:14px}
}


/* Bright green component treatment. The Console page and header retain their
   original theme tokens; the radial wash is painted inside each card only. */
.console,.panel,.teach,.inbox,.doc,.scenario,.fb,.card,.lesson-unit,.badge,
.unit-complete,.end,.stage-card,.lab-pick,.kit-dl,.r-item,.r-locked-sec,
.range-credit,.sample-finding,.range-assignment,.next-step,.cx-dialog,.lab-wrap,
.course-hud,.lab-nav,.review-bar,.cert-actions,#screen .btn,#screen .vbtn,#screen .opt{
  --surface:var(--card-panel);
  --surface-2:var(--prompt-inset);
  --surface-3:#202922;
  --surface-current:var(--card-panel);
  --border:var(--component-border);
  --border-strong:#365442;
  --line:var(--component-border);
  --text:var(--reading-text);
  --text-2:var(--reading-text);
  --text-3:var(--supporting-text);
  --read:var(--reading-text);
  --muted:var(--supporting-text);
  --accent:var(--component-accent);
  --accent-hover:var(--component-accent-hover);
  --accent-ink:var(--component-ink);
  --accent-soft:#10271D;
  --accent-line:#2B6147;
  --brand:var(--component-accent);
  --brand-hi:var(--component-accent-hover);
  --brand-lo:var(--component-accent);
  --violet:var(--component-accent);
  --on-accent:var(--component-ink);
  --radius-sm:4px;
  --radius:4px;
  --radius-lg:4px;
}
.console{color:var(--reading-text)}
.console .card,.console .content-card,.console .tile,.console .unit,.console .stage,.console .backup,
.console .next-row,.lesson-unit,.badge,.badge.earned,.badge.earned.lab,.r-item,.stage-card,.lab-pick,.kit-dl,
.panel,.lab-teaser .panel,.teach,.inbox,.doc,.scenario,.fb,.fb.right,.fb.wrong,.unit-complete,.end,.r-locked-sec,
.range-credit,.range-assignment,.range-assignment[open],.sample-finding,.next-step,.cx-dialog,.cert-preview{
  background-color:var(--card-panel);
  background-image:var(--component-glow);
  background-repeat:no-repeat;
  border:1px solid var(--component-border);
  border-radius:4px;
  color:var(--reading-text);
  box-shadow:none;
}
.console .card--current,.console .stage--current{border-color:var(--accent-line)}
.console .card--ghost,.console .tile--out,.console .stage--locked,.r-locked-sec{
  background-color:var(--card-panel);
  background-image:var(--component-glow);
  border-style:solid;
  opacity:1;
}
.console .tile--out .tile__id{color:var(--component-accent)}
.console .tile--out .tile__name{color:var(--reading-text)}
.cert-preview.is-locked{opacity:1;filter:none}
.lm-item.locked{opacity:1;color:var(--supporting-text)}
.console .card__icon,.console .unit__num,.console .next-row,
.console .stage__next,.console .segmented,.console .segmented button,
.console .chip,.console .tag,.console .field input[type=text],
#screen .btn,#screen .vbtn,#screen .opt,.range-filter input,.r-pill,.r-tag,.r-flag,.r-done,
.inbox .card,.teach-example,.teach-key,.impact,.stat-cell,.howto li,.howto .ic,
.key-row input,.assignment-hint,.console .milestone{border-radius:4px}
.console .segmented button[aria-pressed="true"]{
  background:var(--accent-soft);border-color:var(--accent-line);
}
.console .next-row__value,.console .big-pct,.console .ring .pct,
.stat-cell:not(.breach):not(.false) .v{color:var(--component-accent)}
.lesson-unit li a,.feedback-lesson a,.range-credit a,.panel p a{
  color:var(--component-accent);
}
.console .eyebrow,.teach-label,.unit-tag,.tagline{color:var(--component-accent)}
.inbox-head,.doc-head{color:var(--supporting-text)}
.inbox .card,.teach-example,.teach-key,.impact,.stat-cell,.howto li,
.assignment-hint,.console .milestone{background:var(--prompt-inset)}
.fb.right{border-color:var(--accent-line)}
.fb.wrong{border-color:var(--threat)}
.fb-label,.impact-label,.ex-count,.hint,.kbd,.feedback-lesson{
  color:var(--supporting-text);
}
.opt.dim{opacity:1;color:var(--supporting-text)}
.opt.wrong{
  background:color-mix(in srgb,var(--threat) 8%,var(--prompt-inset));
  border-color:var(--threat);
}
.opt.correct{
  background:color-mix(in srgb,var(--safe) 8%,var(--prompt-inset));
  border-color:var(--safe);
}
@media (hover:hover){
  .console .card:hover,.console .tile:hover,.console .unit:hover,.console .stage:hover,
  .r-item:hover,.stage-card:hover{border-color:var(--accent-line)}
}

.console .content-card{padding:32px}
@media (max-width:640px){.console .content-card{padding:24px}}

/* Floating app header. Keep the account menu outside the rounded bar's
   clipping area, with equal desktop side columns around the main links. */
.site-header{
  top:16px;width:calc(100% - 32px);max-width:1200px;margin:16px auto 0;
  --accent:var(--component-accent);--accent-hover:var(--component-accent-hover);
  --accent-ink:var(--component-ink);
  border:1px solid #2b342e;border-radius:16px;
  background:#111614;overflow:visible;
  box-shadow:0 12px 32px -24px rgba(0,0,0,.65);
}
.site-header__inner{
  max-width:none;min-height:64px;padding:8px 16px;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  grid-template-areas:"brand nav right";column-gap:12px;row-gap:0;
  overflow:visible;
}
.site-header .brand{justify-self:start;gap:7px;min-width:0}
.site-header .brand>svg{width:26px;height:26px;flex:none}
.site-header .brand__name{font-size:18px}
.site-header .tier-chip{font-size:12px;padding:4px 6px;white-space:nowrap}
.site-header .site-nav{
  justify-content:center;gap:2px;min-width:0;max-width:100%;
  margin:0;padding:0;overflow:visible;
}
.site-header .site-nav a{flex:none;font-size:14px;padding:0 7px;border-radius:10px}
.site-header .site-nav a[aria-current="page"]{color:var(--accent);background:var(--accent-soft)}
.site-header .header-right{justify-self:stretch;min-width:0;gap:10px}
.site-header .xp{min-width:0;white-space:normal;text-align:right;line-height:1.35}
.site-header .icon-btn{
  flex:none;border-radius:12px;background:var(--accent);color:var(--accent-ink);
  border-color:transparent;
}
.site-header .icon-btn:hover{background:var(--accent-hover)}
.site-header .icon-btn:focus-visible{outline:2px solid var(--accent-hover);outline-offset:3px}
.site-header .acct-menu{max-width:calc(100vw - 64px)}
.range-filter{top:90px}
@media (max-width:1100px){
  .site-header__inner{
    min-height:108px;grid-template-columns:minmax(0,1fr) auto;
    grid-template-areas:"brand right" "nav nav";row-gap:4px;
  }
  .site-header .site-nav{
    justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;
    scroll-padding-inline:4px;scrollbar-width:none;
  }
  .site-header .site-nav a:focus-visible{outline-offset:-3px}
  .range-filter{top:134px}
}
@media (max-width:640px){
  .site-header{border-radius:14px}
  .site-header__inner{padding-inline:12px;column-gap:8px}
  .site-header .brand{
    display:grid;grid-template-columns:28px max-content;grid-template-rows:22px 22px;
    column-gap:8px;row-gap:0;
  }
  .site-header .brand>svg{width:28px;height:28px;grid-row:1 / 3}
  .site-header .brand__name{line-height:22px}
  .site-header .tier-chip{justify-self:start;align-self:start}
  .site-header .header-right{justify-self:end}
}
