@font-face {
  font-family: "Inter";
  src: url("/polices/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --vert: #00a86b;
  --vert-vif: #2fd895;
  --vert-fonce: #00744a;
  --vert-fonce-2: #005c3b;
  --vert-nuit: #0b3d2e;
  --vert-pale: #e7f6ef;
  --vert-pale-2: #d2efe2;
  --encre: #1d1b18;
  --encre-2: #5c574f;
  --encre-3: #7a746a;
  --fond: #faf8f4;
  --surface: #ffffff;
  --surface-2: #f4f1eb;
  --surface-3: #ebe6dc;
  --trait: #e5dfd4;
  --trait-fort: #c9c1b3;
  --alerte: #8a4b00;
  --alerte-fond: #fff4dc;
  --alerte-trait: #f2d394;
  --erreur: #a8251a;
  --erreur-fond: #fdeeec;
  --erreur-trait: #f3c3bd;
  --libre: #12a150;
  --occupe: #d4442e;
  --hors: #8d877d;
  --p0: #8592a6;
  --p1: #2f7fc8;
  --p2: #00a86b;
  --p3: #7a3fd6;
  --pinc: #b5ada0;
  --rayon-s: 10px;
  --rayon: 12px;
  --rayon-l: 14px;
  --ombre: 0 1px 2px rgb(45 35 15 / 0.06), 0 6px 18px rgb(45 35 15 / 0.10);
  --ombre-forte: 0 2px 6px rgb(45 35 15 / 0.08), 0 18px 44px rgb(45 35 15 / 0.16);
  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --largeur-panneau: 400px;
  --marge: 12px;
  --feuille-plein: calc(100vh - 72px);
  --feuille-visible: 46vh;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; margin: 0; }
body {
  font-family: var(--police);
  font-size: 15px;
  line-height: 1.45;
  color: var(--encre);
  background: var(--fond);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--vert-fonce); text-underline-offset: 2px; }
a:hover { color: var(--vert-fonce-2); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
input::placeholder { color: var(--encre-3); opacity: 1; }

:focus-visible { outline: 3px solid var(--vert); outline-offset: 2px; border-radius: 6px; }
.sr {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.evitement {
  position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 14px;
  background: var(--vert-nuit); color: #fff; border-radius: var(--rayon-s); text-decoration: none; font-weight: 600;
}
.evitement:focus { top: 12px; color: #fff; }

.ico { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.tabulaire { font-variant-numeric: tabular-nums; }

/* ---------- Carte ---------- */
.carte { position: fixed; inset: 0; background: #e2dfda; }
.carte .maplibregl-canvas:focus-visible { outline: 3px solid var(--vert); outline-offset: -3px; }
.maplibregl-ctrl-attrib { font-size: 11px; }
.maplibregl-ctrl-attrib a { color: var(--encre-2); }
.maplibregl-ctrl-group { border-radius: var(--rayon-s) !important; box-shadow: var(--ombre) !important; }
.maplibregl-popup-content { border-radius: var(--rayon); box-shadow: var(--ombre-forte); padding: 6px; font-family: var(--police); }
.maplibregl-popup-tip { display: none; }

.menu-carte { display: flex; flex-direction: column; min-width: 190px; }
.menu-carte button {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none;
  border-radius: 8px; text-align: left; font-size: 14px; font-weight: 500;
}
.menu-carte button:hover, .menu-carte button:focus-visible { background: var(--vert-pale); outline-offset: -2px; }
.menu-carte .ico { color: var(--vert-fonce); }

.repere {
  display: grid; place-items: center; border: 0; padding: 0; font-weight: 700; font-size: 12px;
  font-family: var(--police); line-height: 1; box-shadow: 0 1px 4px rgb(0 0 0 / 0.3);
}
.repere-depart { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 5px solid var(--vert-nuit); }
.repere-etape { width: 22px; height: 22px; border-radius: 50%; background: var(--vert-nuit); color: #fff; border: 2px solid #fff; }
.repere-arrivee {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--vert-nuit); border: 2px solid #fff;
}
.repere-arrivee .ico { transform: rotate(45deg); color: var(--vert-vif); width: 16px; height: 16px; }
.repere-arret {
  min-width: 30px; height: 30px; padding: 0 6px 0 4px; border-radius: 9px; background: var(--vert-fonce); color: #fff;
  border: 2px solid #fff; display: flex; gap: 1px; cursor: pointer; font-size: 13px;
}
.repere-arret .ico { width: 14px; height: 14px; color: var(--vert-vif); }
.repere-arret:hover { background: var(--vert-nuit); }
.repere-choisi {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--vert-nuit);
  background: rgb(0 168 107 / 0.18); box-shadow: 0 0 0 3px #fff; pointer-events: none;
}
.repere-manoeuvre {
  width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; background: var(--vert-nuit);
  box-shadow: 0 0 0 6px rgb(0 168 107 / 0.35); pointer-events: none;
}
.repere-position {
  width: 16px; height: 16px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff;
  box-shadow: 0 0 0 6px rgb(26 115 232 / 0.25); pointer-events: none;
}

/* ---------- Colonne : en-tête + panneau ---------- */
.colonne {
  position: fixed; z-index: 20; top: var(--marge); left: var(--marge); bottom: var(--marge);
  width: var(--largeur-panneau); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--rayon-l); box-shadow: var(--ombre-forte); overflow: hidden;
}
.entete {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--trait); min-height: 56px; flex: none;
}
.marque { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--vert-nuit); border-radius: 8px; }
.marque-logo { width: 30px; height: 30px; flex: none; }
.marque-nom { font-weight: 750; font-size: 19px; letter-spacing: -0.02em; }
.marque-point { color: var(--vert); padding: 0 1px; }

.panneau { flex: 1; min-height: 0; display: flex; flex-direction: column; outline: none; }
.poignee { display: none; }
.panneau-defile { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 16px 20px; scrollbar-gutter: stable; }
.vue { display: flex; flex-direction: column; gap: 14px; }
.titre-vue { font-size: 20px; font-weight: 700; color: var(--vert-nuit); }
.vue-tete { display: flex; align-items: center; gap: 8px; margin: -4px 0 0 -6px; }
.vue-tete h2 { font-size: 18px; font-weight: 700; color: var(--vert-nuit); outline: none; min-width: 0; }
.vue h3 { font-size: 14px; font-weight: 650; color: var(--encre); }
.pied-panneau { font-size: 13px; color: var(--encre-2); margin-top: 6px; text-align: center; }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 8px 14px; border-radius: var(--rayon-s); border: 1px solid transparent;
  font-weight: 600; font-size: 14px; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s;
}
.bouton-principal { background: var(--vert-fonce); color: #fff; }
.bouton-principal:hover { background: var(--vert-fonce-2); color: #fff; }
.bouton-principal:disabled { background: #7aa894; }
.bouton-secondaire { background: var(--surface); border-color: var(--trait-fort); color: var(--vert-nuit); }
.bouton-secondaire:hover { border-color: var(--vert-fonce); background: var(--vert-pale); color: var(--vert-nuit); }
.bouton-discret { background: transparent; color: var(--vert-nuit); }
.bouton-discret:hover { background: var(--surface-2); }
.bouton-danger { background: var(--erreur); color: #fff; }
.bouton-danger:hover { background: #8a1d14; color: #fff; }
.bouton-large { width: 100%; min-height: 46px; font-size: 15px; }
.bouton-petit { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.bouton[aria-busy="true"] .ico { animation: tourne 1s linear infinite; }

.bouton-icone {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: 50%; border: 0; background: transparent; color: var(--encre-2);
}
.bouton-icone:hover { background: var(--surface-2); color: var(--encre); }
.lien-bouton {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 6px 4px;
  color: var(--vert-fonce); font-weight: 600; font-size: 14px; border-radius: 8px;
}
.lien-bouton:hover { color: var(--vert-fonce-2); text-decoration: underline; text-underline-offset: 3px; }
.lien-bouton:disabled { color: var(--encre-3); text-decoration: none; }

.bouton-compte { max-width: 210px; padding: 6px 10px; }
.bouton-compte span { overflow: hidden; text-overflow: ellipsis; }
.initiales {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--vert-nuit); color: #fff; font-size: 12px; font-weight: 700; flex: none;
}

/* ---------- Menu de compte ---------- */
.compte { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 230px; padding: 6px;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre-forte);
}
.menu-entete { padding: 8px 10px 10px; border-bottom: 1px solid var(--trait); margin-bottom: 4px; }
.menu-entete strong { display: block; font-size: 14px; }
.menu-entete span { font-size: 12.5px; color: var(--encre-2); word-break: break-all; }
.menu [role="menuitem"] {
  display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 8px;
  background: none; text-align: left; font-size: 14px; font-weight: 500; color: var(--encre);
}
.menu [role="menuitem"]:hover, .menu [role="menuitem"]:focus { background: var(--vert-pale); outline: none; }
.menu [role="menuitem"] .ico { color: var(--vert-fonce); }
.menu [role="separator"] { height: 1px; background: var(--trait); margin: 4px 0; }

/* ---------- Formulaire ---------- */
.form-itin { display: flex; flex-direction: column; gap: 12px; }
.points-zone { position: relative; padding-right: 40px; }
.points { display: flex; flex-direction: column; gap: 6px; position: relative; }
.point { display: flex; align-items: center; gap: 8px; position: relative; }
.point-marque {
  width: 22px; flex: none; display: grid; place-items: center; color: var(--vert-nuit); position: relative; z-index: 1;
}
.point-marque .rond { width: 13px; height: 13px; border-radius: 50%; border: 3.5px solid var(--vert-nuit); background: #fff; }
.point-marque .numero {
  width: 18px; height: 18px; border-radius: 50%; background: var(--vert-nuit); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}
.points::before {
  content: ""; position: absolute; left: 10px; top: 22px; bottom: 22px; border-left: 2px dotted var(--trait-fort);
}
.point .combo { flex: 1; min-width: 0; }
.point-retirer { width: 32px; height: 32px; }
.inverser { position: absolute; right: 0; top: 50%; transform: translateY(-50%); border: 1px solid var(--trait); background: var(--surface); }
.inverser:hover { border-color: var(--trait-fort); }
.points-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-top: -4px; padding-left: 26px; }

.champ { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.champ > label, .champ > legend, .curseur > label { font-size: 13px; font-weight: 600; color: var(--encre); padding: 0; }
.unite { font-weight: 400; color: var(--encre-2); }
.aide { font-size: 12.5px; color: var(--encre-2); }
.aide-source { font-size: 12px; line-height: 1.4; }

input[type="text"], input[type="number"], input[type="search"], select {
  width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--trait-fort); border-radius: var(--rayon-s);
  background: var(--surface); font-size: 15px; transition: border-color .15s, box-shadow .15s;
}
input[type="text"]:hover, input[type="number"]:hover, select:hover { border-color: #a99f8f; }
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  outline: none; border-color: var(--vert-fonce); box-shadow: 0 0 0 3px rgb(0 168 107 / 0.25);
}
input[aria-invalid="true"] { border-color: var(--erreur); }
select {
  appearance: none; padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%235c574f' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.point input[type="text"] { background: var(--surface-2); border-color: transparent; }
.point input[type="text"]:hover { border-color: var(--trait-fort); }
.point input[type="text"]:focus { background: var(--surface); }
.point input.resolu { color: var(--encre); font-weight: 500; }

.curseur { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 8px; }
.curseur output { font-weight: 700; font-size: 14px; color: var(--vert-nuit); font-variant-numeric: tabular-nums; }
.curseur input { grid-column: 1 / -1; width: 100%; accent-color: var(--vert-fonce); height: 26px; margin: 0; }

.cases { flex-direction: row; flex-wrap: wrap; gap: 6px; }
.cases legend { width: 100%; margin-bottom: 6px; }
.case-puce { position: relative; }
.case-puce input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.case-puce span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--trait-fort); background: var(--surface); font-size: 13.5px; font-weight: 500;
}
.case-puce input:checked + span { background: var(--vert-pale); border-color: var(--vert-fonce); color: var(--vert-nuit); font-weight: 600; }
.case-puce input:checked + span::before { content: "✓"; margin-right: 6px; font-weight: 700; }
.case-puce input:focus-visible + span { outline: 3px solid var(--vert); outline-offset: 2px; }

.segments { flex-direction: row; flex-wrap: nowrap; gap: 0; }
.segments legend { width: 100%; margin-bottom: 6px; }
.segments label { flex: 1; position: relative; }
.segments input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.segments span {
  display: grid; place-items: center; min-height: 36px; border: 1px solid var(--trait-fort); margin-left: -1px;
  font-size: 13.5px; font-weight: 500; background: var(--surface);
}
.segments label:first-of-type span { border-radius: var(--rayon-s) 0 0 var(--rayon-s); margin-left: 0; }
.segments label:last-of-type span { border-radius: 0 var(--rayon-s) var(--rayon-s) 0; }
.segments input:checked + span { background: var(--vert-nuit); border-color: var(--vert-nuit); color: #fff; font-weight: 600; position: relative; }
.segments input:focus-visible + span { outline: 3px solid var(--vert); outline-offset: 2px; position: relative; z-index: 1; }

.interrupteur { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 500; cursor: pointer; min-height: 36px; }
.interrupteur input {
  appearance: none; order: 2; width: 40px; height: 24px; border-radius: 999px; background: var(--trait-fort);
  position: relative; flex: none; cursor: pointer; transition: background-color .15s; margin: 0;
}
.interrupteur input::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.25); transition: transform .15s;
}
.interrupteur input:checked { background: var(--vert-fonce); }
.interrupteur input:checked::after { transform: translateX(16px); }
.interrupteur-compact { font-size: 13px; min-height: 28px; justify-content: flex-start; }
.interrupteur-compact input { order: 0; }

.bloc { border: 1px solid var(--trait); border-radius: var(--rayon); background: var(--surface); }
.bloc > summary {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none;
  border-radius: var(--rayon); min-height: 46px;
}
.bloc > summary::-webkit-details-marker { display: none; }
.bloc > summary:hover { background: var(--surface-2); }
.bloc > summary > .ico:first-child { color: var(--vert-fonce); }
.bloc-titre { font-weight: 650; font-size: 14px; flex: none; }
.bloc-resume { flex: 1; min-width: 0; font-size: 13px; color: var(--encre-2); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chevron { color: var(--encre-2); transition: transform .2s; }
.bloc[open] > summary .chevron { transform: rotate(180deg); }
.bloc[open] > summary { border-bottom: 1px solid var(--trait); border-radius: var(--rayon) var(--rayon) 0 0; }
.bloc-corps { padding: 12px; display: flex; flex-direction: column; gap: 14px; }

.message { font-size: 13.5px; border-radius: var(--rayon-s); padding: 10px 12px; display: flex; gap: 8px; align-items: flex-start; }
.message .ico { margin-top: 1px; }
.message-erreur { background: var(--erreur-fond); color: var(--erreur); border: 1px solid var(--erreur-trait); }
.message-alerte { background: var(--alerte-fond); color: var(--alerte); border: 1px solid var(--alerte-trait); }
.message-info { background: var(--vert-pale); color: var(--vert-nuit); border: 1px solid var(--vert-pale-2); }
.message .bouton { margin-top: 6px; }
.message-corps { display: flex; flex-direction: column; gap: 4px; }

.rappel { font-size: 13px; color: var(--encre-2); text-align: center; }
.rappel button { font-size: 13px; padding: 0 2px; }

/* ---------- Autocomplétion ---------- */
.combo { position: relative; }
.combo-liste {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); max-height: 320px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre-forte); padding: 4px;
}
.combo-liste [role="option"] {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.combo-liste [role="option"][aria-selected="true"], .combo-liste [role="option"]:hover { background: var(--vert-pale); }
.combo-liste .ico { color: var(--encre-2); }
.combo-liste .opt-texte { display: flex; flex-direction: column; min-width: 0; }
.combo-liste .opt-label { font-weight: 550; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-liste .opt-detail { font-size: 12.5px; color: var(--encre-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-message { padding: 10px 12px; font-size: 13px; color: var(--encre-2); }

/* ---------- Résultat ---------- */
.resultat-tete { display: flex; align-items: flex-start; gap: 6px; margin: -4px 0 0 -6px; }
.resultat-tete h2 { font-size: 18px; font-weight: 700; color: var(--vert-nuit); outline: none; overflow-wrap: anywhere; }
.resultat-tete .via { font-size: 13px; color: var(--encre-2); margin-top: 3px; }
.synthese { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.synthese > div { background: var(--surface-2); border-radius: var(--rayon-s); padding: 8px 10px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.synthese dt { font-size: 11px; color: var(--encre-2); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; }
.synthese dd { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--vert-nuit); font-variant-numeric: tabular-nums; white-space: nowrap; }
.synthese dd.faible { color: var(--erreur); }
.total { font-size: 13.5px; color: var(--encre-2); }
.total strong { color: var(--encre); font-variant-numeric: tabular-nums; }
.avertissements { display: flex; flex-direction: column; gap: 6px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.actions .bouton { flex: 1 1 auto; }
.mention { font-size: 12px; color: var(--encre-2); }

.section-liste { display: flex; flex-direction: column; gap: 8px; }
.section-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.section-tete h3 .nb { color: var(--encre-2); font-weight: 500; }
.cartes { display: flex; flex-direction: column; gap: 6px; }
.carte-station {
  display: flex; gap: 10px; width: 100%; text-align: left; padding: 10px; border: 1px solid var(--trait);
  border-radius: var(--rayon); background: var(--surface); align-items: flex-start;
}
.carte-station:hover { border-color: var(--trait-fort); background: #fdfcfa; }
.carte-station.arret { border-color: var(--vert-pale-2); background: #f6fbf8; }
.carte-station.incompatible { opacity: .72; }
.carte-station .badge-num {
  flex: none; min-width: 30px; height: 30px; border-radius: 9px; background: var(--vert-fonce); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 1px; font-weight: 700; font-size: 13px; padding: 0 5px;
}
.carte-station .badge-num .ico { width: 13px; height: 13px; color: var(--vert-vif); }
.carte-station .badge-km {
  flex: none; min-width: 52px; text-align: center; font-size: 12px; font-weight: 600; color: var(--encre-2);
  background: var(--surface-2); border-radius: 8px; padding: 4px 6px; font-variant-numeric: tabular-nums;
}
.carte-station .corps { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.carte-station .nom { font-weight: 650; font-size: 14px; overflow-wrap: anywhere; }
.carte-station .ligne { font-size: 12.5px; color: var(--encre-2); }
.carte-station .ligne-forte { font-size: 13px; color: var(--encre); font-variant-numeric: tabular-nums; }
.etiquette {
  display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 6px;
  background: var(--surface-3); color: var(--encre-2); margin-left: 4px; vertical-align: 1px;
}

.dispo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--encre-2); }
.dispo::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--trait-fort); flex: none; }
.dispo.libre::before { background: var(--libre); box-shadow: 0 0 0 3px rgb(18 161 80 / 0.18); }
.dispo.occupe::before { background: var(--occupe); }
.dispo.hors::before { background: var(--hors); }
.dispo.libre { color: #0d7a3c; }
.dispo.occupe { color: #a8341f; }

.feuille-route { border: 1px solid var(--trait); border-radius: var(--rayon); }
.feuille-route > summary { display: flex; align-items: center; gap: 10px; padding: 11px 12px; cursor: pointer; list-style: none; border-radius: var(--rayon); font-weight: 650; font-size: 14px; }
.feuille-route > summary::-webkit-details-marker { display: none; }
.feuille-route > summary:hover { background: var(--surface-2); }
.feuille-route[open] > summary { border-bottom: 1px solid var(--trait); border-radius: var(--rayon) var(--rayon) 0 0; }
.feuille-route > summary .nb { font-weight: 500; color: var(--encre-2); flex: 1; }
.feuille-route[open] > summary .chevron { transform: rotate(180deg); }
.manoeuvres { padding: 4px; }
.manoeuvres .troncon-tete { font-size: 12px; font-weight: 650; color: var(--vert-nuit); padding: 10px 8px 4px; text-transform: uppercase; letter-spacing: .03em; }
.manoeuvre {
  display: flex; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 8px; text-align: left; align-items: flex-start;
}
.manoeuvre:hover { background: var(--surface-2); }
.manoeuvre .ico { color: var(--vert-nuit); width: 20px; height: 20px; margin-top: 1px; }
.manoeuvre .texte { flex: 1; font-size: 13.5px; }
.manoeuvre .dist { font-size: 12.5px; color: var(--encre-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.manoeuvre.recharge .ico { color: var(--vert); }

/* ---------- Compte ---------- */
.onglets { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: var(--rayon); }
.onglets [role="tab"] { flex: 1; border: 0; background: none; padding: 8px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--encre-2); }
.onglets [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--vert-nuit); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.liste-compte { display: flex; flex-direction: column; gap: 8px; }
.element-compte { border: 1px solid var(--trait); border-radius: var(--rayon); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.element-compte .nom { font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.element-compte .ligne { font-size: 12.5px; color: var(--encre-2); }
.element-compte .boutons { display: flex; gap: 6px; flex-wrap: wrap; }
.element-compte form { display: flex; gap: 6px; }
.vide { text-align: center; color: var(--encre-2); font-size: 14px; padding: 18px 8px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.vide .ico { width: 30px; height: 30px; color: var(--trait-fort); }

.sources { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; padding-left: 0; }
.sources li { padding-left: 14px; position: relative; }
.sources li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--vert); }

/* ---------- Filtres et légende ---------- */
.filtres {
  position: fixed; z-index: 15; top: var(--marge); left: calc(var(--largeur-panneau) + var(--marge) * 2); right: calc(var(--marge) + 50px);
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; align-items: center;
}
.filtres::-webkit-scrollbar { display: none; }
body.fiche-ouverte .filtres { right: 404px; }
.filtres-groupe { display: flex; gap: 6px; flex: none; }
.puce {
  display: inline-flex; align-items: center; gap: 5px; min-height: 34px; padding: 6px 12px; border-radius: 999px; flex: none;
  border: 1px solid var(--trait); background: var(--surface); box-shadow: var(--ombre); font-size: 13.5px; font-weight: 550; white-space: nowrap;
}
.puce .ico { width: 15px; height: 15px; color: var(--vert-fonce); }
.puce:hover { border-color: var(--trait-fort); }
.puce[aria-pressed="true"] { background: var(--vert-nuit); border-color: var(--vert-nuit); color: #fff; }
.puce[aria-pressed="true"] .ico { color: var(--vert-vif); }
.puce-effacer { color: var(--encre-2); }

.legende {
  position: fixed; z-index: 15; bottom: calc(var(--marge) + 18px); left: calc(var(--largeur-panneau) + var(--marge) * 2);
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); font-size: 13px; max-width: 280px;
}
.legende summary { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; list-style: none; font-weight: 600; border-radius: var(--rayon); }
.legende summary::-webkit-details-marker { display: none; }
.legende-pastilles { display: inline-flex; gap: 2px; }
.legende-compte { font-weight: 500; color: var(--encre-2); font-variant-numeric: tabular-nums; }
.legende-liste { padding: 2px 12px 8px; display: flex; flex-direction: column; gap: 5px; }
.legende-liste li { display: flex; align-items: center; gap: 8px; }
.legende-maj { padding: 0 12px 10px; font-size: 12px; color: var(--encre-2); }
.pastille { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgb(0 0 0 / .12); flex: none; }
.p0 { background: var(--p0); } .p1 { background: var(--p1); } .p2 { background: var(--p2); } .p3 { background: var(--p3); } .pinc { background: var(--pinc); }
.anneau { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--p2); border: 2px solid #fff; flex: none; }
.anneau-libre { box-shadow: 0 0 0 2.5px var(--libre); }
.anneau-occupe { box-shadow: 0 0 0 2.5px var(--occupe); }
.anneau-aucun { box-shadow: 0 0 0 1px rgb(0 0 0 / .12); }

.etat-carte {
  position: fixed; z-index: 16; top: 60px; left: calc(var(--largeur-panneau) + var(--marge) * 2);
  background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 8px 12px; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px; max-width: min(460px, calc(100vw - 24px));
}
.etat-carte.erreur { color: var(--erreur); }
.roue { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid var(--vert-pale-2); border-top-color: var(--vert-fonce); animation: tourne .8s linear infinite; flex: none; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Fiche station ---------- */
.fiche {
  position: fixed; z-index: 22; top: var(--marge); right: var(--marge); bottom: var(--marge); width: 380px;
  background: var(--surface); border-radius: var(--rayon-l); box-shadow: var(--ombre-forte); display: flex; flex-direction: column; overflow: hidden;
}
.fiche-barre { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--trait); flex: none; }
.fiche-sur-titre { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-2); display: inline-flex; gap: 6px; align-items: center; }
.fiche-defile { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px 22px; display: flex; flex-direction: column; gap: 14px; }
.fiche h2 { font-size: 19px; font-weight: 700; color: var(--vert-nuit); outline: none; overflow-wrap: anywhere; }
.fiche .sous-titre { font-size: 13.5px; color: var(--encre-2); margin-top: 3px; }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--surface-2); color: var(--encre); }
.badge .ico { width: 14px; height: 14px; }
.badge-kw { background: var(--vert-nuit); color: #fff; }
.badge-kw .ico { color: var(--vert-vif); }
.badge-gratuit { background: var(--vert-pale); color: var(--vert-nuit); }
.encart-dispo { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; border-radius: var(--rayon-s); background: var(--surface-2); font-size: 13.5px; }
.encart-dispo .dispo { font-size: 14px; font-weight: 600; }
.encart-dispo .quand { font-size: 12px; color: var(--encre-2); }
.actions-fiche { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.actions-fiche .bouton { padding: 8px 10px; }
.actions-fiche .bouton-principal { grid-column: 1 / -1; }
.adresse { display: flex; gap: 8px; font-size: 14px; }
.adresse .ico { color: var(--vert-fonce); margin-top: 1px; }
.fiche h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--encre-2); margin-bottom: 6px; }
.infos { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.infos dt { color: var(--encre-2); }
.infos dd { margin: 0; overflow-wrap: anywhere; }
.infos .nr { color: var(--encre-3); font-style: italic; }
.mention-tarif { display: block; font-size: 12px; color: var(--encre-2); }
.tableau-defile { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--rayon-s); }
.points-charge { width: 100%; border-collapse: collapse; font-size: 13px; }
.points-charge caption { text-align: left; }
.points-charge th { text-align: left; font-weight: 600; font-size: 12px; color: var(--encre-2); background: var(--surface-2); padding: 7px 8px; white-space: nowrap; }
.points-charge td { padding: 7px 8px; border-top: 1px solid var(--trait); vertical-align: top; }
.points-charge td.kw { font-weight: 650; white-space: nowrap; font-variant-numeric: tabular-nums; }
.points-charge .petit { font-size: 11.5px; color: var(--encre-2); display: block; }
.points-charge .id { font-size: 11px; color: var(--encre-2); word-break: break-all; display: block; margin-top: 2px; }
.points-charge td.num { font-weight: 650; color: var(--encre-2); width: 2.5em; }
.chargement-lignes { display: flex; flex-direction: column; gap: 10px; }
.chargement-lignes span { height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: reflet 1.2s ease-in-out infinite; }
@keyframes reflet { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- Dialogue de partage ---------- */
.dialogue {
  border: 0; border-radius: var(--rayon-l); padding: 18px; width: min(420px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  box-shadow: var(--ombre-forte); color: var(--encre); background: var(--surface);
}
.dialogue::backdrop { background: rgb(20 18 14 / 0.45); }
.dialogue[open] { display: flex; flex-direction: column; gap: 12px; }
.dialogue-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dialogue-tete h2 { font-size: 18px; color: var(--vert-nuit); }
.qr { align-self: center; width: min(250px, 70vw); aspect-ratio: 1; max-width: 100%; display: grid; place-items: center; background: #fff; border: 1px solid var(--trait); border-radius: var(--rayon); padding: 6px; }
.qr svg { width: 100%; height: 100%; display: block; }
.dialogue-texte { font-size: 14px; color: var(--encre-2); text-align: center; }
.lien-copie { display: flex; gap: 6px; }
.lien-copie input { flex: 1; min-width: 0; font-size: 13px; background: var(--surface-2); }
.partage-compte { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--trait); padding-top: 12px; }
.partage-compte form { display: flex; flex-direction: column; gap: 8px; }

/* ---------- Annonces ---------- */
.annonces { position: fixed; z-index: 60; left: calc(50% + (var(--largeur-panneau) + var(--marge)) / 2); top: 60px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(440px, calc(100vw - 24px)); }
.annonce { pointer-events: auto; background: var(--vert-nuit); color: #fff; padding: 10px 14px; border-radius: var(--rayon); box-shadow: var(--ombre-forte); font-size: 14px; display: flex; gap: 8px; align-items: center; }
.annonce.erreur { background: var(--erreur); }
.annonce .ico { color: var(--vert-vif); }
.annonce.erreur .ico { color: #fff; }

.sans-js { position: fixed; inset: auto 12px 12px; z-index: 100; background: var(--surface); padding: 14px; border-radius: var(--rayon); box-shadow: var(--ombre-forte); }

/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  :root { --marge: 8px; --feuille-plein: calc(100vh - 70px); }
  body { font-size: 15px; }
  .colonne { display: contents; }
  .entete {
    position: fixed; z-index: 25; top: calc(8px + env(safe-area-inset-top)); left: 8px; right: 8px; min-height: 52px;
    background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre); border-bottom: 0; padding: 6px 6px 6px 12px;
  }
  .marque-nom { font-size: 18px; }
  .panneau {
    position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; height: var(--feuille-plein);
    background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 28px rgb(45 35 15 / 0.18);
    transform: translateY(calc(var(--feuille-plein) - var(--feuille-visible)));
    transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  }
  .panneau.glisse { transition: none; }
  .poignee {
    display: block; flex: none; width: 100%; height: 26px; border: 0; background: none; position: relative; cursor: grab; touch-action: none; border-radius: 18px 18px 0 0;
  }
  .poignee::before { content: ""; position: absolute; left: 50%; top: 9px; width: 42px; height: 5px; border-radius: 3px; background: var(--trait-fort); transform: translateX(-50%); }
  .panneau-defile { padding: 2px 14px calc(24px + env(safe-area-inset-bottom)); }
  input[type="text"], input[type="number"], select { font-size: 16px; }
  .filtres { top: calc(68px + env(safe-area-inset-top)); left: 0; right: 0; padding: 2px 8px; }
  body.fiche-ouverte .filtres { right: 0; }
  .legende { left: auto; right: 8px; bottom: auto; top: calc(112px + env(safe-area-inset-top)); max-width: 240px; }
  .legende:not([open]) summary > span:not(.legende-pastilles) { display: none; }
  .etat-carte { left: 8px; top: calc(112px + env(safe-area-inset-top)); max-width: calc(100vw - 70px); }
  .maplibregl-ctrl-bottom-right { bottom: var(--feuille-visible); transition: bottom .28s; }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group { display: none; }
  .fiche {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 82vh; max-height: 82dvh; z-index: 30;
    border-radius: 18px 18px 0 0; box-shadow: 0 -6px 28px rgb(45 35 15 / 0.22);
  }
  .fiche-defile { padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
  .annonces { left: 50%; top: auto; bottom: calc(var(--feuille-visible) + 12px); }
  .synthese dd { font-size: 16px; }
  .menu { position: fixed; top: calc(64px + env(safe-area-inset-top)); right: 8px; left: auto; }
}
@supports (height: 100dvh) {
  :root { --feuille-plein: calc(100dvh - 72px - env(safe-area-inset-top)); }
}
@media (max-width: 380px) {
  .synthese { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions-fiche { grid-template-columns: 1fr; }
  .puce { padding: 6px 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
