/* Artemis site styles. Light mode by design.
   Palette: cool lab-glass white, deep indigo ink, cobalt for actions,
   and one structural flourish: a thin band of the solar spectrum. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("/assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Source Serif 4";
  src: url("/assets/fonts/source-serif-4-latin-opsz-normal.woff2") format("woff2");
  font-weight: 200 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f6f9;
  --surface: #ffffff;
  --ink: #14203b;
  --ink-2: #46526d;
  --ink-3: #6b7690;
  --line: #dde3ec;
  --line-strong: #c4cddb;
  --cobalt: #2343c8;
  --cobalt-deep: #1a329b;
  --cobalt-wash: #e9eefc;
  --amber: #c27c00;
  --good: #0f7a55;
  --bad: #b3261e;
  --spectrum: linear-gradient(90deg, #5b3cc4 0%, #2a78d6 22%, #1baf7a 44%, #e3b11a 64%, #eb6834 82%, #c8352f 100%);
  --sans: "Schibsted Grotesk", "Helvetica Neue", Arial, system-ui, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 38rem;
  --wrap: 1180px;
  --radius-s: 6px;
  --radius-m: 10px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: clamp(2.25rem, 1.6rem + 2.6vw, 3.5rem);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
figure { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.55;
  font-feature-settings: "tnum" 0;
  text-rendering: optimizeLegibility;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--cobalt); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--cobalt-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 3px; }
::selection { background: #cfd9fb; }

.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 50;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-s);
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
/* Same left edge as .wrap; content kept to a readable width. */
.wrap-narrow { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }
.wrap-narrow > * { max-width: 760px; }

/* ---------- header and menu ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(244, 246, 249, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header::after { content: ""; display: block; height: 2px; background: var(--spectrum); opacity: 0.9; }
.header-row { display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand svg { width: 28px; height: 28px; }
.nav { margin-left: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.nav a {
  display: inline-block; padding: 8px 12px; border-radius: var(--radius-s);
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.nav a:hover { color: var(--ink); background: #e8ecf2; }
.nav a[aria-current="page"] { color: var(--ink); background: #e3e8f0; }
.nav .nav-cta a[aria-current="page"] { background: var(--cobalt-deep); color: #fff; box-shadow: inset 0 -2px 0 rgba(255,255,255,0.5); }
.nav .nav-cta a { background: var(--cobalt); color: #fff; margin-left: 8px; font-weight: 600; }
.nav .nav-cta a:hover { background: var(--cobalt-deep); color: #fff; }
.menu-toggle {
  display: none; margin-left: auto; align-items: center; gap: 8px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--ink);
  font: inherit; font-weight: 600; padding: 8px 12px; border-radius: var(--radius-s); cursor: pointer;
}
.menu-toggle svg { width: 18px; height: 18px; }

@media (max-width: 760px) {
  .menu-toggle { display: inline-flex; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px -18px rgba(20, 32, 59, 0.35); }
  .nav[data-open="true"] { display: block; }
  .nav ul { flex-direction: column; align-items: stretch; padding: 8px 16px 18px; gap: 2px; width: min(100%, var(--wrap)); margin: 0 auto; }
  .nav a { display: block; padding: 12px 0; font-size: 1.05rem; border-bottom: 1px solid var(--line); border-radius: 0; }
  .nav a:hover { background: transparent; color: var(--cobalt-deep); }
  .nav a[aria-current="page"] { background: transparent; color: var(--cobalt-deep); }
  .nav .nav-cta a { border-bottom: 0; border-radius: var(--radius-s); }
  body.menu-open::after { content: ""; position: fixed; inset: 0; background: rgba(20, 32, 59, 0.38); z-index: 20; }
  .nav .nav-cta a { margin: 8px 0 0; text-align: center; }
}

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--sans); color: var(--ink); letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 0.5em; }
h1 { font-size: var(--step-4); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: var(--step-3); font-weight: 700; }
h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
.lede { font-size: var(--step-1); color: var(--ink-2); max-width: 60ch; line-height: 1.5; }
.prose { font-family: var(--serif); font-size: 1.0625rem; line-height: 1.7; max-width: var(--measure); color: #1d2742; }
.wrap-narrow.prose { max-width: none; }
.wrap-narrow.prose > * { max-width: var(--measure); }
.wrap-narrow.prose > .table-wrap, .wrap-narrow.prose > figure { max-width: 760px; }
.prose table, .prose th, .prose td { font-family: var(--sans); }
h1, h2, h3, .lede, figcaption, .facts dt, .featured .kpi span, .lattice-caption { text-wrap: balance; hyphens: manual; -webkit-hyphens: manual; }
.ovl { text-decoration: overline; text-decoration-thickness: 1px; text-underline-offset: 0; }
.prose h2, .prose h3 { margin-top: 1.6em; }
.prose h2 { font-size: var(--step-3); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose code, code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 0.88em; background: #eaeef5; padding: 0.1em 0.35em; border-radius: 4px; }
.prose pre { background: #101a33; color: #e6ebf5; padding: 16px 18px; border-radius: var(--radius-m); overflow-x: auto; font-size: 0.86rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 1.2em 0; padding: 0.2em 0 0.2em 1em; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.small { font-size: var(--step--1); color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: var(--radius-s);
  font: inherit; font-weight: 600; font-size: 1rem; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: background-color 120ms ease, border-color 120ms ease;
}
.button-primary { background: var(--cobalt); color: #fff; }
.button-primary:hover { background: var(--cobalt-deep); color: #fff; text-decoration: none; }
.button-quiet { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.button-quiet:hover { border-color: var(--ink-3); color: var(--ink); text-decoration: none; }
.button-danger { background: var(--surface); color: var(--bad); border-color: #e3b9b6; }
.button-danger:hover { border-color: var(--bad); color: var(--bad); }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* ---------- page scaffolding ---------- */
main { display: block; flex: 1 0 auto; }
.section { padding: 72px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { max-width: var(--measure); margin-bottom: 32px; }
.section-head p { color: var(--ink-2); }
.page-head { padding: 64px 0 24px; }
.page-head .lede { margin-top: 8px; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); }

/* ---------- home hero ---------- */
.hero { padding: 40px 0 24px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center; min-height: min(78vh, 640px); }
.hero h1 { max-width: 15ch; }
.hero .lede { margin-top: 18px; }
.lattice-figure { margin: 0; justify-self: end; width: 100%; max-width: 540px; }
.lattice-frame { position: relative; aspect-ratio: 1 / 1; width: 100%; }
.lattice-frame canvas { width: 100% !important; height: 100% !important; }
.lattice-canvas { position: absolute; inset: 0; }
.lattice-frame::after { content: ""; position: absolute; left: 18%; right: 18%; bottom: 3%; height: 7%; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 32, 59, 0.16), transparent); pointer-events: none; }
.lattice-fallback { position: absolute; inset: 0; display: grid; place-items: center; }
.lattice-caption { margin-top: 4px; font-size: var(--step--1); color: var(--ink-3); text-align: center; }
.lattice-key { display: flex; justify-content: center; gap: 16px; margin-top: 6px; }
.lattice-key span { display: inline-flex; align-items: center; gap: 6px; }
.lattice-key i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .lattice-figure { max-width: 300px; justify-self: center; margin-top: 0; }
  .hero h1 { max-width: 18ch; }
}

/* ---------- evidence ---------- */
.evidence { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: 40px; align-items: start; }
@media (max-width: 960px) { .evidence { grid-template-columns: minmax(0, 1fr); } }
.figure { padding: 24px; margin: 24px 0; }
.figure-wide { margin-top: 8px; }
.figure figcaption { margin-top: 14px; font-size: var(--step--1); color: var(--ink-3); }
.chart-title { font-weight: 650; margin: 0 0 4px; }
.chart-sub { color: var(--ink-3); font-size: var(--step--1); margin: 0 0 12px; }
.strip-chart { width: 100%; height: auto; overflow: visible; }
.strip-chart text { font-family: var(--sans); fill: var(--ink-2); }
.strip-chart .axis-label { fill: var(--ink-3); font-size: 12px; }
.strip-chart .row-label { fill: var(--ink); font-size: 13.5px; font-weight: 550; }
.strip-chart .median-label { fill: var(--ink); font-size: 12.5px; font-weight: 650; }
.strip-chart .grid { stroke: #e6eaf0; stroke-width: 1; }
.strip-chart .dot { stroke: var(--surface); stroke-width: 2; cursor: pointer; }
.strip-chart .dot:hover, .strip-chart .dot:focus { stroke: var(--ink); outline: none; }
.strip-chart .median { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.chart-tip {
  position: absolute; pointer-events: none; z-index: 5; transform: translate(-50%, calc(-100% - 12px));
  background: var(--ink); color: #fff; font-size: 0.82rem; line-height: 1.35; padding: 8px 10px; border-radius: var(--radius-s);
  white-space: nowrap; box-shadow: 0 8px 22px -10px rgba(20, 32, 59, 0.6);
}
.chart-wrap { position: relative; }
.compare { width: 100%; border-collapse: collapse; margin-top: 8px; font-variant-numeric: tabular-nums; }
.compare th, .compare td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.compare th { font-size: var(--step--1); color: var(--ink-3); font-weight: 600; }
.compare td.n { text-align: right; white-space: nowrap; font-weight: 600; }
.compare th.n { text-align: right; }
.compare tr.ours td { color: var(--cobalt-deep); }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* ---------- steps (a real sequence) ---------- */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; counter-reset: step; border-top: 2px solid var(--ink); }
.steps li { counter-increment: step; padding: 18px 18px 0 0; }
.steps li + li { padding-left: 18px; border-left: 1px solid var(--line); }
.steps li::before { content: counter(step); display: block; font-weight: 700; font-size: 2rem; color: var(--cobalt); line-height: 1; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.steps h3 { margin-bottom: 2px; }
.steps p { color: var(--ink-2); font-size: 0.95rem; margin: 0; }
.steps .who { display: block; margin-bottom: 10px; font-size: 0.8125rem; color: var(--ink-3); font-weight: 600; }
@media (max-width: 960px) {
  .steps { grid-template-columns: 1fr; border-top: 0; }
  .steps li, .steps li + li { padding: 18px 0 18px 56px; border-left: 0; border-top: 1px solid var(--line); position: relative; }
  .steps li::before { position: absolute; left: 0; top: 18px; font-size: 1.6rem; }
}

/* ---------- trust list ---------- */
.result-intro { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 32px 64px; align-items: start; margin-bottom: 32px; }
.result-intro .section-head { margin-bottom: 0; }
.keynums { margin: 8px 0 0; padding: 0; border-top: 2px solid var(--ink); }
.keynums div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 16px; align-items: baseline; padding: 16px 0; border-bottom: 1px solid var(--line); }
.keynums dd { margin: 0; font-size: 2.4rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; text-align: right; }
.keynums dt { color: var(--ink-2); }
.keynums dd { order: -1; }
.keynums div.ours dd { color: var(--cobalt); }
@media (max-width: 860px) { .result-intro { grid-template-columns: minmax(0, 1fr); } }
.trust { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; }
.trust div { padding: 20px 0; border-top: 1px solid var(--line); }
.trust h3 { margin-bottom: 6px; }
.trust p { color: var(--ink-2); margin: 0; max-width: 52ch; }
@media (max-width: 760px) { .trust { grid-template-columns: 1fr; } }

/* ---------- call to action band ---------- */
.cta-band { background: var(--ink); color: #e9edf6; padding: 56px 0; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #c3cbe0; max-width: 58ch; }
.cta-band .button-primary { background: #fff; color: var(--ink); }
.cta-band .button-primary:hover { background: #dfe6f7; color: var(--ink); }
.cta-band .button-quiet { background: transparent; color: #fff; border-color: #5d6b8c; }
.cta-band .button-quiet:hover { border-color: #fff; color: #fff; }
.cta-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; gap: 24px 48px; align-items: center; }
.cta-grid .actions { margin-top: 0; justify-content: flex-end; }
.cta-band p { margin-bottom: 0; }
@media (max-width: 860px) { .cta-grid { grid-template-columns: 1fr; } .cta-grid .actions { justify-content: flex-start; } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data thead th { background: #f0f3f8; color: var(--ink-2); font-size: var(--step--1); font-weight: 650; position: sticky; top: 0; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data td.n, table.data th.n { text-align: right; white-space: nowrap; }
table.data th { white-space: nowrap; }
table.data td:first-child { min-width: 13rem; }
table.data.status-table td:first-child, .prose table.data td:first-child { min-width: 0; }
table.data.shortlist td:first-child { min-width: 0; width: 3.5rem; }
table.data.shortlist td:last-child { min-width: 15rem; }
table.data.shortlist th { white-space: normal; vertical-align: bottom; }
details.report > .prose { max-width: none; }
details.report > .prose > p, details.report > .prose > ul, details.report > .prose > ol, details.report > .prose > h3, details.report > .prose > h4 { max-width: var(--measure); }
details.report table.data { font-size: 0.85rem; }
details.report table.data th { white-space: normal; }
.vh { font-size: 0; }
.show-all { display: none; }
@media (max-width: 560px) {
  table.data.trials:not(.expanded) tr.minor { display: none; }
  .show-all { display: inline-flex; margin: 4px 0 8px; }
}
table.data tr.highlight td { background: #f3f6fe; }
table.data tr.highlight td:first-child { box-shadow: inset 3px 0 0 var(--cobalt); }
table.data .nowrap, .nowrap { white-space: nowrap; }
table.data .code-name { display: block; margin-top: 2px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.78rem; color: var(--ink-3); }
.table-wrap { margin: 20px 0; position: relative; }
@media (max-width: 560px) {
  .table-wrap.stackable { -webkit-mask-image: none !important; mask-image: none !important; overflow: visible; border: 0; background: transparent; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; min-width: 0 !important; width: auto; }
  table.data.stack thead { display: none; }
  table.data.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; margin-bottom: 10px; }
  table.data.stack td { border: 0; padding: 3px 0; display: flex; justify-content: space-between; gap: 16px; text-align: right; }
  table.data.stack td::before { content: attr(data-label); color: var(--ink-3); font-size: var(--step--1); text-align: left; flex: 0 1 50%; }
  table.data.stack td:first-child { display: block; text-align: left; font-weight: 650; font-size: 1.02rem; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  table.data.stack td:first-child::before { content: none; }
  table.data.stack tr.highlight { border-color: var(--cobalt); }
  table.data.stack.shortlist td:first-child { display: none; }
  table.data.stack.shortlist td.material { display: block; text-align: left; font-size: 1.05rem; padding-bottom: 8px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
  table.data.stack.shortlist td.material::before { content: attr(data-rank) ". "; color: var(--ink-3); font-size: inherit; font-weight: 650; }
  table.data.stack.shortlist td.material .cell { display: inline; }
  table.data.stack tr.highlight td { background: none; box-shadow: none; }
}
@media (min-width: 561px) and (max-width: 760px) {
  table.data { min-width: 620px; }
  table.data.shortlist { min-width: 760px; }
  table.data.status-table { min-width: 0; }
  .table-wrap { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .table-wrap.scrolled-end { -webkit-mask-image: none; mask-image: none; }
}
.tag { display: inline-block; font-size: 0.78rem; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: #edf0f5; color: var(--ink-2); white-space: nowrap; }
.tag-good { background: #e3f3ec; color: var(--good); }
.tag-warn { background: #fbf0dc; color: #8a5a00; }
.tag-run { background: var(--cobalt-wash); color: var(--cobalt-deep); }
.tag-bad { background: #fbe7e6; color: var(--bad); }

/* ---------- result page ---------- */
.result-layout > * { min-width: 0; }
.result-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; align-items: start; }
.toc { position: sticky; top: 96px; font-size: 0.92rem; }
.toc p { font-weight: 650; margin-bottom: 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 14px; color: var(--ink-2); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-left-color: var(--line-strong); }
.toc a.active { color: var(--cobalt-deep); border-left-color: var(--cobalt); font-weight: 600; }
@media (max-width: 1180px) { .result-layout { grid-template-columns: minmax(0, 1fr); } .toc { display: none; } }
.result-section { padding: 8px 0 40px; }
.result-section + .result-section { border-top: 1px solid var(--line); padding-top: 40px; }
.result-title, #run-title { font-size: clamp(2rem, 1.5rem + 1.8vw, 2.75rem); max-width: 24ch; }
#run-body > .prose, #run-body > details, #run-body > .callout { max-width: var(--measure); }
.lab-grid.equal { align-items: stretch; }
.crumb { margin: 0 0 12px; font-size: var(--step--1); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); margin: 28px 0 0; }
.facts div { padding: 20px 22px; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 8px; }
.facts div + div { border-left: 1px solid var(--line); }
.facts dt { font-size: var(--step--1); color: var(--ink-2); max-width: 30ch; }
.facts dd { margin: 0; font-size: 2.6rem; line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.facts dd span { font-size: 1.1rem; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
@media (max-width: 700px) { .facts { grid-template-columns: 1fr; } .facts div + div { border-left: 0; border-top: 1px solid var(--line); } }
.callout { border-left: 3px solid var(--amber); background: #fdf8ee; padding: 14px 18px; border-radius: 0 var(--radius-s) var(--radius-s) 0; color: #4b3a12; max-width: var(--measure); margin: 20px 0; font-family: var(--serif); font-size: 1.02rem; line-height: 1.6; }
.result-section .prose + .table-wrap, .result-section .table-wrap + .prose { margin-top: 20px; }
.sources-title { margin-top: 36px; }
.sources { font-size: 0.95rem; max-width: var(--measure); }
details.report { border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--surface); }
details.report > summary { cursor: pointer; padding: 16px 20px; font-weight: 650; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
details.report > summary::-webkit-details-marker { display: none; }
details.report > summary::after { content: "Show"; font-weight: 600; color: var(--cobalt); font-size: 0.92rem; }
details.report[open] > summary::after { content: "Hide"; }
details.report > div { padding: 4px 24px 24px; border-top: 1px solid var(--line); }
.downloads { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 0; max-width: var(--measure); }
.downloads li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.downloads li span { white-space: nowrap; }
.downloads li span { color: var(--ink-3); font-size: var(--step--1); }

/* ---------- lab page ---------- */
.lab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
@media (max-width: 960px) { .lab-grid { grid-template-columns: minmax(0, 1fr); } }
.panel { padding: 28px; }
fieldset { border: 0; margin: 0 0 24px; padding: 0; }
legend { font-weight: 650; margin-bottom: 12px; padding: 0; }
.choice { display: grid; gap: 10px; }
.choice label { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-m); cursor: pointer; background: var(--surface); }
.choice label:hover { border-color: var(--ink-3); }
.choice input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--cobalt); }
.choice label:has(input:checked) { border-color: var(--cobalt); box-shadow: 0 0 0 1px var(--cobalt); background: #fbfcff; }
.choice strong { display: block; }
.choice span { color: var(--ink-2); font-size: 0.95rem; }
.field { margin-bottom: 20px; }
.field label { display: block; font-weight: 650; margin-bottom: 6px; }
.field .hint { color: var(--ink-3); font-size: var(--step--1); margin: 6px 0 0; }
input[type="text"], input[type="password"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1px solid var(--line-strong); border-radius: var(--radius-s); padding: 11px 12px;
}
textarea { min-height: 128px; resize: vertical; line-height: 1.5; }
input:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px #d5ddfa; }
.form-status { min-height: 1.5em; margin: 14px 0 0; color: var(--ink-2); }
.form-status.bad { color: var(--bad); }
.run-stages { list-style: none; margin: 4px 0 22px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); counter-reset: stage; }
.run-stages li { counter-increment: stage; position: relative; padding-top: 32px; text-align: center; font-size: 0.85rem; font-weight: 600; color: var(--ink-3); line-height: 1.3; }
.run-stages li::before { content: counter(stage); position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; background: var(--surface); border: 2px solid var(--line-strong); color: var(--ink-3); z-index: 1; }
.run-stages li + li::after { content: ""; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--line); }
.run-stages li[data-state="active"] { color: var(--cobalt-deep); }
.run-stages li[data-state="active"]::before { border-color: var(--cobalt); color: var(--cobalt-deep); box-shadow: 0 0 0 4px var(--cobalt-wash); }
.run-stages li[data-state="done"] { color: var(--good); }
.run-stages li[data-state="done"]::before { content: "\2713"; background: var(--good); border-color: var(--good); color: #fff; }
.run-stages li[data-state="done"]::after, .run-stages li[data-state="active"]::after { background: var(--good); }
.run-stages li[data-state="failed"] { color: var(--bad); }
.run-stages li[data-state="failed"]::before { content: "!"; border-color: var(--bad); color: var(--bad); }
.live-panel { position: sticky; top: 92px; }
@media (max-width: 960px) { .live-panel { position: static; } }
.feed { border-top: 1px solid var(--line); max-height: 560px; min-height: 260px; overflow-y: auto; }
.feed:has(> .empty-state) { min-height: 0; }
.feed .msg.prose { white-space: normal; max-width: none; font-size: 0.98rem; }
.feed .msg.prose h2 { font-size: 1.3rem; } .feed .msg.prose h3 { font-size: 1.1rem; }
.feed article { padding: 14px 0; border-bottom: 1px solid var(--line); }
.feed time { display: block; font-size: 0.8rem; color: var(--ink-3); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.feed .msg { font-family: var(--serif); font-size: 1rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.feed .tool { color: var(--ink-3); font-size: 0.88rem; }
.empty-state { color: var(--ink-3); padding: 18px 0; }

/* ---------- results list ---------- */
.featured { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 40px; align-items: center; padding: 28px; margin-bottom: 36px; text-decoration: none; color: inherit; }
.featured:hover { border-color: var(--cobalt); color: inherit; text-decoration: none; }
.featured h2 { font-size: var(--step-2); margin-bottom: 8px; }
.featured p { color: var(--ink-2); margin: 0; max-width: 64ch; }
.featured .kpi { text-align: right; }
.featured .kpi strong { display: block; font-size: 2.6rem; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.featured .kpi span { display: block; font-size: var(--step--1); color: var(--ink-3); max-width: 22ch; margin-top: 6px; }
.featured .go { color: var(--cobalt); font-weight: 600; margin-top: 14px; display: inline-block; }
@media (max-width: 700px) { .featured { grid-template-columns: 1fr; } .featured .kpi { text-align: left; order: -1; } }
.list-title { font-size: var(--step-1); margin: 0 0 8px; }
.result-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.result-list li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: center; }
.result-list li:hover { background: linear-gradient(90deg, transparent, #eef2f8 30%, #eef2f8 70%, transparent); }
.result-list h3 a::after { content: ""; position: absolute; inset: 0; }
.result-list .chev { color: var(--ink-3); font-size: 1.4rem; line-height: 1; }
.result-list h3 { margin: 0 0 6px; }
.result-list h3 a { color: var(--ink); text-decoration: none; }
.result-list h3 a:hover { color: var(--cobalt-deep); text-decoration: underline; }
.result-list p { margin: 0; color: var(--ink-2); max-width: 70ch; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; font-size: var(--step--1); color: var(--ink-3); }
.result-list .side { text-align: right; }
@media (max-width: 640px) { .result-list li { grid-template-columns: 1fr; } .result-list .side { text-align: left; } }

/* ---------- method diagram ---------- */
.flow { width: 100%; height: auto; }
.flow-vertical { display: none; max-width: 340px; margin: 0 auto; }
@media (max-width: 700px) { .flow-horizontal { display: none; } .flow-vertical { display: block; } }
.method-section h2 { font-size: var(--step-3); }
.flow text { font-family: var(--sans); }
.agents td:first-child { font-weight: 650; white-space: nowrap; }

/* ---------- FAQ ---------- */
.faq details { border-top: 1px solid var(--line); padding: 4px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 650; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 500; color: var(--ink-3); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 0 16px; color: var(--ink-2); max-width: 70ch; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; margin-top: 0; background: var(--surface); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-title { font-size: 0.95rem; font-weight: 650; margin: 0 0 10px; color: var(--ink); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 6px 0; }
.footer-grid a { color: var(--ink-2); text-decoration: none; }
.footer-grid a:hover { color: var(--cobalt-deep); text-decoration: underline; }
.footer-grid p { color: var(--ink-2); font-size: 0.95rem; max-width: 36ch; }
.footer-base { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: var(--step--1); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- 404 ---------- */
.not-found { padding: 96px 0; }
.status-table td:nth-child(2) { white-space: nowrap; }
@media (max-width: 560px) { .status-table td:nth-child(2) { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  .site-header, .site-footer, .toc, .cta-band, .lattice-frame { display: none !important; }
  body { background: #fff; }
}
