/* COMPARE. Same look as TRACE: black ground, one amber accent. Tokens match the BioPharma Foundry front page. */
:root {
  --bg: #000000;
  --surface: #0a0a0b;
  --raised: #111113;
  --line: #232326;
  --line-strong: #3a3a3f;
  --ink: #f4f4f1;
  --soft: #b9b9bd;
  --muted: #8e8e93;
  --amber: #f2a93b;
  --amber-hi: #ffd08a;
  --amber-soft: rgba(242, 169, 59, 0.12);
  --danger: #ff8a65;
  --danger-soft: rgba(255, 138, 101, 0.1);
  --proj: rgba(255, 255, 255, 0.045);
  --font-display: lft-etica, sans-serif;
  --font-body: myriad-variable, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --on-amber: #000000;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-stretch: 95%;
  font-variation-settings: "wdth" 95;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--amber); text-decoration: none; }
a:hover { color: var(--amber-hi); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); }

.wrap {
  max-width: 1296px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px), 4vw);
  padding-right: max(16px, env(safe-area-inset-right, 0px), 4vw);
}
@media (min-width: 1400px) { .wrap { padding-left: 48px; padding-right: 48px; } }

/* Header */
.site-header { border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 32px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); min-width: 0; }
.brand:hover { color: var(--ink); }
.brand svg { flex: none; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: -0.02em; }
.brand-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand-name { line-height: 1.1; }
.brand-full { font-family: var(--font-mono); font-size: 11px; line-height: 1.25; color: var(--muted); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--soft); font-size: 15px; font-weight: 500; padding: 10px 14px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 4px; }
.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--amber); }

/* Page head */
.eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--amber); }
.page-head h1 { font-size: 34px; line-height: 1.1; }
.lede { color: var(--soft); font-size: 17px; max-width: 62ch; }

/* App layout */
.layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; padding-bottom: 56px; }
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.rail { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 920px) { .rail { position: static; } }
.main { display: flex; flex-direction: column; gap: 20px; min-width: 0; transition: opacity 0.15s; }
.main.stale { opacity: 0.35; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 18px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.panel-title { font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0; }
.panel-head .panel-title { margin: 0; }
.panel > .panel-title { margin-bottom: 14px; }
.panel > .panel-title + .field { margin-top: 0; }

label, .label { display: block; font-size: 13px; color: var(--soft); margin-bottom: 6px; }
textarea, input[type="number"], select {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  padding: 10px 12px;
  min-height: 44px;
}
textarea { height: 176px; resize: vertical; line-height: 1.5; white-space: pre; overflow: auto; }
select { font-family: var(--font-body); font-size: 14px; }
.field { margin-top: 14px; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.drop.over textarea { border-color: var(--amber); background: var(--amber-soft); }

.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn {
  font-family: var(--font-body); font-size: 14px; font-weight: 500; color: var(--ink);
  background: transparent; border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; margin: 0;
}
.btn:hover { border-color: var(--amber); color: var(--amber); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--on-amber); font-weight: 600; }
.btn.primary:hover { background: var(--amber-hi); border-color: var(--amber-hi); color: var(--on-amber); }
.btn input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.btn:focus-within { outline: 2px solid var(--amber); outline-offset: 3px; }

.msg { font-size: 14px; border-radius: 4px; padding: 10px 12px; margin-top: 12px; border: 1px solid var(--line-strong); color: var(--soft); background: var(--raised); }
.msg.err { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.msg.warn { color: var(--amber-hi); background: var(--amber-soft); border-color: var(--amber); }

/* Parameters */
.params { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; }
.param { padding: 16px 18px; border-right: 1px solid var(--line); min-width: 0; }
.param:last-child { border-right: 0; }
.param .sym { font-family: var(--font-display); font-size: 16px; color: var(--muted); }
.param .val { font-family: var(--font-mono); font-size: 30px; font-weight: 500; color: var(--amber); letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.param .cap { font-size: 13px; color: var(--muted); }
@media (max-width: 600px) {
  .params { grid-template-columns: minmax(0, 1fr); }
  .param { border-right: 0; border-bottom: 1px solid var(--line); }
  .param:last-child { border-bottom: 0; }
}

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 16px 20px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.stat b { display: block; font-family: var(--font-mono); font-weight: 500; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.reading { margin-top: 14px; color: var(--soft); max-width: 72ch; }

/* Charts */
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--amber); vertical-align: middle; margin-right: 7px; }
.legend i.dot { width: 8px; height: 8px; border: 0; border-radius: 50%; background: var(--ink); }
.legend i.dash { border-top-style: dashed; }
.chart { width: 100%; touch-action: pan-y; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-mono); font-size: 11.5px; fill: var(--muted); }
.chart text.lab { font-family: var(--font-body); font-size: 12px; }
.chart text.hot { fill: var(--amber); }
.chart .gl { stroke: var(--line); stroke-width: 1; }
.chart .ax { stroke: var(--line-strong); stroke-width: 1; }
.chart .cur { stroke: var(--ink); stroke-width: 1; opacity: 0; }
.chart .cdot { fill: var(--amber); stroke: var(--bg); stroke-width: 2; opacity: 0; }
.chart .area { fill: var(--amber-soft); }
.chart .fitline { fill: none; stroke: var(--amber); stroke-width: 2.4; stroke-linejoin: round; }
.chart .fitline.dash { stroke-dasharray: 6 5; }
.chart .actual { fill: var(--ink); }
.chart .region { fill: var(--proj); }
.chart .guide { stroke: var(--amber); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .guidedot { fill: var(--amber); }
.readout { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink); min-height: 22px; margin-top: 8px; font-variant-numeric: tabular-nums; }
.readout em { font-style: normal; color: var(--muted); }

/* Tables */
.tablewrap { overflow: auto; max-height: 320px; border: 1px solid var(--line); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-family: var(--font-mono); font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 10px; white-space: nowrap; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 12px; }
th { position: sticky; top: 0; background: var(--surface); color: var(--muted); font-family: var(--font-body); font-weight: 500; font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; }
td:first-child, th:first-child { text-align: left; }
tr.proj td { color: var(--muted); background: var(--proj); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .two { grid-template-columns: minmax(0, 1fr); } }
.export { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; justify-content: space-between; }
.export p { color: var(--muted); font-size: 14px; max-width: 56ch; }
.export .btns { margin-top: 0; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; color: var(--muted); font-size: 13px; }
.site-footer p { max-width: 70ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.site-footer nav a { color: var(--soft); }

/* Help page */
.help { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; padding-bottom: 72px; align-items: start; }
@media (max-width: 860px) { .help { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
.toc { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 860px) { .toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 6px; } }
.toc a { color: var(--soft); font-size: 14px; padding: 8px 10px; border-radius: 4px; min-height: 40px; display: inline-flex; align-items: center; }
.toc a:hover { color: var(--amber); background: var(--raised); }
.doc { font-family: myriad-variable, sans-serif; display: flex; flex-direction: column; gap: 44px; min-width: 0; max-width: 78ch; }
.doc section { scroll-margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.doc h2 { font-size: 28px; line-height: 1.1; }
.doc h3 { font-size: 18px; margin-top: 8px; }
.doc p, .doc li { color: var(--soft); font-size: 17px; line-height: 1.6; }
.doc ul, .doc ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc code { font-size: 13px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 1px 6px; color: var(--ink); }
.eq { font-family: var(--font-mono); font-size: 14px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; overflow-x: auto; white-space: pre; line-height: 1.7; }
.codeblock { font-family: var(--font-mono); font-size: 13px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 14px 16px; overflow-x: auto; white-space: pre; line-height: 1.6; }
.doc table { font-size: 13px; }
.doc td, .doc th { text-align: left; white-space: normal; vertical-align: top; }
.doc .tablewrap { max-height: none; }
details { border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
details summary { cursor: pointer; padding: 14px 16px; min-height: 48px; color: var(--ink); font-weight: 500; }
details[open] summary { border-bottom: 1px solid var(--line); }
details p { padding: 14px 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---- IMPACT additions ---- */
.layout { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); }
@media (max-width: 1000px) { .layout { grid-template-columns: minmax(0, 1fr); } }
.rail { position: static; }
input[type="text"] { width: 100%; font-family: var(--font-body); font-size: 14px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; padding: 10px 12px; min-height: 44px; }
input.mono { font-family: var(--font-mono); font-size: 13px; }
input.changed, textarea.changed { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber); }
textarea.small { height: 72px; white-space: pre-wrap; font-family: var(--font-body); font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
@media (max-width: 480px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sub { font-size: 13px; color: var(--muted); }
.scen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-bottom: 20px; }
.scen .lbl { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
.chip { font: 500 14px var(--font-body); color: var(--soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 16px; min-height: 44px; cursor: pointer; }
.chip:hover { border-color: var(--amber); color: var(--amber); }
.chip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); font-weight: 600; }
.chip.ghost { border-style: dashed; color: var(--muted); }
.scen .spacer { flex: 1 1 24px; }
.scen .sname { max-width: 260px; }
.drug { border: 1px solid var(--line); border-radius: 6px; padding: 14px; margin-top: 14px; background: var(--bg); }
.drug-head { display: flex; align-items: center; gap: 8px; }
.drug-head input { flex: 1 1 auto; font-weight: 600; }
.tag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--on-amber); background: var(--amber); border-radius: 3px; padding: 3px 7px; white-space: nowrap; }
.netline { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.netline b { color: var(--ink); font-family: var(--font-mono); font-weight: 500; }
.shares { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 0 8px; margin-top: 12px; }
.shares label { font-size: 12px; margin-bottom: 4px; }
.sumrow { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 14px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.sumrow span { padding: 3px 8px; border: 1px solid var(--line); border-radius: 3px; }
.sumrow span.bad { color: var(--amber-hi); border-color: var(--amber); background: var(--amber-soft); }
.iconbtn { font: 500 14px var(--font-body); color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; min-width: 44px; min-height: 44px; cursor: pointer; }
.iconbtn:hover { color: var(--danger); border-color: var(--danger); }
.row-item { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin-top: 12px; background: var(--bg); }
.row-item .top { display: flex; gap: 8px; align-items: flex-end; }
.row-item .top > div { flex: 1 1 auto; min-width: 0; }
.row-item .top .grow { flex: 2 1 auto; }
.row-item code { color: var(--amber); }
.preview { font-family: var(--font-mono); font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.preview b { color: var(--ink); font-weight: 500; }
.names { margin-top: 12px; font-size: 13px; color: var(--soft); }
.names code { font-size: 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; margin-right: 2px; color: var(--ink); }
.names dt { color: var(--muted); margin-top: 8px; }
.names dd { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 4px; }
.big { font-family: var(--font-mono); font-size: 28px; font-weight: 500; letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.big.hot { color: var(--amber); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; min-width: 0; }
.tile.hot { border-color: var(--amber); }
.tile .cap { font-size: 13px; color: var(--muted); }
.work td.mine, .work tr.mine td { color: var(--amber); }
.work tr.sep td { border-top: 1px solid var(--line-strong); }
.work tr.sec td { color: var(--muted); font-family: var(--font-body); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--raised); }
.work td.above { color: var(--amber-hi); }
.chart .bar { fill: var(--soft); }
.chart .bar.hot { fill: var(--amber); }
.chart .thr { stroke: var(--amber); stroke-width: 1.4; stroke-dasharray: 5 4; }
.chart .tor-lo { fill: var(--soft); }
.chart .tor-hi { fill: var(--amber); }
.chart .zero { stroke: var(--ink); stroke-width: 1; }
.chart text.val { fill: var(--ink); font-size: 12px; }
.chart text.num { fill: var(--soft); font-size: 11.5px; }
.notice { font-size: 13px; color: var(--muted); max-width: 80ch; }
.inline-select { width: auto; min-width: 96px; display: inline-block; }
.warnlist { margin: 0; padding-left: 18px; }
.tablewrap.tall { max-height: none; }

.basis { color: var(--muted); font-size: 14px; }
.math { font-family: "STIX Two Text", "Cambria Math", "Times New Roman", Georgia, serif; font-size: 18px; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; padding: 16px 20px; color: var(--ink); overflow-x: auto; }
.math .eqrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: baseline; padding: 8px 0; }
.math .eqrow + .eqrow { border-top: 1px solid var(--line); }
.math .eqno { color: var(--muted); font-family: var(--font-mono); font-size: 13px; }
.math var { font-style: italic; }
.math sub, .math sup { font-size: 0.7em; line-height: 0; }
.doc .words { color: var(--soft); font-size: 14.5px; margin-top: -6px; }
.doc .ref { font-size: 14px; }
.doc sup.cite { font-size: 0.72em; line-height: 0; margin-left: 1px; color: var(--muted); }
.doc ol.refs { padding-left: 28px; }
.doc .note { border-left: 2px solid var(--amber); padding: 4px 0 4px 14px; color: var(--soft); }

/* Report: set out like a printed document */
.report { background: #fff; color: #111; border-radius: 6px; margin: 0 0 56px; padding: 40px 44px; font-family: myriad-variable, sans-serif; font-size: 14px; line-height: 1.55; }
.report h1 { font-family: var(--font-display); font-size: 30px; color: #000; margin: 6px 0; letter-spacing: -0.02em; }
.report h2 { font-family: var(--font-display); font-size: 18px; color: #000; margin: 28px 0 10px; padding-bottom: 6px; border-bottom: 1px solid #ccc; }
.report h3 { font-size: 15px; margin: 18px 0 8px; color: #000; }
.report .rbrand { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: #8a5a00; }
.report .rmeta { color: #444; }
.report p { margin: 8px 0; max-width: 90ch; }
.report table { width: 100%; font-size: 12.5px; margin: 10px 0; }
.report th, .report td { border-bottom: 1px solid #ddd; padding: 6px 8px; color: #111; background: transparent; position: static; white-space: normal; text-align: right; vertical-align: top; }
.report th { color: #444; font-family: var(--font-body); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; text-align: right; }
.report th:first-child, .report td:first-child { text-align: left; }
.report table.kv td:last-child { text-align: left; }
.report .math { background: #f6f6f4; border-color: #ddd; color: #111; font-size: 16px; }
.report .math p { margin: 4px 0; }
.report code { font-family: var(--font-mono); font-size: 12px; background: #f1f1ee; padding: 1px 5px; border-radius: 3px; color: #111; }
.report .none, .report .src { color: #555; }
.report ul { padding-left: 20px; }
@media (max-width: 700px) { .report { padding: 22px 16px; overflow-x: auto; } }
.report table { font-family: var(--font-body); }
.report table.kv th:last-child, .report table.kv td:last-child { text-align: left; }
.report table.kv td:first-child { width: 28%; color: #444; }
.report td, .report th { font-variant-numeric: tabular-nums; }

/* Light background. Chosen with the toggle in the header; Method and Help open light the first time. */
html[data-theme="light"] {
  --bg: #fafaf8;
  --surface: #ffffff;
  --raised: #f1f1ee;
  --line: #e3e3de;
  --line-strong: #c8c8c1;
  --ink: #111113;
  --soft: #46464c;
  --muted: #6a6a72;
  --amber: #a85f00;
  --amber-hi: #7a4400;
  --amber-soft: rgba(168, 95, 0, 0.1);
  --danger: #b3401a;
  --danger-soft: rgba(179, 64, 26, 0.08);
  --proj: rgba(0, 0, 0, 0.04);
  --on-amber: #ffffff;
  color-scheme: light;
}
html[data-theme="light"] .report { border: 1px solid var(--line); }
.themebtn { font: inherit; color: var(--soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; margin-left: 8px; }
.themebtn:hover { color: var(--amber); border-color: var(--amber); }

[hidden] { display: none !important; }

/* ---- COMPARE ---------------------------------------------------------------------------------------------- */
input[type="search"] { width: 100%; font-family: var(--font-body); font-size: 15px; color: var(--ink); background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; padding: 10px 12px; min-height: 44px; }
input[type="search"]::placeholder { color: var(--muted); }
.searchbar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; margin-bottom: 16px; }
.sfield { flex: 1 1 320px; min-width: 0; }
.sfield.narrow { flex: 0 1 220px; }
.sfield label { margin-bottom: 6px; }
.searchbar .btn { min-height: 44px; padding-left: 24px; padding-right: 24px; }

.status { padding: 12px 14px; border: 1px solid var(--line); border-radius: 4px; color: var(--soft); margin-bottom: 16px; }
.status.error { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }

.results { padding-bottom: 56px; }
.res-head { margin-bottom: 12px; }
.reslist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rescard { display: flex; align-items: flex-start; gap: 14px; width: 100%; margin: 0; text-align: left; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; cursor: pointer; }
.rescard input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--amber); cursor: pointer; }
.rescard.on { border-color: var(--amber); }
.rc-body { display: grid; gap: 4px; min-width: 0; }
.rc-dm { position: absolute; top: 14px; right: 16px; font-size: 14px; }
.rescard:hover { border-color: var(--amber); }
.rc-title { font-family: var(--font-display); font-weight: 600; font-size: 20px; letter-spacing: -0.01em; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-stretch: 95%; font-variation-settings: "wdth" 95; }
.rc-title small { font-family: var(--font-mono); font-weight: 400; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.rc-meta { color: var(--muted); font-size: 14px; }
.rc-go { color: var(--amber); font-size: 14px; font-weight: 500; }

.lhead { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-start; margin-bottom: 16px; }
.ltitle { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.drugname { font-size: 34px; line-height: 1.1; overflow-wrap: anywhere; }
.drugsub { font-family: var(--font-mono); font-size: 13px; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lchip { font-size: 13px; color: var(--soft); border: 1px solid var(--line-strong); border-radius: 999px; padding: 3px 12px; }
.lacts { display: flex; flex-wrap: wrap; gap: 8px; }
.lhead > .btn { align-self: flex-start; }

.lfind { margin-bottom: 20px; }
.findrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.findrow input { flex: 1 1 260px; width: auto; }
.findcount { color: var(--muted); font-size: 13px; min-width: 7em; }

.lgrid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; padding-bottom: 56px; }
.snav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; display: flex; flex-direction: column; gap: 2px; padding-right: 6px; }
.snav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--soft); font-size: 14px; line-height: 1.3; padding: 8px 10px; min-height: 36px; border-radius: 4px; border-left: 2px solid transparent; }
.snav a:hover { color: var(--amber); background: var(--raised); }
.snav a[aria-current="true"] { color: var(--amber); background: var(--raised); border-left-color: var(--amber); }
.snav a.dim { opacity: 0.4; }
.snav-top { font-weight: 600; }
.snav-group { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 16px 10px 4px; }
.cnt { font-family: var(--font-mono); font-size: 11px; background: var(--amber-soft); color: var(--amber); border-radius: 999px; padding: 1px 8px; flex: none; }

.lbody { min-width: 0; }
.lsec { scroll-margin-top: 16px; padding-bottom: 30px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.lsec:last-child { border-bottom: 0; }
.lsec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.lsec h2 { font-size: 26px; line-height: 1.15; }
.copybtn { font: inherit; font-size: 12.5px; color: var(--muted); background: transparent; border: 1px solid var(--line-strong); border-radius: 4px; padding: 4px 10px; min-height: 32px; cursor: pointer; flex: none; }
.copybtn:hover { color: var(--amber); border-color: var(--amber); }
.sbody { max-width: 78ch; font-size: 17px; line-height: 1.65; color: var(--soft); display: flex; flex-direction: column; gap: 12px; }
.sbody h3 { font-size: 18px; color: var(--ink); margin-top: 10px; }
.subnum { font-family: var(--font-mono); font-size: 12px; color: var(--amber); border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 6px; vertical-align: 1px; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px 24px; margin: 0 0 18px; }
.facts dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }
.facts dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; font-size: 15px; }
.facts dd.mono { font-size: 13px; }
.src { font-size: 14px; color: var(--muted); max-width: 78ch; }
.warnbox { border: 1px solid var(--danger); background: var(--danger-soft); color: var(--danger); border-radius: 4px; padding: 10px 14px; margin-top: 12px; }
mark.hit { background: rgba(242, 169, 59, 0.32); color: inherit; border-radius: 2px; padding: 0 1px; }
mark.hit.cur { background: var(--amber); color: var(--on-amber); }
.lbody table, .cmpgrid table { font-family: var(--font-body); font-size: 14px; }
.lbody th, .lbody td, .cmpgrid th, .cmpgrid td { text-align: left; white-space: normal; vertical-align: top; }
.lbody th, .cmpgrid th { position: static; }
.lbody caption, .cmpgrid caption { text-align: left; color: var(--muted); font-size: 13px; padding: 8px 12px; caption-side: top; }

.resitem { position: relative; }
.resitem .rescard { padding-right: 130px; }
.pick { position: absolute; top: 12px; right: 14px; display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--soft); cursor: pointer; min-height: 32px; }
.pick input { width: 18px; height: 18px; accent-color: var(--amber); margin: 0; cursor: pointer; }
.pick.on { color: var(--amber); }
.tray { position: sticky; bottom: 0; z-index: 6; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; background: var(--raised); border: 1px solid var(--line-strong); border-radius: 6px; padding: 10px 14px; margin: 0 0 16px; }
.tray-title { font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }
.tray-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; min-width: 0; }
.tray-list li { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 13px; color: var(--ink); }
.tray-list button { font: inherit; color: var(--muted); background: transparent; border: 0; cursor: pointer; width: 28px; height: 28px; border-radius: 50%; }
.tray-list button:hover { color: var(--amber); }
.tray .btn { min-height: 38px; }

.cmpview { padding-bottom: 56px; }
.cmpctl { margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px; }
.cmpctl .label { margin: 0; }
.secpick { display: flex; flex-wrap: wrap; gap: 8px; }
.secchip { font: 500 14px var(--font-body); color: var(--soft); background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 14px; min-height: 36px; cursor: pointer; }
.secchip:hover { border-color: var(--amber); color: var(--amber); }
.secchip[aria-pressed="true"] { background: var(--amber); border-color: var(--amber); color: var(--on-amber); font-weight: 600; }
.difftoggle { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; color: var(--ink); cursor: pointer; }
.difftoggle input { width: 18px; height: 18px; accent-color: var(--amber); margin: 0; }
.cmpwrap { min-width: 0; }
.cmpgrid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 28px; align-items: start; }
.cmpgrid.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmpgrid.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmpgrid.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.viewing .page-head, .viewing .searchbar { display: none; }
.chead { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 10px 0 12px; border-bottom: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ctitle { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ctitle h3 { font-size: 20px; line-height: 1.15; overflow-wrap: anywhere; }
.cnum { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--amber); color: var(--on-amber); font-family: var(--font-mono); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.cmeta { color: var(--muted); font-size: 13px; }
.cacts { display: flex; gap: 6px; margin-top: 4px; }
.crowtitle { grid-column: 1 / -1; margin: 28px 0 10px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
h2.crowtitle.sec, div.crowtitle.sec { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 20px; font-family: var(--font-display); font-size: 22px; letter-spacing: -0.02em; text-transform: none; color: var(--ink); padding-bottom: 8px; border-bottom: 1px solid var(--line); scroll-margin-top: 130px; }
.ccell { min-width: 0; }
.cbody { font-size: 15.5px; line-height: 1.6; }
.cbody p { overflow-wrap: anywhere; }
.ccell .muted, .ccell.none .muted { color: var(--muted); font-style: italic; }
.same { display: inline-block; font-family: var(--font-mono); font-size: 11.5px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 2px 10px; margin-bottom: 8px; }
.chg { background: rgba(242, 169, 59, 0.28); border-radius: 2px; box-shadow: 0 0 0 1px rgba(242, 169, 59, 0.28); }
.facts.mini { grid-template-columns: 1fr; gap: 10px; margin: 0; }
.facts.mini dd { font-size: 14px; }
.facts dd.none { color: var(--muted); }

@media (max-width: 900px) {
  .lgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .snav { position: sticky; top: 0; z-index: 5; flex-direction: row; align-items: center; max-height: none; overflow-x: auto; overflow-y: hidden; padding: 8px 0; margin: 0 calc(-1 * max(16px, 4vw)); padding-left: max(16px, 4vw); padding-right: max(16px, 4vw); background: var(--bg); border-bottom: 1px solid var(--line); white-space: nowrap; scrollbar-width: thin; }
  .snav a { flex: none; border-left: 0; border-bottom: 2px solid transparent; }
  .snav a[aria-current="true"] { border-bottom-color: var(--amber); }
  .snav-group { display: none; }
  .lsec { scroll-margin-top: 64px; }
  .drugname { font-size: 28px; }
  .resitem .rescard { padding-right: 16px; padding-bottom: 46px; }
  .pick { top: auto; bottom: 10px; right: 14px; }
  .cmpwrap { overflow-x: auto; margin: 0 calc(-1 * max(16px, 4vw)); padding: 0 max(16px, 4vw); scroll-snap-type: x proximity; }
  .cmpgrid.n2 { grid-template-columns: repeat(2, minmax(82vw, 1fr)); }
  .cmpgrid.n3 { grid-template-columns: repeat(3, minmax(82vw, 1fr)); }
  .cmpgrid.n4 { grid-template-columns: repeat(4, minmax(82vw, 1fr)); }
  .chead { position: static; }
  .crowtitle { grid-column: 1 / -1; position: sticky; left: 0; }
}

@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .searchbar, .status, .lfind, .snav, .lacts, .lhead > .btn, .copybtn, .themebtn, .tray, .cmpctl, .cacts { display: none !important; }
  .cmpgrid { gap: 0 16px; }
  .chead { position: static; }
  .page-head { display: none; }
  .lgrid { display: block; }
  .sbody, .facts dd, .drugname, .lsec h2, .sbody h3 { color: #000 !important; }
  .lsec { break-inside: auto; border-color: #bbb; }
  .lsec h2 { break-after: avoid; }
  mark.hit { background: none; }
}

.cmplayout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 0 28px; align-items: start; }
.cmphint { grid-column: 1 / -1; margin: 0 0 12px; }
.snav a.part { opacity: 0.75; }
.secchip-n { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
@media (max-width: 900px) { .cmplayout { grid-template-columns: minmax(0, 1fr); } }

/* COMPARE compare view, calmer layout */
.cmpbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.cmptitle { flex: 1 1 auto; font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.cmpbtns { display: flex; gap: 18px; }
.tlink { font: 500 14px var(--font-body); color: var(--soft); background: none; border: 0; padding: 6px 0; min-height: 32px; cursor: pointer; text-decoration: none; }
.tlink:hover { color: var(--amber); }
.tlink.back { color: var(--ink); }
.chead { gap: 2px; padding: 8px 0 12px; }
.chead .cacts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin-top: 6px; }
.boxedtag { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--amber); border: 1px solid var(--amber); border-radius: 3px; padding: 1px 7px; }
.glance { margin: 0 0 28px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.glance summary { cursor: pointer; padding: 12px 16px; font-size: 14px; color: var(--soft); list-style: none; }
.glance summary::before { content: '+'; display: inline-block; width: 18px; color: var(--amber); }
.glance[open] summary::before { content: '–'; }
.glance .tablewrap { margin: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.facttable th, .facttable td { font-size: 14px; white-space: normal; text-align: left; vertical-align: top; }
.facttable tbody th { color: var(--muted); font-weight: 500; position: static; }
.facttable td.none { color: var(--muted); }
.snav a { border-radius: 0; }
.snav-group { padding-top: 22px; }

/* three product inputs; one-label view */
.products .sfield { flex: 1 1 200px; }
.products .sfield .opt { color: var(--muted); font-weight: 400; }
.cmpgrid.n1 { grid-template-columns: minmax(0, 1fr); }
.cmpgrid.n1 .cbody { max-width: 82ch; }
.cnote { font-size: 12.5px; color: var(--muted); }
.calt { display: inline-flex; }
.altsel { max-width: 100%; font: inherit; font-size: 13px; }

/* home: same hero as EXPIRY */
body { font-weight: 450; }
.hero { min-height: 52vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; padding: 48px 0; }
.hero h1 { font-size: 40px; line-height: 1.1; }
.hero .lede { max-width: 56ch; margin: 0; }
.products { width: 100%; max-width: 1000px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.prow { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pbox { text-align: left; }
.pbox label { display: block; font-size: 13px; color: var(--soft); margin: 0 0 6px; }
.pbox .opt { color: var(--muted); }
.pbox input { width: 100%; box-sizing: border-box; font: inherit; font-size: 18px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; padding: 16px 18px; outline: none; }
.pbox input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.products .btn.primary { min-height: 48px; padding: 0 32px; font-size: 16px; }
.viewing .hero { display: none; }
@media (max-width: 760px) { .prow { grid-template-columns: minmax(0, 1fr); } .hero h1 { font-size: 32px; } }

#status { margin-top: 16px; }
.fineprint { max-width: 62ch; margin: 0; font-size: 13px; color: var(--muted); }

.pbox { position: relative; }
.sugg { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--bg); border: 1px solid var(--line-strong); border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .12); max-height: 320px; overflow-y: auto; }
.sugg[hidden] { display: none; }
.sugg li { display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: 3px; cursor: pointer; }
.sugg li:hover, .sugg li[aria-selected="true"] { background: var(--soft-bg, rgba(127, 127, 127, .14)); }
.sugg .sname { font-weight: 600; font-size: 14px; }
.sugg .scomp { font-size: 12.5px; color: var(--muted); }
