/* ============================================================
   v5/envois.css — les envois par Mondial Relay, un onglet du Matériel (16/11/2026) : la liste des colis, la fiche
   d'un colis et son suivi, « Nouvel envoi ». Dessiné d'après la maquette cliquable du même jour.
   Jetons v2 partout ; graisses et rayons sur l'échelle (echelles.test.js). Les boutons, les fiches et les cartes
   vides sont ceux de v5/parc.css (x5-btn, x5-fiche, x5-vide).
   ============================================================ */
.x5-env { display: flex; flex-direction: column; gap: 14px; min-width: 0; font-family: var(--font, 'Manrope', -apple-system, system-ui, sans-serif); color: var(--v2-text, #16171a); letter-spacing: -.01em; }
.x5-env a { color: inherit; text-decoration: none; }
.x5-env p, .x5-env h2, .x5-env ol, .x5-env ul { margin: 0; }
.x5-env small { font-size: 12px; font-weight: 400; color: var(--v2-text-3, #6b6f76); }
.x5-env em { font-style: normal; font-size: 10.5px; font-weight: 680; letter-spacing: .08em; text-transform: uppercase; color: var(--v2-text-3, #6b6f76); }
.x5-env-deux { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.x5-env-deux b { font-size: 14px; font-weight: 680; overflow-wrap: anywhere; }
.x5-env-petit { font-size: 12px; color: var(--v2-text-3, #6b6f76); }
.x5-env-erreur { font-size: 12.5px; font-weight: 620; color: var(--neg-fg, #a74137); }
.x5-env-lien { padding: 0; border: 0; background: none; font: inherit; font-weight: 640; color: inherit; text-decoration: underline; cursor: pointer; }

/* Ce qui empêche de travailler : une carte, ou une ligne. */
.x5-env-avis { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; background: var(--warn-soft, rgba(224, 138, 46, .12)); border-radius: var(--r-md, 18px); font-size: 13px; }
.x5-env-avis > b { font-size: 15px; font-weight: 680; }
.x5-env-avis ul { padding-left: 18px; font-weight: 620; }
.x5-env-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 10px 16px; background: var(--panel-solid, #fff); border: 1px solid var(--stroke, rgba(20, 20, 25, .075)); border-radius: var(--r-sm, 12px); font-size: 12.5px; color: var(--v2-text-2, #55595f); }

/* La pastille d'un colis et ses traits : où il en est, d'un coup d'œil. */
.x5-env-etat { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 680; white-space: nowrap; }
.x5-env-etat.est-neutre { background: var(--inset, rgba(0, 0, 0, .05)); color: var(--v2-text-2, #55595f); }
.x5-env-etat.est-orange { background: var(--warn-soft, rgba(224, 138, 46, .12)); color: var(--warn-fg, #8a5510); }
.x5-env-etat.est-vert { background: var(--pos, rgba(23, 128, 81, .15)); color: var(--pos-fg, #136d45); }
.x5-env-etat.est-rouge { background: var(--neg-soft, rgba(193, 75, 64, .11)); color: var(--neg-fg, #a74137); }
.x5-env-pas { display: inline-flex; gap: 4px; }
.x5-env-pas i { width: 18px; height: 4px; border-radius: 99px; background: var(--stroke, rgba(20, 20, 25, .12)); }
.x5-env-pas i.est-fait { background: var(--v2-text, #16171a); }
.x5-env-pas.est-rouge i.est-fait { background: var(--neg-fg, #a74137); }

/* La liste : un colis par ligne, ce qu'il contient, à qui, où il en est, ce qu'il coûte. */
.x5-env-panneau { background: var(--panel-solid, #fff); border: 1px solid var(--stroke, rgba(20, 20, 25, .075)); border-radius: var(--r-md, 18px); overflow: hidden; }
.x5-env-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--stroke-2, rgba(20, 20, 25, .05)); }
.x5-env-filtres { display: flex; flex-wrap: wrap; gap: 6px; }
.x5-env-puce { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 15px; border-radius: 99px; border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); background: var(--panel-solid, #fff); font: inherit; font-size: 12.5px; font-weight: 640; color: inherit; cursor: pointer; }
.x5-env-puce span { font-weight: 550; color: var(--v2-text-3, #6b6f76); font-variant-numeric: tabular-nums; }
.x5-env-puce[aria-pressed="true"] { background: #16171a; color: #f5d547; border-color: transparent; }
.x5-env-puce[aria-pressed="true"] span { color: #fff; }
.x5-env-argent { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; padding: 10px 18px; background: var(--inset, rgba(0, 0, 0, .035)); border-bottom: 1px solid var(--stroke-2, rgba(20, 20, 25, .05)); font-size: 13px; }
.x5-env-argent b { font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }
.x5-env-argent span + span { font-size: 12px; color: var(--v2-text-3, #6b6f76); }
.x5-env-tetes, .x5-env-colis { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1.25fr) 76px; gap: 16px; padding: 0 18px; }
.x5-env-tetes { padding-block: 10px; font-size: 10.5px; font-weight: 680; letter-spacing: .06em; text-transform: uppercase; color: var(--v2-text-3, #6b6f76); border-bottom: 1px solid var(--stroke-2, rgba(20, 20, 25, .05)); }
.x5-env-tetes span:last-child { text-align: right; }
.x5-env-colis { align-items: center; min-height: 76px; padding-block: 10px; border-bottom: 1px solid var(--stroke-2, rgba(20, 20, 25, .05)); }
.x5-env-colis:hover { background: var(--inset, rgba(0, 0, 0, .035)); }
.x5-env-colis:focus-visible, .x5-env-puce:focus-visible, .x5-env-choix:focus-visible, .x5-env-fil a:focus-visible { outline: 2px solid var(--accent-bright, #f5d547); outline-offset: -2px; }
.x5-env-quoi { display: flex; align-items: center; gap: 12px; min-width: 0; }
.x5-env-ou { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; min-width: 0; }
.x5-env-ou small { flex: 1 1 100%; }
.x5-env-cout { text-align: right; font-size: 13px; font-weight: 640; font-variant-numeric: tabular-nums; }
.x5-env-ph { flex: 0 0 auto; display: block; width: 60px; height: 52px; border-radius: var(--r-xs, 9px); background: #f1f0ec; overflow: hidden; }
.x5-env-ph.est-grande { width: 92px; height: 80px; border-radius: var(--r-sm, 12px); }
.x5-env-ph img { display: block; width: 100%; height: 100%; object-fit: contain; }
/* La photo d'un outil dans la liste à cocher (18/11/2026) : plus grande, sur blanc, pour reconnaître l'outil. */
.x5-env-ph.est-outil { width: 64px; height: 64px; background: #fff; border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); }
/* Le choix des habits d'un colis (18/11/2026) : un bloc par habit, sa photo, une case par taille avec − et +. */
.x5-env-habits { display: flex; flex-direction: column; gap: 12px; }
.x5-env-habit { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border-radius: var(--r-sm, 12px); border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); background: var(--panel-solid, #fff); }
.x5-env-habit-tete { display: flex; align-items: center; gap: 12px; }
.x5-env-tailles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); gap: 8px; }
.x5-env-taille small { white-space: nowrap; }
.x5-env-taille { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: var(--r-xs, 9px); border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); }
.x5-env-taille.est-prise { border-color: var(--accent-bright, #f5d547); background: var(--accent-soft, rgba(245, 213, 71, .14)); }
.x5-env-taille.est-vide { opacity: .5; }
.x5-env-rien { padding: 22px 18px; font-size: 13px; color: var(--v2-text-3, #6b6f76); }
.x5-env-note { padding: 12px 18px; border-top: 1px solid var(--stroke-2, rgba(20, 20, 25, .05)); font-size: 11.5px; color: var(--v2-text-3, #6b6f76); }
.x5-env-panneau > .x5-env-colis:last-of-type { border-bottom: 0; }

/* La fiche d'un colis. */
.x5-env-fil { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; font-weight: 640; color: var(--v2-text-3, #6b6f76); }
.x5-env-fil a { display: inline-flex; align-items: center; min-height: 32px; color: var(--v2-text-2, #55595f); }
.x5-env-fil a:hover { text-decoration: underline; }
.x5-env-fil span:last-child { color: var(--v2-text, #16171a); }
.x5-env-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.x5-env-tete h2 { font-size: 26px; font-weight: 680; letter-spacing: -.03em; line-height: 1.1; }
.x5-env-cartes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 12px; align-items: start; }
.x5-env-carte { min-width: 0; font-size: 13px; }
.x5-env-carte > b { font-size: 15px; font-weight: 680; }
.x5-env-carte.est-alerte { background: var(--warn-soft, rgba(224, 138, 46, .12)); border-color: transparent; }
.x5-env-confirme { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--inset, rgba(0, 0, 0, .035)); border-radius: var(--r-sm, 12px); }
.x5-env-faits { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 7px 14px; }
.x5-env-faits > span:nth-child(odd) { color: var(--v2-text-3, #6b6f76); }
.x5-env-faits > span:nth-child(even) { font-weight: 620; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
/* Le suivi : une ligne par étape telle que Mondial Relay la dit, celle où est le colis en jaune. */
.x5-env-suivi { list-style: none; padding: 0; display: flex; flex-direction: column; }
.x5-env-suivi li { position: relative; display: flex; flex-direction: column; gap: 1px; padding: 0 0 16px 26px; }
.x5-env-suivi li:last-child { padding-bottom: 0; }
.x5-env-suivi li b { font-size: 13px; font-weight: 640; }
.x5-env-suivi li::before { content: ""; position: absolute; left: 2px; top: 3px; width: 11px; height: 11px; border-radius: 99px; background: var(--panel-solid, #fff); border: 2px solid var(--stroke, rgba(20, 20, 25, .2)); }
.x5-env-suivi li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 2px; background: var(--stroke, rgba(20, 20, 25, .12)); }
.x5-env-suivi li:last-child::after { display: none; }
.x5-env-suivi li.est-fait::before { background: var(--v2-text, #16171a); border-color: var(--v2-text, #16171a); }
.x5-env-suivi li.est-fait::after { background: var(--v2-text, #16171a); }
.x5-env-suivi li.est-ici::before { background: var(--accent-bright, #f5d547); border-color: var(--v2-text, #16171a); }
.x5-env-suivi li.est-alerte::before { background: var(--neg-fg, #a74137); border-color: var(--neg-fg, #a74137); }

/* Nouvel envoi : une question par carte. */
.x5-env-pile { display: flex; flex-direction: column; gap: 12px; max-width: 820px; }
.x5-env-choixs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.x5-env-choix { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 9px 14px; border-radius: var(--r-sm, 12px); border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); background: var(--panel-solid, #fff); font: inherit; color: inherit; text-align: left; cursor: pointer; }
.x5-env-choix:hover { border-color: var(--accent-bright, #f5d547); }
.x5-env-choix:disabled { opacity: .45; cursor: default; }
.x5-env-choix[aria-pressed="true"] { background: #16171a; color: #f5d547; border-color: transparent; }
.x5-env-choix[aria-pressed="true"] small { color: #fff; }
.x5-env-lignes { display: flex; flex-direction: column; gap: 8px; }
.x5-env-ligne-h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.x5-env-champ { min-width: 0; max-width: 100%; height: 38px; padding: 0 10px; border-radius: var(--r-sm, 12px); border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); background: var(--panel-solid, #fff); font: inherit; font-size: 13px; color: var(--v2-text, #16171a); }
.x5-env-champ.est-court { width: 104px; font-variant-numeric: tabular-nums; }
.x5-env-champ.est-large { width: min(100%, 420px); }
.x5-env-compte { display: inline-flex; align-items: center; gap: 4px; }
.x5-env-compte .x5-btn { width: 36px; padding: 0; justify-content: center; font-size: 17px; }
.x5-env-compte b { min-width: 30px; text-align: center; font-size: 16px; font-weight: 680; font-variant-numeric: tabular-nums; }
.x5-env-bilan { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; }
.x5-env-bilan .x5-env-deux b { font-size: 16px; }

[data-app-theme="dark"] .x5-env-puce[aria-pressed="true"], [data-app-theme="dark"] .x5-env-choix[aria-pressed="true"] { background: #f5d547; color: #1b1a12; }
[data-app-theme="dark"] .x5-env-puce[aria-pressed="true"] span, [data-app-theme="dark"] .x5-env-choix[aria-pressed="true"] small { color: #1b1a12; }
[data-app-theme="dark"] .x5-env-suivi li.est-ici::before { border-color: var(--accent-bright, #f5d547); }

@media (max-width: 760px) {
  .x5-env-tetes { display: none; }
  .x5-env-colis { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "quoi quoi" "qui cout" "ou ou"; gap: 8px 14px; padding-block: 13px; }
  .x5-env-quoi { grid-area: quoi; } .x5-env-qui { grid-area: qui; } .x5-env-ou { grid-area: ou; } .x5-env-cout { grid-area: cout; }
  .x5-env-tete h2 { font-size: 22px; }
}
@media (max-width: 520px) {
  .x5-env-barre, .x5-env-argent, .x5-env-note, .x5-env-rien { padding-inline: 14px; }
  .x5-env-colis { padding-inline: 14px; }
  .x5-env-faits { grid-template-columns: minmax(0, 96px) minmax(0, 1fr); }
  .x5-env-champ.est-large { width: 100%; }
}

/* Recevoir un colis (17/11/2026) : la caméra qui lit le code de l'étiquette. */
.x5-env-camera { overflow: hidden; border-radius: var(--r-sm, 12px); background: #16171a; }
.x5-env-camera[hidden] { display: none; }
.x5-env-camera video { display: block; width: 100%; max-height: 280px; object-fit: cover; }

/* L'adresse d'un site client, dans « Nouvel envoi » (18/11/2026). */
.x5-env-site { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; padding: 12px 14px; border-radius: var(--r-sm, 12px); background: var(--inset, rgba(0, 0, 0, .035)); }
.x5-env-site .x5-env-ligne-h .x5-env-champ { flex: 1 1 180px; }
/* Un colis sur mesure : la description, puis la taille du carton sur une ligne. */
.x5-env-autre { display: grid; gap: 8px; margin-top: 10px; }
.x5-env-autre .x5-env-ligne-h .x5-env-champ.est-court { width: 78px; }
/* Le numéro d'un colis à rattacher : assez large pour ses chiffres, sans pousser les boutons à la ligne. */
.x5-env-confirme .x5-env-ligne-h .x5-env-champ { flex: 0 1 240px; }
.x5-env-site .x5-env-ligne-h .x5-env-champ.est-court { flex: 0 1 120px; }
/* L'aperçu de l'e-mail au technicien, et la confirmation de son envoi (18/11/2026). */
.x5-env-mail { display: flex; flex-direction: column; border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); border-radius: var(--r-sm, 12px); overflow: hidden; background: #fff; }
.x5-env-mail-tete { display: flex; flex-direction: column; gap: 3px; padding: 10px 14px; font-size: 12.5px; color: #16171a; background: #f4f3ef; border-bottom: 1px solid rgba(20, 20, 25, .12); overflow-wrap: anywhere; }
.x5-env-mail-tete b { display: inline-block; min-width: 44px; font-weight: 680; }
.x5-env-mail-corps { display: block; width: 100%; height: 380px; border: 0; background: #fff; }
.x5-env-ok { margin: 0; font-size: 13px; font-weight: 620; color: var(--pos-fg, #136d45); overflow-wrap: anywhere; }
/* La réception des habits, pièce par pièce (18/11/2026) : trois boutons par pièce, occasion, neuf, poubelle. */
.x5-env-recus { display: flex; flex-direction: column; gap: 12px; }
.x5-env-recu { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--r-sm, 12px); border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); }
.x5-env-piece { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.x5-env-piece > span:first-child { font-size: 13px; font-weight: 620; }
.x5-env-piece > span:first-child small { font-weight: 400; color: var(--v2-text-3, #6b6f76); }
.x5-env-dests { display: inline-flex; gap: 6px; }
.x5-env-dest { height: 36px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--stroke, rgba(20, 20, 25, .12)); background: var(--panel-solid, #fff); font-family: inherit; font-size: 13px; font-weight: 640; color: var(--v2-text, #16171a); cursor: pointer; letter-spacing: inherit; }
.x5-env-dest:hover { border-color: var(--accent-bright, #f5d547); }
.x5-env-dest[aria-pressed="true"] { background: #16171a; color: #f5d547; border-color: transparent; }
.x5-env-dest.est-poubelle[aria-pressed="true"] { background: var(--neg-fg, #a74137); color: #fff; }
[data-app-theme="dark"] .x5-env-dest[aria-pressed="true"] { background: #f5d547; color: #1b1a12; }
[data-app-theme="dark"] .x5-env-dest.est-poubelle[aria-pressed="true"] { background: #e06a5c; color: #1b1a12; }
/* ── La feuille « Recevoir un colis » du téléphone (18/11/2026) : plein écran, des cibles pour le pouce ── */
body.x5-env-feuille-ouverte { overflow: hidden; }
.x5-env-feuille .x5-env-boite { width: min(680px, 100%); height: calc(100vh - 16px - env(safe-area-inset-top)); height: calc(100dvh - 16px - env(safe-area-inset-top)); }
.x5-env-feuille .x5-env { flex: 1 1 auto; min-height: 0; }
.x5-env-feuille [data-env-bilan-reception] { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -6px 18px rgba(20, 20, 25, .08); }
@media (min-width: 768px) { .x5-env-feuille .x5-env-boite { height: auto; min-height: 60vh; } }
@media (max-width: 767px) {
  .x5-env-feuille .x5-btn { height: 46px; padding: 0 18px; font-size: 14px; }
  .x5-env-feuille .x5-env-compte .x5-btn { width: 46px; padding: 0; font-size: 20px; }
  .x5-env-feuille .x5-env-compte b { min-width: 34px; font-size: 18px; }
  .x5-env-feuille .x5-env-champ { height: 48px; font-size: 16px; }
  .x5-env-feuille .x5-env-choix { min-height: 78px; padding: 8px 12px; }
  .x5-env-feuille .x5-env-choix b { font-size: 14px; }
  .x5-env-feuille .x5-env-ph.est-outil { width: 62px; height: 62px; }
  .x5-env-feuille .x5-env-bilan { flex-direction: column; align-items: stretch; gap: 10px; }
  .x5-env-feuille .x5-env-bilan .x5-actions { display: flex; gap: 8px; }
  .x5-env-feuille .x5-env-bilan .x5-actions .x5-btn { flex: 1 1 0; }
  .x5-env-feuille .x5-env-fil a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; }
  .x5-env-feuille .x5-env-dests { display: flex; width: 100%; }
  .x5-env-feuille .x5-env-dest { flex: 1 1 0; height: 46px; padding: 0 6px; font-size: 14px; }
  .x5-env-feuille .x5-env-ligne-h .x5-env-champ { flex: 1 1 100%; }
  .x5-env-feuille [data-env-bilan-reception] .x5-env-petit { display: none; }
  .x5-env-feuille [data-env-bilan-reception] small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}
