/* Écran 5 : le module, lu de bas en haut comme une montée. Dans le flux en fin de page, ou jauge élargie (dialog). */
.reserver { padding: 44px 0 40px; scroll-margin-top: var(--barre-h); }

.module { --rep-w: 76px; }
.etapes { display: flex; flex-direction: column-reverse; position: relative; }
.etapes::before {
  content: ""; position: absolute; left: calc(var(--rep-w) - 1px); top: 0; bottom: 0; width: 2px; background: rgb(157 176 169 / .3);
}
.etape { position: relative; display: grid; grid-template-columns: var(--rep-w) minmax(0, 1fr); column-gap: 18px; padding: 18px 0; }
.etape + .etape { border-bottom: 1px solid var(--filet-clair); }
.etape__repere { position: relative; display: grid; align-content: start; justify-items: end; padding-right: 16px; gap: 2px; }
.etape__repere::after {
  content: ""; position: absolute; right: -6px; top: 8px; width: 12px; height: 12px; background: var(--sapin);
  border: 2px solid var(--lichen); box-sizing: border-box;
}
.etape.est-fait .etape__repere::after { background: var(--jaune); border-color: var(--jaune); }
.etape.est-ici .etape__repere::after { box-shadow: 0 0 0 4px rgb(232 178 26 / .3); }
.etape__repere b { font: 600 20px/1 var(--titre); color: var(--lichen); white-space: nowrap; }
.etape.est-fait .etape__repere b { color: var(--jaune); }
.etape__repere span { font: 500 14px/1.2 var(--texte); color: var(--lichen); text-align: right; }
.etape__champ { display: grid; gap: 12px; align-content: start; min-width: 0; }

.lieux { display: grid; }
.jours {
  display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin;
  padding-bottom: 6px; margin-right: -2px;
}
.jour {
  flex: none; width: 58px; min-height: 72px; display: grid; place-content: center; text-align: center; gap: 2px;
  background: none; border: 1px solid var(--filet-clair); color: var(--neige); scroll-snap-align: start;
  font: 500 14px/1.1 var(--texte);
}
.jour b { font: 600 24px/1 var(--titre); }
.jour[aria-pressed="true"] { background: var(--jaune); color: var(--sapin); border-color: var(--jaune); }
.jour:disabled { color: rgb(157 176 169 / .55); border-style: dashed; cursor: not-allowed; }
.jour:disabled b { text-decoration: line-through; }
.champ { display: grid; gap: 6px; font: 500 14px/1.2 var(--texte); color: var(--lichen); }
.champ select {
  min-height: 48px; padding: 0 12px; font-size: 16px; color: var(--neige); background: var(--sapin);
  border: 1px solid var(--lichen); border-radius: 0; max-width: 220px;
}

.motos-m { display: grid; }
.moto-m { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--filet-clair); }
.moto-m:last-child { border-bottom: 0; }
.moto-m b { font: 600 24px/1 var(--titre); }
.moto-m p { grid-column: 1; font-size: 14px; color: var(--lichen); }
.moto-m p .reste { color: var(--jaune); font-weight: 600; }
.pas { grid-row: 1 / span 2; grid-column: 2; display: flex; align-items: center; }
.pas button { width: 44px; height: 44px; background: none; border: 1px solid var(--lichen); color: var(--neige); font: 600 22px/1 var(--texte); display: grid; place-content: center; }
.pas button:disabled { opacity: .35; cursor: not-allowed; }
.pas output { min-width: 34px; text-align: center; font: 600 22px/1 var(--titre); }

.durees { display: flex; flex-wrap: wrap; column-gap: 14px; }
.durees .case:disabled { color: rgb(157 176 169 / .6); cursor: not-allowed; }
.durees .case:disabled .nom { text-decoration: line-through; }
.durees .case small { font-size: 14px; color: var(--rouge); font-weight: 600; }

.retour { font: 600 24px/1.15 var(--titre); }
.retour small { display: block; font: 500 14px/1.3 var(--texte); color: var(--lichen); margin-top: 4px; }

.sommet { display: grid; gap: 10px; }
.total { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; }
.total b { font: 700 44px/1 var(--titre); color: var(--jaune); }
.total span { font-size: 16px; color: var(--neige); }
.total .eco { color: var(--jaune); font-weight: 600; }
.sommet__conditions { display: grid; gap: 6px; font-size: 16px; }
.sommet__conditions p { max-width: 52ch; }
.statut { min-height: 0; font-size: 16px; color: var(--neige); border-left: 3px solid var(--jaune); padding-left: 12px; }
.statut:empty { display: none; }
.module .panneau { justify-self: start; min-width: 200px; }
.module__vide { color: var(--lichen); }

@media (min-width: 1024px) {
  .reserver .module { --rep-w: clamp(240px, 26vw, 520px); }
  .reserver .etape__champ { max-width: 1040px; }
  .reserver .etape { column-gap: clamp(28px, 3vw, 56px); padding: 26px 0; }
  .reserver .etape__repere { padding-right: 28px; }
  .reserver .etape__repere b { font-size: clamp(56px, 5.6vw, 112px); }
  .reserver .etape__repere span { font-size: 16px; }
  .reserver .etape__repere::after { right: -7px; top: 14px; width: 14px; height: 14px; }
  .reserver .moto-m { grid-template-columns: minmax(0, 1fr) auto auto; }
  .reserver .moto-m p { grid-column: auto; grid-row: 1; }
  .reserver .pas { grid-row: 1; grid-column: 3; }
}

/* ---------- La jauge élargie (dialog) ---------- */
.jauge-module {
  position: fixed; inset: calc(var(--demobar-offset, 0px) + var(--barre-h)) 0 0 auto;
  width: 100%; max-width: none; height: auto; max-height: none; margin: 0; padding: 0; border: 0;
  background: var(--panneau); color: var(--neige); border-left: 1px solid var(--filet);
  display: none; flex-direction: column; overflow: hidden;
  transform: translateX(100%); transition: transform .35s var(--courbe);
}
.jauge-module[open] { display: flex; }
.jauge-module.est-ouverte { transform: none; }
.jauge-module::backdrop { background: rgb(6 14 10 / .62); }
.jauge-module__tete {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 12px 6px max(16px, env(safe-area-inset-left)); border-bottom: 1px solid var(--filet-clair);
}
.jauge-module__tete h2 { font: 600 26px/1 var(--titre); }
.fermer {
  display: inline-flex; align-items: center; gap: 8px; min-width: 48px; min-height: 48px; padding: 0 8px;
  background: none; border: 0; color: var(--neige); font: 600 16px/1 var(--texte);
}
.fermer svg { width: 16px; height: 16px; color: var(--jaune); }
.jauge-module__corps {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column-reverse;
  padding: 0 max(16px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(12px, env(safe-area-inset-left));
}
.jauge-module .etape[data-etape="sommet"] { position: sticky; top: 0; z-index: 2; background: var(--panneau); }
.jauge-module .etape__repere::after { background: var(--panneau); }
@media (min-width: 768px) {
  .jauge-module { width: 440px; right: 0; transform: scaleX(.145); transform-origin: right center; }
  .jauge-module .jauge-module__tete, .jauge-module .jauge-module__corps { opacity: 0; transition: opacity .35s .2s; }
  .jauge-module.est-ouverte .jauge-module__tete, .jauge-module.est-ouverte .jauge-module__corps { opacity: 1; }
}

/* ---------- Tiroir du circuit guidé ---------- */
.tiroir {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 92dvh; margin: 0; padding: 0; border: 0;
  background: var(--panneau); color: var(--neige); overflow-y: auto; overscroll-behavior: contain;
  transform: translateY(100%); transition: transform .35s var(--courbe);
}
.tiroir.est-ouverte { transform: none; }
.tiroir::backdrop { background: rgb(6 14 10 / .62); }
.tiroir__tete { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; padding: 4px 8px 4px 16px; background: var(--panneau); border-bottom: 1px solid var(--filet-clair); }
.tiroir__tete h2 { font: 600 26px/1 var(--titre); }
.tiroir img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tiroir__corps { display: grid; gap: 18px; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
.tiroir__titre { font: 600 26px/1.1 var(--titre); }
.tiroir__chiffres { font-size: 14px; color: var(--lichen); }
.tiroir fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.tiroir legend { padding: 0 0 4px; font: 500 14px/1.2 var(--texte); color: var(--lichen); }
.tiroir .ligne-choix { display: flex; flex-wrap: wrap; column-gap: 16px; }
.tiroir input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.tiroir input:focus-visible + .case { outline: 2px solid var(--jaune); outline-offset: 2px; }
.etapes-c { display: grid; gap: 8px; }
.etapes-c li { display: grid; grid-template-columns: 34px 1fr; gap: 8px; font-size: 15px; }
.etapes-c li b { font: 600 18px/1.3 var(--titre); color: var(--jaune); }
.etapes-c small { display: block; font-size: 14px; color: var(--lichen); }
.departs-c { display: grid; gap: 2px; }
.devis-c { display: grid; gap: 4px; padding-top: 12px; border-top: 1px solid var(--filet-clair); }
.devis-c .t { font: 700 36px/1 var(--titre); color: var(--jaune); }
@media (min-width: 768px) {
  .tiroir { inset: calc(var(--demobar-offset, 0px) + var(--barre-h)) 0 0 auto; width: 480px; max-height: none; height: auto; transform: translateX(100%); }
  .tiroir.est-ouverte { transform: none; }
}
html:has(dialog[open]) { overflow: hidden; }
