/* ==========================================================================
   Eesti Ilmateenistuse Radar - Stiilileht (Dark Mode & Premium Leaflet UI)
   ========================================================================== */

:root {
  --bg-color: #030712;
  --accent-color: #38bdf8;
  --accent-glow: rgba(56, 189, 248, 0.4);
  --success-color: #22c55e;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --glass-bg: rgba(15, 23, 42, 0.82);
  --glass-border: rgba(255, 255, 255, 0.14);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Outfit', sans-serif;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: var(--font-main);
  color: var(--text-primary);
  user-select: none;
}

/* Täisekraani konteiner */
#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: #0d0f12;
}

/* Leaflet Kaardi seadistus täisekraanil */
#map {
  position: absolute;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1;
  background-color: #0d0f12;
}

/* Radaripiltide ja äikesekihi läbipaistvuse tagamine (ilma halli taustata ega piirjoonteta) */
.leaflet-image-layer,
.radar-overlay-img,
.lightning-overlay-img {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: pixelated;
  pointer-events: none;
}

/* Laadimise ja veateate overlay */
.overlay-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  z-index: 1000;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.overlay-modal.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--accent-color);
  border-radius: 50%;
  animation: spin 1s infinite linear;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Ülemine staatuse riba (Vasakul ülal) */
.top-bar {
  position: absolute;
  top: 24px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1000;
}

.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 30px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65);
}

.live-dot {
  width: 10px;
  height: 10px;
  background-color: var(--success-color);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--success-color);
  animation: pulse-green 2s infinite ease-in-out;
}

@keyframes pulse-green {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1.5px;
  color: var(--text-primary);
}

.status-tag,
.status-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.88) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: #4ade80 !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65) !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  transition: all 0.3s ease;
}

.status-tag.status-synced,
.status-pill.status-synced {
  color: #4ade80 !important;
  border-color: rgba(74, 222, 128, 0.5) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(34, 197, 94, 0.3) !important;
}

.status-tag.status-offline,
.status-pill.status-offline {
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65), 0 0 16px rgba(239, 68, 68, 0.3) !important;
}

.status-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  animation: statusPulse 2s infinite ease-in-out;
  display: inline-block;
}

.status-offline-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  display: inline-block;
}

@keyframes statusPulse {
  0%, 100% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
}

/* ==========================================================================
   Ülemised Juhtnupud & Paneelid (Paremal ülal: Keel, Legend, Kihid)
   ========================================================================== */

.top-controls-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 30px;
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.ctrl-btn:hover,
.ctrl-btn.active {
  background: rgba(30, 41, 59, 0.95);
  border-color: rgba(56, 189, 248, 0.5);
  color: var(--accent-color);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.3);
}

.lang-btn {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 1px;
  color: #38bdf8;
  padding: 8px 12px;
}

.multiselect-btn {
  border-color: rgba(255, 255, 255, 0.12);
  color: #94a3b8;
}

.multiselect-btn:hover {
  border-color: rgba(56, 189, 248, 0.4);
  color: #e2e8f0;
}

.multiselect-btn.active,
#multiselect-toggle-btn.active,
#btn-multi-select.active {
  background: #0284c7 !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.65), inset 0 0 8px rgba(56, 189, 248, 0.3) !important;
}

.multiselect-btn.active .ctrl-icon,
#multiselect-toggle-btn.active .ctrl-icon,
#btn-multi-select.active .ctrl-icon {
  filter: drop-shadow(0 0 6px #ffffff);
}

.ctrl-icon {
  font-size: 0.95rem;
}

/* Selge sulgemisnupp (X) Leaflet infokastidele */
.leaflet-popup-close-button {
  color: #94a3b8 !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  padding: 6px 8px !important;
  transition: all 0.15s ease !important;
  text-decoration: none !important;
}

.leaflet-popup-close-button:hover {
  color: #f87171 !important;
  transform: scale(1.15);
}

/* Üldine Ripp-paneel (Layers & Legend) */
.dropdown-panel {
  position: absolute;
  top: 72px;
  right: 24px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}

.dropdown-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.layers-menu {
  width: 290px;
  max-height: 80vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.4);
}

.layers-menu::-webkit-scrollbar {
  width: 5px;
}

.layers-menu::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}

.layers-menu::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.35);
  border-radius: 4px;
}

.layers-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(56, 189, 248, 0.6);
}

.legend-panel {
  width: 290px;
  max-height: 82vh;
}

.dropdown-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.panel-header-title {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.panel-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.panel-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.layers-quick-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.layer-quick-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.layer-quick-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.layers-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.layer-category-group {
  background: rgba(30, 41, 59, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 4px 6px 6px 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-category-title {
  font-family: var(--font-display);
  font-size: 10.5px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 4px 4px 4px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.layer-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.layer-item input[type="checkbox"] {
  display: none;
}

.layer-custom-checkbox {
  width: 17px;
  height: 17px;
  border-radius: 4px;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.layer-item input[type="checkbox"]:checked + .layer-custom-checkbox {
  background: var(--accent-color);
  border-color: var(--accent-color);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

.layer-item input[type="checkbox"]:checked + .layer-custom-checkbox::after {
  content: '✓';
  color: #030712;
  font-size: 10px;
  font-weight: 900;
}

.layer-emoji {
  font-size: 13px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.layer-label {
  font-family: var(--font-main);
  font-size: 11.5px;
  color: #e2e8f0;
  line-height: 1.25;
}

.layers-menu-section-header {
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  padding-top: 10px;
  padding-bottom: 6px;
  margin-top: 8px;
  margin-bottom: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.base-layers-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.layer-item input[type="radio"] {
  display: none;
}

.layer-custom-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(148, 163, 184, 0.4);
  background: rgba(30, 41, 59, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.layer-item input[type="radio"]:checked + .layer-custom-radio {
  border-color: var(--accent-color);
  background: rgba(30, 41, 59, 0.9);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.4);
}

.layer-item input[type="radio"]:checked + .layer-custom-radio::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
  box-shadow: 0 0 6px var(--accent-color);
}

/* Legend Paneeli elemendid */
.legend-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legend-group {
  background: rgba(30, 41, 59, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.legend-group-title {
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 2px;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.legend-symbol-icon {
  font-size: 12px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 4px;
}

.legend-symbol-icon.civ-plane {
  color: #ffffff;
}

.legend-symbol-icon.mil-plane {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  border-radius: 50%;
  font-size: 10px;
}

.legend-symbol-icon.drone-plane {
  background: rgba(0, 240, 255, 0.2);
  border: 1px solid #00f0ff;
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.6);
  border-radius: 50%;
  font-size: 10px;
}

.legend-symbol-icon.sonde-balloon {
  background: rgba(234, 179, 8, 0.2);
  border: 1px solid #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
  border-radius: 50%;
  font-size: 10px;
}

.legend-symbol-icon.ship-shadow {
  background: rgba(255, 0, 85, 0.25);
  border: 1px solid #ff0055;
  box-shadow: 0 0 6px #ff0055;
  border-radius: 4px;
}

.legend-symbol-icon.tartu-bus-badge {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.7);
  border-radius: 50%;
  font-size: 10px;
}

.legend-symbol-icon.intercity-bus {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6);
  border-radius: 4px;
  font-size: 10px;
}

.legend-symbol-icon.train-badge {
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
}

.legend-symbol-icon.train-on-time {
  background: rgba(34, 197, 94, 0.25);
  border: 1px solid #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  color: #4ade80;
}

.legend-symbol-icon.train-delayed-minor {
  background: rgba(234, 179, 8, 0.25);
  border: 1px solid #eab308;
  box-shadow: 0 0 6px rgba(234, 179, 8, 0.6);
  color: #facc15;
}

.legend-symbol-icon.train-delayed-major {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
  color: #f87171;
}

.legend-desc {
  font-family: var(--font-main);
  font-size: 10.5px;
  color: #cbd5e1;
  line-height: 1.2;
}

.legend-desc strong {
  color: #f1f5f9;
  font-weight: 600;
  margin-right: 3px;
}

/* ==========================================================================
   VSR Toast Teavitused (Ujuvad teated)
   ========================================================================== */

.vsr-toast {
  position: absolute;
  top: 75px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #f8fafc;
  padding: 8px 16px;
  border-radius: 30px;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.3);
  backdrop-filter: blur(12px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.vsr-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* HUD Alumine Riba - Mahutab kõik kaardid ilma pooleks lõikamata */
#hud-dashboard, .hud-dashboard, #hud-metrics-bar, .bottom-bar {
  position: fixed !important;
  bottom: 12px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  max-width: calc(100vw - 370px) !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(11, 17, 32, 0.94) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  border-radius: 8px !important;
  padding: 4px 10px !important;
  z-index: 10000 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  white-space: nowrap !important;
  scrollbar-width: none !important;
}
#hud-dashboard::-webkit-scrollbar {
  display: none !important;
}
.hud-stat-pill, .hud-card {
  flex-shrink: 0 !important;
  font-size: 11px !important;
  padding: 4px 8px !important;
}

.hud-sub-badge {
  height: 20px !important;
  display: inline-flex !important;
  align-items: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

.hud-card:hover {
  background: rgba(30, 41, 59, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hud-card-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.hud-icon {
  font-size: 13px;
  line-height: 1;
}

.outages-icon {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

.ships-icon {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
}

.planes-icon {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
}

.sondes-icon {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.35);
}

.accidents-icon {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

.gnss-icon {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
}

.radiation-icon {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
}

.energy-icon {
  background: rgba(251, 191, 36, 0.15);
  border-color: rgba(251, 191, 36, 0.35);
}

.energy-price-badge {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.4);
  color: #fde68a;
}

.hud-card-content {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hud-card-label {
  font-family: var(--font-display);
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.1;
}

.hud-card-value-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hud-main-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.3px;
  line-height: 1;
}

.hud-unit {
  font-family: var(--font-main);
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
  margin-right: 2px;
}

.hud-sub-badge {
  font-family: var(--font-main);
  font-size: 9.5px;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.2;
  white-space: nowrap;
}

.hud-sub-badge.sonde-hub-badge {
  background: rgba(234, 179, 8, 0.15);
  border-color: rgba(234, 179, 8, 0.4);
  color: #fef08a;
}

/* ==========================================================================
   Taktikalise Ajaloo ja Trendide Modaalaken (Trend Graphs Modal)
   ========================================================================== */

.trend-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.trend-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.trend-modal-container {
  width: 90%;
  max-width: 740px;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.8), 0 0 32px rgba(56, 189, 248, 0.2);
  padding: 20px 24px;
  transform: translateY(16px) scale(0.97);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trend-modal-overlay.open .trend-modal-container {
  transform: translateY(0) scale(1);
}

.trend-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.trend-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.trend-modal-icon {
  font-size: 24px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.trend-modal-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trend-modal-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.trend-modal-subtitle {
  font-family: var(--font-main);
  font-size: 11.5px;
  color: #94a3b8;
}

.trend-modal-close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.trend-modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.trend-tabs-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.trend-tab-btn {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 20px;
  color: #cbd5e1;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.trend-tab-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #ffffff;
}

.trend-tab-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.trend-chart-box {
  position: relative;
  width: 100%;
  height: 220px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  overflow: hidden;
}

.trend-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.trend-chart-tooltip {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #38bdf8;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: var(--font-main);
  font-size: 11px;
  color: #f8fafc;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 10;
}

.trend-stats-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.trend-stat-item {
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trend-stat-label {
  font-family: var(--font-display);
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}

.trend-stat-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
}

/* ==========================================================================
   Liikumistrajektooride (Breadcrumbs / Trajectory) Stiilid
   ========================================================================== */

.trajectory-trail {
  stroke-dasharray: 6, 6;
  animation: trajectoryFlow 2s linear infinite;
}

@keyframes trajectoryFlow {
  from { stroke-dashoffset: 24; }
  to { stroke-dashoffset: 0; }
}

.hud-sub-badge.shadow-badge {
  color: #ffe4e6;
  background: rgba(76, 5, 25, 0.85);
  border-color: rgba(255, 0, 85, 0.5);
  font-weight: 700;
}

.hud-sub-badge.ru-badge {
  color: #fed7aa;
  background: rgba(67, 20, 7, 0.85);
  border-color: rgba(234, 88, 12, 0.5);
}

.hud-sub-badge.mil-badge {
  color: #fca5a5;
  background: rgba(45, 10, 10, 0.85);
  border-color: rgba(239, 68, 68, 0.5);
}

.hud-sub-badge.drone-badge {
  color: #e0f2fe;
  background: rgba(3, 40, 60, 0.85);
  border-color: rgba(0, 240, 255, 0.5);
}

.hud-sub-badge.live-road-badge {
  color: #fef3c7;
  background: rgba(69, 26, 3, 0.85);
  border-color: rgba(245, 158, 11, 0.4);
}

.hud-divider {
  width: 1px;
  height: 24px;
  background: rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .hud-dashboard {
    bottom: auto;
    top: 75px;
    left: 16px;
    transform: none;
    max-width: calc(100vw - 32px);
    overflow-x: auto;
    padding: 6px 12px;
  }
}

/* ==========================================================================
   Universaalsed Ühistranspordi Markerid (Tallinn, Harju, Tartu, Kaugliinid)
   ========================================================================== */

.transit-custom-marker {
  background: transparent !important;
  border: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: visible !important;
}

.transit-dot {
  min-width: 12px;
  height: 12px;
  border-radius: 6px;
  border: 1.5px solid #ffffff;
  color: #ffffff;
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 10px;
  font-weight: bold;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 2px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.6);
  box-sizing: border-box;
  white-space: nowrap;
  line-height: 1;
}

.transit-dot.bus { background-color: #3b82f6; }
.transit-dot.harju { background-color: #f59e0b; }
.transit-dot.tram { background-color: #10b981; }
.transit-dot.trolley { background-color: #8b5cf6; }
.transit-dot.tartu { background-color: #ef4444; }
.transit-dot.intercity { background-color: #f59e0b; }

/* ─── Ühistranspordi Liinisildid (L.circleMarker Tooltip) ─── */
.transit-label,
.leaflet-tooltip.transit-label {
  font-size: 11px !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85), 0 0 2px rgba(0, 0, 0, 0.9) !important;
  pointer-events: none !important;
}

.leaflet-tooltip.transit-label::before {
  display: none !important;
}

/* Transpordimarkerite interaktiivsus ja klõpsatavus */
.leaflet-interactive,
.bus-marker,
.transport-marker,
.transit-marker,
.vsr-transit-icon,
.transit-pill,
.gnss-div-icon,
.radiation-div-icon,
.gnss-marker-wrap,
.rad-marker-wrap,
.leaflet-marker-icon.vsr-transit-icon,
path.leaflet-interactive {
  pointer-events: auto !important;
  cursor: pointer !important;
  user-select: none;
}

.transit-pill span,
.transit-num,
.gnss-pulse-ring,
.rad-pulse-ring {
  pointer-events: none !important; /* Laseb klõpsu otse põhikonteinerile */
}

/* ==========================================================================
   Riiklikud teavitused & Küberoht (Kriis.ee & RIA / CERT-EE)
   ========================================================================== */

/* HUD Sub-badges */
.hud-sub-badge.kriis-badge {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fca5a5;
}

.hud-sub-badge.weather-badge {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.5);
  color: #fde68a;
}

.hud-sub-badge.ria-badge {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
}

.hud-card-icon-box.alerts-icon {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.hud-card.has-critical-alerts {
  border-color: rgba(239, 68, 68, 0.6) !important;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.35) !important;
  animation: hudAlertPulse 2s infinite ease-in-out;
}

@keyframes hudAlertPulse {
  0%, 100% { box-shadow: 0 0 8px rgba(239, 68, 68, 0.3); border-color: rgba(239, 68, 68, 0.5); }
  50% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.85); border-color: rgba(239, 68, 68, 0.95); }
}

/* Erakorraline ülariba (Breaking Banner) */
.breaking-alert-banner {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #ef4444;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 20px rgba(239, 68, 68, 0.4);
  border-radius: 10px;
  padding: 8px 14px;
  max-width: 90vw;
  width: 720px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: bannerSlideDown 0.4s ease-out;
}

.breaking-alert-banner.hidden {
  display: none !important;
}

@keyframes bannerSlideDown {
  from { transform: translate(-50%, -20px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.breaking-banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  font-family: var(--font-main);
}

.breaking-banner-icon {
  font-size: 18px;
  animation: alertIconBlink 1.2s infinite;
}

@keyframes alertIconBlink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

.breaking-banner-badge {
  font-size: 9.5px;
  font-weight: 800;
  background: #ef4444;
  color: #ffffff;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.breaking-banner-text {
  font-size: 12px;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.breaking-banner-link {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
}

.breaking-banner-link:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

.breaking-banner-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s;
}

.breaking-banner-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Modaalakna Alert-kaardid */
.alerts-modal-container {
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.alerts-count-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.15);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.alerts-list-container {
  overflow-y: auto;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.6);
}

.alerts-list-container::-webkit-scrollbar {
  width: 5px;
}
.alerts-list-container::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.6);
}
.alerts-list-container::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 3px;
}

.alert-item-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.alert-item-card:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateX(2px);
}

.alert-item-card.kriis {
  border-left: 3px solid #ef4444;
}

.alert-item-card.weather {
  border-left: 3px solid #f59e0b;
}

.alert-item-card.ria {
  border-left: 3px solid #38bdf8;
}

.alert-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-source-badge {
  font-family: 'Inter', sans-serif;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.alert-source-badge.badge-kriis {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
}

.alert-source-badge.badge-weather {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid #f59e0b;
  color: #fde68a;
}

.alert-source-badge.badge-ria {
  background: rgba(56, 189, 248, 0.2);
  border: 1px solid #38bdf8;
  color: #7dd3fc;
}

.alert-item-time {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: #94a3b8;
}

.alert-item-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  line-height: 1.3;
  margin: 0;
}

.alert-item-summary {
  font-family: var(--font-main);
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin: 0;
}

.alert-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.alert-item-link {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  color: #38bdf8;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.alert-item-link:hover {
  text-decoration: underline;
  color: #7dd3fc;
}

/* ==========================================================================
   Geokodeeritud Kriisi- ja Ohumarkerid Kaardil (alertsPane)
   ========================================================================== */
.vsr-alert-div-icon {
  background: none !important;
  border: none !important;
}

.vsr-alert-marker {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
  transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.vsr-alert-marker:hover {
  transform: scale(1.3);
  z-index: 1000;
}

.vsr-alert-marker.kriis {
  background: radial-gradient(circle, #ef4444 0%, #991b1b 100%);
  border: 1.5px solid #fecaca;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.95);
}

.vsr-alert-marker.weather {
  background: radial-gradient(circle, #f59e0b 0%, #b45309 100%);
  border: 1.5px solid #fef3c7;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.9);
}

.vsr-alert-pulse {
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.85);
  animation: vsrAlertPulseAnim 2.2s cubic-bezier(0.2, 0.8, 0.2, 1) infinite;
  pointer-events: none;
}

.vsr-alert-marker.weather .vsr-alert-pulse {
  border-color: rgba(245, 158, 11, 0.85);
}

@keyframes vsrAlertPulseAnim {
  0% { transform: scale(0.85); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

.vsr-alert-symbol {
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.alert-item-loc-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #7dd3fc;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.alert-item-loc-btn:hover {
  background: rgba(56, 189, 248, 0.3);
  color: #ffffff;
  border-color: #38bdf8;
}

.alerts-section-header {
  font-family: var(--font-display, sans-serif);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 14px 0 8px 0;
  padding-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.alerts-section-header.active-header {
  color: #38bdf8;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
}

.alerts-section-header.history-header {
  color: #94a3b8;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  margin-top: 20px;
}

.alert-item.history-item {
  opacity: 0.75;
  background: rgba(255, 255, 255, 0.02) !important;
  border-left-width: 2.5px !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.alert-item.history-item:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.04) !important;
}

.alerts-empty-active {
  padding: 12px 14px;
  background: rgba(56, 189, 248, 0.04);
  border: 1px dashed rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  margin-bottom: 12px;
  text-align: center;
}

/* ==========================================================================
   Multi-View Dokk-paneel (Flightradar24 stiilis kleepuvate kaartide dokk)
   ========================================================================== */

.multiview-dock {
  position: fixed;
  top: 75px;
  left: 20px; /* Parema serva asemel vasakusse serva */
  right: auto;
  width: 330px;
  max-height: calc(100vh - 160px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 6px; /* Väldib sisu peitu jäämist kerimisriba taha */
  box-sizing: border-box;
  z-index: 1000;
  pointer-events: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) rgba(15, 23, 42, 0.4);
}

.multiview-dock::-webkit-scrollbar {
  width: 4px;
}
.multiview-dock::-webkit-scrollbar-track {
  background: rgba(15, 23, 42, 0.4);
  border-radius: 4px;
}
.multiview-dock::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}

.multiview-card {
  pointer-events: auto;
  box-sizing: border-box;
  width: 100%;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  color: #f8fafc;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(56, 189, 248, 0.15);
  position: relative;
  animation: slideInLeft 0.25s ease-out;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.multiview-card:hover {
  border-color: rgba(56, 189, 248, 0.65);
}

.multiview-card.dock-card-highlight {
  border-color: #38bdf8;
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.7);
  transform: scale(1.02);
}

.multiview-card .close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 10;
}

.multiview-card .close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.1);
}

.multiview-card .dock-card-body {
  width: 100%;
}

/* Eemalda popupide ümbriste topeltmarginaalid dokis */
.multiview-card .plane-popup,
.multiview-card .ship-popup,
.multiview-card .elron-popup,
.multiview-card .transit-popup,
.multiview-card .outage-popup,
.multiview-card .tarktee-popup,
.multiview-card .sonde-popup {
  padding: 0;
  margin: 0;
}

/* Valitud sihtmärkide helendav valikuring kaardil */
.pulsing-halo {
  animation: haloPulse 2s infinite ease-in-out;
  pointer-events: none;
}

@keyframes haloPulse {
  0% {
    stroke-opacity: 0.85;
    fill-opacity: 0.18;
  }
  50% {
    stroke-opacity: 1;
    fill-opacity: 0.38;
  }
  100% {
    stroke-opacity: 0.85;
    fill-opacity: 0.18;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

/* ==========================================================================
   Stats for Nerds (Süsteemi Diagnostika & Reaalaja Logi Paneel)
   ========================================================================== */
#vsr-nerd-stats {
  position: fixed;
  top: 75px;
  left: 20px;
  width: 440px;
  max-height: 520px;
  background: rgba(10, 15, 29, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7);
  z-index: 99999 !important; /* Peab olema üle kõigi kihtide */
  display: none; /* Vaikimisi peidus */
  flex-direction: column;
  overflow: hidden;
}

#vsr-nerd-stats.visible {
  display: flex !important;
}

/* ==========================================================================
   Lennusõnumite (ACARS/VDL2) Paneeli Positsioneerimine ja Kujundus
   ========================================================================== */
#acars-panel, .acars-box, .acars-widget {
  position: fixed !important;
  bottom: 68px !important; /* Istub sujuvalt ja loomulikult alumise HUD-riba kohal */
  right: 20px !important;
  max-height: 280px !important;
  width: 320px !important;
  z-index: 1000 !important;
  background: rgba(15, 23, 42, 0.92) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  border-radius: 10px !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.65) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  transition: all 0.3s ease !important;
}

.acars-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  background: rgba(30, 41, 59, 0.75) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  user-select: none !important;
}

.acars-title-box {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.acars-sdr-icon {
  flex-shrink: 0 !important;
}

.acars-title-text-group {
  display: flex !important;
  flex-direction: column !important;
  line-height: 1.15 !important;
}

.acars-main-title {
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  font-size: 13px !important;
  color: #f8fafc !important;
}

.acars-sub-title {
  font-family: monospace !important;
  font-size: 10px !important;
  color: #38bdf8 !important;
  letter-spacing: 0.5px !important;
}

.acars-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.acars-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  height: 20px !important;
  padding: 0 8px !important;
  border-radius: 10px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  background: rgba(56, 189, 248, 0.15) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  box-sizing: border-box !important;
  white-space: nowrap !important;
}

.acars-toggle-btn {
  background: none !important;
  border: none !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  cursor: pointer !important;
  padding: 2px !important;
  transition: transform 0.2s ease !important;
}

.acars-widget.collapsed {
  max-height: 42px !important;
}

.acars-widget.collapsed .acars-body {
  display: none !important;
}

.acars-widget.collapsed .acars-toggle-btn {
  transform: rotate(-90deg) !important;
}

.nerd-stats-header {
  cursor: move;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(30, 41, 59, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

.nerd-stats-title {
  font-family: 'Outfit', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #38bdf8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nerd-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nerd-btn-small {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nerd-btn-small:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.nerd-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 15px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.nerd-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.nerd-stats-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nerd-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.nerd-metric-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.nerd-metric-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.nerd-metric-val-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.nerd-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px #22c55e;
  display: inline-block;
  align-self: center;
}

.nerd-metric-num {
  font-family: 'Outfit', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: #f8fafc;
}

.nerd-unit {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
}

.nerd-sub-counts {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: #38bdf8;
  padding-top: 2px;
  white-space: nowrap;
}

.nerd-benchmark-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px dashed rgba(56, 189, 248, 0.3);
  border-radius: 8px;
  padding: 8px 10px;
}

.nerd-bench-action-btn {
  width: 100%;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(14, 165, 233, 0.12));
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nerd-bench-action-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.nerd-bench-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.nerd-bench-results {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 11.5px;
  color: #f8fafc;
}

.nerd-terminal-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nerd-terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.nerd-term-status {
  font-size: 10px;
  color: #22c55e;
  font-weight: 700;
}

.nerd-terminal-console {
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  height: 160px;
  overflow-y: auto;
  padding: 8px 10px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 11px;
  line-height: 1.45;
  color: #4ade80;
  user-select: text;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.nerd-log-line {
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 3px;
  font-size: 10.5px;
}

.nerd-log-line.warn {
  color: #facc15;
}

.nerd-log-line.error {
  color: #f87171;
}

.nerd-log-line.info {
  color: #4ade80;
}

.nerd-log-time {
  color: #64748b;
  margin-right: 4px;
}

/* ==========================================================================
   ESTPOS GNSS Graafikute ja Infokaardi Stiilid
   ========================================================================== */
.gnss-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(15, 23, 42, 0.96) !important;
  border: 1px solid rgba(56, 189, 248, 0.4) !important;
  border-radius: 12px !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  padding: 0 !important;
  color: #f8fafc !important;
  max-width: 340px !important;
}

.gnss-popup-content {
  padding: 10px 12px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  max-width: 320px !important;
  box-sizing: border-box !important;
}

.gnss-graph-wrapper {
  width: 100% !important;
  height: 135px !important; /* Täpne kõrgus ühele graafikule (teljed ja legend loetavad) */
  overflow: hidden !important;
  border-radius: 6px !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  background: #0b1120 !important;
  margin-bottom: 6px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}

.gnss-iframe-graph, .gnss-graph-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border: none !important;
  display: block !important;
}

/* ─── Kaardi De-clutter (Peida tekstisildid kaugele välja suumides) ─── */
.map-zoom-low .energy-name-badge,
.map-zoom-low .gnss-code-badge,
.map-zoom-low .rad-val-badge {
  display: none !important;
}

.map-zoom-low .energy-icon-box,
.map-zoom-low .gnss-icon-box,
.map-zoom-low .rad-icon-box {
  width: 22px !important;
  height: 22px !important;
  font-size: 11px !important;
}

.map-zoom-low .energy-pulse-ring,
.map-zoom-low .gnss-pulse-ring,
.map-zoom-low .rad-pulse-ring {
  width: 22px !important;
  height: 22px !important;
}

/* ─── Energy Node Marker Styles ─── */
.energy-node-icon {
  background: transparent !important;
  border: none !important;
}
.energy-marker-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
}
.energy-badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(11, 17, 32, 0.95);
  border: 1.5px solid #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.energy-marker-wrap:hover .energy-badge {
  transform: scale(1.2);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.9);
}
.energy-label {
  margin-top: 2px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10px;
  font-weight: 700;
  background: rgba(10, 15, 29, 0.92);
  color: #38bdf8;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}
.map-zoom-low .energy-label {
  display: none !important;
}

/* ─── Kaamera Tooltip ja Pisipildi Hover Stiilid ─── */
.vsr-camera-tooltip {
  background: rgba(11, 17, 32, 0.96) !important;
  border: 1px solid rgba(6, 182, 212, 0.4) !important;
  border-radius: 6px !important;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75) !important;
  color: #f8fafc !important;
  padding: 6px !important;
}
.vsr-camera-tooltip::before {
  border-top-color: rgba(6, 182, 212, 0.4) !important;
}

