
/* ---------- tokens: DARK is the base, light is the override ---------- */
:root{
  --ground:#0A0D12; --surface:#11151C; --surface-2:#171D26; --surface-3:#1E2630;
  --ink:#DEE4EC; --ink-2:#AFB9C6; --muted:#78838F;
  --rule:#1F2731; --rule-2:#18202A;
  --brass:#C8A04A; --brass-2:#E0BC72; --brass-soft:#1E1A10;
  --steel:#7FA9D6;
  --ok:#5FC195; --warn:#E2A85C; --bad:#EF8479;
  --boss-cut:#0A0D12;
  --shadow:0 1px 2px rgba(0,0,0,.5),0 12px 32px -14px rgba(0,0,0,.75);
  --t-foundation:#C4564A; --t-appsec:#6E9E58; --t-defense:#4B8AC6;
  --t-offense:#8E6CBF; --t-adversarial:#C05C9A; --t-ai:#45A08C; --t-grc:#7C8A99;
  --ar:"IBM Plex Sans Arabic","Segoe UI",Tahoma,sans-serif;
  --dp:Archivo,"Helvetica Neue",Arial,sans-serif;
  --mo:"IBM Plex Mono",ui-monospace,Consolas,monospace;
}
@media (prefers-color-scheme:light){
  :root:not([data-theme="dark"]){
    --ground:#EDEFF3; --surface:#FFFFFF; --surface-2:#F4F6F9; --surface-3:#E8ECF1;
    --ink:#10141A; --ink-2:#3A434F; --muted:#5F6975;
    --rule:#D5DBE3; --rule-2:#E4E9EF;
    --brass:#8A6A22; --brass-2:#6E5318; --brass-soft:#F5EFE0;
    --steel:#2C5580;
    --ok:#1F6B4A; --warn:#8B5310; --bad:#96302B;
    --boss-cut:#FFFFFF;
    --shadow:0 1px 2px rgba(16,20,26,.06),0 12px 32px -16px rgba(16,20,26,.22);
    --t-foundation:#A84034; --t-appsec:#4F7A3C; --t-defense:#2F6DA8;
    --t-offense:#6B49A0; --t-adversarial:#A03F7B; --t-ai:#2A8271; --t-grc:#5C6A79;
  }
}
:root[data-theme="light"]{
  --ground:#EDEFF3; --surface:#FFFFFF; --surface-2:#F4F6F9; --surface-3:#E8ECF1;
  --ink:#10141A; --ink-2:#3A434F; --muted:#5F6975;
  --rule:#D5DBE3; --rule-2:#E4E9EF;
  --brass:#8A6A22; --brass-2:#6E5318; --brass-soft:#F5EFE0;
  --steel:#2C5580;
  --ok:#1F6B4A; --warn:#8B5310; --bad:#96302B;
  --boss-cut:#FFFFFF;
  --shadow:0 1px 2px rgba(16,20,26,.06),0 12px 32px -16px rgba(16,20,26,.22);
  --t-foundation:#A84034; --t-appsec:#4F7A3C; --t-defense:#2F6DA8;
  --t-offense:#6B49A0; --t-adversarial:#A03F7B; --t-ai:#2A8271; --t-grc:#5C6A79;
}

*{box-sizing:border-box}
/* overflow-x:hidden on <body> PROPAGATES to the viewport, and a hidden viewport is
   still a *scroll container* — scrollable by script, by focus, and by the RTL initial
   scroll position. So one stray wide child did not just get clipped: the whole page
   loaded scrolled to its inline end, pushing the RTL layout off the right edge on
   every phone. `clip` clips without ever creating a scroll container, so a stray
   wide child can never shift the page again. The hidden declaration stays first as
   the fallback for engines that do not know `clip`. */
html{scroll-behavior:smooth; overflow-x:hidden; overflow-x:clip}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font-family:var(--ar); font-size:16.5px; line-height:1.75;
  -webkit-font-smoothing:antialiased; overflow-x:hidden; overflow-x:clip;
  direction:rtl; text-align:start;
}
/* every inline Latin run is isolated so adjacent neutrals (. , : () {}) resolve
   against the Latin run, not against the Arabic paragraph */
bdi{unicode-bidi:isolate}
/* plaintext, not isolate: each physical line picks its own base direction from
   its first strong character (Unicode P2/P3). A pure-code line stays ltr and
   flush-inline-start; an Arabic comment line (whole-line // or #) flips to rtl and
   reads right-to-left the way the student expects, instead of the whole block being
   pinned ltr and laying the Arabic words out backwards. direction:ltr stays as the
   fallback for lines with no strong character (blanks, symbol-only). text-align was
   `left`, now `start` so each line aligns to the edge its own direction begins at. */
pre,pre code,figure.cb pre,figure.cb code{direction:ltr; unicode-bidi:plaintext; text-align:start}
a{color:var(--steel); text-decoration:none}
a:hover{text-decoration:underline; text-underline-offset:3px}
:focus-visible{outline:2px solid var(--brass); outline-offset:2px; border-radius:3px}
button{font-family:inherit; color:inherit; cursor:pointer}
.wrap{max-width:1240px; margin:0 auto; padding:0 26px}
.en{font-family:var(--dp); direction:ltr; unicode-bidi:isolate}
code,kbd,pre{font-family:var(--mo)}
/* `anywhere`, not `break-word`: only `anywhere` also shrinks the element's
   min-content size, and it is min-content that blows a grid/flex track open. Inline
   code carries registry keys and %APPDATA% paths 400px wide, which is what widened
   the lecture pages past a phone. Code *blocks* set white-space:pre and so have no
   wrap opportunities at all — this rule cannot touch them. */
code{direction:ltr; unicode-bidi:isolate; font-size:.86em; background:var(--surface-2);
  border:1px solid var(--rule-2); border-radius:3px; padding:.08em .34em; color:var(--ink-2);
  overflow-wrap:anywhere}

/* ---------- header ---------- */
header.top{position:sticky; top:0; z-index:60; background:color-mix(in srgb,var(--ground) 88%,transparent);
  backdrop-filter:blur(12px); border-bottom:1px solid var(--rule)}
.topin{max-width:1240px; margin:0 auto; padding:0 26px; height:60px; display:flex;
  align-items:center; gap:18px}
.brand{display:flex; align-items:center; gap:11px; color:var(--brass); flex:none}
.brand .mark{display:block; flex:none}
.brand b{font-family:var(--dp); font-weight:700; font-size:19px; letter-spacing:.02em;
  color:var(--ink); direction:ltr}
.brand span{font-size:11px; color:var(--muted); letter-spacing:.14em; text-transform:uppercase;
  font-family:var(--mo); display:block; margin-top:-4px}
nav.main{display:flex; gap:4px; margin-inline-start:auto}
nav.main a{padding:7px 13px; border-radius:5px; font-size:14.5px; color:var(--ink-2)}
nav.main a:hover{background:var(--surface-2); color:var(--ink); text-decoration:none}
nav.main a.on{color:var(--brass); background:var(--brass-soft)}
/* the enrolment nav item is a CTA: tinted in the Blue Team colour so it reads with
   the announcement strip and the map badge, and stands out from the plain links.
   An inset ring, not a border, so it does not shift the row height. */
nav.main a.nav-cta{color:var(--t-defense); font-weight:600;
  background:color-mix(in srgb,var(--t-defense) 15%,transparent);
  box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--t-defense) 55%,transparent)}
nav.main a.nav-cta:hover{color:var(--t-defense); text-decoration:none;
  background:color-mix(in srgb,var(--t-defense) 24%,transparent);
  box-shadow:inset 0 0 0 1px var(--t-defense)}
nav.main a.nav-cta.on{color:var(--t-defense); background:color-mix(in srgb,var(--t-defense) 22%,transparent)}
.tbtn{background:transparent; border:1px solid var(--rule); border-radius:6px;
  height:34px; padding:0 11px; display:inline-flex; align-items:center; gap:7px;
  font-size:13px; color:var(--ink-2); transition:.15s}
.tbtn:hover{border-color:var(--brass); color:var(--ink)}
/* #btn-acct is a link styled as a .tbtn; a:hover would underline its label */
a.tbtn{white-space:nowrap} a.tbtn:hover{text-decoration:none}
.tbtn kbd{font-family:var(--mo); font-size:10.5px; background:var(--surface-2);
  border:1px solid var(--rule); border-radius:3px; padding:1px 4px; color:var(--muted)}
.ico{width:15px; height:15px; flex:none; stroke:currentColor; fill:none; stroke-width:1.7;
  stroke-linecap:round; stroke-linejoin:round}
/* nav.main carried the margin-inline-start:auto that pushed the controls to the
   inline end; once it is display:none the buttons need to carry it themselves,
   otherwise they sit against the brand and spill out of a 320px header. */
@media(max-width:900px){nav.main{display:none} .tbtn .lbl,.tbtn kbd{display:none}
  #btn-search{margin-inline-start:auto} .tbtn{min-width:40px; justify-content:center}}
@media(pointer:coarse),(max-width:560px){.topin{gap:11px}}
/* brand + three icon buttons (search, theme, account) needs ~306px; a 320px phone
   has 286 inside the gutters, so the smallest screens tighten the row */
@media(max-width:374px){.topin{gap:8px} .tbtn{min-width:36px; padding:0 8px}}

/* ---------- launch announcement strip (above the hero) ---------- */
/* --annc is the Blue Team track colour; kept off the hero so the landing's
   marketing front door is untouched below it. */
.annc-w{margin-top:16px}
.annc{--annc:#4B8AC6; display:flex; align-items:center; gap:12px;
  padding:10px 16px; border-radius:11px; text-decoration:none;
  border:1px solid color-mix(in srgb,var(--annc) 42%,var(--rule));
  background:color-mix(in srgb,var(--annc) 11%,var(--surface)); color:var(--ink);
  transition:border-color .16s, background .16s}
.annc:hover{text-decoration:none; border-color:var(--annc);
  background:color-mix(in srgb,var(--annc) 16%,var(--surface))}
.annc-tag{flex:none; font-family:var(--mo); font-size:13px; font-weight:700; letter-spacing:.08em;
  color:#fff; background:var(--annc); border-radius:5px; padding:5px 12px}
.annc-tx{flex:1 1 auto; min-width:0; font-size:14px; color:var(--ink-2); line-height:1.6}
.annc-tx b{color:var(--ink); font-weight:700}
.annc-cta{flex:none; display:inline-flex; align-items:center; gap:3px; font-size:13.5px;
  font-weight:600; color:var(--annc); white-space:nowrap}
.annc-cta .ico{width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:2.2}
/* the discount variant of the tag (Winter Arc): Arabic text, so no letter-spacing (it
   breaks the joins), and a deeper blue so white text clears 4.5:1 */
.annc-tag.annc-off{display:inline-flex; align-items:center; gap:5px; font-family:inherit;
  letter-spacing:0; background:#2F6EA8; padding:5px 11px}
.annc-tag .snow{width:15px; height:15px; stroke-width:2}
/* a struck price, slashed corner to corner: a level line-through runs straight along
   the Arabic-Indic zeros (each a mid-height dot) and turns ٥٠٠٬٠٠٠ into a dash; the
   diagonal crosses the row once and leaves the digits readable. --ink-2, not --muted:
   muted reads about 4.2:1 on the blue tint in the dark theme, under AA */
.annc-tx s,.c-enroll-tx s{display:inline-block; padding:0 3px; text-decoration:none;
  color:var(--ink-2); white-space:nowrap;
  background:linear-gradient(to top left, transparent calc(50% - .9px), currentColor calc(50% - .9px),
    currentColor calc(50% + .9px), transparent calc(50% + .9px))}
@media(max-width:620px){
  .annc{flex-wrap:wrap; gap:8px 10px}
  .annc-tx{flex:1 1 100%; order:3}
}

/* ---------- hero ---------- */
.hero{position:relative; padding:74px 0 30px; overflow:hidden}
.hero::before{content:""; position:absolute; inset:-40% -20% auto -20%; height:620px;
  background:radial-gradient(ellipse at 50% 0%,color-mix(in srgb,var(--brass) 13%,transparent),transparent 62%);
  pointer-events:none}
.hero .wrap{position:relative}
.eyebrow{font-family:var(--mo); font-size:11.5px; letter-spacing:.2em; text-transform:uppercase;
  color:var(--brass); margin-bottom:20px; display:flex; gap:12px; align-items:center; flex-wrap:wrap}
.eyebrow i{width:26px; height:1px; background:var(--brass); opacity:.55; display:inline-block; font-style:normal}
h1.hero-h{font-size:clamp(33px,5.6vw,58px); line-height:1.22; letter-spacing:-.01em;
  font-weight:700; margin:0 0 22px; max-width:19ch; text-wrap:balance}
h1.hero-h em{font-style:normal; color:var(--brass)}
.lede{font-size:clamp(17px,2.1vw,20px); line-height:1.8; color:var(--ink-2); max-width:58ch; margin:0 0 30px}
.hero-cta{display:flex; gap:12px; flex-wrap:wrap; align-items:center}
.btn{display:inline-flex; align-items:center; gap:9px; height:44px; padding:0 20px;
  border-radius:7px; font-size:15px; font-weight:600; border:1px solid transparent; transition:.16s}
.btn-p{background:var(--brass); color:var(--ground); border-color:var(--brass)}
.btn-p:hover{background:var(--brass-2); border-color:var(--brass-2); text-decoration:none}
:root[data-theme="light"] .btn-p,html:not([data-theme]) .btn-p{color:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .btn-p{color:var(--ground)}}
:root[data-theme="dark"] .btn-p{color:var(--ground)}
.btn-s{background:transparent; border-color:var(--rule); color:var(--ink)}
.btn-s:hover{border-color:var(--brass); text-decoration:none}
.stats{display:flex; gap:30px; flex-wrap:wrap; margin-top:38px; padding-top:26px;
  border-top:1px solid var(--rule)}
.stat b{display:block; font-family:var(--mo); font-size:26px; font-weight:500; color:var(--ink);
  font-variant-numeric:tabular-nums; line-height:1.1}
.stat span{font-size:13px; color:var(--muted)}

/* ---------- section frame ---------- */
.sect{padding:64px 0 20px}
.sect-h{display:flex; align-items:baseline; gap:14px; margin-bottom:10px; flex-wrap:wrap}
.sect-h h2{font-size:clamp(24px,3.4vw,33px); font-weight:700; margin:0; letter-spacing:-.01em}
.sect-h .k{font-family:var(--mo); font-size:11px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--brass); border:1px solid var(--rule); background:var(--brass-soft);
  padding:3px 8px; border-radius:4px}
.sect-sub{color:var(--muted); max-width:64ch; margin:0 0 26px; font-size:15.5px}

/* ---------- roadmap ---------- */
.legend{display:flex; gap:7px 16px; flex-wrap:wrap; margin-bottom:18px; font-size:13px}
.lg{display:inline-flex; align-items:center; gap:7px; color:var(--muted)}
.lg i{width:9px; height:9px; border-radius:2px; display:inline-block; flex:none}
.lg.edge i{width:20px; height:0; border-top:2px solid var(--muted); border-radius:0}
.lg.edge.dash i{border-top-style:dashed}
.map-shell{position:relative; border:1px solid var(--rule); border-radius:12px;
  background:var(--surface); box-shadow:var(--shadow); overflow:hidden}
.map-scroll{overflow-x:auto; overflow-y:hidden; padding:26px 22px 22px}
.map{position:relative; direction:ltr; margin:0 auto}
.map svg.edges{position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible}
.map svg.edges path{fill:none; stroke:var(--rule); stroke-width:2; transition:stroke .2s,stroke-width .2s}
.map svg.edges path.soft{stroke-dasharray:5 5}
.map svg.edges path.hi{stroke:var(--brass); stroke-width:2.6}
.node{position:absolute; border:1px solid var(--rule); background:var(--surface-2);
  border-radius:10px; padding:13px 15px 14px; text-align:start; direction:rtl;
  transition:.18s; cursor:pointer; overflow:hidden; display:flex; gap:12px; align-items:flex-start}
.node-emb{flex:none; color:var(--tc); opacity:.92; margin-top:2px}
.node-t{min-width:0; flex:1}
.node::before{content:""; position:absolute; inset:0 0 auto 0; height:3px; background:var(--tc)}
.node:hover{border-color:var(--tc); transform:translateY(-2px);
  box-shadow:0 8px 26px -10px color-mix(in srgb,var(--tc) 55%,transparent)}
.node.on{border-color:var(--tc); background:var(--surface-3);
  box-shadow:0 0 0 1px var(--tc),0 10px 30px -12px color-mix(in srgb,var(--tc) 60%,transparent)}
.node .code{font-family:var(--mo); font-size:10px; letter-spacing:.13em; color:var(--tc);
  display:block; margin-bottom:5px; font-weight:500}
.node .nm{font-weight:600; font-size:14.5px; line-height:1.42; display:block; margin-bottom:7px}
.node .meta{font-size:11.5px; color:var(--muted); display:flex; gap:9px; flex-wrap:wrap;
  align-items:center; font-family:var(--mo)}
.node .tag{font-size:9.5px; letter-spacing:.1em; text-transform:uppercase; padding:2px 6px;
  border-radius:3px; border:1px solid var(--tc); color:var(--tc); font-family:var(--mo)}
/* the pre-enrolment node badge is enlarged and filled so it reads at a glance */
.node .tag.en{font-size:11.5px; padding:3px 10px; font-weight:700; letter-spacing:0;
  text-transform:none; background:color-mix(in srgb,var(--tc) 26%,transparent); border-color:var(--tc)}
/* while the course is discounted (Winter Arc) the badge carries the offer instead,
   in the same deeper blue as the strip's tag; Arabic text, so the Arabic face (.meta
   around it is monospace, which has no Arabic glyphs) */
.node .tag.en.off{font-family:var(--ar); color:#fff; background:#2F6EA8; border-color:#2F6EA8}
.map-hint{padding:9px 22px 14px; font-size:12.5px; color:var(--muted); border-top:1px solid var(--rule-2);
  display:flex; gap:8px; align-items:center}

/* mobile accordion replaces the canvas */
.map-acc{display:none; border:1px solid var(--rule); border-radius:12px; background:var(--surface);
  overflow:hidden}
.acc-i{border-bottom:1px solid var(--rule-2)}
.acc-i:last-child{border-bottom:none}
.acc-b{width:100%; background:transparent; border:0; padding:15px 17px; text-align:start;
  display:flex; align-items:center; gap:11px; border-inline-start:3px solid var(--tc)}
.acc-b .nm{font-weight:600; font-size:15px; flex:1}
.acc-b .code{font-family:var(--mo); font-size:10px; color:var(--tc); letter-spacing:.12em}
.acc-p{display:none; padding:0 17px 16px 17px; border-inline-start:3px solid var(--tc)}
.acc-i.open .acc-p{display:block}
@media(max-width:820px){.map-shell{display:none} .map-acc{display:block}}

/* ---------- detail panel ---------- */
.detail{margin-top:20px; border:1px solid var(--rule); border-radius:12px; background:var(--surface);
  padding:24px 26px 26px; box-shadow:var(--shadow); display:none}
.detail.open{display:block; animation:fade .22s ease}
/* Below 820px .map-shell is hidden and .map-acc takes over, but the detail panel the
   shell drives stayed open, showing a course the phone reader never picked. This has
   to sit after .detail.open: same specificity, so it wins on order rather than needing
   !important. */
@media(max-width:820px){.detail.open{display:none}}
@keyframes fade{from{opacity:0; transform:translateY(6px)}to{opacity:1; transform:none}}
.detail-h{display:flex; align-items:flex-start; gap:14px; flex-wrap:wrap; margin-bottom:6px}
.detail-h h3{margin:0; font-size:23px; font-weight:700; line-height:1.35; flex:1; min-width:220px}
.detail .sub{font-family:var(--dp); direction:ltr; text-align:start; color:var(--muted);
  font-size:14px; margin-bottom:14px}
.detail .note{color:var(--ink-2); border-inline-start:2px solid var(--dc); padding-inline-start:14px;
  margin:0 0 20px; font-size:15px}
.dgrid{display:grid; gap:22px; grid-template-columns:1fr}
@media(min-width:720px){.dgrid{grid-template-columns:1.35fr .95fr}}
.dk{font-family:var(--mo); font-size:10.5px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--muted); margin-bottom:10px}
.mods{margin:0; padding:0; list-style:none; display:grid; gap:1px; background:var(--rule-2);
  border:1px solid var(--rule-2); border-radius:7px; overflow:hidden}
.mods li{background:var(--surface-2); padding:9px 13px; font-size:14px; color:var(--ink-2);
  display:flex; gap:9px; align-items:baseline}
.mods li::before{content:""; width:4px; height:4px; border-radius:50%; background:var(--dc); flex:none;
  transform:translateY(-3px)}
.pre-list{display:flex; flex-direction:column; gap:8px; margin-bottom:20px}
.pre-c{display:flex; align-items:center; gap:10px; border:1px solid var(--rule); border-radius:7px;
  padding:9px 12px; background:var(--surface-2); font-size:13.5px; width:100%; text-align:start}
.pre-c:hover{border-color:var(--brass)}
.pre-c i{width:7px; height:7px; border-radius:2px; flex:none; font-style:normal}
.pre-c b{font-weight:600}
.pre-c small{color:var(--muted); margin-inline-start:auto; font-family:var(--mo); font-size:10.5px;
  letter-spacing:.1em; text-transform:uppercase}
.none{color:var(--muted); font-size:14px; border:1px dashed var(--rule); border-radius:7px;
  padding:11px 13px; background:var(--surface-2)}

/* ---------- lecture cards ---------- */
/* ---------- concept network ----------
   Body state classes stay out of the element namespace: `view-net`, not `net`. */
.netpage,.guidepage,.teampage,.sespage{display:none}
body.view-net .netpage,body.view-guide .guidepage,body.view-team .teampage,
body.view-ses .sespage{display:block}
body.view-net .landing,body.view-guide .landing,body.view-team .landing,
body.view-ses .landing{display:none}

/* ---------- instructor ---------- */
.teampage .wrap{padding-top:26px; padding-bottom:60px}
.tm-hero{display:flex; gap:38px; align-items:center; flex-wrap:wrap; margin:22px 0 44px}
/* height:auto or the img's height attribute wins and aspect-ratio never applies,
   which stretched a 900x1600 portrait into a 170x1600 ellipse. The attributes stay
   for the intrinsic ratio; the box is squared here and the face framed by
   object-position (the crop is vertical only, so the x value is inert). */
.tm-photo{width:min(290px,62vw); height:auto; aspect-ratio:1;
  object-fit:cover; object-position:50% 12%;
  border-radius:50%; border:1px solid var(--rule); background:var(--surface-2); flex:none}
.tm-htext{flex:1; min-width:270px}
.tm-htext h1{font-size:clamp(30px,4.6vw,46px); margin:0 0 6px; font-weight:700; letter-spacing:-.01em}
.tm-role{margin:0 0 16px; color:var(--brass); font-size:15px}
.tm-htext .lede{margin-bottom:22px; max-width:46ch}
.tm-links{display:flex; gap:9px; flex-wrap:wrap}
.tm-links .btn{height:38px; padding:0 15px; font-size:14px}
.tm-links .ico{width:16px; height:16px}
.tm-links .btn:hover{color:var(--brass)}
.tm-body{max-width:62ch}
.tm-body h2{font-size:clamp(19px,2.6vw,24px); margin:34px 0 10px; font-weight:600}
.tm-body p{color:var(--ink-2); line-height:1.95; margin:0 0 14px}
.tm-note{border-inline-start:2px solid var(--brass); padding-inline-start:15px; color:var(--ink)}
@media(max-width:700px){
  .tm-hero{gap:24px; margin-bottom:32px}
  .tm-photo{width:170px}
  .tm-links .btn{flex:1; min-width:132px; justify-content:center}
}
.net-head{padding:30px 0 4px}
.net-head .sect-sub{margin-bottom:14px}
.net-ctl{border-bottom:1px solid var(--rule); background:var(--surface); padding:14px 0 12px}
.ctl-row{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:12px}
.ctl-search{flex:1; min-width:200px; display:flex; align-items:center; gap:9px;
  background:var(--surface-2); border:1px solid var(--rule); border-radius:7px; padding:0 12px; height:36px}
.ctl-search input{flex:1; min-width:0; background:transparent; border:none; outline:none;
  font-family:var(--ar); font-size:14px; color:var(--ink)}
.ctl-search .ico{color:var(--muted)}
.ctl-grid{display:grid; gap:12px 22px; grid-template-columns:repeat(auto-fit,minmax(215px,1fr))}
.ctl-k{font-family:var(--mo); font-size:10px; letter-spacing:.15em; text-transform:uppercase;
  color:var(--muted); margin-bottom:7px}
.ctl-k b{color:var(--brass); font-weight:500}
.chips{display:flex; gap:6px; flex-wrap:wrap}
.chip{display:inline-flex; align-items:center; gap:6px; border:1px solid var(--rule);
  background:transparent; border-radius:999px; padding:4px 11px; font-size:12.5px;
  color:var(--muted); transition:.14s; line-height:1.6}
.chip i{width:8px; height:8px; border-radius:50%; flex:none; background:currentColor; font-style:normal}
.chip small{font-family:var(--mo); font-size:10px; opacity:.8}
.chip:hover{color:var(--ink); border-color:var(--muted)}
.chip.on{color:var(--ink); border-color:currentColor; background:var(--surface-2)}
.chip.on.k-lecture{color:var(--brass)} .chip.on.k-course{color:var(--steel)}
.chip.on.k-method{color:var(--t-adversarial)} .chip.on.k-tool{color:var(--t-offense)}
.chip.on.k-defense{color:var(--t-defense)} .chip.on.k-technique{color:var(--t-ai)}
.chip.on.k-actor{color:var(--t-foundation)}
/* 22px is not a thumb; pan-y keeps a vertical swipe scrolling the page while a
   horizontal drag still reaches the slider. */
.rng{width:100%; accent-color:var(--brass); height:44px; touch-action:pan-y}
.ctl-stat{margin-top:11px; font-size:12.5px; color:var(--muted); font-family:var(--mo)}
.ctl-stat b{color:var(--ink); font-weight:500}

/* pan-y, not none: the stage is most of a phone screen, so a one-finger swipe
   has to scroll the page. Two fingers pan and pinch the map instead. */
.net-stage{position:relative; height:min(70vh,720px); height:min(70dvh,720px);
  border-bottom:1px solid var(--rule);
  background:var(--ground); overflow:hidden; touch-action:pan-y}
#g-svg{width:100%; height:100%; display:block; cursor:grab}
#g-svg.drag{cursor:grabbing}
.ge{stroke:var(--rule); stroke-width:1; opacity:.4}
.ge.e-cites{stroke:var(--brass); opacity:.13}
.ge.e-hard,.ge.e-soft{stroke:var(--steel); opacity:.55; stroke-width:1.5}
.ge.hot{stroke:var(--brass); opacity:1; stroke-width:2.4;
  filter:drop-shadow(0 0 5px var(--brass))}
.ge.lit{opacity:.95; stroke-width:1.8}
.ge.faint{opacity:.08}
.gn{cursor:pointer}
.gn{color:var(--muted)}
.gn circle{fill:currentColor; stroke:var(--ground); stroke-width:1.5;
  transition:opacity .15s, filter .15s}
/* --gs is the graph's current zoom, written by gView(). Dividing by it holds the
   label at a constant SCREEN size: fitted to a phone the graph draws at s~0.355,
   which rendered this 10.5px type at 3.7px and made every label unreadable. The
   halo has to be counter-scaled with it or the 3-unit outline lands at 1px and the
   text loses its contrast against the edges underneath. */
.gn text{font-family:var(--ar); font-size:calc(10.5px / var(--gs,1)); fill:var(--ink-2);
  pointer-events:none; paint-order:stroke; stroke:var(--ground);
  stroke-width:calc(3px / var(--gs,1)); stroke-linejoin:round}
.gn.k-lecture{color:var(--brass)} .gn.k-course{color:var(--steel)}
.gn.k-method{color:var(--t-adversarial)} .gn.k-tool{color:var(--t-offense)}
.gn.k-defense{color:var(--t-defense)} .gn.k-technique{color:var(--t-ai)}
.gn.k-actor{color:var(--t-foundation)}
/* only the handful of matched nodes get a filter; putting one on all 95 is slow */
.gn.hit circle{filter:drop-shadow(0 0 6px currentColor) drop-shadow(0 0 13px currentColor)}
.gn.hit text{fill:var(--ink); font-weight:600}
.gn.sel circle{filter:drop-shadow(0 0 7px currentColor)}
/* An invisible hit circle held at a constant screen radius, so a node that draws as
   a 4px dot at phone zoom is still a ~24px target. Named `tap`, not `hit`: `.gn.hit`
   above is the search-match glow, and putting that drop-shadow on this circle would
   paint giant glowing rings. It has to come after the .hit/.sel rules to cancel
   their filter at equal specificity. Browsers without CSS geometry properties keep
   the r attribute gBuild sets, which is no worse than before. */
.gn circle.tap{fill:transparent; stroke:none; filter:none; r:calc(12px / var(--gs,1))}
.gn.dim{opacity:.13}
.gn.near{opacity:.82}          /* one hop from the focus: must stay readable */
.gn.lbl-hide text{opacity:0}
.gn.lbl-hide:hover text{opacity:1}
.gn.sel circle{stroke:var(--brass); stroke-width:2.5}
.gn.sel text{fill:var(--ink)}
.ge.dim{opacity:.03}

.net-card{position:absolute; inset-block-start:14px; inset-inline-start:14px; z-index:3;
  width:min(310px,calc(100% - 96px));
  background:var(--surface); border:1px solid var(--rule); border-radius:10px;
  box-shadow:var(--shadow); padding:15px 17px; display:none; max-height:calc(100% - 28px);
  overflow-y:auto}
.net-card.on{display:block}
.net-card h4{margin:0 0 3px; font-size:15.5px; font-weight:600}
.net-card .nc-k{font-family:var(--mo); font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brass); margin-bottom:9px}
.net-card p{margin:0 0 11px; font-size:13px; color:var(--ink-2); line-height:1.7}
.net-card .nc-s{font-family:var(--mo); font-size:10.5px; letter-spacing:.13em;
  text-transform:uppercase; color:var(--muted); margin:11px 0 6px}
.net-card a{display:block; font-size:12.7px; padding:3px 0; color:var(--steel)}
.net-card .nc-k,.net-card h4{padding-inline-end:40px}
.net-card .nc-x{position:absolute; inset-block-start:6px; inset-inline-end:6px;
  width:40px; height:40px; display:flex; align-items:center; justify-content:center; padding:0;
  background:transparent; border:none; color:var(--muted); font-size:16px; line-height:1}
.net-hint{position:absolute; inset-block-end:12px; inset-inline-end:14px; font-size:11.5px;
  color:var(--muted); background:color-mix(in srgb,var(--surface) 82%,transparent);
  border:1px solid var(--rule); border-radius:6px; padding:5px 10px; pointer-events:none}
.net-zoom{position:absolute; inset-block-start:14px; inset-inline-end:14px; z-index:2;
  display:flex; flex-direction:column; gap:6px}
.net-zoom button{width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  background:color-mix(in srgb,var(--surface) 92%,transparent); color:var(--ink-2);
  border:1px solid var(--rule); border-radius:8px; font-size:19px; line-height:1;
  font-family:var(--mo); transition:.14s}
.net-zoom button:hover{border-color:var(--brass); color:var(--ink)}
.net-zoom button:active{background:var(--surface-3)}
@media(max-width:760px){
  /* the filter block is 534px tall on a phone and pushed the graph 1019px down the
     page - the reader met a wall of chips and never saw the thing they came for.
     Reordering puts the canvas second and the filters under it (measured: the stage
     top goes 1019 -> 270). The compound selector is deliberate: body.view-net .netpage
     sets display:block earlier in the sheet, and a media query adds no specificity. */
  body.view-net .netpage{display:flex; flex-direction:column}
  .net-head{order:1} .net-stage{order:2} .net-ctl{order:3}
  .ctl-grid .chips{flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none}
  /* 62vh left no room to scroll past on a short screen */
  .net-stage{height:min(56vh,460px); height:min(56dvh,460px)}
  .net-hint{inset-inline:14px; inset-inline-end:auto; inset-block-end:10px; font-size:11px}
  .net-zoom button{width:40px; height:40px}   /* thumb-sized */
  /* under 16px iOS Safari zooms the whole page in when the field takes focus,
     and never zooms back out — the page is left wider than the screen. */
  .ctl-search input{font-size:16px}
}

/* guided tour: a card pinned to the viewport while the real controls move
   underneath it, so the reader watches the filters work rather than a video of
   them working. Fixed, because the controls and the canvas do not fit one
   screen on a phone and the card has to survive the scroll between them. */
.net-tour{position:fixed; inset-block-end:18px; left:50%; transform:translateX(-50%);
  width:min(580px,calc(100vw - 26px)); z-index:75; display:none;
  background:var(--surface); border:1px solid var(--rule); border-radius:12px;
  box-shadow:var(--shadow); padding:15px 18px 14px}
body.tour-on .net-tour{display:block}
body.tour-on .sb-fab{display:none}      /* the fab sits exactly where the card lands */
.net-tour .tr-k{font-family:var(--mo); font-size:10px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brass); margin-bottom:7px}
.net-tour h4{margin:0 0 6px; font-size:16px; font-weight:600}
.net-tour p{margin:0; font-size:13.5px; color:var(--ink-2); line-height:1.85}
.net-tour .tr-r{margin-top:10px; font-family:var(--mo); font-size:11.5px; color:var(--muted)}
.net-tour .tr-r b{color:var(--ink); font-weight:500}
.net-tour .tr-b{display:flex; gap:8px; align-items:center; margin-top:14px}
.net-tour .tr-b .sp{flex:1}
.net-tour .btn{padding:6px 15px; font-size:13px}
.net-tour .tr-k,.net-tour h4{padding-inline-end:38px}
.net-tour .tr-x{position:absolute; inset-block-start:5px; inset-inline-end:6px;
  width:40px; height:40px; display:flex; align-items:center; justify-content:center;
  background:transparent; border:none; color:var(--muted); font-size:18px; line-height:1;
  cursor:pointer; padding:2px 5px}
.net-tour .tr-x:hover{color:var(--ink)}
/* outline, not border or box-shadow: it must not shift the control it rings */
.tour-lit{outline:2px solid var(--brass); outline-offset:6px; border-radius:8px;
  animation:tourpulse .5s ease-out}
@keyframes tourpulse{0%{outline-offset:1px} 60%{outline-offset:10px} 100%{outline-offset:6px}}
@media(prefers-reduced-motion:reduce){.tour-lit{animation:none}}
/* The card is fixed to the bottom of the viewport at every width, so the control a
   step highlights has to be scrolled clear of it at every width too. On .tour-lit
   itself, not on the enumerated .ctl-b/.ctl-search: some steps light a bare .btn,
   which those selectors would miss. --tourh is written by tourGo() once the card's
   HTML for this step is in place. */
.tour-lit{scroll-margin-block-end:calc(var(--tourh,240px) + 26px)}
@media(max-width:760px){.net-tour{inset-block-end:10px; padding:13px 15px 12px}
  .net-tour p{font-size:13px; line-height:1.75}}

/* labels: every node keeps one, crowded ones wait for hover */
.gn.lbl-off text{opacity:0; transition:opacity .12s}
.gn.lbl-off:hover text{opacity:1}
.gn:hover circle{stroke:var(--brass)}
.ge.e-attck{stroke:var(--t-ai); opacity:.8; stroke-width:1.4; stroke-dasharray:5 3}
.ge.e-attck.hot{stroke:var(--brass); stroke-dasharray:none}
.chip.on.e-att{color:var(--t-ai)}
.gn.done circle{stroke:var(--ok); stroke-width:2.6}
.nc-more{display:block; font-size:11.5px; color:var(--muted); padding:2px 0 4px}

/* progress */
.dn-btn.on{color:var(--ok); border-color:var(--ok)}
.card .done-b{display:none}
.card.done .done-b{display:inline; color:var(--ok)}
.card.done{border-color:color-mix(in srgb,var(--ok) 42%,var(--rule))}
.vault-act{display:flex; gap:10px; flex-wrap:wrap; align-items:center}

/* ---------- guide ---------- */
.guidepage .wrap{max-width:82ch}
.guidepage .crumb{margin-top:26px}
.guidepage article{padding:22px 0 30px}
.guidepage h1{font-size:clamp(25px,4vw,35px); font-weight:700; line-height:1.35;
  margin:0 0 24px; text-wrap:balance}
.guidepage article h2{font-size:clamp(19px,2.7vw,24px); margin:44px 0 14px; padding-top:20px;
  border-top:1px solid var(--rule)}
.guidepage article h3{font-size:clamp(16px,2.1vw,18px); margin:28px 0 10px; color:var(--brass)}
.guidepage article p,.guidepage article li{color:var(--ink-2)}
.guidepage article ul,.guidepage article ol{padding-inline-start:24px; margin:0 0 18px}
.guidepage article li{margin-bottom:8px}
.guidepage article li::marker{color:var(--brass)}
.guidepage article blockquote{margin:22px 0; padding:14px 18px;
  border-inline-start:3px solid var(--brass); background:var(--surface-2);
  color:var(--ink-2); font-size:15px;
  border-start-start-radius:0; border-end-start-radius:0;
  border-start-end-radius:7px; border-end-end-radius:7px}
.g-cta{display:flex; gap:11px; flex-wrap:wrap; padding:8px 0 90px;
  border-top:1px solid var(--rule); margin-top:10px; padding-top:26px}

/* ---------- vault panel ---------- */
.vault-box{display:flex; align-items:center; gap:20px; flex-wrap:wrap; justify-content:space-between;
  border:1px solid var(--rule); border-radius:11px; background:var(--surface);
  padding:20px 22px; box-shadow:var(--shadow)}
.vault-k{font-family:var(--mo); font-size:10.5px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--brass); margin-bottom:9px}
.vault-n{display:flex; gap:8px 18px; flex-wrap:wrap; color:var(--muted); font-size:13.5px}
.vault-n b{font-family:var(--mo); font-size:16px; font-weight:500; color:var(--ink);
  font-variant-numeric:tabular-nums; margin-inline-end:5px}
.vault-note{color:var(--muted); font-size:13.5px; margin:14px 0 0; max-width:64ch}
#dl-vault{flex:none}

/* vault download methods (git clone) + the Windows-security help panel */
/* minmax(0,1fr) + min-width:0, both: the track would otherwise be sized by the
   widest item's min-content, and the item would then refuse to shrink below its own
   min-content. That pair is what made the git-clone card 509px wide and gave every
   landing route 151px of horizontal overflow on a phone. */
.vault-get{margin-top:20px; display:grid; gap:14px; max-width:74ch;
  grid-template-columns:minmax(0,1fr)}
.vault-get>*{min-width:0}
.vault-m{border:1px solid var(--rule); border-radius:10px; background:var(--surface-2); padding:16px 18px}
.vault-mk{font-family:var(--mo); font-size:10.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--brass); margin-bottom:9px}
.vault-m p{color:var(--ink-2); font-size:13.5px; line-height:1.7; margin:0 0 12px}
.clone{display:flex; gap:10px; align-items:flex-start; flex-wrap:wrap}
/* min-width:0 lets the 300px flex-basis actually shrink on a narrow screen; the
   command then scrolls inside its own box instead of widening the page. */
.clone pre{flex:1 1 300px; min-width:0; max-width:100%; margin:0; background:var(--ground);
  border:1px solid var(--rule); border-radius:7px; padding:11px 13px; overflow-x:auto}
.clone code{font-family:var(--mo); font-size:12.5px; color:var(--ink-2); white-space:pre;
  background:none; border:none; padding:0}
.clone .btn{flex:none}
.vault-m .mini{display:inline-block; font-size:12.5px; color:var(--steel)}
/* small pill that opens the warning modal in read-only mode */
.vault-info{display:inline-flex; align-items:center; gap:9px; background:transparent; cursor:pointer;
  color:var(--muted); border:1px solid var(--rule); border-radius:999px; padding:8px 14px;
  font-family:inherit; font-size:13px}
.vault-info:hover{color:var(--ink); border-color:var(--brass); background:var(--surface-2)}
.vault-info svg{width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round; flex:none}

/* ---------- vault download-warning modal ---------- */
body.vm-on{overflow:hidden}
.vmodal{position:fixed; inset:0; z-index:140; align-items:center; justify-content:center;
  padding:20px; overflow-y:auto}
.vmodal:not([hidden]){display:flex}
.vmodal-scrim{position:absolute; inset:0; background:rgba(4,6,9,.72); backdrop-filter:blur(4px)}
.vmodal-dialog{position:relative; background:var(--surface); border:1px solid var(--rule);
  border-radius:14px; max-width:640px; width:100%;
  /* 100vh is the LARGE viewport on a phone, so with the URL bar showing the dialog was
     taller than its own container and the footer buttons sat off-screen with no scroll
     path. .vmodal is fixed inset:0, so a percentage resolves against the height the
     browser actually gave it - correct in every toolbar state, and with no dvh needed. */
  max-height:100%; display:flex;
  flex-direction:column; box-shadow:0 30px 60px -20px rgba(0,0,0,.65)}
.vmodal-h{display:flex; align-items:center; gap:13px; padding:16px 20px 12px; border-bottom:1px solid var(--rule)}
.vmodal-i{flex:none; width:36px; height:36px; display:flex; align-items:center; justify-content:center;
  border-radius:9px; background:color-mix(in srgb,var(--warn) 22%,transparent); color:var(--warn)}
.vmodal-i svg{width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round}
.vmodal-h h3{margin:0; font-size:16.5px; color:var(--ink); flex:1 1 auto}
.vmodal-x{flex:none; background:transparent; border:1px solid var(--rule); border-radius:7px;
  width:32px; height:32px; display:flex; align-items:center; justify-content:center; color:var(--muted);
  cursor:pointer}
.vmodal-x:hover{color:var(--ink); border-color:var(--brass)}
.vmodal-x svg{width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round}
.vmodal-b{padding:16px 20px; overflow-y:auto; flex:1 1 auto}
.vmodal-b p{color:var(--ink-2); font-size:13.8px; line-height:1.8; margin:0 0 12px}
.vmodal-b p:last-child{margin-bottom:0}
.vmodal-b .warn-note{color:var(--warn); font-size:13px}
.vmodal-f{display:flex; align-items:center; gap:12px; padding:12px 20px 16px; border-top:1px solid var(--rule);
  flex-wrap:wrap}
.vmodal-c{display:flex; align-items:center; gap:7px; color:var(--muted); font-size:12.8px;
  margin-inline-end:auto; cursor:pointer}
/* On a phone the checkbox and the two buttons wrapped into a ragged three-row block
   that stranded the primary action on a row of its own. Give the checkbox its own
   full-width row and pair the buttons underneath — also 25px shorter, which matters
   in a dialog already pinned to its max-height. Must follow the base rules: same
   specificity, so it wins on order. */
@media(max-width:640px){.vmodal-f{gap:9px 10px} .vmodal-c{margin-inline-end:0; flex:1 0 100%; order:-1}
  .vmodal-f .btn{flex:1 1 0; justify-content:center}}
.vmodal-c input{accent-color:var(--brass)}
.vmodal.vm-info #v-proceed,.vmodal.vm-info .vmodal-c{display:none}

/* ---------- code walkthrough (binder loader) ---------- */
/* entry card, injected after the full listing in lecture 2A */
.trace-cta{display:flex; align-items:center; gap:15px; width:100%; text-align:start; cursor:pointer;
  border:1px solid color-mix(in srgb,var(--brass) 42%,var(--rule)); border-radius:12px; margin:24px 0;
  padding:15px 18px; background:linear-gradient(180deg,var(--brass-soft),var(--surface))}
.trace-cta:hover{border-color:var(--brass); box-shadow:var(--shadow)}
.trace-cta-i{flex:none; width:38px; height:38px; border-radius:10px; display:flex; align-items:center;
  justify-content:center; background:var(--brass); color:var(--ground)}
.trace-cta-i .ico{width:22px; height:22px}
.trace-cta-t{flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:3px}
.trace-cta-t b{font-family:var(--dp); font-size:15.5px; color:var(--ink)}
.trace-cta-t span{font-size:13px; color:var(--ink-2); line-height:1.6}
.trace-cta-go{flex:none; font-family:var(--mo); font-size:12px; color:var(--brass); align-self:center}
/* the whole card is the button, so the label is redundant; dropping it on a phone gives
   the text column back 108px and takes the card from 175px to 115px tall. */
@media(max-width:640px){.trace-cta-go{display:none}}

/* full-screen overlay */
body.trace-on{overflow:hidden}
/* display only when NOT hidden: a bare `.trace-ov{display:flex}` would beat the UA
   `[hidden]{display:none}` (author > UA) and leave the empty overlay covering every
   page, landing page included. Keep display off the base rule. */
.trace-ov{position:fixed; inset:0; z-index:120; background:var(--ground); flex-direction:column}
.trace-ov:not([hidden]){display:flex}
.trace-head{display:flex; align-items:center; gap:14px; padding:11px 18px; border-bottom:1px solid var(--rule);
  background:var(--surface); flex:none}
.trace-hl{font-family:var(--dp); font-weight:600; font-size:16px; color:var(--ink)}
.trace-lang{display:flex; gap:3px; margin-inline-start:auto; background:var(--surface-2);
  border:1px solid var(--rule); border-radius:9px; padding:3px}
.trace-lang button{display:flex; flex-direction:column; align-items:center; gap:1px;
  font-family:var(--mo); font-size:12px; padding:5px 12px; border:none; background:transparent;
  color:var(--muted); border-radius:6px; cursor:pointer; line-height:1.15}
.trace-lang button b{font-weight:600; font-size:12.5px}
.trace-lang button small{font-size:9.5px; opacity:.85; letter-spacing:.02em}
.trace-lang button.on{background:var(--brass); color:var(--ground)}
.trace-x{flex:none; background:transparent; border:1px solid var(--rule); border-radius:7px; width:32px; height:32px;
  display:flex; align-items:center; justify-content:center; color:var(--muted)}
.trace-x:hover{color:var(--ink); border-color:var(--brass)}
.trace-main{flex:1 1 auto; min-height:0; display:grid; grid-template-columns:1fr 1fr}
/* flow on the reading-start (right in RTL), code on the other side */
.trace-flow{order:1; overflow:auto; padding:22px 20px}
/* the scroller has to live on the <pre>, not on .trace-code: .trace-code inherits the
   document's rtl direction, so its overflow start edge is the right one and long code
   lines were clipped with no way to reach them. Adding direction:ltr here instead would
   flip its border-inline-start off the pane seam. */
.trace-code{order:2; overflow-y:auto; overflow-x:hidden; background:var(--surface); border-inline-start:1px solid var(--rule);
  padding:16px 16px 40px}
.trace-code pre{margin:0; overflow-x:auto}
.trace-code code{font-family:var(--mo); font-size:12.5px; line-height:1.75; color:var(--ink-2);
  white-space:pre; display:block}
.tl{display:block; width:max-content; min-width:100%; padding-inline:9px;
  border-inline-start:3px solid transparent; border-radius:3px;
  transition:background .16s,box-shadow .16s}
/* dark mode: --brass-soft alone was too faint to spot. Layer a stronger brass tint
   with a full-height inline-start bar and an inset glow so the highlighted line is
   unmistakable at a glance. */
.tl.hot{background:color-mix(in srgb,var(--brass) 32%,transparent);
  border-inline-start-color:var(--brass); color:var(--ink);
  box-shadow:inset 0 -1px 0 color-mix(in srgb,var(--brass) 55%,transparent),
             inset 0 1px 0 color-mix(in srgb,var(--brass) 55%,transparent)}
/* flow nodes */
.tfn{position:relative; border:1px solid var(--rule); border-radius:9px; background:var(--surface);
  padding:10px 13px; margin-bottom:24px; opacity:.38; transition:opacity .18s,border-color .18s,box-shadow .18s}
.tfn:not(:last-child)::after{content:""; position:absolute; inset-block-end:-24px; inset-inline-start:24px;
  width:2px; height:24px; background:var(--rule-2)}
.tfn.on{opacity:1}
.tfn.hot{border-color:var(--brass); box-shadow:0 0 0 2px var(--brass-soft),var(--shadow)}
.tfn.no{opacity:.5; border-style:dashed}
.tfn.no .tfn-l{text-decoration:line-through}
.tfn-b{display:flex; align-items:center; gap:10px; justify-content:space-between}
.tfn-l{font-family:var(--mo); font-size:12.5px; color:var(--ink); overflow-wrap:anywhere}
.tfn-r{flex:none; font-family:var(--mo); font-size:11px; color:var(--ok); border-radius:20px; padding:2px 10px;
  background:color-mix(in srgb,var(--ok) 15%,transparent); border:1px solid color-mix(in srgb,var(--ok) 42%,transparent)}
.tfn-r.chip-no{color:var(--bad); background:color-mix(in srgb,var(--bad) 15%,transparent);
  border-color:color-mix(in srgb,var(--bad) 42%,transparent)}
.tfn-s{font-size:12px; color:var(--muted); margin-top:6px; line-height:1.55}
.tfn.k-gate{background:var(--surface-2)}
.tfn.k-gate .tfn-l::before{content:"◇ "; color:var(--brass)}
.tfn.gate-no .tfn-l::before{content:"✕ "; color:var(--bad)}
.tfn.k-nested{margin-inline-start:30px}
.tfn.k-entry .tfn-l{color:var(--brass); font-weight:600}
/* language notice bar, above the main pane */
.trace-note{flex:none; padding:9px 20px; font-size:12.5px; line-height:1.6; color:var(--ink-2);
  border-bottom:1px solid var(--rule)}
.trace-note b{color:var(--ink); font-weight:600}
.trace-note.note-pseudo{background:color-mix(in srgb,var(--warn) 12%,transparent);
  border-bottom-color:color-mix(in srgb,var(--warn) 40%,var(--rule))}
.trace-note.note-real{background:color-mix(in srgb,var(--brass) 10%,transparent);
  border-bottom-color:color-mix(in srgb,var(--brass) 40%,var(--rule))}
/* caption card — larger, structured into lead/why/cpp sub-sections, scrollable */
.trace-cap{flex:none; position:relative; max-height:45vh; max-height:45dvh; overflow-y:auto;
  border-top:1px solid var(--rule);
  background:var(--surface); padding:14px 20px 16px}
.trace-cap-h{margin-bottom:10px}
.trace-cap .trace-k{font-family:var(--mo); font-size:10.5px; letter-spacing:.14em; text-transform:uppercase;
  color:var(--brass); margin-bottom:6px}
.trace-lang-tag{color:var(--muted); text-transform:none; letter-spacing:0}
.trace-cap h4{margin:0; font-size:17px; color:var(--ink); line-height:1.4}
.trace-cap-b{display:flex; flex-direction:column; gap:11px; max-width:80ch; margin-bottom:13px}
.trace-lead p{margin:0 0 8px; color:var(--ink); font-size:14.5px; line-height:1.85}
.trace-lead p:last-child{margin-bottom:0}
.trace-sub{border-inline-start:3px solid color-mix(in srgb,var(--brass) 55%,transparent);
  background:color-mix(in srgb,var(--brass) 6%,transparent); border-radius:0 8px 8px 0;
  padding:10px 14px 11px}
html[dir="rtl"] .trace-sub{border-radius:8px 0 0 8px}
.trace-lbl{display:block; font-family:var(--mo); font-size:10.5px; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brass); margin-bottom:6px}
.trace-sub p{margin:0 0 8px; color:var(--ink-2); font-size:13.5px; line-height:1.85}
.trace-sub p:last-child{margin-bottom:0}
.trace-sub ul{margin:6px 0; padding-inline-start:22px}
.trace-sub li{color:var(--ink-2); font-size:13.5px; line-height:1.8; margin-bottom:4px}
.trace-sub li::marker{color:var(--brass)}
/* the step nav is rendered inside the caption's own scroller, so on a phone it scrolled
   out of sight on every step and the walkthrough looked like it had no way forward. */
.trace-b{display:flex; align-items:center; gap:12px; position:sticky; bottom:-16px;
  background:var(--surface); padding-block:9px; margin-block-end:-16px; z-index:1}
.trace-b .sp{flex:none; width:1px}
.trace-dots{display:flex; gap:5px; margin-inline:auto}
.trace-dots i{width:6px; height:6px; border-radius:50%; background:var(--rule-2)}
.trace-dots i.on{background:var(--brass); transform:scale(1.25)}
@media(max-width:820px){
  .trace-main{grid-template-columns:1fr; grid-template-rows:1fr 1fr}
  .trace-code{border-inline-start:none; border-block-start:1px solid var(--rule)}
  /* raising the caption to 50vh left the code pane about four lines tall. Zero-minimum
     tracks so the two rows can never together exceed .trace-main on a short screen. */
  .trace-cap{max-height:min(38vh,280px); max-height:min(38dvh,280px)}
  .trace-main{grid-template-rows:minmax(0,1fr) minmax(0,1.6fr)}
  .trace-lead p{font-size:13.5px}
  .trace-sub p,.trace-sub li{font-size:13px}
}

.cards{display:grid; gap:16px; grid-template-columns:1fr}
@media(min-width:700px){.cards{grid-template-columns:repeat(3,1fr)}}
.card{color:inherit; border:1px solid var(--rule); border-radius:11px; background:var(--surface); padding:20px 21px 22px;
  display:flex; flex-direction:column; gap:10px; transition:.18s; text-align:start; width:100%}
.card.blk{opacity:.72}
.card.blk:hover{border-color:var(--warn)}
.card:hover{border-color:var(--brass); transform:translateY(-3px); box-shadow:var(--shadow)}
.card .n{font-family:var(--mo); font-size:11px; letter-spacing:.15em; color:var(--brass)}
.card h3{margin:0; font-size:17.5px; font-weight:600; line-height:1.45}
.card p{margin:0; font-size:14px; color:var(--muted); line-height:1.7; flex:1}
.card .f{display:flex; gap:12px; font-size:11.5px; color:var(--muted); font-family:var(--mo);
  padding-top:11px; border-top:1px solid var(--rule-2); align-items:center}

/* ---------- reader ---------- */
.reader{display:none}
body.read .reader{display:block}
body.read .landing{display:none}
.rd-wrap{max-width:1240px; margin:0 auto; padding:0 26px; display:grid; gap:44px;
  grid-template-columns:minmax(0,1fr); align-items:start}
@media(min-width:1080px){.rd-wrap{grid-template-columns:minmax(0,1fr) 262px}}
article{padding:34px 0 90px; min-width:0; max-width:78ch}
/* Reference URLs ship as <a><bdi>https://...</bdi></a> in ordinary prose and are one
   unbreakable token ~440px wide, which pushed the lecture pages 100-200px past a phone.
   `anywhere`, not `break-word`: only `anywhere` also lowers min-content, which is what
   stops the token from widening its ancestors. Scoped to prose on purpose - inheriting
   into .tw td would drop table cells to a one-character min-content and make wide
   tables squeeze and hyphenate instead of scrolling in their own .tw{overflow-x:auto}. */
article p,article li,article a,article blockquote,article dd,article dt{overflow-wrap:anywhere}
.rd-head{border-bottom:1px solid var(--rule); padding-bottom:22px; margin-bottom:30px}
.rd-head .n{font-family:var(--mo); font-size:11.5px; letter-spacing:.18em; color:var(--brass);
  text-transform:uppercase}
.rd-head h1{font-size:clamp(26px,4vw,38px); font-weight:700; line-height:1.35; margin:9px 0 14px;
  text-wrap:balance}
.rd-tools{display:flex; gap:9px; flex-wrap:wrap; margin-top:6px}
/* the rail is the section nav; the drawer button is only the stand-in below it */
@media(min-width:1080px){#tocbtn{display:none}}
article h2{font-size:clamp(21px,2.9vw,27px); font-weight:700; margin:52px 0 16px; line-height:1.4;
  scroll-margin-top:76px; text-wrap:balance}
article h2.sec-h{display:flex; flex-direction:column; gap:7px; padding-top:24px;
  border-top:1px solid var(--rule)}
article h2 .sec-k{font-family:var(--mo); font-size:11px; letter-spacing:.17em; color:var(--brass);
  text-transform:uppercase; font-weight:500}
article h3{font-size:clamp(17px,2.2vw,20px); font-weight:600; margin:34px 0 12px; line-height:1.5;
  scroll-margin-top:76px}
article h4{font-size:16px; font-weight:600; margin:24px 0 9px; scroll-margin-top:76px}
article h3.chk-h{background:var(--brass-soft); border:1px solid color-mix(in srgb,var(--brass) 34%,transparent);
  border-radius:8px; padding:12px 16px; color:var(--brass); font-size:16px; margin-top:38px}
article h3.chk-h + ol,article h3.chk-h + p + ol{background:var(--surface-2); border:1px solid var(--rule);
  border-top:none; border-radius:0 0 8px 8px; margin-top:-6px; padding:16px 40px 18px}
article p{margin:0 0 17px}
article ul,article ol{margin:0 0 18px; padding-inline-start:24px}
article li{margin-bottom:9px}
article li::marker{color:var(--brass)}
article hr{border:none; border-top:1px solid var(--rule-2); margin:34px 0}
/* logical corners: the square pair has to sit on whichever edge carries the brass bar. */
article blockquote{margin:22px 0; padding:14px 18px; border-inline-start:3px solid var(--brass);
  background:var(--surface-2); color:var(--ink-2); font-size:15px;
  border-start-start-radius:0; border-end-start-radius:0;
  border-start-end-radius:7px; border-end-end-radius:7px}
article strong{font-weight:600; color:var(--ink)}
figure.cb{margin:22px 0; background:var(--surface); border:1px solid var(--rule); border-radius:8px;
  position:relative; overflow:hidden; box-shadow:var(--shadow)}
figure.cb .cb-l{position:absolute; top:0; inset-inline-start:0; font-family:var(--mo); font-size:10px;
  letter-spacing:.13em; text-transform:uppercase; color:var(--muted); padding:6px 11px;
  background:var(--surface-2); border-inline-end:1px solid var(--rule);
  border-bottom:1px solid var(--rule); z-index:2}
figure.cb .cb-c{position:absolute; top:5px; inset-inline-end:7px; z-index:2; background:var(--surface-2);
  border:1px solid var(--rule); border-radius:5px; font-size:11px; padding:3px 9px; color:var(--muted);
  opacity:0; transition:.15s}
figure.cb:hover .cb-c,figure.cb .cb-c:focus-visible{opacity:1}
figure.cb .cb-c:hover{color:var(--brass); border-color:var(--brass)}
figure.cb pre{margin:0; padding:34px 18px 16px; overflow-x:auto}
/* A touch screen never fires :hover, so the copy button was permanently invisible
   and unreachable on a phone — the one place students most need to copy. Has to come
   after the rule above: that one sets `padding` as a shorthand, which would reset the
   extra headroom the taller chip needs. */
@media(hover:none),(pointer:coarse){
  figure.cb .cb-c{opacity:1; top:4px; padding:6px 12px; font-size:12px}
  figure.cb pre{padding-top:44px}
}
figure.cb code{background:none; border:none; padding:0; font-size:13px; line-height:1.65;
  color:var(--ink-2); white-space:pre; display:block}

/* server-side syntax highlighting — palette built from the brand tokens so light
   and dark themes both work without a second block. Tuned for legibility on the
   surface background; class names come from highlight.py (k/n/c/s/f/t/p/o/v). */
.tok-c{color:var(--muted); font-style:italic}
.tok-k{color:var(--brass); font-weight:600}
.tok-s{color:color-mix(in srgb,var(--ok) 92%,var(--ink))}
.tok-n{color:var(--warn)}
.tok-f{color:var(--steel)}
.tok-t{color:color-mix(in srgb,var(--steel) 85%,var(--ink)); font-weight:500}
.tok-p{color:color-mix(in srgb,var(--brass-2) 80%,var(--muted)); font-weight:500}
.tok-o{color:color-mix(in srgb,var(--brass) 70%,var(--muted))}
.tok-v{color:color-mix(in srgb,var(--warn) 85%,var(--ink))}
/* the walkthrough code pane inherits the same rules (its .tl wrappers do not
   isolate direction), so highlighting works there too. Keep hot-line contrast
   readable by darkening any token colour that lands on the brass tint. */
.tl.hot .tok-c,.tl.hot .tok-p,.tl.hot .tok-v,.tl.hot .tok-o{color:var(--ink)}
.tw{margin:22px 0; overflow-x:auto; border:1px solid var(--rule); border-radius:8px; background:var(--surface)}
.tw table{border-collapse:collapse; width:100%; font-size:14px}
.tw th{background:var(--surface-2); text-align:start; padding:11px 14px; font-weight:600;
  font-size:12.5px; color:var(--muted); border-bottom:1px solid var(--rule); white-space:nowrap}
.tw td{padding:11px 14px; border-bottom:1px solid var(--rule-2); vertical-align:top; color:var(--ink-2)}
/* 29 of 41 lecture tables were 2.3x the phone width; the cells could not break their
   longest token. They still scroll in .tw when genuinely wide, but no longer by default. */
.tw td,.tw th{overflow-wrap:anywhere}
.tw tr:last-child td{border-bottom:none}

/* TOC rail */
.toc{display:none}
@media(min-width:1080px){
  .toc{display:block; position:sticky; top:76px; max-height:calc(100vh - 96px); overflow-y:auto;
    padding:34px 0 40px; scrollbar-width:thin}
}
.toc-t{font-family:var(--mo); font-size:10.5px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--muted); padding-bottom:10px; border-bottom:1px solid var(--rule); margin-bottom:10px}
.toc a{display:block; font-size:13px; line-height:1.5; padding:5px 0 5px 0; color:var(--muted);
  border-inline-start:2px solid transparent; padding-inline-start:12px; margin-inline-start:-2px;
  border-radius:0 5px 5px 0; overflow-wrap:anywhere}
html[dir="rtl"] .toc a{border-radius:5px 0 0 5px}
.toc a.l2{font-size:12.2px; padding-inline-start:24px; color:color-mix(in srgb,var(--muted) 82%,transparent)}
.toc a.l3{font-size:11.8px; padding-inline-start:36px; line-height:1.45;
  color:color-mix(in srgb,var(--muted) 68%,transparent)}
.toc a.chk{color:color-mix(in srgb,var(--brass) 62%,var(--muted))}
.toc a:hover{color:var(--ink); background:var(--surface-2); text-decoration:none}
.toc a.on,.toc a.chk.on{color:var(--brass); border-inline-start-color:var(--brass);
  background:var(--brass-soft); font-weight:500}

/* collapsible section groups, shared by the rail (.toc) and the drawer (.sb-sec).
   The anchors inside keep their own .toc / .sb-sec styling; this only adds the
   header row, the caret, and the fold. */
.tg-h{display:flex; align-items:flex-start; gap:1px}
.tg-h .tg-t{flex:1 1 auto; min-width:0; padding-inline-start:5px; font-weight:500}
.tg-x{flex:none; width:22px; height:26px; display:flex; align-items:center; justify-content:center;
  /* see the coarse-pointer block at the end of the sheet for the phone-sized variant */
  background:transparent; border:none; padding:0; color:var(--muted); border-radius:5px; cursor:pointer}
.tg-x svg{width:11px; height:11px; fill:none; stroke:currentColor; stroke-width:2.3;
  stroke-linecap:round; stroke-linejoin:round; transition:transform .18s ease}
.tg-x:hover{color:var(--ink); background:var(--surface-2)}
.tg.clp .tg-x svg{transform:rotate(-90deg)}   /* RTL: points toward the label when folded */
.tg-x0{cursor:default}
.tg-c{overflow:hidden}
.tg.clp .tg-c{display:none}
.tg.sec > .tg-h .tg-t{color:var(--ink)}
.tg.sec > .tg-h .tg-x{color:var(--brass)}
/* in the drawer the section header should not carry the deep child indent */
.sb-sec .tg-h .tg-t{padding-block:5px}

/* ---------- recorded sessions rail ----------
   Sits between the lecture head and the first section: a student who lands here
   from the channel sees at once which sessions teach this document, and a student
   who came to read is past it in one scroll. Collapsed rows carry no iframe, so a
   six-session lecture costs nothing until a row is opened. */
.ses{margin:0 0 42px; border:1px solid var(--rule); border-radius:10px;
  background:var(--surface); overflow:hidden}
.ses-h{display:flex; align-items:center; gap:9px; font-size:15px; font-weight:600;
  margin:0; padding:14px 18px 0; color:var(--ink)}
.ses-h .ico{width:18px; height:18px; stroke:var(--brass); fill:none; stroke-width:1.6}
.ses-sub{margin:7px 18px 12px; font-size:13px; line-height:1.7; color:var(--muted)}
.ses-l{list-style:none; margin:0; padding:0; border-top:1px solid var(--rule-2)}
.ses-r{border-bottom:1px solid var(--rule-2)}
.ses-r:last-child{border-bottom:none}
.ses-b{display:grid; grid-template-columns:auto minmax(0,1fr) auto auto; gap:13px;
  align-items:center; width:100%; text-align:start; background:none; border:none;
  color:inherit; font:inherit; padding:13px 18px; cursor:pointer}
.ses-b:hover{background:var(--surface-2)}
.ses-n{font-family:var(--mo); font-size:12px; font-weight:600; color:var(--brass);
  min-width:2.4em; text-align:center; padding:4px 6px; border-radius:5px;
  background:var(--brass-soft); border:1px solid color-mix(in srgb,var(--brass) 26%,transparent)}
.ses-t{min-width:0; display:flex; flex-direction:column; gap:3px}
.ses-t b{font-size:14.5px; font-weight:600; line-height:1.5}
.ses-c{font-size:12.5px; line-height:1.65; color:var(--ink-2)}
.ses-m{display:flex; flex-direction:column; align-items:flex-end; gap:3px;
  font-family:var(--mo); font-size:10.5px; color:var(--muted); white-space:nowrap}
.ses-role{letter-spacing:.06em}
.ses-main .ses-role{color:var(--brass)}
.ses-secs{font-family:var(--ar); font-size:11.5px}
.ses-p{width:22px; height:22px; stroke:var(--muted); fill:none; stroke-width:1.5;
  flex:none; transition:stroke .15s}
.ses-b:hover .ses-p{stroke:var(--brass)}
.ses-r.on .ses-p{stroke:var(--brass); transform:rotate(90deg)}
/* the iframe box only exists once a row is open, so nothing reserves 16:9 up front */
.ses-f{display:none}
.ses-r.on .ses-f{display:block; padding:0 18px 14px}
.ses-f iframe{width:100%; aspect-ratio:16/9; border:0; border-radius:8px;
  background:#000; display:block}
.ses-y{display:none; padding:0 18px 14px; font-size:12.5px; color:var(--steel)}
.ses-r.on .ses-y{display:block}
.ses-all{display:block; padding:12px 18px; font-size:12.5px; color:var(--muted);
  border-top:1px solid var(--rule-2); text-decoration:none}
.ses-all:hover{color:var(--brass)}
@media(max-width:620px){
  .ses-b{grid-template-columns:auto minmax(0,1fr) auto; gap:10px; padding:12px 14px}
  .ses-m{display:none}
  .ses-h,.ses-sub{padding-inline:14px; margin-inline:0}
  .ses-sub{margin:7px 14px 12px}
  .ses-r.on .ses-f,.ses-y{padding-inline:14px}
}

/* ---------- /sessions: the channel mirrored ---------- */
.sespage .wrap{max-width:900px; padding-top:26px; padding-bottom:70px}
.sespage .crumb{margin-top:26px}
.sespage h1{font-size:clamp(25px,4vw,34px); font-weight:700; margin:20px 0 10px}
.sx-sub{color:var(--muted); font-size:14px; line-height:1.8; margin:0 0 28px; max-width:70ch}
.sx-l-wrap{list-style:none; margin:0; padding:0; display:grid; gap:12px}
.sx-r{border:1px solid var(--rule); border-radius:10px; background:var(--surface); padding:14px 16px}
.sx-h{display:flex; align-items:center; gap:12px}
.sx-t{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px}
.sx-t b{font-size:15px; font-weight:600; line-height:1.5}
.sx-t span{font-family:var(--mo); font-size:11px; color:var(--muted)}
.sx-ls{display:flex; flex-wrap:wrap; gap:8px; margin-top:12px; padding-top:12px;
  border-top:1px solid var(--rule-2)}
.sx-l{display:inline-flex; align-items:center; gap:8px; padding:6px 11px; border-radius:7px;
  background:var(--surface-2); border:1px solid var(--rule); font-size:12.5px; color:var(--ink-2);
  text-decoration:none; transition:border-color .15s}
.sx-l:hover{border-color:var(--brass)}
.sx-l b{color:var(--brass); font-weight:600}
.sx-role{font-family:var(--mo); font-size:10px; color:var(--muted)}
.sx-none{margin-top:12px; padding-top:12px; border-top:1px solid var(--rule-2);
  font-size:12.5px; color:var(--muted)}
.sx-ch{margin-top:26px}
@media(max-width:620px){
  .sx-h{flex-wrap:wrap}
  .sx-h .btn{width:100%; justify-content:center}
}

/* ---------- per-section session marker ----------
   Sits directly under a «القسم N» heading. Quiet by default: it must not compete with
   the heading or interrupt the read, but it has to be obvious to someone who is stuck
   and looking for a way out of the paragraph. */
.secv{display:flex; flex-wrap:wrap; gap:7px; margin:-6px 0 18px; align-items:center}
.secv-b{display:inline-flex; align-items:center; gap:6px; padding:4px 10px 4px 7px;
  border:1px solid var(--rule); border-radius:999px; background:var(--surface-2);
  color:var(--muted); font:inherit; font-size:12px; cursor:pointer;
  transition:color .15s,border-color .15s}
.secv-b .ico{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:1.6; flex:none}
.secv-b:hover{color:var(--brass); border-color:color-mix(in srgb,var(--brass) 45%,transparent)}
.secv-b.on{color:var(--brass); border-color:var(--brass); background:var(--brass-soft)}
.secv-main{color:var(--ink-2)}
.secv-t{font-family:var(--mo); font-size:10.5px; opacity:.85}
.secv-f:empty{display:none}
.secv-f{flex:1 0 100%; margin-top:4px}
.secv-f iframe{width:100%; max-width:640px; aspect-ratio:16/9; border:0; border-radius:8px;
  background:#000; display:block}

/* ---------- sidebar drawer ----------
   State classes on <body> live in the same class namespace as every element in
   the page, so they never reuse an element's class name. `body.sb` would have
   made <body> itself match `.sb` below and turn the whole document into a
   fixed 330px panel translated off-screen. Hence `nav-open` / `search-open`. */
.sb-fab{position:fixed; inset-block-end:22px; inset-inline-start:22px; z-index:70;
  width:48px; height:48px; border-radius:50%; background:var(--brass); color:var(--ground);
  border:none; display:flex; align-items:center; justify-content:center;
  box-shadow:0 6px 22px -6px rgba(0,0,0,.6); transition:.18s}
.sb-fab:hover{transform:scale(1.07)}
.sb-fab .ico{width:20px; height:20px; stroke-width:2}
.sb-scrim{position:fixed; inset:0; background:rgba(4,6,9,.62); z-index:80; opacity:0;
  pointer-events:none; transition:opacity .2s}
body.nav-open .sb-scrim{opacity:1; pointer-events:auto}
.sb{position:fixed; inset-block:0; inset-inline-start:0; width:min(330px,86vw); z-index:90;
  background:var(--surface); border-inline-end:1px solid var(--rule); display:flex;
  flex-direction:column; transform:translateX(105%); transition:transform .24s cubic-bezier(.4,0,.2,1)}
body.nav-open .sb{transform:translateX(0)}
.sb-h{padding:16px 18px; border-bottom:1px solid var(--rule); display:flex; align-items:center; gap:11px}
.sb-h b{font-family:var(--dp); font-size:16px; direction:ltr}
.sb-x{margin-inline-start:auto; background:transparent; border:1px solid var(--rule);
  border-radius:6px; width:30px; height:30px; display:flex; align-items:center;
  justify-content:center; color:var(--muted)}
.sb-x:hover{color:var(--ink); border-color:var(--brass)}
.sb-b{flex:1; overflow-y:auto; padding:14px 0 30px}
.sb-g{padding:0 16px; margin-bottom:6px}
.sb-k{font-family:var(--mo); font-size:10px; letter-spacing:.16em; text-transform:uppercase;
  color:var(--muted); padding:14px 4px 7px}
.sb-i{display:flex; align-items:center; gap:10px; width:100%; background:transparent; border:none;
  border-radius:6px; padding:8px 10px; font-size:14px; color:var(--ink-2); text-align:start;
  border-inline-start:2px solid transparent}
.sb-i:hover{background:var(--surface-2); color:var(--ink)}
.sb-i.on{color:var(--brass); background:var(--brass-soft); border-inline-start-color:var(--brass)}
.sb-i i{width:8px; height:8px; border-radius:2px; flex:none; font-style:normal}
.sb-i small{margin-inline-start:auto; font-family:var(--mo); font-size:10px; color:var(--muted)}
.sb-sec{padding:2px 0 0}
.sb-sec a{display:block; font-size:12.5px; padding:5px 10px 5px 26px; color:var(--muted);
  border-radius:5px; line-height:1.45; overflow-wrap:anywhere}
html[dir="rtl"] .sb-sec a{padding:5px 26px 5px 10px}
.sb-sec a.l2{font-size:11.8px; color:color-mix(in srgb,var(--muted) 82%,transparent)}
html[dir="rtl"] .sb-sec a.l2{padding-inline-start:38px}
.sb-sec a.l3{font-size:11.4px; color:color-mix(in srgb,var(--muted) 68%,transparent)}
html[dir="rtl"] .sb-sec a.l3{padding-inline-start:50px}
.sb-sec a.chk{color:color-mix(in srgb,var(--brass) 62%,var(--muted))}
.sb-sec a:hover{color:var(--ink); background:var(--surface-2); text-decoration:none}
.sb-sec a.on,.sb-sec a.chk.on{color:var(--brass); background:var(--brass-soft)}

/* ---------- search palette ---------- */
.pal-scrim{position:fixed; inset:0; background:rgba(4,6,9,.66); z-index:100; display:none;
  padding:9vh 18px 18px; padding:9dvh 18px 18px}
body.search-open .pal-scrim{display:block}
.pal{max-width:610px; margin:0 auto; background:var(--surface); border:1px solid var(--rule);
  border-radius:12px; box-shadow:0 24px 70px -20px rgba(0,0,0,.75); overflow:hidden}
.pal-in{display:flex; align-items:center; gap:11px; padding:14px 17px; border-bottom:1px solid var(--rule)}
.pal-in input{flex:1; min-width:0; background:transparent; border:none; outline:none; font-family:var(--ar);
  font-size:16px; color:var(--ink)}
.pal-in input::placeholder{color:var(--muted)}
.pal-r{max-height:52vh; max-height:52dvh; overflow-y:auto; padding:7px}
.pal-r button{display:block; width:100%; text-align:start; background:transparent; border:none;
  border-radius:7px; padding:10px 13px; color:var(--ink-2)}
.pal-r button:hover,.pal-r button.on{background:var(--surface-2); color:var(--ink)}
.pal-r .t{font-size:14.5px; font-weight:500; margin-bottom:3px}
.pal-r .c{font-size:12.5px; color:var(--muted); line-height:1.55; display:-webkit-box;
  -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden}
.pal-r mark{background:color-mix(in srgb,var(--brass) 30%,transparent); color:var(--ink);
  border-radius:2px; padding:0 1px}
.pal-e{padding:26px; text-align:center; color:var(--muted); font-size:14px}
.pal-f{padding:9px 15px; border-top:1px solid var(--rule); font-size:11.5px; color:var(--muted);
  display:flex; gap:15px; font-family:var(--mo)}

/* ---------- footer / toast ---------- */
footer{border-top:1px solid var(--rule); background:var(--surface); margin-top:60px}
footer .wrap{padding:34px 26px 46px; display:flex; gap:26px; flex-wrap:wrap; align-items:flex-start}
footer .fb{flex:1; min-width:220px}
footer p{color:var(--muted); font-size:13.5px; margin:9px 0 0; max-width:52ch; line-height:1.75}
/* the site index: every page reachable from every page, and crawlable without
   running a line of script */
.fnav{border-top:1px solid var(--rule-2)}
.fnav .wrap{padding:26px 26px 40px; display:grid; gap:22px 30px;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr))}
.fnav-c a{display:block; font-size:13px; color:var(--ink-2); padding:4px 0; line-height:1.5}
.fnav-c a:hover{color:var(--brass)}
.fnav .dk{margin-bottom:6px}
.toast{position:fixed; inset-block-end:22px; inset-inline-end:22px; z-index:120;
  max-width:min(420px,calc(100vw - 44px));
  background:var(--surface-3); border:1px solid var(--brass); color:var(--ink);
  border-radius:8px; padding:11px 17px; font-size:14px; box-shadow:var(--shadow);
  opacity:0; transform:translateY(10px); pointer-events:none; transition:.22s}
.toast.on{opacity:1; transform:none}

/* ---------- emblems ---------- */
.emb{--emb-cut:var(--surface-2); flex:none; display:block}
.emb.lg,.emb.xl{--emb-cut:var(--surface)}
.node.on .emb{--emb-cut:var(--surface-3)}

/* ---------- selection feedback ---------- */
@keyframes detail-in{from{opacity:0; transform:translateY(10px) scale(.985)}to{opacity:1; transform:none}}
@keyframes detail-ring{
  0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--dc) 55%,transparent),var(--shadow)}
  100%{box-shadow:0 0 0 14px color-mix(in srgb,var(--dc) 0%,transparent),var(--shadow)}
}
@keyframes row-in{from{opacity:0; transform:translateX(10px)}to{opacity:1; transform:none}}
@keyframes node-pop{0%{transform:none}45%{transform:translateY(-5px) scale(1.03)}100%{transform:translateY(-2px)}}
.detail.pulse{animation:detail-in .28s cubic-bezier(.2,.8,.3,1),detail-ring .7s ease-out .05s}
.detail.pulse .mods li{animation:row-in .34s backwards cubic-bezier(.2,.8,.3,1)}
.detail.pulse .mods li:nth-child(1){animation-delay:.04s}
.detail.pulse .mods li:nth-child(2){animation-delay:.07s}
.detail.pulse .mods li:nth-child(3){animation-delay:.10s}
.detail.pulse .mods li:nth-child(4){animation-delay:.13s}
.detail.pulse .mods li:nth-child(5){animation-delay:.16s}
.detail.pulse .mods li:nth-child(6){animation-delay:.19s}
.detail.pulse .mods li:nth-child(7){animation-delay:.22s}
.node.on{animation:node-pop .3s cubic-bezier(.2,.8,.3,1)}

/* ---------- detail panel additions ---------- */
.detail-h{align-items:center}
.detail-ht{flex:1; min-width:200px}
.detail-ht h3{margin:0 0 3px; font-size:22px; font-weight:700; line-height:1.35}
.detail .sub{font-size:13.5px; color:var(--muted); margin:0}
.ccode{font-family:var(--mo); font-size:10.5px; letter-spacing:.12em; color:var(--dc);
  border:1px solid var(--dc); background:color-mix(in srgb,var(--dc) 12%,transparent);
  padding:4px 9px; border-radius:4px; align-self:flex-start; white-space:nowrap}
.mods li.more{color:var(--muted); font-style:italic}
.detail .openc{margin-top:22px}
.btn.openc .ico{transition:transform .16s}
.btn.openc:hover .ico{transform:translateX(-3px)}

/* ---------- course page ---------- */
.coursepage{display:none}
body.course .coursepage{display:block}
body.course .landing,body.course .reader{display:none}
.crumb{display:inline-flex; align-items:center; gap:7px; font-size:13.5px; color:var(--muted);
  margin:30px 0 4px; padding:6px 0}
.crumb:hover{color:var(--brass); text-decoration:none}
/* The hero is a banner now: the course's weapon sits in an Argead sun on the
   trailing (left) edge, and the title rides the scrimmed right. --wp-ground is
   the colour the scrim fades the title side to, so it tracks the theme. */
.c-hero{position:relative; overflow:hidden; isolation:isolate; min-height:232px;
  display:flex; flex-direction:column; justify-content:center; gap:0;
  padding:30px 34px; margin:14px 0 36px; border-radius:18px;
  border:1px solid var(--rule); box-shadow:var(--shadow);
  background:var(--surface); --wp-ground:var(--surface)}
.c-wp{position:absolute; inset:0; width:100%; height:100%; z-index:0;
  color:var(--dc); pointer-events:none}
.c-wp .wp-ghost{--emb-cut:var(--wp-ground)}
.c-htext{position:relative; z-index:1; min-width:0}
/* pre-enrolment banner on a course that is open for early booking */
.c-enroll{display:flex; flex-wrap:wrap; align-items:center; gap:14px 22px; justify-content:space-between;
  margin:0 0 30px; padding:18px 22px; border-radius:14px;
  border:1px solid color-mix(in srgb,var(--dc) 40%,var(--rule));
  background:color-mix(in srgb,var(--dc) 9%,var(--surface))}
.c-enroll-tx{min-width:0; flex:1 1 300px}
.c-enroll-badge{display:inline-block; font-family:var(--mo); font-size:10.5px; letter-spacing:.1em;
  color:var(--dc); border:1px solid var(--dc); border-radius:4px; padding:3px 8px; margin-bottom:9px;
  background:color-mix(in srgb,var(--dc) 12%,transparent)}
.c-enroll-badges{display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-bottom:9px}
.c-enroll-badges .c-enroll-badge{margin-bottom:0}
/* the Winter Arc pill: the same deeper Blue Team shade as /enroll's, white text at 4.5:1+ */
.promo-pill{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; font-weight:700;
  line-height:1.4; padding:3px 11px; border-radius:20px; color:#fff; background:#2F6EA8}
.promo-pill .snow{width:15px; height:15px; stroke-width:2}
.c-enroll-tx strong{display:block; font-size:17px; color:var(--ink); margin-bottom:5px}
.c-enroll-tx p{margin:0; font-size:14px; color:var(--ink-2); line-height:1.75}
.c-enroll-tx .c-enroll-now{color:var(--ink); font-size:15.5px}
.c-enroll-cta{flex:none}
@media(max-width:560px){
  .c-hero{min-height:264px; padding:24px 20px; justify-content:flex-end}
  /* on a narrow hero the sun drops behind the whole block, so lean the scrim
     darker to keep the title readable over it */
  .c-wp{opacity:.9}
}
.c-kick{display:flex; gap:9px; align-items:center; flex-wrap:wrap; margin-bottom:12px}
.ctrack{font-family:var(--mo); font-size:10.5px; letter-spacing:.12em; color:var(--muted);
  border:1px solid var(--rule); padding:4px 9px; border-radius:4px}
.c-htext h1{font-size:clamp(27px,4vw,40px); font-weight:700; line-height:1.3; margin:0 0 8px;
  text-wrap:balance}
.c-en{color:var(--muted); font-size:15px; margin-bottom:16px}
.c-facts{display:flex; gap:20px; flex-wrap:wrap; font-size:13.5px; color:var(--ink-2)}
.c-facts span{display:inline-flex; align-items:center; gap:7px}
.c-facts span::before{content:""; width:5px; height:5px; border-radius:50%; background:var(--dc)}
.c-emb-name{color:var(--muted); font-style:italic}
/* same min-content trap as .vault-get: the single column was sized by .c-mods,
   which overflowed the course pages by 70px at 320px. */
.c-body{display:grid; gap:44px; grid-template-columns:minmax(0,1fr); padding-bottom:90px}
.c-body>*{min-width:0}
@media(min-width:960px){.c-body{grid-template-columns:minmax(0,1fr) 290px}}
.c-long p{font-size:17px; line-height:1.85; color:var(--ink-2); margin:0 0 18px; max-width:66ch}
.c-h2{font-size:clamp(19px,2.6vw,23px); font-weight:700; margin:40px 0 16px;
  padding-top:22px; border-top:1px solid var(--rule)}
.c-out{list-style:none; margin:0; padding:0; display:grid; gap:10px}
.c-out li{position:relative; padding-inline-start:30px; font-size:15.5px; color:var(--ink-2); line-height:1.7}
.c-out li::before{content:""; position:absolute; inset-inline-start:0; top:.5em; width:15px; height:8px;
  border-inline-start:2px solid var(--dc); border-bottom:2px solid var(--dc);
  transform:rotate(-45deg)}
.c-mods{margin:0; padding:0; list-style:none; counter-reset:m; display:grid; gap:1px;
  background:var(--rule-2); border:1px solid var(--rule-2); border-radius:9px; overflow:hidden}
.c-mods li{counter-increment:m; min-width:0; background:var(--surface); padding:13px 16px; font-size:15px;
  color:var(--ink-2); display:flex; gap:13px; align-items:baseline}
.c-mods li::before{content:counter(m); font-family:var(--mo); font-size:11px;
  color:var(--dc); min-width:18px; font-variant-numeric:tabular-nums}
.c-mods li:hover{background:var(--surface-2); color:var(--ink)}
.lec-list{display:grid; gap:10px}
.lec-row{color:inherit; display:flex; gap:15px; align-items:center; width:100%; text-align:start;
  background:var(--surface); border:1px solid var(--rule); border-radius:10px;
  padding:15px 17px; transition:.16s}
.lec-row:hover{border-color:var(--brass); transform:translateX(-3px)}
.lec-row.blk{opacity:.62}
.lec-row.blk:hover{border-color:var(--warn); transform:none}
.lec-n{font-family:var(--mo); font-size:13px; color:var(--brass); min-width:26px}
.lec-b{flex:1; min-width:0}
.lec-b b{display:block; font-size:15.5px; font-weight:600; margin-bottom:3px}
.lec-b span{display:block; font-size:13px; color:var(--muted); line-height:1.6}
.lec-m{font-family:var(--mo); font-size:11px; color:var(--muted); white-space:nowrap}
/* the meta line cannot shrink, so on a 320-360px screen it alone widened the row past
   the viewport; the rows are only a nowrap flex line up to the 960px breakpoint. */
@media(max-width:640px){.lec-m{white-space:normal}}
.lec-x{font-family:var(--mo); font-size:10px; color:var(--warn); border:1px solid var(--warn);
  padding:2px 7px; border-radius:3px; white-space:nowrap}
.c-side .dk{margin-top:26px}
.c-side .dk:first-child{margin-top:0}
@media(min-width:960px){.c-side{position:sticky; top:78px}}

/* ---------- accordion additions ---------- */
.acc-b{gap:13px}
.acc-b .emb{color:var(--tc); --emb-cut:var(--surface)}
.acc-tx{flex:1; min-width:0}
.acc-tx .code{display:block; font-family:var(--mo); font-size:10px; color:var(--tc); letter-spacing:.12em}
.acc-tx .nm{display:block; font-weight:600; font-size:15px}
.acc-b .chev{transition:transform .2s; color:var(--muted)}
.acc-i.open .acc-b .chev{transform:rotate(180deg)}
.acc-p p{color:var(--ink-2); font-size:14.5px; margin:0 0 12px}
.acc-p .openc{margin-top:14px; width:100%; justify-content:center}

/* ---------- misc ---------- */
.warn-note{color:var(--warn)}
.card .lec-x{margin-inline-start:auto}
.rd-tools .btn{height:38px; font-size:14px}
article .crumb{margin:0 0 18px}

@media(prefers-reduced-motion:reduce){*{transition:none!important; animation:none!important;
  scroll-behavior:auto!important}}
/* `footer .wrap` and `.fnav .wrap` are more specific than `.wrap`, and a media query
   adds no specificity - so both kept their desktop 26px gutter and sat 9px out of line
   with every other section. Naming them here is what actually wins the cascade. */
@media(max-width:640px){
  .wrap,.topin,.rd-wrap,footer .wrap,.fnav .wrap{padding-inline:17px}
  body{font-size:16px}
  .sb-fab{inset-block-end:16px; inset-inline-start:16px}
  /* 74px of lead-in costs a phone a fifth of its screen before the headline */
  .hero{padding-top:44px}
  /* nowrap headers alone forced most lecture tables into a 2.3x-wide scroll */
  .tw th{white-space:normal}
  .tw th,.tw td{padding:9px 10px}
  .tw table{font-size:13px}
  /* 80px of a 339px row went on padding, leaving Arabic ~25 characters wide */
  article h3.chk-h + ol,article h3.chk-h + p + ol{padding:14px 22px 16px}
  /* clear the drawer FAB, which sits in the same corner */
  .toast{inset-block-end:76px}
}

/* ---------- thumb-sized hit areas ----------
   Everything below was between 22px and 37px tall, under the ~44px a fingertip
   needs. Scoped to coarse pointers so the tighter mouse-sized chrome is kept on
   desktop. Padding, not height, so nothing re-flows or clips its own label. */
@media(pointer:coarse){
  .tbtn{height:40px}
  .sb-x{width:38px; height:38px}
  .sb-i{padding-block:11px}
  .sb-sec a{padding-block:9px}
  .vault-info{padding-block:11px}
  .vault-m .mini{padding-block:7px}
  .chip{padding-block:7px}
  .pre-c{padding-block:12px}
  .toc a{padding-block:8px}
  /* the unfold caret sits 1px from a full-width nav link; .sb-sec scopes it to the
     drawer so the desktop .toc rail keeps its compact caret. */
  .sb-sec .tg-h{gap:6px}
  .sb-sec .tg-x{width:40px; height:40px}
  .sb-sec .tg-h .tg-t{padding-block:9px}
}
