/* PYRONOS — VUE FRANCE
   Feuille PROPRE a la page nationale. style.css est charge avant elle et
   fournit les variables de theme, les boutons et les toasts : on n'introduit
   AUCUNE couleur nouvelle hors des trois teintes d'etat, qui existent deja
   ailleurs dans le produit (vert de validation, ambre du non-revu
   style.css:1451, gris du perime). */

#carte-fr {
  position: fixed;
  inset: 0;
  background: var(--fond);
}

/* ══════════════════════════════════════════════════════════════════
   COLONNE DE BANDEAUX — EN HAUT A GAUCHE.
   Lecon de mise en page deja payee sur le banc de mesure : place en bas a
   droite, l'avertissement « non couvert » passait SOUS la legende. Un
   avertissement occultable ne vaut rien. z-index 30 : rien ne passe dessus.
   ══════════════════════════════════════════════════════════════════ */
#colonne-bandeaux {
  position: fixed;
  top: calc(10px + var(--marge-haute, env(safe-area-inset-top, 0px)));
  left: calc(10px + var(--marge-gauche, env(safe-area-inset-left, 0px)));
  z-index: 30;
  width: min(46vw, 560px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;   /* la carte reste manipulable autour des bandeaux */
}
#colonne-bandeaux > * { pointer-events: auto; }

#bandeau-echelle {
  background: var(--panneau);
  border: 1px solid var(--bord);
  border-left: 4px solid var(--accent);
  border-radius: var(--rayon);
  padding: 8px 12px;
}
.bandeau-titre { font-weight: 700; font-size: 14px; }
.bandeau-corps { color: var(--texte-2); font-size: 12px; margin-top: 3px; }

/* ROUGE, non occultable. */
#bandeau-couverture {
  background: rgba(84, 14, 16, 0.96);
  border: 1px solid var(--rouge);
  border-left: 4px solid var(--rouge);
  border-radius: var(--rayon);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #ffd9da;
}

#bandeau-echec {
  background: rgba(84, 14, 16, 0.96);
  border: 1px solid var(--rouge);
  border-radius: var(--rayon);
  padding: 8px 12px;
  font-size: 13px;
  color: #ffd9da;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

/* ══════════════════════════════════════════════════════════════════
   PANNEAU DE COUVERTURE
   ══════════════════════════════════════════════════════════════════ */
#panneau-fr {
  position: fixed;
  top: calc(10px + var(--marge-haute, env(safe-area-inset-top, 0px)));
  right: calc(10px + var(--marge-droite, env(safe-area-inset-right, 0px)));
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  width: min(38vw, 430px);
  background: var(--panneau);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#panneau-fr.replie { width: auto; bottom: auto; }
#panneau-fr.replie #panneau-corps { display: none; }

#panneau-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--bord);
  flex: 0 0 auto;
}
#panneau-fr.replie #panneau-tete { border-bottom: none; }
#btn-replier {
  min-width: 44px; min-height: 44px;   /* cible tactile : regle du depot */
  background: var(--bloc);
  color: var(--texte);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  font-size: 16px;
  cursor: pointer;
}

#panneau-corps {
  overflow-y: auto;
  padding: 10px 12px 16px;
}
#panneau-corps h1 { font-size: 17px; margin: 2px 0 6px; }
#panneau-corps h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texte-2);
  margin: 16px 0 6px;
  border-top: 1px solid var(--bord);
  padding-top: 10px;
}
#panneau-corps .indice { color: var(--texte-2); font-size: 12px; margin: 4px 0; }
.mentions { font-size: 11px; }

/* `.bouton-lien` est defini dans style.css (bloc « Autres zones ») en BLOC
   centre, taille pour le panneau lateral d'index.html. Ici les memes liens
   vivent dans un panneau etroit et dans des bulles : on repasse en ligne, sans
   toucher a la definition d'origine. */
.bouton-lien {
  display: inline-block;
  margin: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  min-height: 40px;
  line-height: 22px;
  text-align: left;
}
.retour { font-weight: 700; }

/* ---- Tableau de couverture : par zone ET par couche ---- */
.tc-repli { font-size: 13px; font-weight: 600; margin: 4px 0; }
.tc-vide {
  font-size: 13px;
  font-weight: 600;
  color: #ffd9da;
  background: rgba(84, 14, 16, 0.85);
  border: 1px solid var(--rouge);
  border-radius: var(--rayon);
  padding: 8px 10px;
}

.tc-zone {
  border: 1px solid var(--bord);
  border-left-width: 4px;
  border-radius: var(--rayon);
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(32, 36, 44, 0.6);
}
/* La teinte DOUBLE le signe et le mot ; elle ne les remplace jamais. */
.tc-zone.et-ok { border-left-color: #22c55e; }
.tc-zone.et-part { border-left-color: #fbbf24; }
.tc-zone.et-ko { border-left-color: var(--rouge); }

.tc-tete { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.tc-nom { font-weight: 700; font-size: 14px; }
.tc-mot { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.et-ok .tc-mot { color: #22c55e; }
.et-part .tc-mot { color: #fbbf24; }
.et-ko .tc-mot { color: var(--rouge); }

.tc-libelle { font-size: 11.5px; color: var(--texte-2); margin-top: 3px; }
.tc-detection { font-size: 12px; margin-top: 4px; font-weight: 600; }

.tc-couches { list-style: none; margin: 6px 0 0; padding: 0; }
.tc-couches li {
  display: flex;
  align-items: baseline;
  /* `wrap` est OBLIGATOIRE depuis que la RAISON de l'etat d'une couche est
     affichee en clair sous son libelle : sans lui, la phrase serveur devient un
     enieme element de la meme rangee flex et se comprime jusqu'a l'illisible.
     Regle du depot : aucune troncature de libelle. */
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  padding: 1px 0;
  color: var(--texte-2);
}
/* La note occupe TOUTE la largeur sous la ligne de la couche. */
.tc-couches li > .tc-note-couche { flex: 0 0 100%; }
.tc-couches li em {
  font-style: normal;
  font-weight: 700;
  font-size: 10.5px;
  letter-spacing: 0.03em;
}
.tc-couches li.sg-ok { color: var(--texte); }
.tc-couches li.sg-ko em { color: var(--rouge); }
.tc-couches li.sg-na em { color: var(--texte-2); }
/* SERVIE VIDE : ni verte (« tout va bien ») ni rouge (« panne »). C'est un
   troisieme etat reel — le serveur a repondu, la couche n'a aucun element —
   et il doit se lire comme tel. Ambre, avec son propre signe « ◍ ». */
.tc-couches li.sg-vide { color: var(--texte); }
.tc-couches li.sg-vide > .sg { color: #fbbf24; }
.tc-couches li.sg-vide em { color: #fbbf24; }
.tc-zoom { border-top: 1px dashed var(--bord); margin-top: 6px; padding-top: 5px; }

/* LA PHRASE DU SERVEUR, EN CLAIR ET NON AU SURVOL. Sur telephone il n'y a pas
   de survol, et c'est l'appareil du terrain : une raison accessible seulement
   a la souris n'existe pas pour l'operateur en intervention. */
.tc-note-couche {
  margin: 3px 0 5px 1.4em;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--texte-2);
}
.tc-couches li.sg-ko .tc-note-couche { color: #f9a8a3; }
.tc-note-serveur {
  margin: 6px 0;
  padding: 6px 8px;
  border-left: 3px solid var(--bord);
  background: rgba(255, 255, 255, 0.03);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--texte);
}
/* FRAICHEUR : « les fichiers sont la » et « ils sont a jour » sont deux faits
   differents. Le second etait calcule par le serveur et jamais affiche ici. */
.tc-fraicheur {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--texte-2);
}
.tc-fraicheur.tc-perime {
  color: #fbbf24;
  font-weight: 600;
}

.sg { font-weight: 700; width: 1em; display: inline-block; text-align: center; }
.sg-ok > .sg, b.sg-ok { color: #22c55e; }
.sg-part > .sg, b.sg-part { color: #fbbf24; }
.sg-ko > .sg, b.sg-ko { color: var(--rouge); }
.sg-na > .sg, b.sg-na { color: var(--texte-2); }

.tc-ouvrir { margin-top: 8px; }
.tc-non-ouvrable {
  margin: 8px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--rouge);
}

/* ---- Legende des etats (panneau) ---- */
.lg-titre {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--texte-2);
  margin: 8px 0 3px;
}
.lg-liste { list-style: none; margin: 0; padding: 0; }
.lg-liste li { font-size: 12px; padding: 2px 0; color: var(--texte-2); }
.lg-liste li b:not(.sg) { color: var(--texte); }

/* ══════════════════════════════════════════════════════════════════
   LEGENDE CARTE — bas a droite, VOLONTAIREMENT sous la colonne de bandeaux
   dans l'ordre d'empilement (15 contre 30).
   ══════════════════════════════════════════════════════════════════ */
#legende-fr {
  position: fixed;
  left: calc(10px + env(safe-area-inset-left, 0px));
  bottom: calc(42px + env(safe-area-inset-bottom, 0px));
  z-index: 15;
  background: var(--panneau);
  border: 1px solid var(--bord);
  border-radius: var(--rayon);
  padding: 8px 10px;
  font-size: 11.5px;
  color: var(--texte-2);
}
.lf-ligne { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.lf-sep { border-top: 1px solid var(--bord); margin: 5px 0; }
.pastille { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.pastille.det-0 { background: #ff3b30; }
.pastille.det-3 { background: #ff9500; }
.pastille.det-6 { background: #ffcc00; }
.pastille.det-12 { background: #9a9aa0; }
.pastille.eau { background: #38bdf8; }
.pastille.seveso { background: #a855f7; }
.trait { width: 18px; height: 0; display: inline-block; }
.trait.tr-complete { border-top: 2px solid #22c55e; }
.trait.tr-partielle { border-top: 2px dashed #fbbf24; }
.trait.tr-ko { border-top: 2px dotted #9a9aa0; }
/* ETATS DU FEU CALCULE PAR LE MODELE. Les motifs de trait REPRODUISENT ceux de
   la carte (france.js, TRAITS_MODELE) : une legende dont le trait ne ressemble
   pas a ce qui est dessine ne sert a rien. Le trait DOUBLE la couleur — deux
   des quatre etats sont a 19,5 et 10,8 de distance ΔE76, indiscernables pour
   un daltonien comme sous un soleil de juillet sur un ecran de telephone. */
.trait.tr-actif { border-top: 3px solid #ff9500; }
.trait.tr-nonrevu { border-top: 2px dashed #e0912f; }
.trait.tr-brule { border-top: 2px solid #6b7280; }
.trait.tr-brule-ancien { border-top: 2px dashed #8a6d4f; }
.lf-titre {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--texte-2);
  margin: 2px 0 3px;
}

/* ══════════════════════════════════════════════════════════════════
   MARQUEURS DE NOM DE ZONE (HTML : le style ne declare aucun `glyphs`,
   toute couche `symbol` avec `text-field` serait refusee par MapLibre)
   ══════════════════════════════════════════════════════════════════ */
.marqueur-zone {
  background: rgba(16, 18, 24, 0.9);
  color: var(--texte);
  border: 1px solid var(--bord);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.marqueur-zone.et-ok { border-color: #22c55e; }
.marqueur-zone.et-part { border-color: #fbbf24; }
.marqueur-zone.et-ko { border-color: var(--rouge); color: #ffd9da; }

.popup-zone h3 { margin: 0 0 6px; font-size: 14px; }
.popup-zone p { margin: 0 0 6px; font-size: 12px; }
.popup-zone .pz-manque { color: #333; font-size: 11.5px; }

/* ══════════════════════════════════════════════════════════════════
   TELEPHONE — l'outil sert sur telephone, en intervention. Le panneau passe
   en tiroir bas et les bandeaux prennent toute la largeur : un avertissement
   tronque ou repousse hors de l'ecran ne vaut rien.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  #colonne-bandeaux {
    width: auto;
    right: calc(10px + env(safe-area-inset-right, 0px));
  }
  .bandeau-corps { font-size: 11.5px; }
  #panneau-fr {
    top: auto;
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    width: auto;
    max-height: 52vh;
  }
  /* REPLIE SUR TELEPHONE : on RE-ANCRE explicitement en bas.
     Defaut mesure au banc le 06/08/2026 : la regle de bureau met `bottom:auto`
     et la regle telephone met `top:auto` — les deux ensemble laissaient
     l'element sans aucun ancrage vertical, il repartait a sa position statique
     et DISPARAISSAIT derriere les bandeaux. Le panneau de couverture, c'est-a
     -dire le livrable principal de cet ecran, devenait alors irrecuperable :
     plus aucun bouton pour le rouvrir. */
  #panneau-fr.replie {
    left: auto;
    width: auto;
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    max-height: none;
  }
  /* A39 (21/08/2026) : la légende n'est PLUS supprimée sur téléphone — la
     distinction détection/calcul doit rester lisible en intervention.
     Panneau compact scrollable au-dessus de la carte. */
  #legende-fr {
    display: block;
    position: fixed;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: min(92vw, 330px);
    max-height: 34vh;
    overflow-y: auto;
    z-index: 60;
    opacity: 0.96;
  }
}

/* Signe « servie vide » dans la LEGENDE (hors liste de couches). Meme ambre
   que dans le panneau : le meme etat doit avoir le meme signe et la meme
   couleur aux deux endroits, sinon la legende n'explique plus rien. */
b.sg-vide { color: #fbbf24; }
