/* ------------------------------------------------------------------ tokens */
:root {
  color-scheme: light;
  --surface: #fcfcfb;
  --surface-alt: #f4f4f1;
  --surface-card: #ffffff;
  --line: #e4e4df;
  --line-strong: #c9c9c2;
  --text: #121212;
  --text-2: #4e4d49;
  --muted: #6e6d68;            /* >= 4.5:1 on --surface, --surface-alt and white (WCAG AA small text) */
  --agentic: #4a3aa7;
  --agentic-soft: #ebe8f8;
  --base: #a8a29e;
  --base-soft: #f0eeec;
  --automl: #eb6834;
  --automl-soft: #fdeee6;
  --good: #0ca30c;
  --fam-realmlp: #2a78d6;
  --fam-mlp: #eb6834;
  --fam-lightgbm: #1baf7a;
  --fam-tabm: #eda100;
  --fam-tabicl: #e87ba4;
  --code-bg: #15151a;
  --code-fg: #e8e8ee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.05);
  --focus: 0 0 0 2px var(--surface-card), 0 0 0 4px var(--agentic);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --maxw: 1180px;
  --nav-h: 50px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 14px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--agentic); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre { font-family: var(--mono); font-size: 0.86em; }
code { background: var(--surface-alt); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre.code, .modal pre {
  background: var(--code-bg);
  color: var(--code-fg);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  line-height: 1.5;
  max-width: 100%;
}
pre.code code { background: none; color: inherit; padding: 0; font-size: 13px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.hidden { display: none !important; }
.hl { background: var(--agentic-soft); font-weight: 600; color: var(--text); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 30px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
h3.sub { margin-top: 44px; }
h4 { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 18px 0 8px; text-wrap: pretty; }
p { margin: 0 0 1em; }
ul.plain { padding-left: 18px; }
ul.plain li { margin-bottom: 6px; }

/* keyboard focus: one consistent ring for every interactive element */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--agentic); outline-offset: 2px; border-radius: 4px; }
button, select, input { font: inherit; }
button { cursor: pointer; }

/* ------------------------------------------------------------------ nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--nav-h);
  padding: 8px 24px;
  background: rgba(252,252,251,.9);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); font-size: 15px; white-space: nowrap; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px;
  background: var(--agentic); color: #fff; font-weight: 700; flex: 0 0 auto;
}
.nav-links { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a { padding: 6px 10px; border-radius: 6px; font-size: 13.5px; color: var(--text-2); font-weight: 500; white-space: nowrap; }
.nav-links a:hover { background: var(--surface-alt); text-decoration: none; color: var(--text); }
.nav-links a.active { color: var(--agentic); background: var(--agentic-soft); }
.nav-links a:focus-visible { outline-offset: 0; }
.nav-cta { border: 1px solid var(--line-strong); }
.nav-toggle {
  display: none; background: var(--surface-card); border: 1px solid var(--line-strong); border-radius: 6px;
  min-width: 40px; min-height: 36px; padding: 4px 10px; font-size: 18px; line-height: 1; color: var(--text);
}
.nav-toggle:hover { border-color: var(--agentic); color: var(--agentic); }
/* laptop: the full link row does not fit next to the brand text below ~1220px, so drop the text, keep the mark */
@media (max-width: 1240px) {
  .brand > span:not(.brand-mark) { display: none; }
  .nav-links a { padding: 6px 8px; font-size: 13px; }
}
@media (max-width: 940px) {
  .brand > span:not(.brand-mark) { display: inline; }
  .nav-toggle { display: inline-block; }
  .topnav { padding: 8px 16px; }
  /* the open menu overlays the page instead of pushing content down */
  .nav-links {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 2px; padding: 8px 10px 10px;
    background: var(--surface-card); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0,0,0,.08);
    max-height: calc(100vh - var(--nav-h)); overflow-y: auto;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 10px 12px; font-size: 15px; }
  .nav-cta { align-self: flex-start; margin-top: 4px; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 72px 0 48px; background: linear-gradient(180deg, #f6f5fb 0%, var(--surface) 100%); border-bottom: 1px solid var(--line); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 12px; font-weight: 600; color: var(--agentic); margin-bottom: 14px; }
.hero h1 { font-size: clamp(30px, 4.6vw, 52px); font-weight: 700; max-width: 900px; letter-spacing: -0.02em; }
.lede { font-size: 19px; color: var(--text-2); max-width: 820px; margin-top: 18px; }
.lede em { color: var(--text); font-style: normal; font-weight: 600; }
.authors { color: var(--muted); margin: 10px 0 22px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 36px; }
.btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface-card); color: var(--text); font-weight: 500; font-size: 14.5px; cursor: pointer;
  font-family: var(--font); line-height: 1.2;
}
.btn:hover { text-decoration: none; border-color: var(--agentic); color: var(--agentic); }
.btn:focus-visible { border-radius: 8px; }
.btn-primary { background: var(--agentic); border-color: var(--agentic); color: #fff; }
.btn-primary:hover { color: #fff; background: #3d2f90; }
.btn-small { padding: 6px 10px; font-size: 13px; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; color: var(--agentic); overflow-wrap: anywhere; }
.stat-label { font-size: 13.5px; color: var(--text-2); margin-top: 6px; line-height: 1.35; }
.stat-row-sm .stat-value { font-size: 22px; }
.stat-row-sm .stat { padding: 10px 14px; }
.stat-row-sm { margin-bottom: 14px; }

/* ------------------------------------------------------------------ sections */
.section { padding: 72px 0; }
.section-alt { background: var(--surface-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-num { font-family: var(--mono); color: var(--agentic); font-size: 13px; font-weight: 600; margin-bottom: 6px; letter-spacing: .08em; }
.section-intro { color: var(--text-2); max-width: 760px; font-size: 16.5px; }
.caption { color: var(--text-2); font-size: 14px; max-width: 860px; border-left: 3px solid var(--line-strong); padding-left: 12px; margin-top: 14px; }
.callout { background: var(--agentic-soft); border: 1px solid #d8d2f1; border-radius: var(--radius); padding: 16px 18px; margin-top: 28px; font-size: 15px; }
.callout code { background: rgba(255,255,255,.7); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-top: 12px; }
/* grid items default to min-width:auto, so a wide table, <pre> or chart would blow the column (and the page) out */
.two-col > *, .method-cols > *, .ds-grid > *, .explorer-grid > *, .paradigms > * { min-width: 0; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }

/* ------------------------------------------------------------------ paradigms */
.paradigms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
@media (max-width: 900px) { .paradigms { grid-template-columns: 1fr; } }
.paradigm { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.paradigm h3 { font-size: 17px; }
.paradigm-ours { border-color: var(--agentic); box-shadow: 0 0 0 3px var(--agentic-soft); }
.paradigm p { font-size: 14.5px; color: var(--text-2); }
.pm { list-style: none; padding: 0; margin: 0 0 12px; flex: 1; }
.pm li { font-size: 14px; padding-left: 22px; position: relative; margin-bottom: 4px; }
.pm li::before { position: absolute; left: 0; font-weight: 700; }
.pm li.plus::before { content: "+"; color: var(--good); }
.pm li.minus::before { content: "−"; color: var(--automl); }
.paradigm-metric { font-size: 14px; border-top: 1px solid var(--line); padding-top: 10px; margin: 0; color: var(--text-2); }
.paradigm-metric strong { color: var(--text); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 5px; margin-right: 6px; vertical-align: middle; }
.tag-base { background: var(--base-soft); color: #6b6560; }
.tag-automl { background: var(--automl-soft); color: #b54818; }
.tag-agentic { background: var(--agentic-soft); color: var(--agentic); }

/* ------------------------------------------------------------------ controls */
.controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; margin: 14px 0 12px; }
.control-label { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface-card); flex-wrap: wrap; max-width: 100%; }
.seg button {
  border: 0; background: transparent; padding: 7px 12px; min-height: 32px; font-size: 13.5px; line-height: 1.2; cursor: pointer; font-family: var(--font); color: var(--text-2);
  border-right: 1px solid var(--line); white-space: nowrap;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-alt); color: var(--text); }
.seg button.active { background: var(--agentic); color: #fff; }
.seg button.active:hover { background: #3d2f90; }
.seg button:focus-visible { outline-offset: -2px; border-radius: 0; }
.seg button.active:focus-visible { outline-color: #fff; outline-offset: -3px; }
.seg button .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
select { font-family: var(--font); font-size: 14px; padding: 7px 10px; min-height: 34px; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface-card); color: var(--text); max-width: min(360px, 100%); }
select:hover { border-color: var(--agentic); }
.check { font-size: 13.5px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 28px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--agentic); cursor: pointer; }
.slider { width: 280px; max-width: 100%; accent-color: var(--agentic); margin: 0; }
.slider-value { font-family: var(--mono); font-size: 13px; min-width: 40px; }

/* ------------------------------------------------------------------ charts & tables */
/* The frame is an inset shadow, not a border: Plotly reads the container's border-box height when it
   autosizes, and a border would make every resize grow the chart by 2px. */
.chart { width: 100%; min-height: 360px; background: var(--surface-card); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--radius); margin: 8px 0 12px; }
.chart-tall { min-height: 560px; }
.chart-sm { min-height: 280px; }
.chart-auto { min-height: 120px; }
/* once Plotly has rendered, the layout height is the truth; a larger min-height would leave blank space under the plot */
.chart.js-plotly-plot { min-height: 0; }
/* Plotly's responsive handler deletes layout.height and sets its .svg-container to height:100%, which is
   indefinite here and lets the drawn SVG overflow the collapsed box. Keeping the first SVG layer in normal
   flow gives the container a definite content height, so autosize reads the right number on every resize. */
.chart .svg-container > .main-svg:first-child { position: relative !important; display: block; }
.legend-inline { font-size: 13px; line-height: 1.9; }
.table-wrap { overflow-x: auto; margin: 8px 0 12px; max-width: 100%; }
.data-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); }
.data-table th, .data-table td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.data-table th:first-child, .data-table td:first-child, .data-table td.left, .data-table th.left { text-align: left; }
.data-table thead th { background: var(--surface-alt); font-weight: 600; color: var(--text-2); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; }
.data-table thead tr:first-child th:first-child { border-top-left-radius: calc(var(--radius) - 1px); }
.data-table thead tr:first-child th:last-child { border-top-right-radius: calc(var(--radius) - 1px); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: #fafaf7; }
.data-table tbody tr:hover td.hl { background: #e3dff5; }
.data-table.compact td, .data-table.compact th { padding: 5px 8px; }
.mini-table { border-collapse: collapse; width: 100%; font-size: 14px; margin-top: 10px; }
.mini-table th, .mini-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.mini-table th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.mini-table td:first-child { font-weight: 600; color: var(--text-2); width: 90px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.badge-agentic { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--agentic-soft); color: var(--agentic); font-size: 11px; font-weight: 600; margin-left: 6px; }
.badge-base { display: inline-block; padding: 1px 6px; border-radius: 4px; background: var(--base-soft); color: #6b6560; font-size: 11px; font-weight: 600; margin-left: 6px; }

/* ------------------------------------------------------------------ method diagram */
.method-diagram { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin: 8px 0 28px; overflow-x: auto; }
.method-diagram svg { display: block; width: 100%; height: auto; min-width: 760px; font-family: var(--font); }
.method-diagram .box { fill: #fff; stroke: var(--line-strong); stroke-width: 1.2; rx: 8; }
.method-diagram .box-agent { fill: var(--agentic-soft); stroke: var(--agentic); }
.method-diagram .box-hpo { fill: #e8f1fb; stroke: var(--fam-realmlp); }
.method-diagram .box-out { fill: #e9f7f1; stroke: var(--fam-lightgbm); }
.method-diagram .stage { fill: #fff; stroke: var(--line-strong); stroke-width: 1; rx: 6; cursor: pointer; transition: fill .15s; }
.method-diagram .stage:hover, .method-diagram .stage.hot { fill: var(--agentic-soft); stroke: var(--agentic); }
.method-diagram text { fill: var(--text); font-size: 12.5px; }
.method-diagram text.title { font-weight: 600; font-size: 13.5px; }
.method-diagram text.small { font-size: 11px; fill: var(--muted); }
.method-diagram text.count { font-family: var(--mono); font-size: 11px; fill: var(--agentic); font-weight: 600; }
.method-diagram .arrow { stroke: var(--line-strong); stroke-width: 1.4; fill: none; marker-end: url(#arrowhead); }
.method-diagram .divider { stroke: var(--line-strong); stroke-dasharray: 4 4; }
.method-diagram text.label-stage { font-size: 11.5px; fill: var(--text-2); font-weight: 600; letter-spacing: .04em; }
.method-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 860px) { .method-cols { grid-template-columns: 1fr; } }
.loop-steps li { margin-bottom: 8px; }
.math { font-family: var(--mono); font-size: 13px; background: var(--surface-card); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line); overflow-wrap: anywhere; }
/* the tip sits inside the scroll box; keep it in view while the diagram is scrolled sideways */
.method-tip { font-size: 13px; color: var(--text-2); margin: 4px 6px 0; min-height: 20px; position: sticky; left: 0; }
@media (max-width: 820px) {
  .method-diagram::before { content: "The diagram scrolls sideways \2192"; display: block; position: sticky; left: 0; font-size: 11.5px; color: var(--muted); margin: 0 6px 2px; }
}

/* ------------------------------------------------------------------ explorer */
.explorer-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.explorer-summary { font-size: 14px; color: var(--text-2); }
.explorer-stages { display: flex; flex-direction: column; gap: 10px; }
.stage-row { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.stage-row-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; margin-bottom: 6px; }
.stage-row-head h4 { margin: 0; font-size: 14px; color: var(--text); }
.stage-row-head .muted { font-size: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 6px; min-height: 28px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface-card); font-size: 12.5px; cursor: pointer; line-height: 1.2; font-family: var(--font); color: var(--text); text-align: left;
}
.chip:hover { border-color: var(--agentic); background: var(--agentic-soft); }
.chip:focus-visible { border-radius: 999px; }
.chip.active { background: var(--agentic); color: #fff; border-color: var(--agentic); }
.chip.active .idx { background: rgba(255,255,255,.25); color: #fff; }
.chip.active .wins, .chip.active .task-tag { color: #fff; }
.chip.base { border-style: dashed; }
.chip .idx { font-family: var(--mono); font-size: 10.5px; background: var(--surface-alt); color: var(--text-2); padding: 1px 5px; border-radius: 999px; }
.chip .wins { font-family: var(--mono); font-size: 10.5px; color: var(--agentic); font-weight: 600; }
.chip.task { opacity: .95; }
.chip .task-tag { font-size: 10.5px; color: var(--muted); }
.explorer-detail { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: sticky; top: calc(var(--nav-h) + 16px); max-height: calc(100vh - var(--nav-h) - 32px); overflow: auto; }
.detail-empty { color: var(--muted); font-size: 14px; padding: 20px 0; text-align: center; }
.detail-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; overflow-wrap: anywhere; }
.detail-meta { font-size: 12.5px; color: var(--muted); font-family: var(--mono); margin-bottom: 10px; word-break: break-all; }
.detail-doc { font-size: 14px; color: var(--text-2); margin-bottom: 10px; }
.detail-datasets { font-size: 12.5px; color: var(--text-2); margin-bottom: 10px; }
.detail-datasets span { display: inline-block; background: var(--surface-alt); border-radius: 4px; padding: 1px 6px; margin: 2px 3px 2px 0; }
.detail-datasets span:hover { background: var(--agentic-soft); color: var(--agentic); }
.explorer-detail pre { margin: 0; max-height: 420px; overflow: auto; font-size: 12px; border-radius: 8px; background: var(--code-bg); }
.explorer-detail pre code { font-size: 12px; }
@media (max-width: 960px) {
  .explorer-grid { grid-template-columns: 1fr; }
  /* single column: pin the detail pane above the chip list so a tap shows its result without scrolling back */
  .explorer-detail { order: -1; top: calc(var(--nav-h) + 8px); max-height: 46vh; z-index: 5; }
  .explorer-detail pre { max-height: none; }
}

/* ------------------------------------------------------------------ dataset card */
.ds-card { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.ds-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 18px; margin-bottom: 8px; }
.ds-head .ds-name { font-size: 22px; font-weight: 700; }
.ds-head .ds-meta { color: var(--text-2); font-size: 14px; }
.ds-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .ds-grid { grid-template-columns: 1fr; } }
.pipeline-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.pipe-stage { background: var(--surface-alt); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; cursor: pointer; min-width: 0; }
.pipe-stage:hover { border-color: var(--agentic); background: var(--agentic-soft); }
.pipe-stage:focus-visible { border-radius: 8px; }
.pipe-stage.is-agentic { border-color: var(--agentic); background: #fff; box-shadow: inset 0 0 0 2px var(--agentic-soft); }
.pipe-stage .ps-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pipe-stage .ps-name { font-size: 13.5px; font-weight: 600; margin-top: 2px; overflow-wrap: anywhere; }
.pipe-stage .ps-idx { font-family: var(--mono); font-size: 11px; color: var(--text-2); }
.ds-params { font-family: var(--mono); font-size: 12px; color: var(--text-2); background: var(--surface-alt); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; word-break: break-word; }
.ds-params b { color: var(--text); font-weight: 500; }

/* ------------------------------------------------------------------ accordion (prompts) */
.accordion { display: flex; flex-direction: column; gap: 8px; }
.acc-item { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); }
.acc-head { width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radius); padding: 12px 16px; font-family: var(--font); font-size: 15px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--text); }
.acc-head:hover { background: var(--surface-alt); }
.acc-head:focus-visible { outline-offset: -2px; border-radius: var(--radius); }
.acc-head .muted { font-weight: 400; font-size: 13px; }
.acc-head > .muted:last-child { flex: 0 0 auto; font-size: 18px; line-height: 1; }
.acc-item.open .acc-head { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.acc-body { display: none; padding: 0 20px 18px; border-top: 1px solid var(--line); }
.acc-item.open .acc-body { display: block; }
.md { font-size: 14.5px; color: var(--text-2); }
.md h1, .md h2, .md h3 { color: var(--text); margin-top: 1.2em; font-size: 16px; }
.md h1 { font-size: 18px; }
.md pre { background: var(--code-bg); color: var(--code-fg); padding: 10px 12px; border-radius: 8px; overflow-x: auto; }
.md pre code { background: none; color: inherit; font-size: 12.5px; }
.md code { font-size: 12.5px; }
.md hr { border: 0; border-top: 1px solid var(--line); }
.frontmatter { font-family: var(--mono); font-size: 12px; color: var(--muted); background: var(--surface-alt); border-radius: 6px; padding: 8px 10px; margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ------------------------------------------------------------------ modal */
.modal { position: fixed; inset: 0; background: rgba(10,10,12,.55); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { background: var(--surface-card); border-radius: 12px; max-width: 980px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 14px 18px 8px; gap: 12px; }
.modal-head > div { min-width: 0; }
.modal-head strong, .modal-head .small { overflow-wrap: anywhere; }
.modal-head .btn { flex: 0 0 auto; }
.modal-doc { padding: 0 18px 8px; font-size: 14px; color: var(--text-2); margin: 0; max-height: 30vh; overflow: auto; }
.modal pre { margin: 0; border-radius: 0; flex: 1; min-height: 0; overflow: auto; }
.modal pre code { font-size: 12.5px; background: none; }
.modal pre code.hljs { padding: 0; }
@media (max-width: 600px) {
  .modal { padding: 0; align-items: stretch; }
  .modal-box { max-width: none; max-height: none; height: 100%; border-radius: 0; }
  .modal pre { padding: 12px 14px; }
  .modal pre code { font-size: 12px; }
}

/* ------------------------------------------------------------------ footer */
.footer { padding: 36px 0 48px; border-top: 1px solid var(--line); color: var(--text-2); font-size: 14px; }

/* ------------------------------------------------------------------ highlight.js on the dark code surfaces */
/* The vendor theme (GitHub light) is loaded first; every token class it colours is re-coloured here so
   nothing falls back to a dark-on-dark value. All colours are >= 4.5:1 against #15151a. */
pre code.hljs { background: var(--code-bg); color: var(--code-fg); padding: 14px 16px; }
.hljs { background: var(--code-bg); color: var(--code-fg); }
.hljs-keyword, .hljs-doctag, .hljs-template-tag, .hljs-template-variable, .hljs-variable.language_, .hljs-selector-tag { color: #c792ea; }
.hljs-string, .hljs-meta .hljs-string, .hljs-regexp, .hljs-addition, .hljs-quote, .hljs-name { color: #c3e88d; }
.hljs-number, .hljs-literal, .hljs-deletion { color: #f78c6c; }
.hljs-comment, .hljs-code, .hljs-formula { color: #8b95ad; font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #82aaff; }
.hljs-title.class_, .hljs-title.class_.inherited__, .hljs-type, .hljs-built_in, .hljs-bullet { color: #ffcb6b; }
.hljs-attr, .hljs-attribute, .hljs-variable, .hljs-selector-attr, .hljs-selector-class, .hljs-selector-id, .hljs-property { color: #f07178; }
.hljs-meta, .hljs-operator, .hljs-symbol, .hljs-selector-pseudo { color: #89ddff; }
.hljs-params, .hljs-subst, .hljs-punctuation, .hljs-emphasis, .hljs-strong { color: var(--code-fg); }
.hljs-emphasis { font-style: italic; }
.hljs-strong, .hljs-section { font-weight: 700; }
.hljs-addition { background: rgba(195,232,141,.12); }
.hljs-deletion { background: rgba(247,140,108,.14); }

/* ------------------------------------------------------------------ small screens */
/* tables placed directly in a column without a .table-wrap: hug their content and scroll inside the column
   instead of widening it (the three bare tables in #results and #ablations). Wrapping them in .table-wrap
   in the HTML makes this rule redundant. */
.two-col > div > table.data-table { display: block; width: max-content; max-width: 100%; overflow-x: auto; }
@media (max-width: 600px) {
  .container { padding: 0 18px; }
  .section { padding: 48px 0; }
  .hero { padding: 44px 0 36px; }
  .hero-actions { margin-bottom: 28px; }
  h2 { font-size: 26px; }
  h3 { font-size: 18px; }
  h3.sub { margin-top: 36px; }
  .lede { font-size: 17px; }
  .section-intro { font-size: 15.5px; }
  .stat-row { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .stat { padding: 12px 14px; }
  .stat-value { font-size: 26px; }
  .stat-row-sm .stat-value { font-size: 20px; }
  .callout { padding: 14px 16px; font-size: 14.5px; }
  .paradigm { padding: 16px; }
  .ds-card { padding: 14px; }
  .ds-head .ds-name { font-size: 20px; }
  .stage-row { padding: 10px; }
  .explorer-detail { padding: 12px; }
  /* wrapping segmented controls read better as a row of pills than as a ragged bordered box */
  .seg { border: 0; background: none; border-radius: 0; overflow: visible; gap: 6px; }
  .seg button { border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface-card); padding: 6px 11px; }
  .seg button:last-child { border-right: 1px solid var(--line-strong); }
  .seg button.active { border-color: var(--agentic); }
  .seg button:focus-visible { outline-offset: 2px; border-radius: 8px; }
  .seg button.active:focus-visible { outline-color: var(--agentic); }
  select { width: 100%; max-width: none; }
  .slider { flex: 1 1 160px; width: auto; }
  pre.code code, .md pre code { font-size: 12.5px; }
  .data-table, .data-table.compact { font-size: 13px; }
}

/* ------------------------------------------------------------------ motion & print */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}
@media print {
  .topnav, .controls, .nav-toggle, .hero-actions, .modal, .btn, .check, .method-tip, .method-diagram::before, .legend-inline + .caption:empty { display: none !important; }
  body { background: #fff; color: #000; }
  .hero, .section-alt { background: #fff; }
  .section { padding: 24px 0; }
  a { color: inherit; text-decoration: underline; }
  .explorer-detail { position: static; max-height: none; order: 0; }
  .acc-body { display: block !important; }
  .chart, .paradigm, .ds-card, .stat, .callout, .table-wrap, .acc-item, .stage-row, .method-diagram { break-inside: avoid; }
  .chart, .paradigm, .ds-card { box-shadow: none; border: 1px solid #ccc; }
  pre.code, .modal pre, .md pre, pre code.hljs, .explorer-detail pre, .hljs { background: #f4f4f1 !important; color: #121212 !important; }
  .hljs-keyword, .hljs-string, .hljs-number, .hljs-comment, .hljs-title, .hljs-built_in, .hljs-meta, .hljs-literal, .hljs-type, .hljs-attr, .hljs-variable, .hljs-operator { color: #121212 !important; }
}

/* inline HTML legends under charts */
.legend-inline { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: -4px 0 12px 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-item .swatch { margin-right: 0; }
.legend-line { display: inline-block; width: 18px; height: 0; }
.legend-note { color: var(--muted); }

/* ------------------------------------------------------------------ overview page */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 24px 0 20px; }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.step h3 { font-size: 17px; margin: 10px 0 6px; }
.step p { font-size: 14.5px; color: var(--text-2); margin: 0; }
.step-num { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-alt); color: var(--text-2); font-weight: 700; font-size: 14px; }
.step-agent .step-num { background: var(--agentic); color: #fff; }
.step-hpo .step-num { background: #e8f1fb; color: var(--fam-realmlp); }
.controls-tight { margin-top: 4px; }
.takeaways { list-style: none; padding: 0; margin: 10px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 860px) { .takeaways { grid-template-columns: 1fr; } }
.takeaways li { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 14.5px; color: var(--text-2); }
.takeaways li strong { display: block; color: var(--text); margin-bottom: 2px; }
.spotlight { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: center; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-top: 28px; box-shadow: var(--shadow); }
@media (max-width: 860px) { .spotlight { grid-template-columns: 1fr; } }
.spotlight h3 { font-size: 24px; margin: 2px 0 8px; }
.spotlight p { font-size: 15px; color: var(--text-2); margin: 0; }
.spotlight .chart { margin: 0; min-height: 200px; }
.dropdown { margin-top: 20px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); }
.dropdown summary { cursor: pointer; padding: 14px 18px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.dropdown summary::-webkit-details-marker { display: none; }
.dropdown summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.dropdown[open] summary::after { transform: rotate(180deg); }
.dropdown summary:hover { color: var(--agentic); }
.dropdown-body { padding: 0 18px 16px; border-top: 1px solid var(--line); }
.dropdown-body .pipeline-strip { margin-top: 12px; }
.more-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 960px) { .more-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .more-grid { grid-template-columns: 1fr; } }
.more-card { display: flex; flex-direction: column; gap: 4px; background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; color: var(--text); font-size: 14px; }
.more-card:hover { text-decoration: none; border-color: var(--agentic); }
.more-card strong { font-size: 15px; }
.more-card span { color: var(--text-2); }
.pipe-stage { text-align: left; font-family: var(--font); }
body.lite .section { padding: 56px 0; }

/* ------------------------------------------------------------------ hero figure */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 40px; align-items: center; }
@media (max-width: 960px) { .hero-grid { grid-template-columns: 1fr; gap: 28px; } }
.hero-grid .hero-actions { margin-bottom: 0; }
.hero-fig { margin: 0; background: var(--surface-card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 10px; box-shadow: var(--shadow); min-width: 0; }
.hero-fig-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.hero-fig-title { font-weight: 600; font-size: 14px; color: var(--text); }
.hero-ds { background: none; border: 0; padding: 0; text-align: left; font-family: var(--font); font-size: 13.5px; color: var(--text-2); cursor: pointer; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.hero-ds .nm { font-weight: 600; color: var(--text); }
.hero-ds:hover .nm { color: var(--agentic); text-decoration: underline; }
.delta-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-pill.pos { background: #e3f6e3; color: #0a6b0a; }
.delta-pill.neg { background: #fbe5e2; color: #a52a1e; }
.delta-pill.zero { background: var(--surface-alt); color: var(--text-2); }
.hero-chart { width: 100%; min-height: 280px; }
.hero-chart svg { display: block; width: 100%; height: auto; }
.hero-fig-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-2); border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; }
.hero-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.hero-legend .k { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hero-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.hero-legend .sw.ring { border: 1.6px solid var(--base); background: #fff; }
.hero-legend .sw.dot { background: var(--agentic); opacity: .55; }
.hero-legend .sw.dot.kept { background: var(--base); opacity: 1; }
.hero-legend .sw.line { width: 16px; height: 0; border-top: 2.5px solid var(--agentic); border-radius: 0; }
.hero-ctl { display: inline-flex; align-items: center; gap: 6px; }
.hero-ctl .muted { font-variant-numeric: tabular-nums; }
.mini { background: var(--surface-card); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 8px; font-size: 12px; font-family: var(--font); color: var(--text-2); cursor: pointer; line-height: 1.5; }
.mini:hover { border-color: var(--agentic); color: var(--agentic); }
.hero-legend .sw.ring.dashed { border-style: dashed; border-color: var(--muted); }
.authors { margin-bottom: 4px; }
.authors sup, .affiliations sup { font-size: 10px; color: var(--agentic); margin-left: 1px; }
.affiliations { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.authors span { white-space: nowrap; }
