/* MedTex-LLM project page.
   Colour roles are tokens; dark mode is its own set of steps, not a flip. */

:root {
  color-scheme: light;
  --page: #f6f5f1;
  --surface: #fcfcfb;
  --surface-2: #f0efea;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --ink-3: #75736d;
  --hair: #e1e0d9;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);

  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: rgba(42, 120, 214, 0.10);

  /* walkthrough: the two ICD-O axes */
  --topo: #2a78d6;
  --topo-wash: rgba(42, 120, 214, 0.16);
  --morph: #d95926;
  --morph-wash: rgba(235, 104, 52, 0.18);

  /* charts */
  --c-expert: #52514e;
  --c-direct: #b9b7af;
  --c-codebook: #8a8882;
  --c-pipeline: #2a78d6;
  --c-small: #86b6ef;
  --c-large: #1c5cab;
  --c-help: #2a78d6;
  --c-hurt: #e34948;
  --noise: rgba(137, 135, 129, 0.16);
  --t-ex: #1c5cab;
  --t-rr: #86b6ef;
  --t-ot: #75736d;

  --good: #006300;
  --bad: #b42323;

  --radius: 10px;
  --maxw: 1080px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d;
    --surface: #1a1a19;
    --surface-2: #232321;
    --ink: #f0efec;
    --ink-2: #c3c2b7;
    --ink-3: #9a9890;
    --hair: #2c2c2a;
    --axis: #44443f;
    --border: rgba(255, 255, 255, 0.10);
    --accent: #3987e5;
    --accent-ink: #86b6ef;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --topo: #5598e7;
    --topo-wash: rgba(57, 135, 229, 0.24);
    --morph: #e8774a;
    --morph-wash: rgba(217, 89, 38, 0.26);
    --c-expert: #85837c;
    --c-direct: #55544f;
    --c-codebook: #6f6e68;
    --c-pipeline: #3987e5;
    --c-small: #2a78d6;
    --c-large: #9ec5f4;
    --t-ex: #3987e5;
    --t-rr: #b7d3f6;
    --t-ot: #6f6e68;
    --c-help: #3987e5;
    --c-hurt: #e66767;
    --noise: rgba(137, 135, 129, 0.20);
    --good: #3fbf3f;
    --bad: #ef7d7d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d;
  --surface: #1a1a19;
  --surface-2: #232321;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --ink-3: #9a9890;
  --hair: #2c2c2a;
  --axis: #44443f;
  --border: rgba(255, 255, 255, 0.10);
  --accent: #3987e5;
  --accent-ink: #86b6ef;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --topo: #5598e7;
  --topo-wash: rgba(57, 135, 229, 0.24);
  --morph: #e8774a;
  --morph-wash: rgba(217, 89, 38, 0.26);
  --c-expert: #85837c;
  --c-direct: #55544f;
  --c-codebook: #6f6e68;
  --c-pipeline: #3987e5;
  --c-small: #2a78d6;
  --c-large: #9ec5f4;
  --t-ex: #3987e5;
  --t-rr: #b7d3f6;
  --t-ot: #6f6e68;
  --c-help: #3987e5;
  --c-hurt: #e66767;
  --noise: rgba(137, 135, 129, 0.20);
  --good: #3fbf3f;
  --bad: #ef7d7d;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--accent-ink); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- nav ---------- */
.topnav {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topnav .wrap { display: flex; align-items: center; gap: 20px; height: 52px; }
.topnav .brand { font-weight: 650; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.topnav ul {
  list-style: none; margin: 0; padding: 0; display: flex; gap: 2px;
  overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.topnav ul::-webkit-scrollbar { display: none; }
.topnav li a {
  display: block; padding: 6px 10px; border-radius: 6px; white-space: nowrap;
  color: var(--ink-2); text-decoration: none; font-size: 14px;
}
.topnav li a:hover { background: var(--surface-2); color: var(--ink); }
.topnav li a[aria-current="true"] { color: var(--ink); background: var(--surface-2); }

/* ---------- hero ---------- */
.hero { padding: 72px 0 40px; text-align: center; }
.eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px;
  margin-bottom: 20px; background: var(--surface);
}
.hero h1 { font-size: clamp(44px, 8vw, 72px); font-weight: 750; letter-spacing: -0.035em; }
.hero h1 .llm { color: var(--accent); }
.hero .subtitle {
  font-size: clamp(19px, 2.6vw, 25px); line-height: 1.35; color: var(--ink);
  max-width: 760px; margin: 14px auto 22px; font-weight: 500; letter-spacing: -0.01em;
}
.authors { font-size: 17px; margin-bottom: 4px; }
.authors .todo, .affil .todo { color: var(--ink-3); }
.affil { color: var(--ink-2); font-size: 15px; }
.affil.emails { font-size: 14px; margin-top: 2px; }
.affil.emails a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.authors .sep, .affil .sep { margin: 0 0.6em; color: var(--ink-3); }
.affil.emails a:hover { color: var(--accent-ink); text-decoration: underline; }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 26px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px; font-size: 15px; font-weight: 550;
  background: var(--ink); color: var(--page); text-decoration: none; border: 1px solid var(--ink);
}
.btn:hover { opacity: 0.88; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn svg { width: 16px; height: 16px; }
.btn[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

/* ---------- sections ---------- */
section.block { padding: 56px 0; border-top: 1px solid var(--border); }
section.block:first-of-type { border-top: 0; }
.section-head { max-width: 760px; margin-bottom: 28px; }
.kicker { font-size: 13px; font-weight: 600; color: var(--accent-ink); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 8px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 34px); letter-spacing: -0.02em; margin-bottom: 12px; font-weight: 700; }
.section-head p { color: var(--ink-2); font-size: 17px; }
.lede { font-size: 19px; line-height: 1.55; max-width: 780px; }
.note { font-size: 14px; color: var(--ink-2); }
.muted { color: var(--ink-3); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px;
}

/* ---------- stat tiles ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 28px; }
@media (max-width: 880px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpis { grid-template-columns: 1fr; } }
.kpi { padding: 18px 18px 16px; }
.kpi .label { font-size: 14px; color: var(--ink-2); margin-bottom: 6px; }
.kpi .value { font-size: 36px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .value small { font-size: 18px; font-weight: 550; color: var(--ink-2); margin-left: 2px; }
.kpi .sub { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; line-height: 1.45; }

/* ---------- problem ---------- */
.three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 820px) { .three { grid-template-columns: minmax(0, 1fr); } }
.three h3 { font-size: 17px; margin-bottom: 8px; }
.three p { color: var(--ink-2); font-size: 15px; margin: 0; }
.big-num { font-size: 30px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 4px; }

/* ---------- pipeline diagram ---------- */
.pipeline {
  display: grid; grid-template-columns: minmax(0, 0.8fr) repeat(4, minmax(0, 1fr)) minmax(0, 0.8fr);
  gap: 0; align-items: stretch; margin-top: 8px;
}
.pipeline > * { position: relative; margin: 0 8px; }
/* one connector after every box but the last, so input and output join the chain */
.pipeline > :not(:last-child)::after {
  content: ""; position: absolute; right: -13px; top: 50%; width: 10px; height: 10px;
  border-top: 1.5px solid var(--axis); border-right: 1.5px solid var(--axis);
  transform: translateY(-50%) rotate(45deg);
}
.pipe-io {
  display: flex; flex-direction: column; gap: 8px; padding: 14px 14px 12px;
  background: var(--surface-2); border: 1px dashed var(--axis); border-radius: var(--radius);
}
.pipe-io .io-label { font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.pipe-io .excerpt {
  font: 12px/1.5 var(--mono); color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden;
}
.pipe-io .io-codes { display: flex; flex-direction: column; gap: 8px; }
.pipe-io .io-code b { display: block; font: 600 15px/1.3 var(--mono); color: var(--ink); }
.pipe-io .io-code span { display: block; font-size: 12px; line-height: 1.35; color: var(--ink-2); }
.pipe-io .io-foot { margin-top: auto; font-size: 12px; color: var(--ink-3); }
.stage {
  text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.stage:hover { border-color: var(--accent); }
.stage .num {
  font-size: 12px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3);
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; white-space: nowrap;
}
.badge {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; text-transform: none;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2);
}
.badge.llm { background: var(--accent-wash); color: var(--accent-ink); }
.stage h3 { font-size: 18px; }
.stage p { font-size: 14px; color: var(--ink-2); margin: 0; line-height: 1.5; }
@media (max-width: 900px) {
  .pipeline { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pipeline > * { margin: 0; }
  .pipeline > :not(:last-child)::after { right: auto; left: 24px; top: auto; bottom: -11px; transform: rotate(135deg); }
  .pipe-io .excerpt { -webkit-line-clamp: 4; }
  .stage .num { flex-direction: row; justify-content: space-between; align-items: center; }
}
.calls-strip { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-2); }
.calls-strip b { color: var(--ink); }

/* ---------- segmented controls ---------- */
.controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 16px; }
.seg {
  display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px;
}
.seg button {
  font: inherit; font-size: 14px; border: 0; background: transparent; color: var(--ink-2);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(0, 0, 0, 0.06);
}
.ctl-label { font-size: 13px; color: var(--ink-3); margin-right: -8px; }

/* ---------- walkthrough ---------- */
.wt-tabs { margin-bottom: 18px; }
.wt-grid { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
@media (max-width: 920px) { .wt-grid { grid-template-columns: minmax(0, 1fr); } }
.wt-report { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.wt-report.pinned { position: sticky; top: 68px; }
.wt-report header {
  padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between;
  gap: 10px; align-items: baseline; flex-wrap: wrap;
}
.wt-report header h3 { font-size: 16px; }
.wt-report header .meta { font-size: 13px; color: var(--ink-3); }
.wt-text {
  margin: 0; padding: 16px 18px 20px; white-space: pre-wrap; word-wrap: break-word;
  font: 13.5px/1.62 var(--mono); color: var(--ink);
}
.wt-text .hd { font-weight: 700; }
mark.q { color: inherit; border-radius: 3px; padding: 1px 0; }
mark.q-site { background: var(--topo-wash); box-shadow: inset 0 -2px 0 var(--topo); }
mark.q-histo { background: var(--morph-wash); box-shadow: inset 0 -2px 0 var(--morph); }
mark.q.loose { background: none; box-shadow: none; text-decoration: underline dotted 2px; text-underline-offset: 3px; }
mark.q-site.loose { text-decoration-color: var(--topo); }
mark.q-histo.loose { text-decoration-color: var(--morph); }
.legend-inline { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--ink-2); padding: 10px 18px; border-top: 1px solid var(--border); }
.key { display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 14px; height: 10px; border-radius: 2px; }
.key i.topo { background: var(--topo-wash); box-shadow: inset 0 -2px 0 var(--topo); }
.key i.morph { background: var(--morph-wash); box-shadow: inset 0 -2px 0 var(--morph); }
.key i.loose { background: none; box-shadow: none; border-bottom: 2px dotted var(--topo); border-radius: 0; height: 8px; }
.key i.morph.loose { border-bottom-color: var(--morph); }

.wt-stages { display: flex; flex-direction: column; gap: 12px; }
.wt-stage { padding: 16px 18px; scroll-margin-top: 72px; }
.wt-stage.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 3px var(--accent); } 100% { box-shadow: 0 0 0 0 transparent; } }
.wt-stage > header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.wt-stage > header h3 { font-size: 15.5px; }
.wt-stage > header h3 .n { color: var(--ink-3); font-weight: 600; margin-right: 6px; }
.wt-stage > header .t { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.stage-note {
  font-size: 13px; line-height: 1.45; color: var(--ink-2); background: var(--accent-wash);
  border-radius: 7px; padding: 7px 10px; margin: -2px 0 8px;
}
.axis-row { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 12px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--hair); }
.axis-row:first-of-type { border-top: 0; }
.axis-name { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.axis-name::before { content: ""; width: 10px; height: 3px; border-radius: 2px; flex: none; }
.axis-name.topo::before { background: var(--topo); }
.axis-name.morph::before { background: var(--morph); }
.s1-table { display: grid; grid-template-columns: 92px minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px 12px; align-items: baseline; }
.s1-head { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.s1-cell .phrase { font-size: 14.5px; overflow-wrap: break-word; }
.s1-cell .phrase.term { font-weight: 600; }
.s1-behaviour { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 12px; align-items: baseline; font-size: 14px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.s1-behaviour .axis-name::before { background: var(--ink-3); }
@media (max-width: 560px) {
  .s1-table { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .s1-head { display: none; }
  .s1-table .axis-name { margin-top: 8px; }
  .s1-cell[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-3); }
  .s1-behaviour { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}
.phrase { font-size: 15px; overflow-wrap: anywhere; }
.axis-row > div { min-width: 0; }
@media (max-width: 480px) { .axis-row { grid-template-columns: 1fr; gap: 2px; } }
.phrase .arrow { color: var(--ink-3); margin: 0 6px; }
.phrase .term { font-weight: 600; }
.phrase .plain { color: var(--ink-2); }
.code {
  font-family: var(--mono); font-size: 13px; padding: 1px 6px; border-radius: 5px;
  background: var(--surface-2); color: var(--ink); white-space: nowrap;
}
.code.changed { background: var(--accent-wash); color: var(--accent-ink); font-weight: 600; }
.code.ok { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--good) 50%, transparent); }
.small-note { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

.cands { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13.5px; }
.cands li {
  display: grid; grid-template-columns: 18px 64px minmax(0, 1fr) 44px; gap: 8px; align-items: center;
  padding: 3px 6px; border-radius: 6px;
}
.cands li[hidden] { display: none; }
.cands li .rk { color: var(--ink-3); font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.cands li .cc { font-family: var(--mono); font-size: 12.5px; }
.cands li .tm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.cands li .sc { font-size: 12px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.cands li.top1 .rk { color: var(--ink); font-weight: 700; }
.cands li.pick { background: var(--accent-wash); }
.cands li.pick .tm { color: var(--ink); }
.cands li.pick .cc { font-weight: 700; color: var(--accent-ink); }
.cands li.gold .cc::after { content: " ✓"; color: var(--good); font-family: var(--font); }
.cands-more {
  font: inherit; font-size: 12.5px; color: var(--accent-ink); background: none; border: 0; padding: 4px 6px; cursor: pointer;
}
.cands-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-3); margin-top: 8px; }
.cands-legend .sw { display: inline-block; width: 12px; height: 10px; border-radius: 3px; background: var(--accent-wash); vertical-align: -1px; margin-right: 4px; box-shadow: inset 0 0 0 1px var(--accent); }

.final-row { display: flex; flex-wrap: wrap; gap: 12px; }
.final-code {
  flex: 1 1 200px; border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; background: var(--surface);
}
.final-code .ax { font-size: 12.5px; color: var(--ink-2); }
.final-code .cv { font: 600 22px/1.3 var(--mono); margin: 2px 0; letter-spacing: -0.01em; }
.final-code .lb { font-size: 13.5px; color: var(--ink-2); }
.verdict { font-size: 13px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.verdict.ok { color: var(--good); }
.verdict.miss { color: var(--bad); }
.timebar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; margin: 10px 0 6px; background: var(--surface); }
.timebar span { display: block; height: 100%; }
.t-ex { background: var(--t-ex); }
.t-rr { background: var(--t-rr); }
.t-ot { background: var(--t-ot); }
.timekeys { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-2); }
.timekeys i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ---------- charts ---------- */
.chart-card { padding: 18px 18px 12px; }
.chart-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.chart-sub { font-size: 13.5px; color: var(--ink-2); margin-bottom: 10px; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin: 4px 0 8px; }
.legend .item { display: inline-flex; align-items: center; gap: 7px; }
.legend svg { overflow: visible; }
.two-up { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
@media (max-width: 820px) { .two-up { grid-template-columns: minmax(0, 1fr); } }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; opacity: 0; transition: opacity 0.08s;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 13px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); max-width: 280px;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-h { font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
.tooltip .tt-r { display: flex; align-items: center; gap: 8px; line-height: 1.5; }
.tooltip .tt-r b { font-variant-numeric: tabular-nums; min-width: 42px; }
.tooltip .tt-r .k { width: 12px; height: 3px; border-radius: 2px; flex: none; }
.tooltip .tt-r span { color: var(--ink-2); }

details.table-view { margin-top: 10px; }
details.table-view summary { cursor: pointer; font-size: 13.5px; color: var(--ink-2); padding: 4px 0; }
details.table-view summary:hover { color: var(--ink); }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--hair); white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th { font-weight: 600; color: var(--ink-2); font-size: 12.5px; vertical-align: bottom; border-bottom: 1px solid var(--axis); }
table.data thead th .sub { display: block; font-weight: 500; color: var(--ink-3); }
table.data tr.group td { font-weight: 650; color: var(--ink); padding-top: 14px; border-bottom: 0; text-align: left; }
table.data tr.pipe td { font-weight: 600; }
table.data tr.pipe td:first-child { color: var(--accent-ink); }
table.data td .ci { color: var(--ink-3); font-size: 12px; font-weight: 400; margin-left: 4px; }
table.data td.best { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
table.data td.indent { padding-left: 24px; }

/* ---------- deployment ---------- */
.dep-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 52px; gap: 10px; align-items: center; margin: 8px 0; font-size: 13px; }
.spec { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 18px; font-size: 14.5px; margin: 0; }
.spec dt { color: var(--ink-2); }
.spec dd { margin: 0; }

/* ---------- lists ---------- */
ul.plain { padding-left: 1.1em; margin: 0; }
ul.plain li { margin-bottom: 8px; color: var(--ink-2); }
ul.plain li b { color: var(--ink); }

/* ---------- citation ---------- */
.bibtex { position: relative; }
.bibtex pre {
  margin: 0; padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow-x: auto; font: 13px/1.6 var(--mono); color: var(--ink);
}
.copy {
  position: absolute; top: 10px; right: 10px; font: inherit; font-size: 12.5px; cursor: pointer;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px;
}
.copy:hover { color: var(--ink); }

footer.site { padding: 36px 0 56px; border-top: 1px solid var(--border); font-size: 13.5px; color: var(--ink-3); }
footer.site p { margin-bottom: 6px; }

.noscript { padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink-2); }
.loading { color: var(--ink-3); font-size: 14px; padding: 24px 0; }
