/* ============================================================
   StoxFeed — Financial Markets Modern Design
   Navy + green palette inspired by the StoxFeed logo
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  /* Colour — Dark Navy (not too dark) */
  --bg:             #1a2435;
  --bg-secondary:   #1f2b3e;
  --surface:        #253347;
  --text:           #e4e9f0;
  --muted:          #8494a7;
  --accent:         #34C665;
  --accent-soft:    rgba(52, 198, 101, 0.1);
  --brand-stox:     #34C665;
  --brand-feed:     #a0b4c8;
  --border:         rgba(255, 255, 255, 0.08);
  --card-shadow:    0 1px 3px rgba(0, 0, 0, 0.25), 0 4px 16px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3), 0 12px 40px rgba(0, 0, 0, 0.2);
  --gradient-hero:  linear-gradient(135deg, #172030 0%, #1a2638 30%, #1c2a3c 60%, #1e2e42 100%);
  --gradient-accent: linear-gradient(135deg, #34C665, #2ba856, #1F2D3E);
  --glass-bg:       rgba(26, 36, 53, 0.88);
  --glass-border:   rgba(255, 255, 255, 0.08);
  --featured-bg:    linear-gradient(135deg, #1e2c40 0%, #1a2f38 100%);
  --featured-text:  #e4e9f0;
  --featured-muted: #8498ad;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-10: 4rem;
  --space-12: 5rem;
  --space-16: 8rem;

  /* Layout */
  --site-max-width: 1280px;
  --page-gutter:    1.5rem;
  --content-width:  760px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

/* ── Light Mode (slightly lighter warm gray) ─────────────── */
[data-theme="light-gray"] {
  --bg:             #f8f9fb;
  --bg-secondary:   #eef0f4;
  --surface:        #ffffff;
  --text:           #111827;
  --muted:          #4b5563;
  --accent:         #28a04e;
  --accent-soft:    rgba(40, 160, 78, 0.1);
  --brand-stox:     #28a04e;
  --brand-feed:     #1F2D3E;
  --border:         rgba(0, 0, 0, 0.12);
  --card-shadow:    0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 16px rgba(0, 0, 0, 0.06);
  --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12), 0 12px 40px rgba(0, 0, 0, 0.10);
  --gradient-hero:  linear-gradient(135deg, #f5f7fa 0%, #f7f8fb 30%, #f5f7fa 60%, #f6f8f7 100%);
  --gradient-accent: linear-gradient(135deg, #28a04e, #1F2D3E);
  --glass-bg:       rgba(255, 255, 255, 0.85);
  --glass-border:   rgba(0, 0, 0, 0.10);
  --featured-bg:    linear-gradient(135deg, #edf2f7 0%, #f0f3f6 100%);
  --featured-text:  #111827;
  --featured-muted: #4b5563;
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: inherit;
  text-decoration: none;
}

p a, li a:not(.site-nav a):not(.footer-links a):not(.topic-pill) {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
  transition: text-decoration-color 0.2s ease;
}

p a:hover, li a:not(.site-nav a):not(.footer-links a):not(.topic-pill):hover {
  text-decoration-color: var(--accent);
}

/* ── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  margin: var(--space-6) 0 var(--space-3);
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.5rem; margin-top: var(--space-8); }
h3 { font-size: 1.2rem; }

h2 a, h3 a { text-decoration: none; }
h2 a:hover, h3 a:hover { color: var(--muted); }

hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
}

/* ── Layout Container ───────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.page, .post {
  width: 100%;
  max-width: 100%;
}

/* page h1 hidden — title now rendered via hero-slim above feed-layout */
.page h1:first-child {
  display: none;
}

/* ── Site Header — Glass Morphism ───────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header-shell {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* Logo — left aligned */
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
  text-decoration: none;
}

.logo-image {
  width: 40px;
  height: auto;
  display: block;
}

/* Show dark logo by default (dark theme), hide light logo */
.logo-light { display: none; }

/* In light-gray mode, swap logos */
[data-theme="light-gray"] .logo-dark { display: none; }
[data-theme="light-gray"] .logo-light { display: block; }

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-stox { color: var(--brand-stox); }
.brand-feed { color: var(--brand-feed); }
/* Legacy class compat */
.brand-health { color: var(--brand-stox); }
.brand-wire   { color: var(--brand-feed); }

/* ── Navigation — Right Aligned ────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color 0.2s ease, background 0.2s ease;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--accent-soft);
}

.site-nav a.active {
  color: var(--text);
  font-weight: 600;
}

/* ── Hamburger Toggle ────────────────────────────────────── */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.nav-toggle:hover {
  background: var(--accent-soft);
}

.hamburger-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
  border-radius: 1px;
}

.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.site-nav.is-open .nav-toggle .hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Theme Toggle Button ────────────────────────────────── */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 1rem;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.theme-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* In dark mode (default): show moon icon (click to go light) */
.theme-icon--sun { display: none; }
.theme-icon--moon { display: block; }

/* In light mode: show sun icon (click to go dark) */
[data-theme="light-gray"] .theme-icon--sun { display: block; }
[data-theme="light-gray"] .theme-icon--moon { display: none; }

/* ── Nav Search ─────────────────────────────────────────── */
.nav-search-btn {
  display: flex;
  align-items: center;
  height: 36px;
  width: 36px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  color: var(--muted);
  overflow: hidden;
  transition: width 0.25s ease, border-color 0.2s ease;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
}

.nav-search-btn:hover {
  border-color: var(--accent);
}

.nav-search-btn.is-open {
  width: 200px;
}

.nav-search-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  width: 36px;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
  flex-shrink: 0;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-search-icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-search-input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.875rem;
  padding: 0 8px 0 0;
  width: 0;
  min-width: 0;
  height: 100%;
  outline: none;
  font-family: inherit;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.nav-search-btn.is-open .nav-search-input {
  width: 100%;
  opacity: 1;
}

.nav-search-input::placeholder {
  color: var(--muted);
}

.nav-search-input::-webkit-search-cancel-button {
  display: none;
}

/* ── Hero Slim ─────────────────────────────────────────── */
.hero-slim {
  position: relative;
  padding: var(--space-5) 0 var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}

.hero-slim h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.2;
  margin: 0;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-slim .post-meta {
  margin: var(--space-1) 0 0;
}

/* ── Source Logos Bar ──────────────────────────────────── */
.source-logos-bar {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
  overflow: hidden;
}

.source-logos-track-wrapper {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

.source-logos-track {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  width: max-content;
  animation: marquee-scroll 80s linear infinite;
}

.source-logos-track:hover {
  animation-play-state: paused;
}

.source-logo-img {
  height: 22px;
  width: auto;
  max-width: 90px;
  object-fit: contain;
  filter: grayscale(100%) brightness(0.7);
  opacity: 0.5;
  transition: filter 0.3s ease, opacity 0.3s ease;
  flex-shrink: 0;
}

.source-logo-img:hover {
  filter: grayscale(0%) brightness(1);
  opacity: 1;
}

[data-theme="light-gray"] .source-logo-img {
  filter: grayscale(100%) brightness(0.4);
  opacity: 0.45;
}

[data-theme="light-gray"] .source-logo-img:hover {
  filter: grayscale(100%) sepia(1) hue-rotate(95deg) saturate(4) brightness(0.18);
  opacity: 1;
}

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

@media (prefers-reduced-motion: reduce) {
  .source-logos-track {
    animation: none;
  }
}

@media (max-width: 768px) {
  .source-logos-bar {
    padding: var(--space-2) 0;
    margin-bottom: var(--space-4);
  }
  .source-logo-img {
    height: 18px;
  }
  .source-logos-track {
    gap: var(--space-5);
  }
}

@media (max-width: 480px) {
  .source-logo-img {
    height: 16px;
  }
}

/* ── Feed Layout (Main + Sidebar) ──────────────────────── */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: var(--space-6);
  align-items: start;
}

.feed-main {
  min-width: 0;
}

.search-box { margin-bottom: var(--space-4); }
.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: 1.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-status {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: var(--space-4);
}
.search-result {
  display: block;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s;
}
.search-result:hover { background: var(--card-bg); }
.search-result-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--fg);
}
.search-result-meta {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 4px;
}
.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}
.search-result mark {
  background: rgba(0, 200, 83, 0.2);
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}
.search-result-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.search-section { margin-bottom: var(--space-5); }
.search-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}
.search-section-count {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}
.search-pill {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.search-pill--source {
  background: var(--accent-soft, rgba(0,200,83,0.1));
  color: var(--accent, #00c853);
}
.search-pill--technology { background: rgba(59,130,246,0.15); color: #3b82f6; }
.search-pill--healthcare { background: rgba(239,68,68,0.15); color: #ef4444; }
.search-pill--energy { background: rgba(245,158,11,0.15); color: #f59e0b; }
.search-pill--finance { background: rgba(16,185,129,0.15); color: #10b981; }
.search-pill--crypto { background: rgba(139,92,246,0.15); color: #8b5cf6; }
.search-pill--status {
  background: var(--surface, rgba(255,255,255,0.05));
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ── Timeline Feed ─────────────────────────────────────── */
.timeline-section {
  margin-bottom: var(--space-5);
}

.timeline-date {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.timeline-items {
  display: flex;
  flex-direction: column;
}

.timeline-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  transition: background 0.15s ease;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-item:hover {
  background: var(--accent-soft);
  margin-left: calc(-1 * var(--space-2));
  margin-right: calc(-1 * var(--space-2));
  padding-left: var(--space-2);
  padding-right: var(--space-2);
  border-radius: var(--radius-sm);
}

.timeline-time {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
  min-width: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
}

.timeline-tz {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--muted);
  opacity: 0.65;
  letter-spacing: 0.02em;
  line-height: 1;
}

.timeline-body {
  min-width: 0;
}

.timeline-body h3 {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 2px;
}

.timeline-body h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.timeline-body h3 a:hover {
  color: var(--accent);
}

.timeline-body p {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ── Sidebar ───────────────────────────────────────────── */
.feed-sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}

.sidebar-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-3);
}

.sidebar-label {
  display: block;
  font-size: 0.55rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: var(--space-2);
}

.sidebar-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0 0 var(--space-3);
}

/* Banner placeholders */
.banner-placeholder {
  background: color-mix(in srgb, var(--border) 50%, transparent);
  border-radius: var(--radius-sm);
  min-height: 120px;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.banner-placeholder .adsbygoogle {
  width: 100%;
  min-height: 120px;
}

.banner-placeholder.banner-tall {
  height: 250px;
}

/* Sidebar links */
.sidebar-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-links li {
  padding: var(--space-1) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.sidebar-links li:last-child {
  border-bottom: none;
}

.sidebar-links a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
  display: block;
  padding: 2px 0;
  transition: color 0.15s ease;
}

.sidebar-links a:hover {
  color: var(--accent);
}

/* Ticker widget */
.ticker-rows {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ticker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-1) 0;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  position: relative;
  cursor: default;
}

.ticker-row:hover::after {
  content: attr(title);
  position: absolute;
  left: 0;
  bottom: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

.ticker-symbol {
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.02em;
}

.ticker-price {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
  margin-right: var(--space-2);
}

.ticker-val {
  font-weight: 700;
  font-size: 0.75rem;
  min-width: 52px;
  text-align: right;
}

.ticker-up {
  color: var(--accent);
}

.ticker-down {
  color: #ef4444;
}

.ticker-updated {
  display: block;
  margin-top: var(--space-2);
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0.7;
}

/* Gold & Precious Metals widget */
.gold-chart-wrap {
  margin-bottom: var(--space-3);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: color-mix(in srgb, var(--border) 30%, transparent);
}

.gold-sparkline {
  display: block;
  width: 100%;
  height: 100px;
}

.gold-kpis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}

.gold-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.kpi-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.kpi-val {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.kpi-change {
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.kpi-up {
  color: var(--accent);
}

.kpi-down {
  color: #ef4444;
}

.kpi-sub {
  font-size: 0.58rem;
  color: var(--muted);
  line-height: 1.3;
}

/* Newsletter form */
.newsletter-form {
  display: flex;
  gap: var(--space-2);
}

.newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  font-size: 0.78rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  transition: border-color 0.2s ease;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
}

.newsletter-form button {
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.newsletter-form button:hover {
  opacity: 0.85;
}

.newsletter-submit-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
}

.newsletter-confirmation {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Mobile newsletter bar (hidden on desktop) ──────────── */
.mobile-newsletter-bar {
  display: none;
}

/* ── Market Banner (hero text) ──────────────────────────── */
.market-banner {
  margin-bottom: var(--space-5);
}

.market-banner-headline {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  background: linear-gradient(to right, #1f9448 0%, #5de08a 50%, #1f9448 100%);
  background-size: 100% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.market-banner-tagline {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ── Animations ─────────────────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.reveal-stagger.is-visible > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.06s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.12s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.18s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.24s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(6) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.reveal-stagger.is-visible > *:nth-child(n+7) { transition-delay: 0.36s; opacity: 1; transform: translateY(0); }

/* ── Topic Filter — Pills ──────────────────────────────── */
.topic-filter-panel {
  margin: 0 0 var(--space-4);
}

.topic-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: flex-start;
}

.topic-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 100px;
  text-decoration: none;
  transition: all 0.2s ease;
  cursor: pointer;
}

.topic-pill:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--accent-soft);
}

.topic-pill.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ── Featured Article Card ──────────────────────────────── */
.featured-article {
  position: relative;
  background: var(--featured-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-10) var(--space-8);
  margin-bottom: var(--space-8);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--border);
}

.featured-article::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(52, 198, 101, 0.10) 0%, transparent 70%);
  animation: featurePulse 8s ease-in-out infinite alternate;
}

.featured-article::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(52, 198, 101, 0.06) 0%, transparent 70%);
  animation: featurePulse 10s ease-in-out 2s infinite alternate;
}

@keyframes featurePulse {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.2); opacity: 1; }
}

.featured-article:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.featured-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-feed);
  margin-bottom: var(--space-4);
}

.featured-badge::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--brand-feed);
  border-radius: 50%;
  animation: livePulse 2s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* -- Daily Brief Pill & Card ---------------------------------------- */
.daily-brief-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 100px;
  padding: 4px 12px;
  margin-bottom: var(--space-2);
  white-space: nowrap;
}

.timeline-item--daily-brief {
  background: rgba(251, 191, 36, 0.04);
  border-left: 3px solid #fbbf24;
  padding-left: var(--space-3);
  border-radius: var(--radius-sm);
}

.post-card--daily-brief {
  border: 1px solid rgba(251, 191, 36, 0.2);
}

.post-card--daily-brief:hover {
  border-color: rgba(251, 191, 36, 0.4);
}

[data-theme="light-gray"] .daily-brief-pill {
  color: #92400e;
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
}

[data-theme="light-gray"] .timeline-item--daily-brief {
  background: rgba(251, 191, 36, 0.06);
  border-left-color: #d97706;
}

[data-theme="light-gray"] .post-card--daily-brief {
  border-color: rgba(251, 191, 36, 0.3);
}

[data-theme="light-gray"] .post-card--daily-brief:hover {
  border-color: rgba(251, 191, 36, 0.5);
}

.featured-article h2 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--featured-text);
  margin: 0 0 var(--space-3);
}

.featured-article h2 a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.featured-article h2 a:hover {
  opacity: 0.85;
}

.featured-article .post-meta {
  position: relative;
  z-index: 1;
  color: var(--featured-muted);
}

.featured-article p:last-of-type {
  position: relative;
  z-index: 1;
  color: var(--featured-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
}

/* ── Article Grid — Floating Wall ──────────────────────── */
.articles-section {
  padding: 0 0 var(--space-12);
}

.articles-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
}

.articles-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0;
}

.post-list {
  margin-top: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-5);
}

/* ── Article Card ───────────────────────────────────────── */
.post-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.post-card h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.post-card h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-card h2 a:hover {
  color: var(--accent);
}

.post-meta {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: var(--space-3);
}

.post-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  flex-grow: 1;
}

.post-card .read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--space-4);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  transition: gap 0.2s ease;
}

.post-card:hover .read-more {
  gap: 8px;
}

/* Legacy post-preview support (topic pages) */
.post-preview {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  margin-bottom: var(--space-4);
}

.post-preview:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.post-preview:first-child {
  padding-top: var(--space-6);
}

.post-preview h2 {
  margin: 0 0 var(--space-2) 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.post-preview h2 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-preview h2 a:hover {
  color: var(--accent);
}

.post-preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.new-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  padding: 2px 8px;
  border-radius: 100px;
  vertical-align: middle;
  margin-left: 0.4em;
  background: var(--accent);
  color: #ffffff;
}

/* ── Autoload (Infinite Scroll) ─────────────────────────── */
.autoload-hidden {
  display: none !important;
}

.autoload-sentinel {
  height: 1px;
}

.autoload-loader {
  display: none;
  text-align: center;
  padding: var(--space-6) 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.autoload-loader.is-active {
  display: block;
}

/* ── Signal Status & Stance Badges ──────────────────────── */
.status-badge,
.stance-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  vertical-align: middle;
}

/* supported / supports */
.status-badge--supported,
.stance-badge--supports {
  background: #14532d;
  color: #86efac;
}

/* mixed */
.status-badge--mixed,
.stance-badge--mixed {
  background: #422006;
  color: #fde68a;
}

/* emerging / mentions */
.status-badge--emerging,
.stance-badge--mentions {
  background: #1e293b;
  color: #94a3b8;
}

/* challenged / contradicts */
.status-badge--challenged,
.stance-badge--contradicts {
  background: #450a0a;
  color: #fca5a5;
}

/* ── Light mode badge overrides ────────────────────────── */
[data-theme="light-gray"] .status-badge--supported,
[data-theme="light-gray"] .stance-badge--supports {
  background: #d1fae5;
  color: #065f46;
}

[data-theme="light-gray"] .status-badge--mixed,
[data-theme="light-gray"] .stance-badge--mixed {
  background: #fef3c7;
  color: #92400e;
}

[data-theme="light-gray"] .status-badge--emerging,
[data-theme="light-gray"] .stance-badge--mentions {
  background: #e2e8f0;
  color: #334155;
}

[data-theme="light-gray"] .status-badge--challenged,
[data-theme="light-gray"] .stance-badge--contradicts {
  background: #fee2e2;
  color: #991b1b;
}

/* ── Signal Shared ───────────────────────────────────────── */
.signal-tile__category {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  flex-shrink: 0;
}

.signal-tile__count {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Signal Accordion ────────────────────────────────────── */
.signal-accordion-list {
  margin: var(--space-6) 0;
}

.signal-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.signal-accordion:hover {
  border-color: color-mix(in srgb, var(--accent) 20%, transparent);
}

.signal-accordion__summary {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.signal-accordion__summary::-webkit-details-marker {
  display: none;
}

.signal-accordion__summary::marker {
  display: none;
}

.signal-accordion__summary:hover .signal-accordion__title {
  color: var(--accent);
}

.signal-accordion__title {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  transition: color 0.2s ease;
}

.signal-accordion__meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

.signal-accordion__chevron {
  font-size: 1rem;
  color: var(--muted);
  transition: transform 0.25s ease;
  display: inline-block;
  line-height: 1;
}

details[open] .signal-accordion__chevron {
  transform: rotate(180deg);
}

.signal-accordion__body {
  padding: 0 var(--space-5) var(--space-5) calc(var(--space-5) + 0.65rem + var(--space-3));
}

/* ── Signal Cards (shared styles) ───────────────────────── */
.signal-card__empty {
  color: var(--muted);
  font-style: italic;
  font-size: 0.9rem;
}

.signal-evidence-list {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
}

.signal-evidence-list li {
  padding: var(--space-2) 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.signal-evidence-list li + li {
  border-top: 1px solid var(--border);
}

.signal-evidence-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .signal-accordion__summary {
    flex-wrap: wrap;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
  }

  .signal-accordion__meta {
    width: 100%;
    justify-content: space-between;
  }

  .signal-accordion__body {
    padding-left: var(--space-4);
  }
}

/* ── Scroll-to-top Button ────────────────────────────────── */
.scroll-top-button {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1.1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s ease, border-color 0.2s ease;
  pointer-events: none;
  z-index: 30;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(10px);
}

.scroll-top-button.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-button:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* ── Article Pages ───────────────────────────────────────── */
article.post {
  margin-top: 0;
}

article.post h1 {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  margin-top: 0;
  margin-bottom: var(--space-4);
}

.post-content {
  font-size: 1.05rem;
}

.post-author-footer {
  margin-top: var(--space-10);
  padding: var(--space-5) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.author-logo {
  width: 48px;
  height: 48px;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.author-contact-link {
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
}

.author-contact-link:hover {
  text-decoration: underline;
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  margin-top: var(--space-16);
  padding: var(--space-12) 0 var(--space-8);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
}

.footer-shell {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 var(--page-gutter);
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  margin-bottom: var(--space-3);
}

.footer-logo-image {
  width: 32px;
  height: auto;
}

.footer-logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.footer-tagline {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.footer-nav-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer-links a {
  font-size: 0.88rem;
  color: var(--muted);
  transition: color 0.2s ease;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--text);
}

.footer-bottom {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-copyright {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.footer-legal-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: var(--space-4);
}

.footer-legal-links a {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-legal-links a:hover {
  color: var(--text);
}

/* ── Contact Form ────────────────────────────────────────── */
.contact-form {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.btn-submit {
  align-self: flex-start;
  padding: var(--space-3) var(--space-7);
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.btn-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* ── Glossary ────────────────────────────────────────────── */
.glossary-term {
  text-decoration: underline dotted color-mix(in srgb, var(--muted) 50%, transparent);
  cursor: help;
  position: relative;
}

.glossary-card {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  width: 240px;
  z-index: 10;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.glossary-term:hover .glossary-card,
.glossary-term:focus .glossary-card {
  display: block;
  animation: fadeInDown 0.15s ease;
}

/* ── Signal Context ──────────────────────────────────────── */
.signal-context {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  display: inline-block;
}

.signal-context::before {
  content: "Tracking signal: ";
  font-weight: 600;
}

.signal-context a {
  color: var(--accent);
  text-decoration: none;
}

.signal-context a:hover {
  text-decoration: underline;
}

/* ── Related Articles ───────────────────────────────────── */
.related-articles {
  margin-top: var(--space-8);
  padding: var(--space-6);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.related-articles h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0 0 var(--space-4);
}

.related-articles ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-articles li {
  padding: var(--space-3) 0;
  font-size: 0.92rem;
  line-height: 1.45;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
}

.related-articles li + li {
  border-top: 1px solid var(--border);
}

.related-articles li a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.related-articles li a:hover {
  color: var(--accent);
}

.related-date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── Internal Links (JS-injected) ───────────────────────── */
a.internal-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  transition: border-color 0.2s ease;
}

a.internal-link:hover {
  border-bottom-style: solid;
  border-color: var(--accent);
}

/* ── Mobile Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
  .feed-layout {
    grid-template-columns: 1fr;
  }

  .feed-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .feed-sidebar .sidebar-widget {
    flex: 1 1 250px;
  }

  /* newsletter lives in the sidebar widget on mobile */
  .sidebar-newsletter {
    display: none;
  }

  .market-banner-headline {
    font-size: 1.1rem;
  }

  .post-grid {
    grid-template-columns: 1fr;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-nav-col:first-of-type {
    margin-top: var(--space-2);
  }
}

@media (max-width: 640px) {
  /* Hamburger: visible on mobile */
  .nav-toggle {
    display: flex;
  }

  .header-shell {
    height: 56px;
  }

  .site-nav {
    position: relative;
  }

  .site-nav ul {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    padding: var(--space-2);
    min-width: 200px;
    z-index: 50;
  }

  .site-nav.is-open ul {
    display: flex;
    animation: fadeInDown 0.2s ease;
  }

  .site-nav li {
    width: 100%;
  }

  .site-nav a {
    display: flex;
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
  }

  .nav-search-btn.is-open {
    width: 170px;
  }

  h1 { font-size: 1.8rem; }
  article.post h1 { font-size: 2rem; }

  .post-author-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
  }

  .topic-filter-buttons {
    justify-content: flex-start;
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-3);
    align-items: flex-start;
  }
}

/* ── Day Sections (Legacy compat) ──────────────────────── */
.day-section {
  padding-bottom: var(--space-8);
  margin-bottom: var(--space-6);
  border-bottom: 1px solid var(--border);
}

.day-section:last-of-type {
  border-bottom: none;
  margin-bottom: var(--space-4);
}

.day-header {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: var(--space-6) 0 var(--space-5);
  padding-left: var(--space-4);
  border-left: 3px solid var(--accent);
}

/* ── View All CTA ──────────────────────────────────────── */
.view-all-cta {
  text-align: center;
  padding: var(--space-5) 0 var(--space-6);
}

.view-all-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 14px 36px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border-radius: 100px;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.view-all-link:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* ── Topics Page Hero ──────────────────────────────────── */
.topics-hero {
  text-align: left;
  padding: var(--space-5) 0 var(--space-3);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}

.topics-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  margin: 0 0 var(--space-1);
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.topics-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* ── Utility: page-content wrapper ──────────────────────── */
.page-content {
  margin-top: var(--space-4);
}

/* ── Article Layout (The Long Game / Own Articles) ────────────── */

/* Hero overrides for articles */
.article-hero .issue-line {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.article-hero .article-subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
  max-width: 680px;
}

.article-hero .article-byline {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Rule sections */
.article-content .rule {
  position: relative;
  padding-top: 2.5rem;
  margin-bottom: 2rem;
}

.article-content .rule-number {
  position: absolute;
  top: -0.5rem;
  left: -0.5rem;
  font-size: 4.5rem;
  font-weight: 900;
  color: var(--accent-soft);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}

.article-content .rule h2 {
  font-size: 1.35rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  line-height: 1.35;
}

/* Lead / prose */
.article-content .lead p {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 1.1rem;
  margin-bottom: 0;
}

.article-content .prose p {
  font-size: 1rem;
  line-height: 1.75;
}

/* Table of contents */
.article-content .toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}

.article-content .toc-inner ol {
  margin: 0;
  padding-left: 1.25rem;
}

.article-content .toc-inner li {
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.article-content .toc-inner a {
  color: var(--text);
  text-decoration: none;
}

.article-content .toc-inner a:hover {
  color: var(--accent);
}

.article-content .toc-dots {
  flex: 1;
  border-bottom: 1px dotted var(--border);
  margin: 0 0.5rem;
  min-width: 1rem;
}

.article-content .toc-pg {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Visual / chart containers */
.article-content .visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin: 1.5rem 0;
}

.article-content .visual-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 1rem;
  margin-top: 0;
}

/* Bar chart */
.article-content .bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 140px;
  padding-bottom: 0.5rem;
}

.article-content .bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.article-content .bar {
  width: 100%;
  background: linear-gradient(180deg, var(--accent) 0%, rgba(52, 198, 101, 0.35) 100%);
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 8px;
}

.article-content .bar-val {
  position: absolute;
  top: -1.4rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

.article-content .bar-label {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

.article-content .chart-note {
  font-size: 0.72rem;
  color: var(--muted);
  font-style: italic;
  margin-top: 0.75rem;
  margin-bottom: 0;
}

/* Tip box */
.article-content .tip-box {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}

.article-content .tip-box ul {
  margin: 0;
  padding-left: 1.25rem;
}

.article-content .tip-box li {
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

.article-content .tip-box li:last-child {
  margin-bottom: 0;
}

/* Section divider */
.article-content .divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: 2.5rem 0;
  position: relative;
}

.article-content .divider::before,
.article-content .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--border);
}

.article-content .divider::before { left: 0; }
.article-content .divider::after  { right: 0; }

/* Behaviour gap diagram */
.article-content .gap-diagram {
  display: flex;
  align-items: center;
  gap: 1rem;
  justify-content: center;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.article-content .gap-box {
  flex: 1;
  min-width: 120px;
  text-align: center;
  padding: 1rem;
  border-radius: var(--radius-sm);
}

.article-content .gap-box.neg {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.article-content .gap-box.pos {
  background: var(--accent-soft);
  border: 1px solid rgba(52, 198, 101, 0.25);
}

.article-content .gap-box .label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.article-content .gap-box .val {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.1;
}

.article-content .gap-box.pos .val { color: var(--accent); }
.article-content .gap-box.neg .val { color: #ef4444; }

.article-content .gap-box .gap-sub {
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.article-content .gap-arrow {
  font-size: 1.5rem;
  color: var(--muted);
  flex-shrink: 0;
}

/* Tail events grid */
.article-content .tail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1rem 0;
}

.article-content .tail-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.article-content .tail-item .icon {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  display: block;
}

.article-content .tail-item .tl {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.article-content .tail-item p {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Timeline visual */
.article-content .timeline {
  display: flex;
  align-items: center;
  margin: 1rem 0 0.25rem;
}

.article-content .tl-dot,
.article-content .tl-dot-end {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.article-content .tl-line {
  flex: 1;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--muted), var(--accent));
  margin: 0 0.25rem;
}

.article-content .tl-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.35rem;
}

/* Enough meter */
.article-content .meter-track {
  position: relative;
  height: 16px;
  background: var(--bg-secondary);
  border-radius: 8px;
  border: 1px solid var(--border);
  overflow: visible;
}

.article-content .meter-fill {
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, rgba(52, 198, 101, 0.3), var(--accent));
  border-radius: 8px;
}

.article-content .meter-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 24px;
  background: var(--text);
  border-radius: 2px;
  transform: translateX(-50%);
}

.article-content .meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.5rem;
}

/* Sources section */
.article-content .sources {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-top: 2.5rem;
}

.article-content .sources h3 {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.article-content .sources ol {
  margin: 0;
  padding-left: 1.5rem;
}

.article-content .sources li {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.4rem;
  line-height: 1.55;
}

/* Blockquote */
.article-content blockquote {
  border-left: 3px solid var(--accent);
  margin: 1.75rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content blockquote p {
  font-style: italic;
  margin-bottom: 0.4rem;
}

.article-content blockquote cite {
  font-size: 0.8rem;
  color: var(--muted);
  font-style: normal;
}

/* Sidebar: Own Articles link */
.sidebar-all-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.sidebar-all-link:hover {
  text-decoration: underline;
}

/* The Long Game listing page */
.the-long-game-list {
  margin-top: var(--space-4);
}

.long-game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.long-game-card:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
  box-shadow: var(--card-shadow);
}

.long-game-card .long-game-meta {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 0.5rem;
}

.long-game-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
  line-height: 1.35;
}

.long-game-card h2 a {
  color: var(--text);
  text-decoration: none;
}

.long-game-card h2 a:hover {
  color: var(--accent);
}

.long-game-card .long-game-subtitle {
  font-size: 0.88rem;
  color: var(--muted);
  font-style: italic;
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.long-game-card .read-more {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

/* Responsive: stack tail grid on small screens */
@media (max-width: 540px) {
  .article-content .tail-grid {
    grid-template-columns: 1fr;
  }

  .article-content .gap-diagram {
    flex-direction: column;
  }

  .article-content .gap-arrow {
    transform: rotate(90deg);
  }
}

/* ── Sidebar: Content Index counter box ───────────────── */
.sidebar-counts {
  padding: var(--space-3) var(--space-4);
}

.sidebar-counts .sidebar-title {
  margin-bottom: var(--space-2);
}

.counts-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-1);
}

.count-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-1) 0;
}

.count-num {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}

.count-label {
  font-size: 0.5rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* ── Social Share Bar ─────────────────────────────────── */
.share-bar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.share-bar__label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  margin-right: 0.3rem;
  white-space: nowrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-decoration: none;
  transition: color 0.18s ease, background 0.18s ease;
  padding: 0;
  flex-shrink: 0;
}

.share-btn:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.share-btn--twitter:hover  { color: #000; }
.share-btn--linkedin:hover { color: #0A66C2; }
.share-btn--facebook:hover { color: #1877F2; }
.share-btn--reddit:hover   { color: #FF4500; }
.share-btn--whatsapp:hover { color: #25D366; }
.share-btn--copy:hover     { color: var(--accent); }
.share-btn--copy.copied    { color: var(--accent); }

[data-theme="light-gray"] .share-btn--twitter:hover { color: #111; }

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  pointer-events: none;
}

/* Compact variant used on post-cards in listing views */
.share-bar--compact {
  margin: 0.75rem 0 0;
  padding-top: 0.75rem;
}

.share-bar--compact .share-btn {
  width: 26px;
  height: 26px;
}

.share-bar--compact .share-btn svg {
  width: 14px;
  height: 14px;
}

/* ================================================================
   ENERGY INTELLIGENCE DASHBOARD
   ================================================================ */

/* ── Hero ──────────────────────────────────────────────── */
.energy-hero {
  background: var(--gradient-hero);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-8) var(--space-6) var(--space-5);
  margin-top: var(--space-5);
  margin-bottom: var(--space-5);
}

.energy-hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  margin: 0 0 var(--space-2);
  letter-spacing: -0.03em;
}

.energy-hero-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: 100px;
  padding: 3px 12px;
  margin-bottom: var(--space-3);
}

.energy-hero-sub {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 var(--space-5);
  max-width: 600px;
}

.energy-kpi-bar {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.energy-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 100px;
}

.energy-kpi-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.energy-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.energy-kpi-change {
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.energy-up { color: var(--accent); }
.energy-down { color: #ef4444; }
.energy-muted { color: var(--muted); font-weight: 600; font-size: 0.68rem; }

/* ── Module Navigation (tabs) ─────────────────────────── */
.energy-module-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
  padding: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.energy-tab {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.energy-tab:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--border) 60%, transparent);
}

.energy-tab.active {
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* ── Modules ──────────────────────────────────────────── */
.energy-module { margin-bottom: var(--space-6); }
.energy-module--hidden { display: none !important; }

.energy-section-header {
  margin-bottom: var(--space-5);
}

.energy-section-header h2 {
  font-size: 1.4rem;
  margin: 0 0 var(--space-2);
}

.energy-section-header p {
  color: var(--muted);
  font-size: 0.88rem;
  margin: 0;
}

/* ── Cards ────────────────────────────────────────────── */
.energy-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  margin-bottom: var(--space-4);
}

.energy-card--placeholder {
  opacity: 0.7;
  border-style: dashed;
}

.energy-card-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 var(--space-3);
}

/* ── Summary Card ─────────────────────────────────────── */
.energy-summary-card {
  border-left: 3px solid var(--accent);
}

.energy-summary-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0 0 var(--space-3);
}

.energy-updated {
  font-size: 0.6rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ── Signals ──────────────────────────────────────────── */
.energy-signals-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.energy-signal {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
}

.energy-signal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}

.energy-signal--bullish .energy-signal-dot { background: var(--accent); }
.energy-signal--bearish .energy-signal-dot { background: #ef4444; }
.energy-signal--neutral .energy-signal-dot { background: #f59e0b; }
.energy-signal--warning .energy-signal-dot { background: #f97316; }

.energy-signal strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.energy-signal-text {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.4;
}

/* ── Events ───────────────────────────────────────────── */
.energy-events {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.energy-event {
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.energy-event-date {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 48px;
  padding-top: 2px;
}

.energy-event-body { flex: 1; }

.energy-event-body strong {
  display: block;
  font-size: 0.82rem;
  margin-bottom: 2px;
}

.energy-event-body p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 4px 0 0;
  line-height: 1.4;
}

.energy-event-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: 100px;
  margin-bottom: 4px;
}

.energy-event-badge--neutral { background: rgba(245,158,11,0.15); color: #f59e0b; }
.energy-event-badge--watch { background: rgba(59,130,246,0.15); color: #3b82f6; }
.energy-event-badge--bullish { background: rgba(52,198,101,0.15); color: var(--accent); }
.energy-event-badge--bearish { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ── Sparkline Grid ───────────────────────────────────── */
.energy-spark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.energy-spark-card {
  padding: var(--space-4);
}

.energy-spark-header {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.energy-spark-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.energy-spark-price {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.energy-sparkline {
  display: block;
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--border) 20%, transparent);
}

/* ── Commodity Grid ───────────────────────────────────── */
.energy-commodity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

.energy-commodity-card {
  text-align: center;
  padding: var(--space-4);
}

.energy-commodity-name {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.energy-commodity-symbol {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}

.energy-commodity-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: var(--space-1);
  margin-bottom: 4px;
}

.energy-commodity-price {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.energy-commodity-unit {
  font-size: 0.65rem;
  color: var(--muted);
}

/* ── Context Grids ────────────────────────────────────── */
.energy-context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}

.energy-context-grid--2col {
  grid-template-columns: repeat(2, 1fr);
}

.energy-context-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-2);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.energy-context-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.energy-context-val {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.energy-context-note {
  font-size: 0.75rem;
  color: var(--muted);
  margin: var(--space-3) 0 0;
  line-height: 1.5;
}

/* ── Dual Grid ────────────────────────────────────────── */
.energy-dual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

/* ── Risk List ────────────────────────────────────────── */
.energy-risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.energy-risk-list li {
  font-size: 0.82rem;
  line-height: 1.5;
  padding: var(--space-2) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  color: var(--muted);
}

.energy-risk-list li:last-child { border-bottom: none; }

.energy-risk-list li strong {
  color: var(--text);
}

/* ── Equities Table ───────────────────────────────────── */
.energy-equities-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.energy-equities-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.energy-equities-table th {
  text-align: left;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: var(--space-2) var(--space-3);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.energy-equities-table th.num,
.energy-equities-table td.num {
  text-align: right;
}

.energy-equities-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  color: var(--muted);
}

.energy-equities-table tr:hover td {
  background: color-mix(in srgb, var(--border) 30%, transparent);
}

.energy-eq-sym {
  font-weight: 700;
  color: var(--text) !important;
}

.energy-cat-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 1px 8px;
  border-radius: 100px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--muted);
}

.energy-cat-badge--etf { color: #3b82f6; border-color: rgba(59,130,246,0.3); background: rgba(59,130,246,0.1); }
.energy-cat-badge--major { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.1); }
.energy-cat-badge--gas { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.1); }
.energy-cat-badge--renewable { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, transparent); background: var(--accent-soft); }
.energy-cat-badge--oilfield { color: #8b5cf6; border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.1); }

/* ── Heatmap ──────────────────────────────────────────── */
.energy-heatmap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 4px;
}

.energy-heatmap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-1);
  border-radius: var(--radius-sm);
  text-align: center;
  min-height: 52px;
}

.hm-sym { font-size: 0.72rem; font-weight: 700; }
.hm-pct { font-size: 0.65rem; font-weight: 600; }

.hm-strong-up { background: rgba(52,198,101,0.2); color: var(--accent); }
.hm-up { background: rgba(52,198,101,0.1); color: var(--accent); }
.hm-down { background: rgba(239,68,68,0.1); color: #ef4444; }
.hm-strong-down { background: rgba(239,68,68,0.2); color: #ef4444; }

/* ── News Feed ────────────────────────────────────────── */
.energy-news-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.energy-news-item {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-2);
  transition: border-color 0.2s ease;
}

.energy-news-item:hover {
  border-color: color-mix(in srgb, var(--accent) 25%, transparent);
}

.energy-news-date {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 48px;
  padding-top: 2px;
}

.energy-news-body h3 {
  font-size: 0.88rem;
  font-weight: 700;
  margin: 0 0 4px;
  line-height: 1.3;
}

.energy-news-body h3 a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.energy-news-body h3 a:hover {
  color: var(--accent);
}

.energy-news-body p {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.energy-empty {
  color: var(--muted);
  font-size: 0.88rem;
  font-style: italic;
}

/* ── Signal Tracker ───────────────────────────────────── */
.energy-signal-tracker-item {
  padding: var(--space-3) 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}

.energy-signal-tracker-item:last-child { border-bottom: none; }

.energy-signal-tracker-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: 4px;
}

.energy-signal-tracker-header strong {
  font-size: 0.85rem;
}

.energy-signal-tracker-item p {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 4px;
  line-height: 1.4;
}

.energy-signal-evidence {
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.7;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 640px) {
  .energy-hero {
    padding: var(--space-5) var(--space-4) var(--space-4);
  }

  .energy-kpi-bar {
    gap: var(--space-3);
  }

  .energy-kpi {
    min-width: 80px;
  }

  .energy-module-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .energy-tab {
    font-size: 0.68rem;
    padding: 6px 12px;
  }

  .energy-spark-grid {
    grid-template-columns: 1fr;
  }

  .energy-commodity-grid {
    grid-template-columns: 1fr 1fr;
  }

  .energy-dual-grid {
    grid-template-columns: 1fr;
  }

  .energy-heatmap {
    grid-template-columns: repeat(3, 1fr);
  }

  .energy-news-item {
    flex-direction: column;
    gap: var(--space-1);
  }
}

/* ── Sidebar: Energy Intelligence promo widget ────────── */
.sidebar-energy-promo {
  display: block;
  text-decoration: none;
  background: linear-gradient(135deg, #0f2318 0%, #0d1f2d 60%, #141f14 100%);
  border: 1px solid rgba(234, 88, 12, 0.35);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
}

.sidebar-energy-promo::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(234, 88, 12, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.sidebar-energy-promo:hover {
  border-color: rgba(234, 88, 12, 0.65);
  box-shadow: 0 4px 24px rgba(234, 88, 12, 0.18);
  transform: translateY(-2px);
}

.sep-icons {
  display: flex;
  gap: var(--space-2);
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
  line-height: 1;
}

.sep-label {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fb923c;
  margin-bottom: var(--space-1);
}

.sep-desc {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 var(--space-3);
}

.sep-cta {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fb923c;
  letter-spacing: 0.02em;
  transition: letter-spacing 0.2s ease;
}

.sidebar-energy-promo:hover .sep-cta {
  letter-spacing: 0.06em;
}

[data-theme="light-gray"] .sidebar-energy-promo {
  background: linear-gradient(135deg, #fff7ed 0%, #fef3e8 60%, #fff8f0 100%);
  border-color: rgba(234, 88, 12, 0.28);
}

[data-theme="light-gray"] .sidebar-energy-promo:hover {
  border-color: rgba(234, 88, 12, 0.55);
  box-shadow: 0 4px 24px rgba(234, 88, 12, 0.12);
}

[data-theme="light-gray"] .sep-label {
  color: #c2410c;
}

[data-theme="light-gray"] .sep-cta {
  color: #c2410c;
}
