/* Page publique : sobre, mobile d'abord. La 3D occupe tout l'écran ; l'interface flotte par-dessus en panneaux translucides et discrets.
   Une seule couleur d'accent pour les actions ; pas d'ombre lourde ni de dégradé décoratif. */
:root {
  --encre: #1b242a; --discret: #4a5a63; --fond: #f7f7f3; --trait: #8b989f; --trait-doux: #d3d9dc;
  --verre: color-mix(in srgb, var(--fond) 88%, transparent); --filet: color-mix(in srgb, var(--encre) 14%, transparent);
  --accent: #0b5cad; --accent-fort: #084a8c; --accent-encre: #ffffff; --puce: #e6ebee; --accent-fond: color-mix(in srgb, var(--accent) 13%, transparent);
  --alerte-fond: #fff1c9; --alerte-encre: #4a3600; --alerte-trait: #b88a00;
  --st-source-f: #dcefe0; --st-source-e: #11451f; --st-fourchette-f: #dce9f8; --st-fourchette-e: #0a3a73;
  --st-calcule-f: #e8e2f6; --st-calcule-e: #3b2670; --st-hypothese-f: #fff1c9; --st-hypothese-e: #4a3600; --st-fictif-f: #f6dede; --st-fictif-e: #6e1717;
  --rayon: 12px; --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 24px; --e6: 32px;
  --haut-barre: 60px;
  --h-bandeau: 40px;
  --sa-h: env(safe-area-inset-top, 0px); --sa-b: env(safe-area-inset-bottom, 0px); --sa-g: env(safe-area-inset-left, 0px); --sa-d: env(safe-area-inset-right, 0px);
  --bas-barre: calc(var(--haut-barre) + var(--sa-b) + 8px);   /* hauteur occupée en bas par la barre flottante */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --encre: #e8eef1; --discret: #b3c0c7; --fond: #13191c; --trait: #70808a; --trait-doux: #36434a;
    --accent: #8cc2ff; --accent-fort: #8cc2ff; --accent-encre: #08213d; --puce: #26343b;
    --alerte-fond: #3d3000; --alerte-encre: #ffe9a6; --alerte-trait: #d9a900;
    --st-source-f: #153a22; --st-source-e: #bfe9c9; --st-fourchette-f: #12345c; --st-fourchette-e: #bcd8fa;
    --st-calcule-f: #2e2354; --st-calcule-e: #d6cbf5; --st-hypothese-f: #3d3000; --st-hypothese-e: #ffe9a6; --st-fictif-f: #4e1c1c; --st-fictif-e: #f5c9c9;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden; background: var(--fond); color: var(--encre);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sans-js { position: fixed; inset: 0; z-index: 99; margin: 0; padding: var(--e5); background: var(--fond); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
button, select, input { font: inherit; color: inherit; }
.long { display: none; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }

#scene { position: fixed; inset: 0; height: 100dvh; background: #dbe5e8; }
#scene canvas { display: block; width: 100%; height: 100%; touch-action: none; outline-offset: -3px; }

/* verre : fond commun des panneaux flottants (translucide, flou léger ; le texte reste lisible sur tout fond) */
#mesures, #bulle, #barre, #panneau, #aide-btn, #bulle-fermer, .note-haut, #attrib, #echelle, .rond {
  background: var(--verre); -webkit-backdrop-filter: blur(14px) saturate(1.15); backdrop-filter: blur(14px) saturate(1.15);
}

/* noms de lieux : étiquettes posées sur le sol (pied de l'étiquette = point du relief), sous les panneaux, sans interaction */
#lieux { position: fixed; inset: 0; height: 100dvh; z-index: 11; overflow: hidden; pointer-events: none; }
.lieu { position: absolute; left: 0; top: 0; display: none; flex-direction: column; align-items: center; line-height: 1.2; color: #1b242a; white-space: nowrap; }
.lieu > span { padding: 1px 6px; border-radius: 6px; background: rgba(250, 250, 246, .82); border: 1px solid rgba(80, 96, 104, .55); }
.lieu::after { content: ""; width: 1px; height: 8px; background: #1b242a; }
.lieu-ville > span, .lieu-village > span { font-weight: 700; }
.lieu-hameau > span { font-weight: 600; }
.lieu-mas > span { font-weight: 500; }

/* bandeau d'avertissement, permanent et compact */
#bandeau {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20; padding: var(--sa-h) calc(var(--sa-d) + var(--e2)) 0 calc(var(--sa-g) + var(--e2));
  background: color-mix(in srgb, var(--alerte-fond) 94%, transparent); color: var(--alerte-encre); border-bottom: 1px solid var(--alerte-trait);
}
#bandeau p { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--e2); font-size: 15px; line-height: 1.25; padding: var(--e1) 0; }
#bandeau strong { font-weight: 600; }
#bandeau .pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--alerte-trait); flex: none; }
.lien { background: none; border: 0; padding: var(--e2) var(--e1); min-height: 44px; margin: calc(-1 * var(--e1)) 0; color: inherit; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* barre de chargement : fine, non bloquante */
#chargement { position: fixed; z-index: 30; left: 0; right: 0; top: calc(var(--sa-h) + var(--h-bandeau) + 1px); height: 3px; background: transparent; }
#chargement > div { height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
@media (prefers-reduced-motion: reduce) { #chargement > div { transition: none; } }

/* rangée flottante du haut : mesures (repliables) et bouton d'aide */
#haut {
  position: fixed; z-index: 15; left: calc(var(--sa-g) + var(--e2)); right: calc(var(--sa-d) + var(--e2)); top: calc(var(--sa-h) + var(--h-bandeau) + var(--e2));
  display: flex; flex-direction: column; gap: var(--e2); align-items: stretch; pointer-events: none;
}
#haut-rang { display: flex; gap: var(--e2); align-items: flex-start; pointer-events: none; }
#haut > *:not(#haut-rang), #haut-rang > * { pointer-events: auto; }
/* pastille d'état « Sans la ligne » : retour visible vers l'affichage de la ligne */
.puce-etat { align-self: flex-start; min-height: 44px; padding: 0 var(--e3); border-radius: var(--rayon); border: 1px solid var(--alerte-trait); background: var(--alerte-fond); color: var(--alerte-encre); font-size: 15px; font-weight: 500; }
.puce-etat span { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
/* légende des repères cartographiques (axe hypothétique, fuseau) */
#legende { align-self: flex-start; max-width: 100%; padding: var(--e1) var(--e3); border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 15px; line-height: 1.3; }
#legende p { display: flex; align-items: center; gap: var(--e2); margin: var(--e1) 0; }
.sw { flex: none; width: 28px; height: 0; border-top: 3px dashed currentColor; }
.sw-fuseau { border-top-style: solid; border-top-width: 2px; }
.rond {
  flex: none; width: 44px; height: 44px; border-radius: 50%; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--filet); font-size: 20px; font-weight: 600; color: var(--encre); line-height: 1;
}
.rond.petit svg { width: 20px; height: 20px; }

/* mesures : une ligne compacte, dépliable d'un toucher */
#mesures { flex: 0 1 auto; min-width: 0; max-width: 100%; border: 1px solid var(--filet); border-radius: var(--rayon); overflow: hidden; }
#mesures[data-etat="ouvert"] { flex: 1 1 auto; max-width: 440px; }
#mes-bascule {
  display: flex; align-items: center; gap: var(--e2); width: 100%; min-height: 44px; padding: 0 var(--e3); background: none; border: 0; text-align: left; font-size: 16px;
  font-variant-numeric: tabular-nums;
}
#mes-bascule svg { flex: none; width: 20px; height: 20px; color: var(--discret); margin-left: auto; }
#mes-resume { min-width: 0; }
#mes-resume small { color: var(--discret); font-size: 15px; margin-right: var(--e1); }
#mes-resume strong { font-weight: 600; }
#mesures[data-etat="ouvert"] #mes-bascule { display: none; }
#mes-corps { padding: 0 var(--e3) var(--e2); max-height: 62dvh; overflow: auto; overscroll-behavior: contain; }
#mes-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); margin-right: calc(-1 * var(--e2)); }
#mes-titre { font-size: 15px; font-weight: 500; color: var(--discret); }
.bouton-texte {
  display: inline-flex; align-items: center; gap: var(--e1); min-width: 44px; min-height: 44px; padding: 0 var(--e3); border: 0; border-radius: var(--rayon);
  background: transparent; color: var(--accent); font-weight: 600; font-size: 15px;
}
.bouton-texte svg { width: 20px; height: 20px; }
.bouton-texte:hover { background: var(--accent-fond); }
#mes-liste, #mes-liste2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e2) var(--e4); }
#mes-liste > div, #mes-liste2 > div { min-width: 0; }
#mes-liste dt, #mes-liste2 dt { font-size: 15px; color: var(--discret); line-height: 1.25; }
#mes-liste dd, #mes-liste2 dd { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.25; }
#mes-liste dd small, #mes-liste2 dd small { font-size: 15px; font-weight: 400; color: var(--discret); }
.focale { margin-top: var(--e1); font-size: 15px; color: var(--discret); font-variant-numeric: tabular-nums; }
#mes-plus { margin-top: var(--e1); }
#mes-plus > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; font-size: 15px; color: var(--accent); }
#mes-liste2 { margin-top: var(--e1); }
#mes-reperes { margin-top: var(--e1); font-size: 15px; }
#mes-reperes summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; color: var(--accent); }
#mes-reperes p { margin-top: var(--e1); }
#mes-reperes .contexte { color: var(--discret); }

/* bulle d'information d'un pylône (vue piéton) */
#bulle {
  position: fixed; z-index: 22; left: 0; top: 0; width: min(300px, calc(100vw - 16px)); padding: var(--e2) var(--e2) var(--e2) var(--e4);
  border: 1px solid var(--filet); border-radius: var(--rayon);
}
.bulle-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); }
#bulle-titre { font-size: 17px; font-weight: 600; }
#bulle-fermer { width: 44px; height: 44px; margin: -2px 0 -2px 0; border: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
#bulle-liste { padding-right: var(--e2); }
#bulle-liste > div { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 var(--e3); padding: var(--e1) 0; border-top: 1px solid var(--filet); }
#bulle-liste dt { font-size: 15px; color: var(--discret); }
#bulle-liste dd { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
#bulle-liste dd small { display: block; font-size: 15px; font-weight: 400; color: var(--discret); }
.bulle-note { font-size: 15px; color: var(--discret); padding: var(--e1) var(--e2) var(--e1) 0; }

/* notes brèves en haut de la scène (message d'entrée en piéton, légende du repère d'échelle) : sous la ligne des mesures, jamais au centre */
.note-haut { align-self: flex-start; max-width: min(100%, 520px); margin: 0; padding: var(--e1) var(--e3); border: 1px solid var(--filet); border-radius: var(--rayon); font-size: 15px; line-height: 1.3; pointer-events: none !important; }

/* barre d'actions du téléphone : flottante */
#barre {
  position: fixed; z-index: 25; left: calc(var(--sa-g) + var(--e2)); right: calc(var(--sa-d) + var(--e2)); bottom: calc(var(--sa-b) + var(--e2)); display: flex; gap: 2px; padding: var(--e1);
  border: 1px solid var(--filet); border-radius: var(--rayon);
}
#barre button {
  flex: 1 1 0; min-width: 44px; min-height: 52px; background: none; border: 0; border-radius: calc(var(--rayon) - 4px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 14px; line-height: 1.1; color: var(--discret); padding: var(--e1) 0;
}
#barre button svg { width: 24px; height: 24px; }
#barre button[aria-pressed="true"] { color: var(--accent-fort); font-weight: 600; background: var(--accent-fond); }

#attrib {
  position: fixed; z-index: 18; left: 0; right: 0; bottom: var(--bas-barre); padding: 2px var(--e2); text-align: center; font-size: 15px; line-height: 1.25; color: var(--encre); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: color-mix(in srgb, var(--fond) 72%, transparent);
}

#attrib .fuseau-src { display: block; }
#attrib .fuseau-src.long { display: none; }
#attrib a { color: var(--accent); text-decoration: underline; display: inline-block; padding: 14px 6px; margin: -14px 0; }
.alerte-hauteur { color: var(--alerte-encre); background: var(--alerte-fond); border: 1px solid var(--alerte-trait); border-radius: var(--rayon); padding: var(--e2) var(--e3); }
#p-sources a { color: var(--accent); display: inline-block; min-height: 44px; padding: 10px 0; box-sizing: border-box; }

/* joystick virtuel */
#joystick { position: fixed; z-index: 16; left: calc(var(--sa-g) + var(--e4)); bottom: calc(var(--bas-barre) + 48px); width: 132px; height: 132px; touch-action: none; }
#joystick .base { width: 100%; height: 100%; border-radius: 50%; background: color-mix(in srgb, var(--fond) 55%, transparent); border: 1px solid var(--filet); position: relative; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#joystick .bouton { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: var(--accent); opacity: .85; }
#echelle { position: fixed; z-index: 16; right: var(--e3); bottom: calc(var(--bas-barre) + 34px); display: none; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 15px; font-variant-numeric: tabular-nums;
  padding: 2px var(--e2); border-radius: var(--rayon); }
#echelle .trait { height: 6px; width: 80px; border: 2px solid var(--encre); border-top: 0; display: block; }

/* panneau : tiroir bas sur téléphone */
#panneau {
  position: fixed; z-index: 35; left: 0; right: 0; bottom: 0; max-height: 50dvh; display: flex; flex-direction: column;
  border-top: 1px solid var(--filet); border-radius: var(--rayon) var(--rayon) 0 0; padding: 0 var(--e4) calc(var(--e3) + var(--sa-b));
  transform: translateY(105%); visibility: hidden; transition: transform .22s ease, visibility 0s .22s;
}
#panneau[data-etat="ouvert"] { transform: none; visibility: visible; transition: transform .22s ease; }
@media (prefers-reduced-motion: reduce) { #panneau, #panneau[data-etat="ouvert"] { transition: none; } }
#tete-panneau { touch-action: none; cursor: grab; }
#poignee { padding: var(--e2) 0 0; display: flex; justify-content: center; }
#poignee span { width: 36px; height: 4px; border-radius: 2px; background: var(--trait); }
.entete-panneau { display: flex; align-items: center; gap: var(--e2); }
/* téléphone : le titre est masqué visuellement (il répète la page), « Fermer » prend la place à droite de la rangée d'onglets */
.entete-panneau h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; font-size: 17px; font-weight: 600; line-height: 1.2; }
.entete-panneau h1 span { font-weight: 400; font-size: 15px; color: var(--discret); }
#fermer { position: absolute; top: var(--e3); right: var(--e2); z-index: 1; }
#onglets { padding-right: 104px; }
.icone { width: 44px; height: 44px; border: 1px solid var(--filet); border-radius: var(--rayon); background: transparent; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.icone svg { width: 22px; height: 22px; }
#rouvrir { background: var(--verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
#replier { display: none; }
#fermer { background: var(--accent-fond); }
#corps-panneau { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.vues-bureau.seg { display: none; }
#onglets { display: flex; gap: var(--e3); margin-bottom: var(--e2); border-bottom: 1px solid var(--filet); }
#onglets [role="tab"] { flex: 0 0 auto; min-height: 44px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 500; font-size: 15px; color: var(--discret); padding: var(--e1) var(--e1) 0; margin-bottom: -1px; }
#onglets [role="tab"][aria-selected="true"] { color: var(--accent-fort); border-bottom-color: var(--accent); font-weight: 600; }
.onglet { overflow: auto; min-height: 0; flex: 1; padding: var(--e1) 0 var(--e2); overscroll-behavior: contain; }
.onglet[hidden] { display: none; }
.champ { display: block; margin: 0 0 var(--e5); padding: 0; border: 0; min-width: 0; }
.champ legend, .champ .lib { font-weight: 600; font-size: 16px; padding: 0; margin-bottom: var(--e2); display: block; }
.rang { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e2); }
output { font-variant-numeric: tabular-nums; font-weight: 600; }
.note { font-size: 15px; color: var(--discret); margin-top: var(--e2); }
select { width: 100%; min-height: 44px; padding: 0 var(--e3); border: 1px solid var(--trait); border-radius: var(--rayon); background: transparent; }
select option { background: var(--fond); color: var(--encre); }
input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--accent); }
/* boutons exclusifs : une piste, le choix actif est cerclé d'accent */
.seg { display: flex; gap: 2px; padding: 3px; background: var(--puce); border-radius: var(--rayon); }
.sous-seg { margin-top: var(--e3); }
.seg-b { flex: 1; min-height: 44px; border: 0; border-radius: calc(var(--rayon) - 3px); background: transparent; padding: var(--e1) var(--e2); font-size: 15px; font-weight: 500; line-height: 1.2; color: var(--encre); }
.seg-b[aria-pressed="true"] { background: var(--fond); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent); font-weight: 600; }
.interrupteurs { display: grid; gap: var(--e1); margin-bottom: var(--e4); }
.interrupteurs.navig { margin: var(--e3) 0 0; }
.inter { display: flex; align-items: center; gap: var(--e3); min-height: 44px; font-size: 16px; position: relative; cursor: pointer; }
.note-inline { font-size: 15px; color: var(--discret); }
.inter input { position: absolute; opacity: 0; width: 44px; height: 44px; margin: 0; left: 0; }
.piste { flex: none; width: 46px; height: 26px; border-radius: 13px; border: 2px solid var(--trait); background: transparent; position: relative; }
.piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--discret); }
.inter input:checked + .piste { background: var(--accent); border-color: var(--accent); }
.inter input:checked + .piste::after { left: 23px; background: var(--accent-encre); }
.inter input:focus-visible + .piste { outline: 3px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; gap: var(--e2); flex-wrap: wrap; margin-bottom: var(--e3); }
.bouton-sec, .bouton { min-height: 44px; padding: var(--e1) var(--e4); border-radius: var(--rayon); border: 1px solid var(--trait); background: transparent; font-weight: 500; }
.bouton { background: var(--accent); color: var(--accent-encre); border-color: var(--accent); font-weight: 600; }
.champ .bouton-sec { margin-top: var(--e3); }

/* étiquettes de statut : jamais la couleur seule (le texte dit le statut) */
.badge { display: inline-block; padding: 0 var(--e2); border-radius: 10px; font-size: 14px; font-weight: 600; line-height: 20px; white-space: nowrap; vertical-align: middle; border: 1px solid currentColor; }
.badge.st-source { background: var(--st-source-f); color: var(--st-source-e); }
.badge.st-fourchette { background: var(--st-fourchette-f); color: var(--st-fourchette-e); }
.badge.st-calcule { background: var(--st-calcule-f); color: var(--st-calcule-e); }
.badge.st-hypothese { background: var(--st-hypothese-f); color: var(--st-hypothese-e); }
.badge.st-fictif { background: var(--st-fictif-f); color: var(--st-fictif-e); }

/* panneau des sources */
#p-sources h3 { font-size: 17px; font-weight: 600; margin: var(--e4) 0 var(--e2); padding-bottom: var(--e1); border-bottom: 1px solid var(--filet); }
#p-sources h4 { font-size: 16px; font-weight: 600; margin: 0; flex: 1; }
#p-sources p { margin: var(--e1) 0; font-size: 15px; }
#p-sources .ligne { border-left: 3px solid var(--trait-doux); padding: var(--e1) 0 var(--e1) var(--e3); margin: 0 0 var(--e3); }
#p-sources .ligne.st-hypothese { border-left-color: var(--alerte-trait); }
#p-sources .ligne header { display: flex; gap: var(--e2); align-items: flex-start; }
#p-sources .valeur { font-weight: 600; font-variant-numeric: tabular-nums; }
#p-sources .src, #p-sources .nuance { color: var(--discret); }
#p-sources details { font-size: 15px; }
#p-sources summary { min-height: 44px; cursor: pointer; display: flex; align-items: center; }
#p-sources blockquote { margin: var(--e1) 0; padding-left: var(--e3); border-left: 2px solid var(--trait); color: var(--discret); }
.alerte { background: var(--alerte-fond); color: var(--alerte-encre); border: 1px solid var(--alerte-trait); border-radius: var(--rayon); padding: var(--e3); font-size: 15px; }
.contexte { border: 1px solid var(--filet); border-radius: var(--rayon); padding: var(--e2) var(--e3); }
.legende-statuts { font-size: 15px; line-height: 2; }

dialog { border: 1px solid var(--filet); border-radius: var(--rayon); background: var(--fond); color: var(--encre); padding: var(--e5); max-width: min(92vw, 520px); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: rgba(10, 16, 20, .5); }
dialog h2 { font-size: 22px; font-weight: 600; margin-bottom: var(--e1, 4px); }
dialog #accueil-titre + .sous-titre { font-size: 16px; color: var(--discret); margin-bottom: var(--e2); }
dialog .initiative { font-size: 16px; font-weight: 500; margin-bottom: var(--e4); padding-bottom: var(--e3); border-bottom: 1px solid var(--trait-doux); }
.entete-panneau h1 small.initiative { display: block; font-size: 15px; font-weight: 400; color: var(--discret); margin-top: 2px; }
dialog h3 { font-size: 15px; font-weight: 600; color: var(--discret); margin: var(--e4) 0 var(--e2); text-transform: none; }
dialog p, dialog li { margin: 0 0 var(--e3); }
dialog ul { padding-left: var(--e5); }
dialog form { margin-top: var(--e4); }
kbd { font: inherit; font-weight: 600; padding: 0 var(--e1); border: 1px solid var(--trait); border-radius: 4px; background: var(--puce); white-space: nowrap; }
.gestes { list-style: none; padding: 0; display: grid; gap: var(--e3); }
.gestes li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--e3); align-items: start; margin: 0; }
.gestes svg { width: 48px; height: 48px; color: var(--accent); }
.gestes strong { display: block; font-weight: 600; line-height: 1.3; }
.gestes span { display: block; font-size: 15px; color: var(--discret); margin-top: 2px; }
dialog .note { margin-top: var(--e3); }

#rouvrir { position: fixed; z-index: 30; left: calc(var(--sa-g) + var(--e2)); top: calc(var(--sa-h) + var(--h-bandeau) + var(--e2)); }

/* ordinateur et tablette : panneau latéral à gauche, mesures en haut à droite, pas de barre du bas */
@media (min-width: 768px) and (min-height: 500px) {
  .long { display: inline; }
  :root { --bas-barre: 0px; }
  #barre { display: none; }
  #attrib { bottom: 0; right: auto; left: 0; text-align: left; padding: 2px var(--e3); border-top-right-radius: var(--rayon); max-width: 70vw; white-space: normal; }
  #attrib .fuseau-src.long { display: block; }
  #haut { left: auto; align-items: flex-end; }
  #haut > .puce-etat, #haut > #legende, #haut > .note-haut { align-self: flex-end; }
  /* le message d'entrée se pose en haut au centre de la scène (la carte des mesures occupe la droite) */
  #haut > #message { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--sa-h) + var(--h-bandeau) + var(--e2)); text-align: center; }
  #mesures[data-etat="ouvert"] { flex: 0 0 300px; }
  #mes-corps { max-height: 46dvh; }
  .entete-panneau h1 { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; flex: 1; }
  #onglets { padding-right: 0; }
  #panneau {
    left: var(--e2); right: auto; top: calc(var(--sa-h) + var(--h-bandeau) + var(--e2)); bottom: 56px; width: 360px; max-height: none; border: 1px solid var(--filet); border-radius: var(--rayon);
    padding-bottom: var(--e3); transform: none; visibility: visible; transition: none;
  }
  #tete-panneau { cursor: default; touch-action: auto; }
  #panneau[data-etat="replie"] { transform: translateX(-120%); visibility: hidden; }
  #poignee, #fermer { display: none; }
  #replier { display: inline-flex; }
  .vues-bureau.seg { display: flex; margin-bottom: var(--e3); }
  .vues-bureau .seg-b { flex: 1; }
  #joystick { bottom: 56px; }
  #echelle { bottom: 44px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  :root { --haut-barre: 56px; }
  #barre button { min-height: 44px; flex-direction: row; justify-content: center; font-size: 14px; }
  #barre button svg { width: 20px; height: 20px; }
  #mesures[data-etat="ouvert"] { max-width: 46vw; }
  #mes-corps { max-height: 52dvh; }
  #mes-liste, #mes-liste2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panneau { max-height: 92dvh; left: auto; width: min(480px, 60vw); right: 0; border-radius: var(--rayon) 0 0 0; }
  #joystick { left: auto; right: calc(var(--sa-d) + var(--e4)); width: 110px; height: 110px; bottom: calc(var(--bas-barre) + 40px); }
  #echelle { right: auto; left: var(--e3); }
}

/* notes courtes avec détail replié (le texte complet reste accessible) */
.note details { margin-top: var(--e1); }
.note summary, .rubrique > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--accent-fort); font-weight: 500; }
.note details > p { margin: 0 0 var(--e2); }
.note details > p + p { margin-top: var(--e2); }
/* choix du lieu */
#liste-lieux, #liste-communes { display: grid; gap: var(--e2); }
.lieu-b { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 56px; padding: var(--e2) var(--e3); text-align: left; border: 1px solid var(--trait); border-radius: var(--rayon); background: transparent; font-weight: 500; line-height: 1.25; }
.lieu-b small { font-size: 15px; font-weight: 400; color: var(--discret); }
.lieu-b[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-fort); font-weight: 600; background: var(--accent-fond); }
#lieu-info { margin-top: var(--e4); }
/* panneau des sources : rubriques repliables */
.rubrique { border-bottom: 1px solid var(--filet); }
.rubrique > summary { font-size: 17px; font-weight: 600; color: var(--encre); list-style: none; justify-content: space-between; }
.rubrique > summary::-webkit-details-marker { display: none; }
.rubrique > summary::after { content: ""; width: 10px; height: 10px; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); margin: -4px var(--e2) 0 var(--e2); flex: none; }
.rubrique[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
#p-sources .rubrique > summary h3 { all: unset; }
.rubrique .rub-corps { padding-bottom: var(--e3); }
.legende-statuts { margin: var(--e3) 0; }
#p-sources .detail { margin: var(--e1) 0; }
#p-sources .detail > summary { color: var(--accent-fort); font-weight: 500; }
.etiquette-multi { white-space: normal !important; max-width: 190px; text-align: center; line-height: 1.2; }
#bulle-liste dd small { display: inline; margin-left: var(--e1); }
#bulle-liste > div { flex-wrap: nowrap; }
#bulle-liste dt { min-width: 0; }

#parcours-sortie { font-variant-numeric: tabular-nums; }
#p-parcours .actions { display: flex; gap: var(--e2); flex-wrap: wrap; }
#p-parcours .actions .bouton-sec { margin-top: var(--e2); }

/* téléphone : quatre onglets (Parcourir, Lieux, Réglages, Sources) + « Fermer » sur une seule rangée */
@media (max-width: 767px) {
  #onglets { gap: 2px; padding-right: 98px; }
  #onglets [role="tab"] { padding-left: 6px; padding-right: 6px; }
  #fermer { padding-left: 8px; padding-right: 10px; }
}
