/* Lagos Dashboard Styles */
/* Dark theme, designed for research intelligence display.
   Visual contract lives in DOCS/dashboard-design.md — color is semantics
   (project identity / alert level / sentiment), density over decoration,
   every data panel declares its data-time. */

/* === Tokens (see DOCS/dashboard-design.md — v2 "Rand pass" 2026-07-03) ===
   Neutral near-black ground; color appears ONLY as information (project
   identity, alert level, sentiment). Typography carries hierarchy. */
:root {
  --bg: #101014;
  --panel: #16161b;
  --inset: #1d1d23;        /* chip/inset fills */
  --hairline: #26262c;     /* ALL borders — one weight, one color */
  --text: #e6e6e3; --text-dim: #9a9a94; --text-faint: #77776f;
  --hot: #e5484d; --warm: #d98324; --quiet: #4a4a52;
  --band-bg: #d9d9d4; --band-text: #101014; --band-dim: #6a6a64;  /* the ONE inversion */
  /* Project identity, per-ground: 50-tier for dark (luminous), 60/70-tier
     for light (ink). Same semantic stories, printed with conviction. */
  --c-nuclear: #4589ff; --c-fusion: #ee5396; --c-weather: #009d9a;
  --c-wildfire: #ff832b; --c-power: #24a148;
  /* Sentiment ramp (bar carets, value labels, The Mood) — per-ground tiers */
  --s-neg2: #fa4d56; --s-neg1: #d9853a; --s-mid: #c9b23e;
  --s-pos1: #7fb04f; --s-pos2: #42be65;
  --link: #78a9ff;
  --gap: 12px;
  --radius: 0px;           /* flat zones, not floating cards */
}
/* Desk theme (light — the browser reading default): positive polarity for
   dense reading; Board (dark) remains for the kiosk and by toggle. */
html[data-theme="light"] {
  /* v3.2 "considered white" (user leash-tug: stark #fff neglects enjoyment;
     think Apple meets IBM). COOL-NEUTRAL canvas (#f5f5f7 — reads white,
     relieves glare) with TRUE-WHITE panels on it: material depth instead of
     glare, comfort for long sessions. The authority stays — black band, 2px
     ink rules, ink-tier hues. Every choice argued for purpose AND enjoyment. */
  --bg: #f5f5f7;
  --panel: #ffffff;
  --inset: #e9e9ec;
  --hairline: #d2d2d7;
  --text: #1d1d1f; --text-dim: #55555c; --text-faint: #86868b;
  --hot: #da1e28; --warm: #a84b00; --quiet: #b0b0a8;
  --band-bg: #1d1d1f; --band-text: #f5f5f7; --band-dim: #9a9a94;
  --c-nuclear: #0f62fe; --c-fusion: #d02670; --c-weather: #007d79;
  --c-wildfire: #ba4e00; --c-power: #198038;
  --s-neg2: #da1e28; --s-neg1: #b25e00; --s-mid: #8a7a10;
  --s-pos1: #4d8b33; --s-pos2: #198038;
  --link: #0f62fe;
}

/* === Type: IBM Plex (self-hosted — the kiosk TV must not depend on a CDN).
   Plex is IBM's open family in the lineage of Rand's IBM identity work —
   Sans for the interface, Mono for data-time and market figures. === */
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400;
  src: url("/fonts/IBMPlexSans-Regular-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600;
  src: url("/fonts/IBMPlexSans-SemiBold-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700;
  src: url("/fonts/IBMPlexSans-Bold-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400;
  src: url("/fonts/IBMPlexMono-Regular-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600;
  src: url("/fonts/IBMPlexMono-SemiBold-Latin1.woff2") format("woff2"); font-display: swap;
}

@font-face {
  font-family: "IBM Plex Sans"; font-style: normal; font-weight: 300;
  src: url("/fonts/IBMPlexSans-Light-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif"; font-style: normal; font-weight: 400;
  src: url("/fonts/IBMPlexSerif-Regular-Latin1.woff2") format("woff2"); font-display: swap;
}
@font-face {
  font-family: "IBM Plex Serif"; font-style: italic; font-weight: 400;
  src: url("/fonts/IBMPlexSerif-Italic-Latin1.woff2") format("woff2"); font-display: swap;
}

/* === Base === */
* { margin: 0; padding: 0; box-sizing: border-box; }
/* text-size-adjust: stop iOS Safari inflating text in landscape — the type
   scale is deliberate on every ground, including Pocket */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "IBM Plex Sans", -apple-system, "Helvetica Neue", Helvetica, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  font-size: 13px;
}
a { color: var(--link); text-decoration: none; }
/* CONTENT headlines are INK — links reveal themselves on hover, not by hue.
   Utility links (nav, "view all", anchors) keep the link blue. */
td a, .top-story-headline, .breaking-title a, .national-card .title { color: var(--text); }
td a:hover, .top-story-headline:hover, .breaking-title a:hover { color: var(--link); }
a:hover { text-decoration: underline; }
/* Tabular numerals wherever figures stack — timetable discipline */
.num, td, .stat-card .value, .age-chip { font-variant-numeric: tabular-nums; }
/* Mono carries the machine-facing values: data-time chips, markets */
.age-chip, .header-meta .mkt, .mono {
  font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}
h1, h2, h3, .breaking-title { letter-spacing: -0.01em; }
body { font-kerning: normal; font-feature-settings: "kern"; }
/* Big display numerals: Plex Light, tightly tracked — elegance at size */
.stat-card .value, .display-num { font-weight: 300; letter-spacing: -0.02em; }
/* The analyst's voice is SERIF; data stays sans (briefing = written analysis) */
.briefing-text {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-size: 13.5px; line-height: 1.6;
}


/* === Header & Navigation === */
.header {
  background: #101014;               /* the BLACK BAND — both themes */
  color: #e6e6e3;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header h1 { font-size: 17px; font-weight: 700; letter-spacing: 0.02em; }
.header h1 span { color: #e5484d; }
.header .subtitle { color: #77776f; font-size: 11px; }
.header .nav-btn { color: #9a9a94; border-color: #26262c; }
.header .nav-btn:hover { color: #e6e6e3; border-color: #9a9a94; }
.header .age-chip, .header .mkt { color: #9a9a94; }
.header .mkt strong { color: #e6e6e3; }
.nav-buttons { display: flex; gap: 6px; }
.nav-btn {
  display: inline-block;
  padding: 4px 12px;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--hairline);
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
}
.nav-btn:hover { border-color: var(--text-dim); color: var(--text); text-decoration: none; }

/* Theme switch (2026-07-08): a two-cell mode control, deliberately UNLIKE the
   nav buttons — both mode names visible, active cell filled (ink-flip on the
   black band), hairline divider setting it apart from navigation. A single
   alternating "Board" label read as a nav link and got clicked as one. */
.theme-switch {
  display: inline-flex;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid #26262c;   /* divider on the band (uncolored — structural, not an accent) */
}
.theme-switch button {
  background: transparent;
  border: 1px solid #26262c;
  color: #77776f;
  font: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  cursor: pointer;
}
.theme-switch button + button { border-left: none; }
.theme-switch button:hover { color: #e6e6e3; }
.theme-switch button.on {
  background: #e6e6e3;   /* filled = the mode you are IN (band ink-flip) */
  color: #101014;
  cursor: default;
}


/* === Layout === */
/* Near-full-bleed: target surfaces are desktop monitors and a 16:9 kiosk TV —
   wide viewports get side-by-side rows, never wider margins. The 1880px cap
   only guards ultra-wide. (Was 1200px centered — a third of the screen lost.) */
.container { max-width: 1880px; margin: 0 auto; padding: 16px 20px; }


/* === Stats & Cards === */
.stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.stat-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px 16px;
  flex: 1;
  min-width: 140px;
}
.stat-card .value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}
.stat-card .label {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}


/* === Sections === */
.section { margin-bottom: 16px; scroll-margin-top: 48px; /* anchored sections clear the sticky jump-nav */ }
.section h2 {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--text);   /* a rule that means it */
}


/* === Project Cards === */
.project-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
}
/* Home pulse row (five project cards) — classed rather than inline-styled so
   the Pocket breakpoints can reflow it (media queries can't beat inline styles). */
.pulse-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap);
  margin-bottom: var(--gap);
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px;
  position: relative;
  overflow: hidden;
  border-top: 3px solid;    /* the project mark — an OVERLINE above the zone (Unigrid
                               lineage); never a colored left card-edge (see design doc) */
}
.project-card:hover { border-color: var(--text-faint); border-top-width: 3px; }
.project-card h3 { font-size: 14px; margin-bottom: 6px; font-weight: 600; }
.project-card .stats { font-size: 12px; color: var(--text-dim); }
.project-card .stats strong { color: var(--text); }
.project-tone-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
}


/* === Tables — flat, hairline-ruled, timetable-style === */
table {
  width: 100%;
  border-collapse: collapse;
  background: transparent;
  border-top: 1px solid var(--hairline);
}
th {
  text-align: left;
  padding: 5px 8px;
  background: transparent;
  border-bottom: 1px solid var(--hairline);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-dim);
  font-weight: 600;
}
td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--hairline);
  font-size: 12.5px;
  line-height: 1.35;
}
tr:hover td { background: var(--panel); }


/* === Badges === */
.tier-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 0;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
}
.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.project-tag {
  display: inline-block;
  width: 62px;              /* fixed column: text after a tag always starts at the same x */
  text-align: center;
  padding: 2px 0;
  border-radius: 0;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}
.topic-label {
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
}
.tone-indicator {
  font-size: 12px;
  font-weight: 600;
}
.domain {
  color: var(--text-dim);
  font-size: 12px;
}
.article-url {
  font-size: 12px;
  color: #6ba7d8;
  word-break: break-all;
}

.back-link {
  display: inline-block;
  margin-bottom: 16px;
  color: var(--text-dim);
  font-size: 13px;
}
.back-link:hover { color: var(--text); }


/* === Noise === */
.noise-section {
  opacity: 0.6;
  margin-top: 24px;
}
.noise-section:hover { opacity: 1; }
.noise-section h3 {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}


/* === Breaking Stories — flat zone, red rule carries the urgency === */
.breaking-section { margin-bottom: var(--gap); }
.breaking-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-top: 3px solid var(--hot);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.breaking-badge {
  background: var(--hot);
  color: #fff;
  border: 1px solid var(--hot);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 2px 8px;
  border-radius: 0;
  white-space: nowrap;
}
.breaking-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
}
.breaking-title a { color: var(--text); }
.breaking-title a:hover { color: #6ba7d8; }
.breaking-stats {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.breaking-stats strong { color: var(--text); }
.top-story-card { border-top-color: var(--warm) !important; }
.top-story-badge { background: var(--text); color: var(--bg); border-color: var(--text); }

.age-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}
.age-fresh { background: #27ae60; color: #fff; }
.age-recent { background: #2c3e50; color: var(--text-dim); }
.age-aging { background: var(--bg); color: var(--text-faint); }
tr.aging td { opacity: 0.5; }
tr.aging:hover td { opacity: 0.8; }


/* === Tooltips === */
.tip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted #555;
}
.tip .tiptext {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  z-index: 1000;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  background: var(--inset);
  color: var(--text);
  border: 1px solid var(--hairline);
  border-radius: 0;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.5;
  width: 280px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  white-space: normal;
  pointer-events: none;
  transition: opacity 0.15s;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.tip:hover .tiptext {
  visibility: visible;
  opacity: 1;
}
table { overflow: visible; }
th { position: relative; }


/* === Sentiment === */
.sentiment-bar {
  position: relative;
  width: 80px;
  height: 14px;
  display: block;
  margin-right: 40px;
}
.sentiment-track {
  position: absolute;
  width: 100%;
  height: 5px;
  top: 5px;
  border-radius: 0;
  background: linear-gradient(to right,
    var(--s-neg2) 0%, var(--s-neg1) 25%, var(--s-mid) 50%,
    var(--s-pos1) 75%, var(--s-pos2) 100%);
  opacity: 0.45;
}
.sentiment-caret {
  position: absolute;
  width: 10px;
  height: 14px;
  top: 0px;
  border-radius: 0;
  transform: translateX(-50%);
  border: 1px solid var(--panel);
  z-index: 2;
}
.sentiment-caret-outline {
  position: absolute;
  width: 10px;
  height: 14px;
  top: 0px;
  border-radius: 0;
  transform: translateX(-50%);
  border: 2px solid;
  background: transparent;
  z-index: 1;
}
.sentiment-range-bar {
  position: absolute;
  height: 6px;
  top: 4px;
  border-radius: 0;
  z-index: 0;
}
.sentiment-value {
  position: absolute;
  left: calc(100% + 6px);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.emotion-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  opacity: 0.9;
  margin-top: 4px;
}
.feeling-words {
  font-size: 11px;
  font-style: italic;
  color: var(--text-dim);
}
.contested-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 0;
  font-size: 10px;
  font-weight: 600;
  background: #8e44ad;
  color: #fff;
  margin-left: 6px;
  white-space: nowrap;
}
.longform-badge {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  opacity: 0.7;
  cursor: help;
}

/* === Entities === */
.persons-orgs-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}
/* Project pages add a third list — trending Places beside People and Orgs */
.persons-orgs-section.three-col { grid-template-columns: repeat(3, 1fr); }
.entity-list {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 12px 16px;
}
.entity-list h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.entity-item {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
}
.entity-bar {
  height: 4px;
  border-radius: 0;
  min-width: 4px;
}
/* Grid/flex items may shrink below their content (min-width:0) — without
   this, one long nowrap entity name forces the whole column past its track
   and under the neighboring card (the home overlap bug, 2026-07-07). */
.persons-orgs-section > div { min-width: 0; }
.entity-item { min-width: 0; }
.entity-name {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
}
a.entity-name:hover { color: #6ba7d8; }
.entity-count {
  font-size: 10px;
  color: var(--text-faint);
  white-space: nowrap;
}

.top-stories-list {
  border-left: 2px solid var(--hairline);
  padding-left: 16px;
}
.top-story-row {
  display: grid;
  grid-template-columns: 66px 1fr auto;   /* tag column | headline | meta — titles align */
  gap: 10px;
  align-items: baseline;
  padding: 7px 0;
  border-bottom: 1px solid var(--hairline);
  line-height: 1.45;
}
.radar-line {
  display: grid;
  grid-template-columns: 66px 1fr auto auto;  /* tag | headline | points | age */
  gap: 0 10px;
  align-items: baseline;
}
.top-story-row:last-child { border-bottom: none; }
.top-story-headline {
  font-weight: 600;
  color: var(--text);
  margin: 0 10px;
}
a.top-story-headline { color: var(--text); text-decoration: none; }
a.top-story-headline:hover { color: #6ba7d8; }
.top-story-meta {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}


/* === Briefing Cards === */
.briefing-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.briefing-card {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-top: 3px solid;
  border-radius: var(--radius);
  padding: 16px;
  transition: box-shadow 0.2s;
}
.briefing-card.hot {
  border-color: var(--hot);
}
.briefing-card.warm {
  border-color: var(--warm);
}
.briefing-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.briefing-project {
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
}
.briefing-project:hover { text-decoration: underline; }
.briefing-meta {
  font-size: 11px;
  color: var(--text-dim);
}
.briefing-top-story {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline);
}
.briefing-top-story .top-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-bottom: 4px;
}
.briefing-top-story .top-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.briefing-card.hot .top-title { font-size: 15px; }
.briefing-top-story .top-title a { color: var(--text); }
.briefing-top-story .top-title a:hover { color: #6ba7d8; }
.briefing-top-story .top-stats {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 3px;
}
.briefing-top-story .top-stats strong { color: var(--hot); }
.importance-bar {
  height: 3px;
  border-radius: 0;
  margin-top: 6px;
  background: var(--inset);
  overflow: hidden;
}
.importance-bar .fill {
  height: 100%;
  border-radius: 0;
}
.briefing-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 12px;
}
.briefing-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 11px;
  color: var(--text-faint);
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
}
.briefing-top {
  flex: 1;
  margin-right: 12px;
  font-style: italic;
}
.briefing-time {
  white-space: nowrap;
  color: var(--text-faint);
}

/* === Panel system (design doc: every data panel = .panel with a header row
   declaring its label and its data-time via an .age-chip) === */
.panel {
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: var(--gap);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.panel-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
}
/* Data-time staleness chip — color set inline by the age_chip helper:
   <2h green, 2-8h amber, >8h red. Honest staleness is a feature. */
.age-chip { font-size: 11px; white-space: nowrap; }
.age-chip::before { content: "●"; font-size: 8px; margin-right: 4px; vertical-align: 1px; }

/* Ground-truth micro-chip on project pulse cards */
.micro-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--text-dim);
  background: var(--inset);
  border-top: 2px solid var(--quiet);
  border-radius: 0;
  padding: 1px 7px;
  margin-top: 6px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.micro-chip .src, .radar-line .src {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-right: 5px;
}

/* Discourse radar one-liners (home strip) */
.radar-line { font-size: 12px; color: var(--text); padding: 2px 0; }
.radar-line .src { color: #f39c12; font-size: 10px; font-weight: 700; margin-right: 4px; }

/* "Show all N" toggle under collapsed tables */
.table-more {
  display: block;
  width: 100%;
  margin: 0 0 4px;
  padding: 5px 8px;
  background: var(--inset);
  border: 1px solid var(--hairline);
  border-top: none;
  color: var(--text-dim);
  font: 600 11px "IBM Plex Sans", sans-serif;
  letter-spacing: .4px;
  text-transform: uppercase;
  cursor: pointer;
}
.table-more:hover { color: var(--link); }

/* Header utility area (markets + global data-age) */
.header-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.header-meta .mkt { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.header-meta .mkt strong { color: #ddd; font-weight: 600; }

/* === Jump-nav (news page) — sticky section index. On first scroll it blinks
   brighter then settles into an elevated "stuck" tone: attention through
   LUMINANCE only, hue stays semantic. === */
.jump-nav {
  position: sticky; top: 0; z-index: 20;
  background: var(--panel);
  border: 1px solid var(--hairline);
  padding: 8px 14px; margin-bottom: var(--gap);
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
  transition: background 0.35s, border-color 0.35s;
}
.jump-nav a { font-size: 13px; color: var(--text); font-weight: 600; white-space: nowrap; }
.jump-nav .jn-sep { width: 1px; height: 16px; background: var(--hairline); }
.jump-nav .jn-cue { font-size: 12px; color: var(--text-faint); margin-left: auto; }
/* Pinned = INVERTED: a light band against the near-black page (the one place
   the palette flips, so the pinned index is unmistakable). Project-color
   marks survive the flip; text inverts. */
.jump-nav.stuck { background: var(--band-bg); border-color: var(--band-bg); }
.jump-nav.stuck a { color: var(--band-text); }
.jump-nav.stuck .panel-label, .jump-nav.stuck .jn-cue { color: var(--band-dim); }
.jump-nav.stuck .jn-sep { background: var(--band-dim); }
.jump-nav.attn { animation: nav-attn 0.9s ease-out; }
@keyframes nav-attn {
  0%   { filter: brightness(1.6); }
  100% { filter: brightness(1); }
}
.jump-nav a.jn-current { border-bottom: 2px solid; padding-bottom: 1px; }

/* === Motion (design doc: "motion is data") ==================================
   Nothing moves unless the data moved. One perpetual "alive" indicator per
   surface (the EKG now-cursor / the map cycle line); everything else is
   delta-triggered or decays with recency. No spinners, no marquees. */

/* The heartbeat: pulsing dot at the EKG's right terminus. Rate is set inline
   by the helper — calm day = slow, surge = quick. */
@keyframes ekg-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}
.ekg-now { animation: ekg-pulse 2.4s ease-in-out infinite; }

/* Breaking badge breathes while the story is fresh; the motion DECAYS with
   age (fast <1h, slow <3h, still after) — motion encodes recency. */
@keyframes badge-breath {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}
.breathe-fast { animation: badge-breath 1.6s ease-in-out infinite; }
.breathe-slow { animation: badge-breath 3.6s ease-in-out infinite; }

/* The forming bar/dot: the still-accumulating current hour shimmers —
   "this number is not finished." */
@keyframes live-dim {
  0%, 100% { opacity: 0.9; }
  50%      { opacity: 0.3; }
}
.live-bar, .live-dot { animation: live-dim 2.4s ease-in-out infinite; }

/* Arrival breath (load-time, NO auto-refresh — never move the reader's
   floor): when the page loads with newer data than your last visit, the
   age chips breathe once. */
@keyframes chip-breath {
  0%, 100% { opacity: 1; }
  30%      { opacity: 0.2; }
  60%      { opacity: 1; }
  80%      { opacity: 0.4; }
}
.breathe-once { animation: chip-breath 1.8s ease-in-out 1; }

/* Map auto-cycle progress: a thin line fills under the active tab over the
   20s dwell — the rotation rhythm made visible. */
.map-tab { position: relative; overflow: hidden; }
.map-tab.active.cycling::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%;
  background: var(--tab-color, var(--text-dim));
  transform-origin: left; transform: scaleX(0);
  animation: tab-progress 20s linear forwards;
}
@keyframes tab-progress { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .ekg-now, .breathe-fast, .breathe-slow, .live-bar, .live-dot, .breathe-once,
  .map-tab.active.cycling::after { animation: none !important; }
}

/* === Polish pass (2026-07-03) === */
/* Floating back-to-top for long story lists — appears after real scrolling */
#to-top {
  position: fixed; right: 18px; bottom: 18px; z-index: 40;
  background: var(--panel); color: var(--text-dim);
  border: 1px solid var(--hairline); border-radius: 0;
  padding: 7px 12px; font-size: 12px; font-weight: 600; font-family: inherit;
  cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.25s, color 0.15s, border-color 0.15s;
}
#to-top.show { opacity: 1; pointer-events: auto; }
#to-top:hover { color: var(--text); border-color: var(--text-dim); }

/* Table headers stick beneath the jump-nav on long lists (--nav-h set by JS) */
.section table th { position: sticky; top: var(--nav-h, 0px); background: var(--bg); z-index: 5; }

/* External links carry a quiet mark — you are leaving the instrument */
a[target="_blank"]::after { content: "\2197"; font-size: 9px; color: var(--text-faint); margin-left: 3px; }

/* Keyboard focus + selection match the system */
:focus-visible { outline: 1px solid var(--text-dim); outline-offset: 2px; }
::selection { background: var(--band-bg); color: var(--band-text); }

/* === Pocket (mobile) — 2026-07-03 ==========================================
   The THIRD GROUND (design doc "Pocket"): Desk reads, Board glances, Pocket
   TRIAGES — "anything breaking? how fresh? what's the top story?" One HTML,
   CSS reflow only: the pages' editorial order (reality → analysis →
   discourse → detail) is already the right phone order, so small screens
   stack it single-column and shed desk furniture (sticky chrome, market
   tickers, hover affordances) rather than getting their own templates. */

/* Touch, at ANY width: hover-dependent affordances need tap equivalents.
   (Keyed on input capability, not viewport — an iPad is touch at 1024px.) */
@media (hover: none) {
  /* Content headlines are ink with hover-revealed linkness on Desk; there is
     no hover here, so linkness whispers instead — a faint underline keeps
     the ink-headline rule without hiding the tap target. */
  td a, .top-story-headline, .breaking-title a {
    text-decoration: underline;
    text-decoration-color: var(--text-faint);
    text-underline-offset: 2px;
  }
  /* Tooltip popovers open on tap — layout.erb JS toggles .open */
  .tip.open .tiptext { visibility: visible; opacity: 1; }
}

/* Dense charts (story trajectory etc.): pan inside their panel on narrow
   screens instead of scaling text into illegibility — same rule as tables. */
.chart-pan { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.chart-pan > svg { min-width: 640px; }

/* Intermediate: five-across can't breathe below ~1100px */
@media (max-width: 1100px) {
  .project-grid, .pulse-grid { grid-template-columns: repeat(3, 1fr); }
  .briefing-grid { grid-template-columns: repeat(2, 1fr); }
  .persons-orgs-section.three-col { grid-template-columns: 1fr 1fr; }
}

/* Pocket proper */
@media (max-width: 720px) {
  body { overflow-x: hidden; }   /* a stray nowrap pans its own panel, never the page */
  .container { padding: 16px 10px 12px; }  /* top stays 16px — home's masthead pulse offsets against it */

  /* Header keeps identity + freshness + nav; the market ticker is desk
     furniture (already on the design doc's audit list) and the subtitle
     is spelled out on every other ground */
  .header { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px; }
  .header .subtitle { display: none; }
  .header-meta { justify-content: flex-start; }
  .header-meta .mkt { display: none; }

  .project-grid, .pulse-grid { grid-template-columns: 1fr 1fr; }
  .briefing-grid, .persons-orgs-section,
  .persons-orgs-section.three-col { grid-template-columns: 1fr; }

  /* Sticky chrome surrenders the small screen: the jump-nav remains a
     top-of-page index (not a pinned band), table headers stay in flow */
  .jump-nav { position: static; }
  .jump-nav.stuck { background: var(--panel); border-color: var(--hairline); }
  .jump-nav.stuck a { color: var(--text); }
  .jump-nav.stuck .panel-label, .jump-nav.stuck .jn-cue { color: var(--text-faint); }
  .jump-nav.stuck .jn-sep { background: var(--hairline); }
  .section table th { position: static; }

  /* Breaking cards stack: badge line / headline / stats */
  .breaking-card { flex-wrap: wrap; gap: 4px 10px; }
  .breaking-title { flex-basis: 100%; }
  .breaking-stats { white-space: normal; }

  /* Label-left grid rows flow like a news list: [tag] headline … meta */
  .top-story-row, .radar-line { display: block; }

  /* Wide data tables pan inside their section instead of squeezing —
     per-cell min-width stops the column crush, the title column stays
     readable, and the panel scrolls where the page must not */
  .section table, .noise-section table, .panel table {
    display: block; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .section th, .section td, .noise-section th, .noise-section td,
  .panel th, .panel td { min-width: 68px; }

  /* Reveal toggles get a finger-sized target */
  .table-more { padding: 9px 8px; }
}

/* --- Phase A: secondary story groups (singleton + International folds) ---
   Collapsed <details> keeps single-source and clearly-foreign stories
   reachable without crowding the corroborated lead (plan A1/A2). */
.fold-details { margin-top: 10px; }
.fold-details summary {
  cursor: pointer; padding: 6px 0;
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim);
}
.fold-details summary:hover { color: var(--text); }
.fold-details table { margin-top: 4px; }
/* Words-as-marks country tag on foreign story rows (design doc v2) */
.intl-tag {
  display: inline-block; margin-left: 6px; padding: 0 5px;
  border: 1px solid var(--hairline); color: var(--text-dim);
  font-size: 10px; letter-spacing: .6px; white-space: nowrap; vertical-align: 1px;
}
/* Group label above the lead table when an A2 split is active */
.group-label {
  font-size: 11px; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim); margin: 8px 0 4px;
}

/* --- Watchlist (plan C1): flagged stories with WHY chips --- */
.watch-line { padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 12.5px; }
.watch-line:last-child { border-bottom: none; }
.watch-line a { text-decoration: none; }
.watch-line a:hover { text-decoration: underline; }
.why-chips { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }
/* Outlined text chips, class-colored (urgency red / reality amber /
   informational blue / attention yellow) — words as marks, no emoji */
.why-chip {
  display: inline-block; padding: 0 5px; border: 1px solid;
  font-size: 10px; letter-spacing: .3px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* --- Interval scrub banner (plan B4) --- */
.scrub-banner {
  display: flex; gap: 18px; align-items: baseline; flex-wrap: wrap;
  margin-bottom: var(--gap); border-top: 3px solid var(--warm);
}
.scrub-banner .scrub-nav { display: flex; gap: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.scrub-banner .scrub-nav a { color: var(--link); text-decoration: none; }
.scrub-banner .scrub-nav a:hover { text-decoration: underline; }
.scrub-banner .scrub-note { font-size: 11px; color: var(--text-dim); }
