/*
 * Interface chauffeur : mobile, une main, en extérieur.
 * Couleurs et règles du « Mini design system » de la maquette : zones tactiles de 56 à 64 px,
 * texte courant de 16 px minimum, un état n'est jamais porté par la couleur seule.
 */
/* Couleurs et polices : assets/styles/tokens.css, communes au bureau. */

body.ch-body {
    margin: 0;
    background: var(--ch-fond);
    color: var(--ch-texte);
    font-family: var(--ch-police);
    font-size: 16px;
    line-height: 1.3;
    -webkit-tap-highlight-color: transparent;
}

.ch-app {
    max-width: 480px;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.ch-app *,
.ch-app *::before,
.ch-app *::after {
    box-sizing: border-box;
}

/* L'attribut hidden (posé par les contrôleurs Stimulus) doit l'emporter sur les display des classes. */
.ch-app [hidden] {
    display: none !important;
}

.ch-note a {
    color: var(--ch-primaire-trait);
    font-weight: 600;
}

.ch-contenu {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px 24px;
}

.ch-pied {
    padding: 12px 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* --- Bandeau d'usurpation (super admin qui voit l'interface d'un chauffeur) --- */

.ch-usurpation {
    padding: 10px 16px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 12px;
    background: var(--ch-fond-inverse);
    color: var(--ch-texte-inverse);
    font-size: 15px;
}

.ch-usurpation a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    color: var(--ch-accent);
    font-weight: 700;
}

/* --- Sections --- */

.ch-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* --- Titres et textes --- */

.ch-titre {
    margin: 0;
    font-family: var(--ch-police-chiffres);
    font-size: 34px;
    font-weight: 700;
    line-height: 1.05;
}

.ch-surtitre {
    font-size: 16px;
    font-weight: 600;
    color: var(--ch-texte-doux);
}

.ch-section-titre {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-texte-doux);
}

.ch-note {
    margin: 0;
    font-size: 16px;
    line-height: 1.3;
    color: var(--ch-texte-doux);
}

.ch-heure {
    font-family: var(--ch-police-chiffres);
    font-weight: 700;
    line-height: 1;
}

/* --- En-têtes --- */

.ch-entete {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ch-entete__ligne {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px 12px;
}

.ch-entete-page {
    padding: 14px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-retour {
    align-self: flex-start;
    min-height: 48px;
    margin-left: -8px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ch-primaire-trait);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.ch-jour-bouton {
    min-height: 48px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon-petit);
    color: var(--ch-primaire-trait);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

/* Paramètres et compte, en haut à droite de l'écran. */
.ch-entete__outils {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Bouton carré à icône seule (accès aux paramètres et au compte). */
.ch-bouton-icone {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon-petit);
    color: var(--ch-primaire-trait);
}

.ch-bouton-icone:focus-visible {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

.ch-progression-label {
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-primaire-trait);
    white-space: nowrap;
}

/* Barre de progression : une case par mission. */
.ch-segments {
    display: flex;
    gap: 4px;
}

.ch-segment {
    flex-grow: 1;
    height: 10px;
    border-radius: 5px;
    background: var(--ch-bord);
}

.ch-segment--terminee_complete { background: var(--ch-primaire); }
.ch-segment--terminee_incomplete { background: var(--ch-orange); }
.ch-segment--prochaine { background: var(--ch-accent); }

/* --- Boutons (56 à 64 px) --- */

.ch-bouton {
    min-height: 56px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2px solid transparent;
    border-radius: var(--ch-rayon);
    font-family: var(--ch-police);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.ch-bouton--principal {
    min-height: 64px;
    font-size: 20px;
    background: var(--ch-primaire);
    color: var(--ch-texte-inverse);
}

.ch-bouton--valider {
    min-height: 64px;
    font-size: 20px;
    background: var(--ch-accent);
    color: var(--ch-texte-sur-accent);
}

.ch-bouton--secondaire {
    background: var(--ch-surface);
    border-color: var(--ch-primaire-trait);
    color: var(--ch-primaire-trait);
}

.ch-bouton--contour-clair {
    background: transparent;
    border-color: var(--ch-texte-inverse);
    color: var(--ch-texte-inverse);
}

.ch-bouton--signaler {
    background: var(--ch-surface);
    border-color: var(--ch-rouge);
    color: var(--ch-rouge);
}

.ch-bouton:focus-visible,
.ch-ligne:focus-visible,
.ch-jour-bouton:focus-visible,
.ch-retour:focus-visible,
.ch-carte-jour:focus-visible,
.ch-semaine__jour:focus-visible {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

/* --- Pastilles (toujours avec un texte) --- */

.ch-pastilles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ch-pastille {
    display: inline-flex;
    align-items: center;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
}

.ch-pastille--poste { background: var(--ch-primaire-clair); color: var(--ch-primaire-trait); }
.ch-pastille--neptune { border-color: var(--ch-primaire-trait); color: var(--ch-primaire-trait); }
.ch-pastille--neptune-inverse { border-color: var(--ch-texte-inverse); color: var(--ch-texte-inverse); }
.ch-pastille--signal { background: var(--ch-accent); color: var(--ch-texte-sur-accent); letter-spacing: 0.6px; font-size: 14px; }
.ch-pastille--a-completer { background: var(--ch-orange-clair); border-color: var(--ch-orange); color: var(--ch-orange-texte); }
.ch-pastille--terminee { background: var(--ch-surface-neutre); color: var(--ch-vert); }

/* --- Carte « prochaine mission » --- */

.ch-carte-prochaine {
    position: relative;
    background: var(--ch-primaire);
    color: var(--ch-texte-inverse);
    border-radius: 22px;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Lieu ou bateau en tête, suivi d'un chevron : la carte entière s'ouvre. */
.ch-carte-prochaine__lieu {
    margin: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.ch-carte-prochaine__lien {
    color: inherit;
    text-decoration: none;
}

.ch-carte-prochaine__lien::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.ch-carte-prochaine__lien:focus-visible { outline: none; }

.ch-carte-prochaine:has(.ch-carte-prochaine__lien:focus-visible) {
    outline: 3px solid var(--ch-focus);
    outline-offset: 3px;
}

.ch-carte-prochaine__chevron { flex-shrink: 0; margin-top: 2px; }

/* Horaire en petit sous le lieu, la pastille au même niveau ; elle passe dessous si la place manque. */
.ch-carte-prochaine__haut {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
}

.ch-carte-prochaine__heure {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.ch-carte-prochaine__heure .ch-heure { font-size: 26px; }
.ch-carte-prochaine__contrainte { font-size: 17px; font-weight: 700; }

.ch-carte-prochaine__resume {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

/* « Appeler l'agent » reste cliquable au-dessus du lien de la carte. */
.ch-carte-prochaine a[href^="tel:"] {
    position: relative;
    z-index: 1;
    margin-top: 4px;
}

/* --- Lignes de mission (listes) --- */

.ch-liste {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-ligne {
    min-height: 64px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon-petit);
    color: var(--ch-texte);
    text-decoration: none;
}

.ch-ligne__heure {
    width: 64px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ch-ligne__heure .ch-heure {
    font-size: 22px;
    color: var(--ch-primaire-trait);
}

.ch-ligne__contrainte {
    font-size: 14px;
    font-weight: 600;
    color: var(--ch-texte-doux);
}

.ch-ligne__texte {
    flex-grow: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ch-ligne__titre {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.ch-ligne__detail {
    font-size: 16px;
    color: var(--ch-texte-doux);
}

.ch-ligne__texte .ch-pastille {
    align-self: flex-start;
    margin-top: 2px;
}

.ch-ligne__chevron {
    flex-shrink: 0;
    color: var(--ch-primaire-trait);
}

.ch-ligne--faites {
    background: var(--ch-surface-neutre);
    border-color: var(--ch-separateur);
}

.ch-ligne--faites .ch-ligne__titre {
    font-size: 16px;
    font-weight: 600;
    color: var(--ch-texte-doux);
}

/* --- Encadrés --- */

.ch-encadre {
    padding: 14px 16px;
    border-radius: var(--ch-rayon);
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 17px;
}

.ch-encadre--info { background: var(--ch-surface); border: 1.5px solid var(--ch-bord); }
.ch-encadre--attention { background: var(--ch-orange-clair); border: 1.5px solid var(--ch-orange); }
.ch-encadre--succes { background: var(--ch-surface-neutre); }

.ch-encadre__titre {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
}

/* --- Messages (après une action) ---
   Bandeau flottant : la page garde son défilement après un bouton (« Fait »…), le message doit
   donc se voir où que l'on soit, sans décaler le contenu. */

.ch-messages {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 50%;
    z-index: 50;
    width: min(100% - 24px, 560px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.ch-messages .ch-message {
    width: 100%;
    text-align: left;
    font-family: inherit;
    line-height: 1.3;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 6px 20px var(--ch-ombre);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.ch-messages .ch-message--success,
.ch-messages .ch-message--error { border: 0; }

.ch-messages .ch-message--sortie {
    opacity: 0;
    transform: translateY(-12px);
}

@media (prefers-reduced-motion: reduce) {
    .ch-messages .ch-message { transition: none; }
}

/* Élément retrouvé après une saisie : un peu d'air au-dessus. */
.ch-etape,
.ch-carte {
    scroll-margin-top: 16px;
}

.ch-message {
    min-height: 52px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: var(--ch-rayon-petit);
    font-size: 17px;
    font-weight: 700;
}

.ch-message--success { background: var(--ch-vert-plein); color: var(--ch-texte-inverse); }
.ch-message--warning { background: var(--ch-orange-clair); border: 1.5px solid var(--ch-orange); color: var(--ch-texte); }
.ch-message--error { background: var(--ch-rouge-plein); color: var(--ch-texte-inverse); }

/* --- Choix du jour --- */

.ch-semaine {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 6px;
}

.ch-semaine__jour {
    min-height: 72px;
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: 12px;
    color: var(--ch-texte);
    text-decoration: none;
}

.ch-semaine__jour--selectionne {
    background: var(--ch-primaire);
    border-color: var(--ch-primaire);
    color: var(--ch-texte-inverse);
}

.ch-semaine__jour--inactif {
    opacity: 0.55;
}

.ch-semaine__lettre { font-size: 14px; font-weight: 600; }
.ch-semaine__numero { font-family: var(--ch-police-chiffres); font-size: 24px; font-weight: 700; line-height: 1; }

.ch-point {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid var(--ch-texte-doux);
}

.ch-point--plein { background: var(--ch-primaire); border-color: var(--ch-primaire); }
.ch-semaine__jour--selectionne .ch-point--plein { background: var(--ch-accent); border-color: var(--ch-accent); }

.ch-legende {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    font-size: 15px;
    color: var(--ch-texte-doux);
}

.ch-legende span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ch-carte-jour {
    min-height: 76px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
    color: var(--ch-texte);
    text-decoration: none;
}

.ch-carte-jour--aujourdhui {
    background: var(--ch-primaire);
    border-color: var(--ch-primaire);
    color: var(--ch-texte-inverse);
}

.ch-carte-jour--vide {
    background: transparent;
    border-style: dashed;
    color: var(--ch-texte-doux);
}

.ch-carte-jour__texte {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ch-carte-jour__etiquette { font-size: 14px; font-weight: 700; letter-spacing: 0.6px; }
.ch-carte-jour__date { font-size: 22px; font-weight: 700; }
.ch-carte-jour__detail { font-size: 16px; }

/* --- Détail de mission --- */

.ch-mission-entete__ligne {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.ch-mission-entete__ligne .ch-heure {
    font-size: 40px;
    color: var(--ch-primaire-trait);
}

.ch-mission-entete__lieu {
    margin: 0;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

/* --- Étapes de la mission : une par action, ouverte par un bandeau contrasté --- */

.ch-etape {
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-margin-top: 12px;
}

.ch-etape + .ch-etape {
    margin-top: 12px;
}

.ch-etape__bandeau {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 10px 10px 10px 10px;
    border-radius: var(--ch-rayon-petit);
    background: var(--ch-accent);
    color: var(--ch-texte-sur-accent);
}

.ch-etape__numero {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--ch-primaire);
    color: var(--ch-texte-inverse);
    font-family: var(--ch-police-chiffres);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
}

.ch-etape__textes {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.ch-etape__verbe {
    margin: 0;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.05;
    overflow-wrap: anywhere;
}

.ch-etape__detail {
    font-size: 16px;
    font-weight: 700;
}

/* Bouton du pied de l'étape : « Fait » en vert plein, « Annuler « Fait » » en retrait, une fois l'étape faite. */
.ch-etape__bouton {
    width: 100%;
    min-height: 56px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: var(--ch-rayon);
    background: var(--ch-vert-plein);
    color: var(--ch-texte-inverse);
    font: inherit;
    font-size: 20px;
    font-weight: 800;
    cursor: pointer;
}

/* Grisé tant qu'un champ de l'étape manque ; la liste dessous dit lequel. */
.ch-etape__bouton:disabled {
    background: var(--ch-surface-neutre);
    color: var(--ch-texte-doux);
    cursor: not-allowed;
}

.ch-etape__manquants {
    margin: 6px 0 0;
    color: var(--ch-orange-texte);
    font-size: 15px;
    font-weight: 700;
}

.ch-etape__annuler {
    border: 1.5px solid var(--ch-bord);
    background: var(--ch-surface);
    color: var(--ch-texte);
    font-size: 16px;
    font-weight: 700;
}

.ch-etape__bouton:focus-visible {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

/* Un filet relie les bennes à leur action. */
.ch-etape__contenu {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: 18px;
    padding-left: 10px;
    border-left: 4px solid var(--ch-accent);
}

/* Commencée avant le bouton « Fait » (début sans fin) : même ambre, cerné. */
.ch-etape--en-cours .ch-etape__bandeau {
    box-shadow: inset 0 0 0 3px var(--ch-primaire);
}

.ch-etape--terminee .ch-etape__bandeau,
.ch-etape--annulee .ch-etape__bandeau {
    background: var(--ch-surface-neutre);
    color: var(--ch-texte);
}

.ch-etape--terminee .ch-etape__numero {
    background: var(--ch-vert-plein);
}

.ch-etape--terminee .ch-etape__detail,
.ch-etape--annulee .ch-etape__detail,
.ch-etape--annulee .ch-etape__verbe {
    color: var(--ch-texte-doux);
}

.ch-etape--annulee .ch-etape__numero {
    background: var(--ch-surface);
    color: var(--ch-texte-doux);
}

.ch-etape--terminee .ch-etape__contenu,
.ch-etape--annulee .ch-etape__contenu {
    border-left-color: var(--ch-surface-neutre);
}

.ch-etape--a-completer .ch-etape__bandeau {
    background: var(--ch-orange-clair);
    color: var(--ch-texte);
    box-shadow: inset 0 0 0 2px var(--ch-orange);
}

.ch-etape--a-completer .ch-etape__numero {
    background: var(--ch-surface);
    color: var(--ch-orange-texte);
}

.ch-etape--a-completer .ch-etape__detail {
    color: var(--ch-orange-texte);
}

.ch-etape--a-completer .ch-etape__contenu {
    border-left-color: var(--ch-orange);
}

/* Bouton « Ajouter à cette étape » : en pointillés, il complète le bloc sans concurrencer le bandeau. */
.ch-etape__ajouter {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 2.5px dashed var(--ch-accent);
    border-radius: var(--ch-rayon);
    background: var(--ch-accent-clair);
    color: var(--ch-texte);
    font-size: 18px;
    font-weight: 800;
    text-decoration: none;
}

.ch-etape--terminee .ch-etape__ajouter,
.ch-etape--a-completer .ch-etape__ajouter {
    border-color: var(--ch-bord);
    background: var(--ch-surface);
}

/* « Ajouter à cette étape », puis « Fait » et, à sa droite, l'icône pour signaler un problème de l'étape. */
.ch-etape__pied {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-etape__validation {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 8px;
}

.ch-etape__validation .ch-etape__action { flex: 1; }

.ch-etape__signaler {
    width: 56px;
    min-height: 56px;
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
}

.ch-etape__ajouter:focus-visible {
    outline: 3px solid var(--ch-texte);
    outline-offset: 2px;
}

/* --- Page « Ajouter à cette étape » --- */

.ch-lot {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
}

.ch-lot__haut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ch-lot__titre {
    font-size: 18px;
    font-weight: 800;
}

.ch-lot__retirer {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: var(--ch-surface-neutre);
    color: var(--ch-texte-doux);
    cursor: pointer;
}

/* Sans JavaScript, un lot ne se retire pas : on le laisse à 0. Le premier lot reste toujours. */
.ch-lot__retirer { display: none; }
.ch-ajout--js .ch-lot + .ch-lot .ch-lot__retirer { display: grid; }

.ch-lot__champ {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-lot__nombre {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ch-select {
    width: 100%;
    min-height: 52px;
    padding: 0 12px;
    background: var(--ch-surface);
    color: var(--ch-texte);
    border: 2px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon-petit);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
}

/* Compteur compact − / + : un nombre se règle au pouce, sans clavier. */
.ch-pas {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ch-pas__bouton {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 12px;
    background: var(--ch-primaire-clair);
    color: var(--ch-primaire-trait);
    font: inherit;
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.ch-pas__bouton:disabled {
    background: var(--ch-surface-neutre);
    color: var(--ch-texte-doux);
    cursor: default;
}

.ch-pas__champ {
    width: 56px;
    min-height: 48px;
    padding: 0;
    text-align: center;
    background: var(--ch-surface);
    color: var(--ch-texte);
    border: 2px solid var(--ch-bord);
    border-radius: 12px;
    font-family: var(--ch-police-chiffres);
    font-size: 26px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
}

.ch-pas__champ::-webkit-outer-spin-button,
.ch-pas__champ::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ch-pas__bouton:focus-visible,
.ch-lot__retirer:focus-visible,
.ch-ajout__autre:focus-visible,
.ch-select:focus-visible,
.ch-pas__champ:focus-visible {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

.ch-ajout__autre {
    min-height: 52px;
    border: 2px dashed var(--ch-bord);
    border-radius: var(--ch-rayon-petit);
    background: transparent;
    color: var(--ch-primaire-trait);
    font: inherit;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
}

/* Le prototype de lot n'existe qu'avec JavaScript. */
.ch-ajout__autre { display: none; }
.ch-ajout--js .ch-ajout__autre { display: block; }

/* Toujours à portée de pouce en bas de l'écran. */
.ch-ajout__valider {
    position: sticky;
    bottom: 0;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--ch-fond);
}

.ch-ajout__valider .ch-bouton {
    width: 100%;
}

.ch-ajout__valider .ch-bouton:disabled {
    background: var(--ch-surface-neutre);
    color: var(--ch-texte-doux);
    cursor: default;
}

.ch-carte {
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ch-carte__titre {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    border-bottom: 1px solid var(--ch-separateur);
}

.ch-carte__rangee {
    min-height: 52px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--ch-separateur);
}

.ch-carte__rangee:last-child { border-bottom: none; }

.ch-carte__libelle {
    font-size: 16px;
    color: var(--ch-texte-doux);
}

.ch-carte__valeur {
    font-size: 19px;
    font-weight: 700;
    text-align: right;
}

.ch-carte__valeur--manquant { color: var(--ch-texte-doux); font-weight: 600; }
.ch-carte__valeur--fait { color: var(--ch-vert); }

.ch-consigne {
    padding: 12px 16px;
    background: var(--ch-orange-clair);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    white-space: pre-line;
}

.ch-appel {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-primaire-clair);
    border-radius: var(--ch-rayon-petit);
    color: var(--ch-primaire-trait);
}

.ch-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* --- Boutons compacts (dans une rangée de carte) et désactivés --- */

.ch-bouton--rangee {
    min-height: 44px;
    padding: 0 14px;
    flex-shrink: 0;
    background: var(--ch-primaire-clair);
    color: var(--ch-primaire-trait);
    font-size: 16px;
    border-radius: 12px;
}

.ch-bouton--rangee-alerte {
    background: var(--ch-rouge-clair);
    color: var(--ch-rouge);
}

.ch-bouton--icone {
    width: 44px;
    min-height: 44px;
    padding: 0;
    background: transparent;
    color: var(--ch-rouge);
}

/* Signaler : icône d'alerte en orange, sans fond, pour rester discrète. */
.ch-bouton--icone-signal {
    color: var(--ch-orange-texte);
}

.ch-bouton:disabled,
.ch-bouton[aria-disabled="true"] {
    background: var(--ch-bord);
    border-color: var(--ch-bord);
    color: var(--ch-texte-doux);
    cursor: not-allowed;
}

.ch-formulaire-bouton {
    display: contents;
}

.ch-carte__valeur-groupe {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: right;
}

.ch-carte__rangee--compacte {
    padding-right: 8px;
}

/* Bas d'une carte de benne : l'icône pour signaler, à droite, sous les saisies. */
.ch-carte__pied {
    display: flex;
    justify-content: flex-end;
    padding: 0 8px 4px;
}

.ch-carte__titre-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* --- Tuiles de choix (boutons radio) --- */

.ch-formulaire {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ch-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-tuiles {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.ch-tuiles--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ch-tuiles--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.ch-tuile {
    position: relative;
    display: flex;
}

.ch-tuile__input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.ch-tuile__texte {
    flex-grow: 1;
    min-height: 60px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: var(--ch-surface);
    border: 2px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    text-align: center;
    cursor: pointer;
}

.ch-tuile__detail {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.85;
}

.ch-tuile__input:checked + .ch-tuile__texte {
    background: var(--ch-primaire);
    border-color: var(--ch-primaire);
    color: var(--ch-texte-inverse);
}

.ch-tuile__input:disabled + .ch-tuile__texte {
    border-style: dashed;
    color: var(--ch-texte-doux);
    opacity: 0.45;
    cursor: not-allowed;
}

.ch-tuile__input:focus-visible + .ch-tuile__texte {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

.ch-tuile[hidden] {
    display: none;
}

a.ch-tuile {
    color: var(--ch-texte);
    text-decoration: none;
}

a.ch-tuile:focus-visible .ch-tuile__texte {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

.ch-champ-titre {
    margin: 0;
    padding: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--ch-texte-doux);
}

.ch-erreur {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-rouge);
}

/* --- Pavé numérique (pesée) --- */

.ch-affichage {
    min-height: 96px;
    padding: 12px 20px 0;
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 10px;
    background: var(--ch-surface);
    border: 2.5px solid var(--ch-primaire-trait);
    border-radius: 18px;
    font-family: var(--ch-police-chiffres);
    font-weight: 700;
}

.ch-affichage__valeur {
    font-size: 66px;
    line-height: 1;
}

.ch-affichage__valeur--vide {
    color: var(--ch-texte-desactive);
}

.ch-affichage__unite {
    font-size: 30px;
    color: var(--ch-texte-doux);
}

.ch-champ-nombre {
    width: 100%;
    min-height: 64px;
    padding: 0 16px;
    border: 2.5px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    font-family: var(--ch-police-chiffres);
    font-size: 40px;
    font-weight: 700;
    text-align: right;
}

.ch-pave {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.ch-touche {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
    color: var(--ch-texte);
    font-family: var(--ch-police-chiffres);
    font-size: 38px;
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}

.ch-touche:active {
    background: var(--ch-primaire-clair);
}

/* --- Compteur (colis) --- */

.ch-compteur {
    padding: 28px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: 22px;
}

.ch-compteur__bouton {
    width: 88px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2.5px solid var(--ch-primaire-trait);
    background: var(--ch-surface);
    color: var(--ch-primaire-trait);
    cursor: pointer;
    touch-action: manipulation;
}

.ch-compteur__bouton--plus {
    background: var(--ch-primaire);
    color: var(--ch-texte-inverse);
}

.ch-compteur__valeur {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.ch-compteur__nombre {
    font-family: var(--ch-police-chiffres);
    font-size: 110px;
    font-weight: 700;
    line-height: 0.95;
}

.ch-compteur__unite {
    font-size: 18px;
    font-weight: 600;
    color: var(--ch-texte-doux);
}

/* --- Tare estimée --- */

.ch-tare {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: var(--ch-primaire-clair);
    border-radius: var(--ch-rayon);
}

.ch-tare__valeur {
    font-family: var(--ch-police-chiffres);
    font-size: 30px;
    font-weight: 700;
    color: var(--ch-primaire-trait);
}

/* --- Historique --- */

.ch-historique {
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
}

.ch-historique__entree {
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    border-bottom: 1px solid var(--ch-separateur);
}

.ch-historique__entree:last-child {
    border-bottom: none;
}

.ch-historique__heure {
    font-family: var(--ch-police-chiffres);
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-primaire-trait);
}

.ch-historique__texte {
    grid-column: 1 / -1;
    font-size: 16px;
}

.ch-pastille--vous { background: var(--ch-primaire-clair); color: var(--ch-primaire-trait); font-size: 13px; padding: 1px 10px; justify-self: start; }
.ch-pastille--bureau { background: var(--ch-accent); color: var(--ch-texte-sur-accent); font-size: 13px; padding: 1px 10px; justify-self: start; }

.ch-pastille--ajoutee { background: var(--ch-primaire-clair); color: var(--ch-primaire-trait); font-size: 13px; }
.ch-pastille--annulee { background: var(--ch-rouge-clair); border-color: var(--ch-rouge); color: var(--ch-rouge); font-size: 13px; }

/* Benne annulée : visible pour mémoire, mise en retrait. */
.ch-carte--annulee {
    background: var(--ch-surface-neutre);
    border-style: dashed;
}

.ch-carte--annulee .ch-carte__titre > span:first-child {
    color: var(--ch-texte-doux);
    text-decoration: line-through;
}

/* --- Signalement : photo et remarque --- */

.ch-tuile__texte--haute {
    min-height: 84px;
}

.ch-photo {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.ch-photo__bouton {
    flex-grow: 1;
    min-height: 88px;
}

.ch-photo__bouton:focus-within {
    outline: 3px solid var(--ch-focus);
    outline-offset: 2px;
}

.ch-photo__apercu {
    width: 88px;
    height: 88px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 2px dashed var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    color: var(--ch-primaire-trait);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    overflow: hidden;
}

.ch-photo__apercu--pleine {
    border-style: solid;
}

.ch-photo__apercu img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ch-zone-texte {
    width: 100%;
    min-height: 100px;
    padding: 12px 14px;
    background: var(--ch-surface);
    border: 1.5px solid var(--ch-bord);
    border-radius: var(--ch-rayon);
    font-family: var(--ch-police);
    font-size: 19px;
    color: var(--ch-texte);
    resize: vertical;
}

/* --- Échange --- */

.ch-tuiles--1 { grid-template-columns: minmax(0, 1fr); }

.ch-ligne--statique {
    background: var(--ch-surface);
}

.ch-collegue__initiale {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--ch-primaire-clair);
    color: var(--ch-primaire-trait);
    font-size: 20px;
    font-weight: 700;
}

.ch-bandeau-echange {
    min-height: 64px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--ch-primaire-clair);
    border: 2px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    color: var(--ch-primaire-trait);
    text-decoration: none;
}

/* --- Alerte « Planning modifié » --- */

.ch-alerte {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--ch-accent);
    border-radius: 22px;
    color: var(--ch-texte-sur-accent);
}

.ch-alerte__titre {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ch-police-chiffres);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.05;
}

.ch-alerte__auteur {
    font-size: 17px;
    font-weight: 600;
}

.ch-alerte__mission {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--ch-surface);
    border-radius: var(--ch-rayon);
}

.ch-alerte__lieu {
    font-size: 22px;
    font-weight: 700;
}

.ch-alerte__changements {
    margin: 6px 0 0;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ch-primaire-trait);
}

.ch-rangee-boutons {
    display: flex;
    gap: 10px;
}

.ch-rangee-boutons > * {
    flex: 1 1 0;
}

/* --- Connexion --- */

.ch-connexion__entete {
    padding-top: 32px;
}

.ch-connexion__marque {
    font-family: var(--ch-police-chiffres);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--ch-primaire-trait);
    text-transform: uppercase;
}

.ch-connexion__bascule {
    margin-top: 8px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--ch-surface-neutre);
    border-radius: var(--ch-rayon);
}

.ch-connexion__question {
    font-size: 17px;
    font-weight: 700;
    color: var(--ch-texte-doux);
    text-align: center;
}

.ch-champ-texte {
    width: 100%;
    min-height: 60px;
    padding: 0 16px;
    background: var(--ch-surface);
    border: 2px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    font-family: var(--ch-police);
    font-size: 22px;
    color: var(--ch-texte);
}

.ch-case {
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
}

.ch-case input {
    width: 24px;
    height: 24px;
}

.ch-pin {
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.ch-pin[hidden] {
    display: none;
}

.ch-pin__points {
    display: flex;
    align-items: center;
    gap: 18px;
}

.ch-pin__point {
    width: 22px;
    height: 22px;
    border: 2.5px solid var(--ch-primaire-trait);
    border-radius: 50%;
}

.ch-pin__point--plein {
    background: var(--ch-primaire);
}

/* Chiffre affiché à la place du point (bouton œil) : même emprise pour ne pas décaler la ligne. */
.ch-pin__point--chiffre {
    display: flex;
    align-items: center;
    justify-content: center;
    border-color: transparent;
    font-family: var(--ch-police-chiffres);
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--ch-texte);
}

/* Bouton œil : affiche ou masque le code PIN ou le mot de passe tapé. */
.ch-pin__oeil,
.ch-mot-de-passe__oeil {
    min-width: 48px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: 0;
    border-radius: var(--ch-rayon);
    color: var(--ch-primaire-trait);
    cursor: pointer;
}

.ch-pin__oeil[hidden],
.ch-mot-de-passe__oeil[hidden],
.ch-pin__oeil .ch-icone[hidden],
.ch-mot-de-passe__oeil .ch-icone[hidden] {
    display: none;
}

.ch-mot-de-passe {
    position: relative;
}

.ch-mot-de-passe .ch-champ-texte {
    padding-right: 64px;
}

.ch-mot-de-passe__oeil {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
}

/* Erreurs des formulaires Symfony (form_errors) dans l'interface. */
.ch-app .ch-formulaire ul:not([class]) {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--ch-rouge);
}

/* --- Volumes Neptune / VIGISIP déclarés par le bateau (en m³, deux par ligne) --- */

.ch-volumes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ch-volumes__champ {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ch-volumes__libelle {
    font-size: 16px;
    font-weight: 600;
    color: var(--ch-texte-doux);
}

.ch-volumes__libelle b {
    font-family: var(--ch-police-chiffres);
    font-size: 20px;
    color: var(--ch-primaire-trait);
}

.ch-volumes__saisie {
    position: relative;
}

.ch-volumes__input {
    padding-right: 48px;
    font-family: var(--ch-police-chiffres);
    font-weight: 700;
    text-align: right;
}

.ch-volumes__unite {
    position: absolute;
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--ch-texte-doux);
}

.ch-carte-neptune {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ch-carte-neptune__volumes {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 17px;
}

.ch-carte-neptune__volumes b {
    font-family: var(--ch-police-chiffres);
    color: var(--ch-primaire-trait);
}

/* Partie Neptune faite : grisée comme une étape terminée. */
.ch-carte-neptune--faite { background: var(--ch-surface-neutre); }
.ch-carte-neptune--faite .ch-section-titre .ch-icone { color: var(--ch-vert); vertical-align: -4px; }

/* Heures de début et de fin de collecte, sous les volumes. */
.ch-carte-neptune__collecte {
    margin-top: 4px;
    padding-top: 8px;
    border-top: 1.5px solid var(--ch-bord);
}

/* Volumes Neptune d'une carte de la tournée : mini-tableau, une colonne par catégorie (lettre, volume ou « – »). */
.ch-neptune-carte {
    width: 100%;
    margin-top: 4px;
    border-collapse: collapse;
    table-layout: fixed;
    border-radius: 10px;
    background: var(--ch-primaire-clair);
    color: var(--ch-texte);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    text-align: center;
}

.ch-neptune-carte th,
.ch-neptune-carte td {
    padding: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.ch-neptune-carte th {
    padding-top: 4px;
    font-family: var(--ch-police-chiffres);
    font-size: 14px;
    font-weight: 700;
    color: var(--ch-primaire-trait);
}

.ch-neptune-carte td { padding-bottom: 4px; font-weight: 700; }
.ch-neptune-carte th:last-child { width: 28px; }
.ch-neptune-carte__vide,
.ch-neptune-carte__unite { color: var(--ch-texte-doux); font-weight: 400; }

/* Collecte de bacs : une ligne par client, avec ses bacs DIB et DIS. */
.ch-collecte { padding: 14px; }
.ch-collecte .ch-etape__validation { margin-top: 10px; justify-content: flex-end; }
.ch-collecte__table {
    width: 100%;
    border-collapse: collapse;
}
.ch-collecte__table th,
.ch-collecte__table td {
    padding: 6px 4px;
    border-bottom: 1px solid var(--ch-bord);
    text-align: left;
}
.ch-collecte__table thead th:not(:first-child),
.ch-collecte__table td { width: 72px; text-align: center; }
.ch-collecte__table tbody th { font-weight: 700; overflow-wrap: anywhere; }
.ch-collecte__champ {
    width: 64px;
    min-height: 56px;
    border: 2px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    font-family: var(--ch-police-chiffres);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
}
.ch-collecte__bom {
    margin: 12px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ch-collecte__liste {
    flex: 1;
    min-width: 0;
    min-height: 56px;
    padding: 0 12px;
    border: 2px solid var(--ch-primaire-trait);
    border-radius: var(--ch-rayon);
    background: var(--ch-surface);
    color: var(--ch-texte);
    font-family: var(--ch-police);
    font-size: 18px;
    font-weight: 700;
}
.ch-collecte__terminer { width: 100%; margin-top: 10px; }
