* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #000000;
  --panel: #111827;
  --card: #1a2236;
  --border: #1e293b;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --red: #ef4444;
  --amber: #ff6600;
  --green: #22c55e;
  --blue: #3b82f6;
  --yellow: #ff6600;
}

body {
  font-family: 'Calibri', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── HEADER ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 24px;
  background: linear-gradient(90deg, #0f172a, #1e293b);
  border-bottom: 1px solid var(--border);
  height: 52px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.tally-logo { display: block; }
.tally-logo .tally {
  stroke: #ffffff;
  stroke-width: 3.5;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: tallyDraw 0.5s ease forwards, tallyGlow 3s 2.5s ease-in-out infinite;
  transition: stroke 0.3s;
}
.tally.t1 { animation-delay: 0.0s, 2.5s; }
.tally.t2 { animation-delay: 0.4s, 2.9s; }
.tally.t3 { animation-delay: 0.8s, 3.3s; }
.tally.t4 { animation-delay: 1.2s, 3.7s; }
.tally.t5 {
  stroke-width: 3;
  stroke-dasharray: 80;
  stroke-dashoffset: 80;
  animation: tallyStrike 0.6s 1.8s ease forwards, tallyGlow 3s 4.1s ease-in-out infinite;
}
@keyframes tallyDraw { to { stroke-dashoffset: 0; } }
@keyframes tallyStrike { to { stroke-dashoffset: 0; } }
@keyframes tallyGlow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 0px #fff); }
  50% { opacity: 0.7; filter: drop-shadow(0 0 6px #fff); }
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--muted); width: 34px; height: 34px; border-radius: 6px;
  cursor: pointer; transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ── LIGHT MODE — TradingView-inspired ── */
body.light {
  --bg: #f8f9fd;
  --panel: #ffffff;
  --card: #ffffff;
  --border: #e0e3eb;
  --text: #131722;
  --muted: #787b86;
  --accent: #2962ff;
}
body.light header { background: #ffffff; border-bottom-color: var(--border); }
body.light .tally-logo .tally { stroke: #131722; }
body.light @keyframes tallyGlow {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 0px #131722); }
  50% { opacity: 0.7; filter: drop-shadow(0 0 4px #2962ff); }
}
body.light .tagline { color: #787b86; }
body.light .tagline-or { color: #f7931a; }
body.light .clock { color: #787b86; }
/* Ticker */
body.light .ticker-markets { background: #ffffff; border-bottom-color: var(--border); }
body.light .ticker-crypto { background: #ffffff; border-bottom-color: var(--border); }
body.light .ticker-label { background: transparent; border-right-color: var(--border); color: #787b86; }
body.light .ticker-crypto .ticker-label { color: #f7931a; }
body.light .ticker-item .sym { color: #2962ff; }
body.light .ticker-crypto .ticker-item .sym { color: #f7931a; }
body.light .ticker-item .price { color: #131722; }
body.light .ticker-sep { color: #e0e3eb; }
/* Feed panel */
body.light #feed-panel { background: #ffffff; border-right-color: var(--border); }
body.light .feed-toolbar { background: #ffffff; border-bottom-color: var(--border); }
body.light .feed-search { background: #f0f3fa; border-color: var(--border); color: #131722; }
body.light .feed-search::placeholder { color: #9598a1; }
body.light .feed-search:focus { border-color: #2962ff; }
body.light .filter-btn { background: #f0f3fa; border-color: var(--border); color: #787b86; }
body.light .filter-btn:hover, body.light .filter-btn.active { border-color: #2962ff; color: #2962ff; }
body.light .filter-dropdown { background: #fff; border-color: var(--border); box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
body.light .filter-option:hover { background: #f0f3fa; }
/* Cards */
body.light .feed-card { background: #ffffff; border-bottom: 1px solid #f0f3fa; border-radius: 0; margin-bottom: 0; }
body.light .feed-card:hover { background: #f0f3fa; }
body.light .feed-card.selected { background: #e8f0fe; box-shadow: inset 0 0 0 1px #2962ff; }
body.light .card-thumb { background: #f0f3fa; }
body.light .feed-card .title a { color: #131722; }
body.light .feed-card .title a:hover { color: #2962ff; }
body.light .feed-card .meta { color: #787b86; }
body.light .keyword-badge { background: #e0e3eb; color: #131722; }
body.light .threat-badge { color: #fff; }
body.light #feed-list::-webkit-scrollbar-thumb { background: #d1d4dc; }
/* Globe panel */
body.light #globe-panel { background: #f0f3fa; }
body.light #globe-info { background: rgba(255,255,255,0.97); border-color: var(--border); box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
body.light #globe-info .info-title { color: #131722; }
body.light #globe-info .info-row { color: #787b86; }
body.light #globe-info .info-row span { color: #131722; }
body.light #globe-info .info-keywords .kw { background: #e0e3eb; color: #2962ff; }
body.light .legend-item { background: rgba(255,255,255,0.95); color: #787b86; }
/* Auth & modals */
body.light .auth-btn { background: #f0f3fa; border-color: var(--border); color: #787b86; }
body.light .auth-btn:hover { background: #e0e3eb; color: #131722; }
body.light .theme-toggle { background: #f0f3fa; border-color: var(--border); color: #787b86; }
body.light .theme-toggle:hover { background: #e0e3eb; color: #131722; }
body.light .auth-box, body.light .disclaimer-box, body.light .legal-box { background: #fff; border-color: var(--border); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
body.light .auth-box::-webkit-scrollbar-thumb { background: #d1d4dc; }
body.light .auth-provider { background: #f0f3fa; border-color: var(--border); color: #131722; }
body.light .auth-provider:hover { background: #e0e3eb; }
body.light .auth-close { color: #787b86; }
body.light .auth-close:hover { color: #131722; }
body.light .auth-note { color: #9598a1; }
body.light .auth-signout { background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.2); color: #ef4444; }
/* Footer */
body.light .footer { background: #ffffff; border-top-color: var(--border); }
body.light .footer__parralax-grid { background: none; }
body.light .footer__parralax-glow { background: none; }
body.light .footer__left p { color: #787b86; }
body.light .footer__left a { color: #2962ff; }
body.light .footer__link { color: #787b86; }
body.light .footer__link:hover { color: #131722; }
body.light .footer__sep { color: #e0e3eb; }
/* Crisis banners light */
body.light .crisis-banner { background: #fff; border-color: #fca5a5; box-shadow: 0 2px 12px rgba(239,68,68,0.1); }
body.light .crisis-banner .crisis-title { color: #b91c1c; }
body.light .crisis-banner .crisis-meta { color: #787b86; }
body.light .crisis-banner .crisis-close { color: #787b86; }
body.light .crisis-banner .crisis-close:hover { color: #131722; }

.tagline { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 2px; }
.tagline-or { color: var(--yellow); font-style: italic; }
.header-right { display: flex; align-items: center; gap: 14px; }
.clock { font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── AUTH ── */
.auth-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--muted); padding: 6px 14px; border-radius: 6px;
  font-size: 13px; cursor: pointer; transition: background 0.2s, color 0.2s;
  font-family: inherit;
}
.auth-btn:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.auth-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); z-index: 1000;
  align-items: center; justify-content: center;
}
.auth-modal.open { display: flex; }
.auth-box {
  background: #111827; border: 1px solid var(--border);
  border-radius: 12px; padding: 32px 28px; width: 420px;
  max-width: 92vw; max-height: 85vh; overflow-y: auto;
  position: relative; text-align: center;
}
.auth-box::-webkit-scrollbar { width: 5px; }
.auth-box::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.auth-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: var(--muted);
  font-size: 18px; cursor: pointer;
}
.auth-close:hover { color: var(--text); }
.auth-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 24px; }
.auth-provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--card);
  color: var(--text); font-size: 15px; font-weight: 600;
  cursor: pointer; margin-bottom: 10px; transition: background 0.2s;
  font-family: inherit;
}
.auth-provider:hover { background: #1e2d4a; }
.auth-provider.google:hover { border-color: #4285F4; }
.auth-provider.twitter:hover { border-color: var(--text); }
.auth-note { font-size: 11px; color: #475569; margin-top: 14px; }
.auth-avatar {
  width: 24px; height: 24px; border-radius: 50%; object-fit: cover;
}
.auth-profile-pic {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 10px; display: block; border: 2px solid var(--accent);
}
.auth-profile-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.auth-profile-email { font-size: 12px; color: var(--muted); margin-bottom: 16px; }
.auth-signout {
  background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3);
  color: #fca5a5; padding: 8px 20px; border-radius: 6px;
  font-size: 13px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: background 0.2s;
}
.auth-signout:hover { background: rgba(239,68,68,0.2); }

/* ── PREFERENCE TABS ── */
.pref-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 18px; text-align: left;
}
.pref-header .auth-profile-pic { margin: 0; }
.pref-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.pref-tab {
  flex: 1; background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 1px;
  padding: 8px 0; cursor: pointer; font-family: inherit;
  transition: color 0.2s, border-color 0.2s;
}
.pref-tab:hover { color: var(--text); }
.pref-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.pref-panel { text-align: left; }
.pref-label {
  font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.pref-hint {
  font-size: 11px; color: var(--muted); margin-bottom: 10px;
}
.pref-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.pref-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 20px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; transition: all 0.2s;
  font-family: inherit;
}
.pref-chip:hover { border-color: var(--accent); color: var(--text); }
.pref-chip.selected {
  background: rgba(56,189,248,0.15); border-color: var(--accent);
  color: var(--accent);
}
.pref-chip .chip-icon { font-size: 14px; }

/* Theme toggle buttons */
.pref-toggle-row { display: flex; gap: 8px; margin-bottom: 4px; }
.pref-theme-btn {
  flex: 1; padding: 8px; border-radius: 8px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); background: var(--card);
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: all 0.2s;
}
.pref-theme-btn:hover { border-color: var(--accent); }
.pref-theme-btn.active {
  background: rgba(56,189,248,0.15); border-color: var(--accent); color: var(--accent);
}

/* Conflict toggle switch */
.pref-switch {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  margin-bottom: 10px;
}
.pref-switch input { display: none; }
.pref-switch-slider {
  width: 36px; height: 20px; border-radius: 10px;
  background: #334155; position: relative; transition: background 0.2s;
  flex-shrink: 0;
}
.pref-switch-slider::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #94a3b8; transition: transform 0.2s, background 0.2s;
}
.pref-switch input:checked + .pref-switch-slider { background: var(--accent); }
.pref-switch input:checked + .pref-switch-slider::after {
  transform: translateX(16px); background: #fff;
}
.pref-switch-label { font-size: 12px; color: var(--muted); }

.conflict-list {
  display: flex; flex-direction: column; gap: 4px; margin-top: 6px;
}
.conflict-item {
  font-size: 11px; color: var(--muted); padding: 4px 8px;
  background: rgba(239,68,68,0.06); border-radius: 4px;
  border-left: 2px solid var(--red);
}
.conflict-item .conflict-parties { color: var(--text); font-weight: 600; }

/* Portfolio */
.portfolio-input-row {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.portfolio-input {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 8px 12px; border-radius: 6px;
  font-size: 13px; font-family: inherit; outline: none;
}
.portfolio-input:focus { border-color: var(--accent); }
.portfolio-add-btn {
  background: var(--accent); color: #000; border: none;
  width: 36px; border-radius: 6px; font-size: 18px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: opacity 0.2s;
}
.portfolio-add-btn:hover { opacity: 0.8; }
.portfolio-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.portfolio-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 700;
  background: rgba(56,189,248,0.1); border: 1px solid rgba(56,189,248,0.3);
  color: var(--accent);
}
.portfolio-tag .remove-tag {
  cursor: pointer; color: var(--muted); font-size: 14px;
  line-height: 1; transition: color 0.2s;
}
.portfolio-tag .remove-tag:hover { color: var(--red); }

/* Light mode overrides for prefs */
body.light .pref-chip { background: #f0f3fa; border-color: var(--border); color: #787b86; }
body.light .pref-chip:hover { border-color: #2962ff; color: #131722; }
body.light .pref-chip.selected { background: rgba(41,98,255,0.08); border-color: #2962ff; color: #2962ff; }
body.light .pref-tab.active { color: #2962ff; border-bottom-color: #2962ff; }
body.light .pref-theme-btn { background: #f0f3fa; border-color: var(--border); }
body.light .pref-theme-btn.active { background: rgba(41,98,255,0.08); border-color: #2962ff; color: #2962ff; }
body.light .portfolio-input { background: #f0f3fa; border-color: var(--border); color: #131722; }
body.light .portfolio-input:focus { border-color: #2962ff; }
body.light .portfolio-tag { background: rgba(41,98,255,0.06); border-color: rgba(41,98,255,0.2); color: #2962ff; }
body.light .conflict-item { background: rgba(239,68,68,0.04); }
body.light .pref-switch-slider { background: #d1d4dc; }
body.light .pref-switch input:checked + .pref-switch-slider { background: #2962ff; }

/* ── TICKER MARQUEES ── */
.ticker-markets, .ticker-crypto {
  height: 30px; overflow: hidden; position: relative;
  display: flex; align-items: center;
}
.ticker-markets { background: #0f172a; border-bottom: 1px solid var(--border); }
.ticker-crypto { background: #0d1320; border-bottom: 1px solid var(--border); }
.ticker-label {
  flex-shrink: 0; font-size: 10px; font-weight: 800;
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 0 14px; color: var(--muted);
  background: rgba(0,0,0,0.3); height: 100%;
  display: flex; align-items: center;
  border-right: 1px solid var(--border); z-index: 1;
}
.ticker-crypto .ticker-label { color: #ff6600; }
.ticker-track {
  display: flex; align-items: center; height: 100%;
  white-space: nowrap; width: max-content;
}
.ticker-markets .ticker-track { animation: tickerScroll 50s linear infinite; }
.ticker-crypto .ticker-track { animation: tickerScroll 40s linear infinite; }
.ticker-track:hover { animation-play-state: paused; }
@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 16px; font-size: 12px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ticker-item .sym { color: var(--accent); }
.ticker-crypto .ticker-item .sym { color: #ff6600; }
.ticker-item .price { color: var(--text); }
.ticker-item .chg { font-size: 11px; }
.ticker-item .chg.up { color: var(--green); }
.ticker-item .chg.down { color: var(--red); }
.ticker-sep { color: #334155; padding: 0 4px; }

/* ── MAIN LAYOUT ── */
main {
  display: flex;
  height: calc(100vh - 52px - 30px - 30px - 40px);
}

/* ── LEFT PANEL ── */
#feed-panel {
  width: 33%; display: flex; flex-direction: column;
  border-right: 1px solid var(--border); background: var(--panel);
}

/* ── FEED TOOLBAR (search + filter) ── */
.feed-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--border);
  background: var(--panel); flex-shrink: 0;
}
.feed-search {
  flex: 1; background: var(--card); border: 1px solid var(--border);
  color: var(--text); padding: 7px 12px; border-radius: 6px;
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 0.2s;
}
.feed-search::placeholder { color: #475569; }
.feed-search:focus { border-color: var(--accent); }
.filter-wrap { position: relative; }
.filter-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--muted); padding: 7px 12px; border-radius: 6px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: border-color 0.2s;
}
.filter-btn:hover, .filter-btn.active { border-color: var(--accent); color: var(--text); }
.filter-dropdown {
  display: none; position: absolute; top: calc(100% + 4px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 0; min-width: 150px;
  z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.filter-dropdown.open { display: block; }
.filter-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 600;
  color: var(--muted); cursor: pointer; transition: background 0.15s;
}
.filter-option:hover { background: rgba(255,255,255,0.05); }
.filter-option.selected { color: var(--text); }
.filter-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}

#feed-list { flex: 1; overflow-y: auto; padding: 10px 14px; }
#feed-list::-webkit-scrollbar { width: 6px; }
#feed-list::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }

/* ── FEED CARD ── */
.feed-card {
  display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 8px;
  background: var(--card); border-radius: 8px;
  border-left: 3px solid transparent; cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}
.feed-card:hover { background: #1e2d4a; }
.feed-card.selected { background: #1e2d4a; box-shadow: inset 0 0 0 1px var(--accent); }
.card-thumb {
  flex-shrink: 0; width: 68px; height: 68px; border-radius: 6px;
  overflow: hidden; background: #0f172a;
  display: flex; align-items: center; justify-content: center;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-thumb.thumb-err { display: none; }
.card-thumb-icon { padding: 16px; }
.card-thumb-icon img { object-fit: contain; }
.card-thumb-placeholder { font-size: 28px; line-height: 1; }
.card-body { flex: 1; min-width: 0; }
.feed-card .source {
  font-size: 11px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); margin-bottom: 4px;
  display: flex; align-items: center; gap: 5px;
}
.reddit-icon { flex-shrink: 0; vertical-align: middle; }
.feed-card.reddit-card { border-left-color: #ff4500 !important; }
.feed-card.reddit-card .source { color: #ff4500; }
.feed-card .title { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 4px; word-wrap: break-word; overflow-wrap: break-word; }
.feed-card .title a { color: var(--text); text-decoration: none; }
.feed-card .title a:hover { color: var(--accent); }
.feed-card .meta { font-size: 12px; color: var(--muted); word-wrap: break-word; overflow-wrap: break-word; }
.feed-card .card-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.threat-badge {
  display: inline-block; font-size: 10px; padding: 2px 7px;
  border-radius: 3px; color: #fff; font-weight: 700; text-transform: uppercase;
}
.keyword-badge {
  display: inline-block; font-size: 10px; padding: 2px 7px;
  border-radius: 3px; color: #fff; font-weight: 600; background: #334155;
}

/* ── RIGHT PANEL (GLOBE) ── */
#globe-panel {
  width: 67%; position: relative; background: var(--bg);
  display: flex; flex-direction: column;
}
#globe-container {
  flex: 1; min-height: 0;
  display: flex; align-items: center; justify-content: center;
}
#globe-container canvas { display: block; }

/* ── CRISIS ALERT BANNERS (floating, dismissible) ── */
.crisis-alert {
  position: absolute; top: 10px; left: 10px; right: 10px;
  z-index: 15; display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.crisis-banner {
  pointer-events: auto;
  background: rgba(15,10,15,0.95); border: 1px solid rgba(239,68,68,0.4);
  border-radius: 10px; padding: 10px 36px 10px 14px;
  position: relative;
  animation: bannerSlideIn 0.3s ease;
  backdrop-filter: blur(8px);
}
@keyframes bannerSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.crisis-banner .crisis-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: #94a3b8;
  font-size: 16px; cursor: pointer; line-height: 1;
  padding: 2px; transition: color 0.2s;
}
.crisis-banner .crisis-close:hover { color: #fff; }
.crisis-banner .crisis-header-row {
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.crisis-banner .crisis-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: crisisDot 1s ease-in-out infinite; flex-shrink: 0;
}
@keyframes crisisDot {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px var(--red); }
  50% { opacity: 0.3; box-shadow: 0 0 10px var(--red); }
}
.crisis-banner .crisis-type {
  font-size: 9px; font-weight: 800; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--red);
}
.crisis-title { font-size: 13px; font-weight: 700; color: #fca5a5; line-height: 1.3; margin-bottom: 3px; }
.crisis-meta { font-size: 10px; color: #94a3b8; margin-bottom: 5px; }
.crisis-meta .src-count { color: var(--red); font-weight: 700; }
.crisis-markets { display: flex; flex-wrap: wrap; gap: 4px; }
.crisis-market-tag {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 700; padding: 2px 6px;
  border-radius: 3px; text-transform: uppercase; letter-spacing: 0.3px;
}
.crisis-market-tag.sell { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.crisis-market-tag.buy { background: rgba(34,197,94,0.15); color: #86efac; border: 1px solid rgba(34,197,94,0.3); }
.crisis-market-tag.hold { background: rgba(255,102,0,0.15); color: #ffb366; border: 1px solid rgba(255,102,0,0.3); }
.crisis-market-tag .signal-arrow { font-size: 8px; }

/* ── GLOBE INFO OVERLAY ── */
#globe-info {
  display: none; position: absolute;
  bottom: 50px; left: 12px; right: 12px;
  background: rgba(15,23,42,0.94); border: 1px solid var(--border);
  padding: 14px 16px; border-radius: 8px;
  font-size: 13px; z-index: 10; max-width: 420px;
}
#globe-info.visible { display: block; }
#globe-info .info-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; line-height: 1.35; }
#globe-info .info-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; color: var(--muted); font-size: 13px; }
#globe-info .info-row span { color: var(--text); font-weight: 600; }
#globe-info .info-keywords { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
#globe-info .info-keywords .kw { background: #1e293b; color: var(--accent); padding: 3px 8px; border-radius: 3px; font-size: 12px; }

/* ── BlockOne: Oman View ── */
.blockone-back {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  display: flex; align-items: center; gap: 6px;
  background: rgba(15,23,42,0.85); color: var(--accent); border: 1px solid var(--accent);
  padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(8px); transition: all 0.2s;
}
.blockone-back:hover { background: var(--accent); color: #fff; }
body.light .blockone-back { background: rgba(255,255,255,0.9); border-color: #2962ff; color: #2962ff; }
body.light .blockone-back:hover { background: #2962ff; color: #fff; }

/* ── BlockOne: Oman View Layout ── */
body.blockone-active main { }
body.blockone-active #feed-panel { width: 25%; }
body.blockone-active #globe-panel { width: 45%; }
.blockone-panel {
  width: 30%; display: flex; flex-direction: column;
  border-left: 1px solid var(--border); background: var(--panel);
  overflow: hidden;
}
.blockone-header {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.blockone-flag { font-size: 20px; }
.blockone-title { font-size: 14px; font-weight: 700; color: var(--text); }
.blockone-scroll {
  flex: 1; overflow-y: auto; padding: 10px;
}
.blockone-scroll::-webkit-scrollbar { width: 5px; }
.blockone-scroll::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.blockone-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px; margin-bottom: 8px;
}
.blockone-card-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 8px;
}
.blockone-stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 12px; color: var(--text);
}
.blockone-stat-label { color: var(--muted); }
.blockone-stat-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.blockone-stat-value.up { color: #22c55e; }
.blockone-stat-value.down { color: #ef4444; }
.blockone-badge {
  display: inline-block; font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
}
.blockone-badge.active { background: rgba(34,197,94,0.15); color: #22c55e; }
.blockone-badge.inactive { background: rgba(239,68,68,0.15); color: #ef4444; }
.blockone-badge.construction { background: rgba(245,158,11,0.15); color: #f59e0b; }
.blockone-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.blockone-table th {
  text-align: left; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--muted); padding: 4px 6px; border-bottom: 1px solid var(--border);
}
.blockone-table td { padding: 5px 6px; color: var(--text); border-bottom: 1px solid rgba(255,255,255,0.03); }
.blockone-table td:last-child { text-align: right; }

/* BlockOne: Layer toggles */
.blockone-layers {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  background: rgba(15,23,42,0.9); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px;
  backdrop-filter: blur(8px);
}
.blockone-layers-title {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--muted); margin-bottom: 6px;
}
.blockone-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text); cursor: pointer;
  padding: 3px 0;
}
.blockone-toggle input { accent-color: var(--accent); }

/* BlockOne: Light mode overrides */
body.light .blockone-panel { background: #ffffff; }
body.light .blockone-card { background: #f8f9fd; border-color: #e0e3eb; }
body.light .blockone-scroll::-webkit-scrollbar-thumb { background: #d1d4dc; }
body.light .blockone-layers { background: rgba(255,255,255,0.92); border-color: #e0e3eb; }
body.light .blockone-table td { border-bottom-color: #f0f3fa; }

/* BlockOne: Rig popup */
.rig-popup {
  position: absolute; bottom: 60px; left: 50%; transform: translateX(-50%);
  z-index: 25; background: rgba(15,23,42,0.95); border: 1px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; min-width: 220px;
  backdrop-filter: blur(10px); animation: bannerSlideIn 0.2s ease;
}
.rig-popup-close {
  position: absolute; top: 8px; right: 10px;
  background: none; border: none; color: #94a3b8;
  font-size: 16px; cursor: pointer; line-height: 1;
}
.rig-popup-close:hover { color: #fff; }
.rig-popup-title {
  font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px;
  padding-right: 20px;
}
.rig-popup-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 12px; color: var(--muted);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.rig-popup-row span:last-child { color: var(--text); font-weight: 600; }
body.light .rig-popup { background: rgba(255,255,255,0.95); border-color: #2962ff; }
body.light .rig-popup-row { border-bottom-color: #f0f3fa; }

/* ── LEGEND ── */
#globe-legend {
  position: absolute; bottom: 12px; left: 12px;
  display: flex; flex-wrap: wrap; gap: 6px; max-width: 90%; z-index: 5;
}
.legend-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--muted);
  background: rgba(17,24,39,0.9); padding: 4px 10px; border-radius: 4px;
}
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── GLOBE MARKERS ── */
.globe-marker-blink { animation: markerBlink 1s ease-in-out infinite; }
@keyframes markerBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.6); }
}

/* ── DISCLAIMER POPUP ── */
.disclaimer-popup {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.85); z-index: 2000;
  align-items: center; justify-content: center;
}
.disclaimer-popup.open { display: flex; }
.disclaimer-box {
  background: #111827; border: 1px solid var(--amber);
  border-radius: 12px; padding: 32px 28px; width: 480px;
  max-width: 92vw; text-align: center;
}
.disclaimer-title {
  font-size: 20px; font-weight: 700; color: var(--amber); margin-bottom: 16px;
}
.disclaimer-box p {
  font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 20px;
}
.disclaimer-accept {
  background: var(--amber); color: #000; border: none;
  padding: 10px 28px; border-radius: 6px; font-size: 14px;
  font-weight: 700; cursor: pointer; font-family: inherit;
  transition: background 0.2s;
}
.disclaimer-accept:hover { background: #fbbf24; }

/* ── LEGAL MODAL ── */
.legal-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.8); z-index: 1500;
  align-items: center; justify-content: center;
}
.legal-modal.open { display: flex; }
.legal-box {
  background: #111827; border: 1px solid var(--border);
  border-radius: 12px; padding: 32px 28px; width: 640px;
  max-width: 92vw; max-height: 85vh; overflow-y: auto;
  position: relative;
}
.legal-box::-webkit-scrollbar { width: 6px; }
.legal-box::-webkit-scrollbar-thumb { background: #334155; border-radius: 3px; }
.legal-close {
  position: absolute; top: 14px; right: 16px;
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer;
}
.legal-close:hover { color: var(--text); }
.legal-box h2 {
  font-size: 18px; font-weight: 700; color: var(--accent);
  margin-bottom: 4px; padding-right: 30px;
}
.legal-updated { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.legal-box h3 {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 18px 0 8px;
}
.legal-box p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 8px; }
.legal-box ul {
  list-style: disc; padding-left: 20px; margin-bottom: 10px;
}
.legal-box li {
  font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 6px;
}
.legal-box strong { color: var(--text); }

/* ── FOOTER ── */
.footer {
  position: relative; height: 40px;
  background: #070b14; border-top: 1px solid var(--border);
  overflow: hidden;
}
.footer__parralax {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden;
}
.footer__parralax-grid {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(56,189,248,0.03) 1px, transparent 1px),
    linear-gradient(0deg, rgba(56,189,248,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  animation: footerGridScroll 20s linear infinite;
}
@keyframes footerGridScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-40px); }
}
.footer__parralax-glow {
  position: absolute; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 400px; height: 20px;
  background: radial-gradient(ellipse, rgba(56,189,248,0.08) 0%, transparent 70%);
}
.footer__container {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  height: 100%; padding: 0 24px;
}
.footer__left p { font-size: 12px; color: #64748b; white-space: nowrap; }
.footer__left a { color: var(--accent); text-decoration: none; }
.footer__left a:hover { color: var(--text); }
.footer__right {
  display: flex; align-items: center; gap: 10px;
}
.footer__link {
  font-size: 12px; color: var(--muted); text-decoration: none;
  transition: color 0.2s;
}
.footer__link:hover { color: var(--text); }
.footer__icon { display: inline-flex; align-items: center; }
.footer__sep { color: #334155; font-size: 12px; }

/* ══════════════════════════════════════════════
   MOBILE — phones only (max-width: 767px)
   Tablets (768px+) get the desktop layout
   ══════════════════════════════════════════════ */
@media (max-width: 767px) {
  body { overflow: auto; height: auto; }

  /* ── Header ── */
  header {
    flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 6px;
  }
  .tagline { font-size: 9px; letter-spacing: 1px; order: 3; width: 100%; text-align: center; padding-top: 4px; }
  .header-right { gap: 10px; }
  .clock { font-size: 12px; }
  .auth-btn { font-size: 12px; padding: 5px 10px; }
  .auth-btn span { display: none; }

  /* ── Tickers ── */
  .ticker-markets, .ticker-crypto { height: 28px; }
  .ticker-label { font-size: 8px; padding: 0 8px; }
  .ticker-item { font-size: 11px; padding: 0 10px; }

  /* ── Main: stacked layout ── */
  main {
    flex-direction: column;
    height: auto;
    min-height: 0;
  }

  /* Globe first on mobile — smaller */
  #globe-panel {
    width: 100%; order: 1;
    height: 40vh; min-height: 240px;
    border-bottom: 1px solid var(--border);
  }

  /* Feed panel below */
  #feed-panel {
    width: 100%; order: 2;
    border-right: none;
    height: auto; min-height: 50vh;
  }
  #feed-list { padding: 8px 10px; }

  /* ── Toolbar ── */
  .feed-toolbar { padding: 6px 10px; gap: 6px; }
  .feed-search { font-size: 12px; padding: 6px 10px; }
  .filter-btn { font-size: 11px; padding: 6px 10px; }

  /* ── Cards ── */
  .feed-card { padding: 10px; gap: 10px; }
  .card-thumb { width: 56px; height: 56px; }
  .feed-card .title { font-size: 14px; }
  .feed-card .meta { font-size: 11px; }
  .feed-card .source { font-size: 10px; }
  .threat-badge, .keyword-badge { font-size: 9px; }

  /* ── Crisis banners mobile ── */
  .crisis-alert { top: 6px; left: 6px; right: 6px; gap: 6px; }
  .crisis-banner { padding: 8px 30px 8px 10px; border-radius: 8px; }
  .crisis-title { font-size: 12px; }
  .crisis-meta { font-size: 9px; }
  .crisis-market-tag { font-size: 8px; padding: 2px 5px; }

  /* ── Globe info ── */
  #globe-info {
    top: auto; bottom: 44px; left: 8px; right: 8px;
    max-width: none; font-size: 12px; padding: 10px 12px;
  }
  #globe-info .info-title { font-size: 13px; }
  #globe-legend { bottom: 8px; left: 8px; gap: 4px; }
  .legend-item { font-size: 9px; padding: 3px 6px; }

  /* BlockOne mobile */
  body.blockone-active #feed-panel { width: 100%; order: 3; }
  body.blockone-active #globe-panel { width: 100%; order: 1; height: 35vh; }
  .blockone-panel { width: 100% !important; order: 2; height: auto; max-height: 40vh; border-left: none; border-bottom: 1px solid var(--border); }
  .blockone-layers { top: auto; bottom: 50px; right: 8px; }

  /* ── Footer ── */
  .footer { height: auto; min-height: 36px; }
  .footer__container {
    flex-direction: column; gap: 6px; padding: 8px 14px;
    height: auto; align-items: center; text-align: center;
  }
  .footer__left p { font-size: 11px; white-space: normal; }
  .footer__right { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .footer__link { font-size: 11px; }

  /* ── Modals ── */
  .disclaimer-box { padding: 24px 20px; }
  .disclaimer-title { font-size: 18px; }
  .legal-box { padding: 24px 20px; }
  .legal-box h2 { font-size: 16px; }

  /* ── Auth modal ── */
  .auth-box { width: 92vw; max-width: 360px; padding: 24px 20px; }
  .auth-title { font-size: 18px; }
  .auth-provider { font-size: 14px; }
  .pref-header { gap: 10px; }
  .pref-header .auth-profile-pic { width: 48px; height: 48px; }
  .pref-tab { font-size: 11px; }
}
