/* ══════════════════════════════════════════════════════════════════
   CertifyRA — Axiom Learn design system
   Ported from "Modern Learning Platform Design System" (Learning
   Platform System.dc.html). That template is authored as inline
   styles on one static mock; here the same tokens and patterns are
   real classes so the app's generated markup can use them.

   Legacy token names (--ink/--accent/--muted/--surface/--line/--warn
   /--accent-2/--analogy-bg/--checkin-bg) are deliberately KEPT: about
   1,700 inline `var(--…)` references live inside diagrams-svg.js and
   the 16 chapter data files. Re-pointing the values here restyles all
   of that content without touching a byte of it.
   ══════════════════════════════════════════════════════════════════ */

:root{
  /* — colour ————————————————————————————————————— */
  --paper:#f6f7f9;          /* bg/base    canvas   */
  --surface:#ffffff;        /* bg/surface cards    */
  --surface-2:#fbfbfd;      /* bg/inset   wells    */
  --paper-2:#eef0f5;        /* bg/chip             */
  --media:#0e1014;          /* bg/media   dark card*/
  --ink:#14161c;            /* fg/primary          */
  --body:#33384a;           /* fg/body   long-form */
  --body-2:#4a4f5c;         /* fg/body   secondary */
  --muted:#8b90a0;          /* fg/muted            */
  --faint:#a3a8b6;          /* fg/faint  glyphs    */
  --line:#e6e8ee;           /* border/default      */
  --line-2:#eef0f5;         /* border/subtle       */
  --accent:#3b53c9;         /* accent/600          */
  --accent-hover:#2f43a8;
  --accent-tint:#dbe0fb;    /* accent/100          */
  --accent-edge:#c9d0ea;    /* accent/200 borders  */
  --accent-2:#0f8a6a;       /* state/pass          */
  --accent-3:#b46a12;       /* state/due           */
  --warn:#b03a34;           /* state/fail          */
  --analogy-bg:#fdf9f2;     /* caution tint        */
  --analogy-edge:#f0e2c8;
  --checkin-bg:#f1faf6;     /* pass tint           */
  --checkin-edge:#cfeae0;
  --wrong-bg:#fdf7f6;       /* fail tint           */
  --wrong-edge:#eccfcd;
  --tooltip-bg:#14161c;
  --tooltip-fg:#ffffff;

  /* — type ——————————————————————————————————————— */
  --font-sans:'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-serif:'Newsreader', Georgia, 'Iowan Old Style', serif;
  --font-mono:'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* — radius / elevation ————————————————————————— */
  --r-sm:8px; --r-md:11px; --r-lg:14px; --r-xl:18px; --radius:14px;
  --shadow-raised:0 1px 2px rgba(20,22,28,.05), 0 8px 20px -14px rgba(20,22,28,.3);
  --shadow-overlay:0 2px 6px rgba(20,22,28,.06), 0 26px 50px -26px rgba(20,22,28,.42);
}

:root[data-theme="dark"]{
  --paper:#0b0d11;
  --surface:#14181f;
  --surface-2:#181d25;
  --paper-2:#222834;
  --media:#080a0d;
  --ink:#eef0f5;
  --body:#c8cdd9;
  --body-2:#aab1c0;
  --muted:#8b93a5;
  --faint:#6d7487;
  --line:#262c38;
  --line-2:#1e242e;
  --accent:#8ea0f0;
  --accent-hover:#a5b4f6;
  --accent-tint:#232a46;
  --accent-edge:#3a4470;
  --accent-2:#4cc79f;
  --accent-3:#dda24a;
  --warn:#e08079;
  --analogy-bg:#241f16;
  --analogy-edge:#453a24;
  --checkin-bg:#12251f;
  --checkin-edge:#24473b;
  --wrong-bg:#251818;
  --wrong-edge:#4a2b28;
  --tooltip-bg:#eef0f5;
  --tooltip-fg:#14161c;
  --shadow-raised:0 1px 2px rgba(0,0,0,.4), 0 8px 20px -14px rgba(0,0,0,.8);
  --shadow-overlay:0 2px 6px rgba(0,0,0,.5), 0 26px 50px -26px rgba(0,0,0,.9);
}

/* ── base ─────────────────────────────────────────────────────── */
*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--paper); color:var(--ink);
  font-family:var(--font-sans); font-size:14.5px; line-height:1.55;
  -webkit-font-smoothing:antialiased;
  transition:background-color .15s, color .15s;
}
a{color:var(--accent); text-decoration:none}
a:hover{color:var(--accent-hover); text-decoration:underline}
::selection{background:var(--accent-tint)}
input,textarea,button,select{font:inherit}
button{cursor:pointer}
h1,h2,h3,h4{margin:0 0 .5em}
:focus-visible{outline:2px solid var(--accent); outline-offset:2px}
@keyframes fadeUp{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.001ms !important;transition-duration:.001ms !important}
}

/* ── shell: sidebar + main ────────────────────────────────────── */
.shell{display:flex; min-height:100vh}

.sidebar{
  width:236px; flex:0 0 236px; background:var(--surface);
  border-right:1px solid var(--line); padding:22px 14px;
  display:flex; flex-direction:column; gap:24px;
  position:sticky; top:0; height:100vh; overflow-y:auto;
}
.brand{display:flex; align-items:center; gap:10px; padding:0 8px}
.brand-mark{
  width:30px; height:30px; flex:0 0 30px; border-radius:9px;
  background:var(--ink); color:var(--surface); display:grid; place-items:center;
  font-family:var(--font-mono); font-size:12px; font-weight:500;
}
.brand-text{display:flex; flex-direction:column; line-height:1.15}
.brand-name{font-size:14px; font-weight:700; letter-spacing:-.01em}
.brand-sub{font-family:var(--font-mono); font-size:9.5px; color:var(--muted); letter-spacing:.08em}

.nav-group{display:flex; flex-direction:column; gap:2px}
.nav-label{
  font-family:var(--font-mono); font-size:9.5px; letter-spacing:.1em;
  color:var(--faint); padding:0 10px 8px;
}
.nav-item{
  display:flex; align-items:center; gap:11px; padding:9px 10px;
  border:0; border-radius:9px; text-align:left; width:100%;
  font-size:13.5px; font-weight:500; background:transparent; color:var(--body-2);
}
.nav-item:hover{background:var(--paper-2)}
.nav-item.active{background:var(--paper-2); color:var(--ink); font-weight:650}
.nav-item .glyph{
  font-family:var(--font-mono); font-size:12px; width:16px;
  text-align:center; color:var(--faint);
}
.nav-item.active .glyph{color:var(--accent)}
.nav-item .badge{
  font-family:var(--font-mono); font-size:10px; background:var(--paper-2);
  color:var(--body-2); padding:2px 6px; border-radius:20px;
}

.sidebar-foot{margin-top:auto; display:flex; flex-direction:column; gap:12px}
.progress-block{border:1px solid var(--line); border-radius:12px; padding:12px; background:var(--surface-2)}
.progress-block .row{display:flex; justify-content:space-between; align-items:baseline; margin-bottom:8px}
.progress-block .label{font-family:var(--font-mono); font-size:9.5px; letter-spacing:.08em; color:var(--muted)}
.progress-block .value{font-family:var(--font-mono); font-size:10px; color:var(--accent)}
.progress-block .note{margin-top:9px; display:flex; gap:6px; align-items:center; font-size:11.5px; color:var(--body-2)}
.progress-block .note .glyph{font-family:var(--font-mono); color:var(--accent-3)}
.user-chip{display:flex; align-items:center; gap:10px; padding:6px 4px; min-width:0}
.user-chip .avatar{
  width:30px; height:30px; flex:0 0 30px; border-radius:99px;
  background:var(--accent-tint); color:var(--accent);
  display:grid; place-items:center; font-size:12px; font-weight:700;
}
.user-chip .who{line-height:1.2; min-width:0}
.user-chip .name{font-size:12.5px; font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.user-chip .sub{font-size:11px; color:var(--muted)}

.main{flex:1; min-width:0; display:flex; flex-direction:column}
.topbar{
  position:sticky; top:0; z-index:20;
  background:color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line);
  padding:12px 30px; display:flex; align-items:center; gap:12px;
}
.crumb{font-family:var(--font-mono); font-size:11px; color:var(--muted); letter-spacing:.02em; min-width:0; overflow-x:auto; scrollbar-width:none}
.crumb::-webkit-scrollbar{display:none}
.crumb nav,.crumb ol{margin:0; padding:0}
.crumb ol{display:flex; align-items:center; list-style:none; white-space:nowrap}
.crumb li{display:flex; align-items:center}
.crumb button{
  appearance:none; border:0; padding:5px 3px; border-radius:5px;
  background:transparent; color:var(--muted); font:inherit; letter-spacing:inherit; cursor:pointer;
}
.crumb button:hover{background:var(--paper-2); color:var(--ink)}
.crumb button:focus-visible{outline:2px solid var(--accent); outline-offset:1px}
.crumb [aria-current="page"]{padding:5px 3px; color:var(--body-2)}
.crumb-separator{padding:0 6px; color:var(--faint); user-select:none}
.topbar .spacer{flex:1}
#app{flex:1; padding:30px; max-width:1320px; width:100%}
.screen{animation:fadeUp .32s ease both}

/* signed-out / gated: chrome collapses to the brand only */
.shell.gated .nav-group,
.shell.gated .sidebar-foot,
.shell.gated .topbar .ctl{display:none}
.shell.gated .sidebar{justify-content:flex-start}
.landing-shell{display:block}
.landing-shell .sidebar,.landing-shell .topbar{display:none}
.landing-shell #app{max-width:none;padding:0}

/* ── primitives ───────────────────────────────────────────────── */
.eyebrow{font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; color:var(--muted)}
.mono{font-family:var(--font-mono)}
.muted{color:var(--muted); font-size:12.8px}
.display{font-family:var(--font-serif); font-size:34px; font-weight:400; letter-spacing:-.02em; margin:6px 0 0; line-height:1.15}
.title{font-family:var(--font-serif); font-size:27px; font-weight:400; letter-spacing:-.02em; margin:6px 0 0}
h1,h2{font-family:var(--font-serif); font-weight:400; letter-spacing:-.02em}
h3,h4{font-family:var(--font-sans); font-weight:650; letter-spacing:.01em}
.lede{margin:8px 0 0; color:var(--body-2); font-size:14px; max-width:66ch; text-wrap:pretty}

.page-head{display:flex; justify-content:space-between; align-items:flex-end; gap:20px; flex-wrap:wrap}
.page-head .actions{display:flex; gap:8px; flex:0 0 auto}

.card{
  background:var(--surface); border:1px solid var(--line);
  border-radius:var(--r-lg); padding:20px; margin:0 0 16px;
}
.card.inset{background:var(--surface-2); border-color:var(--line-2); border-radius:var(--r-md)}
.card h4{margin:0 0 14px; font-size:13.5px; font-weight:650}
.stack{display:flex; flex-direction:column; gap:16px}
.grid-3{display:grid; grid-template-columns:repeat(auto-fit,minmax(260px,1fr)); gap:16px}
.grid-2{display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:16px}

.btn{
  border:0; background:var(--accent); color:#fff; border-radius:9px;
  padding:10px 17px; font-size:13px; font-weight:650; line-height:1.2;
}
.btn:hover{background:var(--accent-hover)}
.btn.secondary{border:1px solid var(--line); background:var(--surface); color:var(--ink); font-weight:600}
.btn.secondary:hover{background:var(--paper-2)}
.btn.ghost{background:transparent; color:var(--accent); padding:10px 13px; font-weight:600}
.btn.ghost:hover{background:var(--paper-2)}
.btn.confirm{background:var(--accent-2)}
.btn.small{padding:7px 12px; font-size:12.5px}
.btn.block{width:100%}
.btn:disabled{background:var(--paper-2); border:1px solid var(--line); color:var(--muted); cursor:not-allowed}
.btn.secondary:disabled{background:var(--paper-2)}

.pill{
  display:inline-block; font-size:11.5px; background:var(--paper-2); color:var(--body-2);
  border:1px solid var(--line); border-radius:20px; padding:4px 10px; margin-right:.4rem;
}
.pill.pass{background:var(--checkin-bg); color:var(--accent-2); border-color:var(--checkin-edge)}
.pill.due{background:var(--analogy-bg); color:var(--accent-3); border-color:var(--analogy-edge)}
.pill.fail{background:var(--wrong-bg); color:var(--warn); border-color:var(--wrong-edge)}
.pill.accent{background:var(--accent-tint); color:var(--accent); border-color:var(--accent-edge)}
.tag{
  font-family:var(--font-mono); font-size:9.5px; letter-spacing:.06em;
  padding:2px 7px; border-radius:20px; background:var(--paper-2); color:var(--muted);
}
.tag.pass{background:var(--checkin-bg); color:var(--accent-2)}
.tag.active{background:var(--analogy-bg); color:var(--accent-3)}

.bar{height:6px; border-radius:99px; background:var(--paper-2); overflow:hidden}
.bar > div{height:100%; border-radius:99px; background:var(--accent); transition:width .3s ease}
.bar.pass > div{background:var(--accent-2)}
.bar.thin{height:5px}

input[type=text],input[type=email],input[type=password],input:not([type]){
  width:100%; border:1px solid var(--line); border-radius:9px; padding:10px 12px;
  font-size:13px; background:var(--surface); color:var(--ink); outline:0;
}
input:focus{border-color:var(--accent)}
select{
  appearance:none; -webkit-appearance:none;
  background-color:var(--surface); color:var(--ink);
  background-image:linear-gradient(45deg,transparent 50%,var(--accent) 50%),linear-gradient(135deg,var(--accent) 50%,transparent 50%);
  background-position:calc(100% - 18px) center, calc(100% - 13px) center;
  background-size:5px 5px,5px 5px; background-repeat:no-repeat;
  border:1px solid var(--line); border-radius:9px;
  padding:9px 2.4rem 9px 12px; font-size:13px;
}
select:hover{border-color:var(--accent-edge)}
select:focus{outline:none; border-color:var(--accent)}

/* ── dashboard ────────────────────────────────────────────────── */
.dash-top{display:grid; grid-template-columns:1.55fr 1fr; gap:18px; align-items:start}
.resume-card{
  background:var(--media); border-radius:16px; padding:22px; color:#fff;
  display:flex; gap:20px; flex-wrap:wrap;
}
/* In dark mode the media surface sits within a few points of the canvas,
   so the card needs an edge to stay a card. */
:root[data-theme="dark"] .resume-card{border:1px solid var(--line)}
.resume-card .thumb{
  width:168px; flex:0 0 168px; height:106px; border-radius:10px;
  background:repeating-linear-gradient(135deg,#1b1f27 0 8px,#171b22 8px 16px);
  display:grid; place-items:center; position:relative;
}
.resume-card .thumb .glyph{
  width:38px; height:38px; border-radius:99px; background:rgba(255,255,255,.14);
  display:grid; place-items:center; font-size:15px;
}
.resume-card .thumb .stamp{
  position:absolute; bottom:6px; right:8px; font-family:var(--font-mono);
  font-size:9px; color:#7d8496;
}
.resume-card .body{flex:1; min-width:220px; display:flex; flex-direction:column}
.resume-card .eyebrow{color:#7d8496}
.resume-card h3{font-family:var(--font-sans); font-size:19px; margin:7px 0 4px; font-weight:600; letter-spacing:-.01em; color:#fff}
.resume-card p{margin:0; font-size:13px; color:#a8aebd}
.resume-card .actions{margin-top:auto; display:flex; gap:9px; padding-top:14px; flex-wrap:wrap}
.resume-card .btn{background:#fff; color:#14161c}
.resume-card .btn:hover{background:var(--accent-tint)}
.resume-card .btn.secondary{border:1px solid rgba(255,255,255,.22); background:transparent; color:#fff}
.resume-card .btn.secondary:hover{background:rgba(255,255,255,.08)}

.stat-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px}
.stat{background:var(--surface); border:1px solid var(--line); border-radius:13px; padding:15px}
.stat .label{font-family:var(--font-mono); font-size:9.5px; letter-spacing:.08em; color:var(--muted)}
.stat .value{font-family:var(--font-serif); font-size:30px; line-height:1.1; margin-top:7px}
.stat .sub{font-size:11.5px; color:var(--muted); margin-top:2px}
.stat .value.pass{color:var(--accent-2)}
.stat .value.due{color:var(--accent-3)}

.row-list{display:flex; flex-direction:column; gap:9px}
.dot-row{display:flex; align-items:center; gap:10px; font-size:13px}
.dot-row .dot{width:6px; height:6px; flex:0 0 6px; border-radius:99px; background:var(--accent)}
.dot-row .name{flex:1; color:var(--body-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.dot-row .n{font-family:var(--font-mono); font-size:11px; color:var(--muted)}

.link-row{
  display:flex; gap:11px; align-items:center; text-align:left; width:100%;
  border:1px solid var(--line-2); background:var(--surface-2);
  border-radius:10px; padding:11px; color:var(--ink);
}
.link-row:hover{border-color:var(--accent-edge); background:var(--surface)}
.link-row .glyph{font-family:var(--font-mono); font-size:11px; color:var(--accent); width:15px; flex:0 0 15px}
.link-row .txt{flex:1; min-width:0}
.link-row .t{display:block; font-size:12.8px; font-weight:600}
.link-row .m{display:block; font-size:11.5px; color:var(--muted)}
.link-row .arrow{color:var(--faint); font-size:12px}

.meter{margin-bottom:13px}
.meter:last-child{margin-bottom:0}
.meter .head{display:flex; justify-content:space-between; font-size:12.5px; margin-bottom:6px; gap:10px}
.meter .head .name{color:var(--body-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.meter .head .pct{font-family:var(--font-mono); font-size:11px; color:var(--muted)}

/* ── syllabus / learning path ─────────────────────────────────── */
.path-grid{display:grid; grid-template-columns:repeat(auto-fit,minmax(240px,1fr)); gap:12px}
.path-card{
  position:relative; border:1px solid var(--line); border-radius:13px; padding:15px;
  background:var(--surface); text-align:left; width:100%; color:var(--ink);
}
.path-card:hover{border-color:var(--accent-edge)}
.path-card.selected{border-color:var(--accent)}
.path-card.selected::after{
  content:"✓ SELECTED"; position:absolute; top:15px; right:15px;
  font-family:var(--font-mono); font-size:9px; letter-spacing:.08em; color:var(--accent);
}
.path-card .tag{display:inline-block; margin-bottom:8px; background:var(--accent-tint); color:var(--accent)}
.path-card h3{font-size:14.5px; font-weight:650; margin:0 0 5px; font-family:var(--font-sans)}
.path-card p{font-size:12.5px; color:var(--muted); margin:0; line-height:1.5}

.module-row{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  padding:14px 16px; display:flex; gap:16px; align-items:center;
  width:100%; text-align:left; color:var(--ink); text-decoration:none;
}
.module-row:hover{border-color:var(--accent-edge); text-decoration:none}
.module-row.done{border-color:var(--checkin-edge)}
.module-row.active{border-color:var(--accent-edge)}
.module-row .mark{
  width:34px; height:34px; flex:0 0 34px; border-radius:10px; display:grid; place-items:center;
  font-family:var(--font-mono); font-size:12px; background:var(--paper-2); color:var(--muted);
}
.module-row.done .mark{background:var(--checkin-bg); color:var(--accent-2)}
.module-row.active .mark{background:var(--accent-tint); color:var(--accent)}
.module-row .body{flex:1; min-width:0}
.module-row .name{display:flex; align-items:center; gap:9px; flex-wrap:wrap}
.module-row .name .t{font-size:14.5px; font-weight:650}
.module-row .meta{font-size:12.5px; color:var(--muted); margin-top:4px}
.module-row .bar{width:130px; flex:0 0 130px; height:5px}
.module-row .cta{flex:0 0 auto}

/* ── lesson / chapter reader ──────────────────────────────────── */
.lesson-grid{display:grid; grid-template-columns:1.62fr 1fr; gap:18px; align-items:start}
.rail{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-lg);
  display:flex; flex-direction:column; max-height:calc(100vh - 120px);
  position:sticky; top:80px; overflow:hidden;
}
.rail .rail-head{padding:15px 16px; border-bottom:1px solid var(--line-2)}
.rail .rail-head .row{display:flex; justify-content:space-between; align-items:center; margin-bottom:10px}
.rail .rail-head h4{margin:0; font-size:13.5px; font-weight:650}
.rail .rail-body{overflow-y:auto; padding:8px}
.rail-item{
  display:flex; gap:11px; width:100%; text-align:left; border:0; border-radius:9px;
  padding:9px 10px; background:transparent; color:var(--body-2); font-size:13px; line-height:1.5;
}
.rail-item:hover{background:var(--paper-2)}
.rail-item.current{background:var(--accent-tint); color:var(--ink); font-weight:600}
.rail-item .n{font-family:var(--font-mono); font-size:10.5px; color:var(--faint); flex:0 0 26px; padding-top:2px}
.rail-item.current .n{color:var(--accent)}
.rail-item.read .n{color:var(--accent-2)}

.section-dots{display:flex; gap:4px; flex-wrap:wrap; margin-top:10px}
.section-dots span{width:22px; height:4px; border-radius:99px; background:var(--line)}
.section-dots span.read{background:var(--accent-2)}
.section-dots span.current{background:var(--accent)}

.section-block h3{color:var(--ink); font-family:var(--font-serif); font-weight:400; font-size:24px; letter-spacing:-.01em; margin:0 0 14px}
.tutor-voice{font-size:15px; line-height:1.65; color:var(--body)}
.tutor-voice p{margin:0 0 14px}
.tutor-voice ul,.tutor-voice ol{padding-left:1.4em; margin:0 0 14px}
.tutor-voice li{margin:.35em 0}
.tutor-voice strong{color:var(--ink); font-weight:650}

.nav-bar{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.nav-bar .spacer{flex:1}
.nav-bar .count{font-family:var(--font-mono); font-size:11px; color:var(--muted)}

/* ── content callouts (authored via render.js markers) ────────── */
.analogy{
  background:var(--analogy-bg); border-left:2px solid var(--accent-3);
  padding:14px 16px; border-radius:0 var(--r-md) var(--r-md) 0; margin:16px 0;
  font-size:14px; line-height:1.6; color:var(--body);
}
.analogy::before{
  content:"THINK OF IT LIKE THIS"; display:block; font-family:var(--font-mono);
  font-size:9.5px; letter-spacing:.1em; color:var(--accent-3); margin-bottom:7px;
}
.checkin{
  background:var(--checkin-bg); border-left:2px solid var(--accent-2);
  padding:14px 16px; border-radius:0 var(--r-md) var(--r-md) 0; margin:16px 0;
  font-size:14px; line-height:1.6; color:var(--body);
}
.checkin::before{
  content:"QUICK CHECK"; display:block; font-family:var(--font-mono);
  font-size:9.5px; letter-spacing:.1em; color:var(--accent-2); margin-bottom:7px;
}
table.cmp{width:100%; border-collapse:collapse; margin:16px 0; font-size:13.2px}
table.cmp th,table.cmp td{border:1px solid var(--line); padding:9px 11px; text-align:left}
table.cmp th{background:var(--surface-2); font-weight:650; font-size:12.5px}

.diagram{
  background:var(--surface-2); border:1px solid var(--line); border-radius:12px;
  padding:16px; margin:18px auto; max-width:960px;
}
.diagram .cap{font-size:12.5px; color:var(--muted); text-align:center; margin-top:10px; line-height:1.5}
.diagram-svg-wrap{overflow-x:auto}
.diagram-svg-wrap svg{width:100%; max-width:900px; height:auto; display:block; margin:0 auto}
.img-slot img{display:block; max-width:100%; border-radius:10px; border:1px solid var(--line); margin:0 auto}
.img-slot .missing-prompt{display:none}
.img-slot.missing img{display:none}
.img-slot.missing{border:1px dashed var(--line)}
.img-slot.missing .missing-prompt{display:block; font-size:12.5px; color:var(--muted); line-height:1.55; text-align:left}
.img-slot.missing .missing-prompt code{
  display:block; background:var(--surface); border:1px solid var(--line); border-radius:6px;
  padding:10px; margin-top:7px; font-family:var(--font-mono); font-size:11px;
  white-space:pre-wrap; color:var(--body);
}
.img-slot.missing .missing-prompt .slot-label{color:var(--accent); font-weight:600}

.jargon{border-bottom:1px dotted var(--accent); cursor:help; position:relative}
.jargon .tip{
  display:none; position:absolute; bottom:130%; left:0;
  background:var(--tooltip-bg); color:var(--tooltip-fg); padding:10px 12px;
  border-radius:9px; font-size:12.5px; width:max-content; max-width:280px;
  z-index:30; line-height:1.5; box-shadow:var(--shadow-overlay); font-weight:400;
}
.jargon:hover .tip,.jargon:focus .tip{display:block}

/* ── formula card (stacked, serif — "the shape is part of the fact") ── */
.formula-card{
  background:var(--surface-2); border:1px solid var(--line-2);
  border-left:2px solid var(--accent); border-radius:0 var(--r-md) var(--r-md) 0;
  padding:18px 20px; margin:18px 0;
}
.formula-title{font-family:var(--font-sans); font-weight:650; font-size:14px; color:var(--ink); margin-bottom:2px}
.formula-label{
  font-family:var(--font-mono); font-size:9.5px; font-weight:400; letter-spacing:.1em;
  color:var(--accent); margin:16px 0 6px;
}
.formula-label:first-of-type{margin-top:12px}
.formula-expr{font-family:var(--font-serif); font-size:21px; text-align:center; padding:2px 0; color:var(--ink)}
.formula-expr-line{line-height:2.1}
.formula-or{font-family:var(--font-sans); font-size:12px; color:var(--muted); margin:6px 0}
.formula-calc{font-family:var(--font-serif); font-size:20px; text-align:center; padding:2px 0; color:var(--ink)}
.formula-calc-line{line-height:2.1; margin:.3em 0}
.formula-meaning{color:var(--body-2); font-size:13.5px; line-height:1.6}
.frac{
  display:inline-flex; flex-direction:column; align-items:center; vertical-align:middle;
  text-align:center; margin:0 .35em; line-height:1.4; font-size:.88em;
}
.frac-num{padding:0 .3em .16em; border-bottom:1px solid currentColor}
.frac-den{padding:.16em .3em 0}

/* ── checkpoints (inline MCQ) ─────────────────────────────────── */
.checkpoint{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-md);
  padding:18px; margin:18px 0;
}
.checkpoint .cp-q{font-size:15px; font-weight:600; margin-bottom:12px; line-height:1.5}
.checkpoint .cp-q::before{
  content:"CHECKPOINT"; display:block; font-family:var(--font-mono); font-weight:400;
  font-size:9.5px; letter-spacing:.1em; color:var(--accent); margin-bottom:8px;
}
.cp-opts{display:flex; flex-direction:column; gap:9px}
.cp-opt{
  display:block; width:100%; text-align:left; padding:12px 14px;
  border:1.5px solid var(--line); border-radius:var(--r-md);
  background:var(--surface); color:var(--body); font-size:14px;
}
.cp-opt:hover:not(:disabled){border-color:var(--accent-edge)}
.cp-opt.correct{border-color:var(--accent-2); background:var(--checkin-bg); font-weight:600}
.cp-opt.wrong{border-color:var(--warn); background:var(--wrong-bg)}
.cp-opt:disabled{cursor:default}
.cp-feedback{
  margin-top:14px; font-size:13.5px; color:var(--body); line-height:1.6;
  background:var(--surface-2); border:1px solid var(--line-2);
  border-radius:var(--r-md); padding:14px 16px;
}

/* ── flashcards ───────────────────────────────────────────────── */
.flash-wrap{max-width:780px; margin:0 auto}
.flash-head{display:flex; justify-content:space-between; align-items:flex-end; gap:16px; margin-bottom:18px; flex-wrap:wrap}
.flash-head .right{text-align:right; flex:0 0 auto}
.fc-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-xl);
  min-height:300px; padding:40px; display:flex; flex-direction:column;
  justify-content:center; align-items:center; text-align:center; cursor:pointer;
  box-shadow:0 1px 2px rgba(20,22,28,.04), 0 12px 32px -18px rgba(20,22,28,.22);
}
.fc-card .side-label{font-family:var(--font-mono); font-size:9.5px; letter-spacing:.12em; color:var(--faint)}
.fc-card .fc-text{
  font-family:var(--font-serif); font-size:26px; line-height:1.35; margin-top:18px;
  max-width:44ch; color:var(--ink); text-wrap:pretty; font-weight:400;
}
.fc-card .hint{margin-top:24px; font-family:var(--font-mono); font-size:10px; color:var(--faint)}
.fc-controls{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:16px}
.fc-controls button{
  border:1px solid var(--line); background:var(--surface); color:var(--ink);
  border-radius:var(--r-md); padding:13px 8px; font-size:13px; font-weight:600;
}
.fc-controls button:hover:not(:disabled){background:var(--surface-2); border-color:var(--accent-edge)}
.fc-controls button.primary{background:var(--accent); border-color:var(--accent); color:#fff}
.fc-controls button.primary:hover{background:var(--accent-hover)}
.fc-controls button:disabled{color:var(--muted); cursor:not-allowed}

/* ── quiz / checkpoint exam ───────────────────────────────────── */
.quiz-wrap{max-width:860px; margin:0 auto}
.quiz-progress{display:flex; align-items:center; gap:14px; margin-bottom:20px; flex-wrap:wrap}
.quiz-progress .dots{flex:1; display:flex; gap:5px; min-width:120px}
.quiz-progress .dots span{flex:1; height:4px; border-radius:99px; background:var(--line)}
.quiz-progress .dots span.done{background:var(--accent-2)}
.quiz-progress .dots span.wrong{background:var(--warn)}
.quiz-q{
  background:var(--surface); border:1px solid var(--line); border-radius:16px;
  padding:24px; margin-bottom:14px;
}
.quiz-q .q-kind{font-family:var(--font-mono); font-size:9.5px; letter-spacing:.1em; color:var(--accent); margin-bottom:10px}
.quiz-q .q-prompt{
  font-family:var(--font-serif); font-size:22px; font-weight:400; margin:0 0 20px;
  line-height:1.35; text-wrap:pretty; color:var(--ink);
}
.quiz-opt{
  display:flex; align-items:center; gap:13px; text-align:left; width:100%;
  border:1.5px solid var(--line); background:var(--surface); border-radius:var(--r-md);
  padding:13px 16px; margin:0 0 9px; color:var(--body); font-size:14.5px; line-height:1.45;
}
.quiz-opt:hover:not(:disabled):not(.correct):not(.wrong){border-color:var(--accent-edge)}
.quiz-opt::before{
  content:attr(data-letter); width:22px; height:22px; flex:0 0 22px; border-radius:99px;
  border:1.5px solid var(--line); display:grid; place-items:center;
  font-family:var(--font-mono); font-size:10px; color:var(--muted);
}
.quiz-opt.correct{border-color:var(--accent-2); background:var(--checkin-bg)}
.quiz-opt.correct::before{border-color:var(--accent-2); background:var(--accent-2); color:#fff; content:"✓"}
.quiz-opt.wrong{border-color:var(--warn); background:var(--wrong-bg)}
.quiz-opt.wrong::before{border-color:var(--warn); background:var(--warn); color:#fff; content:"✕"}
.quiz-opt.mock-selected{border-color:var(--accent); background:var(--accent-tint)}
.quiz-opt.mock-selected::before{border-color:var(--accent); background:var(--accent); color:#fff; content:"●"}
.quiz-opt:disabled{cursor:default}
.quiz-fb{
  margin-top:16px; border-radius:12px; padding:16px 18px;
  background:var(--surface-2); border:1px solid var(--line-2);
  font-size:13.8px; line-height:1.6; color:var(--body);
}
.quiz-fb.pass{background:var(--checkin-bg); border-color:var(--checkin-edge)}
.quiz-fb.fail{background:var(--wrong-bg); border-color:var(--wrong-edge)}
.quiz-fb .head{display:flex; align-items:center; gap:9px; margin-bottom:7px; font-size:13.5px; font-weight:650}
.quiz-fb.pass .head{color:var(--accent-2)}
.quiz-fb.fail .head{color:var(--warn)}
.quiz-fb .src{margin-top:10px; font-family:var(--font-mono); font-size:10px; color:var(--muted)}
.concept-explanation{margin-top:12px; padding:13px 14px; border-radius:10px; background:var(--surface); border:1px solid var(--line)}
.concept-explanation p,.option-review p{margin:5px 0 0}
.option-review-list{margin-top:16px}
.option-review{margin-top:9px; padding:12px 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface)}
.option-review.is-correct{border-color:var(--checkin-edge)}
.option-review.is-user-choice.is-incorrect{border-color:var(--wrong-edge); background:var(--wrong-bg)}
.option-review-head{display:flex; align-items:flex-start; gap:9px}
.option-letter{display:inline-grid; place-items:center; flex:0 0 22px; height:22px; border:1px solid var(--line); border-radius:50%; font:10px var(--font-mono)}
.option-review-label{margin:5px 0 0 31px; font:9.5px var(--font-mono); letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.option-review p{margin-left:31px}
.cp-hint-toggle{margin:10px 0 0}
.cp-hint{margin:10px 0 2px; padding:12px 14px; border-left:3px solid var(--accent); border-radius:0 8px 8px 0; background:var(--accent-tint); color:var(--body); font-size:13.5px; line-height:1.55}

/* ── results ──────────────────────────────────────────────────── */
.score-card{
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r-xl);
  padding:34px; text-align:center; margin-bottom:16px;
}
.score-card .score{font-family:var(--font-serif); font-size:68px; line-height:1; margin:14px 0 6px; color:var(--accent-2)}
.score-card .score.fail{color:var(--warn)}
.score-card .line{font-size:14.5px; color:var(--body-2)}
.score-card .pills{display:flex; gap:10px; justify-content:center; margin-top:20px; flex-wrap:wrap}
.breakdown{display:flex; flex-direction:column; gap:10px}
.breakdown .r{display:flex; gap:11px; align-items:center; font-size:13px}
.breakdown .r .mark{font-family:var(--font-mono); font-size:11px; width:14px; flex:0 0 14px}
.breakdown .r .mark.ok{color:var(--accent-2)}
.breakdown .r .mark.no{color:var(--warn)}
.breakdown .r .t{flex:1; color:var(--body-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.breakdown .r .n{font-family:var(--font-mono); font-size:10.5px; color:var(--muted)}

/* ── auth / gate screens ──────────────────────────────────────── */
.gate{max-width:420px; margin:40px auto}
.gate .card{padding:28px}
.gate h2{font-size:26px; margin:0 0 6px}
.gate form{display:flex; flex-direction:column; gap:9px; margin-top:14px}
.gate .split{display:flex; gap:9px}
.gate .split .btn{flex:1}
.gate hr{border:0; border-top:1px solid var(--line); margin:18px 0}
.gate-back{border:0; background:transparent; color:var(--body-2); padding:0; margin:0 0 22px; font-size:12.5px}
.gate-back:hover{color:var(--accent)}

/* ── public landing page ─────────────────────────────────────── */
.landing{min-height:100vh; background:var(--paper); color:var(--ink)}
.landing-hero,.landing-benefits,.landing-access,.landing-footer{max-width:1180px; margin:0 auto; padding-left:32px; padding-right:32px}
.landing-hero{min-height:620px; display:grid; grid-template-columns:minmax(0,1.04fr) minmax(390px,.96fr); gap:70px; align-items:center; padding-top:80px; padding-bottom:80px}
.landing-copy{max-width:610px}
.landing-copy .eyebrow,.landing-access .eyebrow{color:var(--accent); font-weight:500}
.landing-copy h1{font-family:var(--font-serif); font-weight:400; font-size:clamp(46px,5.5vw,72px); line-height:.98; letter-spacing:-.045em; margin:18px 0 22px}
.landing-copy h1 em{font-weight:300; color:var(--body-2)}
.landing-copy>p{font-size:17px; line-height:1.65; color:var(--body-2); max-width:52ch; margin:0}
.landing-actions{display:flex; align-items:center; gap:22px; margin-top:30px; flex-wrap:wrap}
.landing-primary{padding:14px 19px; font-size:14px}
.landing-primary span{padding-left:10px; font-size:18px; line-height:0}
.landing-text-link{border:0; background:transparent; padding:0; color:var(--accent); font:inherit; font-size:13px; font-weight:650; cursor:pointer}
.landing-text-link:hover{color:var(--accent-hover); text-decoration:underline}
.landing-note{font-size:12.5px !important; color:var(--muted) !important; margin-top:17px !important}
.landing-preview{background:#171c30; color:#f8f9ff; border-radius:18px; padding:22px; box-shadow:0 28px 60px -28px rgba(28,40,89,.55); transform:rotate(1.5deg)}
.preview-topline{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:10px; letter-spacing:.09em; color:#b9c4f4; border-bottom:1px solid rgba(255,255,255,.13); padding-bottom:16px}
.preview-dot{color:#73d2ad}.preview-title{font-family:var(--font-serif); font-size:33px; line-height:1.05; letter-spacing:-.03em; padding:30px 0}
.preview-progress{background:#242c49; border-radius:11px; padding:14px; margin-bottom:13px}.preview-progress div{display:flex; justify-content:space-between; font-family:var(--font-mono); font-size:10px; color:#c6cef1}.preview-progress strong{font-weight:500;color:#89d5ba}.preview-progress i{display:block;height:5px;background:#3c476b;border-radius:99px;margin-top:11px}.preview-progress b{display:block;width:22%;height:100%;background:#8ea0f0;border-radius:99px}
.preview-list{display:flex; flex-direction:column; gap:8px}.preview-list>div{display:flex; align-items:center; gap:13px; padding:12px 10px; background:rgba(255,255,255,.055); border-radius:9px}.preview-list>div>span{font-family:var(--font-mono); font-size:10px; color:#99a6dd}.preview-list p{flex:1;margin:0;line-height:1.3}.preview-list strong{display:block;font-size:12.5px;font-weight:600}.preview-list small{color:#abb4d8;font-size:10.5px}.preview-list>b{font-weight:400;color:#8ea0f0}
.landing-benefits{display:grid; grid-template-columns:repeat(3,1fr); gap:0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding-top:0; padding-bottom:0}.landing-benefits>div{padding:36px 28px 36px 0}.landing-benefits>div+div{border-left:1px solid var(--line); padding-left:28px}.landing-benefits span,.access-card>span{font-family:var(--font-mono); font-size:10px; letter-spacing:.1em; color:var(--accent)}.landing-benefits h2{font-family:var(--font-sans);font-size:16px;font-weight:650;margin:10px 0 7px}.landing-benefits p{font-size:13px;color:var(--body-2);margin:0;line-height:1.55}
.landing-access{display:grid; grid-template-columns:1fr 330px; align-items:center; gap:80px; padding-top:100px; padding-bottom:100px}.landing-access h2{font-size:40px;line-height:1.05;margin:12px 0}.landing-access>div>p{font-size:15px;color:var(--body-2);margin:0}.access-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:27px;box-shadow:var(--shadow-raised)}.access-card strong{display:block;font-family:var(--font-serif);font-weight:400;font-size:46px;letter-spacing:-.04em;line-height:1;margin:15px 0 7px}.access-card sup{font-family:var(--font-sans);font-size:18px;letter-spacing:0}.access-card p{font-size:12.5px;color:var(--muted);margin:0 0 22px}.landing-footer{display:flex;justify-content:space-between;border-top:1px solid var(--line);padding-top:22px;padding-bottom:22px;color:var(--muted);font-size:12px}
.stub-notice{
  background:var(--analogy-bg); border:1px solid var(--analogy-edge); border-radius:var(--r-md);
  padding:14px 16px; color:var(--body); font-size:13.5px; line-height:1.6;
}

/* ── responsive ───────────────────────────────────────────────── */
@media (max-width:1100px){
  .dash-top{grid-template-columns:1fr}
  .lesson-grid{grid-template-columns:1fr}
  .rail{position:static; max-height:340px}
}
@media (max-width:900px){
  .shell{flex-direction:column}
  .sidebar{
    width:100%; flex:none; height:auto; position:sticky; top:0; z-index:30;
    flex-direction:row; align-items:center; gap:14px; padding:10px 14px;
    border-right:0; border-bottom:1px solid var(--line); overflow-x:auto;
  }
  .brand{flex:0 0 auto; padding:0}
  .brand-text{display:none}
  .nav-group{flex-direction:row; gap:4px; flex:0 0 auto}
  .nav-label{display:none}
  .nav-item{width:auto; white-space:nowrap; padding:8px 12px}
  .sidebar-foot{margin:0 0 0 auto; flex:0 0 auto}
  .progress-block{display:none}
  .user-chip .who{display:none}
  .topbar{padding:10px 16px}
  #app{padding:18px 16px 48px}
  .stat-grid{grid-template-columns:1fr 1fr}
  /* The resume card's fixed thumb + min-width body is the one block that
     can't shrink below ~450px — stack it rather than let it push the
     whole page into horizontal scroll. */
  .resume-card{padding:16px; gap:14px}
  .resume-card .thumb{width:100%; flex:1 1 100%; height:96px}
  .resume-card .body{min-width:0}
  .quiz-progress .dots{min-width:70px}
  .module-row{flex-wrap:wrap}
  .module-row .bar{flex:1 1 100%; width:auto}
  .fc-card{padding:28px; min-height:240px}
  .fc-card .fc-text{font-size:21px}
  .quiz-q{padding:18px}
  .quiz-q .q-prompt{font-size:19px}
  .score-card .score{font-size:52px}
  .display{font-size:27px}
  .landing-hero{grid-template-columns:1fr;gap:45px;min-height:auto;padding-top:64px;padding-bottom:64px}.landing-preview{max-width:530px;width:100%;justify-self:center}.landing-access{grid-template-columns:1fr;gap:34px;padding-top:70px;padding-bottom:70px}.landing-benefits{grid-template-columns:1fr}.landing-benefits>div,.landing-benefits>div+div{border-left:0;border-bottom:1px solid var(--line);padding:26px 0}.landing-benefits>div:last-child{border-bottom:0}
}
@media (max-width:560px){.landing-hero,.landing-benefits,.landing-access,.landing-footer{padding-left:22px;padding-right:22px}.landing-copy h1{font-size:45px}.landing-preview{padding:17px}.preview-title{font-size:28px}.landing-actions{align-items:flex-start;flex-direction:column;gap:16px}.landing-access h2{font-size:34px}}
@media (min-width:2200px){ #app{max-width:1700px} }
@media print{ .sidebar,.topbar{display:none} }
