/* ===================================================================
   SAW-Bench — site stylesheet
   Clean, minimal academic project page. Self-contained (no Distill).
   =================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* neutrals */
  --bg:          #ffffff;
  --bg-soft:     #f7f8fa;
  --bg-softer:   #eef1f5;
  --border:      #e3e7ee;
  --text:        #1a1d23;
  --text-soft:   #51586410;
  --muted:       #5b626d;
  --muted-soft:  #8a909b;

  /* primary accent */
  --accent:      #3b5b8c;   /* slate blue */
  --accent-dark: #2c4670;
  --accent-soft: #eef3fb;

  /* task colors */
  --loc:     #d98b84;   /* self-localization  - coral   */
  --dir:     #6f8c9b;   /* relative direction - blue-gray*/
  --shape:   #cf7549;   /* route shape        - orange   */
  --revplan: #4f8a6a;   /* reverse route plan - sage     */
  --mem:     #a86379;   /* spatial memory     - pink     */
  --aff:     #d4a838;   /* spatial affordance - mustard  */

  --red:     #c1121f;

  /* layout */
  --reading:  880px;
  --wide:     1180px;
  --radius:   14px;
  --radius-sm:10px;
  --shadow:   0 6px 24px rgba(20, 30, 55, 0.07);
  --shadow-sm:0 2px 10px rgba(20, 30, 55, 0.06);

  --nav-h: 56px;     /* mobile top-bar height */
  --toc-w: 244px;    /* desktop left sidebar width */

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 24px; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }

/* ---------- Layout containers ---------- */
.container {
  width: 100%;
  max-width: var(--reading);
  margin: 0 auto;
  padding: 0 24px;
}
.wide {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px;
}

section { padding: 64px 0; }
section.tight { padding: 44px 0; }
.section-alt { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.section-title {
  font-size: 2rem;
  text-align: center;
  margin: 0 0 8px;
}
.section-sub {
  text-align: center;
  color: var(--muted);
  font-size: 1.02rem;
  margin: 0 auto 36px;
  max-width: 640px;
}
.eyebrow {
  display: block;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
}

/* ---------- Left sidebar TOC ---------- */
.toc {
  position: fixed;
  left: 0; top: 0;
  width: var(--toc-w);
  height: 100vh;
  padding: 38px 26px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  z-index: 60;
}
.toc-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--text);
}
.toc-brand:hover { text-decoration: none; color: var(--text); }
.toc-brand .dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
  flex: 0 0 auto;
}
.toc-links { display: flex; flex-direction: column; gap: 2px; }
.toc-links a {
  position: relative;
  color: var(--muted);
  font-size: 0.98rem;
  font-weight: 500;
  padding: 6px 0 6px 14px;
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.toc-links a:hover { color: var(--text); text-decoration: none; }
.toc-links a.active {
  color: var(--accent);
  font-weight: 700;
  border-left-color: var(--accent);
}
.toc-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 0.92rem;
}
.toc-foot a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 500;
}
.toc-foot a:hover { color: var(--accent); text-decoration: none; }
.toc-foot a .ico { width: 1.05em; display: inline-flex; justify-content: center; }
.toc-foot img { height: 1.05em; width: auto; }

/* content sits to the right of the fixed sidebar */
.page { margin-left: var(--toc-w); }

/* ---------- Hero ---------- */
.hero {
  padding: 56px 0 8px;
  text-align: center;
}
.hero h1.title {
  font-size: clamp(2rem, 3.8vw, 2.8rem);
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  font-weight: 900;
  background: linear-gradient(100deg, #715c92 0%, #85638b 50%, #9c6a7b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #85638b; /* fallback for older browsers */
}
.hero .subtitle {
  font-size: clamp(1.35rem, 2.7vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 auto 26px;
  max-width: 900px;
  line-height: 1.25;
}
@media (min-width: 720px) {
  .hero .subtitle { white-space: nowrap; }
}
.subtitle .emph { color: var(--text); }
.subtitle .saw {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.authors {
  font-size: 1.08rem;
  line-height: 2;
  margin: 0 auto 4px;
  max-width: 760px;
}
.authors a { color: var(--text); font-weight: 600; }
.authors a:hover { color: var(--accent); text-decoration: none; }
.authors sup { color: var(--muted); font-weight: 600; }
.affils {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 6px auto 0;
  max-width: 820px;
}
.affils sup { color: var(--muted-soft); }
.eq-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 8px;
}

/* award / venue badges */
.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 22px auto 4px;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid transparent;
}
.badge i { font-size: 0.95em; }
.badge-spotlight {
  color: #b23a2f;
  background: #fde3de;
  border-color: #f3b4a8;
}
.badge-award {
  color: #8a5a12;
  background: #fbf1d8;
  border-color: #efd9a3;
}

/* button row */
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 28px 0 8px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.96rem;
  font-weight: 600;
  border: 1px solid var(--text);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover { color: #fff; text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.btn.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn.btn-outline:hover { color: var(--accent); border-color: var(--accent); background: #fff; }
.btn .icon { display: inline-flex; font-size: 1.05em; }
.btn img { height: 1.05em; width: auto; display: inline-block; }

/* hero summary */
.hero-summary {
  max-width: 740px;
  margin: 26px auto 0;
  font-size: 1.08rem;
  line-height: 1.6;
  color: #2f343d;
}
.hero-summary strong { color: var(--text); font-weight: 700; }
.hero-summary em { font-style: italic; color: var(--accent); font-weight: 600; }

/* hero video */
.hero-media {
  margin: 40px auto 0;
  max-width: 840px;
}
.video-frame {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  border: 1px solid var(--border);
}
.video-frame video { width: 100%; display: block; }

/* ---------- Highlight cards ---------- */
.highlights {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 840px;
  margin: 40px auto 0;
}
.hl-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.hl-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.hl-icon {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 11px;
  background: var(--accent-soft);
  margin-bottom: 14px;
}
.hl-icon img { width: 24px; height: 24px; }
.hl-card h3 { font-size: 1rem; margin: 0 0 6px; }
.hl-card p { font-size: 0.92rem; color: var(--muted); margin: 0; line-height: 1.55; }

/* ---------- Abstract + stats ---------- */
.abstract-text {
  font-size: 1.08rem;
  color: #2a2f38;
  text-align: justify;
}
.stats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin: 36px auto 8px;
  max-width: 920px;
}
.stat {
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 12px;
  box-shadow: var(--shadow-sm);
}
.stat .num {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--accent);
}
.stat .lbl { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }

/* ---------- Task cards ---------- */
.task-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.task-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-top: 4px solid var(--tc, var(--accent));
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.task-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.task-card video { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; }
.task-body { padding: 16px 18px 20px; }
.task-chip {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--tc, var(--accent));
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}
.task-card h3 { font-size: 1.08rem; margin: 0 0 6px; }
.task-card p { font-size: 0.92rem; color: var(--muted); margin: 0; }

.tc-loc     { --tc: var(--loc); }
.tc-dir     { --tc: var(--dir); }
.tc-shape   { --tc: var(--shape); }
.tc-revplan { --tc: var(--revplan); }
.tc-mem     { --tc: var(--mem); }
.tc-aff     { --tc: var(--aff); }

/* inline task name colors (for prose/captions) */
.loc     { color: var(--loc);     font-weight: 700; }
.dir     { color: var(--dir);     font-weight: 700; }
.shape   { color: var(--shape);   font-weight: 700; }
.revplan { color: var(--revplan); font-weight: 700; }
.mem     { color: var(--mem);     font-weight: 700; }
.aff     { color: var(--aff);     font-weight: 700; }
.red     { color: var(--red); }

/* ---------- Interactive data viewer ---------- */
.viewer-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 28px;
}
.viewer-tab {
  font-family: var(--font);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.viewer-tab:hover { color: var(--text); border-color: var(--muted-soft); }
.viewer-tab.active {
  color: #fff;
  background: var(--tc, var(--accent));
  border-color: var(--tc, var(--accent));
  box-shadow: var(--shadow-sm);
}

.viewer-def {
  max-width: 800px;
  margin: -8px auto 26px;
  text-align: center;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--muted);
}
.viewer-def .vdef-label {
  display: inline-block;
  color: #fff;
  background: var(--tc, var(--accent));
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 9px;
  border-radius: 999px;
  margin-right: 9px;
  vertical-align: middle;
}

.viewer-body {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
}
.viewer-video { position: relative; }
.viewer-video video {
  width: 100%;
  height: auto;            /* keep each clip's native aspect ratio */
  border-radius: var(--radius-sm);
  background: #000;
}
/* example navigation */
.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}
.vnav {
  width: 34px; height: 34px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}
.vnav:hover { color: var(--accent); border-color: var(--accent); }
.vcount { font-size: 0.9rem; font-weight: 600; color: var(--muted); min-width: 110px; text-align: center; }

.viewer-qa { padding: 4px 4px 4px 0; }
.qa-question {
  font-size: 1.16rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 12px 0 16px;
  color: var(--text);
}

/* lettered options */
.qa-options { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qa-options .opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 0.96rem;
}
.opt-letter {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.opt-text { flex: 1 1 auto; }
.qa-options .opt.correct {
  border-color: #8fcfae;
  background: #eaf7f0;
}
.qa-options .opt.correct .opt-letter { background: #43a06e; color: #fff; border-color: #43a06e; }
.opt-tag { font-size: 0.74rem; font-weight: 700; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px; }
.opt-tag.ok { color: #2f8f5b; }

/* model prediction comparison */
.model-preds {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
}
.mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.mp-score { text-transform: none; letter-spacing: 0; font-size: 0.82rem; color: var(--text); }
.mitem { border-top: 1px solid var(--border); }
.mitem:first-child { border-top: none; }
.mrow {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 14px;
  font-size: 0.92rem;
  background: none;
  border: none;
  font-family: var(--font);
  text-align: left;
  cursor: pointer;
}
.mrow[disabled] { cursor: default; }
.mrow.has-note:hover { background: var(--bg-soft); }
.mname { flex: 1 1 auto; font-weight: 600; color: var(--text); }
.mpick { color: var(--muted); font-size: 0.86rem; }
.mpick b { color: var(--text); }
.mverdict { flex: 0 0 auto; width: 20px; text-align: center; }
.mrow.right .mverdict { color: #2f8f5b; }
.mrow.wrong .mverdict { color: #c4503f; }
.mrow.wrong .mpick b { color: #c4503f; }
.mchev { flex: 0 0 auto; width: 16px; text-align: center; color: var(--muted-soft); font-size: 0.78rem; transition: transform 0.16s ease; }
.mrow.open .mchev { transform: rotate(180deg); }
.mreason {
  padding: 0 14px 13px 14px;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
  background: var(--bg-soft);
  border-top: 1px dashed var(--border);
  padding-top: 11px;
}
.mreason[hidden] { display: none; }

@media (max-width: 760px) {
  .viewer-body { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Figures ---------- */
figure.fig { margin: 0 0 8px; }
figure.fig img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
figure.fig figcaption {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.55;
  text-align: left;
}
.prose { font-size: 1.04rem; text-align: justify; }
.prose + .prose { margin-top: 18px; }
.prose strong { color: var(--text); }

/* two-column: text + floating figure */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  align-items: center;
}
.split.narrow-fig { grid-template-columns: 1.1fr 0.9fr; }

/* ---------- Key finding cards ---------- */
.finding {
  margin-top: 22px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: linear-gradient(135deg, #f3f7fc 0%, #eef2f8 100%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.finding .fnum {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.finding p { margin: 2px 0 0; font-size: 1.05rem; }

/* ---------- Leaderboard ---------- */
.lb-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 auto 18px;
  max-width: 900px;
  text-align: center;
}
.lb-note .red { color: var(--red); font-weight: 700; }
.lb-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
table.lb {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
  min-width: 920px;
}
table.lb thead th {
  position: sticky;
  top: 0;
  background: #3a4250;
  color: #fff;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 12px 10px;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
table.lb thead th:first-child { text-align: left; padding-left: 18px; }
table.lb thead th .arrow { opacity: 0.5; font-size: 0.7em; margin-left: 3px; }
table.lb thead th.sorted .arrow { opacity: 1; }
table.lb tbody td {
  padding: 10px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: #3a3f49;
  white-space: nowrap;
}
table.lb tbody td:first-child { text-align: left; padding-left: 18px; font-weight: 600; color: var(--text); white-space: normal; }
table.lb tbody tr:hover td { background: var(--bg-soft); }

table.lb tr.group td {
  text-align: left;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 9px 18px;
  color: var(--text);
}
tr.group.baselines  td { background: #f3e3e1; }
tr.group.proprietary td { background: #e2e8ec; }
tr.group.opensource  td { background: #f5ecd2; }

td.best   { font-weight: 800; color: var(--text); }
td.second { text-decoration: underline; text-underline-offset: 3px; }
tr.human td { background: #fffaf0; font-weight: 700; }
tr.human td:first-child::before { content: "★ "; color: var(--aff); }
.note.red { color: var(--red); font-weight: 700; }

/* ---------- BibTeX ---------- */
.bibtex-wrap { position: relative; }
pre.bibtex {
  background: #0f1722;
  color: #d6e2f0;
  border-radius: var(--radius);
  padding: 24px 22px;
  overflow-x: auto;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 0.86rem;
  line-height: 1.6;
  margin: 0;
  white-space: pre;
}
.copy-btn {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
}
.copy-btn:hover { background: rgba(255,255,255,0.22); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 40px 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer a { font-weight: 600; }
.footer .foot-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.footer .foot-contact { margin: 0 0 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .highlights { grid-template-columns: repeat(2, 1fr); }
  .task-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .stats { grid-template-columns: repeat(2, 1fr); max-width: 420px; }
}
/* sidebar collapses to a sticky top bar */
@media (max-width: 900px) {
  .toc {
    position: sticky;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 10px 18px;
    gap: 18px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,0.88);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    z-index: 100;
  }
  .toc-brand { font-size: 1.1rem; }
  .toc-links { flex-direction: row; gap: 16px; }
  .toc-links a {
    padding: 2px 0;
    border-left: none;
    white-space: nowrap;
  }
  .toc-links a.active { border-left: none; }
  .toc-foot { display: none; }
  .page { margin-left: 0; }
  html { scroll-padding-top: 70px; }
}
@media (max-width: 820px) {
  body { font-size: 17px; }
  .split, .split.narrow-fig { grid-template-columns: 1fr; gap: 22px; }
}
@media (max-width: 560px) {
  .highlights { grid-template-columns: 1fr; }
  .task-grid { grid-template-columns: 1fr; }
  section { padding: 48px 0; }
  .stat { padding: 16px 10px; }
  .stat .num { font-size: 1.5rem; }
}
