/* ===================================================================
   PANOPTICON — Global Surveillance Visualization
   Core Styles
   =================================================================== */

/* --- Reset & Base --- */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #000;
  color: #00ff41;
  font-family: 'Courier New', monospace;
  overflow: hidden;
}

#cesiumContainer { width: 100vw; height: 100vh; }

/* --- HUD (Heads-Up Display) --- */
#hud {
  position: absolute; top: 0; left: 0; right: 0;
  pointer-events: none; z-index: 10;
  padding: 16px 24px;
  display: flex; justify-content: space-between; align-items: flex-start;
}

#title {
  font-size: 18px; font-weight: bold; letter-spacing: 4px;
  text-shadow: 0 0 10px #00ff41;
}
#title span {
  font-size: 11px; opacity: 0.6; letter-spacing: 1px;
  display: block; margin-top: 2px;
}

#stats {
  text-align: right; font-size: 12px;
  text-shadow: 0 0 8px #00ff41;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 8px;
  max-width: 50vw;
}
.stat-chip { display: none; }
.stat-chip.active { display: inline; }

/* --- Info Panel --- */
#info-panel {
  position: absolute; bottom: 100px; right: 16px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #00ff4180;
  padding: 16px 20px;
  font-size: 13px; line-height: 1.7;
  z-index: 10; display: none;
  min-width: 260px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
}
#info-panel .label { opacity: 0.5; }
#info-panel .callsign {
  font-size: 18px; font-weight: bold;
  margin-bottom: 6px; letter-spacing: 2px;
}

/* --- Country Info Panel (BORDER filter) --- */
#country-panel {
  position: absolute; bottom: 100px; right: 16px;
  background: rgba(0, 0, 0, 0.90);
  border: 1px solid #00ff4180;
  padding: 16px 20px;
  font-size: 13px; line-height: 1.7;
  z-index: 10; display: none;
  min-width: 280px; max-width: 340px;
  box-shadow: 0 0 20px rgba(0, 255, 65, 0.15);
}
#country-panel .label { opacity: 0.5; }
.cp-header {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 4px;
}
.cp-flag { font-size: 24px; }
.cp-name {
  font-size: 18px; font-weight: bold;
  letter-spacing: 2px;
}
.cp-formal {
  font-size: 10px; opacity: 0.5;
  margin-bottom: 8px; letter-spacing: 1px;
}
.cp-grid { line-height: 1.6; }
.filter-border #country-panel {
  border-color: #00ff4160;
  color: #00ff41;
  text-shadow: 0 0 6px rgba(0, 255, 65, 0.3);
}

/* --- Mode Switcher --- */
#mode-bar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; gap: 0;
}
#mode-bar button {
  background: rgba(0, 0, 0, 0.7); color: #00ff41;
  border: 1px solid #00ff4140; padding: 6px 16px;
  font-family: 'Courier New', monospace; font-size: 12px;
  cursor: pointer; letter-spacing: 2px;
}
#mode-bar button:first-child { border-radius: 4px 0 0 4px; }
#mode-bar button:last-child  { border-radius: 0 4px 4px 0; }
#mode-bar button.active {
  background: #00ff41; color: #000; font-weight: bold;
}

/* --- Layer Toggles --- */
#layer-toggles {
  position: absolute; top: 52px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; align-items: center; gap: 14px;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 18px; border-radius: 4px;
  border: 1px solid #00ff4125;
}
/* --- Pin Tray (below toolbar) --- */
#pin-tray {
  position: absolute; top: 82px; left: 50%; transform: translateX(-50%);
  z-index: 9; display: none; flex-direction: column; gap: 2px;
  background: rgba(0, 0, 0, 0.75);
  padding: 6px 14px; border-radius: 4px;
  border: 1px solid #00ff4125;
  max-height: 40vh; overflow-y: auto;
}
#layer-pins, #city-pins {
  display: flex; flex-direction: column; gap: 2px;
}
#pin-tray label {
  color: #00ff41; font-size: 11px; letter-spacing: 1px; cursor: pointer;
  display: flex; align-items: center; gap: 4px;
  user-select: none; padding: 2px 0;
}
#pin-tray input[type="checkbox"] { accent-color: #00ff41; }

/* Unpin button on pinned labels */
#pin-tray .unpin-btn {
  background: none; border: none; color: inherit;
  font-size: 13px; cursor: pointer; opacity: 0;
  padding: 0 2px; margin-left: auto;
  transition: opacity 0.15s;
  font-family: 'Courier New', monospace;
}
#pin-tray label:hover .unpin-btn { opacity: 0.6; }
#pin-tray .unpin-btn:hover { opacity: 1; }

/* Toolbar menu buttons */
#layer-panel-toggle, #city-panel-toggle, #filter-panel-toggle {
  background: none; border: none; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 11px;
  padding: 4px 10px; cursor: pointer; border-radius: 3px;
  letter-spacing: 1px;
}
#layer-panel-toggle:hover, #city-panel-toggle:hover, #filter-panel-toggle:hover { background: #00ff4120; }
#layer-panel-toggle.open, #city-panel-toggle.open, #filter-panel-toggle.open { background: #00ff4115; }
#filter-panel-toggle.filter-active { color: #ffaa00; }

/* --- Layer Dropdown Panel --- */
#layer-panel {
  position: absolute; top: 82px;
  left: 50%; transform: translateX(-50%);
  z-index: 12;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  max-height: 60vh; min-width: 340px; max-width: 420px;
  overflow-y: auto; font-size: 11px;
  box-shadow: 0 4px 24px rgba(0, 255, 65, 0.08);
}
#layer-search {
  width: 100%; background: rgba(0, 255, 65, 0.05);
  border: none; border-bottom: 1px solid #00ff4120;
  color: #00ff41; font-family: 'Courier New', monospace;
  font-size: 12px; padding: 10px 14px; outline: none;
  letter-spacing: 1px; box-sizing: border-box;
}
#layer-search::placeholder { color: #00ff4140; }
.layer-category-header {
  padding: 8px 14px; color: #00ff41; opacity: 0.5;
  font-size: 9px; letter-spacing: 2px; cursor: pointer;
  user-select: none; border-bottom: 1px solid #00ff4110;
}
.layer-category-header:hover { opacity: 0.8; }
.layer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 24px; cursor: pointer;
  transition: background 0.1s;
}
.layer-row:hover { background: rgba(0, 255, 65, 0.05); }
.layer-row input[type="checkbox"] { accent-color: #00ff41; }
.layer-color-swatch {
  width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0;
}
.layer-name {
  flex: 1; color: #ccc; letter-spacing: 1px;
}
.layer-pin-btn {
  background: none; border: 1px solid #00ff4130;
  color: #00ff4180; font-family: 'Courier New', monospace;
  font-size: 9px; padding: 2px 6px; cursor: pointer;
  border-radius: 2px; letter-spacing: 1px;
}
.layer-pin-btn:hover { border-color: #00ff41; color: #00ff41; }
.layer-pin-btn.pinned {
  background: #00ff4120; border-color: #00ff4160; color: #00ff41;
}

/* Reposition layer-panel when detail panels are open */
body.sat-panel-open #layer-panel      { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #layer-panel    { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #layer-panel     { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #layer-panel  { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #layer-panel   { left: calc((100vw - var(--panel-width)) / 2); }
body.sat-panel-open #city-panel       { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #city-panel     { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #city-panel      { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #city-panel   { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #city-panel    { left: calc((100vw - var(--panel-width)) / 2); }

/* --- Dynamic Layer Legend --- */
#layer-legend {
  position: absolute; bottom: 40px; right: 24px;
  z-index: 10; display: none;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #00ff4125;
  padding: 8px 12px; border-radius: 4px;
  font-size: 10px; letter-spacing: 1px;
  max-height: 60vh; overflow-y: auto;
  min-width: 120px;
}
#layer-legend .ll-title {
  color: #00ff41; opacity: 0.5;
  margin-bottom: 6px; font-size: 9px;
  letter-spacing: 2px;
}
#layer-legend .ll-item {
  display: flex; align-items: center; gap: 8px;
  color: #ccc; margin-bottom: 3px;
  line-height: 1.6; white-space: nowrap;
}
#layer-legend .ll-swatch-diamond {
  display: inline-block; width: 8px; height: 8px;
  transform: rotate(45deg); flex-shrink: 0;
}
#layer-legend .ll-swatch-line {
  display: inline-block; width: 14px; height: 2px;
  flex-shrink: 0; border-radius: 1px;
}
#layer-legend .ll-swatch-rect {
  display: inline-block; width: 12px; height: 8px;
  flex-shrink: 0; border-radius: 1px; opacity: 0.7;
}
#layer-legend .ll-swatch-circle {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%; flex-shrink: 0;
}
#layer-legend .ll-swatch-bar {
  display: inline-block; width: 10px; height: 8px;
  flex-shrink: 0; border-left: 2px solid; border-right: 2px solid;
  border-bottom: 2px solid; border-top: none; opacity: 0.8;
}

/* --- Timeline Scrubber --- */
#timeline-bar {
  position: absolute; bottom: 0; left: 260px; right: 0;
  z-index: 10; display: none;
  background: rgba(0, 0, 0, 0.85);
  border-top: 1px solid #00ff4140;
  padding: 12px 24px;
}
#timeline-bar .time-label {
  font-size: 13px; margin-bottom: 6px;
  display: flex; justify-content: space-between;
}
#timeline-ticks {
  position: relative; width: 100%; height: 16px; display: none;
  margin-bottom: 2px;
  /* Inset to align with range thumb center (thumb is 14px, track has no padding) */
  padding: 0 7px; box-sizing: border-box;
}
#timeline-ticks .tick-mark {
  position: absolute; bottom: 0;
  width: 1px; height: 6px;
  background: #00ff4150;
  transform: translateX(-50%);
}
#timeline-ticks .tick-label {
  position: absolute; top: 0;
  font-size: 8px; color: #00ff4140;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: 'Courier New', monospace;
}
#timeline-bar input[type="range"] {
  width: 100%; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  height: 4px; background: #00ff4130; border-radius: 2px; outline: none;
}
#timeline-bar input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: #00ff41; cursor: pointer;
}
#timeline-controls {
  display: flex; align-items: center; gap: 12px; margin-top: 8px;
}
#timeline-controls button {
  background: none; border: 1px solid #00ff4160; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 13px;
  padding: 4px 12px; cursor: pointer; border-radius: 3px;
}
#timeline-controls button:hover { background: #00ff4120; }
#speed-label { font-size: 11px; opacity: 0.6; }

/* --- Scenario Sidebar --- */
#scenario-sidebar {
  position: absolute; top: 80px; left: 0; bottom: 0;
  width: 260px; z-index: 10; display: none;
  background: rgba(0, 0, 0, 0.9);
  border-right: 1px solid #00ff4130;
  padding: 16px;
  overflow-y: auto;
  transition: width 0.2s ease, padding 0.2s ease;
  flex-direction: column;
}
#scenario-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
#scenario-header h3 {
  font-size: 12px; letter-spacing: 3px; opacity: 0.5;
  font-weight: normal; margin: 0;
}
#scenario-toggle {
  background: none; border: 1px solid #00ff4140; color: #00ff41;
  font-size: 12px; cursor: pointer; padding: 2px 6px;
  font-family: 'Courier New', monospace; opacity: 0.6;
  transition: opacity 0.15s;
}
#scenario-toggle:hover { opacity: 1; }
#scenario-sidebar.collapsed {
  width: 32px; padding: 16px 4px; overflow: hidden;
}
#scenario-sidebar.collapsed #scenario-header {
  flex-direction: column;
}
#scenario-sidebar.collapsed #scenario-header h3,
#scenario-sidebar.collapsed .scenario-card { display: none; }
#scenario-sidebar.collapsed #scenario-toggle {
  border: none; font-size: 14px;
}
.scenario-card {
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.scenario-card:hover {
  border-color: #00ff4180;
  background: rgba(0, 255, 65, 0.1);
}
.scenario-card.active {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.15);
}
.scenario-card.stub { opacity: 0.4; cursor: default; }
.scenario-card.stub:hover {
  border-color: #00ff4130;
  background: rgba(0, 255, 65, 0.05);
}
.scenario-card .sc-title {
  font-size: 14px; font-weight: bold; letter-spacing: 2px;
  margin-bottom: 4px;
}
.scenario-card .sc-region { font-size: 10px; opacity: 0.5; margin-bottom: 6px; }
.scenario-card .sc-desc   { font-size: 11px; opacity: 0.7; line-height: 1.5; }
.scenario-card .sc-badge  {
  display: inline-block; font-size: 9px; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 2px; margin-top: 6px;
}
.sc-badge.ready  { background: #00ff4130; color: #00ff41; }
.sc-badge.coming { background: #ffffff15; color: #666; }

/* --- Playback Sidebar --- */
#playback-sidebar {
  position: absolute; top: 80px; left: 0; bottom: 0;
  width: 260px; z-index: 10; display: none;
  background: rgba(0, 0, 0, 0.9);
  border-right: 1px solid #00ff4130;
  padding: 16px;
  overflow-y: auto;
  transition: width 0.2s ease, padding 0.2s ease;
  flex-direction: column;
}
#playback-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
#playback-header h3 {
  font-size: 12px; letter-spacing: 3px; opacity: 0.5;
  font-weight: normal; margin: 0;
}
#playback-toggle {
  background: none; border: 1px solid #00ff4140; color: #00ff41;
  font-size: 12px; cursor: pointer; padding: 2px 6px;
  font-family: 'Courier New', monospace; opacity: 0.6;
  transition: opacity 0.15s;
}
#playback-toggle:hover { opacity: 1; }
#playback-sidebar.collapsed {
  width: 32px; padding: 16px 4px; overflow: hidden;
}
#playback-sidebar.collapsed #playback-header {
  flex-direction: column;
}
#playback-sidebar.collapsed #playback-header h3,
#playback-sidebar.collapsed .playback-card,
#playback-sidebar.collapsed .pb-category { display: none; }
#playback-sidebar.collapsed #playback-toggle {
  border: none; font-size: 14px;
}
#playback-sidebar.collapsed #audio-player { display: none; }

.pb-category { margin-bottom: 12px; }
.pb-category-header {
  font-size: 10px; letter-spacing: 2px; opacity: 0.4;
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid #00ff4120;
}
.playback-card {
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.playback-card:hover {
  border-color: #00ff4180;
  background: rgba(0, 255, 65, 0.1);
}
.playback-card.active {
  border-color: #00ff41;
  background: rgba(0, 255, 65, 0.15);
}
.playback-card .pb-title {
  font-size: 14px; font-weight: bold; letter-spacing: 2px;
  margin-bottom: 4px;
}
.playback-card .pb-type {
  font-size: 10px; opacity: 0.5; margin-bottom: 6px;
}
.pb-badge {
  display: inline-block; font-size: 9px; letter-spacing: 1px;
  padding: 2px 6px; border-radius: 2px; margin-top: 6px;
}
.pb-badge.ready    { background: #00ff4130; color: #00ff41; }
.pb-badge.safe     { background: #00ff4130; color: #00ff41; }
.pb-badge.critical { background: #ff444430; color: #ff4444; }
.pb-badge-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 6px;
}
.pb-badge-row .pb-badge { margin-top: 0; }
.pb-download-btn {
  background: none; border: 1px solid #00ff4160; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 8px;
  letter-spacing: 1px; padding: 2px 8px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pb-download-btn:hover {
  background: rgba(0, 255, 65, 0.15); border-color: #00ff41;
}
.pb-empty {
  font-size: 11px; opacity: 0.4; text-align: center;
  padding: 20px 0;
}
.pb-layers {
  margin-top: 6px;
  display: flex; flex-wrap: wrap; gap: 4px;
}
.pb-layer-tag {
  display: inline-block; font-size: 8px; letter-spacing: 1px;
  padding: 1px 5px; border-radius: 2px;
  background: #00aaff20; color: #00aaff; border: 1px solid #00aaff40;
}

/* --- Wargame Briefing Card --- */
.wg-briefing {
  margin: 6px 0 8px; padding: 8px 10px;
  background: rgba(255, 68, 68, 0.04);
  border: 1px solid #ff444425; border-radius: 3px;
  font-size: 10px; line-height: 1.5; color: #aaa;
}
.wg-briefing:empty { display: none; }
.wg-briefing-header {
  display: flex; align-items: center; gap: 6px; margin-bottom: 6px;
}
.wg-briefing-mode {
  font-size: 8px; letter-spacing: 1.5px; font-weight: bold;
  padding: 2px 6px; border-radius: 2px;
  background: #ff444420; color: #ff6666; border: 1px solid #ff444440;
}
.wg-briefing-desc {
  font-size: 10px; color: #888; margin-bottom: 8px;
  line-height: 1.4;
}
.wg-briefing-section {
  margin-bottom: 5px;
}
.wg-briefing-label {
  display: block; font-size: 8px; letter-spacing: 1px;
  color: #ff4444; opacity: 0.6; margin-bottom: 2px;
}
.wg-briefing-caps {
  display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px;
}
.wg-briefing-cap {
  font-size: 8px; padding: 1px 5px; border-radius: 2px;
  background: #ff444412; color: #cc8888; border: 1px solid #ff444420;
  letter-spacing: 0.5px;
}
.wg-briefing-risk {
  color: #ff8866; font-size: 10px;
  padding-top: 4px; border-top: 1px solid #ff444415;
}

/* --- Wargame Layers Row --- */
.wg-layers {
  margin: 4px 0 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.wg-layers-label {
  font-size: 9px; letter-spacing: 1px; opacity: 0.5; margin-right: 4px;
}
.wg-layers-none {
  font-size: 9px; opacity: 0.3;
}

/* --- Playback Event Feed (wargame playback) --- */
#playback-feed {
  position: absolute; bottom: 80px; left: 270px;
  width: 320px; max-height: 300px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  padding: 10px;
  overflow-y: auto;
  z-index: 10;
  font-size: 11px;
}

/* ===================================================================
   Ambient Layer Panels — Tabbed Container
   =================================================================== */

#ambient-container {
  position: absolute;
  top: 80px;
  right: 0;
  bottom: 80px;
  width: 320px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.92);
  border-left: 1px solid #ffaa0030;
  display: none;
  flex-direction: column;
  font-size: 11px;
  overflow: hidden;
}

#ambient-tabs {
  display: flex;
  border-bottom: 1px solid #ffffff10;
  min-height: 32px;
  overflow-x: auto;
  flex-shrink: 0;
}

.ambient-tab {
  padding: 8px 14px;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: #888;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.ambient-tab:hover { color: #ccc; }

.ambient-tab.active {
  color: var(--tab-color, #ffaa00);
  border-bottom-color: var(--tab-color, #ffaa00);
}

.ambient-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.ambient-panel.active {
  display: flex;
}

.ambient-content {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* --- Kalshi Market Cards --- */

.kalshi-search {
  width: 100%;
  background: rgba(255, 170, 0, 0.05);
  border: none;
  border-bottom: 1px solid #ffaa0020;
  color: #ffaa00;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  padding: 8px 14px;
  outline: none;
  letter-spacing: 1px;
  box-sizing: border-box;
}
.kalshi-search::placeholder { color: #ffaa0040; }

.kalshi-filters {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  overflow-x: auto;
  flex-wrap: nowrap;
  border-bottom: 1px solid #ffaa0015;
}

.kalshi-filter-pill {
  background: rgba(255, 170, 0, 0.08);
  border: 1px solid #ffaa0030;
  color: #ffaa0080;
  font-family: 'Courier New', monospace;
  font-size: 9px;
  padding: 2px 8px;
  cursor: pointer;
  border-radius: 2px;
  letter-spacing: 1px;
  white-space: nowrap;
  flex-shrink: 0;
}
.kalshi-filter-pill:hover { border-color: #ffaa00; color: #ffaa00; }
.kalshi-filter-pill.active {
  background: #ffaa0020;
  border-color: #ffaa0060;
  color: #ffaa00;
}

.kalshi-market-list {
  padding: 4px 0;
}

.kalshi-card {
  padding: 10px 14px;
  border-bottom: 1px solid #ffffff08;
  cursor: default;
  transition: background 0.1s;
}
.kalshi-card:hover { background: rgba(255, 170, 0, 0.04); }

.kalshi-card-title {
  font-size: 11px;
  color: #ccc;
  line-height: 1.4;
  margin-bottom: 6px;
}

.kalshi-price-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.kalshi-yes-price {
  font-size: 12px;
  color: #00ff41;
  font-weight: bold;
  min-width: 36px;
}

.kalshi-no-price {
  font-size: 12px;
  color: #ff4444;
  font-weight: bold;
  min-width: 36px;
  text-align: right;
}

.kalshi-bar-track {
  flex: 1;
  height: 4px;
  background: #ff444440;
  border-radius: 2px;
  overflow: hidden;
}

.kalshi-bar-fill {
  height: 100%;
  background: #00ff41;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.kalshi-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 9px;
  opacity: 0.5;
  letter-spacing: 0.5px;
}

.kalshi-cat-tag {
  display: inline-block;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border-radius: 2px;
  background: #ffaa0015;
  color: #ffaa0080;
  border: 1px solid #ffaa0020;
}

.kalshi-empty {
  padding: 20px 14px;
  color: #ffaa0040;
  text-align: center;
  letter-spacing: 2px;
  font-size: 10px;
}

/* --- Wallet Panel --- */
.wallet-header {
  display: flex; flex-wrap: wrap; gap: 1px;
  background: #ffffff08;
  border-bottom: 1px solid #ffffff10;
}
.wallet-balance-box {
  flex: 1; min-width: 90px;
  padding: 12px 14px;
  background: rgba(0,0,0,0.4);
  transition: background 0.3s, box-shadow 0.3s;
}
.wallet-balance-box.flash {
  background: rgba(255, 170, 0, 0.12);
  box-shadow: inset 0 0 20px rgba(255, 170, 0, 0.15);
}
.wallet-balance-box.wallet-total {
  flex-basis: 100%;
  border-top: 1px solid #ffaa0020;
}
.wallet-balance-label {
  font-size: 9px; letter-spacing: 1.5px;
  color: #ffaa0060; margin-bottom: 4px;
}
.wallet-balance-value {
  font-size: 16px; font-weight: bold;
  color: #ffaa00; letter-spacing: 0.5px;
}
.wallet-total .wallet-balance-value { color: #fff; }
.wallet-pending {
  padding: 8px 14px;
  font-size: 10px; letter-spacing: 2px;
  color: #ffaa00;
  background: rgba(255, 170, 0, 0.06);
  border-bottom: 1px solid #ffaa0015;
  animation: wallet-pulse 1.2s ease-in-out infinite;
}
@keyframes wallet-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.wallet-section {
  border-bottom: 1px solid #ffffff08;
}
.wallet-section-title {
  font-size: 9px; letter-spacing: 2px;
  color: #ffaa0050; padding: 8px 14px 4px;
}
.wallet-position-row {
  padding: 6px 14px;
  font-size: 11px; color: #ccc;
  display: flex; gap: 8px; align-items: center;
}
.wallet-pos-side {
  font-size: 9px; font-weight: bold;
  padding: 1px 5px; border-radius: 2px;
}
.wallet-pos-side.yes { background: #00ff4120; color: #00ff41; }
.wallet-pos-side.no { background: #ff444420; color: #ff4444; }
.wallet-pos-ticker { flex: 1; font-size: 10px; color: #aaa; }
.wallet-pos-amount { color: #ffaa00; font-size: 11px; }
.wallet-tx-row {
  padding: 6px 14px;
  font-size: 11px; color: #ccc;
  display: flex; gap: 6px; align-items: baseline;
}
.wallet-tx-icon { color: #ffaa00; font-size: 12px; }
.wallet-tx-amount { color: #ffaa00; font-weight: bold; white-space: nowrap; }
.wallet-tx-detail { color: #888; font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --- Diplomat / Messenger Panel --- */
.diplomat-status {
  padding: 10px 14px;
  font-size: 10px; letter-spacing: 1.5px;
  color: #4488ff; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid #ffffff10;
  background: rgba(68, 136, 255, 0.04);
}
.diplomat-status-dot {
  width: 6px; height: 6px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
  background: #888;
}
.diplomat-status-dot.status-red { background: #ff4444; box-shadow: 0 0 6px #ff4444; }
.diplomat-status-dot.status-green { background: #00ff41; box-shadow: 0 0 6px #00ff41; }
.diplomat-status-dot.status-yellow { background: #ffaa00; box-shadow: 0 0 6px #ffaa00; }
.diplomat-section {
  border-bottom: 1px solid #ffffff08;
}
.diplomat-section-title {
  font-size: 9px; letter-spacing: 2px;
  color: #4488ff50; padding: 8px 14px 4px;
}
.diplomat-contact-card {
  padding: 8px 14px;
  border-bottom: 1px solid #ffffff05;
}
.diplomat-contact-card:last-child { border-bottom: none; }
.diplomat-contact-name {
  font-size: 11px; color: #ccc; font-weight: bold;
}
.diplomat-contacted {
  font-size: 9px; color: #00ff41; font-weight: normal;
}
.diplomat-contact-role {
  font-size: 9px; color: #4488ff80; margin-top: 2px;
}
.diplomat-contact-status {
  font-size: 10px; color: #888; margin-top: 3px;
  font-style: italic;
}
.diplomat-thread {
  max-height: 200px; overflow-y: auto;
}
.diplomat-message {
  padding: 8px 14px;
  border-bottom: 1px solid #ffffff05;
}
.diplomat-message.sent { border-left: 2px solid #4488ff40; }
.diplomat-message.received { border-left: 2px solid #00ff4140; }
.diplomat-msg-header {
  font-size: 9px; letter-spacing: 1px;
  margin-bottom: 3px;
}
.diplomat-message.sent .diplomat-msg-header { color: #4488ff80; }
.diplomat-message.received .diplomat-msg-header { color: #00ff4180; }
.diplomat-msg-body {
  font-size: 11px; color: #ccc; line-height: 1.4;
}
.diplomat-typing {
  padding: 8px 14px;
  font-size: 10px; color: #4488ff;
  display: flex; align-items: center; gap: 6px;
  background: rgba(68, 136, 255, 0.04);
  border-top: 1px solid #4488ff15;
}
.diplomat-typing-label { letter-spacing: 1px; }
.diplomat-typing-dots span {
  animation: diplomat-dot 1.4s ease-in-out infinite;
  font-size: 16px; font-weight: bold;
}
.diplomat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.diplomat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes diplomat-dot {
  0%, 60%, 100% { opacity: 0.2; }
  30% { opacity: 1; }
}
.diplomat-message.intel { border-left: 2px solid #ffaa0040; }
.diplomat-message.intel .diplomat-msg-header { color: #ffaa0080; }

/* --- Stand Down Overlay --- */
.stand-down-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  animation: stand-down-bg 3s ease-in forwards;
}
.stand-down-inner {
  text-align: center;
  opacity: 0;
  transform: scale(0.5);
  animation: stand-down-in 1.5s ease-out 0.5s forwards;
}
.stand-down-flag {
  font-size: 120px;
  filter: drop-shadow(0 0 40px rgba(255,255,255,0.3));
}
.stand-down-text {
  font-family: 'Courier New', monospace;
  font-size: 28px;
  letter-spacing: 8px;
  color: #fff;
  margin-top: 16px;
  text-shadow: 0 0 20px rgba(255,255,255,0.4);
}
.stand-down-reason {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: #ffffff80;
  margin-top: 12px;
  max-width: 500px;
}
@keyframes stand-down-bg {
  0% { background: rgba(0, 0, 0, 0); }
  100% { background: rgba(0, 0, 0, 0.6); }
}
@keyframes stand-down-in {
  0% { opacity: 0; transform: scale(0.5); }
  100% { opacity: 1; transform: scale(1); }
}

/* --- Missile Video Overlay --- */
.missile-video-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  animation: missile-bg-in 0.5s ease-out forwards;
}
.missile-video-overlay.fade-out {
  animation: missile-bg-out 1.5s ease-in forwards;
}
@keyframes missile-bg-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}
@keyframes missile-bg-out {
  0% { opacity: 1; }
  100% { opacity: 0; }
}

/* --- Crypto Market Cards --- */
.crypto-search {
  width: 100%; border: none; background: transparent;
  color: #f7931a; padding: 8px 14px; font-family: 'Courier New', monospace;
  font-size: 11px; letter-spacing: 1px; outline: none;
  border-bottom: 1px solid #f7931a10;
}
.crypto-search::placeholder { color: #f7931a40; }
.crypto-card {
  padding: 10px 14px; border-bottom: 1px solid #ffffff08;
  display: flex; align-items: center; gap: 10px;
}
.crypto-card:hover { background: rgba(247, 147, 26, 0.04); }
.crypto-rank { font-size: 9px; opacity: 0.3; min-width: 20px; }
.crypto-symbol { font-size: 12px; font-weight: bold; color: #f7931a; min-width: 50px; }
.crypto-name { font-size: 10px; color: #666; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crypto-price { font-size: 12px; color: #ccc; text-align: right; min-width: 80px; }
.crypto-change { font-size: 11px; font-weight: bold; min-width: 60px; text-align: right; }
.crypto-change.positive { color: #00ff41; }
.crypto-change.negative { color: #ff4444; }
.crypto-meta { font-size: 9px; opacity: 0.4; display: flex; gap: 12px; margin-top: 2px; }
.crypto-empty { padding: 20px 14px; color: #f7931a40; text-align: center; letter-spacing: 2px; font-size: 10px; }

/* --- Commodity Price Items --- */
.commodity-filters {
  display: flex; gap: 4px; flex-wrap: nowrap; overflow-x: auto;
  padding: 8px 14px; border-bottom: 1px solid #cc884410;
}
.commodity-pill {
  background: rgba(204, 136, 68, 0.08); border: 1px solid #cc884420; border-radius: 2px;
  padding: 3px 8px; font-size: 9px; letter-spacing: 1px; color: #cc884080;
  cursor: pointer; white-space: nowrap;
}
.commodity-pill.active { background: #cc884020; color: #cc8844; }
.commodity-category-header {
  padding: 8px 14px; color: #cc8844; opacity: 0.5;
  font-size: 9px; letter-spacing: 2px;
  border-bottom: 1px solid #cc884410;
}
.commodity-item {
  padding: 8px 14px; border-bottom: 1px solid #ffffff08;
  display: flex; justify-content: space-between; align-items: center;
}
.commodity-item:hover { background: rgba(204, 136, 68, 0.04); }
.commodity-name { color: #ccc; font-size: 11px; }
.commodity-price { color: #cc8844; font-size: 12px; font-weight: bold; }
.commodity-unit { font-size: 9px; opacity: 0.4; margin-left: 4px; }
.commodity-change { font-size: 10px; font-weight: bold; min-width: 50px; text-align: right; }
.commodity-change.positive { color: #00ff41; }
.commodity-change.negative { color: #ff4444; }
.commodity-empty { padding: 20px 14px; color: #cc884440; text-align: center; letter-spacing: 2px; font-size: 10px; }

/* --- News Feed Items --- */
.news-item {
  padding: 10px 14px; border-bottom: 1px solid #ffffff08; cursor: pointer;
}
.news-item:hover { background: rgba(68, 170, 255, 0.04); }
.news-title {
  color: #ccc; font-size: 11px; line-height: 1.4; margin-bottom: 4px;
}
.news-title:hover { color: #44aaff; }
.news-meta {
  display: flex; justify-content: space-between; font-size: 9px; opacity: 0.5;
}
.news-source { color: #44aaff; letter-spacing: 0.5px; }
.news-time { color: #888; }
.news-empty { padding: 20px 14px; color: #44aaff40; text-align: center; letter-spacing: 2px; font-size: 10px; }

/* --- Whale Transaction Feed --- */
.whale-tx {
  padding: 10px 14px; border-bottom: 1px solid #ffffff08;
}
.whale-tx:hover { background: rgba(247, 147, 26, 0.04); }
.whale-amount {
  font-size: 14px; font-weight: bold; color: #f7931a;
  text-shadow: 0 0 6px rgba(247, 147, 26, 0.3);
}
.whale-usd { font-size: 10px; color: #888; margin-left: 6px; }
.whale-txid {
  font-size: 9px; color: #f7931a80; letter-spacing: 0.5px;
  cursor: pointer; margin-top: 4px;
}
.whale-txid:hover { color: #f7931a; text-decoration: underline; }
.whale-meta {
  display: flex; justify-content: space-between;
  font-size: 9px; opacity: 0.4; margin-top: 4px;
}
.whale-empty {
  padding: 20px 14px; color: #f7931a40;
  text-align: center; letter-spacing: 2px; font-size: 10px;
}

/* --- Wikipedia Articles --- */
.wiki-location {
  padding: 8px 14px;
  font-size: 9px;
  letter-spacing: 1.5px;
  color: #aaaaaa;
  background: rgba(170, 170, 170, 0.04);
  border-bottom: 1px solid #aaaaaa15;
}
.wiki-card {
  padding: 10px 14px;
  border-bottom: 1px solid #ffffff08;
  cursor: pointer;
}
.wiki-card:hover { background: rgba(170, 170, 170, 0.04); }
.wiki-title {
  color: #ccc;
  font-size: 11px;
  font-weight: bold;
  line-height: 1.3;
  margin-bottom: 4px;
}
.wiki-title:hover { color: #aaaaaa; }
.wiki-extract {
  color: #888;
  font-size: 10px;
  line-height: 1.4;
  margin-bottom: 6px;
}
.wiki-meta {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  opacity: 0.5;
}
.wiki-dist { color: #aaaaaa; letter-spacing: 0.5px; }
.wiki-coords { color: #888; }
.wiki-empty {
  padding: 20px 14px; color: #aaaaaa40;
  text-align: center; letter-spacing: 2px; font-size: 10px;
}

/* --- Filter Dropdown Panel --- */
#filter-panel {
  position: absolute; top: 82px;
  left: 50%; transform: translateX(-50%);
  z-index: 12;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  min-width: 220px; max-width: 280px;
  overflow-y: auto; font-size: 11px;
  box-shadow: 0 4px 24px rgba(0, 255, 65, 0.08);
}
.filter-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; cursor: pointer;
  transition: background 0.1s;
}
.filter-row:hover { background: rgba(0, 255, 65, 0.05); }
.filter-row.active { background: rgba(0, 255, 65, 0.12); }
.filter-row.active .filter-name { color: #00ff41; font-weight: bold; }
.filter-name {
  color: #ccc; letter-spacing: 1px; min-width: 60px;
}
.filter-desc {
  color: #00ff4160; font-size: 9px; letter-spacing: 1px;
}

/* --- Pinned City Buttons (in pin tray) --- */
#pin-tray .city-pin {
  background: none; border: none; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 11px;
  padding: 2px 0; cursor: pointer; border-radius: 3px;
  letter-spacing: 1px; text-align: left;
}
#pin-tray .city-pin:hover { color: #44ffaa; }

/* --- City Dropdown Panel --- */
#city-panel {
  position: absolute; top: 82px;
  left: 50%; transform: translateX(-50%);
  z-index: 12;
  background: rgba(0, 0, 0, 0.92);
  border: 1px solid #00ff4130;
  border-radius: 4px;
  max-height: 60vh; min-width: 300px; max-width: 380px;
  overflow-y: auto; font-size: 11px;
  box-shadow: 0 4px 24px rgba(0, 255, 65, 0.08);
}
#city-search {
  width: 100%; background: rgba(0, 255, 65, 0.05);
  border: none; border-bottom: 1px solid #00ff4120;
  color: #00ff41; font-family: 'Courier New', monospace;
  font-size: 12px; padding: 10px 14px; outline: none;
  letter-spacing: 1px; box-sizing: border-box;
}
#city-search::placeholder { color: #00ff4140; }
.city-category-header {
  padding: 8px 14px; color: #00ff41; opacity: 0.5;
  font-size: 9px; letter-spacing: 2px; cursor: pointer;
  user-select: none; border-bottom: 1px solid #00ff4110;
}
.city-category-header:hover { opacity: 0.8; }
.city-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 24px; cursor: pointer;
  transition: background 0.1s;
}
.city-row:hover { background: rgba(0, 255, 65, 0.05); }
.city-name {
  flex: 1; color: #ccc; letter-spacing: 1px;
}
.city-code {
  color: #00ff4160; font-size: 9px; letter-spacing: 1px;
}
.city-pin-btn {
  background: none; border: 1px solid #00ff4130;
  color: #00ff4180; font-family: 'Courier New', monospace;
  font-size: 9px; padding: 2px 6px; cursor: pointer;
  border-radius: 2px; letter-spacing: 1px;
}
.city-pin-btn:hover { border-color: #00ff41; color: #00ff41; }
.city-pin-btn.pinned {
  background: #00ff4120; border-color: #00ff4160; color: #00ff41;
}


/* ===================================================================
   Visual Filter Overlays
   Intensity driven by CSS custom property --fi (0..1) set from JS
   =================================================================== */
:root { --fi: 1; --panel-width: 45vw; }

#filter-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 5;
}

/* CRT scanlines */
.filter-crt #filter-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0, 0, 0, var(--fi)) 2px, rgba(0, 0, 0, var(--fi)) 4px
  );
  opacity: var(--fi); z-index: 1;
}
.filter-crt #filter-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.45) 100%);
  opacity: var(--fi); z-index: 2;
}

/* NVG night vision */
.filter-nvg #filter-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 20, 0, 0.7) 100%);
  opacity: var(--fi); z-index: 1;
}
.filter-nvg #filter-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 3px,
    rgba(0, 255, 0, 0.03) 3px, rgba(0, 255, 0, 0.03) 6px
  );
  opacity: var(--fi);
  animation: nvg-noise 0.1s steps(3) infinite;
  z-index: 2;
}
@keyframes nvg-noise {
  0%   { transform: translateY(0); }
  33%  { transform: translateY(-2px); }
  66%  { transform: translateY(1px); }
  100% { transform: translateY(-1px); }
}

/* FLIR thermal */
.filter-flir #filter-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 80, 0.25) 0%, rgba(0, 0, 40, 0.15) 30%,
    rgba(80, 0, 80, 0.15) 50%, rgba(120, 40, 0, 0.2) 70%,
    rgba(180, 80, 0, 0.25) 100%
  );
  mix-blend-mode: color; opacity: var(--fi); z-index: 1;
}
.filter-flir #filter-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.5) 100%);
  opacity: var(--fi); z-index: 2;
}
.filter-flir .cesium-credit-logoContainer,
.filter-flir #hud, .filter-flir #mode-bar,
.filter-flir #layer-toggles, .filter-flir #pin-tray {
  filter: sepia(0.6) hue-rotate(-30deg) saturate(2);
}

/* Anime cel-shading */
.filter-anime #hud, .filter-anime #mode-bar,
.filter-anime #layer-toggles, .filter-anime #pin-tray,
.filter-anime #info-panel {
  font-weight: bold;
  text-shadow: 0 0 0 transparent;
  -webkit-text-stroke: 0.3px currentColor;
}

/* BORDER geopolitical — dark globe with country border outlines */
.filter-border #filter-overlay::before {
  content: ''; position: absolute; inset: 0;
  background: transparent; z-index: 1;
}
.filter-border #filter-overlay::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 60%, rgba(0, 0, 0, 0.5) 100%);
  opacity: var(--fi); z-index: 2;
}
.filter-border #hud, .filter-border #mode-bar,
.filter-border #layer-toggles, .filter-border #pin-tray,
.filter-border #info-panel {
  color: #00ff41;
  text-shadow: 0 0 8px rgba(0, 255, 65, 0.4);
}
.filter-border #title { text-shadow: 0 0 10px rgba(0, 255, 65, 0.4); }


/* ===================================================================
   Audio Player Widget
   =================================================================== */
#audio-player {
  margin-top: auto;
  background: rgba(0, 255, 65, 0.05);
  border: 1px solid #00ff4140;
  padding: 10px 14px; border-radius: 4px;
  display: flex; align-items: center; gap: 10px;
}
#scenario-sidebar.collapsed #audio-player { display: none; }
#audio-player .ap-btn {
  background: none; border: 1px solid #00ff4160; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 16px;
  width: 32px; height: 32px; cursor: pointer;
  border-radius: 50%; display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; padding: 0;
}
#audio-player .ap-btn:hover { background: #00ff4120; }
#audio-player .ap-info {
  display: flex; flex-direction: column; gap: 2px;
  flex: 1; min-width: 0; overflow: hidden;
}
#audio-player .ap-title {
  font-size: 11px; color: #00ff41; letter-spacing: 1px;
  font-weight: bold; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
#audio-player .ap-artist {
  font-size: 9px; color: #00ff41; opacity: 0.5;
  letter-spacing: 1px; white-space: nowrap;
}
#audio-player .ap-progress-wrap {
  width: 100%; height: 4px; background: #00ff4120;
  border-radius: 2px; cursor: pointer; margin-top: 3px;
}
#audio-player .ap-progress {
  height: 100%; background: #00ff41; border-radius: 2px;
  width: 0%; transition: width 0.3s linear;
}
#audio-player .ap-time {
  font-size: 9px; color: #00ff41; opacity: 0.4;
  flex-shrink: 0;
}


/* ===================================================================
   Satellite Aerial View Panel
   =================================================================== */
#sat-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #ffaa0060;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#sat-view-panel.open { width: var(--panel-width); }

/* Horizontal profile view */
#sat-horizon-view {
  width: 100%; height: 250px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #ffaa0030;
  background: #000;
}
#sat-horizon-canvas { width: 100%; height: 100%; display: block; }
#sat-horizon-label {
  position: absolute; top: 8px; left: 12px;
  font-size: 9px; letter-spacing: 2px;
  color: #ffaa00; opacity: 0.5;
  pointer-events: none;
}

#sat-view-container { width: 100%; flex: 1; min-height: 0; }

#sat-view-hud {
  position: absolute; top: 250px; left: 0; right: 0;
  pointer-events: none; z-index: 16;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, transparent 100%);
}
#sat-view-hud .sv-title {
  font-size: 14px; font-weight: bold; letter-spacing: 3px;
  color: #ffaa00; text-shadow: 0 0 10px #ffaa00;
}
#sat-view-hud .sv-subtitle {
  font-size: 10px; opacity: 0.6; letter-spacing: 1px;
  color: #ffaa00; margin-top: 2px;
}
#sat-view-hud .sv-info {
  font-size: 11px; color: #ffaa00; margin-top: 8px;
  line-height: 1.6; opacity: 0.8;
}
#sat-view-hud .sv-label { opacity: 0.5; }

#sat-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,0,0,0.7); border: 1px solid #ffaa0060;
  color: #ffaa00; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#sat-view-close:hover { background: #ffaa0020; }

/* Crosshair overlay */
#sat-view-crosshair {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
}
#sat-view-crosshair::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right,
    transparent 0%, #ffaa0030 20%, #ffaa0050 50%, #ffaa0030 80%, transparent 100%);
}
#sat-view-crosshair::after {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%, #ffaa0030 20%, #ffaa0050 50%, #ffaa0030 80%, transparent 100%);
}
#sat-view-scope {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%; height: 60%;
  border: 1px solid #ffaa0025;
  border-radius: 50%;
  pointer-events: none; z-index: 16;
  box-shadow: 0 0 40px rgba(255,170,0,0.08) inset;
}
#sat-view-scope::after {
  content: ''; position: absolute; inset: 12%;
  border: 1px dashed #ffaa0015;
  border-radius: 50%;
}

/* Resize main viewer when satellite panel is open */
body.sat-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.sat-panel-open #hud                   { right: var(--panel-width); }
body.sat-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.sat-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.sat-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.sat-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.sat-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.sat-panel-open #timeline-bar          { right: var(--panel-width); }


/* ===================================================================
   Aircraft Aerial View Panel — Military Camera Footage Style
   =================================================================== */
#plane-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #00ff4160;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#plane-view-panel.open { width: var(--panel-width); }

/* --- Stats bar at top --- */
#plane-view-stats {
  width: 100%; flex-shrink: 0;
  background: rgba(0, 8, 0, 0.95);
  border-bottom: 1px solid #00ff4140;
  padding: 10px 16px;
  z-index: 18;
}
.pv-stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#plane-view-stats .pv-title {
  font-size: 15px; font-weight: bold; letter-spacing: 3px;
  color: #00ff41; text-shadow: 0 0 8px #00ff41;
}
.pv-stats-tag {
  font-size: 9px; letter-spacing: 1px;
  color: #00ff41; opacity: 0.6;
  border: 1px solid #00ff4140;
  padding: 1px 6px; border-radius: 2px;
}
.pv-stats-grid {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 11px; color: #00ff41; opacity: 0.85;
  line-height: 1.5;
}
.pv-stats-grid .pv-label {
  opacity: 0.45; font-size: 10px;
}

/* --- Flight profile canvas --- */
#plane-horizon-view {
  width: 100%; height: 220px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #00ff4130;
  background: #000;
}
#plane-horizon-canvas { width: 100%; height: 100%; display: block; }
#plane-horizon-label {
  position: absolute; top: 8px; left: 12px;
  font-size: 9px; letter-spacing: 2px;
  color: #00ff41; opacity: 0.5;
  pointer-events: none;
}

/* --- Cesium viewer wrapper (military camera area) --- */
#plane-view-wrapper {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
}
#plane-view-container { width: 100%; height: 100%; }

/* Green-tinted overlay canvas for HUD elements drawn in JS */
#plane-view-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 17;
}

/* Close button */
#plane-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,8,0,0.7); border: 1px solid #00ff4160;
  color: #00ff41; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#plane-view-close:hover { background: #00ff4120; }

/* Crosshair overlay — mil green */
#plane-view-crosshair {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
}
#plane-view-crosshair::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right,
    transparent 0%, #00ff4125 20%, #00ff4145 50%, #00ff4125 80%, transparent 100%);
}
#plane-view-crosshair::after {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%, #00ff4125 20%, #00ff4145 50%, #00ff4125 80%, transparent 100%);
}
#plane-view-scope {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 60%; height: 60%;
  border: 1px solid #00ff4120;
  border-radius: 50%;
  pointer-events: none; z-index: 16;
  box-shadow: 0 0 40px rgba(0,255,65,0.06) inset;
}
#plane-view-scope::after {
  content: ''; position: absolute; inset: 12%;
  border: 1px dashed #00ff4112;
  border-radius: 50%;
}

/* Resize main viewer when plane panel is open */
body.plane-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.plane-panel-open #hud                   { right: var(--panel-width); }
body.plane-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.plane-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.plane-panel-open #timeline-bar          { right: var(--panel-width); }

/* ===================================================================
   Site Reconnaissance View Panel — Intelligence Recon Style
   =================================================================== */
#site-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #b4dcff60;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#site-view-panel.open { width: var(--panel-width); }

/* --- Site info canvas (top section) --- */
#site-info-view {
  width: 100%; height: 200px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #b4dcff30;
  background: #000;
}
#site-info-canvas { width: 100%; height: 100%; display: block; }
#site-info-label {
  position: absolute; top: 8px; right: 12px;
  font-size: 9px; letter-spacing: 2px;
  color: #b4dcff; opacity: 0.5;
  pointer-events: none;
  font-family: 'Courier New', monospace;
}

/* --- Stats bar --- */
#site-view-stats {
  width: 100%; flex-shrink: 0;
  background: rgba(0, 8, 20, 0.95);
  border-bottom: 1px solid #b4dcff40;
  padding: 10px 16px;
  z-index: 18;
}
.stv-stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#site-view-stats .stv-title {
  font-size: 15px; font-weight: bold; letter-spacing: 3px;
  color: #b4dcff; text-shadow: 0 0 8px #b4dcff;
}
.stv-stats-tag {
  font-size: 9px; letter-spacing: 1px;
  color: #b4dcff; opacity: 0.6;
  border: 1px solid #b4dcff40;
  padding: 1px 6px; border-radius: 2px;
  font-family: 'Courier New', monospace;
}
.stv-stats-grid {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 11px; color: #b4dcff; opacity: 0.85;
  line-height: 1.5;
}
.stv-stats-grid .stv-label {
  opacity: 0.45; font-size: 10px;
}
.stv-notes-row {
  width: 100%;
}

/* --- Cesium viewer wrapper --- */
#site-view-wrapper {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
}
#site-view-container { width: 100%; height: 100%; }

#site-view-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 17;
}

/* Close button */
#site-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,8,20,0.7); border: 1px solid #b4dcff60;
  color: #b4dcff; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#site-view-close:hover { background: #b4dcff20; }

/* Crosshair overlay */
#site-view-crosshair {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
}
#site-view-crosshair::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right,
    transparent 0%, #b4dcff25 20%, #b4dcff45 50%, #b4dcff25 80%, transparent 100%);
}
#site-view-crosshair::after {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%, #b4dcff25 20%, #b4dcff45 50%, #b4dcff25 80%, transparent 100%);
}

/* Resize main viewer when site panel is open */
body.site-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.site-panel-open #hud                   { right: var(--panel-width); }
body.site-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.site-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.site-panel-open #timeline-bar          { right: var(--panel-width); }

/* ===================================================================
   Path Route View Panel — Route Intelligence + 3D Route View
   =================================================================== */
#path-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #00ffa060;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#path-view-panel.open { width: var(--panel-width); }

/* --- Path info canvas (top section) --- */
#path-info-view {
  width: 100%; height: 200px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #00ffa030;
  background: #000;
}
#path-info-canvas { width: 100%; height: 100%; display: block; }
#path-info-label {
  position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
  font-size: 9px; letter-spacing: 4px; color: #00ffa060;
  pointer-events: none;
}

/* --- Stats bar --- */
#path-view-stats {
  width: 100%; flex-shrink: 0;
  background: rgba(0, 8, 20, 0.95);
  padding: 10px 16px;
  border-bottom: 1px solid #00ffa020;
  z-index: 18;
}
.ptv-stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#path-view-stats .ptv-title {
  font-size: 15px; font-weight: bold; letter-spacing: 3px;
  color: #00ffa0; text-shadow: 0 0 8px #00ffa0;
}
.ptv-stats-tag {
  font-size: 9px; letter-spacing: 1px;
  color: #00ffa0; opacity: 0.6;
  border: 1px solid #00ffa040;
  padding: 1px 6px; border-radius: 2px;
  font-family: 'Courier New', monospace;
}
.ptv-stats-grid {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 11px; color: #00ffa0; opacity: 0.85;
  line-height: 1.5;
}
.ptv-stats-grid .ptv-label {
  opacity: 0.45; font-size: 10px;
}
.ptv-notes-row {
  width: 100%;
}

/* --- Cesium viewer wrapper --- */
#path-view-wrapper {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
}
#path-view-container { width: 100%; height: 100%; }

#path-view-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 17;
}

/* Close button */
#path-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: none; border: 1px solid #00ffa040;
  color: #00ffa0; font: 10px 'Courier New'; padding: 4px 10px;
  cursor: pointer; letter-spacing: 2px;
  border-radius: 3px;
}
#path-view-close:hover { background: #00ffa020; }

/* Crosshair overlay */
#path-view-crosshair {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
}
#path-view-crosshair::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right,
    transparent 0%, #00ffa025 20%, #00ffa045 50%, #00ffa025 80%, transparent 100%);
}
#path-view-crosshair::after {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%, #00ffa025 20%, #00ffa045 50%, #00ffa025 80%, transparent 100%);
}

/* Resize main viewer when path panel is open */
body.path-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.path-panel-open #hud                   { right: var(--panel-width); }
body.path-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.path-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.path-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.path-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.path-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.path-panel-open #timeline-bar          { right: var(--panel-width); }

/* ===================================================================
   Airport View Panel — Flight Schedule + Aerial Imagery
   =================================================================== */
#airport-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #00ccff60;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#airport-view-panel.open { width: var(--panel-width); }

/* --- Schedule canvas (top section) --- */
#airport-schedule-view {
  width: 100%; height: 260px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #00ccff30;
  background: #000;
}
#airport-schedule-canvas { width: 100%; height: 100%; display: block; }
#airport-schedule-label {
  position: absolute; top: 8px; right: 12px;
  font-size: 9px; letter-spacing: 2px;
  color: #00ccff; opacity: 0.5;
  pointer-events: none;
  font-family: 'Courier New', monospace;
}

/* --- Stats bar --- */
#airport-view-stats {
  width: 100%; flex-shrink: 0;
  background: rgba(0, 8, 20, 0.95);
  border-bottom: 1px solid #00ccff40;
  padding: 10px 16px;
  z-index: 18;
}
.apv-stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#airport-view-stats .apv-title {
  font-size: 15px; font-weight: bold; letter-spacing: 3px;
  color: #00ccff; text-shadow: 0 0 8px #00ccff;
}
.apv-stats-tag {
  font-size: 9px; letter-spacing: 1px;
  color: #00ccff; opacity: 0.6;
  border: 1px solid #00ccff40;
  padding: 1px 6px; border-radius: 2px;
  font-family: 'Courier New', monospace;
}
.apv-stats-grid {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 11px; color: #00ccff; opacity: 0.85;
  line-height: 1.5;
}
.apv-stats-grid .apv-label {
  opacity: 0.45; font-size: 10px;
}

/* --- Cesium viewer wrapper (aerial area) --- */
#airport-view-wrapper {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
}
#airport-view-container { width: 100%; height: 100%; }

#airport-view-overlay {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 17;
}

/* Close button */
#airport-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,8,20,0.7); border: 1px solid #00ccff60;
  color: #00ccff; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#airport-view-close:hover { background: #00ccff20; }

/* Crosshair overlay */
#airport-view-crosshair {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
}
#airport-view-crosshair::before {
  content: ''; position: absolute;
  top: 50%; left: 0; right: 0; height: 1px;
  background: linear-gradient(to right,
    transparent 0%, #00ccff25 20%, #00ccff45 50%, #00ccff25 80%, transparent 100%);
}
#airport-view-crosshair::after {
  content: ''; position: absolute;
  left: 50%; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(to bottom,
    transparent 0%, #00ccff25 20%, #00ccff45 50%, #00ccff25 80%, transparent 100%);
}

/* Resize main viewer when airport panel is open */
body.airport-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.airport-panel-open #hud                   { right: var(--panel-width); }
body.airport-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.airport-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.airport-panel-open #timeline-bar          { right: var(--panel-width); }

/* ===================================================================
   Webcam View Panel — Live Camera Feed
   =================================================================== */
#webcam-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #00ddff60;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#webcam-view-panel.open { width: var(--panel-width); }

/* --- Info canvas (top section) --- */
#webcam-info-view {
  width: 100%; height: 110px; flex-shrink: 0;
  position: relative; z-index: 18;
  border-bottom: 1px solid #00ddff30;
  background: #000;
}
#webcam-info-canvas { width: 100%; height: 100%; display: block; }
#webcam-info-label {
  position: absolute; top: 8px; right: 12px;
  font-size: 9px; letter-spacing: 2px;
  color: #00ddff; opacity: 0.5;
  pointer-events: none;
  font-family: 'Courier New', monospace;
}

/* --- Stats bar --- */
#webcam-view-stats {
  width: 100%; flex-shrink: 0;
  background: rgba(0, 8, 20, 0.95);
  border-bottom: 1px solid #00ddff40;
  padding: 10px 16px;
  z-index: 18;
}
.wcv-stats-row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 6px;
}
#webcam-view-stats .wcv-title {
  font-size: 15px; font-weight: bold; letter-spacing: 3px;
  color: #00ddff; text-shadow: 0 0 8px #00ddff;
}
.wcv-stats-tag {
  font-size: 9px; letter-spacing: 1px;
  color: #00ddff; opacity: 0.6;
  border: 1px solid #00ddff40;
  padding: 1px 6px; border-radius: 2px;
  font-family: 'Courier New', monospace;
}
.wcv-stats-grid {
  display: flex; flex-wrap: wrap; gap: 4px 16px;
  font-size: 11px; color: #00ddff; opacity: 0.85;
  line-height: 1.5;
}
.wcv-stats-grid .wcv-label {
  opacity: 0.45; font-size: 10px;
}

/* --- Iframe embed wrapper --- */
#webcam-embed-wrapper {
  position: relative; flex: 1; min-height: 0;
  overflow: hidden;
  background: #0a0a0a;
}
#webcam-embed-iframe,
#webcam-hls-video {
  width: 100%; height: 100%; border: none;
  background: #000; object-fit: cover;
  transition: filter 0.4s ease;
}
/* Surveillance filter on video/iframe — toggled via .surveillance class */
#webcam-embed-wrapper.surveillance #webcam-embed-iframe,
#webcam-embed-wrapper.surveillance #webcam-hls-video {
  filter: saturate(0.3) contrast(1.3) brightness(0.9) sepia(0.15) hue-rotate(80deg);
}
#webcam-hls-video { display: none; }
#webcam-embed-wrapper.hls-mode #webcam-hls-video { display: block; }
#webcam-embed-wrapper.hls-mode #webcam-embed-iframe { display: none; }

/* HUD overlay canvas on top of video — hidden when surveillance mode off */
#webcam-video-overlay {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 5;
  opacity: 0; transition: opacity 0.4s ease;
}
#webcam-embed-wrapper.surveillance #webcam-video-overlay { opacity: 1; }

/* Surveillance toggle button */
#webcam-surveillance-toggle {
  position: absolute; bottom: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,8,20,0.7); border: 1px solid #00ff4140;
  color: #00ff4180; font-family: 'Courier New', monospace;
  font-size: 10px; padding: 3px 8px; cursor: pointer;
  border-radius: 3px; letter-spacing: 1px;
  transition: all 0.25s ease;
}
#webcam-surveillance-toggle:hover { background: #00ff4115; color: #00ff41; }
#webcam-surveillance-toggle.active { border-color: #00ff41a0; color: #00ff41; background: rgba(0,255,65,0.1); }

/* Close button */
#webcam-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,8,20,0.7); border: 1px solid #00ddff60;
  color: #00ddff; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#webcam-view-close:hover { background: #00ddff20; }

/* Resize main viewer when webcam panel is open */
body.webcam-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.webcam-panel-open #hud                   { right: var(--panel-width); }
body.webcam-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.webcam-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.webcam-panel-open #timeline-bar          { right: var(--panel-width); }

/* ===================================================================
   SAR Imagery View Panel — Radar Satellite Imagery
   =================================================================== */
#sar-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #00ff4160;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#sar-view-panel.open { width: var(--panel-width); }

#sar-image-view {
  flex: 1; position: relative; overflow: hidden;
  background: #000;
}
#sar-image-canvas, #sar-overlay-canvas {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
}
#sar-overlay-canvas { z-index: 2; pointer-events: none; }

#sar-view-close {
  position: absolute; bottom: 8px; right: 8px; z-index: 20;
  background: none; border: 1px solid #00ff4140;
  color: #00ff41; font: bold 10px 'Courier New', monospace;
  padding: 4px 12px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#sar-view-close:hover { background: #00ff4120; }

/* Resize main viewer when SAR panel is open */
body.sar-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.sar-panel-open #hud                   { right: var(--panel-width); }
body.sar-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.sar-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.sar-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.sar-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.sar-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.sar-panel-open #timeline-bar          { right: var(--panel-width); }
body.sar-panel-open #layer-panel           { left: calc((100vw - var(--panel-width)) / 2); }
body.sar-panel-open #city-panel            { left: calc((100vw - var(--panel-width)) / 2); }

/* ===================================================================
   Submarine 3D View Panel — Underwater Pursuit
   =================================================================== */
#submarine-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #22ccaa60;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#submarine-view-panel.open { width: var(--panel-width); }

/* 3D container fills panel */
#submarine-3d-container {
  width: 100%; flex: 1; min-height: 0;
  position: relative;
}

/* HUD overlay on top of 3D */
#sub-hud-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 16;
  font-family: 'Courier New', monospace;
}
#sub-hud-overlay * { pointer-events: none; }

/* Unit label */
#sub-unit-label {
  position: absolute; top: 10px; left: 14px;
  font-size: 13px; font-weight: bold; letter-spacing: 1px;
  color: #22ccaa; text-shadow: 0 0 6px rgba(34,204,170,0.5);
  text-transform: uppercase;
}

/* Top status bar */
#sub-status-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(0,10,8,0.85) 0%, transparent 100%);
}
#sub-compass {
  font-size: 22px; font-weight: bold; color: #22ccaa;
  text-shadow: 0 0 8px #22ccaa;
  letter-spacing: 2px;
}
.sub-compass-deg { font-size: 14px; opacity: 0.6; }
.sub-stat {
  font-size: 12px; color: #22ccaa; letter-spacing: 1px;
}
.sub-stat-label { opacity: 0.5; font-size: 10px; }
.sub-stat-unit { opacity: 0.4; font-size: 9px; }

/* Command readout */
#sub-command-bar {
  padding: 4px 14px;
  font-size: 10px; letter-spacing: 1px;
  color: #22ccaa80;
}

/* Sonar panel (bottom-left) */
#sub-sonar-panel {
  position: absolute; bottom: 50px; left: 10px;
  width: 200px;
  background: rgba(0, 10, 8, 0.7);
  border: 1px solid #22ccaa30;
  border-radius: 3px;
  padding: 8px;
}
.sub-panel-title {
  font-size: 9px; letter-spacing: 2px;
  color: #22ccaa; opacity: 0.5;
  margin-bottom: 6px;
}
#sub-sonar-list {
  margin-bottom: 8px;
  max-height: 100px; overflow-y: auto;
}
#sub-sonar-ppi {
  display: block; width: 180px; height: 180px;
}

/* AI reasoning (bottom-center) */
#sub-hud-ai {
  position: absolute; bottom: 50px; left: 220px; right: 90px;
  background: rgba(0, 10, 8, 0.7);
  border: 1px solid #22ccaa30;
  border-radius: 3px;
  padding: 8px 12px;
  max-height: 150px; overflow-y: auto;
}
#sub-ai-text {
  font-size: 11px; color: #aac; line-height: 1.5;
}

/* Intel feed (top-right) */
#sub-hud-intel {
  position: absolute; top: 60px; right: 10px;
  width: 200px;
  background: rgba(0, 10, 8, 0.7);
  border: 1px solid #ffaa0030;
  border-radius: 3px;
  padding: 8px 10px;
  max-height: 200px; overflow-y: auto;
}
#sub-hud-intel .sub-panel-title { color: #ffaa00; }
.sub-intel-msg {
  font-size: 10px; color: #ffaa00; opacity: 0.8;
  line-height: 1.5; margin-bottom: 4px;
  padding-bottom: 4px; border-bottom: 1px solid #ffaa0015;
}

/* Depth gauge (right side) */
#sub-depth-gauge {
  position: absolute; bottom: 50px; right: 10px;
  width: 30px; height: 200px;
  display: flex; flex-direction: column; align-items: center;
}
.sub-depth-label {
  font-size: 8px; color: #22ccaa; opacity: 0.4; letter-spacing: 1px;
}
.sub-depth-track {
  flex: 1; width: 4px;
  background: #22ccaa20;
  border-radius: 2px;
  position: relative;
  margin: 4px 0;
}
#sub-depth-indicator {
  position: absolute; left: -4px;
  width: 12px; height: 4px;
  background: #22ccaa;
  border-radius: 2px;
  box-shadow: 0 0 6px #22ccaa;
  transition: top 0.3s ease;
}

/* Close button */
#submarine-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(0,10,8,0.7); border: 1px solid #22ccaa60;
  color: #22ccaa; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#submarine-view-close:hover { background: #22ccaa20; }

/* Resize main viewer when submarine panel is open */
body.submarine-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.submarine-panel-open #hud                   { right: var(--panel-width); }
body.submarine-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.submarine-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.submarine-panel-open #pin-tray               { left: calc((100vw - var(--panel-width)) / 2); }
body.submarine-panel-open #filter-panel            { left: calc((100vw - var(--panel-width)) / 2); }
body.submarine-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.submarine-panel-open #timeline-bar          { right: var(--panel-width); }
body.submarine-panel-open #layer-panel           { left: calc((100vw - var(--panel-width)) / 2); }
body.submarine-panel-open #city-panel            { left: calc((100vw - var(--panel-width)) / 2); }

/* ==================== Sniper Scope View Panel ==================== */
#sniper-view-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 0; z-index: 15;
  background: #000;
  border-left: 2px solid #ff444460;
  transition: width 0.35s ease;
  overflow: hidden;
  display: flex; flex-direction: column;
}
#sniper-view-panel.open { width: var(--panel-width); }

#sniper-3d-container {
  width: 100%; flex: 1; min-height: 0;
  position: relative;
}

#sniper-hud-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 3;
  font-family: 'Courier New', monospace;
}
#sniper-hud-overlay * { pointer-events: none; }

#sniper-status-bar {
  display: flex; align-items: center; gap: 16px;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(10,0,0,0.85) 0%, transparent 100%);
}
.sniper-stat {
  font-size: 12px; color: #ff4444; letter-spacing: 1px;
}
.sniper-stat-label { opacity: 0.5; font-size: 10px; }
.sniper-stat-unit { opacity: 0.4; font-size: 9px; }

#sniper-target-panel {
  position: absolute; bottom: 50px; left: 10px;
  width: 250px;
  background: rgba(10, 0, 0, 0.7);
  border: 1px solid #ff444430;
  border-radius: 3px;
  padding: 8px 10px;
}
.sniper-panel-title {
  font-size: 9px; letter-spacing: 2px;
  color: #ff4444; opacity: 0.5;
  margin-bottom: 6px;
}
#sniper-target-status {
  font-size: 11px; color: #888; line-height: 1.5;
  font-weight: bold; letter-spacing: 1px;
}

#sniper-ai-panel {
  position: absolute; bottom: 50px; left: 270px; right: 20px;
  background: rgba(10, 0, 0, 0.7);
  border: 1px solid #ff444430;
  border-radius: 3px;
  padding: 8px 12px;
  max-height: 150px; overflow-y: auto;
}
#sniper-ai-text {
  font-size: 11px; color: #cc9; line-height: 1.5;
}

#sniper-view-close {
  position: absolute; top: 10px; right: 12px;
  z-index: 19; pointer-events: all;
  background: rgba(10,0,0,0.7); border: 1px solid #ff444460;
  color: #ff4444; font-family: 'Courier New', monospace;
  font-size: 14px; padding: 4px 10px; cursor: pointer;
  border-radius: 3px; letter-spacing: 2px;
}
#sniper-view-close:hover { background: #ff444420; }

body.sniper-panel-open #cesiumContainer       { width: calc(100vw - var(--panel-width)); }
body.sniper-panel-open #hud                   { right: var(--panel-width); }
body.sniper-panel-open #mode-bar              { left: calc((100vw - var(--panel-width)) / 2); }
body.sniper-panel-open #layer-toggles         { left: calc((100vw - var(--panel-width)) / 2); }
body.sniper-panel-open #pin-tray              { left: calc((100vw - var(--panel-width)) / 2); }
body.sniper-panel-open #filter-panel          { left: calc((100vw - var(--panel-width)) / 2); }
body.sniper-panel-open #info-panel            { right: calc(var(--panel-width) + 16px); }
body.sniper-panel-open #timeline-bar          { right: var(--panel-width); }
body.sniper-panel-open #layer-panel           { left: calc((100vw - var(--panel-width)) / 2); }
body.sniper-panel-open #city-panel            { left: calc((100vw - var(--panel-width)) / 2); }

/* --- Panel Resize Handle --- */
.panel-resize-handle {
  position: absolute; left: 0; top: 0; bottom: 0; width: 6px;
  cursor: col-resize; z-index: 20;
  background: transparent;
  transition: background 0.15s;
}
.panel-resize-handle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Disable transitions & lock cursor during panel drag resize */
body.resizing { cursor: col-resize !important; user-select: none !important; }
body.resizing * { transition: none !important; cursor: col-resize !important; }

/* ===================================================================
   Wargame Agent Panel
   =================================================================== */
#wargame-panel {
  position: absolute; top: 80px; left: 0; bottom: 0;
  width: 320px; z-index: 10; display: none;
  background: rgba(0, 0, 0, 0.92);
  border-right: 1px solid #ff444430;
  padding: 16px;
  overflow-y: auto;
  flex-direction: column;
  font-size: 12px;
}
#wargame-panel h3 {
  font-size: 12px; letter-spacing: 3px; opacity: 0.5;
  font-weight: normal; margin-bottom: 14px;
  color: #ff4444;
}
.wg-config {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 12px;
}
.wg-config label {
  display: flex; flex-direction: column; gap: 3px;
  color: #ff4444; font-size: 9px; letter-spacing: 1px; opacity: 0.6;
}
.wg-config select, .wg-config input, .wg-config textarea {
  background: rgba(255, 68, 68, 0.08); color: #ff8888;
  border: 1px solid #ff444440; padding: 5px 8px;
  font-family: 'Courier New', monospace; font-size: 11px;
  border-radius: 3px; outline: none;
}
.wg-config textarea {
  resize: vertical; min-height: 32px;
}
.wg-config select:focus, .wg-config input:focus, .wg-config textarea:focus {
  border-color: #ff4444;
}
.wg-config select:disabled, .wg-config input:disabled, .wg-config textarea:disabled {
  opacity: 0.3;
}
.wg-controls {
  display: flex; gap: 8px; align-items: center;
  margin-bottom: 10px;
}
.wg-controls button {
  background: rgba(255, 68, 68, 0.15); color: #ff4444;
  border: 1px solid #ff444460; padding: 6px 18px;
  font-family: 'Courier New', monospace; font-size: 12px;
  cursor: pointer; border-radius: 3px; letter-spacing: 2px;
}
.wg-controls button:hover { background: #ff444430; }
#wg-tick {
  font-size: 11px; color: #ff4444; opacity: 0.7; letter-spacing: 1px;
}
.wg-status {
  font-size: 10px; color: #888; margin-bottom: 8px;
  min-height: 14px; letter-spacing: 0.5px;
}
.wg-result {
  display: none; padding: 8px 12px; border-radius: 3px;
  font-size: 11px; letter-spacing: 1px; margin-bottom: 10px;
  line-height: 1.5;
}
.wg-result.result-safe {
  background: rgba(0, 255, 65, 0.1); border: 1px solid #00ff4160;
  color: #00ff41;
}
.wg-result.result-critical {
  background: rgba(255, 68, 68, 0.15); border: 1px solid #ff444460;
  color: #ff4444;
}
.wg-playback-btn {
  display: inline-block; margin-top: 8px;
  background: none; border: 1px solid #00ff4180; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 10px;
  letter-spacing: 1px; padding: 4px 12px; cursor: pointer;
  transition: background 0.15s;
}
.wg-playback-btn:hover {
  background: rgba(0, 255, 65, 0.15);
}
.wg-result-buttons {
  display: flex; gap: 8px; margin-top: 8px;
}
.wg-result-buttons .wg-playback-btn {
  margin-top: 0;
}

/* --- Playback IO Buttons --- */
.pb-io-buttons {
  display: flex; gap: 6px; padding: 8px 10px;
  border-bottom: 1px solid #00ff4120; margin-bottom: 8px;
}
.pb-io-btn {
  flex: 1; background: rgba(0, 255, 65, 0.08);
  border: 1px solid #00ff4180; color: #00ff41;
  font-family: 'Courier New', monospace; font-size: 10px;
  letter-spacing: 1px; padding: 6px 0; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pb-io-btn:hover {
  background: rgba(0, 255, 65, 0.2); border-color: #00ff41;
}

.wg-feed {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.wg-entry {
  padding: 8px 10px; border-radius: 3px;
  border-left: 2px solid #444;
  background: rgba(255, 255, 255, 0.02);
}
.wg-entry.wg-intel {
  border-left-color: #ffaa00;
}
.wg-entry.wg-normal {
  border-left-color: #00ff41;
}
.wg-entry.wg-critical {
  border-left-color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
}
.wg-entry-title {
  font-size: 10px; letter-spacing: 1px;
  color: #ccc; margin-bottom: 3px; font-weight: bold;
}
.wg-entry.wg-intel .wg-entry-title { color: #ffaa00; }
.wg-entry.wg-normal .wg-entry-title { color: #00ff41; }
.wg-entry.wg-critical .wg-entry-title { color: #ff4444; }
.wg-entry-body {
  font-size: 10px; color: #999; line-height: 1.5;
}
/* Agentic mode feed entry styles */
.wg-entry.wg-reasoning {
  border-left-color: #4488ff;
}
.wg-entry.wg-reasoning .wg-entry-title { color: #4488ff; }
.wg-entry.wg-tool-call {
  border-left-color: #ffaa00;
  background: rgba(255, 170, 0, 0.05);
}
.wg-entry.wg-tool-call .wg-entry-title { color: #ffaa00; }
.wg-entry.wg-tool-result {
  border-left-color: #00ff41;
}
.wg-entry.wg-tool-result .wg-entry-title { color: #00ff41; }
.wg-entry.wg-error {
  border-left-color: #ff4444;
  background: rgba(255, 68, 68, 0.08);
}
.wg-entry.wg-error .wg-entry-title { color: #ff4444; }
.wg-entry.wg-warning {
  border-left-color: #ffaa00;
  background: rgba(255, 170, 0, 0.05);
}
.wg-entry.wg-warning .wg-entry-title { color: #ffaa00; }
.wg-entry.wg-info {
  border-left-color: #00aaff;
}
.wg-entry.wg-info .wg-entry-title { color: #00aaff; }

/* Stream Video Feed Panel */
.wg-video-feed {
  margin: 8px 0;
  border: 1px solid #ff444440;
  border-radius: 3px;
  background: #000;
  overflow: hidden;
}
.wg-video-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 68, 68, 0.08);
  border-bottom: 1px solid #ff444430;
  font-size: 10px;
  letter-spacing: 2px;
  color: #ff4444;
}
.wg-live-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ff4444;
  animation: wg-pulse 1.5s ease-in-out infinite;
}
@keyframes wg-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #ff4444; }
  50% { opacity: 0.3; box-shadow: 0 0 8px #ff4444; }
}
.wg-live-label {
  font-weight: bold;
}
.wg-feed-label {
  flex: 1;
  text-align: right;
  color: #888;
  font-size: 9px;
  letter-spacing: 1px;
}
.wg-frame-counter {
  color: #666;
  font-size: 9px;
  font-family: 'Courier New', monospace;
}
.wg-video-container {
  position: relative;
  width: 100%;
  background: #000;
}
.wg-video-container video {
  width: 100%;
  display: block;
}
.wg-video-transcript {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.82);
  border-top: 1px solid #00ff4140;
  font-size: 10px;
  color: #00ff41;
  font-family: 'Courier New', monospace;
  line-height: 1.5;
  max-height: 80px;
  overflow-y: auto;
  display: none;
}
.wg-video-transcript.active {
  display: block;
}

/* Wargame Settings Panel */
.wg-settings {
  margin-bottom: 8px;
  border: 1px solid #333;
  background: #0a0a0a;
}
.wg-settings-header {
  padding: 6px 10px;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  user-select: none;
}
.wg-settings-header:hover { color: #ccc; }
#wg-settings-body {
  padding: 8px 10px;
  border-top: 1px solid #333;
}
#wg-settings-body label {
  display: block;
  font-size: 10px;
  color: #666;
  margin-bottom: 6px;
}
#wg-settings-body input {
  display: block;
  width: 100%;
  margin-top: 2px;
  padding: 4px 6px;
  background: #111;
  border: 1px solid #333;
  color: #ccc;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  box-sizing: border-box;
}
#wg-settings-body input:focus {
  border-color: #ff4444;
  outline: none;
}
#wg-settings-body button {
  margin-top: 6px;
  padding: 4px 16px;
  background: transparent;
  border: 1px solid #ff4444;
  color: #ff4444;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  cursor: pointer;
}
#wg-settings-body button:hover { background: #ff444420; }
.wg-settings-note {
  font-size: 10px;
  color: #00ff41;
  margin-bottom: 8px;
}
/* Hide Cesium default UI */
.cesium-viewer-toolbar,
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-fullscreenContainer,
.cesium-viewer-bottom { display: none !important; }
.cesium-credit-logoContainer { opacity: 0.4; }
