/*
 * OrgCarte3D — styles côté visiteur.
 * Personnalisables depuis le thème (variables CSS, toutes facultatives) :
 *   --o3c-accent (boutons, titres), --o3c-accent-text, --o3c-radius (arrondi), --o3c-focus (contour de focus),
 *   --o3c-electric et --o3c-electric-2 (les deux couleurs « électriques » des boîtes : liseré, pastilles, survol).
 */
.o3c { margin: 0 0 1.5rem; --_accent: var(--o3c-accent, #12315e); --_accent-text: var(--o3c-accent-text, #fff); --_focus: var(--o3c-focus, #1a1a1a); --_texte: #0f1630; --_el: var(--o3c-electric, #2a3cff); --_el2: var(--o3c-electric-2, #7a2cff); --_el-txt: #2230d6; --_el-nuit: #101a6b; }

.o3c__stage {
	position: relative; display: grid; place-items: center; overflow: hidden;
	height: var(--o3c-h, 640px); max-height: 90vh;
	border-radius: var(--o3c-radius, 12px); background: #dfe5ea;
	container-type: inline-size;
}
.o3c__stage:fullscreen { height: 100vh; max-height: none; border-radius: 0; }
.o3c__stage > .o3c__placeholder, .o3c__stage > .o3c__poster, .o3c__stage > .o3c__activate { grid-area: 1 / 1; }
.o3c__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.o3c__placeholder { display: flex; flex-direction: column; align-items: center; gap: .5rem; margin-bottom: 8rem; color: #44566c; }
.o3c__placeholder-text { font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }

.o3c__activate {
	position: relative; z-index: 2; min-height: 44px; padding: .6em 1.3em; border: 2px solid transparent; border-radius: 999px;
	font: inherit; font-weight: 600; line-height: 1.2; cursor: pointer;
	background: var(--_accent); color: var(--_accent-text); box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
}
.o3c__activate[hidden] { display: none; }
.o3c__activate:focus-visible, .o3c button:focus-visible, .o3c input:focus-visible, .o3c summary:focus-visible { outline: 3px solid var(--_focus); outline-offset: 2px; box-shadow: 0 0 0 2px #fff; }

/* message d'état : lu par les lecteurs d'écran ; visible pendant le chargement ou en cas d'erreur */
.o3c__stage > .o3c__status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.o3c__stage.is-loading > .o3c__status, .o3c__stage.is-error > .o3c__status {
	inset: auto 12px 12px 12px; z-index: 3; width: auto; height: auto; margin: 0; padding: .5em .9em; overflow: visible; clip-path: none; white-space: normal;
	border-radius: 8px; background: rgba(0, 0, 0, .78); color: #fff; font-size: .875rem; text-align: center;
}

.o3c__caption { margin-top: .6rem; font-size: .9em; }
.o3c__texte { margin-top: .6rem; }
.o3c__texte summary { cursor: pointer; font-weight: 600; }
.o3c__texte h3 { margin: 1rem 0 .3rem; font-size: 1rem; }
.o3c__nojs, .o3c__erreur { margin: .6rem 0 0; font-size: .9em; }
.o3c__erreur { padding: .6em .9em; border-left: 4px solid #b32d2e; background: #fcf0f1; color: #1d2327; }

/* ---------- carte et panneau (une fois la carte chargée) ---------- */
/* sélecteur renforcé : la feuille de style de MapLibre (chargée après la nôtre) impose « position: relative » à .maplibregl-map */
.o3c .o3c__stage > .o3c__map { position: absolute; inset: 0; width: 100%; height: 100%; }
.o3c__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.o3c__panel {
	position: absolute; top: 10px; left: 10px; z-index: 5; width: min(330px, calc(100% - 20px)); max-height: calc(100% - 94px); overflow: auto;
	background: rgba(255, 255, 255, .96); color: var(--_texte); border-radius: 12px; box-shadow: 0 4px 18px rgba(0, 0, 0, .28); font-size: .92rem; line-height: 1.4;
}
.o3c__corps { padding: 0 14px 14px; display: grid; gap: 14px; }
.o3c__f { margin: 0; padding: 0; border: 0; display: grid; gap: 6px; min-width: 0; }
.o3c__f[hidden] { display: none; }
.o3c__f legend { padding: 0; margin-bottom: 4px; font-weight: 700; color: var(--_accent); }
.o3c__panel label { display: flex; align-items: center; gap: 8px; min-height: 28px; }
.o3c__panel input[type=range] { width: 100%; }
.o3c__ligne { display: flex; justify-content: space-between; gap: 8px; }
.o3c__panel output { font-variant-numeric: tabular-nums; font-weight: 600; }
.o3c__panel button, .o3c__profil button {
	min-height: 40px; padding: 6px 14px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer;
	border: 2px solid var(--_accent); background: transparent; color: var(--_accent);
}
.o3c__panel button:hover { background: var(--_accent); color: var(--_accent-text); }
.o3c__boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.o3c__infos { padding: 8px 10px; border-radius: 8px; background: #eef1f5; display: grid; gap: 2px; font-size: .86rem; }
.o3c__message { margin: 0; color: #7a2b00; font-size: .86rem; min-height: 1.2em; }
.o3c__petit { margin: 0; font-size: .8rem; color: #50575e; }

.o3c__stats { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.o3c__stats dt { color: #50575e; }
.o3c__stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.o3c__legende, .o3c__points-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .86rem; }
.o3c__legende li { display: grid; grid-template-columns: 22px 1fr auto; align-items: center; gap: 8px; }
.o3c__pastille { width: 22px; height: 8px; border-radius: 4px; border: 1px solid rgba(0, 0, 0, .35); }
.o3c__km { font-variant-numeric: tabular-nums; color: #50575e; }
.o3c__desc summary { padding: 0; font-weight: 600; font-size: .88rem; }
.o3c__desc[hidden] { display: none; }
.o3c__desc p { margin: 6px 0 0; font-size: .86rem; }
.o3c__traces { display: grid; gap: 2px; }
.o3c__points-liste button { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; text-align: left; border-radius: 8px; }
.o3c__puce { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); flex: none; color: #fff; }

/* profil altimétrique */
.o3c__profil {
	position: absolute; z-index: 4; left: 10px; right: 10px; bottom: 30px; padding: 9px 12px 11px;
	background: rgba(255, 255, 255, .96); color: var(--_texte); border-radius: 12px; box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
}
.o3c__profil[hidden] { display: none; }

.o3c__lecture { margin: 0 0 4px; font-size: .9rem; font-weight: 600; min-height: 1.4em; font-variant-numeric: tabular-nums; }
.o3c__zone { position: relative; height: 110px; touch-action: none; cursor: crosshair; }
.o3c__svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.o3c__curseur-v { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--_accent); pointer-events: none; display: none; }
.o3c__axe { position: absolute; font-size: .72rem; color: #50575e; pointer-events: none; background: rgba(255, 255, 255, .8); padding: 0 2px; border-radius: 3px; }
.o3c__pos { width: 100%; margin: 6px 0 0; }
@container (max-width: 640px) { .o3c__zone { height: 80px; } }

/* repères sur la carte */
.o3c__mk { display: flex; align-items: center; gap: 6px; pointer-events: none; color: var(--_texte); }
.o3c__pt { width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .55); flex: none; }
.o3c__et { background: #fff; font-size: .78rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; box-shadow: 0 1px 5px rgba(0, 0, 0, .4); white-space: nowrap; }
.o3c__mk-depart .o3c__pt { background: #2e9e4f; }
.o3c__mk-haut .o3c__pt { background: #e47a30; }
.o3c__mk-curseur .o3c__pt { background: var(--_accent); width: 20px; height: 20px; }
.o3c__pa { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .6); color: #fff; font: 700 15px/1 system-ui, sans-serif; cursor: pointer; }
.o3c__popup { color: var(--_texte); font-size: .9rem; }
.o3c__popup p { margin: .4em 0 0; }

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

/* liste des parcours : case à cocher + couleur + nom, bouton « Détails » */
.o3c__liste-parcours { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.o3c__parcours { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.o3c__p-label { flex: 1; min-width: 0; }
.o3c__p-nom { overflow-wrap: anywhere; }
.o3c__p-coul { flex: none; width: 22px; height: 6px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .35); }
.o3c__panel .o3c__p-detail { min-height: 32px; padding: 2px 10px; font-size: .82rem; }
.o3c__panel .o3c__p-detail[aria-pressed="true"] { background: var(--_accent); color: var(--_accent-text); }
.o3c__tout[hidden], .o3c__aide-parcours[hidden], .o3c__detail[hidden], .o3c__legende[hidden] { display: none; }
.o3c__detail { display: grid; gap: 6px; padding-top: 6px; border-top: 1px solid #dde1e6; }

/* ---- habillage « verre électrique » des boîtes repliables (panneau et profil) ----
   Contrastes calculés pour le pire cas (photo très sombre derrière le verre) : texte #0f1630 ≥ 12:1, titres #101a6b ≥ 10:1,
   libellés et boutons #2230d6 ≥ 5,4:1, texte blanc sur la pastille ≥ 6:1. */
.o3c__panel, .o3c__profil {
	background: linear-gradient(90deg, var(--_el), var(--_el2)) top / 100% 4px no-repeat, rgba(255, 255, 255, .88);
	-webkit-backdrop-filter: blur(14px) saturate(1.5); backdrop-filter: blur(14px) saturate(1.5);
	border: 1px solid rgba(255, 255, 255, .75);
	box-shadow: 0 0 0 2px rgba(42, 60, 255, .85), 0 10px 30px rgba(16, 26, 107, .38), 0 0 26px rgba(42, 60, 255, .32);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.o3c__panel, .o3c__profil { background: linear-gradient(90deg, var(--_el), var(--_el2)) top / 100% 4px no-repeat, rgba(255, 255, 255, .97); }
}
@media (prefers-reduced-transparency: reduce) {
	.o3c__panel, .o3c__profil { background: linear-gradient(90deg, var(--_el), var(--_el2)) top / 100% 4px no-repeat, #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
	width: 32px; height: 32px; background: linear-gradient(135deg, var(--_el), var(--_el2)); color: #fff;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 14px rgba(42, 60, 255, .55); transition: transform .15s ease, box-shadow .15s ease;
}
.o3c__f legend { color: var(--_el-txt); }
.o3c__panel button { border-color: var(--_el-txt); color: var(--_el-txt); background: rgba(255, 255, 255, .6); }
.o3c__panel button:hover { background: linear-gradient(135deg, var(--_el), var(--_el2)); border-color: transparent; color: #fff; }
.o3c__panel input[type=checkbox], .o3c__panel input[type=range], .o3c__panel input[type=radio] { accent-color: var(--_el); }
.o3c__infos { background: rgba(42, 60, 255, .09); border: 1px solid rgba(42, 60, 255, .22); }

/* ---- tiroirs : le panneau (depuis la gauche) et le profil (depuis le bas) sont masqués, un bouton les fait glisser ---- */
.o3c__panel, .o3c__profil { visibility: hidden; opacity: 0; transition: transform .3s cubic-bezier(.2, .8, .2, 1), opacity .22s ease, visibility 0s linear .3s; }
.o3c__panel { transform: translateX(calc(-100% - 24px)); }
.o3c__profil { transform: translateY(calc(100% + 48px)); }
.o3c__panel.is-ouvert, .o3c__profil.is-ouvert { visibility: visible; opacity: 1; transform: none; transition-delay: 0s; }
.o3c__tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 14px 14px 8px; }
.o3c__profil .o3c__tete { padding: 0 0 6px; }
.o3c__titre { font-size: 1.02rem; letter-spacing: .01em; color: var(--_el-nuit); }
.o3c .o3c__fermer {
	flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%;
	background: linear-gradient(135deg, var(--_el), var(--_el2)); color: #fff; font-size: 1rem; line-height: 1; cursor: pointer;
	box-shadow: 0 0 0 3px rgba(255, 255, 255, .9), 0 0 14px rgba(42, 60, 255, .5); transition: transform .15s ease, box-shadow .15s ease;
}
.o3c .o3c__fermer:hover { background: linear-gradient(135deg, var(--_el), var(--_el2)); color: #fff; transform: scale(1.08); box-shadow: 0 0 0 3px #fff, 0 0 20px rgba(122, 44, 255, .75); }

/* boutons qui ouvrent les tiroirs : pastille électrique + court libellé */
.o3c .o3c__lanceur {
	position: absolute; z-index: 6; left: 10px; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 6px 18px 6px 6px;
	border: 0; border-radius: 999px; cursor: pointer; font: inherit; font-weight: 700; color: var(--_el-nuit);
	background: rgba(255, 255, 255, .88); -webkit-backdrop-filter: blur(12px) saturate(1.5); backdrop-filter: blur(12px) saturate(1.5);
	box-shadow: 0 0 0 2px rgba(42, 60, 255, .85), 0 8px 22px rgba(16, 26, 107, .35), 0 0 20px rgba(42, 60, 255, .35);
	transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
.o3c__lanceur--infos { top: 10px; }
.o3c__lanceur--profil { bottom: 34px; }
.o3c .o3c__lanceur:hover { background: rgba(255, 255, 255, .95); transform: translateY(-1px) scale(1.03); box-shadow: 0 0 0 2px var(--_el2), 0 10px 26px rgba(16, 26, 107, .4), 0 0 26px rgba(122, 44, 255, .5); }
.o3c .o3c__lanceur:focus-visible { outline: 3px solid var(--_focus); outline-offset: 3px; }
.o3c__lanceur[hidden] { display: none; }
.o3c__lanceur.is-masque { visibility: hidden; opacity: 0; pointer-events: none; }
.o3c__ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--_el), var(--_el2)); color: #fff; font: italic 700 1.15rem/1 Georgia, "Times New Roman", serif; box-shadow: 0 0 0 2px #fff; }
@container (min-width: 760px) { .o3c__profil { max-width: 760px; } .o3c__stage.a-panneau .o3c__profil { left: 356px; } }

/* points d'attention sur le profil et interrupteur */
.o3c__pp { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.o3c__pp[hidden] { display: none; }
.o3c .o3c__pp-pt {
	position: absolute; transform: translate(-50%, -50%); pointer-events: auto; width: 24px; height: 24px; min-height: 0; padding: 0; border-radius: 50%;
	border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0, 0, 0, .55); color: #fff; font: 700 13px/1 system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.o3c .o3c__pp-pt::after { content: ""; position: absolute; inset: -10px; } /* zone tactile élargie (≈ 44 px) sans élargir le repère */
.o3c .o3c__pp-pt:hover { transform: translate(-50%, -50%) scale(1.15); }
.o3c .o3c__pp-pt:focus-visible { outline: 3px solid var(--_focus); outline-offset: 2px; }
.o3c__tete-actions { display: inline-flex; align-items: center; gap: 8px; }
.o3c .o3c__bascule-points {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 6px; border: 2px solid var(--_el-txt); border-radius: 999px; background: rgba(255, 255, 255, .7);
	color: var(--_el-txt); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.o3c .o3c__bascule-points[hidden] { display: none; }
.o3c .o3c__bascule-points[aria-pressed="true"] { background: linear-gradient(135deg, var(--_el), var(--_el2)); border-color: transparent; color: #fff; }
.o3c .o3c__bascule-points[aria-pressed="false"] .o3c__pa-mini { opacity: .45; }
.o3c .o3c__bascule-points[aria-pressed="false"] span:last-child { text-decoration: line-through; text-decoration-thickness: 2px; }
.o3c__pa-mini { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--_el-txt); font: 700 14px/1 system-ui, sans-serif; }
.o3c__titre { min-width: 0; }
.o3c__profil .o3c__tete { flex-wrap: nowrap; }
@container (max-width: 520px) {
	.o3c .o3c__bascule-points { padding: 0 6px; }
	.o3c .o3c__bascule-points span:last-child { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
	.o3c .o3c__bascule-points[aria-pressed="false"] span:last-child { text-decoration: none; }
}

/* quadrillage du profil */
.o3c__grille { position: absolute; inset: 0; pointer-events: none; }
.o3c__gl { position: absolute; }
.o3c__gl-h { left: 0; right: 0; border-top: 1px dashed rgba(16, 26, 107, .28); }
.o3c__gl-v { top: 0; bottom: 0; border-left: 1px dashed rgba(16, 26, 107, .28); }
.o3c__gl-txt { position: absolute; font-size: .68rem; line-height: 1.1; color: #3b4150; white-space: nowrap; background: rgba(255, 255, 255, .75); padding: 0 2px; border-radius: 3px; }
.o3c__gl-h .o3c__gl-txt { left: 0; top: 0; transform: translateY(-100%); }
.o3c__gl-v .o3c__gl-txt { bottom: 0; left: 3px; }
.o3c__ymax, .o3c__ymin { display: none; } /* remplacés par les étiquettes des lignes extrêmes du quadrillage (exactement à la hauteur de la valeur) */
.o3c__gl-haut .o3c__gl-txt { transform: none; top: 2px; }

/* pictogrammes des types de points (forme + couleur) */
.o3c__pa svg, .o3c__pp-pt svg, .o3c__puce svg, .o3c__outils svg { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; display: block; }
.o3c__pa svg { width: 16px; height: 16px; flex: none; margin: 0; }
.o3c__pp-pt svg { width: 14px; height: 14px; }
.o3c__puce svg { width: 14px; height: 14px; stroke-width: 2.6; }

/* boutons de la carte plus grands (≈ 40 px) + barre d'outils (cadrer, dessus, réinitialiser) */
.o3c .maplibregl-ctrl-group button { width: 40px; height: 40px; }
.o3c .maplibregl-ctrl-group button + button { border-top: 1px solid rgba(16, 26, 107, .18); }
.o3c .o3c__outils button { display: flex; align-items: center; justify-content: center; padding: 0; color: #101a6b; background: transparent; }
.o3c .o3c__outils button:hover { background: rgba(42, 60, 255, .1); }
.o3c .o3c__outils svg { width: 22px; height: 22px; stroke-width: 2; }
.o3c .maplibregl-ctrl-group button:focus-visible { outline: 3px solid var(--_focus); outline-offset: -3px; }

/* aperçu avant activation : photo aérienne + traces, légèrement assombrie pour que le bouton reste lisible */
.o3c__stage.has-apercu:not(.is-ready)::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, rgba(10, 20, 50, .10), rgba(10, 20, 50, .45)); pointer-events: none; }
.o3c__stage.has-apercu:not(.is-ready) > .o3c__activate, .o3c__stage.has-apercu:not(.is-ready) > .o3c__status { z-index: 2; }

/* ---- panneau en sections (une seule ouverte à la fois) ---- */
.o3c__corps { gap: 4px; }
.o3c__sec[hidden] { display: none; }
.o3c__sec { border-top: 1px solid rgba(16, 26, 107, .16); }
.o3c__sec:first-child { border-top: 0; }
.o3c__sec > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; cursor: pointer; list-style: none; font-weight: 700; color: var(--_el-nuit); }
.o3c__sec > summary::-webkit-details-marker { display: none; }
.o3c__sec > summary::after { content: ""; flex: none; width: 9px; height: 9px; margin-right: 6px; border-right: 2.5px solid var(--_el-txt); border-bottom: 2.5px solid var(--_el-txt); transform: rotate(-45deg); transition: transform .2s ease; }
.o3c__sec[open] > summary::after { transform: rotate(45deg); }
.o3c__sec > .o3c__f { padding: 2px 0 12px; }

/* ---- profil : bulle qui suit le curseur, point sur la courbe, choix d'un tronçon, légende des pentes ---- */
.o3c__profil.is-actif .o3c__lecture { opacity: 0; } /* toujours lue par les lecteurs d'écran, mais invisible : la bulle prend sa place SANS faire bouger la zone (la zone qui saute sous le pointeur gênait la sélection) */
.o3c__bulle { position: absolute; top: -31px; z-index: 3; transform: translateX(-50%); display: inline-flex; gap: 6px; padding: 3px 10px; border-radius: 10px; pointer-events: none; white-space: nowrap; text-align: center;
	font-size: .78rem; line-height: 1.25; color: #0f1630; font-variant-numeric: tabular-nums;
	background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 0 0 1.5px rgba(42, 60, 255, .85), 0 4px 12px rgba(16, 26, 107, .3); }
.o3c__bulle[hidden], .o3c__dot[hidden], .o3c__sel[hidden] { display: none; }
.o3c__bulle strong { color: var(--_el-nuit); }
.o3c__dot { position: absolute; z-index: 2; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 3px solid #fff; background: var(--_el); box-shadow: 0 0 0 1.5px var(--_el), 0 0 10px rgba(42, 60, 255, .6); pointer-events: none; }
.o3c__sel { position: absolute; top: 0; bottom: 0; z-index: 1; background: rgba(42, 60, 255, .16); border-left: 2px solid var(--_el); border-right: 2px solid var(--_el); pointer-events: none; }
.o3c__zone.est-selection { cursor: col-resize; outline: 2px dashed var(--_el); outline-offset: 2px; }
.o3c__mini-legende { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; padding: 0; font-size: .76rem; color: #3b4150; }
.o3c__mini-legende[hidden] { display: none; }
.o3c__mini-legende li { display: inline-flex; align-items: center; gap: 5px; }
.o3c__mini-legende span { width: 18px; height: 6px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .3); }
.o3c .o3c__bascule-zoom {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px 0 8px; border: 2px solid var(--_el-txt); border-radius: 999px; background: rgba(255, 255, 255, .7);
	color: var(--_el-txt); font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
}
.o3c .o3c__bascule-zoom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.o3c .o3c__bascule-zoom[aria-pressed="true"], .o3c .o3c__bascule-zoom.is-plage { background: linear-gradient(135deg, var(--_el), var(--_el2)); border-color: transparent; color: #fff; }
@container (max-width: 520px) {
	.o3c .o3c__bascule-zoom:not(.is-plage) { padding: 0 8px; }
	.o3c .o3c__bascule-zoom:not(.is-plage) span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ---- fenêtre d'un point : même verre que les boîtes ---- */
.o3c .maplibregl-popup-content { padding: 12px 14px 12px; border-radius: 14px; color: var(--_texte); background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); box-shadow: 0 0 0 2px rgba(42, 60, 255, .85), 0 10px 28px rgba(16, 26, 107, .38), 0 0 22px rgba(42, 60, 255, .3); }
.o3c .maplibregl-popup-anchor-top .maplibregl-popup-tip, .o3c .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .o3c .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: rgba(255, 255, 255, .95); }
.o3c .maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .o3c .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .o3c .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: rgba(255, 255, 255, .95); }
.o3c .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: rgba(255, 255, 255, .95); }
.o3c .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: rgba(255, 255, 255, .95); }
.o3c .maplibregl-popup-close-button { top: 6px; right: 6px; width: 32px; height: 32px; padding: 0; border-radius: 50%; font-size: 1.2rem; line-height: 1; color: #fff; background: linear-gradient(135deg, var(--_el), var(--_el2)); }
.o3c .maplibregl-popup-close-button:hover { color: #fff; background: linear-gradient(135deg, var(--_el), var(--_el2)); transform: scale(1.08); }
.o3c .maplibregl-popup-close-button:focus-visible { outline: 3px solid var(--_focus); outline-offset: 2px; }
.o3c__popup-tete { display: flex; align-items: center; gap: 10px; margin: 0 34px 6px 0; }
.o3c__popup-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .25); }
.o3c__popup-ico svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.o3c__popup-type { display: block; font-size: .76rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--_el-txt); }
.o3c__popup-titre { display: block; font-size: .98rem; color: var(--_el-nuit); line-height: 1.25; }
.o3c__popup p { margin: .45em 0 0; line-height: 1.4; }
.o3c__zone, .o3c__zone * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; } /* pas de sélection de texte en glissant sur le profil */

/* ---- suivi de ma position ---- */
.o3c__gps-wrap { position: relative; }
.o3c .o3c__gps-bouton[aria-pressed="true"], .o3c .o3c__gps-suivre[aria-pressed="true"] { background: linear-gradient(135deg, var(--_el), var(--_el2)); color: #fff; }
.o3c .o3c__gps-suivre[hidden] { display: none; }
.o3c .o3c__gps-suivre[aria-pressed="false"] { opacity: .75; }
.o3c__gps-chip {
	position: absolute; top: 0; right: calc(100% + 8px); z-index: 3; display: grid; gap: 1px; width: max-content; max-width: min(260px, 62cqw); padding: 6px 12px; border-radius: 12px; font-size: .8rem; line-height: 1.3; color: #0f1630;
	background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 0 0 2px rgba(42, 60, 255, .85), 0 6px 18px rgba(16, 26, 107, .35);
}
.o3c__gps-chip[hidden] { display: none; }
.o3c__gps-chip strong { color: var(--_el-nuit); font-variant-numeric: tabular-nums; }
.o3c__gps-chip.is-hors { background: #fff1f1; box-shadow: 0 0 0 3px #c1121f, 0 6px 18px rgba(193, 18, 31, .35); }
.o3c__gps-chip.is-hors .o3c__gps-l2 { color: #8f0d17; font-weight: 700; }
.o3c__moi { position: relative; width: 22px; height: 22px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.o3c__moi::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid rgba(26, 115, 232, .55); animation: o3c-pouls 2s ease-out infinite; }
@keyframes o3c-pouls { from { transform: scale(.55); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

/* ---- choix 3D / 2D sur l'aperçu, carte 2D ---- */
.o3c__stage > .o3c__choix { grid-area: 1 / 1; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px 12px; max-width: 92%; }
.o3c__choix[hidden] { display: none; }
.o3c__choix-aide { flex-basis: 100%; margin: 4px 0 0; padding: 4px 10px; border-radius: 8px; text-align: center; font-size: .82rem; line-height: 1.35; color: #0f1630; background: rgba(255, 255, 255, .86); }
.o3c .o3c__activate--2d { background: rgba(255, 255, 255, .95); color: var(--_el-nuit); border-color: var(--_el-txt); }
.o3c__fond2d { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.o3c__fond2d[hidden], .o3c__lg-ortho[hidden], .o3c__bloc-exag[hidden] { display: none; }

/* ---- hors ligne ---- */
.o3c__sec-hl[hidden] { display: none; }
.o3c__hl-opts { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.o3c__hl-opts select { min-height: 36px; max-width: 100%; }
.o3c__hl-estim, .o3c__hl-txt { margin: 0; font-size: .86rem; line-height: 1.35; }
.o3c__hl-txt { font-weight: 600; color: var(--_el-nuit); }
.o3c__hl-prog { width: 100%; height: 12px; }
.o3c__hl-prog[hidden], .o3c__hl-stop[hidden], .o3c__hl-liste[hidden] { display: none; }
.o3c__hl-liste { display: grid; gap: 6px; padding-top: 8px; border-top: 1px solid rgba(16, 26, 107, .16); font-size: .86rem; }
.o3c__hl-liste ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.o3c__hl-liste li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; }

/* ---- alertes d'approche ---- */
.o3c__sec-alertes[hidden] { display: none; }
.o3c__al-groupe { border: 0; margin: 0; padding: 0; display: grid; gap: 4px; }
.o3c__alerte {
	position: absolute; z-index: 8; left: 10px; right: 64px; bottom: 92px; /* au-dessus du bouton « Profil », loin de la bulle de position */ display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 10px; border-radius: 14px; color: #0f1630; font-size: .95rem; line-height: 1.3;
	background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
	box-shadow: 0 0 0 3px var(--o3c-al, #c1121f), 0 8px 24px rgba(0, 0, 0, .4);
}
.o3c__alerte[hidden] { display: none; }
.o3c__alerte.is-danger { background: #fff4f4; }
.o3c__alerte-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--o3c-al, #c1121f); color: #fff; box-shadow: 0 0 0 2px #fff; }
.o3c__alerte-ico svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.o3c__alerte-txt { flex: 1; font-weight: 700; }
.o3c .o3c__alerte-fermer { flex: none; width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 22, 48, .1); color: #0f1630; cursor: pointer; }
.o3c .o3c__alerte-fermer:hover { background: rgba(15, 22, 48, .2); }

/* ---- bascule 2D / 3D : ce qui ne concerne qu'un des deux modes ---- */
.o3c__stage.mode-2d .o3c__lg-ortho, .o3c__stage.mode-2d .o3c__bloc-exag, .o3c__stage.mode-2d .o3c__b-dessus, .o3c__stage.mode-2d .o3c__outils button[data-k="dessus"], .o3c__stage.mode-2d .maplibregl-ctrl-compass { display: none; }
.o3c__stage:not(.mode-2d) .o3c__fond2d { display: none; }
.o3c .o3c__bascule-mode { font: 700 .95rem/1 system-ui, sans-serif; color: var(--_el-nuit); letter-spacing: .02em; }
.o3c .o3c__bascule-mode:hover { background: rgba(42, 60, 255, .1); }
.o3c .o3c__bascule-mode[disabled] { opacity: .45; cursor: not-allowed; }
.o3c__b-mode[hidden] { display: none; }

/* ---- mode discret (écran noir) et choix au démarrage du suivi ---- */
.o3c__gps-bdiscret { margin-top: 4px; padding: 6px 10px; min-height: 36px; border: 0; border-radius: 8px; background: #101a6b; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.o3c__gps-bdiscret[hidden] { display: none; }
.o3c__gps-choix {
	position: absolute; top: 0; right: calc(100% + 8px); z-index: 4; display: grid; gap: 8px; width: max-content; max-width: min(300px, 70cqw); padding: 12px; border-radius: 12px; font-size: .85rem; line-height: 1.35; color: #0f1630;
	background: #fff; box-shadow: 0 0 0 2px rgba(42, 60, 255, .85), 0 6px 18px rgba(16, 26, 107, .35);
}
.o3c__gps-choix[hidden] { display: none; }
.o3c__gps-choix p { margin: 0; }
.o3c__gps-choix .o3c__gps-c-lcd { font-size: .78rem; color: #3a4166; }
.o3c__gps-choix button { min-height: 44px; padding: 8px 12px; border: 2px solid #101a6b; border-radius: 10px; background: #fff; color: #101a6b; font: inherit; font-weight: 700; cursor: pointer; }
.o3c__gps-choix .o3c__gps-c-discret { background: #101a6b; color: #fff; }
.o3c__gps-choix button:disabled { opacity: .5; cursor: not-allowed; }
.o3c__gps-choix button:focus-visible, .o3c__gps-bdiscret:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.o3c__gps-choix .o3c__gps-c-annuler { border-color: #8a90ad; color: #3a4166; font-weight: 500; }

.o3c__discret {
	position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; justify-content: space-between; gap: 16px; padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom));
	background: #000; color: #d8dcf5; font: 16px/1.4 system-ui, sans-serif; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; outline: 0;
}
.o3c__discret[hidden] { display: none; }
.o3c__discret p { margin: 0; }
.o3c__dis-haut { flex: 1 1 auto; min-height: 0; overflow-y: auto; touch-action: pan-y; } /* si l'écran est petit, seul le haut défile : la consigne de sortie reste toujours visible */
.o3c__dis-bas { flex: none; }
.o3c__dis-titre { font-size: .9rem; color: #8f96c4; text-transform: uppercase; letter-spacing: .04em; }
.o3c__dis-infos { margin-top: 8px; font-size: 1.6rem; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.o3c__dis-l2 { margin-top: 4px; font-size: 1.05rem; color: #b9bfe6; }
.o3c__dis-avert { margin-top: 12px; padding: 10px 12px; border: 2px solid #ffbf00; border-radius: 10px; color: #ffd966; font-weight: 600; }
.o3c__dis-avert[hidden], .o3c__dis-alerte[hidden] { display: none; }
.o3c__dis-alerte { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--al, #c1121f); color: #fff; font-size: 1.5rem; font-weight: 800; text-align: center; }
.o3c__dis-sortie { padding: 14px; border: 2px solid #8f96c4; border-radius: 14px; background: #0b0d1c; transition: border-color .2s, box-shadow .2s; }
.o3c__dis-sortie.is-indice { border-color: #ffbf00; box-shadow: 0 0 0 4px rgba(255, 191, 0, .45); }
.o3c__dis-sortie strong { display: block; color: #fff; font-size: 1.05rem; }
.o3c__dis-sortie ul { margin: 6px 0 10px; padding-left: 1.2em; }
.o3c__dis-sortie b { color: #ffd966; }
.o3c__dis-barre { height: 8px; border-radius: 4px; background: #2a2f55; overflow: hidden; }
.o3c__dis-barre span { display: block; width: 0; height: 100%; background: #ffbf00; }
.o3c__dis-retour { width: 100%; margin-top: 12px; min-height: 48px; border: 2px solid #8f96c4; border-radius: 10px; background: #1a1f45; color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.o3c__dis-retour:focus-visible { outline: 3px solid #ffbf00; outline-offset: 2px; }
.o3c__dis-conseil { margin-top: 12px; font-size: .85rem; color: #8f96c4; }
html.o3c-discret-actif, html.o3c-discret-actif body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .o3c__dis-sortie { transition: none; } }

@media (max-height: 700px) {
	.o3c__discret { gap: 10px; padding-top: 10px; padding-bottom: 10px; }
	.o3c__dis-infos { font-size: 1.3rem; margin-top: 4px; }
	.o3c__dis-l2 { font-size: .95rem; }
	.o3c__dis-avert { font-size: .85rem; padding: 6px 10px; margin-top: 8px; }
	.o3c__dis-alerte { font-size: 1.15rem; padding: 10px; margin-top: 8px; }
	.o3c__dis-sortie { padding: 10px; font-size: .9rem; }
	.o3c__dis-sortie ul { margin: 4px 0 8px; }
	.o3c__dis-retour { min-height: 44px; margin-top: 8px; }
	.o3c__dis-conseil { display: none; }
}
