/* AI Tumor Board — design tokens + components */

:root {
  --bg: #F4F7FB;
  --bg-elev: #FFFFFF;
  --bg-sunken: #EAEFF6;
  --bg-tint: #F9FBFD;
  --border: #DEE6F1;
  --border-strong: #C6D1E2;
  --text: #0B1424;
  --text-muted: #56657E;
  --text-faint: #8B96AA;
  --primary: #1F4FA0;
  --primary-strong: #163A78;
  --primary-soft: rgba(31, 79, 160, .08);
  --accent: #0FAE9A;
  --accent-strong: #0A8D7C;
  --accent-soft: rgba(15, 174, 154, .10);
  --warn: #B45309;
  --danger: #C03434;
  --success: #15803D;
  --shadow-xs: 0 1px 2px rgba(15, 30, 60, .04);
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, .05), 0 1px 1px rgba(15, 30, 60, .03);
  --shadow-md: 0 4px 14px -2px rgba(15, 30, 60, .08), 0 2px 6px rgba(15, 30, 60, .05);
  --shadow-lg: 0 14px 40px -8px rgba(15, 30, 60, .14), 0 4px 12px rgba(15, 30, 60, .06);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --sans: "Geist", "Manrope", ui-sans-serif, system-ui, sans-serif;
  --serif: "Source Serif 4", "IBM Plex Serif", Georgia, serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }

/* ─── Header ───────────────────────────────────────────── */
.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 20px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  height: 56px;
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14.5px; }
.brand-mark {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 7px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white; font-size: 13px; font-weight: 700; box-shadow: var(--shadow-sm);
}
.brand-sub {
  font-size: 11px; color: var(--text-faint); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--border);
}
.topbar-nav {
  display: flex; gap: 4px;
  background: var(--bg-sunken); padding: 3px;
  border-radius: 9px; border: 1px solid var(--border);
  justify-self: center;
}
.topbar-nav a {
  text-decoration: none; color: var(--text-muted);
  padding: 5px 14px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
}
.topbar-nav a.active, .topbar-nav a:hover {
  background: var(--bg-elev); color: var(--text); box-shadow: var(--shadow-xs);
}
.topbar-right { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.disclaimer-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  color: var(--warn); background: rgba(180, 83, 9, .08);
  border: 1px solid rgba(180, 83, 9, .18); border-radius: 999px;
  font-family: var(--mono); letter-spacing: 0.02em; white-space: nowrap;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── Page shell ───────────────────────────────────────── */
.page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex; flex-direction: column; gap: 22px;
}

/* ─── Hero input ───────────────────────────────────────── */
.hero {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 22px 24px 18px;
}
.hero-label {
  display: block; font-weight: 600; font-size: 14px; margin-bottom: 10px;
  color: var(--text);
}
.phi-warn { color: var(--danger); font-weight: 600; font-size: 13px; margin-left: 2px; }
.phi-warn a { color: var(--danger); text-decoration: underline; text-underline-offset: 2px; }
.phi-warn a:hover { color: #7c1d1d; }
.hero textarea {
  width: 100%; font-family: var(--sans); font-size: 14.5px; line-height: 1.55;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 14px 16px; resize: vertical; min-height: 160px;
  background: var(--bg-tint); color: var(--text);
}
.hero textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  background: var(--bg-elev);
}
.hero-row {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.btn {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  font-family: var(--sans); font-size: 13.5px; font-weight: 600;
  padding: 9px 18px; cursor: pointer;
  transition: background 120ms, transform 80ms;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:not(:disabled):active { transform: translateY(1px); }
.btn.primary {
  background: var(--primary); color: white; border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}
.btn.primary:not(:disabled):hover { background: var(--primary-strong); }
.btn.ghost {
  background: var(--bg-elev); color: var(--text); border-color: var(--border-strong);
}
.btn.ghost:not(:disabled):hover { background: var(--bg-sunken); }
.status-line {
  font-size: 13px; color: var(--text-muted); margin-left: auto;
  font-family: var(--mono);
}
.status-line.running { color: var(--primary); }
.status-line.ok { color: var(--success); }
.status-line.warn {
  color: var(--warn);
  background: rgba(180, 83, 9, .10);
  border: 1px solid rgba(180, 83, 9, .25);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

/* Patient location + clinical-trial toggle row */
.hero-options {
  display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap;
}
.loc-input {
  flex: 1 1 280px; min-width: 220px;
  font-family: var(--sans); font-size: 13.5px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  padding: 9px 14px; background: var(--bg-tint); color: var(--text);
}
.loc-input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft); background: var(--bg-elev);
}
.trial-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; font-weight: 600; color: var(--text);
  cursor: pointer; -webkit-user-select: none; user-select: none; white-space: nowrap;
}
.trial-toggle input { accent-color: var(--primary); width: 15px; height: 15px; cursor: pointer; }

/* Inline validation under the case textarea */
.case-error {
  display: block;
  margin-top: 6px;
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--sans);
}

/* ─── Section headings ─────────────────────────────────── */
.section { display: flex; flex-direction: column; gap: 12px; }
.section[hidden], [hidden] { display: none !important; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 0 4px;
}
.section-head h2 {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--text);
}
.section-meta {
  font-size: 11px; color: var(--text-faint); font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.06em;
}
.muted { color: var(--text-faint); font-weight: 400; }

/* ─── Round table ──────────────────────────────────────── */
.table-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: 24px;
  position: relative;
}
.table-stage {
  position: relative; width: 100%;
  aspect-ratio: 760 / 360;
  min-height: 320px;
}
.rt-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.rt-center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  width: 144px; height: 144px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
}
.rt-center-label {
  font-size: 10px; font-family: var(--mono); text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-faint);
}
.rt-center-big {
  font-size: 38px; font-weight: 700; letter-spacing: -0.02em; color: var(--text);
  line-height: 1; margin-top: 2px; font-family: var(--serif);
}
.rt-center-big .rt-of { font-size: 16px; color: var(--text-faint); font-weight: 400; }
.rt-center-sub {
  font-size: 11px; color: var(--accent-strong); font-weight: 600;
  margin-top: 6px; font-family: var(--mono); letter-spacing: 0.03em;
}
/* Center "working" state during the judge / synthesis phases — makes the otherwise
   static board visibly active while the post-specialist work runs. */
.rt-center.working { animation: rtCenterPulse 1.5s ease-in-out infinite; }
.rt-center.working .rt-center-sub { color: var(--primary); animation: rtSubBlink 1.2s ease-in-out infinite; }
@keyframes rtCenterPulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--primary-soft); }
  50% { box-shadow: 0 0 0 12px transparent; }
}
@keyframes rtSubBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.rt-node {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 8px 14px 8px 8px;
  box-shadow: var(--shadow-sm);
  min-width: 132px;
  transition: transform 200ms, border-color 200ms, box-shadow 200ms;
}
.rt-node.active {
  border-color: var(--agent-color);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--agent-color) 18%, transparent), var(--shadow-md);
  transform: translate(-50%, -50%) scale(1.04);
}
.rt-node.skipped, .rt-node.abstained {
  opacity: 0.55; filter: grayscale(0.6);
}
.rt-node.agreed { border-color: var(--success); }
.rt-node.disagreed { border-color: var(--warn); }
.rt-avatar {
  width: 28px; height: 28px; border-radius: 7px;
  display: grid; place-items: center;
  color: white; font-size: 11px; font-weight: 700; font-family: var(--mono);
  letter-spacing: 0.02em;
}
.rt-info { display: flex; flex-direction: column; line-height: 1.2; }
.rt-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.rt-meta { font-size: 10.5px; color: var(--text-faint); font-family: var(--mono); text-transform: lowercase; }

/* ─── Final card ───────────────────────────────────────── */
.final-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
  padding: 24px 28px; font-size: 14.5px; line-height: 1.65;
}
.final-card h1, .final-card h2 {
  font-family: var(--serif); font-weight: 600; letter-spacing: -0.01em;
  margin: 18px 0 8px;
}
.final-card h2 { font-size: 18px; }
.final-card h3 { font-size: 15px; margin: 14px 0 6px; font-weight: 600; }
.final-card p { margin: 8px 0; }

/* Bottom-line lede: first heading + paragraph get prominent treatment */
.final-card > h2:first-child {
  margin-top: 0;
  font-size: 13px; font-weight: 600; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-strong);
}
.final-card > h2:first-child + p {
  font-family: var(--serif);
  font-size: 17.5px; line-height: 1.55;
  color: var(--text);
  padding: 14px 18px;
  margin: 4px 0 22px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
}
.final-card > h2:first-child + p .cite {
  font-size: 12.5px;
}
.final-card ul, .final-card ol { padding-left: 22px; margin: 8px 0; }
.final-card .cite {
  display: inline-block; background: var(--accent-soft); color: var(--accent-strong);
  padding: 1px 6px; border-radius: 4px; font-weight: 600; font-size: 11.5px;
  text-decoration: none; font-family: var(--mono); margin: 0 1px;
}
.final-card .cite:hover { background: var(--accent); color: white; }

.verdict {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-weight: 600; font-size: 11.5px; font-family: var(--mono);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.verdict.agreed { background: rgba(21, 128, 61, .12); color: var(--success); }
.verdict.no-consensus { background: rgba(180, 83, 9, .12); color: var(--warn); }

.ag-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: help;
}
.ag-label.strong { background: rgba(21, 128, 61, .12); color: var(--success); }
.ag-label.moderate { background: var(--primary-soft); color: var(--primary); }
.ag-label.limited { background: rgba(180, 83, 9, .12); color: var(--warn); }

/* ─── Evidence ─────────────────────────────────────────── */
.evidence-filters {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 2px;
}
.ev-filter {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.04em;
  padding: 5px 11px; border-radius: 999px;
  background: var(--bg-elev); border: 1px solid var(--border-strong);
  color: var(--text-muted); cursor: pointer;
}
.ev-filter:hover { color: var(--text); border-color: var(--text-muted); }
.ev-filter.on {
  background: var(--text); color: var(--bg-elev); border-color: var(--text);
}
.evidence-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ev-card {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 18px;
  box-shadow: var(--shadow-xs);
  display: flex; flex-direction: column; gap: 6px;
  transition: border-color 120ms, box-shadow 120ms;
}
.ev-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ev-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.ev-label {
  font-family: var(--mono); font-weight: 700; font-size: 11px;
  background: var(--accent-soft); color: var(--accent-strong);
  padding: 2px 7px; border-radius: 5px;
}
.ev-source {
  font-family: var(--mono); font-size: 10.5px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.ev-type {
  font-size: 10px; font-weight: 700; padding: 1px 7px;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.04em;
  font-family: var(--mono);
}
.ev-type.strength-high { background: rgba(21, 128, 61, .12); color: var(--success); }
.ev-type.strength-med  { background: var(--primary-soft); color: var(--primary); }
.ev-type.strength-low  { background: rgba(180, 83, 9, .10); color: var(--warn); }
.ev-type.strength-unknown { background: var(--bg-sunken); color: var(--text-faint); }
.ev-year { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: var(--mono); }
.ev-title { font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text); }
.ev-title a { color: var(--text); text-decoration: none; }
.ev-title a:hover { color: var(--primary); text-decoration: underline; }
.ev-journal { font-size: 12px; font-style: italic; color: var(--text-muted); }
.ev-cited { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.ev-tag {
  font-size: 10px; padding: 2px 8px; border-radius: 999px; font-weight: 600;
  font-family: var(--mono);
}
.ev-snippet { margin-top: 4px; font-size: 12px; }
.ev-snippet summary { cursor: pointer; color: var(--text-faint); font-size: 11px; }
.ev-snippet p {
  margin: 6px 0 0; padding: 8px 10px; background: var(--bg-tint);
  border-radius: var(--radius-sm); color: var(--text); font-size: 12px; line-height: 1.5;
}
.ev-empty {
  padding: 24px; text-align: center; color: var(--text-faint); font-style: italic;
  background: var(--bg-elev); border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
}

/* ─── Discussion transcript (collapsible) ──────────────── */
.transcript-toggle {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 16px;
  cursor: pointer; font-family: var(--sans); font-size: 14px; color: var(--text);
  box-shadow: var(--shadow-xs);
}
.transcript-toggle:hover { background: var(--bg-sunken); }
.chevron { transition: transform 120ms; font-size: 12px; color: var(--text-faint); }
.section-transcript.open .chevron { transform: rotate(0deg); }
.section-transcript:not(.open) .chevron { transform: rotate(-90deg); }
.t-title { font-weight: 600; }
.t-count { margin-left: auto; color: var(--text-faint); font-size: 12px; font-family: var(--mono); }
.transcript-body { margin-top: 12px; }
.transcript {
  list-style: none; padding: 0; margin: 0;
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xs);
  overflow: hidden;
}
.post {
  display: flex; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.post:last-child { border-bottom: none; }
.post.skipped { opacity: 0.6; }
.post.chair { background: var(--bg-tint); }
.post.chair.agreed { background: rgba(21, 128, 61, .04); }
.post.chair.disagreed { background: rgba(180, 83, 9, .04); }
.post-av {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
  color: white; font-size: 11px; font-weight: 700; font-family: var(--mono);
}
.post-av.chair-av {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-family: var(--serif); font-size: 14px;
}
.post-body { flex: 1; min-width: 0; }
.post-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.post-name { font-weight: 600; font-size: 13px; color: var(--text); }
.post-tag {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  background: var(--bg-sunken); color: var(--text-muted);
  padding: 2px 7px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.post-text { font-size: 13.5px; line-height: 1.55; color: var(--text); }
.post-text .cite {
  display: inline-block; background: var(--accent-soft); color: var(--accent-strong);
  padding: 0 5px; border-radius: 4px; font-weight: 600; font-size: 11px;
  text-decoration: none; font-family: var(--mono); margin: 0 1px;
}
.post-text .cite:hover { background: var(--accent); color: white; }

/* ─── About / Privacy pages ────────────────────────────── */
.about-page { max-width: 880px; margin: 24px auto; padding: 0 24px; display: flex; flex-direction: column; gap: 16px; }
.about-card {
  background: var(--bg-elev); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  padding: 22px 26px;
}
.about-card h2 {
  margin: 0 0 12px; font-size: 18px; font-weight: 600; color: var(--text);
  font-family: var(--serif);
}
.about-card p { margin: 8px 0; font-size: 14px; line-height: 1.7; color: var(--text); }
.about-card ul { margin: 8px 0; padding-left: 20px; font-size: 14px; line-height: 1.75; }
.about-card code {
  background: var(--bg-sunken); padding: 1px 5px; border-radius: 3px;
  font-family: var(--mono); font-size: 12.5px;
}
.about-card.warning { border-color: #FBC8C8; background: #FFF7F7; }
.about-card .author-name { font-size: 16px; margin-bottom: 4px; }
.about-card .author-links { margin-top: 14px; font-size: 13px; }
.about-card .author-links a { color: var(--primary); text-decoration: none; }
.about-card .author-links a:hover { text-decoration: underline; }
.about-card .author-links .sep { color: var(--text-faint); margin: 0 8px; }

/* ─── Responsive ──────────────────────────────────────── */
@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr auto; }
  .topbar-right { display: none; }
  .page { padding: 18px 14px 60px; }
  .table-stage { min-height: 480px; aspect-ratio: 1 / 1; }
  .rt-node { min-width: 100px; padding: 6px 10px 6px 6px; }
  .rt-name { font-size: 11px; }
  .rt-meta { font-size: 10px; }
  .rt-center { width: 110px; height: 110px; }
  .rt-center-big { font-size: 30px; }
  .hero textarea { min-height: 120px; }
}

/* ─────────────────────────────────────────────────────────────
   Agent hover popover (round-table nodes) + Clinical-trials section
   ───────────────────────────────────────────────────────────── */
/* Let popovers escape the table card instead of being clipped. */
.table-card, .table-stage { overflow: visible; }
.rt-node { position: absolute; }
.rt-node:hover, .rt-node:focus-within { z-index: 60; outline: none; }
.rt-node { cursor: pointer; }

.rt-pop {
  display: none;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 88vw);
  height: 380px;               /* default — drag the bottom-right corner to resize */
  min-width: 260px; min-height: 160px;
  max-width: 92vw; max-height: 80vh;
  resize: both;                /* user-resizable; applies to every agent */
  overflow: hidden;            /* required for resize; the body scrolls inside */
  flex-direction: column;
  background: var(--bg-elev, #fff);
  border: 1px solid var(--border-strong, #d0d7e2);
  border-radius: var(--radius-md, 10px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  z-index: 70;
  text-align: left;
  cursor: default;
}
.rt-node:hover .rt-pop,
.rt-node:focus-within .rt-pop { display: flex; }
.rt-node.rt-top .rt-pop { top: calc(100% + 8px); }
.rt-node.rt-bottom .rt-pop { bottom: calc(100% + 8px); }
/* Invisible bridge so the pointer can travel from node to popover without flicker. */
.rt-node.rt-top .rt-pop::before { content: ""; position: absolute; top: -10px; left: 0; right: 0; height: 10px; }
.rt-node.rt-bottom .rt-pop::after { content: ""; position: absolute; bottom: -10px; left: 0; right: 0; height: 10px; }

.rt-pop-head {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border, #e6eaf0);
  border-left: 3px solid var(--agent-color, var(--primary));
  border-top-left-radius: var(--radius-md, 10px); border-top-right-radius: var(--radius-md, 10px);
}
.rt-pop-name { font-weight: 700; font-size: 13px; color: var(--text); }
.rt-pop-status {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--text-muted); background: var(--bg-sunken, #f1f5f9);
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.rt-pop-body { flex: 1 1 auto; padding: 10px 12px; overflow: auto; }
.rt-pop-muted { color: var(--text-muted); font-size: 12.5px; margin: 0; }
.rt-pop-sec { margin-bottom: 10px; }
.rt-pop-sec:last-child { margin-bottom: 0; }
.rt-pop-h {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); margin-bottom: 3px;
}
.rt-pop-sec p { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text); }
.rt-pop-src { margin: 0; padding-left: 16px; font-size: 12px; line-height: 1.45; }
.rt-pop-src a { color: var(--primary); text-decoration: none; }
.rt-pop-src a:hover { text-decoration: underline; }
.rt-pop-draft { font-size: 12.5px; line-height: 1.5; color: var(--text); }
/* Normalize ALL rendered content to one size so "What it concluded" and
   "Full reasoning" read consistently (lists/headings no longer default-sized). */
.rt-pop-draft :is(p, li, ul, ol) { font-size: 12.5px; margin: 4px 0; }
.rt-pop-draft :is(h1, h2, h3, h4) { font-size: 12.5px; font-weight: 700; margin: 8px 0 4px; }
.rt-pop-draft ul, .rt-pop-draft ol { padding-left: 18px; }
.rt-pop-draft table { width: 100%; border-collapse: collapse; font-size: 11px; margin: 6px 0; }
.rt-pop-draft th, .rt-pop-draft td { border: 1px solid var(--border, #e6eaf0); padding: 3px 5px; text-align: left; }

/* Clinical-trials section */
.trials-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px;
}
.trial-card {
  border: 1px solid var(--border-strong, #d0d7e2); border-left: 4px solid #14b8a6;
  border-radius: var(--radius-md, 10px); padding: 12px 14px; background: var(--bg-tint, #fafcff);
}
.trial-nct { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: #0d9488; }
.trial-title { font-weight: 600; font-size: 13.5px; margin: 3px 0 6px; color: var(--text); line-height: 1.35; }
.trial-sum { font-size: 12px; color: var(--text-muted); line-height: 1.45; margin-bottom: 8px; }
.trial-link { font-size: 12.5px; font-weight: 600; color: var(--primary); text-decoration: none; }
.trial-link:hover { text-decoration: underline; }
.trials-analysis { margin-top: 16px; font-size: 13.5px; line-height: 1.55; }
.trials-analysis table { border-collapse: collapse; width: 100%; margin: 8px 0; font-size: 12.5px; }
.trials-analysis th, .trials-analysis td { border: 1px solid var(--border, #e6eaf0); padding: 4px 8px; text-align: left; }

