/* jafo /dashboard — newspaper / broadsheet aesthetic.
   Cream paper, black ink, hard rules, strong serif typography. */

/* Reset the global body lock from style.css */
html.dash-html, body.dash-body {
  height: auto !important;
  overflow: visible !important;
}

/* --- Paper texture: cream base + subtle crinkle/fiber via two layered
   gradients. No external images, ~1 KB of CSS. Reads like newsprint. --- */
.dash-body {
  display: block;
  margin: 0;
  padding: 0;
  background-color: #ebe5d4;
  background-image:
    /* subtle fiber lines */
    repeating-linear-gradient(91deg,
      transparent 0, transparent 3px,
      rgba(60, 40, 20, 0.02) 3px, rgba(60, 40, 20, 0.02) 4px),
    repeating-linear-gradient(178deg,
      transparent 0, transparent 5px,
      rgba(70, 50, 30, 0.022) 5px, rgba(70, 50, 30, 0.022) 6px),
    /* large crinkle blobs */
    radial-gradient(ellipse 700px 250px at 20% 30%, rgba(110, 80, 40, 0.06), transparent 60%),
    radial-gradient(ellipse 600px 300px at 80% 70%, rgba(60, 40, 20, 0.05), transparent 60%),
    radial-gradient(ellipse 500px 200px at 50% 50%, rgba(120, 90, 50, 0.04), transparent 60%);
  color: #16110a;
  font-family: "Georgia", "Old Standard TT", "Times New Roman", serif;
  line-height: 1.55;
}

/* Anomaly tape stays — but cleaned to read as a newspaper byline strip */
.anomaly-tape {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 24px;
  font: 700 11px/1.4 ui-monospace, "SF Mono", Menlo, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 2px solid #16110a;
  background: rgba(0, 0, 0, 0.04);
}
.anomaly-tape[data-state="quiet"] { color: #4a4030; }
.anomaly-tape[data-state="watch"] { color: #7a4c10; background: rgba(255, 200, 80, 0.18); }
.anomaly-tape[data-state="alert"] { color: #8a0c10; background: rgba(220, 60, 60, 0.22);
                                     animation: anomaly-pulse 1.4s ease-in-out infinite; }
@keyframes anomaly-pulse {
  0%, 100% { background: rgba(220, 60, 60, 0.22); }
  50%      { background: rgba(220, 60, 60, 0.36); }
}

/* ---- Masthead — proper broadsheet ---- */
.paper-masthead {
  padding: 14px 32px 18px;
  border-bottom: 5px double #16110a;
  text-align: center;
  position: relative;
}
.paper-mast-edge {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font: 500 11px/1 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #4a4030;
  padding-bottom: 8px;
  border-bottom: 1px solid #16110a;
  margin-bottom: 12px;
}
.paper-mast-edge-bit a {
  color: #16110a;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
.paper-mast-main {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  margin: 4px 0 6px 0;
}
.paper-mast-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}
.paper-title {
  margin: 0;
  font-family: "Old Standard TT", "Times New Roman", serif;
  font-size: 84px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #16110a;
  line-height: 0.9;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.06);
}
.paper-mast-sub {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 24px;
  border-top: 1px solid #16110a;
  border-bottom: 1px solid #16110a;
  padding: 6px 0;
  margin-top: 6px;
  font-family: Georgia, serif;
  font-size: 13px;
  letter-spacing: 0.04em;
}
.paper-tagline { font-style: italic; }
.paper-edition { font-weight: 700; text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px; }
.paper-time { font: 600 13px ui-monospace, monospace; color: #4a4030; }

/* ---- Main content column ---- */
.paper-main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px 32px 56px;
}
.paper-section { margin-top: 32px; }
.paper-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 2px solid #16110a;
  padding-bottom: 6px;
}
.paper-section-h {
  margin: 0;
  font: 800 14px/1 "Old Standard TT", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #16110a;
}
.paper-subsection-h {
  margin: 22px 0 8px 0;
  font: 700 12px/1 "Old Standard TT", Georgia, serif;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #16110a;
  border-bottom: 1px solid #16110a;
  padding-bottom: 4px;
}
.paper-subsection-h.hidden { display: none; }
.paper-section-count {
  font: 500 12px ui-monospace, monospace;
  color: #4a4030;
}
.paper-empty {
  padding: 24px;
  text-align: center;
  color: #4a4030;
  font-style: italic;
  border: 1px dashed #16110a;
  background: rgba(0, 0, 0, 0.02);
}

/* ---- LEAD STORY ---- */
.paper-lead {
  margin-top: 16px;
  padding: 22px 26px 24px;
  background: #f3eddc;
  border: 2px solid #16110a;
  border-left-width: 8px;
}
.paper-eyebrow {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  border-bottom: 1px solid #16110a;
  padding-bottom: 6px;
}
.paper-kicker {
  font: 800 11px/1 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: #16110a;
}
.paper-eyebrow-ts {
  font: 500 11px ui-monospace, monospace;
  color: #4a4030;
  font-style: italic;
}
.paper-headline {
  margin: 0 0 12px 0;
  font: 900 36px/1.15 "Old Standard TT", Georgia, serif;
  color: #16110a;
  letter-spacing: -0.015em;
}
.paper-lede {
  margin: 0;
  font: 400 17px/1.65 Georgia, serif;
  color: #16110a;
}
/* Drop cap on the lede */
.paper-lede::first-letter {
  font-family: "Old Standard TT", Georgia, serif;
  font-weight: 900;
  font-size: 56px;
  float: left;
  line-height: 0.9;
  margin: 4px 6px 0 0;
  color: #16110a;
}
.paper-actions { margin-top: 14px; display: flex; gap: 8px; }
.paper-actions.hidden { display: none; }
.paper-btn {
  background: #f3eddc;
  border: 2px solid #16110a;
  color: #16110a;
  padding: 7px 16px;
  font: 700 12px/1 ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
}
.paper-btn:hover { background: #16110a; color: #f3eddc; }
.paper-btn-primary {
  background: #16110a;
  color: #f3eddc;
}
.paper-btn-primary:hover { background: #4a4030; color: #f3eddc; }

/* ---- Story hero illustration ---- */
.story-hero {
  border: 2px solid #16110a;
  position: relative;
  overflow: hidden;
}
.story-hero svg { display: block; width: 100%; height: 100%; }
.story-hero-lead {
  width: 168px;
  height: 100px;
  float: left;
  margin: 0 18px 8px 0;
}
.story-hero-sm {
  width: 100%;
  height: 86px;
  margin-bottom: 10px;
}
.story-hero-slot { display: block; }
.story-hero-slot::after { content: ""; display: block; clear: both; }

/* Severity sash band — a 1-line ribbon at the bottom of the hero */
.story-hero.hero-sev-critical::after { content: "CRITICAL"; background: #b30c10; color: #fff; }
.story-hero.hero-sev-high::after     { content: "HIGH";     background: #a04a00; color: #fff; }
.story-hero.hero-sev-medium::after   { content: "MEDIUM";   background: #8a6a00; color: #fff; }
.story-hero.hero-sev-low::after      { content: "LOW";      background: #2a5a30; color: #fff; }
.story-hero.hero-sev-unknown::after  { content: "REPORTED"; background: #1a1a1a; color: #fff; }
.story-hero::after {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 3px 6px;
  font: 700 9px/1 ui-monospace, monospace;
  letter-spacing: 0.14em;
  text-align: center;
}

/* ---- Stories grid (secondary) ---- */
.paper-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
}
.story-card {
  background: #f3eddc;
  border: 2px solid #16110a;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}
.story-card-content {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.story-card-sev {
  display: inline-block;
  font: 800 9px/1 ui-monospace, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 3px 6px;
  margin-bottom: 6px;
  align-self: flex-start;
}
.story-card-sev.critical { background: #b30c10; color: #fff; }
.story-card-sev.high     { background: #a04a00; color: #fff; }
.story-card-sev.medium   { background: #8a6a00; color: #fff; }
.story-card-sev.low      { background: #2a5a30; color: #fff; }
.story-card-sev.unknown  { background: #16110a; color: #f3eddc; }
.story-card-title {
  margin: 0 0 6px 0;
  font: 800 18px/1.25 "Old Standard TT", Georgia, serif;
  color: #16110a;
}
.story-card-body {
  margin: 0 0 8px 0;
  font: 400 13px/1.55 Georgia, serif;
  color: #16110a;
}
.story-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #16110a;
}
.story-card-ts {
  font: 500 11px ui-monospace, monospace;
  color: #4a4030;
  font-style: italic;
}
.story-card-sources {
  background: transparent;
  border: 1px solid #16110a;
  color: #16110a;
  cursor: pointer;
  font: 700 11px ui-monospace, monospace;
  padding: 4px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.story-card-sources:hover { background: #16110a; color: #f3eddc; }
.story-card-share {
  background: transparent;
  border: 1px solid #16110a;
  color: #16110a;
  cursor: pointer;
  font: 700 11px ui-monospace, monospace;
  padding: 4px 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-decoration: none;
}
.story-card-share:hover { background: #b4280b; color: #ebe5d4; border-color: #b4280b; }

/* ---- Ten-code tooltips ---- */
.ten-code {
  text-decoration: underline dotted #b30c10;
  text-underline-offset: 3px;
  cursor: help;
  color: #8a0c10;
  font-weight: 700;
  font-variant: small-caps;
}
.ten-code-unknown {
  text-decoration-color: #4a4030;
  color: #4a4030;
}

/* ---- Metadata strip ---- */
.meta-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 8px 14px;
  margin: 12px 0 12px 0;
  background: rgba(0, 0, 0, 0.04);
  border-top: 2px solid #16110a;
  border-bottom: 1px solid #16110a;
  font: 500 12px/1.6 ui-monospace, monospace;
  color: #16110a;
}
.meta-strip .meta-bit { white-space: nowrap; }
.meta-strip .meta-bit b {
  color: #8a0c10;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-right: 4px;
  text-transform: uppercase;
  font-size: 11px;
}
.meta-strip .meta-bit-address {
  white-space: normal;
  flex-basis: 100%;
}

/* Secondary card meta */
.story-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
  font: 500 11px/1.4 ui-monospace, monospace;
  color: #4a4030;
}
.story-card-meta-addr {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* ---- By the Numbers ---- */
.paper-numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  border: 2px solid #16110a;
}
.number-tile {
  padding: 14px 16px;
  background: #f3eddc;
  text-align: center;
  border-right: 1px solid #16110a;
  border-bottom: 1px solid #16110a;
}
.number-tile:last-child { border-right: 0; }
.number-tile .num {
  font: 900 32px/1 "Old Standard TT", Georgia, serif;
  color: #16110a;
  letter-spacing: -0.02em;
}
.number-tile .lbl {
  font: 700 10px/1.2 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #16110a;
  margin-top: 4px;
}
.number-tile .sub {
  font: 400 11px ui-monospace, monospace;
  color: #4a4030;
  margin-top: 2px;
  font-style: italic;
}

/* ---- Filter chips ---- */
.paper-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.paper-chips .chip {
  background: transparent;
  border: 1px solid #16110a;
  color: #16110a;
  padding: 4px 10px;
  font: 600 11px/1 ui-monospace, monospace;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.paper-chips .chip:hover { background: rgba(0,0,0,0.06); }
.paper-chips .chip.active { background: #16110a; color: #f3eddc; }

/* ---- Call cards (Local Activity list) ---- */
.paper-list { display: flex; flex-direction: column; gap: 0; }
.paper-call {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid #16110a;
}
.paper-call:last-child { border-bottom: 0; }
.paper-call.sev-critical .paper-call-time { color: #b30c10; font-weight: 700; }
.paper-call.sev-high     .paper-call-time { color: #a04a00; font-weight: 700; }
.paper-call-time {
  font: 600 14px/1.4 ui-monospace, monospace;
  color: #16110a;
  text-align: right;
  white-space: nowrap;
}
.paper-call-time .ago {
  display: block;
  font-size: 11px;
  color: #4a4030;
  font-weight: 500;
  font-style: italic;
  margin-top: 2px;
}
.paper-call-body { min-width: 0; }
.paper-call-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: baseline;
  margin-bottom: 4px;
}
.paper-call-tag {
  font: 800 14px/1 "Old Standard TT", Georgia, serif;
  color: #16110a;
}
.paper-call-type {
  font: 700 11px/1 ui-monospace, monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8a0c10;
}
.paper-call-sev {
  font: 700 9px/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 2px 5px;
}
.paper-call-sev.critical { background: #b30c10; color: #fff; }
.paper-call-sev.high     { background: #a04a00; color: #fff; }
.paper-call-sev.medium   { background: #8a6a00; color: #fff; }
.paper-call-ai { color: #5a3a8a; display: inline-flex; align-items: center; }
.paper-call-ai svg { width: 12px; height: 12px; }
.paper-call-text {
  margin: 0 0 8px 0;
  font: 400 14px/1.55 Georgia, serif;
  color: #16110a;
}
.paper-call-text .summary { font-weight: 700; }
.paper-call-text .pending { color: #4a4030; font-style: italic; }
.paper-call audio { height: 32px; max-width: 380px; width: 100%; }

/* ---- Skies (no map, list-only) ---- */
.paper-skies-list { display: flex; flex-direction: column; gap: 0; border-top: 1px solid #16110a; }
.paper-sky-row {
  display: grid;
  grid-template-columns: 28px 1fr 90px 70px 90px;
  gap: 10px;
  align-items: center;
  padding: 7px 4px;
  font: 500 13px/1.3 ui-monospace, monospace;
  border-bottom: 1px solid rgba(0,0,0,0.15);
  color: #16110a;
}
.paper-sky-row.emerg { background: rgba(220, 60, 60, 0.15); padding: 7px 8px; }
.paper-sky-kind { font-size: 18px; }
.paper-sky-name { color: #16110a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.paper-sky-name .type-code { color: #4a4030; font-size: 11px; margin-left: 6px; font-weight: 500; font-style: italic; }
.paper-sky-alt, .paper-sky-spd, .paper-sky-status { color: #4a4030; font-size: 12px; text-align: right; }
.paper-sky-row.emerg .paper-sky-status { color: #b30c10; font-weight: 800; }

/* ---- Source-calls modal (newspaper themed) ---- */
.source-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
}
.source-modal.open { display: block; }
.source-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 17, 10, 0.78);
}
.source-modal-card {
  position: relative;
  max-width: 820px;
  margin: 4vh auto;
  max-height: 92vh;
  background: #ebe5d4;
  border: 4px solid #16110a;
  border-radius: 0;
  padding: 22px 28px 28px;
  overflow-y: auto;
  font-family: Georgia, serif;
  color: #16110a;
}
.source-modal-close {
  position: absolute;
  top: 8px;
  right: 14px;
  background: transparent;
  border: 0;
  color: #16110a;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
}
.source-modal-close:hover { color: #8a0c10; }
.source-modal-card h2 {
  margin: 0 0 14px 0;
  font: 900 26px/1.2 "Old Standard TT", Georgia, serif;
  color: #16110a;
  padding-right: 30px;
  border-bottom: 2px solid #16110a;
  padding-bottom: 8px;
}
.modal-loading, .modal-empty {
  padding: 30px;
  text-align: center;
  color: #4a4030;
  font-style: italic;
}
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  margin-bottom: 12px;
  font-family: ui-monospace, monospace;
  font-size: 12px;
}
.modal-meta-tag    { color: #8a0c10; font-weight: 800; letter-spacing: 0.04em; }
.modal-meta-count  { color: #4a4030; font-style: italic; }
.modal-meta-sev {
  font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 3px 7px;
  font-size: 11px;
}
.modal-meta-sev.sev-critical { background: #b30c10; color: #fff; }
.modal-meta-sev.sev-high     { background: #a04a00; color: #fff; }
.modal-meta-sev.sev-medium   { background: #8a6a00; color: #fff; }
.modal-meta-sev.sev-low      { background: #2a5a30; color: #fff; }
.modal-meta-sev.sev-unknown  { background: #16110a; color: #f3eddc; }

.modal-summary {
  padding: 12px 16px;
  background: #f3eddc;
  border-left: 6px solid #16110a;
  margin-bottom: 16px;
  font: 400 15px/1.6 Georgia, serif;
  color: #16110a;
}

.modal-calls { display: flex; flex-direction: column; gap: 14px; }
.modal-call {
  background: #f3eddc;
  border: 2px solid #16110a;
  padding: 12px 14px;
}
.modal-call.primary { border-width: 3px; box-shadow: 4px 4px 0 #16110a; }
.modal-call-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 6px;
  border-bottom: 1px solid #16110a;
  padding-bottom: 6px;
}
.modal-call-badge {
  background: #16110a; color: #f3eddc;
  font: 800 10px/1 ui-monospace, monospace;
  letter-spacing: 0.18em;
  padding: 3px 7px;
}
.modal-call-time { font: 600 12px ui-monospace, monospace; color: #4a4030; }
.modal-call-tag { font: 800 13px "Old Standard TT", Georgia, serif; color: #16110a; }
.modal-call-units {
  font: 600 11px ui-monospace, monospace;
  color: #8a0c10;
  padding: 2px 6px;
  border: 1px solid #8a0c10;
}
.modal-call-summary { color: #16110a; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.modal-call-transcript {
  font: 400 14px/1.6 Georgia, serif;
  color: #16110a;
  margin-bottom: 8px;
}
.modal-call-pending { font-style: italic; color: #4a4030; font-size: 12px; }
/* Audio block — "Listen to this call" is a real button now */
.modal-call-audio-wrap {
  margin-top: 8px;
  padding: 0;
  background: transparent;
  border: 0;
}
.modal-call-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #16110a;
  color: #f3eddc;
  border: 2px solid #16110a;
  padding: 8px 16px;
  font: 800 12px/1 ui-monospace, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
}
.modal-call-play-btn:hover {
  background: #8a0c10;
  border-color: #8a0c10;
}
.modal-call-play-btn[data-state="playing"] {
  background: #8a0c10;
  border-color: #8a0c10;
}
.modal-call-play-btn .play-icon {
  font-size: 14px;
  line-height: 1;
}
.modal-call audio {
  display: block;
  height: 34px;
  width: 100%;
  max-width: 100%;
  margin-top: 8px;
}

/* ---- Footer ---- */
.paper-footer {
  margin-top: 48px;
  padding-top: 14px;
  border-top: 3px double #16110a;
  font: 400 11px/1.5 Georgia, serif;
  color: #4a4030;
  text-align: center;
  font-style: italic;
}
.paper-foot-compliance {
  margin-top: 6px;
  font-size: 10px;
  font-style: normal;
  letter-spacing: .02em;
  color: #6b5d45;
  max-width: 80ch;
  margin-left: auto;
  margin-right: auto;
}

/* ---- Responsive ---- */
@media (max-width: 720px) {
  .paper-mast-edge { flex-direction: column; gap: 4px; padding-bottom: 6px; }
  .paper-title { font-size: 56px; }
  .paper-mast-logo { width: 48px; height: 48px; }
  .paper-main { padding: 16px; }
  .paper-headline { font-size: 26px; }
  .paper-lede { font-size: 15px; }
  .paper-lede::first-letter { font-size: 44px; }
  .paper-call { grid-template-columns: 76px 1fr; gap: 12px; }
  .paper-sky-row {
    grid-template-columns: 24px 1fr 70px;
    font-size: 12px;
  }
  .paper-sky-spd, .paper-sky-status { display: none; }
  .story-hero-lead { width: 130px; height: 80px; margin-right: 12px; }
}

/* =====================================================================
   Sort toggle (Impact vs Latest news)
   ===================================================================== */
.paper-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 16px;
  padding: 8px 0;
  border-top: 1px solid #16110a;
  border-bottom: 1px solid #16110a;
  font-family: Georgia, serif;
}
.paper-sort-label {
  font-size: 13px;
  color: #423929;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: bold;
}
.paper-sort-btn {
  font-family: Georgia, serif;
  font-size: 14px;
  font-weight: bold;
  padding: 5px 12px;
  border: 2px solid #16110a;
  background: transparent;
  color: #16110a;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.paper-sort-btn:hover { background: #ebe5d4; }
.paper-sort-btn.active { background: #16110a; color: #ebe5d4; }

/* =====================================================================
   CNN-style ticker (fixed bottom) — mobile-aware
   ===================================================================== */
:root { --ticker-duration: 45s; }

/* Reserve space at bottom of the page so content isn't hidden under
   the ticker. env(safe-area-inset-bottom) accounts for the iPhone
   home indicator. */
body.dash-body {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
}

.jafo-ticker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  /* Account for iPhone home indicator: the bar is offset above it so
     the actual ticker content sits cleanly without being covered. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(44px + env(safe-area-inset-bottom, 0px));
  background: #0a0a0a;
  color: #f3eddc;
  z-index: 1000;
  display: flex;
  align-items: stretch;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.4);
  border-top: 3px solid #b4280b;
  font-family: 'Helvetica Neue', Arial, sans-serif;
  /* nudge GPU layer so iOS Safari runs the animation smoothly */
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
  will-change: transform;
}

.ticker-speed {
  display: flex;
  flex-direction: column;
  width: 38px;
  border-right: 1px solid #2a2a2a;
  background: #16110a;
  flex-shrink: 0;
}
.ticker-speed-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #f3eddc;
  font: bold 18px/1 system-ui, sans-serif;
  cursor: pointer;
  padding: 0;
}
.ticker-speed-up   { border-bottom: 1px solid #2a2a2a; }
.ticker-speed-btn:hover  { background: #b4280b; }
.ticker-speed-btn:active { background: #d9580f; }

.ticker-rail {
  flex: 1;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}
.ticker-track {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  height: 100%;
  -webkit-animation: ticker-scroll var(--ticker-duration) linear infinite;
          animation: ticker-scroll var(--ticker-duration) linear infinite;
  padding-left: 16px;
  white-space: nowrap;
  /* GPU layer — keeps the animation smooth on iOS Safari */
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  will-change: transform;
}
.ticker-track:hover           { -webkit-animation-play-state: paused; animation-play-state: paused; }
.jafo-ticker.paused .ticker-track { -webkit-animation-play-state: paused; animation-play-state: paused; }

@-webkit-keyframes ticker-scroll {
  0%   { -webkit-transform: translate3d(0, 0, 0); }
  100% { -webkit-transform: translate3d(-50%, 0, 0); }
}
@keyframes ticker-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}

.ticker-section-label {
  background: #b4280b;
  color: #fff;
  font-weight: bold;
  font-size: 12px;
  padding: 4px 12px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-item {
  font-size: 14px;
  color: #f3eddc;
  text-decoration: none;
  white-space: nowrap;
  font-weight: 500;
  padding: 2px 0;
}
.ticker-item:hover { color: #ffe87a; text-decoration: underline; }
.ticker-item .ticker-item-sub {
  font-size: 12px;
  color: #8a8275;
  margin-left: 6px;
}
.ticker-sep {
  color: #555;
  font-size: 16px;
  user-select: none;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .jafo-ticker {
    height: calc(38px + env(safe-area-inset-bottom, 0px));
  }
  body.dash-body {
    padding-bottom: calc(48px + env(safe-area-inset-bottom, 0px));
  }
  .ticker-speed { width: 36px; }
  .ticker-speed-btn { font-size: 16px; }
  .ticker-item { font-size: 13px; }
  .ticker-section-label { font-size: 10px; padding: 3px 8px; letter-spacing: 1px; }
  /* iPhone landscape gets a slimmer reserve */
}

/* Devices that can't hover (touch) — show a one-line hint that tapping
   the bar pauses it so the user can read/click an item. */
@media (hover: none) {
  .jafo-ticker { cursor: pointer; }
}
