/* 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;
  /* 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;
}
[hidden] {
  display: none !important;
}
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):not(.overview-marker):not(.overview-dot):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,
.mini-button,
.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 {
  gap: 2px;
  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;
}
.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);
}
/* Route suivie : étiquette verte ; route du prochain carrefour : panneau jaune. Jamais touchables. */
.road-pill {
  padding: 7px 14px;
  border-radius: 12px;
  background: #368a79;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(19, 102, 77, 0.3);
  pointer-events: none;
}
.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: 40px;
  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: 26px;
}
.guidance p {
  color: #dce7e3;
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  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;
}
.above-card .mini-button {
  font-size: 13px;
  padding: 10px;
  white-space: nowrap;
}
.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: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.next-chip.has-items {
  background: rgba(244, 197, 66, 0.3);
  border-color: rgba(244, 197, 66, 0.6);
}
.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);
}
.upcoming {
  background: rgba(24, 42, 53, 0.7);
  padding-bottom: 22px;
}
.upcoming-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 20px 6px;
  font-size: 13px;
  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: 24px;
  line-height: 28px;
  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: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-row .numbers {
  font-size: 13px;
  color: #e8efec;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upcoming-row small {
  display: block;
  margin: 0;
  font-size: 12px;
  color: #b9c8c2;
}
.upcoming-row .icons {
  flex: none;
  font-size: 20px;
  line-height: 22px;
  white-space: nowrap;
}
.upcoming-row.has-items {
  background: rgba(244, 197, 66, 0.16);
}
.upcoming-row.cidex > b {
  font-size: 28px;
}
/* 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: 12px;
}
.above-card > [hidden] {
  display: none;
}
#offline-state {
  margin: 0 auto;
}
.upcoming-empty {
  margin: 0;
  padding: 14px 20px;
  font-size: 14px;
  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: 20px;
  line-height: 26px;
}
.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: 17px;
  line-height: 22px;
  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: 26px;
  line-height: 30px;
  letter-spacing: -0.5px;
}
#stop-km .unit {
  font-size: 15px;
  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: 13px;
}
/* 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: 16px;
}
.bandeau .maneuver:has(use[href='#i-pin-question']) .icon {
  color: #f4a340;
}
.bandeau.compact #guidance-text {
  color: #dce7e3;
  font-size: 16px;
  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: 15px;
  line-height: 20px;
}
.added-banner small {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
#return-original {
  width: auto;
  margin-left: 4px;
}
#guidance-text.tight {
  font-size: 17px;
  line-height: 26px;
}
/* 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: 28px;
  line-height: 34px;
}
/* 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: 30px;
  }
  .guidance b {
    font-size: 23px;
  }
  .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;
  }
}

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

.mini-button {
  padding: 10px 13px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 650;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.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;
}
.skip {
  background: var(--surface-3);
  border-radius: 11px;
  padding: 10px 14px;
  font-weight: 650;
  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: 12px;
  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: 32px;
  max-width: 90px;
  flex-shrink: 0;
}
.address-row h2 {
  overflow-wrap: anywhere;
  font-size: 20px;
  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: 12px;
}
.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: 32px;
  color: var(--route);
}
.press-badge {
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 16px;
  font-weight: 700;
  padding: 6px 8px;
  border-radius: 6px;
}
.next-hint {
  font-size: 22px;
  opacity: 0.25;
  max-width: 50px;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.next-hint:empty {
  display: none;
}
.cidex-destination .press-badge {
  font-size: 12px;
  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: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #dce7e3;
}
.next-stops {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  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: 14px;
  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: 13px;
  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;
}
.destination .address-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}
.destination .address-row > strong {
  font-size: 40px;
  line-height: 44px;
  font-weight: 800;
  letter-spacing: -1.5px;
  font-variant-numeric: tabular-nums;
  max-width: none;
  flex: none;
}
.address-main {
  flex: 1;
  min-width: 0;
}
.destination .address-row h2 {
  font-size: 20px;
  line-height: 24px;
  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: 13px;
  font-weight: 600;
  color: #7a868d;
}
.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: 15px;
  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: 22px;
  line-height: 28px;
  opacity: 0.3;
  max-width: none;
}
.destination .day-progress {
  height: 5px;
  margin: 4px 0 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);
}
.destination .swipe-hint {
  padding: 0;
  font-size: var(--text-caption);
  color: #56656e;
}
.destination .destination-actions {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 96px;
  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: 16px;
}
.destination-actions .back-button {
  display: grid;
  place-items: center;
  padding: 0;
  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: 17px;
  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 .skip {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 650;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.95);
}
.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: 12px;
  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: 36px;
  line-height: 40px;
  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: 16px;
  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: 34px;
  line-height: 40px;
}
.cidex-destination #address-street {
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 26px;
  font-weight: 800;
}
.cidex-destination #stop-meta {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}
.stop-icons {
  white-space: nowrap;
}
@media (max-width: 360px) {
  .destination-actions .back-button {
    width: 44px;
  }
  .address-row > strong {
    font-size: 28px;
    max-width: 72px;
  }
  .address-row h2 {
    font-size: 18px;
  }
}
@media (min-width: 650px) and (max-height: 500px) {
  .address-row {
    margin: 4px 0;
  }
  .address-row h2 {
    font-size: 18px;
  }
  .address-row > strong {
    font-size: 27px;
  }
  /* Paysage : bandeau et carte d'arrêt à gauche, boutons ronds à droite. */
  .destination {
    gap: 6px;
    padding-bottom: 10px;
  }
  .destination .address-row > strong {
    font-size: 30px;
    line-height: 34px;
  }
  .destination .swipe-hint {
    display: none;
  }
  .card-grabber {
    margin-bottom: -30px;
  }
  .destination-actions button {
    min-height: 46px;
  }
}
@media (max-width: 359px) {
  .destination .destination-actions {
    grid-template-columns: 52px minmax(0, 1fr) 52px;
  }
  .destination-actions .skip {
    font-size: 0;
    padding: 0;
  }
  .destination-actions .skip::after {
    content: '→';
    font-size: 20px;
    font-weight: 700;
  }
}

/* ==================================================================================================================
   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);
}
/* Bouton Objets du jour (retour du 15/10) : colis dessiné au trait comme les autres boutons, 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;
}
/* Fin de tournée (maquette 11) : pas de ✕, la fiche se ferme en la glissant vers le bas. */
#sheet.hero #close-sheet {
  display: none;
}

/* ==================================================================================================================
   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;
}
.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;
}
.zone-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.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;
}
#start-demo {
  display: block;
  font-size: 13px;
  margin: 2px 0 0;
  line-height: 1.4;
}
.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;
}
/* Version de l'application : présente mais effacée, à côté de « Démo ». */
.app-version {
  font-size: var(--text-caption);
  color: var(--muted);
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* 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;
}
#setup .app-version {
  display: block;
  text-align: center;
  margin-top: 2px;
}
.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;
}
/* 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;
  }
}

/* ==================================================================================================================
   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,
#selection-alert,
#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;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 0 6px;
  margin: 0 0 8px;
  flex-shrink: 0;
}
.list-head > span:first-child {
  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);
}
/* 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: 2px;
  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 {
    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;
  }
  /* 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. */
#sheet-body .vehicle-add,
#sheet-body .return-button {
  display: flex;
  align-items: center;
  justify-content: center;
}
#sheet-body .vehicle-add {
  min-height: 48px;
  margin: 0 0 10px;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
}
.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;
  gap: 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);
}
#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;
}

/* ==================================================================================================================
   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;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 12px;
}
#sheet-body .detail-actions .done {
  grid-column: span 2;
  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;
}
/* 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 [data-filter='P'] {
  color: #1f4fa3;
}
.stop-filters [data-filter='P'][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%);
}
/* Fiche de l'arrêt : « Passer → » sur une ligne, la flèche à droite du mot comme « ✓ Distribué ». */
#sheet-body .detail-actions .secondary {
  margin: 0;
  min-height: 58px;
  border-radius: 29px;
  font-size: 17px;
  white-space: nowrap;
  padding: 0 8px;
}
/* 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: var(--border);
  background-clip: padding-box;
  border: 7px solid transparent;
  cursor: pointer;
  transition: background 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;
}
.menu-switch input:checked {
  background: var(--route);
}
.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,
.pace-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
#pace-pause {
  width: 100%;
  min-height: 44px;
  margin: 4px 0 14px;
}
.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);
}
.pace-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}
.pace-stats > div {
  min-width: 0;
}
.pace-stats b {
  display: block;
  margin: 3px 0;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.pace-history {
  border-top: 1px solid var(--border);
}
.pace-history details {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.pace-history summary {
  cursor: pointer;
  min-height: 32px;
  font-weight: 600;
}
.pace-history ul {
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.pace-top li b {
  font-variant-numeric: tabular-nums;
}
/* Rythme (maquette 15) : carte verte, progression, trois cartes, Top 3 côte à côte, historique en carte. */
#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 {
  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);
}
#sheet-body .pace-pause {
  flex: none;
  width: auto;
  margin: 0;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: 700;
}
#pace-content .pace-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}
#pace-content .pace-stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 6px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
  text-align: center;
}
#pace-content .pace-stats small {
  font-size: 12px;
  color: var(--muted);
}
#pace-content .pace-stats b {
  font-size: 20px;
  letter-spacing: -0.4px;
}
.pace-stats .fast b {
  color: var(--done);
}
.pace-stats .slow b {
  color: #a15a14;
}
.pace-tops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
/* Rythme (maquette 15) : Top 3 rapides et lentes. */
.pace-top {
  list-style: none;
  counter-reset: top;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
}
.pace-top-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted);
}
.pace-top.fast .pace-top-title {
  color: var(--done);
}
.pace-top.slow .pace-top-title {
  color: #a15a14;
}
.pace-top ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: top;
}
.pace-top li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 26px;
  padding: 0;
  font-size: 14px;
}
.pace-top li > span::before {
  font-weight: 700;
  color: var(--muted);
  counter-increment: top;
  content: counter(top) '. ';
}
#pace-content .pace-history {
  display: flex;
  flex-direction: column;
  padding: 10px 16px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.85);
}
.pace-history details > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  font-size: 16px;
}
/* Rythme : sans repère, la même carte verte, plus douce ; Top 3 et historique vides gardent leur place. */
#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-top li.empty {
  justify-content: flex-start;
  color: var(--muted);
  font-size: 13px;
}
.pace-top li.empty::before,
.pace-top li.empty > span::before {
  content: none;
}
.pace-empty {
  margin: 6px 0 4px;
  font-size: 14px;
  color: var(--muted);
}
.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;
}

/* ==================================================================================================================
   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 {
  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;
}
.overview-marker {
  width: 44px;
  height: 44px;
  background: transparent;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.overview-marker > span {
  background: var(--paper);
  border: 2px solid var(--point-color, var(--route));
  border-radius: 8px;
  min-width: 22px;
  font-size: 12px;
  padding: 2px;
}
.overview-direction {
  font-size: 18px;
  color: #226a59;
  text-shadow: 0 1px white;
  pointer-events: none;
}
.observation-panel .menu-switch:last-child {
  border-bottom: 0;
}
.overview-dot {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  padding: 0;
}
.overview-dot > span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--point-color, var(--route));
  box-shadow: 0 0 0 2px var(--paper);
}
/* 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-template-columns: repeat(3, 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[data-part='P'][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;
}

/* ==================================================================================================================
   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;
}
.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%);
}

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

/* 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 : numéro et voie passent l'un sous l'autre, actions empilées. */
.large-type .destination .address-row {
  display: flex;
  flex-wrap: wrap;
}
.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: 1fr;
}
.large-type .map-button {
  width: 64px;
  height: 64px;
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .scan-frame {
    transition: none;
  }
}
@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);
  }
  #scanner .scan-glass {
    background-color: rgba(24, 42, 53, 0.92);
  }
  #scanner .scan-bottom {
    background-color: #fffefa;
  }
}
