/* ==================================================================
   PrévolVFR — feuille de style commune
   Trois thèmes : clair · sombre · nuit (rouge, préserve la vision nocturne)
   Pensé pour l'iPad en cockpit : fort contraste, cibles tactiles ≥ 48 px
   ================================================================== */

/* ---------- Couleurs par thème ---------- */
:root,
[data-theme="clair"] {
  --fond: #eef1f5;
  --surface: #ffffff;
  --surface-2: #f5f7fa;
  --bordure: #c9d1db;
  --texte: #0b1220;
  --texte-doux: #4a5668;
  --accent: #0050b3;
  --accent-texte: #ffffff;
  --accent-doux: #dbe8fb;
  --alerte-fond: #fff4d6;
  --alerte-bord: #d99a00;
  --alerte-texte: #5c3d00;
  --danger: #c0262d;
  --ok: #1d7a3a;
  --ombre: 0 1px 3px rgba(11, 18, 32, .12);
  color-scheme: light;
}

[data-theme="sombre"] {
  --fond: #0a0e13;
  --surface: #141a22;
  --surface-2: #1b232d;
  --bordure: #2e3a48;
  --texte: #e9eef4;
  --texte-doux: #9aa8b8;
  --accent: #5aa9ff;
  --accent-texte: #05121f;
  --accent-doux: #16304d;
  --alerte-fond: #2e2408;
  --alerte-bord: #c99a1e;
  --alerte-texte: #f5d98a;
  --danger: #ff6b6b;
  --ok: #4cd17a;
  --ombre: none;
  color-scheme: dark;
}

/* Nuit : uniquement des rouges sur noir, luminosité minimale */
[data-theme="nuit"] {
  --fond: #000000;
  --surface: #0d0000;
  --surface-2: #160000;
  --bordure: #3d0a0a;
  --texte: #ff5a4a;
  --texte-doux: #b33a30;
  --accent: #ff3b2f;
  --accent-texte: #000000;
  --accent-doux: #2a0505;
  --alerte-fond: #1a0303;
  --alerte-bord: #8a1a12;
  --alerte-texte: #ff6a5a;
  --danger: #ff2a1a;
  --ok: #ff8a7a;
  --ombre: none;
  color-scheme: dark;
}

/* ---------- Dimensions ---------- */
:root {
  --cible: 48px;               /* taille minimale d'un élément tactile */
  --rayon: 10px;
  --entete: 56px;
  --menu-large: 232px;
  --menu-etroit: 72px;
  --onglets: 64px;
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --police-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--police);
  font-size: 17px;
  line-height: 1.45;
  background: var(--fond);
  color: var(--texte);
  min-height: 100vh;
  min-height: 100dvh;
}

a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 0 0 1rem; }
h2 { font-size: 1.2rem; margin: 1.5rem 0 .75rem; }
.mono { font-family: var(--police-mono); font-variant-numeric: tabular-nums; }
.masque { display: none !important; }
[hidden] { display: none !important; }

/* Lien d'évitement pour la navigation au clavier */
.aller-contenu {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--accent-texte); padding: .5rem 1rem; z-index: 100;
}
.aller-contenu:focus { left: 0; }

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

/* ---------- Boutons et champs ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--cible); padding: 0 1.25rem;
  border-radius: var(--rayon); border: 1px solid var(--bordure);
  background: var(--surface-2); color: var(--texte);
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
}
.bouton:hover { border-color: var(--accent); }
.bouton-principal { background: var(--accent); color: var(--accent-texte); border-color: var(--accent); }
.bouton-principal:disabled { opacity: .6; cursor: wait; }
.bouton-danger { color: var(--danger); }

.champ { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.champ label { font-weight: 600; font-size: .95rem; }
.champ input {
  min-height: var(--cible); padding: 0 .9rem;
  border-radius: var(--rayon); border: 1px solid var(--bordure);
  background: var(--surface-2); color: var(--texte); font: inherit;
}
.champ input:focus { border-color: var(--accent); }

/* ---------- Bandeau d'avertissement réglementaire ---------- */
.bandeau {
  background: var(--alerte-fond);
  border-bottom: 2px solid var(--alerte-bord);
  color: var(--alerte-texte);
  font-size: .85rem;
  padding: .4rem 1rem;
  /* App installée sur l'écran d'accueil : on laisse la place à la barre d'état de l'iPhone */
  padding-top: max(.4rem, env(safe-area-inset-top));
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
  text-align: center;
}
.bandeau a { color: inherit; font-weight: 700; }

/* ---------- Coque : bandeau + barre du haut ---------- */
.coque { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.coque > .bandeau { position: sticky; top: 0; z-index: 30; }

.barre {
  position: sticky; top: var(--hauteur-bandeau, 0px); z-index: 20;
  display: flex; align-items: center; gap: .25rem;
  min-height: var(--entete); padding: .25rem .6rem;
  padding-left: max(.6rem, env(safe-area-inset-left)); padding-right: max(.6rem, env(safe-area-inset-right));
  background: var(--surface); border-bottom: 1px solid var(--bordure);
}
.barre-marque {
  display: inline-flex; align-items: center; gap: .45rem; margin: 0 .5rem 0 .25rem;
  font-weight: 800; font-size: 1.05rem; color: var(--texte); text-decoration: none; white-space: nowrap;
}
.barre-marque svg { width: 24px; height: 24px; color: var(--accent); }
.barre-liens { display: flex; align-items: center; gap: .15rem; min-width: 0; }
.barre-lien {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 44px; padding: 0 .65rem; border-radius: var(--rayon);
  color: var(--texte); text-decoration: none; font-weight: 600; font-size: .95rem; white-space: nowrap; cursor: pointer;
  border: 1px solid transparent;
}
.barre-lien svg { width: 22px; height: 22px; flex: none; }
.barre-lien:hover { background: var(--surface-2); border-color: var(--bordure); }
.barre-lien[aria-current="page"] { background: var(--accent-doux); color: var(--accent); }
.barre-lien .externe { font-size: .75rem; color: var(--texte-doux); }
.barre-lien.seul-icone .libelle { display: none; }
.barre-gpx { border-color: var(--bordure); background: var(--surface-2); }
.barre-espace { flex: 1; }
.barre-dossier { min-height: 44px; padding: 0 .9rem; white-space: nowrap; }
.barre-dossier svg { width: 22px; height: 22px; }
.horloges { display: flex; gap: .8rem; margin-right: .3rem; font-family: var(--police-mono); font-size: .95rem; font-variant-numeric: tabular-nums; }
.horloges .utc { font-weight: 700; }
.horloges .loc { color: var(--texte-doux); }

.bouton-icone {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--cible); height: var(--cible);
  border: 1px solid transparent; border-radius: var(--rayon);
  background: transparent; color: var(--texte); cursor: pointer; padding: 0;
}
.bouton-icone:hover { background: var(--surface-2); border-color: var(--bordure); }
.bouton-icone svg { width: 24px; height: 24px; }

/* Écrans moyens : icônes seules pour les liens */
@media (max-width: 1180px) {
  .barre-liens .libelle, .barre-liens .externe { display: none; }
  .horloges .loc { display: none; }
}
/* iPhone : tout en icônes */
@media (max-width: 767px) {
  .barre { gap: 0; padding-left: max(.3rem, env(safe-area-inset-left)); padding-right: max(.3rem, env(safe-area-inset-right)); }
  .barre-marque span, .barre-gpx .libelle, .barre-dossier .libelle, .barre-lien .libelle { display: none; }
  .barre-marque { margin: 0 .15rem; }
  .barre-lien { padding: 0 .45rem; }
  .barre-dossier { padding: 0 .6rem; }
  .horloges { font-size: .85rem; margin-right: 0; }
  .bandeau { font-size: .72rem; padding-bottom: .25rem; }
  .contenu { padding: 1rem; }
}
.a-venir { color: var(--texte-doux); }

/* Contenu */
.contenu {
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  min-width: 0; /* empêche un tableau large d'élargir toute la page sur iPhone */
}

/* Cartes (blocs) */
.carte-bloc {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--rayon);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--ombre);
}
.carte-bloc > :first-child { margin-top: 0; }
.carte-bloc > :last-child { margin-bottom: 0; }
.grille { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grille a.carte-bloc { color: var(--texte); text-decoration: none; display: flex; gap: .9rem; align-items: flex-start; min-height: 96px; }
.grille a.carte-bloc:hover { border-color: var(--accent); }
.grille a.carte-bloc svg { width: 28px; height: 28px; color: var(--accent); flex: none; margin-top: 2px; }
.grille strong { display: block; margin-bottom: .2rem; }
.grille small { color: var(--texte-doux); }

.pastille {
  display: inline-block; padding: .1rem .55rem; border-radius: 999px;
  font-size: .78rem; font-weight: 700;
  background: var(--surface-2); color: var(--texte-doux); border: 1px solid var(--bordure);
}
.a-venir { color: var(--texte-doux); }

/* ---------- Page de connexion ---------- */
.page-connexion {
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
}
.page-connexion main {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.boite-connexion { width: 100%; max-width: 400px; }
.boite-connexion .logo { display: flex; align-items: center; gap: .6rem; font-size: 1.5rem; font-weight: 800; margin-bottom: 1.25rem; }
.boite-connexion .logo svg { width: 36px; height: 36px; color: var(--accent); }
.boite-connexion .bouton-principal { width: 100%; margin-top: .5rem; }
.message-erreur {
  color: var(--danger); font-weight: 600; min-height: 1.5em; margin: .5rem 0 0;
}

/* ---------- Réglages ---------- */
.choix-theme { display: flex; flex-wrap: wrap; gap: .5rem; border: 0; padding: 0; margin: 0; }
.choix-theme label {
  display: inline-flex; align-items: center; gap: .5rem;
  min-height: var(--cible); padding: 0 1rem;
  border: 1px solid var(--bordure); border-radius: var(--rayon);
  background: var(--surface-2); cursor: pointer; font-weight: 600;
}
.choix-theme input { width: 20px; height: 20px; accent-color: var(--accent); }
.choix-theme label:has(input:checked) { border-color: var(--accent); background: var(--accent-doux); }

dl.infos { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; }
dl.infos dt { color: var(--texte-doux); }
dl.infos dd { margin: 0; font-weight: 600; }

/* ---------- Impression : on ne garde que le contenu ---------- */
@media print {
  .barre, .bandeau { display: none !important; }
  .coque { display: block; }
  body { background: #fff; color: #000; }
}

/* ==================================================================
   Étape 2 — Destinations
   ================================================================== */

.barre-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-bottom: 1rem; }
.barre-actions .recherche { flex: 1; min-width: 180px; }
.recherche input, .champ select, .champ textarea, .champ-ligne input {
  width: 100%; min-height: var(--cible); padding: 0 .9rem;
  border-radius: var(--rayon); border: 1px solid var(--bordure);
  background: var(--surface-2); color: var(--texte); font: inherit;
}
.champ textarea { padding: .6rem .9rem; min-height: 6rem; resize: vertical; }
.champ select { appearance: auto; }
.champ .aide { color: var(--texte-doux); font-size: .85rem; }
.bouton-petit { min-height: 40px; padding: 0 .8rem; font-size: .92rem; }
.bouton svg { width: 20px; height: 20px; }
.groupe-boutons { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Liste des destinations */
.liste-destinations { display: grid; gap: .75rem; margin-bottom: 1.25rem; }
.item-destination {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: .75rem 1rem; box-shadow: var(--ombre);
}
.item-destination:hover { border-color: var(--accent); }
.item-destination.archivee { opacity: .6; }
.item-destination .oaci { font-family: var(--police-mono); font-weight: 800; font-size: 1.35rem; color: var(--accent); text-decoration: none; }
.item-destination .oaci::after { content: ""; position: absolute; inset: 0; } /* toute la carte est cliquable */
.item-destination { position: relative; }
.item-destination .nom { font-weight: 600; }
.item-destination .details { color: var(--texte-doux); font-size: .9rem; }
.item-destination .chiffres { text-align: right; font-family: var(--police-mono); font-size: .95rem; white-space: nowrap; }
.item-destination .chiffres strong { font-size: 1.05rem; }
.bouton-favori { position: relative; z-index: 1; }
.bouton-favori svg { width: 26px; height: 26px; }
.bouton-favori[aria-pressed="true"] { color: #e0a800; }
[data-theme="nuit"] .bouton-favori[aria-pressed="true"] { color: var(--accent); }
.vide { text-align: center; padding: 2rem 1rem; color: var(--texte-doux); }

/* Boîte de dialogue */
dialog {
  border: 1px solid var(--bordure); border-radius: 14px; padding: 0;
  background: var(--surface); color: var(--texte); width: min(520px, calc(100vw - 2rem));
}
dialog::backdrop { background: rgba(0, 0, 0, .5); }
dialog form { padding: 1.25rem; }
dialog h2 { margin-top: 0; }
.apercu { min-height: 3rem; margin: .5rem 0 1rem; }
.apercu dl.infos { font-size: .95rem; }

/* Fiche destination */
.entete-fiche { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.entete-fiche h2 { margin: 0; font-size: 1.5rem; }
.entete-fiche h2 .mono { color: var(--accent); }
.etat-enregistrement { font-size: .85rem; color: var(--texte-doux); min-height: 1.2em; }
.etat-enregistrement.erreur { color: var(--danger); font-weight: 700; }
.section-fiche { margin-bottom: 1.25rem; }
.section-fiche > h2 { margin-top: 0; }

.tuiles { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.tuile { background: var(--surface-2); border: 1px solid var(--bordure); border-radius: var(--rayon); padding: .6rem .8rem; }
.tuile small { display: block; color: var(--texte-doux); font-size: .8rem; line-height: 1.25; }
.tuile strong { font-family: var(--police-mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.tuile.ko { border-color: var(--danger); }
.tuile.ko strong { color: var(--danger); }
.tuile.ok strong { color: var(--ok); }
.hypotheses { font-size: .85rem; color: var(--texte-doux); margin-top: .75rem; }

.avertissement {
  background: var(--alerte-fond); border: 1px solid var(--alerte-bord); color: var(--alerte-texte);
  border-radius: var(--rayon); padding: .6rem .9rem; font-size: .9rem; margin: .75rem 0;
}
.avertissement.danger { border-color: var(--danger); color: var(--danger); background: transparent; font-weight: 700; }

.grille-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* Tableaux */
.defilement { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tableau { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tableau th, .tableau td { padding: .45rem .5rem; border-bottom: 1px solid var(--bordure); text-align: left; vertical-align: middle; }
.tableau th { font-size: .8rem; color: var(--texte-doux); font-weight: 700; white-space: nowrap; }
.tableau td.num, .tableau th.num { text-align: right; font-family: var(--police-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tableau tr.total td { font-weight: 800; border-top: 2px solid var(--bordure); }
.tableau tr.ligne-degagement td { color: var(--danger); }
.tableau input {
  width: 100%; min-width: 4.5rem; min-height: 40px; padding: 0 .5rem;
  border: 1px solid var(--bordure); border-radius: 8px; background: var(--surface-2); color: var(--texte); font: inherit;
}
.tableau input.etroit { width: 5.4rem; min-width: 5.4rem; }
.tableau .actions-point { white-space: nowrap; }
.tableau .actions-point button { width: 40px; height: 40px; }
.rm { font-weight: 800; color: var(--accent); }

.champ-ligne { display: grid; gap: .5rem; grid-template-columns: 1fr 2fr auto; align-items: end; }
@media (max-width: 600px) { .champ-ligne { grid-template-columns: 1fr; } }

/* Notifications */
#notifications {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 60;
  bottom: calc(env(safe-area-inset-bottom) + 1rem);
  display: flex; flex-direction: column; gap: .5rem; width: min(480px, calc(100vw - 2rem));
}
@media (min-width: 768px) { #notifications { bottom: 1.5rem; } }
.notification {
  background: var(--texte); color: var(--surface); padding: .75rem 1rem; border-radius: var(--rayon);
  font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.notification-erreur { background: var(--danger); color: #fff; }

/* ==================================================================
   Données SIA : alertes de validité et import
   ================================================================== */
.alerte-sia { margin-top: .3rem; padding: .3rem .5rem; border-radius: 6px; font-weight: 700; }
.alerte-sia.danger { background: var(--danger); color: #fff; }
.alerte-sia.danger a { color: #fff; }
.alerte-sia.rappel { background: transparent; border: 1px dashed var(--alerte-bord); }
[data-theme="nuit"] .alerte-sia.danger { background: #3a0000; color: var(--danger); }
.pastille.ok { color: var(--ok); border-color: var(--ok); }
.pastille.ko { color: var(--danger); border-color: var(--danger); }
.pastille.attente { color: var(--alerte-texte); border-color: var(--alerte-bord); background: var(--alerte-fond); }
.attribution { font-size: .82rem; color: var(--texte-doux); margin-top: .75rem; }
.description-point { display: block; font-size: .78rem; color: var(--texte-doux); margin-top: .2rem; max-width: 14rem; }
.tableau td small.remarque { display: block; color: var(--texte-doux); font-size: .78rem; white-space: pre-line; }

/* ==================================================================
   Étape 3 — Masse et centrage
   ================================================================== */
.mc-grille { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; }
@media (max-width: 1023px) { .mc-grille { grid-template-columns: minmax(0, 1fr); } }
.mc-champs { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.mc-champs input { font-size: 1.15rem; }
.champ label small { font-weight: 400; color: var(--texte-doux); }
.bouton[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); color: var(--accent); }

.verdict { border-radius: var(--rayon); padding: .9rem 1.1rem; margin-bottom: 1.25rem; font-weight: 700; border: 2px solid; }
.verdict.ok { border-color: var(--ok); color: var(--ok); background: var(--surface); }
.verdict.ko { border-color: var(--danger); color: #fff; background: var(--danger); }
[data-theme="nuit"] .verdict.ko { background: #2a0000; color: var(--danger); }
.verdict .titre-verdict { font-size: 1.25rem; display: block; }
.verdict ul { margin: .5rem 0 0; padding-left: 1.2rem; font-weight: 600; }
.verdict li.attention { opacity: .85; }

.mc-graphique svg { width: 100%; height: auto; display: block; }
.mc-grille-axe { stroke: var(--bordure); stroke-width: 1; }
.mc-texte-axe { fill: var(--texte-doux); font-size: 12px; font-family: var(--police-mono); }
.mc-enveloppe { fill: var(--accent-doux); stroke: var(--accent); stroke-width: 2.5; }
.mc-ligne { stroke: #1c5fc4; stroke-width: 2.5; fill: none; }
.mc-ligne.retour { stroke: #e8590c; stroke-dasharray: 7 5; }
.mc-point { fill: #1c5fc4; stroke: var(--surface); stroke-width: 1.5; }
.mc-point.retour { fill: none; stroke: #e8590c; stroke-width: 2.5; }
.mc-point.hors:not(.retour) { stroke: var(--danger); stroke-width: 3; }
.mc-legende-aller { fill: #1c5fc4; font: 700 13px var(--police); }
.mc-legende-retour { fill: #e8590c; font: 700 13px var(--police); }
[data-theme="nuit"] .mc-ligne, [data-theme="nuit"] .mc-point { stroke: #ff3b2f; fill: #ff3b2f; }
[data-theme="nuit"] .mc-ligne { fill: none; }
[data-theme="nuit"] .mc-point.retour, [data-theme="nuit"] .mc-ligne.retour { stroke: #a61b12; }
.mc-etiquette { fill: var(--texte); font-size: 12px; font-weight: 700; }

.tableau td.hors, .tableau .hors { color: var(--danger); font-weight: 800; }

/* --- Impression du devis M&C : une seule page A4 --- */
.impression-seule { display: none; }
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  body[data-page="mc"] { font-size: 9.5pt; line-height: 1.3; }
  body[data-page="mc"] .bandeau { font-size: 8pt; padding: 1mm; }
  body[data-page="mc"] .barre { display: none; }
  body[data-page="mc"] .contenu { padding: 0; max-width: none; }
  body[data-page="mc"] .impression-seule { display: block; }
  body[data-page="mc"] details, body[data-page="mc"] .groupe-boutons { display: none !important; }
  body[data-page="mc"] .mc-saisie { display: none; }
  body[data-page="mc"] .mc-grille { display: block; }
  body[data-page="mc"] .carte-bloc { box-shadow: none; padding: 2mm 3mm; margin-bottom: 2mm; break-inside: avoid; }
  body[data-page="mc"] h2 { font-size: 11pt; margin: 0 0 1.5mm; }
  body[data-page="mc"] #resume-impression p { margin: .5mm 0; }
  body[data-page="mc"] .verdict { margin-bottom: 2mm; padding: 2mm 3mm; }
  body[data-page="mc"] .verdict .titre-verdict { font-size: 11pt; }
  body[data-page="mc"] .mc-graphique svg { max-height: 72mm; width: auto; margin: 0 auto; }
  body[data-page="mc"] #tableaux { break-inside: auto; }
  body[data-page="mc"] .tableau { font-size: 8.5pt; }
  body[data-page="mc"] .tableau th, body[data-page="mc"] .tableau td { padding: .3mm 1.5mm; }
  body[data-page="mc"] .tableau small.remarque { display: inline; margin-left: 1.5mm; }
  body[data-page="mc"] #tableaux h2 { margin-top: 1.5mm; }
  body[data-page="mc"] .hypotheses { margin: 1mm 0; }
  body[data-page="mc"] .attribution { font-size: 7.5pt; margin: 1mm 0 0; }
}

/* ==================================================================
   Étape 4 — Météo
   ================================================================== */
.liste-stations { display: grid; gap: 1rem; margin-bottom: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
@media (max-width: 600px) { .liste-stations { grid-template-columns: minmax(0, 1fr); } }
.station h2 { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: 0; }
.station h3 { margin: 1rem 0 .4rem; font-size: 1rem; }
.brut { font-family: var(--police-mono); font-size: .85rem; background: var(--surface-2); border: 1px solid var(--bordure);
  border-radius: 8px; padding: .5rem .65rem; white-space: pre-wrap; word-break: break-word; margin: .5rem 0 0; }
.categorie { display: inline-block; min-width: 3.6rem; text-align: center; padding: .15rem .5rem; border-radius: 6px;
  font-weight: 800; font-size: .85rem; color: #fff; font-family: var(--police-mono); }
.cat-VFR { background: #1d7a3a; } .cat-MVFR { background: #1f5fbf; } .cat-IFR { background: #c0262d; } .cat-LIFR { background: #8e1aa8; }
.cat-inconnue { background: var(--texte-doux); }
[data-theme="nuit"] .categorie { color: #000; }
[data-theme="nuit"] .cat-VFR, [data-theme="nuit"] .cat-MVFR { background: #7a1a12; color: #ff8a7a; }
.alerte-meteo { color: var(--danger); font-weight: 700; margin: .4rem 0 0; }
.age { font-size: .85rem; color: var(--texte-doux); font-weight: 400; }
.age.ancien { color: var(--danger); font-weight: 700; }
.vent-saisie { display: inline-flex; gap: .25rem; }
.vent-saisie input { min-width: 4.4rem !important; max-width: 4.8rem; padding-left: .4rem !important; padding-right: .2rem !important; }
.tableau select { min-height: 40px; border-radius: 8px; border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); font: inherit; max-width: 15rem; }
.frequence-libre { display: flex; flex-direction: column; gap: .25rem; margin-top: .25rem; }
.item-destination.vac { grid-template-columns: 5.5rem 1fr auto; }
.item-destination.vac .oaci::after { display: none; }
.item-destination.alerte { border: 2px solid var(--danger); }
@media (max-width: 700px) { .item-destination.vac { grid-template-columns: 4.5rem 1fr; } .item-destination.vac .groupe-boutons { grid-column: 1 / -1; } }

/* Réglages : minimas */
.champ-groupe { border: 1px solid var(--bordure); border-radius: var(--rayon); padding: .6rem .9rem 0; margin: 0; min-width: 0; }
.champ-groupe legend { font-weight: 700; padding: 0 .3rem; }
.champ-court { width: 5.5rem; min-height: 40px; padding: 0 .5rem; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); font: inherit; }
#form-minimas .champ label { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; font-weight: 600; }
#form-minimas input[type="radio"] { width: 20px; height: 20px; }

/* Ancres (#minimas, #sia…) : ne pas se cacher sous la barre collante */
h2[id] { scroll-margin-top: 8rem; }

/* Bandeau : seulement pour les alertes (données SIA périmées…) */
.bandeau:empty { display: none; }
.barre-carte { font-weight: 800; }

/* Avertissement au premier chargement */
.avertissement-initial {
  max-width: 34rem; width: calc(100% - 2rem); border: 1px solid var(--bordure); border-radius: var(--rayon);
  background: var(--surface); color: var(--texte); padding: 1.2rem 1.4rem;
}
.avertissement-initial::backdrop { background: rgba(0, 0, 0, .55); }
.avertissement-initial h2 { margin-top: 0; }
.avertissement-initial .case { display: flex; gap: .6rem; align-items: center; min-height: var(--cible); font-weight: 600; }
.avertissement-initial .case input { width: 22px; height: 22px; }
.bandeau:empty + .barre { padding-top: max(.25rem, env(safe-area-inset-top)); }

/* Masse et centrage : cadre du graphique selon le résultat */
.mc-cadre { fill: none; stroke-width: 3.5; }
.mc-cadre.ok { stroke: #1d9e48; }
.mc-cadre.ko { stroke: #d62828; }
.mc-barre { stroke: #d62828; stroke-width: 3.5; stroke-linecap: round; opacity: .85; }
[data-theme="nuit"] .mc-cadre.ok { stroke: #7a1a12; }
[data-theme="nuit"] .mc-cadre.ko, [data-theme="nuit"] .mc-barre { stroke: #ff3b2f; }
.mc-alertes { margin: .4rem 0 0; padding-left: 1.2rem; }
.mc-alertes li { margin: .2rem 0; }
.mc-alertes li.danger { color: var(--danger); font-weight: 700; }
.mc-alertes li.attention { color: var(--alerte-texte); }
.mc-alertes:empty { display: none; }
@media print { .mc-cadre { stroke-width: 2.5; } }

/* M&C : libellés sur une ligne, champs alignés */
.mc-champs { display: flex; flex-direction: column; gap: .25rem; }
.mc-rangee { display: grid; gap: 0 1rem; grid-template-columns: repeat(2, minmax(0, 12rem)); }
.mc-champs .champ label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-champs .champ label small { color: var(--texte-doux); font-weight: 600; }
.mc-champs .champ input, .mc-champs .champ select { width: 100%; min-width: 0; }
.mc-carburant { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-variant-numeric: tabular-nums; }
.mc-carburant span { white-space: nowrap; }

/* ---------- SOFIA / Météo ---------- */
.import-doc textarea { width: 100%; font: .85rem var(--police-mono); padding: .5rem; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); }
.import-doc label.bouton { cursor: pointer; }
dl.infos.compact { grid-template-columns: max-content 1fr; gap: .2rem 1rem; }
dl.infos .hors, .hors { color: var(--danger); }
.filtres-notam { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; }
.filtres-notam label { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.filtres-notam select { font: inherit; min-height: 40px; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); }
.notam { border-top: 1px solid var(--bordure); padding: .6rem 0; }
.notam header { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.notam-id { font-weight: 800; }
.notam-lieux { color: var(--texte-doux); }
.notam-meta { margin: .2rem 0; font-size: .85rem; color: var(--texte-doux); }
.notam-texte { margin: .2rem 0 0; white-space: pre-line; font-size: .92rem; }
.notam.masque-notam, .notam.inactif { opacity: .55; }
.metar-dossier th { width: 4.5rem; vertical-align: top; }
.metar-dossier .brut { margin: 0; white-space: pre-wrap; }

/* ---------- Dossier prévol ---------- */
.dossier-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; }
.dossier-entete h1 { margin: 0; font-size: 1.35rem; }
.dossier-entete h1 small { font-weight: 500; color: var(--texte-doux); font-size: .95rem; }
.dossier-entete p { margin: .2rem 0 0; }
.dossier-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 1rem; align-items: start; }
.dossier-2col h3 { margin: .3rem 0; font-size: 1rem; }
.verifications { border-left: 6px solid var(--ok); }
.verifications.moyen { border-left-color: var(--alerte-bord); }
.verifications.ko { border-left-color: var(--danger); }
.verifications h2 { margin-bottom: .3rem; }
.verifications ul { margin: 0; padding-left: 1.2rem; }
.verifications li.manque { color: var(--danger); font-weight: 600; }
.verifications li a { text-decoration: none; font-weight: 700; }
.tableau.compact th, .tableau.compact td { padding: .25rem .5rem; }
.tableau .ligne-degagement td { color: var(--danger); }
.tableau.devis tr.total th { border-top: 2px solid var(--texte); }
.liste-notams { list-style: none; margin: 0 0 .5rem; padding: 0; font-size: .9rem; }
.liste-notams li { padding: .25rem 0; border-top: 1px solid var(--bordure); }
.notam-court { display: block; }
.dossier-graphique svg { width: 100%; max-height: 320px; }
.imprime-seul { display: none; }
@media print {
  .non-imprime { display: none !important; }
  .imprime-seul { display: block; }
  body[data-page="dossier"] { font-size: 9pt; line-height: 1.25; }
  body[data-page="dossier"] .contenu { padding: 0; max-width: none; }
  body[data-page="dossier"] .carte-bloc { box-shadow: none; padding: 1.5mm 2.5mm; margin-bottom: 2mm; break-inside: avoid; }
  body[data-page="dossier"] h2 { font-size: 10.5pt; margin: 0 0 1mm; }
  body[data-page="dossier"] .brut { font-size: 7.5pt; }
  body[data-page="dossier"] .dossier-graphique svg { max-height: 60mm; }
  body[data-page="dossier"] .pastille-meteo { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Pastille météo (METAR | TAF) : carte et dossier */
.pastille-meteo {
  display: inline-flex; flex: none; width: 18px; height: 18px; border-radius: 50%; overflow: hidden;
  border: 1.5px solid var(--surface); box-shadow: 0 0 0 1px var(--bordure);
}
.pastille-meteo.grande { width: 24px; height: 24px; }
.pastille-meteo > span { flex: 1; }
.niveau-vert { background: #1d9e48; }
.niveau-orange { background: #f08c00; }
.niveau-rouge { background: #d62828; }
.niveau-inconnu { background: #9aa3ad; }
[data-theme="nuit"] .niveau-vert { background: #5a1410; }
[data-theme="nuit"] .niveau-orange { background: #a8321f; }
[data-theme="nuit"] .niveau-rouge { background: #ff3b2f; }

/* Page Log : choix de la nav */
.choix-log { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; padding: .6rem .9rem; margin-bottom: .8rem; }
.choix-log label:first-child { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; flex: 1 1 18rem; }
.choix-log select { flex: 1; min-height: 44px; font: inherit; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); }
.choix-log label.bouton { cursor: pointer; }

/* Réglages : écart au-dessus des boutons d'import */
#sia .groupe-boutons, #sia + .section-fiche .groupe-boutons, #fond-carte + .section-fiche .groupe-boutons { margin-top: 1rem; }

/* Pastille d'un terrain sans METAR (METAR du terrain le plus proche) : anneau pointillé + hachures */
.pastille-meteo.estimee { position: relative; outline: 2px dashed #6b7280; outline-offset: 1px; }
.pastille-meteo.estimee::after { content: ''; position: absolute; inset: 0; border-radius: inherit;
  background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .6) 0 2px, transparent 2px 5px); }

/* Log : recherche d'un point */
.recherche-point { position: relative; max-width: 40rem; }
.resultats-recherche { list-style: none; margin: .25rem 0 0; padding: 0; border: 1px solid var(--bordure); border-radius: var(--rayon); background: var(--surface); max-height: 18rem; overflow-y: auto; }
.resultats-recherche li { border-top: 1px solid var(--bordure); }
.resultats-recherche li:first-child { border-top: 0; }
.resultats-recherche li.a-venir { padding: .5rem .75rem; }
.resultats-recherche button { display: flex; gap: .5rem; align-items: baseline; width: 100%; min-height: 44px; padding: .4rem .75rem; text-align: left; font: inherit; color: var(--texte); background: none; border: 0; cursor: pointer; }
.resultats-recherche button:hover, .resultats-recherche button:focus-visible { background: var(--surface-2); }
.resultats-recherche button span:last-child { color: var(--texte-doux); font-size: .9rem; }
.grille-3 { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }

/* M&C : séparation aller / retour */
.mc-branche-retour { margin-top: 2rem; padding-top: 1rem; border-top: 2px dashed #e8590c; }
.mc-branche-retour h2 { color: #e8590c; }
[data-theme="nuit"] .mc-branche-retour h2 { color: inherit; }

/* NOTAM : code couleur par groupe (mêmes couleurs que la carte pour les zones) */
.notam { border-left: 5px solid var(--c-notam, #6b7280); padding-left: .7rem; }
.notam-zones { --c-notam: #e65100; }
.notam-terrains { --c-notam: #1c5fc4; }
.notam-espaces { --c-notam: #7b1fa2; }
.notam-obstacles { --c-notam: #6d4c41; }
.notam-autres { --c-notam: #6b7280; }
.puce-notam { display: inline-block; width: .8em; height: .8em; border-radius: 3px; margin-right: .45rem; background: var(--c-notam); vertical-align: baseline; }
.liste-notams li { border-left: 4px solid var(--c-notam, transparent); padding-left: .5rem; }

/* ---------- Profil vertical ---------- */
.pf-commandes { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; margin-bottom: .5rem; }
.pf-commandes label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; }
.pf-commandes select { font: inherit; min-height: 40px; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); }
.segmente .bouton.actif { background: var(--accent, #1c5fc4); color: #fff; border-color: transparent; }
.defilement-h { overflow-x: auto; }
.profil-vertical { width: 100%; min-width: 640px; height: auto; display: block; font-family: var(--police); }
.pf-grille { stroke: var(--bordure); stroke-width: 1; }
.pf-axe { font-size: 11px; fill: var(--texte-doux); }
.pf-sol { fill: #8d6e63; fill-opacity: .85; stroke: #5d4037; stroke-width: 1; }
.pf-zone { fill: var(--c); fill-opacity: .10; stroke: var(--c); stroke-width: 1.5; }
.pf-zone.activable { stroke-dasharray: 6 4; }
.pf-zone-P, .pf-zone-R, .pf-zone-D { fill-opacity: .16; }
.pf-zone-nom { font-size: 10.5px; font-weight: 700; fill: var(--c); }
.pf-notam { fill: #e65100; fill-opacity: .14; stroke: #e65100; stroke-width: 1.5; stroke-dasharray: 4 3; }
.pf-notam.inactif { fill: #9e9e9e; stroke: #9e9e9e; }
.pf-notam-nom { font-size: 10px; font-weight: 700; fill: #e65100; }
.pf-nuage { fill: #90a4ae; fill-opacity: .28; }
.pf-iso0 { fill: none; stroke: #00a3d9; stroke-width: 2.5; stroke-dasharray: 8 5; }
.pf-iso0-point { fill: #00a3d9; stroke: #fff; stroke-width: 1; }
.pf-iso0-texte { font-size: 12px; font-weight: 800; fill: #00a3d9; }
.pf-croisiere { stroke: #1d9e48; stroke-width: 2.5; }
.pf-croisiere-texte { font-size: 11.5px; font-weight: 800; fill: #1d9e48; }
.pf-repere { stroke: var(--texte-doux); stroke-width: 1; stroke-dasharray: 2 3; }
.pf-repere-nom { font: 700 11px var(--police-mono); fill: var(--texte); }
.pf-legende { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .82rem; color: var(--texte-doux); margin: .4rem 0; }
.pf-legende span { display: inline-flex; align-items: center; gap: .3rem; }
.pf-legende i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
.pf-l-sol { background: #8d6e63; }
.pf-l-zone { background: color-mix(in srgb, var(--c) 18%, transparent); border: 1.5px solid var(--c); }
.pf-l-notam { background: rgba(230, 81, 0, .15); border: 1.5px dashed #e65100; }
.pf-l-nuage { background: rgba(144, 164, 174, .45); }
.pf-l-iso { height: 0 !important; border-top: 3px dashed #00a3d9; }
.pf-l-croisiere { height: 0 !important; border-top: 3px solid #1d9e48; }
.diagramme-carburateur { width: 100%; max-width: 360px; }
.diag-grille { stroke: var(--bordure); stroke-width: .6; }
.diag-texte { font-size: 10px; fill: var(--texte-doux); }
.diag-diagonale { stroke: var(--texte); stroke-width: 1.2; }
.diag-point { fill: #d0021b; stroke: #fff; stroke-width: 1.5; }
.diag-etiquette { font-size: 10px; font-weight: 700; fill: #d0021b; }
[data-theme="nuit"] .pf-sol { fill: #3a0000; stroke: #ff3b2f; }
[data-theme="nuit"] .pf-iso0, [data-theme="nuit"] .pf-croisiere { stroke: #ff3b2f; }
@media print { .pf-commandes { display: none; } .profil-vertical { min-width: 0; } }

.pf-c-rouge { --c: #d0021b; } .pf-c-bleu { --c: #1c5fc4; } .pf-c-violet { --c: #7b1fa2; } .pf-c-vert { --c: #2e7d32; } .pf-c-gris { --c: #555; }
.pf-l-c1 { background: #f08c00; } .pf-l-c2 { background: #ffd400; } .pf-l-c3 { background: #2b9a3e; } .pf-l-c4 { background: #1c6dd0; }
.pf-altitudes { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; align-items: center; margin-bottom: .6rem; }
.pf-altitudes label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 700; }
.pf-vent { stroke: #37474f; stroke-width: 1.6; fill: none; }
.pf-vent-tete { fill: #37474f; }
.pf-vent-texte { font: 700 9.5px var(--police-mono); fill: #37474f; }
[data-theme="nuit"] .pf-vent, [data-theme="nuit"] .pf-vent-texte { stroke: #ff3b2f; fill: #ff3b2f; }

.pf-couloir { fill: #bcaaa4; fill-opacity: .55; stroke: #8d6e63; stroke-width: .8; stroke-dasharray: 3 2; }
.pf-obstacle { fill: none; stroke: #b71c1c; stroke-width: 1.8; }
.pf-zs { stroke: #e65100; stroke-width: 2.2; stroke-dasharray: 10 4; }
.pf-zs-texte { font: 800 10.5px var(--police-mono); fill: #e65100; }
.pf-l-couloir { background: rgba(188, 170, 164, .7); border: 1px dashed #8d6e63; }
.pf-l-zs { height: 0 !important; border-top: 3px dashed #e65100; }

.pf-barbule path, .pf-barbule circle { stroke: #263238; stroke-width: 1.6; fill: none; stroke-linecap: round; }
.pf-barbule circle { fill: #263238; }
.pf-barbule .pf-fanion { fill: #263238; }
.pf-plafond line, .pf-plafond path { stroke: #455a64; stroke-width: 2; fill: none; }
.pf-l-plafond { height: 0 !important; border-top: 2px solid #455a64; }
[data-theme="nuit"] .pf-barbule path, [data-theme="nuit"] .pf-barbule circle, [data-theme="nuit"] .pf-plafond line { stroke: #ff3b2f; }

/* Carte AROME (page Météo) */
.carte-arome { height: min(62vh, 560px); border-radius: var(--rayon); border: 1px solid var(--bordure); }
.arome-commandes { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; align-items: center; margin-bottom: .6rem; }
.arome-commandes label { display: inline-flex; gap: .4rem; align-items: center; font-weight: 600; }
.arome-commandes select { font: inherit; min-height: 40px; border-radius: var(--rayon); border: 1px solid var(--bordure); background: var(--surface-2); color: var(--texte); max-width: 18rem; }
.arome-echeance { display: flex; align-items: center; gap: .5rem; flex: 1 1 22rem; }
.arome-echeance input[type=range] { flex: 1; min-height: 44px; }
.arome-legende img { max-width: 100%; }

/* METAR / TAF en couleur */
.brut b { font-weight: 800; }
.mt-bleu { color: #1565c0; }
.mt-noir { color: #000; }
.mt-rouge { color: #c62828; }
.mt-orange { color: #e65100; }
[data-theme="sombre"] .mt-noir, [data-theme="nuit"] .mt-noir { color: var(--texte); }
[data-theme="sombre"] .mt-bleu { color: #64b5f6; }
[data-theme="nuit"] .mt-bleu, [data-theme="nuit"] .mt-rouge, [data-theme="nuit"] .mt-orange { color: #ff3b2f; text-decoration: underline; }

.diag-point { fill: #0b2a5b; stroke: #fff; stroke-width: 1.5; }
.diag-point.croisiere { fill: #6a1b9a; }
.diag-etiquette { font-size: 10.5px; font-weight: 800; fill: #0b2a5b; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.diag-etiquette.croisiere { fill: #6a1b9a; }
.diag-legende { list-style: none; margin: .4rem 0; padding: 0; font-size: .85rem; display: grid; gap: .15rem; }
.diag-legende li { display: flex; gap: .4rem; align-items: center; }
.diag-legende i { width: 14px; height: 10px; border-radius: 2px; flex: none; }
.dl1 { background: #f08c00; } .dl2 { background: #ffd400; } .dl3 { background: #2b9a3e; } .dl4 { background: #1c6dd0; }
#arome-erreur:empty { display: none; }
.liste-couches { columns: 2; font-size: .8rem; margin: .4rem 0; padding-left: 1.2rem; }

.pf-nuage { fill: #78909c; fill-opacity: .12; }
.pf-nuage.n2 { fill-opacity: .18; } .pf-nuage.n3 { fill-opacity: .24; } .pf-nuage.n4 { fill-opacity: .3; }
.pf-nuage.n5 { fill-opacity: .38; } .pf-nuage.n6 { fill-opacity: .46; } .pf-nuage.n7 { fill-opacity: .54; } .pf-nuage.n8 { fill-opacity: .62; }
.pf-plancher { fill: none; stroke: #546e7a; stroke-width: 2; stroke-dasharray: 5 4; }
.pf-plancher-point { fill: #546e7a; }
.pf-plafond-ligne { fill: none; stroke: #263238; stroke-width: 2.5; }
.pf-plafond-ligne-point { fill: #263238; }
.pf-l-plancher { height: 0 !important; border-top: 2px dashed #546e7a; }
#profil-meteo .tableau td { white-space: nowrap; }

.pf-siv { fill: #2e9e4f; fill-opacity: .07; stroke: #2e9e4f; stroke-opacity: .35; stroke-width: .8; stroke-dasharray: 3 3; }
.pf-l-siv { background: rgba(46, 158, 79, .12); border: 1px dashed rgba(46, 158, 79, .6); }

.pf-bulle { position: fixed; left: 0; top: 0; z-index: 2000; max-width: min(420px, 90vw); padding: 6px 9px; border-radius: 6px;
  background: #1d2733; color: #fff; font-size: 13px; line-height: 1.35; white-space: pre-line; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.3); }
.pf-zones-table td { vertical-align: top; }
.pf-zones-table small { display: block; }
.pf-zone-concernee td:first-child { box-shadow: inset 3px 0 0 #c62828; }
.pf-zones-table details summary { cursor: pointer; }

/* Log : paires de champs (avion | carburant, dégagement | altitude…) */
.grille-paires { display: grid; gap: .8rem 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .grille-paires { grid-template-columns: 1fr; } }

/* Profil : code couleur des zones à traverser */
.pf-zones-table tr.cat-rouge td { background: rgba(214, 40, 40, .07); }
.pf-zones-table tr.cat-bleu td { background: rgba(28, 95, 196, .07); }
.pf-zones-table tr.cat-orange td { background: rgba(240, 140, 0, .10); }
.pf-zones-table tr.cat-vert td { background: rgba(29, 158, 72, .08); }
.pf-zones-table tr.cat-rouge td:first-child { box-shadow: inset 4px 0 0 #d62828; }
.pf-zones-table tr.cat-bleu td:first-child { box-shadow: inset 4px 0 0 #1c5fc4; }
.pf-zones-table tr.cat-orange td:first-child { box-shadow: inset 4px 0 0 #f08c00; }
.pf-zones-table tr.cat-vert td:first-child { box-shadow: inset 4px 0 0 #1d9e48; }
.pf-zones-legende span { display: inline-flex; align-items: center; gap: .3rem; margin-right: 1rem; }
.pf-zones-legende i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pf-zones-legende .cat-rouge { background: #d62828; } .pf-zones-legende .cat-bleu { background: #1c5fc4; }
.pf-zones-legende .cat-orange { background: #f08c00; } .pf-zones-legende .cat-vert { background: #1d9e48; }

/* Profil du vol : visibilité < 10 km (modèle) */
.pf-visi-rouge { fill: #d62828; } .pf-visi-orange { fill: #f08c00; } .pf-visi-jaune { fill: #ffd400; }
.pf-visi-texte { font: 700 10px var(--police-mono); fill: #111; }
.pf-l-visi { background: linear-gradient(90deg, #ffd400 0 33%, #f08c00 33% 66%, #d62828 66%); }
.vent-prevu { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; }
.vent-prevu select { width: auto; }

/* ================= Dossier prévol : une section par page ================= */
.dossier-titre-page span { display: inline-block; min-width: 2.2em; padding: 0 .4em; margin-right: .3em; border-radius: 6px; background: var(--accent); color: #fff; text-align: center; }
.dossier-tuiles { margin: .8rem 0; }
.dossier-carte { height: 215mm; max-width: 190mm; margin: 0 auto; border-radius: 8px; overflow: hidden; } /* même taille à l'écran et à l'impression */
.dossier-vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(58mm, 1fr)); gap: 4mm; }
.dossier-vignettes figure { margin: 0; break-inside: avoid; }
.dossier-vignette { height: 58mm; border-radius: 6px; overflow: hidden; }
.dossier-vignettes figcaption { font-size: .85rem; margin-top: .2rem; }
.dossier-point-etiquette { font: 700 12px var(--police-mono); padding: 1px 5px; }
.dossier-notam-etiquette { font: 700 10px var(--police-mono); color: #e65100; background: rgba(255,255,255,.85); border: 0; box-shadow: none; padding: 0 3px; }
.dossier-notam-etiquette::before { display: none; }
.logs-a6 { overflow-x: auto; }
@media print {
  body[data-page="dossier"] .dossier-page { break-before: page; page-break-before: always; break-inside: auto; }
  body[data-page="dossier"] .dossier-couverture { break-before: auto; page-break-before: auto; }
  body[data-page="dossier"] .dossier-page .carte-bloc { break-inside: avoid; }
  body[data-page="dossier"] .notam { break-inside: avoid; }
  body[data-page="dossier"] .leaflet-control-container { display: none; }
  body[data-page="dossier"] .dossier-titre-page span { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
@media print {
  body[data-page="dossier"] .dossier-page .diagramme-carbu, body[data-page="dossier"] .dossier-page .dossier-2col svg { max-height: 85mm; width: auto; }
  body[data-page="dossier"] .dossier-page .brut { font-size: 7pt; }
}

.pf-tocd circle { fill: #fff; stroke: #2e7d32; stroke-width: 2; }
.pf-tocd text { font: 700 10px var(--police-mono); fill: #2e7d32; }
.siv-branche { display: flex; flex-direction: column; margin-top: .25rem; font-weight: 700; color: #0e6b3a; font-size: .8rem; }
.siv-branche label { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; }
.siv-branche input[type="checkbox"] { width: 16px !important; height: 16px !important; min-height: 0 !important; min-width: 0 !important; padding: 0 !important; margin: 0; accent-color: #0e6b3a; flex: none; }

.dossier-pdf-page { display: block; width: 100%; height: auto; margin: 0 auto 6mm; box-shadow: 0 1px 6px rgba(0,0,0,.2); }
@media print {
  body[data-page="dossier"] .dossier-pdf-page { box-shadow: none; max-height: 262mm; width: auto; max-width: 100%; margin: 0 auto; break-after: page; page-break-after: always; }
  body[data-page="dossier"] .dossier-pdf-page:last-child { break-after: auto; page-break-after: auto; }
  body[data-page="dossier"] .dossier-annexe { padding: 0; }
}
.pf-trajectoire { fill: none; stroke-linejoin: round; }

/* Dossier : espace entre la barre de couleur et la liste des points */
.verifications { padding-left: 1rem; }
.verifications ul { padding-left: 1.2rem; }
/* Impression du dossier : pages sans marge d'imprimante ; marges intérieures de 10 mm,
   sauf les logs A6 (4 par A4, pleine page, à découper) */
@media print {
  @page { size: A4; margin: 0; }
  body[data-page="dossier"] .dossier-page { padding: 10mm 12mm; margin: 0; border: 0; border-radius: 0;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; }
  body[data-page="dossier"] .dossier-logs { padding: 0; }
  /* Logs : une page de log par feuille, agrandie pour remplir toute la feuille (A6 × 2 = A4) :
     imprimer sur le format voulu avec « Ajuster à la page » (A6, A5 ou A4) */
  body[data-page="dossier"] .dossier-logs .logs-a6 { display: block; overflow: visible; }
  body[data-page="dossier"] .dossier-logs, body[data-page="dossier"] .dossier-logs .logs-a6 { overflow: visible; }
  body[data-page="dossier"] .dossier-logs .page-a6 { transform: scale(2); transform-origin: 0 0; margin: 0 0 148mm 0; outline: 0;
    break-after: page; page-break-after: always; break-inside: avoid; }
  body[data-page="dossier"] .dossier-logs .page-a6:last-child { break-after: auto; page-break-after: auto; }
  body[data-page="dossier"] .dossier-annexe { padding: 0; }
  body[data-page="dossier"] .dossier-pdf-page { max-height: 297mm; max-width: 210mm; }
  body[data-page="dossier"] main, body[data-page="dossier"] #contenu, body[data-page="dossier"] #dossier { padding: 0 !important; margin: 0 !important; max-width: none !important; }
}
