[hidden] { display: none !important; }
:root {
  --bleu: #0f3d5e; --bleu-c: #e7f0f7; --vert: #1a7f37; --vert-c: #e6f4ea; --rouge: #b42318; --rouge-c: #fdecea;
  --orange: #b54708; --orange-c: #fef3e2; --gris: #667085; --bord: #d0d5dd; --fond: #f5f7fa;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: #1d2939;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); padding-bottom: env(safe-area-inset-bottom); }
#barre { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  padding-top: calc(10px + env(safe-area-inset-top)); background: var(--bleu); color: #fff; }
#barre a { color: #fff; text-decoration: none; }
#barre .titre { font-weight: 700; font-size: 17px; flex: 1; }
#sync { font-size: 13px; padding: 3px 8px; border-radius: 10px; background: rgba(255,255,255,.15); }
#sync.attente { background: var(--orange); }
#sync.horsligne { background: var(--rouge); }
#barre { gap: 8px; padding-top: calc(6px + env(safe-area-inset-top)); padding-bottom: 6px; }
.nav-btn { background: transparent; border: 0; color: #fff; padding: 6px; min-height: 40px; min-width: 40px; border-radius: 8px; }
.nav-btn:hover, #nav a:hover { background: rgba(255,255,255,.12); }
#barre svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#nav { display: flex; gap: 2px; }
#nav a { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; font-size: 14px; opacity: .85; min-height: 40px; }
#nav a.actif { background: rgba(255,255,255,.18); opacity: 1; font-weight: 600; }
#moi { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 640px) {
  #barre .titre { font-size: 16px; }
  #nav a { flex-direction: column; gap: 1px; padding: 4px 8px; font-size: 10.5px; }
  #nav a svg { width: 21px; height: 21px; }
  #moi { max-width: 64px; }
  #sync { font-size: 11px; padding: 2px 6px; }
}
main { max-width: 900px; margin: 0 auto; padding: 14px; }
h1 { font-size: 21px; margin: 4px 0 10px; }
h2 { font-size: 17px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 14px 0 6px; }
a { color: var(--bleu); }
.carte { background: #fff; border: 1px solid var(--bord); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.ligne { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ligne > .pousse { flex: 1; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste > li { border-bottom: 1px solid #eef0f3; }
.liste > li:last-child { border-bottom: 0; }
.liste a.item { display: flex; gap: 10px; align-items: center; padding: 11px 2px; text-decoration: none; color: inherit; }
.item .code { font-weight: 600; min-width: 90px; }
.item .sous { color: var(--gris); font-size: 13px; flex: 1; }
.pastille { font-size: 12px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.p-conforme { background: var(--vert-c); color: var(--vert); }
.p-en_cours { background: var(--orange-c); color: var(--orange); }
.p-a_faire { background: #eef0f3; color: var(--gris); }
.p-alerte { background: var(--rouge-c); color: var(--rouge); }
button, .bouton { font: inherit; font-size: 15px; border: 1px solid var(--bord); background: #fff; color: #1d2939;
  border-radius: 8px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-block; min-height: 44px; }
button.principal, .bouton.principal { background: var(--bleu); border-color: var(--bleu); color: #fff; }
button.danger { color: var(--rouge); border-color: var(--rouge); }
button:disabled { opacity: .5; }
.choix { display: flex; gap: 6px; flex-wrap: wrap; }
.choix button { flex: 1; min-width: 70px; }
.choix button.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.choix button.actif.ok { background: var(--vert); border-color: var(--vert); }
.choix button.actif.nok { background: var(--rouge); border-color: var(--rouge); }
input, select, textarea { font: inherit; font-size: 16px; width: 100%; padding: 10px; border: 1px solid var(--bord); border-radius: 8px; background: #fff; }
textarea { min-height: 70px; }
label { display: block; font-size: 13px; color: var(--gris); margin: 10px 0 4px; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.alerte { background: var(--rouge-c); color: var(--rouge); border-radius: 8px; padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.info { background: var(--bleu-c); color: var(--bleu); border-radius: 8px; padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.succes { background: var(--vert-c); color: var(--vert); border-radius: 8px; padding: 10px 12px; margin: 6px 0; font-size: 14px; }
.bloquants { margin: 6px 0 0; padding-left: 18px; font-size: 14px; color: var(--rouge); }
.point { padding: 10px 0; border-bottom: 1px solid #eef0f3; }
.point:last-child { border-bottom: 0; }
.point .txt { font-size: 14px; margin-bottom: 6px; }
.slot { padding: 10px 0; border-bottom: 1px solid #eef0f3; }
.slot .ligne { justify-content: space-between; }
.vignettes { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.vignettes img, .vignettes video { width: 84px; height: 84px; object-fit: cover; border-radius: 6px; border: 1px solid var(--bord); }
.vignettes .attente { outline: 3px solid var(--orange); }
.vignette { position: relative; display: inline-block; }
.vignette .suppr-media { position: absolute; top: -8px; right: -8px; width: 30px; height: 30px; min-height: 0; padding: 0; border-radius: 50%; background: #c62828; color: #fff; border: 2px solid #fff; font-size: 18px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.manque { color: var(--rouge); font-size: 13px; }
.fait { color: var(--vert); font-size: 13px; }
.gros { font-size: 42px; font-weight: 800; text-align: center; margin: 14px 0; letter-spacing: 1px; }
.barre-prog { height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; margin: 8px 0; }
.barre-prog > div { height: 100%; background: var(--vert); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #eef0f3; vertical-align: top; }
td.nok { color: var(--rouge); font-weight: 600; }
td.ok { color: var(--vert); }
.vide { color: var(--gris); text-align: center; padding: 30px 0; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1d2939; color: #fff; padding: 10px 16px;
  border-radius: 8px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; max-width: 90vw; }
#toast.vu { opacity: 1; }
details > summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.nav-boite { display: flex; gap: 8px; margin-bottom: 10px; }
.filariane { font-size: 13px; color: var(--gris); margin: -4px 0 8px; } .filariane a { color: var(--gris); }
.nav-boite a, .nav-boite span { text-align: center; }
.nav-boite a:nth-child(2) { flex: 1; }
.nav-boite a:first-child, .nav-boite a:last-child, .nav-boite span { min-width: 56px; }
@media (max-width: 560px) { .grille2 { grid-template-columns: 1fr; } .item .code { min-width: 70px; } }

.accueil { display: flex; flex-direction: column; gap: 12px; }
main:has(.accueil) { max-width: 1400px; }
.recherche { position: relative; z-index: 1100; }
.recherche input { font-size: 17px; padding: 13px 14px; border-radius: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.sugg { position: absolute; z-index: 1100; left: 0; right: 0; top: 100%; background: #fff; border-radius: 0 0 10px 10px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 60vh; overflow: auto; }
.sugg:empty { display: none; }
.sugg button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #eef0f3; border-radius: 0; background: #fff; }
.sugg button:hover { background: var(--bleu-c); }
.sugg small { color: var(--gris); }
.carte-zone { display: grid; grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); gap: 12px; }
#carte { height: min(72vh, 720px); border-radius: 10px; border: 1px solid var(--bord); }
/* la mer : là où l'IGN ne sert pas de tuile (au large), le fond prend sa couleur au lieu du blanc */
.leaflet-container { background: #a9d4ea; }
.panneau { margin: 0; max-height: min(72vh, 720px); overflow: auto; }
.panneau table th { width: 105px; color: var(--gris); font-weight: 500; }
@media (max-width: 800px) { .carte-zone { grid-template-columns: 1fr; } #carte { height: 55vh; } .panneau { max-height: none; } }

.trajet-resume { background: var(--bleu-c); border-radius: 10px; padding: 12px 14px; margin: 8px 0; }
.trajet-resume b { display: block; font-size: 28px; color: var(--bleu); }
.trajet-resume span { color: var(--gris); }
.etapes { padding-left: 20px; font-size: 14px; } .etapes li { margin: 5px 0; } .etapes small { color: var(--gris); }
.moi-point { width: 22px; height: 22px; border-radius: 50%; background: #1a73e8; border: 4px solid #fff; box-shadow: 0 0 0 7px rgba(26,115,232,.25), 0 1px 4px rgba(0,0,0,.4); }
.arrivee-point { font-size: 26px; color: #b42318; text-shadow: 0 1px 2px #fff; line-height: 30px; }
main:has(.guidage) { max-width: none; padding: 0; }
.guidage { display: flex; flex-direction: column; height: calc(100dvh - 56px - env(safe-area-inset-top)); }
.g-consigne { background: #0b6e4f; color: #fff; padding: 14px 16px; }
.g-consigne b { display: block; font-size: 21px; } .g-consigne span { font-size: 16px; opacity: .9; }
#g-carte { flex: 1; }
.g-bas { background: #fff; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--bord); }
#g-reste { font-size: 17px; margin-bottom: 8px; } #g-reste b { font-size: 21px; color: var(--vert); }
.g-bas button.actif { background: var(--bleu); color: #fff; border-color: var(--bleu); }

.legende { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--gris); margin: 6px 0; }
.legende i, .puce { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.tab-epci td, .tab-epci th { padding: 5px 4px; font-size: 13px; } .tab-epci td:nth-child(n+2), .tab-epci th:nth-child(n+2) { text-align: right; width: 54px; }

.filtres { margin: 0; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.f-titre { font-size: 13px; color: var(--gris); min-width: 70px; }
.puce-f { min-height: 34px; padding: 5px 10px; border-radius: 18px; font-size: 13px; background: #fff; opacity: .55; }
.puce-f.actif { opacity: 1; border-color: var(--bleu); box-shadow: inset 0 0 0 1px var(--bleu); }
.puce-f i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.puce-f small { color: var(--gris); margin-left: 3px; }
.compteurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 6px 0 10px; }
.compteurs div { background: var(--fond); border-radius: 8px; padding: 8px 4px; text-align: center; }
.compteurs b { display: block; font-size: 22px; } .compteurs span { font-size: 11.5px; color: var(--gris); }
.tab-epci td:nth-child(n+2), .tab-epci th:nth-child(n+2) { text-align: right; width: 42px; }

button.suivi-on { background: #fef9c3; border-color: #eab308; color: #854d0e; font-weight: 600; }
#f-suivis.actif { box-shadow: inset 0 0 0 1px #eab308; border-color: #eab308; background: #fef9c3; }

/* ---- boutons à icône ---- */
.bouton svg, button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; margin-right: 6px; }
.aller { background: #1a73e8 !important; border-color: #1a73e8 !important; color: #fff !important; font-weight: 600; }
/* ---- page PM ---- */
.pm-tete { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.pm-tete h1 { margin: 2px 0; }
.pm-commune { color: var(--gris); font-size: 15px; }
.pm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 4px; }
.pm-actions .aller { margin-left: auto; }
.pm-pos { color: var(--gris); font-size: 13px; margin: 2px 0 8px; }
.alerte.compacte { font-size: 13px; padding: 8px 10px; line-height: 1.5; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin-top: 6px; }
.tuiles a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--bord); border-radius: 10px; text-decoration: none; color: var(--bleu); font-size: 13px; font-weight: 600; }
.tuiles a:active { background: var(--bleu-c); }
.tuiles svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* ---- filtres : actif = plein, inactif = barré et pâle ---- */
.filtres > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.filtres > summary::-webkit-details-marker { display: none; }
.filtres > summary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.filtres > summary small { font-weight: 400; color: var(--gris); }
.filtres[open] > summary { margin-bottom: 8px; }
.f-ligne { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.puce-f { opacity: 1; background: #fff; color: var(--gris); border-color: var(--bord); text-decoration: line-through; text-decoration-color: rgba(0,0,0,.25); }
.puce-f i { opacity: .35; }
.puce-f.actif { text-decoration: none; color: #1d2939; background: var(--bleu-c); border-color: var(--bleu); box-shadow: none; }
.puce-f.actif i { opacity: 1; }
#f-suivis { text-decoration: none; }
/* ---- téléphone : moins d'air ---- */
@media (max-width: 640px) {
  main { padding: 8px; }
  h1 { font-size: 19px; margin: 2px 0 6px; }
  h2 { font-size: 16px; margin-bottom: 6px; }
  .carte { padding: 10px; margin-bottom: 8px; border-radius: 8px; }
  button, .bouton { padding: 7px 11px; min-height: 38px; font-size: 14px; }
  .liste a.item { padding: 8px 0; gap: 8px; }
  .item .sous { font-size: 12.5px; }
  label { margin: 6px 0 3px; }
  input, select, textarea { padding: 8px; }
  .filariane { margin: 0 0 4px; font-size: 12px; }
  .f-titre { width: 100%; min-width: 0; font-size: 12px; margin-bottom: -2px; }
  .f-ligne { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex-wrap: wrap; }
  .puce-f { min-height: 30px; padding: 3px 9px; font-size: 12.5px; }
  .compteurs b { font-size: 18px; } .compteurs div { padding: 6px 2px; }
  .recherche input { padding: 10px 12px; font-size: 16px; }
  .accueil { gap: 8px; }
  #carte { height: 50vh; }
  .point { padding: 8px 0; } .slot { padding: 7px 0; }
  .choix button { min-width: 60px; }
  .pm-actions .aller { margin-left: 0; }
}

/* ---- connexion et administration ---- */
.connexion { max-width: 400px; margin: 30px auto; }
.mdp-champ { position: relative; } .mdp-champ .voir { position: absolute; right: 4px; top: 4px; min-height: 36px; padding: 4px 8px; border: 0; background: transparent; }
.onglets { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 10px; border-bottom: 1px solid var(--bord); }
.onglets a { padding: 9px 14px; text-decoration: none; color: var(--gris); border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 600; font-size: 14px; }
.onglets a.actif { color: var(--bleu); border-bottom-color: var(--bleu); }
.comptes { display: flex; flex-direction: column; gap: 8px; }
.compte { border: 1px solid var(--bord); border-radius: 10px; padding: 10px 12px; }
.compte.inactif { opacity: .6; background: #f8fafc; }
.compte select { width: auto; padding: 5px 8px; font-size: 14px; }
.etiquettes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.actions-compte button { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.fiche-acces { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; background: var(--vert-c); border: 1px solid #a6d8b5; border-radius: 10px; padding: 12px; margin-top: 10px; }
.fa-qr { width: 170px; background: #fff; border-radius: 8px; padding: 6px; } .fa-qr svg { width: 100%; height: auto; display: block; }
.fa-txt { flex: 1; min-width: 220px; } .fa-txt h3 { margin-top: 0; }
.fa-ligne { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed #a6d8b5; padding: 4px 0; margin: 0; }
.fa-ligne span { color: var(--gris); } .fa-ligne b { font-size: 17px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .5px; }
.fa-note { font-size: 13px; color: #344054; }
.j-alerte td { color: var(--rouge); }
#choix-mode button, #mode button { text-align: left; }
@media (max-width: 640px) { .fa-qr { width: 140px; } #nav a span { font-size: 10px; } }

.adr-bloc > summary { font-weight: 600; cursor: pointer; padding: 4px 0; }
.adresses { list-style: none; padding: 0; margin: 4px 0; max-height: 320px; overflow: auto; font-size: 13.5px; }
.adresses li { padding: 5px 2px; border-bottom: 1px solid #eef0f3; } .adresses li[data-lat] { cursor: pointer; } .adresses li[data-lat]:hover { background: var(--bleu-c); }
.adresses small { color: var(--gris); }

.sup { border: 1px solid var(--bord); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.sup > summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-size: 14px; }
.fil-sup { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.fil-sup > div, .msg-user { border-radius: 10px; padding: 7px 10px; font-size: 14px; max-width: 92%; }
.msg-user { background: var(--bleu-c); align-self: flex-end; }
.msg-support { background: var(--vert-c); align-self: flex-start; }
.msg-systeme { background: transparent; color: var(--gris); font-size: 12.5px !important; padding: 0 !important; }
.fil-sup small { color: var(--gris); font-size: 11.5px; }
.lien-tel { min-height: 28px !important; padding: 2px 8px !important; font-size: 12px !important; border-radius: 14px; }
.choix#types button { min-width: 0; }

.aide-laser > summary { font-weight: 600; cursor: pointer; } .aide-laser ol { margin: 8px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.laser-cible { border: 2px solid var(--bleu); }
@media (max-width: 460px) { #barre .titre { font-size: 0; flex: 1; } #barre .titre::before { content: "PM"; font-size: 17px; font-weight: 800; } #nav a { padding: 4px 6px; } }

.nav-ext { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.nav-ext .bouton, .nav-ext button { display: inline-flex; align-items: center; gap: 6px; }
.ico-ext { width: 20px; height: 20px; vertical-align: -5px; margin-right: 2px; }
.bouton .ico-ext, button .ico-ext { margin-right: 4px; }
.photos-ici { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--bord); }
.photo-ici button { width: 100%; text-align: left; }
.photo-ici .requis-btn { border-color: var(--orange); background: var(--orange-c); }
.photo-ici .fait-btn { border-color: var(--vert); background: var(--vert-c); }

.demarrer-pm { border: 2px solid var(--bleu); }
.gros-btn { display: block; text-align: center; font-size: 16px; padding: 14px; }

.seg { display: inline-flex; border: 1px solid var(--bord); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; border-radius: 0; min-height: 40px; padding: 8px 14px; font-weight: 600; color: var(--gris); background: #fff; border-right: 1px solid var(--bord); }
.seg button:last-child { border-right: 0; }
.seg button.actif { background: var(--c); color: #fff; }
.seg.mini button { min-height: 30px; padding: 4px 9px; font-size: 12px; }
.ligne-pm { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ligne-pm > a { flex: 1; min-width: 200px; }
.ligne-pm > div { padding-bottom: 6px; }
.lien-discret { border: 0; background: none; color: var(--gris); text-decoration: underline; font-size: 13px; min-height: 0; padding: 4px; }

.bandeau-fini { font-size: 15px; } .liste-complete { color: inherit; font-size: 14px; margin: 4px 2px 8px; gap: 8px; align-items: flex-start; flex-wrap: nowrap; } .liste-complete small { color: var(--gris); }
