/* ============================================================
   IGPRG — "The Blind Spot"
   Refined editorial data-journalism, dark "ink" theme.
   ============================================================ */

:root {
  /* --- ink palette: deep desaturated navy/charcoal, not pure black --- */
  --ink-900: #0b1019;   /* page base */
  --ink-850: #0e1422;
  --ink-800: #121a2c;   /* panels */
  --ink-700: #18223a;
  --ink-600: #22304f;
  --hair:    rgba(150, 170, 210, 0.13);
  --hair-strong: rgba(160, 180, 220, 0.24);

  /* --- type colours --- */
  --paper:   #eef2fb;   /* near-white headline */
  --text:    #c6cfe2;   /* body */
  --muted:   #8090ab;   /* labels / captions */
  --faint:   #5d6c89;

  /* --- sector palette --- */
  --public:  #4cc4d6;   /* NSW Health — trustworthy cool teal */
  --private: #e9a542;   /* commercial — warm amber */
  --academic:#9d7cf0;   /* academic — violet */
  --unclass: #6c7a96;   /* unclassified — muted grey */

  /* --- THE signal colour: outside governance / the blind spot --- */
  --accent:  #ffd24a;   /* luminous gold */
  --accent-hot: #ffe79a;
  --accent-glow: rgba(255, 210, 74, 0.55);

  /* --- provenance / triangulation source colours (mirror the hero) --- */
  --reg-anzctr: #3a6ea8;   /* ANZCTR registry — blue */
  --reg-ctgov:  #7a5fc0;   /* ClinicalTrials.gov — violet */
  --gov-teal:   #4cc4d6;   /* NSW governance — public teal */

  /* --- choropleth sequential ramp (dark-theme teal->gold), used in legends --- */
  --choro-0: #14233a;
  --choro-1: #1d3a52;
  --choro-2: #225f6e;
  --choro-3: #2f8f8c;
  --choro-4: #6fbf91;
  --choro-5: #d8c45a;

  --r: 14px;
  --maxw: 1280px;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Spline Sans", ui-sans-serif, system-ui, sans-serif;

  /* tabular lining figures everywhere data appears */
  --num: "Spline Sans", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* tabular figures helper */
.tnum, [data-count], .hero-title, .readout-figure, .readout-total-fig,
.map-stat-fig, .tri-bar, .size-legend, .natstat-fig, .pc-fig {
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* ===================== ATMOSPHERE ===================== */
.atmos {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.mesh {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}
.mesh-a {
  width: 60vw; height: 60vw;
  top: -22vw; left: -14vw;
  background: radial-gradient(circle, rgba(76, 196, 214, 0.20), transparent 65%);
}
.mesh-b {
  width: 50vw; height: 50vw;
  top: 8vh; right: -16vw;
  background: radial-gradient(circle, rgba(255, 210, 74, 0.14), transparent 62%);
}
.mesh-c {
  width: 55vw; height: 55vw;
  bottom: -20vw; left: 18vw;
  background: radial-gradient(circle, rgba(157, 124, 240, 0.12), transparent 64%);
}
.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

main, .masthead, .footer { position: relative; z-index: 1; }

/* ===================== MASTHEAD ===================== */
.masthead {
  border-bottom: 1px solid var(--hair);
  backdrop-filter: blur(6px);
}
.masthead-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 16px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.kicker {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
}
.kicker-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px 1px var(--accent-glow);
}
.masthead-meta {
  font-size: 12.5px; letter-spacing: 0.06em; color: var(--faint);
}

/* ===================== SHARED ===================== */
.eyebrow {
  font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 18px;
}
.title-em { font-style: italic; color: var(--paper); }
.accent-text { color: var(--accent); }

/* ===================== HERO ===================== */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 72px 40px 40px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 4.6vw, 4.3rem);
  line-height: 1.02;
  letter-spacing: -0.018em;
  color: var(--paper);
  margin: 0 0 22px;
}
.hero-lede {
  font-size: 1.12rem;
  color: var(--text);
  max-width: 38ch;
  margin: 0 0 34px;
}

/* readout */
.hero-readout {
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  padding: 26px 0;
  margin-bottom: 30px;
}
.readout-row { display: flex; align-items: baseline; gap: 20px; }
.readout-figure {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 4.4vw, 3.6rem);
  line-height: 1;
  color: var(--public);
  min-width: 3.4ch;
  text-align: right;
}
.readout-figure.accent {
  color: var(--accent);
  text-shadow: 0 0 26px var(--accent-glow);
}
.readout-label { display: flex; flex-direction: column; }
.readout-key {
  font-size: 1.02rem; font-weight: 600; color: var(--paper); letter-spacing: 0.01em;
}
.readout-key.accent-text { color: var(--accent-hot); }
.readout-sub { font-size: 0.9rem; color: var(--muted); }
.readout-divider {
  height: 1px; margin: 18px 0;
  background: linear-gradient(90deg, var(--hair-strong), transparent);
}
.readout-total {
  display: flex; align-items: baseline; gap: 12px;
  margin-top: 22px; padding-top: 18px;
  border-top: 1px dashed var(--hair);
}
.readout-total-fig {
  font-family: var(--serif); font-weight: 500;
  font-size: 1.5rem; color: var(--paper);
}
.readout-total-label { font-size: 0.88rem; color: var(--faint); }

/* triangulation */
.triangulation { margin: 0; }
.triangulation figcaption { display: flex; flex-direction: column; margin-bottom: 12px; }
.tri-title {
  font-size: 0.82rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600;
}
.tri-note { font-size: 0.84rem; color: var(--faint); max-width: 50ch; }
.tri-bar {
  display: flex; width: 100%; height: 30px;
  border-radius: 6px; overflow: hidden;
  background: var(--ink-800);
  box-shadow: inset 0 0 0 1px var(--hair);
}
.tri-seg {
  height: 100%; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 600; color: var(--ink-900);
  width: 0;
  transition: width 1.1s cubic-bezier(.22,.61,.36,1);
  white-space: nowrap; overflow: hidden;
}
.tri-legend {
  display: flex; flex-wrap: wrap; gap: 18px 26px; margin-top: 14px;
}
.tri-leg-item { display: flex; align-items: baseline; gap: 8px; font-size: 0.86rem; color: var(--text); }
.tri-leg-sw { width: 11px; height: 11px; border-radius: 3px; align-self: center; flex: none; }
.tri-leg-n { font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums; }
.tri-leg-k { color: var(--muted); }

/* hero visual */
.hero-visual { display: flex; justify-content: center; }
.visual-frame {
  position: relative;
  width: 100%;
  max-width: 480px;
  background:
    radial-gradient(120% 80% at 50% 18%, rgba(76,196,214,0.06), transparent 60%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 22px 22px 16px;
  box-shadow: 0 30px 70px -40px rgba(0,0,0,0.8);
}
#heroViz { width: 100%; height: auto; display: block; }
.visual-caption {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--hair);
  font-size: 0.84rem; color: var(--muted);
}
.vc-line { display: flex; align-items: center; gap: 9px; }
.vc-swatch { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.swatch-public { background: var(--public); }
.swatch-accent {
  background: var(--accent);
  box-shadow: 0 0 10px 1px var(--accent-glow);
}
.vc-blind { color: var(--accent-hot); }

/* scroll cue */
.scroll-cue {
  display: flex; align-items: center; gap: 10px;
  justify-content: center;
  margin-top: 40px;
  color: var(--muted); font-size: 0.82rem;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.scroll-cue svg { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(4px)} }

/* ===================== MAP SECTION ===================== */
.mapsec {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 40px 30px;
}
.mapsec-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 40px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.mapsec-headtext h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.mapsec-lede { font-size: 1.04rem; color: var(--text); max-width: 56ch; margin: 0; }

.mapsec-controls { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.toggle {
  display: inline-flex; padding: 4px;
  background: var(--ink-800); border: 1px solid var(--hair);
  border-radius: 10px;
}
.toggle-btn {
  appearance: none; border: none; cursor: pointer;
  background: transparent; color: var(--muted);
  font-family: var(--sans); font-size: 0.9rem; font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 18px; border-radius: 7px;
  transition: color .25s, background .25s, box-shadow .25s;
}
.toggle-btn:hover { color: var(--text); }
.toggle-btn.is-active {
  color: var(--ink-900); background: var(--accent);
  box-shadow: 0 0 18px -2px var(--accent-glow);
}
.toggle-hint { font-size: 0.82rem; color: var(--faint); margin: 0; }

.map-wrap {
  display: grid;
  grid-template-columns: 1fr 264px;
  gap: 28px;
  align-items: start;
}
.map-stage {
  position: relative;
  background:
    radial-gradient(90% 70% at 60% 30%, rgba(157,124,240,0.05), transparent 60%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair);
  border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 30px 80px -50px rgba(0,0,0,0.9);
}
#mapViz { width: 100%; height: auto; display: block; }

/* map geometry */
.nsw-fill {
  fill: rgba(120, 150, 200, 0.045);
  stroke: var(--hair-strong);
  stroke-width: 1.1;
  stroke-linejoin: round;
}
.graticule { fill: none; stroke: rgba(150,170,210,0.05); stroke-width: 0.6; }
.map-label {
  fill: var(--faint); font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
}
.map-label.city { fill: var(--muted); text-transform: none; letter-spacing: 0.02em; font-size: 11.5px; }
.city-tick { fill: var(--muted); }

/* site circles */
.site {
  cursor: pointer;
  transition: opacity .2s;
}
.site-dot { transition: stroke-width .15s, filter .15s; }
.site.outside .site-dot { } /* lit ones get glow via filter in JS/inline */
/* during an active map zoom, drop the per-dot SVG blur (re-rasterising ~200
   filtered circles per frame is what made deep zoom lag) — restored on zoom end */
#mapViz g.layer-facilities.zooming .site-dot { filter: none !important; }
.map-stage.dim .site:not(.hl) { opacity: 0.28; }

/* cross-filter emphasis: when any dashboard filter is active, the facilities
   touched by the filtered trials read at full strength, the rest fall back. */
.map-stage.xf-active .site.xf-dim { opacity: 0.1; }
.map-stage.xf-active .site.xf-hit { opacity: 1; }
.site.xf-dim, .site.xf-hit { transition: opacity .35s ease; }
@media (prefers-reduced-motion: reduce) {
  .site.xf-dim, .site.xf-hit { transition: none; }
}

/* tooltip */
.map-tooltip {
  position: absolute;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -112%);
  transition: opacity .14s;
  background: rgba(10, 15, 26, 0.96);
  border: 1px solid var(--hair-strong);
  border-radius: 10px;
  padding: 11px 14px;
  min-width: 180px; max-width: 250px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.9);
  z-index: 5;
}
.map-tooltip.show { opacity: 1; }
.tt-name {
  font-weight: 600; color: var(--paper); font-size: 0.92rem;
  line-height: 1.25; margin-bottom: 6px;
}
.tt-row { display: flex; justify-content: space-between; gap: 14px; font-size: 0.82rem; }
.tt-row + .tt-row { margin-top: 2px; }
.tt-k { color: var(--muted); }
.tt-v { color: var(--text); font-weight: 500; }
.tt-v.tnum { font-variant-numeric: tabular-nums; }
.tt-sector { display: inline-flex; align-items: center; gap: 6px; }
.tt-sector-sw { width: 9px; height: 9px; border-radius: 50%; }
.tt-gov {
  margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--hair);
  font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase;
}
.tt-gov.outside { color: var(--accent); }
.tt-gov.inside { color: var(--public); }

/* side panel */
.map-side { display: flex; flex-direction: column; gap: 22px; }
.legend {
  background: var(--ink-800);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 16px 18px;
}
.legend-title {
  font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 12px;
}
.legend-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; cursor: pointer; }
.legend-item .li-sw {
  width: 13px; height: 13px; border-radius: 50%; flex: none;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.02);
}
.legend-item .li-name { color: var(--text); }
.legend-item .li-n { margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; font-size: 0.82rem; }
.legend-item.outside-flag .li-name { color: var(--accent-hot); }
.legend-item.is-muted { opacity: 0.4; }

.size-legend { display: flex; align-items: flex-end; gap: 16px; padding: 6px 2px 2px; }
.size-bub { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.size-bub .sb-circle {
  border-radius: 50%;
  border: 1px solid var(--hair-strong);
  background: rgba(120,150,200,0.08);
}
.size-bub .sb-n { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.map-stat {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 16px 18px;
}
.map-stat-fig {
  font-family: var(--serif); font-weight: 600; font-size: 2.1rem;
  color: var(--paper); line-height: 1;
}
.map-stat-label { font-size: 0.86rem; color: var(--muted); margin-top: 2px; }
.map-stat-note { font-size: 0.8rem; color: var(--faint); margin: 10px 0 0; }

/* ===================== ACT III — DASHBOARD ===================== */
.dash {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 70px 40px 30px;
}
.dash-head { margin-bottom: 26px; }
.dash-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.dash-lede { font-size: 1.04rem; color: var(--text); max-width: 66ch; margin: 0; }

/* (a) sticky filter command bar */
.cmdbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(14,20,34,0.96), rgba(14,20,34,0.9));
  backdrop-filter: blur(10px);
  border: 1px solid var(--hair);
  border-radius: var(--r);
  padding: 16px 20px;
  margin-bottom: 26px;
  box-shadow: 0 18px 50px -34px rgba(0,0,0,0.9);
}
.cmd-figs {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 14px 26px;
}
.cf { display: flex; flex-direction: column; line-height: 1; }
.cf-fig {
  font-family: var(--serif); font-weight: 600; font-size: 1.7rem;
  color: var(--paper);
}
.cf-fig.cf-within { color: var(--public); }
.cf-fig.cf-outside { color: var(--accent); }
.cf-lab { font-size: 0.78rem; color: var(--muted); margin-top: 5px; }
.cf-of { color: var(--faint); }
.cf-sep { width: 1px; align-self: stretch; background: var(--hair); margin: 2px 0; }

.cmd-tools {
  display: flex; align-items: center; gap: 12px;
  margin-top: 16px;
}
.cmd-search {
  display: flex; align-items: center; gap: 9px; flex: 1 1 auto;
  background: var(--ink-900); border: 1px solid var(--hair);
  border-radius: 9px; padding: 9px 13px;
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.cmd-search:focus-within {
  border-color: var(--hair-strong);
  box-shadow: 0 0 0 3px rgba(255,210,74,0.08);
}
.cmd-search svg { flex: none; color: var(--muted); }
.cmd-search input {
  appearance: none; border: none; outline: none; background: transparent;
  flex: 1 1 auto; min-width: 0;
  font-family: var(--sans); font-size: 0.92rem; color: var(--text);
}
.cmd-search input::placeholder { color: var(--faint); }
.clear-all {
  appearance: none; cursor: pointer; flex: none;
  background: transparent; color: var(--accent-hot);
  border: 1px solid var(--hair-strong); border-radius: 9px;
  font-family: var(--sans); font-size: 0.84rem; font-weight: 600;
  padding: 9px 15px;
  transition: background .2s, color .2s, border-color .2s;
}
.clear-all:hover { background: rgba(255,210,74,0.1); border-color: var(--accent-glow); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink-700); border: 1px solid var(--hair-strong);
  border-radius: 999px; padding: 5px 7px 5px 12px;
  font-size: 0.8rem; color: var(--text);
}
.chip .chip-dim { color: var(--faint); }
.chip .chip-val { color: var(--paper); font-weight: 500; }
.chip .chip-x {
  appearance: none; cursor: pointer; border: none;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(150,170,210,0.12); color: var(--muted);
  font-size: 13px; line-height: 1; padding: 0;
  transition: background .15s, color .15s;
}
.chip .chip-x:hover { background: var(--accent); color: var(--ink-900); }

/* (b) live charts */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  margin-bottom: 34px;
}
.chart-card {
  background: var(--ink-800);
  border: 1px solid var(--hair);
  border-radius: 12px;
  padding: 18px 20px 20px;
}
.chart-card.chart-wide { grid-column: 1 / -1; }
.chart-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 14px; margin-bottom: 16px;
}
.chart-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.12rem;
  color: var(--paper); margin: 0;
}
.chart-hint { font-size: 0.78rem; color: var(--faint); text-align: right; }
/* Reconciling caption under a chart whose scope differs from the headline
   (e.g. the year axis spans only 2016-2026 while totals count the full register).
   Keeps the two from silently disagreeing on the same screen. */
.chart-note {
  margin: 12px 0 0; padding-top: 11px;
  border-top: 1px solid var(--hair);
  font-size: 0.74rem; line-height: 1.45; color: var(--faint);
}
.chart-note strong { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row {
  display: grid;
  grid-template-columns: 13.5rem 1fr auto;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: none; background: transparent; text-align: left;
  font-family: var(--sans); color: inherit;
  padding: 3px 6px; margin: -3px -6px; border-radius: 8px;
  width: calc(100% + 12px);
  transition: background .15s;
}
.bar-row:hover { background: rgba(150,170,210,0.05); }
.bar-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bars-static .bar-row { cursor: default; }
.bars-static .bar-row:hover { background: transparent; }
.bar-label {
  font-size: 0.86rem; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* "not on map" marker reconciling the LHD bar chart with the LHD choropleth */
.bar-note {
  margin-left: 7px; font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); border: 1px solid var(--hair); border-radius: 4px;
  padding: 0 5px; white-space: nowrap;
}
.bar-row[aria-pressed="true"] .bar-label { color: var(--accent-hot); font-weight: 600; }
.bar-track {
  position: relative; height: 17px;
  background: rgba(150,170,210,0.07);
  border-radius: 5px; overflow: hidden;
}
.bar-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 0;
  border-radius: 5px;
  background: var(--bar-color, var(--unclass));
  transition: width .7s cubic-bezier(.22,.61,.36,1);
}
.bar-row[aria-pressed="true"] .bar-fill {
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 14px -3px var(--accent-glow);
}
.bar-val {
  font-size: 0.84rem; color: var(--paper); font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  min-width: 4.2rem; text-align: right;
}
.bar-val .bar-pct { color: var(--faint); font-weight: 400; font-size: 0.78rem; margin-left: 5px; }
.bar-row.is-zero { opacity: 0.45; }

/* (c) static context block */
.context-block {
  border-top: 1px dashed var(--hair-strong);
  padding-top: 26px;
}
.context-head { margin-bottom: 18px; }
.context-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.3rem;
  color: var(--paper); margin: 0 0 8px;
}
.context-note { font-size: 0.86rem; color: var(--muted); max-width: 80ch; margin: 0; }
.context-note em { color: var(--text); font-style: normal; border-bottom: 1px dotted var(--faint); }
.context-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px;
}

/* ===================== ACT IV — REGISTER TABLE ===================== */
.register {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 40px 30px;
}
.register-head { margin-bottom: 22px; }
.register-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.register-lede { font-size: 1.04rem; color: var(--text); max-width: 64ch; margin: 0; }

.register-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.register-counts { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.register-count { font-size: 0.88rem; color: var(--muted); margin: 0; font-variant-numeric: tabular-nums; }
/* Transient disclosure shown after a Venn region click: the register cohort is a
   subset of the clicked region's full-universe figure. */
.register-venn-note {
  font-size: 0.8rem; color: var(--accent-hot); margin: 0;
  font-variant-numeric: tabular-nums;
}
.register-venn-note[hidden] { display: none; }
.csv-btn {
  display: inline-flex; align-items: center; gap: 8px;
  appearance: none; cursor: pointer;
  background: var(--ink-800); color: var(--text);
  border: 1px solid var(--hair-strong); border-radius: 9px;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600;
  padding: 9px 15px;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.csv-btn:hover { color: var(--ink-900); background: var(--accent); border-color: var(--accent); box-shadow: 0 0 18px -3px var(--accent-glow); }
.csv-btn svg { flex: none; }

.table-wrap {
  background: var(--ink-800);
  border: 1px solid var(--hair);
  border-radius: 12px;
  overflow-x: auto;
}
.reg-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.85rem;
}
.reg-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--ink-700);
  text-align: left; font-weight: 600; color: var(--muted);
  font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 11px 14px; white-space: nowrap;
  border-bottom: 1px solid var(--hair-strong);
}
.reg-table th.sortable { cursor: pointer; user-select: none; }
.reg-table th.sortable:hover { color: var(--text); }
.reg-table th .sort-ind { margin-left: 5px; opacity: 0.5; font-size: 0.8em; }
.reg-table th[aria-sort="ascending"], .reg-table th[aria-sort="descending"] { color: var(--accent-hot); }
.reg-table th[aria-sort="ascending"] .sort-ind,
.reg-table th[aria-sort="descending"] .sort-ind { opacity: 1; }
.reg-table tbody td {
  padding: 10px 14px; vertical-align: top;
  border-bottom: 1px solid var(--hair);
  color: var(--text);
}
.reg-table tbody tr:last-child td { border-bottom: none; }
.reg-table tbody tr:hover td { background: rgba(150,170,210,0.04); }
.td-title {
  max-width: 30ch; min-width: 18ch;
  color: var(--paper); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.td-sponsor { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.sec-chip {
  display: inline-block; font-size: 0.68rem; line-height: 1.5;
  padding: 1px 7px; border-radius: 999px;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.badge {
  display: inline-block; font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.03em; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.badge.within { color: var(--public); background: rgba(76,196,214,0.12); border: 1px solid rgba(76,196,214,0.35); }
.badge.outside { color: var(--accent); background: rgba(255,210,74,0.1); border: 1px solid rgba(255,210,74,0.4); }
.reg-source { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.table-empty { padding: 28px; text-align: center; color: var(--muted); margin: 0; }

.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 18px; margin-top: 18px;
}
.pg-btn {
  appearance: none; cursor: pointer;
  background: var(--ink-800); color: var(--text);
  border: 1px solid var(--hair-strong); border-radius: 9px;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600;
  padding: 8px 16px;
  transition: background .2s, color .2s, opacity .2s;
}
.pg-btn:hover:not(:disabled) { background: var(--ink-700); color: var(--paper); }
.pg-btn:disabled { opacity: 0.35; cursor: default; }
.pg-status { font-size: 0.86rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ===================== FOOTER ===================== */
.footer {
  max-width: var(--maxw);
  margin: 30px auto 0;
  padding: 26px 40px 56px;
  border-top: 1px solid var(--hair);
}
.caveats { font-size: 0.86rem; color: var(--muted); max-width: 92ch; margin: 0 0 10px; }
.caveats strong { color: var(--text); font-weight: 600; }
.caveats em { color: var(--text); font-style: normal; border-bottom: 1px dotted var(--faint); }
.colophon {
  font-size: 0.78rem; letter-spacing: 0.06em; color: var(--faint); margin: 0;
}

/* ===================== REVEAL MOTION ===================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s cubic-bezier(.22,.61,.36,1), transform .8s cubic-bezier(.22,.61,.36,1);
}
[data-reveal].in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
  .tri-seg { transition: none !important; }
  .bar-fill { transition: none !important; }
  .scroll-cue svg { animation: none; }
  .mesh { display: none; }
}

/* ===================== SECTION NAV (sticky) ===================== */
.sectionnav {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--hair);
  background: rgba(11, 16, 25, 0.82);
  backdrop-filter: blur(12px) saturate(1.1);
}
.sectionnav-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 40px;
  display: flex; align-items: center; gap: 26px;
  min-height: 50px;
}
.snav-brand {
  font-family: var(--serif); font-weight: 600; font-size: 0.98rem;
  color: var(--paper); text-decoration: none; letter-spacing: -0.01em;
  flex: none; white-space: nowrap;
}
.snav-brand::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); margin-right: 9px; vertical-align: middle;
  box-shadow: 0 0 10px 1px var(--accent-glow);
}
.snav-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; scrollbar-width: none;
}
.snav-links::-webkit-scrollbar { display: none; }
.snav-links a {
  display: block; padding: 7px 12px; border-radius: 8px;
  font-size: 0.82rem; font-weight: 500; letter-spacing: 0.01em;
  color: var(--muted); text-decoration: none; white-space: nowrap;
  transition: color .2s, background .2s;
}
.snav-links a:hover { color: var(--text); background: rgba(150,170,210,0.06); }
.snav-links a.is-active { color: var(--accent-hot); background: rgba(255,210,74,0.08); }
.snav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ===================== NATIONAL OVERVIEW ===================== */
.national { max-width: var(--maxw); margin: 0 auto; padding: 64px 40px 30px; }
.national-head { margin-bottom: 26px; }
.national-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.national-lede { font-size: 1.04rem; color: var(--text); max-width: 64ch; margin: 0; }
.ctx-flag {
  display: inline-block; margin-left: 4px;
  font-size: 0.82rem; color: var(--faint); font-style: italic;
  border-left: 2px solid var(--hair-strong); padding-left: 9px;
}

.natstat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
  margin-bottom: 30px;
}
.natstat {
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--hair); border-radius: 14px;
  padding: 20px 22px;
}
.natstat-lead { border-color: rgba(255,210,74,0.28); box-shadow: 0 0 30px -18px var(--accent-glow); }
.natstat-fig {
  font-family: var(--serif); font-weight: 600; font-size: clamp(1.8rem, 2.6vw, 2.5rem);
  line-height: 1; color: var(--paper);
}
.natstat-lab { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-top: 8px; }
.natstat-sub { font-size: 0.8rem; color: var(--faint); margin-top: 2px; }

.natchart-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.natyear-svg { width: 100%; height: auto; display: block; overflow: visible; }
.natyear-legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.nyl-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.82rem; color: var(--muted); }
.nyl-sw { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.natyear-dot { transition: opacity .15s; }
.natyear-hit { stroke: var(--paper); stroke-width: 1.5; }
.natyear-tip {
  position: absolute; pointer-events: none; opacity: 0;
  transform: translate(-50%, -120%); transition: opacity .12s;
  background: rgba(10,15,26,0.96); border: 1px solid var(--hair-strong);
  border-radius: 9px; padding: 8px 12px; z-index: 6;
  font-size: 0.8rem; white-space: nowrap;
}
.natyear-tip.show { opacity: 1; }
.nyt-year { font-weight: 600; color: var(--paper); margin-bottom: 4px; }
.nyt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--text); }
.nyt-row .tnum { font-variant-numeric: tabular-nums; }

/* ===================== PROVENANCE / VENN ===================== */
.prov { max-width: var(--maxw); margin: 0 auto; padding: 70px 40px 30px; }
.prov-head { margin-bottom: 26px; }
.prov-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.prov-lede { font-size: 1.04rem; color: var(--text); max-width: 70ch; margin: 0; }

.prov-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 40px; align-items: center;
}
.prov-vizwrap {
  position: relative;
  background:
    radial-gradient(80% 60% at 50% 40%, rgba(122,95,192,0.07), transparent 62%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair); border-radius: var(--r);
  padding: 18px 18px 10px;
  box-shadow: 0 30px 80px -52px rgba(0,0,0,0.9);
}
#vennViz { width: 100%; height: auto; display: block; overflow: visible; }
.venn-set-label { font-family: var(--sans); font-weight: 600; letter-spacing: 0.02em; }
.venn-region {
  cursor: default;
  transition: filter .18s, opacity .18s;
}
.venn-region.clickable { cursor: pointer; }
.venn-region.clickable:hover { filter: brightness(1.25); }
/* Keyboard focus: native outline on an SVG <g> is unreliable across browsers, so
   give the focused region a visible accent halo + outline its count/sub text. */
.venn-region.clickable:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 6px var(--accent-glow)) brightness(1.18);
}
.venn-region.clickable:focus-visible .venn-rcount,
.venn-region.clickable:focus-visible .venn-rsub {
  paint-order: stroke;
  stroke: var(--accent);
  stroke-width: 0.8px;
}
.venn-rcount {
  font-family: var(--sans); font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600; fill: var(--paper); pointer-events: none;
}
.venn-rsub { font-family: var(--sans); fill: var(--muted); pointer-events: none; }
.venn-rfilter {
  font-family: var(--sans); fill: var(--accent); opacity: 0.78;
  pointer-events: none; font-weight: 600;
}
.venn-region.clickable:hover .venn-rfilter,
.venn-region.clickable:focus-visible .venn-rfilter { opacity: 1; }
.venn-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; padding: 0 6px 4px; }
.vleg-item { display: inline-flex; align-items: center; gap: 8px; font-size: 0.83rem; color: var(--text); }
.vleg-sw { width: 13px; height: 13px; border-radius: 4px; flex: none; opacity: 0.85; }

.prov-readout { display: flex; flex-direction: column; gap: 16px; }
.prov-callout {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--ink-800); border: 1px solid var(--hair);
  border-radius: 12px; padding: 16px 18px;
  border-left-width: 3px;
}
.prov-callout-gap { border-left-color: var(--gov-teal); }
.prov-callout-reg { border-left-color: var(--reg-ctgov); }
.prov-callout-core { border-left-color: var(--accent); }
.pc-fig {
  font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1;
  color: var(--paper); flex: none; min-width: 2.6ch; text-align: right;
}
.prov-callout-gap .pc-fig { color: var(--gov-teal); }
.prov-callout-core .pc-fig { color: var(--accent); }
.pc-key { font-size: 0.95rem; font-weight: 600; color: var(--paper); margin-bottom: 3px; }
.pc-text { font-size: 0.86rem; color: var(--muted); margin: 0; }
.pc-text em { color: var(--text); font-style: normal; border-bottom: 1px dotted var(--faint); }
.prov-hint { font-size: 0.8rem; color: var(--faint); margin: 2px 0 0; font-style: italic; }

/* ===================== MAP — choropleth + layer additions ===================== */
.layer-toggle .toggle-btn.is-active { color: var(--ink-900); background: var(--accent); }
.metric-toggle { margin-top: 8px; }
.legend-sub { font-size: 0.7rem; font-weight: 500; color: var(--faint); text-transform: none; letter-spacing: 0.02em; margin-left: 6px; }

/* choropleth regions */
.choro-region {
  stroke: var(--ink-900); stroke-width: 0.8; stroke-linejoin: round;
  cursor: default; transition: fill .3s, stroke .2s, opacity .2s;
}
.choro-region.nsw-emph { stroke: var(--accent); stroke-width: 1.8; }
.map-stage.choro-dim .choro-region:not(.hl) { opacity: 0.55; }
.choro-region.hl { stroke: var(--paper); stroke-width: 1.6; }
.choro-region.nsw-emph.hl { stroke: var(--accent-hot); }
/* national layer is an interactive cross-filter control (click a state) */
#mapViz g.layer-national .choro-region { cursor: pointer; }
#mapViz g.layer-national .choro-region:focus-visible { outline: none; stroke: var(--accent-hot); stroke-width: 2.4; }
.choro-region.map-sel { stroke: var(--accent); stroke-width: 2.6; }
.choro-region.map-sel.hl { stroke: var(--accent-hot); stroke-width: 2.6; }
.tt-hint { margin-top: 6px; font-size: 0.74rem; color: var(--accent); }
/* map zoom buttons (overlay top-right of the stage) */
.map-zoom-ctrl { position: absolute; top: 14px; right: 14px; z-index: 5; display: flex; flex-direction: column; gap: 6px; }
.map-zoom-ctrl button {
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--hair-strong);
  background: color-mix(in srgb, var(--ink-800) 86%, transparent); color: var(--text);
  font-size: 1.25rem; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(3px); transition: background .15s, color .15s, border-color .15s;
}
.map-zoom-ctrl button:hover { background: var(--ink-700); color: var(--paper); border-color: var(--accent); }
.map-zoom-ctrl button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.map-zoom-ctrl #mapZoomReset { font-size: 1.05rem; }
/* LHD regions are clickable too (zoom into their facilities) */
#mapViz g.layer-lhd .choro-region { cursor: pointer; }
#mapViz g.layer-lhd .choro-region:focus-visible { outline: none; stroke: var(--accent-hot); stroke-width: 2; }

/* LGA layer: 129 small polygons — hairline stroke so the dense metro cluster reads
   as a choropleth, not a mass of borders. Clickable (zoom-to-LGA). */
.choro-region.choro-lga { stroke-width: 0.35; }
#mapViz g.layer-lga .choro-region { cursor: pointer; }
#mapViz g.layer-lga .choro-region.hl { stroke: var(--paper); stroke-width: 1.1; }
#mapViz g.layer-lga .choro-region:focus-visible { outline: none; stroke: var(--accent-hot); stroke-width: 1.6; }

/* POA layer: ~636 postcode polygons — even finer, so the thinnest stroke. */
.choro-region.choro-poa { stroke-width: 0.25; }
#mapViz g.layer-poa .choro-region { cursor: pointer; }
#mapViz g.layer-poa .choro-region.hl { stroke: var(--paper); stroke-width: 1; }
#mapViz g.layer-poa .choro-region:focus-visible { outline: none; stroke: var(--accent-hot); stroke-width: 1.4; }

/* zoom-drill breadcrumb */
.map-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 14px 0 0; }
.crumb {
  font-family: var(--sans); font-size: 0.84rem; color: var(--muted);
  background: rgba(150,170,210,0.07); border: 1px solid var(--hair); border-radius: 999px;
  padding: 5px 13px; cursor: pointer; transition: color .15s, background .15s, border-color .15s;
}
.crumb:hover { color: var(--paper); background: rgba(150,170,210,0.12); }
.crumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.crumb.is-current { color: var(--accent-hot); background: rgba(255,210,74,0.1); border-color: rgba(255,210,74,0.28); cursor: default; font-weight: 600; }
.crumb-sep { color: var(--faint); font-size: 0.9rem; padding: 0 2px; }
/* national-level discoverability nudge (shown in the breadcrumb slot) */
.map-hint-text { font-size: 0.84rem; color: var(--muted); }
.map-hint-text b { color: var(--accent); font-weight: 600; }
/* inline labels for the largest facilities when zoomed into a district */
.site-label {
  fill: var(--paper); font-family: var(--sans); font-weight: 600;
  paint-order: stroke; stroke: rgba(8,12,20,0.9); stroke-linejoin: round; pointer-events: none;
}
.choro-rlabel {
  fill: var(--paper); font-family: var(--sans); font-size: 11px; font-weight: 600;
  pointer-events: none; paint-order: stroke; stroke: rgba(8,12,20,0.6); stroke-width: 2.4px;
}
.choro-rlabel.dim { fill: var(--faint); font-weight: 500; }

/* choropleth legend (gradient scale) */
.choro-legend { display: flex; flex-direction: column; gap: 7px; padding: 2px 0; }
.choro-ramp { height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px var(--hair); }
.choro-ticks { display: flex; justify-content: space-between; font-size: 0.72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.choro-note { font-size: 0.78rem; color: var(--faint); margin: 8px 0 0; }

/* ===================== TRIAL DETAIL MODAL ===================== */
/* The `hidden` attribute MUST win over the display:flex below — otherwise the
   backdrop (a full-viewport dark + blur(4px) overlay) covers and washes out the
   ENTIRE page on load, even with no modal open. */
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 6vh 20px 20px;
  background: rgba(6, 9, 16, 0.72);
  backdrop-filter: blur(4px);
  overflow-y: auto;
  animation: modalFade .18s ease;
}
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: min(680px, 100%);
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--hair-strong);
  border-radius: var(--r);
  box-shadow: 0 40px 110px -40px rgba(0,0,0,0.9);
  outline: none;
  animation: modalRise .24s cubic-bezier(.22,.61,.36,1);
}
@keyframes modalRise { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 9px;
  display: inline-flex; align-items: center; justify-content: center;
  appearance: none; cursor: pointer;
  background: rgba(150,170,210,0.08); border: 1px solid var(--hair);
  color: var(--muted); font-size: 22px; line-height: 1;
  transition: background .15s, color .15s, border-color .15s;
}
.modal-close:hover { background: var(--accent); color: var(--ink-900); border-color: var(--accent); }
.modal-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.modal-scroll { padding: 30px 32px 28px; }

.modal-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.modal-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.22;
  color: var(--paper); margin: 0 0 18px; padding-right: 30px;
}
.modal-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.mbadge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}
.mbadge.gov-within { color: var(--public); background: rgba(76,196,214,0.1); }
.mbadge.gov-outside { color: var(--accent); background: rgba(255,210,74,0.1); }
.mbadge.neutral { color: var(--muted); background: rgba(150,170,210,0.06); }

.modal-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px;
  background: var(--hair); border: 1px solid var(--hair); border-radius: 12px;
  overflow: hidden; margin-bottom: 22px;
}
.mfield { background: var(--ink-800); padding: 13px 16px; }
.mfield-k { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.mfield-v { font-size: 0.94rem; color: var(--paper); font-weight: 500; }
.mfield-full { grid-column: 1 / -1; }

.modal-sec { margin-bottom: 20px; }
.modal-sec:last-child { margin-bottom: 0; }
.modal-sec-title {
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 11px;
}
/* source provenance chips */
.src-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.src-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 13px; border-radius: 10px;
  font-size: 0.84rem; font-weight: 600;
  border: 1px solid var(--hair);
  background: var(--ink-850); color: var(--faint);
  transition: none;
}
.src-chip .src-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: 0.4; flex: none; }
.src-chip.lit { color: var(--paper); border-color: var(--src-color); background: color-mix(in srgb, var(--src-color) 14%, var(--ink-850)); }
.src-chip.lit .src-dot { background: var(--src-color); opacity: 1; box-shadow: 0 0 8px var(--src-color); }
.src-chip.dim { opacity: 0.5; }
.src-chip .src-id { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.src-chip.lit .src-id { color: var(--text); }

/* deep-link id rows */
.id-links { display: flex; flex-direction: column; gap: 9px; }
.id-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px;
  background: var(--ink-850); border: 1px solid var(--hair);
  text-decoration: none; color: var(--text);
  transition: border-color .15s, background .15s;
}
.id-link:hover { border-color: var(--hair-strong); background: var(--ink-800); }
.id-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.idl-reg { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); min-width: 8.5ch; }
.idl-id { font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums; flex: 1 1 auto; }
.idl-go { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--accent-hot); white-space: nowrap; }
.id-link.id-none { color: var(--faint); cursor: default; }
.id-link.id-none:hover { background: var(--ink-850); border-color: var(--hair); }

/* sites list */
.msite-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.msite { display: flex; align-items: center; gap: 11px; font-size: 0.9rem; color: var(--text); }
.msite-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.msite-sector { margin-left: auto; font-size: 0.76rem; color: var(--muted); }

/* table rows clickable affordance */
.reg-table tbody tr { cursor: pointer; }
.reg-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1080px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { order: -1; }
  .visual-frame { max-width: 420px; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-side { flex-direction: row; flex-wrap: wrap; }
  .map-side .legend, .map-side .map-stat { flex: 1 1 220px; }
  .chart-grid { grid-template-columns: 1fr; }
  .context-grid { grid-template-columns: 1fr; }
  .natchart-grid { grid-template-columns: 1fr; }
  .natstat-grid { grid-template-columns: repeat(2, 1fr); }
  .prov-grid { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 720px) {
  .masthead-inner, .hero, .mapsec, .dash, .register, .footer,
  .national, .prov, .sectionnav-inner { padding-left: 22px; padding-right: 22px; }
  .hero { padding-top: 44px; }
  .mapsec-head { flex-direction: column; align-items: flex-start; }
  .mapsec-controls { align-items: flex-start; }
  .map-side { flex-direction: column; }
  .masthead-meta { display: none; }
  .bar-row { grid-template-columns: 9rem 1fr auto; gap: 8px; }
  .bar-val { min-width: 3.4rem; }
  .cf-sep { display: none; }
  .cmdbar { position: static; }
  .natstat-grid { grid-template-columns: 1fr; }
  .snav-brand { display: none; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-scroll { padding: 26px 20px 24px; }
  /* the section nav is sticky; the cmdbar would collide, so it scrolls normally on mobile (above) */
}
/* When both the section nav and the cmdbar are sticky, offset the cmdbar below the nav. */
@media (min-width: 721px) {
  .cmdbar { top: 50px; }
  html { scroll-padding-top: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .modal-backdrop, .modal { animation: none !important; }
  .choro-region, .natyear-dot, .venn-region { transition: none !important; }
}

/* ============================================================
   NATIONAL-FIRST ADDITIONS
   National overview as platform lead + the national EXPLORE layer
   (register + cross-filter over all 18,092 trials), and the NSW lens
   reframing (nav grouping + lens divider band). Reuses every existing
   token: ink palette, sector vars, gold accent, Fraunces+Spline, .bar-row,
   .cmdbar, .chip, .reg-table.
   ============================================================ */

/* ---- national overview promoted to the page lead ---- */
.national-h1 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2.4rem, 4.2vw, 4rem);
  line-height: 1.03; letter-spacing: -0.018em;
  color: var(--paper); margin: 0 0 16px;
}
.lede-link {
  color: var(--accent-hot); text-decoration: none;
  border-bottom: 1px solid rgba(255,210,74,0.32);
  transition: border-color .15s, color .15s;
}
.lede-link:hover { color: var(--accent); border-color: var(--accent); }
.lede-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.national-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.cta-primary {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--accent); color: var(--ink-900);
  font-family: var(--sans); font-weight: 600; font-size: 0.96rem;
  text-decoration: none; padding: 12px 20px; border-radius: 11px;
  box-shadow: 0 0 26px -6px var(--accent-glow);
  transition: transform .15s, box-shadow .2s, background .2s;
}
.cta-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 30px -8px var(--accent-glow); background: var(--accent-hot); }
.cta-primary:focus-visible { outline: 2px solid var(--paper); outline-offset: 2px; }
.cta-primary svg { transition: transform .2s; }
.cta-primary:hover svg { transform: translateX(3px); }
.cta-note { font-size: 0.84rem; color: var(--faint); letter-spacing: 0.02em; }

/* ---- section-nav: NSW lens grouping ---- */
.snav-primary { color: var(--accent-hot) !important; font-weight: 600 !important; }
.snav-primary.is-active { background: rgba(255,210,74,0.12) !important; }
.snav-divider {
  width: 1px; align-self: stretch; min-height: 22px;
  background: var(--hair-strong); margin: 0 4px; flex: none;
}
.snav-lenslabel {
  font-size: 0.66rem; letter-spacing: 0.13em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; white-space: nowrap;
  display: flex; align-items: center; padding: 0 2px;
}

/* ---- NSW lens divider banner ---- */
.lensband {
  max-width: var(--maxw); margin: 30px auto 0; padding: 44px 40px 6px;
}
.lensband-inner {
  border-top: 1px solid var(--hair-strong);
  border-left: 3px solid var(--accent);
  padding: 30px 30px 30px 26px;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(255,210,74,0.05), transparent 55%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border-radius: 0 var(--r) var(--r) 0;
}
.lensband-eyebrow {
  font-size: 0.76rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin: 0 0 10px;
}
.lensband-title {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(1.9rem, 3vw, 2.7rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 12px;
}
.lensband-lede { font-size: 1.02rem; color: var(--text); max-width: 70ch; margin: 0; }
.lensband-lede em { color: var(--accent-hot); font-style: normal; }

/* ============================================================
   EXPLORE — national register + cross-filter
   ============================================================ */
.explore { max-width: var(--maxw); margin: 0 auto; padding: 64px 40px 30px; }
.explore-head { margin-bottom: 24px; }
.explore-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.explore-lede { font-size: 1.04rem; color: var(--text); max-width: 72ch; margin: 0; }
.explore-lede em { color: var(--text); font-style: normal; border-bottom: 1px dotted var(--faint); }

/* lazy-load gate */
/* `hidden` MUST beat the display:flex below, or the gate stays painted over the
   loaded content once national_trials finishes (same trap as .modal-backdrop). */
.explore-loading[hidden] { display: none !important; }
.explore-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  min-height: 280px; padding: 40px;
  background: linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair); border-radius: var(--r);
}
.explore-loading.is-error { border-color: rgba(255,140,140,0.4); }
.exl-spinner {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(255,210,74,0.18); border-top-color: var(--accent);
  animation: exlSpin 0.9s linear infinite;
}
@keyframes exlSpin { to { transform: rotate(360deg); } }
.exl-text { font-family: var(--serif); font-size: 1.3rem; color: var(--paper); margin: 0; font-variant-numeric: tabular-nums; }
.exl-sub { font-size: 0.86rem; color: var(--faint); margin: 0; max-width: 46ch; }
@media (prefers-reduced-motion: reduce) { .exl-spinner { animation: none; } }

/* national command bar (reuses .cmdbar look; non-sticky — it's tall) */
.ncmdbar { position: static; }
.ncmd-controls { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.nfilter-lab, .nsel-lab {
  display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin-bottom: 7px;
}
.nfilter-hint { color: var(--faint); font-weight: 500; letter-spacing: 0.02em; text-transform: none; margin-left: 6px; }

/* state quick-chips (neutral default -> gold when active) */
.state-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.state-chip {
  appearance: none; cursor: pointer;
  background: var(--ink-900); border: 1px solid var(--hair-strong);
  color: var(--text); font-family: var(--sans); font-weight: 600; font-size: 0.82rem;
  padding: 6px 13px; border-radius: 999px;
  display: inline-flex; align-items: baseline; gap: 7px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.state-chip:hover { border-color: var(--accent-glow); color: var(--paper); }
.state-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.state-chip .sc-n { font-size: 0.74rem; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.state-chip[aria-pressed="true"] {
  background: var(--accent); color: var(--ink-900); border-color: var(--accent);
  box-shadow: 0 0 16px -4px var(--accent-glow);
}
.state-chip[aria-pressed="true"] .sc-n { color: rgba(11,16,25,0.66); }

/* registration-year dual-handle range slider (two overlaid range inputs; only the
   thumbs catch pointer events so each handle stays grabbable over the shared track) */
.nfilter-year { max-width: 520px; }
.yrange { position: relative; height: 42px; --yr-h: 5px; --yr-thumb: 17px; }
.yrange-track {
  position: absolute; left: 0; right: 0; top: 12px; height: var(--yr-h);
  background: var(--ink-900); border: 1px solid var(--hair-strong); border-radius: 999px;
}
.yrange-fill {
  position: absolute; top: -1px; bottom: -1px; left: 0; right: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-glow));
  border-radius: 999px;
}
.yrange input[type="range"] {
  position: absolute; left: 0; top: 6px; width: 100%; height: var(--yr-thumb);
  margin: 0; background: none; pointer-events: none;
  -webkit-appearance: none; appearance: none;
}
.yrange input[type="range"]::-webkit-slider-runnable-track { background: none; border: none; height: var(--yr-thumb); }
.yrange input[type="range"]::-moz-range-track { background: none; border: none; height: var(--yr-thumb); }
.yrange input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; pointer-events: auto; cursor: grab;
  width: var(--yr-thumb); height: var(--yr-thumb); border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
  box-shadow: 0 1px 5px rgba(0,0,0,0.45); transition: box-shadow .15s, transform .1s;
}
.yrange input[type="range"]::-moz-range-thumb {
  pointer-events: auto; cursor: grab;
  width: var(--yr-thumb); height: var(--yr-thumb); border-radius: 50%;
  background: var(--paper); border: 2px solid var(--accent);
  box-shadow: 0 1px 5px rgba(0,0,0,0.45);
}
.yrange input[type="range"]::-webkit-slider-thumb:hover { box-shadow: 0 0 0 5px rgba(255,210,74,0.16); }
.yrange input[type="range"]:active::-webkit-slider-thumb { cursor: grabbing; transform: scale(1.08); }
.yrange input[type="range"]:focus-visible { outline: none; }
.yrange input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(255,210,74,0.32); }
.yrange input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px rgba(255,210,74,0.32); }
#yrangeLo { z-index: 3; }
#yrangeHi { z-index: 4; }
.yrange-ticks {
  position: absolute; left: 0; right: 0; top: 27px; display: flex; justify-content: space-between;
  font-size: 0.7rem; color: var(--faint); font-variant-numeric: tabular-nums;
  font-family: var(--sans); pointer-events: none;
}

/* select rows */
.ncmd-row { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.ncmd-row-tools { align-items: center; }
.nsel { display: flex; flex-direction: column; flex: 1 1 150px; min-width: 0; }
.nsel-wide { flex: 1 1 230px; }
.nsel-page { flex: 0 0 auto; }
.nsel select {
  appearance: none; cursor: pointer;
  background: var(--ink-900); color: var(--text);
  border: 1px solid var(--hair-strong); border-radius: 9px;
  font-family: var(--sans); font-size: 0.9rem; font-weight: 500;
  padding: 9px 30px 9px 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238090ab' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color .2s, box-shadow .2s;
}
.nsel select:hover { border-color: var(--accent-glow); }
.nsel select:focus-visible { outline: none; border-color: var(--accent-glow); box-shadow: 0 0 0 3px rgba(255,210,74,0.1); }
.nsel option { background: var(--ink-800); color: var(--text); }

.ncmd-search { flex: 1 1 240px; margin: 0; }
.ntoggle-check {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 0.88rem; color: var(--text); font-weight: 500; white-space: nowrap;
  background: var(--ink-900); border: 1px solid var(--hair-strong);
  border-radius: 9px; padding: 9px 14px;
  transition: border-color .15s, color .15s;
}
.ntoggle-check:hover { border-color: var(--accent-glow); }
.ntoggle-check input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }
.ntoggle-check:focus-within { border-color: var(--accent-glow); box-shadow: 0 0 0 3px rgba(255,210,74,0.08); }

.quick-nsw {
  appearance: none; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--public);
  border: 1px solid rgba(76,196,214,0.4); border-radius: 9px;
  font-family: var(--sans); font-size: 0.86rem; font-weight: 600;
  padding: 9px 15px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.quick-nsw:hover { background: rgba(76,196,214,0.12); }
.quick-nsw:focus-visible { outline: 2px solid var(--public); outline-offset: 1px; }
.quick-nsw[aria-pressed="true"] {
  background: var(--public); color: var(--ink-900); border-color: var(--public);
  box-shadow: 0 0 16px -4px rgba(76,196,214,0.6);
}

/* explore charts wrapper spacing */
.nexp-charts { margin-bottom: 34px; }
.nexp-charts .bar-row { grid-template-columns: 12rem 1fr auto; }

/* national register tweaks */
.nexp-register { margin-top: 6px; }
.nexp-regtools { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; }
.nexp-regtools .nsel-page select { padding-top: 8px; padding-bottom: 8px; }
/* state chips inside the register table */
.reg-statechips { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-statechip {
  display: inline-block; font-size: 0.66rem; font-weight: 600; line-height: 1.5;
  padding: 1px 7px; border-radius: 999px;
  border: 1px solid var(--hair-strong); color: var(--muted);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.reg-statechip.is-nsw { color: var(--accent-hot); border-color: rgba(255,210,74,0.45); }
/* source provenance chips inside the register table (reuse provenance colours) */
.reg-srcchips { display: flex; flex-wrap: wrap; gap: 4px; }
.reg-srcchip {
  display: inline-block; font-size: 0.64rem; font-weight: 600; line-height: 1.5;
  padding: 1px 7px; border-radius: 4px;
  border: 1px solid currentColor; white-space: nowrap; opacity: 0.92;
}
.td-states, .td-sources { min-width: 9ch; }
.td-sites { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* humanised sponsor-class / status pills reuse .badge.neutral feel inline */
.nreg-table .reg-source { color: var(--text); }

@media (max-width: 1080px) {
  .nexp-charts .bar-row { grid-template-columns: 9.5rem 1fr auto; }
}
@media (max-width: 720px) {
  .explore, .lensband { padding-left: 22px; padding-right: 22px; }
  .lensband { padding-top: 30px; }
  .lensband-inner { padding: 22px 18px 22px 18px; }
  .ncmd-row { flex-direction: column; }
  .nsel { flex: 1 1 auto; }
  .nexp-charts .bar-row { grid-template-columns: 8rem 1fr auto; }
}

/* ============================================================
   RESEARCH INTELLIGENCE  —  the analytical heart.
   Sponsor + institution leaderboards & dossiers, the force-directed
   site collaboration network (the showpiece), and therapeutic-area
   deep-dives. Reuses every existing token: ink palette, sector vars,
   gold accent, Fraunces+Spline, .bar-row chart language, .legend,
   .map-stat, the .modal-backdrop dialog, the .toggle control.
   ============================================================ */
.intel { max-width: var(--maxw); margin: 0 auto; padding: 70px 40px 30px; }
.intel-head { margin-bottom: 22px; }
.intel-head h2 {
  font-family: var(--serif); font-weight: 600;
  font-size: clamp(2rem, 3.2vw, 3rem); line-height: 1.05; letter-spacing: -0.015em;
  color: var(--paper); margin: 0 0 14px;
}
.intel-lede { font-size: 1.04rem; color: var(--text); max-width: 74ch; margin: 0; }

/* ---- tab strip ---- */
.intel-tabs {
  display: flex; flex-wrap: wrap; gap: 8px;
  border-bottom: 1px solid var(--hair); padding-bottom: 0; margin-bottom: 26px;
}
.itab {
  appearance: none; cursor: pointer; text-align: left;
  background: transparent; border: 1px solid transparent; border-bottom: none;
  border-radius: 11px 11px 0 0; padding: 11px 18px 13px;
  font-family: var(--sans); color: var(--muted);
  display: flex; flex-direction: column; gap: 2px;
  position: relative; top: 1px;
  transition: color .2s, background .2s, border-color .2s;
}
.itab:hover { color: var(--text); background: rgba(150,170,210,0.05); }
.itab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.itab .itab-k { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; color: inherit; letter-spacing: -0.01em; }
.itab .itab-sub { font-size: 0.74rem; letter-spacing: 0.04em; color: var(--faint); }
.itab.is-active {
  color: var(--paper);
  background: var(--ink-800);
  border-color: var(--hair);
  border-bottom: 1px solid var(--ink-800);
}
.itab.is-active .itab-k { color: var(--accent-hot); }
.itab.is-active .itab-sub { color: var(--muted); }

/* ---- lazy-load gate (mirrors .explore-loading; hidden MUST win) ---- */
.intel-loading[hidden] { display: none !important; }
.intel-loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; min-height: 300px; padding: 40px;
  background: linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair); border-radius: var(--r);
}
.intel-loading.is-error { border-color: rgba(255,140,140,0.4); }

/* ---- tab panels ---- */
.intel-body[hidden] { display: none !important; }
.ipanel[hidden] { display: none !important; }
.ipanel { animation: ipanelIn .32s cubic-bezier(.22,.61,.36,1); }
@keyframes ipanelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ipanel { animation: none; } }

.ipanel-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap; margin-bottom: 18px;
}
.ipanel-headtext { min-width: 0; flex: 1 1 380px; }
.ipanel-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.5rem;
  color: var(--paper); margin: 0 0 6px; letter-spacing: -0.01em;
}
.ipanel-note { font-size: 0.9rem; color: var(--muted); max-width: 70ch; margin: 0; }
.ipanel-note strong { color: var(--text); font-weight: 600; }

/* ---- class split summary (sponsors) ---- */
.classsplit { display: flex; flex-direction: column; gap: 8px; min-width: 240px; flex: 0 1 320px; }
.cs-bar {
  display: flex; width: 100%; height: 22px; border-radius: 6px; overflow: hidden;
  background: var(--ink-900); box-shadow: inset 0 0 0 1px var(--hair);
}
.cs-seg { height: 100%; transition: width .8s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .cs-seg { transition: none; } }
.cs-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.cs-item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--text); }
.cs-sw { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.cs-n { font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums; }
.cs-k { color: var(--muted); }
.cs-pct { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 0.74rem; }
.cs-cap { margin: 2px 0 0; font-size: 0.72rem; line-height: 1.4; color: var(--faint); }

/* sector key (institutions) */
.sectorkey { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; flex: 0 1 auto; }
.sk-item { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8rem; color: var(--muted); }
.sk-sw { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.sk-note { flex-basis: 100%; font-size: 0.72rem; color: var(--faint); font-style: italic; margin-top: 2px; }

/* ---- leaderboards (dense, ranked, tabular) ---- */
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lb-row {
  display: grid;
  grid-template-columns: 2.4rem minmax(11rem, 1.4fr) 2fr auto;
  align-items: center; gap: 14px;
  width: 100%; text-align: left;
  appearance: none; cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: 9px;
  font-family: var(--sans); color: inherit;
  padding: 8px 12px;
  transition: background .15s, border-color .15s;
}
.lb-row:hover { background: rgba(150,170,210,0.05); border-color: var(--hair); }
.lb-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lb-rank {
  font-family: var(--serif); font-weight: 600; font-size: 0.98rem;
  color: var(--faint); font-variant-numeric: tabular-nums; text-align: right;
}
.lb-row:nth-child(-n+3) .lb-rank { color: var(--accent-hot); }
.lb-namecol { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.lb-name {
  font-size: 0.95rem; font-weight: 600; color: var(--paper);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.lb-chip {
  display: inline-block; font-size: 0.66rem; font-weight: 600; line-height: 1.5;
  padding: 0px 7px; border-radius: 999px; white-space: nowrap;
  border: 1px solid currentColor;
}
.lb-chip.lb-state { color: var(--muted); }
.lb-classlabel { font-size: 0.72rem; color: var(--faint); }
.lb-trackcol { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lb-track {
  position: relative; height: 15px;
  background: rgba(150,170,210,0.07); border-radius: 5px; overflow: hidden;
}
.lb-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  border-radius: 5px; background: var(--bar-color, var(--public));
  transition: width .7s cubic-bezier(.22,.61,.36,1);
}
@media (prefers-reduced-motion: reduce) { .lb-fill { transition: none; } }
.lb-subline { font-size: 0.7rem; color: var(--faint); font-variant-numeric: tabular-nums; }
.lb-valcol { text-align: right; min-width: 5.6rem; }
.lb-val { font-size: 1.02rem; font-weight: 600; color: var(--paper); font-variant-numeric: tabular-nums lining-nums; }
.lb-vallab { font-size: 0.68rem; color: var(--faint); letter-spacing: 0.04em; text-transform: uppercase; }

/* ============================================================
   COLLABORATION NETWORK  —  the showpiece.
   ============================================================ */
.net-lede strong { color: var(--accent-hot); font-weight: 600; }
.net-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; flex: 1 1 420px; justify-content: flex-end; }
.net-search { flex: 1 1 160px; min-width: 140px; max-width: 240px; padding: 7px 11px; }
.net-sel { flex: 0 0 auto; }
.net-slider { display: flex; flex-direction: column; gap: 5px; flex: 0 0 168px; }
.net-slider input[type="range"] { width: 168px; accent-color: var(--accent); cursor: pointer; height: 18px; }
.net-slider .nsel-lab { white-space: nowrap; }
.net-slider #netMinW { color: var(--accent); font-variant-numeric: tabular-nums; }
.net-node.net-faded { opacity: 0.08 !important; pointer-events: none; }
.net-zoom-ctrl { z-index: 4; }

.net-wrap { display: grid; grid-template-columns: 1fr 248px; gap: 24px; align-items: start; }
.net-stage {
  position: relative;
  background:
    radial-gradient(75% 60% at 50% 42%, rgba(76,196,214,0.06), transparent 62%),
    radial-gradient(60% 50% at 78% 75%, rgba(255,210,74,0.045), transparent 60%),
    linear-gradient(180deg, var(--ink-850), var(--ink-900));
  border: 1px solid var(--hair); border-radius: var(--r);
  overflow: hidden;
  box-shadow: 0 30px 80px -50px rgba(0,0,0,0.9);
}
/* no pan/zoom is wired on the canvas, so don't advertise a draggable surface
   with a grab cursor; nodes keep their own pointer cursor (.net-node). */
#netViz { width: 100%; height: auto; display: block; cursor: default; }

/* edges + nodes */
.net-edge { stroke: var(--accent); pointer-events: none; transition: stroke-opacity .2s; }
.net-node { cursor: pointer; transition: opacity .2s; }
.net-node-dot { transition: stroke-width .15s, filter .15s; }
.net-stage.dim .net-node:not(.hl):not(.adj) { opacity: 0.18; }
.net-stage.dim .net-edge:not(.hl) { stroke-opacity: 0.04 !important; }
.net-node.hl .net-node-dot { stroke: var(--paper); stroke-width: 2; }
.net-node:focus-visible { outline: none; }
.net-node:focus-visible .net-node-dot { stroke: var(--accent); stroke-width: 2.5; }

/* network tooltip (mirrors .map-tooltip) */
.net-tooltip {
  position: absolute; pointer-events: none; opacity: 0;
  transform: translate(-50%, -114%); transition: opacity .14s;
  background: rgba(10, 15, 26, 0.97);
  border: 1px solid var(--hair-strong); border-radius: 10px;
  padding: 11px 14px; min-width: 190px; max-width: 260px;
  box-shadow: 0 18px 40px -18px rgba(0,0,0,0.9); z-index: 5;
}
.net-tooltip.show { opacity: 1; }

.net-side { display: flex; flex-direction: column; gap: 20px; }
.netlegend-list .legend-item { cursor: default; }
.netlegend-list .li-n { font-size: 0.78rem; }
.net-stat .map-stat-fig { font-size: 1.9rem; }

/* ============================================================
   THERAPEUTIC-AREA DEEP-DIVE
   ============================================================ */
.area-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.area-chip {
  appearance: none; cursor: pointer; white-space: nowrap;
  background: var(--ink-900); border: 1px solid var(--hair-strong);
  color: var(--text); font-family: var(--sans); font-weight: 600; font-size: 0.82rem;
  padding: 6px 13px; border-radius: 999px;
  display: inline-flex; align-items: baseline; gap: 7px;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
}
.area-chip:hover { border-color: var(--accent-glow); color: var(--paper); }
.area-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.area-chip .ac-n { font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; font-weight: 500; }
.area-chip[aria-selected="true"] {
  background: var(--accent); color: var(--ink-900); border-color: var(--accent);
  box-shadow: 0 0 16px -4px var(--accent-glow);
}
.area-chip[aria-selected="true"] .ac-n { color: rgba(11,16,25,0.66); }

/* per-area dashboard grid */
.area-dash { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.area-headline {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 28px;
  background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--hair); border-radius: 14px; padding: 20px 24px;
}
.ah-name { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: var(--paper); margin: 0; }
.ah-figs { display: flex; gap: 28px; flex-wrap: wrap; }
.ah-fig { display: flex; flex-direction: column; line-height: 1.05; }
.ah-fig .ahf-n { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: var(--paper); font-variant-numeric: tabular-nums; }
.ah-fig .ahf-n.accent { color: var(--accent); }
.ah-fig .ahf-k { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

/* ============================================================
   SHARED: dossier mini-charts (used in profile modal + area dash)
   ============================================================ */
.dossier-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.dcard {
  background: var(--ink-800); border: 1px solid var(--hair);
  border-radius: 12px; padding: 16px 18px 18px;
}
.dcard.dcard-wide { grid-column: 1 / -1; }
.dcard-title {
  font-size: 0.76rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; margin: 0 0 13px;
}
/* mini horizontal bars (reuse .bar-row language at a denser scale) */
.minibars { display: flex; flex-direction: column; gap: 7px; }
.minibar { display: grid; grid-template-columns: 9.5rem 1fr auto; align-items: center; gap: 11px; }
.minibar-lab { font-size: 0.82rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar-track { position: relative; height: 13px; background: rgba(150,170,210,0.07); border-radius: 4px; overflow: hidden; }
.minibar-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 4px;
  background: var(--bar-color, var(--public));
  transition: width .65s cubic-bezier(.22,.61,.36,1);
}
@media (prefers-reduced-motion: reduce) { .minibar-fill { transition: none; } }
.minibar-val { font-size: 0.8rem; color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }

/* year trend mini area chart */
.dtrend { width: 100%; height: auto; display: block; overflow: visible; }
.dtrend-note { font-size: 0.72rem; color: var(--faint); margin: 8px 0 0; }

/* ranked name lists (top sites / top sponsors) */
.ranklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-item { display: flex; align-items: baseline; gap: 10px; font-size: 0.84rem; }
.rank-item .ri-name { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1 1 auto; }
.rank-item .ri-n { color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.rank-item .ri-bar { flex: 0 0 64px; height: 6px; border-radius: 3px; background: rgba(150,170,210,0.08); position: relative; overflow: hidden; }
.rank-item .ri-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--public); border-radius: 3px; transition: width .6s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .rank-item .ri-bar i { transition: none; } }

/* ---- profile modal (wider dossier) ---- */
.modal-wide { width: min(860px, 100%); }
.profile-eyebrow {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.78rem; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 12px;
}
.profile-title {
  font-family: var(--serif); font-weight: 600; font-size: 1.6rem; line-height: 1.2;
  color: var(--paper); margin: 0 0 16px; padding-right: 30px;
}
.profile-headline {
  display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: baseline;
  padding: 16px 20px; margin-bottom: 22px;
  background: var(--ink-850); border: 1px solid var(--hair); border-radius: 12px;
}
.ph-fig { display: flex; flex-direction: column; line-height: 1.05; }
.ph-fig .phf-n { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; color: var(--paper); font-variant-numeric: tabular-nums; }
.ph-fig .phf-n.accent { color: var(--accent); }
.ph-fig .phf-k { font-size: 0.76rem; color: var(--muted); margin-top: 4px; }
.ph-badge {
  align-self: center; margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.78rem; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}

/* ============================================================
   TRENDS & MOMENTUM (#trends) — temporal analytical depth
   Reuses .intel / .intel-tabs / .itab / .ipanel / .intel-loading /
   .intel-body / .minibars / .chart-card; adds the new chart idioms below.
   ============================================================ */
.tpanel[hidden] { display: none !important; }
.trends-loading[hidden], .trends-body[hidden] { display: none !important; }

.trends-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 24px;
}
.tstat {
  background: var(--ink-800); border: 1px solid var(--hair); border-radius: 14px; padding: 18px 18px 16px;
}
.tstat-lead { border-color: rgba(255,210,74,0.28); box-shadow: 0 0 30px -18px var(--accent-glow); }
.tstat-fig { font-family: var(--serif); font-weight: 600; font-size: 2.1rem; line-height: 1; color: var(--paper); font-variant-numeric: tabular-nums; }
.tstat-lab { font-size: 0.92rem; font-weight: 600; color: var(--text); margin-top: 8px; }
.tstat-sub { font-size: 0.78rem; color: var(--faint); margin-top: 2px; }
.accent-text { color: var(--accent) !important; }

.tgrid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }

/* ---- (1) area momentum: diverging growth bars + sparkline ---- */
.mom-axis {
  display: grid; grid-template-columns: 12.5rem 3.2rem 1fr 4rem 80px; gap: 12px;
  font-size: 0.7rem; letter-spacing: 0.04em; color: var(--faint); margin: 2px 0 8px;
}
.mom-axis-l { grid-column: 3; text-align: left; }
.mom-axis-0 { grid-column: 3; text-align: center; margin-top: -0.95rem; }
.mom-axis-r { grid-column: 3; text-align: right; margin-top: -0.95rem; }
.momentum { display: flex; flex-direction: column; gap: 5px; }
.mom-row {
  display: grid; grid-template-columns: 12.5rem 3.2rem 1fr 4rem 80px;
  align-items: center; gap: 12px; padding: 2px 0;
}
.mom-name { font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.is-rising .mom-name { color: var(--paper); }
.mom-total { font-size: 0.76rem; color: var(--faint); text-align: right; font-variant-numeric: tabular-nums; }
.mom-track { position: relative; height: 15px; background: rgba(150,170,210,0.06); border-radius: 4px; }
.mom-mid { position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: rgba(150,170,210,0.30); }
.mom-fill { position: absolute; top: 0; bottom: 0; width: 0; border-radius: 3px; transition: width 0.7s cubic-bezier(.22,.61,.36,1); }
.mom-pos { left: 50%; background: linear-gradient(90deg, rgba(76,196,214,0.45), var(--public)); }
.mom-neg { right: 50%; background: linear-gradient(270deg, rgba(233,165,66,0.45), var(--private)); }
.mom-growth { font-size: 0.82rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mom-growth.pos { color: var(--public); }
.mom-growth.neg { color: var(--private); }
.mom-spark { width: 80px; height: 24px; display: block; }

/* ---- (1b) COVID-era shift dumbbell ---- */
.db-key { display: flex; gap: 18px; margin: 2px 0 8px; font-size: 0.76rem; color: var(--faint); }
.db-key-item { display: inline-flex; align-items: center; gap: 7px; }
.dumbbell { display: flex; flex-direction: column; gap: 9px; }
.db-row { display: grid; grid-template-columns: 13rem 1fr 4.6rem; align-items: center; gap: 14px; }
.db-name { font-size: 0.85rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-track { position: relative; height: 16px; }
.db-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(150,170,210,0.10); }
.db-conn { position: absolute; top: 50%; height: 3px; transform: translateY(-50%); border-radius: 2px; opacity: 0.55; }
.db-conn.up { background: var(--public); }
.db-conn.down { background: var(--private); }
.db-dot { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; transform: translate(-50%, -50%); border: 1.5px solid var(--ink-900); box-sizing: border-box; }
.db-pre { background: var(--unclass); z-index: 1; }
.db-post { background: var(--public); z-index: 2; }
.db-post.down { background: var(--private); }
.db-key-dot { position: static; transform: none; display: inline-block; }
.db-delta { font-size: 0.8rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.db-delta.pos { color: var(--public); }
.db-delta.neg { color: var(--private); }

/* ---- (2) live pipeline banner ---- */
.pipe-banner {
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  padding: 18px 24px; margin-bottom: 18px;
  background: rgba(255,210,74,0.04); border: 1px solid rgba(255,210,74,0.16); border-radius: 16px;
}
.pipe-fig { display: flex; flex-direction: column; }
.pipe-n { font-family: var(--serif); font-size: 2.5rem; font-weight: 600; line-height: 1; color: var(--paper); font-variant-numeric: tabular-nums; }
.pipe-cap { font-size: 0.82rem; color: var(--muted); margin-top: 6px; max-width: 32ch; }
.pipe-arrow { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }

/* ---- (3) composition over time ---- */
/* aspect-ratio pins the height so the SVG can't collapse to 0 on the
   hidden -> shown tab transition (it's the one chart built inside a panel
   that starts display:none). viewBox is 880x360. */
.otstack-svg { width: 100%; height: auto; aspect-ratio: 880 / 360; display: block; margin-top: 6px; }

/* ---- (4) sponsor momentum table ---- */
.smom-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.smom-table th { white-space: nowrap; user-select: none; }
.smom-sortable { cursor: pointer; }
.smom-sortable:hover { color: var(--accent-hot); }
.smom-sorted { color: var(--accent); }
.smom-arr { opacity: 0.6; font-size: 0.82em; }
.smom-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.smom-rank { text-align: right; color: var(--faint); width: 2.5rem; }
.smom-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.smom-name { display: inline-block; max-width: 17rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--text); }
.smom-cur { color: var(--muted); }
.smom-spark { width: 88px; }
.smom-spark svg { width: 80px; height: 22px; display: block; }
.smom-growth { font-weight: 600; text-align: right; }
.smom-growth.pos { color: var(--public); }
.smom-growth.neg { color: var(--private); }
.smom-growth.flat { color: var(--muted); }
.smom-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; margin: 2px 5px 2px 0;
  font-size: 0.71rem; background: rgba(150,170,210,0.08); border-radius: 20px; color: var(--muted); white-space: nowrap;
}
.smom-chip i { font-style: normal; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

/* ---- (4b) sponsor x area heatmap ---- */
.heatmap-wrap { overflow-x: auto; margin-top: 8px; }
.heatmap {
  display: grid;
  grid-template-columns: 150px repeat(var(--areacols), minmax(34px, 1fr));
  gap: 2px; min-width: 660px;
}
.hm-colh {
  font-size: 0.66rem; color: var(--muted); line-height: 1.05; text-align: center;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 2px 5px; min-height: 50px;
}
.hm-colh span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hm-rowh { font-size: 0.76rem; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; padding-right: 8px; }
.hm-cell {
  min-height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 0.73rem; font-variant-numeric: tabular-nums; font-weight: 600; border-radius: 3px;
  background: transparent;
}

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .net-wrap { grid-template-columns: 1fr; }
  .net-side { flex-direction: row; flex-wrap: wrap; }
  .net-side .legend, .net-side .map-stat { flex: 1 1 220px; }
  .area-dash { grid-template-columns: 1fr; }
  .dossier-grid { grid-template-columns: 1fr; }
  .ipanel-head { align-items: flex-start; }
  .tgrid-2 { grid-template-columns: 1fr; }
  .trends-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .intel { padding-left: 22px; padding-right: 22px; }
  .net-side { flex-direction: column; }
  .lb-row { grid-template-columns: 2rem 1fr auto; gap: 10px; }
  .lb-trackcol { display: none; }
  .minibar { grid-template-columns: 7rem 1fr auto; }
  .itab { padding: 9px 13px 11px; }
  .itab .itab-sub { display: none; }
  .trends-stats { grid-template-columns: 1fr; }
  .mom-axis, .mom-row { grid-template-columns: 8.5rem 1fr 3.4rem; }
  .mom-total, .mom-spark { display: none; }
  .mom-axis-l, .mom-axis-0, .mom-axis-r { grid-column: 2; }
  .db-row { grid-template-columns: 8.5rem 1fr 3.8rem; gap: 10px; }
  .smom-focus { display: none; }
  .smom-name { max-width: 11rem; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-seg, .lb-fill, .minibar-fill, .rank-item .ri-bar i, .mom-fill { transition: none !important; }
}

/* ============================================================
   RICH TRIAL DOSSIER (modal) — summary / outcomes / sites /
   investigators / NSW ethics & governance (s07f trial_detail.json)
   ============================================================ */
.modal-summary { font-size: 0.96rem; line-height: 1.6; color: var(--text); margin: 0 0 20px; }
.modal-grid-detail { margin-bottom: 20px; }
.modal-prose { font-size: 0.9rem; line-height: 1.55; color: var(--text); margin: 0; }
.sec-count { font-size: 0.78rem; color: var(--faint); font-weight: 500; font-variant-numeric: tabular-nums; }

.mout-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: mout; }
.mout { position: relative; padding-left: 28px; }
.mout::before {
  counter-increment: mout; content: counter(mout); position: absolute; left: 0; top: 1px;
  width: 19px; height: 19px; border-radius: 50%; background: rgba(150,170,210,0.1); color: var(--muted);
  font-size: 0.72rem; font-weight: 600; display: flex; align-items: center; justify-content: center;
}
.mout-measure { display: block; font-size: 0.9rem; color: var(--text); line-height: 1.45; }
.mout-time { display: block; font-size: 0.78rem; color: var(--faint); margin-top: 3px; }

.msite-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.minv-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.minv { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 0.9rem; }
.minv-name { color: var(--paper); font-weight: 600; }
.minv-role { font-size: 0.76rem; color: var(--public); }
.minv-aff { font-size: 0.8rem; color: var(--muted); }

.gov-panel {
  margin-top: 22px; padding: 18px 20px; border-radius: 14px;
  background: rgba(76,196,214,0.05); border: 1px solid rgba(76,196,214,0.22);
}
.gov-panel-head {
  display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-weight: 600;
  font-size: 1.05rem; color: var(--public); margin-bottom: 14px;
}
.gov-panel-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--public); box-shadow: 0 0 8px var(--public); flex: none; }
.gov-block { margin-bottom: 14px; }
.gov-block:last-child { margin-bottom: 0; }
.gov-block-t { font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.gov-row { display: flex; gap: 12px; padding: 4px 0; border-bottom: 1px solid rgba(150,170,210,0.06); }
.gov-row:last-child { border-bottom: none; }
.gov-k { flex: 0 0 38%; font-size: 0.82rem; color: var(--muted); }
.gov-v { flex: 1 1 auto; font-size: 0.86rem; color: var(--text); }
.gov-sites { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gov-sites li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 10px; font-size: 0.84rem;
  padding: 7px 11px; background: rgba(11,16,25,0.45); border-radius: 8px;
}
.gov-site-org { color: var(--paper); font-weight: 500; }
.gov-site-lhd { font-size: 0.78rem; color: var(--muted); }
.gov-site-status { margin-left: auto; font-size: 0.76rem; color: var(--public); white-space: nowrap; }

/* facility dossier — its trials list (each row opens the trial dossier) */
.ftrial-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow-y: auto; }
.ftrial {
  width: 100%; text-align: left; display: flex; flex-direction: column; gap: 3px;
  padding: 9px 12px; background: var(--ink-800); border: 1px solid var(--hair);
  border-radius: 9px; cursor: pointer; transition: border-color .15s, background .15s;
}
.ftrial:hover { border-color: var(--hair-strong); background: var(--ink-700); }
.ftrial:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ftrial-title { font-size: 0.88rem; color: var(--paper); line-height: 1.35; }
.ftrial-meta { font-size: 0.76rem; color: var(--muted); }

/* dossier enrichment — health conditions, study-design grid, NSW reach, scope */
.sec-hint { font-family: var(--sans); font-weight: 400; font-size: 0.72rem; letter-spacing: 0.01em;
  text-transform: none; color: var(--faint); margin-left: 10px; }
.cond-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.cond-chip {
  font-size: 0.82rem; font-weight: 500; color: var(--accent);
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255,210,74,0.08); border: 1px solid rgba(255,210,74,0.28);
}
.cov-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; padding: 6px 0; }
.cov-row + .cov-row { border-top: 1px solid rgba(150,170,210,0.07); }
.cov-k { flex: 0 0 150px; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cov-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; }
.cov-chip {
  font-size: 0.8rem; color: var(--text); padding: 4px 10px; border-radius: 7px;
  background: var(--ink-800); border: 1px solid var(--hair-strong);
}
.cov-chip-precinct { color: var(--academic); border-color: rgba(157,124,240,0.32); background: rgba(157,124,240,0.06); }
.scope-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.scope-item {
  display: flex; align-items: baseline; gap: 9px; font-size: 0.85rem; color: var(--text);
  padding: 6px 11px; background: rgba(76,196,214,0.05); border-radius: 8px;
}
.scope-tick { color: var(--public); font-weight: 700; flex: none; }

/* deep dossier (P26) — results banner, eligibility, arms, interventions, ethics
   committees, publications, MeSH (the full recovered ct.gov + ANZCTR detail) */
.results-banner { display: flex; align-items: center; gap: 10px; margin: 14px 0; padding: 10px 14px;
  border-radius: 10px; background: rgba(76,196,214,0.08); border: 1px solid rgba(76,196,214,0.3);
  text-decoration: none; color: var(--text); transition: border-color .15s; }
.results-banner:hover { border-color: var(--public); }
.rb-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--public); box-shadow: 0 0 8px var(--public); flex: none; }
.rb-text { font-size: 0.85rem; } .rb-text b { color: var(--public); }
.rb-go { margin-left: auto; font-size: 0.77rem; color: var(--public); white-space: nowrap; }
.mesh-line { margin-top: 7px; font-size: 0.76rem; color: var(--faint); }
.elig-demo { font-size: 0.85rem; color: var(--paper); margin: 0 0 8px; font-weight: 500; }
.elig-criteria { white-space: pre-wrap; font-size: 0.83rem; line-height: 1.55; color: var(--text);
  background: var(--ink-900); border: 1px solid var(--hair); border-radius: 9px; padding: 12px 14px;
  max-height: 360px; overflow-y: auto; }
.arm-list, .intv-list, .ec-list, .pub-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.arm { padding: 9px 12px; background: var(--ink-800); border: 1px solid var(--hair); border-radius: 9px; }
.arm-head { display: flex; align-items: baseline; gap: 9px; }
.arm-name { font-weight: 600; font-size: 0.88rem; color: var(--paper); }
.arm-type { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); }
.arm-desc { margin-top: 5px; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.intv { padding: 8px 12px; background: var(--ink-800); border: 1px solid var(--hair); border-radius: 9px; }
.intv-name { font-weight: 600; font-size: 0.86rem; color: var(--paper); }
.intv-type { margin-left: 8px; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--academic); }
.intv-desc { margin-top: 4px; font-size: 0.82rem; color: var(--muted); line-height: 1.45; }
.mout-desc { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.ec-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 11px; background: var(--ink-800); border-radius: 8px; font-size: 0.84rem; }
.ec-name { color: var(--paper); } .ec-id { font-size: 0.76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pub-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; padding: 8px 11px; background: var(--ink-800); border-radius: 8px; font-size: 0.83rem; line-height: 1.45; }
.pub-type { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); border: 1px solid var(--hair-strong); border-radius: 5px; padding: 1px 6px; flex: none; }
.pub-cite { color: var(--text); flex: 1 1 200px; }
.pub-link { color: var(--accent); text-decoration: none; white-space: nowrap; font-size: 0.78rem; }
.pub-link:hover { text-decoration: underline; }

/* posted results tables (P27) — participant flow, outcome values, adverse events */
.res-sec { border-top: 1px solid var(--hair-strong); margin-top: 22px; padding-top: 16px; }
.res-h { font-size: 0.85rem; font-weight: 600; color: var(--public); margin: 16px 0 8px; }
.res-h5 { font-size: 0.74rem; font-weight: 600; color: var(--muted); margin: 12px 0 6px; text-transform: uppercase; letter-spacing: 0.05em; }
.res-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; margin-bottom: 4px; }
.res-table th { text-align: left; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); font-weight: 600; padding: 5px 9px; border-bottom: 1px solid var(--hair-strong); }
.res-table td { padding: 6px 9px; border-bottom: 1px solid rgba(150,170,210,0.06); color: var(--text); vertical-align: top; }
.res-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.res-den { color: var(--faint); }
.res-outcome { margin: 8px 0; padding: 9px 12px; background: var(--ink-900); border: 1px solid var(--hair); border-radius: 9px; }
.res-otitle { font-size: 0.86rem; color: var(--paper); font-weight: 500; line-height: 1.4; }
.res-otype { font-size: 0.64rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); border: 1px solid rgba(255,210,74,0.3); border-radius: 5px; padding: 1px 6px; margin-right: 8px; white-space: nowrap; }
.res-ometa { font-size: 0.76rem; color: var(--faint); margin-top: 3px; }
.res-vals { margin-top: 8px; }
.res-vals td { border-bottom: none; padding: 3px 9px; }
.res-unit { color: var(--faint); font-size: 0.76rem; }
.res-note { font-size: 0.74rem; color: var(--faint); margin: 2px 0 8px; }
.res-events .res-term { color: var(--paper); }
.res-organ { color: var(--muted); font-size: 0.78rem; }

/* record linkage & provenance panel */
.lk-panel { display: flex; flex-direction: column; gap: 12px; }
.lk-conf {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 11px 15px; border-radius: 11px; border: 1px solid var(--hair-strong);
}
.lk-tier { font-family: var(--serif); font-weight: 600; font-size: 1rem; }
.lk-count { font-size: 0.76rem; color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }
.lk-verified { background: rgba(255,210,74,0.07); border-color: rgba(255,210,74,0.32); }
.lk-verified .lk-tier { color: var(--accent); }
.lk-linked { background: rgba(76,196,214,0.06); border-color: rgba(76,196,214,0.30); }
.lk-linked .lk-tier { color: var(--public); }
.lk-single { background: var(--ink-800); }
.lk-single .lk-tier { color: var(--muted); }
.lk-statement { font-size: 0.84rem; line-height: 1.5; color: var(--muted); margin: 0; }
.lk-rows { display: flex; flex-direction: column; gap: 5px; }
.lk-row {
  display: flex; align-items: baseline; gap: 10px; padding: 9px 12px; border-radius: 9px;
  background: var(--ink-800); border: 1px solid var(--hair);
}
.lk-row.off { opacity: 0.45; }
.lk-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; align-self: center; }
.lk-sys { font-weight: 600; font-size: 0.86rem; color: var(--paper); flex: 0 0 140px; }
.lk-role { font-size: 0.78rem; color: var(--faint); flex: 1 1 auto; }
.lk-id { font-family: var(--mono, monospace); font-size: 0.8rem; color: var(--text); font-variant-numeric: tabular-nums; }
.lk-id-no { color: var(--faint); font-style: italic; }
.lk-id-yes { color: var(--public); }
.lk-go { font-size: 0.78rem; color: var(--accent); text-decoration: none; white-space: nowrap; }
.lk-go:hover { text-decoration: underline; }
.lk-internal { color: var(--faint); }
@media (max-width: 560px) {
  .lk-role { display: none; }
  .lk-sys { flex-basis: auto; }
}

/* institution register — Explore-style filter bar + per-site trial dot */
.inst-filterbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin: 2px 0 18px; }
.inst-filterbar .nsel { flex: 0 0 auto; }
.inst-search { flex: 1 1 200px; min-width: 160px; align-self: stretch; }
.inst-count { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; margin-left: auto; align-self: center; white-space: nowrap; }
.ft-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--public); box-shadow: 0 0 6px var(--public); margin-right: 7px; vertical-align: middle; flex: none; }
/* investigator-panel coverage caveat — visible but not alarmist */
.people-caveat {
  margin: 0 0 14px; padding: 10px 14px; border-radius: 9px;
  background: rgba(233,165,66,0.06); border: 1px solid rgba(233,165,66,0.26);
  color: var(--muted); line-height: 1.5;
}

/* ============================================================
   SOURCES tab — 4-system provenance (per-source totals + UpSet)
   ============================================================ */
.src-loading[hidden], .sources-body[hidden] { display: none !important; }
.src-totals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 6px 0 28px; }
.src-total { background: var(--ink-800); border: 1px solid var(--hair); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 3px; }
.src-total-dot { width: 12px; height: 12px; border-radius: 50%; }
.src-total-n { font-family: var(--serif); font-weight: 600; font-size: 2rem; line-height: 1; color: var(--paper); font-variant-numeric: tabular-nums; margin-top: 7px; }
.src-total-lab { font-size: 0.82rem; color: var(--muted); }
.src-upset-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.src-upset { display: flex; flex-direction: column; gap: 5px; }
.ups-row { display: grid; grid-template-columns: 96px 1fr 4rem; align-items: center; gap: 14px; padding: 3px 0; }
.ups-dots { display: flex; gap: 6px; }
.ups-dot { width: 12px; height: 12px; border-radius: 50%; background: rgba(150,170,210,0.13); }
.ups-bar { position: relative; height: 15px; background: rgba(150,170,210,0.06); border-radius: 4px; overflow: hidden; }
.ups-bar i { display: block; height: 100%; background: var(--muted); border-radius: 4px; }
.ups-row.is-unique .ups-bar i { background: var(--accent); }
.ups-row.is-unique .ups-n { color: var(--accent-hot); }
.ups-n { text-align: right; font-size: 0.84rem; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
/* national 3-set Venn (registries + NSW governance) */
.venn3nat-wrap { margin: 4px 0 30px; display: flex; flex-direction: column; align-items: center; }
.venn3nat-svg { width: 100%; max-width: 560px; height: auto; display: block; }
.venn3nat-svg .v3-setlab { fill: var(--muted); font-family: var(--sans); font-size: 14px; font-weight: 600; }
.venn3nat-svg .v3-n { fill: var(--paper); font-family: var(--sans); font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; }
.venn3nat-svg .v3-n.v3-sm { font-size: 15px; fill: var(--text); }
.venn3nat-note { font-size: 0.88rem; color: var(--muted); max-width: 72ch; text-align: center; margin-top: 10px; line-height: 1.55; }
.venn3nat-note strong { color: var(--accent); }
@media (max-width: 720px) {
  .src-totals { grid-template-columns: repeat(2, 1fr); }
  .ups-row { grid-template-columns: 78px 1fr 3rem; gap: 10px; }
}
