/* ── Reset & tokens ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:         #0f1117;
  --surface:    #1a1d27;
  --surface2:   #22263a;
  --border:     #2e3347;
  --accent:     #4f8ef7;
  --accent2:    #7c3aed;
  --text:       #e2e8f0;
  --text-muted: #94a3b8;
  --red:        #ef4444;
  --orange:     #f97316;
  --yellow:     #eab308;
  --green:      #22c55e;
  --radius:     10px;
  --shadow:     0 4px 24px rgba(0,0,0,.45);
  --font:       'Inter', 'Segoe UI', system-ui, sans-serif;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font); line-height: 1.65; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ── Layout ─────────────────────────────────────────────────────── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1.5rem; }

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; gap: 1rem;
}
.logo { font-size: 1.25rem; font-weight: 700; color: var(--text); white-space: nowrap; }

/* Nav — collapses on mobile via toggle button */
.nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 6px; padding: .3rem .7rem; cursor: pointer; font-size: 1.1rem; }
.main-nav { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; }
.main-nav a { padding: 0.35rem 0.45rem; border-radius: 6px; font-size: 0.875rem; color: var(--text-muted); transition: background .15s, color .15s; }
.main-nav a:hover, .main-nav a.active { background: var(--surface2); color: var(--text); text-decoration: none; }
.nav-alert { color: var(--red) !important; font-weight: 600; padding: 0.35rem 0.7rem !important; }
.nav-alert:hover { background: rgba(239,68,68,.1) !important; }
.nav-divider { width: 1px; height: 1.2rem; background: var(--border); margin: 0 .25rem; }
.nav-region { font-size: 1.15rem !important; padding: 0.2rem 0.3rem !important; }
.flag { font-size: 1.15rem; }

/* ── Breaking banner ────────────────────────────────────────────── */
.breaking-banner {
  background: linear-gradient(90deg, var(--red), #b91c1c);
  color: #fff; display: flex; align-items: center; gap: 1rem;
  padding: 0.5rem 1.5rem; overflow: hidden;
}
.banner-label { font-weight: 800; font-size: 0.8rem; letter-spacing: .1em; white-space: nowrap; }
.ticker-wrap { overflow: hidden; flex: 1; }
.ticker { display: flex; gap: 2rem; animation: ticker 40s linear infinite; width: max-content; }
.ticker-item a { color: #fff; font-size: 0.875rem; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ── Hero ───────────────────────────────────────────────────────── */
.page-hero { padding: 3rem 0 2rem; text-align: center; }
.page-hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin-bottom: .5rem; }
.hero-date { color: var(--text-muted); font-size: .95rem; margin-bottom: 1rem; }
.date-selector { margin: .5rem auto 1rem; }
.date-select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: .9rem;
  padding: .35rem .9rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.date-select:hover { border-color: var(--accent); }
.date-select:focus { outline: none; border-color: var(--accent); }
.hero-sub { color: var(--text-muted); }
.breaking-hero { background: radial-gradient(ellipse at top, rgba(239,68,68,.15), transparent 60%); }

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: .6rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .9rem; cursor: pointer; transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn-alert { background: var(--red); color: #fff; }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); margin-top: 1.5rem; }

/* ── Section ────────────────────────────────────────────────────── */
.section { padding: 2rem 0; }
.section-title { font-size: 1.4rem; font-weight: 700; margin-bottom: 1.5rem; border-left: 4px solid var(--accent); padding-left: .75rem; }

/* ── Region grid ────────────────────────────────────────────────── */
.region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.region-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.region-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card-link { display: block; padding: 1.25rem; color: inherit; }
.card-link:hover { text-decoration: none; }
.card-header { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.card-flag { font-size: 2rem; }
.card-label { font-size: 1.1rem; font-weight: 700; }
.card-overview { color: var(--text-muted); font-size: .875rem; margin-bottom: 1rem; line-height: 1.5; }
.card-headlines { list-style: none; margin-bottom: 1rem; display: flex; flex-direction: column; gap: .4rem; }
.card-headlines li { font-size: .8rem; color: var(--text-muted); }
.card-cta { font-size: .8rem; font-weight: 600; color: var(--accent); }

/* ── Category badges ────────────────────────────────────────────── */
.cat-badge {
  display: inline-block; padding: .15rem .55rem; border-radius: 4px;
  font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; margin-right: .4rem;
}
/* Legacy categories (old data) */
.cat-politics    { background: rgba(79,142,247,.2);  color: #93c5fd; }
.cat-economy     { background: rgba(234,179,8,.2);   color: #fde68a; }
.cat-technology  { background: rgba(124,58,237,.2);  color: #c4b5fd; }
.cat-environment { background: rgba(34,197,94,.2);   color: #86efac; }
.cat-health      { background: rgba(249,115,22,.2);  color: #fed7aa; }
.cat-culture     { background: rgba(236,72,153,.2);  color: #f9a8d4; }
.cat-sports      { background: rgba(6,182,212,.2);   color: #a5f3fc; }
.cat-other       { background: rgba(148,163,184,.2); color: #cbd5e1; }
/* New 20-topic categories */
.cat-world_news              { background: rgba(6,182,212,.2);   color: #67e8f9; }
.cat-business_economy        { background: rgba(234,179,8,.2);   color: #fde68a; }
.cat-science_environment     { background: rgba(34,197,94,.2);   color: #86efac; }
.cat-crime_safety            { background: rgba(239,68,68,.2);   color: #fca5a5; }
.cat-entertainment_culture   { background: rgba(236,72,153,.2);  color: #f9a8d4; }
.cat-lifestyle               { background: rgba(20,184,166,.2);  color: #5eead4; }
.cat-artificial_intelligence { background: rgba(139,92,246,.2);  color: #c4b5fd; }
.cat-wall_street             { background: rgba(245,158,11,.2);  color: #fcd34d; }
.cat-silicon_valley          { background: rgba(99,102,241,.2);  color: #a5b4fc; }
.cat-social_networks         { background: rgba(244,63,94,.2);   color: #fda4af; }
.cat-global_warming          { background: rgba(132,204,22,.2);  color: #bef264; }
.cat-cost_of_living          { background: rgba(251,146,60,.2);  color: #fdba74; }
.cat-employment              { background: rgba(100,116,139,.2); color: #cbd5e1; }
.cat-gender_equity           { background: rgba(217,70,239,.2);  color: #e879f9; }
.cat-pets_animals            { background: rgba(52,211,153,.2);  color: #6ee7b7; }
.cat-music_movies            { background: rgba(168,85,247,.2);  color: #d8b4fe; }

/* ── Topic highlights grid ──────────────────────────────────────── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}
.topic-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  min-height: 105px;
  transition: border-color .2s;
}
.topic-card:hover { border-color: var(--accent); }
.topic-card--empty { opacity: .45; }
.topic-header {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
}
.topic-headline {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.topic-headline:hover { color: var(--accent); text-decoration: none; }
.topic-meta {
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-top: auto;
  font-size: .74rem;
}
.topic-source { color: var(--text-muted); }
.topic-missing { font-size: .8rem; color: var(--text-muted); font-style: italic; }

/* ── Tabs ─────────────────────────────────────────────────────── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 1.75rem;
  overflow-x: auto;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  padding: .65rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-pane       { display: none; }
.tab-pane.active{ display: block; }

/* ── World map ────────────────────────────────────────────────── */
.map-wrap { position: relative; border-radius: var(--radius); overflow: visible; background: #07122b; }
.map-ocean     { fill: #07122b; }
.map-country   { fill: #243554; stroke: none; transition: fill .15s; }
.map-country--covered { fill: #4f8ef7; cursor: pointer; }
.map-country--covered:hover,
.map-country--hovered { fill: #7ab3ff !important; }
.map-borders   { fill: none; stroke: rgba(255,255,255,.18); stroke-width: .5px; pointer-events: none; }
.map-legend    { font-size: .75rem; color: var(--text-muted); margin-top: .6rem; text-align: center; }
.map-legend .leg-cov   { color: #4f8ef7; }
.map-legend .leg-uncov { color: #243554; }

/* map popup — fixed so it is never clipped by overflow */
#map-popup {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  width: 295px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.65);
  opacity: 0;
  transition: opacity .1s;
}
#map-popup.mp--visible { opacity: 1; }
.mp-header  { font-weight: 700; font-size: .95rem; margin-bottom: .5rem; }
.mp-stories { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.mp-stories li { display: flex; flex-direction: column; gap: .1rem; }
.mp-stories a  { font-size: .8rem; line-height: 1.35; color: var(--text); }
.mp-stories a:hover { color: var(--accent); text-decoration: none; }
.mp-source  { font-size: .7rem; color: var(--text-muted); }
.mp-empty   { font-size: .82rem; color: var(--text-muted); font-style: italic; margin-top: .25rem; }
.mp-link    { display: inline-block; margin-top: .5rem; font-size: .8rem; font-weight: 600; color: var(--accent); }

/* ── Breaking news ranking tab ────────────────────────────────── */
.rank-list { display: flex; flex-direction: column; gap: 1rem; }
.rank-card {
  display: flex; gap: 1.25rem; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius);
  border-left: 4px solid var(--border); padding: 1.2rem 1.4rem;
}
.rank-card.severity-critical { border-left-color: var(--red); }
.rank-card.severity-high     { border-left-color: var(--orange); }
.rank-card.severity-moderate { border-left-color: var(--yellow); }
.rank-num {
  font-size: 1.6rem; font-weight: 800; line-height: 1;
  color: var(--text-muted); min-width: 2rem; text-align: center; padding-top: .1rem;
}
.rank-body { flex: 1; display: flex; flex-direction: column; gap: .4rem; }
.rank-header { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.rank-cat    { font-size: .75rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }
.rank-title  { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.rank-summary{ font-size: .875rem; color: var(--text-muted); line-height: 1.6; }
.rank-sources{ display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }

/* ── Breaking news cards (home) ─────────────────────────────────── */
.breaking-list { display: flex; flex-direction: column; gap: 1rem; }
.breaking-card {
  background: var(--surface); border-radius: var(--radius);
  border-left: 4px solid var(--border); padding: 1.25rem;
}
.breaking-card.severity-critical { border-left-color: var(--red); }
.breaking-card.severity-high     { border-left-color: var(--orange); }
.breaking-card.severity-moderate { border-left-color: var(--yellow); }
.breaking-card-header { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.breaking-icon { font-size: 1.3rem; }
.breaking-cat-label { font-size: .8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; flex: 1; }
.severity-badge {
  padding: .2rem .6rem; border-radius: 4px; font-size: .7rem; font-weight: 700;
  background: rgba(239,68,68,.15); color: var(--red);
}
.severity-badge-large {
  padding: .25rem .75rem; border-radius: 6px; font-size: .8rem; font-weight: 700;
}
.severity-critical .severity-badge-large { background: rgba(239,68,68,.2); color: var(--red); }
.severity-high     .severity-badge-large { background: rgba(249,115,22,.2); color: var(--orange); }
.severity-moderate .severity-badge-large { background: rgba(234,179,8,.2);  color: var(--yellow); }
.breaking-title { font-size: 1.1rem; font-weight: 700; margin-bottom: .5rem; }
.breaking-summary { font-size: .9rem; color: var(--text-muted); margin-bottom: .75rem; }
.breaking-sources { display: flex; flex-wrap: wrap; gap: .4rem; }
.source-chip {
  padding: .2rem .6rem; border-radius: 20px; font-size: .75rem;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted);
}
.source-chip:hover { color: var(--accent); text-decoration: none; }

/* ── Region page ────────────────────────────────────────────────── */
.region-hero {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 2.5rem 0 1.5rem;
}
.region-hero-flag { font-size: 4rem; }
.region-hero h1  { font-size: 2rem; font-weight: 800; }
.overview-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem; margin-bottom: 2rem;
}
.overview-box h2 { font-size: 1rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .75rem; }
.overview-box p  { color: var(--text); line-height: 1.7; }

.filter-bar { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-btn {
  padding: .4rem 1rem; border-radius: 20px; border: 1.5px solid var(--border);
  background: transparent; color: var(--text-muted); cursor: pointer; font-size: .85rem;
  transition: all .15s;
}
.filter-btn:hover, .filter-btn.active {
  background: var(--accent); border-color: var(--accent); color: #fff;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.story-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
  display: flex; flex-direction: column; gap: .6rem;
  transition: opacity .2s;
}
.story-card.hidden { display: none; }
.story-meta { display: flex; align-items: center; gap: .5rem; }
.story-source { font-size: .75rem; color: var(--text-muted); }
.story-headline { font-size: 1rem; font-weight: 700; line-height: 1.4; }
.story-summary  { font-size: .875rem; color: var(--text-muted); flex: 1; }
.story-link { font-size: .8rem; font-weight: 600; color: var(--accent); margin-top: auto; }

.region-switcher {
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: .75rem;
}
.switcher-group { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.switcher-label { font-size: .75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; min-width: 6rem; }
.region-pill {
  padding: .25rem .65rem; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; font-size: .78rem; color: var(--text-muted);
}
.region-pill:hover { color: var(--text); text-decoration: none; border-color: var(--accent); }

/* ── Breaking page ──────────────────────────────────────────────── */
.breaking-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  align-items: start;
  padding-bottom: 4rem;
}
@media (max-width: 768px) { .breaking-layout { grid-template-columns: 1fr; } }

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.visible { display: block; }

/* Sidebar edge-tab handle (mobile only) */
.sidebar-tab {
  display: none;
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  background: var(--surface);
  border: 1px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: .65rem .45rem;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  color: var(--text-muted);
  font-size: .65rem;
  font-weight: 600;
  box-shadow: -2px 0 10px rgba(0,0,0,.4);
  transition: color .15s;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab .tab-icon { font-size: 1.05rem; }

@media (max-width: 768px) {
  .sidebar-tab { display: flex; }
  .breaking-sidebar {
    position: fixed;
    top: 5rem;
    right: 0;
    width: 240px;
    max-height: calc(100vh - 5.5rem);
    overflow-y: auto;
    padding: 1.25rem;
    border-width: 1px;
    border-radius: var(--radius) 0 0 var(--radius);
    z-index: 200;
    transform: translateX(calc(100% + 1px));
    transition: transform .3s ease;
  }
  .breaking-sidebar.open {
    transform: translateX(0);
  }
}

.breaking-sidebar {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem;
}
@media (min-width: 769px) {
  .breaking-sidebar { position: sticky; top: 5rem; }
}
.breaking-sidebar h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 1rem; }
.cat-nav { list-style: none; display: flex; flex-direction: column; gap: .25rem; }
.cat-nav-link {
  display: flex; justify-content: space-between; align-items: center;
  padding: .5rem .75rem; border-radius: 6px; font-size: .875rem;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.cat-nav-link:hover, .cat-nav-link.active { background: var(--surface2); color: var(--text); text-decoration: none; }
.count {
  background: var(--surface2); border-radius: 10px;
  padding: .1rem .5rem; font-size: .75rem; min-width: 1.5rem; text-align: center;
}
.sidebar-note { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.sidebar-note strong { display: block; font-size: .8rem; margin-bottom: .4rem; }
.sidebar-note p { font-size: .75rem; color: var(--text-muted); line-height: 1.5; }

.breaking-feed { display: flex; flex-direction: column; gap: 2rem; }
.cat-section { }
.cat-section-title {
  font-size: 1.2rem; font-weight: 700;
  border-left: 4px solid var(--border); padding-left: .75rem;
  margin-bottom: 1rem; display: flex; align-items: center; gap: .5rem;
}

.breaking-detail-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem;
  position: relative;
}
.detail-header {
  padding: 1rem 1.5rem; display: flex; align-items: flex-start; gap: 1rem;
  border-bottom: 1px solid var(--border);
}
.severity-critical .detail-header { background: rgba(239,68,68,.08); }
.severity-high     .detail-header { background: rgba(249,115,22,.08); }
.severity-moderate .detail-header { background: rgba(234,179,8,.08); }
.detail-header h3 { font-size: 1.15rem; font-weight: 700; flex: 1; }
.detail-body { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
@media (max-width: 640px) { .detail-body { grid-template-columns: 1fr; } }
.detail-summary-col { padding: 1.25rem 1.5rem; border-right: 1px solid var(--border); }
.detail-sources-col { padding: 1.25rem 1.5rem; }
.detail-summary-col h4, .detail-sources-col h4 {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin-bottom: .6rem;
}
.detail-summary-col p { font-size: .9rem; line-height: 1.65; margin-bottom: 1rem; }
.analysis-text { color: var(--text-muted) !important; font-style: italic; }
.source-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.source-list li { font-size: .875rem; }
.source-angle { color: var(--text-muted); font-size: .8rem; }

/* ── Verification links ─────────────────────────────────────────── */
.btn-verify {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .4rem .9rem; border-radius: 6px; font-size: .8rem; font-weight: 600;
  background: rgba(79,142,247,.12); border: 1px solid rgba(79,142,247,.35);
  color: var(--accent); transition: background .15s, border-color .15s;
  margin-top: auto;
}
.btn-verify:hover { background: rgba(79,142,247,.22); border-color: var(--accent); text-decoration: none; }

.verify-link { font-weight: 600; color: var(--accent); }
.verify-link:hover { text-decoration: underline; }

.headline-link { color: var(--text); }
.headline-link:hover { color: var(--accent); text-decoration: underline; }

.story-source-link { font-size: .75rem; color: var(--text-muted); text-decoration: underline dotted; }
.story-source-link:hover { color: var(--accent); }

.sources-label { font-size: .75rem; color: var(--text-muted); }

.empty-state { color: var(--text-muted); padding: 2rem 0; }
.empty-state-full { text-align: center; padding: 5rem 2rem; color: var(--text-muted); font-size: 1.1rem; }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 2rem 0; margin-top: 4rem; text-align: center;
}
.site-footer p { color: var(--text-muted); font-size: .85rem; }
.small { font-size: .75rem; margin-top: .4rem; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .main-nav { display: none; width: 100%; padding: .5rem 0; }
  .main-nav.open { display: flex; }
  .header-inner { flex-wrap: wrap; }
}
@media (max-width: 640px) {
  .region-grid { grid-template-columns: 1fr; }
  .stories-grid { grid-template-columns: 1fr; }
  .region-hero { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .region-hero-flag { font-size: 2.5rem; }
  .switcher-label { min-width: 5rem; }
}
.main-content { padding-top: 1.5rem; padding-bottom: 4rem; }

/* ── Last pipeline run timestamp in footer ───────────────────────── */
.last-run { color: var(--text-muted); margin-top: .3rem; }
.last-run strong { color: var(--accent); }

/* ── Favorites button ────────────────────────────────────────────── */
.fav-btn {
  background: none; border: none; cursor: pointer;
  font-size: .95rem; color: var(--text-muted); padding: .1rem .2rem;
  line-height: 1; flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.fav-btn:hover  { color: var(--yellow); transform: scale(1.25); }
.fav-btn.faved  { color: var(--yellow); }

.story-card { position: relative; }
.fav-btn--card {
  position: absolute; top: .7rem; right: .8rem;
  font-size: 1.15rem; z-index: 1;
}

.card-headlines li {
  display: flex; align-items: center; gap: .3rem; flex-wrap: nowrap;
}
.card-headlines .headline-link { flex: 1; min-width: 0; }

/* ── Favorites tab ───────────────────────────────────────────────── */
.fav-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: .5rem;
}
.fav-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.fav-group-title {
  font-size: .95rem; font-weight: 700; margin-bottom: .8rem;
  padding-bottom: .5rem; border-bottom: 1px solid var(--border);
}
.fav-list { list-style: none; display: flex; flex-direction: column; gap: .7rem; }
.fav-item { display: flex; align-items: flex-start; gap: .4rem; }
.fav-item-main { flex: 1; display: flex; flex-direction: column; gap: .1rem; }
.fav-headline { font-size: .875rem; font-weight: 600; color: var(--text); line-height: 1.35; }
a.fav-headline:hover { color: var(--accent); text-decoration: underline; }
.fav-source { font-size: .72rem; color: var(--text-muted); }
.fav-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: .7rem; padding: .15rem .3rem;
  border-radius: 4px; flex-shrink: 0;
  transition: color .15s, background .15s;
}
.fav-remove:hover { color: var(--red); background: rgba(239,68,68,.1); }
.fav-empty { text-align: center; padding: 4rem 1rem; color: var(--text-muted); font-size: .95rem; }

/* ── Social Pulse tab ───────────────────────────────────────────── */
.sp-lead { color: var(--text-muted); max-width: 900px; }
.sp-updated { color: var(--text-muted); font-size: .8rem; margin-top: .35rem; }
.sp-h3 { font-size: 1.05rem; margin-bottom: .9rem; }
.sp-search-form { display: flex; gap: .5rem; max-width: 820px; }
.sp-search-form input { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); padding: .7rem .9rem; font: inherit; }
.sp-search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.sp-search-form button { background: var(--accent); color: #fff; border: 0; border-radius: var(--radius); padding: .7rem 1.2rem; font-weight: 700; cursor: pointer; }
.sp-search-form button:disabled { opacity: .6; cursor: wait; }
.sp-hint { color: var(--text-muted); font-size: .78rem; margin-top: .4rem; }
.sp-answer { margin-top: 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 1rem 1.1rem; max-width: 820px; }
.sp-answer p { margin-bottom: .6rem; }
.sp-answer ol { padding-left: 1.2rem; font-size: .85rem; color: var(--text-muted); }
.sp-answer .sp-error { color: var(--orange); }
.sp-briefings { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 1rem; }
.sp-brief { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.sp-brief header { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .5rem; }
.sp-brief p { font-size: .88rem; color: var(--text-muted); line-height: 1.55; }
.sp-topic { font-weight: 700; text-transform: capitalize; }
.sp-count { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.sp-mood { display: flex; height: 5px; border-radius: 3px; overflow: hidden; margin-top: .8rem; background: var(--surface2); }
.sp-mood .pos { background: var(--green); } .sp-mood .neu { background: #64748b; } .sp-mood .neg { background: var(--red); }
.sp-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.sp-chip { background: var(--surface); border: 1px solid var(--border); color: var(--text-muted); border-radius: 999px; padding: .3rem .8rem; font-size: .8rem; cursor: pointer; text-transform: capitalize; }
.sp-chip.active, .sp-chip:hover { color: var(--text); border-color: var(--accent); }
.sp-posts { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.sp-post { display: flex; gap: .75rem; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .7rem .9rem; }
.sp-post.hidden { display: none; }
.sp-post-main { flex: 1; min-width: 0; }
.sp-post-title { color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.sp-meta { display: flex; flex-wrap: wrap; gap: .35rem .7rem; font-size: .74rem; color: var(--text-muted); margin-top: .3rem; }
.sp-platform { font-weight: 700; }
.sp-hackernews { color: #ff6600; } .sp-lobsters { color: #ac130d; } .sp-devto { color: #c4b5fd; }
.sp-lemmy { color: #22c55e; } .sp-arxiv { color: #f87171; } .sp-federal_register { color: #60a5fa; }
.sp-tag { text-transform: capitalize; }
.sp-sent.sp-positive { color: var(--green); } .sp-sent.sp-negative { color: var(--red); }
@media (max-width: 600px) { .sp-search-form { flex-direction: column; } }

/* ── AI News tab (folded in from the former AI News Hub) ───────────────────── */
.ai-intro { color: var(--text-muted); font-size: .9rem; line-height: 1.55; max-width: 60rem; margin: .25rem 0 1rem; }
.ai-weekly {
  font-size: .8rem; color: var(--text); line-height: 1.55;
  margin-bottom: .9rem; padding-top: .7rem; border-top: 1px solid var(--border);
}
.ai-weekly strong { color: var(--text-muted); font-weight: 700; text-transform: uppercase; font-size: .68rem; letter-spacing: .05em; display: block; margin-bottom: .3rem; }
.ai-papers-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.ai-papers-header .section-title { margin-bottom: 0; }
.ai-papers-header .date-selector { margin: 0; }
.ai-authors { font-size: .78rem; color: var(--text-muted); font-style: italic; }
@media (max-width: 640px) { .ai-papers-header { flex-direction: column; align-items: flex-start; } }
