/* marked.bio
   Palette after an H&E slide: haematoxylin violet for structure and links,
   eosin pink as the highlighter that marks matched biomarker text. */
:root {
  --paper: #fbfbfd;
  --paper-2: #f2f1f7;
  --ink: #1f1d2b;
  --ink-2: #4a475a;
  --muted: #6a6780;
  --rule: #e2e0ea;
  --hema: #43398f;          /* links, headings accents (text contrast) */
  --chart: #5b4fc0;         /* chart marks (validated) */
  --eosin: #f7c6d4;         /* highlighter */
  --eosin-ink: #7a1f3d;
  --ok: #1f6f4a;  --ok-bg: #e3f2ea;
  --warn: #8a5208; --warn-bg: #fbefdc;
  --off: #6a6780; --off-bg: #eeedf2;
  --ph1: #d5d1f3; --ph2: #9d94e3; --ph3: #5b4fc0; --ph4: #2e2675; --pho: #cfcdd8;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --measure: 68ch;
  --wide: 72rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16151d; --paper-2: #1e1d28; --ink: #ecebf3; --ink-2: #c9c7d6; --muted: #a29fb6;
    --rule: #2e2c3b; --hema: #b9b2f6; --chart: #857ce0; --eosin: rgba(236, 120, 156, .34); --eosin-ink: #ffd9e4;
    --ok: #7fd3a6; --ok-bg: #173226; --warn: #f0b45f; --warn-bg: #352610; --off: #a29fb6; --off-bg: #25232f;
    --ph1: #3b3570; --ph2: #5f56b8; --ph3: #857ce0; --ph4: #c3bdf8; --pho: #3a3846;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #16151d; --paper-2: #1e1d28; --ink: #ecebf3; --ink-2: #c9c7d6; --muted: #a29fb6;
  --rule: #2e2c3b; --hema: #b9b2f6; --chart: #857ce0; --eosin: rgba(236, 120, 156, .34); --eosin-ink: #ffd9e4;
  --ok: #7fd3a6; --ok-bg: #173226; --warn: #f0b45f; --warn-bg: #352610; --off: #a29fb6; --off-bg: #25232f;
  --ph1: #3b3570; --ph2: #5f56b8; --ph3: #857ce0; --ph4: #c3bdf8; --pho: #3a3846;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 1rem/1.55 var(--sans); font-feature-settings: "tnum" 0;
}
a { color: var(--hema); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--hema); outline-offset: 2px; border-radius: 2px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--paper); padding: .5rem 1rem; }
.skip:focus { left: 1rem; z-index: 10; }

/* ---------- header and footer */
.site-header {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  max-width: var(--wide); margin: 0 auto; padding: 1rem 1rem .75rem;
  border-bottom: 1px solid var(--rule);
}
.wordmark {
  font: 600 1.35rem/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -.01em;
}
.wordmark .mk { background: linear-gradient(transparent 55%, var(--eosin) 55%, var(--eosin) 92%, transparent 92%); padding: 0 .05em; }
.wordmark .tld { color: var(--muted); font-weight: 400; }
.site-nav { margin-left: auto; font-size: .95rem; }
.search { position: relative; flex: 1 1 18rem; max-width: 28rem; }
.search input {
  width: 100%; font: inherit; font-size: .95rem; padding: .45rem .7rem; color: var(--ink);
  background: var(--paper-2); border: 1px solid var(--rule); border-radius: 6px;
}
.search-results {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: .25rem 0;
  list-style: none; background: var(--paper); border: 1px solid var(--rule); border-radius: 6px;
  box-shadow: 0 6px 24px rgba(20, 16, 50, .12);
}
.search-results a { display: block; padding: .45rem .75rem; text-decoration: none; color: var(--ink); }
.search-results a[aria-selected="true"], .search-results a:hover { background: var(--paper-2); }
.search-results .why { display: block; font-size: .82rem; color: var(--muted); }
.site-footer {
  max-width: var(--wide); margin: 4rem auto 0; padding: 1.25rem 1rem 2.5rem;
  border-top: 1px solid var(--rule); color: var(--muted); font-size: .88rem;
}
.site-footer p { margin: .25rem 0; }

main { max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: -.01em; }
h2 { font-size: 1.45rem; margin: 3rem 0 .5rem; }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: var(--measure); }
.sub { display: block; color: var(--muted); font-size: .86rem; font-weight: 400; }
.note, .section-note { color: var(--muted); font-size: .9rem; max-width: var(--measure); }
.empty { color: var(--muted); }

/* ---------- the highlighter: the one loud thing */
mark {
  color: var(--ink); background: var(--eosin); padding: .05em .2em; border-radius: .2em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.evidence { margin: .5rem 0 0; padding: 0 0 0 .9rem; border-left: 2px solid var(--rule); color: var(--ink-2); }
.evidence p { margin: 0; font-family: var(--serif); font-size: .98rem; line-height: 1.6; max-width: var(--measure); }

/* ---------- index */
.intro { padding: 3rem 0 1rem; }
.intro h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); max-width: 22ch; margin: 0 0 1rem; }
.example { margin: 2rem 0 0; max-width: 46rem; }
.example .evidence { border-left-color: var(--eosin); }
.example .evidence p { font-size: 1.25rem; }
.example figcaption { margin-top: .6rem; color: var(--muted); font-size: .9rem; }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data th, .data td { text-align: left; padding: .6rem .75rem .6rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data thead th { font-weight: 500; color: var(--muted); font-size: .86rem; border-bottom-color: var(--ink-2); }
.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.data tbody th { font-weight: 500; }
.data tbody th a { font-weight: 600; }
.group-row th { padding-top: 1.6rem; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--ink-2); border-bottom-color: var(--ink-2); }
.biomarker-list .data tbody th { width: 46%; }

/* ---------- biomarker page */
.bm-head { padding: 2.5rem 0 .5rem; }
.bm-head .kind { margin: 0; color: var(--muted); font-size: .95rem; }
.bm-head h1 { font-size: clamp(2.4rem, 6vw, 4rem); margin: .1rem 0 .75rem; }
.bm-head h1::after {
  /* the biomarker name gets the marker stroke */
  content: ""; display: block; width: 4.5rem; height: .45rem; margin-top: .35rem;
  background: var(--eosin); border-radius: 2px;
}
.updated { color: var(--muted); font-size: .9rem; margin: .25rem 0 1rem; }
.toc { display: flex; gap: 1.25rem; flex-wrap: wrap; font-size: .95rem; }

.snapshot { display: grid; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); gap: 2rem 3rem; margin: 2rem 0 0; }
.snapshot figure { margin: 0; }
.snapshot figcaption { font-weight: 600; font-size: .95rem; margin-bottom: .6rem; }
.chart { width: 100%; max-width: 30rem; height: auto; display: block; overflow: visible; }
.chart .mark { fill: var(--chart); }
.chart .baseline { stroke: var(--rule); stroke-width: 1; }
.chart .axis-label { fill: var(--muted); font: 11px var(--sans); }
.chart .value { fill: var(--ink-2); font: 600 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; }
.chart .bar:hover .mark { fill: var(--hema); }

.approvals .drug { font-weight: 600; }
.approvals .combo { font-weight: 400; color: var(--ink-2); }
.approvals details summary { cursor: pointer; list-style-position: outside; }
.approvals details[open] summary { margin-bottom: .4rem; }
.indications { margin: 0; font-size: .88rem; }
.indications dt { font-weight: 600; margin-top: .4rem; }
.indications dd { margin: 0; color: var(--ink-2); }
.approvals tr.inactive { color: var(--muted); }
.status-cell .st { font-weight: 500; }
.s-active .st { color: var(--ok); }
.s-active .st::before { content: "\2713\00a0"; }   /* check mark + label: never colour alone */
.s-withdrawn .st { color: var(--warn); }
.s-under_review .st { color: var(--ink-2); }
.s-none .st, .s-not_authorised .st { color: var(--muted); }

.tag {
  display: inline-block; font-size: .78rem; line-height: 1.3; padding: .1rem .45rem; margin: .25rem .3rem 0 0;
  border-radius: 999px; background: var(--off-bg); color: var(--off); font-weight: 500;
}
.tag.verify { background: transparent; border: 1px dashed var(--muted); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }

.companies { list-style: none; margin: 1rem 0 .5rem; padding: 0; max-width: 52rem; }
.companies li {
  display: grid; grid-template-columns: minmax(10rem, 16rem) 2.5rem 1fr; gap: .75rem; align-items: center;
  padding: .35rem 0; border-bottom: 1px solid var(--rule);
}
.co-name { font-weight: 500; }
.co-n { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.co-phases { display: flex; flex-wrap: wrap; gap: 2px; }
.ph { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--pho); }
.ph-earlyphase1, .ph-phase1 { background: var(--ph1); }
.ph-phase1-2, .ph-phase2 { background: var(--ph2); }
.ph-phase2-3, .ph-phase3 { background: var(--ph3); }
.ph-phase4 { background: var(--ph4); }
.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; font-size: .82rem; color: var(--muted); }
.legend .ph { margin-right: 2px; vertical-align: -1px; }

/* ---------- trial filters and list */
.filters {
  display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: center;
  margin: 1rem 0 .5rem; padding: .75rem 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.filters fieldset { border: 0; margin: 0; padding: 0; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.seg label { padding: .3rem .7rem; font-size: .9rem; cursor: pointer; border-right: 1px solid var(--rule); }
.seg label:last-child { border-right: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--ink); color: var(--paper); }
.seg label:has(input:focus-visible) { outline: 2px solid var(--hema); outline-offset: -2px; }
.filters select, .filters input[type="search"] {
  font: inherit; font-size: .9rem; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 6px; padding: .3rem .5rem;
}
.filters .sel { font-size: .9rem; display: inline-flex; gap: .4rem; align-items: center; }
.filters .txt { flex: 1 1 14rem; }
.filters .txt input { width: 100%; }
.filters .chk { font-size: .9rem; display: inline-flex; gap: .35rem; align-items: center; }
.count { color: var(--muted); font-size: .9rem; margin: .5rem 0; }

.trials { list-style: none; margin: 0; padding: 0; }
.trial { padding: 1.1rem 0; border-bottom: 1px solid var(--rule); }
.trial h3 { font: 600 1.05rem/1.35 var(--sans); margin: 0 0 .3rem; max-width: var(--measure); }
.trial h3 a { color: var(--ink); text-decoration: none; }
.trial h3 a:hover { color: var(--hema); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; gap: .2rem 1rem; margin: 0; font-size: .88rem; color: var(--ink-2); }
.meta .nct { color: var(--muted); font-variant-numeric: tabular-nums; }
.status { font-weight: 600; }
.status.s-recruiting { color: var(--ok); }
.status.s-recruiting::before { content: "\25CF\00a0"; }
.drugs { margin: .35rem 0 0; font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem .9rem; }
.drugs .drug { font-weight: 500; }
abbr.ok { text-decoration: none; font-size: .72rem; font-weight: 600; color: var(--ok); background: var(--ok-bg); padding: .05rem .3rem; border-radius: 3px; cursor: help; }
.flags { margin: .4rem 0 0; }
.flags .sub { display: inline; margin-left: .2rem; }

/* ---------- prose pages */
.prose { max-width: var(--measure); padding-top: 2rem; }
.prose h1 { font-size: 2.4rem; margin-bottom: .5rem; }
.prose dt { font-weight: 600; margin-top: 1rem; }
.prose dd { margin: .2rem 0 0; }
.prose li { margin: .3rem 0; }

@media (max-width: 40rem) {
  .site-nav { margin-left: 0; }
  .companies li { grid-template-columns: 1fr 2.5rem; }
  .co-phases { grid-column: 1 / -1; }
  .data th, .data td { padding-right: .5rem; }
  .filters { position: static; }
  /* approvals: one stacked block per therapy instead of a cramped table */
  table.approvals thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.approvals, .approvals tbody, .approvals tr, .approvals th, .approvals td { display: block; width: auto; }
  .approvals tr { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; padding: .8rem 0; border-bottom: 1px solid var(--rule); }
  .approvals tbody th { grid-column: 1 / -1; }
  .approvals td[data-label="Tumour"] { grid-column: 1 / -1; color: var(--ink-2); }
  .approvals th, .approvals td { border: 0; padding: 0; }
  .approvals td[data-label]::before { content: attr(data-label); display: block; font-size: .78rem; color: var(--muted); }
  .approvals td[data-label="Tumour"]::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
@media print {
  .site-header .search, .filters, .toc { display: none; }
  .trial[hidden] { display: none; }
  mark { background: none; text-decoration: underline; text-decoration-thickness: 2px; }
}
