/* Carte — pictogrammes, fenêtres d'information, outils, impression (v3.27.9). Aucun style en ligne n'est nécessaire. */
.picto-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.pc-halo { fill: none; stroke: #0f172a; stroke-width: 5; stroke-linejoin: round; opacity: .5; }
.pc-forme { fill: currentColor; stroke: #fff; stroke-width: 2.2; stroke-linejoin: round; }
.pc-gs { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pc-gf { fill: #fff; stroke: none; }
.picto { display: block; width: 32px; height: 32px; margin: 0 auto; overflow: visible; }
.picto-repere { background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.picto-repere:focus-visible { outline: 3px solid #f59e0b; outline-offset: 1px; border-radius: 8px; }
.pz-bas .picto-repere .picto { width: 20px; height: 20px; }
.pz-moy .picto-repere .picto { width: 26px; height: 26px; }
.pz-haut .picto-repere .picto { width: 32px; height: 32px; }
.picto-repere.picto-sel .picto { transform: scale(1.28); filter: drop-shadow(0 0 5px #f59e0b); }
.picto-masque { display: none !important; }
.picto.pc-leg { width: 26px; height: 26px; flex: 0 0 26px; margin: 0; }
/* couleurs : une classe par type ou variante (forme + couleur, jamais la couleur seule) */
.pc-c-pcc { color: #b91c1c; } .pc-c-gendarmerie { color: #1e3a8a; } .pc-c-pei { color: #1d4ed8; }
.pc-c-pei-ok { color: #15803d; } .pc-c-pei-warn { color: #b45309; } .pc-c-pei-ko { color: #b91c1c; } .pc-c-pei-nr { color: #7c3aed; }
.pc-c-erp { color: #1d4ed8; } .pc-c-erp-sante { color: #6d28d9; } .pc-c-erp-service { color: #0f766e; } .pc-c-erp-commerce { color: #a16207; }
.pc-c-care { color: #15803d; } .pc-c-care-exclu { color: #b91c1c; }
.pc-c-rassemblement { color: #0e7490; } .pc-c-barrage { color: #1d4ed8; } .pc-c-tmd { color: #c2410c; }
.pc-c-secteur { color: #00677d; } .pc-c-batiment { color: #475569; } .pc-c-icpe { color: #7e22ce; } .pc-c-casias { color: #64748b; }
.picto-grappe { background: none; border: 0; }
.grappe { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: currentColor; border: 3px solid #fff; box-shadow: 0 0 0 2px #0f172a80; }
.grappe { color: #1d4ed8; font: 700 13px/1 system-ui, sans-serif; }
.grappe.pc-c-batiment { color: #475569; }
.grappe { -webkit-text-fill-color: #fff; }
.legende-liste { list-style: none; margin: 4px 0 8px; padding: 0; }
.legende-liste li { display: flex; align-items: center; gap: 8px; padding: 2px 0; font-size: 11.5px; }
.legende-liste em { color: #64748b; font-style: normal; }
/* fenêtre d'information */
.pc-leaflet-popup .leaflet-popup-content { margin: 10px 12px; min-width: 230px; }
.pc-popup { outline: none; font-size: 13px; line-height: 1.4; color: #1e293b; }
.pc-tete { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 6px; }
.pc-ico .picto { width: 30px; height: 30px; }
.pc-titre { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-titre strong { font-size: 14px; overflow-wrap: anywhere; }
.pc-badge { align-self: flex-start; background: #e0f2fe; color: #0c4a6e; border: 1px solid #7dd3fc; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 700; }
.pc-alerte { display: flex; gap: 6px; align-items: flex-start; margin: 4px 0; padding: 5px 7px; border-radius: 6px; font-size: 12px; border-left: 4px solid; }
.pc-alerte-danger { background: #fef2f2; color: #7f1d1d; border-color: #b91c1c; }
.pc-alerte-ok { background: #f0fdf4; color: #14532d; border-color: #15803d; }
.pc-alerte-ico svg { width: 16px; height: 16px; display: block; flex: 0 0 16px; }
.pc-alerte-danger .pc-alerte-ico { color: #b91c1c; } .pc-alerte-ok .pc-alerte-ico { color: #15803d; }
.pc-champs { margin: 4px 0; display: grid; grid-template-columns: max-content 1fr; gap: 2px 8px; }
.pc-champs dt { font-weight: 700; color: #334155; } .pc-champs dd { margin: 0; overflow-wrap: anywhere; } .pc-champs dd.pc-sans-cle { grid-column: 1 / -1; }
.pc-voir { border: 0; background: none; color: #1f4e79; font-weight: 700; text-decoration: underline; padding: 6px 0; min-height: 32px; cursor: pointer; }
.pc-plus { margin: 2px 0 4px; max-height: 160px; overflow: auto; } .pc-plus[hidden] { display: none; }
.pc-plus-ligne { margin: 2px 0; font-size: 12px; }
.pc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-btn { flex: 1 1 auto; min-height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border: 1.5px solid #1f4e79; border-radius: 7px; background: #fff; color: #1f4e79; font: 700 12.5px/1.1 system-ui, sans-serif; text-decoration: none; cursor: pointer; }
.pc-btn:hover, .pc-btn:focus-visible { background: #1f4e79; color: #fff; outline: 2px solid #f59e0b; outline-offset: 1px; }
.pc-lien { display: block; margin-top: 6px; color: #1f4e79; font-weight: 700; }
.pc-cache-copie { position: fixed; left: -9999px; top: 0; }
.pc-popup-cache { display: none !important; }
/* feuille basse (téléphone) */
.pc-feuille { position: fixed; left: 8px; right: 8px; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 1040; max-height: min(52dvh, calc(100dvh - 150px)); background: #fff; border-radius: 14px 14px 10px 10px; box-shadow: 0 -4px 22px rgba(15,23,42,.35); border: 1px solid #cbd5e1; display: flex; flex-direction: column; }
.pc-feuille[hidden] { display: none; }
.pc-poignee { width: 44px; height: 5px; border-radius: 3px; background: #94a3b8; margin: 7px auto 2px; flex: 0 0 auto; }
.pc-fermer { position: absolute; top: 6px; right: 6px; min-width: 48px; min-height: 48px; border: 1.5px solid #475569; border-radius: 10px; background: #fff; color: #1e293b; font: 700 13px/1 system-ui, sans-serif; z-index: 2; }
.pc-feuille-corps { overflow: auto; padding: 4px 62px 12px 12px; -webkit-overflow-scrolling: touch; }
.pc-feuille .pc-btn { min-height: 48px; font-size: 13.5px; }
.pc-feuille .pc-voir { min-height: 48px; }
/* échelle et nord */
.leaflet-control-scale-line { font-weight: 700; color: #0f172a; background: rgba(255,255,255,.88); border-color: #0f172a; }
.pc-nord { background: rgba(255,255,255,.88); border: 1px solid #94a3b8; border-radius: 6px; padding: 2px 4px; line-height: 0; }
.nord-fl { fill: #fff; stroke: #0f172a; stroke-width: 2; stroke-linejoin: round; } .nord-fl2 { fill: #0f172a; } .nord-n { font: 700 11px system-ui, sans-serif; fill: #0f172a; }
/* panneau d'outils */
#panel-outils { top: 102px; left: 10px; width: clamp(290px, 27vw, 380px); max-height: calc(100dvh - 116px); }
#panel-outils .panel-body { padding-bottom: 14px; }
.ou-sec { border-bottom: 1px solid #e2e8f0; padding: 6px 0 9px; } .ou-sec:last-child { border-bottom: 0; }
.ou-sec h3 { margin: 0 0 5px; font-size: 12px; color: #1f4e79; text-transform: uppercase; letter-spacing: .03em; }
.ou-ligne { display: flex; align-items: center; gap: 6px; margin: 3px 0; flex-wrap: wrap; }
.ou-lib { flex: 0 0 74px; font-weight: 700; color: #334155; } .ou-ligne output { flex: 1 1 140px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ou-btn { min-height: 34px; padding: 5px 10px; border: 1.5px solid #1f4e79; border-radius: 7px; background: #fff; color: #1f4e79; font: 700 12px/1.1 system-ui, sans-serif; cursor: pointer; }
.ou-btn:hover, .ou-btn:focus-visible { background: #e0f2fe; outline: 2px solid #f59e0b; outline-offset: 1px; }
.ou-fort { background: #1f4e79; color: #fff; } .ou-fort:hover { background: #00677d; }
.ou-pet { min-height: 28px; padding: 3px 7px; font-size: 11px; } .ou-on { background: #1f4e79; color: #fff; }
.ou-etiq { font-size: 11.5px; color: #475569; margin: 2px 0; } .ou-nom { font-weight: 700; margin: 0 0 4px; }
.ou-res, .ou-msg, .ou-pcc { margin: 4px 0; font-weight: 600; } .ou-err { color: #b91c1c; }
#ou-saisie { flex: 1 1 160px; min-height: 36px; border: 1.5px solid #94a3b8; border-radius: 6px; padding: 4px 8px; font-size: 14px; }
.ou-court { width: 70px; min-height: 32px; } .ou-coche { display: flex; gap: 6px; align-items: center; margin: 4px 0; font-weight: 600; }
.ou-tab { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 6px; } .ou-tab th, .ou-tab td { border: 1px solid #cbd5e1; padding: 3px 5px; text-align: left; vertical-align: top; } .ou-tab th { background: #f1f5f9; }
.ou-choix { white-space: normal; } .ou-choix .ou-btn { margin: 1px 2px 1px 0; }
.pc-mesure { stroke: #be185d; fill: #be185d; fill-opacity: .12; } .pc-mesure-pt { stroke: #fff; fill: #be185d; fill-opacity: 1; }
.pc-mesurant { cursor: crosshair; } .pc-cible { stroke: #be185d; fill: none; }
.pc-prop-pt { stroke: #be185d; fill: #be185d; } .pc-prop-lien { stroke: #be185d; } .pc-prop-trace { stroke: #be185d; fill: none; }
@media (max-width: 900px) {
  html, body { overflow-x: hidden; max-width: 100%; }
  #header .badge { white-space: normal; flex-shrink: 1; min-width: 0; max-width: 100%; }
  #panel-outils { top: auto !important; left: 8px !important; right: 8px !important; bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; max-height: 58dvh !important; border-radius: 12px; }
  .pc-leaflet-popup { display: none; }
  .pc-btn, .ou-btn { min-height: 44px; } #ou-saisie { min-height: 44px; font-size: 16px; }
  body.pc-feuille-ouverte #ui-toolbar { z-index: 1030; }
}
#pc-impr-tete { display: none; }
/* impression A4 / A3 paysage : en-tête opérationnel commun, carte, échelle et nord */
@page a4 { size: A4 landscape; margin: 8mm; }
@page a3 { size: A3 landscape; margin: 8mm; }
@media print {
  body.imp-a4 { page: a4; } body.imp-a3 { page: a3; }
  body.pc-impression { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.pc-impression #header, body.pc-impression .bandeau-travail, body.pc-impression #ui-toolbar, body.pc-impression .btn-plein-ecran, body.pc-impression #basemap-bar,
  body.pc-impression .floating-panel, body.pc-impression .pc-feuille, body.pc-impression .leaflet-control-zoom, body.pc-impression #fond-etat { display: none !important; }
  body.pc-impression #pc-impr-tete { display: block; }
  body.pc-impression #map { position: relative !important; top: 0 !important; left: 0 !important; width: 100% !important; }
  body.imp-a4 #map { height: 156mm !important; } body.imp-a3 #map { height: 240mm !important; }
  body.pc-impression .pc-impr-repli { display: flex; gap: 10px; align-items: center; font-weight: 700; margin-bottom: 4px; }
  body.pc-impression .pc-impr-titre { margin: 2px 0 4px; font-size: 11px; }
}
.pc-feuille .pc-actions { display: grid; grid-template-columns: 1fr 1fr; }

/* ---- v3.27.11 : Contrôle des cartes ---- */
#panel-controle { top: 102px; left: 10px; width: clamp(340px, 40vw, 600px); max-height: calc(100dvh - 116px); z-index: 1200; }
#panel-controle .panel-body { padding-bottom: 14px; }
.cc-qui { flex: 1 1 200px; min-height: 36px; padding: 4px 8px; border: 1.5px solid #64748b; border-radius: 6px; font: inherit; }
.cc-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-weight: 700; font-size: 11px; white-space: nowrap; border: 1.5px solid; }
.cc-ok { background: #dcfce7; color: #14532d; border-color: #166534; } .cc-mineur { background: #fef3c7; color: #78350f; border-color: #b45309; } .cc-majeur { background: #fee2e2; color: #7f1d1d; border-color: #b91c1c; }
.cc-etat { font-weight: 700; white-space: nowrap; } .cc-e-accepte { color: #14532d; } .cc-e-refuse { color: #7f1d1d; } .cc-e-attente { color: #475569; }
.cc-groupe td { background: #eaf2fb; } .cc-groupe .ou-btn { margin-left: 6px; }
.cc-tab td, .cc-tab th { font-size: 11px; }
.cc-confirm { margin-top: 6px; padding: 8px; border: 2px solid #b45309; border-radius: 8px; background: #fffbeb; }
.cc-liste { margin: 3px 0 6px; padding-left: 18px; font-size: 11.5px; } .cc-apercu { color: #92400e; }
#cc-fond-apercu { z-index: 2500; } #cc-fond-apercu .ou-ligne { padding: 0 4px; }
@media (max-width: 900px) {
  #panel-controle { top: auto !important; left: 8px !important; right: 8px !important; bottom: calc(60px + env(safe-area-inset-bottom, 0px)) !important; width: auto !important; max-height: 64dvh !important; border-radius: 12px; }
}
@media print { #panel-controle, #cc-fond-apercu { display: none !important; } }

/* ---- v3.27.11 : téléphone en PAYSAGE (hauteur ≤ 520 px) — la carte garde toute la hauteur ----
   Titre sur UNE ligne de 26 px, avertissement « carte de travail » sur une ligne, barre d'outils en bande défilante (boutons ≥ 44 px),
   encadrés et feuilles bornés à 80 % de l'écran. Bureau et portrait inchangés. */
@media (orientation: landscape) and (max-height: 520px) {
  #header { min-height: 26px; height: 26px; padding: 0 max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)); gap: 6px; flex-wrap: nowrap; }
  #header .commune-blason { width: 20px; height: 22px; }
  #header .sub { display: none; }
  #header h1 { font-size: 12px; }
  #header .badge { font-size: 10px; padding: 1px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48%; min-width: 0; }
  #map { top: 26px; }
  body.fullscreen-map #map { top: 0 !important; }
  .bandeau-travail { position: absolute; top: 26px; left: 0; right: 0; z-index: 1004; margin: 0; padding: 1px 8px; font-size: 10px; line-height: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .96; }
  .leaflet-top { margin-top: 16px; }
  body.fullscreen-map .leaflet-top { margin-top: 0; }
  .leaflet-bottom.leaflet-right, .leaflet-bottom.leaflet-left { margin-bottom: 58px; }
  #ui-toolbar { top: auto !important; bottom: calc(4px + env(safe-area-inset-bottom, 0px)) !important; left: 8px; right: 8px; transform: none; max-width: none; justify-content: flex-start; padding: 4px 6px; border-radius: 14px; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
  .tb-btn { flex: 0 0 auto; min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 12px; }
  #basemap-bar { top: 46px !important; right: 8px; left: auto; padding: 2px 5px; }
  #basemap-select { min-height: 32px; }
  #panel-layers, #panel-legend, #panel-info, #panel-outils, #panel-controle { top: 44px !important; bottom: 62px !important; left: 8px !important; right: auto !important; width: min(400px, 58vw) !important; max-height: min(80dvh, calc(100dvh - 106px)) !important; border-radius: 12px; }
  .pc-feuille { left: 8px; right: auto; width: min(480px, 62vw); bottom: calc(60px + env(safe-area-inset-bottom, 0px)); max-height: min(80dvh, calc(100dvh - 96px)); }
  .leaflet-popup-content { max-height: min(60dvh, 220px); overflow-y: auto; }
  .pc-nord { transform: scale(.7); transform-origin: top left; margin-top: 2px !important; }
}

.cc-tab { table-layout: auto; } .cc-objet { min-width: 120px; } .cc-sous { font-size: 10.5px; color: #475569; margin-top: 2px; } .cc-tab .ou-choix { min-width: 130px; }

/* ---- v3.27.12 : bouton « Plein écran » flottant, hors de la barre d'outils défilante ----
   Toujours dans l'écran et ≥ 44 px, en bureau, portrait et paysage (la barre défilante le poussait hors de l'écran). */
.btn-plein-ecran { position: absolute; z-index: 1025; right: 10px; top: 104px; width: 48px; height: 48px; min-width: 44px; min-height: 44px; padding: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: #fff; cursor: pointer;
  background: rgba(15, 23, 42, 0.88); border: 1px solid rgba(255,255,255,0.28); border-radius: 12px; box-shadow: 0 3px 12px rgba(0,0,0,0.3); }
.btn-plein-ecran.active { background: var(--bleu, #1d4ed8); }
.btn-plein-ecran:focus-visible { outline: 3px solid #fde047; outline-offset: 2px; }
body.fullscreen-map .btn-plein-ecran { top: 56px; }
@media (max-width: 700px) and (orientation: portrait) { .btn-plein-ecran { top: 104px; right: 8px; } body.fullscreen-map .btn-plein-ecran { top: 54px; } }
@media (orientation: landscape) and (max-height: 520px) { .btn-plein-ecran { top: 92px; right: 8px; } body.fullscreen-map .btn-plein-ecran { top: 92px; } }

/* v3.28.2 : en plein écran, le titre du fond de secours passe sous le bouton « Quitter » de la coquille */
body.fullscreen-map .fond-secours-titre { margin-top: 56px; }
.btn-plein-ecran { z-index: 2100; }   /* v3.28.2 : le bouton reste cliquable au-dessus du fond de secours hors ligne (z-index 2000) */
.pc-hors-ligne { flex: 1 1 100%; grid-column: 1 / -1; margin: 2px 0 0; padding: 4px 8px; font-size: 12px; line-height: 1.3; color: #7A2E00; background: #FFF7D6; border-radius: 6px; }   /* v3.28.2 */
.pc-hors-ligne[hidden] { display: none; }
