/* ══════════════════════════════════════════════════════════
   newsleys — News Intelligence Platform
   ══════════════════════════════════════════════════════════ */

/* ── Reset & Tokens ────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg-0: #07080c;
  --bg-1: #0d0f15;
  --bg-2: #13151e;
  --bg-3: #1a1d29;
  --bg-4: #222536;
  --bg-glass: rgba(255,255,255,0.025);
  --bg-glass-hover: rgba(255,255,255,0.05);
  --border: rgba(255,255,255,0.1);
  --border-1: rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.1);
  --border-3: rgba(255,255,255,0.16);
  --text-1: #eaeaf0;
  --text-2: #a0a0b4;
  --text-3: #686880;
  --text-4: #44445a;
  --accent: #818cf8;
  --accent-dim: rgba(129,140,248,0.12);
  --accent-bright: #a5b4fc;
  --red: #f87171;
  --red-dim: rgba(248,113,113,0.12);
  --orange: #fb923c;
  --orange-dim: rgba(251,146,60,0.12);
  --yellow: #facc15;
  --yellow-dim: rgba(250,204,21,0.12);
  --green: #4ade80;
  --green-dim: rgba(74,222,128,0.12);
  --blue: #60a5fa;
  --cyan: #22d3ee;

  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;

  --r-xs: 4px; --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 20px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur: 220ms;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5);
  --shadow-glow: 0 0 24px rgba(129,140,248,0.08);

  --sidebar-w: 260px;
}

html { font-size: 15px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg-0);
  color: var(--text-1);
  min-height: 100%;
  height: 100%;
  overflow: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: var(--font-sans); }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Layout ────────────────────────────────────────────── */
#app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  height: 100vh;
  height: 100dvh;
}

/* ══ SIDEBAR ═══════════════════════════════════════════════ */
#sidebar {
  background: var(--bg-1);
  border-right: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s var(--ease);
}

.sidebar-header {
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--border-1);
}
.logo {
  display: flex;
  align-items: center;
  gap: 11px;
}
.logo svg { flex-shrink: 0; }
.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-1);
  font-family: 'DM Sans', var(--font-sans);
  line-height: 1.1;
}
.logo-sub {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #dc2626;
  margin-top: 3px;
  font-weight: 700;
  font-family: 'DM Sans', var(--font-sans);
}

.sidebar-nav {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: left;
  width: 100%;
  position: relative;
}
.nav-item svg { opacity: 0.6; transition: opacity var(--dur); flex-shrink: 0; }
.nav-item:hover { background: var(--bg-glass-hover); color: var(--text-2); }
.nav-item:hover svg { opacity: 0.8; }
.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
}
.nav-item.active svg { opacity: 1; }
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}

.badge {
  margin-left: auto;
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  display: none;
  line-height: 1.5;
}
.badge.visible { display: inline; }

.sidebar-divider {
  height: 1px;
  background: var(--border-1);
  margin: 6px 16px;
}

.sidebar-sections {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.sidebar-section {
  border-bottom: 1px solid var(--border-1);
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sidebar-section:not(.collapsed) {
  flex: 1 1 0;
}
.sidebar-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-4);
  padding: 10px 20px 6px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--dur);
  flex-shrink: 0;
}
.sidebar-section-title:hover { color: var(--text-2); }
.section-chevron {
  opacity: 0.5;
  transition: transform 0.2s var(--ease), opacity 0.2s;
  flex-shrink: 0;
}
.sidebar-section-title:hover .section-chevron { opacity: 0.8; }
.sidebar-section.collapsed .section-chevron { transform: rotate(-90deg); }
.sidebar-section-body {
  overflow-y: auto;
  transition: max-height 0.25s var(--ease), opacity 0.2s;
  min-height: 0;
}
.sidebar-section.collapsed .sidebar-section-body {
  max-height: 0 !important;
  overflow: hidden;
  opacity: 0;
  padding: 0 8px;
}

.sidebar-topics { padding: 0 8px 8px; overflow-y: auto; }
.sidebar-reading-lists { padding: 0 8px 8px; overflow-y: auto; }
.content-loading { display: flex; align-items: center; gap: 8px; padding: 20px; color: var(--text-3); font-size: 0.85rem; }
.topic-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 7px 14px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.topic-btn:hover { background: var(--bg-glass-hover); color: var(--text-2); }
.topic-btn.active { color: var(--accent); background: var(--accent-dim); }
.topic-icon { font-size: 0.95rem; width: 22px; text-align: center; }

.sidebar-footer {
  padding: 14px 12px;
  border-top: 1px solid var(--border-1);
  margin-top: auto;
}
.refresh-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--border-2);
  background: var(--bg-glass);
  color: var(--text-3);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.refresh-btn.loading svg { animation: spin 0.8s linear infinite; }
.refresh-btn.loading { pointer-events: none; opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

.stats-mini {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-4);
  text-align: center;
  letter-spacing: 0.3px;
}

.admin-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  border: none;
  background: none;
  color: var(--text-4);
  font-size: 0.7rem;
  cursor: pointer;
  margin-top: 6px;
  border-radius: var(--r-sm);
  transition: color var(--dur);
}
.admin-btn:hover { color: var(--text-3); }

/* ══ MAIN ══════════════════════════════════════════════════ */
#main {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg-0);
}

/* ── Top Bar ───────────────────────────────────────────── */
#topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border-1);
  background: var(--bg-1);
  flex-shrink: 0;
}
.mobile-menu-btn {
  display: none;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 4px;
}
.search-container {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  color: var(--text-4);
  transition: border-color var(--dur);
  max-width: 520px;
}
.search-container:focus-within { border-color: var(--accent); }
.search-container svg { flex-shrink: 0; }
.search-container input {
  flex: 1;
  border: none;
  background: none;
  color: var(--text-1);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  outline: none;
}
.search-container input::placeholder { color: var(--text-4); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.topbar-right select {
  padding: 7px 10px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  cursor: pointer;
  outline: none;
}
.article-count {
  font-size: 0.78rem;
  color: var(--text-4);
  white-space: nowrap;
}

/* ── Content Area ──────────────────────────────────────── */
#content-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px 40px;
  scroll-behavior: smooth;
}
.view { display: none; }
.view.active { display: block; animation: viewIn 0.3s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.view-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  color: var(--text-1);
}

/* ══ ARTICLE GRID ══════════════════════════════════════════ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

/* ── Article Tile ──────────────────────────────────────── */
.article-tile {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  align-self: start;
}
.article-tile:hover {
  border-color: var(--border-2);
  background: var(--bg-3);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.article-tile.expanded {
  grid-column: 1 / -1;
  cursor: default;
  transform: none;
  border-color: var(--border-2);
  background: var(--bg-2);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: tileExpand 0.35s var(--ease);
}
@keyframes tileExpand {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

.tile-image-wrap {
  position: relative;
  overflow: hidden;
}
.tile-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}
.article-tile:hover .tile-image { transform: scale(1.03); }
.article-tile.expanded .tile-image { height: 320px; }

.tile-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-4) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  opacity: 0.3;
}
.article-tile.expanded .tile-image-placeholder { height: 140px; }

.tile-image-overlay {
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(0,0,0,0.5));
  pointer-events: none;
}

/* ── Tile Body ─────────────────────────────────────────── */
.tile-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tile-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-4);
  flex-wrap: wrap;
}
.tile-source {
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: -0.1px;
}
.tile-dot { opacity: 0.3; }
.tile-time { margin-left: auto; white-space: nowrap; }

/* Bias Pill */
.bias-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  line-height: 1.7;
}
.bias-fl { background: rgba(248,113,113,0.15); color: #fca5a5; }
.bias-l  { background: rgba(251,146,60,0.15); color: #fdba74; }
.bias-cl { background: rgba(250,204,21,0.12); color: #fde047; }
.bias-c  { background: rgba(74,222,128,0.12); color: #86efac; }
.bias-cr { background: rgba(250,204,21,0.12); color: #fde047; }
.bias-r  { background: rgba(251,146,60,0.15); color: #fdba74; }
.bias-fr { background: rgba(248,113,113,0.15); color: #fca5a5; }

.tile-title {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: -webkit-line-clamp 0.3s;
}
.article-tile.expanded .tile-title {
  -webkit-line-clamp: unset;
  font-size: 1.6rem;
  line-height: 1.3;
  margin-bottom: 4px;
}

.tile-summary {
  font-size: 0.84rem;
  color: var(--text-3);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-tile.expanded .tile-summary {
  -webkit-line-clamp: unset;
  color: var(--text-2);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border-1);
  gap: 8px;
}

.tile-topics {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  min-width: 0;
}
.topic-tag {
  padding: 2px 8px;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.67rem;
  font-weight: 600;
  white-space: nowrap;
  letter-spacing: 0.2px;
}

/* Fact Score Badge */
.fact-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px 2px 6px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.fact-badge svg { width: 13px; height: 13px; }
.fact-high { background: var(--green-dim); color: var(--green); }
.fact-mid  { background: var(--yellow-dim); color: var(--yellow); }
.fact-low  { background: var(--red-dim); color: var(--red); }
.fact-na   { background: var(--bg-3); color: var(--text-3); }
.fact-none { color: var(--text-4); font-weight: 500; font-size: 0.72rem; }
.fact-disc-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--orange);
  background: rgba(217, 119, 6, 0.12);
  white-space: nowrap;
  flex-shrink: 0;
}
.fact-disc-badge svg { stroke: var(--orange); }

/* ══ EXPANDED TILE CONTENT ═════════════════════════════════ */
.expanded-content {
  padding: 0 16px 20px;
  animation: expandIn 0.35s var(--ease);
}
@keyframes expandIn {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 4000px; }
}

.expanded-content .article-body {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-2);
  max-width: 720px;
  margin: 16px auto 0;
}
.expanded-content .article-body p { margin-bottom: 1em; }

.expand-meta-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-1);
  margin-bottom: 16px;
  font-size: 0.82rem;
  color: var(--text-3);
  flex-wrap: wrap;
}
.expand-meta-bar a { font-weight: 500; }

.collapse-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--border-2);
  background: var(--bg-glass);
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-left: auto;
}
.collapse-btn:hover { border-color: var(--accent); color: var(--accent); }

.open-full-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border: 1px solid var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.open-full-btn:hover { background: var(--accent); color: white; }

/* ── Bias Compass (inline in expanded) ─────────────────── */
.bias-compass-inline {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin: 16px 0;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.bias-compass-inline h4 {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 10px;
}
.bias-bar {
  position: relative;
  height: 6px;
  background: linear-gradient(to right, #f87171, #fb923c, #facc15, #4ade80, #facc15, #fb923c, #f87171);
  border-radius: 3px;
}
.bias-marker {
  position: absolute;
  top: -7px;
  width: 20px;
  height: 20px;
  background: white;
  border: 3px solid var(--bg-0);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(255,255,255,0.25);
  transition: left 0.4s var(--spring);
}
.bias-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--text-4);
  margin-top: 6px;
  letter-spacing: 0.2px;
}
.bias-owner {
  font-size: 0.78rem;
  color: var(--text-4);
  margin-top: 8px;
  font-style: italic;
}

/* ══ ARTICLE DETAIL (full view) ════════════════════════════ */
#article-detail {
  max-width: 780px;
  margin: 0 auto;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-4);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 6px 0;
  border: none;
  background: none;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: color var(--dur);
  margin-bottom: 16px;
}
.article-back:hover { color: var(--accent); }

.detail-header { margin-bottom: 28px; }
.detail-header .source-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.detail-header h1 {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.6px;
  margin-bottom: 14px;
}
.detail-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-4);
  font-size: 0.82rem;
  flex-wrap: wrap;
}
.detail-meta strong { color: var(--text-2); }

.detail-hero {
  width: 100%;
  max-width: 720px;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--r-lg);
  margin: 20px auto;
  display: block;
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
}

/* Summary box */
.article-summary-box-detail {
  max-width: 720px;
  margin: 0 auto 24px;
  padding: 20px 24px;
  border-radius: 12px;
  background: linear-gradient(var(--bg-2), var(--bg-2)) padding-box,
    linear-gradient(135deg, var(--accent), var(--green), var(--blue)) border-box;
  border: 2px solid transparent;
  position: relative;
}
.summary-box-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.summary-box-header span {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.summary-box-text {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-2);
}
.summary-box-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.summary-box-owner { font-size: 0.75rem; color: var(--text-4); }
.summary-box-score { font-size: 0.75rem; font-weight: 600; }

/* Read original button */
.detail-read-original {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
}
.detail-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 8px;
}

/* Content loading state */
.content-loading {
  text-align: center;
  padding: 24px 0;
  color: var(--text-4);
  font-size: 0.85rem;
}

.detail-body {
  max-width: 720px;
  margin: 20px auto;
  font-family: var(--font-serif);
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--text-2);
}
.detail-body p { margin-bottom: 1.2em; }
.detail-body img {
  max-width: 100%;
  border-radius: var(--r-md);
  margin: 16px 0;
}
.detail-body h2, .detail-body h3 {
  font-family: var(--font-sans);
  color: var(--text-1);
  margin: 1.5em 0 0.5em;
}
.detail-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 16px;
  margin: 16px 0;
  color: var(--text-3);
  font-style: italic;
}
.detail-body a { color: var(--accent); }

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 20px 0;
  flex-wrap: wrap;
}

/* ── Fact Check Section ────────────────────────────────── */
.fact-section {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 22px;
  margin: 28px 0;
}
.fact-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-1);
}

.score-display {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.score-big {
  font-size: 2.8rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
}
.score-max { font-size: 1.2rem; font-weight: 400; color: var(--text-4); }
.score-info { flex: 1; }
.score-bar-wrap {
  height: 6px;
  background: var(--bg-4);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}
.score-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s var(--ease);
}
.score-text { font-size: 0.8rem; color: var(--text-3); }

.spectrum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.spectrum-card {
  background: var(--bg-3);
  border-radius: var(--r-md);
  padding: 12px;
  border: 1px solid var(--border-1);
}
.spectrum-card h4 {
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.spectrum-item {
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 3px 0;
  border-bottom: 1px solid var(--border-1);
  line-height: 1.4;
}
.spectrum-item:last-child { border-bottom: none; }

.corrections-box {
  margin-top: 16px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.corrections-box h4 {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
}
.correction-item {
  padding: 10px 14px;
  background: var(--red-dim);
  border-left: 3px solid var(--red);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  margin-bottom: 6px;
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.45;
}
.correction-src { font-weight: 700; color: var(--text-1); font-size: 0.78rem; margin-bottom: 2px; }

.citations-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-1);
}
.citations-box h4 {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}
.citation-row {
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 2px 0;
  line-height: 1.45;
}
.citation-num { color: var(--text-4); font-weight: 600; }

/* ── Entity Chips ──────────────────────────────────────── */
.entity-section {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 20px 0;
}
.entity-section h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.entity-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--text-2);
  margin: 2px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.entity-chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.entity-type {
  font-size: 0.6rem;
  text-transform: uppercase;
  color: var(--text-4);
  letter-spacing: 0.5px;
}

/* ══ SOURCES BROWSER ═══════════════════════════════════════ */
.source-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.source-filters select {
  padding: 7px 12px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  outline: none;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
}
.source-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
}
.source-card:hover { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.source-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}
.source-card h4 { font-size: 0.92rem; font-weight: 600; }
.source-country-tag {
  font-size: 0.68rem;
  color: var(--text-4);
  padding: 2px 8px;
  background: var(--bg-4);
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 500;
}
.source-card .source-meta-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-3);
  margin-bottom: 4px;
}
.source-owner-line {
  font-size: 0.75rem;
  color: var(--text-4);
  font-style: italic;
  margin-top: 2px;
}
.source-stats-line {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-4);
  font-weight: 500;
}

/* ══ CATEGORIES ════════════════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.category-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  text-align: center;
}
.category-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}
.category-icon { font-size: 2.2rem; margin-bottom: 10px; display: block; }
.category-card h3 { font-size: 1.05rem; font-weight: 600; margin-bottom: 4px; }
.category-count { font-size: 0.8rem; color: var(--text-4); }

/* ══ READING LISTS ═════════════════════════════════════════ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--accent);
  border: none;
  border-radius: var(--r-md);
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  margin-bottom: 14px;
}
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 0.82rem;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

.readlist-card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.readlist-card:hover { border-color: var(--border-2); }
.readlist-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 3px; }
.readlist-meta { font-size: 0.78rem; color: var(--text-4); }

/* ══ LOADING & EMPTY ═══════════════════════════════════════ */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px;
  color: var(--text-4);
  font-size: 0.85rem;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Skeleton loading */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
}
.skeleton-tile {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.skeleton-img {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-body { padding: 14px 16px; }
.skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg-3) 25%, var(--bg-4) 50%, var(--bg-3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin-bottom: 10px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.h8 { height: 8px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-4);
}
.empty-state svg { margin-bottom: 14px; opacity: 0.2; }
.empty-state h3 { color: var(--text-3); margin-bottom: 6px; font-size: 1.1rem; }
.empty-state p { font-size: 0.85rem; }

/* ══ MODAL ═════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalIn 0.2s var(--ease);
}
@keyframes modalIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 24px;
  min-width: 340px;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.25s var(--spring);
}
@keyframes modalSlide { from { transform: translateY(16px) scale(0.97); } to { transform: none; } }
.modal-content h3 { margin-bottom: 14px; font-size: 1.05rem; }
.modal-content input {
  width: 100%;
  padding: 9px 13px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
  color: var(--text-1);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  margin-bottom: 10px;
  outline: none;
  transition: border-color var(--dur);
}
.modal-content input:focus { border-color: var(--accent); }
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Paywall & Language Tags ──────────────────────────── */
.paywall-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.7);
  color: var(--yellow);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  z-index: 2;
}
.lang-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  background: rgba(0,0,0,0.7);
  color: var(--cyan);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 4px;
  z-index: 2;
}
.paywall-pill {
  padding: 2px 8px;
  background: var(--yellow-dim);
  color: var(--yellow);
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.lang-pill {
  padding: 2px 8px;
  background: rgba(34,211,238,0.12);
  color: var(--cyan);
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ── Limited Fact Check ──────────────────────────────── */
.limited-check-tag {
  font-size: 0.72rem;
  color: var(--orange);
  margin-top: 4px;
  font-style: italic;
}

/* ── Spectrum Source Links ────────────────────────────── */
.spectrum-link {
  display: block;
  text-decoration: none;
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--dur);
}
.spectrum-link:hover { color: var(--accent); text-decoration: none; }
.spectrum-title {
  display: block;
  font-size: 0.68rem;
  color: var(--text-4);
  margin-top: 1px;
  line-height: 1.3;
}
.citation-link {
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--dur);
}
.citation-link:hover { color: var(--accent); }

/* ── Expandable Discrepancies ────────────────────────── */
.discrepancy-item {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--dur);
  overflow: hidden;
}
.discrepancy-item:hover { border-color: var(--border-2); }
.discrepancy-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
}
.discrepancy-type {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.discrepancy-source {
  color: var(--text-2);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.discrepancy-chevron {
  flex-shrink: 0;
  transition: transform 0.2s var(--ease);
  color: var(--text-4);
}
.discrepancy-body {
  padding: 0 14px 14px;
  animation: expandIn 0.2s var(--ease);
}
.discrepancy-detail {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 8px;
  padding: 10px;
  background: var(--bg-2);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--orange);
}
.discrepancy-numerical {
  border-color: var(--orange);
  border-width: 1px 1px 1px 3px;
}
.disc-num-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  background: rgba(217, 119, 6, 0.06);
}
.disc-num-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.disc-num-label {
  font-size: 0.68rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.disc-num-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.disc-num-unit {
  font-size: 0.7rem;
  color: var(--orange);
  font-weight: 600;
  text-transform: uppercase;
}
.disc-num-vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.disc-num-diff {
  font-size: 0.68rem;
  color: var(--orange);
  font-weight: 600;
}
.discrepancy-article-title {
  font-size: 0.78rem;
  color: var(--text-3);
  padding: 0 14px 6px;
  font-style: italic;
  line-height: 1.4;
}
.discrepancy-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.discrepancy-link {
  font-size: 0.75rem;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: var(--accent-dim);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.discrepancy-link:hover { text-decoration: none; background: rgba(129,140,248,0.2); }
.discrepancy-view-btn,
.discrepancy-detail-btn {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--bg-3);
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.discrepancy-view-btn:hover,
.discrepancy-detail-btn:hover {
  background: var(--bg-4);
  color: var(--text-1);
}
.discrepancy-detail-btn {
  border-color: var(--orange);
  color: var(--orange);
}
.discrepancy-detail-btn:hover {
  background: var(--orange-dim);
  color: var(--orange);
}

/* ── Discrepancy Detail Modal ──────────────────────── */
.discrepancy-modal {
  max-width: 560px;
}
.discrepancy-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.discrepancy-modal-type {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.discrepancy-modal-source {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 8px;
}
.discrepancy-modal-article {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--bg-3);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--accent);
}
.discrepancy-modal-body h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 10px;
}
.discrepancy-modal-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-2);
  white-space: pre-wrap;
  padding: 14px;
  background: var(--bg-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border-1);
}
.discrepancy-modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  justify-content: flex-end;
}

/* ── Related Articles ────────────────────────────────── */
.related-section {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-lg);
  padding: 18px;
  margin: 20px 0;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.related-card {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.related-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.related-card-source {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
}
.related-card-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-4);
}

/* ── Source Detail Modal ─────────────────────────────── */
.source-modal {
  max-width: 520px;
  min-width: 0;
  width: 90vw;
}
.source-detail-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.source-detail-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  flex: 1;
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-4);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: color var(--dur);
}
.modal-close-btn:hover { color: var(--text-1); }
.source-detail-desc {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 14px;
}
.source-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 16px 0;
}
.source-stat-card {
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 10px;
  text-align: center;
}
.source-stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
}
.source-stat-label {
  font-size: 0.68rem;
  color: var(--text-4);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}
.source-detail-meta {
  font-size: 0.82rem;
  color: var(--text-3);
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 14px 0;
}
.source-detail-meta strong { color: var(--text-2); }
.source-detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

/* ── Read Tag ────────────────────────────────────────── */
.read-tag {
  padding: 1px 6px;
  background: var(--green-dim);
  color: var(--green);
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
}

/* ── Article Summary in Detail View ──────────────────── */
.article-summary-detail {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-2);
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--r-md);
  padding: 16px;
  margin: 16px 0;
}
.article-summary-detail strong {
  color: var(--text-3);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 6px;
}

/* ══ MOBILE BOTTOM NAV ═════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border-1);
  z-index: 900;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: stretch;
}
.mob-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex: 1;
  padding: 8px 4px 6px;
  border: none;
  background: transparent;
  color: var(--text-4);
  font-size: 0.6rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: color var(--dur);
  -webkit-tap-highlight-color: transparent;
  min-height: 52px;
  letter-spacing: 0.2px;
}
.mob-nav-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.mob-nav-btn.active { color: var(--accent); }
.mob-nav-btn:active { color: var(--accent-bright); }

/* ══ RESPONSIVE — TABLET (<=900px) ═════════════════════════ */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }

  #app { grid-template-columns: 1fr; }

  /* Sidebar becomes slide-out drawer */
  #sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 280px;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
  }
  #sidebar.open { transform: translateX(0); }

  .mobile-menu-btn { display: block; }
  .mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }

  #content-area { padding: 16px 16px 40px; }

  /* Grid adjustments */
  .article-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
  .article-tile.expanded { grid-column: 1 / -1; }
  .skeleton-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .sources-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .related-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

  /* Typography */
  .detail-header h1 { font-size: 1.6rem; }
  .article-tile.expanded .tile-title { font-size: 1.35rem; }

  /* Spectrum grid stacks at tablet */
  .spectrum-grid { grid-template-columns: 1fr; }

  /* Modal adjustments */
  .modal-content { min-width: 0; max-width: 90vw; width: 90vw; }
  .source-modal { max-width: 90vw; }
}

/* ══ RESPONSIVE — MOBILE (<=640px) ═════════════════════════ */
@media (max-width: 640px) {
  html { font-size: 14px; }

  /* Show bottom nav, hide sidebar footer actions */
  .mobile-bottom-nav { display: block; }
  .sidebar-footer { display: none; }

  /* Main layout needs bottom padding for nav */
  #main { height: 100%; min-height: 0; }
  #content-area {
    padding: 12px 12px 90px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    min-height: 0;
    flex: 1;
  }

  /* Topbar compact */
  #topbar {
    padding: 8px 12px;
    gap: 8px;
    flex-shrink: 0;
  }
  .search-container {
    padding: 8px 12px;
    max-width: none;
    border-radius: var(--r-lg);
  }
  .search-container input { font-size: 16px; /* Prevents iOS zoom */ }
  .topbar-right { gap: 6px; }
  .topbar-right select {
    font-size: 0.75rem;
    padding: 6px 8px;
    max-width: 110px;
  }
  .article-count { display: none; }

  /* Article grid: single column */
  .article-grid { grid-template-columns: 1fr; gap: 10px; }
  .skeleton-grid { grid-template-columns: 1fr; }

  /* Tile adjustments */
  .tile-image, .tile-image-placeholder { height: 160px; }
  .article-tile.expanded .tile-image { height: 200px; }
  .article-tile.expanded .tile-image-placeholder { height: 100px; }
  .tile-body { padding: 12px 14px 14px; }
  .tile-title { font-size: 1rem; -webkit-line-clamp: 3; }
  .article-tile.expanded .tile-title { font-size: 1.25rem; }
  .tile-summary { font-size: 0.82rem; -webkit-line-clamp: 2; }
  .tile-meta { font-size: 0.72rem; }
  .tile-footer { padding-top: 8px; }

  /* Expanded content mobile */
  .expanded-content { padding: 0 12px 16px; }
  .expand-meta-bar {
    gap: 8px;
    padding: 10px 0;
    font-size: 0.78rem;
    flex-direction: column;
    align-items: flex-start;
  }
  .expand-meta-bar .collapse-btn { margin-left: 0; align-self: flex-end; }
  .expand-meta-bar .btn-secondary,
  .expand-meta-bar .open-full-btn,
  .expand-meta-bar .collapse-btn {
    padding: 8px 16px;
    font-size: 0.78rem;
    min-height: 36px;
  }
  /* Action buttons row on mobile */
  .expand-meta-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .expand-meta-bar > span { grid-column: 1 / -1; }
  .expand-meta-bar .collapse-btn { grid-column: 1 / -1; justify-content: center; }

  .expanded-content .article-body { font-size: 0.95rem; line-height: 1.75; }

  /* Bias compass mobile */
  .bias-compass-inline { padding: 12px; }
  .bias-labels { font-size: 0.58rem; }

  /* Detail view mobile */
  #article-detail { max-width: none; }
  .detail-header h1 {
    font-size: 1.35rem;
    line-height: 1.28;
    letter-spacing: -0.3px;
  }
  .detail-meta { gap: 8px; font-size: 0.78rem; }
  .detail-actions { gap: 6px; }
  .detail-actions .btn-secondary,
  .detail-actions .btn-primary {
    padding: 10px 16px;
    font-size: 0.82rem;
    min-height: 40px;
    flex: 1;
    justify-content: center;
  }
  .detail-body { font-size: 1rem; line-height: 1.75; }
  .detail-hero { max-height: 240px; border-radius: var(--r-md); margin-bottom: 16px; }
  .article-summary-detail { padding: 12px; font-size: 0.88rem; }

  /* Fact check mobile */
  .fact-section { padding: 14px; margin: 16px 0; }
  .fact-section h3 { font-size: 0.92rem; }
  .score-display { gap: 12px; }
  .score-big { font-size: 2.2rem; }
  .score-text { font-size: 0.75rem; }
  .spectrum-grid { grid-template-columns: 1fr; gap: 8px; }
  .spectrum-card { padding: 10px; }
  .spectrum-card h4 { font-size: 0.68rem; }
  .spectrum-item { font-size: 0.75rem; }

  /* Discrepancies mobile */
  .discrepancy-header { padding: 10px 12px; font-size: 0.78rem; }
  .discrepancy-body { padding: 0 12px 12px; }
  .discrepancy-detail { padding: 8px; font-size: 0.78rem; }

  /* Related articles mobile */
  .related-section { padding: 14px; }
  .related-grid { grid-template-columns: 1fr; gap: 6px; }
  .related-card { padding: 10px; }
  .related-card-title { font-size: 0.82rem; }

  /* Entity chips mobile */
  .entity-section { padding: 14px; }
  .entity-chip { padding: 5px 10px; font-size: 0.75rem; min-height: 32px; }

  /* Categories mobile */
  .categories-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .category-card { padding: 16px 12px; }
  .category-icon { font-size: 1.8rem; margin-bottom: 6px; }
  .category-card h3 { font-size: 0.92rem; }

  /* Sources mobile */
  .sources-grid { grid-template-columns: 1fr; }
  .source-card { padding: 12px 14px; }
  .source-filters { gap: 6px; }
  .source-filters select { flex: 1; min-width: 0; font-size: 0.78rem; padding: 8px 10px; }

  /* Reading lists mobile */
  .readlist-card { padding: 12px 14px; }
  .readlist-card h4 { font-size: 0.88rem; }

  /* Modal full-screen on mobile */
  .modal-overlay { align-items: flex-end; }
  .modal-content {
    min-width: 0;
    max-width: 100vw;
    width: 100vw;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  }
  .source-modal {
    max-width: 100vw;
    width: 100vw;
    max-height: 90vh;
  }
  .source-detail-stats { grid-template-columns: repeat(2, 1fr); }
  .source-detail-actions { flex-direction: column; }
  .source-detail-actions .btn-primary,
  .source-detail-actions .btn-secondary {
    justify-content: center;
    min-height: 44px;
  }

  /* View titles */
  .view-title { font-size: 1.2rem; margin-bottom: 14px; }

  /* Back button */
  .article-back { margin-bottom: 12px; min-height: 36px; }

  /* Citation rows */
  .citation-row { font-size: 0.75rem; padding: 4px 0; }
  .citations-box h4 { font-size: 0.72rem; }

  /* Loading states */
  .loading-indicator { padding: 30px; }
  .empty-state { padding: 40px 16px; }

  /* Tags */
  .paywall-tag, .lang-tag { font-size: 0.6rem; padding: 2px 6px; }
  .paywall-pill, .lang-pill { font-size: 0.6rem; }
}

/* ══ RESPONSIVE — SMALL MOBILE (<=380px) ═══════════════════ */
@media (max-width: 380px) {
  html { font-size: 13px; }

  #topbar { padding: 6px 10px; gap: 6px; }
  .search-container { padding: 7px 10px; }
  #content-area { padding: 10px 10px 90px; }

  .tile-image, .tile-image-placeholder { height: 130px; }
  .tile-body { padding: 10px 12px 12px; gap: 4px; }
  .tile-title { font-size: 0.95rem; }
  .tile-meta { font-size: 0.68rem; gap: 4px; }
  .bias-pill { font-size: 0.58rem; padding: 1px 5px; }
  .topic-tag { font-size: 0.6rem; padding: 1px 6px; }
  .fact-badge { font-size: 0.7rem; padding: 2px 6px; }
  .fact-badge svg { width: 11px; height: 11px; }

  .detail-header h1 { font-size: 1.15rem; }
  .score-big { font-size: 1.8rem; }
  .score-max { font-size: 1rem; }

  .categories-grid { grid-template-columns: 1fr; }
  .category-card { padding: 14px 10px; }
  .category-icon { font-size: 1.5rem; }

  .mob-nav-btn { padding: 6px 2px 4px; font-size: 0.55rem; min-height: 48px; }
  .mob-nav-btn svg { width: 18px; height: 18px; }
}

/* ══ SAFE AREA (notched phones) ════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ══ TOUCH OPTIMIZATIONS ══════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* Disable hover transforms on touch devices */
  .article-tile:hover {
    transform: none;
    box-shadow: none;
  }
  .article-tile:hover .tile-image { transform: none; }
  .source-card:hover { transform: none; }
  .category-card:hover { transform: none; }
  .related-card:hover { transform: none; }

  /* Active states instead */
  .article-tile:active { background: var(--bg-3); }
  .source-card:active { background: var(--bg-3); }
  .category-card:active { border-color: var(--accent); }
  .related-card:active { border-color: var(--accent); }

  /* Larger touch targets */
  .btn-primary, .btn-secondary { min-height: 44px; }
  .nav-item { min-height: 44px; }
  .topic-btn { min-height: 40px; padding: 9px 14px; }

  /* Remove scrollbar on touch */
  ::-webkit-scrollbar { display: none; }
  * { scrollbar-width: none; }
}

/* ══ LANDSCAPE MOBILE ═════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .mobile-bottom-nav { display: none; }
  #content-area { padding-bottom: 20px; }
  .tile-image, .tile-image-placeholder { height: 120px; }
  .detail-hero { max-height: 180px; }
}

/* ══ JOURNALIST MODAL ═══════════════════════════════════════ */
.author-link {
  cursor: pointer;
  color: var(--accent);
  transition: color 0.15s;
}
.author-link:hover { color: var(--accent-bright); text-decoration: underline; }

.journalist-modal { max-width: 560px; }
.journalist-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.journalist-header h2 { margin: 0; font-size: 1.2rem; }
.journalist-subtitle { font-size: 0.78rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.journalist-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
}
.journalist-stats-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-3);
  border-radius: var(--r-md);
}
.journalist-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}
.journalist-stat-num { font-size: 1.1rem; font-weight: 700; color: var(--text-1); }
.journalist-stat-label { font-size: 0.68rem; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.journalist-sources-section { margin-bottom: 14px; }
.journalist-sources-section h4 { font-size: 0.82rem; color: var(--text-3); margin-bottom: 8px; }
.journalist-sources-list { display: flex; flex-wrap: wrap; gap: 6px; }
.source-chip {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border-1);
}
.journalist-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.journalist-follow-btn.following {
  background: var(--green-dim);
  color: var(--green);
  border: 1px solid var(--green);
}
.journalist-articles-section h4 {
  font-size: 0.88rem;
  color: var(--text-2);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-1);
}
.sidebar-journalists { padding: 0 8px 8px; overflow-y: auto; }

/* ── Sidebar Markets ─────────────────────────────────────── */
.sidebar-markets {
  overflow-y: auto;
  padding: 4px 8px;
}
.sidebar-market-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
}
.sidebar-market-item:hover {
  background: var(--bg-glass-hover);
}
.sidebar-market-name {
  color: var(--text-2);
  font-weight: 500;
}
.sidebar-market-price {
  color: var(--text-1);
  font-weight: 600;
  font-size: 0.75rem;
}
.sidebar-market-change {
  font-size: 0.7rem;
  font-weight: 600;
}
.sidebar-market-change.up { color: var(--green); }
.sidebar-market-change.down { color: var(--red); }
.sidebar-market-change.flat { color: var(--text-4); }

/* ══ ARTICLE SUMMARY BOX ══════════════════════════════════ */
.article-summary-box-detail {
  max-width: 720px;
  margin: 24px auto;
  padding: 24px 28px;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  position: relative;
  border: 1px solid var(--border-2);
  border-left: 3px solid var(--accent);
}
.summary-box-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.summary-box-text {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-1);
}
.summary-box-meta {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-1);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-3);
}

/* ══ LIVE TICKER ═══════════════════════════════════════════ */
/* Ticker show button — always visible when ticker hidden */
.ticker-show-btn {
  position: fixed;
  bottom: 8px;
  right: 16px;
  z-index: 860;
  display: none; /* shown via JS when ticker hidden */
  align-items: center;
  gap: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-3);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 14px;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  font-family: var(--font-sans);
}
.ticker-show-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.ticker-show-btn svg { opacity: 0.7; }

.ticker-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 36px;
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
  border-top: 1px solid var(--border-2);
  z-index: 850;
  display: flex;
  align-items: center;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  overflow: hidden;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.ticker-bar.hidden {
  transform: translateY(100%);
  pointer-events: none;
}
.ticker-close-btn {
  flex-shrink: 0;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-right: 1px solid var(--border-1);
  color: var(--text-3);
  font-size: 1rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, background 0.15s;
  z-index: 1;
  line-height: 1;
}
.ticker-close-btn:hover { color: var(--text-1); background: var(--bg-4); }
.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}
.ticker-content {
  display: flex;
  align-items: center;
  gap: 0;
  height: 100%;
  white-space: nowrap;
  animation: tickerScroll 120s linear infinite;
  will-change: transform;
}
.ticker-content:hover { animation-play-state: paused; }

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  height: 100%;
  color: var(--text-2);
  border-right: 1px solid var(--border-1);
  cursor: default;
  flex-shrink: 0;
}
.ticker-item.stock { gap: 4px; cursor: pointer; }
.ticker-item.stock:hover { background: var(--bg-glass-hover); }
.ticker-stock-name {
  font-weight: 600;
  color: var(--text-1);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}
.ticker-stock-price {
  color: var(--text-2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.ticker-stock-change {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 5px;
  border-radius: 3px;
}
.ticker-stock-change.up { color: var(--green); background: var(--green-dim); }
.ticker-stock-change.down { color: var(--red); background: var(--red-dim); }
.ticker-stock-change.flat { color: var(--text-3); }
.ticker-market-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
}
.ticker-market-label.us { color: var(--blue); background: rgba(96,165,250,0.12); }
.ticker-market-label.uk { color: var(--cyan); background: rgba(34,211,238,0.12); }
.ticker-market-label.jp { color: var(--orange); background: rgba(251,146,60,0.12); }

.ticker-divider {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  height: 100%;
  flex-shrink: 0;
}
.ticker-divider-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.ticker-headline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 100%;
  cursor: pointer;
  transition: color 0.15s;
  flex-shrink: 0;
}
.ticker-headline:hover { color: var(--accent-bright); }
.ticker-headline-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-dim);
  padding: 2px 5px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ticker-headline-text {
  color: var(--text-2);
  font-size: 0.78rem;
  max-width: 400px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ticker-headline-source {
  font-size: 0.68rem;
  color: var(--text-4);
  flex-shrink: 0;
}


/* Ticker speed slider control */
.ticker-speed-control {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  z-index: 1;
}
.ticker-speed-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-4);
  min-width: 30px;
  text-align: center;
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums;
}
.ticker-speed-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
.ticker-speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.ticker-speed-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}
.ticker-speed-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  cursor: pointer;
}
.ticker-speed-slider::-moz-range-track {
  height: 4px;
  background: var(--border-2);
  border-radius: 2px;
}

/* Sidebar followed articles */
/* ══ FOLLOWED JOURNALISTS PAGE ════════════════════════════ */
.followed-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.followed-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}
.followed-search-input {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.82rem;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  width: 200px;
}
.followed-search-input:focus { border-color: var(--accent); outline: none; }
.followed-filters select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.8rem;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  cursor: pointer;
}

/* Table view */
.followed-table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.followed-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
.followed-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-4);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.followed-row {
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border-1);
}
.followed-row:last-child { border-bottom: none; }
.followed-row:hover { background: var(--bg-glass-hover); }
.followed-row td {
  padding: 10px 14px;
  vertical-align: top;
}
.followed-title-cell { max-width: 400px; }
.followed-title {
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.followed-author-cell { white-space: nowrap; }
.followed-author { color: var(--accent); font-weight: 600; font-size: 0.8rem; }
.followed-source-cell { white-space: nowrap; color: var(--text-3); font-size: 0.8rem; }
.followed-time-cell { white-space: nowrap; color: var(--text-4); font-size: 0.78rem; }

/* By-journalist grouped view */
.followed-journalist-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 14px;
  overflow: hidden;
}
.followed-journalist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bg-2);
  cursor: pointer;
  transition: background 0.15s;
}
.followed-journalist-header:hover { background: var(--bg-3); }
.followed-journalist-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-1);
}
.followed-journalist-stats {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-4);
}
.followed-journalist-count { font-weight: 600; }
.followed-journalist-articles {
  border-top: 1px solid var(--border-1);
}
.followed-j-article {
  padding: 10px 18px;
  border-bottom: 1px solid var(--border-1);
  cursor: pointer;
  transition: background 0.15s;
}
.followed-j-article:last-child { border-bottom: none; }
.followed-j-article:hover { background: var(--bg-glass-hover); }
.followed-j-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 4px;
}
.followed-j-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}
.followed-j-source { font-size: 0.72rem; color: var(--text-3); font-weight: 500; }
.followed-j-time { font-size: 0.68rem; color: var(--text-4); }

@media (max-width: 768px) {
  .followed-filters { width: 100%; }
  .followed-search-input { flex: 1; width: auto; }
  .followed-table th:nth-child(4),
  .followed-table td:nth-child(4),
  .followed-table th:nth-child(6),
  .followed-table td:nth-child(6) { display: none; }
}

/* Analysis sections in discrepancy modal */
.analysis-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: var(--bg-3);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--border-2);
}
.analysis-section:last-child { margin-bottom: 0; }
.analysis-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  display: block;
  margin-bottom: 4px;
}
.analysis-section p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-2);
  margin: 0;
}

/* Sidebar stock row */
.sidebar-stock-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  cursor: pointer;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  transition: background var(--dur);
}
.sidebar-stock-row:hover { background: var(--bg-glass-hover); }

/* Adjust spacing when ticker visible */
body:has(.ticker-bar:not(.hidden)) #content-area { padding-bottom: 46px; }
body:has(.ticker-bar:not(.hidden)) .mobile-bottom-nav { bottom: 36px; }

/* ══ MARKETS VIEW ═════════════════════════════════════════ */
.mkt-page { max-width: 1100px; margin: 0 auto; }

/* Toolbar */
.mkt-toolbar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.mkt-search-wrap {
  flex: 1; min-width: 180px; display: flex; align-items: center; gap: 8px;
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-md);
  padding: 7px 12px;
}
.mkt-search-wrap svg { color: var(--text-4); flex-shrink: 0; }
.mkt-search {
  border: none; background: none; color: var(--text-1); font-size: 0.85rem;
  font-family: var(--font-sans); width: 100%; outline: none;
}
.mkt-toolbar-right { display: flex; align-items: center; gap: 6px; }
.mkt-view-btn {
  background: var(--bg-2); border: 1px solid var(--border-1); color: var(--text-3);
  padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer;
  transition: all var(--dur); display: flex; align-items: center;
}
.mkt-view-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.mkt-view-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.mkt-alerts-btn {
  position: relative; background: var(--bg-2); border: 1px solid var(--border-1); color: var(--text-3);
  padding: 6px 8px; border-radius: var(--r-sm); cursor: pointer; display: flex; align-items: center;
  transition: all var(--dur);
}
.mkt-alerts-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.mkt-alert-count {
  position: absolute; top: -5px; right: -5px; background: var(--red); color: white;
  font-size: 0.6rem; font-weight: 700; width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* Sections */
.mkt-section { margin-bottom: 28px; }
.mkt-section-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border-1);
}
.mkt-section-header h3 { font-size: 0.95rem; font-weight: 700; color: var(--text-1); margin: 0; }
.mkt-section-icon { display: flex; align-items: center; }

/* Grid cards */
.mkt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.mkt-card {
  border: 1px solid var(--border-1); border-radius: var(--r-lg); padding: 14px 16px;
  cursor: pointer; transition: border-color var(--dur), transform var(--dur);
}
.mkt-card:hover { border-color: var(--border-2); transform: translateY(-1px); }
.mkt-card-top {
  display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 8px;
}
.mkt-card-name { min-width: 0; }
.mkt-card-symbol {
  font-size: 0.72rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em;
  text-transform: uppercase; display: block;
}
.mkt-card-fullname { font-size: 0.8rem; color: var(--text-4); display: block; margin-top: 1px; }
.mkt-card-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mkt-card-alert-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--yellow); flex-shrink: 0;
}
.mkt-fav-btn {
  background: none; border: none; color: var(--text-4); font-size: 1rem; cursor: pointer;
  padding: 0 2px; transition: color var(--dur); line-height: 1;
}
.mkt-fav-btn:hover { color: var(--yellow); }
.mkt-fav-btn.active { color: var(--yellow); }
.mkt-card-mid {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px;
}
.mkt-card-price {
  font-size: 1.15rem; font-weight: 700; color: var(--text-1);
  font-variant-numeric: tabular-nums;
}
.mkt-card-spark { flex-shrink: 0; }
.mkt-card-bottom {
  display: flex; align-items: center; gap: 8px; font-size: 0.78rem;
}
.mkt-card-change { font-weight: 600; font-variant-numeric: tabular-nums; }
.mkt-card-change-abs { color: var(--text-4); font-variant-numeric: tabular-nums; }
.mkt-card-market {
  margin-left: auto; font-size: 0.65rem; font-weight: 600; color: var(--text-4);
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Table view */
.mkt-table-wrap { overflow-x: auto; }
.mkt-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
}
.mkt-table th {
  text-align: left; padding: 8px 10px; font-size: 0.7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-4);
  border-bottom: 1px solid var(--border-1); white-space: nowrap;
}
.mkt-table th.right { text-align: right; }
.mkt-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--border-1);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.mkt-table td.right { text-align: right; }
.mkt-tbl-row { cursor: pointer; transition: background var(--dur); }
.mkt-tbl-row:hover { background: var(--bg-glass-hover); }
.mkt-tbl-name { font-weight: 500; color: var(--text-1); cursor: pointer; }
.mkt-tbl-name:hover { color: var(--accent); }
.mkt-tbl-sym { font-size: 0.75rem; color: var(--text-4); font-weight: 500; }
.mkt-tbl-price { font-weight: 600; color: var(--text-1); }

/* Stock Detail */
.mkt-detail { max-width: 860px; margin: 0 auto; }
.mkt-detail-top {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.mkt-back-btn {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  color: var(--text-3); font-size: 0.85rem; cursor: pointer; padding: 6px 0;
  font-family: var(--font-sans); transition: color var(--dur);
}
.mkt-back-btn:hover { color: var(--accent); }
.mkt-detail-title { flex: 1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mkt-detail-title h2 { font-size: 1.3rem; font-weight: 700; color: var(--text-1); margin: 0; }
.mkt-detail-sym { font-size: 0.82rem; color: var(--text-3); font-weight: 500; }
.mkt-detail-actions { display: flex; gap: 8px; }
.mkt-fav-btn-lg {
  background: var(--bg-2); border: 1px solid var(--border-1); color: var(--text-3);
  padding: 6px 14px; border-radius: var(--r-md); font-size: 0.82rem; cursor: pointer;
  font-family: var(--font-sans); font-weight: 500; transition: all var(--dur);
}
.mkt-fav-btn-lg:hover { border-color: var(--yellow); color: var(--yellow); }
.mkt-fav-btn-lg.active { border-color: var(--yellow); color: var(--yellow); background: rgba(234,179,8,0.08); }
.mkt-alert-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-2); border: 1px solid var(--border-1); color: var(--text-3);
  padding: 6px 14px; border-radius: var(--r-md); font-size: 0.82rem; cursor: pointer;
  font-family: var(--font-sans); font-weight: 500; transition: all var(--dur);
}
.mkt-alert-btn:hover { border-color: var(--accent); color: var(--accent); }

.mkt-detail-price-row {
  display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; flex-wrap: wrap;
}
.mkt-detail-price { font-size: 2rem; font-weight: 800; color: var(--text-1); font-variant-numeric: tabular-nums; }
.mkt-detail-change { font-size: 1rem; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Range buttons */
.mkt-range-bar {
  display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap;
}
.mkt-range-btn {
  background: var(--bg-2); border: 1px solid var(--border-1); color: var(--text-3);
  padding: 5px 12px; border-radius: var(--r-sm); font-size: 0.75rem; font-weight: 600;
  cursor: pointer; font-family: var(--font-sans); transition: all var(--dur);
  letter-spacing: 0.02em;
}
.mkt-range-btn:hover { border-color: var(--border-2); color: var(--text-2); }
.mkt-range-btn.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* Chart container */
.mkt-chart-container {
  border: 1px solid var(--border-1); border-radius: var(--r-lg); overflow: hidden;
  margin-bottom: 20px; min-height: 360px;
}

/* Stats grid */
.mkt-stats-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px;
  margin-bottom: 20px;
}
.mkt-stat {
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-md);
  padding: 10px 14px;
}
.mkt-stat-label { display: block; font-size: 0.68rem; color: var(--text-4); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 3px; }
.mkt-stat-value { display: block; font-size: 0.9rem; font-weight: 600; color: var(--text-1); font-variant-numeric: tabular-nums; }

/* Detail alerts */
.mkt-detail-alerts { margin-bottom: 20px; }
.mkt-detail-alerts h4 { font-size: 0.82rem; color: var(--text-2); margin-bottom: 8px; }
.mkt-alert-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-sm);
  padding: 6px 12px; font-size: 0.82rem; color: var(--text-2); margin-bottom: 4px;
}
.mkt-alert-rm {
  background: none; border: none; color: var(--text-4); font-size: 1rem; cursor: pointer;
  padding: 0 4px; line-height: 1; transition: color var(--dur);
}
.mkt-alert-rm:hover { color: var(--red); }

/* News items */
.mkt-news-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 0;
  border-bottom: 1px solid var(--border-1); cursor: pointer; transition: opacity var(--dur);
}
.mkt-news-item:hover { opacity: 0.8; }
.mkt-news-title { font-size: 0.85rem; color: var(--text-2); font-weight: 500; }
.mkt-news-meta { font-size: 0.72rem; color: var(--text-4); }

/* Modal */
.mkt-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6); z-index: 10000; display: flex;
  align-items: center; justify-content: center; padding: 20px;
}
.mkt-modal {
  background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--r-lg);
  padding: 24px; max-width: 400px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.mkt-modal h3 { font-size: 1.05rem; font-weight: 700; color: var(--text-1); margin: 0; }
.mkt-input {
  background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--r-sm);
  color: var(--text-1); padding: 8px 12px; font-size: 0.85rem; font-family: var(--font-sans);
  outline: none; transition: border-color var(--dur);
}
.mkt-input:focus { border-color: var(--accent); }

/* Alerts list */
.mkt-alert-list-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid var(--border-1); font-size: 0.85rem;
}
.mkt-alert-list-item.triggered { opacity: 0.5; }

/* Sidebar stock rows */
/* Responsive */
@media (max-width: 640px) {
  .mkt-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
  .mkt-card { padding: 10px 12px; }
  .mkt-card-price { font-size: 1rem; }
  .mkt-detail-price { font-size: 1.5rem; }
  .mkt-chart-container { min-height: 260px; }
  .mkt-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .mkt-toolbar { gap: 8px; }
  .mkt-detail-top { gap: 10px; }
}

/* ══ SOURCE LINK BUTTON ═══════════════════════════════════ */
.source-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--r-md);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  margin: 20px auto;
  max-width: 720px;
}
.source-link-btn:hover {
  background: var(--accent-bright);
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

/* ══ PRINT ═════════════════════════════════════════════════ */
/* ══ EVENT WIDGETS ═══════════════════════════════════════════ */
.event-widget {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  display: flex;
  flex-direction: column;
}
.event-widget:hover {
  transform: translateY(-2px);
  border-color: var(--red);
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.1);
}
.event-hero {
  grid-column: 1 / -1;
}
.event-hero .event-image-wrap {
  height: 280px;
}
.event-hero .event-headline {
  font-size: 1.5rem;
  line-height: 1.3;
}
.event-hero .event-summary {
  -webkit-line-clamp: 4;
  font-size: 0.92rem;
}

.event-image-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.event-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.event-image-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-2));
}

.event-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.event-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.event-topic-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
  background: rgba(220, 38, 38, 0.08);
  padding: 3px 8px;
  border-radius: 4px;
}
.event-time {
  font-size: 0.75rem;
  color: var(--text-4);
  flex-shrink: 0;
}
.event-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.event-summary {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.event-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.event-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.event-source-pill {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  white-space: nowrap;
}
.event-source-more {
  background: var(--bg-hover);
  color: var(--text-4);
}
.event-stats {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.75rem;
  color: var(--text-4);
  flex-shrink: 0;
}
.event-article-count {
  white-space: nowrap;
}
.event-fact-score {
  font-weight: 700;
}

/* ══ BREAKING NEWS PAGE ══════════════════════════════════── */
.breaking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.breaking-filters {
  display: flex;
  gap: 8px;
}
.breaking-filters select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-size: 0.8rem;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  font-family: var(--font-sans);
  cursor: pointer;
}
.breaking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
}
.breaking-widget {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.breaking-widget:hover {
  transform: translateY(-2px);
  border-color: var(--red);
  box-shadow: 0 6px 24px rgba(220, 38, 38, 0.12);
}
.breaking-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}
.breaking-hero .breaking-img-wrap { height: 100%; min-height: 260px; }
.breaking-hero .breaking-headline { font-size: 1.4rem; -webkit-line-clamp: 3; }
.breaking-hero .breaking-summary { -webkit-line-clamp: 4; font-size: 0.9rem; }

.breaking-img-wrap {
  position: relative;
  height: 180px;
  overflow: hidden;
  flex-shrink: 0;
}
.breaking-img-sm { height: 100px; }
.breaking-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.breaking-img-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, var(--bg-2));
}
.breaking-live-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(220, 38, 38, 0.85);
  color: white;
  backdrop-filter: blur(4px);
}
.breaking-no-img {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-2) 100%);
  border-bottom: 1px solid var(--border);
}
.breaking-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.breaking-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breaking-topic {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--red);
}
.breaking-time {
  font-size: 0.7rem;
  color: var(--text-4);
  margin-left: auto;
}
.breaking-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.breaking-summary {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-3);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}
.breaking-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.breaking-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.breaking-source-pill {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  white-space: nowrap;
}
.breaking-more { background: var(--bg-hover); color: var(--text-4); }
.breaking-fact {
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}
.breaking-single {
  flex-direction: row;
  align-items: stretch;
}
.breaking-single .breaking-img-wrap {
  width: 120px;
  height: auto;
  min-height: 80px;
}
.breaking-single .breaking-body { padding: 10px 14px; }
.breaking-unclustered-header {
  grid-column: 1 / -1;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 0 0;
  border-top: 1px solid var(--border-2);
  margin-top: 8px;
}
@media (max-width: 768px) {
  .breaking-grid { grid-template-columns: 1fr; }
  .breaking-hero { grid-template-columns: 1fr; }
  .breaking-hero .breaking-img-wrap { min-height: 180px; }
  .breaking-filters { width: 100%; }
  .breaking-filters select { flex: 1; }
}

/* ══ HOMEPAGE FEED (hf-* classes) ══════════════════════════ */
.home-feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Topic filter bar */
.hf-topic-bar {
  display: flex;
  gap: 6px;
  padding: 4px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-wrap: nowrap;
}
.hf-topic-bar::-webkit-scrollbar { display: none; }
.hf-topic-pill {
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.hf-topic-pill:hover {
  border-color: var(--text-4);
  color: var(--text-1);
}
.hf-topic-active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.hf-topic-active:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Hero card - top story */
.hf-hero {
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s;
  margin-bottom: 28px;
}
.hf-hero:hover {
  border-color: var(--red);
  transform: translateY(-2px);
}
.hf-hero-img {
  position: relative;
  width: 100%;
  height: 340px;
  overflow: hidden;
}
.hf-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hf-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, var(--bg-2));
}
.hf-hero-body {
  padding: 20px 24px;
}
.hf-hero-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-4);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.hf-hero-topic {
  font-weight: 700;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hf-hero-dot { color: var(--text-5, #444); }
.hf-hero-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-1);
  margin: 0 0 10px;
}
.hf-hero-summary {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-3);
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-hero-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.hf-source-chip {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-3);
  color: var(--text-3);
  white-space: nowrap;
}
.hf-hero-related {
  border-top: 1px solid var(--border);
  padding: 12px 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hf-hero-related-item, .hf-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s;
}
.hf-hero-related-item:hover, .hf-sub-item:hover {
  background: var(--bg-glass-hover);
}
.hf-related-source, .hf-sub-source {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  flex-shrink: 0;
}
.hf-related-title, .hf-sub-title {
  font-size: 0.82rem;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category sections */
.hf-category {
  margin-bottom: 20px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}
.hf-category-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--red);
}
.hf-category-icon {
  font-size: 1.1rem;
}
.hf-category-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}
.hf-category-count {
  font-size: 0.72rem;
  color: var(--text-4);
  margin-left: auto;
}

/* Card grid */
.hf-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Story card */
.hf-card {
  background: var(--bg-3, var(--bg-1));
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.12s;
  display: flex;
  flex-direction: column;
}
.hf-card:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}
/* compact card footer with counts */
.hf-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
}
.hf-card-counts {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hf-card-count-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.75rem;
  color: var(--text-4);
  font-weight: 500;
}
.hf-card-count-item svg { opacity: 0.6; }
.hf-card-time {
  font-size: 0.72rem;
  color: var(--text-5, #555);
  white-space: nowrap;
}

.hf-card-img {
  height: 120px;
  overflow: hidden;
}
.hf-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hf-card-body {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* category header stats */
.hf-category-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.hf-cat-stat {
  font-size: 0.75rem;
  color: var(--text-4);
  font-weight: 500;
}
.hf-card-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-1);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-card-summary {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text-3);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-card-disc {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--orange);
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.2);
  border-radius: var(--r-sm);
  padding: 4px 8px;
  margin-top: 4px;
}
.hf-card-disc svg { flex-shrink: 0; stroke: var(--orange); }
.hf-card-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
  padding-top: 4px;
}
.hf-card-related {
  border-top: 1px solid var(--border);
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Tags ── */
.hf-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
}
.hf-tag-sm { padding: 2px 8px; font-size: 0.68rem; }
.hf-tag-xs { padding: 1px 6px; font-size: 0.62rem; }
.hf-tag-topic { background: rgba(215, 38, 56, 0.1); color: var(--red); }
.hf-tag-entity { background: rgba(99, 102, 241, 0.1); color: #818cf8; }
.hf-tag-theme { background: rgba(8, 145, 178, 0.1); color: #22d3ee; }
.hf-tag-region { background: rgba(217, 119, 6, 0.1); color: #fbbf24; }
.hf-tag-count { opacity: 0.6; font-weight: 400; font-size: 0.65rem; }
.hf-tag-filterable { cursor: pointer; }
.hf-tag-filterable:hover { filter: brightness(1.2); transform: scale(1.05); }
.hf-tag-active { outline: 2px solid currentColor; outline-offset: 1px; }
.hf-card-tags, .hf-hero-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.hf-section-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }

/* ── Filter bar ── */
.hf-filter-bar {
  margin-bottom: 20px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-1);
  padding: 8px 0 4px;
}
.hf-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.hf-topic-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.hf-topic-pills::-webkit-scrollbar { display: none; }
.hf-tag-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.12s;
  flex-shrink: 0;
}
.hf-tag-filter-btn:hover { border-color: var(--red); color: var(--red); }
.hf-tag-filter-active { border-color: var(--red); color: var(--red); background: rgba(215, 38, 56, 0.06); }
.hf-tag-panel {
  padding: 12px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.hf-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* ── Breaking news banner ── */
.hf-breaking {
  margin-bottom: 24px;
  background: var(--bg-2);
  border: 1px solid var(--red);
  border-radius: 14px;
  overflow: hidden;
}
.hf-breaking-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(215, 38, 56, 0.2);
}
.hf-breaking-badge {
  background: var(--red);
  color: white;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  animation: breakingPulse 2s ease-in-out infinite;
}
@keyframes breakingPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
.hf-breaking-label {
  font-size: 0.82rem;
  color: var(--text-3);
  font-weight: 500;
}
.hf-breaking-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 200px;
}
.hf-breaking .hf-hero {
  border-radius: 0;
  border: none;
  margin: 0;
}
.hf-breaking-sidebar {
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.hf-breaking-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.12s;
  border-bottom: 1px solid var(--border);
  flex: 1;
}
.hf-breaking-item:last-child { border-bottom: none; }
.hf-breaking-item:hover { background: var(--bg-glass-hover); }
.hf-breaking-thumb {
  width: 80px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
}
.hf-breaking-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hf-breaking-info { flex: 1; min-width: 0; }
.hf-breaking-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-1);
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hf-breaking-meta {
  display: flex;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-4);
}

/* ── Sections container ── */
.hf-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* ── Show more button ── */
.hf-show-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: none;
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.hf-show-more:hover { border-color: var(--red); color: var(--red); background: rgba(215, 38, 56, 0.04); }

/* ── Search results header ── */
.hf-search-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.hf-search-info { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.hf-search-info h2 { font-size: 1.1rem; font-weight: 700; color: var(--text-1); margin: 0; }
.hf-search-count { font-size: 0.82rem; color: var(--text-4); }
.hf-search-tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hf-search-tags-label { font-size: 0.75rem; color: var(--text-4); margin-right: 4px; }

@media (max-width: 1024px) {
  .hf-sections { grid-template-columns: 1fr; }
  .hf-breaking-grid { grid-template-columns: 1fr; }
  .hf-breaking-sidebar { border-left: none; border-top: 1px solid var(--border); }
}
@media (max-width: 768px) {
  .hf-hero-img { height: 200px; }
  .hf-hero-headline { font-size: 1.35rem; }
  .hf-hero-body { padding: 14px 16px; }
  .hf-card-grid { grid-template-columns: 1fr; }
  .hf-filter-bar { padding: 4px 0; }
  .hf-breaking-grid { grid-template-columns: 1fr; }
  .hf-sections { grid-template-columns: 1fr; }
}

/* ══ EVENT PAGE ═════════════════════════════════════════════ */
.event-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}
/* ── Event Page (ep-* classes) ── */
.ep {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px 40px;
}
.ep-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 0;
  margin-bottom: 12px;
  transition: color 0.15s;
}
.ep-back:hover { color: var(--red); }

.ep-hero-img {
  position: relative;
  width: 100%;
  height: 320px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}
.ep-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ep-hero-gradient {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, var(--bg-1));
}

.ep-header {
  margin-bottom: 28px;
}
.ep-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.ep-topic {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 4px;
}
.ep-stat {
  font-size: 0.78rem;
  color: var(--text-4);
}
.ep-stat + .ep-stat::before {
  content: '\00b7';
  margin-right: 8px;
}
.ep-headline {
  font-family: 'DM Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-1);
  margin: 8px 0 12px;
}
.ep-summary {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--text-3);
  margin: 0 0 12px;
}
.ep-timerange {
  font-size: 0.78rem;
  color: var(--text-4);
}

/* ── Sections ── */
.ep-section {
  margin-bottom: 32px;
}
.ep-section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--red);
}

/* ── Coverage section & filters ── */
.ep-coverage-section {
  margin-bottom: 32px;
}
.ep-coverage-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.ep-coverage-header .ep-section-title {
  margin-bottom: 0;
  padding-bottom: 6px;
  flex-shrink: 0;
}
.ep-coverage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ep-filter-search {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-1);
  font-size: 0.82rem;
  padding: 6px 10px;
  width: 180px;
  outline: none;
  transition: border-color 0.15s;
}
.ep-filter-search:focus {
  border-color: var(--red);
}
.ep-filter-search::placeholder {
  color: var(--text-5, #555);
}
.ep-filter-select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-2);
  font-size: 0.82rem;
  padding: 6px 8px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}
.ep-filter-select:focus {
  border-color: var(--red);
}

.ep-articles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ep-no-results {
  text-align: center;
  color: var(--text-4);
  font-size: 0.9rem;
  padding: 32px 0;
  font-style: italic;
}

/* ── Event article cards ── */
.ep-article {
  display: flex;
  gap: 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.ep-article:hover {
  border-color: var(--red);
  background: var(--bg-hover);
  transform: translateY(-1px);
}
.ep-article-img {
  width: 110px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.ep-article-body {
  flex: 1;
  min-width: 0;
}
.ep-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.ep-article-source {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ep-article-score {
  font-size: 0.75rem;
  font-weight: 700;
}
.ep-article-time {
  font-size: 0.72rem;
  color: var(--text-4);
  margin-left: auto;
}
.ep-article-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-article-summary {
  font-size: 0.8rem;
  color: var(--text-3);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ep-article-author {
  font-size: 0.7rem;
  color: var(--text-4);
  margin-top: 4px;
}

/* ── Cross-Spectrum View (sp-* classes) ── */
.sp-bar {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
  height: 28px;
  margin-bottom: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
}
.sp-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  transition: width 0.3s;
}
.sp-bar-left { background: #3b82f6; }
.sp-bar-center { background: #6b7280; }
.sp-bar-right { background: #ef4444; }

.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}
.sp-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.sp-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
}
.sp-count {
  font-size: 0.7rem;
  color: var(--text-4);
}
.sp-empty {
  text-align: center;
  color: var(--text-5, #444);
  font-size: 0.78rem;
  font-style: italic;
  padding: 16px 4px;
}
.sp-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.sp-card:hover {
  border-color: var(--red);
  background: var(--bg-hover);
}
.sp-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sp-source {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.sp-score {
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: auto;
}
.sp-title {
  font-size: 0.82rem;
  color: var(--text-2);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sp-time {
  font-size: 0.68rem;
  color: var(--text-4);
  margin-top: 4px;
}

/* ── Timeline ── */
.event-timeline {
  position: relative;
  padding-left: 24px;
}
.event-timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.timeline-entry {
  position: relative;
  padding: 8px 0 16px 0;
  cursor: pointer;
}
.timeline-entry:hover .timeline-title { color: var(--red); }
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg-1);
}
.timeline-content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.timeline-time {
  font-size: 0.72rem;
  color: var(--text-4);
  font-weight: 600;
  min-width: 40px;
}
.timeline-source {
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 700;
  text-transform: uppercase;
}
.timeline-title {
  font-size: 0.82rem;
  color: var(--text-2);
  transition: color 0.15s;
  flex: 1;
  min-width: 200px;
}

/* Mobile responsive - event page */
@media (max-width: 640px) {
  .ep { padding: 0 8px 24px; }
  .ep-hero-img { height: 180px; border-radius: 8px; }
  .ep-headline { font-size: 1.4rem; }
  .sp-grid { grid-template-columns: 1fr; gap: 16px; }
  .ep-coverage-header { flex-direction: column; align-items: stretch; }
  .ep-filter-search { width: 100%; }
  .ep-article { flex-direction: column; gap: 8px; }
  .ep-article-img { width: 100%; height: 140px; }
}

/* ══ LIVE STREAMS & PODCASTS (ls-* classes) ════════════════ */

/* Floating action button */
.ls-fab {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}
.ls-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(220, 38, 38, 0.45);
}
.ls-fab-active {
  background: var(--text-4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.ls-fab-label {
  font-size: 0.78rem;
  letter-spacing: 0.3px;
}
.ls-fab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  animation: ls-pulse 2s infinite;
}
.ls-fab-active .ls-fab-dot { display: none; }
@keyframes ls-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* Panel */
.ls-panel {
  position: fixed;
  bottom: 140px;
  right: 20px;
  z-index: 9500;
  width: 380px;
  max-height: 540px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
}

/* Header */
.ls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}
.ls-header:active { cursor: grabbing; }
.ls-tabs {
  display: flex;
  gap: 2px;
}
.ls-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-3);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.ls-tab:hover { color: var(--text-1); background: var(--bg-3); }
.ls-tab-active { color: var(--text-1); background: var(--bg-3); }
.ls-header-btns {
  display: flex;
  gap: 4px;
}
.ls-hdr-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: var(--text-3);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.ls-hdr-btn:hover { background: var(--bg-3); color: var(--text-1); }

/* Player */
.ls-player {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  background: #000;
}
.ls-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Now playing bar */
.ls-now {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
}
.ls-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
  animation: ls-pulse 1.5s infinite;
}
.ls-now-name {
  font-weight: 700;
  color: var(--text-1);
}
.ls-now-region {
  margin-left: auto;
  font-size: 0.7rem;
  color: var(--text-4);
}

/* Channel list */
.ls-channels {
  flex: 1;
  overflow-y: auto;
  max-height: 200px;
  scrollbar-width: thin;
}
.ls-region-hdr {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-3);
  cursor: pointer;
  user-select: none;
  transition: color 0.12s;
}
.ls-region-hdr:hover { color: var(--text-1); }
.ls-region-count {
  font-size: 0.65rem;
  color: var(--text-4);
  font-weight: 600;
  background: var(--bg-3);
  padding: 1px 5px;
  border-radius: 8px;
}
.ls-region-chevron {
  margin-left: auto;
  transition: transform 0.2s;
  color: var(--text-4);
}
.ls-region-open .ls-region-chevron { transform: rotate(180deg); }
.ls-region-list {
  display: none;
  padding: 0 8px 6px;
}
.ls-region-open .ls-region-list { display: block; }
.ls-ch {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.12s;
  text-align: left;
}
.ls-ch:hover { background: var(--bg-3); }
.ls-ch-active {
  background: var(--red-dim);
  color: var(--red);
  font-weight: 700;
}
.ls-ch-name {
  flex: 1;
}
.ls-ch-live-badge {
  font-size: 0.55rem;
  font-weight: 800;
  color: #22c55e;
  letter-spacing: 0.5px;
}
.ls-ch-off-badge {
  font-size: 0.55rem;
  font-weight: 700;
  color: var(--text-5, #444);
  letter-spacing: 0.3px;
}
.ls-ch-offline {
  opacity: 0.5;
}
.ls-offline {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  padding-top: 56.25%;
  position: relative;
  background: var(--bg-2);
  color: var(--text-4);
  font-size: 0.85rem;
  font-style: italic;
}
.ls-offline::after {
  content: 'Channel not currently live';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ls-offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-5, #444);
  flex-shrink: 0;
}

/* Podcast list */
.ls-podcasts {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  scrollbar-width: thin;
}
.ls-pod {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: none;
  text-decoration: none;
  text-align: left;
  width: 100%;
  cursor: pointer;
  transition: background 0.12s;
}
.ls-pod:hover { background: var(--bg-2); }
.ls-pod-active { background: rgba(215, 38, 56, 0.08); border-left: 3px solid var(--red); }
.ls-pod-unavailable { opacity: 0.45; cursor: default; }
.ls-pod-unavailable:hover { background: none; }
.ls-pod-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}
.ls-pod-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ls-pod-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-1);
}
.ls-pod-pub {
  font-size: 0.72rem;
  color: var(--text-4);
}
.ls-pod-arrow {
  color: var(--text-4);
  flex-shrink: 0;
  transition: color 0.12s;
}
.ls-pod:hover .ls-pod-arrow { color: var(--red); }

/* ── PiP Mini-Player ─────────────────────── */
.ls-pip {
  position: fixed;
  bottom: 80px;
  right: 20px;
  z-index: 9600;
  width: 320px;
  background: var(--bg-1);
  border: 1px solid var(--border-2);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.ls-pip iframe {
  width: 100%;
  aspect-ratio: 16/9;
  display: block;
}
.ls-pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--bg-2);
  cursor: grab;
  user-select: none;
}
.ls-pip-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ls-pip-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ls-pip-btn {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
}
.ls-pip-btn:hover { color: var(--text-1); background: var(--bg-glass-hover); }

@media (max-width: 640px) {
  .ls-pip { width: 240px; right: 8px; bottom: 70px; }
}

/* Mobile */
@media (max-width: 640px) {
  .ls-fab {
    bottom: 70px;
    right: 12px;
    padding: 8px 12px;
  }
  .ls-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 120px;
    max-height: 70vh;
  }
}

/* ══ PHASE 6: Article Content Formatting ═══════════════════ */
.article-body img, .detail-body img, .expanded-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--r-md);
  margin: 16px 0;
  display: block;
}
.article-body figure, .detail-body figure {
  margin: 20px 0;
}
.article-body figcaption, .detail-body figcaption {
  font-size: 0.78rem;
  color: var(--text-3);
  margin-top: 6px;
  font-style: italic;
  line-height: 1.4;
}
.article-body q, .detail-body q {
  display: block;
  border-left: 3px solid var(--accent);
  padding: 10px 16px;
  margin: 16px 0;
  color: var(--text-2);
  font-style: italic;
  background: var(--bg-glass);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.article-body table, .detail-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.85rem;
}
.article-body th, .article-body td, .detail-body th, .detail-body td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-1);
  text-align: left;
}
.article-body th, .detail-body th {
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg-3);
}

/* ══ PHASE 8: Enhanced Animations ═══════════════════════════ */
@keyframes tooltipIn {
  from { opacity: 0; transform: translateX(-50%) translateY(4px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes cardHover {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}
@keyframes slideDown {
  from { opacity: 0; max-height: 0; }
  to { opacity: 1; max-height: 400px; }
}
@keyframes slideUp {
  from { opacity: 1; max-height: 400px; }
  to { opacity: 0; max-height: 0; }
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Card hover lift */
.article-tile { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.article-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hf-card { transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur); }
.hf-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* Smooth view transitions */
.view-fade-in { animation: viewIn 0.3s var(--ease); }

/* Tag panel slide */
.hf-tag-panel { transition: max-height 0.3s var(--ease), opacity 0.3s var(--ease); overflow: hidden; }

/* Sidebar section collapse */
.sidebar-section-body { transition: max-height 0.25s var(--ease), opacity 0.25s var(--ease); overflow: hidden; }

/* ══ PHASE 9: Tooltip System ═══════════════════════════════ */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-4);
  color: var(--text-1);
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  max-width: 280px;
  z-index: 10000;
  pointer-events: none;
  animation: tooltipIn 150ms var(--ease);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-2);
}
[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-4);
  z-index: 10001;
  pointer-events: none;
}
/* Tooltip below variant */
[data-tooltip-below]:hover::after {
  bottom: auto;
  top: calc(100% + 8px);
}
[data-tooltip-below]:hover::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: var(--bg-4);
}

/* ══ PHASE 4: Responsive Fixes ═════════════════════════════ */
/* Topic pills scroll indicator */
.hf-topic-pills {
  position: relative;
  -webkit-mask-image: linear-gradient(to right, black 90%, transparent 100%);
  mask-image: linear-gradient(to right, black 90%, transparent 100%);
}

/* Markets table responsive */
.mkt-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mkt-table { white-space: nowrap; }

/* Event spectrum grid mobile */
@media (max-width: 640px) {
  .sp-grid { grid-template-columns: 1fr !important; }
  .spectrum-grid { grid-template-columns: 1fr !important; }
}

/* Image gallery scroll */
.img-gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.img-gallery img {
  flex-shrink: 0;
  width: 240px;
  height: 160px;
  object-fit: cover;
  border-radius: var(--r-md);
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), opacity var(--dur);
}
.img-gallery img:hover { transform: scale(1.03); opacity: 0.9; }

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease);
  cursor: zoom-out;
}
.lightbox-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: var(--r-md);
  cursor: default;
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ══ PHASE 10: Utility Classes for Inline Style Cleanup ════ */
.max-720 { max-width: 720px; margin-left: auto; margin-right: auto; }
.text-center { text-align: center; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }

@media print {
  #sidebar, #topbar, .mobile-bottom-nav, .expand-meta-bar,
  .collapse-btn, .open-full-btn, .btn-primary, .btn-secondary,
  .refresh-btn, .admin-btn, .ticker-bar { display: none !important; }
  #app { grid-template-columns: 1fr; }
  body { background: white; color: black; }
  .article-tile { break-inside: avoid; border: 1px solid #ddd; }
}
