/* ============================================================
   Wingman VFR — Design System v2
   Light (default) + Dark theme
   ============================================================ */

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

.hidden { display: none !important; }
.icon { display: inline-block; vertical-align: middle; flex-shrink: 0; }
.icon svg { display: block; }

/* ── Light theme (default) ──────────────────────────────── */
:root {
  --bg:          #eef2f8;
  --sidebar-bg:  #ffffff;
  --surface:     #ffffff;
  --surface-2:   #f3f7fc;
  --surface-3:   #e6eef8;
  --border:      rgba(15,40,100,0.09);
  --border-s:    rgba(15,40,100,0.055);
  --shadow:      0 1px 3px rgba(15,40,100,0.07), 0 1px 2px rgba(15,40,100,0.04);
  --shadow-md:   0 4px 12px rgba(15,40,100,0.09), 0 2px 4px rgba(15,40,100,0.05);
  --shadow-lg:   0 8px 28px rgba(15,40,100,0.13), 0 2px 8px rgba(15,40,100,0.07);

  --text:        #0d1829;
  --text-muted:  #4a607c;
  --text-dim:    #96adc4;

  --brand:       #2563eb;
  --brand-light: #3b82f6;
  --accent-dim:  rgba(37,99,235,0.10);
  --accent-glow: rgba(37,99,235,0.20);
  --cyan:        #0284c7;
  --cyan-dim:    rgba(2,132,199,0.10);

  --vfr:  #16a34a; --vfr-dim:  rgba(22,163,74,0.12);
  --mvfr: #2563eb; --mvfr-dim: rgba(37,99,235,0.12);
  --ifr:  #dc2626; --ifr-dim:  rgba(220,38,38,0.12);
  --lifr: #9333ea; --lifr-dim: rgba(147,51,234,0.12);

  --sidebar-w:    330px;
  --header-h:     50px;
  --route-bar-h:  0px;
  --radius:       8px;
  --detail-panel-w: 380px;

  /* ── bp-panel / balance tokens (light) ── */
  --bp-bg:       #eef2f8;
  --bp-s1:       #ffffff;
  --bp-s2:       #f3f7fc;
  --bp-s3:       #e8eef8;
  --bp-bdr:      rgba(15,40,100,0.10);
  --bp-bdr-hi:   rgba(15,40,100,0.20);
  --bp-txt:      #0d1829;
  --bp-txt2:     #3a5888;
  --bp-muted:    #7090b8;
  --bp-cyan:     #0060a0;
  --bp-tot:      #0d1829;
  --bp-tabs-bg:  rgba(238,242,248,0.92);
  --bp-acc-rgb:  26,96,216;
  --bp-perf-num: #0d1829;
  --bp-hi-line:  rgba(26,96,216,0.12);
}

/* ── Dark theme ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:          #080d18;
  --sidebar-bg:  #0c1120;
  --surface:     #111c2d;
  --surface-2:   #172438;
  --surface-3:   #1e2f46;
  --border:      rgba(148,180,240,0.10);
  --border-s:    rgba(148,180,240,0.06);
  --shadow:      0 1px 4px rgba(0,0,0,0.30);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.40);
  --shadow-lg:   0 8px 32px rgba(0,0,0,0.55);

  --text:        #dde6f5;
  --text-muted:  #8ea6c4;
  --text-dim:    #4a627e;

  --brand:       #3d7eff;
  --brand-light: #5a92ff;
  --accent-dim:  rgba(61,126,255,0.14);
  --accent-glow: rgba(61,126,255,0.28);
  --cyan:        #0ea5e9;
  --cyan-dim:    rgba(14,165,233,0.14);

  --vfr:  #22c55e; --vfr-dim:  rgba(34,197,94,0.15);
  --mvfr: #3b82f6; --mvfr-dim: rgba(59,130,246,0.15);
  --ifr:  #ef4444; --ifr-dim:  rgba(239,68,68,0.15);
  --lifr: #a855f7; --lifr-dim: rgba(168,85,247,0.15);

  /* ── bp-panel / balance tokens (dark) ── */
  --bp-bg:       #040912;
  --bp-s1:       #0c1726;
  --bp-s2:       #101f31;
  --bp-s3:       #162538;
  --bp-bdr:      rgba(80,144,255,0.11);
  --bp-bdr-hi:   rgba(80,144,255,0.22);
  --bp-txt:      #c4d8f0;
  --bp-txt2:     #7098be;
  --bp-muted:    #3d5878;
  --bp-cyan:     #00d8ff;
  --bp-tot:      #ffffff;
  --bp-tabs-bg:  rgba(7,13,24,0.50);
  --bp-acc-rgb:  64,128,255;
  --bp-perf-num: #ffffff;
  --bp-hi-line:  rgba(100,160,255,0.18);
}

/* ── Base ───────────────────────────────────────────────── */
html {
  /* iOS Safari : exclut les barres du navigateur de la hauteur */
  height: -webkit-fill-available;
  height: 100dvh;
}
html, body {
  height: 100%; overflow: hidden;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

/* Propage la hauteur réelle jusqu'au layout */
#app { height: 100%; display: flex; flex-direction: column; }

/* ── Header ─────────────────────────────────────────────── */
#header {
  height: var(--header-h);
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 0 14px;
  position: relative; z-index: 1000;
  box-shadow: var(--shadow);
  transition: background .25s, border-color .25s;
}

/* ── Route Panel (sidebar) ──────────────────────────────── */
#route-panel {
  flex-shrink: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface-2);
  border-bottom: none;
  position: relative;
  z-index: 1;
  box-shadow: 0 4px 18px -4px rgba(0,0,0,.10);
}
#route-panel::-webkit-scrollbar { width: 4px; }
#route-panel::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ── Route Editor ─────────────────────────────────────── */
.re-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-dim);
  padding: 2px 0 4px;
}
#route-editor {
  padding: 10px 12px 8px;
  display: flex; flex-direction: column; gap: 5px;
}

/* Collapse button — coin haut droit */
.re-collapse-btn {
  position: absolute; top: 10px; right: 10px; z-index: 1;
  padding: 4px 7px; background: var(--surface-2); border: 1px solid var(--border-s);
  color: var(--text-dim); cursor: pointer; border-radius: 6px;
  transition: background .12s, color .12s;
}
.re-collapse-btn:hover { background: var(--surface-3); color: var(--text); }

/* ── Stop cards (DEP / ARR) ──────────────────────────── */
.re-stop-card {
  border: 1.5px solid var(--border-s); border-radius: 10px;
  padding: 7px 8px 7px 12px; background: var(--surface);
  transition: box-shadow .15s;
}
.re-stop-dep { border-left: 3px solid #22c55e; }
.re-stop-dep:focus-within { box-shadow: 0 0 0 3px rgba(34,197,94,.08); }
.re-stop-arr { border-left: 3px solid #ef4444; }
.re-stop-arr:focus-within { box-shadow: 0 0 0 3px rgba(239,68,68,.08); }

/* Layout interne DEP / ARR */
.re-stop-inner {
  display: flex; align-items: center; gap: 9px;
}
.re-stop-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; border: 2px solid;
}
.re-dep-dot { background: #22c55e; border-color: #16a34a; }
.re-arr-dot { background: #ef4444; border-color: #dc2626; }
.re-stop-text { flex: 1; min-width: 0; }
.re-stop-clear {
  flex-shrink: 0; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: none; border-radius: 50%;
  cursor: pointer; color: var(--text-muted);
  transition: background .12s, color .12s;
}
.re-stop-clear:hover { background: rgba(239,68,68,.12); color: #ef4444; }
.re-stop-card-label { display: none; }

/* Input ICAO — borderless, grand format */
.re-icao {
  width: 100%; border: none !important; box-shadow: none !important;
  padding: 0 !important; background: transparent !important; outline: none;
  font-size: 16px; font-weight: 800; letter-spacing: .5px; color: var(--text);
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
}
.re-icao::placeholder { color: var(--border); font-weight: 800; }
.re-icao.invalid { color: var(--ifr) !important; }

/* Airport name */
.re-ap-name {
  display: block; font-size: 10px; color: var(--text-muted);
  margin-top: 1px; min-height: 12px;
}

/* ── Dropdown autocomplétion ICAO ──────────────────────── */
.icao-ac-dropdown {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1.5px solid var(--border-s);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  overflow: hidden;
}
.icao-ac-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; cursor: pointer;
  transition: background .1s;
}
.icao-ac-item:hover, .icao-ac-item.sel { background: var(--surface-2); }
.icao-ac-code {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  color: var(--brand); flex-shrink: 0; min-width: 36px;
}
.icao-ac-name {
  font-size: 11px; color: var(--text-muted);
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icao-ac-country {
  font-size: 10px; color: var(--text-dim); flex-shrink: 0;
}

/* ── Connector DEP → ARR (via) ────────────────────────── */
.re-connector {
  display: flex; align-items: stretch;
  margin: -2px 0; padding: 0 12px;
}
.re-connector-line {
  position: relative;
  width: 2px; min-height: 20px; background: var(--border-s);
  margin-left: 6px; flex-shrink: 0;
}
.re-connector-line::before,
.re-connector-line::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 2px solid;
  background: var(--surface);
}
.re-connector-line::before { top: -4px;    border-color: var(--brand); }
.re-connector-line::after  { bottom: -4px; border-color: #ef4444; }
.re-via-body {
  flex: 1; display: flex; flex-direction: column; align-items: stretch;
  gap: 4px; padding: 4px 0 4px 12px;
}
.re-chip-list { display: flex; flex-direction: column; gap: 3px; }

/* ── Bouton inverser la route ──────────────────────────── */
.btn-swap-route {
  align-self: center;
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: var(--surface-2);
  border: 1.5px solid var(--border-s);
  border-radius: 50%;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 4px;
  transition: background .15s, color .15s, border-color .15s, transform .25s;
}
.btn-swap-route:hover {
  background: var(--accent-dim);
  border-color: var(--brand);
  color: var(--brand);
  transform: rotate(180deg);
}

/* Lignes survols / dégagements */
#route-editor .dynamic-row {
  display: flex; align-items: center; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; gap: 0; overflow: hidden;
}
#route-editor .drag-handle {
  display: flex; align-items: center; justify-content: center;
  padding: 0 7px; color: var(--text-dim); cursor: grab; flex-shrink: 0;
}
#route-editor .drag-handle:active { cursor: grabbing; }
#route-editor .dynamic-row .airport-name {
  display: block; font-size: 10px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; padding: 0 4px; pointer-events: none;
}
#route-editor .dynamic-row .icao-input {
  width: 50px; min-width: 50px; padding: 6px 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .5px;
  border: none; background: transparent; color: var(--brand);
}
#route-editor .dynamic-row .btn-remove {
  padding: 6px 9px; font-size: 11px; background: transparent;
  border: none; border-left: 1px solid var(--border);
  cursor: pointer; color: var(--text-muted); flex-shrink: 0;
  transition: background .12s, color .12s;
}
#route-editor .dynamic-row .btn-remove:hover { background: rgba(239,68,68,.1); color: #ef4444; }

/* ── Add buttons (survol / dégagement) ───────────────── */
.re-add-btn {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600; font-family: inherit;
  color: var(--text-dim); background: transparent;
  border: 1.5px dashed var(--border); border-radius: 99px;
  padding: 3px 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.re-add-btn:hover {
  border-color: var(--brand); color: var(--brand);
  background: var(--accent-dim); border-style: solid;
}

/* ── Dégagements row ─────────────────────────────────── */
.re-alt-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
}

/* ── Settings row (Corridor + FL max) ────────────────── */
.re-settings-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-s);
}
.re-setting { display: flex; align-items: center; gap: 5px; }
.re-setting-label {
  font-size: 9.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-dim); flex-shrink: 0;
}
.re-setting-sep { width: 1px; height: 16px; background: var(--border); flex-shrink: 0; }
/* Compat alias */
.re-opt-label { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--text-dim); flex-shrink: 0; }
.re-opt-sep { width: 1px; height: 16px; background: var(--border); }
.re-opt-unit { font-size: 10px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; }
.re-number-input {
  width: 46px; padding: 4px 6px; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: 12px; font-weight: 600;
  color: var(--text); background: var(--surface); text-align: center;
  transition: border-color .15s;
}
.re-number-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-dim); }

/* ── Time row ────────────────────────────────────────── */
.re-time-row {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-s);
}
.re-time-icon { color: var(--text-dim); flex-shrink: 0; }
.re-date-input {
  flex: 1; min-width: 0; padding: 4px 8px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 11px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
.re-time-input {
  width: 76px; padding: 4px 6px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 11px; font-family: inherit; color: var(--text); background: var(--surface);
  transition: border-color .15s;
}
/* Icônes natives calendrier/horloge : visibles et cliquables */
.re-date-input::-webkit-calendar-picker-indicator,
.re-time-input::-webkit-calendar-picker-indicator {
  opacity: .5; cursor: pointer;
}
.re-date-input::-webkit-calendar-picker-indicator:hover,
.re-time-input::-webkit-calendar-picker-indicator:hover { opacity: .9; }
.re-dur-input {
  width: 42px; padding: 4px 5px;
  border: 1.5px solid var(--border); border-radius: 6px;
  font-size: 11px; color: var(--text); background: var(--surface);
  text-align: center; transition: border-color .15s;
}
.re-date-input:focus, .re-time-input:focus, .re-dur-input:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-dim);
}
.re-time-row.time-set .re-date-input,
.re-time-row.time-set .re-time-input { border-color: var(--brand); background: var(--accent-dim); }
[data-theme="dark"] .re-date-input,
[data-theme="dark"] .re-time-input { color-scheme: dark; }
.re-clear-time {
  font-size: 10px; color: var(--text-muted); background: transparent;
  border: none; cursor: pointer; padding: 2px 5px; border-radius: 4px;
  transition: color .12s;
}
.re-clear-time:hover { color: #ef4444; }
.re-clear-time.hidden { display: none; }

/* Load button */
#route-editor .btn-briefing { width: 100%; margin-top: 0; justify-content: center; }

/* Log de nav button */
/* ── Groupe 2 colonnes : Profil de vol + Log de nav ────────── */
.nav-empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 32px 16px;
  color: var(--text-muted);
  text-align: center;
  font-size: 12.5px; line-height: 1.5;
}
.nav-empty svg { opacity: .4; }

.btn-navlog-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 8px;
}
/* Masque le groupe si aucun bouton visible (les deux ont .hidden) */
.btn-navlog-group:not(:has(> :not(.hidden))) { display: none; }

/* ── Tip altitude (dans #airspace-panel) ───────────────────── */
.alt-tip {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px 12px;
  background: var(--surface-2);
  border-top: 1px solid var(--border-s);
}
.alt-tip.hidden { display: none; }
.alt-tip-illo { flex-shrink: 0; width: 76px; }
.alt-tip-illo svg { width: 76px; height: auto; display: block; }
.alt-tip-text {
  display: flex; flex-direction: column; gap: 3px;
  font-size: 11.5px; line-height: 1.45; color: var(--text-dim);
}
.alt-tip-text strong { font-size: 12px; font-weight: 600; color: var(--text); }
[data-theme="dark"] .alt-tip {
  background: rgba(30,64,175,0.06);
}


.btn-navlog {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 10px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 11.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-navlog:hover { background: var(--accent-dim); color: var(--brand); border-color: var(--brand); }
.btn-navlog.hidden { display: none; }

/* ── Réinitialiser la route — discret, en bas ───────────────── */
.btn-reset-route {
  width: 100%; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 14px;
  background: none; color: var(--text-dim);
  border: none; border-radius: var(--radius);
  font-size: 11px; font-weight: 500; font-family: inherit; cursor: pointer;
  opacity: .6;
  transition: color .15s, opacity .15s;
}
.btn-reset-route:hover { color: #dc2626; opacity: 1; }
[data-theme="dark"] .btn-reset-route:hover { color: #f87171; }

/* ── Sélecteur de couche (layer picker) — floating sur la carte ── */
#layer-picker-wrap {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 800;
}

.layer-picker-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 11.5px; font-weight: 600; font-family: inherit;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background .15s, box-shadow .15s;
}
.layer-picker-btn:hover { background: var(--surface-2); }
.layer-picker-btn svg:first-child { color: var(--brand); }

.layer-picker-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 234px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 14px;
}

.lp-section-label {
  font-size: 9.5px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .7px; color: var(--text-dim);
  margin-bottom: 8px;
}

.lp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-bottom: 2px;
}

.lp-option {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 8px 6px 7px;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--surface-2);
  cursor: pointer;
  font-family: inherit; font-size: 9.5px; font-weight: 600;
  color: var(--text-muted);
  transition: all .15s;
}
.lp-option:hover { background: var(--accent-dim); color: var(--brand); }
.lp-option.active {
  border-color: var(--brand);
  background: var(--accent-dim);
  color: var(--brand);
}

.lp-thumb {
  width: 56px; height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border-s);
  flex-shrink: 0;
}
.lp-thumb-osm       { background: linear-gradient(135deg,#d4e8c2 0%,#f0f4ef 45%,#b8d4e8 80%,#8fbfd8 100%); }
.lp-thumb-satellite { background: linear-gradient(135deg,#111a0e 0%,#1e3414 40%,#142a1e 70%,#0a1a10 100%); }
.lp-thumb-oaci250   { background: linear-gradient(135deg,#f0ecd4 0%,#faf7e8 40%,#e8dfc0 70%); position: relative; overflow: hidden; }
.lp-thumb-oaci250::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(60deg, transparent, transparent 3px, rgba(100,140,180,.3) 3px, rgba(100,140,180,.3) 4px);
}
.lp-thumb-oaci500   { background: linear-gradient(135deg,#f7f0d8 0%,#fdf8ec 40%,#f0e8cc 70%); position: relative; overflow: hidden; }
.lp-thumb-oaci500::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, transparent, transparent 5px, rgba(180,100,100,.25) 5px, rgba(180,100,100,.25) 6px);
}
.lp-thumb-oaci1m    { background: linear-gradient(135deg,#eee8d4 0%,#f8f4e4 40%,#e4dcc8 70%); position: relative; overflow: hidden; }
.lp-thumb-oaci1m::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(30deg, transparent, transparent 8px, rgba(120,80,150,.2) 8px, rgba(120,80,150,.2) 9px);
}

.lp-sep {
  height: 1px;
  background: var(--border-s);
  margin: 10px 0 8px;
}

.lp-overlay-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px;
  font-size: 11px; font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 7px;
  transition: background .12s;
}
.lp-overlay-row:hover { background: var(--surface-2); }
.lp-overlay-row input[type="checkbox"] {
  accent-color: var(--brand);
  width: 13px; height: 13px;
}

[data-theme="dark"] .layer-picker-btn { background: var(--surface); border-color: var(--border); }
[data-theme="dark"] .layer-picker-panel { background: var(--surface); }
[data-theme="dark"] .lp-thumb-osm { background: linear-gradient(135deg,#2a3d24 0%,#1e2e38 60%,#162534 100%); }

/* ── Profil de vol ─────────────────────────────────────────── */
#profile-panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 210px;
  z-index: 450;
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(0,0,0,.12);
  box-shadow: 0 -4px 20px rgba(0,0,0,.18);
  overflow: hidden;
}
#profile-panel.hidden { display: none; }

.profile-hdr {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  font-size: 11.5px; font-weight: 600; color: var(--text);
}
.profile-hdr svg { color: var(--brand); flex-shrink: 0; }
.profile-hdr-title { font-weight: 700; font-size: 12px; }
.profile-alt-ctrl {
  display: flex; align-items: center; gap: 5px;
  margin-left: auto;
  font-size: 11px; color: var(--text-muted);
}
.profile-alt-ctrl input {
  width: 64px; padding: 3px 6px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--text);
  font-size: 11px; font-family: 'JetBrains Mono', monospace;
  text-align: right;
}
.profile-close {
  margin-left: 8px; flex-shrink: 0;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 3px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.profile-close:hover { background: var(--surface-2); color: var(--text); }

.profile-body {
  flex: 1; position: relative; overflow: hidden;
}
#profile-canvas {
  display: block; width: 100%; height: 100%;
}
.profile-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 12px; color: var(--text-muted);
  background: rgba(255,255,255,.85);
}
[data-theme="dark"] .profile-loading { background: rgba(20,20,30,.85); }
.profile-loading.hidden { display: none; }

/* ── Route Summary (compact — tous onglets non-Route) ──────── */
#route-summary {
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border-s);
  margin-bottom: 2px;
}
.rs-body { display: flex; gap: 10px; margin-bottom: 7px; }
.rs-timeline {
  display: flex; flex-direction: column; align-items: center;
  width: 10px; flex-shrink: 0; padding-top: 3px;
}
.rs-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.rs-dot-dep { background: var(--brand); }
.rs-dot-arr { background: transparent; border: 2.5px solid #ef4444; }
.rs-vline { width: 2px; flex: 1; min-height: 24px; background: var(--border); margin: 4px 0; }
.rs-labels { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.rs-airport { display: flex; align-items: center; gap: 5px; min-width: 0; }
.rs-icao { font-size: 13px; font-weight: 800; color: var(--text); letter-spacing: .3px; flex-shrink: 0; }
.rs-name {
  font-size: 10.5px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0;
}
.rs-cat {
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 99px; flex-shrink: 0; letter-spacing: .3px;
}
.rs-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.rs-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.rs-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.rs-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }
.rs-via { font-size: 10px; color: var(--text-dim); padding-left: 1px; }
.rs-footer { display: flex; align-items: center; justify-content: space-between; }
.rs-meta { font-size: 10px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
.rs-dist-badge {
  display: inline-flex; align-items: center;
  background: #dcfce7; color: #15803d;
  font-size: 10px; font-weight: 700; letter-spacing: .3px;
  border-radius: 4px; padding: 1px 6px;
}
[data-theme="dark"] .rs-dist-badge { background: #14532d; color: #4ade80; }
.rs-edit-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--accent-dim); border: none; border-radius: 6px;
  padding: 5px 11px; cursor: pointer; transition: background .15s, color .15s;
}
.rs-edit-btn:hover { background: var(--brand); color: #fff; }


.header-brand { display: flex; align-items: center; gap: 9px; }
.brand-icon-wrap {
  width: 30px; height: 30px;
  background: var(--brand);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px var(--accent-glow);
  flex-shrink: 0;
}
.brand-name { font-size: 15px; font-weight: 700; color: var(--text); letter-spacing: -.3px; }
.brand-name em { color: var(--brand); font-style: normal; }

.header-center {
  position: absolute; left: 50%; transform: translateX(-50%);
}
#header-route-pill {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; padding: 5px 16px;
  display: flex; align-items: center; gap: 8px;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  font-size: 12px; font-weight: 600; color: var(--text);
  letter-spacing: .3px; box-shadow: var(--shadow);
  transition: background .25s;
}
#header-route-pill .rp-sep { color: var(--text-dim); font-size: 10px; }
#header-route-pill:empty::before { content: 'Saisissez une route'; color: var(--text-dim); font-size: 11px; font-weight: 400; font-family: 'Inter', sans-serif; letter-spacing: 0; }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-sep { width: 1px; height: 18px; background: var(--border); flex-shrink: 0; }

#utc-clock {
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  font-size: 11px; font-weight: 500; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 9px; letter-spacing: .5px;
  transition: background .25s;
}

.btn-theme-toggle {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: all .18s;
}
.btn-theme-toggle:hover { color: var(--text); border-color: var(--brand); }

#config-badge {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  cursor: default;
}
#config-badge.ok   { background: var(--vfr); box-shadow: 0 0 0 2px rgba(34,197,94,.25); }
#config-badge.warn { background: #f59e0b; box-shadow: 0 0 0 2px rgba(245,158,11,.25); }

#loading-indicator { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
#loading-indicator.hidden { display: none; }
.spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .8s linear infinite; transform-origin: center; }

.list-loading {
  display: flex; align-items: center; gap: 8px;
  padding: 20px 16px; color: var(--text-muted); font-size: 13px;
}
.list-loading .spinner { flex-shrink: 0; }

/* ── Wind barbs layer ────────────────────────────────────── */
.wind-barb-icon { background: none !important; border: none !important; }
.wind-barb-icon svg { display: block; }

/* ── Aviation radar weather loader ───────────────────────── */
.wx-radar-loader {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 48px 20px 36px;
}
.wx-radar-scope {
  width: 80px; height: 80px; position: relative;
  color: var(--brand);
}
.wx-radar-rings {
  width: 80px; height: 80px; position: absolute; inset: 0;
}
.wx-radar-beam {
  position: absolute; inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(34,197,94,0.75)  0deg,
    rgba(34,197,94,0.18) 45deg,
    transparent           75deg,
    transparent          360deg
  );
  animation: wx-radar-spin 2.2s linear infinite;
}
.wx-radar-beam::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 38px; height: 1.5px;
  transform-origin: left center;
  transform: translateY(-50%) rotate(0deg);
  background: linear-gradient(to right, rgba(34,197,94,0.9), rgba(34,197,94,0.2));
  border-radius: 1px;
  box-shadow: 0 0 4px rgba(34,197,94,0.6);
}
@keyframes wx-radar-spin { to { transform: rotate(360deg); } }

.wx-radar-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--text-muted); letter-spacing: 0.04em;
}
.wx-radar-dots {
  display: inline-flex; gap: 3px; align-items: center;
}
.wx-radar-dots span {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-muted); opacity: 0;
  animation: wx-dot-blink 1.4s ease-in-out infinite;
}
.wx-radar-dots span:nth-child(2) { animation-delay: 0.22s; }
.wx-radar-dots span:nth-child(3) { animation-delay: 0.44s; }
@keyframes wx-dot-blink {
  0%, 80%, 100% { opacity: 0; }
  40%           { opacity: 1; }
}

/* ── Layout ─────────────────────────────────────────────── */
#main-layout {
  display: flex; overflow: hidden;
  flex: 1;
  min-height: 0;
  position: relative; /* référence pour les overlays absolus */
}

/* ── Sidebar ─────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w); min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: background .25s, border-color .25s;
  box-shadow: 2px 0 12px rgba(15,40,100,0.05);
}
[data-theme="dark"] #sidebar { box-shadow: 2px 0 16px rgba(0,0,0,0.25); }

/* ── Detail Panel ────────────────────────────────────────── */
#detail-panel {
  width: 0; min-width: 0; overflow: hidden;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  transition: width .22s cubic-bezier(.4,0,.2,1), min-width .22s cubic-bezier(.4,0,.2,1);
  flex-shrink: 0;
  box-shadow: 2px 0 12px rgba(15,40,100,0.06);
}
#detail-panel.open {
  width: var(--detail-panel-w);
  min-width: var(--detail-panel-w);
}
[data-theme="dark"] #detail-panel { box-shadow: 2px 0 16px rgba(0,0,0,0.25); }

#dp-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); flex-shrink: 0; gap: 8px;
  min-width: var(--detail-panel-w);
  position: relative; z-index: 850; /* au-dessus des nav pills (800) */
}
#dp-header-left  { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
#dp-header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

#dp-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  padding: 2px 8px; border-radius: 99px; color: #fff; flex-shrink: 0;
}
#dp-title {
  font-size: 12px; font-weight: 700; color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#dp-header-right button {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 6px; border: none;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background .12s, color .12s;
}
#dp-header-right button:hover { background: var(--surface-3); color: var(--text); }
#dp-close:hover { background: rgba(239,68,68,.12) !important; color: #ef4444 !important; }

#dp-body {
  flex: 1; overflow-y: auto; min-width: var(--detail-panel-w);
  padding: 0;
}
#dp-body::-webkit-scrollbar { width: 4px; }
#dp-body::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* ── NOTAM detail content ────────────────────────────────── */
.dp-notam { padding: 14px; }

.dp-notam-meta {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px; margin-bottom: 12px;
}
.dp-meta-block {
  background: var(--surface-2); border-radius: 6px; padding: 8px 10px;
  border: 1px solid var(--border-s);
}
.dp-meta-label {
  font-size: 9px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px;
}
.dp-meta-value { font-size: 12px; font-weight: 600; color: var(--text); }
.dp-meta-lieu  { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dp-meta-value.active  { color: var(--vfr); }
.dp-meta-value.expired { color: var(--text-muted); }
.dp-meta-value.perm    { color: var(--brand); }
.dp-meta-sub { font-size: 9.5px; color: var(--text-muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.dp-alt-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  padding: 6px 10px; background: var(--surface-2); border-radius: 6px;
  border: 1px solid var(--border-s); font-size: 12px;
}
.dp-alt-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-dim); }
.dp-alt-value { font-weight: 700; font-family: 'JetBrains Mono', monospace; }

.dp-notam-text-label {
  font-size: 9px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 6px;
}
.dp-notam-text {
  font-size: 12px; line-height: 1.65; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border-radius: 6px; padding: 10px 12px;
  border: 1px solid var(--border-s);
}

/* Liens AIP SUP / AIP AMDT dans le texte NOTAM */
.notam-doc-link {
  display: inline-flex; align-items: center; gap: 3px;
  color: var(--brand); font-weight: 700; text-decoration: none;
  background: var(--accent-dim);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  border-radius: 4px; padding: 0 5px 0 4px; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.notam-doc-link:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.notam-doc-link-icon { flex-shrink: 0; opacity: .7; transition: opacity .12s; }
.notam-doc-link:hover .notam-doc-link-icon { opacity: 1; stroke: #fff; }
/* Dans l'aperçu tronqué de la liste */
.notam-item-text .notam-doc-link { font-size: 10.5px; padding: 0 3px; }

.dp-actions {
  display: flex; gap: 8px; margin-top: 14px; padding-top: 12px;
  border-top: 1px solid var(--border-s);
}
.dp-btn-dismiss {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; padding: 7px 14px; cursor: pointer; font-family: inherit;
  transition: all .12s; flex: 1;
}
.dp-btn-dismiss:hover { background: rgba(239,68,68,.1); color: #ef4444; border-color: #ef4444; }

/* ── Weather detail content ──────────────────────────────── */
.dp-wx { padding: 14px; }
.dp-wx-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.dp-wx-icao-row { display: flex; align-items: center; gap: 8px; }
.dp-wx-icao { font-size: 20px; font-weight: 800; font-family: 'JetBrains Mono', monospace; }
.dp-wx-name { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Lien carte VAC SIA */
.vac-link {
  display: inline-flex; align-items: center;
  padding: 1px 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .4px;
  color: var(--brand); border: 1.5px solid var(--brand); border-radius: 4px;
  text-decoration: none; line-height: 1.5; flex-shrink: 0;
  transition: background .12s, color .12s;
}
.vac-link:hover { background: var(--brand); color: #fff; }
.vac-link--sm { font-size: 8.5px; padding: 0 4px; border-width: 1px; }

.dp-wx-cat {
  font-size: 13px; font-weight: 800; padding: 6px 14px; border-radius: 8px; letter-spacing: .5px;
}
.dp-wx-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.dp-wx-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.dp-wx-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.dp-wx-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }

.dp-wx-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px;
}
.dp-wx-cell {
  background: var(--surface-2); border: 1px solid var(--border-s);
  border-radius: 6px; padding: 8px 10px;
}
.dp-wx-cell-label { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--text-dim); margin-bottom: 3px; }
.dp-wx-cell-value { font-size: 13px; font-weight: 600; color: var(--text); }
.dp-wx-cell.alert .dp-wx-cell-value { color: var(--ifr); }

/* Sections observation / prévisions */
.dp-wx-section { padding-bottom: 2px; }
.dp-wx-section + .dp-wx-section {
  padding-top: 14px; margin-top: 4px;
  border-top: 1px solid var(--border);
}
.dp-wx-section-title {
  display: flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 10px;
}
.dp-wx-section-title .icon { color: var(--brand); opacity: .8; }

/* Date/heure d'observation sous la grille */
.dp-wx-obs-time {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-muted);
  margin-top: -6px; margin-bottom: 10px;
}

/* Toggle données brutes */
.dp-wx-raw-toggle { margin-top: 8px; }
.dp-wx-raw-toggle summary {
  list-style: none; -webkit-appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; color: var(--text-dim);
  padding: 3px 8px; border-radius: 4px;
  border: 1px solid var(--border-s); background: var(--surface-2);
  user-select: none; transition: background .12s, color .12s;
}
.dp-wx-raw-toggle summary::-webkit-details-marker { display: none; }
.dp-wx-raw-toggle summary::after { content: ' ▾'; font-size: 9px; }
.dp-wx-raw-toggle[open] summary { background: var(--surface-3); color: var(--text); }
.dp-wx-raw-toggle[open] summary::after { content: ' ▴'; }
.dp-wx-raw-toggle summary:hover { background: var(--surface-3); color: var(--text); }
.dp-wx-raw-pre {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; line-height: 1.6;
  color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border-s);
  border-radius: 6px; padding: 8px 10px; white-space: pre-wrap; word-break: break-all;
  margin-top: 6px;
}

/* Aucune donnée */
.dp-wx-nodata {
  font-size: 12px; color: var(--text-dim); padding: 10px 0; text-align: center;
}

/* Keep .dp-wx-taf-title for backward compat (popup map) */
.dp-wx-taf-title {
  font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim); margin-bottom: 8px;
}

/* ── Map pulse animation ─────────────────────────────────── */
/* Applied via JS setStyle, no CSS class needed */

.panel { border-bottom: 1px solid var(--border-s); padding: 14px 14px 14px; transition: background .25s; }
.panel.flex-fill { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; padding: 0; }

.panel-title {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 12px;
}

/* ── Form fields ─────────────────────────────────────────── */
.field-group { margin-bottom: 10px; }
.field-label {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px;
}
.airport-row { display: flex; align-items: center; gap: 8px; }

.icao-input {
  width: 70px; min-width: 70px;
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  background: var(--surface-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s, background .25s;
  box-shadow: var(--shadow);
}
.icao-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--accent-dim); }
.icao-input.valid   { border-color: var(--vfr); }
.icao-input.invalid { border-color: var(--ifr); }

.airport-name { font-size: 12px; color: var(--text-muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.airport-name.found    { color: var(--vfr); font-weight: 500; }
#dep-name.found { color: #16a34a; }
#arr-name.found { color: #dc2626; }
.airport-name.notfound { color: var(--ifr); }

/* Dynamic rows */
.dynamic-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; transition: opacity .15s; }
.dynamic-row.dragging,
.wp-sidebar-row.dragging { opacity: .35; }
.dynamic-row.drop-above,
.wp-sidebar-row.drop-above { border-top: 2px solid var(--brand) !important; margin-top: -2px; }
.dynamic-row.drop-below,
.wp-sidebar-row.drop-below { border-bottom: 2px solid var(--brand) !important; margin-bottom: -2px; }
.wp-sidebar-row[draggable="true"] { cursor: grabbing; }

.drag-handle {
  display: flex; align-items: center; color: var(--text-dim);
  cursor: grab; padding: 0 3px; flex-shrink: 0; user-select: none; touch-action: none;
}
.drag-handle:hover { color: var(--text-muted); }
.drag-handle:active { cursor: grabbing; }

.btn-remove {
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: var(--ifr-dim); color: var(--ifr);
  cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: background .15s;
}
.btn-remove:hover { background: rgba(220,38,38,0.22); }

.btn-add {
  background: none; border: none; cursor: pointer;
  color: var(--brand); font-size: 11px; font-weight: 600; padding: 0;
}
.btn-add:hover { text-decoration: underline; }

/* ── Route flow (DEP → VIA → ARR) ───────────────────────── */
.route-flow { display: flex; flex-direction: column; margin-bottom: 8px; }

.rn-outer { display: flex; gap: 12px; min-width: 0; }

.rn-col {
  display: flex; flex-direction: column; align-items: center;
  flex-shrink: 0; width: 14px; padding-top: 17px;
}

.rn-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface-3); border: 2px solid var(--text-dim);
  transition: background .25s, border-color .25s, box-shadow .25s;
}
.rn-dep { background: var(--vfr);  border-color: var(--vfr);  box-shadow: 0 0 7px var(--vfr-dim); }
.rn-arr { background: var(--ifr);  border-color: var(--ifr);  box-shadow: 0 0 7px var(--ifr-dim); }
.rn-via { background: var(--mvfr); border-color: var(--mvfr); box-shadow: 0 0 5px var(--mvfr-dim); width: 8px; height: 8px; }

.rn-line {
  flex: 1; width: 2px; border-radius: 1px; min-height: 8px; margin-top: 3px;
  opacity: 0.35;
}
.rn-line-dep { background: linear-gradient(to bottom, var(--vfr), var(--mvfr)); }
.rn-line-via { background: linear-gradient(to bottom, var(--mvfr), var(--ifr)); }

.rn-body { flex: 1; padding-bottom: 10px; min-width: 0; }

.rn-label {
  font-size: 10px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}
.rn-label-action {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; background: none; border: none; cursor: default;
  font-size: 10px; font-weight: 700; letter-spacing: .7px;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 5px;
}

/* Dégagements — section séparée sous la route */
.alt-section {
  border-top: 1px solid var(--border-s);
  padding-top: 10px; margin-bottom: 10px;
}

/* Corridor + boutons en bas */
.bottom-controls {
  display: flex; align-items: center; gap: 7px; margin-top: 2px;
}

/* ── Corridor ────────────────────────────────────────────── */
.corridor-input-wrap {
  display: flex; align-items: center; gap: 5px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 5px 10px; box-shadow: var(--shadow);
  flex-shrink: 0;
}
.corridor-input-wrap input[type="number"] {
  width: 38px; background: none; border: none; outline: none;
  font-size: 14px; font-weight: 700; text-align: center; color: var(--brand);
  font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace;
  -moz-appearance: textfield;
}
.corridor-input-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
.unit { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.corridor-label-text { font-size: 11px; color: var(--text-dim); font-weight: 500; }

/* ── Route actions ───────────────────────────────────────── */
.route-actions { display: flex; gap: 7px; flex: 1; }

/* Bouton unique "Briefing" (NOTAM + Météo) */
.btn-briefing {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--cyan) 100%);
  color: #fff; border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 700; cursor: pointer; letter-spacing: .2px;
  box-shadow: 0 2px 10px var(--accent-glow);
  transition: filter .15s, box-shadow .15s, opacity .15s;
  font-family: inherit;
}
.btn-briefing:hover:not(:disabled) { filter: brightness(1.12); box-shadow: 0 4px 14px var(--accent-glow); }
.btn-briefing:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; filter: none; }

/* Compatibilité: garder .btn-primary et .btn-weather si référencés ailleurs */
.btn-primary {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; background: var(--brand); color: #fff;
  border: none; border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: 0 2px 8px var(--accent-glow);
  transition: filter .15s, box-shadow .15s, opacity .15s;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.1); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-weather {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px;
  background: var(--surface-2); border: 1.5px solid rgba(2,132,199,0.35);
  color: var(--cyan); border-radius: var(--radius);
  font-size: 13px; font-weight: 600; cursor: pointer;
  box-shadow: var(--shadow); transition: background .15s, border-color .15s;
}
.btn-weather:hover:not(:disabled) { background: var(--cyan-dim); border-color: var(--cyan); }
.btn-weather:disabled { opacity: .55; cursor: not-allowed; }

/* ── Balance & Perf panel (zone centrale — natif) ─── */
#bp-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  left: var(--sidebar-w);
  z-index: 350;
  background: rgba(238, 242, 248, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 66px; /* accounts for sidebar nav tabs row that overlaps the top */
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}
[data-theme="dark"] #bp-panel {
  background: rgba(8, 13, 24, 0.55);
}
#bp-panel.bp-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* ── Aircraft header bar ── */
.bp-ac-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px 8px;
  border-bottom: 1px solid var(--bp-bdr);
  background: var(--bp-s1);
  flex-shrink: 0;
}
.bp-ac-info {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--bp-txt2);
}
.bp-ac-info .bi-airplane-fill { font-size: 12px; color: rgb(var(--bp-acc-rgb)); }
.bp-ac-immat { font-size: 16px; font-weight: 800; color: var(--bp-txt); letter-spacing: -0.3px; }
.bp-ac-sep   { font-size: 13px; color: var(--bp-muted); margin: 0 2px; }
.bp-ac-model { font-size: 13px; font-weight: 500; color: var(--bp-txt2); }
.bp-print-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  background: rgba(var(--bp-acc-rgb),0.08); border: 1px solid rgba(var(--bp-acc-rgb),0.20);
  color: rgb(var(--bp-acc-rgb)); cursor: pointer; transition: all .15s;
  font-family: inherit;
}
.bp-print-btn:hover { background: rgba(var(--bp-acc-rgb),0.14); border-color: rgba(var(--bp-acc-rgb),0.35); }
/* ── Disclaimer ── */
.bp-disclaimer {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 16px; font-size: 11px; font-weight: 500;
  background: #1a1200; color: #f0b840;
  border-bottom: 1px solid rgba(240,184,64,0.2);
  flex-shrink: 0; line-height: 1.4;
}
.bp-disclaimer .bi { font-size: 12px; flex-shrink: 0; }
[data-theme="light"] .bp-disclaimer { background: #fffbea; color: #886000; border-bottom-color: rgba(180,130,0,0.20); }
/* ── Empty state ── */
.bp-empty {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; color: var(--bp-txt2); font-size: 13px;
  text-align: center; padding: 32px;
}
/* ── Content wrapper ── */
#bp-content {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
/* ── Sub-tabs ── */
#bp-tabs {
  display: flex; gap: 3px; padding: 10px 16px;
  border-bottom: 1px solid var(--bp-bdr); flex-shrink: 0;
  background: var(--bp-tabs-bg);
}
.bp-tab {
  padding: 6px 14px; border-radius: 8px; font-size: 13px; font-weight: 500;
  background: transparent; border: 1px solid transparent; color: var(--bp-txt2); cursor: pointer;
  display: flex; align-items: center; gap: 7px; transition: all .18s;
}
.bp-tab.active {
  background: rgba(var(--bp-acc-rgb),0.12);
  border-color: rgba(var(--bp-acc-rgb),0.25);
  color: rgb(var(--bp-acc-rgb)); font-weight: 600;
}
.bp-tab:hover:not(.active) { color: var(--bp-txt); background: rgba(var(--bp-acc-rgb),0.06); }
/* ── Tab sections ── */
.bp-tab-section {
  flex: 1; display: flex; flex-direction: column; overflow-y: auto; overflow-x: hidden;
  gap: 10px; padding: 12px 16px 20px;
}
/* ── KPI row: 3 cards ── */
.bp-kpi-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bp-kpi-card {
  background: var(--bp-s1);
  border: 1px solid var(--bp-bdr);
  border-radius: 12px; padding: 13px 16px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.bp-kpi-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--bp-hi-line), transparent);
}
.bp-kpi-label {
  font-size: 10px; font-weight: 600; color: var(--bp-muted);
  text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px;
}
.bp-kpi-num { font-size: 22px; font-weight: 700; color: var(--bp-txt); letter-spacing: -0.5px; line-height: 1.1; }
.bp-kpi-sub { font-size: 10px; color: var(--bp-muted); margin-top: 5px; }
/* Status badge — dark pill on any background */
.bp-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.6px;
  text-transform: uppercase;
}
.bp-badge-ok   { background: #0a1e14; color: #22c87a; border: 1.5px solid rgba(34,200,122,0.55); }
.bp-badge-warn { background: #1e1400; color: #f5c400; border: 1.5px solid rgba(245,196,0,0.50); }
.bp-badge-err  { background: #1e0008; color: #ff5a70; border: 1.5px solid rgba(255,90,112,0.50); }
/* ── Cards ── */
.bp-card {
  background: var(--bp-s1);
  border: 1px solid var(--bp-bdr);
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative; flex-shrink: 0;
}
.bp-card::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--bp-hi-line) 50%, transparent 95%);
  pointer-events: none;
}
.bp-card-hd {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--bp-bdr);
}
.bp-card-icon {
  width: 28px; height: 28px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}
.bp-chi-blue   { background: rgba(var(--bp-acc-rgb),0.10); color: rgb(var(--bp-acc-rgb)); }
.bp-chi-green  { background: rgba(0,160,90,0.10);   color: #007a3a; }
.bp-chi-orange { background: rgba(200,120,0,0.10);  color: #b06000; }
[data-theme="dark"] .bp-chi-green  { background: rgba(0,192,122,0.14); color: #00c87a; }
[data-theme="dark"] .bp-chi-orange { background: rgba(240,144,48,0.14); color: #f09030; }
.bp-card-title { font-size: 13px; font-weight: 600; color: var(--bp-txt); }
.bp-card-sub   { margin-left: auto; font-size: 11px; color: var(--bp-muted); }
.bp-card-body  { padding: 14px 16px; }
/* ── Canvas ── */
.bp-canvas-wrap { background: var(--bp-bg); }
.bp-canvas-wrap canvas { width: 100%; display: block; }
/* ── Legend bar ── */
.bp-legend-bar {
  display: flex; flex-wrap: wrap; gap: 14px;
  padding: 8px 14px;
  background: var(--bp-s2); border-top: 1px solid var(--bp-bdr);
  font-size: 11px; color: var(--bp-txt2);
}
.bp-legend-bar span { display: flex; align-items: center; gap: 5px; }
.bp-leg-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* ── Side-by-side canvas + recap row ── */
.bp-cards-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}
.bp-card-canvas { min-width: 0; }
.bp-card-recap  { min-width: 0; }
@media (max-width: 560px) {
  .bp-cards-row { grid-template-columns: 1fr; }
}
/* ── Recap table ── */
.bp-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.bp-table tr { border-bottom: 1px solid var(--bp-bdr); }
.bp-table tr:last-child { border-bottom: none; }
.bp-table td { padding: 6px 2px; }
.bp-table td:first-child { color: var(--bp-txt2); }
.bp-table td:last-child  { text-align: right; font-weight: 600; color: var(--bp-cyan); font-variant-numeric: tabular-nums; }
.bp-table tr.total td { padding-top: 10px; font-size: 13px; font-weight: 700; color: var(--bp-txt); border-top: 1px solid var(--bp-bdr); border-bottom: none; }
.bp-table tr.total td:last-child { color: var(--bp-tot); }
/* ── Status box ── */
.bp-status-box {
  margin-top: 12px; border-radius: 10px; padding: 12px 16px;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  letter-spacing: 0.2px;
}
.bp-status-box.bp-status-ok   { background: rgba(0,160,80,0.10);  border: 1.5px solid rgba(0,160,80,0.30);  color: #007a3a; }
.bp-status-box.bp-status-warn { background: rgba(180,130,0,0.10); border: 1.5px solid rgba(180,130,0,0.30); color: #886000; }
.bp-status-box.bp-status-err  { background: rgba(200,0,40,0.08);  border: 1.5px solid rgba(200,0,40,0.25);  color: #c0002a; }
[data-theme="dark"] .bp-status-box.bp-status-ok   { background: rgba(0,209,112,0.13); border-color: rgba(0,209,112,0.35); color: #00d170; }
[data-theme="dark"] .bp-status-box.bp-status-warn { background: rgba(245,196,0,0.10); border-color: rgba(245,196,0,0.35);  color: #f5c400; }
[data-theme="dark"] .bp-status-box.bp-status-err  { background: rgba(255,63,94,0.10); border-color: rgba(255,63,94,0.35);  color: #ff3f5e; }
/* ── Perf grid ── */
.bp-perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bp-form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 7px; margin-bottom: 8px; }
.bp-form-g { display: flex; flex-direction: column; gap: 3px; }
.bp-flabel {
  font-size: 10px; font-weight: 600; color: var(--bp-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.bp-input {
  width: 100%; background: var(--bp-s2); border: 1px solid var(--bp-bdr);
  color: var(--bp-txt); padding: 7px 9px; border-radius: 8px;
  font-size: 13px; font-family: inherit; font-weight: 500;
  transition: border-color .2s, box-shadow .2s; box-sizing: border-box;
}
.bp-input:focus { outline: none; border-color: rgb(var(--bp-acc-rgb)); box-shadow: 0 0 0 3px rgba(var(--bp-acc-rgb),0.12); }
.bp-surf-toggle { display: flex; gap: 5px; margin-bottom: 10px; }
.bp-surf-btn {
  flex: 1; padding: 6px 8px; font-size: 11px; font-weight: 600; border-radius: 7px;
  background: rgba(var(--bp-acc-rgb),0.06); border: 1px solid rgba(var(--bp-acc-rgb),0.14);
  color: var(--bp-txt2); cursor: pointer; transition: all .15s;
}
.bp-surf-btn.active { background: rgba(var(--bp-acc-rgb),0.14); border-color: rgba(var(--bp-acc-rgb),0.35); color: rgb(var(--bp-acc-rgb)); }
.bp-perf-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.bp-perf-kpi {
  background: var(--bp-s2); border: 1px solid var(--bp-bdr);
  border-radius: 10px; padding: 10px 12px;
}
.bp-perf-kpi-lbl { font-size: 10px; font-weight: 600; color: var(--bp-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.bp-perf-kpi-val { font-size: 26px; font-weight: 700; color: var(--bp-perf-num); letter-spacing: -1px; line-height: 1; }
.bp-perf-kpi-unit { font-size: 12px; color: var(--bp-txt2); }
.bp-computed-box {
  background: var(--bp-s2); border: 1px solid var(--bp-bdr);
  border-radius: 8px; padding: 9px 12px; font-size: 12px;
}
.bp-computed-row { display: flex; justify-content: space-between; padding: 3px 0; }
.bp-c-key { color: var(--bp-txt2); }
.bp-c-val { font-weight: 700; color: var(--bp-cyan); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) {
  .bp-perf-grid { grid-template-columns: 1fr; }
  .bp-kpi-row   { grid-template-columns: 1fr 1fr; }
}

/* ── Balance form (sidebar gauche) ─────────────────────── */
#balance-panel { overflow-y: auto; }
.bal-aircraft-badge {
  display: flex; align-items: center; gap: 7px;
  margin: 10px 14px 4px;
  padding: 7px 12px;
  border-radius: 8px;
  background: rgba(var(--bp-acc-rgb),0.08);
  border: 1px solid rgba(var(--bp-acc-rgb),0.20);
  font-size: 12px; font-weight: 700; color: rgb(var(--bp-acc-rgb));
}
.bal-aircraft-badge i { font-size: 11px; }
.bal-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 200px; padding: 24px 16px;
  text-align: center; font-size: 12px; color: var(--bp-txt2); line-height: 1.5;
}
/* Station cards */
.bal-form { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px 16px; }
.bal-station {
  background: var(--bp-s2);
  border: 1px solid var(--bp-bdr);
  border-radius: 10px;
  padding: 9px 11px;
  transition: border-color .2s, background .2s;
}
.bal-station:hover { border-color: var(--bp-bdr-hi); background: var(--bp-s3); }
.bal-station-ld {
  background: rgba(0,160,90,0.07);
  border-color: rgba(0,160,90,0.18);
}
.bal-station-ld:hover { background: rgba(0,160,90,0.11); }
.bal-station-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.bal-station-lbl {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--bp-txt2);
}
/* Colored dot per station type */
.stn-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
/* Light mode station colors */
.s-front .bal-station-lbl { color: #1a60d8; }
.s-front .stn-dot          { background: #1a60d8; box-shadow: 0 0 4px rgba(26,96,216,0.4); }
.s-rear  .bal-station-lbl  { color: #7030c0; }
.s-rear  .stn-dot           { background: #7030c0; box-shadow: 0 0 4px rgba(112,48,192,0.4); }
.s-fuel  .bal-station-lbl  { color: #007a3a; }
.s-fuel  .stn-dot           { background: #007a3a; box-shadow: 0 0 4px rgba(0,122,58,0.4); }
.s-bag   .bal-station-lbl  { color: #b06000; }
.s-bag   .stn-dot           { background: #b06000; box-shadow: 0 0 4px rgba(176,96,0,0.4); }
.bal-station-ld .bal-station-lbl { color: #007a3a; }
/* Dark mode station colors */
[data-theme="dark"] .s-front .bal-station-lbl { color: #4a90ff; }
[data-theme="dark"] .s-front .stn-dot          { background: #4a90ff; box-shadow: 0 0 5px #4a90ff; }
[data-theme="dark"] .s-rear  .bal-station-lbl  { color: #a06ae8; }
[data-theme="dark"] .s-rear  .stn-dot           { background: #a06ae8; box-shadow: 0 0 5px #a06ae8; }
[data-theme="dark"] .s-fuel  .bal-station-lbl  { color: #00c07a; }
[data-theme="dark"] .s-fuel  .stn-dot           { background: #00c07a; box-shadow: 0 0 5px #00c07a; }
[data-theme="dark"] .s-bag   .bal-station-lbl  { color: #f09030; }
[data-theme="dark"] .s-bag   .stn-dot           { background: #f09030; box-shadow: 0 0 5px #f09030; }
[data-theme="dark"] .bal-station-ld .bal-station-lbl { color: #00c07a; }
/* Arm badge */
.arm-badge {
  font-size: 10px; color: var(--bp-txt2);
  background: var(--bp-s1); border: 1px solid var(--bp-bdr);
  border-radius: 5px; padding: 1px 7px;
  font-variant-numeric: tabular-nums;
}
/* Pulse dot for landing section */
.ld-pulse {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #007a3a;
  box-shadow: 0 0 0 3px rgba(0,122,58,0.2);
  animation: ldPulse 1.8s ease-in-out infinite;
}
[data-theme="dark"] .ld-pulse {
  background: #00c07a;
  box-shadow: 0 0 0 3px rgba(0,192,122,0.2);
}
@keyframes ldPulse { 0%,100%{box-shadow:0 0 0 3px rgba(0,160,80,0.2)} 50%{box-shadow:0 0 0 6px rgba(0,160,80,0.08)} }
/* Form layout within stations */
.bal-row   { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.bal-group { display: flex; flex-direction: column; gap: 3px; }
/* Labels */
.flabel {
  font-size: 10px; font-weight: 600; color: var(--bp-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
/* Inputs */
.bal-input {
  width: 100%; padding: 7px 9px;
  font-size: 13px; font-weight: 600; color: var(--bp-txt);
  background: var(--bp-s1); border: 1px solid var(--bp-bdr);
  border-radius: 7px; transition: border-color .15s, box-shadow .15s;
  -moz-appearance: textfield; box-sizing: border-box;
}
.bal-input::-webkit-inner-spin-button,
.bal-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.bal-input:focus { outline: none; border-color: rgb(var(--bp-acc-rgb)); box-shadow: 0 0 0 3px rgba(var(--bp-acc-rgb),0.12); }
.bal-readonly { background: var(--bp-s2); color: var(--bp-txt2); cursor: default; opacity: 0.7; }
/* Hints */
.input-hint { font-size: 10px; color: var(--bp-muted); margin-top: 3px; }
.bal-hint   { font-size: 10px; color: var(--bp-muted); margin-top: 5px; }

/* ── Print ─────────────────────────────────────────────── */
@media print {
  @page { margin: 1cm; size: A4; }

  body > * { display: none !important; }
  #bp-panel {
    display: flex !important;
    position: static !important;
    opacity: 1 !important; transform: none !important;
    width: 100% !important; height: auto !important;
    overflow: visible !important;
    background: #ffffff !important;
    padding-top: 0 !important;
    box-shadow: none !important;
  }
  #bp-content { display: flex !important; overflow: visible !important; }
  .bp-tab-section { display: flex !important; overflow: visible !important; height: auto !important; }
  #bp-mc-section, #bp-perf-section { display: flex !important; page-break-inside: avoid; }
  #bp-tabs, .bp-print-btn { display: none !important; }
  .bp-ac-header { border-bottom: 1px solid #ccc !important; background: #fff !important; padding-bottom: 6px !important; }
  .bp-disclaimer { background: #fffbea !important; color: #886000 !important; border: 1px solid #e0c060 !important; border-radius: 4px !important; margin-bottom: 6px !important; }
  .bp-card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .bp-kpi-card { background: #f8f8f8 !important; border: 1px solid #ddd !important; box-shadow: none !important; }
  .bp-badge-ok   { background: #e8f8f0 !important; color: #007a3a !important; border-color: #007a3a !important; }
  .bp-badge-warn { background: #fffbea !important; color: #886000 !important; border-color: #886000 !important; }
  .bp-badge-err  { background: #fef2f2 !important; color: #c0002a !important; border-color: #c0002a !important; }
  .bp-status-box.bp-status-ok   { background: #e8f8f0 !important; color: #007a3a !important; }
  .bp-status-box.bp-status-warn { background: #fffbea !important; color: #886000 !important; }
  .bp-status-box.bp-status-err  { background: #fef2f2 !important; color: #c0002a !important; }
  canvas { max-width: 100% !important; }
}

/* ── Nav pills flottants ─────────────────────────────────── */
#sidebar-tabs {
  position: absolute;
  top: 14px;
  left: calc(50vw + var(--sidebar-w) / 2);
  transform: translateX(-50%);
  z-index: 800;
  display: flex;
  gap: 2px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-radius: 99px;
  padding: 4px;
  box-shadow:
    0 4px 24px rgba(15,40,100,.18),
    0 1px 4px rgba(15,40,100,.08),
    0 0 0 1px rgba(255,255,255,.7);
  border-bottom: none;
  flex-shrink: unset;
  align-items: center;
  transition: left .25s ease, opacity .15s, transform .15s;
}
.sidebar-tab {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 16px;
  border-radius: 99px;
  font-size: 12px; font-weight: 600;
  color: rgba(30,50,100,.55);
  background: transparent; border: none;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
  border-bottom: none !important;
  margin-bottom: 0 !important;
}
.sidebar-tab .icon { flex-shrink: 0; }
.sidebar-tab:hover {
  background: rgba(59,130,246,.09);
  color: rgba(30,50,100,.85);
}
.sidebar-tab.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(59,130,246,.35);
  border-bottom-color: transparent !important;
}
.sidebar-tab.active .tab-badge {
  background: rgba(255,255,255,.25) !important;
  color: #fff !important;
}
/* Dark mode */
[data-theme="dark"] #sidebar-tabs {
  background: rgba(18,28,50,.90);
  box-shadow:
    0 4px 24px rgba(0,0,0,.45),
    0 0 0 1px rgba(255,255,255,.08);
}
[data-theme="dark"] .sidebar-tab { color: rgba(180,210,255,.5); }
[data-theme="dark"] .sidebar-tab:hover { background: rgba(255,255,255,.08); color: rgba(180,210,255,.85); }
[data-theme="dark"] .sidebar-tab.active { background: var(--brand); color: #fff; }

/* ── Quand le detail panel est ouvert (desktop) ─────────── */
/* Recentre la barre sur la zone carte restante + passe en icônes */
#detail-panel.open ~ #sidebar-tabs {
  left: calc(50vw + var(--sidebar-w) / 2 + var(--detail-panel-w) / 2);
}
#detail-panel.open ~ #sidebar-tabs .tab-label { display: none; }
#detail-panel.open ~ #sidebar-tabs .sidebar-tab {
  padding: 9px 13px;
  position: relative;
}
#detail-panel.open ~ #sidebar-tabs .sidebar-tab::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15,40,100,.88);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 7px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
  z-index: 9999;
}
#detail-panel.open ~ #sidebar-tabs .sidebar-tab:hover::after { opacity: 1; }

/* ── Titre de section actif ─────────────────────────────── */
#sidebar-section-label {
  display: flex; align-items: center;
  padding: 8px 14px;
  flex-shrink: 0;
  background: rgba(37,99,235,0.06);
  border-left: 3px solid var(--brand);
  border-bottom: 1px solid var(--border);
}
.section-label-text {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: var(--brand);
}
[data-theme="dark"] #sidebar-section-label {
  background: rgba(59,130,246,0.10);
}
[data-theme="dark"] .section-label-text {
  color: #93c5fd;
}

/* ── Barre d'actions sous les onglets ───────────────────── */
.tab-actions-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border-s);
  flex-shrink: 0;
}
.tab-actions-spacer { flex: 1; }
.tab-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px; line-height: 1.5;
}
.tab-badge-notam { background: var(--accent-dim); color: var(--brand); }
.tab-badge-vfr   { background: var(--vfr-dim);  color: var(--vfr); }
.tab-badge-mvfr  { background: var(--mvfr-dim); color: var(--mvfr); }
.tab-badge-ifr   { background: var(--ifr-dim);  color: var(--ifr); }
.tab-badge-lifr  { background: var(--lifr-dim); color: var(--lifr); }
/* Badge quand le tab est actif (fond brand) → blanc opaque */
.sidebar-tab.active .tab-badge {
  background: rgba(255,255,255,.25) !important;
  color: #fff !important;
}

/* ── NOTAM panel ─────────────────────────────────────────── */
.notam-count-badge {
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px;
}

#notam-list { flex: 1; overflow-y: auto; padding: 8px 8px 12px; }
#notam-list::-webkit-scrollbar { width: 4px; }
#notam-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.empty-state {
  text-align: center; color: var(--text-muted); font-size: 13px;
  line-height: 1.6; padding: 32px 16px;
}
.empty-state strong { color: var(--text); }
.empty-state code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; font-size: 12px; }

/* ── Groupes par terrain / FIR ──────────────────────────── */
.notam-loc-group { margin-bottom: 6px; }

.notam-loc-header {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 6px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border-s);
  transition: background .12s; user-select: none;
}
.notam-loc-header:hover { background: var(--surface-3); }
.notam-loc-header.route { border-left: 3px solid var(--brand); }

.notam-loc-icao {
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700;
  color: var(--text); flex-shrink: 0;
}
.notam-loc-name {
  font-size: 11px; color: var(--text-muted); flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notam-loc-cats { display: flex; gap: 3px; flex-shrink: 0; }
.loc-cat-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.notam-loc-count {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  background: var(--border); border-radius: 99px; padding: 1px 6px; flex-shrink: 0;
}
.notam-loc-chevron {
  font-size: 11px; color: var(--text-dim); flex-shrink: 0;
  transition: transform .2s; display: inline-block;
}
.notam-loc-chevron.rotated { transform: rotate(-90deg); }

/* Bouton "ignorer tout" sur l'en-tête de groupe */
.notam-loc-dismiss-all {
  margin-left: auto;
  flex-shrink: 0;
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  background: transparent; border: 1px solid transparent;
  border-radius: 4px; cursor: pointer; padding: 0;
  transition: background .12s, color .12s, border-color .12s;
  opacity: 0;
}
.notam-loc-header:hover  .notam-loc-dismiss-all,
.notam-loc-header:focus  .notam-loc-dismiss-all,
.notam-loc-header:focus-within .notam-loc-dismiss-all { opacity: 1; }
.notam-loc-dismiss-all:hover {
  background: rgba(239,68,68,.12); color: #ef4444; border-color: rgba(239,68,68,.25);
}

.notam-loc-items { padding-left: 6px; margin-top: 3px; }
.notam-loc-items.collapsed { display: none; }

/* Rétrocompat si anciens sélecteurs existent encore */
.notam-group { margin-bottom: 5px; }
.notam-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 8px; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--text-muted);
  background: var(--surface-2); border-radius: 6px; margin-bottom: 3px; cursor: pointer;
  transition: background .12s;
}
.notam-group-header:hover { background: var(--surface-3); }
.notam-group-count {
  background: var(--border); border-radius: 99px; padding: 1px 7px;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
}

.notam-item {
  padding: 8px 10px; border-radius: var(--radius); border-left: 3px solid transparent;
  margin-bottom: 3px; cursor: pointer; background: var(--surface); border: 1px solid var(--border-s);
  border-left-width: 3px; box-shadow: var(--shadow); transition: box-shadow .12s, background .12s;
  position: relative; overflow: hidden; touch-action: pan-y;
}
.notam-item:hover { box-shadow: var(--shadow-md); background: var(--surface-2); }
.notam-item.active { background: var(--accent-dim); border-left-color: var(--brand); }

.notam-item-header { display: flex; align-items: center; gap: 5px; margin-bottom: 3px; }
.notam-item-id { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 11px; font-weight: 700; color: var(--text); }
/* Badge catégorie compact (remplace .notam-item-loc) */
.notam-item-cat {
  font-size: 9px; font-weight: 700; color: #fff; letter-spacing: .3px; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0; white-space: nowrap;
}
.notam-item-loc {  /* conservé pour rétrocompat */
  font-size: 11px; font-weight: 700; color: var(--brand);
  background: var(--accent-dim); padding: 1px 6px; border-radius: 4px;
}
.notam-item-valid { margin-left: auto; font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.notam-item-valid.expired { color: var(--ifr); }
.notam-item-valid.active  { color: var(--vfr); font-weight: 600; }
.notam-item-text {
  font-size: 11px; color: var(--text-muted); line-height: 1.4;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

/* Bouton ignorer NOTAM */
.notam-dismiss-btn {
  flex-shrink: 0; margin-left: 4px;
  width: 18px; height: 18px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 4px; cursor: pointer;
  font-size: 9px; font-weight: 700; line-height: 1;
  background: transparent; color: var(--text-dim);
  opacity: 0; transition: opacity .15s, background .15s, color .15s;
}
.notam-item:hover .notam-dismiss-btn { opacity: 1; }
.notam-dismiss-btn:hover { background: var(--ifr-dim, rgba(239,68,68,.12)); color: var(--ifr); opacity: 1; }

/* ── Section NOTAMs ignorés (restauration individuelle) ── */
.notam-dismissed-section {
  margin: 10px 0 2px; border-radius: 10px;
  border: 1px solid var(--border-s); overflow: hidden;
}
.notam-dismissed-hd {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; background: var(--surface-2);
  cursor: pointer; user-select: none;
}
.notam-dismissed-title {
  display: flex; align-items: center; gap: 5px;
  flex: 1; font-size: 11px; font-weight: 600; color: var(--text-dim);
}
.notam-restore-all-btn {
  font-size: 10px; font-weight: 700; color: var(--brand);
  background: none; border: 1px solid transparent; border-radius: 5px;
  cursor: pointer; padding: 2px 7px; font-family: inherit; flex-shrink: 0;
}
.notam-restore-all-btn:hover { background: var(--accent-dim); border-color: var(--brand); }
.notam-dismissed-chevron {
  font-size: 11px; color: var(--text-dim);
  transition: transform .2s; flex-shrink: 0;
}
.notam-dismissed-section.open .notam-dismissed-chevron { transform: rotate(180deg); }
.notam-dismissed-list {
  display: none; flex-direction: column; gap: 4px; padding: 6px 8px 8px;
}
.notam-dismissed-section.open .notam-dismissed-list { display: flex; }
.notam-dismissed-item {
  padding: 7px 10px; border-radius: 8px;
  border-left: 3px solid; background: var(--surface);
  opacity: 0.6; transition: opacity .15s;
}
.notam-dismissed-item:hover { opacity: 0.9; }
.notam-dismissed-item-hd {
  display: flex; align-items: center; gap: 5px; margin-bottom: 3px;
}
.notam-dismissed-loc {
  font-size: 11px; font-weight: 700; color: var(--text-dim); flex-shrink: 0;
}
.notam-restore-btn {
  margin-left: auto; display: flex; align-items: center;
  background: none; border: none; cursor: pointer;
  color: var(--brand); padding: 2px 5px; border-radius: 4px;
}
.notam-restore-btn:hover { background: var(--accent-dim); }
.notam-dismissed-text { color: var(--text-dim); font-size: 11px; }

/* ── Weather sidebar ─────────────────────────────────────── */

.btn-print {
  display: flex; align-items: center; gap: 5px; padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; box-shadow: var(--shadow); transition: all .15s; font-family: inherit;
}
.btn-print:hover:not(:disabled) { color: var(--text); border-color: var(--brand); }
.btn-print:disabled { opacity: .45; cursor: not-allowed; }

/* Bouton icône seule (tab bar) */
.btn-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border-s);
  border-radius: 7px; color: var(--text-muted);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-icon:hover:not(:disabled) { color: var(--text); border-color: var(--brand); background: var(--accent-dim); }
.btn-icon:disabled { opacity: .4; cursor: not-allowed; }

/* Bouton Cartes dans la tab bar (onglet météo) */
.btn-charts-mini {
  display: flex; align-items: center; gap: 4px; padding: 5px 8px;
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,0.20);
  border-radius: 6px; font-size: 11px; font-weight: 600; color: var(--brand);
  cursor: pointer; transition: all .15s; white-space: nowrap;
  font-family: inherit;
}
.btn-charts-mini:hover { background: rgba(37,99,235,0.18); border-color: var(--brand); }
.btn-charts-mini.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ── Slider de prévisualisation temporelle ── */
#wx-time-slider-container {
  padding: 8px 12px 6px; flex-shrink: 0;
  border-bottom: 1px solid var(--border-s);
  margin-bottom: 2px;
}
.wx-time-slider { display: flex; flex-direction: column; gap: 6px; }

/* Ligne titre + heure sélectionnée */
.wx-time-slider-header {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.wx-time-slider-title {
  display: flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase;
  color: var(--text-dim);
}
.wx-time-slider-title .icon { opacity: .7; }
.wx-time-current {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  letter-spacing: .3px; transition: color .15s;
  white-space: nowrap;
}
.wx-time-current.active { color: var(--brand); }

/* Ligne slider + bornes UTC */
.wx-time-slider-row { display: flex; align-items: center; gap: 6px; }
.wx-time-label-start, .wx-time-label-end {
  font-size: 10px; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; flex-shrink: 0; letter-spacing: .2px;
}
.wx-time-slider-row input[type="range"] {
  flex: 1; height: 4px; cursor: pointer; accent-color: var(--brand);
  border-radius: 4px;
}

/* Carte en mode TAF preview */
.wx-sb-item.taf-preview { border-style: dashed; }
.wx-sb-taf-label { color: var(--brand) !important; font-weight: 600; }

/* ── Barre de refresh météo ──────────────────────────────── */
.wx-refresh-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 12px 5px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  gap: 8px; flex-shrink: 0;
}
.wx-refresh-bar.hidden { display: none; }
.wx-last-update { font-size: 10.5px; color: var(--text-muted); flex: 1; font-variant-numeric: tabular-nums; }
.wx-refresh-btn {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 600; font-family: inherit;
  padding: 4px 9px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.wx-refresh-btn:hover { background: var(--accent-dim); color: var(--brand); border-color: var(--brand); }
.wx-refresh-btn:disabled { opacity: .5; cursor: default; }
@keyframes wx-spin { to { transform: rotate(360deg); } }
.wx-refresh-btn.spinning svg { animation: wx-spin .7s linear infinite; }

#wx-sidebar-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
#wx-sidebar-list::-webkit-scrollbar { width: 4px; }
#wx-sidebar-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

/* Weather sidebar items → card style */
.wx-sb-item {
  position: relative;
  background: var(--surface); border: 1px solid var(--border-s);
  border-radius: 10px; border-left-width: 3px;
  cursor: pointer; box-shadow: var(--shadow); transition: box-shadow .15s, background .15s;
  overflow: hidden; text-align: left; width: 100%;
  flex-shrink: 0; /* empêche la compression → force le scroll de la liste */
}

/* Swipe-to-dismiss hint sur les items NOTAM (iPad / touch) */
.notam-swipe-hint {
  position: absolute; right: 0; top: 0; bottom: 0; width: 72px;
  background: var(--ifr);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: #fff; font-size: 10px; font-weight: 600;
  opacity: 0; pointer-events: none;
  border-radius: 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0;
  transition: opacity .1s;
}
.wx-sb-item:hover { box-shadow: var(--shadow-md); }
[data-theme="light"] .wx-sb-item:hover { background: #f9fbff; }
[data-theme="dark"]  .wx-sb-item:hover { background: var(--surface-2); }
.wx-sb-item.VFR  { border-left-color: var(--vfr); }
.wx-sb-item.MVFR { border-left-color: var(--mvfr); }
.wx-sb-item.IFR  { border-left-color: var(--ifr); }
.wx-sb-item.LIFR { border-left-color: var(--lifr); }
.wx-sb-item.highlighted .leaflet-marker { transform: scale(1.3); }
/* Carte active (panneau de détail ouvert) — même style que .notam-item.active */
.wx-sb-item.active { background: var(--accent-dim); border-left-color: var(--brand); }

/* Bouton radar sur la carte */
.wx-radar-btn {
  position: absolute; bottom: 52px; left: 10px; z-index: 500;
  display: flex; align-items: center; gap: 6px;
  background: rgba(30,41,59,.82); color: #94a3b8;
  border: 1.5px solid rgba(148,163,184,.25);
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  cursor: pointer; backdrop-filter: blur(4px);
  transition: background .15s, color .15s, border-color .15s;
}
.wx-radar-btn:hover {
  background: rgba(51,65,85,.92); color: #e2e8f0;
}
.wx-radar-btn.active {
  background: rgba(14,165,233,.18); color: #38bdf8;
  border-color: rgba(56,189,248,.5);
}
.wx-radar-btn.active svg { stroke: #38bdf8; }
.wx-radar-btn.hidden { display: none; }
[data-theme="light"] .wx-radar-btn {
  background: rgba(255,255,255,.92); color: #475569;
  border-color: rgba(0,0,0,.12);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
[data-theme="light"] .wx-radar-btn:hover {
  background: #f1f5f9; color: #1e293b;
}
[data-theme="light"] .wx-radar-btn.active {
  background: rgba(14,165,233,.1); color: #0284c7;
  border-color: rgba(14,165,233,.4);
}

/* Légende météo sur la carte */
#wx-map-legend {
  position: absolute; bottom: 52px; right: 10px; z-index: 500;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(30,41,59,.82); color: #f1f5f9;
  padding: 7px 10px; border-radius: 8px; font-size: 11px;
  pointer-events: none; backdrop-filter: blur(4px);
}
#wx-map-legend.hidden { display: none; }
[data-theme="light"] #wx-map-legend {
  background: rgba(255,255,255,.92); color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.wx-legend-item { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.wx-legend-dot {
  width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0;
  border: 2px solid rgba(255,255,255,.5);
}
.wx-legend-dot.VFR  { background: var(--vfr); }
.wx-legend-dot.MVFR { background: var(--mvfr); }
.wx-legend-dot.IFR  { background: var(--ifr); }
.wx-legend-dot.LIFR { background: var(--lifr); }

.wx-sb-head { display: flex; align-items: center; gap: 7px; padding: 9px 12px 5px; }
.wx-sb-icao { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: .5px; }
.wx-sb-role {
  font-size: 9px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
}
.wx-sb-role.dep  { background: var(--vfr-dim);  color: var(--vfr); }
.wx-sb-role.arr  { background: var(--ifr-dim);  color: var(--ifr); }
.wx-sb-role.via  { background: var(--mvfr-dim); color: var(--mvfr); }
.wx-sb-role.alt  { background: var(--lifr-dim); color: var(--lifr); }
.wx-sb-cat {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
}
.wx-sb-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.wx-sb-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.wx-sb-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.wx-sb-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }
.wx-sb-cat { margin-left: auto; }

.wx-sb-name { font-size: 11px; color: var(--text-muted); padding: 0 12px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wx-sb-age { font-size: 9.5px; color: var(--text-dim); padding: 0 12px 3px; }
.dp-wx-age { color: var(--text-dim); }
.dp-wx-cell-full { grid-column: 1 / -1; }
.wx-sb-conditions { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 12px 9px; }
.wx-sb-condition-chip {
  display: flex; align-items: center; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 7px; font-size: 11px; font-weight: 500; color: var(--text-muted);
  transition: background .12s;
}
.wx-sb-condition-chip.warn { color: var(--ifr); border-color: rgba(220,38,38,0.2); background: var(--ifr-dim); }
.wx-sb-condition-chip.taf  { color: var(--text-dim); font-size: 10px; border-style: dashed; }

.wx-sb-nearest {
  font-size: 10px; color: var(--text-dim); font-style: italic;
  padding: 0 12px 8px; display: flex; align-items: center; gap: 4px;
}

/* nearest banner inside sidebar */
.wx-nearest-banner {
  display: flex; align-items: flex-start; gap: 7px;
  background: var(--accent-dim); border: 1px solid rgba(37,99,235,0.2);
  border-radius: 6px; padding: 8px 10px; margin: 0 0 6px;
  font-size: 11px; color: var(--brand); line-height: 1.5;
}

/* ── Map ─────────────────────────────────────────────────── */
#map-container { flex: 1; position: relative; overflow: hidden; isolation: isolate; }
#map { width: 100%; height: 100%; position: relative; z-index: 0; }

/* Badge heure météo sur la carte */
#wx-map-time-badge {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 500; pointer-events: none;
  display: flex; align-items: center; gap: 5px;
  padding: 5px 8px 5px 11px; border-radius: 20px;
  background: rgba(15, 23, 42, 0.82); backdrop-filter: blur(6px);
  color: #f1f5f9; font-size: 11px; font-weight: 600; letter-spacing: .2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  white-space: nowrap;
  transition: opacity .2s;
}
#wx-map-time-badge.hidden { display: none; }
/* Mode live : le badge entier devient interactif via le bouton refresh */
#wx-map-time-badge.wx-badge-live { pointer-events: auto; padding-right: 4px; }
#wx-map-time-badge.wx-badge-preview { background: rgba(37, 99, 235, 0.88); }
[data-theme="light"] #wx-map-time-badge {
  background: rgba(255,255,255,0.92); color: #1e293b;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
[data-theme="light"] #wx-map-time-badge.wx-badge-preview {
  background: rgba(219, 234, 254, 0.96); color: #1d4ed8;
}
/* Bouton refresh dans le badge */
.wx-badge-refresh {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: inherit;
  cursor: pointer; transition: background .15s, transform .2s;
  flex-shrink: 0;
}
.wx-badge-refresh:hover { background: rgba(255,255,255,.28); }
.wx-badge-refresh:active { transform: rotate(180deg); }
[data-theme="light"] .wx-badge-refresh { background: rgba(0,0,0,.08); }
[data-theme="light"] .wx-badge-refresh:hover { background: rgba(0,0,0,.15); }

/* Leaflet overrides */
.leaflet-control-layers { border: none !important; box-shadow: var(--shadow-md) !important; border-radius: var(--radius) !important; background: var(--sidebar-bg) !important; }
.leaflet-control-layers-base label { font-size: 13px; color: var(--text); }
.leaflet-popup-content { font-size: 13px; line-height: 1.5; max-height: 380px; overflow-y: auto; }
.leaflet-popup-content-wrapper { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; background: var(--sidebar-bg) !important; color: var(--text) !important; border: 1px solid var(--border) !important; }
.leaflet-popup-tip { background: var(--sidebar-bg) !important; }
.leaflet-bar a { background: var(--sidebar-bg) !important; color: var(--text) !important; border-color: var(--border) !important; }
.leaflet-bar a:hover { background: var(--surface-2) !important; }

/* ── NOTAM popup ──────────────────────────────────────────── */
.notam-popup { min-width: 260px; max-width: 340px; }
.popup-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.popup-badge { font-size: 10px; font-weight: 700; color: #fff; padding: 2px 8px; border-radius: 99px; letter-spacing: .4px; text-transform: uppercase; }
.popup-id    { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; }
.popup-loc   { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.popup-valid { font-size: 12px; margin-bottom: 6px; }
.popup-alt   { font-size: 11px; color: var(--text-muted); background: var(--surface-2); padding: 2px 8px; border-radius: 4px; display: inline-block; margin-bottom: 6px; }
.popup-text  { font-size: 12px; color: var(--text); white-space: pre-wrap; word-break: break-word; border-top: 1px solid var(--border); padding-top: 6px; max-height: 180px; overflow-y: auto; }
.popup-more  { margin-top: 6px; font-size: 11px; color: var(--brand); cursor: pointer; text-decoration: underline; }
.popup-actions {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  padding-top: 6px; border-top: 1px solid var(--border);
}
.popup-btn-detail {
  font-size: 11px; font-weight: 600; color: var(--brand);
  background: var(--accent-dim); border: none; border-radius: 4px;
  padding: 3px 8px; cursor: pointer; font-family: inherit;
}
.popup-btn-detail:hover { background: var(--brand); color: #fff; }
.popup-btn-dismiss {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 8px; cursor: pointer; font-family: inherit;
  margin-left: auto;
}
.popup-btn-dismiss:hover { background: rgba(239,68,68,.1); color: #ef4444; border-color: #ef4444; }

/* ── Weather map popup (wxd-*) ──────────────────────────── */
.wx-map-popup .leaflet-popup-content-wrapper { border-radius: 12px !important; padding: 0 !important; min-width: 240px; box-shadow: 0 4px 20px rgba(0,0,0,.18) !important; }
.wx-map-popup .leaflet-popup-content { margin: 0 !important; max-height: 520px; overflow-y: auto; }

.wxd-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px 7px; border-bottom: 1px solid var(--border-s); }
.wxd-icao { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 15px; font-weight: 700; color: var(--text); }
.wxd-cat {
  margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; padding: 3px 9px; border-radius: 99px;
}
.wxd-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.wxd-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.wxd-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.wxd-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }
.wxd-name { font-size: 11px; color: var(--text-muted); padding: 4px 14px 6px; }
.wxd-nearest { font-size: 10.5px; color: var(--brand); font-style: italic; padding: 0 14px 6px; display: flex; align-items: center; gap: 5px; }

.wxd-table { width: 100%; border-collapse: collapse; padding: 0 14px; }
.wxd-row td { padding: 3px 14px; font-size: 11.5px; }
.wxd-icon { color: var(--text-dim); width: 22px; }
.wxd-val  { color: var(--text-muted); }

.wxd-raw { margin: 8px 14px 6px; }
.wxd-raw-label { font-size: 9px; font-weight: 700; color: var(--text-dim); letter-spacing: .6px; text-transform: uppercase; margin-bottom: 3px; }
.wxd-raw-text {
  background: var(--surface-2); border: 1px solid var(--border-s); border-radius: 6px;
  padding: 7px 9px; font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-size: 10px; color: var(--text-muted); line-height: 1.6; white-space: pre-wrap; word-break: break-all;
}

.wxd-taf { margin: 0 14px 10px; }
.wxd-taf summary { font-size: 11px; font-weight: 600; color: var(--mvfr); cursor: pointer; padding: 4px 0; list-style: none; }
.wxd-taf summary::-webkit-details-marker { display: none; }
.wxd-taf summary::before { content: '▶ '; font-size: 9px; }
.wxd-taf[open] summary::before { content: '▼ '; }
.wxd-taf-details { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.wxd-taf-period { background: var(--surface-2); border-radius: 6px; padding: 6px 8px; font-size: 11px; }
.wxd-taf-head { font-weight: 600; color: var(--text); margin-bottom: 2px; }
.wxd-taf-conds { color: var(--text-muted); }

/* ── Map weather popup v2 (compact) ─────────────────────── */
/* Nearest station note */
.wx-pop-nearest { display: flex; align-items: flex-start; gap: 6px; background: var(--accent-dim); border-bottom: 1px solid rgba(37,99,235,0.12); padding: 8px 12px; font-size: 10.5px; color: var(--brand); line-height: 1.5; }
/* Header: ICAO + name + category pill */
.wx-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding: 11px 14px 7px; }
.wx-pop-icao { font-family: 'JetBrains Mono','SF Mono',monospace; font-size: 16px; font-weight: 800; display: block; line-height: 1; color: var(--text); }
.wx-pop-name { font-size: 10.5px; color: var(--text-muted); margin-top: 3px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 155px; }
.wx-pop-iata { font-size: 9.5px; color: var(--text-dim); font-family: 'JetBrains Mono',monospace; margin-top: 1px; display: block; }
.wx-pop-cat { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 99px; flex-shrink: 0; margin-top: 2px; letter-spacing: .3px; }
.wx-pop-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.wx-pop-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.wx-pop-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.wx-pop-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }
/* Meta row: role badge + obs time */
.wx-pop-meta { display: flex; align-items: center; gap: 7px; padding: 0 14px 9px; border-bottom: 1px solid var(--border-s); }
.wx-pop-role { font-size: 9.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; letter-spacing: .4px; }
.wx-pop-role.dep { background: var(--vfr-dim);  color: var(--vfr); }
.wx-pop-role.arr { background: var(--ifr-dim);  color: var(--ifr); }
.wx-pop-role.alt { background: var(--lifr-dim); color: var(--lifr); }
.wx-pop-role.via { background: var(--surface-3); color: var(--text-muted); }
.wx-pop-time { font-size: 10px; color: var(--text-dim); font-family: 'JetBrains Mono',monospace; margin-left: auto; }
/* Condition rows */
.wx-pop-body { padding: 9px 14px 6px; display: flex; flex-direction: column; gap: 5px; }
.wx-pop-row { display: flex; align-items: baseline; gap: 7px; font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.wx-pop-row.alert { color: var(--ifr); font-weight: 600; }
.wx-pop-row.dim   { font-size: 11px; color: var(--text-dim); }
/* Raw METAR / TAF block */
.wx-pop-raw { font-family: 'JetBrains Mono','SF Mono',monospace; font-size: 9.5px; color: var(--text-dim); line-height: 1.65; background: var(--surface-2); border: 1px solid var(--border-s); border-radius: 6px; padding: 6px 8px; margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
/* TAF visual panel — always visible */
.wx-pop-taf { border-top: 1px solid var(--border-s); padding: 10px 12px 8px; }
.wx-pop-taf-title { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-dim); margin-bottom: 7px; }
/* TAF groups */
.taf-groups { display: flex; flex-direction: column; gap: 5px; }
.taf-group { background: var(--surface-2); border: 1px solid var(--border-s); border-radius: 7px; padding: 6px 9px 7px; }
.taf-group.taf-group-active { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }

/* Bannière prévisualisation dans le panneau de détail */
/* Chip "Prévisualisation HH:MM UTC" — dans la section TAF */
.dp-wx-preview-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: color-mix(in srgb, var(--brand) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-radius: 20px; padding: 3px 9px;
  font-size: 10.5px; font-weight: 600; color: var(--brand);
  margin-bottom: 10px;
}
.dp-wx-preview-chip strong { font-weight: 800; }

/* Chip "Station la plus proche · ICAO" — dans la section Observation */
.dp-wx-near-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface-2);
  border: 1px solid var(--border-s);
  border-radius: 20px; padding: 3px 9px;
  font-size: 10.5px; font-weight: 500; color: var(--text-muted);
  margin-top: 0; margin-bottom: 8px;
}
.dp-wx-near-chip strong { color: var(--text); font-weight: 700; }
.taf-group-head { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.taf-type { font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.taf-type-base  { background: var(--surface-3);  color: var(--text-muted); }
.taf-type-fm    { background: var(--accent-dim);  color: var(--brand); }
.taf-type-becmg { background: rgba(234,179,8,.14); color: #92680a; }
.taf-type-tempo { background: var(--lifr-dim);    color: var(--lifr); }
.taf-type-prob  { background: rgba(234,179,8,.14); color: #92680a; }
[data-theme="dark"] .taf-type-becmg { color: #fcd34d; }
[data-theme="dark"] .taf-type-prob  { color: #fcd34d; }
.taf-time { font-family: 'JetBrains Mono',monospace; font-size: 9.5px; color: var(--text-muted); flex: 1; }
.taf-cat { font-size: 8.5px; font-weight: 800; padding: 2px 6px; border-radius: 4px; flex-shrink: 0; }
.taf-cat.VFR  { background: var(--vfr-dim);  color: var(--vfr); }
.taf-cat.MVFR { background: var(--mvfr-dim); color: var(--mvfr); }
.taf-cat.IFR  { background: var(--ifr-dim);  color: var(--ifr); }
.taf-cat.LIFR { background: var(--lifr-dim); color: var(--lifr); }


.taf-group-body { display: flex; flex-direction: column; gap: 2px; }
.taf-val { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-muted); line-height: 1.4; }
.taf-val .icon { flex-shrink: 0; opacity: .7; }
.taf-wx { color: var(--text); font-size: 11px; }
.taf-empty { font-size: 11px; color: var(--text-dim); font-style: italic; }
.taf-raw-fallback { margin-top: 0; }
/* No-data inline text */
.wx-pop-nodata { font-size: 11px; color: var(--text-muted); font-style: italic; padding: 8px 14px; }
/* Footer action buttons */
.wx-pop-footer { display: flex; gap: 5px; padding: 8px 14px 12px; border-top: 1px solid var(--border-s); }
.wx-pop-btn { flex: 1; padding: 6px 4px; background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 7px; font-size: 10.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; text-align: center; box-shadow: var(--shadow); transition: background .12s, color .12s, border-color .12s; line-height: 1; white-space: nowrap; font-family: inherit; }
.wx-pop-btn:hover { background: var(--surface-3); color: var(--text); }
.wx-pop-btn.via-btn  { color: var(--brand);  border-color: var(--accent-dim); }
.wx-pop-btn.via-btn:hover  { background: var(--accent-dim); }
.wx-pop-btn.alt-btn  { color: var(--lifr);  border-color: var(--lifr-dim); }
.wx-pop-btn.alt-btn:hover  { background: var(--lifr-dim); }
/* ── Cartes button (header) ─────────────────────────────── */
.btn-charts {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 99px; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  transition: all .18s; font-family: inherit;
}
.btn-charts:hover { color: var(--brand); border-color: var(--brand); background: var(--accent-dim); }
.btn-charts.active { color: var(--brand); border-color: var(--brand); background: var(--accent-dim); }

/* ═══════════════════════════════════════════════════════════
   NAVLOG MODAL
   ═══════════════════════════════════════════════════════════ */
.navlog-modal {
  position: fixed; inset: 0; z-index: 3000;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 24px 16px; overflow-y: auto;
}
.navlog-modal.hidden { display: none; }
.navlog-modal-box {
  background: var(--surface); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35), 0 0 0 1px var(--border);
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column;
  overflow: hidden;
}

/* ── Header ── */
.navlog-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, #1e3a5f 0%, #1d4ed8 100%);
  color: #fff; gap: 12px;
}
.navlog-modal-title-wrap {
  display: flex; align-items: center; gap: 10px; min-width: 0;
}
.navlog-modal-title {
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.navlog-modal-subtitle {
  font-size: 13px; font-weight: 600; opacity: .75;
  font-family: 'JetBrains Mono', monospace; white-space: nowrap;
}
.navlog-modal-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.navlog-print-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 8px;
  background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 12.5px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: background .15s;
}
.navlog-print-btn:hover { background: rgba(255,255,255,.25); }
.navlog-close-btn {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2);
  color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.navlog-close-btn:hover { background: rgba(255,255,255,.25); }

/* ── Body ── */
.navlog-modal-body { padding: 20px; overflow-x: auto; }

/* ── Info cards ── */
.nl-info-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;
}
.nl-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; min-width: 100px;
}
.nl-card-route { flex: 2; min-width: 200px; }
.nl-card-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-muted); margin-bottom: 3px;
}
.nl-card-val {
  font-size: 14px; font-weight: 700; color: var(--text);
  font-family: 'JetBrains Mono', monospace;
}
.nl-card-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Table ── */
.nl-table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); }
.nl-table {
  width: 100%; border-collapse: collapse;
  font-size: 12.5px;
}
.nl-table thead tr {
  background: #1e3a5f; color: #fff;
}
.nl-table th {
  padding: 9px 8px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  border-right: 1px solid rgba(255,255,255,.1);
  white-space: nowrap;
}
.nl-table th:last-child { border-right: none; }
.nl-th-unit { font-weight: 400; opacity: .65; font-size: 10px; }
.nl-th-pos { text-align: left; padding-left: 12px; min-width: 160px; }
.nl-th-obs { min-width: 120px; }

.nl-table tbody tr { border-bottom: 1px solid var(--border); }
.nl-table tbody tr:last-child { border-bottom: none; }

.nl-row-dep { background: #eff6ff; }
.nl-row-arr { background: #fef2f2; }
.nl-row-via { background: var(--surface); }
.nl-row-total { background: var(--surface-2); border-top: 2px solid #1e3a5f !important; }
.dark .nl-row-dep { background: rgba(37,99,235,.12); }
.dark .nl-row-arr { background: rgba(220,38,38,.1); }

.nl-td-pos { padding: 10px 8px 10px 12px; text-align: left; }
.nl-td-num { padding: 10px 8px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; }
.nl-td-cum { color: var(--text-muted); font-size: 11px; }
.nl-td-time { padding: 10px 8px; text-align: center; font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 600; }
.nl-td-reel { background: repeating-linear-gradient(135deg,transparent,transparent 4px,rgba(0,0,0,.03) 4px,rgba(0,0,0,.03) 8px); }
.nl-td-blank { background: repeating-linear-gradient(135deg,transparent,transparent 4px,rgba(0,0,0,.03) 4px,rgba(0,0,0,.03) 8px); }
.nl-td-obs { min-width: 100px; background: repeating-linear-gradient(135deg,transparent,transparent 4px,rgba(0,0,0,.03) 4px,rgba(0,0,0,.03) 8px); }
.nl-td-cl { padding: 6px 4px; text-align: center; }
.nl-cl-wrap { display: flex; gap: 3px; justify-content: center; flex-wrap: wrap; }
.nl-cl-o { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--border-strong, #aaa); display: inline-block; }
.nl-x { color: var(--text-muted); font-size: 11px; }

.nl-pos-icao { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.nl-pos-name { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.nl-badge {
  font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 99px;
  letter-spacing: .3px; flex-shrink: 0;
}
.nl-badge-dep { background: #dcfce7; color: #166534; }
.nl-badge-arr { background: #fee2e2; color: #991b1b; }
.nl-badge-via { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.dark .nl-badge-dep { background: rgba(22,101,52,.3); color: #86efac; }
.dark .nl-badge-arr { background: rgba(153,27,27,.3); color: #fca5a5; }

/* ── Footer ── */
.nl-footer {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px; margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.nl-footer-note { font-size: 11px; color: var(--text-muted); line-height: 1.6; }
.nl-footer-brand { font-size: 11px; color: var(--text-muted); white-space: nowrap; }

/* ── Route 3D modal ──────────────────────────────────────── */
.route3d-modal {
  position: fixed; inset: 0; z-index: 9995;
  background: #0f172a;
}
.route3d-modal.hidden { display: none; }
.route3d-canvas {
  display: block; width: 100%; height: 100%;
  touch-action: none; cursor: grab;
}
.route3d-canvas:active { cursor: grabbing; }
.route3d-toolbar {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 10px 16px;
  background: rgba(15,23,42,.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.route3d-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: #94a3b8;
  letter-spacing: .02em;
}
.route3d-title svg { opacity: .7; flex-shrink: 0; }
.route3d-toolbar-actions { display: flex; align-items: center; gap: 6px; }
.route3d-btn {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: #94a3b8; font-size: 12px; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; cursor: pointer;
  transition: background .15s, color .15s;
}
.route3d-btn:hover { background: rgba(255,255,255,.12); color: #e2e8f0; }
.route3d-close-btn { color: #f87171; border-color: rgba(248,113,113,.25); }
.route3d-close-btn:hover { background: rgba(248,113,113,.12); color: #fca5a5; }
.route3d-btn-off { color: #64748b; border-color: rgba(100,116,139,.2); }
.route3d-btn-off:hover { background: rgba(100,116,139,.1); color: #94a3b8; }
.route3d-hints {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px;
  font-size: 11px; color: rgba(148,163,184,.5);
  pointer-events: none; white-space: nowrap;
}
.route3d-hints span::before { content: '·'; margin-right: 6px; }
.route3d-legend {
  position: absolute; top: 60px; right: 14px;
  max-height: calc(100vh - 110px);
  background: rgba(15,23,42,.82); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 8px;
  padding: 10px 12px; min-width: 150px; max-width: 200px;
  display: flex; flex-direction: column; gap: 0;
}
.route3d-legend-scroll {
  overflow-y: auto; flex: 1;
  scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent;
  padding-right: 2px;
}
.route3d-legend.hidden { display: none; }
.route3d-legend-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: #64748b; margin-bottom: 7px;
}
.route3d-legend-item {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; color: #94a3b8; margin-bottom: 4px;
}
.route3d-legend-item:last-child { margin-bottom: 0; }
.route3d-legend-swatch {
  width: 12px; height: 12px; border-radius: 2px;
  border: 1.5px solid; flex-shrink: 0;
}
.route3d-legend-swatch.conflict { box-shadow: 0 0 0 1.5px currentColor; }
.route3d-legend-sep {
  height: 1px; background: rgba(255,255,255,.07); margin: 6px 0;
}
/* Zone toggle rows */
.route3d-zone-row {
  cursor: pointer; border-radius: 4px; padding: 3px 4px 3px 2px;
  transition: background .12s; user-select: none; align-items: flex-start;
}
.route3d-zone-row:hover { background: rgba(255,255,255,.07); }
.route3d-zone-row .zone-lbl { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.zone-type-tag { font-size: 10px; font-weight: 700; letter-spacing: .03em; line-height: 1.3; }
.zone-name { font-size: 11px; color: #cbd5e1; line-height: 1.3; }
.zone-eye { color: #475569; flex-shrink: 0; display: flex; align-items: center; }
.zone-eye-off { display: none; }
/* Hidden state */
.route3d-zone-row.zone-hidden .zone-lbl { opacity: .35; text-decoration: line-through; }
.route3d-zone-row.zone-hidden .route3d-legend-swatch { opacity: .25; }
.route3d-zone-row.zone-hidden .zone-eye-on { display: none; }
.route3d-zone-row.zone-hidden .zone-eye-off { display: flex; }
.route3d-loading {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #64748b; font-size: 13px;
  background: #0f172a; pointer-events: none;
  transition: opacity .3s;
}
.route3d-loading.hidden { opacity: 0; pointer-events: none; }
.route3d-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid rgba(99,102,241,.2);
  border-top-color: #6366f1;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-navlog-3d { border-color: rgba(99,102,241,.35); color: #818cf8; }
.btn-navlog-3d:hover { background: rgba(99,102,241,.12); color: #a5b4fc; border-color: #818cf8; }

/* ── Charts modal ───────────────────────────────────────── */
.charts-modal {
  position: fixed; inset: 0; z-index: 9990;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: charts-fade-in .2s ease;
}
.charts-modal.hidden { display: none; }
@keyframes charts-fade-in { from { opacity: 0; } to { opacity: 1; } }

.charts-modal-box {
  background: var(--sidebar-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 1060px;
  height: calc(100vh - 32px); max-height: 840px;
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: charts-slide-up .22s cubic-bezier(.25,.8,.25,1);
}
@keyframes charts-slide-up {
  from { transform: translateY(18px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Header */
.charts-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.charts-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--text);
}
.charts-modal-subtitle {
  font-size: 11px; font-weight: 400; color: var(--text-dim);
  padding-left: 2px;
}
.charts-modal-close {
  width: 30px; height: 30px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 50%; cursor: pointer;
  color: var(--text-muted); display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s; flex-shrink: 0;
}
.charts-modal-close:hover { background: var(--surface-3); color: var(--text); }

/* Tab bar */
.charts-tabs {
  display: flex; gap: 2px; padding: 8px 14px 0;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0; overflow-x: auto;
}
.charts-tab {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px 8px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; white-space: nowrap;
  transition: color .15s, border-color .15s;
  font-family: inherit;
  margin-bottom: -1px;
}
.charts-tab:hover { color: var(--text); }
.charts-tab.active { color: var(--brand); border-bottom-color: var(--brand); }

/* Content area */
.charts-content { flex: 1; overflow: hidden; display: flex; flex-direction: column; min-height: 0; }

/* Panel */
.charts-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.charts-panel.active { display: flex; }

/* Info strip */
.charts-info-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 18px;
  background: var(--surface-2); border-bottom: 1px solid var(--border-s);
  flex-shrink: 0;
}
.charts-info-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.charts-info-name { font-size: 12px; font-weight: 700; color: var(--text); }
.charts-info-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Source buttons */
.charts-sources { display: flex; gap: 6px; flex-shrink: 0; }
.charts-src-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; font-size: 10.5px; font-weight: 600;
  color: var(--text-muted); text-decoration: none;
  transition: all .15s; white-space: nowrap;
  box-shadow: var(--shadow);
}
.charts-src-btn:hover { color: var(--text); background: var(--surface-3); }
.charts-src-btn.charts-src-primary {
  color: var(--brand); border-color: var(--accent-dim); background: var(--accent-dim);
}
.charts-src-btn.charts-src-primary:hover { background: rgba(37,99,235,0.18); border-color: var(--brand); }

/* Iframe wrapper */
.charts-iframe-wrap {
  flex: 1; min-height: 0; position: relative;
  background: var(--surface-2);
}
.charts-iframe {
  width: 100%; height: 100%;
  border: none; display: block;
}
/* Status overlay (loading / unavailable) */
.charts-status-overlay {
  position: absolute; inset: 0; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
}
.charts-status-overlay.hidden-overlay { display: none; }
.charts-status-inner {
  display: flex; flex-direction: column; align-items: center; gap: 9px;
  max-width: 340px; text-align: center; padding: 28px 20px;
}
.charts-status-spinner { line-height: 1; }
.charts-status-title {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.charts-status-desc {
  font-size: 11.5px; color: var(--text-muted); line-height: 1.55;
}
.charts-status-icon { color: var(--text-dim); }
.charts-status-icon.warn { color: #f59e0b; }
.charts-status-actions {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 4px;
}
.charts-status-retry {
  background: var(--brand); color: #fff; border: none; border-radius: 6px;
  padding: 5px 13px; font-size: 11.5px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: filter .12s;
}
.charts-status-retry:hover { filter: brightness(1.12); }
.charts-status-sofia {
  background: var(--surface); color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 13px; font-size: 11.5px; font-weight: 600;
  text-decoration: none; transition: border-color .12s, color .12s;
}
.charts-status-sofia:hover { color: var(--text); border-color: var(--brand); }
.charts-iframe { position: relative; z-index: 1; }

/* Caption */
.charts-caption {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 8px 18px 10px;
  font-size: 10.5px; color: var(--text-dim); line-height: 1.5;
  background: var(--sidebar-bg); border-top: 1px solid var(--border-s);
  flex-shrink: 0;
}
.charts-caption strong { color: var(--text-muted); }
.charts-caption svg { flex-shrink: 0; margin-top: 1px; }

/* Official badge on chart name */
.charts-official-badge {
  display: inline-flex; align-items: center;
  font-size: 9px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase;
  background: var(--vfr-dim); color: var(--vfr);
  padding: 1px 6px; border-radius: 99px; margin-left: 7px; vertical-align: middle;
}

/* Tab badge (MF = Météo-France officiel) */
.charts-tab-badge {
  font-size: 8.5px; font-weight: 800; letter-spacing: .3px;
  padding: 1px 5px; border-radius: 99px; margin-left: 4px; vertical-align: middle;
}
.charts-tab-badge-official { background: var(--vfr-dim); color: var(--vfr); }

/* Echeance navigation */
.charts-ech-nav {
  display: flex; align-items: center; gap: 3px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 3px 7px;
}
.charts-ech-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 15px; line-height: 1;
  padding: 1px 5px; border-radius: 4px;
  transition: background .12s, color .12s; font-family: inherit;
}
.charts-ech-btn:hover { background: var(--surface-3); color: var(--text); }
.charts-ech-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 600; color: var(--text);
  min-width: 108px; text-align: center; white-space: nowrap;
}
/* Toggle zone France / EUROC */
.charts-zone-btn {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 5px; padding: 2px 7px;
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; transition: all .13s; font-family: inherit;
  margin-left: 2px; letter-spacing: .3px;
}
.charts-zone-btn:hover { color: var(--text); border-color: var(--brand); }
.charts-zone-btn.euroc { color: var(--brand); background: var(--accent-dim); border-color: rgba(37,99,235,0.25); }

/* Charts modal — responsive */
@media (max-width: 720px) {
  .charts-info-strip { flex-wrap: wrap; gap: 6px; }
  .charts-ech-nav { order: 3; width: 100%; justify-content: center; }
  .charts-sources { flex-wrap: wrap; }
  .charts-modal-subtitle { display: none; }
  .charts-tab { padding: 6px 9px 7px; font-size: 11px; }
  .charts-tab-badge { display: none; }
}
@media (max-height: 640px) {
  .charts-modal-box { height: calc(100vh - 16px); border-radius: 12px; }
  .charts-info-strip { padding: 7px 14px; }
  .charts-caption { display: none; }
}

/* ── Print selection modal ──────────────────────────────── */
.print-modal {
  position: fixed; inset: 0; z-index: 9995;
  background: rgba(0,0,0,.52); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.print-modal.hidden { display: none; }

.print-modal-box {
  background: var(--sidebar-bg); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 430px;
  display: flex; flex-direction: column; overflow: hidden;
  animation: charts-slide-up .2s cubic-bezier(.25,.8,.25,1);
}
.print-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 11px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.print-modal-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text);
}
.print-modal-close {
  width: 28px; height: 28px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s;
}
.print-modal-close:hover { background: var(--surface-3); color: var(--text); }

.print-modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.print-modal-subtitle { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.print-section-group { display: flex; flex-direction: column; gap: 7px; }
.print-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-dim); display: flex; align-items: center; gap: 7px;
  padding-bottom: 5px; border-bottom: 1px solid var(--border-s);
}
.print-section-badge {
  font-size: 9px; background: var(--vfr-dim); color: var(--vfr);
  padding: 1px 6px; border-radius: 99px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
}

.print-option {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color .13s, background .13s; user-select: none;
}
.print-option:hover:not(.disabled) { border-color: var(--brand); background: var(--accent-dim); }
.print-option.disabled { opacity: .48; cursor: not-allowed; pointer-events: none; }
.print-option input[type="checkbox"] {
  width: 15px; height: 15px; flex-shrink: 0; cursor: pointer; accent-color: var(--brand);
}
.print-option-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.print-option-name { font-size: 12px; font-weight: 600; color: var(--text); }
.print-option-ech {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  color: var(--text-muted); font-weight: 500;
}
.print-option-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }
.print-option-status { font-size: 10px; font-weight: 600; flex-shrink: 0; white-space: nowrap; }
.print-option-status.available   { color: var(--vfr); }
.print-option-status.unavailable { color: var(--ifr); }
.print-option-status.checking    { color: var(--text-dim); }

.print-modal-footer {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 12px 18px 16px; border-top: 1px solid var(--border-s);
}
.print-modal-cancel {
  padding: 8px 16px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 12px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all .13s; font-family: inherit;
}
.print-modal-cancel:hover { color: var(--text); border-color: var(--brand); }
.print-modal-confirm {
  padding: 8px 18px; background: var(--brand); border: none;
  border-radius: var(--radius); font-size: 12px; font-weight: 700; color: #fff;
  cursor: pointer; transition: filter .13s; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
}
.print-modal-confirm:hover:not(:disabled) { filter: brightness(1.1); }
.print-modal-confirm:disabled { opacity: .5; cursor: not-allowed; }

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(4px); }
.modal-overlay.hidden { display: none; }
.modal-box { background: var(--sidebar-bg); border: 1px solid var(--border); border-radius: 16px; padding: 24px; width: 100%; max-width: 600px; max-height: 80vh; overflow-y: auto; position: relative; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 28px; height: 28px; background: var(--surface-2); border: none; border-radius: 50%; font-size: 18px; cursor: pointer; color: var(--text-muted); display: flex; align-items: center; justify-content: center; transition: background .15s; }
.modal-close:hover { background: var(--surface-3); }
.modal-notam-id   { font-family: 'JetBrains Mono', monospace; font-size: 18px; font-weight: 700; margin-bottom: 4px; color: var(--text); }
.modal-badge      { display: inline-flex; font-size: 11px; font-weight: 700; color: #fff; padding: 3px 10px; border-radius: 99px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .4px; }
.modal-meta       { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.modal-meta strong{ color: var(--text); }
.modal-divider    { border: none; border-top: 1px solid var(--border); margin: 12px 0; }
.modal-text       { font-size: 13px; white-space: pre-wrap; line-height: 1.7; font-family: 'JetBrains Mono', 'SF Mono', 'Consolas', monospace; color: var(--text); }

/* ── Toast ──────────────────────────────────────────────── */
#toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 9998; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 11px 16px; border-radius: var(--radius); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-lg); max-width: 360px; transform: translateX(120%); transition: transform .3s cubic-bezier(.25,.8,.25,1); border-left: 4px solid transparent; }
.toast.show { transform: translateX(0); }
.toast.error   { background: var(--sidebar-bg); color: var(--ifr);  border-left-color: var(--ifr); }
.toast.warning { background: var(--sidebar-bg); color: #b45309;     border-left-color: #f59e0b; }
.toast.success { background: var(--sidebar-bg); color: var(--vfr);  border-left-color: var(--vfr); }
.toast.info    { background: var(--sidebar-bg); color: var(--brand); border-left-color: var(--brand); }
[data-theme="dark"] .toast.warning { color: #fbbf24; }

/* ── Btn link ───────────────────────────────────────────── */
.btn-link { background: none; border: none; cursor: pointer; color: var(--brand); font-size: 12px; font-weight: 600; padding: 0; }
.btn-link:hover { text-decoration: underline; }

/* ── Sidebar weather helpers (kept) ─────────────────────── */
.wx-sb-nodata { margin-left: auto; font-size: 11px; color: var(--text-dim); }
.wx-sb-top { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.wx-role-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px; letter-spacing: .4px; }
.wx-role-badge.dep { background: var(--vfr-dim);  color: var(--vfr); }
.wx-role-badge.arr { background: var(--ifr-dim);  color: var(--ifr); }
.wx-role-badge.alt { background: var(--lifr-dim); color: var(--lifr); }
.wx-role-badge.via { background: var(--surface-3); color: var(--text-muted); }
.wx-btn-badge { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .4px; background: rgba(255,255,255,.25); padding: 1px 5px; border-radius: 4px; margin-left: 2px; }
/* ── Print weather table (wxd-*) ────────────────────────── */
.wxd-section { margin-bottom: 18px; }
.wxd-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); margin-bottom: 8px; padding-bottom: 4px; border-bottom: 1px solid var(--border); }
.wxd-table { width: 100%; border-collapse: collapse; }
.wxd-table tr { border-bottom: 1px solid var(--border-s); }
.wxd-table tr.alert td { color: var(--ifr); font-weight: 700; }
.wxd-table td { padding: 7px 8px; font-size: 13.5px; vertical-align: middle; }
.wxd-table td:first-child { font-size: 16px; width: 28px; text-align: center; }
.wxd-table td:nth-child(2) { width: 100px; color: var(--text-muted); font-size: 12px; }
.wxd-table td:nth-child(3) { white-space: nowrap; }
.wxd-notaf { font-size: 12px; color: var(--text-muted); font-style: italic; }
.airport-label { background: none; border: none; font-size: 11px; font-weight: 700; color: var(--brand); white-space: nowrap; margin-top: 2px; text-shadow: 1px 1px 0 #fff, -1px 1px 0 #fff, 1px -1px 0 #fff, -1px -1px 0 #fff; }

/* Dot coloré DEP/ARR/VIA */
.ap-dot { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid #fff; }

/* Popup DEP / ARR (marqueur seul avant route complète) */
.single-ap-popup .leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,.18) !important;
  padding: 0 !important;
}
.single-ap-popup .leaflet-popup-content { margin: 10px 13px !important; }

/* Scrollbar styling */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── Backdrop (tablet) ──────────────────────────────────── */
#dp-backdrop {
  display: none;
  position: absolute; inset: 0; z-index: 299;
  background: rgba(0,0,0,.3); backdrop-filter: blur(1px);
}

/* ═══════════════════════════════════════════════════════════
   TABLET / iPad  (≤ 900 px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {

  /* Sidebar plus étroite pour laisser de la place à la carte */
  :root { --sidebar-w: 280px; --detail-panel-w: 310px; }

  /* Le layout devient reference pour les overlays */
  #main-layout { position: relative; }

  /* ── Detail panel : overlay flottant au-dessus de la carte ── */
  #detail-panel {
    position: absolute;
    left: var(--sidebar-w);
    top: 0; bottom: 0;
    z-index: 900; /* > sidebar-tabs (800) pour que le bouton fermer reste accessible */
    border-right: none;
    box-shadow: 6px 0 28px rgba(0,0,0,.28);
  }

  /* Backdrop visible uniquement sur tablet quand le panel est ouvert */
  #dp-backdrop.visible { display: block; }

  /* Quand le panel de détail est ouvert, cacher le menu flottant (overlay plein écran) */
  #detail-panel.open ~ #map-container #layer-picker-wrap { z-index: 1; }
  #detail-panel.open ~ #sidebar-tabs {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-6px);
    transition: opacity .15s, transform .15s;
  }

  /* ── Touch targets ≥ 44 px ────────────────────────────────── */
  /* Inputs ICAO route — cartes DEP/ARR */
  .re-stop-card .re-icao { font-size: 18px; }

  /* Bouton Charger */
  #btn-briefing { min-height: 48px; font-size: 14px; }

  /* Onglets — mode icône seule pour éviter le débordement */
  .tab-label { display: none; }
  .sidebar-tab {
    min-height: 44px;
    font-size: 13px;
    padding: 9px 13px;
    position: relative;
  }
  /* Tooltip CSS au survol */
  .sidebar-tab::after {
    content: attr(data-label);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15,40,100,.88);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 7px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
    z-index: 9999;
  }
  .sidebar-tab:hover::after { opacity: 1; }

  /* Options row corridor / FL max */
  .re-number-input { min-height: 36px; }
  .re-date-input, .re-time-input { min-height: 36px; }

  /* Items NOTAM */
  .notam-item { padding: 10px 12px; }

  /* Items météo sidebar */
  .wx-sb-item { padding-bottom: 2px; }

  /* Boutons +Survol, +Dégagement */
  .re-add-btn { padding: 6px 12px; min-height: 36px; }
  .btn-add-row { min-height: 36px; }
  .btn-remove  { min-height: 36px; min-width: 36px; }

  /* Header : réduire légèrement les paddings */
  #header { padding: 0 10px; }

  /* Boutons d'action header */
  #btn-theme { min-height: 36px; padding: 5px 10px; }

  /* Settings row : passage en 2 lignes sur sidebar étroite */
  .re-settings-row { flex-wrap: wrap; gap: 6px 10px; }
  .re-setting-sep { display: none; }

  /* Leaflet controls : plus grands pour le toucher */
  .leaflet-bar a { width: 34px !important; height: 34px !important; line-height: 34px !important; font-size: 18px !important; }
}

/* ── Print ──────────────────────────────────────────────── */
@media print {
  body > *:not(#print-briefing) { display: none !important; }
  #print-briefing { display: block !important; }
}

/* ══════════════════════════════════════════════════════════
   HELP MODAL
   ══════════════════════════════════════════════════════════ */

/* Bouton ? dans le header */
.btn-help {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--border-s);
  color: var(--text-dim); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.btn-help:hover { background: var(--accent-dim); color: var(--brand); border-color: var(--brand); }

/* Overlay */
.help-modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; }
.help-modal.hidden { display: none; }
.help-overlay { position: absolute; inset: 0; background: rgba(0,0,0,.45); backdrop-filter: blur(3px); }

/* Panel */
.help-panel {
  position: relative; z-index: 1;
  width: 560px; max-width: calc(100vw - 24px);
  max-height: calc(100vh - 40px);
  background: var(--surface); border: 1.5px solid var(--border-s);
  border-radius: 18px; box-shadow: 0 24px 64px rgba(0,0,0,.35);
  display: flex; flex-direction: column; overflow: hidden;
  animation: helpSlideIn .22s cubic-bezier(.34,1.4,.64,1);
}
@keyframes helpSlideIn {
  from { opacity: 0; transform: translateY(18px) scale(.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Header */
.help-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--border-s);
  flex-shrink: 0;
}
.help-header-brand { display: flex; align-items: center; gap: 10px; }
.help-header-title { font-size: 16px; font-weight: 800; color: var(--text); line-height: 1; }
.help-header-title em { font-style: normal; color: var(--brand); }
.help-header-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.help-close {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border-s);
  color: var(--text-dim); cursor: pointer; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.help-close:hover { background: var(--border-s); }

/* Body */
.help-body { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 22px; }

/* Section */
.help-section { display: flex; flex-direction: column; gap: 10px; }
.help-section-label {
  display: flex; align-items: center; gap: 9px;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-dim);
}
.help-step-num {
  width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0;
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center;
}

/* Cards */
.help-cards { display: flex; flex-direction: column; gap: 6px; }
.help-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 13px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-s);
  transition: border-color .15s;
}
.help-card:hover { border-color: var(--border); }
.help-card-highlight { border-color: var(--brand); background: var(--accent-dim); }
.help-card-icon {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.help-card-title { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.help-card-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.55; }
.help-card-desc code {
  font-family: 'JetBrains Mono', monospace; font-size: 10.5px;
  background: var(--surface); border: 1px solid var(--border-s);
  border-radius: 4px; padding: 1px 4px; color: var(--brand);
}
.help-card-desc strong { color: var(--text); font-weight: 700; }

/* Catégories météo */
.help-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.help-cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-s);
}
.help-cat-badge {
  font-size: 10px; font-weight: 800; padding: 3px 7px;
  border-radius: 6px; flex-shrink: 0; letter-spacing: .4px;
}
.help-cat-badge.vfr  { background: var(--vfr-dim);  color: var(--vfr); }
.help-cat-badge.mvfr { background: var(--mvfr-dim); color: var(--mvfr); }
.help-cat-badge.ifr  { background: var(--ifr-dim);  color: var(--ifr); }
.help-cat-badge.lifr { background: var(--lifr-dim); color: var(--lifr); }
.help-cat-title { font-size: 11px; font-weight: 700; color: var(--text); }
.help-cat-desc  { font-size: 10.5px; color: var(--text-muted); margin-top: 1px; }

/* Footer */
.help-footer {
  font-size: 10.5px; color: var(--text-dim); line-height: 1.6;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-s);
}
.help-footer strong { color: var(--text-muted); font-weight: 600; }

@media (max-width: 600px) {
  .help-cat-grid { grid-template-columns: 1fr; }
  .help-panel { border-radius: 14px; }
}

/* ── Sélecteur d'avion (topbar) ─────────────────────────── */
.aircraft-selector {
  position: relative;
}
.btn-aircraft {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px;
  background: var(--accent-dim);
  border: 1.5px solid var(--brand);
  border-radius: 8px;
  color: var(--brand);
  font-size: 12px; font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
  white-space: nowrap;
  box-shadow: 0 0 0 3px rgba(59,130,246,.08);
}
.btn-aircraft:hover { background: var(--brand); color: #fff; box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.btn-aircraft .chevron { opacity: .5; transition: transform .15s; }
.btn-aircraft.open .chevron { transform: rotate(180deg); }

.aircraft-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 260px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 1200;
  overflow: hidden;
  padding: 4px;
}
.aircraft-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12.5px; font-weight: 500;
  color: var(--text);
  transition: background .12s;
}
.aircraft-item:hover { background: var(--surface-2); }
.aircraft-item.selected { background: rgba(59,130,246,.1); color: var(--brand); font-weight: 700; }
.aircraft-item-tas { font-size: 11px; color: var(--text-dim); font-weight: 400; }
.aircraft-group-label {
  padding: 5px 12px 3px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--text-dim); pointer-events: none;
}
.aircraft-group-sep { margin-top: 4px; border-top: 1px solid var(--border); padding-top: 7px; }
.dark .aircraft-dropdown { box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.aircraft-login-hint {
  display: flex; align-items: center; gap: 6px;
  margin: 4px 4px 2px; padding: 8px 10px;
  border-radius: 6px; border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-dim); line-height: 1.4;
}
.aircraft-login-hint svg { flex-shrink: 0; opacity: .6; }
.aircraft-login-hint a { color: var(--brand); text-decoration: none; font-weight: 600; }
.aircraft-login-hint a:hover { text-decoration: underline; }
/* ── Profile Modal ──────────────────────────────────────── */
.profile-modal-box { max-width: 440px; }
.profile-header {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 20px;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; }
.profile-avatar-large {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; overflow: hidden;
  border: 2px solid var(--border);
}
.profile-avatar-large.has-photo { background: transparent; }
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-avatar-upload-btn {
  position: absolute; bottom: 0; right: 0;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 2px solid var(--sidebar-bg);
  transition: opacity .15s;
}
.profile-avatar-upload-btn:hover { opacity: .85; }
.profile-header-info { flex: 1; min-width: 0; }
.profile-name-input {
  width: 100%; padding: 6px 10px; font-size: 15px; font-weight: 600;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 8px; color: var(--text); outline: none;
  transition: border-color .15s;
}
.profile-name-input:focus { border-color: var(--brand); }
.profile-meta {
  margin-top: 5px; font-size: 12px; color: var(--text-dim);
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.profile-since { font-size: 11px; }
.profile-club-field { margin-bottom: 16px; }
.profile-club-label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 5px; letter-spacing: .04em;
}
#profile-club-select {
  width: 100%; border: 1.5px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text);
  font-size: 13px; outline: none; box-sizing: border-box;
  transition: border-color .15s; padding: 8px 10px; cursor: pointer;
}
#profile-club-select:focus { border-color: var(--brand); }
.profile-upload-status {
  font-size: 12px; padding: 6px 10px; border-radius: 6px;
  background: var(--surface-2); color: var(--text-dim); margin-bottom: 14px;
}
.profile-upload-status.error { background: #fef2f2; color: #b91c1c; }
.dark .profile-upload-status.error { background: rgba(239,68,68,.12); color: #fca5a5; }
.profile-actions { display: flex; justify-content: flex-end; }
.profile-save-btn {
  padding: 8px 20px; background: var(--brand); color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.profile-save-btn:hover { opacity: .85; }
.profile-save-btn:disabled { opacity: .5; cursor: not-allowed; }

.aircraft-item-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.aircraft-item-info-btn {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border: none; border-radius: 4px;
  background: transparent; color: var(--text-dim);
  cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s;
  flex-shrink: 0; padding: 0;
}
.aircraft-item:hover .aircraft-item-info-btn { opacity: 1; }
.aircraft-item-info-btn:hover { background: rgba(59,130,246,.12); color: var(--brand); }

/* ── Aircraft Info Modal content ────────────────────────── */
.ac-info-title { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ac-info-reg { font-size: 12px; color: var(--text-dim); font-family: 'JetBrains Mono', monospace; margin-bottom: 2px; }
.ac-info-section-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--text-dim); margin: 10px 0 5px; }
.ac-info-grid { display: grid; gap: 2px; }
.ac-info-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 8px; border-radius: 6px; }
.ac-info-row:nth-child(even) { background: var(--surface-2); }
.ac-info-label { font-size: 13px; color: var(--text-muted); }
.ac-info-value { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ac-info-unit { font-size: 11px; font-weight: 400; color: var(--text-dim); margin-left: 3px; }

/* ── Labels de segment (vue Route) ──────────────────────── */
.route-seg-label {
  display: inline-flex; align-items: center; gap: 0;
  background: #1e40af;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 2px 10px rgba(0,0,0,.35), 0 0 0 2px rgba(255,255,255,.9);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.seg-hdg {
  font-size: 10.5px; font-weight: 700;
  color: rgba(255,255,255,.75);
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 7px 4px 9px;
  letter-spacing: .5px;
}
.seg-dist {
  font-size: 11.5px; font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  padding: 4px 9px 4px 7px;
  border-left: 1px solid rgba(255,255,255,.25);
}
.seg-time {
  font-size: 11px; font-weight: 700;
  color: #1e40af;
  background: #fff;
  padding: 4px 9px;
  pointer-events: auto;
  position: relative;
  cursor: help;
}
.seg-time::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #f1f5f9;
  font-size: 10.5px;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  line-height: 1.45;
  padding: 7px 10px;
  border-radius: 8px;
  white-space: normal;
  width: 180px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  z-index: 1200;
}
.seg-time:hover::after { opacity: 1; }
.route-seg-hint {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(100,116,139,.3);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 10px; color: #64748b; font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.dark .route-seg-label { box-shadow: 0 2px 10px rgba(0,0,0,.55), 0 0 0 2px rgba(30,45,80,.9); }
.dark .route-seg-hint { background: rgba(18,28,50,.92); color: #94a3b8; border-color: rgba(255,255,255,.1); }

/* ── Label dégagement sur carte ─────────────────────────── */
.alt-seg-label {
  display: inline-flex; align-items: center; gap: 0;
  background: #c2410c;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.3), 0 0 0 2px rgba(255,255,255,.9);
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, -50%);
  overflow: hidden;
}
.alt-seg-dist {
  font-size: 11px; font-weight: 700;
  color: #fff;
  font-family: 'JetBrains Mono', monospace;
  padding: 3px 8px;
}
.alt-seg-time {
  font-size: 11px; font-weight: 700;
  color: #c2410c;
  background: #fff;
  padding: 3px 8px;
  border-left: 1px solid rgba(255,255,255,.3);
}

/* ── Bouton altitude sur segment ────────────────────────── */
.seg-alt {
  font-size: 10px; font-weight: 700;
  border-radius: 0 20px 20px 0;
  padding: 0 8px;
  height: 100%; display: flex; align-items: center;
  border: none; cursor: pointer;
  pointer-events: auto;   /* ← annule le pointer-events:none du parent */
  transition: background .15s, color .15s;
}
.seg-alt-set {
  background: #16a34a; color: #fff;
}
.seg-alt-set:hover { background: #15803d; }
.seg-alt-empty {
  background: rgba(255,255,255,.18); color: rgba(255,255,255,.8);
  border-left: 1px solid rgba(255,255,255,.25);
}
.seg-alt-empty:hover { background: rgba(255,255,255,.32); color: #fff; }

/* ── Popup édition altitude ─────────────────────────────── */
.alt-edit-popup .leaflet-popup-content-wrapper {
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.18);
  padding: 0;
}
.alt-edit-popup .leaflet-popup-content { margin: 0; width: auto !important; }
.aep-inner { padding: 14px 16px 12px; min-width: 200px; }
.aep-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 10px;
}
.aep-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.aep-inp {
  flex: 1; padding: 6px 10px;
  background: var(--surface-2); border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--text);
  font-family: inherit; outline: none; width: 90px;
}
.aep-inp:focus { border-color: var(--brand); }
.aep-unit { font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.aep-hints { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.aep-hint {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  background: var(--accent-dim); color: var(--brand);
  border: 1px solid var(--brand); border-radius: 99px;
  cursor: pointer; transition: background .12s;
}
.aep-hint:hover { background: var(--brand); color: #fff; }
.aep-actions { display: flex; justify-content: flex-end; gap: 6px; }
.aep-btn-ok {
  padding: 5px 14px; border-radius: 8px;
  background: var(--brand); color: #fff;
  border: none; font-size: 12px; font-weight: 700; cursor: pointer;
}
.aep-btn-ok:hover { filter: brightness(1.1); }
.aep-btn-clear {
  padding: 5px 10px; border-radius: 8px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border-s); font-size: 11px; cursor: pointer;
}
.aep-btn-clear:hover { color: #ef4444; border-color: #ef4444; }

/* ── Panel espace aérien ────────────────────────────────── */
#airspace-panel {
  border-top: 1px solid var(--border-s);
  padding: 10px 14px 4px;
}
.asp-header {
  display: flex; align-items: center; gap: 7px;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: 8px;
}
.asp-header svg { color: var(--brand); flex-shrink: 0; }
.asp-title { flex: 1; }
.asp-badge {
  font-size: 9.5px; font-weight: 800; padding: 1px 6px;
  border-radius: 99px; line-height: 1.4;
}
.asp-badge-warn { background: #fef3c7; color: #d97706; }
.asp-badge-info { background: var(--accent-dim); color: var(--brand); }
.asp-hint { font-size: 10px; color: var(--text-muted); font-weight: 400; font-style: italic; }
.asp-content { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.asp-empty { font-size: 11.5px; color: var(--text-muted); padding: 4px 0 8px; line-height: 1.5; }
.asp-leg {
  border: 1px solid var(--border-s); border-radius: 10px;
  overflow: hidden; background: var(--surface);
}
.asp-leg-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 10px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-s);
}
.asp-leg-route { font-size: 11.5px; font-weight: 700; color: var(--text); font-family: 'JetBrains Mono', monospace; }
.asp-leg-alt   { font-size: 10px; color: var(--text-muted); }
.asp-leg-alt em { font-style: normal; color: var(--text-dim); }
.asp-zone {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border-s);
}
.asp-zone:last-child { border-bottom: none; }
.asp-zone-hoverable {
  cursor: pointer;
  transition: background 0.12s;
}
.asp-zone-hoverable:hover {
  background: var(--surface-2);
  border-radius: 4px;
}
.asp-zone-pill {
  font-size: 9.5px; font-weight: 800; padding: 2px 6px;
  border-radius: 4px; white-space: nowrap; flex-shrink: 0; margin-top: 1px;
}
.asp-zone-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.asp-zone-name  { font-size: 11px; font-weight: 600; color: var(--text); }
.asp-zone-range { font-size: 10px; color: var(--text-dim); }

/* ── Profil vertical espace aérien ────────────────────────── */
.asp-profile-wrap {
  background: #f8fafc;
  border: 1px solid var(--border-s);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 6px;
}
.asp-profile {
  width: 100%;
  display: block;
}
.asp-list-title {
  font-size: 10.5px;
  font-weight: 800;
  color: #d97706;
  padding: 4px 0 2px;
  display: flex;
  align-items: center;
  gap: 4px;
}
/* État "rafraîchissement en cours" */
#airspace-panel.asp-refreshing .asp-profile-wrap,
#airspace-panel.asp-refreshing .asp-leg,
#airspace-panel.asp-refreshing .asp-empty {
  opacity: .45;
  transition: opacity .15s;
}
#airspace-panel.asp-refreshing .asp-header::after {
  content: '';
  display: inline-block;
  width: 8px; height: 8px; flex-shrink: 0;
  border-radius: 50%;
  border: 1.5px solid var(--brand);
  border-top-color: transparent;
  animation: asp-spin .6s linear infinite;
  margin-left: 2px;
}
@keyframes asp-spin { to { transform: rotate(360deg); } }

.asp-expand-btn {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; flex-shrink: 0;
  background: none; border: 1px solid var(--border-s);
  border-radius: 6px; cursor: pointer;
  color: var(--text-muted); transition: background .15s, color .15s;
  padding: 0;
}
.asp-expand-btn:hover { background: var(--surface-2); color: var(--brand); }
.asp-3d-btn {
  width: auto; padding: 0 8px; gap: 5px;
  font-size: 11px; font-weight: 600;
  border-color: rgba(99,102,241,.35); color: #818cf8;
}
.asp-3d-btn:hover { background: rgba(99,102,241,.1); color: #a5b4fc; border-color: #818cf8; }

/* ── Modal profil plein écran ─────────────────────────────── */
.asp-modal {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.55); z-index: 9999;
  align-items: center; justify-content: center;
  padding: 20px;
}
.asp-modal.open { display: flex; }
.asp-modal-inner {
  background: #fff; border-radius: 16px;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
  width: min(860px, 100%); max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden; position: relative;
  padding: 20px 24px 16px;
}
.asp-modal-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text-dim);
  margin-bottom: 14px;
}
.asp-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 30px; height: 30px;
  background: var(--surface-2); border: 1px solid var(--border-s);
  border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: background .15s, color .15s;
}
.asp-modal-close:hover { background: var(--border-s); color: var(--text); }
.asp-modal-body { flex: 1; overflow-y: auto; }
.asp-modal-body .asp-profile-wrap { margin-bottom: 0; border-radius: 10px; }
.asp-modal-body .asp-profile { width: 100%; display: block; }

/* ── Points tournants draggables ─────────────────────────── */
.wp-drag-marker {
  width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
}
.wp-drag-marker:active { cursor: grabbing; }
.wp-drag-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2.5px solid #2563eb;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
  transition: transform .1s;
}
.wp-drag-marker:hover .wp-drag-dot { transform: scale(1.4); border-color: #1d4ed8; }

/* Label du point tournant */
.wp-label {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 700;
  font-family: 'JetBrains Mono','SF Mono',monospace;
  color: #1e40af;
  background: rgba(255,255,255,.88);
  border: 1px solid #93c5fd;
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
  line-height: 1.4;
}
.wp-label-generic {
  font-weight: 500;
  font-style: italic;
  color: #6b7280;
  background: rgba(255,255,255,.75);
  border-color: var(--border);
}

/* Popup de renommage du point tournant */
.wp-popup-wrap .leaflet-popup-content-wrapper { padding: 0 !important; border-radius: 10px !important; }
.wp-popup-wrap .leaflet-popup-content { margin: 0 !important; }
.wp-rename-form { padding: 11px 12px 10px; width: 176px; }
.wp-name-input {
  width: 100%; box-sizing: border-box;
  font-family: 'JetBrains Mono','SF Mono',monospace;
  font-size: 12px; font-weight: 600;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.wp-name-input:focus { border-color: var(--brand); }
.wp-rename-actions { display: flex; gap: 6px; margin-top: 8px; }
.wp-btn-save, .wp-btn-del {
  flex: 1; padding: 6px 4px;
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  border: none; border-radius: 7px; cursor: pointer;
  transition: filter .15s;
}
.wp-btn-save { background: var(--brand); color: #fff; }
.wp-btn-save:hover { filter: brightness(1.12); }
.wp-btn-del { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.wp-btn-del:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* ── Points tournants custom dans la sidebar ── */
.wp-sidebar-row {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 6px 8px 6px 8px;
  width: 100%;
}
.wp-sidebar-grip {
  color: var(--text-dim); flex-shrink: 0; cursor: grab;
}
.wp-sidebar-pin { flex-shrink: 0; }
.wp-sidebar-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: var(--text);
}
.wp-sidebar-name strong { color: var(--brand); }
.wp-sidebar-name-generic strong { color: var(--text-muted); }
.wp-sidebar-btn {
  background: transparent; border: none; padding: 2px 3px;
  cursor: pointer; border-radius: 5px; color: var(--text-dim); flex-shrink: 0;
  display: flex; align-items: center; transition: background .12s, color .12s;
  -webkit-user-drag: none; user-drag: none;
}
.wp-sidebar-btn:hover { background: var(--surface-3); color: var(--text); }
.wp-sidebar-btn-del:hover { color: #ef4444; background: rgba(239,68,68,.1); }
.wp-sidebar-btn-rename:hover { color: var(--brand); background: var(--accent-dim); }
.wp-sidebar-input {
  flex: 1; font-size: 11px; font-weight: 600; font-family: inherit;
  background: transparent; border: none; border-bottom: 1.5px solid var(--brand);
  color: var(--text); outline: none; padding: 0 2px;
}

/* ── Weather Overview Layer ──────────────────────────────── */
.wx-ov-marker {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  pointer-events: auto;
}
.wx-ov-icon {
  width: 34px; height: 34px;
  background: var(--wx-bg, #dcfce7);
  border: 2px solid var(--wx-col, #16a34a);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: transform .15s;
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.wx-ov-icon svg { width: 24px; height: 24px; }
.wx-ov-marker:hover .wx-ov-icon { transform: scale(1.12); }
.wx-ov-cat {
  font-size: 8.5px; font-weight: 800; letter-spacing: .3px;
  color: var(--wx-col, #16a34a);
  background: #fff;
  border: 1.5px solid var(--wx-col, #16a34a);
  border-radius: 4px; padding: 0 3px; line-height: 1.5;
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.wx-ov-popup-wrap .leaflet-popup-content-wrapper { border-radius: 12px !important; padding: 0 !important; box-shadow: 0 4px 20px rgba(0,0,0,.18) !important; }
.wx-ov-popup-wrap .leaflet-popup-content { margin: 0 !important; }
.wx-ov-popup { min-width: 210px; }
.wx-ov-popup-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px; border-bottom: 1px solid rgba(0,0,0,.06);
}
.wx-ov-popup-icon {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.wx-ov-popup-icon svg { width: 30px; height: 30px; flex-shrink: 0; }
.wx-ov-popup-icao { font-family: 'JetBrains Mono', monospace; font-size: 15px; font-weight: 800; line-height: 1; }
.wx-ov-popup-name { font-size: 10px; color: #64748b; margin-top: 2px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wx-ov-popup-cat  { margin-left: auto; font-size: 11px; font-weight: 800; flex-shrink: 0; }
.wx-ov-popup-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 10px; padding: 9px 14px; font-size: 11px; }
.wx-ov-popup-lbl  { color: #64748b; font-weight: 600; }
.wx-ov-popup-raw  { padding: 6px 14px 10px; font-family: 'JetBrains Mono', monospace; font-size: 9px; color: #94a3b8; border-top: 1px solid rgba(0,0,0,.06); word-break: break-all; line-height: 1.4; }
.wx-ov-popup-iata { font-size: 10px; font-weight: 600; color: #94a3b8; background: rgba(0,0,0,.05); border-radius: 4px; padding: 0 4px; }
.wx-ov-popup-time { padding: 4px 14px 0; font-size: 9.5px; color: #94a3b8; }
.wx-ov-popup-nodata { padding: 10px 14px 12px; font-size: 11px; color: #94a3b8; }
.wx-ov-nearest    { padding: 5px 14px 0; font-size: 10px; color: #d97706; }

/* ── Airport route popup (vue Route — pastilles grises) ── */
.ap-popup-wrap .leaflet-popup-content-wrapper { padding: 0 !important; }
.ap-popup-wrap .leaflet-popup-content { margin: 0 !important; }
.ap-route-popup { width: 196px; }
.ap-route-head {
  padding: 11px 13px 9px;
  border-bottom: 1px solid var(--border-s);
}
.ap-route-icao {
  font-family: 'JetBrains Mono','SF Mono',monospace;
  font-size: 17px; font-weight: 800; color: var(--text); line-height: 1;
}
.ap-route-name {
  font-size: 11px; color: var(--text-muted); margin-top: 3px;
  line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ap-route-actions { padding: 9px 9px 9px; display: flex; flex-direction: column; gap: 6px; }
.ap-route-pair   { display: flex; gap: 6px; }
.ap-btn {
  font-family: inherit; font-size: 11.5px; font-weight: 600;
  border: none; border-radius: 8px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  transition: filter .15s, background .15s, color .15s;
  line-height: 1;
}
.ap-btn-dep, .ap-btn-arr {
  flex: 1; padding: 8px 4px;
  background: var(--brand); color: #fff;
}
.ap-btn-dep:hover, .ap-btn-arr:hover { filter: brightness(1.12); }
.ap-btn-via {
  width: 100%; padding: 7px 10px;
  background: var(--surface-2); color: var(--text-muted);
  border: 1px solid var(--border);
}
.ap-btn-via:hover { background: var(--accent-dim); color: var(--brand); border-color: transparent; }
.ap-btn-alt {
  width: 100%; padding: 7px 10px;
  background: var(--surface-2); color: #b45309;
  border: 1px solid #fde68a;
}
.ap-btn-alt:hover { background: #fef3c7; color: #92400e; border-color: #f59e0b; }

/* ── AUTH (in header) ──────────────────────────────────────── */
.auth-login-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 99px;
  background: var(--brand); color: #fff;
  border: none; font-size: 11px; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
  white-space: nowrap;
}
.auth-login-btn:hover { opacity: .85; }
.auth-user-info {
  display: flex; align-items: center; gap: 6px;
}
.auth-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
  cursor: pointer; transition: opacity .15s;
}
.auth-avatar:hover { opacity: .8; }
.auth-username {
  font-size: 11px; color: var(--text); font-weight: 600;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.auth-logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 3px; border-radius: 6px;
  display: flex; align-items: center;
  transition: color .12s, background .12s;
}
.auth-logout-btn:hover { color: var(--text); background: var(--surface-2); }
.hidden { display: none !important; }

/* ── AUTH MODAL ────────────────────────────────────────────── */
#auth-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
}
.auth-modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 28px 24px;
  width: min(380px, 94vw);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  position: relative;
}
.auth-modal-close {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  padding: 4px 8px; border-radius: 6px;
}
.auth-modal-close:hover { background: var(--surface-2); color: var(--text); }
.auth-modal-logo {
  font-size: 16px; font-weight: 800; color: var(--text);
  margin-bottom: 18px; letter-spacing: -.3px;
}
.auth-modal-logo span { color: var(--brand); }
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  color: var(--text-muted); background: none; border: none;
  border-bottom: 2px solid transparent; cursor: pointer;
  margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-field {
  margin-bottom: 12px;
}
.auth-field label {
  display: block; font-size: 11px; font-weight: 600;
  color: var(--text-muted); margin-bottom: 4px; letter-spacing: .04em;
}
.auth-field input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text);
  font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.auth-submit-btn {
  width: 100%; padding: 10px; border-radius: 10px; border: none;
  background: var(--brand); color: #fff;
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .15s; margin-top: 4px;
}
.auth-submit-btn:hover { background: var(--brand-light); }
.auth-divider {
  text-align: center; font-size: 11px; color: var(--text-dim);
  margin: 14px 0; position: relative;
}
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%;
  height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
.auth-google-btn {
  width: 100%; padding: 9px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s;
}
.auth-google-btn:hover { background: var(--surface-2); }
.auth-error {
  color: #dc2626; font-size: 11px; margin-top: 8px;
  min-height: 16px;
}
.auth-label-opt { font-weight: 400; color: var(--text-dim); text-transform: none; letter-spacing: 0; }
.auth-field input[list] {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--surface-2); color: var(--text);
  font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.auth-field input[list]:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

/* ── SAVED ROUTES ──────────────────────────────────────────── */
.saved-routes-section {
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.saved-routes-header {
  display: flex; align-items: center; gap: 7px;
  padding: 10px 14px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  user-select: none; transition: color .12s;
}
.saved-routes-header:hover { color: var(--text); }
.saved-routes-count {
  font-size: 10px; background: var(--brand); color: #fff;
  padding: 1px 6px; border-radius: 99px; font-weight: 700;
}
.sr-chevron { margin-left: auto; transition: transform .2s; }
.saved-routes-section.open .sr-chevron { transform: rotate(180deg); }
.saved-routes-list {
  display: none; flex-direction: column; gap: 4px;
  padding: 0 10px 8px;
}
.saved-routes-section.open .saved-routes-list { display: flex; }
.sr-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.sr-item:hover { background: var(--surface-3, var(--surface-2)); }
.sr-route {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px; font-weight: 700; color: var(--text); flex: 1;
}
.sr-meta { font-size: 10px; color: var(--text-muted); }
.sr-delete {
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); padding: 2px; border-radius: 4px;
  display: flex; align-items: center; font-size: 14px;
  transition: color .12s;
}
.sr-delete:hover { color: #dc2626; }
.save-route-btn {
  margin: 4px 10px 10px;
  width: calc(100% - 20px);
  padding: 8px; border-radius: 9px;
  border: 1px dashed var(--brand);
  background: var(--accent-dim, rgba(37,99,235,.05));
  color: var(--brand); font-size: 12px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s;
}
.save-route-btn:hover { background: rgba(37,99,235,.1); }

/* ── Panneau Carburant — Good Pilot VFR ─────────────────── */
#fuel-panel { overflow-y: auto; }
.fuel-panel { padding: 12px 14px 28px; display: flex; flex-direction: column; gap: 0; }

/* En-tête avion */
.fuel-header {
  display: flex; flex-direction: column; gap: 2px;
  padding-bottom: 10px; margin-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.fuel-ac-name  { font-size: 13px; font-weight: 700; color: var(--text); }
.fuel-ac-specs { font-size: 11px; color: var(--text2); }

/* Blocs colorés (bordure gauche) */
.fuel-block {
  border-left: 3px solid var(--border);
  padding-left: 10px; margin: 10px 0 4px;
}
.fuel-block-roulage { border-left-color: #6b7280; }
.fuel-block-etape   { border-left-color: #3b82f6; }
.fuel-block-div     { border-left-color: #f59e0b; }
.fuel-block-reserve { border-left-color: #10b981; }
.fuel-block-marge   { border-left-color: #8b5cf6; }
.fuel-block-reel    { border-left: none; margin-top: 0; }

.fuel-block-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text2); margin-bottom: 5px;
}

/* Lignes */
.fuel-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 5px 0; gap: 8px;
  border-bottom: 1px solid var(--border-subtle, rgba(0,0,0,.04));
}
.fuel-row-readonly { opacity: .8; }
.fuel-row-reserve  { align-items: flex-start; padding: 6px 0; }
.fuel-row-sub {
  border-top: 1px solid var(--border); border-bottom: none;
  padding: 6px 0 0; margin-top: 3px;
}
.fuel-row-ok   { background: rgba(22,163,74,.06); border-radius: 5px; padding: 5px 6px; }
.fuel-row-warn { background: rgba(220,38,38,.06); border-radius: 5px; padding: 5px 6px; }

/* Textes */
.fuel-lbl      { font-size: 12px; color: var(--text2); flex: 1; min-width: 0; }
.fuel-hint     { font-size: 10.5px; opacity: .7; }
.fuel-val      { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; flex-shrink: 0; }
.fuel-val-sub  { font-weight: 700; color: var(--text); }

/* Ligne minimum réglementaire */
.fuel-row-minimum {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; margin: 12px 0 10px;
  background: var(--card2); border-radius: 9px;
  border: 1px solid var(--border);
}
.fuel-lbl-min { font-size: 12px; font-weight: 700; color: var(--text); }
.fuel-val-min { font-size: 14px; font-weight: 800; color: var(--text); text-align: right; flex-shrink: 0; }

/* Ligne d'input */
.fuel-inp-row { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fuel-inp {
  width: 50px; padding: 3px 6px; text-align: right;
  border: 1px solid var(--border); border-radius: 5px;
  background: var(--bg); color: var(--text);
  font-size: 12px; font-weight: 600;
  -moz-appearance: textfield;
}
.fuel-inp::-webkit-outer-spin-button,
.fuel-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.fuel-inp:focus { outline: none; border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59,130,246,.15); }
.fuel-inp-reel { width: 60px; font-size: 13px; }
.fuel-unit { font-size: 11px; color: var(--text2); }
.fuel-calc { font-size: 11px; color: var(--text2); min-width: 38px; text-align: right; }

/* Bouton reset auto */
.fuel-btn-reset {
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--card2); color: var(--text2); font-size: 12px; cursor: pointer;
  line-height: 1;
}
.fuel-btn-reset:hover { background: var(--border); color: var(--text); }

/* Radio réserve */
.fuel-radio-group { display: flex; gap: 5px; }
.fuel-radio {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px;
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: 10px; color: var(--text2);
}
.fuel-radio input[type="radio"] { display: none; }
.fuel-radio span { font-size: 12px; font-weight: 700; color: var(--text); }
.fuel-radio small { font-size: 9px; white-space: nowrap; }
.fuel-radio-active {
  border-color: #3b82f6;
  background: rgba(59,130,246,.08);
}

/* Barre visuelle */
.fuel-bar-wrap { margin: 14px 0 10px; }
.fuel-bar {
  height: 18px; border-radius: 6px; overflow: hidden;
  display: flex; gap: 1px; background: var(--border);
}
.fuel-bar-seg { height: 100%; transition: width .25s ease; min-width: 3px; }
.fuel-bar-legend { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; }
.fuel-bar-leg-item { display: flex; align-items: center; gap: 4px; }
.fuel-bar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.fuel-bar-leg-lbl { font-size: 10px; color: var(--text2); }
.fuel-bar-leg-val { font-size: 10px; font-weight: 600; color: var(--text); }

/* Badges statut */
.fuel-badge {
  font-size: 10px; font-weight: 700; padding: 2px 6px;
  border-radius: 4px; letter-spacing: .3px; white-space: nowrap; min-width: 0;
}
.fuel-badge-ok   { background: rgba(22,163,74,.12);  color: #16a34a; }
.fuel-badge-warn { background: rgba(220,38,38,.12); color: #dc2626; }

/* Notes */
.fuel-note {
  margin-top: 6px; padding: 7px 10px;
  background: var(--card2); border-radius: 7px;
  font-size: 10.5px; color: var(--text2); line-height: 1.5;
}
.fuel-note-ok   { background: rgba(22,163,74,.08);  color: #16a34a; }
.fuel-note-warn { background: rgba(220,38,38,.08); color: #dc2626; }

/* Dark mode overrides */
body.dark .fuel-badge-ok   { background: rgba(74,222,128,.15); color: #4ade80; }
body.dark .fuel-badge-warn { background: rgba(248,113,113,.15); color: #f87171; }
body.dark .fuel-row-ok     { background: rgba(74,222,128,.08); }
body.dark .fuel-row-warn   { background: rgba(248,113,113,.08); }
body.dark .fuel-note-ok    { background: rgba(74,222,128,.1);  color: #4ade80; }
body.dark .fuel-note-warn  { background: rgba(248,113,113,.1); color: #f87171; }

/* ═══════════════════════════════════════════════════════════
   CARBURANT OVERLAY — zone carte
   ═══════════════════════════════════════════════════════════ */
#fuel-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  left: var(--sidebar-w);
  z-index: 350;
  background: rgba(238, 242, 248, 0.55);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  overflow-y: auto;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
[data-theme="dark"] #fuel-overlay {
  background: rgba(8, 13, 24, 0.55);
}
#fuel-overlay.fov-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.fov-content {
  width: 100%;
  max-width: 620px;
  padding: 76px 20px 100px; /* top : espace pour les pills flottantes */
}

/* État vide */
.fov-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 50vh; gap: 16px; color: var(--text2); text-align: center;
}
.fov-empty-icon { line-height: 1; }
.fov-empty-text { font-size: 14px; line-height: 1.6; max-width: 280px; }

/* Titre de section */
.fov-section-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: var(--text2); margin: 0 0 10px;
}

/* Barre visuelle */
.fov-bar-wrap { margin-bottom: 20px; }
.fov-bar {
  height: 28px; border-radius: 8px; overflow: hidden;
  display: flex; gap: 2px; background: var(--border);
}
.fov-bar-seg { height: 100%; transition: width .25s ease; min-width: 4px; }
.fov-bar-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; }
.fov-bar-leg-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 11px; color: var(--text2);
}
.fov-bar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Tableau décomposition */
.fov-breakdown {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin-bottom: 20px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .fov-breakdown {
  background: rgba(17,28,45,0.65);
}
.fov-bd-header {
  display: grid; grid-template-columns: 1fr 90px 90px;
  padding: 8px 16px;
  background: var(--card2);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--text2);
}
.fov-bd-header span:not(:first-child) { text-align: right; }
.fov-bd-row {
  display: grid; grid-template-columns: 1fr 90px 90px;
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle, rgba(0,0,0,.05));
  align-items: center;
}
.fov-bd-total {
  background: var(--card2); border-top: 2px solid var(--border);
}
.fov-bd-name { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text); }
.fov-bd-min  { font-size: 12px; color: var(--text2); text-align: right; }
.fov-bd-l    { font-size: 12px; font-weight: 600; color: var(--text); text-align: right; }
.fov-bd-total .fov-bd-name { font-size: 13px; font-weight: 700; }
.fov-bd-total .fov-bd-min,
.fov-bd-total .fov-bd-l    { font-size: 13px; font-weight: 700; color: var(--text); }

/* Carte minimum réglementaire */
.fov-minimum-card {
  background: var(--text);
  color: var(--bg);
  border-radius: 14px;
  padding: 24px 28px;
  text-align: center;
  margin-bottom: 20px;
}
.fov-minimum-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px;
  opacity: .65; margin-bottom: 8px;
}
.fov-minimum-value {
  font-size: 32px; font-weight: 800; letter-spacing: -.5px;
}

/* Carburant réel à bord */
.fov-reel-card {
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 18px 20px; margin-bottom: 16px;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: border-color .2s, background .2s;
}
[data-theme="dark"] .fov-reel-card {
  background: rgba(17,28,45,0.65);
}
.fov-reel-card.fov-reel-ok   { border-color: #16a34a; background: rgba(22,163,74,.05); }
.fov-reel-card.fov-reel-warn { border-color: #dc2626; background: rgba(220,38,38,.05); }
.fov-reel-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  color: var(--text2); margin-bottom: 12px;
}
.fov-reel-row {
  display: flex; align-items: center; gap: 10px;
}
.fov-reel-inp {
  width: 100px; padding: 10px 14px;
  font-size: 22px; font-weight: 700; text-align: right;
  border: 2px solid var(--border); border-radius: 9px;
  background: var(--bg); color: var(--text);
  -moz-appearance: textfield;
  transition: border-color .15s;
}
.fov-reel-inp::-webkit-outer-spin-button,
.fov-reel-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.fov-reel-inp:focus {
  outline: none; border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.fov-reel-unit { font-size: 18px; font-weight: 600; color: var(--text2); }
.fov-reel-note { margin-top: 10px; font-size: 13px; font-weight: 500; }
.fov-note-ok   { color: #16a34a; }
.fov-note-warn { color: #dc2626; font-weight: 600; }

/* Badges */
.fov-badge {
  font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 20px;
  letter-spacing: .3px; white-space: nowrap;
}
.fov-badge-ok   { background: rgba(22,163,74,.12);  color: #16a34a; }
.fov-badge-warn { background: rgba(220,38,38,.12); color: #dc2626; }
.fov-badge-hint { background: var(--card2); color: var(--text2); }

/* Note de bas de page */
.fov-footnote {
  font-size: 10.5px; color: var(--text2); text-align: center; line-height: 1.7; margin-top: 4px;
}

/* Dark mode */
body.dark .fov-reel-card.fov-reel-ok   { background: rgba(74,222,128,.06); }
body.dark .fov-reel-card.fov-reel-warn { background: rgba(248,113,113,.06); }
body.dark .fov-badge-ok   { background: rgba(74,222,128,.15); color: #4ade80; }
body.dark .fov-badge-warn { background: rgba(248,113,113,.15); color: #f87171; }
body.dark .fov-note-ok    { color: #4ade80; }
body.dark .fov-note-warn  { color: #f87171; }
