/* InfoNewsHQ site. Theme tokens are the agreed mockup's (App.dc.html), as CSS variables: white by default, a dark
   switch, and the system setting when the visitor never chose. */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(/fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #FFFFFF; --panel: #F3F5F8; --line: #E5E8EE; --text: #0F172A; --soft: #334155; --muted: #5B6577;
  --hover: #F7F9FB; --active-bg: #EAF1FE; --active-text: #1D4ED8; --live-bg: #E8F7EE; --live-text: #166534;
  --dev-bg: #F1ECFE; --dev-text: #4C1D95; --first-bg: #F3F7FF; --accent: #2563EB; --accent-text: #2563EB;
  --sev-critical: #B91C1C; --sev-high: #C2410C; --sev-medium: #A16207; --sev-notable: #A16207; --ok: #166534;
  --update: #7C3AED; --fresh: #FEF9C3;
  --page: #FFFFFF; --card: #FFFFFF; --side-bg: #071226; --side-text: #DCE6F5; --side-muted: #8EA0BC;
  --side-hover: rgba(255,255,255,0.06); --side-active: #12305E; --shadow: none;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B1220; --panel: #151E31; --line: #24304A; --text: #E6EAF2; --soft: #C3CCDA; --muted: #94A3B8;
  --hover: #121B2D; --active-bg: #16233D; --active-text: #93C5FD; --live-bg: #0F2A1C; --live-text: #6EE7A0;
  --dev-bg: #241A45; --dev-text: #D8CCFF; --first-bg: #12203D; --accent-text: #93C5FD;
  --sev-critical: #FCA5A5; --sev-high: #FDBA74; --sev-medium: #FDE047; --sev-notable: #FDE047; --ok: #4ADE80;
  --fresh: #2A2A12;
  --page: #0B1220; --card: #0B1220; --side-bg: #050B16; --side-text: #DCE6F5; --side-muted: #8EA0BC;
  --side-hover: rgba(255,255,255,0.05); --side-active: #13284A; --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0B1220; --panel: #151E31; --line: #24304A; --text: #E6EAF2; --soft: #C3CCDA; --muted: #94A3B8;
    --hover: #121B2D; --active-bg: #16233D; --active-text: #93C5FD; --live-bg: #0F2A1C; --live-text: #6EE7A0;
    --dev-bg: #241A45; --dev-text: #D8CCFF; --first-bg: #12203D; --accent-text: #93C5FD;
    --sev-critical: #FCA5A5; --sev-high: #FDBA74; --sev-medium: #FDE047; --sev-notable: #FDE047; --ok: #4ADE80;
    --fresh: #2A2A12;
    --page: #0B1220; --card: #0B1220; --side-bg: #050B16; --side-text: #DCE6F5; --side-muted: #8EA0BC;
    --side-hover: rgba(255,255,255,0.05); --side-active: #13284A; --shadow: none;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); color: var(--text); }
body { font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; font-size: 14px; line-height: 1.4;
  -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- page frame: the menu and top bar stay put; only the content scrolls (wider than a phone) ---- */
.app { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }
.side { flex: 0 0 232px; padding: 0 12px 14px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto;
  background: var(--side-bg); color: var(--side-text); }
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
#view { flex: 1 1 0; min-height: 0; overflow-y: auto; }
#view.is-list { overflow: hidden; }
.foot { display: none; }
.side-foot { margin: auto 0 0; padding: 14px 10px 0; font-size: 11px; line-height: 1.5; color: var(--side-muted); }

/* ---- Sidebar ---- */
.brand { display: flex; align-items: center; gap: 10px; height: 60px; flex-shrink: 0; margin: 0 -12px 10px; padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08); color: #FFFFFF; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0; }
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -0.02em; }
.side-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--side-muted); padding: 6px 10px; }
.topics { display: flex; flex-direction: column; gap: 2px; }
.topic { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  border: 0; background: transparent; color: var(--side-text); font-size: 14px; text-align: left; }
.topic:hover { background: var(--side-hover); }
.topic[aria-current="true"] { background: var(--side-active); color: #FFFFFF; font-weight: 700; }
.topic-n { font-size: 12px; font-weight: 600; color: var(--side-muted); }
.topic[aria-current="true"] .topic-n { color: #BFD6FF; }

/* ---- TopBar ---- */
.top { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 0 20px;
  border-bottom: 1px solid var(--line); height: 60px; flex-shrink: 0; background: var(--card); }
.top-left { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.top h1 { margin: 0; font-size: 18px; font-weight: 700; }
.back { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 8px; border-radius: 10px; border: 0;
  background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.back:hover { background: var(--hover); }
.live { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--live-bg);
  color: var(--live-text); font-size: 12px; font-weight: 700; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #16A34A; }
.live.off { background: var(--panel); color: var(--muted); }
.live.off .live-dot { background: var(--muted); }
.paused { font-size: 12px; color: var(--muted); }
.icon-btn { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: transparent;
  color: var(--text); display: flex; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--hover); }

/* ---- Tags ---- */
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; background: var(--panel); color: var(--soft); }
.chip.new { background: var(--accent); color: #FFFFFF; }
.chip.urgent { background: #DC2626; color: #FFFFFF; }
.chip.early { background: #7C3AED; color: #FFFFFF; }
.chip.unchecked { background: #B45309; color: #FFFFFF; }
.sev { padding: 1px 7px; border-radius: 6px; border: 1.5px solid currentColor; font-size: 11px; font-weight: 700; }
.sev.critical { color: var(--sev-critical); } .sev.high { color: var(--sev-high); }
.sev.notable, .sev.medium { color: var(--sev-notable); }
.place { padding: 2px 8px; border-radius: 6px; background: var(--panel); font-size: 11px; font-weight: 700; }
.tag-extra { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---- list view: alerts 75%, the selected story 25%, each scrolling on its own ---- */
.list-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 1px var(--panel-w, 30%); height: 100%; }
.list-wrap.no-panel { grid-template-columns: minmax(0, 1fr); }
.list-wrap.resizing { cursor: col-resize; user-select: none; }
.list { min-width: 0; min-height: 0; overflow-y: auto; padding: 0 0 24px; display: flex; flex-direction: column; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 20px 10px; }
.list-head h2 { margin: 0; font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.list-n { padding: 1px 8px; border-radius: 999px; background: var(--panel); font-size: 12px; font-weight: 700; color: var(--muted); }
.note { font-size: 12px; color: var(--muted); }
.rows { flex-shrink: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.list-head { flex-shrink: 0; }
.row { text-align: left; display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; border: 0; border-radius: 0;
  border-bottom: 1px solid var(--line); background: transparent; color: var(--text); width: 100%; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover); }
.row[aria-pressed="true"] { background: var(--active-bg); }
.row-icon { width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: var(--panel); color: var(--accent-text);
  display: flex; align-items: center; justify-content: center; }
.row[aria-pressed="true"] .row-icon { background: var(--bg); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.row-title { font-size: 15px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.row-foot { font-size: 12px; color: var(--muted); }
.row.fresh { animation: slide-in 0.45s ease-out, flash 3s ease-out; }
@keyframes slide-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flash { from { background: var(--fresh); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .row.fresh { animation: none; } }
.empty { margin: 0 20px; padding: 40px 16px; border: 1px dashed var(--line); border-radius: 16px; display: flex; flex-direction: column;
  align-items: center; gap: 6px; text-align: center; }
.empty strong { font-size: 15px; }
.empty span { font-size: 13px; color: var(--muted); }

.panel { position: relative; min-width: 0; min-height: 0; overflow-y: auto; padding: 16px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.panel .head { padding-right: 34px; }
.panel-x { position: absolute; z-index: 3; top: 10px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); display: flex; align-items: center; justify-content: center; }
.panel-x:hover { background: var(--hover); color: var(--text); }
.panel .head .title { font-size: 18px; line-height: 1.28; }
.panel .head p { font-size: 14px; line-height: 1.5; }
.panel .fact { padding: 9px 11px; }
.panel-sources { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.panel-sources h3 { margin: 0; font-size: 13px; font-weight: 700; }
.see-all { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 12px; border-radius: 10px; border: 0;
  background: var(--accent); color: #FFFFFF; font-size: 14px; font-weight: 700; text-decoration: none; text-align: center; }
.see-all:hover { filter: brightness(1.08); }

/* ---- StoryHead ---- */
.head { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.head .title { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.22; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.head.big .title { font-size: 30px; }
.head .title a { text-decoration: none; }
.head .title a:hover { text-decoration: underline; }
.head p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--soft); max-width: 720px; }
.head.big p { font-size: 16px; }
.why { font-size: 12px; line-height: 1.5; color: var(--muted); }

/* ---- Facts ---- */
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.facts.one { grid-template-columns: minmax(0, 1fr); }
.fact { background: var(--panel); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact-k { font-size: 10px; font-weight: 700; letter-spacing: 0.07em; color: var(--muted); }
.fact-v { font-size: 14px; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.fact ul { margin: 2px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.fact li { font-size: 14px; font-weight: 500; line-height: 1.4; color: var(--soft); }

/* ---- SourceRow ---- */
.src { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); }
.src.first { border-color: var(--accent); background: var(--first-bg); }
.src.compact { gap: 10px; align-items: center; padding: 0; border: 0; background: transparent; }
.badge { width: 34px; height: 34px; flex-shrink: 0; border-radius: 9px; color: #FFFFFF; display: flex; align-items: center;
  justify-content: center; font-size: 13px; font-weight: 800; }
.src.compact .badge { width: 30px; height: 30px; }
.src-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.src-line { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.src-name { font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.pill { padding: 1px 7px; border-radius: 999px; background: var(--panel); font-size: 11px; font-weight: 600; color: var(--muted); }
.src.first .pill { background: var(--bg); }
.pill.first, .src.first .pill.first { background: var(--accent); color: #FFFFFF; font-weight: 700; }
.src-when { font-size: 12px; color: var(--muted); }
.src-text { font-size: 14px; line-height: 1.45; color: var(--soft); overflow-wrap: anywhere; }
.src.compact .src-text { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.open { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--line); color: var(--text);
  display: flex; align-items: center; justify-content: center; text-decoration: none; background: var(--bg); }
.open:hover { background: var(--hover); }

/* ---- story view (scrolls inside #view) ---- */
.story { padding: 20px 24px 32px; display: flex; flex-direction: column; gap: 18px; max-width: 1240px; }
.numbers { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.number { background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.number b { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.number span { font-size: 12px; color: var(--muted); }
.story-cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.story-main { flex: 999 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.story-side { flex: 1 1 260px; max-width: 320px; display: flex; flex-direction: column; gap: 10px; }
.story-side h2 { margin: 0; font-size: 15px; font-weight: 700; }
.box { border: 1px solid var(--line); border-radius: 12px; padding: 18px; background: var(--card); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.sec-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: baseline; }
.sec-head h2 { margin: 0; font-size: 16px; font-weight: 700; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; border-bottom: 1px solid var(--line); }
.bar-col { flex: 1; min-width: 0; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.bar-n { font-size: 11px; font-weight: 600; color: var(--muted); }
.bar { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: var(--accent); }
.bar.zero { background: var(--line); }
.bar.after { background: var(--update); }
.bar-labels { display: flex; gap: 6px; }
.bar-labels span { flex: 1; min-width: 0; font-size: 11px; color: var(--muted); text-align: center; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--muted); }
.legend span { display: flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--accent); }
.legend i.after { background: var(--update); }

.trail-sec { display: flex; flex-direction: column; gap: 14px; }
.trail-sec .sec-head h2 { font-size: 18px; font-weight: 800; }
.btn { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; }
.btn:hover { background: var(--hover); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text);
  font-size: 13px; font-weight: 600; }
.filter[aria-pressed="true"] { border-color: var(--text); background: var(--text); color: var(--bg); font-weight: 700; }
.filter-n { opacity: 0.75; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.entry { display: flex; gap: 14px; align-items: stretch; }
.entry-when { width: 74px; flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; text-align: right; }
.entry-when b { font-size: 13px; font-weight: 700; }
.entry-when .day { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.02em; }
.entry-when span { font-size: 12px; color: var(--muted); }
.rail { width: 14px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
.rail-top { width: 2px; height: 16px; background: var(--line); }
.rail-line { width: 2px; flex: 1; background: var(--line); }
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--bg); border: 2px solid var(--accent); }
.dot.first { width: 14px; height: 14px; background: var(--accent); }
.dot.update { background: var(--update); border-color: var(--update); }
.entry-body { flex: 1; min-width: 0; padding: 8px 0; }
.divider { padding: 10px 14px; border-radius: 12px; background: var(--dev-bg); color: var(--dev-text); font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.gone { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---- narrow screens: the list sits above the story panel; the whole page scrolls ---- */
@media (max-width: 900px) {
  .app { height: auto; overflow: visible; }
  #view, #view.is-list { overflow: visible; }
  .list-wrap { display: flex; flex-direction: column; height: auto; }
  .list { overflow: visible; border-right: 0; }
  .panel { overflow: visible; border-top: 1px solid var(--line); }
  .side-foot { display: none; }
  .foot { display: block; padding: 16px 20px 24px; font-size: 12px; color: var(--muted); }
}
/* ---- phone width: the menu stacks above the list, 16px gutters ---- */
@media (max-width: 760px) {
  .app { flex-direction: column; }
  .side { flex: none; padding: 0 16px 12px; overflow: visible; }
  .brand { margin: 0 -16px 10px; padding: 0 16px; height: 56px; }
  .side-head { display: none; }
  .topics { flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .topic { padding: 6px 10px; border: 1px solid rgba(255,255,255,0.14); border-radius: 999px; font-size: 13px; }
  .topic[aria-current="true"] { border-color: transparent; }
  .top { padding: 0 16px; height: 56px; }
  .list { padding: 0 0 16px; }
  .list-head { padding: 12px 16px 8px; }
  .row { padding: 12px 16px; }
  .empty { margin: 0 16px; }
  .panel { padding: 16px; }
  .story { padding: 16px; }
  .head.big .title { font-size: 24px; }
  .numbers { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .number b { font-size: 17px; }
  .story-side { max-width: none; }
  .box { padding: 16px; }
  .entry { gap: 8px; }
  .entry-when { width: 58px; }
  .chart, .bar-labels { gap: 3px; }
  .foot { padding: 16px; }
}

/* ---- outlet logos: drawn over the letter or topic icon, which show only if the outlet has no icon ---- */
.badge, .row-icon { position: relative; overflow: hidden; }
.logo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4px; background: #FFFFFF;
  border-radius: inherit; box-shadow: inset 0 0 0 1px rgba(15,23,42,0.08); }
.row-icon .logo { padding: 5px; }

/* ---- feeling live ---- */
.live-dot { position: relative; }
.live:not(.off) .live-dot::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #16A34A;
  animation: ping 1.8s ease-out infinite; }
@keyframes ping { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.since { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.just { display: inline-flex; align-items: center; gap: 5px; margin-right: 8px; color: #DC2626; font-weight: 700; }
.just i { width: 6px; height: 6px; border-radius: 50%; background: #DC2626; animation: blink 1.4s ease-in-out infinite; }
:root[data-theme="dark"] .just { color: #F87171; }
@keyframes blink { 50% { opacity: 0.25; } }
.new-pill { position: sticky; top: 4px; z-index: 2; align-self: center; display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: -6px; padding: 7px 14px; border: 0; border-radius: 999px; background: var(--accent); color: #FFFFFF;
  font-size: 13px; font-weight: 700; box-shadow: 0 4px 14px rgba(37,99,235,0.35); animation: drop 0.35s ease-out; }
@keyframes drop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.topic.bump .topic-n { animation: bump 1.2s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 20% { transform: scale(1.5); color: #FFFFFF; } 100% { transform: scale(1); } }
.entry.fresh .entry-body { animation: slide-in 0.45s ease-out; }
.entry.fresh .src { animation: flash 3s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .live-dot::after, .just i, .new-pill, .topic.bump .topic-n, .entry.fresh .entry-body, .entry.fresh .src { animation: none !important; }
}

/* ---- the line between the list and the panel: 1px to see, 13px to grab ---- */
.split { position: relative; background: var(--line); cursor: col-resize; touch-action: none; z-index: 1; }
.split::before { content: ''; position: absolute; inset: 0 -6px; }
.split::after { content: ''; position: absolute; top: 50%; left: -2px; width: 5px; height: 36px; margin-top: -18px; border-radius: 3px;
  background: var(--line); opacity: 0; transition: opacity 0.15s; }
.split:hover, .split:focus-visible, .resizing .split { background: var(--accent); }
.split:hover::after, .resizing .split::after { opacity: 1; background: var(--accent); }

/* ---- menu: topic icons; collapsed to a rail of icons ---- */
.topic-ic { display: flex; flex-shrink: 0; color: var(--side-muted); }
.topic[aria-current="true"] .topic-ic { color: #FFFFFF; }
.topic-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-btn { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 7px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--side-muted); font-size: 13px; text-align: left; }
.rail-btn:hover { background: var(--side-hover); color: var(--side-text); }
.side { transition: flex-basis 0.18s ease; }
:root[data-rail="1"] .side { flex-basis: 64px; padding: 0 10px 14px; }
:root[data-rail="1"] .brand { justify-content: center; padding: 0; margin: 0 -10px 10px; }
:root[data-rail="1"] .brand-name, :root[data-rail="1"] .side-head, :root[data-rail="1"] .topic-name,
:root[data-rail="1"] .topic-n, :root[data-rail="1"] .side-foot { display: none; }
:root[data-rail="1"] .topic, :root[data-rail="1"] .rail-btn { justify-content: center; padding: 9px 0; }
:root[data-rail="1"] .topic.bump .topic-ic { animation: bump 1.2s ease-out; }
@media (max-width: 760px) {
  .rail-btn, .topic-ic { display: none; }
  :root[data-rail="1"] .side { flex-basis: auto; padding: 0 16px 12px; }
  :root[data-rail="1"] .brand-name, :root[data-rail="1"] .topic-name, :root[data-rail="1"] .topic-n { display: inline; }
  :root[data-rail="1"] .brand { justify-content: flex-start; padding: 0 16px; margin: 0 -16px 10px; }
  :root[data-rail="1"] .topic { padding: 6px 10px; }
}
@media (max-width: 900px) { .split { display: none; } }
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }

/* ---- quiet scrollbars, so a scrollbar never reads as a divider ---- */
* { scrollbar-width: thin; scrollbar-color: transparent transparent; }
*:hover { scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; }
*:hover::-webkit-scrollbar-thumb { background: var(--line); }
.side, .side:hover { scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* ---- top strip: the last 24 hours, and outages still going ---- */
.top-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.strip { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.stat { display: inline-flex; align-items: baseline; gap: 4px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); font-size: 13px; white-space: nowrap; }
.stat b { color: var(--text); font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.crit b { color: var(--sev-critical); } .stat.high b { color: var(--sev-high); }
.stat:hover:not(:disabled) { background: var(--hover); }
.stat:disabled { cursor: default; opacity: 0.7; }
.stat[aria-pressed="true"] { background: var(--active-bg); color: var(--active-text); }
.svc { display: inline-flex; align-items: center; gap: 7px; margin-left: 6px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--soft); font-size: 13px; font-weight: 600; white-space: nowrap; }
.svc i { width: 8px; height: 8px; border-radius: 50%; background: #16A34A; }
.svc.down i { background: #F59E0B; animation: blink 1.4s ease-in-out infinite; }
.svc:hover { background: var(--hover); }
.clear-sev { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 0; border-radius: 999px;
  background: var(--active-bg); color: var(--active-text); font-size: 12px; font-weight: 700; }

/* ---- At a glance (the right column when no story is open) ---- */
.glance { gap: 22px; }
.glance-title { margin: 0; font-size: 16px; font-weight: 800; }
.g-sec { display: flex; flex-direction: column; gap: 8px; }
.g-sec h3 { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.g-sec h3 span { text-transform: none; letter-spacing: 0; font-weight: 600; }
.g-top { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.g-top button { width: 100%; display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 10px; row-gap: 1px; padding: 8px 6px;
  border: 0; border-radius: 8px; background: transparent; text-align: left; color: var(--text); }
.g-top button:hover { background: var(--hover); }
.g-n { grid-row: span 2; align-self: center; text-align: center; font-size: 15px; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.g-t { font-size: 13px; font-weight: 600; line-height: 1.35; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-m { font-size: 11px; color: var(--muted); }
.g-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 10px; row-gap: 2px; align-items: center; width: 100%;
  padding: 6px; border: 0; border-radius: 8px; background: transparent; color: var(--text); font-size: 13px; text-align: left; }
button.g-row:hover { background: var(--hover); }
.g-row em { grid-column: 1 / -1; font-style: normal; font-size: 11px; color: var(--muted); }
.g-overall span:first-child { font-weight: 700; }
.meter { display: inline-flex; gap: 3px; }
.meter i { width: 14px; height: 6px; border-radius: 2px; background: var(--line); }
.meter i.on.l1, .meter i.on.l2 { background: #22C55E; } .meter i.on.l3 { background: #EAB308; }
.meter i.on.l4 { background: #F97316; } .meter i.on.l5 { background: #EF4444; }
.g-event { display: flex; flex-direction: column; gap: 1px; padding: 4px 6px; }
.g-when { font-size: 11px; font-weight: 700; color: var(--accent-text); }
.g-event b { font-size: 13px; font-weight: 600; }
.g-why { font-size: 12px; color: var(--muted); line-height: 1.4; }
.g-hours { display: flex; align-items: flex-end; gap: 2px; height: 48px; padding: 0 6px; border-bottom: 1px solid var(--line); }
.g-hours i { flex: 1; min-width: 0; border-radius: 2px 2px 0 0; background: var(--accent); opacity: 0.85; }
.g-hours i:last-child { opacity: 1; }
.g-hours-l { display: flex; justify-content: space-between; padding: 0 6px; font-size: 10px; color: var(--muted); }
@media (max-width: 1180px) { .stat:not(.crit):not(.high) { display: none; } }
@media (max-width: 900px) { .strip .stat { display: none; } .glance { display: none; } }
@media (max-width: 760px) { .top-right { gap: 8px; } .svc { margin-left: 0; padding: 5px 10px; font-size: 12px; } }

/* ---- the right column fits the window (wider than 900 px): only the alert list scrolls ---- */
@media (min-width: 901px) {
  .panel { overflow: hidden; }
  /* An open story: the body gives way (faded at the bottom); "See all" always shows. */
  .panel:not(.glance) { gap: 12px; }
  .panel-body { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 14px;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 36px), transparent); }
  .panel .head p { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
  .panel .fact-v { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .panel .fact li { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .panel .fact li:nth-child(n+4) { display: none; }
  .panel .see-all { flex-shrink: 0; }
  /* At a glance: compact rows; the lists give way before anything is cut. */
  .glance { gap: 16px; padding-bottom: 16px; }
  .glance > * { flex-shrink: 0; }
  .glance .g-sec:first-of-type, .glance .g-threat { flex-shrink: 1; min-height: 0; overflow: hidden; }
  .g-top button { padding: 6px; row-gap: 0; }
  .g-t { -webkit-line-clamp: 1; }
  .g-row { grid-template-columns: minmax(0, 1fr) auto auto; padding: 5px 6px; }
  .g-row em { grid-column: auto; text-align: right; }
  .g-event { padding: 3px 6px; }
  .g-ev-line { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
  .g-ev-line b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .g-when { flex-shrink: 0; }
  .g-why { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (min-width: 901px) and (max-height: 820px) { .g-hours-sec { display: none; } .g-why { display: none; }
  .g-top li:nth-child(n+5) { display: none; } .g-threat .g-row:nth-of-type(n+6) { display: none; } }
@media (min-width: 901px) and (max-height: 700px) { .g-coming { display: none; } }
/* The left menu on short screens: tighter rows rather than a scrollbar. */
@media (min-width: 761px) and (max-height: 820px) { .topic { padding: 4px 10px; } .side-head { padding: 4px 10px; } .brand { margin-bottom: 6px; } .side-foot { padding-top: 8px; } }

/* ---- narrow screens and phones: one column that scrolls as a page ---- */
@media (max-width: 900px) {
  #view, #view.is-list { flex: none; }
  .top { height: auto; min-height: 56px; padding: 8px 16px; row-gap: 8px; }
  .top-right { margin-left: 0; }
  .list-wrap .panel, .list-wrap .split { display: none; }
}
@media (max-width: 760px) {
  /* topics: one row that slides sideways instead of five rows of chips */
  .topics { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
  .topics::-webkit-scrollbar { display: none; }
  .topic { flex-shrink: 0; }
  .brand { height: 52px; margin-bottom: 8px; }
  .side { padding-bottom: 10px; }
  .top h1 { font-size: 17px; }
  .since { display: none; }
}
