/* ============================================================
   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; }

* { 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);
}

/* 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-value.loading {
  color: var(--ink-muted);
  font-weight: normal;
  font-style: italic;
}

/* 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;
}

/* ---- 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;
}

/* 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;
  overflow: hidden;
}

#grok-content {
  flex: 1;
  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-muted);
  font-style: italic;
  font-size: 11px;
  padding: 10px 0;
}

.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: var(--ink-muted);
  font-weight: normal;
  font-style: italic;
}

/* ---- 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;
  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;
}
.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) {
  #main { flex-direction: column; }
  #sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--ink-border);
    max-height: 40vh;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
  }
  .sidebar-section {
    flex: 1 1 45%;
    min-width: 200px;
    padding: 8px;
  }
  .header-title { font-size: 16px; }
  .header-left, .header-right { min-width: auto; }
}
