/* Styles FONCTIONNELS du mode connecté (connexion, points clés, mode suivi, alerte). Fichier « soft » : mise en page et lisibilité de base.
   Le graphisme peut tout restyler depuis style.css (chargé après ce fichier, donc prioritaire). Classes documentées dans README.md. */
#toast { z-index: 40; }

/* Bouton de connexion + menu */
#auth { position: absolute; z-index: 5; left: 10px; top: calc(96px + var(--safe-t, 0px)); }
.auth-btn { font: 700 12px "Quicksand", sans-serif; color: #04222C; background: #fff; border: 2px solid transparent; border-radius: 10px; padding: 7px 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,.3); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.auth-btn.on { border-color: #00BBCC; }
.auth-btn.expired { border-color: #E53935; }
.auth-badge { background: #FF9D03; color: #04222C; border-radius: 999px; min-width: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; text-align: center; }
.auth-badge.warn { background: #E53935; color: #fff; }
.auth-menu { margin-top: 6px; background: #fff; border-radius: 12px; padding: 12px; width: 230px; box-shadow: 0 6px 20px rgba(0,0,0,.35); display: flex; flex-direction: column; gap: 8px; }
.auth-who { display: flex; flex-direction: column; color: #04222C; }
.auth-who small, .auth-note { color: #6b7780; font-size: 12px; margin: 0; }

/* Fenêtres */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(4,34,44,.72); display: flex; align-items: center; justify-content: center; padding: 14px; overflow-y: auto; }
.modal.hidden { display: none; }
.modal.sheetlike { align-items: flex-end; padding: 0; }
.modal-box { background: #fff; color: #383838; border-radius: 16px; padding: 18px; width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; font: 500 14px "Quicksand", system-ui, sans-serif; }
.sheetlike .modal-box { border-radius: 18px 18px 0 0; padding-bottom: calc(18px + var(--safe-b, 0px)); max-width: 520px; }
.modal-box h2 { margin: 0 0 6px; font-size: 20px; color: #04222C; }
.modal-sub { margin: 0 0 10px; color: #6b7780; }
.modal-msg { background: #FFF4DC; border-left: 4px solid #FF9D03; padding: 8px 10px; border-radius: 6px; margin: 0 0 10px; }
.modal-box label { display: block; font-weight: 700; font-size: 13px; color: #00838F; margin: 10px 0 0; }
.modal-box input:not([type=checkbox]), .modal-box textarea { display: block; width: 100%; margin-top: 4px; font: 500 16px "Quicksand", system-ui, sans-serif; color: #383838; padding: 10px; border: 1.5px solid #cfd8dc; border-radius: 10px; }
.modal-box textarea { min-height: 70px; resize: vertical; }
.modal-box label.check { display: flex; gap: 8px; align-items: center; font-weight: 500; color: #383838; }
.modal-err { color: #b71c1c; font-weight: 700; min-height: 1em; margin-top: 8px; }
.modal-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.modal-actions .tbtn { flex: 1 1 auto; }
.tbtn { display: inline-block; text-align: center; text-decoration: none; font: 700 14px "Quicksand", sans-serif; padding: 11px 14px; border-radius: 12px; border: 0; cursor: pointer; background: #eef2f3; color: #04222C; }
.tbtn.primary { background: #FF9D03; color: #04222C; }
.tbtn.ghost { background: #E7F7F9; color: #00838F; }
.tbtn.danger { background: #E53935; color: #fff; }
.tbtn.big { display: block; width: 100%; font-size: 18px; padding: 16px; }
.tbtn:disabled { opacity: .5; }

/* Points clés : liste dans la fiche */
.wps { margin: 12px 0; }
.wps h3 { margin: 0 0 6px; font-size: 15px; color: #04222C; }
.wp-list { list-style: none; margin: 0; padding: 0; }
.wp-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid #eef2f3; }
.wp-item.flash { background: #FFF4DC; }
.wp-item.pending { opacity: .85; }
.wp-txt { flex: 1; font-size: 14px; }
.wp-txt small { display: block; color: #6b7780; font-size: 12px; }
.wp-flag { color: #b26a00; font-size: 11px; font-style: normal; font-weight: 700; }
.wp-edit { font: 700 12px "Quicksand", sans-serif; background: #E7F7F9; color: #00838F; border: 0; border-radius: 8px; padding: 6px 9px; cursor: pointer; }
.wp-ico { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: #04222C; color: #fff; border: 2px solid #FF9D03; font: 700 13px/22px "Quicksand", sans-serif; text-align: center; display: inline-block; }
.wps-actions .btn, .fiche-extra .btn { margin-top: 8px; }
.fiche-extra { margin-top: 4px; }
#sheet .badge.priv { background: #04222C; }

/* Points clés : marqueurs sur la carte */
.wp { width: 26px; height: 26px; border-radius: 50%; background: #04222C; color: #fff; border: 2px solid #FF9D03; font: 700 13px/22px "Quicksand", sans-serif; text-align: center; cursor: pointer; box-shadow: 0 2px 5px rgba(0,0,0,.45); }
.wp.pending { border-style: dashed; opacity: .85; }
.wp.edit { background: #FF9D03; color: #04222C; border-color: #fff; }
.wp-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.wp-type { display: flex; flex-direction: column; align-items: center; gap: 4px; font: 700 12px "Quicksand", sans-serif; color: #04222C; background: #eef2f3; border: 2px solid transparent; border-radius: 12px; padding: 8px 4px; cursor: pointer; }
.wp-type[aria-checked="true"] { border-color: #FF9D03; background: #FFF4DC; }
.wp-pos { margin-top: 12px; }
.wp-pos-txt { font-weight: 700; color: #04222C; margin-bottom: 6px; }
.wp-pos-btns { display: flex; gap: 8px; }
.wp-pos-btns .tbtn { flex: 1; }
.pick-bar { position: fixed; z-index: 21; left: 12px; right: 12px; bottom: calc(14px + var(--safe-b, 0px)); background: #04222C; color: #fff; border-radius: 14px; padding: 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; font-weight: 700; }

/* Mode suivi */
body.following #top, body.following #basemaps, body.following #sheet, body.following #auth { display: none; }
.follow { position: fixed; inset: 0; z-index: 12; pointer-events: none; font: 500 14px "Quicksand", system-ui, sans-serif; }
.follow > * { pointer-events: auto; }
.follow-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(10px + var(--safe-t, 0px)) 12px 12px; background: rgba(4,34,44,.93); color: #fff; display: flex; flex-direction: column; gap: 6px; }
.follow-title { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.follow-name { font-size: 17px; }
.follow-phase { color: #FF9D03; font-weight: 700; }
.follow-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,.2); overflow: hidden; }
.follow-bar-fill { display: block; height: 100%; width: 0; background: #00BBCC; transition: width .5s; }
.follow-stats { display: flex; justify-content: space-between; font-weight: 700; }
.follow-next { display: flex; gap: 10px; align-items: center; min-height: 28px; }
.follow-next small { display: block; color: #bfe9ee; }
.follow-gps { font-size: 12px; color: #bfe9ee; }
.follow-gps.bad { color: #FFB74D; }
.follow-warn { background: #E53935; color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 700; }
.follow-warn.ok { background: #2FA84F; }
.follow-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 12px calc(14px + var(--safe-b, 0px)); display: flex; gap: 10px; align-items: flex-end; justify-content: space-between; }
.follow-alert { position: relative; width: 104px; height: 104px; border-radius: 50%; border: 4px solid #fff; background: #E53935; color: #fff; font: 700 16px "Quicksand", sans-serif; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 4px 14px rgba(0,0,0,.5); touch-action: none; user-select: none; -webkit-user-select: none; }
.follow-alert small { font-size: 10px; font-weight: 500; }
.follow-alert.pressing { transform: scale(.96); }
.follow-alert-ring { position: absolute; inset: -8px; border-radius: 50%; background: conic-gradient(#FF9D03 calc(var(--p, 0) * 360deg), transparent 0); -webkit-mask: radial-gradient(circle, transparent 54px, #000 55px); mask: radial-gradient(circle, transparent 54px, #000 55px); pointer-events: none; }
.follow-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px; margin-left: auto; max-width: calc(100% - 118px); }
.follow-add { font: 700 14px "Quicksand", sans-serif; background: #fff; color: #04222C; border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.4); display: inline-flex; align-items: center; gap: 6px; }
.follow-add-ico { font-style: normal; font-size: 18px; line-height: 1; }
.follow-stop, .follow-recenter { font: 700 14px "Quicksand", sans-serif; background: #fff; color: #04222C; border: 0; border-radius: 12px; padding: 12px 14px; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.follow-recenter { background: #FF9D03; }
.me-dot { width: 22px; height: 22px; border-radius: 50%; background: #1E88E5; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(30,136,229,.28), 0 2px 6px rgba(0,0,0,.5); position: relative; }
.me-arrow { display: none; position: absolute; left: 50%; top: -12px; margin-left: -6px; border: 6px solid transparent; border-bottom: 10px solid #1E88E5; transform-origin: 50% 23px; }
.me-arrow.on { display: block; }

/* Alerte */
.alert-modal { z-index: 30; }
.alert-modal .modal-box { border-top: 8px solid #E53935; }
.al-coords { background: #FDE8E8; border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.al-coords b { font-size: 20px; color: #04222C; user-select: all; }
.al-coords small { color: #6b7780; }
.al-site { margin: 8px 0; font-weight: 700; color: #04222C; }
.al-ch { margin: 10px 0; }
.al-hint { margin: 6px 0 0; font-size: 12px; color: #6b7780; }
.al-status { margin: 6px 0 0; font-weight: 700; font-size: 13px; }
.al-status.ok { color: #1c8a4a; } .al-status.wait { color: #b26a00; } .al-status.err { color: #b71c1c; }
.al-contacts { display: flex; flex-direction: column; gap: 6px; }
.al-contact { display: flex; gap: 8px; align-items: center; }
.al-contact span { flex: 1; font-weight: 700; }

/* Mode suivi : rendu allégé (écran allumé pendant des heures sur des téléphones Android modestes).
   Pas de flou d'arrière-plan sur la carte WebGL ni d'animation permanente. */
body.following .follow-top, body.following .follow-bottom, body.following .modal, body.following .pick-bar, body.following .follow-warn { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
body.following .follow *, body.following .follow-alert { animation: none !important; }
body.following .maplibregl-ctrl-geolocate { display: none; }
.diag-pre { background: #F2F6F7; color: #04222C; border-radius: 10px; padding: 10px; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-word; max-height: 50vh; overflow: auto; margin: 8px 0 12px; user-select: text; }

/* Fiche réduite en bulle (v8) — soft : comportement et mise en page de base ; le graphisme peut tout redéfinir dans style.css (sélecteurs à 2 id pour passer devant les règles de #sheet). */
#sheet.open #sheet-body { max-height: min(40vh, 340px); }          /* fiche moins haute : le tracé reste visible au-dessus */
#sheet #shrink { position: absolute; top: 10px; right: 52px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: #eef2f3; font-size: 18px; line-height: 1; cursor: pointer; color: var(--navy, #04222C); }
#sheet #sheet-body h2 { padding-right: 78px; }
#sheet .grab { position: relative; cursor: pointer; }
#sheet .grab::before { content: ""; position: absolute; left: -40px; right: -40px; top: -14px; bottom: -14px; }   /* zone de tap plus large que la poignée */
#bubble { position: absolute; z-index: 7; left: 50%; top: calc(10px + var(--safe-t, 0px)); transform: translate(-50%, -160%); opacity: 0; pointer-events: none;
          transition: transform .22s ease, opacity .22s; display: flex; align-items: stretch; max-width: calc(100% - 24px); background: #fff; border-radius: 999px;
          box-shadow: 0 4px 16px rgba(0,0,0,.35); overflow: hidden; }
#bubble.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#bubble button { border: 0; background: none; font: 700 15px "Quicksand", system-ui, sans-serif; color: var(--navy, #04222C); cursor: pointer; }
#bubble-open { display: flex; align-items: center; gap: 8px; padding: 10px 6px 10px 14px; min-width: 0; }
#bubble .bb-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
#bubble .bb-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#bubble .bb-chev { flex: 0 0 auto; opacity: .55; font-size: 14px; }
#bubble-close { padding: 0 14px 0 8px; font-size: 20px; opacity: .6; }
body.fiche-mini #top { display: none; }                            /* bulle en haut : on libère la barre de filtres */
body.following #bubble { display: none; }

/* ---- Photos des points clés (v10) — styles fonctionnels, surchargeables par le graphisme ---- */
.wp-ph { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.wp-ph-btn { padding: 0; border: 0; background: #dfe8ea; border-radius: 10px; overflow: hidden; width: 64px; height: 64px; cursor: pointer; flex: 0 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.wp-ph-btn img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wp-ph-btn:active { transform: scale(.96); }
.wp.has-ph::after { content: ""; position: absolute; right: -4px; top: -4px; width: 12px; height: 12px; border-radius: 50%; background: #FF9D03; border: 2px solid #fff; box-sizing: border-box; }
body.lb-open { overflow: hidden; }
#lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(2,14,18,.94); display: none; align-items: center; justify-content: center; padding: calc(14px + var(--safe-t, 0px)) 10px calc(14px + var(--safe-b, 0px)); touch-action: pan-y; }
#lightbox.show { display: flex; }
#lightbox figure { margin: 0; max-width: 100%; max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
#lightbox .lb-img { max-width: 100%; max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); object-fit: contain; border-radius: 10px; background: #000; }
#lightbox figcaption { color: #fff; font: 500 14px "Quicksand", system-ui, sans-serif; text-align: center; display: flex; flex-direction: column; gap: 2px; max-width: 560px; }
#lightbox .lb-title { font-weight: 700; font-size: 15px; }
#lightbox .lb-note { opacity: .85; }
#lightbox .lb-count { opacity: .6; font-size: 12px; }
#lightbox .lb-close, #lightbox .lb-prev, #lightbox .lb-next { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; font: 400 28px/1 system-ui, sans-serif; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; }
#lightbox .lb-close { top: calc(10px + var(--safe-t, 0px)); right: 10px; font-size: 30px; }
#lightbox .lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
#lightbox .lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
#lightbox.single .lb-prev, #lightbox.single .lb-next { display: none; }
/* éditeur : photos du point clé */
.wp-photos { margin-top: 12px; }
.wp-photos-txt { font-weight: 700; color: #04222C; margin-bottom: 6px; }
.wp-photos-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wp-photo { position: relative; width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: #dfe8ea; }
.wp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wp-photo button { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(4,34,44,.85); color: #fff; font: 700 15px/1 system-ui; cursor: pointer; padding: 0; }
.wp-photo.busy::after { content: "…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.7); font: 700 22px system-ui; }
.follow-next .wp-ph-btn { width: 44px; height: 44px; margin-left: auto; }
.wp-photo.local { outline: 2px dashed #FF9D03; outline-offset: -2px; }
/* ---- Boutons Siflo (v11) — styles fonctionnels, surchargeables par le graphisme ---- */
/* Couleurs de Siflo : #D45400 = orange de Siflo assombri pour rester lisible au soleil (demande de Siflo). */
#sheet .siflo { --siflo-orange: #D45400; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #9BB8C0; }
#sheet .siflo .btn { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 6px; border-radius: 10px; box-sizing: border-box; font-size: 13px; line-height: 1.25; }
#sheet .siflo .siflo-create { background: var(--siflo-orange); color: #fff; border: 2px solid var(--siflo-orange); }
#sheet .siflo .siflo-join { background: #fff; color: var(--siflo-orange); border: 2px solid var(--siflo-orange); }
#sheet .siflo .btn:focus-visible { outline: 2px solid var(--siflo-orange); outline-offset: 2px; }
#sheet .siflo p { grid-column: 1 / -1; margin: 2px 0 0; font-size: 11.5px; line-height: 1.4; opacity: .8; }

/* ---- Aide (?) et menu des filtres mobile (v12) — styles fonctionnels, surchargeables par le graphisme ----
   Sélecteurs volontairement plus spécifiques (#top …, body #…) car style.css est chargé après terrain.css. */
#top .bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
#top .bar h1 { margin: 0; flex: 1 1 auto; min-width: 0; }
#top .bar h1 i { flex: 0 0 auto; }
#top .bar h1 .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { position: relative; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-radius: 50%; cursor: pointer; color: #fff;
            border: 1.5px solid rgba(255,255,255,.3); background: rgba(255,255,255,.14); font: 700 20px "Quicksand", sans-serif;
            display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:focus-visible, #chips .chip:focus-visible, .linkbtn:focus-visible, #help a:focus-visible, #help button:focus-visible { outline: 2px solid #FF9D03; outline-offset: 2px; }
.icon-btn[aria-expanded="true"] { background: rgba(0,187,204,.35); border-color: #00BBCC; }
#filter-btn { display: none; }
#filter-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
                background: #FF9D03; color: #04222C; font: 700 11px/18px "Quicksand", sans-serif; text-align: center; }
#filter-badge:empty { display: none; }

#help { border: 0; padding: 0; margin: auto; width: 100%; max-width: 640px; height: 100%; height: 100dvh; max-height: 100%; background: #fff;
        color: #383838; overflow: hidden; font-family: "Quicksand", system-ui, sans-serif; }
#help[open] { display: flex; flex-direction: column; }
#help::backdrop { background: rgba(4,34,44,.65); }
.help-head { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: calc(12px + var(--safe-t, 0px)) 16px 12px 18px; background: #04222C; color: #fff; }
.help-head h2 { margin: 0; flex: 1; font-size: 19px; font-weight: 700; }
.help-head .x { width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.16); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.help-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px calc(28px + var(--safe-b, 0px)); font-size: 15px; line-height: 1.5; }
.help-body h3 { scroll-margin-top: 10px; margin: 26px 0 8px; font-size: 17px; font-weight: 700; color: #04222C; }
.help-body .urgence + h3 { margin-top: 20px; }
.help-body p { margin: 0 0 10px; }
.help-body ul { margin: 0 0 10px; padding-left: 20px; }
.help-body li { margin-bottom: 6px; }
.help-body .small { font-size: 13px; color: #6b7780; }
.help-body .warn { background: #FFF4DC; border-left: 4px solid #FF9D03; padding: 9px 11px; border-radius: 6px; font-size: 14px; margin: 12px 0; }
.help-body a { color: #00838F; font-weight: 700; }
.urgence { background: #FDE8E8; border-left: 4px solid #E53935; border-radius: 8px; padding: 12px; }
.urgence > b { color: #8f1d1b; }
.calls { display: flex; gap: 8px; margin: 10px 0 8px; }
.help-body a.call { flex: 1 1 0; text-align: center; text-decoration: none; background: #E53935; color: #fff; font: 700 20px/1.1 "Quicksand", sans-serif; padding: 10px 6px; border-radius: 12px; }
.call small { display: block; margin-top: 3px; font-weight: 500; font-size: 11px; opacity: .92; }
.linkbtn { background: none; border: 0; padding: 2px 0; color: #00838F; font: 700 14px "Quicksand", sans-serif; text-decoration: underline; cursor: pointer; }
ol.steps { list-style: none; counter-reset: s; margin: 10px 0; padding: 0; }
ol.steps > li { counter-increment: s; position: relative; padding: 0 0 12px 40px; margin: 0; }
ol.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #04222C; color: #fff; font-weight: 700; text-align: center; line-height: 28px; }
ol.steps.sos > li::before { background: #E53935; }
ol.steps > li > b { display: block; color: #04222C; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; margin: 8px 0 2px; font-size: 14px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.pos { background: #E7F7F9; border-radius: 12px; padding: 12px; margin: 6px 0 10px; }
.pos > b { display: block; color: #04222C; margin-bottom: 8px; }
#pos-btn { width: 100%; background: #FF9D03; color: #04222C; border: 0; border-radius: 12px; padding: 12px; font: 700 15px "Quicksand", sans-serif; cursor: pointer; }
#pos-out { margin-top: 10px; }
#pos-out .big { font-size: 18px; font-weight: 700; color: #04222C; line-height: 1.35; }
#pos-out .info { font-size: 13px; color: #5b666d; margin: 4px 0 8px; }
#pos-out button { background: #fff; color: #00838F; border: 1.5px solid #00BBCC; border-radius: 10px; padding: 8px 12px; font: 700 13px "Quicksand", sans-serif; cursor: pointer; }
@media (min-width: 641px) { #help { height: min(88vh, 860px); border-radius: 18px; box-shadow: 0 12px 40px rgba(0,0,0,.45); } }

/* Mobile : les boutons de niveau sont regroupés dans un menu déroulant ouvert par le picto filtre */
@media (max-width: 640px) {
  #top .bar h1 { font-size: 16px; }
  #filter-btn { display: inline-flex; }
  #top #chips { display: none; position: absolute; top: calc(58px + var(--safe-t, 0px)); right: 12px; width: min(240px, calc(100vw - 24px));
                flex-direction: column; gap: 2px; overflow: visible; padding: 6px; background: rgba(4,34,44,.98);
                border: 1.5px solid rgba(255,255,255,.2); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
  #top #chips.open { display: flex; }
  #top #chips .chip { border-color: transparent; background: transparent; border-radius: 10px; padding: 11px 10px; font-size: 14px; }
  #top #chips .chip[aria-pressed="true"] { background: rgba(0,187,204,.2); border-color: transparent; }
  #top #chips .chip[aria-pressed="false"] { opacity: .6; }
  #top #chips .chip::after { content: ""; margin-left: auto; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px; border: 2px solid rgba(255,255,255,.45);
                             font-size: 13px; line-height: 16px; text-align: center; }
  #top #chips .chip[aria-pressed="true"]::after { content: "✓"; background: #00BBCC; border-color: #00BBCC; color: #04222C; }
  body #basemaps { top: calc(66px + var(--safe-t, 0px)); z-index: 4; }
  body #auth { top: calc(66px + var(--safe-t, 0px)); z-index: 4; }
  body #toast { top: calc(70px + var(--safe-t, 0px)); }
}
@media (max-width: 420px) { #top .bar h1 .loc { display: none; } }

/* v13 — placement d'un point clé : bandeau avec « Enregistrer la nouvelle position » */
.pick-bar { flex-wrap: wrap; }
.pick-bar .pick-txt { flex: 1 1 100%; font-size: 13px; }
.pick-bar .pick-btns { display: flex; gap: 8px; flex: 1 1 100%; }
.pick-bar .pick-btns .tbtn { flex: 1 1 auto; }
.pick-bar .tbtn[disabled] { opacity: .45; }

/* v15 — bandeau d'installation de l'appli (install.js) */
#install-bar { position: fixed; z-index: 9; left: 10px; right: 10px; bottom: calc(10px + var(--safe-b, 0px)); max-width: 460px; margin: 0 auto; box-sizing: border-box;
               display: none; gap: 10px; align-items: center; padding: 10px 6px 10px 14px; border-radius: 14px; background: #04222C; color: #fff;
               border: 1.5px solid rgba(255,255,255,.2); box-shadow: 0 8px 24px rgba(0,0,0,.45); font: 600 14px/1.35 "Quicksand", system-ui, sans-serif; }
#install-bar.show { display: flex; }
#install-bar .ib-txt { flex: 1 1 auto; min-width: 0; }
#install-bar .ib-txt small { display: block; margin-top: 4px; font-weight: 500; font-size: 12px; opacity: .75; }
#install-bar svg { vertical-align: -3px; }
#install-bar .ib-go, #help .install-go { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; box-sizing: border-box;
                                          background: #00BBCC; color: #04222C; font: 700 14px "Quicksand", system-ui, sans-serif; text-decoration: none; cursor: pointer; }
#install-bar .ib-go { flex: 0 0 auto; }
#help .install-go { margin-top: 8px; }
#install-bar .ib-x { flex: 0 0 auto; width: 36px; height: 44px; border: 0; background: none; color: #fff; font-size: 22px; line-height: 1; opacity: .6; cursor: pointer; }
#sheet.open ~ #install-bar, body.following #install-bar { display: none; }
