/* Cilia. A lab journal: a contents rail on the left, serif headings, one ink-blue
   accent, a faint tissue-section texture, light and dark themes. */

:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --rail: #eceef1;
  --ink: #1b1f26;
  --ink-2: #4a515c;
  --ink-3: #7b828e;
  --line: #e0e3e8;
  --line-2: #c9ced6;
  --accent: #2c4f86;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecf6;
  --good: #2e7a4d;
  --good-soft: #e3f1e8;
  --warn: #9a6400;
  --warn-soft: #f8eedb;
  --bad: #b03a30;
  --bad-soft: #f7e4e2;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Source Code Pro", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111419; --surface: #171b22; --rail: #0d1014; --ink: #e6e9ee; --ink-2: #a9b0bb; --ink-3: #788190;
    --line: #242a33; --line-2: #333b47; --accent: #9cb7e6; --accent-ink: #0d1014; --accent-soft: #1b2636;
    --good: #72c595; --good-soft: #17281f; --warn: #e2b55a; --warn-soft: #2b2416; --bad: #ee857b; --bad-soft: #2d1a19;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111419; --surface: #171b22; --rail: #0d1014; --ink: #e6e9ee; --ink-2: #a9b0bb; --ink-3: #788190;
  --line: #242a33; --line-2: #333b47; --accent: #9cb7e6; --accent-ink: #0d1014; --accent-soft: #1b2636;
  --good: #72c595; --good-soft: #17281f; --warn: #e2b55a; --warn-soft: #2b2416; --bad: #ee857b; --bad-soft: #2d1a19;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--sans); transition: background .3s, color .3s; }
a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); color: var(--ink); padding: 6px 10px; z-index: 30; }
.skip:focus { left: 12px; }
h1, h2, h3 { margin: 0; color: var(--ink); }
h1 { font: 400 clamp(2rem, 3.6vw, 2.9rem)/1.15 var(--serif); letter-spacing: -0.01em; max-width: 24ch; margin-bottom: 18px; font-variation-settings: "opsz" 60; }
h2 { font: 400 1.75rem/1.2 var(--serif); letter-spacing: -0.005em; font-variation-settings: "opsz" 40; }
h3 { font: 600 1rem/1.3 var(--sans); margin-bottom: 12px; }
h3.gap { margin-top: 26px; }
p { margin: 0 0 12px; }
.small { font-size: .88rem; }
.muted { color: var(--ink-2); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .82em; }
[hidden] { display: none !important; }

/* ------------------------------------------------ shell + rail */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--rail); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px; padding: 26px 22px;
}
.rail-top { display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font: 400 1.4rem/1 var(--serif); letter-spacing: -0.01em; }
.brand small { display: block; font: 500 .72rem/1.3 var(--sans); color: var(--ink-3); letter-spacing: .01em; margin-top: 3px; }
.logo { width: 34px; height: 34px; stroke: var(--accent); flex: none; overflow: visible; }
.logo .nuc { fill: var(--accent); stroke: none; }
.logo path { transform-origin: 16px 16px; animation: beat 6s ease-in-out infinite; }
@keyframes beat { 50% { transform: rotate(7deg); } }
.menu { display: none; }
.live { margin: 0; display: flex; align-items: center; gap: 8px; font-size: .86rem; color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.dot.on { background: var(--good); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .35; } }
.toc { display: flex; flex-direction: column; gap: 1px; }
.toc a { display: flex; align-items: center; gap: 10px; color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 6px; font-size: .96rem; transition: background .2s, color .2s; }
.toc svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; opacity: .85; }
.toc a:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 5%, transparent); }
.toc a.here { color: var(--accent); background: var(--accent-soft); }
.rail-swarms { display: grid; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.rs { display: grid; grid-template-columns: 38px 1fr 26px; gap: 8px; align-items: center; font-size: .8rem; color: var(--ink-2); text-decoration: none; }
.rs b { font-weight: 600; color: var(--ink); }
.rs .meter { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rs .meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .8s ease; }
.rs span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.theme { margin-top: auto; display: flex; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.theme button { flex: 1; font: 500 .8rem var(--sans); color: var(--ink-2); background: transparent; border: 0; padding: 6px 0; cursor: pointer; }
.theme button + button { border-left: 1px solid var(--line-2); }
.theme button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }

/* ------------------------------------------------ content */
.content { padding: 0 48px; max-width: 1180px; width: 100%; overflow-x: clip; }
.sec { padding: 52px 0 12px; }
.sec + .sec { border-top: 1px solid var(--line); }
.intro { padding-top: 64px; position: relative; isolation: isolate; }
.intro::before {
  content: ""; position: absolute; z-index: -1; inset: 0 -48px 40px -48px; background: var(--ink); opacity: .06;
  -webkit-mask: url(/static/tissue.svg) right top / 1200px auto no-repeat, linear-gradient(to bottom, #000 30%, transparent 95%);
  -webkit-mask-composite: source-in;
  mask: url(/static/tissue.svg) right top / 1200px auto no-repeat, linear-gradient(to bottom, #000 30%, transparent 95%);
  mask-composite: intersect;
}
:root[data-theme="dark"] .intro::before { opacity: .09; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .intro::before { opacity: .09; } }
.intro-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); gap: 48px; align-items: center; margin-bottom: 34px; }
.intro-grid .actions { margin-bottom: 0; }
.plate { margin: 0; }
.plate svg { width: 100%; height: auto; display: block; overflow: visible; }
.plate figcaption { font-size: .82rem; color: var(--ink-3); margin-top: 8px; max-width: 46ch; }
.plate .rim { fill: var(--surface); stroke: var(--line-2); stroke-width: 1.2; }
.plate .rim2 { fill: none; stroke: var(--line); stroke-width: 1; }
.plate .well { fill: var(--bg); stroke: var(--line-2); stroke-width: 1.2; }
.plate .well-in { fill: none; stroke: var(--line); stroke-width: 1; }
.plate .w { cursor: pointer; text-decoration: none; }
.plate .w:hover .well { stroke: var(--accent); }
.plate .w:focus-visible { outline: none; }
.plate .w:focus-visible .well { stroke: var(--accent); stroke-width: 2; }
.plate .empty-well { fill: none; stroke: var(--line-2); stroke-width: 1.2; stroke-dasharray: 4 4; }
.plate .plus { stroke: var(--ink-3); stroke-width: 1.4; stroke-linecap: round; }
.plate .colony { fill: var(--accent); }
.plate .colony.new { animation: grow 1.6s ease-out; transform-box: fill-box; transform-origin: center; }
@keyframes grow { 0% { transform: scale(0); fill: var(--good); } 30% { transform: scale(1.8); fill: var(--good); } 100% { transform: scale(1); } }
.plate .pulse { fill: none; stroke: var(--accent); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ring 2s ease-out forwards; }
@keyframes ring { from { transform: scale(.4); opacity: .9; } to { transform: scale(1.18); opacity: 0; } }
.plate text { font: 600 12px var(--sans); fill: var(--ink); }
.plate text.sub { font: 400 11px var(--sans); fill: var(--ink-3); }
.lede { font-size: 1.12rem; color: var(--ink-2); max-width: 64ch; }
.actions { display: flex; gap: 12px; margin: 24px 0 34px; flex-wrap: wrap; }
.sec-head { margin-bottom: 20px; }
.sec-head h2 { margin-bottom: 8px; }
.sec-head p { color: var(--ink-2); max-width: 70ch; }
.sec-head.row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.sec-head.row p { margin: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.cols > .panel { margin-bottom: 18px; }
.scroll-x { overflow-x: auto; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; font: 600 .93rem var(--sans); color: var(--accent-ink); background: var(--accent);
  border: 1px solid var(--accent); padding: 9px 16px; border-radius: 6px; cursor: pointer; text-decoration: none;
  transition: filter .2s, transform .1s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--line-2); }
.btn.ghost:hover { border-color: var(--accent); filter: none; }

/* stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stats div { padding: 16px 20px; display: flex; flex-direction: column-reverse; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: .86rem; color: var(--ink-2); }
.stats dd { margin: 0; font: 400 2.1rem/1.15 var(--serif); font-variant-numeric: lining-nums tabular-nums; }

/* segmented controls */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; }
.seg button { font: 500 .86rem var(--sans); color: var(--ink-2); background: transparent; border: 0; padding: 5px 11px; border-radius: 5px; cursor: pointer; transition: background .2s, color .2s; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"], .seg button[aria-selected="true"] { background: var(--accent-soft); color: var(--accent); }
.seg.wide { margin-bottom: 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); margin-top: -6px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }

/* swarm cards */
.grid5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.card-name { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card-name h3 { margin: 0; font: 400 1.08rem/1.25 var(--serif); min-height: 2.5em; }
.card-name span { font-size: .75rem; color: var(--ink-3); font-weight: 600; }
.bio { font: italic 400 .84rem/1.4 var(--serif); color: var(--ink-2); margin: -4px 0 2px; min-height: 4.2em; }
.gene { font-style: italic; }
.metrics { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; margin: 0; }
.metrics div { display: flex; flex-direction: column-reverse; }
.metrics dt { font-size: .72rem; color: var(--ink-3); }
.metrics dd { margin: 0; font: 600 1.02rem var(--sans); font-variant-numeric: tabular-nums; }
.spark { width: 100%; height: 34px; display: block; }
.spark .area { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.spark .line { fill: none; stroke: var(--accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.now { font-size: .82rem; line-height: 1.4; color: var(--ink-2); min-height: 3.4em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.now time { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: 4px; }
.now.fresh { animation: rise .45s ease-out; }
.card details { border-top: 1px solid var(--line); padding-top: 8px; font-size: .82rem; }
.card summary { cursor: pointer; color: var(--ink-2); list-style: none; display: flex; justify-content: space-between; }
.card summary::-webkit-details-marker { display: none; }
.card summary::after { content: "+"; color: var(--ink-3); }
.card details[open] summary::after { content: "\2212"; }
.agents { display: grid; gap: 3px; margin-top: 8px; }
.ag { display: grid; grid-template-columns: 8px 54px minmax(0, 1fr); gap: 7px; align-items: baseline; }
.ag i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-2); align-self: center; }
.ag.working i { background: var(--good); }
.ag.error i { background: var(--bad); }
.ag b { font-weight: 600; color: var(--ink); }
.ag span { color: var(--ink-3); overflow-wrap: anywhere; line-height: 1.35; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }

/* live log */
#log .panel { padding: 6px 0; }
.feed { list-style: none; margin: 0; padding: 0; height: 460px; overflow-y: auto; }
.feed li { display: grid; grid-template-columns: 74px 46px minmax(0, 1fr); gap: 12px; padding: 7px 22px; font-size: .9rem; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.feed li.new { animation: rise .45s ease-out; }
.feed time { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: .84rem; }
.feed .d { font-weight: 600; font-size: .82rem; color: var(--ink-2); }
.feed .x { color: var(--ink); overflow-wrap: anywhere; }
.feed .x.dim { color: var(--ink-3); }
.feed .x::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; background: var(--line-2); }
.feed .x.good::before { background: var(--good); }
.feed .x.bad::before { background: var(--bad); }
.feed .x.test::before { background: var(--accent); }
.feed .agent { color: var(--ink-3); font-size: .82rem; margin-right: 6px; }
.feed .src { margin-left: 6px; font-size: .82rem; }

/* tests */
.chain { display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center; }
.chain h3 { margin-bottom: 4px; }
.chain p { margin: 0; }
.chain p.ok { color: var(--good); }
.chain p.bad { color: var(--bad); }
.chain-bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.chain-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
/* Solana anchor, inside the receipt-chain panel (onchain.js) */
.anchor { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 20px; align-items: center; padding-top: 14px; border-top: 1px solid var(--line); }
.anchor p + p { margin-top: 4px; }
.anchor .mono { overflow-wrap: anywhere; }
@media (max-width: 560px) { .anchor { grid-template-columns: minmax(0, 1fr); } }
/* Daily backups of the record, below the anchor (backup.js) */
.backup { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); }
.backup p + p { margin-top: 4px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar p { margin: 0; }
.list { padding: 0; }
.test { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.test:last-child { border-bottom: 0; }
.test-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.badge { font: 600 .74rem var(--sans); padding: 2px 8px; border-radius: 4px; background: var(--line); color: var(--ink-2); }
.badge.survived { background: var(--good-soft); color: var(--good); }
.badge.challenged { background: var(--warn-soft); color: var(--warn); }
.badge.registered, .badge.tested, .badge.candidate { background: var(--accent-soft); color: var(--accent); }
.test-top .d { font-size: .8rem; font-weight: 600; color: var(--ink-3); }
.test-top .id { margin-left: auto; font-size: .8rem; color: var(--ink-3); }
.test-statement { font: 400 1.06rem/1.45 var(--serif); margin-bottom: 6px; }
.test-sum { font: 400 .8rem/1.55 var(--mono); color: var(--ink-2); margin-bottom: 6px; }
.test-meta { font-size: .8rem; color: var(--ink-3); margin: 0; }
.challenge { font-size: .88rem; color: var(--ink-2); padding: 6px 10px; border-radius: 4px; background: var(--warn-soft); margin-bottom: 6px; }
.test details { margin-top: 8px; font-size: .92rem; }
.test summary { cursor: pointer; color: var(--accent); width: fit-content; }
.detail { padding-top: 12px; animation: rise .35s ease-out; }
.detail p { color: var(--ink-2); }
.notes { padding-left: 10px; border-left: 2px solid var(--line-2); color: var(--ink-2); }
.llm-notes { margin: 4px 0 0; padding-left: 18px; }
.llm-notes li { margin-bottom: 4px; overflow-wrap: anywhere; }
.pre { font: 400 .74rem/1.5 var(--mono); background: var(--bg); border: 1px solid var(--line); padding: 12px; border-radius: 6px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }
.more { text-align: center; }
.km { width: 100%; max-width: 580px; height: auto; display: block; margin: 4px 0; }
.km .grid { stroke: var(--line); stroke-width: 1; }
.km .axis { stroke: var(--line-2); stroke-width: 1; }
.km text { font: 400 11px var(--sans); fill: var(--ink-3); }
.km .hi { fill: none; stroke: var(--accent); stroke-width: 2; }
.km .lo { fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-dasharray: 0; }
.km .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.2s ease-out forwards; }
.strip { width: 100%; max-width: 580px; height: auto; display: block; margin: 4px 0; }
.strip .grid { stroke: var(--line); stroke-width: 1; }
.strip .axis { stroke: var(--line-2); stroke-width: 1; }
.strip text { font: 400 11px var(--sans); fill: var(--ink-3); }
.strip .dot { fill: var(--accent); fill-opacity: .55; }
.strip .mean { stroke: var(--ink); stroke-width: 2.5; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.km-legend { display: flex; gap: 4px 22px; flex-wrap: wrap; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
.km-legend i { display: inline-block; width: 18px; border-top: 2px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.km-legend i.lo { border-top-color: var(--ink-3); }
.forest { width: 100%; max-width: 580px; height: auto; display: block; margin: 4px 0 2px; }
.forest .grid { stroke: var(--line); stroke-width: 1; }
.forest .one { stroke: var(--line-2); stroke-width: 1.5; }
.forest text { font: 400 11px var(--sans); fill: var(--ink-3); }
.forest .lab { font: 600 12px var(--sans); fill: var(--ink-2); }
.forest .val { font: 400 12px var(--mono); fill: var(--ink-2); }
.forest .ci { stroke: var(--ink-3); stroke-width: 2; }
.forest .pt { fill: var(--ink-3); }
.forest .ci.cgga { stroke: var(--accent); }
.forest .pt.cgga { fill: var(--accent); }
.forest .ci.batch { stroke: var(--line-2); }
.forest .pt.batch { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.forest .lab.strong { fill: var(--ink); }
.forest.compact { display: none; }
.forest .dia.pool { fill: var(--accent); }
.forest .dia.sens { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.fig-k { font: 600 .74rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 0; }

/* knowledge */
.ask label { display: block; font-weight: 600; margin-bottom: 10px; }
.ask-row { display: flex; gap: 8px; }
.ask input, #node-id {
  flex: 1; min-width: 0; font: 400 1rem var(--sans); color: var(--ink); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 9px 12px;
}
.ask input:focus, #node-id:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.ask p { margin: 8px 0 0; }
.answer { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.answer > p:first-child { font: 400 1.08rem/1.5 var(--serif); }
.answer .w { opacity: 0; animation: fadein .3s ease-out forwards; }
@keyframes fadein { to { opacity: 1; } }
.quotes { list-style: none; padding: 0; margin: 0; }
.quotes li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.quotes li:last-child { border-bottom: 0; }
.quotes li.in { opacity: 0; animation: risein .45s ease-out forwards; }
@keyframes risein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.q { display: block; font: 400 1rem/1.5 var(--serif); }
.src { display: block; font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.ft { display: inline-block; margin-left: 6px; padding: 0 5px; border: 1px solid var(--line-2); border-radius: 3px; font: 600 .68rem/1.45 var(--sans); color: var(--ink-3); letter-spacing: .02em; vertical-align: 1px; }
.pol { font: 600 .7rem var(--sans); margin-right: 8px; padding: 1px 6px; border-radius: 3px; vertical-align: 2px; }
.pol.positive { background: var(--good-soft); color: var(--good); }
.pol.null { background: var(--line); color: var(--ink-2); }
.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
.t th { text-align: left; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--line-2); padding: 6px 14px 8px 0; font-size: .82rem; }
.t th.num { text-align: right; }
.t td { border-bottom: 1px solid var(--line); padding: 9px 14px 9px 0; vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t .num { padding-right: 20px; white-space: nowrap; }
.t td:last-child, .t th:last-child { padding-right: 0; }
.t td.small { color: var(--ink-2); }
.status { font: 600 .74rem var(--sans); padding: 2px 7px; border-radius: 4px; background: var(--line); color: var(--ink-2); white-space: nowrap; }
.status.approved, .status.survived { background: var(--good-soft); color: var(--good); }
.status.failed, .status.withdrawn { background: var(--bad-soft); color: var(--bad); }
.status.pipeline, .status.challenged { background: var(--accent-soft); color: var(--accent); }
.status.st-failed, .status.st-inconclusive { background: var(--line); color: var(--ink-2); }
.status.st-survived { background: var(--good-soft); color: var(--good); }
.status.st-challenged { background: var(--warn-soft); color: var(--warn); }
.status.st-candidate, .status.st-pending { background: var(--accent-soft); color: var(--accent); }
.status.st-pending { background: transparent; border: 1px solid var(--line-2); color: var(--ink-3); }
.cohorts { display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); gap: 10px; align-items: stretch; margin-bottom: 14px; }
.cohort { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.cohort .k { font: 600 .74rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 2px; }
.cohort .v { font: 400 1.3rem/1.2 var(--serif); margin: 0 0 6px; }
.cohort p.small { margin: 0; color: var(--ink-2); }
.cohorts .arrow { display: grid; place-items: center; }
.cohorts .arrow svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cohorts.three { grid-template-columns: minmax(0, 1fr) 28px minmax(0, 2fr); }
.pool { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; border: 1px dashed var(--line-2); border-radius: var(--radius); padding: 10px; }
.pool .pool-k { grid-column: 1 / -1; font: 600 .74rem var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 -2px 2px; }
.power { background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; }
.t.atlas td.sub { color: var(--ink-3); }
.bar { display: inline-block; width: 64px; height: 6px; border-radius: 3px; background: var(--line); vertical-align: middle; margin-right: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--good); transition: width .8s ease-out; }
.plain { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.plain li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; }
.plain li:last-child { border-bottom: 0; }
.plain li > span:last-child { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.kv { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: .92rem; }
.kv dt, .kv dd { padding: 6px 0; border-bottom: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--ink-2); padding-right: 16px; }
.kv dd { text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.empty { color: var(--ink-3); }

/* nodes + fees */
.code { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; font: 400 .82rem/1.75 var(--mono); overflow-x: auto; margin: 0 0 18px; color: var(--ink); }
#link-form label { display: block; font-weight: 600; font-size: .9rem; margin: 12px 0 6px; }
#node-id { width: 100%; font-family: var(--mono); font-size: .85rem; margin-bottom: 12px; }
.split { display: flex; height: 44px; border-radius: var(--radius); overflow: hidden; margin: 6px 0 12px; font-size: .9rem; border: 1px solid var(--line); }
.split span { display: flex; align-items: center; gap: 6px; padding: 0 14px; }
.split span:first-child { background: var(--accent); color: var(--accent-ink); }
.split span:last-child { background: var(--surface); color: var(--ink); }
.formula { font: 400 .86rem var(--mono); color: var(--ink-2); margin-bottom: 20px; }
.setup .state::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 2px; background: var(--line-2); }
.setup .state.on { color: var(--good); }
.setup .state.on::before { background: var(--good); }
.setup .state.off { color: var(--ink-3); }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 44px; color: var(--ink-3); font-size: .86rem; }
.foot a { margin-right: 14px; }

/* ------------------------------------------------ responsive */
@media (max-width: 1280px) {
  .grid5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .intro-grid { grid-template-columns: 1fr; gap: 28px; }
  .plate { max-width: 460px; }
}
@media (max-width: 960px) {
  html { scroll-padding-top: 104px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-top { flex: 1; }
  .menu { display: inline-block; font: 500 .9rem var(--sans); color: var(--ink); background: transparent; border: 1px solid var(--line-2); border-radius: 6px; padding: 5px 12px; cursor: pointer; }
  .live { order: 3; width: 100%; }
  .toc { display: none; order: 4; width: 100%; }
  .rail.open .toc { display: flex; }
  .rail-swarms { display: none; }
  .theme { order: 5; margin-top: 0; width: 100%; display: none; }
  .rail.open .theme { display: flex; }
  .content { padding: 0 18px; }
  .cols { grid-template-columns: 1fr; gap: 0; }
  .grid5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .card-name h3 { min-height: 0; }
  .bio { min-height: 0; }
  body { font-size: 16px; }
  .intro { padding-top: 36px; }
  .grid5 { grid-template-columns: 1fr; }
  .stats dd { font-size: 1.7rem; }
  .feed li { grid-template-columns: 62px minmax(0, 1fr); padding: 7px 14px; }
  .feed .d { display: none; }
  .feed .agent { display: none; }
  .chain { grid-template-columns: 1fr; }
  .cohorts, .cohorts.three, .pool { grid-template-columns: 1fr; }
  .t.atlas .sub { display: none; }  /* per-cohort hazard ratios: in each test's detail; keep the pooled result in view */
  .forest.wide { display: none; }
  .forest.compact { display: block; }
  .cohorts .arrow svg { transform: rotate(90deg); }
  .test { padding: 16px; }
  .panel { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .km .draw { stroke-dasharray: none; stroke-dashoffset: 0; }  /* no draw-in animation: show the curves at once */
  html { scroll-behavior: auto; }
}

/* ------------------------------------------------ human genetics and drug targets (genetics.js) */
.gx-lede { color: var(--ink-2); max-width: 78ch; }
.gx-h { font: 600 .95rem/1.3 var(--sans); margin: 24px 0 6px; color: var(--ink); }
.gx-rows { border-top: 1px solid var(--line-2); margin-top: 8px; }
.gx-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.25fr) minmax(0, 1.15fr) minmax(150px, .8fr); gap: 6px 22px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.gx-row p { margin: 0 0 4px; }
.gx-row h4 { margin: 0 0 4px; font: 400 1.2rem/1.2 var(--serif); }
.gx-k { font: 600 .7rem/1.4 var(--sans); letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.gx-dir > p:nth-child(2) { font: 400 1.02rem/1.35 var(--serif); }
.gx-v { display: inline-block; font: 600 .78rem/1.35 var(--sans); padding: 3px 8px; border-radius: 4px; background: var(--line); color: var(--ink-2); margin-bottom: 6px; }
.gx-v.good { background: var(--good-soft); color: var(--good); }
.gx-v.bad { background: var(--bad-soft); color: var(--bad); }
.gx-v.warn { background: var(--warn-soft); color: var(--warn); }
.gx-v.accent { background: var(--accent-soft); color: var(--accent); }
.gx-none { margin-top: 16px; font-size: .9rem; }
.gx-none summary { cursor: pointer; color: var(--accent); width: fit-content; }
.gx-none p { margin: 8px 0 0; }
.gx-foot { margin: 16px 0 0; }
.gx-list { margin: 4px 0 0; padding-left: 18px; }
.cohort p.small.gx-sub { margin-top: 6px; }
.gx-forest .sub { font: 400 10px var(--sans); fill: var(--ink-3); }
.gx-forest .ci.prim, .gx-forest .ci.rep { stroke: var(--accent); }
.gx-forest .pt.prim { fill: var(--accent); }
.gx-forest .ci.rep { stroke-dasharray: 3 2; }
.gx-forest .pt.rep { fill: var(--surface); stroke: var(--accent); stroke-width: 1.5; }
.gx-forest .ci.other { stroke: var(--line-2); }
.gx-forest .pt.other { fill: var(--ink-3); }
@media (max-width: 1000px) { .gx-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
@media (max-width: 560px) { .gx-row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }

/* ------------------------------------------------ probation and limits (vesting.js) */
.probation { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px; align-items: start; }
#probation-rules { max-width: 68ch; }
#standing-form label { display: block; font-weight: 600; font-size: .9rem; margin: 0 0 6px; }
#standing-id {
  width: 100%; font: 400 .85rem var(--mono); color: var(--ink); background: var(--bg); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 9px 12px; margin-bottom: 12px;
}
#standing-id:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
#standing-out { margin: 12px 0 0; }
.ledger-note { margin: 12px 0 0; }
@media (max-width: 960px) { .probation { grid-template-columns: minmax(0, 1fr); gap: 20px; } }
/* Trials with posted results (trials.js) */
.tr-funnel { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 4px 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.tr-funnel div { padding: 10px 14px; display: flex; flex-direction: column-reverse; justify-content: flex-end; min-width: 0; }
.tr-funnel div + div { border-left: 1px solid var(--line); }
.tr-funnel dt { font-size: .8rem; color: var(--ink-2); }
.tr-funnel dd { margin: 0; font: 400 1.5rem/1.2 var(--serif); font-variant-numeric: lining-nums tabular-nums; }
.tr-funnel div:last-child dd { color: var(--good); }
.tr-list { list-style: none; margin: 10px 0 12px; padding: 0; border-top: 1px solid var(--line); }
.tr-ex { padding: 9px 0; border-bottom: 1px solid var(--line); }
.tr-ex p { margin: 0; overflow-wrap: anywhere; }
.tr-ex-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 2px !important; }
.tr-ex-top .status { margin-left: auto; }
.family { background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; }
@media (max-width: 560px) {
  .tr-funnel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-funnel div:nth-child(3) { border-left: 0; }
  .tr-funnel div:nth-child(n+3) { border-top: 1px solid var(--line); }

.watch-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.watch-list li { line-height: 1.4; overflow-wrap: anywhere; }
