/* Météo Planeur — style sobre, une seule couleur d'accent */

:root {
  --fond: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --bord: #dce1e7;
  --texte: #1c232b;
  --texte-2: #5d6875;
  --accent: #1f5f9e;
  --accent-doux: #e3edf7;
  --erreur: #b3261e;
  --risque-0: #e9ecef;
  --risque-1: #f6e7a8;
  --risque-2: #f3c27a;
  --risque-3: #e5866d;
  --risque-4: #b8475e;
  --rayon: 6px;
  --police: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

/* Thème sombre : choisi dans l'interface (data-theme), ou suivant le système en mode auto */
:root[data-theme="dark"] {
  --fond: #11161b;
  --surface: #182027;
  --surface-2: #202a33;
  --bord: #2c3742;
  --texte: #e4e9ee;
  --texte-2: #98a4b0;
  --accent: #6ea8e2;
  --accent-doux: #1c3148;
  --risque-0: #2a333c;
  --risque-1: #5c5428;
  --risque-2: #6e4c22;
  --risque-3: #7a3a2c;
  --risque-4: #7c2a3e;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --fond: #11161b;
    --surface: #182027;
    --surface-2: #202a33;
    --bord: #2c3742;
    --texte: #e4e9ee;
    --texte-2: #98a4b0;
    --accent: #6ea8e2;
    --accent-doux: #1c3148;
    --risque-0: #2a333c;
    --risque-1: #5c5428;
    --risque-2: #6e4c22;
    --risque-3: #7a3a2c;
    --risque-4: #7c2a3e;
    color-scheme: dark;
  }
}

.theme { margin-left: auto; }

* { box-sizing: border-box; }
[x-cloak] { display: none !important; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font: 14px/1.45 var(--police);
  font-variant-numeric: tabular-nums;
}

h2, h3 { margin: 0 0 .6rem; font-weight: 600; }
h2 { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
h3 { font-size: .95rem; }
small { color: var(--texte-2); }
.discret { color: var(--texte-2); font-size: .85rem; margin: .4rem 0; }
.erreur { color: var(--erreur); font-size: .85rem; }

button, input, select, .bouton {
  font: inherit;
  color: inherit;
}
button, .bouton {
  cursor: pointer;
  border: 1px solid var(--bord);
  background: var(--surface);
  border-radius: var(--rayon);
  padding: .35rem .7rem;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}
button:hover:not(:disabled), .bouton:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, .bouton:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button.principal { background: var(--accent); border-color: var(--accent); color: #fff; }
button.lien {
  border: 0; background: none; padding: 0; color: var(--accent); font-size: .85rem;
}
input, select {
  border: 1px solid var(--bord);
  background: var(--surface);
  border-radius: var(--rayon);
  padding: .35rem .5rem;
  min-width: 0;
}

/* En-tête : sélection (modèle, journée, état, thème) puis réglages (lieu, favoris, taux de chute, zone) */
.barre {
  position: relative; z-index: 1200; /* au-dessus des contrôles Leaflet (1000) pour les menus */
  background: var(--surface);
  border-bottom: 1px solid var(--bord);
}
.barre .ligne {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.25rem;
  padding: .55rem 1.25rem;
}
.barre .ligne.reglages { border-top: 1px solid var(--bord); background: var(--surface-2); font-size: .88rem; }
.barre .erreur { margin: 0; padding: .4rem 1.25rem; border-top: 1px solid var(--bord); }
.marque { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: 1.05rem; }
.marque svg { width: 26px; height: 26px; fill: var(--accent); }
.espace { flex: 1; }

.segments { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--bord); border-radius: var(--rayon); overflow: hidden; }
.segments button { border: 0; border-radius: 0; border-right: 1px solid var(--bord); padding: .35rem .75rem; }
.segments button:last-of-type { border-right: 0; }
.segments button[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); font-weight: 600; }
.segments button small { font-weight: 400; }
.segments.petits button { padding: .25rem .6rem; font-size: .85rem; }
.segments.jours { border: 0; gap: .25rem; overflow: visible; }
.segments.jours button { border: 1px solid var(--bord); border-radius: var(--rayon); }
.segments.jours button[aria-pressed="true"] { border-color: var(--accent); }

.pastille { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--bord); }
.pastille.prete { background: #3a8a5c; }

/* État des données, dans la première ligne */
.etat { font-size: .88rem; }
.etat > span { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem; }
.etat button.principal small { color: inherit; opacity: .85; }
.progression { display: inline-block; width: 140px; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; }
.progression span { display: block; height: 100%; background: var(--accent); transition: width .5s; }
.progression.indetermine span { width: 30%; animation: va-et-vient 1.2s ease-in-out infinite alternate; }
@keyframes va-et-vient { from { margin-left: 0; } to { margin-left: 70%; } }

/* Lieu */
.recherche-bloc { position: relative; flex: 0 1 22rem; }
.recherche, .ajout-favori { display: flex; gap: .4rem; }
.recherche input, .ajout-favori input { flex: 1; }
.resultats {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 1100;
  list-style: none; margin: 0; padding: .2rem; max-height: 20rem; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.resultats li.discret { margin: 0; padding: .4rem; }
.resultats button {
  width: 100%; border: 0; border-bottom: 1px solid var(--bord); border-radius: 0;
  flex-direction: column; align-items: flex-start; gap: 0; text-align: left; padding: .4rem .3rem;
}
.resultats li:last-child button { border-bottom: 0; }
.resultats button:hover { background: var(--surface-2); }
.resultats small { font-size: .78rem; }
.lieu-actuel { position: relative; display: inline-flex; align-items: baseline; gap: .5rem; white-space: nowrap; }
.lieu-actuel .ajout-favori {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1100; width: 18rem;
  padding: .4rem; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}
.favoris { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.favoris li { display: inline-flex; align-items: center; border: 1px solid var(--bord); border-radius: 999px; background: var(--surface); }
.favoris li.actif { background: var(--accent-doux); border-color: var(--accent); }
.favoris .nom { border: 0; background: none; padding: .15rem .1rem .15rem .65rem; font-size: .85rem; }
.favoris .retirer { border: 0; background: none; color: var(--texte-2); padding: .1rem .5rem .1rem .3rem; }

/* Réglages */
.reglage { display: inline-flex; align-items: center; gap: .4rem; color: var(--texte-2); }
.champ { display: inline-flex; align-items: center; gap: .3rem; color: var(--texte); }
.champ input { width: 4.2rem; text-align: right; }
.champ em { font-style: normal; color: var(--texte-2); font-size: .85rem; }

/* Mise en page : le contenu occupe toute la largeur, moins les marges sur écran de PC (en fin de fichier) */
.page { padding: 1rem 1.25rem; }
.carte-bloc, .graphiques figure, .tableau-bloc, .vide {
  background: var(--surface);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
}
.contenu { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }

/* Carte */
.carte-bloc { overflow: hidden; }
.outils-carte {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem;
  padding: .5rem .8rem; border-bottom: 1px solid var(--bord); font-size: .85rem;
}
.outils-carte label { display: inline-flex; align-items: center; gap: .4rem; color: var(--texte-2); }
.outils-carte select { color: var(--texte); max-width: 15rem; }
.outils-carte .opacite input { width: 6rem; accent-color: var(--accent); }
.outils-carte .espace { flex: 1; }
.outils-carte button { font-size: .85rem; padding: .25rem .6rem; }
.carte-corps { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.carte-conteneur { position: relative; }

/* Résumé condensé au point, à droite de la carte */
.resume {
  width: 230px; height: 580px; overflow-y: auto;
  border-left: 1px solid var(--bord); font-size: .84rem;
}
.resume header {
  display: flex; justify-content: space-between; align-items: baseline; gap: .5rem;
  padding: .5rem .8rem; border-bottom: 1px solid var(--bord); background: var(--surface-2);
}
.resume header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume section { padding: .35rem .8rem .4rem; border-bottom: 1px solid var(--bord); }
.resume section:last-child { border-bottom: 0; }
.resume h3 { margin: 0 0 .15rem; font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); }
.resume .valeur { margin: 0; font-size: 1.35rem; font-weight: 600; line-height: 1.2; }
.resume .valeur em { font-style: normal; font-size: .75rem; font-weight: 400; color: var(--texte-2); margin-left: .3rem; }
.resume dl { display: grid; grid-template-columns: auto 1fr; gap: .05rem .6rem; margin: 0; }
.resume dt { color: var(--texte-2); white-space: nowrap; }
.resume dd { margin: 0; text-align: right; white-space: nowrap; }
.risque.petit { font-size: .78rem; padding: 0 .4rem; }
#carte { height: 500px; }
.legende {
  position: absolute; left: 10px; bottom: 34px; z-index: 900;
  min-width: 220px; max-width: 320px; padding: .45rem .6rem;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  font-size: .78rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}
.legende .heure-carte { float: right; font-weight: 600; color: var(--accent); margin-left: .6rem; }
.outils-carte .animer[aria-pressed="true"] { background: var(--accent-doux); border-color: var(--accent); color: var(--accent); }
.legende .degrade { height: 10px; border-radius: 2px; margin-top: .3rem; }
.legende .graduations { display: flex; justify-content: space-between; color: var(--texte-2); font-size: .72rem; }
.legende .categories { display: flex; flex-wrap: wrap; gap: .2rem .7rem; margin-top: .3rem; }
.legende .categories i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .25rem; vertical-align: -1px; }
.legende .note-vent { display: block; margin-top: .3rem; }
/* Situation synoptique (couleurs fixes : elles se lisent sur les fonds de carte clairs) */
.etiquette-isobare {
  font-size: 10px; line-height: 14px; text-align: center; color: #2e3741; font-weight: 600;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.centre-pression { display: flex; flex-direction: column; align-items: center; line-height: 1; text-shadow: 0 0 3px #fff, 0 0 4px #fff; }
.centre-pression b { font-size: 24px; }
.centre-pression small { font-size: 11px; font-weight: 600; color: #2e3741; }
.centre-pression.depression b, .symbole-d { color: #c0392b; }
.centre-pression.anticyclone b, .symbole-a { color: #1f5fd0; }
.fleche-vent svg { width: 100%; height: 100%; fill: #1c232b; stroke: #fff; stroke-width: 1.5; paint-order: stroke; opacity: .8; }
.legende-carte { margin: 0; padding: .45rem .8rem; font-size: .82rem; color: var(--texte-2); border-top: 1px solid var(--bord); }
.vide { padding: 2rem; text-align: center; color: var(--texte-2); }

/* Heures */
.heures {
  display: grid;
  grid-template-columns: repeat(var(--n, 12), minmax(38px, 1fr));
  gap: .3rem;
  overflow-x: auto;
  position: relative; /* repère des positions pour le défilement automatique */
  padding: 2px;
}
.heures button {
  flex-direction: column; gap: 0; padding: .3rem 0;
  background: color-mix(in srgb, var(--accent) calc(var(--teinte) * 1%), var(--surface));
}
.heures button small { color: inherit; opacity: .75; font-size: .75rem; }
.heures button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: -1px; font-weight: 600; }

/* Fiches */
.prevision { display: flex; flex-direction: column; gap: 1rem; }
.fleche { display: inline-block; font-style: normal; color: var(--accent); }
.risque { display: inline-block; font-size: 1.05rem; padding: .2rem .6rem; border-radius: var(--rayon); }
.r0 { background: var(--risque-0); } .r1 { background: var(--risque-1); } .r2 { background: var(--risque-2); }
.r3 { background: var(--risque-3); } .r4 { background: var(--risque-4); color: #fff; }

/* Graphiques */
.graphiques { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.graphiques figure { margin: 0; padding: .8rem 1rem; }
.graphiques figcaption { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); font-weight: 600; margin-bottom: .4rem; }
.cadre { position: relative; height: 240px; }

/* Tableau */
.tableau-bloc { padding: .8rem 0 0; }
.tableau-entete { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: 0 1rem .6rem; }
.defilement { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th, td { padding: .3rem .5rem; border-top: 1px solid var(--bord); white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--surface); font-weight: 600; cursor: pointer; text-align: right; }
tbody th { text-align: left; font-weight: 400; position: sticky; left: 0; background: var(--surface); }
tbody th small { margin-left: .35rem; font-size: .75rem; }
td { text-align: right; }
tr.groupe th { background: var(--surface-2); font-weight: 600; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; color: var(--texte-2); }
th.choisie, td.choisie { background: var(--accent-doux); }
td.vario { background: color-mix(in srgb, var(--accent) calc(var(--teinte) * 1%), transparent); }
td.choisie.vario { outline: 1px solid var(--accent); outline-offset: -1px; }

.pied { padding: .8rem 1.25rem 1.5rem; text-align: center; font-size: .8rem; color: var(--texte-2); }

/* Écrans étroits */
@media (max-width: 900px) {
  .page { padding: .75rem 1rem; }
  .barre .ligne { padding: .5rem 1rem; }
  .recherche-bloc { flex: 1 1 100%; }
  /* Résumé sous la carte, en deux colonnes */
  .carte-corps { grid-template-columns: minmax(0, 1fr); }
  .resume { width: auto; height: auto; border-left: 0; border-top: 1px solid var(--bord); display: grid; grid-template-columns: 1fr 1fr; }
  .resume header { grid-column: 1 / -1; }
  .resume section { border-right: 1px solid var(--bord); }
  .barre .reglages .espace { display: none; }
  #carte { height: 340px; }
  .legende { min-width: 0; max-width: calc(100% - 20px); }
  .graphiques { grid-template-columns: minmax(0, 1fr); }
}

/* Onglets : Situation générale (cartes) et Point (évolutions, comparaison) */
.onglets { display: inline-flex; gap: .2rem; }
.onglets button {
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  padding: .35rem .7rem; font-weight: 600; color: var(--texte-2);
}
.onglets button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.onglets button:hover { color: var(--texte); }

/* Situation générale : la carte occupe la hauteur de l'écran */
.vue-situation #carte { height: max(480px, calc(100vh - 270px)); }

.titre-section { margin: .4rem 0 0; font-size: .95rem; text-transform: none; letter-spacing: 0; color: var(--texte); }
.titre-section small { font-weight: 400; margin-left: .3rem; }

/* Comparaison des modèles */
.comparaison { display: flex; flex-direction: column; gap: .6rem; }
.comparaison-entete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1rem; }
.modeles-legende { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .85rem; }
.modeles-legende i { display: inline-block; width: 12px; height: 3px; margin-right: .35rem; vertical-align: middle; border-radius: 2px; }
.petits-graphiques { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .75rem; }
.petits-graphiques figure { margin: 0; padding: .6rem .8rem; background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); }
.petits-graphiques figcaption { font-size: .8rem; font-weight: 600; margin-bottom: .2rem; }
.cadre.petit { height: 170px; }
.note-source { margin: 0; font-size: .78rem; color: var(--texte-2); }
.popup-point { text-align: center; min-width: 210px; }
.popup-point dt { white-space: nowrap; }
.popup-point .coordonnees { color: #5d6875; font-size: 11px; }
.popup-point dl { display: grid; grid-template-columns: auto auto; gap: .1rem .6rem; margin: .4rem 0 0; text-align: left; font-size: 12px; }
.popup-point dl:empty { display: none; }
.popup-point dt { color: #5d6875; }
.popup-point dt.heure-bulle { grid-column: 1 / -1; font-weight: 600; color: #1f5f9e; }
.popup-point dd { margin: 0; text-align: right; font-weight: 600; white-space: nowrap; }
.popup-point button { margin-top: .5rem; }

/* Unités dans les cellules du tableau */
td small { color: var(--texte-2); font-size: .72rem; }

/* Agrandissement des graphiques */
figcaption { display: flex; align-items: center; gap: .3rem; }
figcaption .agrandir {
  margin-left: auto; padding: 0 .4rem; border: 1px solid transparent; background: none;
  color: var(--texte-2); font-size: 1rem; line-height: 1.4;
}
figcaption .agrandir:hover { border-color: var(--bord); color: var(--accent); }
.agrandi {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 2rem; background: rgba(0, 0, 0, .45);
}
.agrandi-boite {
  width: min(1400px, 100%); height: min(820px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}
.agrandi-entete { display: flex; justify-content: space-between; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--bord); }
.agrandi-entete button { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--texte-2); }
.agrandi-cadre { position: relative; flex: 1; min-height: 0; padding: 1rem; }
@media (max-width: 900px) { .agrandi { padding: .5rem; } }

/* Titres des graphiques : nom, puis lieu et date */
figcaption .titres { display: flex; flex-direction: column; gap: .05rem; min-width: 0; }
figcaption .contexte, .agrandi-entete .contexte {
  display: block; font-size: .72rem; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--texte-2);
}
.titre-section span { font-weight: 600; }

.note-graphique { margin: .3rem 0 0; font-size: .72rem; color: var(--texte-2); }

/* TAF */
.taf-bloc { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.taf-bloc .reglage select { margin-left: .4rem; max-width: 26rem; }
.taf { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: .75rem; align-items: start; }
.taf .taf-masque { grid-column: 1 / -1; margin: 0; }
.taf .avertissement { grid-column: 1 / -1; margin: 0; padding: .4rem .7rem; border-radius: var(--rayon); background: var(--accent-doux); font-size: .85rem; }
.taf-brut, .taf-groupe { background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon); padding: .6rem .8rem; }
.taf-brut-entete { display: flex; flex-direction: column; gap: .1rem; margin-bottom: .5rem; font-size: .85rem; }
.taf-brut pre { margin: 0; font-size: .85rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.taf-groupes { display: flex; flex-direction: column; gap: .5rem; }
.taf-groupe.evolution { border-left: 3px solid var(--accent); }
.taf-groupe h3 { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin: 0; font-size: .85rem; }
.taf-groupe h3 code { font-weight: 400; color: var(--texte-2); }
.taf-groupe .discret { margin: .2rem 0 0; }
.taf-groupe dl { margin: .4rem 0 0; display: grid; grid-template-columns: max-content 1fr; gap: .2rem .8rem; font-size: .85rem; }
.taf-groupe dl:empty { display: none; }
.taf-groupe dl > div { display: contents; }
.taf-groupe dt code { font-weight: 600; }
.taf-groupe dd { margin: 0; }
code, pre { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
@media (max-width: 900px) { .taf { grid-template-columns: minmax(0, 1fr); } }

/* Écran de PC : marges de 15 % de chaque côté. Les fonds de l'en-tête restent sur toute la largeur,
   seul leur contenu est resserré, aligné sur la page. */
@media (min-width: 1200px) {
  .barre .ligne, .barre .erreur, .page, .pied { padding-left: 15%; padding-right: 15%; }
}

/* Onglet Point : sections affichées (boutons à bascule) */
.sections { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .85rem; }
.sections > span { color: var(--texte-2); margin-right: .3rem; }
.sections button { padding: .2rem .7rem; border-radius: 999px; font-size: .82rem; color: var(--texte-2); }
.sections button[aria-pressed="true"] { background: var(--accent-doux); border-color: var(--accent); color: var(--accent); }
.sections button[aria-pressed="false"] { text-decoration: line-through; opacity: .75; }

/* Onglet Point : carte un peu plus haute, à la hauteur du résumé */
@media (min-width: 901px) {
  .vue-point #carte { height: 580px; }
}

/* En-tête : menus Lieu et Réglages, en haut à droite */
.menu { position: relative; }
.menu-bouton { display: inline-flex; align-items: center; gap: .4rem; }
.menu-bouton svg { width: 16px; height: 16px; fill: var(--accent); flex: none; }
.menu-bouton .chevron { font-style: normal; font-size: .75rem; color: var(--texte-2); }
.menu-bouton[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-doux); }
.menu-lieu { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.menu-panneau {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 1100;
  width: min(27rem, calc(100vw - 2rem));
  display: flex; flex-direction: column; gap: .8rem; padding: .8rem;
  background: var(--surface); border: 1px solid var(--bord); border-radius: var(--rayon);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}
.menu-panneau .recherche-bloc { flex: none; }
.menu-panneau .lieu-actuel { flex-wrap: wrap; white-space: normal; }
.menu-panneau > small { margin: 0; }
.reglage-ligne { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: .25rem .6rem; font-size: .88rem; color: var(--texte-2); }
.reglage-ligne > .segments, .reglage-ligne > .champ { justify-self: start; }
.reglage-ligne small { grid-column: 2; font-size: .76rem; line-height: 1.35; }

/* En-tête, seconde ligne : bande des heures et animation */
.barre .ligne.temps { flex-wrap: nowrap; gap: .75rem; padding-top: .45rem; padding-bottom: .5rem; border-top: 1px solid var(--bord); background: var(--surface-2); }
.ligne.temps .heures { flex: 1; min-width: 0; }
.ligne.temps .heures-vide { flex: 1; margin: 0; }
.animation { display: inline-flex; align-items: center; gap: .4rem; flex: none; font-size: .85rem; }
.animation button { font-size: .85rem; padding: .3rem .7rem; white-space: nowrap; }
/* Bande des heures dans l'en-tête : valeurs sur une ligne ; elle défile si la place manque */
.ligne.temps .heures { grid-template-columns: repeat(var(--n, 12), minmax(46px, 1fr)); }
.heures button span, .heures button small { white-space: nowrap; }
/* Écran étroit : les menus s'ouvrent sur toute la largeur, sous la ligne de l'en-tête */
@media (max-width: 900px) {
  .barre .ligne { position: relative; }
  .menu { position: static; }
  .menu-panneau { left: .5rem; right: .5rem; width: auto; }
}

/* Journées : nom, puis niveau vol à voile au lieu choisi */
.segments.jours button.jour { flex-direction: column; align-items: center; gap: .15rem; padding: .25rem .6rem; min-width: 6.5rem; }
.jour-nom { font-weight: 600; }
.niveau { font-size: .7rem; line-height: 1.25; padding: .05rem .4rem; border-radius: 999px; white-space: nowrap; color: var(--texte-2); }
.niveau.n-aucun { font-style: italic; opacity: .8; }
.niveau.n-vz_faible, .niveau.n-plafond_faible { background: var(--surface-2); color: var(--texte-2); }
.niveau.n-moyenne { background: #f2e14c40; color: var(--texte); }
.niveau.n-bonne { background: #3a8a5c33; color: #2f7a4f; font-weight: 600; }
.niveau.n-exceptionnelle { background: #3a8a5c; color: #fff; font-weight: 600; }
.niveau.n-vent { background: #f7a03a40; color: var(--texte); }
.niveau.n-orage { background: #b8475e; color: #fff; font-weight: 600; }
:root[data-theme="dark"] .niveau.n-bonne { color: #7fd1a0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .niveau.n-bonne { color: #7fd1a0; } }

/* Bande des heures : l'heure seule */
.ligne.temps .heures { grid-template-columns: repeat(var(--n, 12), minmax(40px, 1fr)); }
.ligne.temps .heures button { background: var(--surface); padding: .35rem 0; }
.ligne.temps .heures button[aria-pressed="true"] { background: var(--accent-doux); color: var(--accent); }

/* Première ligne de l'en-tête plus serrée : elle tient sur une ligne en grand écran */
.barre .ligne:first-child { column-gap: .9rem; }
.menu-bouton svg { width: 18px; height: 18px; }
/* Libellés longs (« Journée exceptionnelle ») sur deux lignes plutôt qu'un en-tête qui déborde */
.segments.jours button.jour { min-width: 5.6rem; }
.niveau { white-space: normal; max-width: 6.2rem; text-align: center; }

/* Réglages : seuils du niveau de la journée (section repliable) */
.reglages-panneau { max-height: calc(100vh - 7rem); overflow-y: auto; }
.seuils { border-top: 1px solid var(--bord); border-bottom: 1px solid var(--bord); padding: .5rem 0; font-size: .88rem; }
.seuils summary { cursor: pointer; font-weight: 600; color: var(--texte); }
.seuils summary small { font-weight: 400; color: var(--accent); }
.seuils > p.discret { font-size: .78rem; margin: .4rem 0; }
.seuils fieldset { border: 0; margin: .5rem 0 0; padding: 0; }
.seuils legend { padding: 0; margin-bottom: .2rem; font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-2); }
.seuil-ligne { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .1rem 0; color: var(--texte-2); }
.seuil-ligne .champ input { width: 4.6rem; }
.seuil-ligne .champ em { min-width: 2.6rem; }
.seuils > button.lien { margin-top: .5rem; }
.seuils .erreur { margin: .4rem 0 0; font-size: .8rem; }

/* Onglet Manuel */
.manuel { max-width: 62rem; margin: 0 auto; padding: .5rem 0 2rem; line-height: 1.6; color: var(--texte); }
.manuel h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
.manuel h2 { font-size: 1.25rem; margin: 2rem 0 .7rem; padding-bottom: .3rem; border-bottom: 1px solid var(--bord); }
.manuel h3 { font-size: 1.05rem; margin: 1.5rem 0 .5rem; }
.manuel h1, .manuel h2, .manuel h3 { scroll-margin-top: 1rem; text-transform: none; letter-spacing: normal; color: var(--texte); font-weight: 650; }
.manuel p, .manuel ul, .manuel ol { margin: .5rem 0; }
.manuel li { margin: .2rem 0; }
.manuel a { color: var(--accent); }
.manuel code { font-size: .88em; padding: .05rem .3rem; border-radius: 4px; background: var(--surface-2); }
.manuel blockquote { margin: 1rem 0; padding: .6rem 1rem; border-left: 3px solid var(--accent); background: var(--surface); }
.manuel blockquote p { margin: 0; }
.manuel hr { border: 0; border-top: 1px solid var(--bord); margin: 2rem 0; }
.manuel table { border-collapse: collapse; width: 100%; margin: .6rem 0 1rem; font-size: .9rem; }
.manuel td:first-child { min-width: 9rem; }
.manuel th, .manuel td { border: 1px solid var(--bord); padding: .35rem .6rem; text-align: left; vertical-align: top; position: static; cursor: auto; background: none; white-space: normal; font-variant-numeric: normal; }
.manuel thead th { background: var(--surface); font-weight: 600; }

/* Journées passées : menu « Passé » et bouton de la journée passée choisie */
.passes-panneau { gap: .5rem; }
@media (min-width: 901px) { .passes-panneau { left: 0; right: auto; width: 19rem; max-height: calc(100vh - 7rem); overflow-y: auto; } }
.liste-passes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; }
.liste-passes button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: .6rem; text-align: left; }
.liste-passes button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-doux); }
.segments.jours button.jour.passe { border-style: dashed; }

/* Journées estimées (GFS, J+4 à J+7) : pas de vue détaillée, donc pas un bouton */
.segments.jours .jour.estimation {
  display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; padding: .25rem .6rem; min-width: 5.6rem;
  border: 0; border-radius: 0; border-left: 1px dashed var(--bord); cursor: help; color: var(--texte-2); background: transparent;
}
.segments.jours .jour.estimation .jour-nom { font-weight: 500; font-style: italic; }
.segments.jours .jour.estimation .niveau { opacity: .85; }

/* Émagramme (onglet Détaillé) */
.emagramme-bloc { margin: 0; padding: .8rem 1rem; }
.emagramme-bloc figcaption { font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--texte-2); font-weight: 600; margin-bottom: .4rem; }
.emagramme-bloc figcaption .espace { flex: 1; }
.emagramme-bloc figcaption button.lien { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: .82rem; }
.emagramme-corps { display: grid; grid-template-columns: minmax(0, 720px) minmax(220px, 1fr); gap: 1.2rem; align-items: start; }
.emagramme-cadre { position: relative; }
.emagramme-cadre svg { display: block; width: 100%; height: auto; user-select: none; }
.agrandi-cadre.emagramme-cadre { display: flex; justify-content: center; }
.agrandi-cadre.emagramme-cadre svg { width: auto; height: 100%; max-width: 100%; }
.emagramme-info {
  position: absolute; z-index: 5; pointer-events: none; padding: .35rem .55rem; border-radius: var(--rayon);
  background: var(--surface); border: 1px solid var(--bord); box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  font-size: .78rem; line-height: 1.45; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.emagramme-legende { font-size: .85rem; display: flex; flex-direction: column; gap: .8rem; }
.emagramme-chiffres { margin: 0; display: flex; flex-direction: column; gap: .35rem; }
.emagramme-chiffres div { display: flex; flex-direction: column; }
.emagramme-chiffres dt { font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--texte-2); }
.emagramme-chiffres dd { margin: 0; font-variant-numeric: tabular-nums; }
.emagramme-cles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .25rem; color: var(--texte-2); }
.emagramme-cles button {
  display: flex; align-items: center; width: 100%; padding: .2rem .4rem; border: 1px solid transparent; background: none;
  text-align: left; color: var(--texte-2); font-size: inherit;
}
.emagramme-cles button[aria-pressed="true"] { color: var(--texte); }
.emagramme-cles button[aria-pressed="false"] { opacity: .5; }
.emagramme-cles button[aria-pressed="false"] span { text-decoration: line-through; }
.emagramme-cles i { flex: none; display: inline-block; width: 22px; height: 0; margin-right: .5rem; vertical-align: middle; border-top: 2px solid; }
.emagramme-cles .cle-t { border-color: #d0342c; border-top-width: 2.5px; }
.emagramme-cles .cle-td { border-color: #2f7fd6; border-top-width: 2.5px; }
.emagramme-cles .cle-tw { border-color: #1f9e89; border-top-width: 2px; border-top-style: dashed; }
.emagramme-cles .cle-particule { border-color: var(--texte); border-top-style: dashed; }
.emagramme-cles .cle-seche { border-color: #c08a3e; border-top-width: 1px; }
.emagramme-cles .cle-humide { border-color: #3a8a5c; border-top-width: 1px; border-top-style: dashed; }
.emagramme-cles .cle-melange { border-color: #8a5cc0; border-top-width: 1px; border-top-style: dotted; }
.emagramme-cles .cle-nuage { height: 10px; border: 0; background: var(--texte-2); opacity: .6; }
.emagramme-cles .cle-reperes { border-color: #7b8794; border-top-width: 1.5px; border-top-style: dashed; }

/* Lignes masquées depuis la légende (classes posées sur le SVG) */
svg.masque-t :is(.ema-t, .ema-point-t),
svg.masque-td :is(.ema-td, .ema-point-td),
svg.masque-tw :is(.ema-tw, .ema-point-tw),
svg.masque-particule :is(.ema-particule, .ema-condensation),
svg.masque-reperes :is(.ema-base, .ema-sommet, .ema-plafond, .ema-base-texte, .ema-sommet-texte, .ema-plafond-texte),
svg.masque-nuage :is(.ema-nuage, .ema-colonne),
svg.masque-seche .ema-seche,
svg.masque-humide .ema-humide,
svg.masque-melange :is(.ema-melange, .ema-etiquette-melange) { display: none; }
@media (max-width: 900px) { .emagramme-corps { grid-template-columns: minmax(0, 1fr); } }

/* Éléments du diagramme (classes posées par emagramme.js) */
.ema-aire { fill: var(--surface); }
.ema-cadre { stroke: var(--texte-2); stroke-width: 1; }
.ema-isotherme { stroke: var(--bord); stroke-width: .8; }
.ema-zero { stroke: var(--texte-2); stroke-width: 1; stroke-dasharray: 4 3; }
.ema-isobare { stroke: var(--bord); stroke-width: .8; }
.ema-seche { fill: none; stroke: #c08a3e; stroke-width: .7; opacity: .45; }
.ema-humide { fill: none; stroke: #3a8a5c; stroke-width: .7; stroke-dasharray: 5 3; opacity: .5; }
.ema-melange { fill: none; stroke: #8a5cc0; stroke-width: .7; stroke-dasharray: 1.5 2.5; opacity: .6; }
.ema-etiquette-melange { font-size: 8px; fill: #8a5cc0; text-anchor: middle; opacity: .8; }
.ema-graduation { font-size: 10px; fill: var(--texte-2); font-variant-numeric: tabular-nums; }
.ema-sous-sol { fill: var(--texte-2); opacity: .18; }
.ema-sol { stroke: var(--texte); stroke-width: 2; }
.ema-t { fill: none; stroke: #d0342c; stroke-width: 2.5; stroke-linejoin: round; }
.ema-td { fill: none; stroke: #2f7fd6; stroke-width: 2.5; stroke-linejoin: round; }
.ema-tw { fill: none; stroke: #1f9e89; stroke-width: 1.8; stroke-linejoin: round; stroke-dasharray: 7 2 2 2; }
.ema-point-tw { fill: #1f9e89; stroke: var(--surface); stroke-width: 1.5; }
.ema-particule { fill: none; stroke: var(--texte); stroke-width: 1.6; stroke-dasharray: 6 4; }
.ema-condensation { fill: var(--surface); stroke: var(--texte); stroke-width: 1.5; }
.ema-base, .ema-sommet, .ema-plafond { stroke-width: 1.2; stroke-dasharray: 8 4; }
.ema-base { stroke: #7b8794; }
.ema-sommet { stroke: #7b8794; stroke-dasharray: 2 3; }
.ema-plafond { stroke: var(--accent); }
.ema-base-texte, .ema-sommet-texte, .ema-plafond-texte { font-size: 10.5px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.ema-base-texte, .ema-sommet-texte { fill: var(--texte-2); }
.ema-plafond-texte { fill: var(--accent); }
.ema-colonne { fill: none; stroke: var(--bord); }
.ema-nuage { fill: var(--texte-2); }
.ema-fleche { fill: none; stroke: var(--texte); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.ema-vent { font-size: 10px; fill: var(--texte); font-variant-numeric: tabular-nums; }
/* Vent fort (> 30 km/h) en orange, très fort (> 45 km/h) en rouge : valeur et flèche */
.ema-vent.ema-vent-fort { fill: #e07b1a; font-weight: 700; }
.ema-vent.ema-vent-tres-fort { fill: #d0342c; font-weight: 700; }
.ema-vent-fort .ema-fleche { stroke: #e07b1a; }
.ema-vent-tres-fort .ema-fleche { stroke: #d0342c; }

/* Convention horaire, à gauche de la bande des heures */
.convention-heure { flex: none; display: flex; flex-direction: column; line-height: 1.15; font-size: .75rem; color: var(--texte-2); cursor: help; }
.convention-heure strong { font-weight: 600; color: var(--texte); }
.ema-guide { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.ema-point-t { fill: #d0342c; stroke: var(--surface); stroke-width: 1.5; }
.ema-point-td { fill: #2f7fd6; stroke: var(--surface); stroke-width: 1.5; }

/* Note de la couche d'observation (satellite, radar), dans la légende de la carte */
.legende .note-observation { color: var(--texte); }

/* Onglet Observation */
.vue-observation { display: flex; flex-direction: column; gap: .6rem; }
.obs-outils, .obs-temps { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.obs-outils .case { display: inline-flex; align-items: center; gap: .3rem; }
.obs-outils .espace { flex: 1; }
.obs-temps input[type="range"] { flex: 1; min-width: 12rem; accent-color: var(--accent); }
.obs-heure { min-width: 11rem; font-variant-numeric: tabular-nums; }
.obs-carte-conteneur { position: relative; }
#carte-observation { height: calc(100vh - 15rem); min-height: 420px; border: 1px solid var(--bord); border-radius: var(--rayon); }
.obs-legende { position: absolute; left: 10px; bottom: 26px; z-index: 1000; }
.obs-aide { margin: 0; font-size: .8rem; }

/* METAR : historique des observations sous le décodage */
.metar-historique { grid-column: 1 / -1; overflow-x: auto; }
.metar-historique table { width: 100%; font-size: .85rem; }
.metar-historique th, .metar-historique td { text-align: left; white-space: nowrap; padding: .25rem .6rem; }
.metar-historique thead th { cursor: default; }
.metar-historique td.vent-fort { color: #e07b1a; font-weight: 600; }
.metar-historique td.vent-tres-fort { color: #d0342c; font-weight: 600; }

/* Planeurs en direct (OGN) */
.planeur-icone { position: relative; }
.planeur-icone svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 0 1px rgba(255, 255, 255, .9)); }
.planeur-vz {
  position: absolute; left: 22px; top: -2px; font-size: 11px; font-weight: 700; white-space: nowrap;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff; font-variant-numeric: tabular-nums;
}
