/* ============================================================
   SITUATION ROOM — Bitcoin & Global Macro Dashboard
   Parchment & Black Ink Theme (from utxocosmos.space)
   ============================================================ */

/* ── Splash Screen ── */
#splash-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(30, 25, 18, 0.85);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.5s ease;
}
#splash-overlay.dismissed {
  opacity: 0; pointer-events: none;
}
#splash-card {
  background: #f8f1e3;
  border: 2px solid #3e2c1a;
  max-width: 640px; width: 90%;
  max-height: 85vh; overflow-y: auto;
  padding: 2rem 2.5rem;
  font-family: 'IM Fell English SC', serif;
  color: #3e2c1a;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
#splash-card::-webkit-scrollbar { width: 6px; }
#splash-card::-webkit-scrollbar-track { background: #efe6d3; }
#splash-card::-webkit-scrollbar-thumb { background: #b8a88a; border-radius: 3px; }
.splash-header { text-align: center; margin-bottom: 0.5rem; }
.splash-title {
  font-size: 1.8rem; letter-spacing: 0.15em; text-transform: uppercase;
  color: #3e2c1a; margin-bottom: 0.2rem;
}
.splash-subtitle {
  font-size: 0.85rem; letter-spacing: 0.2em; text-transform: uppercase;
  color: #8b7355;
}
.splash-rule {
  border: none; border-top: 1px solid #c4b08a; margin: 1rem 0;
}
.splash-body { font-family: 'IM Fell English', serif; font-size: 0.85rem; line-height: 1.6; }
.splash-body p { margin: 0.6rem 0; color: #5a4a3a; }
.splash-section { margin: 1rem 0; }
.splash-section-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.15em;
  color: #8b7355; border-bottom: 1px solid #d4c4a4; padding-bottom: 0.3rem;
  margin-bottom: 0.5rem;
}
.splash-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.3rem 1.5rem;
}
.splash-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.15rem 0; border-bottom: 1px dotted #ddd4c0;
}
.splash-label { color: #3e2c1a; font-size: 0.78rem; }
.splash-val { color: #8b7355; font-size: 0.72rem; text-align: right; }
.splash-features {
  margin: 0; padding-left: 1.2rem; list-style: none;
}
.splash-features li {
  position: relative; padding: 0.15rem 0; color: #5a4a3a; font-size: 0.8rem;
}
.splash-features li::before {
  content: '◆'; position: absolute; left: -1.1rem;
  color: #8b7355; font-size: 0.55rem; top: 0.3rem;
}
.splash-disclaimer {
  font-size: 0.7rem; color: #a0906e; font-style: italic; text-align: center;
  margin-top: 1rem;
}
#splash-enter {
  display: block; width: 100%; margin-top: 0.5rem;
  background: #3e2c1a; color: #f8f1e3; border: none;
  padding: 0.75rem; cursor: pointer;
  font-family: 'IM Fell English SC', serif; font-size: 0.9rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  transition: background 0.2s;
}
#splash-enter:hover { background: #5a3e28; }

/* ── What Changed Overlay ──────────────────────────────────── */
.diff-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(30, 25, 18, 0.92);
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.4s ease;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto;
  padding: 1rem;
}
.diff-overlay.dismissed { opacity: 0; pointer-events: none; }
.diff-card {
  background: #f8f1e3;
  border: 2px solid #3e2c1a;
  max-width: 520px; width: 100%;
  padding: 1.8rem 2rem;
  font-family: 'IM Fell English SC', serif;
  color: #3e2c1a;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  position: relative;
  z-index: 100000;
}
.diff-header {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: 2px solid #3e2c1a;
  padding-bottom: 0.6rem; margin-bottom: 1rem;
}
.diff-header h2 {
  font-size: 1.1rem; letter-spacing: 0.08em;
  text-transform: uppercase; margin: 0;
}
.diff-timeago {
  font-size: 0.72rem; color: #888;
  font-family: 'IBM Plex Mono', monospace;
}
.diff-body { display: flex; flex-direction: column; gap: 0.6rem; }
.diff-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(62,44,26,0.12);
}
.diff-row:last-child { border-bottom: none; }
.diff-label {
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.06em; color: #666;
}
.diff-values {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.82rem; text-align: right;
}
.diff-primary .diff-values { font-size: 1rem; font-weight: 600; }
.diff-delta {
  display: inline-block; margin-left: 6px;
  font-size: 0.78rem; font-weight: 600;
}
.diff-delta.positive { color: #2a6e2a; }
.diff-delta.negative { color: #8b2020; }
.diff-headline .diff-values {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.78rem; max-width: 300px;
  text-align: right; line-height: 1.4;
}
.diff-summary {
  flex-direction: column; text-align: center;
  padding-top: 0.5rem; border-top: 1px solid rgba(62,44,26,0.2);
}
.diff-summary span {
  font-size: 0.72rem; line-height: 1.5;
  color: #555; font-style: italic;
  font-family: 'IBM Plex Mono', monospace;
}
.diff-dismiss {
  display: block; width: 100%; margin-top: 1.2rem;
  padding: 0.9rem 0.6rem; border: none;
  background: #3e2c1a; color: #f8f1e3;
  font-family: 'IM Fell English SC', serif;
  font-size: 0.85rem; cursor: pointer;
  letter-spacing: 0.12em; text-transform: uppercase;
  transition: background 0.2s;
  position: relative;
  z-index: 100001;
  -webkit-tap-highlight-color: rgba(0,0,0,0.2);
  touch-action: manipulation;
  min-height: 48px;
}
.diff-dismiss:hover { background: #5a3e28; }
.diff-dismiss:active { background: #5a3e28; }

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

:root {
  --parchment: #f8f1e3;
  --parchment-hover: #ede6d4;
  --parchment-active: #ddd6c4;
  --ink: #1a1a1a;
  --ink-border: #2a2a2a;
  --ink-secondary: #666;
  --ink-tertiary: #888;
  --ink-muted: #bbb;
  --grid-line: rgba(0,0,0,0.025);
  --sepia: rgba(80, 60, 20, 0.06);
}

body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--parchment);
  color: var(--ink);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Parchment grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
  z-index: 0;
}

/* Vignette — worn paper edges */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(80,60,20,0.12) 100%);
  pointer-events: none;
  z-index: 9999;
}

/* ---- HEADER ---- */
#header {
  position: relative;
  z-index: 10;
  background: var(--parchment);
  border-bottom: 1px solid var(--ink-border);
  padding: 0 24px;
  flex-shrink: 0;
}

.header-rule-double {
  border: none;
  border-top: 3px double var(--ink-border);
  margin: 0 0 4px 0;
}

.header-rule-single {
  border: none;
  border-top: 1px solid var(--ink-border);
  margin: 4px 0 0 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  position: relative;
}

.header-wing {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.header-wing-left {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

/* Header Fear & Greed */
.header-fg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 10px;
  padding: 2px 6px;
  border: 1px solid rgba(0,0,0,0.12);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.05em;
  cursor: default;
}
.header-fg-label {
  color: var(--ink-muted);
  font-size: 8px;
  text-transform: uppercase;
}
.header-fg-score {
  font-weight: 700;
  font-size: 11px;
  min-width: 16px;
  text-align: center;
}

/* Burger Menu */
#burger-menu-wrapper {
  position: relative;
}
#burger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  padding: 5px;
  background: none;
  border: 1px solid rgba(0,0,0,0.3);
  cursor: pointer;
}
#burger-btn span {
  display: block;
  width: 100%;
  height: 2.5px;
  background: var(--ink-primary, #3e2c1a);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}
#burger-btn:hover {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.5);
}
#burger-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  min-width: 200px;
  background: var(--parchment);
  border: 1px solid rgba(0,0,0,0.2);
  box-shadow: 2px 3px 8px rgba(0,0,0,0.12);
  z-index: 1000;
  padding: 4px 0;
}
#burger-dropdown.open {
  display: block;
}
#burger-dropdown a {
  display: block;
  padding: 8px 14px;
  color: var(--ink-primary);
  text-decoration: none;
  font-family: 'IM Fell English SC', 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
#burger-dropdown a:hover {
  background: rgba(0,0,0,0.06);
}

.header-wing-right {
  justify-content: flex-end;
}

.header-center {
  text-align: center;
  flex-shrink: 0;
}

.header-title {
  font-size: 22px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: normal;
  line-height: 1.1;
}

.header-subtitle {
  font-size: 9px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  margin-top: 1px;
}

.header-badge {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
}

.refresh-btn {
  font-family: Georgia, serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink-border);
  background: var(--parchment);
  padding: 3px 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.refresh-btn:hover { background: var(--parchment-hover); }
.refresh-btn:active { background: var(--parchment-active); }

/* Threat Level Gauge */
#threat-gauge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
}

#threat-label {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  flex-shrink: 0;
}

#threat-bar {
  width: 80px;
  height: 8px;
  border: 1px solid rgba(0,0,0,0.2);
  background: rgba(0,0,0,0.04);
  position: relative;
  flex-shrink: 0;
}

#threat-bar-fill {
  height: 100%;
  width: 0%;
  transition: width 0.8s ease, background-color 0.8s ease;
  background: #2a6e2a;
}

#threat-level {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  min-width: 50px;
  text-align: left;
}

#threat-level.low { color: #2a6e2a; }
#threat-level.guarded { color: #5a7e2a; }
#threat-level.elevated { color: #b8860b; }
#threat-level.high { color: #b85020; }
#threat-level.severe { color: #8b2020; }
#threat-level.critical { color: #5a0000; }

/* ---- MAIN LAYOUT ---- */
#main {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ---- LEFT SIDEBAR ---- */
#sidebar {
  width: 240px;
  flex-shrink: 0;
  border-right: 1px solid var(--ink-border);
  background: var(--parchment);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 12px;
  gap: 4px;
  z-index: 2;
}

#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: var(--ink-muted); }

.sidebar-section {
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.sidebar-section:last-child { border-bottom: none; }

.section-title {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #444;
  border-bottom: 1px solid var(--ink-border);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 1px 0;
  font-size: 11px;
  line-height: 1.5;
}

.data-label {
  color: var(--ink-secondary);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.data-value {
  font-weight: bold;
  font-size: 11px;
  letter-spacing: 0.02em;
  text-align: right;
}

.data-value.positive { color: #2a6e2a; }
.data-value.negative { color: #8b2020; }
.data-change { font-size: 9px; margin-left: 4px; white-space: nowrap; }
.data-change.positive { color: #2a6e2a; }
.data-change.negative { color: #8b2020; }
.data-value.loading {
  color: transparent;
  font-weight: normal;
  font-style: italic;
  background: linear-gradient(90deg, #e8e0d0 25%, #f0e8d8 50%, #e8e0d0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
  min-width: 60px;
  display: inline-block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── BTC Hero Price (dominant on load) ── */
.sidebar-section.btc-hero {
  background: rgba(80,60,20,0.04);
  border: 1px solid rgba(80,60,20,0.12);
  padding: 10px 12px 8px;
  margin-bottom: 4px;
}
.sidebar-section.btc-hero .section-title {
  font-size: 10px;
  color: #8b7355;
}
.btc-hero-price {
  font-size: 22px;
  font-weight: bold;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 2px 0 4px;
  font-family: 'Courier New', monospace;
}
.btc-hero-price.loading {
  color: transparent;
  background: linear-gradient(90deg, #e8e0d0 25%, #f0e8d8 50%, #e8e0d0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
  width: 160px;
  height: 28px;
}
.btc-hero-change {
  font-size: 13px;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

/* Fear & Greed gauge */
.fg-gauge {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.fg-score {
  font-size: 22px;
  font-weight: bold;
  line-height: 1;
}

.fg-label {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
}

.fg-bar {
  flex: 1;
  height: 5px;
  background: rgba(0,0,0,0.08);
  position: relative;
  border: 1px solid rgba(0,0,0,0.15);
}

.fg-bar-fill {
  height: 100%;
  background: var(--ink);
  transition: width 0.6s ease;
}

/* ── Conviction Score Panel ── */
.conviction-section { cursor: pointer; }
.conviction-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}
.conviction-score {
  font-size: 26px;
  font-weight: bold;
  line-height: 1;
  font-family: 'IBM Plex Mono', monospace;
}
.conviction-band {
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
  font-weight: 600;
}
.conviction-bar {
  height: 4px;
  background: rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.12);
  margin: 5px 0 6px;
}
.conviction-bar-fill {
  height: 100%;
  transition: width 0.6s ease, background 0.6s ease;
}
.conviction-signals {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.conviction-signal {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  line-height: 1.3;
}
.cs-icon {
  font-size: 8px;
  width: 12px;
  text-align: center;
  color: var(--ink-muted);
}
.cs-name {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 8px;
  color: var(--ink-secondary);
}
.cs-score {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 9px;
  min-width: 20px;
  text-align: right;
}

/* ── Conviction Detail Overlay ── */
.conviction-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(30, 25, 18, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 1rem;
}
.conviction-overlay.visible {
  opacity: 1;
}
.conviction-detail-card {
  background: var(--parchment);
  border: 2px solid #3e2c1a;
  max-width: 640px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 12px 60px rgba(0,0,0,0.5);
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.conviction-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #3e2c1a;
  padding-bottom: 0.8rem;
  margin-bottom: 1.2rem;
}
.conviction-detail-header h2 {
  font-family: 'IM Fell English SC', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
  color: #3e2c1a;
}
.conviction-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #888;
  line-height: 1;
  padding: 4px 8px;
}
.conviction-close:hover { color: #3e2c1a; }
.conviction-detail-top {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
.conviction-gauge-large {
  flex-shrink: 0;
}
.conviction-detail-meta {
  flex: 1;
}
.conviction-detail-band {
  font-family: 'IM Fell English SC', serif;
  font-size: 1.1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}
.conviction-detail-signals {
  font-size: 0.75rem;
  color: var(--ink-secondary);
  font-family: 'IBM Plex Mono', monospace;
}
.conviction-detail-updated {
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin-top: 4px;
}
.conviction-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cd-signal-row {
  display: flex;
  align-items: center;
  padding: 0.7rem 0;
  border-bottom: 1px solid rgba(62,44,26,0.1);
}
.cd-signal-row:last-child { border-bottom: none; }
.cd-signal-icon {
  font-size: 14px;
  width: 24px;
  text-align: center;
  color: var(--ink-muted);
}
.cd-signal-info {
  flex: 1;
  margin-left: 8px;
}
.cd-signal-name {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.cd-signal-label {
  font-size: 0.7rem;
  color: var(--ink-secondary);
  line-height: 1.4;
  margin-top: 2px;
}
.cd-signal-score-col {
  text-align: right;
  min-width: 50px;
}
.cd-signal-score-val {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
}
.cd-signal-bar {
  width: 80px;
  height: 4px;
  background: rgba(0,0,0,0.08);
  margin-top: 4px;
  margin-left: auto;
}
.cd-signal-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}
.conviction-detail-footer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(62,44,26,0.15);
}
.conviction-detail-footer p {
  font-size: 0.65rem;
  color: var(--ink-muted);
  font-style: italic;
  text-align: center;
  line-height: 1.4;
}

/* ---- CONTENT AREA (two-column) ---- */
#content {
  flex: 1;
  display: flex;
  overflow: hidden;
}

#content-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--ink-border);
}

#globe-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

#content-right {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#content-right::-webkit-scrollbar { width: 4px; }
#content-right::-webkit-scrollbar-thumb { background: var(--ink-muted); }

/* ---- WORLD MAP (D3.js) ---- */
#map-section {
  position: relative;
  border-bottom: 1px solid var(--ink-border);
  padding: 8px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#map-header {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 2px;
  flex-shrink: 0;
}

#map-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#map-title {
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #444;
}

#map-legend {
  display: flex;
  gap: 12px;
}

.legend-item {
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.bitcoin   { background: #f7931a; }
.legend-dot.conflict  { background: #8b2020; }
.legend-dot.disaster  { background: #b8860b; }
.legend-dot.economy   { background: #2a2a2a; }
.legend-dot.political { background: #555; }

/* Map filter dropdown */
#map-filters {
  display: flex;
  align-items: center;
}

#map-view-toggle {
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.06em;
  border: 1px solid var(--ink-border);
  background: var(--parchment);
  color: var(--ink);
  padding: 2px 8px;
  cursor: pointer;
  transition: background 0.15s;
}
#map-view-toggle:hover { background: var(--parchment-hover); }

#map-filter-select {
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--ink-border);
  background: var(--parchment);
  color: var(--ink);
  padding: 2px 6px;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='5'%3E%3Cpath d='M0 0l4 5 4-5z' fill='%231a1a1a'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  padding-right: 18px;
}
#map-filter-select:hover { background-color: var(--parchment-hover); }
#map-filter-select optgroup { font-style: normal; font-weight: bold; font-size: 9px; }
#map-filter-select option { font-weight: normal; text-transform: none; }

/* Color scale legend */
/* Map body: scale bar + map side by side */
#map-body {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

#map-scale {
  display: flex;
  flex-direction: row;
  flex-shrink: 0;
  padding: 8px 2px 8px 6px;
  gap: 4px;
  position: relative;
  width: 52px;
}

#map-scale-gradient {
  width: 8px;
  flex-shrink: 0;
  border: 1px solid rgba(0,0,0,0.15);
  background: linear-gradient(to bottom, #2a6e2a, #6a9e3a, #b8b020, #b8860b, #8b2020);
  border-radius: 2px;
  align-self: stretch;
}

/* Labels column — sits to the right of the gradient bar */
#map-scale-labels-top,
#map-scale-labels-mid,
#map-scale-labels-bottom {
  position: absolute;
  left: 20px;
  font-size: 7px;
  letter-spacing: 0.03em;
  white-space: nowrap;
  font-weight: bold;
}

#map-scale-labels-top {
  top: 8px;
  color: #2a6e2a;
}

#map-scale-labels-mid {
  top: 50%;
  transform: translateY(-50%);
  font-size: 6.5px;
  font-weight: normal;
  color: var(--ink-tertiary);
}

#map-scale-labels-bottom {
  bottom: 8px;
  color: #8b2020;
}

#map-scale-name {
  display: none;
}

#world-map-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 240px;
  overflow: hidden;
  cursor: grab;
}
#world-map-container:active { cursor: grabbing; }

#world-map-container svg {
  width: 100%;
  height: 100%;
}

/* Globe ocean */
.globe-ocean {
  fill: rgba(0,0,0,0.02);
  stroke: var(--ink-border);
  stroke-width: 0.5;
}

/* D3 map country styling */
.country {
  fill: rgba(0,0,0,0.07);
  stroke: var(--ink-border);
  stroke-width: 0.4;
  transition: fill 0.15s;
}
.country:hover {
  fill: rgba(0,0,0,0.16);
}

/* Country borders / graticule */
.graticule {
  fill: none;
  stroke: rgba(0,0,0,0.04);
  stroke-width: 0.3;
}
.boundary {
  fill: none;
  stroke: rgba(0,0,0,0.12);
  stroke-width: 0.3;
}

/* Day/Night terminator overlay */
.night-overlay {
  fill: rgba(10, 10, 30, 0.25);
  stroke: rgba(80, 60, 20, 0.5);
  stroke-width: 0.8;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

/* Map controls (zoom + rotation toggle) */
#map-controls {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 10;
}
#map-controls button {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(0,0,0,0.25);
  background: rgba(248, 241, 227, 0.85);
  color: #3e2c1a;
  font-family: 'IM Fell English SC', 'Palatino Linotype', 'Book Antiqua', serif;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
#map-controls button:hover {
  background: rgba(248, 241, 227, 1);
  border-color: rgba(0,0,0,0.4);
}
#map-controls button.active {
  background: #3e2c1a;
  color: #f8f1e3;
  border-color: #3e2c1a;
}

/* ── Mode Toggle (Globe / Charts) ── */
#mode-toggle {
  display: inline-flex;
  border: 1px solid rgba(0,0,0,0.2);
  overflow: hidden;
}
.mode-btn {
  padding: 2px 10px;
  font-family: 'IM Fell English SC', serif;
  font-size: 11px;
  background: transparent;
  color: #5a3e28;
  border: none;
  border-right: 1px solid rgba(0,0,0,0.15);
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: background 0.15s, color 0.15s;
}
.mode-btn:last-child { border-right: none; }
.mode-btn.active {
  background: #3e2c1a;
  color: #f8f1e3;
}
.mode-btn:not(.active):hover {
  background: rgba(62,44,26,0.1);
}

/* ── Charts View ── */
#charts-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}
#charts-normal {
  flex: 1;
  display: flex;
  min-height: 0;
}
#charts-expanded {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
}
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  width: 100%;
  height: 100%;
}
.chart-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
}
.chart-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5a3e28;
  padding: 4px 0 2px;
  flex-shrink: 0;
}
.chart-canvas {
  flex: 1;
  min-height: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
}
.chart-canvas svg {
  width: 100%;
  height: 100%;
}

/* Chart styling */
.chart-line {
  fill: none;
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.chart-area {
  opacity: 0.12;
}
.chart-grid line {
  stroke: rgba(0,0,0,0.06);
  stroke-dasharray: 2,3;
}
.chart-axis text {
  font-family: Georgia, serif;
  font-size: 8px;
  fill: #8b7355;
}
.chart-axis line,
.chart-axis path {
  stroke: rgba(0,0,0,0.1);
}
.chart-crosshair {
  stroke: rgba(0,0,0,0.2);
  stroke-dasharray: 3,3;
  pointer-events: none;
}
.chart-tooltip-box {
  position: absolute;
  background: rgba(248,241,227,0.95);
  border: 1px solid #c4b08a;
  padding: 4px 8px;
  font-family: Georgia, serif;
  font-size: 10px;
  color: #2c1810;
  pointer-events: none;
  white-space: nowrap;
  z-index: 20;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.chart-dot {
  fill: #3e2c1a;
  stroke: #f8f1e3;
  stroke-width: 1.5;
  pointer-events: none;
}
.chart-price-line { stroke: #3e2c1a; }
.chart-price-area { fill: #3e2c1a; }
.chart-hashrate-line { stroke: #b87333; }
.chart-hashrate-area { fill: #b87333; }
.chart-mvrv-line { stroke: #4a6741; }
.chart-mvrv-area { fill: #4a6741; }
.chart-exchange-line { stroke: #6b4c8a; }
.chart-exchange-area { fill: #6b4c8a; }
.chart-volume-bar { fill: rgba(62,44,26,0.15); }
.chart-ref-line {
  stroke: rgba(139,32,32,0.4);
  stroke-dasharray: 4,3;
  stroke-width: 1;
}
.chart-ref-label {
  font-family: Georgia, serif;
  font-size: 7px;
  fill: #8b2020;
}

/* Event markers on map */
.event-marker {
  cursor: pointer;
  opacity: 0.85;
}
.event-marker circle {
  stroke: var(--parchment);
  stroke-width: 1;
}
.event-marker.bitcoin circle   { fill: #f7931a; }
.event-marker.conflict circle  { fill: #8b2020; }
.event-marker.disaster circle  { fill: #b8860b; }
.event-marker.economy circle   { fill: #2a2a2a; }
.event-marker.political circle { fill: #555; }

/* Pulse ring around active events */
.event-pulse {
  fill: none;
  stroke-width: 1;
  opacity: 0;
  animation: marker-pulse 2.5s ease-out infinite;
}
.bitcoin .event-pulse   { stroke: #f7931a; }
.conflict .event-pulse  { stroke: #8b2020; }
.disaster .event-pulse  { stroke: #b8860b; }
.economy .event-pulse   { stroke: #2a2a2a; }
.political .event-pulse { stroke: #555; }

@keyframes marker-pulse {
  0%   { r: 4; opacity: 0.6; }
  100% { r: 14; opacity: 0; }
}
@keyframes iss-pulse {
  0%   { r: 5; opacity: 0.8; }
  100% { r: 18; opacity: 0; }
}

/* Map tooltip */
#map-tooltip {
  display: none;
  position: absolute;
  background: var(--parchment);
  border: 1px solid var(--ink-border);
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.5;
  max-width: 280px;
  z-index: 30;
  box-shadow: 2px 2px 0 rgba(0,0,0,0.06);
  pointer-events: none;
}
#map-tooltip.visible { display: block; }
#map-tooltip .tt-category {
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
#map-tooltip .tt-category.bitcoin   { color: #f7931a; }
#map-tooltip .tt-category.conflict  { color: #8b2020; }
#map-tooltip .tt-category.disaster  { color: #b8860b; }
#map-tooltip .tt-category.economy   { color: #2a2a2a; }
#map-tooltip .tt-category.political { color: #555; }
#map-tooltip .tt-location {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-secondary);
  margin-bottom: 2px;
}
#map-tooltip .tt-headline {
  font-weight: bold;
  font-size: 11.5px;
}
#map-tooltip .tt-source {
  font-size: 9px;
  color: var(--ink-tertiary);
  margin-top: 2px;
}

/* Intelligence + Grok row */
#intel-grok-row {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Intelligence Feed */
#intel-feed {
  flex: 7;
  padding: 8px 12px;
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Grok AI Panel */
#grok-panel {
  flex: 3;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--ink-border);
  padding: 8px 10px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

#grok-content {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--ink);
  padding-right: 4px;
}

/* ── Custom Tooltip (replaces native title) ── */
#custom-tooltip {
  display: none;
  position: fixed;
  z-index: 20000;
  background: var(--parchment);
  border: 1px solid var(--ink-border);
  padding: 10px 14px;
  font-family: Georgia, serif;
  font-size: 10px;
  line-height: 1.7;
  letter-spacing: 0.03em;
  color: var(--ink);
  max-width: 300px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  pointer-events: none;
}
#custom-tooltip.visible {
  display: block;
}
#custom-tooltip p {
  margin: 0 0 4px 0;
}
#custom-tooltip p:last-child {
  margin-bottom: 0;
}

/* Grok rate-limit toast */
#grok-rate-toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--parchment);
  border: 2px solid var(--ink-border);
  padding: 18px 28px;
  font-family: Georgia, serif;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink);
  text-align: center;
  z-index: 10000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  max-width: 340px;
  letter-spacing: 0.03em;
  opacity: 1;
  transition: opacity 0.8s ease;
}
#grok-rate-toast strong {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
}
#grok-rate-toast.fade-out {
  opacity: 0;
}

/* Minimize button */
#intel-minimize-btn {
  float: right;
  background: none;
  border: 1px solid var(--ink-border);
  font-family: Georgia, serif;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink-secondary);
  width: 22px;
  height: 18px;
  line-height: 14px;
  text-align: center;
  padding: 0;
  margin-top: -2px;
}
#intel-minimize-btn:hover {
  background: var(--ink-border);
  color: var(--ink);
}

/* Minimized state */
#intel-grok-row.minimized {
  flex: 0 0 24px !important;
  min-height: 24px;
  max-height: 24px;
  overflow: hidden;
  border-top: 1px solid var(--ink-border);
}
#intel-grok-row.minimized #intel-feed,
#intel-grok-row.minimized #grok-content,
#intel-grok-row.minimized #grok-refresh-btn,
#intel-grok-row.minimized #intel-items,
#intel-grok-row.minimized #intel-header {
  display: none;
}
#intel-grok-row.minimized #grok-panel {
  flex: 1;
  border-left: none;
  padding: 3px 10px;
}
#intel-grok-row.minimized .section-title {
  margin: 0;
  padding: 0;
  font-size: 9px;
}

/* Restore button on intel-feed header when minimized */
#intel-restore-bar {
  display: none;
}
#intel-grok-row.minimized #intel-feed {
  display: none;
}

#grok-content::-webkit-scrollbar { width: 4px; }
#grok-content::-webkit-scrollbar-track { background: transparent; }
#grok-content::-webkit-scrollbar-thumb { background: var(--ink-muted); }

#grok-content p {
  margin-bottom: 6px;
}

#grok-content strong {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

#grok-refresh-btn {
  flex-shrink: 0;
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--ink-border);
  background: var(--parchment);
  padding: 4px 8px;
  cursor: pointer;
  margin-top: 6px;
  transition: background 0.15s;
}
#grok-refresh-btn:hover { background: var(--parchment-hover); }
#grok-refresh-btn:disabled { opacity: 0.4; cursor: default; }

#intel-header {
  flex-shrink: 0;
  margin-bottom: 4px;
}

#intel-filter-row {
  display: inline-flex;
  gap: 3px;
  margin-left: 8px;
  vertical-align: middle;
}

.intel-cat-btn {
  font-family: Georgia, serif;
  font-size: 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(0,0,0,0.15);
  background: transparent;
  color: var(--ink-secondary);
  padding: 1px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s;
}
.intel-cat-btn:hover { background: var(--parchment-hover); }
.intel-cat-btn.active {
  background: var(--ink);
  color: var(--parchment);
  border-color: var(--ink);
}
.intel-cat-btn.active .legend-dot { border: 1px solid var(--parchment); }

#intel-items {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#intel-feed::-webkit-scrollbar, #intel-items::-webkit-scrollbar { width: 4px; }
#intel-feed::-webkit-scrollbar-track, #intel-items::-webkit-scrollbar-track { background: transparent; }
#intel-feed::-webkit-scrollbar-thumb, #intel-items::-webkit-scrollbar-thumb { background: var(--ink-muted); }

.intel-loading {
  color: var(--ink-tertiary);
  font-style: italic;
  font-size: 11px;
  padding: 12px 0;
  text-align: center;
  background: linear-gradient(90deg, transparent 0%, rgba(80,60,20,0.03) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

.intel-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  align-items: flex-start;
}

.intel-category {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-top: 5px;
}
.intel-category.bitcoin   { background: #f7931a; }
.intel-category.conflict  { background: #8b2020; }
.intel-category.disaster  { background: #b8860b; }
.intel-category.economy   { background: #2a2a2a; }
.intel-category.political { background: #555; }

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

.intel-headline {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink);
}

.intel-headline a {
  color: var(--ink);
  text-decoration: none;
}
.intel-headline a:hover { text-decoration: underline; }

.intel-meta {
  font-size: 9px;
  color: var(--ink-tertiary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 1px;
}

/* Right column panels */
.panel-section {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.panel-section:last-child { border-bottom: none; }

#market-tickers, #commodity-tickers {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.market-ticker {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  font-size: 11px;
}

.ticker-name {
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-secondary);
}

.ticker-price {
  font-weight: bold;
  text-align: right;
  font-size: 11px;
}

.ticker-change {
  text-align: right;
  font-size: 10px;
  min-width: 52px;
}

.ticker-change.positive { color: #2a6e2a; }
.ticker-change.negative { color: #8b2020; }
.ticker-change.loading, .ticker-price.loading {
  color: transparent;
  font-weight: normal;
  background: linear-gradient(90deg, #e8e0d0 25%, #f0e8d8 50%, #e8e0d0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 3px;
  min-width: 40px;
}

/* ---- CENTRAL BANK WATCH ---- */
#cb-watch {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cb-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.cb-bank {
  font-size: 9px;
  font-weight: bold;
  letter-spacing: 0.06em;
  color: var(--ink-secondary);
}

.cb-rate {
  font-size: 11px;
  font-weight: bold;
  text-align: right;
  color: var(--ink);
}

.cb-note {
  font-size: 8px;
  color: var(--ink-tertiary);
  font-style: italic;
  margin-top: 6px;
  line-height: 1.4;
}

/* ---- NEWS TICKER (FOOTER) ---- */
#ticker {
  position: relative;
  z-index: 10;
  background: var(--parchment);
  border-top: 1px solid var(--ink-border);
  overflow: hidden;
  height: 28px;
  display: flex;
  align-items: center;
}

.ticker-label {
  flex-shrink: 0;
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #444;
  padding: 0 12px;
  min-width: 54px;
  justify-content: center;
  border-right: 1px solid var(--ink-border);
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
}

.ticker-content {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}

.ticker-content:hover { animation-play-state: paused; }

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

.ticker-item {
  font-size: 11px;
  color: var(--ink);
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ticker-item a {
  color: var(--ink);
  text-decoration: none;
}

/* ── BTC Equities Ticker ──────────────────────────────────── */
#equities-ticker {
  position: relative; z-index: 10;
  background: var(--parchment);
  border-top: 1px solid var(--ink-border);
  overflow: hidden; height: 28px;
  display: flex; align-items: center;
}
.eq-ticker-label {
  flex-shrink: 0; font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: #444; padding: 0 12px;
  min-width: 54px; justify-content: center;
  border-right: 1px solid var(--ink-border);
  height: 100%; display: flex; align-items: center;
}
.eq-ticker-track {
  flex: 1; overflow: hidden; position: relative; height: 100%;
}
.eq-ticker-content {
  display: flex; align-items: center; height: 100%;
  white-space: nowrap;
  animation: ticker-scroll 60s linear infinite;
  will-change: transform;
}
.eq-ticker-content:hover { animation-play-state: paused; }
.eq-item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 24px; font-size: 11px; color: var(--ink);
}
.eq-item .eq-symbol { font-weight: 700; }
.eq-item .eq-price { color: var(--ink); }
.eq-item .eq-change { font-size: 10px; }
.eq-item .eq-change.positive { color: #2a6e2a; }
.eq-item .eq-change.negative { color: #8b2020; }
.eq-item .eq-sep { color: var(--ink-border); }
.ticker-item a:hover { text-decoration: underline; }

.ticker-sep {
  color: var(--ink-muted);
  font-size: 8px;
}

/* ---- LOADING STATE ---- */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  color: transparent !important;
  border-radius: 2px;
  min-width: 40px;
  display: inline-block;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
  #sidebar { width: 200px; }
  #content-right { width: 220px; }
}

@media (max-width: 768px) {

  /* ── Header ── */
  .header-inner {
    flex-wrap: wrap;
    padding: 4px 8px;
    justify-content: center;
    gap: 2px;
  }
  .header-wing-left {
    order: -1;
    flex: 0 0 auto;
  }
  #utc-clock { display: none; }
  #last-refresh { display: none; }
  .header-fg { display: none; }
  .header-center {
    flex: 1 1 100%;
    order: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }
  .header-title { font-size: 14px; letter-spacing: 0.1em; }
  .header-subtitle { display: none; }
  .header-wing-right {
    order: 0;
    flex: 0 0 auto;
    gap: 4px;
  }
  /* Move threat gauge inline with title */
  #threat-gauge {
    gap: 4px;
  }
  #threat-label { display: none; }
  #threat-bar { width: 40px; height: 6px; }
  .header-wing { flex: 0 0 auto; }

  /* ── Main layout — single column ── */
  #main {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* Flatten layout so all children can be reordered freely */
  #content { display: contents; }
  #sidebar { display: contents; }

  /* Mobile order: BTC price → map/intel/AI → rest of sidebar → market data */
  .btc-hero { order: -2; width: 100%; }
  #content-left { order: -1; }
  .sidebar-section { order: 0; width: 100%; }
  #content-right { order: 1; width: 100%; }

  /* Sidebar sections need padding since parent is display:contents */
  .sidebar-section {
    padding: 4px 10px;
    border-bottom: 1px solid var(--ink-border);
  }

  /* ── Content area — stack vertically ── */
  #content {
    flex-direction: column;
    overflow: visible;
  }
  #content-left {
    border-right: none;
    overflow: visible;
  }
  #globe-col {
    overflow: visible;
  }

  /* ── Map — flat only, compact, no controls ── */
  #map-header {
    display: flex;
    justify-content: center;
    padding: 4px 8px;
  }
  #map-header-top { display: none; }
  #world-map-container {
    height: 250px !important;
    min-height: 250px;
    max-height: 250px;
  }
  #world-map-container svg {
    width: 100% !important;
    height: 250px !important;
  }
  #map-controls { display: none !important; }
  #map-legend { display: none; }
  #map-filters {
    display: flex !important;
    justify-content: center;
    padding: 4px 0;
  }
  #map-view-toggle { display: none !important; }
  #map-filter-select { display: none !important; }

  /* Charts on mobile — single column, auto height */
  #charts-body { min-height: 250px; }
  .charts-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto auto !important;
    gap: 10px;
  }
  .chart-panel { min-height: 150px; }
  #charts-normal .chart-panel { min-height: 200px; }

  /* ── Intel + Grok — stack vertically ── */
  #intel-grok-row {
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }
  #intel-feed {
    max-height: 350px;
    overflow-y: auto;
    border-right: none;
    flex: none;
  }
  #grok-panel {
    border-left: none;
    border-top: 1px solid var(--ink-border);
    flex: none;
    max-height: 400px;
    overflow-y: auto;
  }
  #intel-grok-row.minimized { flex: 0 0 24px !important; }

  /* ── Right panel — full width ── */
  #content-right {
    width: 100%;
    overflow: visible;
    border-left: none;
    padding: 8px 10px;
  }

  /* ── Market tickers — compact 2-column ── */
  #market-tickers, #commodity-tickers {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
  }
  .market-ticker {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 3px 0;
  }
  .market-ticker .ticker-name {
    font-size: 8px;
    min-width: 55px;
  }
  .market-ticker .ticker-price {
    font-size: 10px;
  }
  .market-ticker .ticker-change {
    font-size: 9px;
  }

  /* ── FX tickers ── */
  .fx-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Central Bank Watch ── */
  .cb-row {
    font-size: 10px;
  }

  /* ── On-chain panel ── */
  .onchain-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* ── Whale feed ── */
  .whale-tx {
    font-size: 10px;
  }

  /* ── Splash screen — mobile optimised ── */
  #splash-card {
    padding: 1rem 0.8rem;
    max-height: 90vh;
    width: 95%;
  }
  .splash-title { font-size: 1.1rem; letter-spacing: 0.1em; }
  .splash-subtitle { font-size: 0.65rem; }
  .splash-desc { font-size: 0.75rem; line-height: 1.5; margin-bottom: 0.6rem; }
  .splash-grid {
    grid-template-columns: 1fr;
    gap: 0.15rem;
  }
  .splash-grid-header { font-size: 0.7rem; }
  .splash-grid-row { padding: 0.25rem 0; }
  .splash-grid-label { font-size: 0.7rem; min-width: 60px; }
  .splash-grid-desc { font-size: 0.65rem; }
  .splash-dismiss {
    padding: 0.7rem;
    font-size: 0.8rem;
    margin-top: 0.8rem;
  }
  .splash-footer { font-size: 0.6rem; }

  /* ── Diff overlay (return visit) — mobile optimised ── */
  .diff-card {
    padding: 1.2rem 1rem !important;
    width: 95% !important;
    max-width: 100% !important;
    max-height: 90vh;
    overflow-y: auto;
  }
  .diff-header h2 { font-size: 1rem; }
  .diff-row { padding: 0.4rem 0; font-size: 0.8rem; }
  .diff-primary { font-size: 0.9rem; }
  .diff-dismiss {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
  .diff-subscribe {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
  }
  .diff-subscribe-title { font-size: 0.7rem; }
  .diff-subscribe-form {
    flex-wrap: wrap;
    gap: 4px;
  }
  .diff-subscribe-form input[type="email"] {
    flex: 1 1 100%;
    max-width: 100%;
  }
  .diff-subscribe-form select,
  .diff-subscribe-form button {
    flex: 1;
  }

  /* ── Event calendar bar — hidden on mobile ── */
  #macro-calendar { display: none; }

  /* ── Section titles ── */
  .section-title { font-size: 9px; }
  .panel-section .section-title { font-size: 8px; }

  /* ── Prevent horizontal overflow ── */
  body, html { overflow-x: hidden; }
  #intel-header {
    flex-wrap: wrap;
    gap: 4px;
  }
  #intel-filter-row {
    margin-left: 0;
    flex-wrap: wrap;
    gap: 2px;
  }
  .intel-cat-btn {
    font-size: 7px !important;
    padding: 1px 4px !important;
  }

  /* ── Ticker footer ── */
  #ticker { font-size: 9px; }

  /* ── Page overlay (briefings, archive) ── */
  #page-overlay { padding: 1rem; }
  .archive-row {
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    font-size: 0.8rem;
    padding: 0.6rem 0.3rem;
  }
  .archive-date { grid-column: 1; font-size: 0.78rem; }
  .archive-threat { grid-column: 2; grid-row: 1; text-align: right; }
  .archive-price { grid-column: 1 / -1; font-size: 0.72rem; }
  .archive-summary { grid-column: 1 / -1; font-size: 0.7rem; line-height: 1.4; }
  .briefing-snapshot { grid-template-columns: repeat(2, 1fr); }
  .briefing-page { padding: 0; }
  .briefing-content { font-size: 0.82rem; }

  /* ── Mobile AI Briefing Summary ── */
  .mobile-briefing-text {
    font-size: 11px;
    line-height: 1.6;
    color: var(--ink);
    padding: 6px 0;
  }
  .mobile-briefing-link {
    display: inline-block;
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #8b7355;
    text-decoration: none;
    padding: 4px 0;
  }

  /* ── Digest signup ── */
  .digest-signup-form { flex-direction: column; align-items: center; }
  #digest-email { width: 100%; }
}

/* ============================================================
   V2 — Page Overlay (Archive, Briefing, Diff views)
   ============================================================ */

#page-overlay {
  padding: 2rem 3rem;
  max-width: 900px;
  margin: 0 auto;
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--ink);
  min-height: calc(100vh - 80px);
  max-height: 100vh;
  overflow-y: auto;
}
#page-overlay::-webkit-scrollbar { width: 6px; }
#page-overlay::-webkit-scrollbar-track { background: transparent; }
#page-overlay::-webkit-scrollbar-thumb { background: var(--ink-muted); border-radius: 3px; }
#page-overlay::-webkit-scrollbar-thumb:hover { background: var(--ink-secondary); }

/* ── Archive Page ── */
.archive-page h1 {
  font-family: 'IM Fell English SC', serif;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}
.archive-header {
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #c4b08a;
  padding-bottom: 1rem;
}
.archive-back {
  font-size: 0.9rem;
  color: #f5f0e8;
  background: #3e2c1a;
  text-decoration: none;
  display: inline-block;
  padding: 6px 16px;
  margin-bottom: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'IM Fell English SC', serif;
  font-size: 0.75rem;
  transition: background 0.2s;
}
.archive-back:hover { background: #5a3e28; color: #f5f0e8; }
.archive-count {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  margin: 0.3rem 0 0;
}
.archive-empty {
  color: var(--ink-secondary);
  font-style: italic;
  margin-top: 2rem;
}
.archive-loading {
  color: var(--ink-secondary);
  font-style: italic;
  text-align: center;
  margin-top: 3rem;
}

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.archive-row {
  display: grid;
  grid-template-columns: 160px 140px 90px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px dotted #d4c4a4;
  text-decoration: none;
  color: var(--ink);
  transition: background 0.15s;
}
.archive-row:hover { background: var(--parchment-hover); }
.archive-date {
  font-size: 0.82rem;
  font-weight: bold;
  white-space: nowrap;
}
.archive-price {
  font-size: 0.82rem;
  font-family: 'Courier New', monospace;
}
.archive-threat {
  font-size: 0.72rem;
  font-family: 'IM Fell English SC', serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  padding: 2px 6px;
  border-radius: 3px;
}
.archive-threat.low { color: #2a6e2a; background: rgba(42,110,42,0.08); }
.archive-threat.guarded { color: #5a7e2a; background: rgba(90,126,42,0.08); }
.archive-threat.elevated { color: #b8860b; background: rgba(184,134,11,0.08); }
.archive-threat.high { color: #b85020; background: rgba(184,80,32,0.08); }
.archive-threat.severe { color: #8b2020; background: rgba(139,32,32,0.08); }
.archive-threat.critical { color: #5a0000; background: rgba(90,0,0,0.1); }
.archive-summary {
  font-size: 0.78rem;
  color: var(--ink-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Briefing Page ── */
.briefing-page {
  max-width: 740px;
  margin: 0 auto;
}
.briefing-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.briefing-nav-arrows { display: flex; gap: 0.5rem; }
.briefing-nav-btn {
  font-size: 0.8rem;
  color: #8b7355;
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid #d4c4a4;
  border-radius: 3px;
  transition: all 0.15s;
}
.briefing-nav-btn:hover { background: var(--parchment-hover); color: var(--ink); }
.briefing-nav-btn.disabled {
  opacity: 0.35;
  pointer-events: none;
}
.briefing-header {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #c4b08a;
  padding-bottom: 1rem;
}
.briefing-header h1 {
  font-family: 'IM Fell English SC', serif;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.3rem;
}
.briefing-date {
  font-size: 0.85rem;
  color: var(--ink-secondary);
}

.briefing-snapshot {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
  padding: 1rem;
  border: 1px solid #d4c4a4;
  background: rgba(80,60,20,0.03);
}
.briefing-stat { text-align: center; }
.briefing-stat-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-secondary);
  margin-bottom: 0.3rem;
}
.briefing-stat-value {
  font-size: 1rem;
  font-weight: bold;
  font-family: 'Courier New', monospace;
}

.briefing-content {
  line-height: 1.7;
  font-size: 0.9rem;
}
.briefing-content h2 {
  font-family: 'IM Fell English SC', serif;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8b7355;
  border-bottom: 1px dotted #d4c4a4;
  padding-bottom: 0.3rem;
  margin: 1.5rem 0 0.8rem;
}
.briefing-content h3 {
  font-size: 0.9rem;
  font-weight: bold;
  margin: 1rem 0 0.5rem;
}
.briefing-content p { margin: 0.5rem 0; }
.briefing-content ul { margin: 0.5rem 0; padding-left: 1.2rem; }
.briefing-content li { margin: 0.3rem 0; }

.briefing-headlines {
  margin-top: 2rem;
  border-top: 1px solid #c4b08a;
  padding-top: 1rem;
}
.briefing-headlines h3 {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b7355;
  margin-bottom: 0.8rem;
}
.briefing-headline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px dotted #e4d4b4;
  font-size: 0.78rem;
}
.briefing-hl-cat {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 2px;
  flex-shrink: 0;
}
.briefing-hl-cat.bitcoin { color: #b8860b; background: rgba(184,134,11,0.1); }
.briefing-hl-cat.conflict { color: #8b2020; background: rgba(139,32,32,0.1); }
.briefing-hl-cat.disaster { color: #b85020; background: rgba(184,80,32,0.1); }
.briefing-hl-cat.economy { color: #2a6e2a; background: rgba(42,110,42,0.1); }
.briefing-hl-cat.political { color: #3e2c8a; background: rgba(62,44,138,0.1); }
.briefing-hl-title { flex: 1; }
.briefing-hl-source { color: var(--ink-tertiary); font-size: 0.7rem; flex-shrink: 0; }

.briefing-footer {
  margin-top: 2rem;
  padding-top: 0.8rem;
  border-top: 1px dotted #d4c4a4;
  font-size: 0.7rem;
  color: var(--ink-tertiary);
  text-align: center;
}

/* ── "What Changed" Diff Overlay ── */
/* duplicate diff styles removed — consolidated at top of file */

.diff-subscribe {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(62,44,26,0.15);
  text-align: center;
}
.diff-subscribe-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a3e28;
  margin-bottom: 0.6rem;
}
.diff-subscribe-form {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.diff-subscribe-form input[type="email"] {
  flex: 1;
  max-width: 200px;
  padding: 6px 10px;
  border: 1px solid #c4b08a;
  background: #fffdf7;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: #2c1810;
}
.diff-subscribe-form select {
  padding: 6px 8px;
  border: 1px solid #c4b08a;
  background: #fffdf7;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: #2c1810;
}
.diff-subscribe-form button {
  padding: 6px 14px;
  background: #3e2c1a;
  color: #f8f1e3;
  border: none;
  font-family: 'IM Fell English SC', serif;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background 0.2s;
}
.diff-subscribe-form button:hover { background: #5a3e28; }
#diff-digest-msg {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  min-height: 1em;
}
#diff-digest-msg.success { color: #2a6e2a; font-weight: 600; }
#diff-digest-msg.error { color: #8b2020; font-weight: 600; }

.positive { color: #2a6e2a; }
.negative { color: #8b2020; }

/* ── Macro Event Calendar Bar ── */
#macro-calendar {
  background: rgba(80,60,20,0.04);
  border-top: 1px solid #c4b08a;
  border-bottom: 1px solid #c4b08a;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  font-size: 0.72rem;
  white-space: nowrap;
}
#macro-calendar::-webkit-scrollbar { height: 4px; }
#macro-calendar::-webkit-scrollbar-thumb { background: #c4b08a; border-radius: 2px; }
.cal-label {
  font-family: 'IM Fell English SC', serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b7355;
  flex-shrink: 0;
  font-size: 0.7rem;
}
.cal-event {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid #d4c4a4;
  border-radius: 3px;
  background: var(--parchment);
  color: var(--ink);
  flex-shrink: 0;
  transition: background 0.15s;
  cursor: default;
}
.cal-event:hover { background: var(--parchment-hover); }
.cal-event-date {
  font-weight: bold;
  color: #8b7355;
}
.cal-event-title { color: var(--ink); }
.cal-event.high { border-color: #b85020; }
.cal-event.high .cal-event-date { color: #b85020; }

@media (max-width: 768px) {
  #page-overlay { padding: 1rem; }
  .archive-row {
    grid-template-columns: 1fr auto;
    gap: 2px 8px;
    font-size: 0.8rem;
    padding: 0.6rem 0.3rem;
  }
  .archive-date { grid-column: 1; font-size: 0.78rem; }
  .archive-threat { grid-column: 2; grid-row: 1; text-align: right; }
  .archive-price { grid-column: 1 / -1; font-size: 0.72rem; }
  .archive-summary { grid-column: 1 / -1; font-size: 0.7rem; line-height: 1.4; }
  .briefing-snapshot { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Phase 2 — On-Chain Sentiment & Whale Feed
   ============================================================ */

.panel-interpretation {
  font-size: 0.68rem;
  font-style: italic;
  color: var(--ink-tertiary);
  margin-top: 4px;
  padding: 4px 6px;
  background: rgba(80,60,20,0.03);
  border-left: 2px solid #d4c4a4;
  line-height: 1.4;
}
.panel-interpretation.positive {
  color: #2a6e2a;
  border-left-color: #2a6e2a;
  background: rgba(42,110,42,0.04);
}
.panel-interpretation.negative {
  color: #8b2020;
  border-left-color: #8b2020;
  background: rgba(139,32,32,0.04);
}

.section-badge {
  font-size: 7px;
  background: rgba(80,60,20,0.08);
  padding: 1px 4px;
  border-radius: 2px;
  vertical-align: middle;
  color: var(--ink-secondary);
  letter-spacing: 0.03em;
}

/* Whale feed */
#whale-feed {
  max-height: 180px;
  overflow-y: auto;
}
#whale-feed::-webkit-scrollbar { width: 3px; }
#whale-feed::-webkit-scrollbar-thumb { background: #c4b08a; border-radius: 2px; }

.whale-tx {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 6px;
  align-items: baseline;
  padding: 3px 0;
  border-bottom: 1px dotted rgba(0,0,0,0.06);
  font-size: 10px;
}
.whale-amount {
  font-weight: bold;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  white-space: nowrap;
}
.whale-usd {
  color: var(--ink-secondary);
  font-size: 9px;
  white-space: nowrap;
}
.whale-meta {
  text-align: right;
  font-size: 8px;
  color: var(--ink-tertiary);
}
.whale-meta a {
  color: #8b7355;
  text-decoration: none;
}
.whale-meta a:hover { text-decoration: underline; }
.whale-meta span { margin-left: 4px; }
.whale-empty {
  color: var(--ink-tertiary);
  font-size: 10px;
  font-style: italic;
  padding: 8px 0;
  text-align: center;
}

/* ============================================================
   Phase 3 — Structured Briefing, Query, Share
   ============================================================ */

/* Expandable briefing sections */
.briefing-section {
  border-bottom: 1px dotted rgba(0,0,0,0.08);
  padding: 4px 0;
}
.briefing-section:last-of-type { border-bottom: none; }
.briefing-section-header {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}
.briefing-section-header:hover { background: rgba(0,0,0,0.02); }
.briefing-section-icon { font-size: 10px; color: #8b7355; flex-shrink: 0; }
.briefing-section-title {
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8b7355;
  font-weight: bold;
  flex: 1;
}
.briefing-section-arrow {
  font-size: 8px;
  color: var(--ink-tertiary);
  transition: transform 0.2s;
}
.briefing-section.expanded .briefing-section-arrow {
  transform: rotate(90deg);
}
.briefing-section-summary {
  font-size: 10px;
  color: var(--ink-secondary);
  line-height: 1.4;
  padding: 2px 0 2px 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.briefing-section.expanded .briefing-section-summary {
  display: none;
}
.briefing-section-detail {
  display: none;
  font-size: 10px;
  line-height: 1.5;
  padding: 4px 0 4px 15px;
  color: var(--ink);
}
.briefing-section-detail p { margin: 3px 0; }
.briefing-section-detail strong { color: var(--ink); }
.briefing-section.expanded .briefing-section-detail {
  display: block;
}
.briefing-date-label {
  font-size: 8px;
  color: var(--ink-tertiary);
  text-align: right;
  margin-top: 6px;
  letter-spacing: 0.05em;
}

/* AI Actions Row */
#ai-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
  flex-shrink: 0;
}

/* Share Result */
#ai-share-result {
  flex-shrink: 0;
  max-height: 120px;
  overflow-y: auto;
}
#ai-share-btn {
  font-family: 'IM Fell English SC', serif;
  font-size: 8px;
  padding: 3px 8px;
  background: none;
  border: 1px solid #c4b08a;
  color: #8b7355;
  cursor: pointer;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
#ai-share-btn:hover { background: var(--parchment-hover); color: var(--ink); }
#ai-share-btn:disabled { opacity: 0.5; cursor: default; }
.ai-archive-link {
  font-size: 8px;
  color: #8b7355;
  text-decoration: none;
  letter-spacing: 0.05em;
}
.ai-archive-link:hover { color: var(--ink); text-decoration: underline; }

/* Share Summary Box */
.share-summary-box {
  background: rgba(80,60,20,0.04);
  border: 1px solid #d4c4a4;
  padding: 8px;
  position: relative;
}
.share-summary-text {
  font-size: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: var(--ink);
}
.share-copy-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 7px;
  padding: 2px 6px;
  background: #3e2c1a;
  color: var(--parchment);
  border: none;
  cursor: pointer;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.share-copy-btn:hover { background: #5a3e28; }

/* Briefing Comparison */
.briefing-comparison {
  margin-bottom: 1.5rem;
  padding: 0.8rem 1rem;
  background: rgba(80,60,20,0.04);
  border: 1px solid #d4c4a4;
  border-left: 3px solid #8b7355;
}
.comp-title {
  font-size: 0.7rem;
  font-family: 'IM Fell English SC', serif;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b7355;
  margin-bottom: 0.5rem;
}
.comp-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.2rem 0;
  font-size: 0.82rem;
}
.comp-label { color: var(--ink-secondary); font-size: 0.75rem; }
.comp-value { font-weight: bold; font-family: 'Courier New', monospace; }

/* ============================================================
   Phase 4 — Distribution & Growth
   ============================================================ */

/* ── Digest Signup (in-page) ────────────────────────────────── */
.digest-signup {
  margin-top: 2rem;
  padding: 1.2rem;
  border: 1px solid #c4b08a;
  background: rgba(80,60,20,0.04);
  text-align: center;
}
.digest-signup-title {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8b7355;
  margin-bottom: 0.3rem;
}
.digest-signup-desc {
  font-size: 0.8rem;
  color: var(--ink-secondary);
  margin-bottom: 0.8rem;
}
.digest-signup-form {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
#digest-email {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  padding: 6px 10px;
  border: 1px solid #c4b08a;
  background: #fff;
  color: var(--ink);
  width: 220px;
  outline: none;
}
#digest-email:focus { border-color: #8b7355; }
#digest-email::placeholder { color: var(--ink-muted); font-style: italic; }
#digest-freq {
  font-family: Georgia, serif;
  font-size: 0.75rem;
  padding: 6px 8px;
  border: 1px solid #c4b08a;
  background: #fff;
  color: var(--ink);
  outline: none;
}
.digest-signup-form button {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.75rem;
  padding: 6px 16px;
  background: #3e2c1a;
  color: #f5f0e8;
  border: none;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.digest-signup-form button:hover { background: #5a3e28; }
#digest-msg {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  text-align: center;
  min-height: 1.2em;
}
#digest-msg.success { color: #2a6e2a; font-weight: 600; }
#digest-msg.error { color: #8b2020; font-weight: 600; }

/* ── Embed Codes Page ──────────────────────────────────────── */
.embed-page {
  max-width: 740px;
  margin: 0 auto;
}
.embed-page h1 {
  font-family: 'IM Fell English SC', serif;
  font-size: 1.3rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 1rem;
}
.embed-card {
  border: 1px solid #d4c4a4;
  padding: 1rem;
  margin-bottom: 1rem;
  background: rgba(80,60,20,0.02);
}
.embed-card h3 {
  font-family: 'IM Fell English SC', serif;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8b7355;
  margin-bottom: 0.5rem;
}
.embed-preview {
  margin-bottom: 0.5rem;
  border: 1px solid #e4d4b4;
  display: inline-block;
}
.embed-code {
  font-family: 'Courier New', monospace;
  font-size: 0.75rem;
  background: rgba(0,0,0,0.04);
  padding: 0.5rem;
  border: 1px solid #d4c4a4;
  word-break: break-all;
  line-height: 1.4;
  position: relative;
}
.embed-copy-btn {
  font-size: 8px;
  padding: 2px 8px;
  background: #3e2c1a;
  color: var(--parchment);
  border: none;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  float: right;
  margin-left: 8px;
}
