/* HealthSurface: newsprint light theme. Serif for reading, bold sans for navigation and labels. */
:root {
  --paper: #ffffff;
  --paper-2: #f6f5f1;
  --ink: #111111;
  --ink-2: #3a3a3a;
  --muted: #6b6b6b;
  --rule: #e2e0da;
  --rule-strong: #111111;
  --accent: #0b6e5f;
  --accent-ink: #ffffff;
  --band: #0f1312;
  --band-2: #1a201e;
  --band-text: #f4f4f1;
  --band-muted: #a9b0ad;

  --l-press: #9a5800;
  --l-pre: #7a2f8f;
  --l-peer: #1c7a3e;
  --l-reg: #1f4fbf;
  --l-news: #5b5b5b;

  --serif: "Newsreader", "Times New Roman", Times, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 18px/1.55 var(--serif);
  font-optical-sizing: auto;
}
a { color: inherit; }
button { font: inherit; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Masthead ---------- */
.masthead { background: var(--paper); }
.masthead-top {
  display: flex; justify-content: space-between; gap: 12px;
  font: 600 0.72rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  padding-top: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--rule);
}
.masthead-top p { margin: 0; }
.masthead-title { text-align: center; padding-top: 22px; padding-bottom: 18px; }
.brand { margin: 0; font: 700 clamp(2.4rem, 6vw, 4.4rem)/1 var(--serif); letter-spacing: -0.02em; }
.brand a { text-decoration: none; }
.tagline { margin: 10px 0 0; font: italic 400 1.1rem/1.4 var(--serif); color: var(--ink-2); }

.sections {
  position: sticky; top: 0; z-index: 10; background: var(--paper);
  border-top: 3px solid var(--rule-strong); border-bottom: 1px solid var(--rule-strong);
}
.sections-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding-top: 8px; padding-bottom: 8px; }
.tabs { grid-column: 2; display: flex; gap: 6px; }
.sections [role="tab"] {
  font: 700 0.8rem/1 var(--sans); letter-spacing: 0.08em; text-transform: uppercase;
  background: var(--paper-2); color: var(--ink); border: 1px solid var(--rule); border-radius: 999px; padding: 10px 18px; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.sections [role="tab"]:hover { background: var(--rule); border-color: var(--ink); }
.sections [role="tab"][aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.disclaimer { grid-column: 3; justify-self: end; text-align: right; font: italic 400 0.95rem/1.2 var(--serif); color: var(--ink-2); }

/* ---------- In focus band (feature + scrolling playlist) ---------- */
.focus { background: var(--band); color: var(--band-text); padding: 36px 0 40px; margin-bottom: 8px; }
.focus-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.focus-head h2 { margin: 0; font: 800 0.8rem/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; }
.focus-head p { margin: 0; font: italic 400 1rem/1.3 var(--serif); color: var(--band-muted); }
.focus-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }

.feature {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 380px; padding: 32px; border-radius: 20px; overflow: hidden;
  background:
    radial-gradient(120% 90% at 85% 10%, rgba(11, 110, 95, 0.55), transparent 60%),
    radial-gradient(90% 80% at 0% 100%, rgba(31, 79, 191, 0.35), transparent 60%),
    var(--band-2);
}
.feature .kicker { color: var(--band-text); }
.feature h3 { margin: 12px 0 12px; font: 600 clamp(1.6rem, 3.2vw, 2.6rem)/1.12 var(--serif); letter-spacing: -0.01em; }
.feature h3 a { text-decoration: none; }
.feature h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.feature p.summary { margin: 0 0 22px; font-size: 1.12rem; color: #dfe3e1; max-width: 46ch; }
.feature-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font: 700 0.85rem/1 var(--sans); letter-spacing: 0.02em;
  padding: 13px 20px; border-radius: 999px; background: var(--band-text); color: var(--band);
}
.btn:hover { background: #ffffff; }
.feature-meta { font: 500 0.82rem/1.3 var(--sans); color: var(--band-muted); }
.feature .progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.12); }
.feature .progress span { display: block; height: 100%; width: 0; background: var(--band-text); }
.feature.playing .progress span { animation: fill var(--dwell, 9s) linear forwards; }
@keyframes fill { to { width: 100%; } }

.playlist { display: flex; flex-direction: column; min-height: 0; max-height: 440px; }
.playlist-label { font: 700 0.72rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--band-muted); margin: 0 0 10px; }
.playlist ol {
  position: relative; list-style: none; margin: 0; padding: 0 6px 0 0; overflow-y: auto; scroll-snap-type: y proximity;
  scrollbar-width: thin; scrollbar-color: #4a524f transparent;
}
.playlist li { scroll-snap-align: start; }
.playlist button {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: none; color: inherit; border: 0; border-top: 1px solid #2a312e; padding: 14px 8px 14px 4px;
}
.playlist li:first-child button { border-top: 0; }
.playlist button:hover { background: rgba(255, 255, 255, 0.04); }
.playlist button[aria-current="true"] { background: rgba(255, 255, 255, 0.08); box-shadow: inset 3px 0 0 var(--band-text); }
.playlist .num { font: 700 0.95rem/1.4 var(--sans); color: var(--band-muted); padding-left: 6px; }
.playlist .t { display: block; font: 500 1.02rem/1.3 var(--serif); }
.playlist .kicker { font-size: 0.66rem; margin-bottom: 4px; color: var(--band-muted); }

/* ---------- Summary band (AI daily summary + its sources) and In focus placement ---------- */
#focus { margin: 36px 0 0; }
#news-list-more:empty { display: none; }
.summary-band { margin-bottom: 0; }
.summary-card { justify-content: flex-start; min-height: 0; isolation: isolate; background: var(--band-2); }
/* Two soft glows (green, blue) that drift behind the text; z-index -1 stays inside the isolated card. */
.summary-card::before, .summary-card::after {
  content: ""; position: absolute; z-index: -1; border-radius: 50%; pointer-events: none; will-change: transform;
}
.summary-card::before {
  width: 85%; aspect-ratio: 1; top: -35%; right: -20%;
  background: radial-gradient(closest-side, rgba(11, 110, 95, 0.6), transparent);
  animation: orb-green 10s ease-in-out infinite alternate;
}
.summary-card::after {
  width: 75%; aspect-ratio: 1; bottom: -40%; left: -20%;
  background: radial-gradient(closest-side, rgba(31, 79, 191, 0.45), transparent);
  animation: orb-blue 13s ease-in-out infinite alternate;
}
@keyframes orb-green {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(-35%, 30%) scale(1.15); }
  66%  { transform: translate(-60%, -5%) scale(0.9); }
  100% { transform: translate(-20%, 45%) scale(1.05); }
}
@keyframes orb-blue {
  0%   { transform: translate(0, 0) scale(1); }
  33%  { transform: translate(40%, -30%) scale(1.1); }
  66%  { transform: translate(75%, 5%) scale(0.95); }
  100% { transform: translate(25%, -50%) scale(1.15); }
}
.summary-eyebrow { margin: 0; font: 700 0.72rem/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--band-muted); }
.summary-card h3 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); margin: 12px 0 16px; }
.summary-text p { margin: 0 0 14px; font-size: 1.1rem; line-height: 1.6; color: #dfe3e1; max-width: 64ch; }
.summary-text p:last-child { margin-bottom: 22px; }
.summary-band .feature-meta { flex: 1 1 220px; }
.btn[data-listen] { border: 0; cursor: pointer; }
.btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
/* The card sets the row height; the source list scrolls inside it (height 0 + min-height 100%). */
.summary-band .playlist { max-height: none; height: 0; min-height: 100%; }
.summary-band .playlist ol { flex: 1; min-height: 0; }
.playlist a {
  display: grid; grid-template-columns: 2.2rem 1fr; gap: 10px; text-decoration: none; color: inherit;
  border-top: 1px solid #2a312e; padding: 14px 8px 14px 4px;
}
.playlist li:first-child a { border-top: 0; }
.playlist a:hover { background: rgba(255, 255, 255, 0.06); }
.playlist a:hover .t { text-decoration: underline; text-underline-offset: 3px; }
.playlist .src-name { display: block; margin-top: 4px; font: 500 0.78rem/1.3 var(--sans); color: var(--band-muted); }

/* ---------- Ask what's new ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ask chat: floating logo launcher, bottom right. Opens a panel (desktop) or a 2/3-height sheet (mobile). */
.ask-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 40;
  width: 64px; height: 64px; padding: 0; border: 1px solid var(--rule); border-radius: 50%;
  background: var(--paper); cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ask-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22); }
.ask-fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.ask-fab img { display: block; width: 100%; height: 100%; border-radius: 50%; }
.ask-fab[hidden] { display: none; }

.ask {
  position: fixed; z-index: 50; right: 20px; bottom: 96px;
  width: min(420px, calc(100vw - 40px)); height: min(640px, calc(100vh - 120px)); height: min(640px, calc(100dvh - 120px));
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22); overflow: hidden;
}
.ask[hidden] { display: none; }
.ask-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.ask-head img { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--rule); }
.ask h2 { margin: 0; flex: 1; font: 700 1.2rem/1.2 var(--serif); }
.ask-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink); font: 400 1.6rem/1 var(--sans); cursor: pointer; }
.ask-close:hover { background: var(--rule); }
.ask-body { flex: 1; overflow-y: auto; padding: 16px; overscroll-behavior: contain; }
.ask-foot { border-top: 1px solid var(--rule); padding: 12px 16px 14px; background: var(--paper); }
.ask-form { display: flex; gap: 8px; }
.ask-form input {
  flex: 1; min-width: 0; font: 400 1rem/1.3 var(--sans); padding: 11px 16px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--paper); color: var(--ink);
}
.ask-form input:focus { border-color: var(--ink); outline: none; }
.ask-go { font: 700 0.9rem/1 var(--sans); padding: 11px 20px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; }
.ask-go:disabled { opacity: 0.5; cursor: wait; }
.ask-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chips button { font: 600 0.8rem/1.2 var(--sans); padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-2); color: var(--ink); cursor: pointer; text-align: left; }
.ask-chips button:hover { border-color: var(--ink); }
.ask-notice { margin: 8px 0 0; font: 400 0.72rem/1.4 var(--sans); color: var(--muted); }
.ask-notice a { color: var(--accent); }
.ask-out:not(:empty) { margin-top: 16px; padding: 14px 16px; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 14px; }
.ask-out p { margin: 0 0 10px; }
.ask-out.is-loading p, .ask-out.is-nothing p, .ask-out.is-resting p, .ask-out.is-limited p { color: var(--muted); font-style: italic; }
.ask-sources-label { font: 700 0.7rem/1 var(--sans) !important; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 14px !important; }
.ask-sources { list-style: none; margin: 0; padding: 0; }
.ask-sources li { padding: 8px 0; border-top: 1px solid var(--rule); font-size: 0.95rem; }
.ask-sources .kicker { margin-right: 6px; }
.ask-src { font: 500 0.78rem/1 var(--sans); color: var(--muted); margin-left: 6px; }
.ask-left { font: 600 0.8rem/1 var(--sans) !important; color: var(--l-press); }

@media (max-width: 600px) {
  .ask-fab { right: 16px; bottom: 16px; width: 56px; height: 56px; }
  /* Mobile: bottom sheet, two thirds of the screen; the launcher hides while it is open. */
  .ask {
    left: 0; right: 0; bottom: 0; width: 100%;
    height: 66.667vh; height: 66.667dvh;
    border-radius: 18px 18px 0 0; border-bottom: 0;
  }
  .ask-fab.is-open { display: none; }
  .ask-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

/* ---------- Section heads and filters ---------- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 28px; border-bottom: 1px solid var(--rule-strong); padding-bottom: 8px; }
.section-head h2 { margin: 0; font: 700 1.9rem/1.1 var(--serif); letter-spacing: -0.01em; }
.count { margin: 0; font: 500 0.8rem/1 var(--sans); color: var(--muted); }
.dek { font: italic 400 1.05rem/1.5 var(--serif); color: var(--ink-2); max-width: 70ch; margin: 12px 0 0; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 16px 0 6px; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.filters label {
  display: flex; flex-direction: column; gap: 5px; min-width: 150px;
  font: 700 0.66rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.filters .grow { flex: 1 1 220px; }
.filters select, .filters input {
  font: 500 0.9rem/1.2 var(--sans); color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--rule); border-radius: 999px; padding: 9px 14px; width: 100%; min-width: 0;
  appearance: none; -webkit-appearance: none;
}
.filters select {
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px; background-repeat: no-repeat;
}
.filters select:hover, .filters input:hover { border-color: #bdbab2; }
.filters select:focus, .filters input:focus { border-color: var(--ink); outline: none; }

/* ---------- Lists ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.kicker {
  display: inline-flex; align-items: center; gap: 6px; cursor: help;
  font: 800 0.7rem/1 var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--l-news);
}
.kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.kicker[data-l="Press release"] { color: var(--l-press); }
.kicker[data-l="Preprint"] { color: var(--l-pre); }
.kicker[data-l="Peer-reviewed study"] { color: var(--l-peer); }
.kicker[data-l="Regulatory action"] { color: var(--l-reg); }
.focus .kicker[data-l] { color: var(--band-text); }

.stories { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 40px; }
.story { padding: 22px 0; border-bottom: 1px solid var(--rule); }
.story h3 { margin: 10px 0 8px; font: 600 1.38rem/1.22 var(--serif); letter-spacing: -0.005em; }
.story h3 a { text-decoration: none; }
.story h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.story .summary { margin: 0 0 10px; color: var(--ink-2); font-size: 1.02rem; }
.story.lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 40px; align-items: start; }
.story.lead h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); line-height: 1.12; margin-top: 12px; }
.story.lead .summary { font-size: 1.15rem; }
.byline { font: 500 0.78rem/1.4 var(--sans); color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.byline span + span::before { content: "·"; margin-right: 10px; color: #b7b4ac; }
.tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font: 600 0.72rem/1.2 var(--sans); }
.tags span { color: var(--ink-2); }
.tags .sector { color: var(--accent); }

.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--rule); }
.row h3 { margin: 4px 0 6px; font: 600 1.3rem/1.25 var(--serif); }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.row .eyebrow { font: 700 0.72rem/1.2 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.row .facts { margin: 0; font-size: 1rem; color: var(--ink-2); }
.row .side { text-align: right; align-self: center; }
.amount { font: 700 1.6rem/1 var(--sans); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.amount-note { display: block; margin-top: 6px; font: 500 0.72rem/1.2 var(--sans); color: var(--muted); }
.row .src { font: 600 0.8rem/1.2 var(--sans); color: var(--accent); }
.pill {
  display: inline-block; font: 700 0.72rem/1 var(--sans); padding: 7px 12px; border-radius: 999px;
  border: 1.5px solid var(--ink); text-decoration: none; white-space: nowrap;
}
.pill:hover { background: var(--ink); color: var(--paper); }

.empty { padding: 40px 0; text-align: center; color: var(--muted); font-style: italic; grid-column: 1 / -1; }
.more {
  display: block; margin: 24px auto 8px; grid-column: 1 / -1;
  font: 700 0.85rem/1 var(--sans); padding: 13px 22px; border-radius: 999px;
  border: 0; background: var(--ink); color: var(--paper); cursor: pointer;
}
.more:hover { background: #333; }
li:has(> .more) { grid-column: 1 / -1; }

.contract { margin: 40px 0 8px; padding-top: 18px; border-top: 3px solid var(--rule-strong); }
.contract h2 { margin: 0; font: 700 1.4rem/1.2 var(--serif); }
.contract p { margin: 4px 0 14px; color: var(--muted); font-style: italic; }
.contract ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.contract a { display: inline-block; padding: 8px 14px; border: 1.5px solid var(--rule); border-radius: 999px; text-decoration: none; font: 600 0.82rem/1 var(--sans); }
.contract a:hover { border-color: var(--ink); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 56px; background: var(--band); color: var(--band-muted); padding: 32px 0 44px; font: 400 0.85rem/1.55 var(--sans); }
.footer-brand { margin: 0 0 8px; font: 700 1.6rem/1 var(--serif); color: var(--band-text); }
.site-footer p { max-width: 80ch; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .focus-grid { grid-template-columns: 1fr; }
  .feature { min-height: 300px; padding: 24px; }
  .playlist { max-height: 300px; }
  .summary-band .playlist { height: auto; min-height: 0; max-height: 360px; }
  .stories { grid-template-columns: 1fr; }
  .story.lead { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  body { font-size: 17px; }
  .masthead-top { justify-content: center; text-align: center; }
  .masthead-top .edition { display: none; }
  .disclaimer { display: none; }
  .sections [role="tab"] { padding: 9px 14px; }
  .filters label { min-width: calc(50% - 6px); flex: 1 1 calc(50% - 6px); }
  .row { grid-template-columns: 1fr; }
  .row .side { text-align: left; }
  .focus { padding: 24px 0 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .feature.playing .progress span { animation: none; }
  .summary-card::before, .summary-card::after { animation: none; }
}
.site-footer a { color: var(--band-text); }
