/* =====================================================================
   Theory: topic list on the left, the topic card in the middle, and the
   topic's mechanism from Nodes on the right.
   ===================================================================== */
#view-theory{
  --th-rail:292px; --th-side:348px;
  display:grid; grid-template-columns:var(--th-rail) minmax(0,1fr) var(--th-side);
  overflow:hidden; overflow:clip;   /* the drawers wait off screen without widening the page */
}
#view-theory.home{grid-template-columns:var(--th-rail) minmax(0,1fr)}
#view-theory.home .th-side{display:none}

/* ---------------- rail ---------------- */
.th-rail{display:flex; flex-direction:column; min-height:0; background:var(--surface); border-right:1px solid var(--line)}
.th-rail-head{padding:16px 14px 12px; display:flex; flex-direction:column; gap:10px; border-bottom:1px solid var(--line-2)}
.th-search{position:relative}
.th-search svg{position:absolute; left:11px; top:10px; width:16px; height:16px; fill:none; stroke:var(--muted); stroke-width:1.9; stroke-linecap:round; pointer-events:none}
.th-search .search{padding-left:34px}
.th-toggles{display:flex; gap:6px; flex-wrap:wrap}
.th-progress{display:flex; align-items:center; gap:10px; font-family:var(--font-mono); font-size:11px; color:var(--muted)}
.th-progress .bar{flex:1; height:5px; border-radius:5px; background:var(--sunken); overflow:hidden}
.th-progress .bar i{display:block; height:100%; border-radius:5px; background:var(--accent); transition:width .4s ease}
.th-progress b{color:var(--ink); font-weight:600}

.th-toc{flex:1; overflow-y:auto; min-height:0; padding:0 8px 28px}
.toc-b{margin-top:2px}
.toc-bh{
  position:sticky; top:0; z-index:1; display:grid; grid-template-columns:26px minmax(0,1fr) auto; gap:6px; align-items:baseline;
  padding:12px 8px 6px; margin:0 -8px; padding-left:16px; padding-right:16px;
  background:var(--surface); box-shadow:0 6px 8px -8px color-mix(in srgb,var(--ink) 25%,transparent);
  text-decoration:none; color:var(--muted);
}
.toc-bh .bn{font-family:var(--font-display); font-weight:750; font-size:12px; color:var(--accent); line-height:1; font-variant-numeric:tabular-nums}
.toc-bh .bt{font-family:var(--font-mono); font-size:10px; letter-spacing:.11em; text-transform:uppercase; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.toc-bh .bc{font-family:var(--font-mono); font-size:10px; color:var(--faint)}
.toc-bh:hover .bt{color:var(--ink)}
.toc-p{padding:9px 8px 3px; font-size:11px; font-weight:600; color:var(--muted); line-height:1.3}
.toc-bh + .toc-p{padding-top:4px}
.toc-i{
  display:grid; grid-template-columns:26px minmax(0,1fr) 15px; gap:6px; align-items:center;
  padding:5px 8px; border-radius:8px; color:var(--ink-2); text-decoration:none; font-size:13px; line-height:1.3;
}
.toc-i:hover{background:var(--surface-2); color:var(--ink)}
.toc-i .n{font-family:var(--font-mono); font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums}
.toc-i.on{background:var(--accent-soft); color:var(--ink); font-weight:600}
.toc-i.on .n{color:var(--accent)}
.toc-i .tick{width:13px; height:13px; border-radius:50%; border:1.5px solid var(--line); position:relative}
.toc-i.read .tick{border-color:var(--accent); background:var(--accent)}
.toc-i.read .tick::after{content:""; position:absolute; left:3.5px; top:1.3px; width:3px; height:6px; border:solid var(--on-accent); border-width:0 1.6px 1.6px 0; transform:rotate(45deg)}
.toc-i .hits{font-family:var(--font-mono); font-size:9.5px; color:var(--accent); margin-left:4px; font-weight:500}
.toc-none{color:var(--muted); font-size:13px; padding:18px 10px}

/* ---------------- main column ---------------- */
.th-main{overflow-y:auto; overflow-x:hidden; min-height:0; outline:none; position:relative}
.th-mbar{display:none}
.th-scrim{display:none}

/* ---------------- topic ---------------- */
.th-topic{max-width:840px; margin:0 auto; padding:34px 48px 90px}
.th-crumbs{display:flex; gap:8px; flex-wrap:wrap; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted)}
.th-crumbs a{color:inherit; text-decoration:none}
.th-crumbs a:hover{color:var(--accent)}
.th-crumbs span{color:var(--faint)}
.th-titlerow{display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 20px; align-items:start; margin:18px 0 0}
.th-num{
  font-family:var(--font-display); font-weight:200; font-size:76px; line-height:.8; color:var(--accent);
  letter-spacing:-.05em; padding-top:2px; min-width:.9em; font-variant-numeric:lining-nums tabular-nums;
}
.th-topic h1{
  font-family:var(--font-display); font-weight:750; font-size:clamp(27px,2.7vw,36px); line-height:1.12;
  letter-spacing:-.03em; margin:0; text-wrap:balance;
}
.th-meta{font-family:var(--font-mono); font-size:11.5px; color:var(--muted); margin:10px 0 0}
.th-actions{display:flex; gap:8px; flex-wrap:wrap; margin:22px 0 0}
.th-actions .primary{background:var(--nodes); border-color:var(--nodes)}
.th-actions [data-read][aria-pressed="true"]{border-color:var(--accent-line); color:var(--accent); background:var(--accent-soft)}
.only-drawer{display:none!important}

/* the plan: numbered sections, stacked, joined by a thin line */
.th-plan{
  margin:28px 0 6px; background:var(--surface); border:1px solid var(--line); border-radius:16px;
  box-shadow:var(--shadow-sm); scroll-margin-top:18px; overflow:hidden;
}
.plan-h{display:flex; justify-content:space-between; align-items:center; padding:13px 18px 11px; border-bottom:1px solid var(--line-2); background:var(--surface-2)}
.plan-t{font-size:11px; font-weight:700; letter-spacing:.14em; text-transform:uppercase; color:var(--accent)}
.plan-c{font-size:12px; color:var(--muted); font-variant-numeric:tabular-nums}
.th-plan ol{list-style:none; margin:0; padding:8px; position:relative}
.th-plan ol::before{   /* the spine through the numbers */
  content:""; position:absolute; left:29px; top:22px; bottom:22px; width:2px; border-radius:2px; background:var(--line-2);
}
.th-plan li{margin:0; padding:0}
.plan-i{
  position:relative; display:grid; grid-template-columns:28px minmax(0,1fr) auto; gap:14px; align-items:center;
  width:100%; padding:8px 12px 8px 8px; border:0; border-radius:10px; background:transparent; cursor:pointer;
  text-align:left; font:inherit; font-size:14.5px; line-height:1.35; color:var(--ink); transition:background .15s;
}
.plan-i:hover{background:color-mix(in srgb,var(--c) 7%,transparent)}
.plan-i .pn{
  width:28px; height:28px; border-radius:9px; display:grid; place-items:center; position:relative; z-index:1;
  font-size:12.5px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--c);
  background:color-mix(in srgb,var(--c) 13%,var(--surface)); box-shadow:0 0 0 3px var(--surface);
  transition:background .15s, color .15s;
}
.plan-i .pt{font-weight:600; letter-spacing:-.01em}
.plan-i .pk{font-size:10.5px; font-weight:650; letter-spacing:.1em; text-transform:uppercase; color:var(--c); opacity:.8; white-space:nowrap}
.plan-i.on .pn,.plan-i:hover .pn{background:var(--c); color:var(--surface)}
.plan-i.on{background:color-mix(in srgb,var(--c) 9%,transparent)}

/* the slim bar that shows the current section once the plan is out of view */
.th-now{position:sticky; top:0; height:0; z-index:6}
.now-in{
  position:absolute; left:-10px; right:-10px; top:10px; display:flex; align-items:center; gap:10px;
  padding:5px 6px 5px 5px; border-radius:12px; border:1px solid var(--line);
  background:var(--surface); box-shadow:var(--shadow); opacity:0; transform:translateY(-8px); pointer-events:none; transition:opacity .18s, transform .18s;
}
.th-now.show .now-in{opacity:1; transform:none; pointer-events:auto}
.th-now{--c:var(--accent)}
.now-plan{
  display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line); background:var(--surface-2); border-radius:8px;
  padding:4px 10px 4px 8px; font-size:12px; font-weight:600; color:var(--ink-2); cursor:pointer;
}
.now-plan:hover{border-color:var(--accent-line); color:var(--accent)}
.now-plan svg,.now-step svg{width:15px; height:15px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round}
.now-n{font-size:11.5px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--surface); background:var(--c); border-radius:6px; padding:2px 7px}
.now-t{flex:1; min-width:0; font-size:13.5px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.now-step{width:30px; height:28px; display:grid; place-items:center; border:1px solid transparent; background:transparent; border-radius:8px; color:var(--muted); cursor:pointer}
.now-step:hover{border-color:var(--line); color:var(--ink)}

/* ---------------- the card's content ---------------- */
.th-body{font-size:15.5px; line-height:1.7; color:var(--ink); padding-top:6px}
.th-body .blk{padding:28px 0 6px; scroll-margin-top:64px; --c:var(--muted)}
.th-body .blk + .blk{border-top:1px dashed var(--line)}
.th-body .blk > h3,.th-body .hy > h3{
  display:inline-flex; align-items:center; gap:8px; margin:0 0 14px; padding:4px 11px 4px 9px; border-radius:7px;
  font-family:var(--font-mono); font-size:11px; font-weight:600; letter-spacing:.12em; text-transform:uppercase;
  color:var(--c); background:color-mix(in srgb,var(--c) 10%,transparent);
}
.th-body .blk > h3::before{content:""; width:7px; height:7px; border-radius:2px; background:var(--c)}
.th-body h3:has(.hn)::before{display:none}
.th-body h3 .hn{display:inline-grid; place-items:center; min-width:19px; height:19px; padding:0 5px; margin-left:-3px; border-radius:6px;
  background:var(--c); color:var(--surface); font-size:10.5px; font-weight:700; letter-spacing:0; font-variant-numeric:tabular-nums}
.th-body .def{--c:var(--c-def)} .th-body .eti{--c:var(--c-eti)} .th-body .mech{--c:var(--c-mech)}
.th-body .cls{--c:var(--c-cls)} .th-body .clin{--c:var(--c-clin)}
.th-body p{margin:0 0 13px; max-width:72ch}
.th-body ul,.th-body ol{margin:0 0 13px; padding-left:21px; max-width:72ch}
.th-body li{margin-bottom:6px; padding-left:2px}
.th-body li::marker{color:var(--faint)}
.th-body ul ul,.th-body ol ul{margin:6px 0 2px}
.th-body b,.th-body strong{font-weight:600}
.th-body em.term{font-style:normal; font-weight:600; background:linear-gradient(transparent 58%, color-mix(in srgb,var(--c,var(--accent)) 18%,transparent) 58%)}
.th-body .lat{font-style:italic; color:var(--ink-2)}
.th-body sub,.th-body sup{line-height:0}
.th-body code{font-size:.85em}

/* lists written with middle dots in the notes, one item per line */
.th-body .dotlist{margin:0 0 13px; max-width:72ch}
.th-body .dotlist > p{margin:0 0 4px}
.th-body ul.dots{list-style:none; margin:4px 0 13px; padding-left:18px; max-width:72ch}
.th-body .dotlist > ul.dots{margin-bottom:0}
.th-body ul.dots > li{position:relative; margin-bottom:5px; padding-left:0}
.th-body ul.dots > li::before{   /* the notes' own ·, kept as the bullet */
  content:"\B7"; position:absolute; left:-15px; top:0; width:10px; text-align:center;
  font-weight:900; color:var(--c,var(--accent)); transform:scale(1.7); transform-origin:50% 55%;
}
.th-body li > ul.dots{margin:5px 0 3px}
.th-body td ul.dots,.th-body th ul.dots{margin:2px 0 0; padding-left:14px}
.th-body td ul.dots > li,.th-body th ul.dots > li{margin-bottom:3px}
.th-body td ul.dots > li::before,.th-body th ul.dots > li::before{left:-13px}
.th-body td .dl-lead{margin-bottom:2px}
.th-body .chain ul.dots{margin:0; padding-left:16px; max-width:none}
.th-body .chain ul.dots > li{margin-bottom:2px}
.th-body .chain ul.dots > li::before{color:var(--c-mech)}
.th-body .chain .dl-lead{margin-bottom:2px}

/* mechanism chains: the arrows are the point */
.th-body .chain{
  position:relative; margin:6px 0 16px; padding:13px 18px 13px 20px; max-width:none;
  background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:var(--shadow-sm);
  font-size:14.8px; line-height:1.85; overflow-x:auto;
}
.th-body .chain::before{content:""; position:absolute; left:0; top:12px; bottom:12px; width:3px; border-radius:0 3px 3px 0; background:var(--c-mech)}
.th-body .chain .ar{color:var(--c-mech); font-weight:700; padding:0 4px}
.th-body .chain b{font-weight:650}
.nref{
  font:inherit; color:inherit; background:none; border:0; margin:0; padding:0 2px; cursor:pointer; border-radius:4px;
  text-decoration:underline dotted color-mix(in srgb,var(--nodes) 75%,transparent); text-decoration-thickness:1.6px; text-underline-offset:4px;
  transition:background .12s, color .12s;
}
.nref.x{text-decoration-style:solid; text-decoration-color:color-mix(in srgb,var(--nodes) 55%,transparent)}
.nref:hover,.nref.on{background:color-mix(in srgb,var(--nodes) 15%,transparent); color:var(--ink); text-decoration-color:var(--nodes)}
.nref.on{box-shadow:0 0 0 1px color-mix(in srgb,var(--nodes) 50%,transparent)}

.th-body .tblwrap{overflow-x:auto; margin:6px 0 18px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:var(--shadow-sm)}
.th-body table{border-collapse:collapse; width:100%; font-size:13.8px; line-height:1.55; min-width:460px}
.th-body th,.th-body td{text-align:left; vertical-align:top; padding:9px 14px; border-bottom:1px solid var(--line-2)}
.th-body thead th{
  font-family:var(--font-mono); font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; font-weight:600;
  color:var(--muted); background:var(--surface-2); border-bottom-color:var(--line);
}
.th-body tbody th{font-weight:600; color:var(--ink); background:var(--surface-2); white-space:nowrap; width:1%}
.th-body tbody tr:last-child > *{border-bottom:0}
.th-body tbody tr:hover > td{background:color-mix(in srgb,var(--accent) 3.5%,transparent)}

.th-body .hy{
  --c:var(--hy-ink); position:relative; margin:30px 0 8px; padding:20px 24px 18px; border-radius:16px;
  background:var(--hy-bg); border:1px solid var(--hy-line); scroll-margin-top:64px;
}
.th-body .hy > h3{background:color-mix(in srgb,var(--hy-line) 30%,transparent)}
.th-body .hy > h3::before{content:"★"; font-size:12px; letter-spacing:0}
.th-body .hy ul{margin:0; padding-left:20px; max-width:none}
.th-body .hy li{color:var(--ink-2)}
.th-body .hy li::marker{color:var(--hy-line)}
.th-body .hy li:last-child{margin-bottom:0}

.th-body figure.fig{margin:8px 0 18px; padding:16px 16px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--ink-2)}
.th-body figure.fig svg{display:block; width:100%; height:auto}
.th-body figcaption{font-size:12.5px; color:var(--muted); margin-top:8px; line-height:1.5}

/* cram mode: high-yield boxes only */
#view-theory.th-cram .th-body .blk{display:none}
#view-theory.th-cram .th-body .hy{margin-top:12px}
#view-theory.th-cram .th-plan,#view-theory.th-cram .th-now{display:none}

/* sentence opened from Nodes, and filter matches */
::highlight(ps-quote){background-color:color-mix(in srgb,var(--nodes) 28%,transparent); color:var(--ink)}
::highlight(ps-term){background-color:var(--mark); color:var(--ink)}
.th-body .pulse{animation:pulse 2.4s ease-out}
@keyframes pulse{0%,35%{box-shadow:0 0 0 6px color-mix(in srgb,var(--nodes) 22%,transparent); background:color-mix(in srgb,var(--nodes) 7%,transparent)} 100%{box-shadow:0 0 0 0 transparent}}

/* pager */
.th-pager{display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:46px; padding-top:26px; border-top:1px solid var(--line)}
.pg{
  display:flex; flex-direction:column; gap:4px; padding:15px 18px 16px; border:1px solid var(--line); border-radius:14px;
  background:var(--surface); color:var(--ink); text-decoration:none; transition:border-color .15s, transform .15s, box-shadow .15s;
}
.pg:hover{border-color:var(--accent-line); box-shadow:var(--shadow); transform:translateY(-1px)}
.pg .d{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted)}
.pg .t{font-family:var(--font-display); font-size:16px; font-weight:680; line-height:1.3; letter-spacing:-.018em}
.pg.next{text-align:right; grid-column:2}

/* ---------------- home ---------------- */
.th-home{max-width:1220px; margin:0 auto; padding:44px 44px 90px}
.hero{
  display:grid; grid-template-columns:minmax(0,1.55fr) minmax(280px,1fr); gap:24px; align-items:start;
  padding-bottom:34px; margin-bottom:30px; border-bottom:1px solid var(--line);
}
/* the welcome card, drawn like the Nodes start card */
.th-welcome{background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:24px 26px; box-shadow:var(--shadow)}
.th-welcome h2{font-family:var(--font-display); font-size:24px; font-weight:750; margin:6px 0 10px; line-height:1.15; letter-spacing:-.03em}
.th-welcome p{margin:0 0 14px; color:var(--ink-2)}
.th-welcome .hintline{margin:0; font-size:12.5px; color:var(--muted)}
.th-welcome .hintline b{color:var(--ink-2); font-weight:600}
.hero h1{font-family:var(--font-display); font-weight:780; font-size:clamp(36px,4.3vw,54px); line-height:1.03; letter-spacing:-.04em; margin:14px 0 0; text-wrap:balance}
.hero h1 em{font-style:normal; font-weight:250; color:var(--accent)}
.hero-card{
  background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px 22px; box-shadow:var(--shadow);
  display:flex; flex-direction:column; gap:12px;
}
.hero-card{gap:16px}
/* the whole, as a ring with the percentage inside */
.hc-head{display:grid; grid-template-columns:72px minmax(0,1fr); align-items:center; gap:16px; position:relative}
.hc-ring{width:72px; height:72px; transform:rotate(-90deg)}
.hc-ring circle{fill:none; stroke-width:7}
.hc-ring .bg{stroke:var(--sunken)}
.hc-ring .fg{stroke:var(--accent); stroke-linecap:round; transition:stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1)}
.hc-pct{position:absolute; left:0; top:0; width:72px; height:72px; display:flex; align-items:center; justify-content:center; font-family:var(--font-display); font-size:21px; font-weight:700; letter-spacing:-.03em; color:var(--ink); font-variant-numeric:tabular-nums}
.hc-pct small{font-size:11px; font-weight:600; color:var(--muted); margin-left:1px}
.hc-title{display:grid; gap:3px}
.hc-title b{font-family:var(--font-display); font-size:19px; font-weight:720; letter-spacing:-.025em; line-height:1.2; color:var(--ink)}
/* read / in progress / to go */
.hc-stats{display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--line); border-radius:12px; overflow:hidden}
.hc-stats div{display:grid; gap:1px; padding:9px 12px; background:var(--bg)}
.hc-stats div + div{border-left:1px solid var(--line)}
.hc-stats b{font-family:var(--font-display); font-size:20px; font-weight:700; letter-spacing:-.03em; color:var(--ink); font-variant-numeric:tabular-nums}
.hc-stats span{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
/* what to read next */
.hc-next{
  display:grid; gap:6px; padding:13px 15px; border-radius:12px; text-decoration:none; color:var(--ink);
  background:var(--accent-soft); border:1px solid var(--accent-line); transition:border-color .15s, box-shadow .15s;
}
.hc-next:hover{border-color:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}
.hn-k{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.08em; text-transform:uppercase; color:var(--accent); font-weight:600}
.hn-t{font-size:15px; font-weight:650; line-height:1.3; letter-spacing:-.01em}
.hn-t .n{font-family:var(--font-mono); font-size:12px; font-weight:600; color:var(--accent); margin-right:7px}
.hn-p{font-size:12px; color:var(--muted)}
.hn-go{justify-self:start; margin-top:2px; padding:6px 13px; border-radius:8px; background:var(--accent); color:var(--on-accent); font-size:13px; font-weight:600}
/* one bar per body system, in the welcome card */
.th-systems{display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:2px 22px; margin:4px 0 14px}
@media (max-width:560px){ .th-systems{grid-template-columns:1fr} }
.hc-sys{display:grid; grid-template-columns:minmax(0,1fr) auto 48px; align-items:center; gap:10px; padding:4px 6px; margin:0 -6px; border-radius:7px; text-decoration:none; color:var(--ink-2)}
.hc-sys:hover{background:var(--bg); color:var(--ink)}
.hs-n{font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis}
.hs-c{font-family:var(--font-mono); font-size:11px; color:var(--muted); font-variant-numeric:tabular-nums}
.hc-sys .hc-bar{height:4px}
.hc-sys.done .hs-c{color:var(--accent); font-weight:600}
@media (prefers-reduced-motion:reduce){.hc-ring .fg{transition:none}}
.hc-bar{height:6px; border-radius:6px; background:var(--sunken); overflow:hidden}
.hc-bar i{display:block; height:100%; background:var(--accent); border-radius:6px}
.hc-acts{display:flex; gap:8px; flex-wrap:wrap}
/* where the progress is kept: the the main site account, or only this browser */
.hc-acct{margin:0; font-size:12px; line-height:1.45; color:var(--muted)}
.hc-acct b{font-weight:600; color:var(--ink-2)}
.hc-acct a{color:var(--accent); text-decoration:underline; text-underline-offset:2px}
.hc-acct.on::before{content:""; display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--accent); margin-right:7px; vertical-align:1px}
/* "Continue at 43%": a card opened at its top with a place saved further down */
.th-actions .th-resume{border-color:var(--accent-line); color:var(--accent); background:var(--accent-soft)}

.bgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(340px,1fr)); gap:18px}
.bcard{
  background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px 22px 18px;
  display:flex; flex-direction:column; gap:10px; box-shadow:var(--shadow-sm); scroll-margin-top:20px;
  transition:box-shadow .2s, border-color .2s; container-type:inline-size;
}
.bcard:hover{box-shadow:var(--shadow)}
.bcard.flash{animation:bflash 1.4s ease-out}
@keyframes bflash{0%,40%{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-soft)}}
.bc-top{display:flex; align-items:flex-start; justify-content:space-between; gap:12px}
.bc-num{font-family:var(--font-display); font-weight:200; font-size:48px; line-height:.8; letter-spacing:-.05em; color:var(--accent); font-variant-numeric:tabular-nums}
.bc-kick{font-family:var(--font-mono); font-size:10.5px; letter-spacing:.1em; text-transform:uppercase; color:var(--muted); text-align:right; line-height:1.5}
/* the system's icon beside its title, growing and shrinking with the card */
.bc-title{display:flex; align-items:flex-end; justify-content:space-between; gap:14px}
.bc-ic{
  flex:none; width:clamp(34px,14cqi,60px); height:auto; margin:-6px -2px -2px 0;
  fill:none; stroke:var(--accent); stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; opacity:.9;
}
.bcard h2{font-family:var(--font-display); font-weight:750; font-size:21px; line-height:1.18; margin:4px 0 0; letter-spacing:-.028em}
.bc-list{list-style:none; margin:4px 0 0; padding:10px 0 0; border-top:1px solid var(--line-2); display:grid; gap:1px}
.bc-part{margin:4px 0 0; padding:10px 0 0; border-top:1px solid var(--line-2); font-size:11.5px; font-weight:600; color:var(--muted); line-height:1.3}
.bc-part + .bc-list{margin-top:-6px; padding-top:0; border-top:0}
.bc-list a{
  display:grid; grid-template-columns:24px minmax(0,1fr) 13px; gap:6px; align-items:center; padding:4px 6px; margin:0 -6px;
  border-radius:7px; color:var(--ink-2); text-decoration:none; font-size:13px; line-height:1.3;
}
.bc-list a:hover{background:var(--surface-2); color:var(--ink)}
.bc-list .n{font-family:var(--font-mono); font-size:11px; color:var(--muted)}
.bc-list .tick{width:11px; height:11px; border-radius:50%; border:1.5px solid var(--line)}
.bc-list .read .tick{background:var(--accent); border-color:var(--accent)}
.bc-foot{display:flex; align-items:center; gap:10px; margin-top:auto; padding-top:6px; font-family:var(--font-mono); font-size:10.5px; color:var(--muted)}
.bc-foot .hc-bar{flex:1; height:4px}

/* ---------------- side: the topic in Nodes ---------------- */
.th-side{background:var(--surface); border-left:1px solid var(--line); overflow-y:auto; overflow-x:hidden; min-height:0; padding:20px 18px 48px}
.th-side *{max-width:100%}
.sd-kick{display:flex; align-items:center; gap:7px; font-family:var(--font-mono); font-size:10.5px; letter-spacing:.13em; text-transform:uppercase; font-weight:600; color:var(--nodes)}
.sd-kick .dot{width:7px; height:7px; border-radius:50%; background:var(--nodes); box-shadow:0 0 0 3px color-mix(in srgb,var(--nodes) 20%,transparent)}
.th-side h2{font-family:var(--font-display); font-weight:750; font-size:20px; line-height:1.2; margin:8px 0 8px; letter-spacing:-.025em; overflow-wrap:anywhere}
.sd-lead{font-size:12.8px; line-height:1.55; color:var(--muted); margin:0 0 12px}
.th-side .primary{background:var(--nodes); border-color:var(--nodes)}
.th-side .ghost:hover{border-color:color-mix(in srgb,var(--nodes) 45%,var(--line)); color:var(--nodes)}
.sd-tabs{display:flex; gap:3px; padding:3px; margin:16px 0 4px; background:var(--surface-2); border:1px solid var(--line-2); border-radius:10px}
.sd-tabs button{flex:1; border:0; background:transparent; padding:6px 8px; border-radius:7px; font-size:12.5px; font-weight:600; color:var(--muted); cursor:pointer}
.sd-tabs button span{font-family:var(--font-mono); font-size:10.5px; font-weight:500; margin-left:4px; opacity:.8}
.sd-tabs button[aria-selected="true"]{background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm)}
.sd-close{position:absolute; right:14px; top:14px}

.chead{font-family:var(--font-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; font-weight:600; color:var(--muted); margin:18px 0 7px}
.cline{margin:0 0 10px; font-size:12.8px; line-height:2.05}
.cs{
  font:inherit; font-size:12.5px; line-height:1.45; border:1px solid var(--line); background:var(--surface-2); border-radius:7px;
  padding:1px 7px 2px; cursor:pointer; color:var(--ink-2); text-align:left; transition:border-color .12s, color .12s, background .12s;
}
.cs.shared{border-color:color-mix(in srgb,var(--nodes) 38%,var(--line)); background:color-mix(in srgb,var(--nodes) 7%,var(--surface)); color:var(--ink); font-weight:550}
.cs.dis{font-family:var(--font-display); font-weight:720; letter-spacing:-.01em}
.cs sup{font-family:var(--font-mono); font-size:9.5px; font-weight:600; color:var(--nodes); margin-left:3px; vertical-align:1px}
.cs:hover,.cs.on{border-color:var(--nodes); color:var(--nodes); background:color-mix(in srgb,var(--nodes) 11%,var(--surface))}
.car{color:var(--faint); margin:0 3px; font-size:12px}

.conn{padding:11px 2px; border-bottom:1px solid var(--line-2)}
.conn:last-child{border-bottom:0}
.conn-top{display:flex; align-items:baseline; gap:8px}
.conn-t{display:flex; gap:8px; align-items:baseline; min-width:0; flex:1; color:var(--ink); text-decoration:none; font-weight:600; font-size:13.3px; line-height:1.35}
.conn-t:hover{color:var(--accent)}
.conn-t .tn,.sd-topic .tn{font-family:var(--font-mono); font-size:11px; font-weight:600; color:var(--accent); flex:none}
.conn-c{font-family:var(--font-mono); font-size:10px; color:var(--muted); white-space:nowrap}
.conn-via{display:flex; flex-wrap:wrap; gap:4px; align-items:center; margin-top:7px; font-size:11.5px; color:var(--muted)}
.conn-via .cs{font-size:11.5px; padding:0 6px 1px}
.sd-subh{font-family:var(--font-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; font-weight:600; color:var(--muted); margin:18px 0 4px}
.sd-empty{font-size:12.5px; color:var(--muted); padding:10px 2px}

.sd-back{border:0; background:none; padding:0; margin:0 0 12px; cursor:pointer; color:var(--muted); font-size:12.5px; display:inline-flex; gap:6px; align-items:center}
.sd-back:hover{color:var(--nodes)}
.sd-def{background:var(--surface-2); border:1px solid var(--line-2); border-radius:12px; padding:11px 13px 12px; margin:6px 0 12px}
.sd-def h4{display:flex; justify-content:space-between; gap:8px; align-items:baseline; margin:0 0 5px; font-family:var(--font-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--nodes); font-weight:600}
.sd-def h4 span{letter-spacing:.02em; text-transform:none; color:var(--muted); font-weight:500}
.sd-def h4 a{color:var(--accent); text-decoration:none}
.sd-def p{margin:0; font-size:13.6px; line-height:1.55; color:var(--ink)}
.sd-note{font-size:12.8px; line-height:1.55; color:var(--ink-2); background:var(--surface-2); border-left:3px solid var(--nodes); padding:8px 11px; border-radius:0 9px 9px 0; margin:0 0 12px}
.sd-sec{margin-top:18px}
.sd-sec h4{display:flex; justify-content:space-between; align-items:baseline; margin:0 0 5px; font-family:var(--font-mono); font-size:10px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted); font-weight:600}
.sd-row{
  display:grid; grid-template-columns:14px minmax(0,1fr); gap:2px 7px; width:100%; text-align:left; align-items:start;
  border:0; background:transparent; border-radius:9px; padding:7px 6px 8px; cursor:pointer; font-size:13px; color:var(--ink);
}
.sd-row:hover{background:var(--surface-2)}
.sd-row .ar{color:var(--muted); font-size:12px; line-height:1.45}
.sd-row .t{font-weight:500; overflow-wrap:anywhere}
.sd-row .tp{grid-column:2; font-family:var(--font-mono); font-size:10px; color:var(--muted)}
.sd-row .why{grid-column:2; font-size:12px; line-height:1.45; color:var(--muted); display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden}
.sd-topic{display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:8px; align-items:baseline; padding:6px 6px; border-radius:8px; color:var(--ink-2); text-decoration:none; font-size:13px}
.sd-topic:hover{background:var(--surface-2); color:var(--ink)}
.sd-topic.cur{color:var(--ink); font-weight:600}
.sd-topic em{font-style:normal; font-family:var(--font-mono); font-size:9.5px; text-transform:uppercase; letter-spacing:.08em; color:var(--nodes)}

/* ---------------- narrower windows ---------------- */
@media (max-width:1360px){ #view-theory{--th-rail:262px; --th-side:318px} .th-topic{padding:30px 38px 80px} }
/* the Nodes panel becomes a drawer */
@media (max-width:1180px){
  #view-theory{grid-template-columns:var(--th-rail) minmax(0,1fr)}
  .th-side{
    position:absolute; z-index:25; top:0; right:0; bottom:0; width:min(380px,92vw);
    transform:translateX(102%); transition:transform .24s ease; box-shadow:var(--shadow-lg); border-left:1px solid var(--line);
  }
  #view-theory.side-open .th-side{transform:none}
  #view-theory.side-open .th-scrim,#view-theory.rail-open .th-scrim{display:block; position:absolute; inset:0; z-index:24; background:var(--scrim)}
  .only-drawer{display:inline-flex!important}
}
/* the topic list becomes a drawer too */
@media (max-width:880px){
  #view-theory,#view-theory.home{grid-template-columns:minmax(0,1fr)}
  .th-rail{
    position:absolute; z-index:25; top:0; left:0; bottom:0; width:min(320px,88vw);
    transform:translateX(-102%); transition:transform .24s ease; box-shadow:var(--shadow-lg);
  }
  #view-theory.rail-open .th-rail{transform:none}
  .th-mbar{display:flex; position:absolute; z-index:6; top:10px; left:12px; right:12px; gap:8px; pointer-events:none}
  .th-mbar button{pointer-events:auto; background:color-mix(in srgb,var(--surface) 92%,transparent); backdrop-filter:blur(8px); box-shadow:var(--shadow-sm)}
  .th-mbar .only-topic{margin-left:auto}
  #view-theory.home .th-mbar .only-topic{display:none}
  .th-actions .only-drawer{display:none!important}   /* the floating bar has it */
  .th-topic{padding:62px 20px 70px}
  .th-home{padding:64px 18px 70px}
  .th-num{font-size:56px}
  .hero{grid-template-columns:1fr; gap:22px}
  .bgrid{grid-template-columns:1fr}
  .th-plan{margin-left:-6px; margin-right:-6px}
  .plan-i .pk{display:none}
  .now-in{top:54px; left:-8px; right:-8px}
  .th-body{font-size:15px}
  .th-pager{grid-template-columns:1fr}
  .pg.next{grid-column:auto}
}

/* ---------------- tablets ---------------- */
/* an iPad held upright: still one column of text, with wider margins, and the
   overview keeps its cards two by two */
@media (min-width:700px) and (max-width:880px){
  .th-topic{padding:68px 36px 80px}
  .th-home{padding:68px 28px 80px}
  .hero{grid-template-columns:minmax(0,1.3fr) minmax(250px,1fr); gap:26px}
  .bgrid{grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px}
  .th-body{font-size:15.5px}
  .th-pager{grid-template-columns:1fr 1fr}
  .pg.next{grid-column:2}
}
/* fingers: rows tall enough to hit, and lists that don't drag the page along */
@media (pointer:coarse){
  .th-toc,.th-main,.th-side{overscroll-behavior:contain}
  .th-body tbody tr:hover > td{background:none}
}
@media (pointer:coarse) and (min-width:600px){
  .toc-i{padding:10px 8px; font-size:14px}
  .toc-bh{padding-top:14px; padding-bottom:9px}
  .bc-list a{padding:9px 6px; font-size:14px}
  .plan-i{padding-top:11px; padding-bottom:11px}
  .now-in{padding:7px 8px 7px 7px}
  .now-plan{padding:8px 12px 8px 10px}
  .now-step{width:42px; height:38px}
  .th-crumbs{font-size:11px; gap:10px}
  .th-crumbs a{padding:6px 0}
  .cline{line-height:2.7}
  .cs{padding:4px 9px 5px; font-size:13px}
  .sd-tabs button{padding:10px 8px; font-size:13px}
  .sd-row{padding:10px 6px 11px; font-size:14px}
  .sd-topic{padding:10px 6px; font-size:14px}
  .sd-back{padding:8px 0; font-size:13.5px}
  .th-finals a{padding:12px 16px 13px}
  .gg-row{padding:8px 0}
}

/* ---------- the Gamblegram in topic 18 (js/gamblegram.js) ---------- */
.th-body .gg{margin:6px 0 18px; padding:16px 18px 14px; border:1px solid var(--line); border-radius:12px; background:var(--surface); box-shadow:var(--shadow-sm); font-size:13.5px; line-height:1.5}
.gg-top{display:flex; flex-wrap:wrap; align-items:baseline; gap:4px 12px; margin-bottom:10px}
.gg-title{font-weight:650; font-size:14.5px; color:var(--ink)}
.gg-sub{color:var(--muted); font-size:12.5px}
.gg-cases{display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px}
.gg-cases .ghost[aria-pressed="true"]{border-color:var(--accent-line); background:var(--accent-soft); color:var(--accent)}
.gg-grid{display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:6px 18px; align-items:start}
.gg-svg{display:block; width:100%; height:auto; max-width:460px; justify-self:center; font-family:var(--font-ui)}
.gg-b{stroke:var(--surface); stroke-width:1.5}
.gg-tick{stroke:var(--line-2); stroke-width:1}
.gg-ax{fill:var(--faint); font-size:11.5px; font-variant-numeric:tabular-nums}
.gg-l{fill:var(--ink-2); font-size:13.5px}
.gg-n{fill:var(--ink); font-weight:650; font-variant-numeric:tabular-nums}
.gg-h{fill:var(--muted); font-size:12px; font-weight:600; letter-spacing:.06em; text-transform:uppercase}
.gg-lead{stroke:var(--faint); stroke-width:1; fill:none}
.gg-br{stroke:var(--ink-2); stroke-width:1.5; fill:none}
.gg-ag{fill:var(--muted); font-size:12px; font-weight:600; letter-spacing:.06em}
.gg-agn{fill:var(--ink); font-size:17px; font-weight:700; font-variant-numeric:tabular-nums}
.gg-out{padding:2px 0 10px; border-bottom:1px dashed var(--line); margin-bottom:10px}
.gg-big{display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 18px}
.gg-stat{display:inline-flex; align-items:baseline; gap:8px}
.gg-k{color:var(--muted); font-size:12.5px}
.gg-v{font-size:30px; font-weight:700; line-height:1.1; letter-spacing:-.02em; color:var(--ink); font-variant-numeric:tabular-nums}
.gg-tag{font-size:11.5px; font-weight:650; padding:2px 8px; border-radius:999px; border:1px solid var(--line); color:var(--ink-2)}
.gg-tag[data-band="ok"]{color:var(--c-cls); border-color:color-mix(in srgb,var(--c-cls) 45%,var(--line))}
.gg-tag[data-band="high"]{color:var(--c-mech); border-color:color-mix(in srgb,var(--c-mech) 45%,var(--line))}
.gg-tag[data-band="low"]{color:var(--c-eti); border-color:color-mix(in srgb,var(--c-eti) 45%,var(--line))}
.th-body .gg p{max-width:none; margin:0}
.th-body .gg .gg-eq{margin-top:4px; color:var(--ink-2); font-variant-numeric:tabular-nums}
.th-body .gg .gg-say{margin-top:5px; color:var(--ink-2); min-height:3em}
.gg-row{display:grid; grid-template-columns:9px 5.4em minmax(0,1fr) 2.5em 3.2em; align-items:center; gap:8px; padding:3px 0}
.gg-sw{width:9px; height:9px; border-radius:3px}
.gg-name{color:var(--ink); font-weight:550}
.gg-row input{width:100%; margin:0; accent-color:var(--accent); cursor:pointer}
.gg-row output{text-align:right; font-weight:650; font-variant-numeric:tabular-nums; color:var(--ink)}
.gg-unit{color:var(--muted); font-size:11.5px}
.th-body .gg .gg-ch{margin:9px 0 2px; font-size:11px; font-weight:600; letter-spacing:.06em; text-transform:uppercase; color:var(--muted)}
.th-body .gg .gg-in{margin-top:6px; color:var(--muted); font-size:12.5px; font-variant-numeric:tabular-nums}
.gg-in b{color:var(--ink)}
.th-body .gg .gg-why{margin-top:12px; padding-top:10px; border-top:1px dashed var(--line); color:var(--ink-2)}
@media (max-width:1180px){ .gg-grid{grid-template-columns:minmax(0,1fr)} }

/* ---------- gas exchange, animated: topics 48 and 53 (js/lung-anim.js) ---------- */
.th-body .la{margin:16px 0 4px; padding-top:14px; border-top:1px dashed var(--line)}
.la-top{display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-bottom:10px}
.la-kicker{font-size:10.5px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; color:var(--c-mech)}
.la-tabs{display:flex; flex-wrap:wrap; gap:6px}
.la-tabs .ghost[aria-pressed="true"]{border-color:var(--accent-line); background:var(--accent-soft); color:var(--accent)}
.la-card{background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:16px 18px 14px; box-shadow:var(--shadow-sm); container-type:inline-size}
.th-body .la-card h4{margin:0 0 10px; font-size:16.5px; font-weight:700; letter-spacing:-.015em; color:var(--ink); line-height:1.3}
.la-body{display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); gap:14px 18px; align-items:start}
.la-scene-box{border:1px solid var(--line-2); border-radius:12px; background:var(--surface-2); padding:6px}
.la-scene,.la-panel{display:block; width:100%; height:auto; font-family:var(--font-ui); user-select:none; -webkit-user-select:none}
.la-panel{border:1px solid var(--line-2); border-radius:12px; background:var(--surface)}
.la-panel.trend{cursor:ew-resize; touch-action:pan-y}
.la-side{display:grid; gap:10px; min-width:0}

/* scene */
.la-air{fill:none; stroke:var(--edge); stroke-linecap:round}
.la-air-in{fill:none; stroke:#EEF6F8; stroke-linecap:round}
.la-plug{fill:#C9B458; stroke:#9C8A3A; stroke-width:1}
.la-sac{stroke:var(--edge); stroke-width:1.6}
.la-mem{fill:none; stroke:#C7A9A2; stroke-linecap:round}
.la-vessel{fill:none; stroke:#EAD9DC; stroke-width:12; stroke-linecap:round; stroke-linejoin:round}
.la-arteriole{fill:none; stroke:#8C86C9; stroke-linecap:round; opacity:.7}
.la-cap{fill:none; stroke:#E6B9BD; stroke-width:9; stroke-linecap:round; opacity:.6}
.la-cap.flat{stroke:#EAD0D3; opacity:1}
.la-venule{fill:none; stroke:#E08F86; stroke-width:9; stroke-linecap:round; opacity:.5}
.la-trunk{fill:none; stroke-width:12; stroke-linecap:round}
.la-trunk.art{stroke:#B7B2E0} .la-trunk.ven{stroke:#EBB0A9}
.la-node{stroke:var(--surface); stroke-width:2} .la-node.art{fill:#7F78C4} .la-node.ven{fill:#D1453B}
.la-bronch{fill:none; stroke:#8C86C9; stroke-width:5; stroke-linecap:round; transition:opacity .3s}
.la-tag{font-size:9.5px; font-weight:700; fill:var(--p4); letter-spacing:.02em}
.la-arteriole{transition:none}
.la-clot{fill:#5B1D1A; stroke:#2E0E0C; stroke-width:1}
.la-rbc{stroke:rgba(255,255,255,.85); stroke-width:1}
.la-rbc.tracked{stroke:var(--ink); stroke-width:2}
.la-flux{fill:none; stroke-width:2.6; stroke-linecap:round}
.la-flux.o2{stroke:var(--p0)} .la-flux.co2{stroke:var(--p1)}
.la-gas{font-size:10.5px; font-weight:650; font-variant-numeric:tabular-nums}
.la-gas.o2{fill:var(--p0)} .la-gas.co2{fill:var(--p1)}
.la-name{font-size:15px; font-weight:800; fill:var(--ink-2)}
.la-vq{font-size:11.5px; font-weight:700; fill:var(--ink); font-variant-numeric:tabular-nums}
.la-lbl{font-size:10.5px; fill:var(--muted)}
.la-lbl.strong{fill:var(--ink-2); font-weight:650; font-variant-numeric:tabular-nums}
.la-lbl.small{font-size:9.5px}
.la-lbl.bad,.la-lbl.strong.bad{fill:var(--c-mech)}
.la-lbl.adapt{fill:var(--p8); font-weight:650; letter-spacing:.06em}
.la-bar-bg{fill:var(--sunken)}
.la-bar.co2{fill:var(--p1)} .la-bar.o2{fill:var(--p0)}
.la-lung{fill:#FBF4F2; stroke:var(--edge); stroke-width:1.5}
.la-fluid{fill:#7FB3E0; opacity:.75}
.la-grav{stroke:var(--faint); stroke-width:1.6}
.la-grav-h{fill:var(--faint)}

/* panels */
.la-grid{stroke:var(--line-2); stroke-width:1}
.la-ax{fill:var(--faint); font-size:10.5px; font-variant-numeric:tabular-nums}
.la-ttl{fill:var(--ink-2); font-size:11.5px; font-weight:650}
.la-th{stroke-width:1.2; stroke-dasharray:4 4; opacity:.75}
.la-th.o2{stroke:var(--p0)} .la-th.co2{stroke:var(--p1)} .la-th.flow{stroke:var(--p4)} .la-th.warn{stroke:var(--c-mech)}
.la-th-t{font-size:10px; font-weight:650}
.la-th-t.o2{fill:var(--p0)} .la-th-t.co2{fill:var(--p1)} .la-th-t.flow{fill:var(--p4)} .la-th-t.warn{fill:var(--c-mech)} .la-th-t.air{fill:var(--p9)}
.la-line{fill:none; stroke-width:2.4; stroke-linejoin:round; stroke-linecap:round}
.la-line.o2{stroke:var(--p0)} .la-line.co2{stroke:var(--p1)} .la-line.flow{stroke:var(--p4)} .la-line.air{stroke:var(--p9)}
.la-line.odc{stroke:var(--p0); stroke-width:2}
.la-line.ghost{opacity:.16}
.la-leg.o2{fill:var(--p0)} .la-leg.co2{fill:var(--p1)} .la-leg.flow{fill:var(--p4)}
.la-dot{stroke:var(--surface); stroke-width:1.5}
.la-dot.o2{fill:var(--p0)} .la-dot.co2{fill:var(--p1)} .la-dot.flow{fill:var(--p4)}
.la-cursor{stroke:var(--accent); stroke-width:1; opacity:.55}
.la-grip{fill:var(--accent); opacity:.07}
.la-panel.trend:hover .la-grip{opacity:.14}
.la-reserve{fill:var(--c-cls); opacity:0; transition:opacity .3s} .la-reserve{fill-opacity:.07}
.la-pass.old .la-line{opacity:.38}
.la-pass-t{font-size:10.5px; font-weight:650; fill:var(--ink-2)}
.la-pt{stroke:var(--surface); stroke-width:1.5}
.la-pt.a{fill:var(--p2)} .la-pt.b{fill:var(--p3)} .la-pt.mix{fill:var(--ink)}
.la-pt-t{font-size:10.5px; font-weight:650; font-variant-numeric:tabular-nums}
.la-pt-t.a{fill:var(--p2)} .la-pt-t.b{fill:var(--p3)} .la-pt-t.mix{fill:var(--ink)}
.la-drop{fill:none; stroke:var(--ink); stroke-width:1; stroke-dasharray:3 3; opacity:.45}
.la-wet{fill:#7FB3E0; opacity:.35}

/* readouts */
.la-reads{display:flex; flex-wrap:wrap; gap:6px}
.la-read{display:inline-flex; align-items:baseline; gap:5px; padding:5px 10px; border:1px solid var(--line); border-radius:9px; background:var(--surface-2)}
.la-read-k{font-size:11.5px; color:var(--muted)}
.la-read-v{font-size:16px; font-weight:700; color:var(--ink); font-variant-numeric:tabular-nums; min-width:2ch; text-align:right}
.la-read-u{font-size:10.5px; color:var(--faint)}
.la-read.low{border-color:color-mix(in srgb,var(--c-eti) 45%,var(--line))} .la-read.low .la-read-v{color:var(--c-eti)}
.la-read.bad{border-color:color-mix(in srgb,var(--c-mech) 50%,var(--line)); background:color-mix(in srgb,var(--c-mech) 6%,var(--surface))} .la-read.bad .la-read-v{color:var(--c-mech)}

/* controls, phases */
.la-controls{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:12px}
.la-play{min-width:68px; justify-content:center}
.la-slider{flex:1; min-width:140px; accent-color:var(--accent); cursor:pointer}
.la-speed{display:flex; background:var(--surface-2); border:1px solid var(--line); border-radius:9px; padding:2px; gap:2px}
.la-speed button{border:0; background:transparent; border-radius:7px; padding:4px 10px; font-size:12px; font-weight:600; color:var(--muted); cursor:pointer}
.la-speed button[aria-pressed="true"]{background:var(--surface); color:var(--ink); box-shadow:var(--shadow-sm)}
.th-body .la-hint{font-size:12px; color:var(--faint); margin:6px 0 4px}
.th-body .la-steps{list-style:none; margin:4px 0 0; padding:0; display:grid; gap:2px; counter-reset:step}
.th-body .la-steps li{counter-increment:step; margin:0; padding:0}
.th-body .la-steps li::before{content:none}
.la-step{width:100%; display:grid; grid-template-columns:20px 10px 1fr; gap:10px; align-items:baseline; padding:7px 10px;
  border:0; border-left:3px solid transparent; border-radius:8px; background:transparent; text-align:left; cursor:pointer;
  font:inherit; font-size:13.5px; line-height:1.45; color:var(--muted); transition:background-color .15s, color .15s}
.la-step::before{content:counter(step); font-size:11.5px; font-weight:650; color:var(--faint); font-variant-numeric:tabular-nums}
.la-step:hover{background:var(--surface-2); color:var(--ink)}
.la-step-dot{width:9px; height:9px; border-radius:50%; align-self:center}
.la-steps li.active .la-step{background:var(--surface-2); color:var(--ink); border-left-color:var(--accent); font-weight:500}
.la-steps li.active .la-step::before{color:var(--accent)}
.th-body .la-notice{margin:10px 0 0; padding:10px 0 0 20px; border-top:1px solid var(--line-2)}
.th-body .la-notice li{font-size:13.5px; margin:3px 0; color:var(--ink-2)}
/* the topic column is narrow: scene above, panel below, unless the card is wide */
@container (max-width:760px){ .la-body{grid-template-columns:1fr} .la-scene-box{max-width:480px; justify-self:center; width:100%} }
@media (pointer:coarse) and (min-width:600px){ .la-step{padding:11px 10px} .la-speed button{padding:9px 13px; font-size:13.5px} .la-slider{height:32px} }
@media (prefers-reduced-motion:reduce){ .la-step{transition:none} }

/* ---------- membrane voltage, animated: topics 17, 18, 19, 23, 71, 90 (js/membrane-anim.js) ---------- */
.la-line.k,.la-leg.k{stroke:var(--p4)} .la-leg.k{fill:var(--p4)} .la-dot.k{fill:var(--p4)}
.la-line.h{stroke:var(--p0)} .la-leg.h{fill:var(--p0)} .la-dot.h{fill:var(--p0)}
.la-line.v{stroke:var(--p7); stroke-width:2} .la-dot.v{fill:var(--p7)}
.la-th-t.k{fill:var(--p4)} .la-th-t.rest{fill:var(--muted)}
.la-band{opacity:.08} .la-band.k{fill:var(--p4)}
.la-grid.zero{stroke:var(--edge); stroke-dasharray:2 3}
.mb-ecf{fill:#F6F1EA} .mb-icf{fill:#F1EEF8}
.mb-lipid circle{fill:#E9D8B4; stroke:#C9B285; stroke-width:.8}
.mb-core{fill:#F3E9D2}
.mb-chan rect{stroke-width:1.4}
.mb-chan.k rect{fill:#E7DDF8; stroke:var(--p4)}
.mb-chan.na rect{fill:#FBE8C8; stroke:var(--p3)}
.mb-chan.pump rect{fill:#E6ECEE; stroke:var(--faint)}
.mb-chan.ex rect{fill:#F8E1DE; stroke:var(--p0)}
.mb-chan .mb-pore{fill:var(--surface); stroke:none}
.mb-gate{fill:var(--p3); transition:x .08s}
.mb-chain{fill:none; stroke:var(--p3); stroke-width:1.5}
.mb-ball{fill:#FBE8C8; stroke:var(--p3); stroke-width:2}
.mb-ball.shut{fill:var(--p3)}
.mb-ion circle{stroke:rgba(255,255,255,.9); stroke-width:1}
.mb-ion text{font-size:6.4px; font-weight:800; fill:#fff; pointer-events:none}
.mb-ion.k circle{fill:var(--p4)} .mb-ion.na circle{fill:var(--p3)} .mb-ion.h circle{fill:var(--p0)} .mb-ion.ca circle{fill:var(--p2)}
.mb-sign{font-size:12px; font-weight:800; fill:var(--ink-2)}
.mb-vm{font-size:20px; font-weight:800; fill:var(--p7); font-variant-numeric:tabular-nums}
.mb-vm.small{font-size:11px; font-weight:700}
.mb-vm.up{fill:var(--c-mech)}
.mb-ins{font-size:10.5px; font-weight:700; fill:var(--c-cls)} .mb-ins.off{fill:var(--c-mech)}
.mb-urine{fill:#FFF6C8; stroke:#D9C25A; stroke-width:1.4}
.mb-diu{fill:none; stroke:#C9A93A; stroke-width:2; stroke-dasharray:4 3}
.mb-diu-h{fill:#C9A93A}
.mb-rest{fill:none; stroke:var(--muted); stroke-width:1.2; stroke-dasharray:5 4}
.mb-thr{fill:none; stroke:var(--c-mech); stroke-width:1.4; stroke-dasharray:3 3}
.mb-stim{fill:none; stroke:var(--ink-2); stroke-width:1.2}
.mb-stim.fired{fill:var(--ink-2)}
.mb-gap{fill:none; stroke:var(--ink-2); stroke-width:1.3}
.mb-gap-t{font-size:10.5px; font-weight:700; fill:var(--ink-2); font-variant-numeric:tabular-nums}
.mb-gap-t.bad{fill:var(--c-mech)}
