:root {
  --bg: #0f1419;
  --surface: #1a2332;
  --surface-2: #243044;
  --text: #e8edf4;
  --muted: #8b9cb3;
  --primary: #3b82f6;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --border: #2d3a4f;
  --header-h: 64px;
}

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Transitions douces par défaut sur les éléments interactifs courants */
a,
button,
input,
select,
.btn,
.layer-item label,
.search-result-item,
.spot-select,
.checklist-item,
.flight-restriction-card {
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    opacity 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.app-header,
.layers-panel,
.flight-panel,
.status-bar,
.spots-panel,
.modal-content,
.panel-section,
.score-volable {
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Scrollbars fines, cohérentes avec le thème (panneaux sombres et clairs) */
.layers-panel,
.flight-panel-body,
.spots-panel,
.admin-body {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.layers-panel::-webkit-scrollbar,
.flight-panel-body::-webkit-scrollbar,
.spots-panel::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
  width: 8px;
}
.layers-panel::-webkit-scrollbar-thumb,
.flight-panel-body::-webkit-scrollbar-thumb,
.spots-panel::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}
.layers-panel::-webkit-scrollbar-thumb:hover,
.flight-panel-body::-webkit-scrollbar-thumb:hover,
.spots-panel::-webkit-scrollbar-thumb:hover,
.search-results::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

.map-shell {
  position: absolute;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 28px;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  background: var(--bg);
}

#map {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  z-index: 1;
}

#map .leaflet-container {
  width: 100%;
  height: 100%;
  background: #1a1f2e;
}

#map.map-plan-only .leaflet-container,
.map-plan-only #map .leaflet-container {
  background: #f2efe9;
}
.map-plan-only .leaflet-basemap-underlay-pane,
.map-plan-only .leaflet-basemap-plan-pane {
  background: #f2efe9;
}
.map-plan-only .leaflet-basemap-orthophoto-pane,
.map-plan-only .leaflet-basemap-satellite-pane,
.map-plan-only .leaflet-basemap-oaci-pane,
.map-plan-only .leaflet-basemap-imagery-pane {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  z-index: 1100;
  overflow: visible;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.brand h1 { font-size: 1.1rem; font-weight: 700; }
.subtitle { font-size: 0.75rem; color: var(--muted); }
.logo { font-size: 1.5rem; }

.search-bar {
  position: relative;
  flex: 1;
  display: flex;
  gap: 8px;
  max-width: 480px;
  z-index: 1100;
}

.search-bar input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.95rem;
}

.header-actions { display: flex; gap: 8px; }

.btn {
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: white; }
.btn-secondary { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn:hover:not(:disabled) { opacity: 0.85; }
.btn:active:not(:disabled) { transform: scale(0.97); }

.layers-panel {
  position: relative;
  flex: 0 0 320px;
  width: 320px;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--surface);
  color: var(--text);
  border-left: 1px solid var(--border);
  padding: 14px 16px 20px;
  z-index: 1200;
  box-shadow: -6px 0 24px rgba(0, 0, 0, 0.35);
  -webkit-overflow-scrolling: touch;
}

.map-shell.panel-collapsed .layers-panel {
  display: none;
}

.layers-panel h3,
.layers-panel h4,
.layers-panel label {
  color: var(--text);
}

.layers-panel h3 { font-size: 0.95rem; margin-bottom: 12px; }
.section-title { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.panel-hint { font-size: 0.72rem; color: var(--muted); margin: 6px 0 4px; line-height: 1.4; }
.panel-hint a { color: var(--primary); }
.basemap-list .layer-item { border-bottom: none; }
.map-layer-item { margin-bottom: 2px; }
.uas-layer-controls {
  margin: 8px 0 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.uas-layer-controls.hidden { display: none; }
.uas-trust-note {
  color: #86efac;
  font-weight: 500;
  margin-top: 4px;
}

.opacity-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.opacity-control input[type="range"] {
  flex: 1;
  accent-color: var(--primary);
}

.layer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
}

.layer-item:last-child { border-bottom: none; }

.layer-color {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.layer-item label { flex: 1; cursor: pointer; color: var(--text); }
.layer-count { color: var(--muted); font-size: 0.75rem; }

.legend { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.legend h4 { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 0.8rem; margin-bottom: 4px; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.active { background: var(--danger); }
.dot.inactive { background: var(--success); }

.panel-footer { margin-top: 12px; font-size: 0.8rem; }
.panel-footer a { color: var(--primary); }

.notam-alerts { margin-bottom: 10px; }
.notam-summary { font-size: 0.82rem; margin-bottom: 8px; line-height: 1.4; }
.notam-updated { display: block; color: var(--muted); font-size: 0.75rem; }
.notam-list { list-style: none; margin: 0; padding: 0; }
.notam-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
}
.notam-item:last-child { border-bottom: none; }
.notam-title { display: block; font-weight: 600; margin-bottom: 2px; }
.notam-desc { color: var(--muted); line-height: 1.35; }
.notam-item.priorite-critique .notam-title { color: #fca5a5; }
.notam-item.priorite-vigilance .notam-title { color: #fcd34d; }

.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 1101;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.search-results.hidden { display: none; }
.search-results:not(.hidden) { animation: dropdown-in 0.15s ease-out; }

.search-result-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.search-result-item:hover { background: var(--surface-2); }

.status-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 12px;
  z-index: 1000;
}

.status-meta {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-author {
  margin-left: auto;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--text);
  opacity: 0.8;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}

#map { cursor: crosshair; }

/* Calques vectoriels SIA au-dessus du raster UAS */
.leaflet-data-overlay-pane path,
.leaflet-data-overlay-pane circle {
  pointer-events: auto;
}

.flight-panel {
  position: fixed;
  bottom: 36px;
  left: 8px;
  width: min(420px, calc(100vw - 16px));
  max-height: min(72vh, calc(100vh - var(--header-h) - 80px));
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  animation: panel-in 0.22s ease-out;
}

.flight-panel.hidden { display: none; }

.flight-panel.minimized .flight-panel-body { display: none; }

.flight-panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.flight-panel-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.flight-panel-header h2 { font-size: 1rem; }

.flight-export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.flight-date-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.flight-date-input {
  flex: 1;
  min-width: 120px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: inherit;
  font-size: 0.82rem;
}

.flight-period-select {
  min-width: 108px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: inherit;
  font-size: 0.82rem;
}

.flight-export-bar .btn-sm {
  padding: 6px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.flight-export-bar .btn-sm:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.meteo-vol-section {
  border-left: 3px solid var(--primary);
  padding-left: 10px;
}

.meteo-period-badge {
  display: inline-block;
  margin: 4px 0 6px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(22, 163, 74, 0.12);
  color: #166534;
  font-size: 0.78rem;
}

.flight-panel-body {
  padding: 12px 14px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.flight-verdict {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
}

.flight-verdict.autorise { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.35); }
.flight-verdict.restreint { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
.flight-verdict.interdit { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.4); }

.flight-verdict h3 { font-size: 1.05rem; margin-bottom: 6px; }
.flight-altitude { font-size: 1.35rem; font-weight: 700; margin: 4px 0 8px; }
.flight-map-color-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.92rem;
  line-height: 1.35;
}
.flight-map-color-hint.is-sia {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
}
.flight-color-swatch {
  width: 18px;
  height: 18px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.flight-color-swatch-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  color: var(--success);
  font-size: 0.75rem;
  font-weight: 700;
}
.flight-map-color-text { font-weight: 600; }
[data-theme="light"] .flight-map-color-hint { background: rgba(15, 23, 42, 0.04); }
.flight-coords { color: var(--muted); font-size: 0.78rem; margin-bottom: 4px; }
.flight-address { margin-bottom: 8px; }

.flight-restrictions { margin-top: 12px; }
.flight-restrictions h4 { font-size: 0.8rem; color: var(--muted); margin-bottom: 8px; }

.flight-sources { margin-top: 12px; }
.flight-sources h4 { font-size: 0.8rem; color: var(--muted); margin-bottom: 6px; }

.flight-restriction-card {
  padding: 10px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border-radius: 6px;
  border-left: 3px solid var(--border);
}

.flight-restriction-card.priorite-critique { border-left-color: var(--danger); }
.flight-restriction-card.priorite-vigilance { border-left-color: var(--warning); }
.flight-restriction-card.priorite-info { border-left-color: var(--primary); }

.flight-restriction-card .card-title { font-weight: 600; margin-bottom: 4px; }
.flight-restriction-card .card-meta { color: var(--muted); font-size: 0.78rem; line-height: 1.4; }
.flight-restriction-card .card-conseil { margin-top: 6px; font-size: 0.8rem; }

.flight-panel-links { margin-top: 12px; font-size: 0.8rem; }
.flight-panel-links a { color: var(--primary); display: inline-block; margin-right: 10px; margin-bottom: 4px; }

.flight-categorie-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  margin-bottom: 8px;
}

.flight-rappels { margin-top: 10px; font-size: 0.78rem; color: var(--muted); }
.flight-rappels li { margin: 4px 0 4px 16px; }

.flight-briefing-resume { margin: 6px 0 10px; font-size: 0.88rem; line-height: 1.45; }

.flight-key-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.flight-key-point {
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.flight-key-point .key-label {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flight-key-point .key-value {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 2px;
}

.flight-key-point.niveau-ok { border-color: rgba(34, 197, 94, 0.35); }
.flight-key-point.niveau-warn { border-color: rgba(245, 158, 11, 0.45); }
.flight-key-point.niveau-danger { border-color: rgba(239, 68, 68, 0.5); background: rgba(239, 68, 68, 0.08); }

.flight-checklist { list-style: none; margin: 0; padding: 0; }
.checklist-item {
  padding: 8px 10px 8px 28px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 0.82rem;
  line-height: 1.4;
  position: relative;
}
.checklist-item::before {
  content: "○";
  position: absolute;
  left: 10px;
  color: var(--muted);
}
.checklist-item.done::before { content: "✓"; color: var(--success); }
.checklist-item.todo::before { content: "!"; color: var(--warning); }
.checklist-item.niveau-danger { border-left: 3px solid var(--danger); }
.checklist-item.niveau-warn { border-left: 3px solid var(--warning); }
.checklist-item a { color: var(--primary); margin-left: 4px; }

.flight-contexte { opacity: 0.85; }
.flight-contexte h4 { font-style: italic; }

.meteo-section { border-top: 1px solid var(--border); padding-top: 4px; }
.meteo-resume { margin-bottom: 10px; }

.meteo-metar-card,
.meteo-mf-card {
  padding: 10px;
  margin-bottom: 10px;
  background: var(--surface-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.meteo-source { font-size: 0.75rem; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.meteo-conditions { font-size: 0.85rem; margin-bottom: 8px; }

.meteo-wind-block {
  padding: 8px 10px;
  margin: 8px 0;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.meteo-wind-title { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.meteo-wind-main { display: flex; align-items: baseline; gap: 10px; margin-top: 4px; }
.meteo-sector { font-size: 1.2rem; font-weight: 800; color: #93c5fd; min-width: 72px; }
.meteo-speed { font-size: 1.05rem; font-weight: 700; }
.meteo-wind-detail,
.meteo-wind-gust,
.meteo-wind-resume { font-size: 0.78rem; color: var(--muted); margin-top: 4px; }

.meteo-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 8px;
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 8px;
}

.meteo-raw {
  display: block;
  margin-top: 8px;
  padding: 8px;
  border-radius: 4px;
  background: var(--bg);
  font-size: 0.72rem;
  word-break: break-word;
  color: #cbd5e1;
}

.meteo-conseil {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid var(--warning);
  font-size: 0.82rem;
}

.meteo-forecast-table {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.meteo-forecast-table th,
.meteo-forecast-table td {
  padding: 5px 4px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.meteo-forecast-table th { color: var(--muted); font-weight: 600; }

#viewport-count { margin-left: 0; }
#data-updated { margin-left: auto; }

/* Modal disclaimer */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal.hidden { display: none; }

.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  max-width: 520px;
  width: 100%;
  animation: modal-in 0.2s ease-out;
}

.modal-content h2 { margin-bottom: 16px; }
.modal-content p { margin-bottom: 12px; line-height: 1.5; color: var(--muted); }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Popup zone */
.zone-popup { min-width: 220px; }
.zone-popup h3 { font-size: 1rem; margin-bottom: 6px; }
.popup-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.badge.priorite-critique { background: rgba(239,68,68,0.25); color: #fca5a5; }
.badge.priorite-vigilance { background: rgba(245,158,11,0.25); color: #fcd34d; }
.badge.priorite-info { background: rgba(59,130,246,0.2); color: #93c5fd; }
.popup-notam { margin-top: 10px; font-size: 0.85rem; }
.zone-popup .badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.badge.active { background: rgba(239,68,68,0.2); color: var(--danger); }
.badge.inactive { background: rgba(34,197,94,0.2); color: var(--success); }
.badge.activable { background: rgba(139,92,246,0.22); color: #c4b5fd; }

.popup-supaip a,
.card-description a,
.flight-zrt-procedure a {
  color: var(--primary);
  font-weight: 600;
}

.card-description {
  margin-top: 6px;
  line-height: 1.45;
}
.zone-popup dl { font-size: 0.85rem; }
.zone-popup dt { color: var(--muted); margin-top: 6px; }
.zone-popup dd { margin-left: 0; }
.zone-popup a { color: var(--primary); }

/* Admin */
.admin-body { overflow: auto; height: auto; background: var(--bg); }
.admin-container { max-width: 800px; margin: 40px auto; padding: 0 20px 60px; }
.admin-container h1 { margin-bottom: 8px; }
.admin-grid { display: grid; gap: 16px; margin: 24px 0; }
.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.admin-card h3 { margin-bottom: 8px; }
.admin-card input[type="file"] { margin: 12px 0; color: var(--text); }
.admin-help pre {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
  font-size: 0.8rem;
  margin: 12px 0;
}

/* ── v2.1 Tout-en-un ── */
.btn-icon {
  min-width: 42px;
  padding: 10px 12px;
  font-size: 1.1rem;
  line-height: 1;
}
.btn-icon.active { outline: 2px solid var(--primary); }
.btn-success { background: var(--success); color: #052e16; }
.btn-sm { padding: 8px 12px; font-size: 0.82rem; }
.hidden { display: none !important; }

.fab-verify {
  position: fixed;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #052e16;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 8px 28px rgba(34, 197, 94, 0.45);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.fab-verify:hover { transform: translateX(-50%) scale(1.03); }
.fab-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  font-size: 1.1rem;
}

.flight-panel-body { flex: 1; overflow-y: auto; }
.flight-panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.flight-panel-actions .btn-success { flex: 1; min-width: 140px; }

.pdf-export-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.select-sm {
  padding: 6px 8px;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
}

.panel-section {
  margin: 12px 0;
  padding: 12px;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.section-heading {
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.score-volable {
  padding: 16px;
  border-radius: 14px;
  margin-bottom: 14px;
  border: 2px solid var(--border);
}
.score-volable.score-vert { background: rgba(34, 197, 94, 0.12); border-color: rgba(34, 197, 94, 0.45); }
.score-volable.score-jaune { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.45); }
.score-volable.score-rouge { background: rgba(239, 68, 68, 0.15); border-color: rgba(239, 68, 68, 0.5); }
.score-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.score-emoji { font-size: 2.6rem; line-height: 1; }
.score-hero-value {
  font-size: 2.4rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
}
.score-hero-unit { font-size: 1rem; font-weight: 700; color: var(--muted); margin-left: 2px; }
.score-title { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.score-label { font-size: 1.15rem; font-weight: 700; margin-top: 2px; }
.score-bar-wrap {
  height: 6px;
  background: rgba(0,0,0,0.2);
  border-radius: 3px;
  margin-top: 6px;
  overflow: hidden;
}
.score-bar { height: 100%; border-radius: 3px; }
.score-bar.score-vert { background: var(--success); }
.score-bar.score-jaune { background: var(--warning); }
.score-bar.score-rouge { background: var(--danger); }
.score-raisons { list-style: none; margin: 8px 0 0; padding: 0; font-size: 0.78rem; color: var(--muted); }
.score-raisons li { margin: 4px 0; }

.kp-block {
  padding: 10px;
  margin: 10px 0;
  border-radius: 8px;
  background: rgba(59, 130, 246, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.2);
}
.kp-block.niveau-ok { border-color: rgba(34, 197, 94, 0.35); background: rgba(34, 197, 94, 0.08); }
.kp-block.niveau-warn { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.1); }
.kp-block.niveau-danger { border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.1); }
.kp-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.kp-value { font-size: 1.4rem; font-weight: 800; }
.kp-label { font-size: 0.85rem; color: var(--muted); }
.kp-scale { display: flex; gap: 3px; margin-bottom: 6px; }
.kp-tick {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background: var(--border);
}
.kp-tick.active { background: var(--primary); }
.kp-tick.active.niveau-ok { background: var(--success); }
.kp-tick.active.niveau-warn { background: var(--warning); }
.kp-tick.active.niveau-danger { background: var(--danger); }
.kp-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.kp-fill { height: 100%; background: var(--primary); }
.kp-fill.niveau-ok { background: var(--success); }
.kp-fill.niveau-warn { background: var(--warning); }
.kp-fill.niveau-danger { background: var(--danger); }
.kp-conseil { font-size: 0.8rem; margin-top: 8px; line-height: 1.4; }
.kp-legend { margin-top: 6px; font-size: 0.72rem; }

.uas-legend {
  margin: 10px 0 6px;
  padding: 10px;
  background: var(--surface);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.uas-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  margin: 5px 0;
}
.uas-swatch {
  width: 14px;
  height: 14px;
  border-radius: 2px;
  border: 1px solid rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.uas-legend-note { margin-top: 6px; font-size: 0.68rem; }

.install-pwa-btn { white-space: nowrap; }

.metar-resume-fr {
  font-size: 0.95rem;
  font-style: italic;
  margin: 8px 0;
  padding: 8px 10px;
  background: rgba(34, 197, 94, 0.1);
  border-radius: 6px;
  border-left: 3px solid var(--success);
}
.metar-decrypt-list {
  margin: 10px 0;
  padding-left: 18px;
  font-size: 0.8rem;
  line-height: 1.5;
}
.metar-decrypt-list li { margin: 6px 0; }

.interactive-checklist label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}
.interactive-checklist input { margin-top: 3px; accent-color: var(--success); }

.spots-panel {
  position: fixed;
  top: calc(var(--header-h) + 12px);
  left: 12px;
  width: 280px;
  max-height: calc(100vh - var(--header-h) - 52px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: panel-in 0.2s ease-out;
}
.spots-list { list-style: none; }
.spot-item {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.spot-select {
  flex: 1;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.8rem;
  cursor: pointer;
}
.spot-select:hover { border-color: var(--primary); }
.spot-remove {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
}
.spot-date { display: block; font-size: 0.7rem; color: var(--muted); }
.score-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.score-dot.score-vert { background: var(--success); }
.score-dot.score-jaune { background: var(--warning); }
.score-dot.score-rouge { background: var(--danger); }

.beginner-mode .advanced-section { display: none; }
.beginner-mode .beginner-collapsed .flight-restriction-card { display: none; }
.legal-hint { margin-top: 8px; font-size: 0.72rem; }

/* Thème clair */
[data-theme="light"] {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cbd5e1;
}
[data-theme="light"] .modal-content { background: #fff; color: #0f172a; }
[data-theme="light"] .layers-panel { background: #ffffff; color: #0f172a; }
[data-theme="light"] #map .leaflet-container { background: #e2e8f0; }
[data-theme="light"] .fab-verify { box-shadow: 0 8px 24px rgba(22, 163, 74, 0.35); }

@media (max-width: 768px) {
  .brand .subtitle { display: none; }
  .search-bar { max-width: none; }
  .map-shell { flex-direction: column; }
  .layers-panel {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: 8px;
    left: 8px;
    width: auto;
    flex: none;
    max-height: 45vh;
    border-left: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1200;
  }
  .map-shell:not(.panel-collapsed) #map {
    filter: brightness(0.55);
  }
  .spots-panel { width: calc(100vw - 24px); left: 12px; }
  .flight-panel {
    left: 8px;
    right: 8px;
    width: auto;
    max-height: 58vh;
  }
  .fab-label { display: none; }
  .fab-verify { padding: 16px 20px; bottom: 40px; }
  .install-pwa-btn { font-size: 0.72rem; padding: 6px 10px; }
  .pdf-export-group { width: 100%; }
  .pdf-export-group select { flex: 1 1 100px; min-width: 0; }
  .pdf-export-group .btn { flex: 1 1 100%; order: 99; }
}