/* ============================================================
   NEXUS NEWS — Mobile-First News Platform
   Al Jazeera–inspired professional design
   ============================================================ */

/* ── VARIABLES ─────────────────────────────────────────────── */
:root {
  --accent:        #e8272d;
  --accent-dim:    rgba(232,39,45,0.15);
  --accent-2:      #f0a500;
  --live-green:    #22c55e;

  /* Typography */
  --font-display:  'Playfair Display', Georgia, serif;
  --font-body:     'Source Serif 4', Georgia, serif;
  --font-ui:       'DM Sans', system-ui, sans-serif;

  /* Spacing */
  --nav-h:         108px;
  --ticker-h:      34px;
  --safe-top:      env(safe-area-inset-top, 0px);
  --safe-bottom:   env(safe-area-inset-bottom, 0px);
  --gap:           12px;
  --r:             10px;
  --r-lg:          16px;
}

/* Dark theme (default) */
[data-theme="dark"] {
  --bg:            #0f0f0f;
  --bg-2:          #181818;
  --bg-3:          #222222;
  --bg-4:          #2a2a2a;
  --border:        rgba(255,255,255,0.08);
  --text-1:        #f0ede8;
  --text-2:        #a0998f;
  --text-3:        #6b6460;
  --nav-bg:        rgba(15,15,15,0.96);
  --card-shadow:   0 2px 16px rgba(0,0,0,0.4);
  --skeleton:      #1e1e1e;
  --skeleton-shine:#242424;
}

/* Light theme */
[data-theme="light"] {
  --bg:            #f6f4f1;
  --bg-2:          #ffffff;
  --bg-3:          #ede9e4;
  --bg-4:          #e2ddd8;
  --border:        rgba(0,0,0,0.08);
  --text-1:        #1a1714;
  --text-2:        #58524c;
  --text-3:        #8c857f;
  --nav-bg:        rgba(246,244,241,0.97);
  --card-shadow:   0 2px 12px rgba(0,0,0,0.08);
  --skeleton:      #e8e5e1;
  --skeleton-shine:#f0ede9;
}

/* ── RESET ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text-1);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
  padding-top: var(--nav-h);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, button { -webkit-appearance: none; appearance: none; }

/* ── BREAKING TICKER ────────────────────────────────────────── */
.breaking-ticker {
  position: fixed;
  top: 0;
  left: 0; right: 0;
  height: var(--ticker-h);
  background: var(--accent);
  display: flex;
  align-items: center;
  z-index: 200;
  overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  border-right: 1px solid rgba(255,255,255,0.25);
  height: 100%;
}
.ticker-label .fa-circle-dot {
  animation: pulse 1.2s infinite;
}
.ticker-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}
.ticker-inner {
  display: inline-block;
  animation: ticker 30s linear infinite;
}
.ticker-item {
  display: inline-block;
  padding: 0 32px;
  font-size: 12px;
  color: rgba(255,255,255,0.92);
  font-family: var(--font-ui);
  font-weight: 500;
}
.ticker-item a { color: #fff; }
@keyframes ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── NAVBAR ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: var(--ticker-h);
  left: 0; right: 0;
  background: var(--nav-bg);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 190;
  transition: transform .25s ease, box-shadow .25s ease;
}
.navbar.hide { transform: translateY(calc(-100% - var(--ticker-h))); }
.navbar.scrolled { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  height: 52px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 16px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.01em;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 16px;
  transition: background .2s, color .2s;
}
.icon-btn:active, .icon-btn:hover { background: var(--bg-3); color: var(--text-1); }
.icon-btn.active { color: var(--accent); }

/* ── SEARCH BAR ─────────────────────────────────────────────── */
.search-bar {
  display: none;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}
.search-bar.open { display: block; }
.search-form {
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border-radius: 24px;
  padding: 0 14px;
  gap: 8px;
}
.search-icon { color: var(--text-3); font-size: 14px; }
.search-form input {
  flex: 1;
  border: none;
  background: none;
  height: 40px;
  color: var(--text-1);
  font-size: 15px;
  font-family: var(--font-ui);
  outline: none;
}
.search-form input::placeholder { color: var(--text-3); }
.search-close {
  color: var(--text-3);
  font-size: 16px;
  padding: 4px;
}
.search-suggestions {
  margin-top: 8px;
  background: var(--bg-2);
  border-radius: var(--r);
  overflow: hidden;
  border: 1px solid var(--border);
}
.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: var(--bg-3); }
.suggestion-item i { color: var(--accent); font-size: 12px; }

/* ── CATEGORIES ─────────────────────────────────────────────── */
.categories-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-top: 1px solid var(--border);
}
.categories-scroll::-webkit-scrollbar { display: none; }
.categories-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  width: max-content;
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--font-ui);
  color: var(--text-2);
  background: var(--bg-3);
  white-space: nowrap;
  transition: background .2s, color .2s;
  letter-spacing: .01em;
}
.cat-pill.active {
  background: var(--accent);
  color: #fff;
}
.cat-pill:active { opacity: .8; }

/* ── MAIN CONTENT ────────────────────────────────────────────── */
.main-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 var(--gap) calc(var(--gap) + var(--safe-bottom));
}

/* ── LIVE SECTION ────────────────────────────────────────────── */
.live-section {
  margin: 14px 0;
  background: var(--bg-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--live-green);
  font-family: var(--font-ui);
}
.live-badge .fa-signal { animation: livePulse 1.5s infinite; }
.live-time {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-ui);
}
.live-feed { padding: 6px 0; }

.live-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.live-item:last-child { border-bottom: none; }
.live-item:active { background: var(--bg-3); }
.live-dot {
  flex-shrink: 0;
  margin-top: 5px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-3);
}
.live-dot.breaking {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
  animation: pulse 1.5s infinite;
}
.live-text { flex: 1; }
.live-headline {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-1);
  line-height: 1.4;
  font-family: var(--font-ui);
}
.live-meta {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}
.breaking-label {
  color: var(--accent);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .06em;
}

/* ── HERO CARD ──────────────────────────────────────────────── */
.hero-section { margin-bottom: 4px; }
.hero-card {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--bg-2);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.hero-img-wrap {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
}
.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.hero-card:active .hero-img { transform: scale(1.02); }
.hero-no-img {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-4) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 40px;
}
.hero-overlay {
  padding: 14px;
}
.hero-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 7px;
  font-family: var(--font-ui);
}
.hero-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 800;
  line-height: 1.22;
  color: var(--text-1);
  letter-spacing: -.02em;
  margin-bottom: 8px;
}
.hero-desc {
  font-size: 14px;
  color: var(--text-2);
  font-family: var(--font-body);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}
.hero-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hero-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  font-family: var(--font-ui);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.hero-time {
  font-size: 11px;
  color: var(--text-3);
  font-family: var(--font-ui);
}

/* ── FEED HEADER ────────────────────────────────────────────── */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 10px;
}
.feed-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.01em;
}
.refresh-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 14px;
  transition: background .2s, transform .3s;
}
.refresh-btn:active { background: var(--bg-4); }
.refresh-btn.spinning i { animation: spin 1s linear infinite; }

/* ── NEWS GRID ──────────────────────────────────────────────── */
.news-grid {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.news-card {
  background: var(--bg-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  text-decoration: none;
  display: block;
}
.news-card:active { transform: scale(0.99); box-shadow: none; }

.card-layout {
  display: flex;
  gap: 0;
}

/* Horizontal card (image left, text right) */
.news-card.horizontal .card-layout {
  flex-direction: row;
  align-items: stretch;
}
.news-card.horizontal .card-img-wrap {
  flex-shrink: 0;
  width: 110px;
  aspect-ratio: 1;
}
.news-card.horizontal .card-body {
  flex: 1;
  padding: 12px;
  min-width: 0;
}

/* Vertical card (image top) */
.news-card.vertical .card-layout {
  flex-direction: column;
}
.news-card.vertical .card-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
}
.news-card.vertical .card-body {
  padding: 12px;
}

.card-img-wrap {
  overflow: hidden;
  background: var(--bg-3);
  position: relative;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.news-card:active .card-img { transform: scale(1.03); }
.card-no-img {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 24px;
  background: var(--bg-3);
}

.card-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
  font-family: var(--font-ui);
}
.card-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-1);
  letter-spacing: -.01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.news-card.vertical .card-title {
  font-size: 17px;
  -webkit-line-clamp: 2;
}
.card-desc {
  font-size: 13px;
  color: var(--text-2);
  font-family: var(--font-body);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
}
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-source {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-3);
  font-family: var(--font-ui);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-time {
  font-size: 10.5px;
  color: var(--text-3);
  font-family: var(--font-ui);
  flex-shrink: 0;
}
.card-save {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 12px;
  transition: color .2s;
}
.card-save.saved { color: var(--accent); }

/* breaking badge on card */
.card-breaking {
  position: absolute;
  top: 8px; left: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .07em;
  padding: 3px 7px;
  border-radius: 4px;
  font-family: var(--font-ui);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── LOAD MORE ──────────────────────────────────────────────── */
.load-more-wrap {
  padding: 16px 0 8px;
  display: flex;
  justify-content: center;
}
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--bg-2);
  border: 1.5px solid var(--border);
  border-radius: 24px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  font-family: var(--font-ui);
  transition: background .2s, border-color .2s;
}
.load-more-btn:active { background: var(--bg-3); }
.load-more-btn.loading {
  pointer-events: none;
  color: var(--text-3);
}

/* ── ARTICLE SHEET (OVERLAY) ────────────────────────────────── */
.article-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  display: flex;
  align-items: flex-end;
}
.article-overlay.open { pointer-events: all; }

.article-sheet {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  max-height: 93vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
  padding-bottom: var(--safe-bottom);
}
.article-overlay.open .article-sheet {
  transform: translateY(0);
}

.sheet-handle {
  width: 36px; height: 4px;
  background: var(--bg-4);
  border-radius: 2px;
  margin: 12px auto 0;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 2;
}
.sheet-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  font-size: 15px;
}
.sheet-actions { display: flex; gap: 6px; }
.sheet-action {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 15px;
  transition: color .2s;
}
.sheet-action.active { color: var(--accent); }
.sheet-content { padding: 16px; }

.article-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--text-3);
  font-size: 14px;
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--bg-4);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* Article sheet content styles */
.sa-cat {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: var(--font-ui);
  margin-bottom: 8px;
}
.sa-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: var(--text-1);
  margin-bottom: 12px;
}
.sa-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.sa-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 14px;
  flex-shrink: 0;
}
.sa-author { font-size: 13px; font-weight: 600; color: var(--text-1); font-family: var(--font-ui); }
.sa-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.sa-hero {
  width: calc(100% + 32px);
  margin: 0 -16px 16px;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
}
.sa-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.sa-body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  color: var(--text-1);
}
.sa-body p { margin-bottom: 16px; }
.sa-body p:last-child { margin-bottom: 0; }

.sa-source-box {
  margin: 20px 0;
  padding: 12px 14px;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 3px solid var(--accent);
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.sa-source-link {
  color: var(--accent);
  font-weight: 600;
  margin-left: auto;
}
.sa-share-row {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.sa-share-btn {
  flex: 1;
  height: 40px;
  border-radius: 20px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 15px;
  transition: background .2s, color .2s;
}
.sa-share-btn:active { background: var(--bg-4); }
.sa-share-btn.twitter:active  { color: #1DA1F2; }
.sa-share-btn.facebook:active { color: #1877F2; }
.sa-share-btn.whatsapp:active { color: #25D366; }

.sa-related { margin-top: 24px; }
.sa-related-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.sa-related-grid { display: flex; flex-direction: column; gap: 10px; }
.sa-related-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  cursor: pointer;
}
.sa-related-img {
  width: 72px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.sa-related-no-img {
  width: 72px; height: 56px;
  border-radius: 8px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  flex-shrink: 0;
}
.sa-related-t { flex: 1; min-width: 0; }
.sa-related-src { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; font-family: var(--font-ui); }
.sa-related-title-t {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
  font-family: var(--font-ui);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 3px 0;
}
.sa-related-time { font-size: 10.5px; color: var(--text-3); }

/* ── OVERLAY DIM ─────────────────────────────────────────────── */
.overlay-dim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 290;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
  backdrop-filter: blur(2px);
}
.overlay-dim.show { opacity: 1; pointer-events: all; }

/* ── BOOKMARKS PANEL ─────────────────────────────────────────── */
.bookmarks-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 88%;
  max-width: 340px;
  background: var(--bg);
  z-index: 310;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.16,1,.3,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--safe-bottom);
}
.bookmarks-panel.open { transform: translateX(0); }
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
}
.panel-header h3 {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-display);
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-header h3 i { color: var(--accent); }
.panel-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 15px;
}
.bookmarks-list { padding: 12px; }
.bm-card {
  display: flex;
  gap: 10px;
  padding: 10px;
  background: var(--bg-2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  text-decoration: none;
  cursor: pointer;
}
.bm-img {
  width: 64px; height: 48px;
  border-radius: 7px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-3);
}
.bm-text { flex: 1; min-width: 0; }
.bm-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-ui);
}
.bm-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 14px;
}
.bm-empty i { font-size: 32px; margin-bottom: 10px; display: block; color: var(--text-3); opacity: .5; }

/* ── ARTICLE PAGE ────────────────────────────────────────────── */
body.article-page { padding-top: 0; }
.article-topbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  padding: 0 12px;
  height: 52px;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  gap: 10px;
}
.back-home {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  font-size: 15px;
  flex-shrink: 0;
}
.topbar-logo {
  flex: 1;
  text-align: center;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -.01em;
}
.topbar-actions { display: flex; gap: 4px; }

.reading-progress {
  position: sticky;
  top: 52px;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 99;
  transition: width .1s linear;
}

.article-page-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px;
}

.article-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.article-cat-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: var(--font-ui);
}
.breaking-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .07em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  font-family: var(--font-ui);
  animation: pulse 2s infinite;
}

.article-headline {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.025em;
  color: var(--text-1);
  margin-bottom: 16px;
}

.article-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.byline-author {
  display: flex;
  align-items: center;
  gap: 10px;
}
.byline-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 15px;
  flex-shrink: 0;
}
.author-name { font-size: 13.5px; font-weight: 600; color: var(--text-1); display: block; font-family: var(--font-ui); }
.byline-sep { color: var(--text-3); margin: 0 2px; }
.pub-time { font-size: 12px; color: var(--text-3); font-family: var(--font-ui); }
.byline-right { flex-shrink: 0; }
.read-time { font-size: 12px; color: var(--text-3); font-family: var(--font-ui); display: flex; align-items: center; gap: 5px; }

.article-hero-fig {
  margin: 0 -16px 22px;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: var(--bg-3);
}
.article-hero-img { width: 100%; height: 100%; object-fit: cover; }

.article-body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text-1);
}
.article-body p { margin-bottom: 20px; }
.article-body p:last-child { margin-bottom: 0; }

.article-source-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 24px 0;
  padding: 14px;
  background: var(--bg-2);
  border-radius: var(--r);
  border-left: 3px solid var(--accent);
  font-size: 13px;
  color: var(--text-2);
}
.source-link { color: var(--accent); font-weight: 600; margin-left: auto; display: flex; align-items: center; gap: 5px; font-size: 12.5px; }

.article-share-row {
  display: flex;
  gap: 8px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin: 20px 0;
}
.share-btn {
  flex: 1;
  height: 42px;
  border-radius: 21px;
  background: var(--bg-3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 16px;
  transition: background .2s, color .2s;
}
.share-btn:active { background: var(--bg-4); }
.bookmark-article-btn.active { color: var(--accent); }

.related-section { padding: 0 0 30px; }
.related-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-1);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.related-grid { display: flex; flex-direction: column; gap: 10px; }
.related-card {
  display: flex;
  gap: 10px;
  background: var(--bg-2);
  border-radius: var(--r);
  border: 1px solid var(--border);
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .15s;
}
.related-card:active { opacity: .85; }
.related-card img {
  width: 90px; height: 70px;
  object-fit: cover;
  flex-shrink: 0;
}
.related-no-img {
  width: 90px; height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-3);
  color: var(--text-3);
  flex-shrink: 0;
}
.related-card-body { flex: 1; padding: 10px 10px 10px 0; min-width: 0; }
.related-source { font-size: 10px; color: var(--accent); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.related-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.35;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font-ui);
}
.related-time { font-size: 11px; color: var(--text-3); }

/* ── SKELETON LOADERS ────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton-img,
.skeleton-line,
.skeleton-hero-img,
.skeleton-dot,
.skeleton-live-item .skeleton-line {
  background: linear-gradient(90deg, var(--skeleton) 25%, var(--skeleton-shine) 50%, var(--skeleton) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.skeleton-card {
  background: var(--bg-2);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex !important;
  cursor: default;
}
.skeleton-img { width: 110px; height: 85px; border-radius: 0; flex-shrink: 0; }
.skeleton-body { flex: 1; padding: 12px; }
.skeleton-line { height: 12px; margin-bottom: 8px; border-radius: 6px; }
.skeleton-line.short { width: 45%; }
.skeleton-line.medium { width: 70%; }
.skeleton-hero-img { width: 100%; aspect-ratio: 16/9; border-radius: 0; }
.skeleton-hero-text { padding: 14px; }
.skeleton-live-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.skeleton-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text-1);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 24px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  pointer-events: none;
  z-index: 400;
  font-family: var(--font-ui);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── ANIMATIONS ─────────────────────────────────────────────── */
@keyframes pulse  { 0%,100%{opacity:1} 50%{opacity:.4} }
@keyframes livePulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.7;transform:scale(0.9)} }
@keyframes spin   { to{transform:rotate(360deg)} }
@keyframes fadeUp { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }

.news-card { animation: fadeUp .35s ease both; }
.news-card:nth-child(1) { animation-delay: .03s; }
.news-card:nth-child(2) { animation-delay: .06s; }
.news-card:nth-child(3) { animation-delay: .09s; }
.news-card:nth-child(4) { animation-delay: .12s; }
.news-card:nth-child(5) { animation-delay: .15s; }
.news-card:nth-child(6) { animation-delay: .18s; }

/* ── MISC ───────────────────────────────────────────────────── */
.no-results {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-3);
}
.no-results i { font-size: 36px; margin-bottom: 12px; display: block; opacity: .5; }
.no-results h3 { font-size: 17px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.no-results p { font-size: 14px; }

/* Desktop: constrain to mobile width */
@media (min-width: 500px) {
  .main-content,
  .article-page-content,
  .article-sheet {
    max-width: 480px;
  }
  .breaking-ticker,
  .navbar {
    max-width: 100%;
  }
}
