:root {
  --accent: #3d85ff;
  --bg: #030812;
  --text: #d0dce8;
  --text-bright: #f0f6ff;
  --muted: #5a7a9a;
  --panel: rgba(8, 20, 50, 0.55);
  --panel-strong: rgba(8, 20, 50, 0.7);
  --border: rgba(61, 133, 255, 0.1);
  --red: #ff5757;
  --amber: #f59e0b;
  --signal: #00e5a0;
  --noise: #4a6080;
}

body {
  background: var(--bg);
  font-family: 'Inter', 'Space Grotesk', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

.mono { font-family: 'Space Mono', monospace; }

.scan-line {
  position: fixed; left: 0; right: 0; height: 1px; top: -2px;
  background: linear-gradient(90deg, transparent, rgba(61,133,255,.18), transparent);
  animation: scan-y 9s linear infinite;
  z-index: 2; pointer-events: none;
}
@keyframes scan-y { 0% { top: -2px; } 100% { top: 100%; } }

.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(rgba(61,133,255,.025) 1px,transparent 1px),
                     linear-gradient(90deg,rgba(61,133,255,.025) 1px,transparent 1px);
  background-size: 60px 60px;
}

.bg-glow {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%);
  width: 1000px; height: 300px;
  background: radial-gradient(ellipse at 50% 0%, rgba(61,133,255,.09), transparent 65%);
  pointer-events: none; z-index: 0;
}

.pulse-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(61,133,255,.5); animation: ring-out 2.8s ease-out infinite; }
.pulse-ring.r2 { border-color: rgba(61,133,255,.35); animation-delay: .93s; }
.pulse-ring.r3 { border-color: rgba(61,133,255,.2); animation-delay: 1.86s; }
@keyframes ring-out { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3.4); opacity: 0; } }

.pulse-dot {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
  animation: dot-pulse 2.2s ease-in-out infinite;
}
@keyframes dot-pulse { 0%,100% { opacity: 1; box-shadow: 0 0 12px var(--accent); } 50% { opacity: .3; box-shadow: none; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.empty-state { text-align: center; padding: 90px 32px; }

/* ── Page tabs ── */
.page-tabs { display: flex; gap: 8px; margin-bottom: 30px; }
.page-tab {
  font-family: 'Space Grotesk', sans-serif; font-size: 13px; font-weight: 600; letter-spacing: .03em;
  padding: 10px 22px; border-radius: 8px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  transition: all .18s ease;
}
.page-tab:hover { color: var(--text); border-color: rgba(61,133,255,.3); }
.page-tab.active { color: var(--text-bright); background: rgba(61,133,255,.1); border-color: rgba(0,229,160,.4); }
.tab-panel.hidden { display: none; }

/* ── Live dot ── */
.live-dot {
  position: relative; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: inline-block;
  background: var(--signal); box-shadow: 0 0 10px var(--signal); animation: dot-pulse 2s ease-in-out infinite;
}

/* ── Ticker ── */
.ticker-wrap {
  height: 38px; overflow: hidden; display: flex; align-items: center;
  background: rgba(8,20,50,.5); border: 1px solid var(--border); border-radius: 8px;
}
.ticker-track { display: flex; align-items: center; white-space: nowrap; will-change: transform; animation: ticker-scroll linear infinite; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: inline-flex; align-items: center; gap: 8px; padding: 0 22px; flex-shrink: 0; }
.ticker-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.ticker-cat { font-family: 'Space Mono', monospace; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ticker-q { font-size: 12px; color: var(--text); }
.ticker-prob { font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; }

/* ── Stat strip ── */
.stat-strip { display: flex; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.stat-cell { flex: 1; padding: 16px 4px 14px; border-right: 1px solid rgba(61,133,255,.12); }
.stat-cell:last-child { border-right: none; }
.stat-cell-value { font-family: 'Space Mono', monospace; font-size: 26px; font-weight: 700; line-height: 1; }
.stat-cell-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

/* ── Toolbar (sort + filters) ── */
.predictions-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 22px 0 14px; }
.sort-btn, .cat-chip, .noise-toggle {
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500; letter-spacing: .02em;
  padding: 7px 14px; border-radius: 6px; cursor: pointer;
  background: transparent; color: var(--muted); border: 1px solid var(--border);
  transition: all .15s;
}
.sort-btn:hover, .cat-chip:hover, .noise-toggle:hover { color: var(--text); border-color: rgba(61,133,255,.3); }
.sort-btn.active { background: rgba(61,133,255,.12); color: var(--accent); border-color: rgba(61,133,255,.5); }
.cat-chip.off { opacity: .35; }
.noise-toggle.active { background: rgba(0,229,160,.1); color: var(--signal); border-color: rgba(0,229,160,.5); }
.toolbar-sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }

/* ── Screener (raw signal log) ── */
.screener-head { display: flex; font-family: 'Space Mono', monospace; font-size: 9px; text-transform: uppercase; letter-spacing: .1em; color: #3d5570; padding: 0 12px 8px; }
.screener-row { display: flex; align-items: center; padding: 11px 12px; border-radius: 6px; text-decoration: none; transition: background .15s, opacity .15s; }
.screener-row:hover { background: rgba(61,133,255,.06); }
.screener-row.is-noise { opacity: .4; }
.screener-row.is-noise:hover { opacity: .75; }
.screener-cat { width: 120px; display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.screener-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.screener-cat-label { font-family: 'Space Mono', monospace; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.screener-q { flex: 1; font-size: 13px; color: var(--text); padding-right: 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.screener-prob { width: 60px; text-align: right; font-family: 'Space Mono', monospace; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.screener-vol { width: 70px; text-align: right; font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.screener-age { width: 60px; text-align: right; font-family: 'Space Mono', monospace; font-size: 11px; color: var(--muted); flex-shrink: 0; }
.screener-crossings { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--muted); margin-left: 6px; }

/* ── Reports: masthead ── */
.masthead { text-align: center; padding: 4px 0 28px; border-bottom: 2px solid rgba(240,246,255,.9); margin-bottom: 28px; }
.masthead-kicker { font-size: 12px; letter-spacing: .3em; color: var(--muted); text-transform: uppercase; margin: 0 0 14px; }
.masthead-title { margin: 0 0 12px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 38px; letter-spacing: -.01em; color: var(--text-bright); }
.masthead-meta { font-size: 11px; color: var(--muted); letter-spacing: .03em; margin: 0; }

/* AI-generated content disclosure (Reports tab; reuse for future AI prose) */
.ai-disclosure {
  display: flex; gap: 14px; align-items: flex-start;
  margin: -12px 0 24px; padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 180, 80, .35);
  background: rgba(255, 180, 80, .07);
}
.ai-disclosure-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 700; letter-spacing: .14em;
  padding: 5px 8px; border-radius: 4px;
  color: #ffc96a; background: rgba(255, 180, 80, .14); border: 1px solid rgba(255, 180, 80, .35);
}
.ai-disclosure-title { margin: 0 0 4px; font-size: 13px; font-weight: 600; color: #ffd89a; }
.ai-disclosure-body { margin: 0; font-size: 12px; line-height: 1.55; color: #b8a88a; max-width: 62ch; }
.lead-intro.ai-prose { position: relative; }
.lead-intro.ai-prose::after {
  content: 'AI-written intro · not Tim\'s words';
  display: block; margin-top: 10px;
  font-family: 'Space Mono', monospace; font-size: 9px; letter-spacing: .12em; text-transform: uppercase;
  color: #b89560;
}

.lead-intro { font-size: 18px; line-height: 1.75; color: var(--text); max-width: 64ch; margin: 0 0 32px; }
.lead-intro::first-letter { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 56px; float: left; line-height: .8; margin: 6px 10px 0 0; color: var(--text-bright); }

/* ── Reports: story items ── */
.story { display: flex; gap: 26px; padding: 30px 0; border-top: 1px solid rgba(255,255,255,.08); align-items: flex-start; }
.story:first-child { border-top: none; padding-top: 0; }
.story-main { flex: 1; min-width: 0; }
.story-kicker { font-family: 'Space Mono', monospace; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; }
.story-headline { margin: 0 0 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 23px; line-height: 1.25; color: var(--text-bright); }
.story-who { margin: 0 0 12px; font-style: italic; font-size: 14px; line-height: 1.6; color: #8095b0; }
.story-uk { margin: 0 0 12px; font-size: 14px; line-height: 1.6; color: var(--text); }
.story-uk strong { color: var(--signal); font-weight: 600; margin-right: 4px; }
.story-body { margin: 0 0 14px; font-size: 16px; line-height: 1.7; color: var(--text); }
.story.ai-prose .story-kicker::after { content: ' · AI prose'; color: #b89560; font-weight: 400; }
.story-quote { border-left: 2px solid; padding: 2px 0 2px 16px; margin: 0 0 14px; }
.story-quote p { margin: 0; font-family: 'Space Grotesk', sans-serif; font-style: italic; font-size: 15px; line-height: 1.6; color: var(--text-bright); }
.story-sources { display: flex; flex-wrap: wrap; gap: 6px; }
.story-source-chip { font-family: 'Space Mono', monospace; font-size: 10px; padding: 4px 9px; border-radius: 4px; background: rgba(61,133,255,.08); border: 1px solid rgba(61,133,255,.2); color: #7ea8ff; text-decoration: none; }
.story-source-chip:hover { border-color: rgba(0,229,160,.4); color: var(--signal); }
.story-prob-col { flex-shrink: 0; width: 76px; text-align: right; padding-top: 2px; }
.story-prob-val { font-family: 'Space Mono', monospace; font-weight: 700; font-size: 32px; line-height: 1; }
.story-prob-label { font-family: 'Space Mono', monospace; font-size: 9px; color: var(--muted); margin-top: 2px; letter-spacing: .06em; }

/* ── Reports: date picker ── */
.report-picker { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 24px; scrollbar-width: thin; }
.report-pill {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 12px 16px; border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); color: var(--muted);
  transition: all .15s;
}
.report-pill:hover { border-color: rgba(61,133,255,.35); color: var(--text); }
.report-pill.active { border-color: rgba(0,229,160,.45); background: rgba(0,229,160,.08); color: var(--text-bright); }
.report-pill.is-archive { opacity: .72; }
.report-pill.is-archive.active { opacity: 1; }
.report-pill-date { font-size: 15px; font-weight: 600; }
.report-pill-count { font-size: 10px; letter-spacing: .06em; opacity: .75; }

.report-empty { text-align: center; padding: 80px 24px; color: var(--muted); }
.report-empty-kicker { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }

/* ── Trends tab ── */
.theme-card { padding: 26px 0; border-top: 1px solid rgba(255,255,255,.08); }
.theme-card:first-child { border-top: none; padding-top: 0; }
.theme-name { margin: 0 0 10px; font-family: 'Space Grotesk', sans-serif; font-weight: 600; font-size: 19px; color: var(--text-bright); }
.theme-note { margin: 0 0 12px; font-size: 15px; line-height: 1.7; color: var(--text); }
.theme-evidence { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-evidence a { font-family: 'Space Mono', monospace; font-size: 10px; padding: 4px 10px; border-radius: 4px; background: rgba(61,133,255,.08); border: 1px solid rgba(61,133,255,.2); color: #7ea8ff; text-decoration: none; }
.theme-evidence a:hover { border-color: rgba(0,229,160,.4); color: var(--signal); }

.trends-watchlist { margin-top: 8px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.08); }
.trends-watchlist.hidden { display: none; }
.trends-watchlist-title { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; }
.trends-watchlist ul { margin: 0; padding: 0 0 0 1.2rem; }
.trends-watchlist li { font-size: 15px; line-height: 1.7; color: var(--text); margin-bottom: 8px; }
