/* Unbiased Headlines — Premium Dark Theme (Bloomberg meets Apple News) */
:root {
  --bg: #0a0a0b;
  --surface: #141416;
  --surface-hover: #1a1a1e;
  --surface-raised: #1e1e22;
  --text: #e8e8ed;
  --text-secondary: #9a9aa0;
  --text-muted: #5c5c66;
  --accent: #e8e8ed;
  --accent-hover: #ffffff;
  --blue: #4a9eff;
  --blue-dim: rgba(74,158,255,0.12);
  --border: #232328;
  --border-light: #1c1c20;
  --red: #ef4444;
  --red-dim: rgba(239,68,68,0.1);
  --green: #22c55e;
  --green-dim: rgba(34,197,94,0.1);
  --gold: #eab308;
  --purple: #a78bfa;
  --breaking-bg: rgba(239,68,68,0.06);
  --breaking-border: #ef4444;
  --bias-left: #4a9eff;
  --bias-center: #5c5c66;
  --bias-right: #ef4444;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container { max-width: 720px; margin: 0 auto; padding: 0 20px; }

/* ── Push notification banner ── */
.push-banner {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  padding: 10px 0;
  position: relative;
  z-index: 101;
}
.push-banner-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.push-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.push-banner-icon { flex-shrink: 0; opacity: 0.6; }
.push-banner-actions { display: flex; gap: 6px; flex-shrink: 0; }
.push-banner .btn {
  background: var(--blue);
  color: #fff;
  font-size: 0.72rem;
  padding: 4px 10px;
}
.push-banner .btn:hover { opacity: 0.9; }
.push-banner .btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  padding: 4px 10px;
}

/* ── Header ── */
.site-header {
  background: #0a0e14;
  border-bottom: 1px solid #1c2128;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
  font-size: 1.1rem;
  white-space: nowrap;
  letter-spacing: -0.03em;
}
.logo-icon { stroke: var(--text); flex-shrink: 0; opacity: 0.5; }
.logo-text { color: #ffffff; font-weight: 700; }
.logo-accent { color: var(--blue); font-weight: 700; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions .btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.header-actions .btn:hover { background: var(--surface); color: var(--text); }
.header-actions .btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.header-actions .btn-primary:hover { opacity: 0.9; }

/* ── Nav Bar ── */
.nav-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 52px;
  z-index: 99;
}
.nav-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav-scroll::-webkit-scrollbar { display: none; }

.nav-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 0;
  min-width: max-content;
}
.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius-full);
  transition: all var(--transition);
  background: transparent;
  border: none;
}
.nav-pill svg { flex-shrink: 0; opacity: 0.4; }
.nav-pill:hover { color: var(--text-secondary); }
.nav-pill.active {
  color: var(--text);
  background: var(--surface-raised);
  font-weight: 600;
}
.nav-pill.active svg { opacity: 0.8; stroke: var(--text); }
.nav-pill-saved { margin-left: auto; }
.saved-count {
  background: var(--blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-full);
  min-width: 16px;
  text-align: center;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
}
.btn:hover { opacity: 0.9; }
.btn-sm { padding: 5px 12px; font-size: 0.75rem; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover { background: var(--surface); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--surface); }
.btn-load-more {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 12px 32px;
  font-size: 0.85rem;
  border-radius: var(--radius-full);
}
.btn-load-more:hover { background: var(--surface); border-color: var(--text-muted); color: var(--text); }

/* ── Hero (minimal) ── */
.hero {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.hero-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
}
.hero h1 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero p {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ── Main content ── */
.main-content { padding-bottom: 40px; min-height: 50vh; }

/* ── Articles ── */
.articles-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.article-card {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: background var(--transition);
  cursor: pointer;
  position: relative;
}
.article-card:hover { background: var(--surface); margin: 0 -20px; padding: 20px; border-radius: var(--radius); }
.article-card.breaking {
  border-left: 2px solid var(--breaking-border);
  padding-left: 16px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: none;
  border-radius: 0;
}
.category-tag::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}
.cat-politics { color: var(--blue); }
.cat-politics::before { background: var(--blue); }
.cat-tech { color: #22c55e; }
.cat-tech::before { background: #22c55e; }
.cat-defense { color: #eab308; }
.cat-defense::before { background: #eab308; }
.cat-economy { color: #a78bfa; }
.cat-economy::before { background: #a78bfa; }

.breaking-badge {
  background: var(--red);
  color: #fff;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.6} }

.article-time {
  color: var(--text-muted);
  font-size: 0.72rem;
}
.updated-badge {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 600;
}

.article-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 5px;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--text);
}
.article-card .summary {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.article-footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Share & Save buttons on cards ── */
.card-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.action-btn:hover { background: var(--surface-raised); color: var(--text-secondary); }
.action-btn.saved { color: var(--blue); }
.action-btn svg { width: 15px; height: 15px; }

/* ── Share dropdown ── */
.share-dropdown {
  position: absolute;
  right: 0;
  bottom: 100%;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 50;
  min-width: 180px;
  display: none;
}
.share-dropdown.open { display: block; }
.share-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  font-family: inherit;
  transition: background var(--transition);
}
.share-option:hover { background: var(--surface-hover); color: var(--text); }
.share-option svg { width: 15px; height: 15px; flex-shrink: 0; }
.share-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* ── Bias meter ── */
.bias-meter {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
}
.bias-bar {
  width: 40px;
  height: 3px;
  background: linear-gradient(to right, var(--bias-left), var(--bias-center), var(--bias-right));
  border-radius: 2px;
  position: relative;
}
.bias-dot {
  width: 7px;
  height: 7px;
  background: var(--text);
  border: 1.5px solid var(--bg);
  border-radius: 50%;
  position: absolute;
  top: -2px;
  transform: translateX(-50%);
}
.source-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.source-count svg { width: 11px; height: 11px; }

/* ── Article Detail Page ── */
.article-page {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 0 60px;
}
.article-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  margin-bottom: 20px;
  padding: 6px 10px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.article-back:hover { background: var(--surface); color: var(--text); }
.article-back svg { width: 16px; height: 16px; }

.article-page h1 {
  font-size: 1.6rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.article-page .summary-box {
  background: var(--surface);
  border-left: 2px solid var(--blue);
  padding: 14px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 24px;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
.article-page .body { line-height: 1.8; font-size: 0.93rem; }
.article-page .body p { margin-bottom: 16px; }

/* Share bar on article page */
.article-share-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.article-share-bar .share-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 4px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  padding: 0;
}
.share-btn:hover { background: var(--surface); color: var(--text-secondary); }
.share-btn svg { width: 15px; height: 15px; }
.share-btn.twitter:hover { color: #1da1f2; border-color: #1da1f2; }
.share-btn.facebook:hover { color: #1877f2; border-color: #1877f2; }
.share-btn.linkedin:hover { color: #0077b5; border-color: #0077b5; }
.share-btn.email-share:hover { color: var(--green); border-color: var(--green); }

/* ── Sources ── */
.sources-section {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.sources-section h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.source-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}
.source-item a { color: var(--blue); text-decoration: none; }
.source-item a:hover { text-decoration: underline; }

.source-lean {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
}
.lean-left { background: var(--blue-dim); color: var(--blue); }
.lean-center-left { background: rgba(99,102,241,0.1); color: #818cf8; }
.lean-center { background: var(--surface-raised); color: var(--text-muted); }
.lean-center-right { background: rgba(234,179,8,0.1); color: var(--gold); }
.lean-right { background: var(--red-dim); color: var(--red); }

.changelog-section {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.changelog-section h3 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 8px;
}
.changelog-section ul { list-style: none; padding: 0; }
.changelog-section li { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }

/* ── Auth modal ── */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  max-width: 400px;
  width: 92%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.modal h2 { font-size: 1.1rem; margin-bottom: 6px; font-weight: 700; }
.modal p { color: var(--text-secondary); margin-bottom: 18px; font-size: 0.85rem; }
.modal input,
.modal select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 12px;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
}
.modal input:focus, .modal select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(74,158,255,0.15);
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}
.modal-close:hover { background: var(--surface-hover); }

/* ── Settings modal ── */
.settings-section { margin-bottom: 20px; }
.settings-section h3 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
}
.toggle-row label { font-size: 0.85rem; color: var(--text); cursor: pointer; }
.toggle-switch { position: relative; width: 40px; height: 22px; cursor: pointer; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: var(--radius-full);
  transition: background var(--transition);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.toggle-switch input:checked + .toggle-slider { background: var(--blue); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

/* ── Loading / Empty ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.load-more {
  text-align: center;
  padding: 20px 0 32px;
}

/* ── Footer ── */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  background: var(--bg);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand { display: flex; flex-direction: column; gap: 2px; }
.footer-logo { font-weight: 700; font-size: 0.82rem; color: var(--text-secondary); }
.footer-tagline { font-size: 0.72rem; color: var(--text-muted); }
.footer-links { font-size: 0.72rem; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.footer-links a { color: var(--text-muted); text-decoration: none; }
.footer-links a:hover { color: var(--text-secondary); }
.footer-sep { opacity: 0.3; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-muted);
}
.empty-state h2 { font-size: 1.1rem; margin-bottom: 8px; color: var(--text-secondary); font-weight: 700; }
.empty-state p { font-size: 0.88rem; }

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-raised);
  color: var(--text);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  transition: transform 0.3s ease;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ── Responsive — Desktop ── */
@media (min-width: 641px) {
  .container { padding: 0 24px; }
  .header-inner { padding: 16px 0; }
  .logo { font-size: 1.15rem; }
  .nav-pill { padding: 6px 14px; font-size: 0.8rem; }
  .hero { padding: 24px 0 18px; }
  .hero h1 { font-size: 1.4rem; }
  .article-card { padding: 22px 0; }
  .article-card h2 { font-size: 1.1rem; }
  .article-page h1 { font-size: 1.8rem; }
}

/* ── Responsive — Mobile ── */
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { padding: 12px 0; }
  .logo { font-size: 0.95rem; gap: 6px; }
  .logo-icon { width: 20px; height: 20px; }
  .nav-bar { top: 46px; }
  .nav-pill { padding: 5px 10px; font-size: 0.72rem; gap: 4px; }
  .nav-pill svg { width: 11px; height: 11px; }
  .hero { padding: 16px 0 12px; }
  .hero h1 { font-size: 1.15rem; }
  .hero p { font-size: 0.8rem; }
  .article-card h2 { font-size: 0.95rem; }
  .article-card .summary { font-size: 0.82rem; }
  .article-page { padding: 16px 0 40px; }
  .article-page h1 { font-size: 1.35rem; }
  .push-banner-inner { flex-direction: row; }
  .push-banner-content { font-size: 0.75rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .article-share-bar { flex-wrap: wrap; }
  .share-dropdown { right: auto; left: 0; }
}

/* ── Hamburger Menu (Mobile ≤768px) ── */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 26px;
  line-height: 1;
  border-radius: var(--radius);
  transition: background var(--transition);
}
.hamburger-btn:hover { background: var(--surface); }

.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 1000;
  flex-direction: column;
  padding: 20px;
  overflow-y: auto;
}
.mobile-menu.open {
  display: flex !important;
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--text);
  font-size: 28px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
}
.mobile-menu-close:hover { background: var(--surface); }

.mobile-menu-items {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu-items a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background var(--transition);
}

.mobile-menu-items a:hover { background: var(--surface); }
.mobile-menu-items a.active {
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 768px) {
  .hamburger-btn { display: block; }
  .nav-bar { display: none; }
  .header-actions .btn:not(.hamburger-btn) { display: none; }
}

@media (min-width: 769px) {
  .mobile-menu { display: none !important; }
}

/* ── Audio Player (Article TTS) ── */
.audio-player {
  background: #161b22;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.audio-player.hidden { display: none; }
.audio-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 14px;
  transition: opacity var(--transition);
}
.audio-btn:hover { opacity: 0.85; }
.audio-btn.skip {
  width: 28px;
  height: 28px;
  background: var(--surface-raised);
  color: var(--text-secondary);
  font-size: 12px;
}
.audio-btn.skip:hover { color: var(--text); }
.audio-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.audio-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}
.audio-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s linear;
}
.audio-progress-text {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.audio-now-playing {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  min-width: 0;
}
.speed-select {
  background: var(--surface-raised);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 6px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
}
.speed-select:focus { outline: none; border-color: var(--blue); }

/* ── Homepage Headlines Player (fixed bottom) ── */
.headlines-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #161b22;
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.headlines-player.visible { transform: translateY(0); }
.headlines-player .audio-now-playing { max-width: 300px; }
.headlines-player-start {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  transition: all var(--transition);
  margin: 8px 0;
}
.headlines-player-start:hover { background: var(--surface-hover); color: var(--text); }

@media (max-width: 640px) {
  .audio-player { padding: 10px 12px; gap: 8px; }
  .audio-btn { width: 32px; height: 32px; font-size: 12px; }
  .audio-now-playing { max-width: 120px; font-size: 0.7rem; }
  .headlines-player { padding: 8px 12px; gap: 8px; }
  .headlines-player .audio-now-playing { max-width: 140px; }
}

/* Source title in article view */
.source-title {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
  font-style: italic;
}

/* Header logo image */
.logo-img {
  height: 52px;
  width: auto;
  display: block;
}
@media (max-width: 768px) {
  .logo-img { height: 46px; }
}

/* Article card image */
.article-image {
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  margin-bottom: 12px;
}
.article-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
@media (min-width: 769px) {
  .article-image img { height: 240px; }
}

/* View toggle */
.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
}
.view-toggle button {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.view-toggle button.active {
  background: var(--surface);
  color: var(--text);
  border-color: var(--blue);
}

/* List view — compact horizontal cards */
.articles-grid.list-view .article-card {
  padding: 12px;
}
.articles-grid.list-view .article-link {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: flex-start;
}
.articles-grid.list-view .article-image {
  width: 140px;
  min-width: 140px;
  height: 90px;
  border-radius: var(--radius);
  margin-bottom: 0;
  flex-shrink: 0;
}
.articles-grid.list-view .article-image img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius);
}
.articles-grid.list-view .article-text-wrap {
  flex: 1;
  min-width: 0;
}
.articles-grid.list-view h2 {
  font-size: 0.95rem;
  line-height: 1.3;
  margin-bottom: 4px;
}
.articles-grid.list-view .summary {
  font-size: 0.82rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.articles-grid.list-view .article-footer {
  padding: 4px 0 0;
}
.articles-grid.list-view .article-meta {
  margin-bottom: 4px;
}
.articles-grid.list-view .category-tag {
  font-size: 0.7rem;
  padding: 1px 6px;
}

@media (max-width: 480px) {
  .articles-grid.list-view .article-image {
    width: 100px;
    min-width: 100px;
    height: 70px;
  }
  .articles-grid.list-view .article-image img {
    width: 100px;
    height: 70px;
  }
  .articles-grid.list-view h2 { font-size: 0.88rem; }
  .articles-grid.list-view .summary { display: none; }
}

/* Article hero image */
.article-hero-image {
  margin: 16px 0 20px;
  border-radius: 12px;
  overflow: hidden;
}
.article-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}
