:root {
  --bg: #f7f8fa;
  --card: #ffffff;
  --ink: #1a2230;
  --muted: #687385;
  --accent: #0b5cad;
  --accent-soft: #e7f0fa;
  --border: #e2e6ec;
  --shadow: 0 1px 3px rgba(20, 30, 50, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.wrap { max-width: 920px; margin: 0 auto; padding: 0 20px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header / nav */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--ink); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a, .nav .nav-label { color: var(--ink); font-size: 0.95rem; cursor: pointer; }
.dropdown { position: relative; }
.dropdown-menu {
  display: none; position: absolute; top: 100%; left: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; box-shadow: var(--shadow); min-width: 230px; padding: 6px 0;
}
/* Open on hover and on keyboard focus (:focus-within) so the trigger and its
   menu links stay reachable by Tab, not just the mouse. */
.dropdown:hover .dropdown-menu,
.dropdown:focus-within .dropdown-menu { display: block; }
.nav-label:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropdown-menu a { display: block; padding: 8px 16px; color: var(--ink); }
.dropdown-menu a:hover { background: var(--accent-soft); text-decoration: none; }

/* Search */
.nav-search { margin: 0; }
.nav-search input {
  border: 1px solid var(--border); border-radius: 20px; padding: 5px 12px;
  font-size: 0.85rem; width: 130px; background: var(--bg);
}
.nav-search input:focus { outline: none; border-color: var(--accent); width: 170px; }
.search-form { display: flex; gap: 8px; margin: 10px 0; }
.search-form input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 14px; font-size: 1rem;
}
.search-form input:focus { outline: none; border-color: var(--accent); }
.search-form button {
  background: var(--accent); color: #fff; border: none; border-radius: 8px;
  padding: 0 18px; font-size: 0.95rem; cursor: pointer;
}
.search-form button:hover { background: #094a8c; }

/* Page heads */
main { padding: 28px 20px 60px; min-height: 60vh; }
.page-head h1 { margin: 0 0 4px; font-size: 1.7rem; }
.subtitle { margin: 0 0 4px; color: var(--muted); }
.muted { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); padding: 30px 0; }

/* Story list */
.story-list { list-style: none; padding: 0; margin: 20px 0 0; }
.story-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 16px 18px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.story-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 0.8rem; color: var(--muted); margin-bottom: 6px;
}
.story-title { margin: 2px 0 6px; font-size: 1.15rem; }
.story-summary { margin: 0; color: #3a4456; }
.tag-row { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Badges */
.badge {
  display: inline-block; font-size: 0.72rem; padding: 2px 9px;
  border-radius: 20px; background: #eef1f5; color: #41506a; line-height: 1.6;
}
.badge-cat { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.badge-entity { background: #f0e9fb; color: #6b3fcf; }
.badge-state { background: #e6f6ee; color: #1b8a52; }
.badge-tag { background: #eef1f5; color: #51607a; }
.badge-on { background: #e6f6ee; color: #1b8a52; }
.badge-off { background: #fbeaea; color: #b23b3b; }
/* MA-eligibility tier (shown on the story page when the gate is on). */
.badge-eligibility { background: #eef1f5; color: #51607a; text-transform: uppercase; letter-spacing: .03em; }
.badge-eligibility-brief { background: #e6f6ee; color: #1b8a52; }
.badge-eligibility-alert { background: #fff4e0; color: #a8630a; }
.badge-eligibility-display { background: #eef1f5; color: #51607a; }
.badge-eligibility-exclude { background: #fbeaea; color: #b23b3b; }
.eligibility-reason { margin: 6px 0 0; }
a.badge:hover { text-decoration: none; opacity: 0.85; }

/* Feed filter bar — topics/states/payers as navigable tags */
.filter-bar {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 16px; margin-top: 18px; display: flex; flex-direction: column;
  gap: 8px; box-shadow: var(--shadow);
}
.filter-group { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.filter-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); min-width: 52px;
}
.chip {
  display: inline-block; font-size: 0.8rem; line-height: 1.6; padding: 2px 10px;
  border-radius: 20px; border: 1px solid var(--border); background: var(--bg);
  color: #41506a;
}
a.chip:hover { border-color: var(--accent); text-decoration: none; }
.chip-active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.chip-count { color: var(--muted); font-size: 0.72rem; }
.chip-active .chip-count { color: #dbe9f7; }
.chip-more { color: var(--accent); background: var(--card); }
.chip-clear { color: #b23b3b; background: var(--card); align-self: flex-start; }

/* Angles (lens intersections) */
.period-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 4px; }
.highlights { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; }
.angle-section-h {
  font-size: 1.15rem; margin: 26px 0 4px; border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}
.angle-list { list-style: none; padding: 0; margin: 14px 0 0; }
.angle-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.angle-head { display: flex; align-items: center; gap: 8px; }
.angle-label { margin: 0; font-size: 1.1rem; }
.angle-sep { color: var(--muted); margin: 0 5px; font-weight: 400; }
.angle-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  font-size: 0.8rem; margin-top: 8px;
}
.momentum { font-size: 0.78rem; font-weight: 600; }
.momentum-up, .momentum-new { color: #1b8a52; }
.momentum-down { color: #b23b3b; }
.momentum-steady { color: var(--muted); }
.angle-fact { margin: 10px 0 6px; color: #3a4456; }
.angle-evidence { margin: 6px 0; font-size: 0.9rem; color: #3a4456; }
.angle-consistency { margin: 4px 0 6px; font-size: 0.85rem; color: #1b8a52; }
.evidence-tag {
  font-weight: 600; color: var(--accent); margin-right: 4px;
}
.angle-stories { margin: 8px 0 0; padding-left: 20px; }
.angle-stories li { margin-bottom: 4px; font-size: 0.92rem; }

/* Type + causal-layer badges */
.badge-angle-type { background: #eef1f5; color: #41506a; font-weight: 600; }
.badge-layer { background: #f4eefb; color: #6b3fcf; }

/* Venn glyph: translucent overlapping circles; overlap reads darker. Purely
   decorative (aria-hidden in the template). */
.venn { display: inline-flex; align-items: center; flex: 0 0 auto; }
.venn > span {
  width: 15px; height: 15px; border-radius: 50%;
  background: rgba(11, 92, 173, 0.38);
}
.venn > span + span { margin-left: -6px; }
.venn-chain > span { background: rgba(178, 59, 59, 0.34); }
.venn-single > span { background: rgba(104, 115, 133, 0.32); }
.venn-cascade > span { background: rgba(27, 138, 82, 0.32); }

/* About-this-model panel (JS-free <details>, survives static export) */
.about-model {
  margin-top: 30px; background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 18px; box-shadow: var(--shadow);
}
.about-model summary { cursor: pointer; font-weight: 600; }
.about-model .model-layers { margin: 10px 0; padding-left: 22px; }
.about-model .model-edges { margin: 10px 0 4px; padding-left: 22px; }
.about-model .model-edges li { margin-bottom: 6px; font-size: 0.9rem; }

/* Visually hidden but read by assistive tech (intersection separators). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* Pagination */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 24px; font-size: 0.95rem;
}
.pagination .disabled { color: #bcc3cf; }
.page-info { color: var(--muted); }

/* Sources */
.source-group { margin-top: 26px; }
.source-group h2 { font-size: 1.15rem; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.source-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.source-table th {
  text-align: left; color: var(--muted); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.source-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.source-name { font-weight: 600; }
.source-desc { color: #3a4456; margin: 3px 0; font-size: 0.86rem; }

/* States */
.state-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px; margin-top: 22px;
}
.state-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 3px;
  box-shadow: var(--shadow); color: var(--ink);
}
.state-card:hover { border-color: var(--accent); text-decoration: none; }
.state-name { font-weight: 600; }
.state-count { color: var(--accent); font-size: 0.9rem; }

/* Payer intelligence */
.payer-section { margin-top: 26px; }
.payer-overview {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px; margin: 22px 0 8px;
}
.payer-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; box-shadow: var(--shadow);
}
.payer-panel h2 { margin: 0 0 10px; font-size: 1rem; }
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-list li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 4px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.stat-list li:last-child { border-bottom: none; }

/* Sparklines (signal-volume trends). Colors come from CSS vars so the mark
   follows the theme; a single series needs no legend. */
.sparkline { margin: 0; }
.spark-svg {
  display: block; width: 100%; height: 48px;
  /* non-scaling stroke keeps the 2px line crisp despite the stretched viewBox */
  vector-effect: non-scaling-stroke;
}
.spark-line {
  fill: none; stroke: var(--accent); stroke-width: 2;
  stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.spark-area { fill: var(--accent-soft); stroke: none; }
.spark-end { fill: var(--accent); stroke: var(--card); stroke-width: 2; }
.spark-caption { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }
/* On the wider /status section, cap the sparkline width so it doesn't stretch. */
.status-section .sparkline { max-width: 480px; }

/* Per-card related-coverage timelines: same mark family as .spark-*, sized down
   to sit unobtrusively inside a story card. */
.story-card .card-timeline { margin-top: 10px; max-width: 340px; }
.story-card .card-timeline .spark-svg { height: 28px; }
.story-card .card-timeline .spark-caption { font-size: 0.75rem; margin-top: 2px; }
/* The story's own day: a hollow ring, distinct from the filled "today" end dot. */
.spark-story { fill: var(--card); stroke: var(--accent); stroke-width: 2; }

/* /timeline layered chart: a callout band (labeled top stories) over a shared
   date axis over a per-topic bubble strip. Every mark is absolutely positioned
   (percentage x, pixel y from timeline_layout.py) so it stays round/legible at
   any width, needs no JS, and survives the static export. Topic color rides in
   on a `--topic` custom property each element sets inline. */
.timeline-viz {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; margin-top: 18px; box-shadow: var(--shadow);
}
.timeline-viz .empty { padding: 10px 0; }

/* Shared 1px day gridline, reused inside the callout band and each strip plot. */
.viz-grid-line {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--border); transform: translateX(-50%);
}

/* --- Callout band: labeled top stories on stems above the axis --- */
.callout-band { position: relative; overflow: visible; }
.callout-stem {
  position: absolute; bottom: 0; width: 1px;
  background: var(--topic); transform: translateX(-50%);
}
.callout-dot {
  position: absolute; bottom: 0; width: 8px; height: 8px; border-radius: 50%;
  background: var(--topic); transform: translate(-50%, 50%);
}
.callout {
  position: absolute;
  /* width COUPLED to timeline_layout.CALLOUT_W_PCT (24.0) — the packing math
     clamps against this; keep the two in sync. */
  width: 24%;
  /* Above the stems/dots/gridlines (all z-index auto) so a neighbouring
     callout's stem is hidden where it passes behind this card, never painted
     across its face. */
  z-index: 1;
  padding: 5px 8px; border-radius: 6px;
  font-size: 0.78rem; line-height: 1.25; color: var(--ink); text-decoration: none;
  background: var(--card);
  background: color-mix(in srgb, var(--topic) 12%, white);
  border-left: 3px solid var(--topic);
  box-shadow: 0 1px 2px rgba(20, 30, 50, 0.12);
  overflow: hidden;
}
.callout:hover {
  z-index: 5; text-decoration: none;
  box-shadow: 0 3px 10px rgba(20, 30, 50, 0.18);
}
.callout-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.25; font-weight: 600; color: var(--ink);
}
.callout-meta {
  display: block; margin-top: 2px; color: var(--muted); font-size: 0.7rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Right-aligned caption above the band (see timeline.html): kept out of the
   band so it never overlaps the top callout row, which fills the band's height. */
.callout-overflow {
  margin: 0 0 3px; text-align: right;
  color: var(--muted); font-size: 0.72rem;
}

/* --- Shared date axis (kept .axis-tick* styles, reparented under .viz-axis) --- */
.viz-axis { position: relative; height: 24px; border-top: 1px solid var(--border); }
.axis-tick {
  position: absolute; top: 5px; transform: translateX(-50%);
  font-size: 0.72rem; color: var(--muted); white-space: nowrap;
}
.axis-tick-end { transform: translateX(-100%); }
.axis-tick-start { transform: none; }

/* --- Topic strip: one row per topic, one bubble per day, area ∝ count --- */
.topic-strip {
  display: grid; grid-template-columns: 150px 1fr; align-items: center;
  margin-top: 8px;
}
/* Row separators. Two mutually-exclusive rules, partitioned by a `has-bands`
   modifier the template puts on `.topic-strip` itself only for the threads
   lane (see timeline.html), so the two never compete on the same element:
     - `/timeline` topics/payers strip: NEVER carries `has-bands` (no band
       headers exist there) -- kept as the original position-based rule
       (every grid child from the second row on; children pair up as
       label+plot, so the first two are row one), markup untouched.
     - threads lane (`has-bands`): the strip interleaves a variable number of
       full-width `.strip-band` headers (see below) between label+plot pairs,
       which shifts child-position parity -- nth-child can't express "every
       row except the first one after a boundary" once that boundary count
       varies, so this rule is class-based instead: every `.strip-label`/
       `.strip-plot`/`.strip-band` gets a border EXCEPT whichever cell opens
       a new visual section (the very first row, or the first row of a new
       causal-layer band), marked `strip-nosep` server-side.
   Scoping both under/around `has-bands` -- rather than one shared rule --
   is what keeps `/timeline`'s DOM and CSS byte-for-byte identical to before
   this step. */
.topic-strip:not(.has-bands) > :nth-child(n+3) { border-top: 1px solid var(--border); }
.topic-strip.has-bands > .strip-label,
.topic-strip.has-bands > .strip-plot,
.topic-strip.has-bands > .strip-band { border-top: 1px solid var(--border); }
.topic-strip.has-bands > .strip-nosep { border-top: none; }
.strip-label {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  align-self: stretch; padding-right: 12px; font-size: 0.82rem; line-height: 1.3;
}
.strip-count { color: var(--muted); font-size: 0.72rem; }
/* Wraps the count and the optional per-thread "leads to" chip so
   `.strip-label` keeps exactly two flex children (the title, this) whether
   or not a chip renders -- adding the chip as a bare third child would shift
   `justify-content: space-between`'s spacing for every row that has one. */
.strip-meta { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.strip-link { font-size: 0.72rem; color: var(--muted); text-align: right; }
.strip-link a { font-weight: 600; }
.strip-plot { position: relative; height: 26px; }
.strip-bubble {
  position: absolute; top: 50%; border-radius: 50%;
  background: var(--topic); transform: translate(-50%, -50%); opacity: 0.85;
}
a.strip-bubble:hover { opacity: 1; box-shadow: 0 0 0 3px rgba(20, 30, 50, 0.08); }
/* Causal-layer band header (threads lane only): a full-width grid row
   spanning both topic-strip columns, so it never becomes a third cell in a
   label+plot pair. Reuses .legend-layer's existing chip styling (see
   "Emergent-thread lane" below) rather than inventing new chip CSS; the
   left margin that chip carries for its usual inline-after-text placement
   is zeroed here since the band header IS the whole line. */
.strip-band { grid-column: 1 / -1; padding: 7px 0 3px; }
.strip-band .legend-layer { margin-left: 0; }
/* Threads lane's two trailing aggregate rows -- "+N smaller threads" and
   "Ungrouped signals" (see web/routes.py's muted_rows) -- are summaries
   standing in for stories the chart didn't draw its own row for, not a
   thread found on its own, so they read as visually secondary to every
   other row. Opacity/style only, deliberately no width/height/padding/
   margin changes: .strip-label and .strip-plot are shared with /timeline's
   plain topics strip, which never applies this class. */
.strip-row-muted { opacity: 0.62; font-style: italic; }

.timeline-stories-h {
  font-size: 1.15rem; margin: 30px 0 0; border-bottom: 2px solid var(--border);
  padding-bottom: 6px;
}
@media (max-width: 640px) {
  .topic-strip { grid-template-columns: 92px 1fr; }
  .strip-label { padding-right: 8px; }
  /* Reclaim horizontal room on phones: drop the second callout line, shrink text. */
  .callout { font-size: 0.72rem; }
  .callout-meta { display: none; }
  /* Daily ticks crowd at phone widths; keep every other label (gridlines stay). */
  .viz-axis .axis-tick:nth-child(even) { display: none; }
}

/* Story page: jump from one signal to its related-coverage timeline. */
.story-timeline-link { margin: 12px 0 0; font-size: 0.9rem; font-weight: 600; }

/* "Also reported by" — other sources carrying the same story */
.also-covered { color: var(--muted); font-size: 0.88rem; margin: -6px 0 14px; }

/* Story detail */
.story-detail { background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 26px 28px; box-shadow: var(--shadow); }
.story-detail h1 { margin: 8px 0 12px; }
.lead { font-size: 1.05rem; color: #2c3548; }
.source-link { font-weight: 600; }
.draft {
  margin-top: 26px; padding: 18px 20px; background: #fbfbfd;
  border: 1px dashed var(--border); border-radius: 10px;
}
.draft-note, .caution { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.draft .hook { font-weight: 600; }
.draft-paragraph { color: #3a4456; }
.hashtags span { color: var(--accent); margin-right: 6px; font-size: 0.9rem; }
.back { margin-top: 24px; }

/* Daily Briefing */
.briefing-meta { margin: 4px 0 14px; }
.briefing-frame {
  width: 100%; border: 1px solid var(--border); border-radius: 10px;
  background: #f4f6f9; min-height: 400px;
}
.briefing-archive { margin-top: 30px; }
.briefing-archive h2 { font-size: 1.1rem; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.archive-list { list-style: none; padding: 0; }
.archive-list li { padding: 7px 0; border-bottom: 1px solid var(--border); }

/* Status dashboard */
.status-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px; margin: 20px 0 8px;
}
.stat-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px; text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 1.8rem; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.status-section { margin-top: 26px; }
.status-section h2 { font-size: 1.1rem; border-bottom: 2px solid var(--border); padding-bottom: 6px; }
.status-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.status-table th { text-align: left; font-weight: 600; color: #41506a; padding: 7px 10px; border-bottom: 1px solid var(--border); width: 60%; }
.status-table td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--border); }
.review-flag { background: #fdeceb; border: 1px solid #f3c7c4; color: #8a2820; border-radius: 8px; padding: 10px 14px; font-size: 0.88rem; }
.yield-table th { width: auto; }
.yield-table tr.flagged th, .yield-table tr.flagged td { background: #fdf3f2; }

/* Reader feedback widget */
.feedback {
  margin: 26px 0; padding: 18px 20px; background: var(--accent-soft);
  border: 1px solid var(--border); border-radius: 10px;
}
.feedback-q { font-size: 1rem; margin: 0 0 12px; color: var(--ink); }
.feedback-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.fb-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 8px 16px; font-size: 0.92rem; color: var(--ink);
}
.fb-btn:hover { border-color: var(--accent); }
.fb-btn[aria-pressed="true"] {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.feedback-hint { font-size: 0.82rem; color: var(--muted); margin: 10px 0 0; }
.feedback-what { font-size: 0.82rem; }
.feedback-more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.feedback-more-q { font-size: 0.9rem; margin: 0 0 8px; }
.feedback-more-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fb-chip {
  cursor: pointer; background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 5px 12px; font-size: 0.85rem; color: #41506a;
}
.fb-chip:hover { border-color: var(--accent); }
.fb-cat-label { font-size: 0.85rem; color: var(--muted); }
.fb-cat { font-size: 0.85rem; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); }
.feedback-done { font-size: 0.85rem; color: #1b8a52; margin: 12px 0 0; font-weight: 600; }
.feedback-error { font-size: 0.85rem; color: #b3261e; margin: 12px 0 0; }
.feedback-static .feedback-hint { margin-top: 0; }

/* Lightweight feed-card rating */
.card-feedback { margin-top: 10px; display: flex; gap: 6px; }
.card-fb {
  cursor: pointer; background: var(--bg); border: 1px solid var(--border);
  border-radius: 16px; padding: 2px 10px; font-size: 0.9rem; line-height: 1.6;
}
.card-fb:hover { border-color: var(--accent); }
.card-fb-done { font-size: 0.8rem; color: #1b8a52; font-weight: 600; }

/* Static explainer page */
.prose { max-width: 680px; }
.prose h2 { font-size: 1.1rem; margin-top: 26px; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--card); padding: 22px 0; }
.site-footer p { color: var(--muted); font-size: 0.8rem; margin: 0; }

/* Topic color legend (/timeline) — swatches keyed to the same --topic custom
   property the callouts/bubbles read (see topic_colors.py, _topic_legend.html). */
.timeline-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-top: 10px; font-size: 0.8rem; color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; }
.legend-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--topic); margin-right: 4px; vertical-align: middle;
}
/* Emergent-thread lane: grouping toggle + per-thread causal-layer tag. */
.timeline-views { display: inline-flex; gap: 6px; margin: 8px 0 0; }
.timeline-view {
  padding: 2px 10px; border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.78rem; color: var(--muted); background: var(--card);
}
.timeline-view.is-active {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.legend-layer {
  margin-left: 4px; padding: 0 5px; border-radius: 3px;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.02em;
  color: var(--muted); background: var(--card); border: 1px solid var(--border);
}
/* Thread detail page: reciprocal "caused by" back-link (see thread.html). */
.thread-caused-by { margin-top: 2px; }
.footer-links { margin-top: 8px !important; }
