/* HornetMap — interface de terrain : la carte occupe tout l'écran, les commandes flottent dessus.
   Surfaces claires, coins arrondis, ombres douces ; contrastes forts et grandes cibles (lisible au soleil, utilisable avec des gants). */
:root {
  /* Palette du logo HornetMap : vert profond, orange, crème */
  --encre: #0b2e21; --encre-2: #2f4a3f; --gris: #55635c; --miel: #b85c05; --miel-vif: #c96f0e; --miel-pale: #fbf1e2; --creme: #f6e5d0;
  --surface: #fff; --fond: #f6f3ee; --trait: #e5dfd5; --trait-fort: #bbb4a7; --champ: #efebe4;
  --fort: #0b2e21; --sur-fort: #fff;                 /* éléments pleins (bouton de la barre, choix actif) */
  --verre: #ffffffeb; --verre-bord: #ffffffb3;       /* barre flottante */
  --ok: #14663a; --alerte: #b3001b; --lien: #9a4c00;
  --avis-fond: #fbf1e2; --avis-bord: #e8cfa6; --avis-texte: #3a2606;
  --rouge-fond: #ffeceb; --rouge-bord: #f0b3ac; --rouge-texte: #4a0009;
  --vert-fond: #e6f5ec; --vert-bord: #a9d6b9; --vert-texte: #0c3d22;
  --alerte-fond: #fff3c4; --alerte-bord: #d9a400; --alerte-texte: #3d2a00;
  --b-cours: #083c8a; --b-cours-f: #e3edfc; --b-nid: #8c0b2d; --b-nid-f: #fde4ea; --b-fin: #333; --b-fin-f: #e8e9eb; --b-att: #6b4200; --b-att-f: #ffeab3;
  --ombre-1: 0 1px 2px #0b2e2114, 0 2px 8px #0b2e2114;
  --ombre-2: 0 2px 6px #0b2e211f, 0 10px 28px #0b2e2129;
  --carte: none;                                     /* filtre appliqué aux fonds de carte */
  --barre: 72px;   /* bas de la barre flottante + marge */
  --bas: 82px;     /* hauteur réservée aux deux boutons du bas (téléphone) */
  color-scheme: light;
}
/* Mode sombre : choisi dans « Compte → Apparence », ou celui de l'appareil en réglage automatique. L'interface passe au sombre ;
   la carte est seulement atténuée, pour que les couleurs des tracés et de la légende gardent leur sens. */
:root[data-theme=sombre] {
  --encre: #eef2ec; --encre-2: #cdd6cf; --gris: #a2b0a7; --miel: #b85c05; --miel-vif: #e58f33; --miel-pale: #33291b; --creme: #f6e5d0;
  --surface: #17211c; --fond: #0e1512; --trait: #2a3731; --trait-fort: #4d5d55; --champ: #212c26;
  --fort: #f6e5d0; --sur-fort: #0b2e21;
  --verre: #17211ceb; --verre-bord: #ffffff1f;
  --ok: #7fd3a1; --alerte: #ff9d93; --lien: #f2a968;
  --avis-fond: #33291b; --avis-bord: #6b5026; --avis-texte: #f6e5d0;
  --rouge-fond: #3b1c1c; --rouge-bord: #7c3a36; --rouge-texte: #ffd9d4;
  --vert-fond: #173123; --vert-bord: #2f6a48; --vert-texte: #cdeedb;
  --alerte-fond: #40330e; --alerte-bord: #a37d00; --alerte-texte: #ffeeb5;
  --b-cours: #b4d0ff; --b-cours-f: #1b3157; --b-nid: #ffb3c4; --b-nid-f: #4f1a29; --b-fin: #d6d6d6; --b-fin-f: #34383a; --b-att: #ffdf94; --b-att-f: #4a3a10;
  --ombre-1: 0 1px 2px #0006, 0 2px 8px #0006;
  --ombre-2: 0 2px 6px #0008, 0 10px 28px #000a;
  --carte: brightness(.72) contrast(1.06);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=clair]) {
    --encre: #eef2ec; --encre-2: #cdd6cf; --gris: #a2b0a7; --miel: #b85c05; --miel-vif: #e58f33; --miel-pale: #33291b; --creme: #f6e5d0;
    --surface: #17211c; --fond: #0e1512; --trait: #2a3731; --trait-fort: #4d5d55; --champ: #212c26;
    --fort: #f6e5d0; --sur-fort: #0b2e21;
    --verre: #17211ceb; --verre-bord: #ffffff1f;
    --ok: #7fd3a1; --alerte: #ff9d93; --lien: #f2a968;
    --avis-fond: #33291b; --avis-bord: #6b5026; --avis-texte: #f6e5d0;
    --rouge-fond: #3b1c1c; --rouge-bord: #7c3a36; --rouge-texte: #ffd9d4;
    --vert-fond: #173123; --vert-bord: #2f6a48; --vert-texte: #cdeedb;
    --alerte-fond: #40330e; --alerte-bord: #a37d00; --alerte-texte: #ffeeb5;
    --b-cours: #b4d0ff; --b-cours-f: #1b3157; --b-nid: #ffb3c4; --b-nid-f: #4f1a29; --b-fin: #d6d6d6; --b-fin-f: #34383a; --b-att: #ffdf94; --b-att-f: #4a3a10;
    --ombre-1: 0 1px 2px #0006, 0 2px 8px #0006;
    --ombre-2: 0 2px 6px #0008, 0 10px 28px #000a;
    --carte: brightness(.72) contrast(1.06);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font: 16.500px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; color: var(--encre); background: var(--fond); overflow: hidden;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h2 { font-size: 1.3rem; font-weight: 750; letter-spacing: -.015em; margin: 0 0 .5rem; }
h3 { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin: 1.4rem 0 .5rem; }
p { margin: .55rem 0; }
small, .note { font-size: .9rem; color: var(--gris); }
a { color: var(--lien); }

/* ---- Barre flottante */
#barre { position: fixed; top: max(10px, env(safe-area-inset-top)); left: 10px; right: 10px; height: 54px; z-index: 1100; display: flex; align-items: center; gap: .5rem;
  padding: 0 7px 0 9px; border-radius: 18px; background: var(--verre); -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: var(--ombre-2); border: 1px solid var(--verre-bord); }
.marque { display: flex; align-items: center; flex: none; background: #fffaf2; border-radius: 12px; }   /* le logo garde un fond clair en mode sombre */
.marque img { display: block; }
.marque .long { display: none; }
@media (min-width: 521px) { .marque .picto { display: none; } .marque .long { display: block; margin: 0 .2rem 0 .1rem; } }
#lieu { flex: 1; position: relative; min-width: 0; }
#lieu-q { width: 100%; height: 40px; min-height: 0; border: 1.500px solid transparent; border-radius: 12px; padding: 0 .8rem 0 2.3rem; background: var(--champ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2355635c' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.500'/%3E%3Cpath d='m16 16 4.500 4.500'/%3E%3C/svg%3E") .65rem center / 18px no-repeat; color: var(--encre); }
#lieu-q::placeholder { color: var(--gris); }
#lieu-q:focus { background-color: var(--surface); border-color: var(--encre); outline: none; }
#lieu-res { position: absolute; top: 50px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface);
  border-radius: 16px; max-height: 50vh; overflow: auto; box-shadow: var(--ombre-2); }
#lieu-res button { display: block; width: 100%; text-align: left; padding: .7rem .75rem; border: 0; border-radius: 10px; background: none; }
#lieu-res button:hover, #lieu-res button:focus { background: var(--miel-pale); }
.bouton-barre { height: 40px; padding: 0 .95rem; border-radius: 12px; border: 0; background: var(--fort); color: var(--sur-fort); font-weight: 650;
  max-width: 9.500rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Carte */
#carte { position: fixed; inset: 0; z-index: 1; background: #dfe6ea; }
.leaflet-container { font: inherit; }
.leaflet-top { top: var(--barre); }
.leaflet-bottom { bottom: var(--bas); }
.leaflet-tile-pane { filter: var(--carte); }
body.fond-photo .leaflet-tile-pane { filter: none; }
.leaflet-control-attribution { font-size: 11px; background: var(--verre) !important; color: var(--encre) !important; border-radius: 8px 0 0 0; padding: 1px 7px !important; }
.leaflet-bar, .leaflet-control-layers { border: 0 !important; border-radius: 14px !important; box-shadow: var(--ombre-1) !important; overflow: hidden; }
.leaflet-touch .leaflet-bar a, .leaflet-bar a { width: 40px; height: 40px; line-height: 40px; color: var(--encre); background: var(--surface); border-bottom-color: var(--trait); }
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--fond); color: var(--encre); }
.leaflet-control-layers { background: var(--surface); color: var(--encre); }
.leaflet-control-attribution a { color: var(--lien); }
.leaflet-touch .leaflet-control-layers-toggle, .leaflet-control-layers-toggle { width: 44px; height: 44px; }
.leaflet-control-layers-expanded { padding: 10px 14px 10px 12px; font-size: 15px; }
.leaflet-control-layers label { font-weight: 500; margin: .45rem 0; }
.leaflet-control-scale-line { border-color: var(--encre) !important; background: var(--verre) !important; color: var(--encre); border-radius: 0 0 4px 4px; }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--ombre-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--encre); }
.leaflet-container a.leaflet-popup-close-button { color: var(--gris); }
.leaflet-popup-content { font-size: 15px; margin: 14px 16px; }
.leaflet-popup-content button { margin-top: .5rem; }

#bandeau { position: fixed; top: var(--barre); left: 10px; right: 10px; z-index: 1050; background: var(--alerte-fond); color: var(--alerte-texte); border: 1.500px solid var(--alerte-bord); border-radius: 14px;
  padding: .5rem .75rem; font-weight: 600; font-size: .95rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; box-shadow: var(--ombre-1); }
#bandeau.erreur { background: var(--rouge-fond); border-color: var(--alerte); color: var(--rouge-texte); }
#bandeau button { min-height: 36px; padding: 0 .8rem; border-radius: 10px; border: 0; background: var(--fort); color: var(--sur-fort); font-weight: 650; }

#consigne { position: fixed; top: var(--barre); left: 10px; right: 68px; z-index: 1040; background: #0b2e21f0; color: #fff; outline: 1px solid #ffffff2e;
  padding: .5rem .8rem .5rem .75rem; border-radius: 14px; font-weight: 600; font-size: .93rem; line-height: 1.25; box-shadow: var(--ombre-2); border-left: 5px solid var(--miel-vif);
  pointer-events: none; /* ne bloque jamais un toucher sur la carte */ }
body.avec-bandeau #consigne { top: calc(var(--barre) + 62px); }

#outils { position: fixed; right: 10px; bottom: calc(var(--bas) + 30px); z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
#outils button { width: 56px; min-height: 56px; border-radius: 16px; border: 0; background: var(--surface); color: var(--encre);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: .66rem; font-weight: 650; padding: 4px 0; box-shadow: var(--ombre-1); }
#outils svg { width: 22px; height: 22px; fill: currentColor; }
/* Libellés longs dans certaines langues : le bouton s'élargit vers la gauche, le texte passe à la ligne au besoin */
#outils { align-items: flex-end; }
#outils button { width: auto; min-width: 56px; max-width: 96px; padding: 4px 6px; }
#outils span { text-align: center; line-height: 1.1; overflow-wrap: anywhere; }
#outils button.actif { background: var(--fort); color: var(--sur-fort); }

/* ---- Boutons du bas : flottants */
#bas { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 1000; display: flex; gap: .5rem; pointer-events: none; }
#bas button { flex: 1; pointer-events: auto; min-height: 58px; border-radius: 18px; box-shadow: var(--ombre-2); }
#bas button { font-size: .98rem; padding-inline: .5rem; white-space: nowrap; }
#bas .secondaire { flex: 0 0 31%; border-color: transparent; }

button.principal, button.secondaire, button.danger, a.secondaire, a.google { min-height: 52px; border-radius: 14px; font-weight: 700; font-size: 1.02rem; padding: .4rem 1rem; border: 1.500px solid transparent;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .6rem; text-align: center; transition: transform .08s, background-color .15s, box-shadow .15s; }
button.principal { background: var(--miel); color: #fff; box-shadow: inset 0 -2px 0 #0000001f; }
button.principal:hover { background: #a24f02; }
button.secondaire, a.secondaire { background: var(--surface); color: var(--encre); border-color: var(--trait-fort); }
button.secondaire:hover, a.secondaire:hover { background: var(--fond); }
button.danger { background: var(--rouge-fond); color: var(--alerte); border-color: var(--rouge-bord); }
button.petit { min-height: 44px; font-size: .95rem; border-radius: 12px; }
button.principal:active, button.secondaire:active, button.danger:active, a.google:active { transform: scale(.98); }
button:disabled { opacity: .45; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid var(--lien); outline-offset: 2px; }
.rangee { display: flex; gap: .5rem; flex-wrap: wrap; margin: .7rem 0; }
.rangee > * { flex: 1 1 8rem; }

/* Connexion avec Google */
a.google { display: flex; width: 100%; margin: .4rem 0 0; background: var(--surface); color: var(--encre); border-color: var(--trait-fort); box-shadow: var(--ombre-1); }
a.google:hover { background: var(--fond); }
a.google .sym svg { filter: none; }
select { color-scheme: inherit; }
.ou { display: flex; align-items: center; gap: .8rem; margin: 1rem 0 .9rem; color: var(--gris); font-size: .88rem; }
.ou::before, .ou::after { content: ""; flex: 1; height: 1px; background: var(--trait); }

/* ---- Panneau : feuille du bas (téléphone), colonne (ordinateur) */
#panneau { position: fixed; z-index: 1200; left: 0; right: 0; bottom: 0; max-height: 72vh; overflow: auto; overscroll-behavior: contain; background: var(--surface);
  border-radius: 24px 24px 0 0; padding: 0 1rem 1.2rem; padding-bottom: max(1.2rem, env(safe-area-inset-bottom)); box-shadow: 0 -8px 30px #0b2e2138; }
#panneau.compact { max-height: 46vh; }
.entete { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; background: var(--surface); padding: 1.15rem 0 .55rem; z-index: 2; }
.entete::before { content: ""; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--trait-fort); }
.entete h2 { flex: 1; margin: 0; }
.entete button { width: 42px; height: 42px; flex: none; border-radius: 50%; border: 0; background: var(--fond); color: var(--encre); font-weight: 700; font-size: 1.05rem; }
.entete button:hover { background: var(--trait); }

label { display: block; font-weight: 650; font-size: .95rem; margin: .8rem 0 .25rem; }
label > input, label > select, label > textarea { margin-top: .3rem; font-weight: 400; font-size: 1rem; }
label.case { display: flex; gap: .65rem; align-items: flex-start; font-weight: 450; font-size: 1rem; padding: .45rem 0; }
label.case input { width: 24px; height: 24px; flex: none; margin: 1px 0 0; accent-color: var(--encre); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=search], select, textarea {
  width: 100%; min-height: 48px; border: 1.500px solid var(--trait-fort); border-radius: 12px; padding: .45rem .7rem; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--encre); box-shadow: 0 0 0 3px #c96f0e59; outline: none; }
textarea { min-height: 76px; resize: vertical; }
.segments { display: flex; gap: 4px; padding: 4px; background: var(--champ); border-radius: 15px; }
.segments button { flex: 1; min-height: 48px; border: 0; border-radius: 11px; background: none; color: var(--encre-2); font-weight: 650; padding: .2rem .3rem; line-height: 1.15; transition: background-color .15s; }
.segments button[aria-pressed=true] { background: var(--fort); color: var(--sur-fort); box-shadow: var(--ombre-1); }
.segments small { display: block; font-weight: 500; color: inherit; opacity: .85; font-size: .76rem; }
.azimut { display: flex; gap: 6px; align-items: stretch; }
.azimut input { text-align: center; font-size: 1.4rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.azimut button { min-width: 56px; border: 1.500px solid var(--trait-fort); border-radius: 12px; background: var(--surface); font-weight: 750; font-size: 1.1rem; }
.azimut output { min-width: 4rem; display: flex; align-items: center; justify-content: center; font-weight: 750; font-size: 1.15rem; }

.carte-r { border: 1px solid var(--trait); border-radius: 16px; padding: .8rem .9rem; margin: .6rem 0; background: var(--surface); box-shadow: var(--ombre-1); }
.carte-r h3 { margin: 0 0 .3rem; font-size: 1.05rem; text-transform: none; letter-spacing: -.01em; color: var(--encre); }
.carte-r .rangee { margin-bottom: 0; }
.badge { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .84rem; padding: .18rem .65rem; border-radius: 99px; white-space: nowrap; }
.badge.en_cours { color: var(--b-cours); background: var(--b-cours-f); } .badge.localise { color: var(--b-nid); background: var(--b-nid-f); } .badge.detruite { color: var(--b-fin); background: var(--b-fin-f); } .badge.attente { color: var(--b-att); background: var(--b-att-f); }
.avis { background: var(--avis-fond); border: 1px solid var(--avis-bord); color: var(--avis-texte); padding: .65rem .8rem; border-radius: 14px; margin: .7rem 0; font-size: .97rem; }
.avis.rouge { background: var(--rouge-fond); border-color: var(--rouge-bord); color: var(--rouge-texte); }
.avis.gris { background: var(--fond); border-color: var(--trait); color: var(--encre); }
.avis.vert { background: var(--vert-fond); border-color: var(--vert-bord); color: var(--vert-texte); }
.erreur-f { color: var(--alerte); font-weight: 650; margin: .5rem 0; }
ul.liste { list-style: none; margin: .3rem 0; padding: 0; }
ul.liste > li { border-bottom: 1px solid var(--trait); padding: .55rem 0; }
ul.liste > li:last-child { border-bottom: 0; }
ul.liste button.ligne { display: block; width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: .35rem .3rem; min-height: 48px; }
ul.liste button.ligne:hover { background: var(--miel-pale); }
dl.fiche { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: .6rem 0; padding: .8rem .9rem; background: var(--fond); border-radius: 14px; }
dl.fiche dt { font-weight: 500; color: var(--gris); } dl.fiche dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
table.legende { border-collapse: collapse; width: 100%; } table.legende td { padding: .5rem .3rem; vertical-align: middle; border-bottom: 1px solid var(--trait); }
table.legende td:first-child { width: 64px; text-align: center; }
table.legende .sym { background: #f3efe8; border-radius: 10px; padding: 5px 4px; }   /* les symboles gardent leur fond clair, même en mode sombre */
details { margin: .7rem 0; border: 1px solid var(--trait); border-radius: 14px; padding: 0 .9rem; }
details[open] { padding-bottom: .6rem; }
summary { font-weight: 650; padding: .75rem 0; cursor: pointer; min-height: 44px; }
.lien { background: none; border: 0; padding: 0; color: var(--lien); text-decoration: underline; text-underline-offset: 2px; font-weight: 600; min-height: 44px; }

#toast { outline: 1px solid #ffffff2e; position: fixed; z-index: 1500; left: 50%; transform: translateX(-50%); top: calc(var(--barre) + 4px); width: max-content; background: #0b2e21f2; color: #fff; padding: .7rem 1.1rem;
  border-radius: 14px; font-weight: 600; max-width: 92vw; box-shadow: var(--ombre-2); }
#toast.erreur { background: #b3001b; }

/* ---- Carte d'accueil (premier passage) */
#accueil { position: fixed; z-index: 1150; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); max-height: calc(100% - var(--barre) - 16px); overflow: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: 22px; padding: 1.1rem 1.1rem .9rem; box-shadow: var(--ombre-2); }
.sans-accueil #accueil, body.panneau-ouvert #accueil, body.visee #accueil { display: none; }
#accueil h1 { font-size: 1.4rem; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 .5rem; text-wrap: balance; }
#accueil ol { list-style: none; counter-reset: etape; margin: .8rem 0; padding: 0; }
#accueil li { counter-increment: etape; position: relative; padding: .3rem 0 .3rem 2.5rem; font-size: .97rem; }
#accueil li::before { content: counter(etape); position: absolute; left: 0; top: .35rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--miel); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
#accueil li strong { display: block; }
#accueil details { border: 0; padding: 0; margin: .2rem 0 0; }
#accueil summary { font-size: .92rem; color: var(--gris); padding: .4rem 0; min-height: 0; }
#langues nav { display: flex; flex-wrap: wrap; gap: .35rem; padding: .2rem 0 .4rem; }
#langues a { text-decoration: none; font-size: .9rem; font-weight: 600; color: var(--encre); background: var(--fond); border: 1px solid var(--trait); border-radius: 99px; padding: .25rem .7rem; }
#langues a[aria-current] { background: var(--fort); color: var(--sur-fort); border-color: transparent; }
#accueil-langue { display: block; margin: .2rem 0; }

/* ---- Visée à la boussole : la carte prend tout l'écran, le bouton rond valide comme un déclencheur photo */
#visee { position: fixed; inset: 0; z-index: 1300; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; align-items: stretch; }
#visee-haut { align-self: center; margin: max(12px, env(safe-area-inset-top)) 12px 0; max-width: min(78vw, 300px); display: flex; flex-direction: column; align-items: center; text-align: center;
  background: #0b2e21e6; color: #fff; border-radius: 14px; padding: .25rem .8rem .35rem; box-shadow: var(--ombre-2); outline: 1px solid #ffffff2e; }
#visee-cap { font-size: 1.35rem; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
#visee-aide { font-size: .74rem; line-height: 1.25; opacity: .9; }
#visee-bas { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 16px max(26px, calc(env(safe-area-inset-bottom) + 14px)); }
#visee-bas button { pointer-events: auto; }
#visee-annuler { justify-self: start; min-height: 50px; padding: 0 1.1rem; border-radius: 16px; border: 0; background: var(--surface); color: var(--encre); font-weight: 650; box-shadow: var(--ombre-2); }
#visee-valider { width: 96px; height: 96px; border-radius: 50%; border: 5px solid #fff; background: var(--miel); color: #fff; font-weight: 800; font-size: 1rem; padding: 0 .2rem;
  box-shadow: 0 0 0 4px var(--miel), 0 8px 24px #0008; transition: transform .08s; overflow: hidden; }
#visee-valider span { display: block; overflow-wrap: anywhere; line-height: 1.1; }
#visee-valider:active { transform: scale(.94); }
#visee-valider:disabled { opacity: .55; }
body.visee #barre, body.visee #outils, body.visee #bas, body.visee #consigne, body.visee .leaflet-top, body.visee .leaflet-bottom.leaflet-left { display: none; }
body.visee #panneau { display: none !important; }
body.visee .leaflet-bottom { bottom: 0; }
/* La carte tourne sous la flèche : grand carré centré sur le point d'observation (placé un peu sous le milieu de l'écran, pour voir loin devant). */
body.visee #carte { inset: auto !important; left: 50% !important; top: 58% !important; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; will-change: transform; }
#visee-nord { justify-self: end; width: 56px; height: 56px; border-radius: 50%; background: #0b2e21f0; outline: 1px solid #ffffff2e; box-shadow: var(--ombre-2); }
#visee-nord svg { display: block; width: 100%; height: 100%; }

/* ---- Statistiques : tuiles de chiffres clés et graphiques à une série */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px; margin: .7rem 0; }
.tuile { background: var(--fond); border: 1px solid var(--trait); border-radius: 14px; padding: .7rem .8rem; display: flex; flex-direction: column; gap: .15rem; }
.tuile strong { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tuile span { font-size: .86rem; color: var(--gris); line-height: 1.25; }
.graphe { margin: 1.1rem 0; padding: 0; }
.graphe figcaption { font-weight: 650; font-size: .95rem; margin-bottom: .5rem; }
.colonnes { display: flex; align-items: flex-end; gap: 2px; height: 150px; border-bottom: 1px solid var(--trait-fort); padding-top: 1.1rem; }
.col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.col .barre { width: min(100%, 26px); min-height: 0; background: var(--miel-vif); border-radius: 4px 4px 0 0; }
.col:hover .barre, .lig:hover .barre { filter: brightness(1.15); }
.col .val { font-size: .68rem; font-weight: 650; color: var(--gris); font-variant-numeric: tabular-nums; line-height: 1.5; }
.col .nom { position: absolute; top: 100%; margin-top: 3px; font-size: .66rem; color: var(--gris); white-space: nowrap; }
.colonnes { margin-bottom: 1.4rem; }
.lignes { display: grid; gap: 6px; }
.lig { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: 8px; font-size: .92rem; }
.lig .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lig .piste { height: 14px; background: var(--fond); border-radius: 4px; overflow: hidden; }
.lig .barre { display: block; height: 100%; background: var(--miel-vif); border-radius: 0 4px 4px 0; }
.lig .val { font-weight: 650; font-variant-numeric: tabular-nums; min-width: 1.5rem; text-align: right; }

/* Symboles de la carte */
.sym { display: flex; align-items: center; justify-content: center; }
.sym svg { display: block; filter: drop-shadow(0 1px 2px #0008); }
.etiquette { background: var(--surface); border: 0; border-radius: 99px; padding: 2px 9px; font-weight: 700; font-size: 12px; color: var(--encre); white-space: nowrap; box-shadow: 0 0 0 1.500px var(--encre), var(--ombre-1); }
.etiquette::before { display: none; }

@media (min-width: 900px) {
  :root { --bas: 0px; }
  #accueil { left: 14px; right: auto; bottom: auto; top: var(--barre); width: 440px; }
  #barre { left: 14px; right: 14px; top: 14px; }
  :root { --barre: 80px; }
  #lieu { max-width: 460px; margin-right: auto; }
  #bas { left: auto; right: 86px; bottom: 26px; width: 470px; }
  #panneau { top: 0; bottom: 0; right: auto; width: 420px; max-height: none; border-radius: 0; padding-top: .4rem; box-shadow: 4px 0 24px #0b2e2124; }
  #panneau.compact { max-height: none; }
  .entete::before { display: none; }
  body.panneau-ouvert #carte { left: 420px; }
  body.panneau-ouvert #barre { left: 434px; }
  body.panneau-ouvert #bandeau, body.panneau-ouvert #consigne { left: 434px; }
  #bandeau { left: 14px; right: 14px; }
  #consigne { left: 14px; right: 80px; }
  #outils { right: 14px; bottom: 30px; }
}
@media (max-width: 899px) {
  body.panneau-ouvert #bas, body.panneau-ouvert #outils { display: none; }
  body.panneau-ouvert .leaflet-bottom { bottom: 20px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Méthode en animation, en surimpression */
#methode { position: fixed; inset: 0; z-index: 1600; background: #0b2e21b3; display: flex; align-items: center; justify-content: center; padding: 12px; }
#methode[hidden] { display: none; }
#methode-carte { background: var(--surface); color: var(--encre); border-radius: 20px; box-shadow: var(--ombre-2); width: min(100%, 960px); max-height: 100%; overflow: auto; padding: 10px 12px 12px; }
#methode-haut { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 2px 6px; }
#methode-haut h2 { margin: 0; font-size: 1.1rem; }
#methode-fermer { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--fond); color: var(--encre); font-size: 1.1rem; flex: none; }
#methode-img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 12px; background: #fbf1e2; }
#methode .rangee { justify-content: center; margin-top: 10px; }
#accueil-methode { display: block; margin: .2rem 0; }
