/* ═══════════════════════════════════════════════
   my-newsboard · style.css
   ═══════════════════════════════════════════════ */

/* ── CSS Variables: Dark (default) ─────────────── */
:root {
  --bg:          #08090f;
  --surface:     #0d1120;
  --surface-2:   #111827;
  --surface-3:   #1a2235;
  --border:      rgba(255,255,255,.06);
  --border-2:    rgba(255,255,255,.11);
  --text:        #e2e8f5;
  --text-dim:    #94a3b8;
  --text-muted:  #4e5d78;
  --accent:      #60a5fa;
  --accent-2:    #a78bfa;
  --red:         #e63946;
  --shadow:      0 4px 24px rgba(0,0,0,.55);
  --shadow-sm:   0 2px 8px rgba(0,0,0,.35);
  --radius:      12px;
  --radius-sm:   8px;
  --topbar-h:    36px;
  --header-h:    72px;
  --nav-h:       44px;
  --ticker-h:    38px;
}

/* ── CSS Variables: Light ───────────────────────── */
[data-theme="light"] {
  --bg:          #f0f4f9;
  --surface:     #ffffff;
  --surface-2:   #f6f8fc;
  --surface-3:   #edf1f7;
  --border:      rgba(0,0,0,.07);
  --border-2:    rgba(0,0,0,.13);
  --text:        #0f172a;
  --text-dim:    #475569;
  --text-muted:  #64748b;
  --accent:      #2563eb;
  --accent-2:    #7c3aed;
  --shadow:      0 4px 16px rgba(0,0,0,.09);
  --shadow-sm:   0 1px 4px rgba(0,0,0,.07);
}

/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Topbar ─────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 11.5px;
  color: var(--text-muted);
  gap: 8px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 8px; }
.topbar-sep { opacity: .25; user-select: none; }
.topbar-btn {
  color: var(--text-muted);
  font-size: 11.5px;
  display: flex; align-items: center; gap: 5px;
  padding: 2px 0;
  transition: color .15s;
}
.topbar-btn:hover { color: var(--text); }
.topbar-loc { white-space: nowrap; }

/* ── Header ─────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border-2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.logo-badge {
  width: 44px; height: 44px;
  background: var(--red);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff; letter-spacing: .5px;
  box-shadow: 0 0 20px rgba(230,57,70,.35);
  flex-shrink: 0;
}
.logo-badge--sm { width: 28px; height: 28px; font-size: 10px; border-radius: 6px; box-shadow: none; }
.logo-name {
  font-size: 19px; font-weight: 800; color: var(--text);
  line-height: 1.25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.logo-tag {
  font-size: 10px; font-weight: 600;
  color: var(--accent-2);
  background: rgba(167,139,250,.12);
  border: 1px solid rgba(167,139,250,.25);
  padding: 1px 8px; border-radius: 20px;
}
.logo-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Header right */
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: color .15s, background .15s, border-color .15s;
  flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); background: var(--surface-2); border-color: var(--accent); }
.icon-btn.spinning svg { animation: spin .65s linear infinite; }

.search-box {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text-muted);
  transition: border-color .15s;
}
.search-box:focus-within { border-color: var(--accent); }
.search-box input {
  background: none; border: none; outline: none;
  color: var(--text); font-size: 13px; width: 200px;
}
.search-box input::placeholder { color: var(--text-muted); }

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Category Nav ───────────────────────────────── */
.cat-nav {
  position: sticky;
  top: var(--header-h);
  z-index: 99;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.cat-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-list {
  display: flex; gap: 2px;
  flex: 1; overflow-x: auto; scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-btn {
  white-space: nowrap;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.tab-btn:hover { color: var(--text); background: var(--surface-3); }
.tab-btn.active {
  color: var(--accent);
  background: rgba(96,165,250,.1);
  border-color: rgba(96,165,250,.3);
}
.tab-list--sm .tab-btn { font-size: 12px; padding: 3px 11px; }
.tab-count { font-size: 10.5px; opacity: .55; margin-left: 2px; }

.cat-nav-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.region-filter {
  display: flex;
  background: var(--surface-3);
  border-radius: 20px;
  padding: 2px;
  gap: 1px;
}
.region-btn {
  font-size: 11.5px; font-weight: 500;
  color: var(--text-muted);
  padding: 3px 11px; border-radius: 18px;
  transition: color .15s, background .15s, box-shadow .15s;
}
.region-btn.active {
  color: var(--text);
  background: var(--surface-2);
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.saved-btn {
  font-size: 12px; color: var(--text-muted);
  padding: 4px 10px;
  border: 1px solid var(--border-2);
  border-radius: 6px;
  white-space: nowrap;
  transition: color .15s;
}
.saved-btn:hover { color: var(--text); }

/* Sub-category bar */
.sub-cat-bar {
  position: sticky;
  top: calc(var(--header-h) + var(--nav-h));
  z-index: 98;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sub-cat-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
}

/* ── Ticker ─────────────────────────────────────── */
.ticker-bar {
  display: flex;
  align-items: center;
  height: var(--ticker-h);
  background: rgba(230,57,70,.07);
  border-bottom: 1px solid rgba(230,57,70,.12);
  overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  background: var(--red);
  color: #fff;
  font-size: 11px; font-weight: 700;
  letter-spacing: .3px;
  padding: 0 16px;
  height: 100%;
  display: flex; align-items: center;
}
.ticker-wrap { flex: 1; overflow: hidden; }
.ticker-track { display: flex; }
.ticker-inner {
  display: inline-block;
  white-space: nowrap;
  color: var(--text-dim);
  font-size: 12.5px;
  padding-left: 20px;
  animation: ticker-scroll 70s linear infinite;
}
.ticker-inner:hover { animation-play-state: paused; }
@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Loading bar ─────────────────────────────────── */
.loading-bar {
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer { 0%{background-position:200%} 100%{background-position:-200%} }

/* ── Stats bar ───────────────────────────────────── */
.stats-bar {
  max-width: 1280px; margin: 0 auto;
  padding: 10px 20px 0;
  font-size: 11.5px; color: var(--text-muted);
  min-height: 22px;
}

/* ── Page layout ─────────────────────────────────── */
.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 20px 56px;
}
.page-grid {
  display: grid;
  grid-template-columns: 280px 1fr 360px;
  gap: 24px;
  align-items: start;
}
@media (max-width: 1200px) {
  .page-grid { grid-template-columns: 1fr 360px; }
  .page-left-sidebar { display: none; }
}
@media (max-width: 1060px) {
  .page-grid { grid-template-columns: 1fr; }
}

/* ── Left sidebar (gas) ──────────────────────── */
.page-left-sidebar {
  position: sticky;
  top: calc(var(--header-h) + var(--nav-h) + var(--ticker-h) + 20px);
  max-height: calc(100vh - var(--header-h) - var(--nav-h) - var(--ticker-h) - 40px);
  overflow-y: auto; scrollbar-width: none;
}
.page-left-sidebar::-webkit-scrollbar { display: none; }
@media (max-width: 640px)  { .page { padding: 12px 12px 40px; } }

/* ── Mobile fixes (≤ 640px) ──────────────────────────────── */
@media (max-width: 640px) {
  /* Topbar — hide location text, keep clock + buttons */
  .topbar { padding: 0 12px; }
  .topbar-loc { display: none; }
  .topbar-sep { display: none; }

  /* Header — hide search, shrink logo */
  .header-inner { padding: 0 12px; gap: 8px; }
  .search-box   { display: none; }
  .logo-sub     { display: none; }
  .logo-name    { font-size: 16px; }
  .logo-badge   { width: 36px; height: 36px; font-size: 13px; border-radius: 8px; }

  /* Nav — tighter padding */
  .cat-nav-inner { padding: 0 12px; gap: 6px; }
  .saved-btn     { display: none; }

  /* Sidebar stacks below on mobile — already handled by grid */
  .page-sidebar  { position: static; max-height: none; overflow: visible; }
}

/* ── Gold/Gas sidebar widgets ────────────────────── */
/* App-icon style wrapper */
.cw-icon-wrap {
  width: 52px; height: 52px; flex-shrink: 0;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
}
/* Gold icon: dark warm-gray matching the reference (#252836) */
.cw-icon-gold { background: #252836; }
/* Gas icon: dark blue */
.cw-icon-gas  { background: #1a2535; }

.cw-header-text { flex: 1; min-width: 0; }
.cw-unit {
  font-size: 10.5px; color: var(--text-muted);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 5px;
  padding: 3px 7px;
  white-space: nowrap;
  align-self: flex-start;
}

/* ── Change badges ──────────────────────────────────────── */
/* Design: colored text on transparent tinted background     */
/* (matches reference: NOT white-on-solid, but color-on-tint) */
.gt-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px;
  margin-top: 3px; line-height: 1.6;
}
/* dark mode */
.gt-down { color: #f87171; background: rgba(239,68,68,.15); }
.gt-up   { color: #4ade80; background: rgba(74,222,128,.12); }
.gt-flat { color: var(--text-muted); background: rgba(148,163,184,.1); }

/* light mode */
[data-theme="light"] .gt-down { color: #dc2626; background: rgba(220,38,38,.1); }
[data-theme="light"] .gt-up   { color: #16a34a; background: rgba(22,163,74,.1); }
[data-theme="light"] .gt-flat { color: #64748b; background: rgba(100,116,139,.1); }
.gold-source-tabs {
  display: flex; gap: 4px;
  margin-bottom: 10px;
  background: var(--surface-3);
  padding: 3px; border-radius: 8px;
}
.gold-tab {
  flex: 1; text-align: center;
  font-size: 11.5px; font-weight: 600;
  padding: 5px 4px; border-radius: 6px;
  color: var(--text-muted);
  transition: color .15s, background .15s;
}
.gold-tab:hover  { color: var(--text); }
.gold-tab.active { background: var(--red); color: #fff; }

.gold-table-wrap table,
.gas-table-wrap table {
  width: 100%; border-collapse: collapse;
}
.gold-table-wrap thead th,
.gas-table-wrap  thead th {
  font-size: 10px; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: .3px;
  padding: 0 0 6px; border-bottom: 1px solid var(--border);
  text-align: right;
}
.gold-table-wrap thead th:first-child,
.gas-table-wrap  thead th:first-child { text-align: left; }
.gold-table-wrap tbody tr,
.gas-table-wrap  tbody tr { border-bottom: 1px solid var(--border); }
.gold-table-wrap tbody tr:last-child,
.gas-table-wrap  tbody tr:last-child { border-bottom: none; }

/* Gold rows */
.gt-name  { font-size: 11.5px; color: var(--text); padding: 6px 0; vertical-align: top; }
.gt-pct   { font-size: 10px; color: var(--text-muted); margin-top: 1px; }
.gt-price { font-size: 12px; font-weight: 700; text-align: right; padding: 6px 0 6px 6px; vertical-align: middle; white-space: nowrap; }
.gt-buy   { color: var(--text); }
.gt-sell  { color: #f59e0b; }  /* amber — matches reference */

/* Gas rows */
.gas-name   { font-size: 11px; color: var(--text); padding: 5px 0; }
.gas-price  { font-size: 11px; font-weight: 600; color: var(--text); text-align: right; padding: 5px 0 5px 6px; white-space: nowrap; }
.gas-change { font-size: 10px; font-weight: 600; text-align: right; padding: 5px 0 5px 4px; white-space: nowrap; }
/* dark mode */
.gas-change.up   { color: #4ade80; }
.gas-change.down { color: #f87171; }
.gas-change.flat { color: var(--text-muted); }
/* light mode */
[data-theme="light"] .gas-change.up   { color: #16a34a; }
[data-theme="light"] .gas-change.down { color: #dc2626; }

.cw-updated { font-size: 9.5px; color: var(--text-muted); text-align: right; margin-top: 6px; }
.cw-loading { font-size: 11px; color: var(--text-muted); padding: 14px 0; text-align: center; }
.cw-error   { font-size: 11px; color: var(--red); padding: 8px 0; text-align: center; }

/* ── Commodities left sidebar ────────────────────── */
.page-commodities {
  display: flex; flex-direction: column; gap: 16px;
  position: sticky;
  top: calc(var(--header-h) + var(--nav-h) + var(--ticker-h) + 20px);
  max-height: calc(100vh - var(--header-h) - var(--nav-h) - var(--ticker-h) - 40px);
  overflow-y: auto; scrollbar-width: none;
}
.page-commodities::-webkit-scrollbar { display: none; }

.commodity-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
.cw-header {
  display: flex; align-items: center; gap: 9px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cw-icon  { font-size: 18px; flex-shrink: 0; }
.cw-title { font-size: 12.5px; font-weight: 700; color: var(--text); line-height: 1.3; }
.cw-sub   { font-size: 10px; color: var(--text-muted); margin-top: 1px; }

/* Gold — featured (SJC) */
.gold-featured   { margin-bottom: 10px; }
.gold-feat-name  {
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px;
}
.gold-price-row  { display: flex; align-items: center; gap: 5px; padding: 3px 0; }
.gpr-label { font-size: 10.5px; color: var(--text-muted); width: 26px; flex-shrink: 0; }
.gpr-value { font-size: 12.5px; font-weight: 700; color: var(--text); flex: 1; }
.gpr-sell  { color: #fbbf24; }
.gpr-change {
  font-size: 9.5px; font-weight: 600; padding: 1px 5px; border-radius: 4px;
}
.gpr-change.up   { color: #22c55e; background: rgba(34,197,94,.12); }
.gpr-change.down { color: #ef4444; background: rgba(239,68,68,.12); }
.gpr-change.flat { color: var(--text-muted); }

/* Gold — mini table */
.gold-mini { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.gold-mini tr { border-bottom: 1px solid var(--border); }
.gold-mini tr:last-child { border-bottom: none; }
.gold-mini td { padding: 3px 0; vertical-align: middle; }
.gm-name  { font-size: 10.5px; color: var(--text-dim); }
.gm-price { font-size: 11px; font-weight: 600; color: var(--text); text-align: right; padding-right: 4px; }
.gm-dir   { width: 14px; text-align: right; }

/* Direction icons */
.dir-up   { color: #22c55e; font-size: 9px; }
.dir-down { color: #ef4444; font-size: 9px; }
.dir-flat { color: var(--text-muted); font-size: 9px; opacity: .4; }

/* Gas table */
.gas-tbl { width: 100%; border-collapse: collapse; margin-bottom: 6px; }
.gas-tbl thead th {
  font-size: 9.5px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .3px;
  padding: 0 0 5px; border-bottom: 1px solid var(--border);
}
.gas-tbl thead th:not(:first-child) { text-align: right; }
.gas-tbl tbody tr { border-bottom: 1px solid var(--border); }
.gas-tbl tbody tr:last-child { border-bottom: none; }
.gas-name  { font-size: 10.5px; color: var(--text-dim); padding: 4px 0; }
.gas-price { font-size: 11px; font-weight: 600; color: var(--text); text-align: right; padding: 4px 3px; white-space: nowrap; }
.gas-dir   { width: 12px; text-align: right; padding-left: 2px; }

.cw-updated { font-size: 9.5px; color: var(--text-muted); text-align: right; margin-top: 4px; }
.cw-loading { font-size: 11px; color: var(--text-muted); padding: 12px 0; text-align: center; }
.cw-error   { font-size: 11px; color: var(--red); padding: 8px 0; text-align: center; }

/* ── Section header ──────────────────────────────── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.section-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 7px;
}
.section-title svg { color: var(--accent); }
.link-all { font-size: 12px; color: var(--text-muted); transition: color .15s; }
.link-all:hover { color: var(--accent); }

/* AI toggle */
.ai-toggle-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 16px;
}
.toggle-switch {
  position: relative; display: inline-block;
  width: 32px; height: 18px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; inset: 0; border-radius: 18px;
  background: var(--surface-3);
  cursor: pointer; transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute; width: 12px; height: 12px;
  left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
input:checked + .toggle-slider { background: var(--accent); }
input:checked + .toggle-slider::before { transform: translateX(14px); }

/* ── Featured card ───────────────────────────────── */
.featured-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  transition: box-shadow .2s;
}
.featured-card:hover { box-shadow: 0 8px 40px rgba(0,0,0,.65); }

.featured-hero {
  height: 248px;
  display: flex; align-items: flex-end;
  padding: 14px 16px;
  position: relative;
}
/* Compact strip when no real image — just shows source badges */
.featured-hero--no-img {
  height: 72px;
  align-items: center;
}
.featured-badges { display: flex; gap: 7px; flex-wrap: wrap; }

.badge {
  display: inline-flex; align-items: center;
  font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  color: #fff; letter-spacing: .2px;
  white-space: nowrap;
}
.badge-featured { background: var(--red); }
.badge-sm { font-size: 9.5px; padding: 2px 7px; }

.featured-body { padding: 16px 20px 22px; }

.article-meta {
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 10px;
}
.meta-sep { opacity: .35; }
.meta-source { font-weight: 600; color: var(--text-dim); }

.featured-title {
  font-size: 21px; font-weight: 800;
  line-height: 1.3; color: var(--text);
  margin-bottom: 10px;
}
.featured-excerpt {
  font-size: 13.5px; color: var(--text-dim);
  line-height: 1.65; margin-bottom: 14px;
}

/* AI summary box */
.ai-box {
  background: rgba(167,139,250,.06);
  border: 1px solid rgba(167,139,250,.18);
  border-left: 3px solid var(--accent-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin-bottom: 18px;
}
.ai-box-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--accent-2);
  text-transform: uppercase; letter-spacing: .6px;
  margin-bottom: 9px;
  display: flex; align-items: center; gap: 5px;
}
.ai-box ul  { padding: 0; }
.ai-box li {
  font-size: 13px; color: var(--text-dim);
  line-height: 1.6;
  padding: 3px 0 3px 18px;
  position: relative;
}
.ai-box li::before {
  content: '▸';
  position: absolute; left: 0; top: 4px;
  color: var(--accent-2); font-size: 10px;
}
.ai-box p { font-size: 13px; color: var(--text-dim); line-height: 1.65; }

.btn-read-more {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600;
  color: var(--accent);
  padding: 8px 18px;
  border: 1px solid rgba(96,165,250,.3);
  border-radius: var(--radius-sm);
  background: rgba(96,165,250,.07);
  transition: background .15s, border-color .15s;
}
.btn-read-more:hover {
  background: rgba(96,165,250,.14);
  border-color: var(--accent);
  text-decoration: none;
}
.btn-read-more .arrow { transition: transform .15s; }
.btn-read-more:hover .arrow { transform: translateX(3px); }

/* ── Quick reads ─────────────────────────────────── */
.quick-section { margin-top: 4px; }
.quick-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 12px;
}
.quick-title svg { color: #facc15; }
.quick-grid { display: flex; flex-direction: column; gap: 10px; }

.quick-card {
  display: flex; gap: 0; align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.quick-card:hover {
  border-color: var(--border-2);
  transform: translateX(3px);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}
.qc-image {
  width: 96px; flex-shrink: 0;
  min-height: 82px;
}
.qc-body {
  padding: 10px 14px 10px 12px;
  flex: 1; display: flex; flex-direction: column; gap: 5px;
  min-width: 0;
}
.qc-top { display: flex; align-items: center; gap: 6px; }
.qc-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.qc-meta {
  font-size: 11px; color: var(--text-muted);
  margin-top: auto;
  display: flex; gap: 4px; align-items: center;
}

/* ── More articles (load-more results) ──────────────── */
.more-articles-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

/* ── Load more ───────────────────────────────────── */
.load-more-wrap { display: flex; justify-content: center; margin-top: 28px; }
.btn-load-more {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 24px;
  color: var(--text);
  font-size: 13px; font-weight: 500;
  padding: 9px 28px;
  transition: background .15s, border-color .15s;
}
.btn-load-more:hover { background: var(--surface-2); border-color: var(--accent); }

/* ── Sidebar ─────────────────────────────────────── */
.page-sidebar {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: calc(var(--header-h) + var(--nav-h) + var(--ticker-h) + 20px);
  max-height: calc(100vh - var(--header-h) - var(--nav-h) - var(--ticker-h) - 40px);
  overflow-y: auto; scrollbar-width: none;
}
.page-sidebar::-webkit-scrollbar { display: none; }
@media (max-width: 1060px) { .page-sidebar { position: static; max-height: none; overflow: visible; } }

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.sidebar-card-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.sidebar-card-title { font-size: 14px; font-weight: 700; color: var(--text); }
.sidebar-card-meta  { font-size: 11px; color: var(--text-muted); }

/* Telegram CTA card */
.telegram-card {
  background: linear-gradient(150deg, #0c2461 0%, #1e3799 100%);
  border-color: rgba(96,165,250,.2);
  text-align: center;
}
[data-theme="light"] .telegram-card {
  background: linear-gradient(150deg, #1d4ed8 0%, #2563eb 100%);
}
.tc-icon { font-size: 32px; margin-bottom: 10px; }
.tc-title { font-size: 15px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.tc-sub   { font-size: 11px; color: rgba(255,255,255,.6); margin-bottom: 10px; }
.tc-desc  { font-size: 12px; color: rgba(255,255,255,.5); line-height: 1.55; margin-bottom: 16px; }
.btn-telegram {
  display: inline-flex; align-items: center; gap: 7px;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 9px 20px; border-radius: var(--radius-sm);
  transition: background .15s;
  width: 100%; justify-content: center;
}
.btn-telegram:hover { background: rgba(255,255,255,.25); }

/* Most read list */
.most-read-list { display: flex; flex-direction: column; gap: 13px; }
.mr-item  { display: flex; gap: 11px; align-items: flex-start; }
.mr-rank  {
  font-size: 22px; font-weight: 900;
  color: var(--border-2); line-height: 1;
  flex-shrink: 0; min-width: 30px;
  font-variant-numeric: tabular-nums;
}
.mr-body  { flex: 1; min-width: 0; }
.mr-title {
  display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 12.5px; font-weight: 600; color: var(--text);
  line-height: 1.45; transition: color .15s;
}
.mr-title:hover { color: var(--accent); }
.mr-meta { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

/* Expert corner */
.expert-list  { display: flex; flex-direction: column; gap: 4px; }
.expert-item  { display: flex; align-items: center; gap: 10px; }
.expert-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11.5px; font-weight: 700; flex-shrink: 0;
}
.expert-name { font-size: 12.5px; font-weight: 600; color: var(--text); }
.expert-role { font-size: 11px; color: var(--text-muted); }
.expert-quote {
  font-size: 12.5px; color: var(--text-dim); line-height: 1.6;
  font-style: italic;
  border-left: 2px solid var(--border-2);
  padding-left: 10px; margin-left: 46px;
  margin-top: 6px; margin-bottom: 4px;
}

/* ── Empty state ─────────────────────────────────── */
.empty-state {
  text-align: center; padding: 80px 20px;
}
.empty-icon  { font-size: 56px; margin-bottom: 20px; }
.empty-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.empty-hint  { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.empty-cmd {
  display: inline-block;
  background: var(--surface); border: 1px solid var(--border-2);
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-family: 'SFMono-Regular', Consolas, 'Courier New', monospace;
  font-size: 12px; color: var(--text); word-break: break-all;
}

/* ── Footer ──────────────────────────────────────── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border-2);
  margin-top: 48px;
}
.footer-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 40px 20px 32px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
}
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .footer-inner { grid-template-columns: 1fr; } }

.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.footer-name { font-size: 15px; font-weight: 700; }
.footer-desc { font-size: 12px; color: var(--text-muted); line-height: 1.65; }
.footer-col-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px;
  color: var(--text-dim); margin-bottom: 12px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 8px; }
.footer-col li { font-size: 12.5px; color: var(--text-muted); }

.footer-bottom {
  max-width: 1280px; margin: 0 auto;
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; color: var(--text-muted);
}
.footer-links { display: flex; gap: 16px; }
.footer-links a { color: var(--text-muted); transition: color .15s; }
.footer-links a:hover { color: var(--accent); }

/* ── Modal ───────────────────────────────────────── */
.modal[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }

.modal-box {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius);
  padding: 36px 32px 28px;
  width: 100%; max-width: 420px;
  position: relative;
  text-align: center;
  animation: slideUp .2s ease;
}
@keyframes slideUp { from { transform: translateY(18px); opacity: 0 } to { transform: none; opacity: 1 } }

.modal-close {
  position: absolute; top: 14px; right: 14px;
  color: var(--text-muted); font-size: 16px;
  padding: 5px 9px; border-radius: 6px;
  transition: color .15s, background .15s;
}
.modal-close:hover { color: var(--text); background: var(--surface-3); }
.modal-icon  { font-size: 52px; margin-bottom: 16px; }
.modal-title { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.modal-desc  { font-size: 13px; color: var(--text-muted); line-height: 1.65; margin-bottom: 22px; }
.modal-input {
  width: 100%; background: var(--surface-3);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  padding: 10px 14px; margin-bottom: 12px; outline: none;
  transition: border-color .15s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-btn {
  width: 100%; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 600; padding: 11px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s; margin-bottom: 14px;
}
.modal-btn:hover { opacity: .88; }
.modal-note { font-size: 11px; color: var(--text-muted); }
