/* Les composants du site climat (plan site_climat, § Design, D19). La page `/design` les montre tous, dans
   les deux thèmes et les trois langues : c'est leur référence vivante. Aucune couleur en dur : tout lit
   jetons.css. Les cibles font 32 px au moins, le focus se voit (base.css). */

/* ── La mise en page ─────────────────────────────────────────────────────── */

.page { max-width: var(--largeur-page); margin: 0 auto; padding: var(--espace-5) var(--espace-5) var(--espace-8); }
.pile { display: flex; flex-direction: column; gap: var(--espace-4); }
.pile-large { display: flex; flex-direction: column; gap: var(--espace-6); }
.rangee { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-3); }
.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--espace-4); }
.col-3 { grid-column: span 3; } .col-4 { grid-column: span 4; } .col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; } .col-7 { grid-column: span 7; } .col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }
@media (max-width: 860px) {
    .col-3, .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: span 12; }
    .page { padding: var(--espace-4) var(--espace-4) var(--espace-7); }
}

.discret { color: var(--couleur-encre-2); }
.tenu { color: var(--couleur-encre-3); font-size: var(--taille-s); }
.etiquette {
    color: var(--couleur-encre-3); font-size: var(--taille-xs); font-weight: 600;
    letter-spacing: 0.06em; text-transform: uppercase;
}

/* ── La carte ─────────────────────────────────────────────────────────────── */

.carte {
    background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-radius: var(--rayon-3);
    box-shadow: var(--ombre-1); padding: var(--espace-4) var(--espace-5);
}
.carte-titre { display: flex; align-items: baseline; justify-content: space-between; gap: var(--espace-3); margin-bottom: var(--espace-3); }

/* ── L'en-tête ────────────────────────────────────────────────────────────── */

.entete {
    position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: var(--espace-4);
    height: var(--hauteur-entete); padding: 0 var(--espace-5);
    background: color-mix(in srgb, var(--couleur-surface) 88%, transparent); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--couleur-trait);
}
.entete-marque { display: flex; align-items: center; gap: var(--espace-2); color: var(--couleur-encre); font-weight: 650; letter-spacing: -0.01em; }
.entete-marque:hover { color: var(--couleur-encre); text-decoration: none; }
.entete-marque img { width: 28px; height: 28px; display: block; }
.entete-marque span { color: var(--couleur-encre-3); font-weight: 450; }
.entete-droite { margin-left: auto; display: flex; align-items: center; gap: var(--espace-2); }
.entete-recherche {
    display: flex; align-items: center; gap: var(--espace-2); flex: 0 1 340px; min-height: var(--cible-min); margin-left: var(--espace-3);
    padding: 0 var(--espace-3); background: var(--couleur-surface-2); border: 1px solid transparent;
    border-radius: var(--rayon-2); color: var(--couleur-encre-3); cursor: pointer; text-align: left;
    transition: border-color var(--duree-rapide) var(--courbe), background var(--duree-rapide) var(--courbe);
}
.entete-recherche:hover { border-color: var(--couleur-trait-fort); }
.entete-recherche span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: var(--taille-s); }
kbd {
    padding: 1px 5px; font-size: 0.6875rem; color: var(--couleur-encre-2); background: var(--couleur-surface);
    border: 1px solid var(--couleur-trait-fort); border-bottom-width: 2px; border-radius: var(--rayon-1);
}
.entete-menu { display: flex; align-items: center; gap: var(--espace-2); }
/* `.entete .…` et `.bouton.…` : ces règles précèdent celles de `.bouton`, et doivent les emporter. */
.entete .entete-bouton-menu { display: none; }
.bouton.bouton-lien { border-color: transparent; background: transparent; color: var(--couleur-encre-2); }
.bouton.bouton-lien:hover { background: var(--couleur-surface-2); color: var(--couleur-encre); text-decoration: none; }
.bouton.bouton-lien[aria-current="page"] { color: var(--couleur-action); }

/* D21. Sur un téléphone, la recherche se réduit à sa loupe (la palette, elle, prend toute la largeur) et le menu se
   replie derrière son bouton : il s'ouvre en panneau sous l'en-tête. */
@media (max-width: 860px) {
    .entete { padding: 0 var(--espace-3); gap: var(--espace-2); }
    .entete-recherche { flex: 0 0 var(--cible-min); width: var(--cible-min); margin-left: 0; padding: 0; justify-content: center; }
    .entete-recherche span, .entete-recherche kbd { display: none; }
    .entete .entete-bouton-menu { display: inline-flex; }
    .entete-menu {
        position: absolute; top: 100%; right: var(--espace-2); display: none; flex-direction: column; align-items: stretch;
        min-width: 220px; padding: var(--espace-2); background: var(--couleur-surface); border: 1px solid var(--couleur-trait);
        border-radius: var(--rayon-2); box-shadow: var(--ombre-3);
    }
    .entete-menu[data-ouvert="true"] { display: flex; }
    .entete-menu .bouton { justify-content: flex-start; width: 100%; }
    .entete-menu .segments { align-self: stretch; }
    .entete-menu .segments button { flex: 1; }
}
@media (max-width: 340px) { .entete-marque span { display: none; } }

/* ── Les boutons et les champs ────────────────────────────────────────────── */

.bouton {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--espace-2);
    min-height: var(--cible-min); padding: 0 var(--espace-3); border-radius: var(--rayon-2);
    border: 1px solid var(--couleur-trait-fort); background: var(--couleur-surface); color: var(--couleur-encre);
    font-size: var(--taille-s); font-weight: 550; cursor: pointer; white-space: nowrap;
    transition: background var(--duree-rapide) var(--courbe), border-color var(--duree-rapide) var(--courbe), color var(--duree-rapide) var(--courbe);
}
.bouton:hover:not(:disabled) { background: var(--couleur-surface-2); }
.bouton:disabled { opacity: 0.55; cursor: not-allowed; }
.bouton-action { border-color: var(--couleur-action); color: var(--couleur-action); }
.bouton-action:hover:not(:disabled) { background: var(--couleur-action-fond); }
.bouton-plein { background: var(--couleur-action); border-color: var(--couleur-action); color: var(--couleur-sur-action); }
.bouton-plein:hover:not(:disabled) { background: var(--couleur-action-survol); border-color: var(--couleur-action-survol); }
.bouton-danger { border-color: var(--couleur-erreur); color: var(--couleur-erreur); }
.bouton-danger:hover:not(:disabled) { background: var(--couleur-erreur-fond); }
.bouton-icone { width: var(--cible-min); padding: 0; border-color: transparent; background: transparent; color: var(--couleur-encre-2); }
.bouton-icone:hover:not(:disabled) { color: var(--couleur-encre); }

.champ {
    width: 100%; height: var(--cible-min); padding: 0 var(--espace-3); background: var(--couleur-surface);
    border: 1px solid var(--couleur-bord-champ); border-radius: var(--rayon-2);
    transition: border-color var(--duree-rapide) var(--courbe), box-shadow var(--duree-rapide) var(--courbe);
}
.champ:focus { outline: none; border-color: var(--couleur-action); box-shadow: 0 0 0 3px var(--couleur-action-fond); }
.champ::placeholder { color: var(--couleur-encre-3); }
.libelle { display: block; margin-bottom: var(--espace-1); font-size: var(--taille-s); font-weight: 550; color: var(--couleur-encre-2); }

/* Un choix en segments : langue, thème, source de la température. */
.segments {
    display: inline-flex; align-self: flex-start; padding: 2px; gap: 2px; background: var(--couleur-surface-2); border-radius: var(--rayon-2);
}
.segments button {
    min-height: calc(var(--cible-min) - 4px); min-width: calc(var(--cible-min) - 4px); padding: 0 var(--espace-2); border: 0; border-radius: 6px; background: transparent;
    color: var(--couleur-encre-2); font-size: var(--taille-xs); font-weight: 600; cursor: pointer;
    transition: background var(--duree-rapide) var(--courbe), color var(--duree-rapide) var(--courbe);
}
.segments button:hover { color: var(--couleur-encre); }
.segments button[aria-pressed="true"] { background: var(--couleur-surface); color: var(--couleur-encre); box-shadow: var(--ombre-1); }

/* ── Les puces ────────────────────────────────────────────────────────────── */

.puce {
    display: inline-flex; align-items: center; gap: var(--espace-1); padding: 2px var(--espace-2); border-radius: var(--rayon-plein);
    background: var(--couleur-surface-2); color: var(--couleur-encre-2); font-size: var(--taille-xs); font-weight: 550; white-space: nowrap;
}
.puce-chaud { background: var(--couleur-chaud-fond); color: var(--couleur-chaud); }
.puce-froid { background: var(--couleur-froid-fond); color: var(--couleur-froid); }
.puce-attention { background: var(--couleur-attention-fond); color: var(--couleur-attention); }
.puce-erreur { background: var(--couleur-erreur-fond); color: var(--couleur-erreur); }
.puce-succes { background: var(--couleur-succes-fond); color: var(--couleur-succes); }

/* ── Les cartes de grandeur ───────────────────────────────────────────────── */

.grandeur {
    position: relative; display: flex; flex-direction: column; gap: var(--espace-1); min-width: 0;
    padding: var(--espace-3) var(--espace-4); background: var(--couleur-surface);
    border: 1px solid var(--couleur-trait); border-radius: var(--rayon-3); box-shadow: var(--ombre-1);
}
.grandeur-libelle { font-size: var(--taille-s); font-weight: 550; color: var(--couleur-encre-2); }
/* Une aide à la demande (Ui.aide) : un `popover` du navigateur, placé sous son bouton. Une vraie cible (§ Design), sans grandir la
   ligne qui la porte : le picto reste petit, ses marges négatives rendent la place. */
.aide-bouton { display: inline-flex; align-items: center; justify-content: center; min-width: var(--cible-min); min-height: var(--cible-min); margin-block: calc((20px - var(--cible-min)) / 2); margin-inline: calc((20px - var(--cible-min)) / 2); padding: 2px; vertical-align: -5px; border: 0; border-radius: 50%; background: none; color: var(--couleur-encre-3); cursor: pointer; }
.aide-bouton:hover { color: var(--couleur-action); }
.aide-bouton svg { width: 16px; height: 16px; }
.aide-bulle { position: absolute; inset: auto; margin: 0; padding: var(--espace-3) var(--espace-4); background: var(--couleur-surface); color: var(--couleur-encre); border: 1px solid var(--couleur-trait-fort); border-radius: var(--rayon-2); box-shadow: var(--ombre-3); font-size: var(--taille-s); font-weight: 400; line-height: 1.5; }
.aide-bulle p { margin: 0 0 var(--espace-2); }
.aide-bulle p:last-child { margin-bottom: 0; }
.grandeur-valeur {
    display: flex; align-items: baseline; gap: 0.3em; font-family: var(--police-chiffres); font-variant-numeric: tabular-nums;
    font-size: var(--taille-xl); font-weight: 500; letter-spacing: -0.02em; line-height: 1.15;
}
.grandeur-unite { font-family: var(--police-texte); font-size: 0.5em; font-weight: 500; letter-spacing: 0; color: var(--couleur-encre-3); }
.grandeur-note { font-size: var(--taille-xs); color: var(--couleur-encre-3); }
.grandeur-chaud .grandeur-valeur { color: var(--couleur-chaud); }
.grandeur-froid .grandeur-valeur { color: var(--couleur-froid); }

.grandeur-heros { padding: var(--espace-4) var(--espace-5) var(--espace-4); overflow: hidden; }
.grandeur-heros::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; }
.grandeur-heros.grandeur-chaud::before { background: var(--couleur-chaud-vif); }
.grandeur-heros.grandeur-froid::before { background: var(--couleur-froid-vif); }
.grandeur-heros .grandeur-valeur { font-size: var(--taille-heros); margin: var(--espace-1) 0; }
.grandeur-heros .grandeur-unite { font-size: 0.42em; }

.grille-grandeurs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--espace-3); }
.grille-heros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--espace-3); }
@media (max-width: 640px) { .grille-grandeurs, .grille-heros { grid-template-columns: minmax(0, 1fr); } }

/* ── L'identité d'un point ────────────────────────────────────────────────── */

.identite { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--espace-1) var(--espace-3); }
.identite-code { font-family: var(--police-chiffres); font-size: var(--taille-2xl); font-weight: 600; letter-spacing: -0.02em; }
.identite-nom { font-size: var(--taille-l); font-weight: 500; color: var(--couleur-encre-2); }
.identite-faits { display: flex; flex-wrap: wrap; gap: var(--espace-1) var(--espace-4); font-size: var(--taille-s); color: var(--couleur-encre-3); }
/* Une vraie cible, la bascule d'unité : même façon que `.aide-bouton`. Le pointillé vit sur le texte, plus sur le bord de la cible. */
.bascule-unite {
    display: inline-flex; align-items: center; justify-content: center; min-width: var(--cible-min); min-height: var(--cible-min);
    margin-block: calc((1.5em - var(--cible-min)) / 2); margin-inline: calc((1.5em - var(--cible-min)) / 2); padding: 0; vertical-align: middle;
    border: 0; background: none; color: var(--couleur-action); font: inherit; font-weight: 600; cursor: pointer;
    text-decoration: underline dotted; text-underline-offset: 3px;
}

/* Des faits en lignes : la page du compte. */
.lignes-faits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 2px var(--espace-5); font-size: var(--taille-s); color: var(--couleur-encre-2); }

/* ── Les réglages de la fiche : la plage, la source, la station (D22) ─────── */

.fiche-reglages { display: flex; flex-direction: column; gap: var(--espace-2); }
.reglages-choix { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-2) var(--espace-5); margin-top: var(--espace-2); padding-top: var(--espace-3); border-top: 1px solid var(--couleur-trait); }
.reglage { display: flex; flex-wrap: wrap; align-items: center; gap: var(--espace-1) var(--espace-2); min-width: 0; }
.reglage-station { flex: 1 1 340px; flex-wrap: nowrap; gap: var(--espace-1) var(--espace-3); max-width: 760px; }
.reglage-champ { display: flex; flex: 1 1 auto; align-items: center; gap: var(--espace-1) var(--espace-2); min-width: 0; }
.reglage-champ > .tenu, .reglage-service { white-space: nowrap; }
/* Sur un téléphone, le libellé au-dessus : la ligne de la station a besoin de toute la largeur. */
@media (max-width: 640px) {
    .reglage-station, .reglage-champ { flex-direction: column; align-items: stretch; }
    .reglage-station { flex-basis: 100%; }
}

/* Une liste déroulante sobre : le <select> du système, sans son chevron, le nôtre étant tracé aux jetons pour suivre le
   thème. Son texte se coupe plutôt que de déborder : la ligne entière reste au survol (`title`) et à l'ouverture. */
.liste-deroulante { position: relative; display: block; flex: 1 1 auto; min-width: 0; }
.liste-deroulante::after {
    content: ""; position: absolute; top: 50%; right: var(--espace-3); width: 6px; height: 6px; margin-top: -5px; pointer-events: none;
    border: solid var(--couleur-encre-3); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg);
}
.champ-liste { appearance: none; padding: 0 var(--espace-6) 0 var(--espace-2); font-size: var(--taille-s); text-overflow: ellipsis; cursor: pointer; }
.champ-liste:disabled { color: var(--couleur-encre-3); cursor: default; }

/* ── Le curseur de plage ──────────────────────────────────────────────────── */

.curseur-plage { user-select: none; }
.curseur-piste { position: relative; height: var(--poignee); margin: 0 calc(var(--poignee) / 2); touch-action: none; }
.curseur-annees { position: absolute; inset: 0; display: flex; gap: 2px; }
.curseur-annee { flex: 1 1 0; min-width: 0; border-radius: 3px; background: var(--couleur-surface-2); transition: background var(--duree-rapide) var(--courbe), opacity var(--duree-rapide) var(--courbe); }
.curseur-annee[data-etat="retenue"] { background: var(--couleur-action); opacity: 0.85; }
/* Écartée : hachurée. Le motif reste lisible sans la couleur. */
.curseur-annee[data-etat="ecartee"] {
    background: repeating-linear-gradient(135deg, var(--couleur-attention) 0 3px, transparent 3px 6px);
    outline: 1px solid var(--couleur-attention); outline-offset: -1px;
}
.curseur-annee[data-etat="hors"] { opacity: 0.55; }
.curseur-poignee {
    position: absolute; top: 50%; width: var(--poignee); height: var(--poignee); margin: calc(var(--poignee) / -2) 0 0 calc(var(--poignee) / -2); padding: 0; border-radius: 50%;
    background: var(--couleur-surface); border: 2px solid var(--couleur-action); box-shadow: var(--ombre-2); cursor: grab; touch-action: none;
    transition: transform var(--duree-rapide) var(--courbe);
}
/* La poignée se voit à sa taille, et se saisit plus large : le pseudo-élément appartient au bouton, il reçoit le pointeur. */
.curseur-poignee::after { content: ""; position: absolute; inset: calc((var(--poignee) - var(--cible-min)) / 2 - 2px); border-radius: 50%; }
.curseur-poignee:hover { transform: scale(1.1); }
.curseur-poignee:active { cursor: grabbing; }
.curseur-ecartees { margin-top: var(--espace-2); }
.curseur-reperes { display: flex; justify-content: space-between; margin: var(--espace-1) calc(var(--poignee) / 2) 0; font-family: var(--police-chiffres); font-size: var(--taille-xs); color: var(--couleur-encre-3); }
.curseur-valeurs { display: flex; align-items: baseline; justify-content: space-between; gap: var(--espace-3); margin-bottom: var(--espace-2); }
.curseur-valeurs strong { font-family: var(--police-chiffres); font-weight: 600; font-size: var(--taille-l); }

.graphique { position: relative; height: 260px; }
.graphique-profil { height: 280px; }
@media (max-width: 640px) { .graphique, .graphique-profil { height: 220px; } }

/* Une fiche qui se recharge : ses chiffres restent, atténués, jusqu'aux suivants. Pas de saut. */
[aria-busy="true"] .fiche { opacity: 0.55; transition: opacity var(--duree) var(--courbe); }

/* Une carte s'étend moins sur un téléphone (D21). */
@media (max-width: 860px) { .carte { padding: var(--espace-3) var(--espace-4); } }

/* ── La carte géographique ────────────────────────────────────────────────── */

.geo { position: relative; height: 340px; border-radius: var(--rayon-2); overflow: hidden; border: 1px solid var(--couleur-trait); background: var(--couleur-surface-2); isolation: isolate; }
/* Sur la fiche, elle a toute la largeur sous les graphiques : plus de liste à épouser. */
.geo-fiche { height: min(56vh, 460px); min-height: 280px; }
@media (max-width: 860px) { .geo { height: 280px; } }
.geo .leaflet-tile-pane { filter: var(--filtre-tuiles); }
.geo .leaflet-container, .geo.leaflet-container { font-family: var(--police-texte); background: var(--couleur-surface-2); }
.geo .leaflet-control-attribution { background: color-mix(in srgb, var(--couleur-surface) 82%, transparent); color: var(--couleur-encre-3); font-size: 0.6875rem; }
.geo .leaflet-control-attribution a { color: var(--couleur-encre-2); }
.geo .leaflet-bar a { background: var(--couleur-surface); color: var(--couleur-encre); border-bottom-color: var(--couleur-trait); }
.geo .leaflet-bar a:hover { background: var(--couleur-surface-2); }
.marque-station { width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid var(--couleur-action); background: var(--couleur-surface); box-shadow: var(--ombre-1); transition: transform var(--duree-rapide) var(--courbe); }
.marque-station[data-choisie="true"] { background: var(--couleur-action); box-shadow: 0 0 0 3px var(--couleur-action-fond); }
.marque-arp { width: 22px; height: 22px; margin: -11px 0 0 -11px; color: var(--couleur-encre); filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.marque-point { width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 2px; transform: rotate(45deg); background: var(--couleur-encre); border: 2px solid var(--couleur-surface); box-shadow: var(--ombre-1); }
.geo-anneau-etiquette { font-family: var(--police-chiffres); font-size: 0.6875rem; color: var(--couleur-encre-2); white-space: nowrap; }
.geo-anneau { stroke: var(--couleur-encre-3); stroke-width: 1; stroke-dasharray: 2 5; fill: none; }
.geo-trait { stroke: var(--couleur-action); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }

/* ── La palette de recherche ──────────────────────────────────────────────── */

.voile { position: fixed; inset: 0; z-index: 1000; background: var(--couleur-voile); animation: apparition var(--duree) var(--courbe); }
.palette {
    position: fixed; z-index: 1001; top: 12vh; left: 50%; width: min(620px, calc(100vw - 2 * var(--espace-4))); transform: translateX(-50%);
    background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-radius: var(--rayon-3); box-shadow: var(--ombre-3); overflow: hidden;
    animation: glissement var(--duree) var(--courbe);
}
.palette-saisie { width: 100%; padding: var(--espace-4); border: 0; border-bottom: 1px solid var(--couleur-trait); background: transparent; font-size: var(--taille-l); outline: none; }
.palette-resultats { max-height: min(50vh, 420px); overflow-y: auto; padding: var(--espace-2); }
.palette-resultat { display: flex; align-items: center; gap: var(--espace-3); width: 100%; min-height: max(40px, var(--cible-min)); padding: var(--espace-2) var(--espace-3); border: 0; border-radius: var(--rayon-2); background: transparent; text-align: left; cursor: pointer; }
.palette-resultat[aria-selected="true"], .palette-resultat:hover { background: var(--couleur-action-fond); }
.palette-resultat code { font-weight: 600; min-width: 4ch; }
.palette-resultat span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.palette-pied { display: flex; flex-wrap: wrap; gap: var(--espace-3); padding: var(--espace-2) var(--espace-4); border-top: 1px solid var(--couleur-trait); font-size: var(--taille-xs); color: var(--couleur-encre-3); }
@keyframes apparition { from { opacity: 0; } }
@keyframes glissement { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ── Les bulles de conversation ───────────────────────────────────────────── */

.conversation { display: flex; flex-direction: column; gap: var(--espace-4); max-width: var(--largeur-lecture); margin: 0 auto; }
.bulle { padding: var(--espace-3) var(--espace-4); border-radius: var(--rayon-3); max-width: 90%; overflow-wrap: anywhere; }
.bulle p + p { margin-top: var(--espace-2); }
.bulle-question { align-self: flex-end; background: var(--couleur-action-fond); border-bottom-right-radius: var(--rayon-1); }
.bulle-reponse { align-self: flex-start; background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-bottom-left-radius: var(--rayon-1); box-shadow: var(--ombre-1); }
.bulle-outils { display: flex; flex-wrap: wrap; gap: var(--espace-1); margin-bottom: var(--espace-2); }

/* Le Markdown d'une réponse : sobre, et une table qui défile dans sa bulle plutôt que de la déborder. */
.bulle-texte > :first-child { margin-top: 0; }
.bulle-texte > :last-child { margin-bottom: 0; }
.bulle-texte p, .bulle-texte ul, .bulle-texte ol, .bulle-texte table { margin: 0 0 var(--espace-2); }
.bulle-texte ul { list-style: disc; padding-left: var(--espace-5); }
.bulle-texte ol { list-style: decimal; padding-left: var(--espace-5); }
.bulle-texte table { display: block; overflow-x: auto; border-collapse: collapse; font-size: var(--taille-s); }
.bulle-texte th, .bulle-texte td { padding: 2px var(--espace-2); border-bottom: 1px solid var(--couleur-trait); text-align: left; white-space: nowrap; }
.bulle-texte code { font-size: 0.92em; }
.bulle-outils .puce { text-decoration: none; }
/* Une puce qui mène quelque part est une cible : les récents de l'accueil, les outils d'une réponse. */
a.puce { min-height: var(--cible-min); padding-inline: var(--espace-3); }
a.puce:hover { background: var(--couleur-action-fond); color: var(--couleur-action); text-decoration: none; }

/* La page de l'assistant : la liste à gauche, la conversation et sa saisie à droite ; sur un téléphone, l'une sur l'autre. */
.assistant { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--espace-5); align-items: start; }
.assistant-liste { position: sticky; top: calc(var(--hauteur-entete) + var(--espace-4)); display: flex; flex-direction: column; gap: var(--espace-1); max-height: calc(100vh - var(--hauteur-entete) - 2 * var(--espace-4)); overflow-y: auto; }
/* Inerte le temps d'une réponse : on n'en change pas de conversation (pages-assistant.js). */
.assistant-liste[inert] { opacity: 0.6; }
.assistant-entree { display: flex; align-items: center; gap: var(--espace-1); border-radius: var(--rayon-2); }
.assistant-entree[aria-current="true"] { background: var(--couleur-action-fond); }
.assistant-titre { flex: 1; min-width: 0; min-height: var(--cible-min); padding: 0 var(--espace-2); background: none; border: 0; border-radius: var(--rayon-2); text-align: left; font-size: var(--taille-s); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.assistant-titre:hover { background: var(--couleur-surface-2); }
.assistant-entree .bouton { border-color: transparent; background: transparent; padding: 0 var(--espace-2); }
/* Sa hauteur : l'écran, moins l'en-tête et les marges de `.page`, pour que la saisie reste en bas sans faire défiler. */
.assistant-principal { display: flex; flex-direction: column; gap: var(--espace-4); min-width: 0; min-height: calc(100vh - var(--hauteur-entete) - var(--espace-5) - var(--espace-8)); }
.assistant-principal .conversation { flex: 1; width: 100%; }
.assistant-accueil { display: flex; flex-direction: column; gap: var(--espace-3); padding-block: var(--espace-6); }
.assistant-accueil .bouton { white-space: normal; text-align: left; height: auto; padding-block: var(--espace-2); }
.composeur { position: sticky; bottom: var(--espace-3); display: flex; align-items: flex-end; gap: var(--espace-2); width: 100%; max-width: var(--largeur-lecture); margin: 0 auto; padding: var(--espace-2); background: var(--couleur-surface); border: 1px solid var(--couleur-bord-champ); border-radius: var(--rayon-3); box-shadow: var(--ombre-2); }
.composeur-saisie { flex: 1; height: auto; min-height: var(--cible-min); padding-block: 8px; border: 0; resize: none; background: transparent; }
.composeur-saisie:focus { box-shadow: none; }
@media (max-width: 860px) {
    .assistant { grid-template-columns: minmax(0, 1fr); gap: var(--espace-3); }
    .assistant-liste { position: static; max-height: 140px; padding: var(--espace-2); background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-radius: var(--rayon-2); }
    .assistant-principal { min-height: 0; }
}

/* ── Les tables ───────────────────────────────────────────────────────────── */

.table-cadre { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--taille-s); }
.table th { padding: var(--espace-2) var(--espace-3); text-align: left; color: var(--couleur-encre-3); font-size: var(--taille-xs); font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; border-bottom: 1px solid var(--couleur-trait-fort); white-space: nowrap; }
.table td { padding: var(--espace-2) var(--espace-3); border-bottom: 1px solid var(--couleur-trait); }
.table tbody tr:hover { background: var(--couleur-surface-2); }
.table .nombre { text-align: right; font-family: var(--police-chiffres); font-variant-numeric: tabular-nums; }

.exemple { margin: 0; padding: var(--espace-2) var(--espace-3); overflow-x: auto; background: var(--couleur-surface-2); border-radius: var(--rayon-2); font-family: var(--police-chiffres); font-size: var(--taille-xs); }
/* Dans une table, un champ et un geste restent à leur taille. */
.table .champ { width: auto; min-width: 130px; padding-block: 2px; }

/* Une clé d'API montrée une fois. */
.cadre-copie { display: flex; align-items: center; gap: var(--espace-2); padding: var(--espace-2) var(--espace-3); background: var(--couleur-surface-2); border: 1px dashed var(--couleur-trait-fort); border-radius: var(--rayon-2); }
.cadre-copie code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: var(--taille-s); }

/* ── Les messages ─────────────────────────────────────────────────────────── */

.toasts { position: fixed; z-index: 1100; right: var(--espace-4); bottom: var(--espace-4); display: flex; flex-direction: column; gap: var(--espace-2); max-width: min(380px, calc(100vw - 2 * var(--espace-4))); }
.toast { display: flex; gap: var(--espace-2); padding: var(--espace-3) var(--espace-4); background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-left: 3px solid var(--couleur-action); border-radius: var(--rayon-2); box-shadow: var(--ombre-3); font-size: var(--taille-s); animation: apparition var(--duree) var(--courbe); }
.toast-erreur { border-left-color: var(--couleur-erreur); }
.toast-succes { border-left-color: var(--couleur-succes); }

/* Un état dessiné : chargement, vide, erreur, hors MNT, relais injoignable… (§ Design, La finition). */
.etat { display: flex; flex-direction: column; align-items: center; gap: var(--espace-2); padding: var(--espace-6) var(--espace-5); text-align: center; color: var(--couleur-encre-2); }
.etat-picto { width: 40px; height: 40px; color: var(--couleur-encre-3); }
.etat-titre { font-weight: 620; color: var(--couleur-encre); }
.etat-texte { max-width: 52ch; font-size: var(--taille-s); }
.etat-attention .etat-picto { color: var(--couleur-attention); }
.etat-erreur .etat-picto { color: var(--couleur-erreur); }

.bandeau { display: flex; align-items: flex-start; gap: var(--espace-2); padding: var(--espace-2) var(--espace-3); border-radius: var(--rayon-2); font-size: var(--taille-s); }
.bandeau-attention { background: var(--couleur-attention-fond); color: var(--couleur-attention); }
.bandeau-erreur { background: var(--couleur-erreur-fond); color: var(--couleur-erreur); }

/* Les squelettes occupent la place exacte de ce qui vient : aucun saut au chargement des chiffres. */
.squelette {
    display: block; border-radius: var(--rayon-1); color: transparent !important; user-select: none;
    background: linear-gradient(90deg, var(--couleur-squelette) 25%, var(--couleur-squelette-reflet) 50%, var(--couleur-squelette) 75%);
    background-size: 200% 100%; animation: reflet 1.4s linear infinite;
}
@keyframes reflet { to { background-position: -200% 0; } }

/* ── L'accueil ────────────────────────────────────────────────────────────── */

.accueil-tete { display: flex; flex-direction: column; align-items: flex-start; gap: var(--espace-3); padding-block: var(--espace-5) var(--espace-3); max-width: var(--largeur-lecture); }
.accueil-titre { font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.12; }
.accueil-recherche {
    display: flex; align-items: center; gap: var(--espace-3); width: min(560px, 100%); min-height: 48px; padding: 0 var(--espace-4); background: var(--couleur-surface);
    border: 1px solid var(--couleur-trait-fort); border-radius: var(--rayon-3); box-shadow: var(--ombre-1); color: var(--couleur-encre-3); cursor: pointer; text-align: left;
    transition: border-color var(--duree-rapide) var(--courbe), box-shadow var(--duree-rapide) var(--courbe);
}
.accueil-recherche:hover { border-color: var(--couleur-action); box-shadow: var(--ombre-2); }
.accueil-recherche span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.geo-accueil { height: min(62vh, 560px); min-height: 320px; }
.marque-aerodrome { fill: var(--couleur-action); fill-opacity: 0.55; stroke: var(--couleur-surface); stroke-width: 1; }
.marque-aerodrome:hover { fill-opacity: 1; }
.leaflet-tooltip.bulle-carte { background: var(--couleur-encre); color: var(--couleur-surface); border: 0; border-radius: var(--rayon-1); box-shadow: var(--ombre-2); font-family: var(--police-texte); font-size: var(--taille-xs); padding: 2px 8px; }
.leaflet-tooltip.bulle-carte::before { display: none; }
.chiffres-cles { display: flex; flex-wrap: wrap; gap: var(--espace-1) var(--espace-5); font-size: var(--taille-s); color: var(--couleur-encre-3); }
.chiffres-cles strong { color: var(--couleur-encre); font-family: var(--police-chiffres); font-weight: 600; }

/* La carte d'un point libre : d'abord. */
.geo-point { height: min(52vh, 480px); min-height: 280px; cursor: crosshair; }
.geo-point .leaflet-grab { cursor: crosshair; }

/* ── La page de connexion ─────────────────────────────────────────────────── */

.connexion { position: relative; display: grid; place-items: center; min-height: 100vh; padding: var(--espace-4); overflow: hidden; }
.connexion-isothermes { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--couleur-trait); pointer-events: none; }
.connexion-isothermes path { fill: none; stroke: currentColor; stroke-width: 1; animation: derive 90s ease-in-out infinite alternate; }
.connexion-isothermes path:nth-child(2n) { animation-duration: 120s; animation-direction: alternate-reverse; }
@keyframes derive { to { transform: translate(-3%, 2%); } }
.connexion-boite { position: relative; width: min(380px, 100%); padding: var(--espace-6); background: var(--couleur-surface); border: 1px solid var(--couleur-trait); border-radius: var(--rayon-3); box-shadow: var(--ombre-3); }
.connexion-boite img { width: 48px; height: 48px; display: block; margin-bottom: var(--espace-3); }
.connexion-reglages { position: absolute; top: var(--espace-3); right: var(--espace-3); display: flex; align-items: center; gap: var(--espace-2); }
@media (max-width: 480px) { .connexion-boite { padding: var(--espace-5); } }

/* ── La page /design ──────────────────────────────────────────────────────── */

.nuancier { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--espace-3); }
.nuance { border: 1px solid var(--couleur-trait); border-radius: var(--rayon-2); overflow: hidden; background: var(--couleur-surface); font-size: var(--taille-xs); }
.nuance-pave { height: 44px; border-bottom: 1px solid var(--couleur-trait); }
.nuance-nom { padding: var(--espace-1) var(--espace-2) 0; font-family: var(--police-chiffres); overflow-wrap: anywhere; }
.nuance-valeur { padding: 0 var(--espace-2) var(--espace-1); color: var(--couleur-encre-3); font-family: var(--police-chiffres); }
.echantillon-espace { display: flex; align-items: flex-end; gap: var(--espace-3); flex-wrap: wrap; }
.echantillon-espace i { display: block; background: var(--couleur-action); opacity: 0.8; border-radius: 2px; }
.echantillon-rayon { width: 56px; height: 40px; background: var(--couleur-surface-2); border: 1px solid var(--couleur-trait-fort); }
.echantillon-ombre { width: 96px; height: 56px; background: var(--couleur-surface); border-radius: var(--rayon-2); }
