/* RevuToday — same palette, type and card language as the mobile app. */
:root {
  --navy: #0C1C38;
  --navy-2: #1A2E52;
  --paper: #F2F6FD;
  --card: #FFFFFF;
  --text: #13213A;
  --muted: #5F6B7E;
  --rule: #E2E8F2;
  --outline: #C5CDD9;
  --blue: #1479F8;
  --sky: #4A9BFF;
  --red: #E0365A;
  --orange: #F26B21;
  --purple: #7745DB;
  --radius-l: 16px;
  --radius-s: 8px;
  --shadow: 0 1px 3px rgba(19, 33, 58, .06);
  --font: Roboto, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --max: 1120px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; background: #fff; padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

/* Header and hero */
.top { background: var(--navy); color: #fff; padding: 0 16px 64px; }
.bar { max-width: var(--max); margin: 0 auto; display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 24px; letter-spacing: -.02em; }
.brand-2 { color: var(--sky); }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { display: flex; align-items: center; gap: 8px; color: #B6C3D8; text-decoration: none; font-weight: 500; font-size: 14px; padding: 8px 12px; border-radius: 20px; }
.nav a:hover { color: #fff; background: var(--navy-2); }
.nav a[aria-current="page"] { color: #fff; background: var(--navy-2); }
.nav svg, .tabbar svg { width: 18px; height: 18px; fill: currentColor; }
.live { margin: 0 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: #B6C3D8; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #6B7A90; }
.live.on i { background: #2BD17E; box-shadow: 0 0 0 0 rgba(43, 209, 126, .6); animation: pulse 2.4s infinite; }
.live.off i { background: #F0A43A; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(43, 209, 126, 0); } 100% { box-shadow: 0 0 0 0 rgba(43, 209, 126, 0); } }
.hero { max-width: var(--max); margin: 0 auto; padding: 28px 0 0; }
.hero h1 { margin: 0; font-size: clamp(26px, 4vw, 38px); line-height: 1.12; font-weight: 700; letter-spacing: -.01em; max-width: 22ch; }
.hero p { margin: 10px 0 0; color: #D5DEEC; font-size: 15px; max-width: 62ch; }

/* Page */
.page { max-width: calc(var(--max) + 32px); margin: -40px auto 0; padding: 0 16px 48px; position: relative; }
h2 { font-size: 18px; font-weight: 500; margin: 0 0 12px; }
.note { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 75ch; }
.empty { background: var(--card); border-radius: var(--radius-l); padding: 24px; color: var(--muted); text-align: center; box-shadow: var(--shadow); }
.alert { background: #FFF4E5; color: #7A4A00; border-radius: var(--radius-s); padding: 12px 16px; margin: 0 0 16px; }
.loading { background: var(--card); border-radius: var(--radius-l); padding: 24px; box-shadow: var(--shadow); color: var(--muted); }
.loading i { display: block; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--blue) 0 35%, var(--rule) 35%); background-size: 200% 100%; animation: load 1.2s infinite linear; margin-bottom: 12px; }
@keyframes load { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Country board: coloured summary tiles, as in the app */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.board-tile { font: inherit; color: #fff; text-align: left; background: var(--tile, var(--blue)); border: 0; border-radius: var(--radius-l); padding: 14px 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 2px 6px rgba(19, 33, 58, .12); }
.board-tile:hover { filter: brightness(1.05); }
.board-tile[aria-pressed="true"] { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--tile, var(--blue)); }
.bt-name { font-weight: 700; font-size: 15px; }
.bt-row { display: flex; flex-direction: column; font-size: 11px; color: rgba(255, 255, 255, .82); }
.bt-row b { color: #fff; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Controls: outlined chips, selected chip filled blue with a tick */
.controls { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 20px; }
.page > .controls:first-child { background: var(--card); padding: 12px; border-radius: var(--radius-l); box-shadow: var(--shadow); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { font: 500 13px/1 var(--font); color: var(--text); background: var(--card); border: 1px solid var(--outline); padding: 8px 14px; border-radius: var(--radius-s); cursor: pointer; }
.seg button:hover { background: #EEF3FB; }
.seg button[aria-pressed="true"] { background: var(--blue); border-color: var(--blue); color: #fff; }
.seg button[aria-pressed="true"]::before { content: "✓ "; }

/* Measure cards: compact, coloured icon and figure */
.group { margin: 0 0 26px; }
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.more { font-weight: 500; font-size: 14px; text-decoration: none; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.kpi { --tone: var(--blue); display: flex; flex-direction: column; gap: 4px; background: var(--card); border-radius: var(--radius-l); padding: 14px 16px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; border: 1px solid transparent; }
.kpi:hover { border-color: var(--rule); box-shadow: 0 4px 14px rgba(19, 33, 58, .08); }
.kpi-icon { width: 22px; height: 22px; margin-bottom: 4px; }
.kpi-name { font-size: 13px; font-weight: 500; color: var(--text); }
.fig { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; color: var(--tone); }
.fig small { width: 100%; font-size: 12px; color: var(--muted); }
.fig b { font-size: 26px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; }
.fig em { font-style: normal; font-size: 13px; color: var(--muted); }
.fig-text { font-size: 14px; font-weight: 500; color: var(--tone); min-height: 29px; }
.kpi-line { font-size: 11px; color: var(--muted); display: flex; align-items: baseline; gap: 6px; }
.dot { width: 6px; height: 6px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.dot.ok { background: var(--tone); }

/* News */
.stories { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.story { display: grid; gap: 4px; padding: 14px 16px; color: var(--text); text-decoration: none; background: var(--card); border-radius: var(--radius-l); box-shadow: var(--shadow); border-left: 4px solid var(--blue); }
.stories li:nth-child(4n+1) .story { border-left-color: var(--red); }
.stories li:nth-child(4n+2) .story { border-left-color: var(--orange); }
.stories li:nth-child(4n+4) .story { border-left-color: var(--purple); }
.story:hover .story-title { color: var(--blue); }
.story-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--blue); }
.story-meta time { color: var(--muted); }
.story-meta time::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: currentColor; margin: 0 8px 3px 0; }
.story-title { font-size: 15px; font-weight: 500; line-height: 1.35; max-width: 75ch; }
.story-sum { font-size: 13px; color: var(--muted); max-width: 80ch; }
.compact .story-sum { display: none; }

/* Evidence */
.back { display: inline-block; margin: 0 0 14px; font-weight: 500; text-decoration: none; }
.back::before { content: "‹ "; }
.detail-total { background: var(--navy); color: #fff; border-radius: var(--radius-l); padding: 18px 20px; margin-bottom: 14px; }
.detail-total .fig { color: #fff; }
.detail-total .fig small, .detail-total .fig em, .detail-total p { color: #C9D6EA; }
.detail-total p { margin: 6px 0 0; font-size: 13px; }
.evidence { background: var(--card); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.evidence > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.evidence h3 { margin: 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.where { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.badge { font-size: 11px; font-weight: 500; padding: 3px 10px; border-radius: 20px; background: #EEF1F5; color: var(--muted); white-space: nowrap; }
.badge.official { background: #E3F6EC; color: #137A45; }
.badge.corroborated { background: #E4EFFF; color: #0F5FCC; }
.badge.conflicting { background: #FDE8EC; color: #B0213F; }
blockquote { margin: 8px 0 0; padding: 0 0 0 12px; border-left: 3px solid var(--rule); }
blockquote p { margin: 0; font-size: 14px; }
blockquote footer { margin-top: 4px; font-size: 12px; color: var(--muted); }
blockquote a { font-weight: 500; margin-left: 6px; }

/* Charts */
.chart { background: var(--card); border-radius: var(--radius-l); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.chart ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.chart li { display: grid; grid-template-columns: 1fr auto; gap: 5px 12px; font-size: 13px; }
.c-name { font-weight: 500; }
.c-val { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.c-track { grid-column: 1 / -1; height: 8px; background: #EAF0F8; border-radius: 4px; overflow: hidden; }
.c-track i { display: block; height: 100%; background: var(--blue); border-radius: 4px; }
.chart li:nth-child(2) .c-track i { background: var(--orange); }
.chart li:nth-child(3) .c-track i { background: var(--purple); }
.chart li:nth-child(n+4) .c-track i { background: var(--red); }

/* Footer and mobile tab bar */
.foot { max-width: var(--max); margin: 0 auto; padding: 22px 0 40px; color: var(--muted); font-size: 12px; border-top: 1px solid var(--rule); }
.foot p { margin: 0 0 6px; max-width: 75ch; }
.tabbar { display: none; }

@media (max-width: 860px) {
  .nav { display: none; }
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { padding-bottom: 56px; }
  .hero { padding-top: 16px; }
  .hero p { font-size: 14px; }
  .tabbar { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: #EEF1F6; border-top: 1px solid var(--rule); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 4px 0; }
  .tabbar a svg { width: 22px; height: 22px; padding: 2px 16px; box-sizing: content-box; border-radius: 16px; }
  .tabbar a[aria-current="page"] { color: var(--text); }
  .tabbar a[aria-current="page"] svg { background: #DCE5F6; }
  .foot { padding: 22px 16px 96px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 12px; }
  .fig b { font-size: 22px; }
  .kpi-big { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
