/* ==========================================================================
   public/css/icao.css
   Paragliding Pro - Interactive ICAO Aeronautical Chart & Flight Computer
   ========================================================================== */

:root {
  --icao-bg: #0b1120;
  --icao-surface: #131d33;
  --icao-surface-2: #1a2744;
  --icao-border: rgba(255, 255, 255, 0.12);
  --icao-border-focus: #38bdf8;
  --icao-text: #f1f5f9;
  --icao-text-muted: #94a3b8;
  --icao-primary: #0284c7;
  --icao-primary-light: #38bdf8;
  --icao-accent-gold: #f59e0b;
  --icao-accent-green: #10b981;
  --icao-accent-red: #ef4444;
  --icao-accent-cyan: #06b6d4;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.7);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--icao-bg);
  color: var(--icao-text);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.4;
}

/* ── App Shell ─────────────────────────────────────────────────────────── */
#app-container {
  display: flex;
  flex-direction: column;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* ── Top Flight Navigation Bar ─────────────────────────────────────────── */
#top-bar {
  height: 52px;
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--icao-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
  flex-shrink: 0;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.3), rgba(56, 189, 248, 0.1));
  border: 1px solid var(--icao-primary-light);
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.brand-title {
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--icao-primary-light);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Center HUD summary */
.flight-hud {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--icao-surface);
  border: 1px solid var(--icao-border);
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 11px;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.hud-label {
  color: var(--icao-text-muted);
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 700;
}

.hud-val {
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
}

.hud-val.gold { color: var(--icao-accent-gold); }
.hud-val.green { color: var(--icao-accent-green); }
.hud-val.cyan { color: var(--icao-accent-cyan); }

/* Right action buttons */
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--icao-surface);
  border: 1px solid var(--icao-border);
  color: var(--icao-text);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-tool:hover {
  background: var(--icao-surface-2);
  border-color: var(--icao-primary-light);
  color: #fff;
}

.btn-tool.active {
  background: rgba(2, 132, 199, 0.25);
  border-color: var(--icao-primary-light);
  color: var(--icao-primary-light);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.btn-unit-toggle {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(245, 158, 11, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--icao-accent-gold);
  font-weight: 700;
}

.btn-unit-toggle:hover {
  border-color: var(--icao-accent-gold);
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}

.btn-back-to-practice {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}

.btn-back-to-practice:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8) !important;
  border-color: #7dd3fc !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.6) !important;
  transform: translateY(-1px);
}

.fab-return-practice {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  border: 1px solid #38bdf8 !important;
  color: #ffffff !important;
  font-size: 16px !important;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.5) !important;
}

/* ── Main Viewport Area ────────────────────────────────────────────────── */
#viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#icao-map {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: #090e1a;
  z-index: 1;
}

#icao-map-3d {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  background: #090e1a;
  z-index: 2;
}

#btn-toggle-3d.active, #fab-3d.active {
  background: #0284c7 !important;
  color: #fff !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5);
}

.btn-primary-tool {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.5) !important;
  font-weight: 800;
}
.btn-primary-tool:hover {
  background: #38bdf8 !important;
  color: #0b1120 !important;
}

.map-fab.fab-highlight {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  border-color: #38bdf8 !important;
  color: #fff !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6) !important;
}
.map-fab.fab-highlight:hover {
  background: #38bdf8 !important;
  color: #0b1120 !important;
}

/* ── Floating Tool Drawer / Sidebar ───────────────────────────────────── */
#tool-drawer {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 440px;
  max-width: calc(100vw - 28px);
  max-height: calc(100% - 28px);
  background: rgba(19, 29, 51, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--icao-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, width 0.2s ease;
}

#tool-drawer.expanded {
  width: 580px;
}

#tool-drawer.hidden {
  transform: translateX(480px);
  opacity: 0;
  pointer-events: none;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  gap: 6px;
  border-bottom: 1px solid var(--icao-border);
  background: rgba(11, 17, 32, 0.5);
  border-radius: var(--radius) var(--radius) 0 0;
}

.drawer-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--icao-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-icon {
  font-size: 12px;
  flex-shrink: 0;
}

.tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
}

.tab-btn.active {
  background: var(--icao-surface-2);
  color: var(--icao-primary-light);
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.drawer-size-toggle {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  user-select: none;
}
.drawer-size-toggle:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #38bdf8;
}

.drawer-close {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  user-select: none;
}
.drawer-close:hover {
  background: #ef4444;
  color: #fff;
}

.drawer-body {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  position: relative;
}

.tool-panel {
  display: none;
}
.tool-panel.active {
  display: block;
}

/* ── Panel Sub-Navigation & Jump Anchors ──────────────────────────────── */
.panel-quick-nav {
  position: sticky;
  top: -16px;
  z-index: 20;
  background: rgba(19, 29, 51, 0.96);
  backdrop-filter: blur(12px);
  margin: -16px -16px 14px -16px;
  padding: 8px 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--icao-border);
}
.panel-quick-nav::-webkit-scrollbar {
  display: none;
}

.sub-nav-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--icao-text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.sub-nav-chip:hover, .sub-nav-chip.active {
  background: rgba(56, 189, 248, 0.22);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.6);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Scroll clearance for anchor jumps */
#sec-outcome, #sec-height, #sec-airspace, #sec-glider, #sec-wind, #sec-pilot {
  scroll-margin-top: 50px;
}

/* ── Floating Reopen Pill on Map ─────────────────────────────────────── */
.floating-drawer-pill {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom, 15px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 1002;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: 2px solid #38bdf8;
  border-radius: 999px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 800;
  display: none;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.6), 0 0 16px rgba(56, 189, 248, 0.4);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: pulse-open-pill 2.2s infinite ease-in-out;
}

@keyframes pulse-open-pill {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.6), 0 0 16px rgba(56, 189, 248, 0.4);
    transform: translateX(-50%) scale(1);
  }
  50% {
    box-shadow: 0 10px 32px rgba(2, 132, 199, 0.9), 0 0 24px rgba(56, 189, 248, 0.7);
    transform: translateX(-50%) scale(1.04);
  }
}

.floating-drawer-pill:hover, .floating-drawer-pill:active {
  transform: translateX(-50%) scale(1.08);
  background: linear-gradient(135deg, #0369a1, #0284c7);
  box-shadow: 0 10px 32px rgba(56, 189, 248, 0.85);
}

/* Pure CSS selector when drawer is hidden */
#tool-drawer.hidden ~ #floating-open-drawer {
  display: flex !important;
}

/* ── Panel Components ──────────────────────────────────────────────────── */
.form-section-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--icao-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctrl-card {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--icao-border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 12px;
}

.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.ctrl-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--icao-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-value {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--icao-primary-light);
}

/* Sliders */
input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--icao-surface-2);
  outline: none;
  cursor: pointer;
  accent-color: var(--icao-primary-light);
  margin: 6px 0 10px 0;
}

/* Number inputs */
.num-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.num-input {
  width: 80px;
  background: var(--icao-surface-2);
  border: 1px solid var(--icao-border);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  text-align: right;
  outline: none;
}
.num-input:focus { border-color: var(--icao-primary-light); }

.unit-label {
  font-size: 11px;
  color: var(--icao-text-muted);
  font-weight: 600;
}

/* Preset buttons */
.preset-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--icao-border);
  color: var(--icao-text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.preset-chip:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--icao-primary-light);
  color: var(--icao-primary-light);
}
.preset-chip.active {
  background: var(--icao-primary);
  border-color: var(--icao-primary-light);
  color: #fff;
}

/* ── Result Outcome Box ────────────────────────────────────────────────── */
.outcome-box {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.15), rgba(16, 185, 129, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: inset 0 0 20px rgba(2, 132, 199, 0.08);
}

.outcome-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.outcome-cell {
  background: rgba(11, 17, 32, 0.6);
  border: 1px solid var(--icao-border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}

.outcome-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--icao-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.outcome-val {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 2px;
}

.outcome-val.gold { color: var(--icao-accent-gold); }
.outcome-val.green { color: var(--icao-accent-green); }
.outcome-val.cyan { color: var(--icao-accent-cyan); }
.outcome-val.red { color: var(--icao-accent-red); }

.outcome-sub {
  font-size: 10px;
  color: var(--icao-text-muted);
  margin-top: 2px;
}

/* ── Vector Diagram Canvas ─────────────────────────────────────────────── */
.vector-canvas-wrap {
  width: 100%;
  height: 180px;
  background: rgba(11, 17, 32, 0.8);
  border: 1px solid var(--icao-border);
  border-radius: var(--radius-sm);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}

/* ── Bottom Floating HUD (Coordinates & Ruler) ────────────────────────── */
#bottom-hud {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid var(--icao-border);
  border-radius: 999px;
  padding: 6px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow);
  z-index: 1000;
  font-size: 12px;
  max-width: calc(100vw - 32px);
  white-space: nowrap;
}

.crosshair-coord-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.crosshair-badge {
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--icao-primary-light);
}

/* Quick Tools floating FAB on map */
#map-fab-bar {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
}

.map-fab {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(19, 29, 51, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid var(--icao-border);
  color: #fff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: all 0.15s ease;
}
.map-fab:hover {
  background: var(--icao-surface-2);
  border-color: var(--icao-primary-light);
  color: var(--icao-primary-light);
  transform: scale(1.05);
}

/* Layer Opacity slider popup */
#opacity-control-popup {
  position: absolute;
  bottom: 20px;
  left: 68px;
  background: rgba(11, 18, 33, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  width: 320px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 130px);
  overflow-y: auto;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  z-index: 1005;
  display: none;
  animation: popup-fade-in 0.2s ease;
}
#opacity-control-popup.show { display: block; }

@keyframes popup-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.layer-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.layer-popup-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 13px;
  color: #fff;
  letter-spacing: 0.3px;
}
.layer-popup-icon {
  font-size: 16px;
}
.layer-popup-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--icao-text-muted);
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.15s ease;
}
.layer-popup-close:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
}

.layer-presets-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.layer-preset-btn {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: var(--icao-text-dim);
  padding: 6px 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-preset-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--icao-primary);
  color: #fff;
}
.layer-preset-btn.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--icao-primary);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

.layer-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.layer-item-row {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  padding: 8px 10px;
  transition: border-color 0.15s ease;
}
.layer-item-row:hover {
  border-color: rgba(56, 189, 248, 0.4);
}
.layer-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.layer-vis-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 13px;
  padding: 2px 4px;
  opacity: 0.35;
  transition: opacity 0.15s ease, transform 0.1s ease;
}
.layer-vis-btn.active {
  opacity: 1;
}
.layer-vis-btn:active {
  transform: scale(0.9);
}
.layer-label {
  flex: 1;
  font-size: 11.5px;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.layer-pct-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  min-width: 40px;
  text-align: right;
}
.layer-slider-wrapper {
  display: flex;
  align-items: center;
}
.layer-opacity-slider {
  width: 100%;
  accent-color: var(--icao-primary);
  height: 6px;
  cursor: pointer;
}
.layer-popup-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 10px;
  color: var(--icao-text-muted);
  line-height: 1.35;
}

/* ── Custom Leaflet Overlays & High-Contrast Markers ────────────────────── */

/* Pulsing radar waves */
@keyframes radar-pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.9), 0 0 10px rgba(16, 185, 129, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(16, 185, 129, 0), 0 0 22px rgba(16, 185, 129, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0), 0 0 10px rgba(16, 185, 129, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
}

@keyframes radar-pulse-pink {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 0, 102, 0.9), 0 0 12px rgba(255, 0, 102, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  70% {
    box-shadow: 0 0 0 20px rgba(255, 0, 102, 0), 0 0 24px rgba(255, 0, 102, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 0, 102, 0), 0 0 12px rgba(255, 0, 102, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
}

@keyframes radar-pulse-gold {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.9), 0 0 12px rgba(245, 158, 11, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  70% {
    box-shadow: 0 0 0 22px rgba(245, 158, 11, 0), 0 0 25px rgba(245, 158, 11, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0), 0 0 12px rgba(245, 158, 11, 0.9), 0 4px 12px rgba(0,0,0,0.8);
  }
}

@keyframes dash-flow {
  to {
    stroke-dashoffset: -32;
  }
}

.pulsing-ruler-line path {
  animation: dash-flow 1.4s linear infinite;
}

.pilot-icon-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: rgba(11, 17, 32, 0.92);
  border: 3px solid #f59e0b;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.8), 0 4px 14px rgba(0, 0, 0, 0.8);
  cursor: move;
  transition: transform 0.1s ease;
  position: relative;
}

.pilot-icon-marker.pulse-active {
  animation: radar-pulse-gold 2.2s infinite ease-in-out;
}

.pilot-icon-marker:active {
  transform: scale(1.18);
}

/* Ruler Pin Markers (A: Green, B: Magenta) */
.ruler-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  cursor: move;
  position: relative;
  border: 3px solid #000;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85);
  transition: transform 0.15s ease;
  user-select: none;
}

.ruler-pin::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.ruler-pin:active {
  transform: scale(1.2);
}

.ruler-pin.pin-a {
  background: #10b981; /* High-vis Neon Emerald Green */
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.ruler-pin.pin-a.pulse-active {
  animation: radar-pulse-green 1.8s infinite ease-in-out;
}

.ruler-pin.pin-b {
  background: #ff0066; /* High-vis Vivid Neon Magenta / Pink */
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.ruler-pin.pin-b.pulse-active {
  animation: radar-pulse-pink 1.8s infinite ease-in-out;
}

/* Ruler Line Midpoint Tooltip */
.ruler-line-tooltip {
  background: rgba(0, 0, 0, 0.92) !important;
  color: #fff !important;
  border: 2px solid #ff0066 !important;
  box-shadow: 0 0 16px rgba(255, 0, 102, 0.8), 0 4px 10px rgba(0, 0, 0, 0.8) !important;
  border-radius: 6px !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  padding: 5px 12px !important;
  white-space: nowrap !important;
}

/* Graticule Crosshair Handle & Intersection Markers */
.crosshair-target-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: rgba(11, 17, 32, 0.9);
  border: 2.5px solid #ffe600;
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(255, 230, 0, 0.8), 0 3px 10px rgba(0, 0, 0, 0.8);
  font-size: 16px;
  cursor: move;
  transition: transform 0.1s ease;
}
.crosshair-target-badge:active {
  transform: scale(1.2);
}

.wire-handle-lat, .wire-handle-lng, .wire-handle-lat-badge, .wire-handle-lng-badge {
  background: rgba(11, 17, 32, 0.95);
  color: #ffe600;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: center;
  border-radius: 6px;
  border: 2px solid #ffe600;
  box-shadow: 0 0 14px rgba(255, 230, 0, 0.7), 0 3px 10px rgba(0, 0, 0, 0.8);
  padding: 3px 10px;
  user-select: none;
  white-space: nowrap;
  transition: transform 0.1s ease;
}

.wire-handle-lat, .wire-handle-lat-badge,
.wire-line-lat, .wire-casing-lat, .wire-hit-lat {
  cursor: ns-resize !important;
}

.wire-handle-lng, .wire-handle-lng-badge,
.wire-line-lng, .wire-casing-lng, .wire-hit-lng {
  cursor: ew-resize !important;
}

.wire-handle-lat:active, .wire-handle-lat-badge:active,
.wire-handle-lng:active, .wire-handle-lng-badge:active {
  transform: scale(1.18);
  background: #ffe600;
  color: #000;
}

/* ── Quick Side Altitude Slider (Instellen zonder menu te openen) ────── */
#side-height-control {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  border-radius: 26px;
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 16px rgba(56, 189, 248, 0.3);
  user-select: none;
  touch-action: pan-x;
  width: 58px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.side-height-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.side-height-icon {
  font-size: 16px;
}

.side-height-badge {
  background: rgba(2, 132, 199, 0.25);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 5px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  line-height: 1.1;
  transition: all 0.15s ease;
}
.side-height-badge:hover {
  background: rgba(56, 189, 248, 0.35);
  border-color: #38bdf8;
  color: #fff;
}

.side-mode-tag {
  font-size: 9px;
  font-weight: 900;
  color: #fbbf24;
  text-transform: uppercase;
}

.side-step-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.side-step-btn:hover, .side-step-btn:active {
  background: rgba(56, 189, 248, 0.3);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: scale(1.1);
}

.side-slider-wrapper {
  height: 170px;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Vertical slider: cross-browser */
#side-range-height {
  -webkit-appearance: slider-vertical;
  appearance: slider-vertical;
  writing-mode: vertical-lr;
  direction: rtl;
  width: 28px;
  height: 160px;
  cursor: ns-resize;
  accent-color: #0284c7;
}

.side-preset-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.side-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--icao-text-muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.side-chip:hover, .side-chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
}

/* ── Vector Drag Handles on Map ───────────────────────────────────────── */
.vector-drag-handle {
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: grab;
  user-select: none;
  touch-action: none;
  transition: transform 0.1s ease;
  white-space: nowrap;
}
.vector-drag-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.15);
}

.handle-blue {
  background: rgba(11, 17, 32, 0.95);
  color: #00e5ff;
  border: 2px solid #00e5ff;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.75), 0 3px 10px rgba(0, 0, 0, 0.9);
}
.handle-blue .handle-icon {
  font-size: 13px;
}

.handle-green {
  background: rgba(11, 17, 32, 0.95);
  color: #10b981;
  border: 2px solid #10b981;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.75), 0 3px 10px rgba(0, 0, 0, 0.9);
}
.handle-green .handle-icon {
  font-size: 13px;
}

.handle-yellow {
  background: rgba(11, 17, 32, 0.95);
  color: #ffea00;
  border: 2px solid #ffea00;
  border-radius: 999px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 900;
  box-shadow: 0 0 16px rgba(255, 234, 0, 0.75), 0 3px 10px rgba(0, 0, 0, 0.9);
}
.handle-yellow .handle-icon {
  font-size: 13px;
}

/* ── Badges in the Legs (in de benen koers & snelheid) ─────────────────── */
.leg-badge-container {
  pointer-events: none !important;
}

.leg-badge {
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  user-select: none;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.85);
  line-height: 1.2;
}

.leg-badge.badge-blue {
  color: #00e5ff;
  border: 1.5px solid #00e5ff;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.45), 0 3px 8px rgba(0, 0, 0, 0.85);
}

.leg-badge.badge-green {
  color: #34d399;
  border: 1.5px solid #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.45), 0 3px 8px rgba(0, 0, 0, 0.85);
}

.leg-badge.badge-yellow {
  color: #facc15;
  border: 1.5px solid #eab308;
  box-shadow: 0 0 12px rgba(234, 179, 8, 0.55), 0 3px 8px rgba(0, 0, 0, 0.85);
}

.leg-badge.badge-drift {
  color: #fb923c;
  border: 1.5px dashed #f97316;
  font-size: 10px;
}

/* Responsive Breakpoints for Mobile */
@media (max-width: 768px) {
  #top-bar {
    padding: 0 8px;
    height: 48px;
  }
  .brand-logo {
    width: 30px;
    height: 30px;
    font-size: 16px;
  }
  .brand-title {
    font-size: 13px;
  }
  .brand-tag {
    display: none;
  }
  .flight-hud {
    display: none;
  }
  .top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .top-actions::-webkit-scrollbar {
    display: none;
  }
  .btn-tool {
    padding: 5px 8px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .btn-unit-toggle {
    display: none;
  }

  /* Drawer Responsive Bottom Sheet */
  #tool-drawer {
    width: 100vw;
    max-width: 100vw;
    top: auto;
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    border-top: 2px solid rgba(56, 189, 248, 0.4);
    height: 62dvh;
    max-height: 62dvh;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.75);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.25s ease;
  }
  #tool-drawer.expanded {
    height: 93dvh;
    max-height: 93dvh;
  }
  #tool-drawer.hidden {
    transform: translateY(105%);
    pointer-events: none;
    opacity: 0;
  }

  /* Responsive Tab Titles */
  .tab-txt-full {
    display: none !important;
  }
  .tab-txt-short {
    display: inline !important;
  }
  .tab-btn {
    padding: 5px 7px;
    font-size: 11px;
  }

  /* Scrollable body with safe-area padding so last items aren't obscured */
  .drawer-body {
    padding: 12px 14px calc(95px + env(safe-area-inset-bottom, 25px)) 14px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  /* Slider & card touch-action optimization: allows vertical swipe to scroll cleanly */
  input[type="range"] {
    touch-action: pan-x;
  }
  .ctrl-card, .outcome-box, .drawer-body {
    touch-action: pan-y;
  }

  /* Bottom HUD hidden on small screens */
  #bottom-hud {
    display: none;
  }

  /* Floating open drawer pill on mobile */
  .floating-drawer-pill {
    bottom: calc(20px + env(safe-area-inset-bottom, 12px));
    padding: 11px 18px;
    font-size: 13px;
  }

  #map-fab-bar {
    bottom: calc(26px + env(safe-area-inset-bottom, 16px));
    left: calc(16px + env(safe-area-inset-left, 0px));
    gap: 7px;
  }

  /* Layer Opacity slider popup on Mobile */
  #opacity-control-popup {
    left: max(16px, env(safe-area-inset-left, 16px));
    right: max(16px, env(safe-area-inset-right, 16px));
    margin: 0 auto;
    width: auto;
    max-width: 360px;
    bottom: calc(76px + env(safe-area-inset-bottom, 16px));
    max-height: calc(100dvh - 145px - env(safe-area-inset-bottom, 16px));
    border-radius: 18px;
    padding: 15px 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(56, 189, 248, 0.35);
  }

  .layer-popup-close {
    width: 32px;
    height: 32px;
    font-size: 14px;
    border-radius: 8px;
  }

  .layer-opacity-slider {
    height: 8px;
    touch-action: pan-x;
  }

  /* Quick Side Altitude Slider on Mobile */
  #side-height-control {
    right: 8px;
    width: 48px;
    padding: 8px 4px;
    gap: 6px;
    border-radius: 20px;
    top: 40%;
  }
  .side-slider-wrapper {
    height: 130px;
  }
  #side-range-height {
    height: 120px;
    width: 24px;
  }
  .side-step-btn {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .side-height-badge {
    font-size: 10px;
    padding: 2px 4px;
  }
  .side-chip {
    font-size: 8.5px;
    padding: 2px 2px;
  }
}

/* ── 3D Airspace Blocks & Popups ───────────────────────────────────────── */
.airspace-3d-popup .maplibregl-popup-content {
  background: rgba(11, 17, 32, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 20px rgba(2, 132, 199, 0.25);
  color: #f8fafc;
}

.airspace-3d-popup .maplibregl-popup-close-button {
  color: #94a3b8;
  font-size: 16px;
  padding: 4px 8px;
  top: 4px;
  right: 4px;
}
.airspace-3d-popup .maplibregl-popup-close-button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.airspace-3d-popup .maplibregl-popup-tip {
  border-top-color: rgba(11, 17, 32, 0.94);
}

.airspace-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.asp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.asp-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
}
.asp-chip.active {
  background: rgba(2, 132, 199, 0.25);
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.asp-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.airspace-legend-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  font-size: 11px;
  color: #94a3b8;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.asp-leg-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  line-height: 1.2;
}

/* ── Unified Filter Strip & Central Filters Panel ──────────────────────── */
.quick-filter-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  padding: 7px 10px;
  background: rgba(9, 14, 26, 0.88);
  border-bottom: 1px solid var(--icao-border);
  flex-shrink: 0;
}

.qf-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--icao-text-muted);
  white-space: nowrap;
  margin-right: 2px;
}

.qf-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--icao-text-muted);
  font-size: 10.5px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  flex-shrink: 0;
}
.qf-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.qf-pill .qf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #475569;
  transition: all 0.15s ease;
}
.qf-pill.active {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.55);
  color: #f8fafc;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}
.qf-pill.active .qf-dot {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--icao-primary-light);
  margin-bottom: 8px;
}

.filter-mini-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--icao-text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-mini-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  color: #fff;
}

.filter-card-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(11, 17, 32, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 10px 12px;
  transition: all 0.15s ease;
}
.filter-toggle-row:hover {
  border-color: rgba(56, 189, 248, 0.35);
}
.filter-toggle-row.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(2, 132, 199, 0.08));
  border-color: rgba(16, 185, 129, 0.4);
}

.filter-row-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.filter-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.filter-row-text {
  min-width: 0;
  flex: 1;
}
.filter-row-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.25;
}
.filter-row-sub {
  font-size: 10.5px;
  color: var(--icao-text-muted);
  line-height: 1.3;
  margin-top: 2px;
}

.filter-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.filter-cfg-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.filter-cfg-btn:hover {
  background: #0284c7;
  color: #fff;
  border-color: #38bdf8;
}

.filter-sub-box {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Modern iOS/Flight Toggle Switch */
.ui-switch {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #334155;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  padding: 2px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.ui-switch-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.ui-switch.on, .ui-switch.active {
  background: #10b981;
  border-color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
}
.ui-switch.on .ui-switch-thumb, .ui-switch.active .ui-switch-thumb {
  transform: translateX(18px);
  background: #ffffff;
}

/* Top Banner in Individual Tool Panels */
.panel-visibility-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(2, 132, 199, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.panel-visibility-banner.off {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(255, 255, 255, 0.12);
}
.pvb-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
}
.pvb-sub {
  font-size: 10.5px;
  color: var(--icao-text-muted);
}

/* ── Paraglider "Waar mag ik vliegen" Filter Box in 3D Luchtruim ───────── */
.paraglider-fly-filter-box {
  margin-top: 9px;
  padding: 9px 10px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}
.paraglider-fly-filter-box.active {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22), rgba(2, 132, 199, 0.15));
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}
.pff-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.pff-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.pff-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.pff-title {
  font-size: 12px;
  font-weight: 800;
  color: #34d399;
}
.pff-sub {
  font-size: 10px;
  color: #cbd5e1;
  line-height: 1.25;
  margin-top: 1px;
}
.pff-legend {
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(16, 185, 129, 0.35);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 10.5px;
  color: #e2e8f0;
}
.pff-leg-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
  opacity: 0.72;
}
.pff-leg-item:hover {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(56, 189, 248, 0.45);
  opacity: 0.95;
}
.pff-leg-item.active {
  background: rgba(15, 23, 42, 0.92);
  border-color: rgba(16, 185, 129, 0.65);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.18);
  opacity: 1;
}
.pff-leg-txt {
  flex: 1;
  min-width: 0;
  line-height: 1.25;
}
.pff-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pff-check {
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.pff-leg-item.active .pff-check {
  opacity: 1;
  transform: scale(1);
}
.ui-switch.ui-switch-sm {
  width: 32px;
  height: 18px;
  padding: 2px;
}
.ui-switch.ui-switch-sm .ui-switch-thumb {
  width: 12px;
  height: 12px;
}
.ui-switch.ui-switch-sm.on .ui-switch-thumb,
.ui-switch.ui-switch-sm.active .ui-switch-thumb {
  transform: translateX(14px);
}

/* ── Coordinate Airspace Stack (Opbouw Luchtruim voor Paraglider) ──────── */
.coord-asp-card {
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(11, 17, 32, 0.95));
  padding: 12px;
}
.coord-asp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.coord-asp-title {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}
.coord-asp-sub {
  font-size: 10.5px;
  font-family: var(--font-mono);
  color: #38bdf8;
  margin-top: 2px;
  font-weight: 700;
}
.coord-asp-verdict {
  border-radius: 8px;
  padding: 10px 11px;
  margin-bottom: 10px;
  font-size: 11.5px;
  line-height: 1.35;
}
.coord-asp-verdict.verdict-green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.55);
  color: #ecfdf5;
}
.coord-asp-verdict.verdict-yellow {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.55);
  color: #fffbeb;
}
.coord-asp-verdict.verdict-red {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.6);
  color: #fef2f2;
}
.coord-asp-stack-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--icao-text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.coord-asp-stack-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.asp-stack-item {
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(19, 29, 51, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left-width: 4px;
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.asp-stack-item:hover {
  border-color: rgba(56, 189, 248, 0.5);
}
.asp-stack-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}
.asp-stack-name {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 5px;
}
.asp-badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.asp-class-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}
.asp-alt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(9, 14, 26, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
}
.asp-alt-col-lbl {
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.4px;
}
.asp-alt-ft {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 800;
  color: #38bdf8;
  margin-top: 1px;
}
.asp-alt-m {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #fbbf24;
}
.asp-rule-txt {
  margin-top: 6px;
  font-size: 10.5px;
  line-height: 1.3;
  color: #cbd5e1;
}
