/* ═══════════════════════════════════════════════════════
   Pulse — News Aggregator  |  Global Stylesheet
   ═══════════════════════════════════════════════════════ */

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

/* Screen-reader only utility */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content link — hidden until focused via keyboard */
.skip-link {
  position: absolute;
  top: -40px;
  left: 8px;
  background: var(--accent, #2563eb);
  color: #fff;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  z-index: 10000;
  transition: top .15s;
}
.skip-link:focus { top: 8px; }

/* Focus styles */
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}

/* ── LIGHT MODE (default) ────────────────────────────── */
:root {
  --bg:           #f4f5f7;
  --surface:      #ffffff;
  --border:       #e2e5ea;
  --text:         #1a1d23;
  --text-muted:   #6b7280;
  --text-light:   #9ca3af;
  --primary:      #0f172a;
  --primary-light:#1e293b;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --card-hover-border: #c7d2fe;
  --sidebar-w:    260px;
  --topbar-h:     56px;
  --countrybar-h: 52px;
  --header-h:     108px;
  --radius:       10px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md:    0 4px 12px rgba(0,0,0,.10);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  scrollbar-gutter: stable;
  transition: background .2s, color .2s;
}

/* ── DARK MODE ───────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --text-light:   #64748b;
  --primary:      #020617;
  --primary-light:#131f35;
  --accent:       #60a5fa;
  --accent-hover: #93c5fd;
  --card-hover-border: #3b82f6;
  --shadow:       0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-md:    0 4px 12px rgba(0,0,0,.4);
}

/* ── TOP BAR ─────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--primary);
  z-index: 200;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  padding: 0 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 12px;
  background: rgba(15, 30, 60, 0.7);
  border: 1px solid rgba(96,165,250,.22);
  transition: background .15s, border-color .15s;
}
.logo:hover {
  background: rgba(96,165,250,.12);
  border-color: rgba(96,165,250,.4);
}

.logo-wave {
  width: 72px;
  height: 40px;
  display: block;
}

/* ── PAGE NAV (News / Live TV) ───────────────────────────*/
.page-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}
.page-nav-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.page-nav-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.page-nav-btn:hover  { background: rgba(255,255,255,.08); color: #e2e8f0; }
.page-nav-btn.active { background: var(--accent); color: #fff; }

/* ── COUNTRY BAR ─────────────────────────────────────── */
.country-bar {
  position: fixed;
  top: var(--topbar-h);
  left: 0; right: 0;
  height: var(--countrybar-h);
  background: var(--primary-light);
  border-bottom: 1px solid rgba(255,255,255,.07);
  z-index: 190;
  display: flex;
  align-items: center;
}

.country-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  width: 100%;
  height: 100%;
}
.country-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: #94a3b8;
  padding: 7px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1;
}
.tab-btn .tab-flag { font-size: 15px; }
.tab-btn:hover  {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.2);
  color: #e2e8f0;
}
.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

/* Topbar right */
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

/* ── LANGUAGE TOGGLE ─────────────────────────────────── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  flex-shrink: 0;
}
.lang-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  color: rgba(255,255,255,.55);
  font-size: .75rem;
  font-weight: 700;
  width: 36px;
  height: 36px;
  cursor: pointer;
  letter-spacing: .06em;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s, border-color .2s, box-shadow .2s;
}
.lang-btn:hover {
  background: rgba(255,255,255,.18);
  color: #fff;
  transform: scale(1.06);
}
#langBtnFR.active {
  background: #2563eb;
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 10px rgba(59,130,246,.55);
  animation: langPop .32s cubic-bezier(.34,1.56,.64,1);
}
#langBtnEN.active {
  background: #dc2626;
  border-color: #f87171;
  color: #fff;
  box-shadow: 0 0 10px rgba(220,38,38,.55);
  animation: langPop .32s cubic-bezier(.34,1.56,.64,1);
}
@keyframes langPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.22); }
  75%  { transform: scale(0.91); }
  100% { transform: scale(1); }
}
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}
#searchInput {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  color: #fff;
  padding: 6px 12px 6px 34px;
  width: 200px;
  font-size: 13px;
  outline: none;
  transition: background .2s, border-color .2s, width .25s;
}
#searchInput::placeholder { color: #64748b; }
#searchInput:focus {
  background: rgba(255,255,255,.15);
  border-color: rgba(255,255,255,.3);
  width: 260px;
}

/* Icon buttons (refresh, theme, mobile-filter) */
.icon-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(255,255,255,.2); color: #fff; }
.icon-btn.spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Good-news heart button */
.good-news-btn { transition: background .15s, color .15s, box-shadow .2s; }
.good-news-btn.active {
  background: rgba(244,63,94,.25);
  color: #fb7185;
  border-color: rgba(251,113,133,.5);
  box-shadow: 0 0 12px rgba(251,113,133,.5);
}
.good-news-btn.active svg { animation: heartbeat .8s ease infinite; }
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  30%     { transform: scale(1.35); }
  60%     { transform: scale(1.1); }
}

/* ── GOOD NEWS BANNER ────────────────────────────────── */
.good-news-banner {
  display: none;
  overflow: hidden;
  max-height: 0;
  transition: max-height .4s cubic-bezier(.4,0,.2,1), opacity .3s;
  opacity: 0;
}
.good-news-banner.visible {
  display: block;
  max-height: 80px;
  opacity: 1;
}
.gnb-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(251,113,133,.15) 0%, rgba(251,191,36,.12) 100%);
  border: 1px solid rgba(251,113,133,.25);
  font-size: .85rem;
  color: var(--text-main);
  animation: gnbSlideIn .4s cubic-bezier(.4,0,.2,1);
}
.gnb-text   { font-weight: 700; color: #fb7185; letter-spacing: .02em; }
.gnb-sub    { color: var(--text-light); font-size: .8rem; }
.gnb-hearts { font-size: 1.1rem; animation: gnbFloat 2.5s ease-in-out infinite; }
.gnb-hearts:last-child { animation-delay: 1.2s; }
@keyframes gnbSlideIn {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
@keyframes gnbFloat {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-4px); }
}

/* ── GOOD NEWS MODE — body-level overrides ───────────── */
body.good-news-mode .article-grid {
  --gn-glow: rgba(251,113,133,.18);
}
body.good-news-mode .card {
  border-color: rgba(251,113,133,.3);
  box-shadow: 0 2px 12px rgba(251,113,133,.12), var(--card-shadow, none);
  transition: border-color .2s, box-shadow .2s, transform .18s;
}
body.good-news-mode .card:hover {
  border-color: rgba(251,113,133,.6);
  box-shadow: 0 6px 24px rgba(251,113,133,.22);
}
body.good-news-mode .card-title { color: #be185d; }
[data-theme="dark"] body.good-news-mode .card-title,
body.good-news-mode [data-theme="dark"] .card-title { color: #fb7185; }
body.good-news-mode .cat-badge {
  outline: 1px solid rgba(251,113,133,.35);
}
/* Tiny heart badge on each card in good-news mode */
body.good-news-mode .card::before {
  content: '💛';
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: .75rem;
  opacity: .7;
  pointer-events: none;
}
body.good-news-mode .card { position: relative; }
/* Result count turns cheerful */
body.good-news-mode .result-count { color: #fb7185; font-weight: 600; }

/* Mobile filter button — hidden on desktop */
#mobileFilterBtn { display: none; }

/* ── LAYOUT ──────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── SIDEBAR ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 0 14px 40px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  overflow-x: visible;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  transition: width .25s cubic-bezier(.4,0,.2,1), padding .25s, background .2s, border-color .2s;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── SIDEBAR HEADER ──────────────────────────────────── */
.sidebar-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2px 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
}
.sidebar-hd-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-light);
}
.sidebar-close-btn {
  display: none; /* shown on mobile only */
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-light);
  width: 28px;
  height: 28px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
  flex-shrink: 0;
}
.sidebar-close-btn:hover { background: var(--border); color: var(--text-main); }

/* ── DESKTOP COLLAPSE TOGGLE ─────────────────────────── */
.sidebar-toggle-btn {
  position: absolute;
  top: 50%;
  right: -14px;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  z-index: 10;
  transition: background .15s, color .15s;
}
.sidebar-toggle-btn:hover { background: var(--bg); color: var(--text-main); }
.sidebar { position: sticky; } /* keep it relative for the toggle */

/* Collapsed sidebar (desktop) */
body.sidebar-collapsed .sidebar {
  width: 0;
  padding-left: 0;
  padding-right: 0;
  overflow: hidden;
  border-right-color: transparent;
}
body.sidebar-collapsed .sidebar-toggle-btn {
  right: -24px;
}
body.sidebar-collapsed #toggleChevron {
  transform: rotate(180deg);
}

/* Mobile sidebar drawer */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 150;
}
.sidebar-overlay.open { display: block; }

/* ── FLOATING FILTER FAB (mobile only) ───────────────── */
.filter-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 16px;
  z-index: 140;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 12px 18px;
  gap: 8px;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.filter-fab:hover  { transform: scale(1.04); }
.filter-fab:active { transform: scale(.97); }
.fab-label { font-size: 14px; font-weight: 600; }
.fab-badge {
  background: #fb7185;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -2px;
}

/* Stats card */
.stats-card {
  display: flex;
  justify-content: space-around;
  align-items: center;
  background: var(--primary);
  border-radius: var(--radius);
  padding: 12px 8px;
  margin-bottom: 20px;
}
.stat { text-align: center; }
.stat-value { display: block; font-size: 18px; font-weight: 700; color: #fff; }
.stat-label { font-size: 10px; color: #64748b; text-transform: uppercase; letter-spacing: .5px; }
.stat-sep { width: 1px; height: 32px; background: rgba(255,255,255,.1); }

/* Filter sections */
.filter-section { margin-bottom: 20px; }
.filter-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.clear-btn {
  font-size: 10px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.clear-btn:hover { text-decoration: underline; }

/* Radio group */
.radio-group { display: flex; flex-direction: column; gap: 4px; border: none; padding: 0; min-inline-size: 0; }
.radio-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  transition: background .1s, color .1s;
}
.radio-opt input { accent-color: var(--accent); }
.radio-opt:hover  { background: var(--bg); color: var(--text); }
.radio-opt.active { background: rgba(37,99,235,.1); color: var(--accent); font-weight: 500; }

/* Filter chips */
.filter-list { display: flex; flex-direction: column; gap: 3px; }
.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
  transition: background .12s, color .12s;
  width: 100%;
}
.filter-chip:hover  { background: var(--bg); color: var(--text); }
.filter-chip.active { background: rgba(37,99,235,.1); color: var(--accent); font-weight: 500; }
.chip-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--chip-color, #607d8b);
  flex-shrink: 0;
}

/* Source chips */
.source-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  text-align: left;
  transition: background .12s, color .12s;
  width: 100%;
}
.source-chip:hover  { background: var(--bg); color: var(--text); }
.source-chip.active { background: rgba(37,99,235,.1); color: var(--accent); font-weight: 500; }
.source-chip-favicon {
  width: 14px; height: 14px;
  border-radius: 2px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Breakdown */
.breakdown-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 4px;
  font-size: 12px;
}
.breakdown-label { color: var(--text-muted); }
.breakdown-count {
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  padding: 1px 7px;
  border-radius: 10px;
  font-size: 11px;
}
.sidebar-hint { font-size: 12px; color: var(--text-light); font-style: italic; padding: 4px; }

/* ── CONTENT ─────────────────────────────────────────── */
.content {
  flex: 1;
  min-width: 0;
  padding: 20px 24px 40px;
}

/* Toolbar */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.toolbar-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.result-count { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.last-updated { font-size: 12px; color: var(--text-light); }

/* Active filter tags */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37,99,235,.1);
  border: 1px solid rgba(37,99,235,.2);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}
.filter-tag-remove {
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  opacity: .6;
  transition: opacity .1s;
}
.filter-tag-remove:hover { opacity: 1; }

/* ── ARTICLE GRID ────────────────────────────────────── */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Loading / empty */
.no-results {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results h3 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.no-results p  { font-size: 13px; }

/* Skeleton loading */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--border) 25%, var(--bg) 50%, var(--border) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite linear;
}
.skel-line { height: 13px; border-radius: 4px; }

/* ── CARD ────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s, border-color .2s, background .2s;
}
@media (hover: hover) {
  .card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--card-hover-border);
  }
}

/* Card body */
.card-meta,
.card-title,
.card-desc,
.card-footer {
  padding-left: 16px;
  padding-right: 16px;
}
.card-meta  { padding-top: 14px; }
.card-footer { padding-bottom: 12px; }
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.card-source {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.source-favicon {
  width: 16px; height: 16px;
  border-radius: 3px;
  object-fit: contain;
  flex-shrink: 0;
}
.source-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.source-flag { font-size: 12px; flex-shrink: 0; }
.card-date {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  flex-shrink: 0;
}
.card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .15s;
  margin-top: 8px;
  flex: 1;
}
.card-title:hover { color: var(--accent); }
.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 6px;
}
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  gap: 6px;
}
.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  letter-spacing: .2px;
}
.card-link-btn {
  font-size: 12px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
  white-space: nowrap;
}
.card-link-btn:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── PAGINATION ──────────────────────────────────────── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.page-btn:hover:not(:disabled) { background: var(--bg); border-color: #93c5fd; color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ── FOOTER ──────────────────────────────────────────── */
footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px;
  margin-top: 0;
  transition: background .2s, border-color .2s;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  text-align: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── MADE BY STAN BADGE ──────────────────────────────── */
.made-by-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  padding: 4px 12px 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .3px;
  overflow: hidden;
  transition:
    border-color .35s ease,
    box-shadow   .35s ease,
    background   .35s ease,
    color        .25s ease;
}

/* Sliding underline that draws left → right on hover */
.made-by-badge::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 0%;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 0 0 20px 20px;
  transition: width .45s cubic-bezier(.4, 0, .2, 1);
}

@media (hover: hover) {
  .made-by-badge:hover {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent),
                0 4px 20px color-mix(in srgb, var(--accent) 18%, transparent);
    background: color-mix(in srgb, var(--accent) 6%, var(--surface));
    color: var(--accent);
  }
  .made-by-badge:hover::after {
    width: 100%;
  }

  /* Letters cascade upward on hover */
  .made-by-badge:hover .stan-letter:nth-child(2) { transform: translateY(-3px); transition-delay:  20ms; }
  .made-by-badge:hover .stan-letter:nth-child(3) { transform: translateY(-3px); transition-delay:  60ms; }
  .made-by-badge:hover .stan-letter:nth-child(4) { transform: translateY(-3px); transition-delay: 100ms; }
  .made-by-badge:hover .stan-letter:nth-child(5) { transform: translateY(-3px); transition-delay: 140ms; }
}

/* Individual letter spring */
.stan-letter {
  display: inline-block;
  transform: translateY(0);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}

/* Pulsing dot — heartbeat idle animation */
.made-by-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: mby-pulse 2.2s ease-in-out infinite;
}
@keyframes mby-pulse {
  0%, 100% { transform: scale(1);   opacity: .5; box-shadow: none; }
  50%       { transform: scale(1.5); opacity: 1;  box-shadow: 0 0 6px var(--accent); }
}
.footer-legal {
  font-size: 11px;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 680px;
}
.footer-legal a { color: var(--accent); text-decoration: none; }
.footer-legal a:hover { text-decoration: underline; }
.footer-copy {
  font-size: 11px;
  color: var(--text-light);
}

/* ── STREAK BADGE ────────────────────────────────────── */
.streak-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, rgba(251,146,60,.15), rgba(239,68,68,.1));
  border: 1px solid rgba(251,146,60,.3);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fb923c;
  margin-bottom: 20px;
  transition: border-color .2s;
}
.streak-fire { font-size: 14px; }

/* ── SAVED TOGGLE ────────────────────────────────────── */
.saved-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  text-align: left;
}
.saved-toggle:hover  { background: var(--bg); color: var(--text); }
.saved-toggle.active { background: rgba(37,99,235,.1); border-color: var(--accent); color: var(--accent); }

/* ── TRENDING BAR ────────────────────────────────────── */
.trending-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  min-height: 0;
}
.trending-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--text-light);
  margin-right: 2px;
}
.trending-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.trending-tag:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.trending-count {
  font-size: 10px;
  color: var(--text-light);
  font-weight: 400;
}

/* ── CARD ENHANCEMENTS ───────────────────────────────── */
.card.seen { opacity: .6; }
.card.seen:hover { opacity: 1; }

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.read-time {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
}

.bookmark-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s, transform .12s;
  flex-shrink: 0;
  min-width: 42px;
  min-height: 42px;
}
.bookmark-btn svg { width: 18px; height: 18px; }
.bookmark-btn:hover  { color: var(--accent); border-color: var(--accent); transform: scale(1.08); }
.bookmark-btn.saved  { color: var(--accent); border-color: var(--accent); background: var(--bg); }

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 220px; }
  .content { padding: 16px; }
  #searchInput { width: 140px; }
  .topbar-inner { gap: 10px; padding: 0 12px; }
}

/* Topbar compact on small screens */
@media (max-width: 600px) {
  /* Shrink logo */
  .logo { padding: 5px 8px; border-radius: 10px; flex-shrink: 0; }
  .logo-wave { width: 48px; height: 28px; }

  /* Lang buttons same size as icon-btns on mobile */
  .lang-btn { width: 40px; height: 40px; border-radius: 10px; font-size: .8rem; }

  /* Buttons fill full width evenly — search is hidden on mobile */
  .topbar-right { justify-content: space-evenly; gap: 0; }

  /* Bigger tap targets */
  .icon-btn { width: 40px; height: 40px; border-radius: 10px; }
  .icon-btn svg { width: 18px; height: 18px; }

  /* Topbar taller for comfort */
  :root { --topbar-h: 62px; }
  .topbar-inner { gap: 0; padding: 0 10px; }
}

/* On mobile, show only flag + abbreviated name or just flag */
@media (max-width: 700px) {
  .tab-btn .tab-name { display: none; }
  .tab-btn { padding: 7px 12px; font-size: 15px; gap: 0; }
  .tab-btn.tab-all .tab-name { display: inline; font-size: 13px; }
}

@media (max-width: 700px) {
  /* Sidebar becomes a fixed drawer — starts below the topbar */
  .sidebar {
    position: fixed;
    top: var(--header-h);
    left: -100%;
    width: min(300px, 88vw);
    height: calc(100dvh - var(--header-h));
    z-index: 160;
    padding-top: 0;
    transition: left .28s cubic-bezier(.4,0,.2,1);
    box-shadow: 4px 0 32px rgba(0,0,0,.25);
  }
  .sidebar.open { left: 0; }

  /* Also start the overlay below the topbar so it doesn't block the header */
  .sidebar-overlay {
    top: var(--header-h);
  }

  /* Show close button & hide collapse toggle on mobile */
  .sidebar-close-btn  { display: flex; align-items: center; justify-content: center; }
  .sidebar-toggle-btn { display: none; }

  /* Show FAB, hide topbar burger */
  .filter-fab { display: flex; }
  #mobileFilterBtn { display: none !important; }

  /* Hide search on very small screens */
  .search-box { display: none; }

  .content { padding: 12px 12px 80px; } /* 80px = above FAB */
  .article-grid { grid-template-columns: 1fr; }

  footer { padding: 20px 16px 80px; }

  /* Disable desktop collapse on mobile */
  body.sidebar-collapsed .sidebar { width: min(300px, 88vw); }
}

@media (max-width: 400px) {
  .tab-btn { padding: 5px 8px; font-size: 11px; }
}

/* ── MODALS ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 400;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .22s;
}
.modal-overlay.visible { opacity: 1; }

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(12px);
  transition: transform .22s cubic-bezier(.34,1.56,.64,1);
}
.modal-overlay.visible .modal-box { transform: translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; margin: 0; }

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-light);
  padding: 4px 8px;
  border-radius: 8px;
  transition: background .15s, color .15s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-desc {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ── READING STATS ───────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stats-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stats-val { font-size: 1.4rem; font-weight: 700; color: var(--text); }
.stats-lbl { font-size: .72rem; color: var(--text-light); font-weight: 500; }

.stats-chart-title {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 0 0 12px;
}
.mini-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 70px;
}
.mini-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 4px;
}
.mini-bar {
  width: 100%;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  opacity: .75;
  min-height: 4px;
  transition: height .3s;
}
.mini-label { font-size: .65rem; color: var(--text-light); }

/* ── SUBSCRIBE FORM ──────────────────────────────────────── */
.subscribe-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.subscribe-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .15s;
}
.subscribe-form input[type="email"]:focus { border-color: var(--accent); }
.subscribe-submit {
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.subscribe-submit:hover { opacity: .85; }
.subscribe-msg {
  font-size: .85rem;
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: 8px;
}
.subscribe-msg.success { background: #dcfce7; color: #15803d; }
.subscribe-msg.error   { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .subscribe-msg.success { background: #14532d; color: #86efac; }
[data-theme="dark"] .subscribe-msg.error   { background: #450a0a; color: #fca5a5; }

/* ── SHORTCUTS GRID ──────────────────────────────────────── */
.shortcuts-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  align-items: center;
}
kbd {
  display: inline-block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-bottom-width: 3px;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: .8rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.shortcuts-grid span { font-size: .88rem; color: var(--text-muted); }

/* ── AUTOCOMPLETE ────────────────────────────────────────── */
.search-box { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 200;
  overflow: hidden;
}
.ac-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-size: .88rem;
  cursor: pointer;
  color: var(--text);
  transition: background .12s;
}
.ac-item:hover { background: var(--bg); }
.ac-count {
  font-size: .75rem;
  color: var(--text-light);
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 20px;
}

/* ── PWA INSTALL BANNER ──────────────────────────────────── */
.pwa-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 300;
  font-size: .88rem;
  color: var(--text);
  opacity: 0;
  transition: transform .3s cubic-bezier(.34,1.56,.64,1), opacity .3s;
  white-space: nowrap;
}
.pwa-banner.visible { transform: translateX(-50%) translateY(0); opacity: 1; }
.pwa-install-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
}
.pwa-install-btn:hover { opacity: .85; }
.pwa-dismiss-btn {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}

/* ── SHARE BUTTON ────────────────────────────────────────── */
.share-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color .15s, background .15s, border-color .15s, transform .12s;
  flex-shrink: 0;
  min-width: 42px;
  min-height: 42px;
}
.share-btn svg { width: 18px; height: 18px; }
.share-btn:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.08); }

/* ── AI SUMMARY ──────────────────────────────────────────── */
.ai-summary { margin: 6px 0 4px; }
.ai-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .78rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: background .15s, border-color .15s, color .15s;
}
.ai-btn:hover:not(:disabled) { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.ai-btn:disabled { opacity: .6; cursor: default; }
.ai-text {
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 6px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

/* ── CATEGORY CHIP COUNT BADGE ───────────────────────────── */
.chip-count {
  margin-left: 4px;
  font-size: .68rem;
  font-weight: 600;
  background: rgba(255,255,255,.18);
  color: inherit;
  padding: 0 5px;
  border-radius: 10px;
}

/* ── SIDEBAR ACTION BUTTONS ──────────────────────────────── */
.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 8px 8px;
}
.sidebar-action-btn {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: .85rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s, color .15s;
}
.sidebar-action-btn:hover { background: var(--surface); border-color: var(--accent); color: var(--accent); }

/* ── Source health modal ────────────────────────────── */
.health-content { padding: 12px 4px 4px; max-height: 60vh; overflow-y: auto; }
.health-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: .85rem;
  color: var(--text-muted);
}
.health-list { display: flex; flex-direction: column; gap: 4px; }
.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: .85rem;
}
.health-row-name { font-weight: 600; color: var(--text); }
.health-row-meta { font-size: .75rem; color: var(--text-muted); }
.health-row.offline { border-left: 3px solid #ef4444; }
.health-row.warn    { border-left: 3px solid #f59e0b; }
.health-empty { padding: 24px; text-align: center; color: var(--text-muted); }

/* ── Health pill in topbar ───────────────────────────── */
.health-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  padding: 4px 10px;
  color: #cbd5e1;
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.health-pill:hover { background: rgba(255,255,255,.12); }
.health-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34,197,94,.5);
}
.health-pill.warn  .health-dot { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.health-pill.error .health-dot { background: #ef4444; box-shadow: 0 0 6px rgba(239,68,68,.5); }

/* ── For You chip ────────────────────────────────────── */
.for-you-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #78350f;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
[data-theme="dark"] .for-you-chip {
  background: linear-gradient(135deg, rgba(252,211,77,.18), rgba(252,211,77,.08));
  color: #fcd34d;
  border-color: rgba(252,211,77,.35);
}
.for-you-chip:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(245,158,11,.18); }
.for-you-chip[aria-pressed="true"] {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-color: transparent;
}
.for-you-icon { font-size: .9rem; }

/* ── Featured hero (Article of the day) ──────────────── */
.featured-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 1.4fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin: 0 0 18px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.featured-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--card-hover-border);
}
.featured-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--border);
}
.featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.featured-hero:hover .featured-img { transform: scale(1.04); }
.featured-body { padding: 22px 26px; display: flex; flex-direction: column; justify-content: center; gap: 8px; }
.featured-eyebrow {
  display: inline-block;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  color: #78350f;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  width: fit-content;
}
[data-theme="dark"] .featured-eyebrow {
  background: linear-gradient(135deg, rgba(252,211,77,.25), rgba(245,158,11,.4));
  color: #fef3c7;
}
.featured-title { font-size: 1.35rem; font-weight: 700; line-height: 1.25; margin: 4px 0; letter-spacing: -.01em; }
.featured-desc  { color: var(--text-muted); font-size: .9rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.featured-meta  { display: flex; gap: 10px; align-items: center; font-size: .78rem; color: var(--text-muted); margin-top: 4px; }
.featured-cat { padding: 2px 8px; border-radius: 999px; background: var(--border); color: var(--text); font-weight: 600; }

@media (max-width: 720px) {
  .featured-hero { grid-template-columns: 1fr; }
  .featured-img-wrap { aspect-ratio: 16 / 9; }
}

/* ── Card hero image ─────────────────────────────────── */
.card-image-link {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s;
}
.card-image-link:hover .card-image { transform: scale(1.04); }
.card.seen .card-image { filter: grayscale(.4); }

/* ── Toast notifications ─────────────────────────────── */
.toast-host {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}
.toast {
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: .88rem;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  pointer-events: auto;
  max-width: 90vw;
}
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.success { background: #065f46; }
.toast.error   { background: #991b1b; }

/* ── Infinite scroll sentinel ────────────────────────── */
#infiniteSentinel { height: 1px; }
.load-more-btn {
  display: block;
  margin: 24px auto;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
.load-more-btn:hover { background: var(--accent-hover); }
.load-more-btn[disabled] { opacity: .5; cursor: default; }

/* Duplicate-source pill on cards */
.dup-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .7rem;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 999px;
  margin-left: 6px;
}
