/* Copilot' — feuille de style unique.
   Rangée en chapitres (titres encadrés) : jetons, base, briques communes, puis un chapitre par écran ou élément, et
   l'accessibilité en dernier. Dans un chapitre, les variantes de format (@media) sont regroupées à la fin.
   Ordre des règles : en CSS, à force égale, la dernière règle écrite l'emporte. Le rangement de l'étape 4 a gardé
   chaque gagnante (preuves : tools/css-order.mjs, tests/styles.mjs, tests/pixels.mjs) ; une règle déplacée doit
   repasser ces preuves. */

/* ==================================================================================================================
   1. Jetons : couleurs, verre, tailles de texte, mouvements
   ================================================================================================================== */

:root {
  /* Encre, papier et fond : --ink, --muted, --paper, --border, --accent, --green, plus bas dans ce bloc. */
  --route: #368a79; /* vert du tracé, interrupteurs, choix actifs */
  --trail: #417dad; /* bleu du chemin déjà parcouru */
  --position: #1779db; /* point bleu de la position */
  --blue-p: #1f4fa3; /* bleu de la partie P et du centre */
  --stop: #128068; /* repère d'arrêt sur la carte */
  --target: #e4af20; /* anneau du prochain arrêt */
  --house: #b14e68; /* maison localisée (CIDEX) */
  --focus: #3279d5; /* contour de focus clavier */
  --surface-2: #eef1e9; /* bouton secondaire, fond de contrôle segmenté */
  --surface-3: #f1f3eb; /* boutons Passer et Retour */
  --ok-bg: #e1f2eb; /* choisi, distribué */
  --ok-ink: #15573f;
  --warn-bg: #fce9db; /* à vérifier, à confirmer */
  --warn-ink: #925022;
  --badge-bg: #fff0c5; /* pastille de mission */
  --badge-ink: #665016;
  --danger: #b3261e;
  /* Rayons */
  --radius-l: 20px;
  /* Plus petite taille de texte (12 px, MAJ-101) ; les autres tailles sont écrites dans chaque règle */
  --text-caption: 12px;
  /* Taille du texte réglée sur l'iPhone (lot 6, H10 ; app/text-size.mjs) : multiplie les textes du bandeau et de la
     carte d'arrêt. 1 par défaut : rien ne change. */
  --text-scale: 1;
  /* Verre : TOUT le verre de l'app se règle ici. Pour économiser la batterie, passer
     --glass-filter à none (plus aucun flou) et/ou monter --glass-bg vers --glass-bg-strong (plus opaque). */
  --glass-bg: rgba(255, 254, 250, 0.8); /* verre clair des fiches et panneaux */
  --glass-bg-strong: rgba(255, 254, 250, 0.94); /* verre presque opaque : bannières, panneaux en roulant */
  --glass-filter: blur(30px) saturate(190%);
  --glass-edge: rgba(255, 255, 255, 0.85); /* filet blanc du bord */
  --glass-sheen: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.15) 28%,
    rgba(255, 255, 255, 0.25) 100%
  );
  --glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 -6px 32px rgba(22, 46, 51, 0.2);
  --glass-control: rgba(255, 255, 255, 0.72); /* boutons ronds posés sur du verre */
  --glass-control-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95), 0 2px 8px rgba(24, 42, 53, 0.1);
  --radius-sheet: 34px;
  /* Mouvements : courbe « ressort » d'iOS, durées courtes. Réduire les animations les coupe. */
  --ease-spring: cubic-bezier(0.2, 0.9, 0.25, 1);
  --motion-sheet: 0.38s;
  --motion-press: 0.12s;
  --ink: #182a35;
  --muted: #56656e;
  --paper: #fffefa;
  --border: #e5e7df;
  --accent: #f4c542;
  --green: #13664d;
  --shadow: 0 10px 45px #233e3320;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', sans-serif;
  font-family: var(--font);
  color: var(--ink);
  background: #e6ebdf;
  --on-accent: #182a35;
  --glass-panel: rgba(255, 254, 250, 0.66);
  --done: #13664d;
}

/* ==================================================================================================================
   2. Base : page, texte, boutons, champs, icônes
   ================================================================================================================== */

body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button {
  color: inherit;
  border: 0;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
/* Titre qui reçoit le focus au changement d'écran (lot 6, M28) : rien d'affiché, seul le lecteur d'écran s'y place. */
[tabindex='-1']:focus {
  outline: none;
}
[hidden] {
  display: none !important;
}
/* Texte pour le lecteur d'écran seulement (lot 6). */
.hidden-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
h1 {
  font-size: 36px;
  line-height: 1.13;
  letter-spacing: -1.5px;
  margin: 18px 0;
}
h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: -0.4px;
}
small {
  display: block;
  color: var(--muted);
  font-size: var(--text-caption);
  margin-top: 5px;
}
input[type='search'],
textarea {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--paper);
  color: var(--ink);
  padding: 13px;
  border-radius: 11px;
  margin: 7px 0;
}
textarea {
  min-height: 95px;
  resize: vertical;
}
dialog::backdrop {
  background: #162e3345;
}
#app {
  height: 100dvh;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
button,
summary {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
button,
input,
textarea,
summary,
.destination {
  touch-action: manipulation;
}
dialog {
  border: 0;
  position: fixed;
  inset: auto 0 0;
  margin: 0 auto;
  width: min(520px, 100%);
  border-radius: 26px 26px 0 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 -10px 70px #172e3130;
  max-width: 100%;
  max-height: calc(100dvh - max(12px, env(safe-area-inset-top)));
  padding: 0;
  overflow: hidden;
}
dialog[open] {
  display: flex;
  flex-direction: column;
}

/* Retour immédiat à chaque appui : léger enfoncement, sauf les repères de la carte qui sont placés par la carte. */
:where(button, a.primary, a.secondary, .file-label) {
  transition:
    scale var(--motion-press) ease,
    filter var(--motion-press) ease;
}
:where(button):not(:disabled):not(.stop-marker):active {
  scale: 0.97;
  filter: brightness(0.93);
}
/* Textes d'exemple des champs (« Numéro et rue ») : gris de l'app, lisible (contraste 5:1), au lieu du gris pâle de
   Safari. */
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 1;
}
/* Pas de barre de défilement visible : on fait défiler au doigt, comme sur l'iPhone. */
* {
  box-sizing: border-box;
  scrollbar-width: none;
}
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* ==================================================================================================================
   3. Briques communes : listes groupées, pastilles, boutons en pilule, onglets, champs arrondis, messages
   ================================================================================================================== */

.muted {
  color: var(--muted);
  line-height: 1.5;
}
.small {
  font-size: 13px;
}
.section {
  padding: 16px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary,
.secondary {
  width: 100%;
  border-radius: 14px;
  padding: 17px 18px;
  font-weight: 750;
  text-align: center;
  min-height: 52px;
  margin-top: 10px;
}
.primary {
  background: var(--accent);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.primary span {
  font-size: 22px;
}
.secondary {
  background: var(--surface-2);
}
.text-button {
  font-size: 12px;
  background: none;
  text-decoration: underline;
  padding: 8px 0;
}
.list-row b {
  font-size: 14px;
}
.list-row small {
  font-size: var(--text-caption);
}
.list-scroll {
  max-height: 43dvh;
  overflow: auto;
}
.round,
.sim-control,
.text-button {
  min-height: 44px;
  min-width: 44px;
  flex-shrink: 0;
}
.notice {
  line-height: 1.55;
  color: #626d63;
  background: #f1f3ea;
  padding: 12px;
  border-radius: 10px;
  margin: 10px 0;
  font-size: 12px;
}
.eyebrow {
  font-weight: 800;
  color: var(--muted);
  font-size: var(--text-caption);
  letter-spacing: 1px;
}
.counter {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
}
#sheet-body .list-scroll {
  max-height: none;
  overflow: visible;
}
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.list-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.quantity {
  display: grid;
  grid-template-columns: 44px minmax(24px, auto) 44px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.quantity button {
  height: 44px;
  width: 44px;
  border: 0;
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  padding: 0;
}
.quantity output {
  padding: 0 2px;
  text-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}
.quantity:has(output:not(:empty)) {
  max-width: 100%;
}
.day-progress {
  height: 3px;
  margin: 0 0 9px;
  background: #7b998515;
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}
.day-progress > span {
  display: block;
  height: 100%;
  width: 0;
  background: #78938780;
  transition: width 0.25s;
}
.menu-summary {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}
.menu-summary b {
  color: var(--ink);
  text-transform: capitalize;
}
.menu-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  margin-bottom: 14px;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 6px 4px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.menu-icon {
  width: 28px;
  text-align: center;
  font-size: 20px;
}
.menu-label {
  flex: 1;
}
.cidex-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  gap: 8px;
}
.cidex-tabs button {
  min-height: 44px;
  background: transparent;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 650;
}
.field-label {
  margin: 14px 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--muted);
  text-transform: uppercase;
}
#sheet-body > .field-label:first-child {
  margin-top: 0;
}
.icon {
  width: 22px;
  height: 22px;
  display: block;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.inline {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-right: 6px;
}
.menu-icon .icon {
  margin: 0 auto;
}
/* Boutons ronds en verre (fiches, barre de l'Aperçu, outils) ; ceux du bandeau sombre et de la carte d'arrêt gardent
   leur style. */
.round {
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 24px;
  display: grid;
  place-items: center;
  background: var(--glass-control);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-control-shadow);
  color: var(--ink);
}
.glass-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  min-height: 46px;
  padding: 0 16px;
  border-radius: 23px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  background-color: rgba(246, 250, 236, 0.74);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 8px 18px rgba(24, 42, 53, 0.16);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
}
.glass-pill .icon {
  color: var(--route);
}
/* Onglets Colis / Recommandés (contrôle segmenté iOS). */
.segmented {
  gap: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 4px;
  border-radius: 22px;
  background: rgba(24, 42, 53, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.segmented button[aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 700;
  box-shadow:
    inset 0 1px 1px #fff,
    0 2px 8px rgba(24, 42, 53, 0.12);
}
/* Recherche : champ arrondi avec loupe. */
#sheet-body .search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  margin: 0 0 12px;
  padding: 0 14px;
  border-radius: 23px;
  background: rgba(24, 42, 53, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-weight: 400;
  flex-shrink: 0;
}
.search-field:focus-within {
  box-shadow: 0 0 0 2px rgba(23, 121, 219, 0.45);
}
.search-field .icon {
  width: 18px;
  height: 18px;
  color: var(--muted);
  flex: none;
}
#sheet-body .search-field input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 16px;
  color: var(--ink);
  outline: none;
  box-shadow: none;
}
#sheet-body .done {
  flex-shrink: 0;
  width: 100%;
  margin-top: auto;
  min-height: 56px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  background-color: var(--done);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(19, 102, 77, 0.28);
}
/* Les mêmes briques partout (maquettes 5, 6, 17, 19 à 23 et les fiches sans maquette) : listes groupées en verre
   clair, titres de section en capitales, boutons en pilule, recherche avec loupe. */
#sheet-body .primary,
#sheet-body .secondary,
#unlock .primary {
  border-radius: 28px;
  min-height: 56px;
  justify-content: center;
  gap: 8px;
}
#sheet-body .primary,
#unlock .primary {
  border: 1px solid rgba(255, 255, 255, 0.6);
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 8px 20px rgba(158, 118, 10, 0.24);
  font-size: 17px;
}
#sheet-body .secondary {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--glass-control-shadow);
  font-weight: 650;
}
#sheet-body .primary:disabled {
  box-shadow: none;
  opacity: 0.55;
}
#sheet-body .field-label {
  margin: 16px 0 8px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
}
#sheet-body .notice {
  border-radius: 16px;
  background: rgba(255, 240, 197, 0.6);
  color: #5c4a12;
}
/* Listes groupées : menus, objets du jour, CIDEX, rythme, récapitulatifs. */
#sheet-body .menu-list {
  margin: 0 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  overflow: hidden;
}
#sheet-body .menu-list > * {
  position: relative;
}
#sheet-body .menu-list > * + *::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 0;
  height: 1px;
  background: rgba(24, 42, 53, 0.07);
}
#sheet-body .menu-list > :has(.menu-icon) + :has(.menu-icon)::before {
  left: 54px;
}
#sheet-body .menu-row {
  min-height: 56px;
  padding: 6px 14px;
  border-bottom: 0;
  background: transparent;
}
#sheet-body .menu-label {
  font-size: 16px;
  font-weight: 600;
}
#sheet-body .menu-label small {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.menu-chevron {
  font-size: 20px;
  color: #8c989e;
}
.chip {
  flex: none;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255, 240, 197, 0.95);
  color: #665016;
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.segmented button[aria-checked='true'] {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 700;
  box-shadow:
    inset 0 1px 1px #fff,
    0 2px 8px rgba(24, 42, 53, 0.12);
}
/* Pas-à-pas dans toutes les fiches : − en verre, + jaune. */
#sheet-body .quantity {
  /* « − » et « + » plus écartés (lot 6 : 2 px entre les cibles, appuis voisins confondus avec des gants). */
  gap: 6px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
#sheet-body .quantity button {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}
#sheet-body .quantity button:last-child {
  border: 0;
  background: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}
#sheet-body .quantity output {
  font-size: 18px;
  font-weight: 800;
}
.choice-button {
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  font-weight: 800;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.75);
  font-size: 22px;
}
#sheet-body .field-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 12px;
  padding: 10px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.9);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.field-card:focus-within {
  box-shadow: 0 0 0 2px rgba(23, 121, 219, 0.45);
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chips .chip {
  font-size: 13px;
  font-weight: 650;
  padding: 3px 9px;
}
.plus-badge {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--accent);
  font-size: 17px;
  font-weight: 800;
}
.choice-button[aria-expanded='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-size: 18px;
}
/* Rond vert des adresses remises (objets du jour, maquette 19). */
.done-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: var(--done);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
#sheet-body .menu-list > .given + .given::before {
  left: 48px;
}
/* Onglets Colis / Recommandés : chacun sur une ligne, à la même hauteur. */
.segmented button {
  touch-action: manipulation;
  min-height: 44px;
  border-radius: 18px;
  border: 1px solid transparent;
  background: transparent;
  color: #3e4c55;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  padding: 0 4px;
}
/* « Terminé » des fiches de préparation : un peu plus bas. La fiche est déjà relevée de la zone du geste d'accueil,
   le bas de la liste n'a pas à la compter une seconde fois. */
#sheet-body:has(> .done:last-child) {
  padding-bottom: 14px;
}
@media (max-height: 690px) {
  .section {
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .notice {
    margin: 8px 0;
  }
}
@media (max-height: 700px) {
  #sheet-body .done {
    position: sticky;
    bottom: 0;
    z-index: 1;
    margin-top: 12px;
  }
}

/* ==================================================================================================================
   4. Carte et position : fond, tracés, repères, bulles, flèche du véhicule, imprécision du GPS
   ================================================================================================================== */

#map {
  position: absolute;
  inset: 0;
}
.maplibregl-ctrl-bottom-right {
  bottom: 0;
}
.depot-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--blue-p);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px #0004;
}
.stop-marker,
.stop-marker.target {
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.stop-marker::before {
  content: '';
  width: 14px;
  height: 14px;
  background: #fff;
  border: 3px solid var(--stop);
  border-radius: 50%;
  box-shadow: 0 1px 5px #13382c40;
}
.stop-marker.target {
  z-index: 1;
}
.stop-marker.target::before {
  width: 27px;
  height: 27px;
  border: 5px solid var(--target);
}
.stop-marker.collection-marker::before {
  content: '📮';
  width: 26px;
  height: 26px;
  font-size: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
}
.stop-marker.target.collection-marker::before {
  outline: 3px solid var(--target);
}
.stop-popup .secondary {
  min-height: 44px;
  margin-top: 8px;
  padding: 10px;
}
.popup-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.popup-heading b {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  flex: 1;
  min-width: 0;
}
.stop-popup small {
  margin: 0;
}
.maplibregl-popup-content {
  background: var(--paper);
  border-radius: 8px;
  padding: 12px;
}
.maplibregl-popup-tip {
  border-top-color: var(--paper) !important;
}
.house-marker {
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--house);
  border: 2px solid var(--house);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 24px;
  box-shadow: var(--shadow);
}
/* Bulle plus légère (19/09) : adresse en 15 px demi-gras, zone en petit dessous. */
.stop-popup {
  color: var(--ink);
  overflow-wrap: anywhere;
  font-family: inherit;
  padding-top: 0;
  min-width: 180px;
  max-width: 260px;
  font-size: 14px;
}
.stop-popup .popup-meta {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: -6px;
}
/* Icônes dessinées (MAJ-101) : un seul jeu dans la page (#i-…), trait de la couleur du texte, centrées au pixel près.
   Les emojis 📰 📦 ✉️ 📮 📪 restent des emojis. */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.depot-marker .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.2;
}
.stop-popup .popup-close {
  right: 6px;
  top: 4px;
  width: 44px;
  height: 44px;
  background: var(--paper);
  border-radius: 8px;
  position: static;
  flex: 0 0 44px;
  font-size: 20px;
  display: grid;
  place-items: center;
}
.stop-popup .popup-close .icon {
  width: 18px;
  height: 18px;
}
.map-button {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 30px;
  color: var(--ink);
  background-color: rgba(246, 250, 236, 0.62);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 8px 18px rgba(24, 42, 53, 0.16);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
}
.map-button .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}
.vehicle-arrow {
  transition: transform 0.25s linear;
  position: absolute;
  inset: 0;
  display: block;
}
/* Carte sobre : noms de rues gris doux, lisibles sur le fond ; cercle d’imprécision du GPS sous le point bleu. */
.road-label {
  font-size: var(--text-caption);
  white-space: nowrap;
  pointer-events: none;
  color: #5d6b63;
  font-weight: 600;
  letter-spacing: 0.1px;
  text-shadow:
    0 0 2px #fff,
    0 0 2px #fff,
    0 1px 3px #fff;
}
.vehicle-accuracy {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(224, 138, 46, 0.1);
  border: 1.5px dashed rgba(224, 138, 46, 0.45);
  pointer-events: none;
  z-index: -1;
}
.vehicle-accuracy[hidden] {
  display: none;
}
/* Bulle d'une adresse touchée (maquette 2 d) : petite, nom et rang, sans bouton. */
.maplibregl-popup.bubble-popup .maplibregl-popup-content {
  padding: 10px 14px;
  border-radius: 16px;
}
/* La bulle passe devant les repères des arrêts (le rond jaune du prochain arrêt cachait le nom, 20/10). */
.maplibregl-popup.bubble-popup {
  z-index: 10;
}
.bubble-popup b {
  display: block;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bubble-popup small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  font-size: 12px;
  color: var(--muted);
}
/* « Reprendre ici » dans la bulle (retour du 20/10) : un vrai bouton, à la taille du doigt. */
.bubble-popup .popup-resume {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 8px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
/* Route suivie : étiquette verte au-dessus de la flèche, un peu à l'écart, en fondu (retours du 21/10) ; route du
   prochain carrefour : panneau jaune. Jamais touchables. */
.road-pill {
  position: absolute;
  bottom: calc(100% + 18px);
  left: 50%;
  transform: translateX(-50%);
  padding: 5px 12px;
  border-radius: 11px;
  /* Blanc sur ce vert : 4,9:1 (lot 6, M24 : 4,1:1 avec le vert du tracé). */
  background: #2f7d6d;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(19, 102, 77, 0.3);
  pointer-events: none;
  transition: opacity 0.45s ease-in-out;
}
.road-pill.off {
  opacity: 0;
}
.road-shield {
  padding: 2px 7px;
  border-radius: 6px;
  border: 1.5px solid #fff;
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(24, 42, 53, 0.25);
  pointer-events: none;
}
/* Police : la même que la maquette partout, y compris sur la carte (MapLibre impose Helvetica / Arial à ses
   éléments). */
.maplibregl-map,
.maplibregl-popup,
.maplibregl-marker {
  font-family: var(--font);
}
/* Position façon Plans : la flèche seule, sans rond ni cadre, posée sur une ombre douce. */
.vehicle {
  color: white;
  border-radius: 50%;
  z-index: 2;
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  place-items: center;
  font-size: 0;
  width: 46px;
  height: 46px;
}
.vehicle-arrow svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 2px 3px rgba(20, 48, 80, 0.38));
}
@media (min-width: 650px) and (max-height: 500px) {
  .map-button {
    width: 52px;
    height: 52px;
    min-width: 52px;
  }
}
@media (max-height: 700px) and (max-width: 649px) {
  .map-button {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: 24px;
  }
  .map-button .icon {
    width: 22px;
    height: 22px;
  }
}

/* ==================================================================================================================
   5. Bandeau de navigation : consigne, ENSUITE, liste déroulée
   ================================================================================================================== */

.guidance > div {
  flex: 1;
  min-width: 0;
}
.maneuver {
  font-size: calc(40px * var(--text-scale));
  min-width: 38px;
}
.nav-top {
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 3;
  grid-row: 1;
}
.nav-bottom {
  bottom: max(15px, env(safe-area-inset-bottom));
  left: 50%;
  z-index: 3;
  grid-row: 3;
}
.guidance b {
  letter-spacing: -1px;
  font-size: calc(26px * var(--text-scale));
}
.guidance p {
  color: #dce7e3;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: calc(13px * var(--text-scale));
  line-height: 1.3;
}
.above-card > span {
  background: var(--paper);
  padding: 7px 10px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  max-width: none;
  min-width: 0;
  line-height: 1.35;
}
/* Démonstration (retours du 21/10) : vitesse et Simuler / Pause en verre, comme les boutons de la carte, avec une
   icône dessinée ; la vitesse passe au jaune dès qu'elle accélère. */
.sim-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 14px;
  border-radius: 22px;
  color: var(--ink);
  font-size: calc(14px * var(--text-scale));
  font-weight: 700;
  white-space: nowrap;
  background-color: rgba(246, 250, 236, 0.74);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 8px 18px rgba(24, 42, 53, 0.16);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
}
.sim-control .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
  color: var(--route);
}
.sim-control.running .icon {
  color: var(--ink);
}
/* Groupées à gauche, juste après « DÉMO » : la colonne des boutons ronds, à droite, descend jusqu'ici quand la carte
   d'adresse est haute (CIDEX) et cachait « Pause ». */
.above-card .sim-speed {
  min-width: 56px;
  font-variant-numeric: tabular-nums;
}
.above-card #simulate {
  margin-right: auto;
}
.above-card .sim-speed.fast {
  background-color: var(--accent);
  color: var(--on-accent);
}
.swipe-hint {
  text-align: center;
  color: var(--muted);
  font-size: var(--text-caption);
  padding-top: 6px;
}
.guidance {
  display: flex;
  align-items: center;
  background: var(--ink);
  color: white;
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-top: 6px;
  padding: 10px 14px;
  gap: 12px;
  cursor: default;
}
#navigation:not([hidden]) .nav-top {
  animation: drop-in 0.4s var(--ease-spring);
}
#navigation:not([hidden]) .nav-bottom {
  animation: rise-in 0.45s var(--ease-spring);
}
/* Navigation (maquette 2 b) : bandeau sombre à deux niveaux, trois boutons ronds, carte d’arrêt en verre. Les zones
   vides laissent passer les gestes vers la carte. */
.nav-top,
.nav-bottom {
  position: static;
  transform: none;
  width: min(460px, 100%);
  min-width: 0;
  justify-self: center;
  pointer-events: none;
}
.bandeau,
#gps-pill,
#return-original,
#destination,
.above-card > *,
.map-tools {
  pointer-events: auto;
}
.bandeau {
  position: relative;
  border-radius: var(--radius-sheet);
  overflow: hidden;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.28),
    0 12px 30px rgba(24, 42, 53, 0.25);
  -webkit-backdrop-filter: blur(26px) saturate(170%);
  backdrop-filter: blur(26px) saturate(170%);
}
.bandeau .maneuver {
  flex: none;
  display: grid;
  place-items: center;
  min-width: 0;
}
.guidance-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.next-chip {
  flex: none;
  padding: 4px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: calc(17px * var(--text-scale));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.next-chip.has-items {
  position: relative;
  background: rgba(244, 197, 66, 0.3);
  border-color: rgba(244, 197, 66, 0.6);
}
/* Point jaune « à remettre » (lot 6, M25) : visible sans compter sur la couleur du fond. */
.next-chip.has-items::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(24, 42, 53, 0.9);
}
.bandeau-grabber span {
  position: absolute;
  left: 50%;
  bottom: 7px;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
}
/* Liste déroulée : fond plus couvrant et petits textes plus clairs, au moins 4,5:1 même sur une route blanche (lot 6,
   M24 : 3,3:1). */
.upcoming {
  background: rgba(24, 42, 53, 0.82);
  padding-bottom: 22px;
}
.upcoming-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 20px 6px;
  font-size: calc(13px * var(--text-scale));
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #dce7e3;
}
.upcoming-head span + span {
  font-weight: 400;
  letter-spacing: 0;
  color: #b9c8c2;
}
.upcoming-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 6px 18px 6px 20px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: transparent;
  color: #fff;
  text-align: left;
}
.upcoming-row > b {
  min-width: 58px;
  font-size: calc(24px * var(--text-scale));
  line-height: calc(28px * var(--text-scale));
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.upcoming-row > span:nth-child(2) {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.upcoming-row .street {
  font-size: calc(16px * var(--text-scale));
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-row .numbers {
  font-size: calc(13px * var(--text-scale));
  color: #e8efec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-row small {
  display: block;
  margin: 0;
  font-size: calc(12px * var(--text-scale));
  color: #dde7e3;
}
.upcoming-row .icons {
  flex: none;
  font-size: calc(20px * var(--text-scale));
  line-height: calc(22px * var(--text-scale));
  white-space: nowrap;
}
.upcoming-row.has-items {
  background: rgba(244, 197, 66, 0.16);
}
.upcoming-row.cidex > b {
  font-size: calc(28px * var(--text-scale));
}
/* Ligne au-dessus de la carte d'arrêt : démonstration, hors connexion, simulation. */
.above-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: calc(12px * var(--text-scale));
}
.above-card > [hidden] {
  display: none;
}
#offline-state {
  margin: 0 auto;
}
.upcoming-empty {
  margin: 0;
  padding: 14px 20px;
  font-size: calc(14px * var(--text-scale));
  color: #b9c8c2;
}
/* Consignes de direction : pictogramme (miroir pour la gauche), panneau de route jaune comme sur la maquette. */
.bandeau .maneuver.left .icon {
  transform: scaleX(-1);
}
/* La colonne de droite prend juste sa taille ; la consigne garde le reste de la place. */
.bandeau .guidance > .guidance-side {
  flex: none;
}
/* Carte d’arrêt descendue de 10 px (retours du 11/10). */
#navigation {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(80px, 1fr) auto;
  gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  overflow-y: auto;
  pointer-events: none;
  scrollbar-width: thin;
  padding-bottom: max(20px, calc(env(safe-area-inset-bottom) + 4px));
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
}
.nav-bottom #destination {
  margin: 0 2px;
}
/* Bandeau : marges 22 / 20 / 18, distance 36 px, consigne 20 px, km 26 px avec l'unité en 15 px. */
/* Retours du test visuel : bandeau plus couvrant pour le soleil, boutons ronds sous la place de la bannière,
   « Passer » réduit à sa flèche sur les écrans étroits, carte d'arrêt entière en paysage. */
.bandeau .guidance {
  display: flex;
  align-items: center;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0) 60%);
  background-color: rgba(24, 42, 53, 0.9);
  gap: 14px;
  padding: 22px 20px 18px 20px;
}
.bandeau .maneuver .icon {
  stroke-width: 2.2;
  width: 44px;
  height: 44px;
}
#guidance-text {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
  font-weight: 700;
  font-size: calc(20px * var(--text-scale));
  line-height: calc(26px * var(--text-scale));
}
.road-ref {
  display: inline-block;
  margin-left: 4px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
  white-space: nowrap;
  vertical-align: 1px;
  font-size: calc(17px * var(--text-scale));
  line-height: calc(22px * var(--text-scale));
  padding: 1px 7px;
}
.guidance-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  padding-left: 12px;
}
#stop-km {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: calc(26px * var(--text-scale));
  line-height: calc(30px * var(--text-scale));
  letter-spacing: -0.5px;
}
#stop-km .unit {
  font-size: calc(15px * var(--text-scale));
  font-weight: 700;
  letter-spacing: 0;
  color: #dce7e3;
}
/* Bandeau : la consigne et son panneau de route passent avant la distance jusqu’à l’arrêt, jamais à la ligne. */
#stop-km-label {
  color: #dce7e3;
  white-space: nowrap;
  font-size: calc(13px * var(--text-scale));
}
/* Bandeau compact (à placer, sans flèche) et retour au centre (vert) : ni ENSUITE ni poignée. */
.bandeau.compact .next-row,
.bandeau.finish .next-row,
.bandeau.compact .bandeau-grabber,
.bandeau.finish .bandeau-grabber,
.bandeau.compact .upcoming,
.bandeau.finish .upcoming {
  display: none;
}
.bandeau.finish .guidance {
  background-color: rgba(19, 102, 77, 0.92);
}
.bandeau.finish #guidance-text {
  color: #ddf0e8;
  font-weight: 500;
  font-size: calc(16px * var(--text-scale));
}
.bandeau .maneuver:has(use[href='#i-pin-question']) .icon {
  color: #f4a340;
}
.bandeau.compact #guidance-text {
  color: #dce7e3;
  font-size: calc(16px * var(--text-scale));
  font-weight: 500;
  white-space: normal;
}
/* Liste déroulée (maquette 2 c) : ENSUITE laisse sa place, environ quatre adresses, boutons ronds cachés. */
.bandeau.expanded .next-row {
  display: none;
}
.upcoming-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-mask-image: linear-gradient(180deg, #000 85%, rgba(0, 0, 0, 0.05));
  mask-image: linear-gradient(180deg, #000 85%, rgba(0, 0, 0, 0.05));
  max-height: min(236px, 40dvh);
}
#navigation:has(.bandeau.expanded) .map-tools {
  opacity: 0;
  pointer-events: none;
}
/* Arrêt ajouté (maquette 9 b) : bannière verte, puis « Reprendre le tracé d'origine ». */
.added-banner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 4px 0;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(232, 245, 239, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 6px 16px rgba(24, 42, 53, 0.14);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
}
.added-banner[hidden] {
  display: none;
}
.added-banner .ok-dot {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--done);
  color: #fff;
}
.added-banner .ok-dot .icon {
  width: 16px;
  height: 16px;
  stroke-width: 3;
}
.added-banner b {
  display: block;
  font-size: calc(15px * var(--text-scale));
  line-height: calc(20px * var(--text-scale));
}
.added-banner small {
  display: block;
  font-size: calc(13px * var(--text-scale));
  color: var(--muted);
}
#return-original {
  width: auto;
  margin-left: 4px;
}
/* Consigne trop longue pour une ligne : un cran plus petite, et sur deux lignes s'il le faut, à toutes les largeurs
   (lot 6, M30 : les deux lignes n'existaient que sous 380 px ; de 390 à 430 px, elle restait coupée). */
#guidance-text.tight {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  white-space: normal;
  font-size: calc(17px * var(--text-scale));
  line-height: calc(21px * var(--text-scale));
}
/* Petits Android, 380 px de large et moins (revue du 21/10) : bandeau un peu plus serré. */
@media (max-width: 380px) {
  .bandeau .guidance {
    gap: 10px;
    padding: 18px 14px 14px;
  }
  .bandeau .maneuver .icon {
    width: 36px;
    height: 36px;
  }
  #stop-km {
    font-size: calc(22px * var(--text-scale));
  }
}
/* Bandeau : la poignée est posée dans le bas du bandeau (elle dépassait sous la ligne ENSUITE, laissant voir la
   carte). */
.bandeau-grabber {
  display: block;
  width: 120px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  position: absolute;
  left: 50%;
  bottom: 0;
  margin: 0;
  transform: translateX(-50%);
  z-index: 1;
}
/* Retour au centre : « Fin de la tournée » tient sur la ligne (maquette 11 : 28 px). */
.bandeau.finish #distance {
  font-size: calc(28px * var(--text-scale));
  line-height: calc(34px * var(--text-scale));
}
/* Poignées tirables : le doigt reste à l'app, Safari ne défile pas. */
.bandeau-grabber,
.card-grabber {
  touch-action: none;
}
@media (max-width: 600px) {
  .nav-top {
    top: max(10px, env(safe-area-inset-top));
  }
  .nav-bottom {
    bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media (max-height: 690px) {
  .nav-bottom {
    bottom: 12px;
  }
  .guidance .maneuver {
    font-size: calc(30px * var(--text-scale));
  }
  .guidance b {
    font-size: calc(23px * var(--text-scale));
  }
  .swipe-hint,
  .footer-row {
    display: none;
  }
}
@media (min-width: 650px) and (max-height: 500px) {
  .nav-top {
    grid-column: 1;
    grid-row: 1;
  }
  .nav-bottom {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }
  .guidance {
    margin-top: 4px;
    padding: 6px 12px;
  }
  .guidance p {
    margin: 2px 0;
  }
  #navigation {
    grid-template-columns: minmax(280px, 340px) minmax(80px, 1fr);
    grid-template-rows: auto 1fr;
    gap: 8px 16px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
  }
  .above-card {
    margin-bottom: 4px;
  }
}
/* Messages sous le bandeau (GPS, Arrêt ajouté, Reprendre le tracé d'origine) : posés sur la carte, ils ne poussent
   plus les boutons ronds vers le bas (retour du 19/10, MAJ-120). Sur téléphone, ils s'arrêtent avant la colonne de
   boutons. Petits écrans et paysage : boutons placés autrement, les messages restent dans le flux. */
@media (min-height: 701px) {
  #navigation .nav-top {
    position: relative;
    top: auto;
    left: auto;
  }
  .nav-notes {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
  }
}
@media (min-height: 701px) and (max-width: 640px) {
  .nav-notes {
    right: 64px;
  }
  .large-type .nav-notes {
    right: 68px;
  }
}

/* ==================================================================================================================
   6. Carte d’arrêt : adresse en cours, missions, Distribué / Passer, glissement
   ================================================================================================================== */

.address-row > div {
  flex: 1;
  min-width: 0;
}
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.badge.approx {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.delivered {
  background: var(--green);
  color: white;
  border-radius: 11px;
  padding: 10px;
  flex: 1;
  font-weight: 700;
  min-height: 44px;
}
.footer-row span {
  background: var(--paper);
  padding: 3px 6px;
  border-radius: 5px;
}
.back-button {
  background: var(--surface-3);
  border-radius: 11px;
  padding: 10px 12px;
  font-weight: 650;
  min-height: 44px;
}
.back-button:disabled {
  opacity: 0.4;
}
.houses-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 21px;
  padding: 0 7px;
  border-radius: 11px;
  background: var(--blue-p);
  color: #fff;
  font-size: calc(12px * var(--text-scale));
  font-weight: 800;
  line-height: 1;
  margin-top: 3px;
  flex: none;
  vertical-align: middle;
}
.houses-badge[hidden] {
  display: none;
}
.address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0;
}
.address-row > strong {
  letter-spacing: -1px;
  overflow-wrap: anywhere;
  font-size: calc(32px * var(--text-scale));
  max-width: 90px;
  flex-shrink: 0;
}
.address-row h2 {
  overflow-wrap: anywhere;
  font-size: calc(20px * var(--text-scale));
  line-height: 1.25;
}
.address-title {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}
.badge {
  background: var(--badge-bg);
  color: var(--badge-ink);
  border-radius: 8px;
  padding: 5px 8px;
  font-weight: 700;
  font-size: calc(12px * var(--text-scale));
}
.destination-actions {
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
}
#delivery-feedback {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.remittance-logo {
  position: absolute;
  font-size: calc(32px * var(--text-scale));
  color: var(--route);
}
.press-badge {
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: calc(16px * var(--text-scale));
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 6px;
}
.next-hint {
  font-size: calc(22px * var(--text-scale));
  opacity: 0.25;
  max-width: 50px;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.next-hint:empty {
  display: none;
}
.cidex-destination .press-badge {
  font-size: calc(12px * var(--text-scale));
  padding: 5px 8px;
}
.footer-row {
  justify-content: space-between;
  color: var(--muted);
  font-size: var(--text-caption);
  margin: 5px 2px 0;
  gap: 6px;
  display: none;
}
.next-label {
  flex: none;
  font-size: calc(13px * var(--text-scale));
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #dce7e3;
}
/* Marge du haut rendue aussitôt : le point jaune « à remettre », qui dépasse du coin de sa pastille, reste entier
   malgré le fondu à droite qui coupe ce qui déborde (retour du facteur, 25/10). */
.next-stops {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  padding-top: 4px;
  margin-top: -4px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.08) 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 62%, rgba(0, 0, 0, 0.08) 100%);
}
/* Sous le bandeau : GPS imprécis (maquette 9) et retour au tracé d'origine (9 b). */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  min-height: 36px;
  margin: 0;
  padding: 0 14px;
  border-radius: 18px;
  font-size: calc(14px * var(--text-scale));
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-pill.warn {
  margin: 8px auto 0;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  color: #8a4b10;
  background: rgba(253, 236, 214, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 6px 16px rgba(24, 42, 53, 0.14);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  backdrop-filter: blur(20px) saturate(190%);
}
.status-pill.warn::before {
  content: '';
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: #e08a2e;
}
.status-pill.dark {
  color: #fff;
  font-size: calc(13px * var(--text-scale));
  background: rgba(24, 42, 53, 0.76);
  border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}
/* Carte d'arrêt en verre : numéro et voie, rang discret à droite, missions à gauche, emoji de l'adresse suivante à
   droite, progression au-dessus de « précédente · suivante ». */
.destination {
  background: var(--paper);
  position: relative;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0 20px 16px;
  border-radius: var(--radius-sheet);
  background-color: rgba(250, 252, 242, 0.78);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0.22) 100%
  );
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 12px 32px rgba(24, 42, 53, 0.16);
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  backdrop-filter: blur(26px) saturate(190%);
  transition: background-color 0.2s;
}
.card-grabber {
  display: block;
  align-self: center;
  width: 120px;
  height: 44px;
  margin: 0 0 -26px;
  padding: 0;
  background: transparent;
  border: 0;
  position: relative;
}
.card-grabber span {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 36px;
  height: 5px;
  margin-left: -18px;
  border-radius: 3px;
  background: rgba(24, 42, 53, 0.22);
}
.destination .eyebrow {
  margin-top: 6px;
}
/* « RETOUR AU CENTRE » (ou « MISSIONS RESTANTES ») au milieu de la carte, plus collé à gauche (retour du 22/10). */
.destination.homeward .eyebrow {
  text-align: center;
}
.destination .address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.destination .address-row > strong {
  font-size: calc(40px * var(--text-scale));
  line-height: calc(44px * var(--text-scale));
  font-weight: 800;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  max-width: none;
  flex: none;
}
.address-main {
  flex: 1;
  min-width: 0;
}
/* Retour au centre (MAJ-122) : rond vert à la maison à la place du numéro (orange « ! » s'il reste des missions), le
   bilan en pastilles ; le compteur et la barre de la journée, pleins, ne disent plus rien. */
.destination.homeward .address-row > strong {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  background: var(--done);
  color: #fff;
  font-size: calc(26px * var(--text-scale));
  letter-spacing: 0;
  box-shadow: 0 6px 16px rgba(19, 102, 77, 0.28);
}
.destination.homeward .address-row > strong.warn {
  background: #e08a2e;
  box-shadow: 0 6px 16px rgba(224, 138, 46, 0.28);
}
.destination.homeward .address-row > strong .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.4;
}
.destination.homeward .counter,
.destination.homeward .progress-row {
  display: none;
}
.destination.homeward .badges {
  margin-top: 4px;
}
.destination .badge.recap {
  background: rgba(19, 102, 77, 0.1);
  color: var(--ok-ink);
  font-size: calc(14px * var(--text-scale));
}
.destination .badge.recap.approx {
  background: rgba(252, 233, 219, 0.95);
  color: var(--warn-ink);
}
/* « ‹ » (revenir au dernier arrêt) et « Revoir le bilan » sur la même ligne. */
.destination.homeward .destination-actions #trip-summary {
  grid-column: 2 / -1;
}
.destination .address-row h2 {
  font-size: calc(20px * var(--text-scale));
  line-height: calc(24px * var(--text-scale));
  font-weight: 700;
  letter-spacing: -0.4px;
}
#stop-meta {
  line-height: 1.4;
  margin-top: 2px;
  font-size: var(--text-caption);
  color: var(--muted);
}
.destination .counter {
  flex: none;
  align-self: center;
  font-size: calc(13px * var(--text-scale));
  font-weight: 600;
  /* 4,6:1 sur la carte d'arrêt (lot 6, M24 : 3,5:1, sous le seuil de lecture). */
  color: #66727a;
}
.mission-row:has(#badges:empty):has(#next-hint:empty) {
  display: none;
}
.destination .badges {
  flex: 1;
  min-width: 0;
}
.destination .badge {
  padding: 6px 11px;
  border-radius: 11px;
  background: rgba(255, 240, 197, 0.95);
  color: var(--badge-ink);
  font-size: calc(15px * var(--text-scale));
  font-weight: 700;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}
.destination .badge.press-badge {
  background: rgba(255, 240, 197, 0.95);
  color: var(--badge-ink);
}
.destination .badge.approx {
  background: rgba(252, 233, 219, 0.95);
  color: var(--warn-ink);
}
.destination .next-hint {
  flex: none;
  margin-left: auto;
  font-size: calc(22px * var(--text-scale));
  line-height: calc(28px * var(--text-scale));
  opacity: 0.3;
  max-width: none;
}
/* La barre et, à sa droite, le pourcentage de la tournée (09/11, demande du facteur), en vert « fait ». */
.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 0;
}
.destination .day-progress {
  flex: 1;
  height: 5px;
  margin: 0;
  border-radius: 3px;
  background: rgba(24, 42, 53, 0.1);
  -webkit-mask-image: none;
  mask-image: none;
  overflow: hidden;
}
.destination .day-progress > span {
  border-radius: 3px;
  background: var(--green);
}
.day-percent {
  flex: none;
  min-width: 3.2em;
  text-align: right;
  color: var(--ok-ink);
  font-size: calc(13px * var(--text-scale));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
/* Bulle d'un quart de tournée (09/11) : au-dessus de la carte, au milieu, en vert « fait », texte blanc (6,9:1). Elle
   ne prend aucun toucher ; navigation.mjs la fait monter puis partir. */
.quarter-pop {
  position: absolute;
  bottom: calc(100% + 12px + var(--above-card, 0px));
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px 8px 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 10px 28px rgba(22, 46, 51, 0.28);
  color: #fff;
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
  /* Sur une ligne ; avec le plus grand texte, la phrase passe à la ligne plutôt que de sortir de l'écran. */
  width: max-content;
  max-width: calc(100% - 16px);
  pointer-events: none;
}
.quarter-pop b {
  white-space: nowrap;
  font-size: calc(20px * var(--text-scale));
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.quarter-pie {
  flex: none;
  width: 28px;
  height: 28px;
}
.quarter-pie circle {
  fill: none;
  stroke: #fff;
  stroke-width: 1.9;
}
.quarter-pie path {
  fill: #fff;
}
/* Les boutons ronds (z-index 4) passent sous la bulle le temps qu'elle est là ; elle ne prend aucun toucher. */
.nav-bottom:has(#quarter-pop:not([hidden])) {
  z-index: 5;
}
/* Paysage : bandeau et carte d'arrêt remplissent la colonne de gauche ; la bulle se pose sur la carte, à droite. */
@media (min-width: 650px) and (max-height: 500px) {
  .quarter-pop {
    right: auto;
    bottom: 0;
    left: calc(100% + 16px);
    margin: 0;
  }
}
.destination .swipe-hint {
  padding: 0;
  font-size: var(--text-caption);
  color: #56656e;
}
/* Boutons de la carte d'arrêt (lot 6, choix du facteur le 24/10) : « ‹ Retour » et « Suivant › », comme le glissé. */
.destination .destination-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 8px;
  margin: 0;
  padding: 0;
  border-top: 0;
}
.destination-actions button {
  white-space: nowrap;
  padding: 10px;
  min-height: 52px;
  border-radius: 26px;
  font-size: calc(16px * var(--text-scale));
}
.destination-actions .back-button,
.destination-actions .delivered {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.destination-actions .back-button {
  padding: 0 12px 0 6px;
  color: var(--ink);
  font-weight: 650;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.destination-actions .delivered {
  background-color: var(--green);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: calc(17px * var(--text-scale));
  font-weight: 750;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 6px 16px rgba(19, 102, 77, 0.28);
}
.destination-actions #trip-summary {
  grid-column: 1 / -1;
  margin: 0;
  border-radius: 26px;
}
/* Glissement de la carte d'arrêt : au-delà du seuil, la carte se teinte (vert : suivante ; gris : précédente). */
.destination[data-swipe='next'] {
  background-color: rgba(225, 242, 235, 0.92);
}
.destination[data-swipe='back'] {
  background-color: rgba(233, 236, 232, 0.92);
}
.rank {
  font-size: calc(12px * var(--text-scale));
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.progress {
  height: 5px;
  margin: 0 6px 14px;
  border-radius: 3px;
  background: rgba(24, 42, 53, 0.1);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--done);
}
#distance {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: calc(36px * var(--text-scale));
  line-height: calc(40px * var(--text-scale));
  letter-spacing: -1px;
}
.next-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(24, 42, 53, 0.8);
  padding: 12px 0 18px 22px;
}
/* Carte d'arrêt : pas de « Zone » ; position manquante en rouge et bouton pour la relever (maquette 9). */
#stop-meta:empty {
  display: none;
}
.badge.missing {
  background: rgba(253, 226, 222, 0.95);
  color: #9b2c1f;
}
.card-position {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin: 0;
  border-radius: 25px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  color: #1779db;
  font-size: calc(16px * var(--text-scale));
  font-weight: 700;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.card-position[hidden] {
  display: none;
}
#address-street {
  letter-spacing: -0.4px;
}
/* CIDEX en tournée (maquette 2 e) : 📪 grand, nom 22 px très gras, numéros en 15 px. */
.cidex-destination #address-number {
  font-size: calc(34px * var(--text-scale));
  line-height: calc(40px * var(--text-scale));
}
.cidex-destination #address-street {
  overflow-wrap: anywhere;
  font-size: calc(22px * var(--text-scale));
  line-height: calc(26px * var(--text-scale));
  font-weight: 800;
}
.cidex-destination #stop-meta {
  font-size: calc(15px * var(--text-scale));
  font-weight: 600;
  color: var(--ink);
}
.stop-icons {
  white-space: nowrap;
}
@media (max-width: 360px) {
  .address-row > strong {
    font-size: calc(28px * var(--text-scale));
    max-width: 72px;
  }
  .address-row h2 {
    font-size: calc(18px * var(--text-scale));
  }
}
@media (min-width: 650px) and (max-height: 500px) {
  .address-row {
    margin: 4px 0;
  }
  .address-row h2 {
    font-size: calc(18px * var(--text-scale));
  }
  .address-row > strong {
    font-size: calc(27px * var(--text-scale));
  }
  /* Paysage : bandeau et carte d'arrêt à gauche, boutons ronds à droite. */
  .destination {
    gap: 6px;
    padding-bottom: 10px;
  }
  .destination .address-row > strong {
    font-size: calc(30px * var(--text-scale));
    line-height: calc(34px * var(--text-scale));
  }
  .destination .swipe-hint {
    display: none;
  }
  .card-grabber {
    margin-bottom: -30px;
  }
  .destination-actions button {
    min-height: 46px;
  }
}
@media (max-width: 359px) {
}

/* ==================================================================================================================
   7. Boutons ronds de la carte : colis, liste des arrêts, menu, recentrage
   ================================================================================================================== */

.map-tools:empty {
  display: none;
}
/* Boutons ronds sur la carte, à droite : objets du jour, liste des arrêts, menu, recentrer (entouré de bleu quand
   la carte ne suit plus). */
.map-tools {
  right: 25px;
  top: 43%;
  position: static;
  grid-row: 2;
  justify-self: end;
  align-self: start;
  display: flex;
  z-index: 4;
  flex-direction: column;
  gap: 14px;
  margin-top: 8px;
}
#recenter {
  color: var(--position);
}
#recenter.lost {
  border: 2px solid var(--position);
  background-color: rgba(246, 250, 236, 0.88);
}
/* Carte déplacée au doigt (retour du 19/10, comme Plans) : colis, liste des arrêts et menu s'effacent en fondu, sans
   bouger de place ; seul le recentrage reste. Ils reviennent en fondu au recentrage. */
.map-tools > :not(#recenter) {
  transition:
    opacity 0.28s var(--ease-spring),
    transform 0.28s var(--ease-spring),
    visibility 0s;
}
#navigation.free-map .map-tools > :not(#recenter) {
  opacity: 0;
  transform: scale(0.86);
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.22s ease-out,
    transform 0.22s ease-out,
    visibility 0s 0.22s;
}
/* Bouton Objets du jour (retour du 15/10) : colis et lettre dessinés au trait comme les autres boutons (choix du
   19/10), pastille jaune du nombre d'objets à remettre. */
.objects-button {
  position: relative;
}
.objects-left {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--ink);
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(24, 42, 53, 0.2);
}
.objects-left[hidden] {
  display: none;
}
@media (max-width: 600px) {
  .map-tools {
    right: 15px;
    top: 40%;
  }
}
@media (min-width: 650px) and (max-height: 500px) {
  .map-tools {
    grid-column: 2;
    grid-row: 1;
    gap: 10px;
    margin-top: 0;
  }
}
@media (max-height: 700px) and (max-width: 649px) {
  /* Petits écrans (iPhone SE) : les boutons ronds passent en ligne pour ne jamais recouvrir la carte d’arrêt. */
  .map-tools {
    flex-direction: row;
    gap: 8px;
    margin-top: 6px;
  }
}
@media (min-height: 701px) {
  .map-tools {
    margin-top: 64px;
  }
}

/* ==================================================================================================================
   8. Fiches du bas et message passager
   ================================================================================================================== */

#sheet-body {
  line-height: 1.45;
  padding: 8px 16px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scroll-padding: 12px;
}
#sheet-body input,
#sheet-body textarea {
  font-size: 16px;
}
#sheet-body label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-top: 10px;
}
/* Fiche du bas en verre : posée à 8 px des bords, poignée, entrée en glissant, fermeture en la tirant vers le bas. */
#sheet {
  inset: auto 0 max(8px, env(safe-area-inset-bottom)) 0;
  margin: 0 auto;
  width: min(520px, calc(100% - 16px));
  max-width: calc(100% - 16px);
  max-height: calc(100dvh - max(20px, env(safe-area-inset-top) + 12px) - max(8px, env(safe-area-inset-bottom)));
  border-radius: var(--radius-sheet);
  background-color: var(--glass-bg);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-edge);
  box-shadow: var(--glass-shadow);
  transition: transform var(--motion-sheet) var(--ease-spring);
}
#sheet[open] {
  animation: sheet-in var(--motion-sheet) var(--ease-spring);
}
#sheet::backdrop {
  background: rgba(22, 46, 51, 0.22);
}
#sheet[open]::backdrop {
  animation: fade-in var(--motion-sheet) ease;
}
#sheet.dragging {
  transition: none;
}
.sheet-grabber {
  flex: none;
  width: 36px;
  height: 5px;
  border-radius: 3px;
  background: rgba(24, 42, 53, 0.22);
  margin: 8px auto 0;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
  flex-shrink: 0;
  margin: 0;
  background: transparent;
  border-bottom: 0;
  padding: 4px 14px 10px 20px;
  touch-action: none;
  cursor: grab;
}
@keyframes sheet-in {
  from {
    transform: translateY(105%);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
/* Messages en bannière : en haut de l'écran, en verre, glissent depuis le haut ; les touchers passent au travers. */
#toast {
  background: var(--ink);
  position: fixed;
  z-index: 50;
  top: calc(max(10px, env(safe-area-inset-top)) + 4px);
  left: 50%;
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  max-width: none;
  padding: 12px 16px;
  border-radius: var(--radius-l);
  background-color: var(--glass-bg-strong);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid var(--glass-edge);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 8px 22px rgba(24, 42, 53, 0.16);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
}
#toast:not([hidden]) {
  animation: banner-in 0.35s var(--ease-spring);
}
#toast.leaving {
  animation: banner-out 0.25s ease forwards;
}
@keyframes banner-in {
  from {
    transform: translate(-50%, calc(-100% - 20px));
    opacity: 0;
  }
}
@keyframes banner-out {
  to {
    transform: translate(-50%, calc(-100% - 20px));
    opacity: 0;
  }
}
@keyframes rise-in {
  from {
    transform: translateY(24px);
    opacity: 0;
  }
}
@keyframes drop-in {
  from {
    transform: translateY(-24px);
    opacity: 0;
  }
}
/* Bannière sous le bandeau pendant la tournée (maquette 9 b). */
body.navigation-active #toast {
  top: calc(var(--nav-top-bottom, 0px) + 10px);
}
/* Fiches : sur-titre en petites capitales au-dessus du titre, boutons ronds à côté de ✕. */
.sheet-titles {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sheet-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-actions {
  display: flex;
  gap: 8px;
  flex: none;
}
.sheet-actions:empty {
  display: none;
}
.sheet-actions [aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}
.sheet-note {
  font-size: 13px;
  color: var(--muted);
  padding: 0 6px;
  margin: 0 0 10px;
  flex-shrink: 0;
}
/* Sous-titre des fiches : sous le titre, 13 px gris. */
.sheet-subtitle {
  font-size: 13px;
  line-height: 18px;
  color: var(--muted);
}
.sheet-subtitle[hidden] {
  display: none;
}
/* Fin de tournée (maquette 11) : en-tête centré, quatre cartes. */
#sheet.hero .sheet-titles {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
#sheet.hero .sheet-head {
  position: absolute;
  top: 10px;
  right: 0;
  z-index: 1;
  padding: 0 14px;
}
#sheet-body #cancel-validate {
  min-height: 50px;
}
/* Fiches : titres de 26 px ; grandes fiches à 64 px sous l'heure ; « Terminé » toujours en bas. */
.sheet-head h2 {
  overflow-wrap: anywhere;
  min-width: 0;
  line-height: 1.2;
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.6px;
}
/* Message dans une fiche ouverte (lot 6, H8) : la bannière de l'écran restait dessous, invisible. */
.sheet-message {
  margin: 0 16px 10px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(24, 42, 53, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.sheet-message:empty {
  margin: 0;
  padding: 0;
}

/* ==================================================================================================================
   9. Accueil : tournée, parties, tuiles, Démarrer, mise à jour
   ================================================================================================================== */

.brand span:not(.brand-icon) {
  display: block;
  font-size: var(--text-caption);
  letter-spacing: 1.7px;
  margin-top: 4px;
}
/* Profil test (lien testeurs, 27/10) : pastille à côté du nom, à la place de la devise, pour que personne ne prenne
   l'essai pour l'app d'un facteur. */
.brand.test span:not(.brand-icon) {
  display: none;
}
.test-badge {
  display: inline-block;
  margin-left: 8px;
  vertical-align: middle;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: var(--text-caption);
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
}
.test-badge[hidden] {
  display: none;
}
.brand-icon {
  display: grid;
  place-items: center;
  background: var(--accent);
  width: 45px;
  height: 45px;
  border-radius: 15px;
  font-size: 27px;
  transform: rotate(-15deg);
}
.route-card strong {
  font-size: 13px;
}
.stats b {
  font-size: 28px;
  display: block;
  letter-spacing: -1px;
}
.navigation-active .brand {
  display: none;
}
/* Un bouton par partie de la tournée (lot 7). Toujours la taille d'un tiers de la ligne : sans partageable, les deux
   boutons gardent cette taille et se centrent (02/11) ; à plus de trois, ils se partagent la ligne. */
.zone-picker {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.zone-picker .zone-button {
  flex: 0 1 calc((100% - 16px) / 3);
  min-width: 0;
}
.zone-button b {
  font-size: 24px;
  line-height: 1;
}
.zone-button small {
  font-size: 12px;
  color: var(--muted);
}
.brand-icon,
.route-number {
  color: var(--on-accent);
}
.brand {
  position: absolute;
  top: max(25px, env(safe-area-inset-top));
  left: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
  z-index: 2;
  right: 32px;
  max-width: 375px;
}
.panel {
  position: absolute;
  z-index: 3;
  left: 32px;
  top: 105px;
  bottom: 30px;
  width: 375px;
  background: var(--paper);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: auto;
  scrollbar-width: thin;
  padding: 22px;
  scroll-padding: 16px;
}
.panel h1 {
  font-size: 26px;
  margin: 12px 0;
  letter-spacing: 0;
}
.stats {
  display: flex;
  padding: 16px 0;
  justify-content: space-between;
  gap: 16px;
}
.stats span {
  color: var(--muted);
  font-size: 12px;
}
.zone-button[aria-pressed='true'] small {
  color: #34434a;
}
.zone-button.add[aria-pressed='true'] {
  color: #fff;
  background: var(--blue-p);
  border-color: #92b4ef;
}
.zone-button.add[aria-pressed='true'] small {
  color: #fff;
}
.setup-actions .primary,
.setup-actions .secondary {
  margin-top: 6px;
}
#resume:not([hidden]) {
  order: -2;
  background: var(--accent);
  color: var(--on-accent);
}
.setup-actions:has(#resume:not([hidden])) #start {
  background: var(--surface-2);
  color: var(--ink);
}
#update {
  order: -3;
}
.local-note {
  text-align: center;
  color: var(--muted);
  margin-top: 19px;
  font-size: var(--text-caption);
  margin: 4px 0 0;
}
.mode-label {
  border-radius: 30px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-weight: 800;
  font-size: var(--text-caption);
  letter-spacing: 0.5px;
  line-height: 1.4;
  padding: 7px 10px;
}
#trip-summary {
  grid-column: 2 / -1;
  margin: 0;
  justify-content: center;
  min-height: 44px;
}
@media (max-width: 360px) {
  .panel h1 {
    font-size: 28px;
  }
}
@media (max-height: 690px) {
  .panel h1 {
    margin: 8px 0;
    font-size: 22px;
  }
}
.route-card {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: 16px;
  background: transparent;
  border-radius: 0;
  padding: 12px 0;
}
.route-card > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
.route-number {
  font-size: 18px;
  font-weight: 800;
  background: var(--accent);
  padding: 13px 8px;
  min-height: 44px;
  min-width: 60px;
  border-radius: 8px;
}
/* Aperçu depuis l'accueil (19/09) : loupe à droite de la tournée choisie. */
.route-card .overview-open {
  margin-left: auto;
  display: grid;
  place-items: center;
  color: var(--ink);
}
/* Pendant l'Aperçu, l'en-tête de l'accueil laisse la place aux deux boutons. */
body.observing .brand {
  display: none;
}
.brand-icon .icon {
  width: 26px;
  height: 26px;
}
/* Passage accueil ↔ tournée : les panneaux arrivent en glissant au lieu d'apparaître d'un coup. */
#setup:not([hidden]) {
  animation: rise-in 0.4s var(--ease-spring);
}
.setup-head {
  display: grid;
  gap: 4px;
  text-align: center;
}
.setup-head .eyebrow {
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.setup-head h1,
.panel .setup-head h1 {
  margin: 0;
  font-size: 30px;
  line-height: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
#setup .route-card {
  margin-top: 14px;
  padding: 10px;
  gap: 12px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.9);
}
#setup .route-card strong {
  font-size: 15px;
  font-weight: 600;
}
#setup .route-number {
  border-radius: 12px;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}
#setup .stats {
  padding: 16px 4px 12px;
}
#setup .stats b {
  font-size: 30px;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
#setup .stats span {
  font-size: 13px;
}
.zone-button {
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 12px 6px;
  color: var(--ink);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  min-height: 68px;
}
.zone-button[aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--ink);
  border: 1.5px solid rgba(24, 42, 53, 0.85);
  background-color: rgba(244, 197, 66, 0.92);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0) 55%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.8),
    0 4px 12px rgba(158, 118, 10, 0.22);
}
.zone-button.add:not([aria-pressed='true']) {
  color: #1f4fa3;
}
.start-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.start-row #start {
  flex: 1;
  margin: 0;
  min-height: 60px;
  border-radius: 30px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 10px 26px rgba(158, 118, 10, 0.3);
  font-size: 17px;
  font-weight: 750;
}
.start-row .demo-button {
  flex: none;
  width: 60px;
  height: 60px;
  min-width: 60px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.route-choice .icon {
  flex: none;
  width: 22px;
  height: 22px;
  color: var(--done);
  stroke-width: 2.6;
}
/* Accueil (maquette 1) : « Démarrer » et « Démo » posés sous le panneau, sur la carte. */
#setup[hidden] + .setup-actions {
  display: none;
}
.setup-actions {
  display: flex;
  flex-direction: column;
  border-top: 0;
  position: absolute;
  z-index: 3;
  left: 32px;
  width: 375px;
  bottom: max(30px, env(safe-area-inset-bottom));
  padding: 0;
  background: transparent;
  border: 0;
}
/* Accueil (maquette 1) : panneau en verre, titre centré, tournée dans une carte, tuiles 2 × 2, Démarrer et Démo côte
   à côte. */
#setup.panel {
  background-color: var(--glass-panel);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(255, 255, 255, 0.12) 38%,
    rgba(255, 255, 255, 0.2) 100%
  );
  -webkit-backdrop-filter: blur(26px) saturate(190%);
  backdrop-filter: blur(26px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 32px;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    inset 0 -1px 1px rgba(24, 42, 53, 0.05),
    0 12px 36px rgba(24, 42, 53, 0.16);
  bottom: 106px;
}
#app:has(#resume:not([hidden])) #setup.panel,
#app:has(#update:not([hidden])) #setup.panel {
  bottom: 170px;
}
/* Journée mise de côté : une ligne sobre sous les boutons, sur la carte. */
#app:has(#aside-day:not([hidden])) #setup.panel {
  bottom: 158px;
}
#app:has(#aside-day:not([hidden])):has(#resume:not([hidden])) #setup.panel,
#app:has(#aside-day:not([hidden])):has(#update:not([hidden])) #setup.panel {
  bottom: 222px;
}
.aside-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 2px 4px 2px 14px;
  border-radius: var(--radius-l);
  background: var(--glass-panel);
  color: var(--ink);
  font-size: var(--text-caption);
}
.aside-day button {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
  text-decoration: underline;
}
/* Choisir la tournée (maquette 23) : carte blanche, numéro cerclé de foncé. */
.route-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 14px;
  border: 0;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 255, 255, 0.6);
}
.route-choice .route-number {
  flex: none;
  padding: 8px 9px;
  border-radius: 12px;
  background: var(--accent);
  font-size: 17px;
  font-weight: 800;
  border: 1.5px solid rgba(24, 42, 53, 0.85);
}
/* « Reprendre la journée » (11/10) : bouton jaune comme « Démarrer ma tournée » ; quand il est là, « Démarrer »
   passe en blanc. */
.setup-actions #resume {
  margin: 0 0 8px;
  min-height: 60px;
  border-radius: 30px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 10px 26px rgba(158, 118, 10, 0.3);
  font-size: 17px;
  font-weight: 750;
}
.setup-actions #resume[hidden] {
  display: none;
}
.setup-actions:has(#resume:not([hidden])) .start-row #start {
  background-color: rgba(255, 255, 255, 0.8);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 60%);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  box-shadow:
    inset 0 1px 1px #fff,
    0 8px 20px rgba(24, 42, 53, 0.14);
}
@media (max-width: 600px) {
  .brand {
    font-size: 23px;
    top: max(16px, env(safe-area-inset-top));
    left: 20px;
    right: 20px;
  }
  .panel {
    left: 12px;
    right: 12px;
    width: auto;
    top: max(82px, calc(env(safe-area-inset-top) + 66px));
    bottom: max(12px, env(safe-area-inset-bottom));
    padding: 18px;
  }
  .setup-actions {
    left: 12px;
    right: 12px;
    width: auto;
  }
  #setup.panel {
    bottom: max(106px, calc(env(safe-area-inset-bottom) + 76px));
  }
}
@media (max-width: 360px) {
  .zone-button small {
    font-size: var(--text-caption);
  }
  .mode-label {
    font-size: var(--text-caption);
    padding: 6px;
    max-width: calc(100% - 100px);
  }
  .setup-head h1,
  .panel .setup-head h1 {
    font-size: 26px;
    line-height: 30px;
  }
  .setup-actions {
    bottom: 10px;
  }
  #setup.panel {
    bottom: 84px;
  }
}
@media (max-height: 690px) {
  .route-number {
    padding: 8px;
  }
  .stats {
    padding: 10px 0;
  }
  .stats b {
    font-size: 24px;
  }
  .route-card {
    margin-top: 10px;
    min-height: 54px;
  }
}
@media (min-width: 650px) and (max-height: 500px) {
  .brand {
    top: 12px;
  }
  .panel {
    top: 72px;
    bottom: 12px;
  }
}

/* Roue des paramètres (21/10, maquette B) : bandeau jaune avec le profil, cases posées à cheval dessus, sauvegarde en
   pastille, boutons directs. */
.profile-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 64px;
  border-radius: 26px;
  background: linear-gradient(160deg, #f9d873, var(--accent) 55%, #eab62f);
  box-shadow: 0 12px 28px rgba(158, 118, 10, 0.25);
}
.profile-avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 6px 16px rgba(120, 90, 10, 0.25);
}
.profile-avatar svg {
  width: 54px;
  height: 54px;
  fill: var(--ink);
}
.profile-who {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}
.profile-name {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.3px;
  text-align: left;
}
.profile-name-input {
  width: 100%;
  padding: 3px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}
.profile-role {
  color: #4b4a33;
  font-size: 14px;
}
.profile-tiles {
  position: relative;
  display: grid;
  /* Des colonnes qui ne s'élargissent pas avec un grand nombre, des lignes de même hauteur (audit du 07/11). */
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-auto-rows: 1fr;
  gap: 10px;
  margin: -48px 12px 12px;
}
.profile-tile {
  display: flex;
  flex-direction: column;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  background: var(--paper);
  box-shadow:
    inset 0 1px 1px #fff,
    0 6px 18px rgba(24, 42, 53, 0.09);
}
.profile-tile b {
  color: var(--ink);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
}
.profile-tile b small {
  display: inline;
  margin-left: 3px;
  font-size: 15px;
  letter-spacing: 0;
}
.profile-tile > span {
  color: var(--muted);
  font-size: 13px;
}
/* Petit iPhone (SE) : « ✉️ recommandés » tient sur une ligne, les cases gardent la hauteur de deux lignes. */
@media (max-width: 380px) {
  .profile-tile > span {
    font-size: 12px;
  }
}
/* Les km de toutes les tournées, sur deux lignes à côté des colis et des recommandés ; dessous, « Mes tournées » à
   gauche et les tournées validées à droite (07/11, demandes du facteur : la case des km était trop grande). */
.profile-km {
  grid-row: span 2;
  padding: 14px 16px;
}
.profile-km b {
  white-space: nowrap;
  font-size: min(44px, 11vw);
  letter-spacing: -2px;
}
.profile-tile .profile-average {
  margin-top: 6px;
  color: var(--ink);
  font-weight: 650;
}
.profile-road {
  width: 64px;
  height: 40px;
  margin-bottom: auto;
  fill: none;
  stroke-linecap: round;
}
.profile-road-way {
  stroke: rgba(244, 197, 66, 0.5);
  stroke-width: 9;
}
.profile-road-line {
  stroke: var(--ink);
  stroke-width: 1.6;
  stroke-dasharray: 3 4;
  opacity: 0.45;
}
.profile-save {
  margin: 0 12px 16px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(19, 102, 77, 0.09);
  color: var(--done);
  font-size: 14px;
  font-weight: 650;
  text-align: center;
}
.profile-save.off {
  background: var(--surface-2);
  color: var(--muted);
}
.settings-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
/* « Mes tournées » (07/11) : dans la grille des chiffres qu'il détaille, à la place d'une case ; en jaune, sinon on ne
   comprenait pas que c'était un bouton (demande du facteur). La place prise, discrète, n'est pas un chiffre de
   tournée. */
#sheet-body .profile-ranking {
  width: auto;
  min-height: 0;
  margin: 0;
  padding: 10px 12px;
  border-radius: 22px;
}
.profile-storage-line {
  margin: -6px 12px 14px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
/* Le classement des tournées (07/11, voulu par le facteur) : un podium, le premier au milieu et en jaune, le seul
   jaune de la fiche ; puis une fiche par tournée, sa barre de km au regard de la première et ses quatre chiffres. Une
   tournée jamais ouverte ici : en pointillés, sans rang ni chiffres. */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 18px;
}
.step {
  flex: 0 1 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  text-align: center;
}
.step b {
  font-size: 18px;
  font-weight: 800;
}
.step small {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}
.step-block {
  display: grid;
  place-items: center;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 18px 18px 6px 6px;
  background: var(--paper);
  box-shadow:
    inset 0 1px 1px #fff,
    0 6px 18px rgba(24, 42, 53, 0.09);
  color: var(--ink);
  font-size: 28px;
  font-weight: 800;
}
.step-1 .step-block {
  height: 96px;
  background: var(--accent);
}
.step-2 .step-block {
  height: 70px;
}
.step-3 .step-block {
  height: 52px;
}
.tour-cards {
  display: grid;
  gap: 10px;
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}
.tour-card {
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  background: var(--paper);
  box-shadow:
    inset 0 1px 1px #fff,
    0 6px 18px rgba(24, 42, 53, 0.09);
}
.tour-card.unopened {
  border: 1px dashed rgba(24, 42, 53, 0.22);
  background: transparent;
  box-shadow: none;
}
.tour-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tour-bar {
  height: 6px;
  margin: 10px 0 8px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--surface-2);
}
.tour-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--route);
}
.tour-stats {
  display: grid;
  /* La dernière colonne un peu plus large : « recommandés » y tient (audit du 07/11). */
  grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr);
  gap: 6px;
}
.tour-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.tour-stats b {
  white-space: nowrap;
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}
.tour-stats small {
  color: var(--muted);
  font-size: 12px;
}
.tour-card-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.rank-badge {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}
.rank-who {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.rank-who b {
  font-size: 18px;
  font-weight: 800;
}
.rank-who span {
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}
/* Version, discrète, qui ouvre « Version et diagnostic » (MAJ-030) : un vrai bouton, à la taille d'un doigt. */
.settings-version {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  opacity: 0.7;
}
/* Version et diagnostic : une ligne par état, libellé à gauche, valeur à droite. */
.diagnostic {
  margin: 0 0 16px;
}
.diagnostic > div {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
}
.diagnostic dt {
  flex: none;
  color: var(--muted);
  font-size: 14px;
}
.diagnostic dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
}
.diagnostic-back {
  display: block;
  margin: 0 auto;
}
/* Boutons côte à côte sur une ligne, même hauteur et même alignement, quelle que soit leur couleur (retours du facteur,
   25/10). Chacun prend la largeur de son libellé, sans jamais le couper ni le passer à la ligne ; « Annuler », un seul
   mot, reste court à côté de « Oublier ce téléphone ». */
#sheet-body .settings-actions > button {
  flex: 1 1 auto;
  width: auto;
  margin-top: 0;
  padding: 14px 8px;
  font-size: 16px;
  white-space: nowrap;
}
#sheet-body .settings-actions > #forget-confirm,
#sheet-body .settings-actions > #repair-confirm {
  padding: 14px 16px;
}
#sheet-body .settings-actions > #forget-cancel,
#sheet-body .settings-actions > #repair-cancel {
  flex: none;
  padding: 14px 22px;
}

/* ==================================================================================================================
   10. Préparation : presse, collecte, colis et recommandés, remise à zéro
   ================================================================================================================== */

.prep-sections button:hover {
  border-color: var(--ink);
}
.prep-toolbar [aria-pressed='true'] {
  background: var(--accent);
  color: var(--on-accent);
}
#sheet-body:has(#prep-search) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#prep-search,
#prep-count,
#reset-confirmation {
  flex-shrink: 0;
}
#prep-count {
  font-size: 12px;
  color: var(--muted);
  margin: 10px 0;
}
.prep-address {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 72px;
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.prep-address > div:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}
.prep-address b {
  font-size: 15px;
  line-height: 1.4;
}
.prep-address small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.prep-toggle {
  position: relative;
  width: 52px;
  min-height: 44px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 22px;
}
.prep-toggle[aria-pressed='true'] {
  background: var(--ok-bg);
  border-color: #287157;
}
.prep-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 0 8px;
}
.prep-sections b {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.prep-sections button > span {
  font-size: 22px;
  line-height: 26px;
}
.prep-sections output {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.prep-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-bottom: 12px;
}
.scan-pill .icon {
  width: 20px;
  height: 20px;
}
.list-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 2px 8px;
  padding: 0 6px;
  margin: 0 0 8px;
  flex-shrink: 0;
}
.list-head > span:first-child {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.list-head #prep-count {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
/* Colis et recommandés (audit du 20/11) : sur chaque ligne « 📦 + » (jaune) et « ✉️ + » (bleu), toujours à la même
   place ; ce qui est compté dessous, « 📦 2 − », sur fond vert. */
.prep-add {
  display: flex;
  gap: 6px;
}
#sheet-body .prep-add button {
  min-width: 56px;
  min-height: 44px;
  margin: 0;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(158, 118, 10, 0.25);
}
#sheet-body .prep-add button.registered {
  background: #eef0fb;
  color: #3a4a8c;
  box-shadow: inset 0 0 0 1px rgba(58, 74, 140, 0.25);
}
.prep-haves {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.prep-have {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 10px;
  border-radius: 14px;
  border: 1.5px solid #287157;
  background: var(--ok-bg);
  font-size: 15px;
}
.grouped .prep-address .prep-have b {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
#sheet-body .prep-have button {
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid rgba(40, 113, 87, 0.3);
  border-radius: 0 12px 12px 0;
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
  font-size: 20px;
  font-weight: 700;
}
/* Pendant la recherche (audit du 20/11) : scanner et filtre se replient, les résultats remontent au-dessus du clavier
   (une seule ligne visible avant). */
#sheet-body:has(#prep-search[data-busy]) :is(.prep-toolbar, #prep-filter) {
  display: none;
}
/* Bannière « Annuler » (comme au camion) entre la liste et « Terminé ». */
#prep-undo {
  flex-shrink: 0;
  margin: 0 0 10px;
}
/* Colis d'hier (lot 1, S1-01) : en bas de la liste du jour, repliés et grisés, en lecture seule ; « Vider » dedans. */
.prep-past {
  border-top: 1px solid var(--border);
  color: var(--muted);
}
.prep-past > summary {
  min-height: 44px;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 650;
}
.past-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  font-size: 14px;
}
.past-row small {
  display: block;
  font-size: var(--text-caption);
}
.past-count {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* « Remettre » d'une ligne (relecture du 22/11) : à la taille du doigt. */
#sheet-body .past-row .text-button {
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  font-size: 14px;
}
#sheet-body .prep-past .secondary {
  width: calc(100% - 28px);
  margin: 4px 14px 10px;
}
/* Liste groupée : fond de verre clair, filets décalés après le numéro d'ordre. */
.grouped {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.grouped .prep-address + .prep-address::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50px;
  right: 0;
  height: 1px;
  background: rgba(24, 42, 53, 0.07);
}
.grouped .prep-address b {
  font-size: 16px;
  line-height: 1.3;
}
.grouped .prep-address small {
  margin-top: 1px;
}
.grouped .empty {
  padding: 14px;
}
.grouped .prep-toggle {
  width: 52px;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  opacity: 0.45;
}
.grouped .prep-toggle[aria-pressed='true'] {
  opacity: 1;
  border: 1.5px solid #287157;
  background: var(--ok-bg);
}
/* Quantité : − en verre, + jaune, chiffre en gras. */
.grouped .quantity {
  grid-template-columns: 44px minmax(26px, auto) 44px;
  gap: 6px;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}
.grouped .quantity button {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.75);
  font-weight: 600;
}
.grouped .quantity button:last-child {
  border: 0;
  background: var(--accent);
  font-weight: 700;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.7);
}
.grouped .quantity output {
  font-size: 18px;
  font-weight: 800;
}
#prep-list {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
  margin-bottom: 12px;
}
/* Scan terminé (maquette 21) : bandeau de quatre cases, total en vert ; un compte vert par adresse. */
.recap-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 6px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  overflow: hidden;
}
.recap-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 2px;
  text-align: center;
  min-width: 0;
}
.recap-cell + .recap-cell {
  border-left: 1px solid rgba(24, 42, 53, 0.07);
}
.recap-cell > span {
  font-size: 18px;
  line-height: 22px;
}
.recap-cell b {
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.recap-cell small {
  font-size: 12px;
  color: var(--muted);
}
.recap-cell.total {
  background: var(--ok-bg);
}
.recap-cell.total > span,
.recap-cell.total b {
  color: var(--done);
  font-weight: 800;
}
.recap-cell.total small {
  color: #1c5240;
  font-weight: 700;
}
.recap-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 6px 14px;
}
.recap-row > div {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.recap-row b {
  display: block;
  font-size: 16px;
}
.recap-row small {
  font-size: 12px;
  color: var(--muted);
}
.count-pill {
  flex: none;
  min-width: 32px;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--ok-bg);
  color: #1c5240;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
/* Détail d'un CIDEX en tournée (maquette 22) : trois cases, puis chaque boîte avec ses objets en pastilles et 📍 la
   maison. */
.recap-cells.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.recap-value {
  flex: none;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.recap-value small {
  display: block;
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}
.recap-name {
  font-size: 16px;
}
.prep-sections button {
  display: grid;
  justify-items: center;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  grid-template-rows: auto;
  gap: 2px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  min-height: 64px;
  padding: 6px;
  line-height: 1.2;
}
#sheet:has(#prep-search) {
  width: 600px;
  height: calc(100dvh - max(64px, calc(env(safe-area-inset-top) + 64px)) - max(8px, env(safe-area-inset-bottom)));
}
#sheet:has(#prep-search) #sheet-body {
  flex: 1 1 auto;
}
.scan-pill {
  flex: 1;
  min-height: 50px;
  margin: 0;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 750;
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 6px 16px rgba(158, 118, 10, 0.22);
  white-space: nowrap;
  padding: 0 14px;
}
/* Latence au toucher (retours du 11/10) : les lignes hors écran des longues listes (900 adresses) ne sont ni mises
   en page ni peintes ; leur hauteur est réservée pour garder le défilement juste. */
.grouped .prep-address {
  position: relative;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 60px;
  padding: 6px 8px 6px 14px;
  border-bottom: 0;
  content-visibility: auto;
  contain-intrinsic-size: auto 60px;
}
/* Barre du scanner : la pilule se resserre pour laisser entiers les deux boutons ronds (remise à zéro coupée à
   droite). */
.prep-toolbar .scan-pill {
  min-width: 0;
  padding: 0 10px;
  gap: 6px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.prep-toolbar .round {
  border-radius: 50%;
  width: 50px;
  height: 50px;
  min-width: 50px;
  flex: none;
}
/* Remise à zéro des colis et recommandés (retour du 15/10) : nouvelle journée en jaune, puis l'un ou l'autre seul,
   puis Annuler. */
#sheet-body .reset-panel {
  margin: 0 0 12px;
}
#sheet-body .reset-panel[hidden] {
  display: none;
}
.reset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 6px;
}
.reset-head b {
  font-size: 16px;
}
#sheet-body .reset-cancel {
  margin: 0;
  min-height: 44px;
  padding: 0 6px;
  border: 0;
  background: none;
  box-shadow: none;
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
#sheet-body .reset-panel .menu-list {
  margin: 0;
}
#sheet-body .reset-panel .menu-row {
  width: 100%;
  text-align: left;
}
#sheet-body .reset-panel .chip {
  font-variant-numeric: tabular-nums;
}
/* Pendant le choix de remise à zéro, « Terminé » s'efface : il cachait « Annuler » sur petit iPhone. */
#sheet-body:has(#reset-confirmation:not([hidden])) #prep-done {
  display: none;
}
/* Chaque ligne de remise à zéro se termine par un rond jaune ↺ : on voit qu'elle se touche (retour du 15/10). */
.reset-go {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: 8px;
  border-radius: 18px;
  background: var(--accent);
  color: var(--ink);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 2px 6px rgba(158, 118, 10, 0.25);
}
.reset-go .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.4;
}
@media (max-width: 360px) {
  .prep-address {
    grid-template-columns: minmax(0, 1fr);
  }
  .prep-address > .quantity,
  .prep-address > .prep-toggle {
    justify-self: end;
  }
  .grouped .prep-address {
    grid-template-columns: 22px minmax(0, 1fr);
    row-gap: 4px;
  }
  .grouped .prep-address > .quantity,
  .grouped .prep-address > .prep-toggle,
  .grouped .prep-address > .prep-add {
    grid-column: 2;
    justify-self: end;
  }
  .recap-cell small {
    font-size: 10.5px;
  }
  .recap-cell b {
    font-size: 21px;
  }
  .scan-pill {
    white-space: normal;
    font-size: 14px;
    line-height: 1.2;
  }
  /* Filtres Colis / Recommandés / Tout (fiche et camion) : « Recommandés » reste entier. */
  #sheet-body .vehicle-filter,
  #sheet-body .prep-filter {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 1fr);
  }
  #sheet-body .vehicle-filter button,
  #sheet-body .prep-filter button {
    font-size: 13px;
  }
  /* Petits écrans : les onglets perdent leur emoji pour garder « Recommandés · N » entier. */
  .segment-icon {
    display: none;
  }
  .reset-go {
    width: 32px;
    height: 32px;
    margin-left: 4px;
  }
  #sheet-body .reset-panel .menu-row {
    gap: 8px;
    padding-left: 10px;
    padding-right: 10px;
  }
}
@media (max-height: 700px) {
  /* Écrans bas (iPhone SE, paysage) : toute la fiche défile, la liste ne se retrouve jamais écrasée ; « Terminé »
     reste en bas. */
  #sheet-body:has(#prep-search) {
    display: block;
    overflow-y: auto;
  }
  #sheet-body:has(#prep-search) #prep-list {
    overflow: visible;
  }
}

/* ==================================================================================================================
   11. Charger mon véhicule
   ================================================================================================================== */

/* Accueil : ligne « Charger mon véhicule » sous les tuiles. */
.vehicle-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  margin: 0 0 6px;
  padding: 0 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  color: var(--ink);
  text-align: left;
}
.vehicle-open > span {
  font-size: 24px;
  line-height: 26px;
}
.vehicle-open b {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
}
.vehicle-open .icon {
  width: 16px;
  height: 16px;
  color: #8c989e;
  stroke-width: 2.6;
}
/* Charger mon véhicule (maquette 4 b) : frise pointillée, premier à livrer en vert, dernier en sombre, adresse
   complète grisée. */
/* En haut (MAJ-121) : « Ajouter une adresse » et le scanner sur une ligne ; les adresses trouvées dessous, chacune avec
   « 📦 +1 » et « ✉️ +1 » (ajoutés sans être chargés, 20/11). */
.vehicle-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
#sheet-body .vehicle-tools .search-field {
  flex: 1;
  min-width: 0;
  margin: 0;
}
#sheet-body .vehicle-tools .scan-pill {
  flex: none;
  width: auto;
  min-height: 46px;
  padding: 0 14px;
  font-size: 15px;
}
/* Barre Colis / Recommandés / Tout (04/11) : sous « Ajouter une adresse », au-dessus de « Premier à livrer ». */
.vehicle-filter,
.prep-filter {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 8px;
}
.vehicle-filter button,
.prep-filter button {
  padding-inline: 2px;
}
.vehicle-results {
  margin: 0 0 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 20px rgba(24, 42, 53, 0.14);
  overflow: hidden;
}
.vehicle-result {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px 6px 14px;
}
.vehicle-result + .vehicle-result {
  border-top: 1px solid var(--border);
}
.vehicle-result > span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.vehicle-result b {
  font-size: 15px;
}
.vehicle-result small {
  font-size: 12px;
  color: var(--muted);
}
.vehicle-result button {
  flex: none;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--badge-bg);
  color: var(--badge-ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.vehicle-result button.letters {
  background: #eef0fb;
  color: #3a4a8c;
}
.vehicle-list {
  padding: 0 4px;
}
.vehicle-end {
  margin: 0 0 6px;
  padding-left: 46px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.vehicle-end.first {
  color: var(--done);
}
.vehicle-end.last {
  margin: 6px 0 0;
}
.vehicle-row {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  padding: 5px 0;
}
.vehicle-row::before {
  content: '';
  position: absolute;
  left: 15.5px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: repeating-linear-gradient(180deg, #368a79 0 6px, transparent 6px 11px);
}
.vehicle-row.first::before {
  top: 50%;
}
.vehicle-row.last::before {
  bottom: 50%;
}
.vehicle-row.first.last::before {
  display: none;
}
.vehicle-rank {
  position: relative;
  z-index: 1;
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  font-size: 13px;
  font-weight: 800;
  color: var(--done);
  isolation: isolate;
}
.vehicle-rank::before {
  content: '';
  position: absolute;
  inset: 0 2px;
  border-radius: 15px;
  background: #fff;
  border: 2.5px solid #368a79;
  z-index: -1;
}
.vehicle-row.first .vehicle-rank {
  color: #fff;
}
.vehicle-row.first .vehicle-rank::before {
  background: var(--done);
  border-color: var(--done);
  box-shadow: 0 0 0 4px rgba(19, 102, 77, 0.15);
}
.vehicle-row.last:not(.first) .vehicle-rank {
  color: #fff;
}
.vehicle-row.last:not(.first) .vehicle-rank::before {
  background: var(--ink);
  border-color: var(--ink);
}
.vehicle-row.full .vehicle-rank {
  color: #fff;
}
.vehicle-row.full .vehicle-rank::before {
  background: #c9cfc7;
  border-color: #c9cfc7;
  box-shadow: none;
}
.vehicle-row > button {
  flex: 1;
  min-width: 0;
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
}
.vehicle-row > button > span:first-child {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-wrap: anywhere;
}
.vehicle-row b {
  font-size: 16px;
}
.vehicle-row small {
  font-size: 12px;
  color: var(--muted);
}
.vehicle-row.full > button {
  background: rgba(24, 42, 53, 0.05);
  border-color: rgba(24, 42, 53, 0.06);
  box-shadow: none;
  opacity: 0.5;
}
.vehicle-row.full b {
  text-decoration: line-through;
}
.vehicle-badge {
  flex: none;
  padding: 4px 9px;
  border-radius: 10px;
  background: rgba(255, 240, 197, 0.95);
  color: #665016;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.vehicle-badge.partial {
  background: var(--accent);
  color: var(--ink);
}
.vehicle-row.full .vehicle-badge {
  background: rgba(19, 102, 77, 0.14);
  color: var(--done);
}
/* Recommandés de l'adresse, à côté des colis. Ils se chargent aussi (09/11) : en partie, la couleur des colis en
   partie ; un type tout chargé sur une ligne qui ne l'est pas encore (« 📦 ✓ », « ✉️ ✓ »), le vert d'une adresse
   chargée. */
.vehicle-row .vehicle-badge.letters {
  background: #eef0fb;
  color: #3a4a8c;
}
.vehicle-row .vehicle-badge.letters.partial {
  background: var(--accent);
  color: var(--ink);
}
.vehicle-row .vehicle-badge.loaded {
  background: rgba(19, 102, 77, 0.14);
  color: var(--done);
}
/* ✎ Corriger (MAJ-121) : bouton rond à droite de la ligne ; il ouvre dessous colis − +, recommandés − + et « un chargé
   de moins ». La ligne trouvée ou ajoutée s'entoure de jaune un instant. */
.vehicle-row > .vehicle-edit {
  flex: none;
  width: 44px;
  min-height: 44px;
  padding: 0;
  justify-content: center;
  border-radius: 22px;
  font-size: 18px;
  color: var(--muted);
}
.vehicle-row > .vehicle-edit[aria-expanded='true'] {
  background: var(--surface-2);
  color: var(--ink);
}
.vehicle-row.flash > button[data-load] {
  box-shadow: 0 0 0 3px var(--accent);
}
.vehicle-drawer {
  flex-basis: 100%;
  margin-left: 46px;
  display: grid;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.9);
}
.vehicle-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.vehicle-drawer .text-button {
  justify-self: start;
  font-size: 14px;
  font-weight: 700;
  color: var(--route);
  text-decoration: none;
}
/* Bannière « Annuler » au-dessus du bouton du bas : elle pousse la liste, elle ne la cache pas. */
.vehicle-undo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 6px 6px 6px 14px;
  border-radius: 18px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.vehicle-undo[hidden] {
  display: none;
}
.vehicle-undo span {
  flex: 1;
  min-width: 0;
}
.vehicle-undo button {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--ink);
  font-weight: 800;
}
#sheet:has(#vehicle-list) .sheet-head h2 {
  font-size: 23px;
  white-space: nowrap;
}
/* Charger mon véhicule (retour du 15/10) : « + Ajouter un colis » reste en haut, seule la liste des adresses défile. */
#sheet:has(#vehicle-list) #sheet-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#sheet-body:has(#vehicle-list) > :not(#vehicle-list) {
  flex-shrink: 0;
}
#vehicle-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#sheet-body:has(#vehicle-list) #vehicle-done {
  margin-top: 12px;
}

/* ==================================================================================================================
   12. Vérifier ma tournée
   ================================================================================================================== */

#review-route-warning:empty {
  display: none;
}
/* Vérifier ma tournée (maquette 12). */
.review-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.review-parts {
  display: flex;
  align-items: center;
  gap: 8px;
}
.review-label {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.review-parts .part-pill {
  border-radius: 8px;
  font-size: 15px;
  padding: 3px 10px;
}
.review-path {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
}
.review-path .arrow {
  color: #8c989e;
  font-weight: 400;
}
.review-path .centre {
  color: #1f4fa3;
}
.review-total {
  display: flex;
  gap: 18px;
  font-size: 15px;
}
.review-total b {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.review-tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.review-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  text-align: center;
}
.review-tile > span:first-child {
  font-size: 13px;
  font-weight: 600;
}
.review-tile .emoji {
  font-size: 22px;
  line-height: 26px;
}
.review-tile b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
}
#sheet-body .review-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 240, 197, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 600;
  color: #665016;
}
.review-note > span {
  font-size: 20px;
}
#sheet-body .review-start {
  min-height: 60px;
  border-radius: 30px;
  justify-content: space-between;
  padding: 0 24px;
}
/* Une journée existe : ce bouton la remplace, en rouge, comme les gestes de danger de l'éditeur (.btn.red). */
#sheet-body .review-start.replace-day {
  background-color: var(--danger);
  background-image: linear-gradient(#c63a31, var(--danger));
  color: #fff;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.3),
    0 6px 18px rgba(179, 38, 30, 0.28);
}

/* ==================================================================================================================
   13. Liste des arrêts et fiche d’une adresse
   ================================================================================================================== */

.stop-choice small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.stop-choice.current {
  background: #fff4c7;
  border-radius: 10px;
}
.stop-info {
  flex: 1;
  min-width: 0;
}
#elsewhere > summary,
.skipped-summary > summary {
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
}
#sheet-body:has(#stop-search) {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#stop-search,
#search-count {
  flex-shrink: 0;
}
#sheet-body #stop-list {
  overflow-y: auto;
  min-height: 0;
  overscroll-behavior: contain;
}
.stop-choice {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  color: inherit;
  border-bottom: 1px solid var(--border);
  min-height: 54px;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 2px;
}
.stop-rank {
  color: var(--muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 26px;
  font-size: 12px;
}
.stop-filters {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin: 6px 0;
}
/* Adresse à vérifier (MAJ-004), dans la fiche ⋯. */
.check-block {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--warn-bg);
  color: #5c3413;
}
.check-block p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.4;
}
.check-block p + p {
  margin-top: 10px;
}
.check-block .secondary {
  margin-top: 6px;
  background: var(--paper);
}
.check-block .text-button {
  min-height: 0;
  padding: 0 4px;
  color: inherit;
}
.check-block input {
  margin-top: 8px;
}
.check-block #number-form + p {
  margin-top: 14px;
}
#stop-search,
#mission-search {
  width: 100%;
  min-height: 46px;
  padding: 0 14px 0 40px;
  border-radius: 23px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  font-size: 16px;
  color: var(--ink);
  outline: none;
  background: rgba(24, 42, 53, 0.07)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2356656E' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4 4'/%3E%3C/svg%3E")
    no-repeat 14px 50%/18px;
}
#stop-search:focus,
#mission-search:focus {
  box-shadow: 0 0 0 2px rgba(23, 121, 219, 0.45);
}
/* Liste des arrêts (maquette 6) : filtres en contrôle segmenté, liste groupée, prochain arrêt surligné. */
#sheet-body .stop-filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 10px 0;
  padding: 4px;
  border-radius: 22px;
  background: rgba(24, 42, 53, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.6);
}
.stop-filters button {
  min-height: 44px;
  min-width: 44px;
  flex: 1;
  border: 1px solid transparent;
  border-radius: 18px;
  background: transparent;
  color: #3e4c55;
  font-weight: 600;
}
.stop-filters [aria-pressed='true'] {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 700;
  box-shadow:
    inset 0 1px 1px #fff,
    0 2px 8px rgba(24, 42, 53, 0.12);
}
#search-count {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0;
  padding: 0 6px;
}
.day-results,
#elsewhere[open] > .stop-choice:first-of-type {
  border-radius: 22px;
}
.day-results {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  overflow: hidden;
}
.day-results > .stop-choice {
  position: relative;
  border-bottom: 0;
  padding: 8px 8px 8px 14px;
}
.day-results > .stop-choice + .stop-choice::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50px;
  right: 0;
  height: 1px;
  background: rgba(24, 42, 53, 0.07);
}
.day-results > .stop-choice.current {
  background: rgba(255, 240, 197, 0.75);
  border-radius: 0;
}
.stop-choice b {
  display: block;
  overflow-wrap: anywhere;
  line-height: 1.35;
  font-size: 16px;
}
.stop-choice.expanded {
  color: var(--ink);
  transition: background 0.2s;
  background: rgba(255, 255, 255, 0.75);
}
/* Fiche de l'arrêt (maquette 3). */
.detail-actions {
  display: grid;
  margin: 0 0 12px;
}
#sheet-body .detail-actions .done {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  min-height: 58px;
  border-radius: 29px;
}
.detail-count {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 8px 0 14px;
}
.detail-count .row-icon {
  font-size: 22px;
  flex: none;
  width: 28px;
  text-align: center;
}
.detail-count .menu-label {
  flex: 1;
}
#sheet-body .menu-list > .detail-count + .detail-count::before {
  left: 54px;
}
#sheet-body .note-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.note-card:focus-within {
  box-shadow: 0 0 0 2px rgba(23, 121, 219, 0.45);
}
#sheet-body .note-card textarea {
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 16px;
  font-weight: 400;
  color: var(--ink);
  outline: none;
  box-shadow: none;
}
.detail-footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
#sheet-body .detail-footer .secondary {
  margin: 0;
  min-height: 52px;
  border-radius: 26px;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.detail-footer .icon {
  color: #1779db;
}
/* Fiche d'un CIDEX en tournée : Position GPS et ✎ Modifier côte à côte, « ← Retour » dessous sur toute la largeur. De
   même, sur une adresse, la remise d'une position et la question d'une position lointaine. */
.detail-footer #cidex-detail-back,
.detail-footer .whole-line {
  grid-column: 1 / -1;
}
/* Saut d'adresses (maquette 10). */
.jump-count {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(253, 236, 214, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.85);
}
.jump-count > b {
  font-size: 44px;
  line-height: 46px;
  letter-spacing: -1.5px;
  color: #8a4b10;
}
.jump-count span b {
  display: block;
  font-size: 17px;
}
.jump-count small {
  display: block;
  font-size: 14px;
  color: #6b4a22;
}
.jump-label {
  min-width: 34px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--muted);
}
.jump-range .recap-row b {
  font-size: 16px;
}
#sheet-body .menu-list.jump-range > * + *::before {
  left: 62px;
}
.jump-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
#sheet-body .jump-actions .secondary {
  margin-top: 8px;
  min-height: 52px;
}
/* Liste des arrêts (maquette 6) : état et icônes sur la seconde ligne, prochain arrêt en brun, P en bleu, ✕ sombre,
   actions en pilules côte à côte et « Ajouter au prochain arrêt » jaune. */
.stop-choice.current .stop-state {
  color: #665016;
  font-weight: 600;
}
.stop-filters .extra {
  color: #1f4fa3;
}
.stop-filters .extra[aria-pressed='true'] {
  color: #1f4fa3;
}
.stop-choice.expanded > .stop-info,
.stop-choice.expanded > .stop-rank {
  opacity: 1;
}
.stop-options .next-stop {
  grid-column: span 2;
  border-color: rgba(255, 255, 255, 0.6);
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
}
/* Liste des arrêts : « Y aller maintenant » entier et centré dans sa bulle (le « t » sortait à droite). */
.stop-options {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px 4px 10px 30px;
  padding-left: 12px;
}
/* Liste des arrêts (retour du 15/10) : « Dans l’ordre de la tournée » dépassait de sa bulle ; un libellé trop long
   passe sur deux lignes, centré, au lieu d’être coupé. */
.stop-options button {
  min-height: 44px;
  margin: 0;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  box-shadow:
    inset 0 1px 1px #fff,
    0 4px 12px rgba(24, 42, 53, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13.5px;
  white-space: normal;
  line-height: 1.15;
  padding: 4px 10px;
  overflow: visible;
}

/* ==================================================================================================================
   14. Objets du jour : liste, fiche d’une adresse, ajout
   ================================================================================================================== */

.mission-result small {
  color: var(--muted);
  margin-top: 1px;
}
.mission-add {
  margin: 0 0 6px;
  padding: 13px 16px;
  min-height: 48px;
}
.mission-row .menu-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.mission-row b {
  display: block;
  font-size: 16px;
}
.mission-row small {
  font-size: 13px;
  margin-top: 2px;
}
.mission-results {
  max-height: min(34vh, 260px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mission-chip > span {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.mission-chip small {
  font-size: 12px;
}
.mission-chip .text-button {
  padding: 8px 10px;
  text-decoration: none;
  color: var(--route);
  font-weight: 650;
  font-size: 14px;
}
.mission-quantity .field-label {
  margin: 0;
}
.mission-save {
  justify-content: center;
  margin-top: 18px;
}
.mission-total b {
  text-transform: none;
}
.mission-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 0;
}
/* Objets du jour (maquette 19) et ajout (maquette 20). */
.mission-total {
  margin: 0 6px 12px;
}
#sheet-body .mission-total .menu-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
  font-size: 15px;
  color: var(--ink);
}
.mission-total .progress {
  margin: 0;
}
#sheet-body .unknown-list {
  background: rgba(255, 240, 197, 0.75);
}
.unknown-list small {
  color: #6b5a22;
}
#sheet-body .mission-add {
  margin: 0 0 4px;
}
.mission-results:not(:empty) {
  margin-top: 10px;
  gap: 0;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.mission-result {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
  position: relative;
  min-height: 52px;
  padding: 6px 14px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.mission-result + .mission-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 0;
  height: 1px;
  background: rgba(24, 42, 53, 0.07);
}
.mission-result b {
  font-size: 16px;
}
.mission-results .field-label {
  margin: 10px 0 4px;
}
.mission-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border: 0;
  border-radius: 18px;
  background: var(--ok-bg);
  padding: 8px 8px 8px 14px;
}
#mission-unknown {
  width: auto;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  font-size: 15px;
}
.mission-quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  margin-top: 12px;
  padding: 0 6px 0 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
#sheet-body .mission-quantity .field-label {
  margin: 0;
  padding: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
#here-unknown:not(:empty) {
  margin: 0 0 12px;
}
.mission-row.given .menu-label b {
  font-weight: 600;
  color: #3e4c55;
}
/* Ajouter un objet (maquette 20) : l'adresse choisie reste dans la liste, surlignée en vert avec ✓. */
.mission-result[aria-checked='true'] {
  background: var(--ok-bg);
  padding-right: 44px;
}
.mission-result[aria-checked='true']::after {
  content: '✓';
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--done);
  font-size: 20px;
  font-weight: 800;
}
.mission-result[aria-checked='true'] small {
  color: #3c5a4e;
}
#sheet-body #mission-unknown {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-height: 44px;
  margin: 10px 0 0;
  padding: 0 16px;
}
#sheet-body #mission-unknown[hidden] {
  display: none;
}
/* Objets du jour : une ligne pour les colis, une pour les recommandés, le compte « remis » à droite. */
.mission-lines {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mission-lines > span {
  white-space: nowrap;
}

/* ==================================================================================================================
   15. CIDEX : liste, création, détail en tournée
   ================================================================================================================== */

.cidex-tabs button[aria-selected='true'] {
  border-color: var(--green);
  color: var(--ink);
}
#cidex-panel input[type='text'] {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper);
  color: var(--ink);
}
#cidex-panel .menu-label {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cidex-member {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
#sheet-body .cidex-anchor {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  font-weight: 500;
  min-height: 44px;
  cursor: pointer;
}
.cidex-member input {
  flex: none;
  width: 22px;
  height: 22px;
  accent-color: var(--green);
}
.cidex-member label span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.cidex-member small {
  font-size: 12px;
}
.cidex-member .round {
  flex: none;
  box-shadow: none;
  border: 1px solid var(--border);
  font-size: 22px;
}
.cidex-marker {
  border-color: var(--trail);
}
#cidex-error {
  color: #ad3535;
}
/* CIDEX (maquettes 14 et 14 b) : onglets en contrôle segmenté, nom dans une carte, « ＋ Adresse suivante » jaune,
   adresses groupées, point d'arrêt teinté de vert, position GPS en bleu. */
.cidex-tabs.segmented {
  gap: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
}
.cidex-tabs.segmented button {
  border-bottom-width: 1px;
}
.cidex-tabs.segmented button[aria-selected='true'] {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  font-weight: 700;
  box-shadow:
    inset 0 1px 1px #fff,
    0 2px 8px rgba(24, 42, 53, 0.12);
}
.cidex-note {
  text-align: center;
  margin: 4px 0 12px;
}
#cidex-panel .field-card input[type='text'] {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  outline: none;
}
.cidex-counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 4px 6px 8px;
}
.cidex-counter b {
  font-size: 17px;
}
.cidex-counter .quantity {
  grid-template-columns: 44px auto;
}
#sheet-body .cidex-counter .next-address {
  width: auto;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 700;
}
#cidex-members .cidex-member {
  min-height: 54px;
  padding: 6px 8px 6px 14px;
  border-bottom: 0;
}
#cidex-members .cidex-member:has(:checked) {
  background: rgba(54, 138, 121, 0.12);
}
#cidex-members .cidex-member small {
  display: block;
  color: var(--done);
  font-weight: 700;
}
#cidex-members .cidex-member .round {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.75);
}
#sheet-body #cidex-position {
  color: #1779db;
}
.cidex-detail-list .cidex-member {
  gap: 8px;
  min-height: 58px;
  padding: 6px 8px 6px 0;
  border-bottom: 0;
}
.cidex-open {
  flex: 1;
  min-width: 0;
  min-height: 46px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  padding: 4px 0 4px 14px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}
.cidex-open b {
  font-size: 16px;
  overflow-wrap: anywhere;
}
.cidex-member.done .cidex-open b {
  color: var(--muted);
  text-decoration: line-through;
}
#sheet-body .house-button {
  flex: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  color: #1779db;
}
#sheet:has(.cidex-tabs) {
  min-height: min(600px, calc(100dvh - 120px));
}
#sheet:has(.cidex-tabs) #sheet-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
#cidex-panel {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
#sheet-body #cidex-new {
  margin-top: auto;
}
/* CIDEX : adresses en gras. */
#cidex-members .cidex-member label span {
  font-size: 16px;
  font-weight: 700;
}
/* Détail d'un CIDEX : la liste des objets reprend l'allure de la liste des adresses ; hors journée en gris. */
.cidex-objects .cidex-member {
  gap: 8px;
  min-height: 58px;
  padding: 6px 8px 6px 0;
  border-bottom: 0;
}
.cidex-detail-list .cidex-member.outside .cidex-open b {
  color: var(--muted);
}
.cidex-open small {
  font-size: 13px;
  color: var(--muted);
}

/* ==================================================================================================================
   16. Menu de tournée et validation
   ================================================================================================================== */

.menu-validate {
  width: 100%;
  margin-bottom: 12px;
}
/* Interrupteur discret, dans le style de l'application (remplace la case à cocher native). */
#sheet-body .menu-switch,
.menu-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  touch-action: manipulation;
}
.menu-switch input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  position: relative;
  box-sizing: content-box;
  width: 51px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  background-color: var(--border);
  background-clip: padding-box;
  border: 7px solid transparent;
  /* Bord visible à l'état « non » (lot 6, M29 : 1,2:1, presque invisible ; 3,2:1 avec ce bord). */
  box-shadow: inset 0 0 0 1.5px #8a9187;
  cursor: pointer;
  transition: background-color 0.2s;
}
.menu-switch input::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px #0003;
  transition: transform 0.2s;
}
/* Couleur seule, jamais le raccourci « background » : il remettait le fond sur la zone de toucher (bord transparent de
   7 px), et l'interrupteur grossissait une fois activé (retour du facteur, 24/10). */
.menu-switch input:checked {
  background-color: var(--route);
  box-shadow: none;
}
.menu-switch input:checked::before {
  transform: translateX(20px);
}
.menu-switch input:focus-visible {
  outline: 2px solid var(--route);
  outline-offset: 2px;
}
.menu-validate:disabled {
  opacity: 0.45;
}
.menu-note {
  margin: -6px 0 10px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
/* Menu « Ma journée » (maquette 5). */
#sheet-body .menu-summary {
  margin: -4px 6px 10px;
  font-size: 14px;
  line-height: 1.45;
}
#sheet-body .menu-card {
  min-height: 52px;
  margin-top: 12px;
  padding: 0 12px 0 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
#sheet-body .menu-validate {
  margin-top: 4px;
}
.validate-day b {
  font-size: 17px;
  text-transform: capitalize;
  margin-right: 4px;
}
.part-pill {
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}
.part-pill.part-P {
  background: var(--blue-p);
  color: #fff;
}
/* Valider la tournée (maquette 11 b) : date et parties en pastilles, une ligne par élément. */
.validate-day {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
  margin: 0 0 12px;
  padding: 12px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.validate-day > span {
  display: flex;
  gap: 6px;
}
.validate-day .part-pill {
  padding: 6px 12px;
  font-size: 15px;
}
.ok-tick {
  color: var(--done);
  font-weight: 800;
  font-size: 18px;
}
.validate-ok {
  margin: 0 0 12px;
  padding: 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--done);
}
/* Menu (maquette 5) : rythme en vert, accueil en bleu. */
#menu-pace .menu-icon {
  color: var(--done);
}
#menu-home .menu-icon {
  color: #1779db;
}
#sheet-body .menu-credits {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

/* ==================================================================================================================
   17. Rythme de tournée
   ================================================================================================================== */
.pace-status small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.pace-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.pace-status b {
  font-size: 17px;
  color: var(--ink);
}
/* Colis de la journée (19/10) : petit repère, sans charger l'écran. */
.pace-parcels {
  margin-left: auto;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* Rythme (maquette 15, proposition D du 21/10 ; par adresse le 24/10) : carte de l’écart, progression et colis,
   puis la note sur les heures habituelles. */
#pace-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#pace-content .pace-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 18px 16px;
  border-radius: 24px;
  text-align: center;
  color: #fff;
  background-color: rgba(19, 102, 77, 0.9);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0) 60%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(19, 102, 77, 0.28);
}
.pace-status .pace-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #cdebdf;
}
#pace-content .pace-status b {
  color: #fff;
  font-size: 34px;
  line-height: 40px;
  letter-spacing: -1px;
}
#pace-content .pace-status small {
  font-size: 14px;
  color: #ddf0e8;
}
#pace-reason {
  margin: 0;
  padding: 14px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  font-size: 14px;
}
.pace-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.pace-progress > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.pace-progress b {
  font-size: 17px;
}
.pace-progress small {
  font-size: 13px;
  color: var(--muted);
}
/* Rythme : sans repère, la même carte verte, plus douce. */
#pace-content .pace-status.waiting {
  background-color: rgba(19, 102, 77, 0.72);
}
#pace-content .pace-status.waiting b {
  font-size: 26px;
  line-height: 32px;
}
.pace-note {
  padding: 0 8px;
}
.pace-note p {
  margin: 0 0 4px;
  font-size: 12px;
  line-height: 17px;
  color: var(--muted);
}
.pace-status #pace-reason {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #ddf0e8;
  font-size: 14px;
}
/* Rythme, proposition D du 21/10 (MAJ-133) : jauge dans la carte verte. Vous en blanc ; votre rythme habituel à
   cette heure, le rond en pointillé, nommé dessous. */
.pace-gauge {
  position: relative;
  align-self: stretch;
  height: 10px;
  margin: 12px 0 4px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
}
.pace-gauge:has(i) {
  margin-bottom: 22px;
}
.pace-gauge > span {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #fff;
}
.pace-gauge > i {
  position: absolute;
  top: -4px;
  width: 14px;
  height: 14px;
  margin-left: -9px;
  border-radius: 50%;
  border: 2px dashed #cdebdf;
  background: #2a7a61;
}
.pace-gauge > em {
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  font-size: 12px;
  font-style: normal;
  color: #cdebdf;
  white-space: nowrap;
}
/* Couleur de l'écart (choix du facteur, 24/10) : vert en avance, gris dans le rythme habituel (moins de 3 min),
   rouge en retard. Avant, la carte restait verte. */
#pace-content .pace-status.even {
  background-color: rgba(86, 101, 110, 0.92);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(86, 101, 110, 0.28);
}
#pace-content .pace-status.late {
  background-color: rgba(176, 46, 36, 0.92);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.4),
    0 8px 20px rgba(176, 46, 36, 0.28);
}
#pace-content :is(.pace-status.even, .pace-status.late) :is(.pace-eyebrow, small, .pace-gauge > em) {
  color: rgba(255, 255, 255, 0.85);
}
.pace-status.even .pace-gauge > i {
  border-color: rgba(255, 255, 255, 0.85);
  background: #56656e;
}
.pace-status.late .pace-gauge > i {
  border-color: rgba(255, 255, 255, 0.85);
  background: #8f2a20;
}
/* Colis du jour à droite de la progression, l'habitude en petit dessous. */
#pace-content .pace-parcels {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  padding: 0;
  font-size: 15px;
  color: var(--ink);
}
#pace-content .pace-parcels small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

/* ==================================================================================================================
   18. Fin de tournée
   ================================================================================================================== */

/* Fin de tournée (maquette 11) : bilan en 2 × 2, retour au centre en verre avec la maison bleue. */
#sheet-body .return-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}
.home-badge {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--blue-p);
  color: #fff;
}
.home-badge .icon {
  width: 18px;
  height: 18px;
}
.finish-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 6px 0 14px;
  text-align: center;
}
.finish-check {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: var(--done);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(19, 102, 77, 0.3);
}
.finish-hero.warn .finish-check {
  background: #e08a2e;
  box-shadow: 0 8px 20px rgba(224, 138, 46, 0.3);
}
.finish-check .icon {
  width: 30px;
  height: 30px;
  stroke-width: 3;
  color: #fff;
  stroke: #fff;
}
.finish-hero > b {
  font-size: 26px;
  line-height: 30px;
  letter-spacing: -0.6px;
}
.finish-hero > span:not(.finish-check) {
  font-size: 15px;
  color: var(--muted);
  padding: 0 24px;
}
.finish-cells {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
.finish-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 8px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.finish-cell b {
  font-size: 28px;
  line-height: 32px;
  letter-spacing: -0.8px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.finish-cell small {
  font-size: 13px;
  color: var(--muted);
}

/* ==================================================================================================================
   19. Aperçu de la tournée
   ================================================================================================================== */

#observation {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}
.observation-panel .menu-switch:last-child {
  border-bottom: 0;
}
/* Aperçu de la journée (maquette 16) : 🏠, parties dans une pilule de verre, options à droite (sombre une fois ouvert),
   réglages en verre sous les options, résumé en bas. */
.observation-bar {
  pointer-events: auto;
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  left: 12px;
  display: flex;
  gap: 8px;
  right: 12px;
  align-items: center;
}
.observation-bar .round {
  background: var(--paper);
  font-size: 20px;
  width: 52px;
  height: 52px;
  min-width: 52px;
  background-color: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(24, 42, 53, 0.14);
}
#observation-options {
  margin-left: auto;
}
#observation-options[aria-expanded='true'] {
  background: var(--ink);
  color: #fff;
}
/* Aperçu : boutons A, B, P à côté de ⌂ et ⚙. */
.observation-parts {
  margin-left: 4px;
  flex: 1;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  margin: 0;
  padding: 4px;
  border-radius: 26px;
  background-color: var(--glass-panel);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 6px 18px rgba(24, 42, 53, 0.14);
}
.observation-parts[hidden] {
  display: none;
}
.observation-parts button[aria-pressed='true'] {
  border-color: var(--ink);
  background: var(--accent);
  color: var(--ink);
}
.observation-parts button.extra[aria-pressed='true'] {
  background: var(--blue-p);
  color: #fff;
}
.observation-panel {
  pointer-events: auto;
  position: absolute;
  background: var(--paper);
  left: auto;
  right: 12px;
  top: calc(max(10px, env(safe-area-inset-top)) + 64px);
  width: min(250px, calc(100% - 24px));
  padding: 0;
  border-radius: 22px;
  overflow: hidden;
  background-color: rgba(255, 254, 250, 0.8);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 10px 28px rgba(24, 42, 53, 0.18);
}
.observation-panel .menu-switch {
  color: var(--ink);
  border-bottom: 1px solid var(--border);
  min-height: 52px;
  padding: 0 12px 0 16px;
  font-size: 15px;
  font-weight: 600;
  border-bottom-color: rgba(24, 42, 53, 0.07);
}
.observation-summary b {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.observation-summary span {
  font-size: 13px;
  color: var(--muted);
}
/* Parties de l'aperçu : 44 px au moins sous le doigt (la pilule fait 52 px avec sa marge). */
.observation-parts button {
  min-width: 44px;
  touch-action: manipulation;
  border: 0;
  background: transparent;
  color: #3e4c55;
  font-size: 16px;
  font-weight: 800;
  box-shadow: none;
  min-height: 44px;
  border-radius: 22px;
}
/* Aperçu : légende des parties à droite du résumé, quand les couleurs sont choisies. */
.observation-summary {
  pointer-events: auto;
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(34px, calc(env(safe-area-inset-bottom) + 24px));
  display: flex;
  padding: 14px 18px;
  border-radius: 24px;
  background-color: rgba(255, 254, 250, 0.72);
  background-image: var(--glass-sheen);
  -webkit-backdrop-filter: var(--glass-filter);
  backdrop-filter: var(--glass-filter);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 10px 28px rgba(24, 42, 53, 0.16);
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.observation-summary > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.observation-legend {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  font-weight: 700;
}
.observation-legend[hidden] {
  display: none;
}
.observation-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.observation-legend i {
  display: block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
}
/* Arrêts de l'Aperçu pour VoiceOver : hors de la vue, la carte les montre. */
.observation-stops {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Pendant l'Aperçu, la pastille « Centre » remplace la maison du centre. */
body.observing .depot-marker {
  display: none;
}

/* ==================================================================================================================
   20. Scanner des colis
   ================================================================================================================== */

/* Scanner des étiquettes (MAJ-094) : plein écran, au-dessus de tout. */
#scanner {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: #000;
  color: #fff;
  overflow: hidden;
}
#scan-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.scan-top {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 2;
}
.scan-top .round {
  background: #ffffffe0;
  color: var(--ink);
}
.scan-count {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 58px);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 1px 3px #000;
  z-index: 2;
}
.scan-live-hint {
  position: absolute;
  top: calc(54% + 12px);
  left: 16px;
  right: 16px;
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  text-shadow: 0 1px 3px #000;
  z-index: 2;
}
.scan-live-hint small {
  display: block;
  color: #e6ece9;
  font-size: 12px;
  font-weight: 400;
  margin-top: 4px;
}
.scan-choice {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 18%;
  padding: 14px;
  border-radius: 16px;
  background: var(--paper);
  color: var(--ink);
  z-index: 3;
  box-shadow: var(--shadow);
}
.scan-choice .secondary {
  margin-top: 8px;
}
.scan-candidate {
  text-align: left;
  font-size: 16px;
}
.scan-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: max(14px, env(safe-area-inset-bottom));
  z-index: 2;
}
.scan-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 650;
  background: #e3f1ec;
  color: var(--green);
}
.scan-banner > span:first-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}
.scan-banner[data-kind='away'] {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.scan-banner[data-kind='duplicate'] {
  background: #e6e9eb;
  color: #44525a;
}
.scan-banner[data-kind='error'] {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.scan-actions {
  display: flex;
  gap: 6px;
}
.scan-actions .secondary {
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
  background: #fff;
}
.scan-done {
  justify-content: center;
  margin: 0;
}
body.scanning {
  overflow: hidden;
}
/* Choix du type après une lecture (21/09) : deux gros boutons au pouce, rien n'est compté avant. */
.scan-kind-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}
.scan-kind {
  top: calc(54% + 16px);
}
.scan-kind-buttons button {
  display: grid;
  justify-items: center;
  place-content: center;
  gap: 2px;
  margin: 0;
  padding: 10px 8px;
  min-height: 74px;
  text-align: center;
}
.scan-kind-icon {
  font-size: 22px;
  line-height: 1;
}
.scan-kind-word {
  font-size: 16px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
#scan-kind-address {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
}
#sheet-body #scan-back {
  margin-top: 12px;
}
/* Scanner (maquettes 7 et 7 b, retours du 11/10). En haut, verre sombre : fermer, compte « 📦 · ✉️ », consigne.
   Le cadre de lecture garde sa place (réglage de la lecture) mais n'est plus dessiné que par ses quatre coins jaunes.
   En bas, une fiche de verre clair : adresse lue et deux gros boutons, ou choix d'adresse, puis Ignorer / Terminé. */
#scanner .scan-glass {
  border: 1px solid rgba(255, 255, 255, 0.28);
  background-color: rgba(24, 42, 53, 0.55);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
}
#scanner .scan-top {
  left: 14px;
  right: 14px;
  justify-content: space-between;
}
#scanner .scan-top .round {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 26px;
}
#scanner .scan-top .round .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.8;
}
.scan-tally {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
  white-space: pre;
}
#scanner .scan-count {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#scanner .scan-live-hint {
  top: calc(max(12px, env(safe-area-inset-top)) + 82px);
  left: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 16px;
  border-radius: 22px;
  border-color: rgba(255, 255, 255, 0.24);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: none;
}
#scanner .scan-live-hint[hidden] {
  display: none;
}
#scanner .scan-live-hint small {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  color: #dce7e3;
}
.scan-frame {
  position: absolute;
  left: 5%;
  width: 90%;
  top: 32%;
  height: 22%;
  transition: border-color 0.15s;
  z-index: 1;
  --corner: #f4c542;
  border: 0;
  border-radius: 14px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.22);
}
.scan-frame::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 5px solid var(--corner);
  border-radius: 14px;
  transition: border-color 0.15s;
  -webkit-mask: linear-gradient(90deg, #000 34px, transparent 34px calc(100% - 34px), #000 calc(100% - 34px)),
    linear-gradient(180deg, #000 34px, transparent 34px calc(100% - 34px), #000 calc(100% - 34px));
  -webkit-mask-composite: source-in;
  mask: linear-gradient(90deg, #000 34px, transparent 34px calc(100% - 34px), #000 calc(100% - 34px)),
    linear-gradient(180deg, #000 34px, transparent 34px calc(100% - 34px), #000 calc(100% - 34px));
  mask-composite: intersect;
}
.scan-frame[data-flash='ok'] {
  border-color: #3fb489;
  --corner: #3fb489;
  box-shadow: 0 0 0 100vmax rgba(19, 102, 77, 0.3);
}
.scan-frame[data-flash='warn'] {
  border-color: #e0a050;
  --corner: #e0a050;
}
.scan-frame[data-flash='dup'] {
  border-color: #9aa6ad;
  --corner: #c3ccd1;
}
#scanner .scan-bottom {
  left: 8px;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 14px 18px;
  border-radius: 34px;
  background-color: rgba(255, 254, 250, 0.82);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.65) 0%,
    rgba(255, 255, 255, 0.15) 40%,
    rgba(255, 255, 255, 0.25) 100%
  );
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  backdrop-filter: blur(30px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 -6px 32px rgba(0, 0, 0, 0.3);
  color: var(--ink);
}
#scanner .scan-kind,
#scanner .scan-choice {
  position: static;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
  background: none;
  box-shadow: none;
  border-radius: 0;
  color: var(--ink);
}
#scanner .scan-kind[hidden],
#scanner .scan-choice[hidden],
#scanner .scan-row > [hidden] {
  display: none;
}
.scan-read {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 6px;
}
.scan-read > div {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.scan-read small,
.scan-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.scan-read-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: var(--done);
  color: #fff;
}
.scan-read-check .icon {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}
#scanner #scan-kind-address {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-align: left;
}
#scanner .scan-kind-buttons {
  margin: 0;
  gap: 8px;
}
#scanner .scan-kind-buttons button {
  min-height: 84px;
  gap: 4px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background-color: rgba(244, 197, 66, 0.94);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0) 60%);
  color: var(--ink);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.85),
    0 6px 16px rgba(158, 118, 10, 0.22);
}
#scanner .scan-kind-word {
  font-size: 17px;
  font-weight: 750;
}
#scanner .scan-kind-icon {
  font-size: 28px;
  line-height: 32px;
}
#scanner .scan-choice {
  gap: 10px;
}
.scan-choice > .scan-eyebrow,
.scan-choice > .scan-title,
.scan-choice > .scan-sub {
  padding: 0 6px;
}
.scan-choice > .scan-eyebrow {
  color: #8a5a1c;
  margin-bottom: -8px;
}
.scan-title {
  font-size: 22px;
  line-height: 26px;
  letter-spacing: -0.4px;
}
.scan-sub {
  margin-top: -8px;
  font-size: 13px;
  color: var(--muted);
}
#scan-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#scanner .scan-candidate {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  margin: 0;
  padding: 0 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.7);
  text-align: left;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.scan-candidate > b {
  min-width: 48px;
  font-size: 22px;
  font-variant-numeric: tabular-nums;
}
.scan-candidate > span {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.scan-candidate > span > span {
  font-size: 16px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.scan-candidate small {
  font-size: 12px;
  color: var(--muted);
}
.scan-candidate .icon {
  width: 16px;
  height: 16px;
  stroke: #8c989e;
  stroke-width: 2.6;
}
#scanner #scan-none {
  margin: 0;
  min-height: 50px;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.5);
}
#scanner .scan-banner {
  margin: 0;
  border-radius: 18px;
}
.scan-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
}
#scanner .scan-row button {
  margin: 0;
  min-height: 50px;
  border-radius: 25px;
  font-size: 15px;
}
#scanner #scan-skip {
  border: 1px solid rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.6);
  font-weight: 650;
}
#scanner #scan-done {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background-color: var(--done);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 55%);
  color: #fff;
  font-weight: 750;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

/* ==================================================================================================================
   21. Déverrouillage et écran de chargement
   ================================================================================================================== */

#unlock[hidden] {
  display: none;
}
/* Écran de chargement : le même que l'image de lancement, pour un démarrage sans flash. */
#loading {
  position: absolute;
  inset: 0;
  place-items: center;
  background: var(--paper);
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 18px;
  color: var(--muted);
  font-size: 15px;
}
#loading .brand-icon {
  width: 72px;
  height: 72px;
  border-radius: 22px;
}
#loading .brand-icon .icon {
  width: 40px;
  height: 40px;
}
/* Filet du démarrage (startup-guard.js) : explication et « Réessayer » sous le chargement. */
#loading .loading-help {
  max-width: 280px;
  margin: 0;
  text-align: center;
}
#loading-retry {
  min-width: 200px;
  margin-top: 0;
}
.unlock-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 30px 22px 24px;
  border-radius: 34px;
  text-align: center;
  background-color: var(--glass-panel);
  background-image: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.6) 0%,
    rgba(255, 255, 255, 0.12) 40%,
    rgba(255, 255, 255, 0.22) 100%
  );
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.95),
    0 14px 40px rgba(24, 42, 53, 0.18);
}
.unlock-card .brand-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
}
.unlock-card h1 {
  margin: 6px 0 0;
  font-size: 30px;
  line-height: 34px;
  font-weight: 800;
  letter-spacing: -0.8px;
}
.unlock-card > p.muted {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
}
.search-field.unlock-field {
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  border-radius: 27px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 1px 2px rgba(24, 42, 53, 0.08);
}
.unlock-field:focus-within {
  box-shadow: 0 0 0 2px rgba(23, 121, 219, 0.45);
}
.unlock-field .icon {
  width: 20px;
  height: 20px;
  color: var(--muted);
  flex: none;
}
#unlock-phrase {
  width: 100%;
  box-sizing: border-box;
  border-radius: 14px;
  color: var(--ink);
  margin-top: 8px;
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 17px;
  outline: none;
}
#unlock-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
  min-height: 18px;
}
#unlock .primary {
  width: 100%;
  min-height: 58px;
  border-radius: 29px;
  margin: 0;
}
.unlock-brand {
  position: absolute;
  left: 0;
  right: 0;
  bottom: max(40px, env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--muted);
}
/* Déverrouillage : fond de carte dessiné (la vraie carte n'est pas encore chargée). */
/* Déverrouillage (maquette 17) : carte en verre, champ arrondi au cadenas, marque en bas. */
#unlock {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #e3ead6;
  background-color: #e3ead6;
  background-image: linear-gradient(90deg, transparent 22%, #fff1c2 22%, #fff1c2 26%, transparent 26%),
    linear-gradient(180deg, transparent 37%, #fff1c2 37%, #fff1c2 40%, transparent 40%),
    linear-gradient(
      162deg,
      transparent 58%,
      rgba(208, 222, 195, 0.8) 58%,
      rgba(208, 222, 195, 0.8) 78%,
      transparent 78%
    ),
    linear-gradient(20deg, rgba(214, 226, 201, 0.75) 0 18%, transparent 18%);
}
/* Accord de confidentialité d'un collègue (26/11) : la carte du déverrouillage, en texte à lire et cases à cocher ;
   la page défile quand le texte dépasse l'écran. */
#accord {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  justify-items: center;
  align-items: start;
  overflow-y: auto;
  padding: max(24px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  background: #e3ead6;
}
#accord[hidden] {
  display: none;
}
.accord-card {
  max-width: 460px;
  align-items: stretch;
  text-align: left;
}
.accord-card h1 {
  font-size: 26px;
  line-height: 30px;
}
.accord-point {
  margin: 0;
  font-size: 15px;
  line-height: 21px;
}
/* La seule case à cocher, pour les cinq points. */
.accord-consent {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 16px;
  line-height: 22px;
  font-weight: 700;
}
.accord-consent input {
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--ink);
}
#accord-points {
  display: grid;
  gap: 14px;
}
#accord-name {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  outline: none;
}
#accord-error {
  color: var(--danger);
  font-size: 14px;
  margin: 0;
  min-height: 18px;
}
#accord .primary {
  width: 100%;
  min-height: 58px;
  border-radius: 29px;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background-color: rgba(244, 197, 66, 0.94);
  font-size: 17px;
  font-weight: 800;
  justify-content: center;
  text-align: center;
}
#accord .primary:disabled {
  opacity: 0.45;
}

/* ==================================================================================================================
   22. Accessibilité : réduire les animations, réduire la transparence, très grand texte ; verre en roulant
   ================================================================================================================== */

/* Grand texte : ordre de lecture conservé, actions empilées et défilement possible. */
.large-type .round {
  width: 64px;
  height: 64px;
  min-width: 64px;
}
.large-type .address-row {
  grid-template-columns: minmax(0, 1fr) 64px;
}
.large-type .address-row > strong {
  max-width: none;
  grid-column: 1;
}
.large-type .destination-actions button {
  white-space: normal;
  overflow-wrap: anywhere;
}
.large-type .mode-label {
  max-width: calc(100% - 74px);
}
/* Très grand texte : le compteur passe sous l'adresse et laisse la largeur à la voie (audit du lot 6 : à 1,6 fois,
   un nom de voie de trois mots tenait sur quatre lignes). « Retour » et « Suivant » restent côte à côte : deux mots
   courts, qui tiennent. */
.large-type .destination .address-row {
  display: flex;
  flex-wrap: wrap;
}
.large-type .destination .counter {
  flex-basis: 100%;
  text-align: right;
  margin-top: -6px;
}
.large-type .address-row > div {
  grid-column: auto;
  grid-row: auto;
}
.large-type #details {
  grid-column: auto;
  grid-row: auto;
}
.large-type .destination .destination-actions {
  grid-template-columns: auto minmax(0, 1fr);
}
.large-type .destination-actions .back-button,
.large-type .destination-actions .delivered {
  white-space: nowrap;
  overflow-wrap: normal;
}
/* Grand texte, bandeau (audit du lot 6) : la distance jusqu'au virage n'est jamais coupée (« 55… » à 1,6 fois) ; la
   distance jusqu'à l'arrêt, secondaire, garde la taille du dessin et lui laisse la place. */
.large-type #distance {
  overflow: visible;
  text-overflow: clip;
}
.large-type #stop-km {
  font-size: 26px;
  line-height: 30px;
}
.large-type #stop-km .unit {
  font-size: 15px;
}
.large-type #stop-km-label {
  font-size: 13px;
}
/* Grand texte : la carte d'arrêt grandit ; les boutons ronds restent à 48 px (au-dessus des 44 px conseillés),
   serrés, pour ne pas la chevaucher (lot 6, H10 : à 64 px, la colonne descendait sur la carte d'arrêt). */
.large-type .map-button {
  width: 48px;
  height: 48px;
  min-width: 48px;
}
.large-type .map-tools {
  gap: 6px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .scan-frame {
    transition: none;
  }
}
/* Verre en roulant (batterie, audit du 22/10, H12) : pendant que la carte glisse, le verre de l'écran de tournée n'est
   plus flouté, car le flou était recalculé à chaque image. Un fond plus couvrant garde le même aspect ; le flou revient
   à l'arrêt. Classe « gliding » posée par map-view.mjs au départ et à l'arrêt. */
#navigation.gliding :is(.bandeau, .map-button, .destination, .glass-pill, .sim-control, .status-pill, .added-banner) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
#navigation.gliding .map-button {
  background-color: rgba(246, 250, 236, 0.9);
}
#navigation.gliding .destination {
  background-color: rgba(250, 252, 242, 0.93);
}
#navigation.gliding :is(.glass-pill, .sim-control) {
  background-color: rgba(246, 250, 236, 0.92);
}
#navigation.gliding .status-pill.dark {
  background-color: rgba(24, 42, 53, 0.9);
}
#navigation.gliding .bandeau:not(.finish) .guidance {
  background-color: rgba(24, 42, 53, 0.97);
}
#navigation.gliding .next-row {
  background-color: rgba(24, 42, 53, 0.95);
}
@media (prefers-reduced-transparency: reduce) {
  /* Réduire la transparence (réglage d'accessibilité de l'iPhone) : verre remplacé par un fond plein. */
  :root {
    --glass-bg: var(--paper);
    --glass-bg-strong: var(--paper);
    --glass-filter: none;
    --glass-control: #fff;
    --glass-panel: var(--paper);
  }
  /* Verre de l'écran de tournée, flou écrit à part dans chaque règle : coupé aussi. */
  :is(.bandeau, .map-button, .destination, .glass-pill, .sim-control, .status-pill, .added-banner) {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .map-button {
    background-color: rgba(246, 250, 236, 0.9);
  }
  .destination {
    background-color: rgba(250, 252, 242, 0.93);
  }
  #scanner .scan-glass {
    background-color: rgba(24, 42, 53, 0.92);
  }
  #scanner .scan-bottom {
    background-color: #fffefa;
  }
}
/* Mode pro (09/11, cadrage avec le facteur). Dans « Vérifier ma tournée » : l'interrupteur sous le parcours, et le
   total des arrêts « sur » celui de la journée complète. */
#sheet-body .review-switch {
  margin: 0 0 12px;
  padding: 6px 4px 6px 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}
.review-switch b {
  display: block;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}
.review-switch small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
}
.review-all {
  display: inline;
  font-size: 13px;
  color: var(--muted);
}
/* En tournée, la liste des arrêts importants (retour du facteur, 09/11) : par-dessus la carte, sur le fond des
   écrans ; le prochain arrêt cerclé de l'anneau du prochain arrêt, son « Guider » en vert comme le tracé ; un arrêt
   oublié en orange « à vérifier ». */
.pro-list {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  background: #e6ebdf;
  /* L'écran de tournée laisse passer les gestes vers la carte (pointer-events: none) : la liste les prend tous. */
  pointer-events: auto;
}
.pro-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.pro-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: calc(28px * var(--text-scale));
  letter-spacing: -0.5px;
}
.pro-head .mode-label {
  font-size: var(--text-caption);
  letter-spacing: 0.5px;
}
.pro-list-left {
  color: var(--muted);
  font-size: calc(14px * var(--text-scale));
}
.pro-counts {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
/* Le mot toujours sous le chiffre (audit du 09/11) : jamais coupé, même avec le texte agrandi de l'iPhone, et les
   deux cases gardent la même hauteur. */
.pro-tile {
  flex: 1;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  font-size: calc(18px * var(--text-scale));
}
.pro-tile b {
  font-size: calc(26px * var(--text-scale));
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.pro-tile small {
  flex-basis: 100%;
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}
.pro-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 -16px;
  padding: 4px 16px 12px;
  overflow-y: auto;
  list-style: none;
}
.pro-row {
  padding: 12px 12px 12px 14px;
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.pro-row.next {
  box-shadow:
    0 0 0 3px var(--target),
    var(--shadow);
}
.pro-row.forgot {
  background: var(--warn-bg);
}
.pro-row-main {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* Colonne de largeur fixe (quatre chiffres) : les rues commencent toutes au même endroit. */
.pro-num {
  flex: none;
  width: 2.6em;
  font-size: calc(26px * var(--text-scale));
  font-weight: 800;
  letter-spacing: -0.5px;
}
.pro-what {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.pro-what b {
  display: block;
  font-size: calc(16px * var(--text-scale));
}
.pro-what small {
  display: block;
  color: var(--muted);
  font-size: calc(13px * var(--text-scale));
}
/* Tous les badges de la même taille, presse comprise, lisibles d'un coup d'œil depuis le camion (audits du 09/11). */
.pro-badges .badge {
  padding: 5px 8px;
  border-radius: 8px;
  font-size: calc(14px * var(--text-scale));
}
.pro-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.pro-check {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: transparent;
  color: var(--green);
}
.pro-check .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2.6;
}
.pro-forgot {
  margin: 8px 0 0;
  color: var(--warn-ink);
  font-weight: 700;
  font-size: calc(14px * var(--text-scale));
}
/* « Guider » discret sous la rue (audit du 09/11) : ✓ reste le geste de tous les arrêts. */
.pro-go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin: 10px 0 0 calc(2.6em * 26 / 16 + 12px);
  padding: 0 18px;
  border-radius: 22px;
  background: var(--green);
  color: #fff;
  font-weight: 700;
  font-size: calc(16px * var(--text-scale));
}
.pro-go .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.4;
}
.pro-empty {
  padding: 24px 8px;
  color: var(--muted);
  text-align: center;
}
.pro-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 8px;
}
.pro-undo:disabled {
  opacity: 0.45;
}
/* État de la position, en bas : un point vert (rappels actifs), orange (recherche) ou rouge (refusée). */
.pro-gps {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: calc(12px * var(--text-scale));
  line-height: 1.3;
}
.pro-gps-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn-ink);
}
.pro-gps[data-state='on'] .pro-gps-dot {
  background: var(--done);
}
.pro-gps[data-state='off'] .pro-gps-dot {
  background: var(--danger);
}
.pro-foot .pro-gps:not([hidden]) ~ .sim-control,
.pro-foot .sim-speed {
  margin-left: auto;
}
.pro-foot .sim-speed ~ #pro-sim {
  margin-left: 0;
}
.pro-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px 4px 8px;
}
.pro-progress-row .day-progress {
  flex: 1;
  height: 5px;
  margin: 0;
  border-radius: 3px;
  background: rgba(24, 42, 53, 0.1);
  -webkit-mask-image: none;
  mask-image: none;
  overflow: hidden;
}
.pro-progress-row .day-progress > span {
  border-radius: 3px;
  background: var(--green);
}
.pro-list .quarter-pop {
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 64px);
}
.pro-unknown {
  background: var(--badge-bg);
}
/* Fiche d'un arrêt : un objet par ligne, « Avisé » à droite (orange une fois avisé). */
.pro-object {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.pro-object span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pro-object small {
  color: var(--muted);
}
.pro-object .pro-avise {
  flex: none;
  width: auto;
  margin: 0;
  padding: 0 16px;
}
.pro-object .pro-avise.on {
  background: var(--warn-bg);
  color: var(--warn-ink);
}
.pro-object-press {
  margin: 8px 0;
  font-weight: 700;
}
/* Arrêt loupé (audit du 09/11) : une pilule orange en bas de la liste, au-dessus de « Annuler », et la même ligne dans
   la carte d'arrêt ; elles restent tant qu'il n'est pas fait, et ouvrent sa fiche. */
.pro-behind,
.pro-alert {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 6px 0 2px;
  padding: 8px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font: inherit;
  font-weight: 700;
  font-size: calc(14px * var(--text-scale));
  text-align: left;
}
.pro-alert {
  margin: 8px 0 0;
  box-shadow: var(--shadow);
}
/* Presse seule : une ligne basse. */
.pro-row.compact {
  padding-top: 6px;
  padding-bottom: 6px;
}
.pro-row.compact .pro-num {
  font-size: calc(20px * var(--text-scale));
}
.pro-row.compact .pro-what {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.pro-row.compact .pro-badges {
  margin-top: 0;
}
.pro-row.compact .pro-check {
  width: 44px;
  height: 44px;
}
/* Arrêts faits, repliés en bas. */
.pro-done-toggle {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  align-items: center;
}
.pro-row.pro-faite {
  padding-top: 6px;
  padding-bottom: 6px;
  background: rgba(255, 255, 255, 0.55);
  box-shadow: none;
  color: var(--muted);
}
.pro-row.pro-faite .pro-num {
  font-size: calc(18px * var(--text-scale));
}
.pro-foot .sim-speed.fast {
  background-color: var(--accent);
  color: var(--on-accent);
}
/* « Retour au mode Pro » sur la carte : à la place de « Simuler », en premier ; en démonstration, la rangée passe à la
   ligne plutôt que de déborder. */
.above-card:has(#pro-back:not([hidden])) {
  flex-wrap: wrap;
  row-gap: 4px;
}
.above-card #pro-back {
  order: -2;
}
/* Seul sur sa ligne : la démonstration (DÉMO, vitesse, Simuler) passe dessous. */
.above-card:has(#pro-back:not([hidden])):has(#simulate:not([hidden]))::before {
  content: '';
  order: -1;
  flex-basis: 100%;
}
