/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: 'General Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 14px;
  font-variant-numeric: tabular-nums lining-nums;
  overflow: hidden;
}

h1, h2, h3, h4 {
  font-family: 'Cabinet Grotesk', 'General Sans', sans-serif;
  font-weight: 700;
  line-height: 1.2;
}

/* ===== THEME TOKENS ===== */
:root, [data-theme="dark"] {
  --bg: #0F1117;
  --bg-surface: #161822;
  --bg-card: #1C1F2E;
  --bg-card-hover: #222640;
  --border: #2A2E42;
  --border-subtle: #1F2236;
  --text-primary: #E8E9ED;
  --text-secondary: #9CA0B0;
  --text-muted: #6B6F82;
  --accent: #818CF8;
  --accent-hover: #9BA3FB;
  --accent-dim: rgba(129,140,248,0.12);
  --accent-dim-2: rgba(129,140,248,0.06);
  --green: #34D399;
  --green-dim: rgba(52,211,153,0.12);
  --red: #F87171;
  --red-dim: rgba(248,113,113,0.12);
  --orange: #FB923C;
  --orange-dim: rgba(251,146,60,0.12);
  --yellow: #FBBF24;
  --yellow-dim: rgba(251,191,36,0.12);
  --blue: #60A5FA;
  --purple: #A78BFA;
  --pink: #F472B6;
  --teal: #2DD4BF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.45);
}

[data-theme="light"] {
  --bg: #F4F5F7;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8F9FB;
  --border: #E2E4EA;
  --border-subtle: #EEF0F4;
  --text-primary: #111318;
  --text-secondary: #5C6070;
  --text-muted: #9196A8;
  --accent: #6366F1;
  --accent-hover: #4F46E5;
  --accent-dim: rgba(99,102,241,0.1);
  --accent-dim-2: rgba(99,102,241,0.05);
  --green: #059669;
  --green-dim: rgba(5,150,105,0.1);
  --red: #DC2626;
  --red-dim: rgba(220,38,38,0.1);
  --orange: #EA580C;
  --orange-dim: rgba(234,88,12,0.1);
  --yellow: #CA8A04;
  --yellow-dim: rgba(202,138,4,0.1);
  --blue: #2563EB;
  --purple: #7C3AED;
  --pink: #DB2777;
  --teal: #0D9488;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.1);
}

body {
  background: var(--bg);
  color: var(--text-primary);
}

/* ===== LAYOUT ===== */
.dashboard {
  display: flex;
  height: 100dvh;
  overflow: hidden;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 12px;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 20px;
  color: var(--accent);
}

.logo-text {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: 16px;
  color: var(--text-primary);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-item:hover {
  background: var(--accent-dim-2);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
}

.nav-item svg { flex-shrink: 0; }

/* sidebar-footer styles moved to Yellow House Branding section */

.sidebar-label {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== THEME TOGGLE ===== */
.theme-toggle {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

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

[data-theme="dark"] .icon-moon,
[data-theme="light"] .icon-sun { display: none; }
[data-theme="dark"] .icon-sun,
[data-theme="light"] .icon-moon { display: block; }

/* ===== MOBILE HEADER ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  z-index: 90;
}

.mobile-title {
  flex: 1;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
}

.menu-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 95;
}

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 28px 32px 40px;
  scroll-behavior: smooth;
}

/* ===== SECTIONS ===== */
.section {
  display: none;
  animation: fadeIn 0.3s ease;
}

.section.active { display: block; }

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

.section-header { margin-bottom: 24px; }

.section-title {
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  max-width: 600px;
}

/* ===== KPI GRID ===== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-card.accent {
  border-color: var(--accent);
  background: var(--accent-dim);
}

.kpi-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.kpi-value {
  display: block;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.kpi-delta {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
}

.kpi-delta.positive {
  color: var(--green);
  background: var(--green-dim);
}

.kpi-delta.neutral {
  color: var(--text-secondary);
  background: var(--accent-dim-2);
}

.kpi-delta.negative {
  color: var(--red);
  background: var(--red-dim);
}

/* ===== CHART ROWS ===== */
.chart-row {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: box-shadow 0.2s ease;
}

.chart-card:hover {
  box-shadow: var(--shadow-md);
}

.chart-card.wide { flex: 3; min-width: 0; }
.chart-card.narrow { flex: 2; min-width: 0; }

.chart-header { margin-bottom: 16px; }

.chart-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.chart-source {
  font-size: 11px;
  color: var(--text-muted);
}

.chart-container {
  position: relative;
  width: 100%;
  min-height: 200px;
}

.chart-container canvas {
  width: 100% !important;
  max-height: 300px;
}

/* ===== TABLES ===== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
}

.table-scroll { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

td.positive { color: var(--green); }
td.neutral { color: var(--text-secondary); }

.table-sources {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* ===== PLATFORM BADGES ===== */
.platform-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.platform-badge.fb { background: #1877F220; color: #4293F5; }
.platform-badge.ig { background: #E1306C20; color: #E1306C; }
.platform-badge.tt { background: #00F2EA20; color: #00D4CE; }
.platform-badge.li { background: #0A66C220; color: #0A8ED9; }
.platform-badge.pt { background: #E6002320; color: #E60023; }
.platform-badge.th { background: #00000015; color: var(--text-primary); }
.platform-badge.x  { background: #14171A20; color: var(--text-secondary); }
.platform-badge.meta { background: #0668E120; color: #4293F5; }
.platform-badge.all { background: var(--accent-dim); color: var(--accent); }
.platform-badge.snap { background: #FFFC0020; color: #FFFC00; }
.platform-badge.bsky { background: #0085FF20; color: #0085FF; }

[data-theme="light"] .platform-badge.snap { background: #FFFC0015; color: #B8A900; }
[data-theme="light"] .platform-badge.bsky { background: #0085FF15; color: #0066CC; }

[data-theme="light"] .platform-badge.th { background: #00000010; }

/* New platform badges */
.platform-badge.reddit { background: #FF450020; color: #FF4500; }
.platform-badge.strava { background: #FC4C0220; color: #FC4C02; }
.platform-badge.letterboxd { background: #00E05420; color: #00E054; }
.platform-badge.podcast { background: #9B59B620; color: #9B59B6; }
.platform-badge.yt { background: #FF000020; color: #FF0000; }

[data-theme="light"] .platform-badge.reddit { background: #FF450015; color: #CC3700; }
[data-theme="light"] .platform-badge.strava { background: #FC4C0215; color: #CC3D02; }
[data-theme="light"] .platform-badge.letterboxd { background: #00E05415; color: #00A03C; }
[data-theme="light"] .platform-badge.podcast { background: #9B59B615; color: #7D3F94; }
[data-theme="light"] .platform-badge.yt { background: #FF000015; color: #CC0000; }

/* Loyalty badges */
.loyalty-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.loyalty-badge.extreme {
  background: var(--red-dim);
  color: var(--red);
}

.loyalty-badge.very-high {
  background: var(--orange-dim);
  color: var(--orange);
}

.loyalty-badge.high {
  background: var(--yellow-dim);
  color: var(--yellow);
}

/* Fandoms tab bar wrap */
.fandoms-tab-bar {
  flex-wrap: wrap;
  width: auto;
}

/* ===== ALGORITHM CARDS ===== */
.algo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.algo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  transition: all 0.2s ease;
}

.algo-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.algo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.algo-update {
  font-size: 11px;
  color: var(--text-muted);
}

.algo-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.signal-list {
  list-style: none;
  padding: 0;
  margin-bottom: 14px;
}

.signal-list li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  padding: 5px 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.signal-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.algo-insight {
  background: var(--accent-dim-2);
  border-radius: 8px;
  padding: 12px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== INSIGHT BANNER ===== */
.insight-banner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: 10px;
  padding: 18px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 8px;
}

.insight-icon {
  color: var(--accent);
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== COMMERCE STATS ===== */
.commerce-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
}

.stat-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.stat-list {
  list-style: none;
  padding: 0;
}

.stat-list li {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: baseline;
  gap: 8px;
}

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

.stat-num {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ===== IMPACT METRICS ===== */
.impact-metrics {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.impact-item {
  padding: 0;
}

.impact-value {
  display: block;
  font-family: 'Cabinet Grotesk', sans-serif;
  font-weight: 800;
  font-size: 28px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}

.impact-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== TRENDING SECTION ===== */
.tab-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
  width: fit-content;
}

.tab-btn {
  padding: 8px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent);
  color: #fff;
}

.tab-content { display: none; animation: fadeIn 0.3s ease; }
.tab-content.active { display: block; }

.subsection-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
  margin-top: 24px;
  color: var(--text-primary);
}

.subsection-title:first-child { margin-top: 0; }

.trend-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Breaking Through — creator/brand breakout cards */
.breakout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-bottom: 12px;
}

.breakout-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.breakout-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.breakout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.breakout-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.breakout-handle {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  margin-top: 2px;
}

.breakout-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breakout-metric {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-radius: 6px;
  display: inline-block;
  width: fit-content;
}

.breakout-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.breakout-desc a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

.breakout-desc a:hover {
  border-bottom-color: var(--accent);
}

.trend-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  transition: all 0.2s ease;
}

.trend-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.trend-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.trend-name {
  font-size: 14px;
  font-weight: 700;
}

.trend-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-badge.peak    { background: var(--red-dim); color: var(--red); }
.status-badge.rising  { background: var(--orange-dim); color: var(--orange); }
.status-badge.viral   { background: var(--accent-dim); color: var(--accent); }
.status-badge.sustained { background: var(--green-dim); color: var(--green); }

.moment-card {
  border-left: 3px solid var(--accent);
}

.moment-date {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Hashtags */
.hashtag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.hashtag-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
}

.hashtag-name { color: var(--accent); }
.hashtag-vol {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

/* Products */
.products-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.products-grid.compact { gap: 6px; }

.product-pill {
  display: inline-block;
  background: var(--accent-dim-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

/* IG Trends */
.ig-trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.ig-trend-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  border-left: 3px solid var(--pink);
  transition: all 0.2s ease;
}

.ig-trend-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.ig-trend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ig-trend-name {
  font-size: 14px;
  font-weight: 700;
}

.ig-trend-date {
  font-size: 11px;
  color: var(--text-muted);
}

.ig-trend-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ===== CHANGELOG ===== */
.changelog-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.changelog-entry {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.changelog-entry:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.changelog-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 85px;
  white-space: nowrap;
  padding-top: 2px;
}

.changelog-body { flex: 1; min-width: 0; }

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

.changelog-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.severity-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.severity-badge.critical { background: var(--red-dim); color: var(--red); }
.severity-badge.major    { background: var(--orange-dim); color: var(--orange); }
.severity-badge.moderate { background: var(--yellow-dim); color: var(--yellow); }
.severity-badge.opportunity { background: var(--green-dim); color: var(--green); }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: 250px;
    transition: left 0.25s ease;
    z-index: 100;
  }

  .sidebar.open { left: 0; }
  .sidebar-overlay.open { display: block; }

  .mobile-header { display: flex; }

  .main {
    padding: 72px 16px 32px;
  }

  .chart-row {
    flex-direction: column;
  }

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

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

  .kpi-value { font-size: 20px; }

  .trend-cards-grid,
  .ig-trends-grid {
    grid-template-columns: 1fr;
  }

  .commerce-stats-grid {
    grid-template-columns: 1fr;
  }

  .changelog-entry {
    flex-direction: column;
    gap: 8px;
  }

  .tab-bar {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== YELLOW HOUSE BRANDING ===== */

/* Top CTA Banner */
.yh-banner {
  background: #fddd11;
  color: #000000;
  font-family: 'Barlow', 'General Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 38px;
  padding: 0 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  flex-shrink: 0;
  position: relative;
}

.yh-banner-text {
  letter-spacing: 0.01em;
}

.yh-banner-arrow {
  display: inline-block;
  margin: 0 2px;
}

.yh-banner-cta {
  color: #000000;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.yh-banner-cta:hover {
  color: #000000;
  text-decoration-thickness: 2px;
}

.yh-banner-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #000000;
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s ease;
}

.yh-banner-close:hover {
  opacity: 1;
  background: rgba(0,0,0,0.08);
}

/* Sidebar Footer - Yellow House Branding */
.sidebar-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.yh-footer-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.yh-footer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 0 2px;
}

.yh-logo-img {
  flex-shrink: 0;
  margin-top: 2px;
  object-fit: contain;
}

.yh-footer-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.yh-footer-label {
  font-size: 10px;
  font-family: 'Barlow', 'General Sans', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.3;
}

.yh-yellow {
  color: #fddd11;
  font-weight: 700;
}

.yh-footer-link {
  font-size: 10px;
  font-family: 'Barlow', 'General Sans', sans-serif;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.yh-footer-link:hover {
  opacity: 1;
  color: #fddd11;
  text-decoration: underline;
}

/* ===== PLATFORM NAV BAR ===== */
.platform-nav-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.platform-nav-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: 'General Sans', sans-serif;
  text-decoration: none;
  color: #fff;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
  opacity: 0.85;
}

.platform-nav-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 1;
  text-decoration: none;
  color: #fff;
}

.platform-nav-pill.fb { background: #1877F2; }
.platform-nav-pill.ig { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.platform-nav-pill.tt { background: #000; border: 1px solid #333; }
.platform-nav-pill.li { background: #0A66C2; }
.platform-nav-pill.yt { background: #FF0000; }
.platform-nav-pill.snap { background: #FFFC00; color: #000; }
.platform-nav-pill.pt { background: #E60023; }
.platform-nav-pill.x { background: #000; border: 1px solid #333; }
.platform-nav-pill.bsky { background: #0085FF; }
.platform-nav-pill.reddit { background: #FF4500; }

[data-theme="light"] .platform-nav-pill.tt { border-color: #ccc; }
[data-theme="light"] .platform-nav-pill.x { border-color: #ccc; }

@media (max-width: 768px) {
  .platform-nav-bar {
    gap: 6px;
  }
  .platform-nav-pill {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
}

/* ===== BOTTOM CTA ===== */
.yh-bottom-cta {
  background: #000;
  border-top: 4px solid #fddd11;
  padding: 56px 32px;
  margin-top: 48px;
  text-align: center;
}

.yh-bottom-cta-inner {
  max-width: 600px;
  margin: 0 auto;
}

.yh-bottom-cta-logo {
  margin-bottom: 20px;
  object-fit: contain;
}

.yh-bottom-cta-heading {
  font-family: 'Barlow', 'Cabinet Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.yh-bottom-cta-sub {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  margin: 0 0 28px;
}

.yh-bottom-cta-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.yh-bottom-cta-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 6px;
  font-family: 'Barlow', 'General Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s ease, transform 0.1s ease, color 0.15s ease;
}

.yh-bottom-cta-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
}

.yh-btn-primary {
  background: #fddd11;
  color: #000;
}

.yh-btn-primary:hover {
  background: #ffe84d;
  color: #000;
}

.yh-btn-secondary {
  background: transparent;
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
}

.yh-btn-secondary:hover {
  color: #fddd11;
  border-color: #fddd11;
}

[data-theme="light"] .yh-bottom-cta {
  background: #000;
}

/* ===== UTILITY ===== */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

button { cursor: pointer; font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== PLATFORM DEEP-DIVE PAGES ===== */
.platform-page { padding: 0; animation: fadeIn 0.3s ease; }

.platform-back-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 20px;
  transition: all 0.15s ease;
  font-family: inherit;
}
.platform-back-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.platform-page-header {
  margin-bottom: 24px;
}

.platform-page .card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow 0.2s ease;
}

.platform-page .card:hover {
  box-shadow: var(--shadow-md);
}

.platform-page .card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--text-primary);
}

.platform-page .card p {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.platform-page .card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.platform-page .card li {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.platform-page .card li:last-child {
  border-bottom: none;
}

.platform-page .card li strong {
  color: var(--text-primary);
}

.platform-page .card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
}

.platform-page .card th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.platform-page .card td {
  padding: 9px 10px;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

.platform-page .card td.num {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--text-primary);
}

.platform-page .card td.highlight {
  color: var(--accent);
  font-weight: 600;
}

.platform-page .card td.positive { color: var(--green); font-weight: 600; }
.platform-page .card td.negative { color: var(--red); font-weight: 600; }

.platform-page .two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 680px) {
  .platform-page .two-col { grid-template-columns: 1fr; }
}

.platform-link {
  text-decoration: none;
  display: inline-block;
  transition: transform 0.15s ease;
}
.platform-link:hover {
  transform: translateY(-1px);
}
.platform-link .platform-badge {
  cursor: pointer;
  transition: opacity 0.15s ease, box-shadow 0.15s ease;
}
.platform-link:hover .platform-badge {
  opacity: 0.85;
  box-shadow: 0 0 0 2px var(--accent);
}

.pp-insight {
  background: var(--accent-dim-2);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pp-insight strong {
  color: var(--accent);
}

.pp-warn {
  background: var(--red-dim);
  border-left: 3px solid var(--red);
  border-radius: 0 6px 6px 0;
  padding: 10px 14px;
  margin: 12px 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pp-warn strong { color: var(--red); }

/* ===== LOOKING FORWARD ===== */
.forward-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.forward-card {
  position: relative;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 18px;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--accent) 0%, var(--border) 55%, var(--border) 100%) border-box;
  transition: all 0.2s ease;
}

.forward-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--accent) 0%, var(--teal) 100%) border-box;
}

.forward-card.featured {
  grid-column: span 2;
  padding: 22px;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    linear-gradient(135deg, var(--accent) 0%, var(--pink) 50%, var(--orange) 100%) border-box;
}

.fwd-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.fwd-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  white-space: nowrap;
}

.fwd-badge.featured-badge {
  background: linear-gradient(90deg, var(--accent-dim), var(--red-dim));
  color: var(--accent);
  font-size: 11px;
}

.fwd-signal {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  white-space: nowrap;
}

.fwd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.fwd-dot.strong { background: var(--green); box-shadow: 0 0 8px var(--green); }
.fwd-dot.medium { background: var(--yellow); box-shadow: 0 0 8px var(--yellow); }
.fwd-dot.early  { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

.fwd-headline {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 8px;
}

.forward-card.featured .fwd-headline { font-size: 18px; }

.fwd-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.fwd-implications {
  list-style: none;
  margin: 10px 0 4px;
  padding: 0;
}

.fwd-implications li {
  position: relative;
  padding-left: 18px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 5px;
}

.fwd-implications li::before {
  content: '\2192';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.fwd-sources {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
  font-size: 11px;
  color: var(--text-muted);
}

.fwd-sources a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 2px; }
.fwd-sources a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .forward-grid { grid-template-columns: 1fr; }
  .forward-card.featured { grid-column: span 1; }
}

/* ===== AI VISIBILITY SECTION ===== */
.platform-badge.ai     { background: rgba(167,139,250,0.16); color: #A78BFA; }
.platform-badge.gpt    { background: #10A37F20; color: #10A37F; }
.platform-badge.pplx   { background: #20B8CD20; color: #20B8CD; }
.platform-badge.claude { background: #D9775720; color: #D97757; }
.platform-badge.aio    { background: #4285F420; color: #669DF6; }
.platform-badge.gemini { background: #8E75F520; color: #9E8CFC; }
.platform-badge.metaai { background: #0668E120; color: #4293F5; }

[data-theme="light"] .platform-badge.ai     { background: rgba(124,58,237,0.10); color: #7C3AED; }
[data-theme="light"] .platform-badge.gpt    { background: #10A37F15; color: #0B7A5F; }
[data-theme="light"] .platform-badge.pplx   { background: #20B8CD15; color: #158D9E; }
[data-theme="light"] .platform-badge.claude { background: #D9775715; color: #B85B3E; }
[data-theme="light"] .platform-badge.aio    { background: #4285F415; color: #2A67CC; }
[data-theme="light"] .platform-badge.gemini { background: #8E75F515; color: #6D51E0; }
[data-theme="light"] .platform-badge.metaai { background: #0668E115; color: #0553B8; }

/* Subtle violet accent reserved for AI Visibility cards */
.ai-tint { border-color: rgba(167,139,250,0.30) !important; }
[data-theme="light"] .ai-tint { border-color: rgba(124,58,237,0.25) !important; }

.ai-badge {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(167,139,250,0.14);
  color: #A78BFA;
  border: 1px solid rgba(167,139,250,0.35);
}

[data-theme="light"] .ai-badge {
  background: rgba(124,58,237,0.08);
  color: #7C3AED;
  border-color: rgba(124,58,237,0.30);
}

/* ===== Q4 2026 additions ===== */
.q4-brief {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 18px 22px;
  margin-bottom: 20px;
}
.q4-brief-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent); margin-bottom: 10px;
}
.q4-brief-list { margin: 0; padding-left: 20px; display: grid; gap: 7px; }
.q4-brief-list li { font-size: 14px; line-height: 1.5; color: var(--text-secondary); }
.q4-brief-list li strong { color: var(--text); }
.insight-tile {
  padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-secondary);
}
.insight-tile .insight-kicker {
  font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.insight-tile .insight-head { font-weight: 600; margin-bottom: 6px; color: var(--text); }
.insight-tile p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; margin: 0; }
.insight-tile p a, .q4-brief a { color: var(--accent); }
.kpi-delta a { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.section-lede { font-size: 14px; color: var(--text-muted); margin: -8px 0 16px; }
.status-badge.watch { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.pred-num { display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:8px;background:var(--accent-dim);color:var(--accent);font-size:13px;font-weight:800;flex-shrink:0; }
.platform-badge.tiktok { background: #00F2EA20; color: #00D4CE; }
.platform-badge.instagram { background: #E1306C20; color: #E1306C; }
.platform-badge.youtube { background: #FF000020; color: #FF0000; }
.platform-badge.pinterest { background: #E6002320; color: #E60023; }
[data-theme="light"] .platform-badge.tiktok { color: #00A39E; }
[data-theme="light"] .platform-badge.youtube { background: #FF000015; color: #CC0000; }
.culture-charts table { table-layout: fixed; width: 100%; }
.culture-charts th, .culture-charts td { white-space: normal; line-height: 1.5; vertical-align: top; }
.culture-charts th:nth-child(1), .culture-charts td:nth-child(1) { width: 16%; }
.culture-charts th:nth-child(2), .culture-charts td:nth-child(2) { width: 46%; }
