/* ==========================================================================
   SPLT : composants et cadre (étape L1 + L2, octobre 2026).
   Ordre : 1. base, 2. composants, 3. cadre, 4. signes des pastilles, 5. utilitaires.
   Ce fichier n'est rangé dans aucune couche : il passe toujours devant l'ancienne
   feuille (styles.css, couche « legacy »), même sur un navigateur qui ignore les couches.
   Règles d'écriture (tests/l1Css.test.js) : couleurs seulement par var(--…) ; pas de
   !important hors des utilitaires ; précision au plus 0,3,0 ; pas d'identifiant hors des
   utilitaires ; pas de « body.gregan-app ».
   Les anciennes classes restent dans le HTML : les règles ci-dessous les visent.
   Icônes : dessins Lucide (licence ISC), écrits ici en data: pour les masques.
   ========================================================================== */

/* ------------------------------------------------------------------------
   1. Base
   ------------------------------------------------------------------------ */
:root {
  --i-alert-triangle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --i-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  --i-check-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E");
  --i-clipboard-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='8' height='4' x='8' y='2' rx='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14 2 2 4-4'/%3E%3C/svg%3E");
  --i-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
  --i-help: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  --i-mail: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='20' height='16' x='2' y='4' rx='2'/%3E%3Cpath d='m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7'/%3E%3C/svg%3E");
  --i-megaphone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 18-5v12L3 14v-3z'/%3E%3Cpath d='M11.6 16.8a3 3 0 1 1-5.8-1.6'/%3E%3C/svg%3E");
  --i-minus-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M8 12h8'/%3E%3C/svg%3E");
  --i-send: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z'/%3E%3Cpath d='m21.854 2.147-10.94 10.939'/%3E%3C/svg%3E");
  --i-truck: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E");
  --i-user-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m16 11 2 2 4-4'/%3E%3Cpath d='M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='9' cy='7' r='4'/%3E%3C/svg%3E");
  --i-x-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='m15 9-6 6'/%3E%3Cpath d='m9 9 6 6'/%3E%3C/svg%3E");
  --i-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4'/%3E%3Cpath d='M12 8h.01'/%3E%3C/svg%3E");
  --i-alert-circle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 8v4'/%3E%3Cpath d='M12 16h.01'/%3E%3C/svg%3E");
  --i-chevron-down: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --i-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M16 2v4'/%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
  --i-arrow-right: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
}
/* Revue L1 + L2 (M21) : contrôles natifs (barres de défilement, listes, dates) dans le thème choisi. */
:root[data-theme="dark"] { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); scroll-padding-bottom: 96px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-16);
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 767px) {
  :root { --control-h: 48px; --content-pad: 16px; --card-pad: 16px; --page-gap: 24px; }
}
@media (max-width: 1023px) {
  :root { --topbar-h: 56px; }
}
a:not([class]) { color: var(--link); text-underline-offset: 2px; }
a:not([class]):hover { text-decoration-thickness: 2px; }
strong, b { font-weight: 600; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--action-bg); color: var(--text); }
::placeholder { color: var(--text-subtle); opacity: 1; }
code, kbd, samp, pre { font-family: var(--font-mono); }
/* Correctifs du 19 octobre (relecture de la session SPLT) : un navigateur sans <dialog> (Safari
   avant 15.4, Firefox avant 98) n'a pas la règle du navigateur qui cache une fenêtre fermée, et
   ignore aussi styles.css (importée dans une couche) : ces deux règles ne dépendent que d'ici. */
dialog:not([open]) { display: none; }
.print-only { display: none; }

.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.icon { max-width: none; }
svg.icon use { pointer-events: none; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

.skip-link {
  position: absolute; left: 8px; top: -200px; z-index: var(--z-toast);
  padding: 10px 16px; border-radius: var(--r-md);
  background: var(--surface); color: var(--primary-text); font-weight: 600; text-decoration: none;
  box-shadow: var(--shadow-3);
}
.skip-link:focus, .skip-link:focus-visible { top: 8px; }

@keyframes ui-spin { to { transform: rotate(360deg); } }
@keyframes ui-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes ui-up { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------------
   2. Composants
   ------------------------------------------------------------------------ */

/* 2.1 Boutons ----------------------------------------------------------- */
.button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-8);
  min-height: var(--control-h); padding: 0 var(--sp-16);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 600;
  text-align: center; text-decoration: none; cursor: pointer;
  box-shadow: none; transform: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.button:hover, .btn:hover { background: var(--surface-2); }
.button.primary, .btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.button.primary:hover, .btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.button.secondary, .btn-secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.button.secondary:hover, .btn-secondary:hover { background: var(--surface-2); }
.button.danger, .btn-danger { background: var(--danger-solid); border-color: var(--danger-solid); color: var(--on-danger); }
.button.danger:hover, .btn-danger:hover { background: var(--danger-solid-hover); border-color: var(--danger-solid-hover); }
.button.small, .btn-sm { min-height: 36px; padding: 0 var(--sp-12); font-size: var(--fs-14); line-height: var(--lh-14); border-radius: var(--r-md); }
.button.full, .btn-block { display: flex; width: 100%; }
.button:disabled, .button[aria-disabled="true"], .btn:disabled { opacity: .55; cursor: not-allowed; }
.button:disabled, .button[aria-disabled="true"] { pointer-events: none; }
.button[aria-busy="true"], .btn[aria-busy="true"] { pointer-events: none; }
.button[aria-busy="true"]::before, .btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; flex: none;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: ui-spin .8s linear infinite;
}
.link-button {
  display: inline; padding: 0; border: 0; background: none; color: var(--primary-text);
  font: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.link-button:hover { text-decoration-thickness: 2px; }
.password-toggle {
  min-width: 44px; min-height: 44px; width: 44px; height: 44px; right: 0;
  border-radius: var(--r-md); color: var(--text-muted); background: transparent;
}
.password-toggle:hover { background: var(--surface-2); color: var(--text); }
.password-input-wrap input { padding-right: 48px; }
.signature-clear { min-height: 44px; }

/* 2.2 Pastilles d'état ---------------------------------------------------- */
.status-chip, .badge, .pill, .status-badge, .process-status-chip, .process-turn-pill, .security-badge {
  --chip-bg: var(--tone-neutral-bg); --chip-fg: var(--tone-neutral-fg); --chip-bd: var(--tone-neutral-bd);
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 24px; padding: 2px 10px; max-width: 100%;
  border: 1px solid var(--chip-bd); border-radius: var(--r-full);
  background: var(--chip-bg); color: var(--chip-fg);
  font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; letter-spacing: 0; text-transform: none;
  white-space: nowrap; vertical-align: middle;
}
.status-chip--neutral   { --chip-bg: var(--tone-neutral-bg);   --chip-fg: var(--tone-neutral-fg);   --chip-bd: var(--tone-neutral-bd); }
.status-chip--published, .process-turn-pill, .security-badge { --chip-bg: var(--tone-published-bg); --chip-fg: var(--tone-published-fg); --chip-bd: var(--tone-published-bd); }
.status-chip--accepted  { --chip-bg: var(--tone-accepted-bg);  --chip-fg: var(--tone-accepted-fg);  --chip-bd: var(--tone-accepted-bd); }
.status-chip--transit   { --chip-bg: var(--tone-transit-bg);   --chip-fg: var(--tone-transit-fg);   --chip-bd: var(--tone-transit-bd); }
.status-chip--tosign, .security-badge--warn { --chip-bg: var(--tone-tosign-bg); --chip-fg: var(--tone-tosign-fg); --chip-bd: var(--tone-tosign-bd); }
.status-chip--delivered, .pill-ok, .security-badge--ok { --chip-bg: var(--tone-delivered-bg); --chip-fg: var(--tone-delivered-fg); --chip-bd: var(--tone-delivered-bd); }
.status-chip--cancelled, .pill-bad, .security-badge--alert { --chip-bg: var(--tone-cancelled-bg); --chip-fg: var(--tone-cancelled-fg); --chip-bd: var(--tone-cancelled-bd); }
.status-chip--alert     { --chip-bg: var(--tone-alert-bg);     --chip-fg: var(--tone-alert-fg);     --chip-bd: var(--tone-alert-bd); }
.process-turn-pill--wait, .pill-bad[data-inactive-pill] { --chip-bg: var(--tone-neutral-bg); --chip-fg: var(--tone-neutral-fg); --chip-bd: var(--tone-neutral-bd); }
.pill-bad[data-camhydra-name-missing] { --chip-bg: var(--tone-tosign-bg); --chip-fg: var(--tone-tosign-fg); --chip-bd: var(--tone-tosign-bd); }
/* Signe devant le mot : un point, ou le dessin nommé par data-icon (section 4). */
.status-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.security-badge { white-space: normal; text-align: center; }

/* 2.3 Compteurs ----------------------------------------------------------- */
.count, .exp-process-count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-full); background: var(--surface-3); color: var(--text);
  font-size: var(--fs-12); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; flex: none;
}
.exp-process-step.has-items .exp-process-count { background: var(--primary); color: var(--on-primary); }
.nav-unread-badge, .badge-dot {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-full); background: var(--badge-bg); color: var(--badge-fg);
  font-size: var(--fs-12); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums;
}
.badge-dot { position: absolute; top: 4px; right: 2px; box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.badge-dot:empty { min-width: 10px; width: 10px; height: 10px; padding: 0; top: 10px; right: 10px; }

/* 2.4 Cartes ---------------------------------------------------------------- */
.card, .section-card, .process-block, .exp-dash-list-panel, .exp-dash-detail-panel, .hero-copy, .simple-auth-card, .simple-page-card, .auth-card, .account-page, .simple-landing-card, .transport-dashboard-card, .mobile-scan-card {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1); padding: var(--card-pad);
}
.card .card, .card .section-card { box-shadow: none; }
.hero-panel, .dashboard-summary-panel, .case-block, .process-journey-card, .process-chat-panel, .transport-card, .exp-offer-card, .candidate-row, .device-row, .transport-fleet-card, .exp-dash-account {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: none;
}
.transport-card:hover, .exp-offer-card:hover { border-color: var(--border-strong); background: var(--surface); }
.transport-card.selected, .exp-offer-card.is-selected { border-color: var(--action-border); background: var(--action-bg); box-shadow: inset 3px 0 0 var(--action-border); }
.transport-card.is-unread { border-color: var(--tone-cancelled-bd); box-shadow: inset 3px 0 0 var(--danger-solid); }
.card h2, .section-card h2, .process-block-head h2 { font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; color: var(--text); }
.card h3, .section-card h3 { font-size: var(--fs-18); line-height: var(--lh-18); font-weight: 600; color: var(--text); }

/* 2.5 Pavés (dans une carte : deux niveaux de cadre au plus) ------------- */
.detail-block, .process-info-item, .process-party-card, .stack-card, .fee-column, .metric-card, .perf-stat, .tile, .stat {
  background: var(--surface-2); color: var(--text); border: 0; border-radius: var(--r-md); box-shadow: none; padding: var(--sp-16);
}
.process-party-card--dest, .process-party-card--carrier { background: var(--surface-2); }
.process-info-item strong, .process-party-label, .detail-block span, .metric-card span, .perf-stat span { color: var(--text-muted); }
.process-info-item span, .process-party-card strong { color: var(--text); }
.process-party-card span { color: var(--text-muted); }
.metric-card strong, .stat-value { font-size: var(--fs-30); line-height: var(--lh-30); font-weight: 700; font-variant-numeric: tabular-nums; }

/* 2.6 Formulaire encadré : sans cadre ----------------------------------------- */
.action-form { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }

/* 2.7 Carte d'action (« à vous », en attente, terminé) ------------------------ */
.process-turn-banner, .process-action-card, .exp-next-action, .process-wait {
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); box-shadow: none;
}
.process-turn-banner, .process-wait, .exp-next-action { padding: var(--sp-16) var(--sp-20); }
.process-turn-banner.is-my-turn, .process-action-card--accent, .exp-next-action {
  background: var(--action-bg); border-color: var(--action-border); border-left-width: 4px;
}
.process-turn-banner.is-waiting, .process-wait { background: var(--surface-2); border-color: var(--border); }
.process-turn-banner--done, .process-action-card--success {
  background: var(--success-bg); border-color: var(--tone-delivered-bd); border-left-width: 4px; border-left-color: var(--success);
}
.process-turn-banner-main strong { font-size: var(--fs-18); line-height: var(--lh-18); font-weight: 600; color: var(--text); }
.process-turn-eyebrow { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.process-turn-banner-main span[data-turn-detail], .process-action-card p, .process-wait span { color: var(--text-muted); font-size: var(--fs-16); line-height: var(--lh-16); }
.process-action-step { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--primary-text); }
.exp-next-action { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 600; }

/* 2.8 Champs --------------------------------------------------------------- */
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="image"], [type="reset"])), select, textarea {
  min-height: var(--control-h); padding: 0 var(--sp-12);
  border: 1px solid var(--border-strong); border-radius: var(--r-md);
  background: var(--surface); color: var(--text);
  font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 400;
  box-shadow: none;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
:where(input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"], [type="range"], [type="color"], [type="submit"], [type="button"], [type="image"], [type="reset"])) { height: var(--control-h); }
textarea { min-height: 96px; padding: 10px var(--sp-12); resize: vertical; }
select { cursor: pointer; }
:where(input, select, textarea):hover { border-color: var(--text-muted); }
:where(input, select, textarea):focus { border-color: var(--focus); }
:where(input, select, textarea):focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; box-shadow: none; }
:where(input, textarea)[readonly] { background: var(--surface-2); }
:where(input, select, textarea):disabled { background: var(--surface-2); color: var(--text-subtle); cursor: not-allowed; }
[aria-invalid="true"] { border-color: var(--danger); outline-color: var(--danger); }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; margin: 2px 0 0; padding: 0; flex: none; accent-color: var(--primary); cursor: pointer; }
input[type="date"], input[type="time"], input[type="datetime-local"] { color-scheme: inherit; }
input[type="file"] { color: var(--text); max-width: 100%; }

/* libellé au-dessus du champ */
:where(label, .field) > span:first-child:not(:only-child) { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; color: var(--text); letter-spacing: 0; }
.checkbox-field, .create-fret-save-carnet, .confirm-check, .mfa-remember, .create-fret-mode-option { color: var(--text); font-weight: 400; }
.checkbox-field > span, .create-fret-save-carnet > span, .confirm-check > span, .mfa-remember > span { font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 400; color: var(--text); }
.label { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; color: var(--text); }
/* aides sous les champs et textes secondaires */
.hint, .help, .field-hint, .section-note, .exp-dash-hint, .route-map-hint, .journey-hint, .simple-page-hint, .mfa-device-hint, .form-actions-note, .mfa-secret-hint {
  font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); font-weight: 400; opacity: 1;
}
.error-text { display: flex; gap: 6px; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--danger); }
.field, .form-grid { min-width: 0; }
/* Étape L4 : phrase d'erreur sous une case (reliée par aria-describedby), case avec unité
   (« kg », « € HT »), mention « (facultatif) », carte de choix (vrai bouton radio dans un label). */
.field-error { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; color: var(--danger); }
.field-error::before {
  content: ""; width: 16px; height: 16px; margin-top: 1px; flex: none; background: currentColor;
  -webkit-mask: var(--i-alert-circle) center / contain no-repeat; mask: var(--i-alert-circle) center / contain no-repeat;
}
.optional { font-weight: 400; color: var(--text-muted); }
.control-affix { display: flex; align-items: stretch; min-width: 0; }
.control-affix > .control { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.control-affix > .affix {
  display: inline-flex; align-items: center; flex: none; padding: 0 var(--sp-12);
  border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--surface-2); color: var(--text-muted); font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; white-space: nowrap;
}
.choice-card {
  position: relative; display: flex; align-items: flex-start; gap: var(--sp-12); min-width: 0; min-height: 96px; padding: var(--sp-16) var(--sp-20);
  border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); color: var(--text); cursor: pointer;
}
/* Correctif L4 (relecture visuelle, M18) : au survol, seule la bordure change (une carte désactivée
   n'a plus le même fond qu'une carte survolée) ; désactivée : estompée, icône grise. */
.choice-card:hover { border-color: var(--primary); }
.choice-card:has(input:checked) { border-color: var(--primary); background: var(--action-bg); box-shadow: inset 0 0 0 1px var(--primary); }
.choice-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.choice-card:has(input:disabled) { cursor: not-allowed; border-color: var(--border-strong); background: var(--surface-2); color: var(--text-muted); opacity: .6; }
.choice-card > input { margin-top: 2px; }
.choice-card-icon {
  width: 24px; height: 24px; flex: none; background: var(--link);
  -webkit-mask: var(--choice-icon, var(--i-info)) center / contain no-repeat; mask: var(--choice-icon, var(--i-info)) center / contain no-repeat;
}
:where(.choice-card:has(input:disabled)) .choice-card-icon { background: var(--text-muted); }
.choice-card-icon[data-icon="megaphone"] { --choice-icon: var(--i-megaphone); }
.choice-card-icon[data-icon="send"] { --choice-icon: var(--i-send); }
.choice-card-text { display: grid; gap: 4px; min-width: 0; }
.choice-card-title { font-weight: 600; }
.choice-card-sub { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); font-weight: 400; }

/* code de double authentification : grands chiffres espacés */
.auth-form input[autocomplete="one-time-code"] {
  max-width: 320px; height: 56px; text-align: center;
  font-family: var(--font-mono); font-size: var(--fs-24); line-height: var(--lh-24); font-weight: 600;
  letter-spacing: .3em; font-variant-numeric: tabular-nums;
}

/* 2.9 Listes de suggestions ------------------------------------------------- */
.country-combobox-list, .plate-combobox-list, .address-suggest-list, .listbox {
  z-index: var(--z-dropdown); padding: 4px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-3);
}
.country-combobox-option, .plate-combobox-option, .address-suggest-option, .option {
  min-height: 44px; padding: 8px 12px; border-radius: var(--r-sm);
  color: var(--text); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 400; cursor: pointer;
}
.country-combobox-option strong, .plate-combobox-option strong { font-size: var(--fs-16); font-weight: 600; }
.country-combobox-option span, .plate-combobox-option span { font-size: var(--fs-14); font-weight: 400; letter-spacing: 0; color: var(--text-muted); }
.country-combobox-option:hover, .country-combobox-option.is-active,
.plate-combobox-option:hover, .plate-combobox-option.is-active,
.address-suggest-option:hover, .address-suggest-option.is-active,
.option:hover, .option[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.country-combobox-option.is-active, .plate-combobox-option.is-active, .address-suggest-option.is-active, .option[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--primary); }

/* 2.10 Messages (bandeaux) ---------------------------------------------------- */
.feedback-box, .page-flash, .form-error-summary, .sms-status, .hint-box, .simple-hint-box, .notice {
  position: relative; padding: var(--sp-12) var(--sp-16); min-height: 0;
  border: 0; border-radius: var(--r-md); box-shadow: none;
  background: var(--surface-2); color: var(--text);
  font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 400;
}
.feedback-box { margin-top: var(--sp-12); }
.hint-box, .simple-hint-box, .notice-info, .feedback-box.feedback-info { background: var(--info-bg); color: var(--info); }
.feedback-box.feedback-error, .form-error-summary, .notice-danger, .sms-status--failed { background: var(--danger-bg); color: var(--danger); }
.feedback-box.feedback-success, .notice-success, .sms-status--sent { background: var(--success-bg); color: var(--success); }
.notice-warning, .sms-status--unknown, .sms-status--test, .sms-status--replaced { background: var(--warning-bg); color: var(--warning); }
.feedback-box.feedback-error, .feedback-box.feedback-success, .feedback-box.feedback-info, .form-error-summary, .notice-info, .notice-success, .notice-warning, .notice-danger { padding-left: 44px; font-weight: 600; }
.feedback-box.feedback-error::before, .feedback-box.feedback-success::before, .feedback-box.feedback-info::before, .form-error-summary::before,
.notice-info::before, .notice-success::before, .notice-warning::before, .notice-danger::before {
  content: ""; position: absolute; left: 16px; top: 13px; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--notice-icon, var(--i-info)) center / contain no-repeat; mask: var(--notice-icon, var(--i-info)) center / contain no-repeat;
}
.feedback-box.feedback-error, .form-error-summary, .notice-danger { --notice-icon: var(--i-alert-circle); }
.feedback-box.feedback-success, .notice-success { --notice-icon: var(--i-check-circle); }
.notice-warning { --notice-icon: var(--i-alert-triangle); }
.hint-box ul, .simple-hint-box ul { color: inherit; }
.form-error-summary .link-button { color: var(--danger); }
.sms-status strong { color: inherit; font-size: var(--fs-14); }
.sms-status span { color: var(--text); font-size: var(--fs-14); }
.sms-status--failed strong { display: inline-flex; align-items: center; gap: 6px; }
.sms-status--failed strong::before {
  content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: var(--i-alert-triangle) center / contain no-repeat; mask: var(--i-alert-triangle) center / contain no-repeat;
}
.sms-status-link { color: inherit; font-weight: 600; }
/* G123 : une zone de message vide ne prend pas de place (le texte écrit ensuite reste annoncé). */
.feedback-box:empty, .notice:empty { padding: 0; margin: 0; min-height: 0; background: none; border: 0; }
.feedback-box:empty::before, .notice:empty::before { content: none; }

/* 2.11 Fenêtres ---------------------------------------------------------------- */
dialog { color: var(--text); }
.dialog, .exp-confirm-dialog {
  width: min(480px, calc(100vw - 32px)); max-width: min(480px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: var(--r-xl);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-3);
}
.dialog[open], .exp-confirm-dialog[open] { animation: ui-in var(--dur-base) var(--ease); }
.dialog::backdrop, .exp-confirm-dialog::backdrop, .sheet::backdrop { background: var(--scrim); }
.exp-confirm-form, .dialog-box {
  display: grid; gap: var(--sp-12); margin: 0; padding: var(--sp-24);
  background: var(--surface); color: var(--text); border: 0; border-radius: var(--r-xl); box-shadow: none;
}
.dialog-title, .exp-confirm-form h2, .exp-confirm-form h3 { margin: 0; font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; color: var(--text); }
.dialog-body, .exp-confirm-form p, .confirm-recap li { color: var(--text-muted); }
.dialog-body { display: grid; gap: var(--sp-12); }
/* Correctif L4 (relecture visuelle, I1) : information sous la liste des conditions (date indicative). */
.exp-confirm-form p.confirm-note { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); font-style: italic; }
.exp-confirm-form .error-text { color: var(--danger); }
.dialog-actions, .exp-confirm-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--sp-8); margin-top: var(--sp-8); }
/* Revue L1 + L2 (M24) : le rouge est réservé au bouton (titre en couleur normale). */
@media (max-width: 767px) {
  .dialog, .exp-confirm-dialog {
    width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92vh;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
  }
  .dialog[open], .exp-confirm-dialog[open] { animation-name: ui-up; }
  .exp-confirm-form, .dialog-box { padding: var(--sp-20) var(--sp-16) calc(var(--sp-16) + env(safe-area-inset-bottom, 0px)); border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .dialog-actions, .exp-confirm-actions { flex-direction: column-reverse; align-items: stretch; }
  /* Décision d'Edouard du 25 octobre 2026 (L4.1, D-L41-2) : fenêtre rouge (data-tone="danger") sur
     téléphone : le bouton sûr (« Annuler », « Continuer la saisie », « Garder les liens »…) en haut,
     le bouton rouge dessous. Ordinateur et autres fenêtres : ordre inchangé. */
  .dialog[data-tone="danger"] .dialog-actions, .exp-confirm-dialog[data-tone="danger"] .exp-confirm-actions { flex-direction: column; }
  .dialog-actions .button, .exp-confirm-actions .button { width: 100%; }
}

/* 2.12 Panneau du bas (« Plus ») -------------------------------------------- */
.sheet {
  position: fixed; inset: auto 0 0 0; width: 100%; max-width: 100%; max-height: 88vh;
  margin: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); border: 0; border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-3); overflow: auto;
}
.sheet[open] { animation: ui-up var(--dur-base) var(--ease); }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: var(--r-full); background: var(--border-strong); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); min-height: 52px; padding: var(--sp-4) var(--sp-16) var(--sp-4) var(--sp-20); }
.sheet-title { margin: 0; font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; }
.sheet-head .button { min-width: 44px; min-height: 44px; padding: 0; border-color: transparent; }
.sheet-body { display: grid; gap: 2px; padding: 0 var(--sp-8) var(--sp-16); }
.sheet-nav, .sheet-account { display: grid; gap: 2px; }

/* 2.13 Menus déroulants ------------------------------------------------------- */
.menu-anchor { position: relative; display: inline-flex; }
.menu {
  position: absolute; top: calc(100% + 4px); right: 0; z-index: var(--z-dropdown);
  display: grid; gap: 2px; min-width: 260px; max-width: min(340px, calc(100vw - 32px)); padding: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-3);
  animation: ui-in var(--dur-fast) var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 12px;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--text);
  font: inherit; font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 400; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item:focus-visible { background: var(--surface-2); }
/* Revue L1 + L2 (M8) : sur un écran tactile, le survol reste « collé » après un appui : fond au survol seulement avec une souris. */
@media (hover: hover) {
  .menu-item:hover { background: var(--surface-2); }
}
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item > .icon { color: var(--text-muted); }
.menu-item[aria-current="page"] { font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.menu-item[aria-checked="true"] { font-weight: 600; }
.menu-item[aria-checked="true"]::after {
  content: ""; width: 18px; height: 18px; margin-left: auto; flex: none; background: var(--primary-text);
  -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat;
}
.menu-item .space-dot { margin-inline: 4px; }
.menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }
.menu-head { display: flex; align-items: center; gap: var(--sp-12); padding: 10px 12px 12px; }
.menu-head > div { display: grid; gap: 1px; min-width: 0; }
.menu-head-name { font-weight: 600; color: var(--text); }
.menu-head-company, .menu-head-email { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); overflow-wrap: anywhere; }
/* Revue L1 + L2 (M7) : adresse sur une ligne, coupée par « … » (adresse complète en infobulle). */
.menu-head-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; overflow-wrap: normal; }
.menu-label { margin: 0; padding: 8px 12px 2px; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 600; color: var(--text-muted); }
.segmented { display: flex; gap: 2px; margin: 4px 6px 6px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.segmented > button {
  flex: 1 1 auto; min-height: 36px; padding: 0 8px; border: 0; border-radius: 7px; background: transparent;
  color: var(--text-muted); font: inherit; font-size: var(--fs-14); font-weight: 600; white-space: nowrap; cursor: pointer;
}
.segmented > button:hover { color: var(--text); }
.segmented > button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* 2.14 Onglets ---------------------------------------------------------------- */
.tabs, .notification-tabs, .perf-range-toggle {
  display: flex; flex-wrap: nowrap; gap: var(--sp-4); margin: 0 0 var(--sp-16); padding: 0;
  border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: none;
  overflow-x: auto; scrollbar-width: none; min-width: 0;
}
.tabs::-webkit-scrollbar { display: none; }
.tab, .notification-tab, .perf-range-toggle .perf-range-btn {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  min-height: 44px; padding: 0 var(--sp-12); margin-bottom: -1px;
  border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none;
  color: var(--text-muted); font: inherit; font-size: var(--fs-16); font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.tab:hover, .notification-tab:hover, .perf-range-toggle .perf-range-btn:hover { color: var(--text); background: none; }
.tab[aria-selected="true"], .tab[aria-current="page"], .notification-tab.is-active, .perf-range-toggle .perf-range-btn.active {
  color: var(--text); background: none; border-color: var(--primary-text);
}
.tab:focus-visible, .notification-tab:focus-visible { outline-offset: -2px; }
.tab-panel { display: block; padding-top: var(--sp-8); min-width: 0; }

/* 2.15 Barres d'étapes ---------------------------------------------------------- */
.exp-process-step {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: var(--r-lg);
  min-height: 72px; padding: var(--sp-12) var(--sp-16); box-shadow: none; transform: none;
}
.exp-process-step:hover { border-color: var(--border-strong); background: var(--surface); }
.exp-process-step.is-active, .exp-process-step[aria-current="step"], .exp-process-step[aria-pressed="true"] {
  background: var(--action-bg); border-color: var(--action-border); box-shadow: inset 0 -3px 0 var(--action-border);
}
.exp-process-index { background: var(--surface-2); color: var(--text-muted); font-weight: 700; }
.exp-process-step.is-active .exp-process-index { background: var(--primary); color: var(--on-primary); }
.exp-process-copy strong { font-size: var(--fs-16); font-weight: 600; }
.exp-process-copy span { color: var(--text-muted); font-size: var(--fs-14); }
/* Étape L3a : la frise de la page d'un transport est la frise « stepper » (2.23). Étape L4 : l'ancienne barre des « Blocs » de la création est retirée. */
.mfa-steps { color: var(--text-muted); }

/* 2.16 Frise du trajet ------------------------------------------------------------ */
.journey-card { background: var(--surface-2); border: 0; border-radius: var(--r-md); }
.journey-panel-label, .profile-preview-label { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.journey-time, .process-journey-time { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.journey-dot, .process-journey-dot { background: var(--surface); border: 3px solid var(--primary); box-shadow: none; }
.journey-dot--end, .process-journey-dot--end { background: var(--primary); border-color: var(--primary); }
.journey-line, .process-journey-line { background: var(--border-strong); width: 2px; }
.journey-place strong, .process-journey-place strong { color: var(--text); font-weight: 600; }
.journey-place span, .process-journey-place span, .journey-card-top span, .process-journey-meta span { color: var(--text-muted); }
.journey-mode-toggle { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-md); }
.journey-mode-toggle:hover { background: var(--surface-2); border-color: var(--border-strong); }
.route-map-panel { background: var(--surface-2); border: 0; border-radius: var(--r-md); min-height: 0; align-self: start; }
.route-map-panel-head strong { color: var(--text); font-size: var(--fs-14); }
.route-map-panel-sub { color: var(--text-muted); font-size: var(--fs-14); }
.route-map-canvas { flex: none; min-height: 0; background: none; border-radius: 0; overflow: visible; }
/* Frise « départ → arrivée » dessinée par le site (remplace la carte) : ●───● */
.route-timeline { list-style: none; margin: 0; padding: var(--sp-8) 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-16); }
.route-timeline-stop { position: relative; display: grid; align-content: start; gap: 2px; min-width: 0; padding-top: 22px; overflow-wrap: anywhere; }
.route-timeline-stop--end { text-align: right; justify-items: end; }
.route-timeline-dot { position: absolute; top: 1px; left: 0; width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--primary); }
.route-timeline-stop--end .route-timeline-dot { left: auto; right: 0; background: var(--primary); }
.route-timeline-line { position: absolute; top: 7px; left: 20px; width: calc(200% + var(--sp-16) - 40px); border-top: 2px dashed var(--border-strong); }
.route-timeline-label { font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 600; color: var(--text-muted); }
.route-timeline-place { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; color: var(--text); }
.route-timeline-country { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
.is-missing > .route-timeline-place { color: var(--text-subtle); font-weight: 400; }
.is-missing > .route-timeline-dot { border-color: var(--border-strong); }

/* 2.17 Tableaux --------------------------------------------------------------------- */
.data-table, .perf-matrix, .releve-table { border-collapse: collapse; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text); background: var(--surface); }
.data-table { display: table; width: 100%; gap: 0; }
.data-table th, .perf-matrix th, .releve-table th {
  text-align: left; padding: 10px var(--sp-16); background: var(--surface-2); color: var(--text-muted);
  font-size: var(--fs-14); font-weight: 600; border: 0; border-bottom: 1px solid var(--border);
}
.data-table td, .perf-matrix td, .releve-table td { padding: var(--sp-8) var(--sp-16); border: 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table .num, .perf-matrix .num, .releve-table .num, .data-table td[data-num] { text-align: right; font-variant-numeric: tabular-nums; }
.data-table tr, .data-table .transport-table-row { display: table-row; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.transport-table-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.transport-table-head { background: var(--surface-2); color: var(--text-muted); font-size: var(--fs-14); font-weight: 600; border-color: transparent; }
.archive-row--attention { border-color: var(--warning); box-shadow: inset 3px 0 0 var(--warning); }
/* Correctifs du 19 octobre : entre 1024 et 1100 px, la colonne Statut ne rétrécissait pas et la
   liste Transports débordait de sa carte. La pastille passe à la ligne dans un tableau, les cases
   sont un peu moins larges sous 1200 px (sans couper un mot) ; la carte défile elle-même en
   dernier recours (jamais la page entière). */
.data-table td .status-chip { white-space: normal; }
@media (min-width: 768px) and (max-width: 1199px) {
  .transport-table th, .transport-table td { padding-left: var(--sp-12); padding-right: var(--sp-12); }
}
.transport-dashboard-card { overflow-x: auto; }
@media (max-width: 767px) {
  .data-table, .data-table tbody, .data-table tr, .data-table .transport-table-row, .data-table td { display: block; width: 100%; }
  .data-table { background: none; }
  .data-table thead { display: none; }
  .data-table tr, .data-table .transport-table-row { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-16); }
  .data-table tr + tr { margin-top: var(--sp-12); }
  .data-table td { display: flex; justify-content: space-between; gap: var(--sp-12); padding: 6px 0; border: 0; text-align: right; }
  .data-table td::before { content: attr(data-label); flex: none; color: var(--text-muted); text-align: left; }
  .data-table td:not([data-label])::before { content: none; }
  .data-table tbody tr:hover td { background: none; }
}

/* 2.18 En-têtes de page --------------------------------------------------------------- */
.page-header, .dashboard-hero, .exp-dash-intro, .create-fret-intro, .profile-page-intro, .hero.admin-hero {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--sp-8); align-items: start; margin: 0 0 var(--sp-24);
}
.process-topbar { align-items: flex-end; gap: var(--sp-16); flex-wrap: wrap; }
.eyebrow { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-muted); }
.page-header h1, .dashboard-hero h1, .exp-dash-intro h1, .create-fret-intro h1, .profile-page-intro h1, .hero h1, .process-topbar h1, .mobile-hero h1 {
  margin: var(--sp-4) 0 0; font-size: var(--fs-30); line-height: var(--lh-30); font-weight: 700; letter-spacing: 0; color: var(--text);
}
.page-header p, .dashboard-hero p, .exp-dash-intro p, .create-fret-intro p, .profile-page-intro p, .hero p, .process-topbar p {
  margin: 0; max-width: 70ch; color: var(--text-muted); font-size: var(--fs-16); line-height: var(--lh-16);
}
.hero-copy { padding: 0; border: 0; background: none; box-shadow: none; }
.page-header > .button, .dashboard-hero > .button, .exp-dash-intro > .button, .create-fret-intro > .button, .profile-page-intro > .button { justify-self: start; }
@media (max-width: 1023px) {
  .page-header h1, .dashboard-hero h1, .exp-dash-intro h1, .create-fret-intro h1, .profile-page-intro h1, .hero h1, .process-topbar h1, .mobile-hero h1 { font-size: var(--fs-24); line-height: var(--lh-24); }
}

/* 2.19 États vides ------------------------------------------------------------------ */
.empty-state, .exp-detail-empty, .process-chat-empty, .country-combobox-empty, .plate-combobox-empty, .address-suggest-empty, .empty {
  display: block; min-height: 0; margin: 0; padding: var(--sp-12) 0;
  border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--text-muted); font-size: var(--fs-16); line-height: var(--lh-16); text-align: left;
}
.country-combobox-empty, .plate-combobox-empty, .address-suggest-empty { padding: 10px 12px; font-size: var(--fs-14); }

/* 2.20 Discussion ------------------------------------------------------------------- */
.process-chat-panel { overflow: hidden; }
.process-chat-head { background: var(--surface-2); border-bottom: 1px solid var(--border); }
.process-chat-title strong { color: var(--text); }
.process-chat-title span { color: var(--text-muted); font-size: var(--fs-14); }
/* Correctif L4.1 (P13) : bouton « − » de la discussion discret (icône sans cadre, comme « Fermer »). */
.process-chat-toggle { width: 44px; height: 44px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-muted); display: inline-flex; align-items: center; justify-content: center; }
.process-chat-toggle:hover { background: var(--surface-2); color: var(--text); }
.process-chat-bubble { border: 0; border-radius: var(--r-lg); color: var(--text); }
.process-chat-bubble.is-theirs { background: var(--surface-2); border-top-left-radius: var(--r-sm); }
.process-chat-bubble.is-mine { background: var(--action-bg); border-top-right-radius: var(--r-sm); }
.process-chat-bubble p { font-size: var(--fs-16); line-height: var(--lh-16); }
.process-chat-meta { color: var(--text-muted); font-size: var(--fs-12); opacity: 1; }
.process-chat-composer { border-top: 1px solid var(--border); }
.process-chat-composer textarea { background: var(--surface); color: var(--text); min-height: 56px; }

/* 2.21 Signature (zone blanche dans les deux thèmes) ----------------------------- */
.signature-pad { background: var(--signature-bg); color: var(--signature-fg); border: 2px solid var(--border-strong); border-radius: var(--r-lg); }
.signature-overlay { color: var(--signature-fg); }
.signature-field.is-missing .signature-pad, .reception-result.is-missing { outline: 3px solid var(--danger); outline-offset: 2px; }
.signature-field.is-signed .signature-pad { border-color: var(--success); }

/* 2.22 Connexion et double authentification ---------------------------------------- */
.simple-auth-layout { display: grid; place-items: start center; min-height: 0; padding: var(--sp-16) 0; }
.simple-auth-card, .auth-card { width: min(100%, 440px); max-width: 440px; margin-inline: auto; border-radius: var(--r-xl); padding: var(--sp-32); display: grid; gap: var(--sp-16); }
.simple-auth-card h1, .auth-card h1 { margin: 0; font-size: var(--fs-24); line-height: var(--lh-24); font-weight: 700; color: var(--text); }
.simple-auth-card p, .auth-card p { color: var(--text-muted); }
/* Revue L1 + L2 (M12) : la phrase sous « Connexion » est retirée ; le titre garde son écart avec le formulaire. */
.simple-auth-card h1 + .auth-form { margin-top: var(--sp-16); }
.auth-form { gap: var(--sp-16); }
.auth-form label { gap: 6px; font-weight: 600; }
.mfa-qr svg, .mfa-qr img { background: var(--qr-bg); color: var(--qr-fg); padding: 8px; border-radius: var(--r-md); }
.mfa-secret code, .mfa-recovery-list code { font-family: var(--font-mono); color: var(--text); }
@media (max-width: 767px) {
  .simple-auth-card, .auth-card { padding: var(--sp-24) var(--sp-16); border-radius: var(--r-lg); }
}

/* 2.23 Étape L3a : composants de la page d'un transport ------------------------
   Carte d'action, bouton icône, menu (élément rouge), frise des étapes, historique, barre
   d'action du téléphone, fenêtre moyenne, panneau plein écran (réception). */
.icon-button {
  display: inline-grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; flex: none;
  border: 1px solid transparent; border-radius: var(--r-md); background: transparent; color: var(--text-muted); cursor: pointer;
}
.icon-button:hover { background: var(--surface-2); color: var(--text); }
.icon-button.button { border-color: var(--border-strong); background: var(--surface); color: var(--text); }
.icon-button.button:hover { background: var(--surface-2); }
.menu-item.is-danger { color: var(--danger); font-weight: 600; }
.menu-item.is-danger:focus-visible { background: var(--danger-bg); }
@media (hover: hover) {
  .menu-item.is-danger:hover { background: var(--danger-bg); }
}

/* Carte d'action : pastille, titre (un verbe), une phrase, boutons ; teinte selon data-tone. */
.action-card {
  --card-accent: var(--action-border);
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-16) var(--sp-24);
  min-width: 0; margin: 0; padding: var(--sp-20);
  border: 1px solid var(--action-line); border-left: 4px solid var(--card-accent); border-radius: var(--r-lg);
  background: var(--action-bg); color: var(--text); box-shadow: none;
}
.action-card[data-tone="waiting"] { --card-accent: var(--border-strong); background: var(--surface-2); border-color: var(--border); }
.action-card[data-tone="done"] { --card-accent: var(--success); background: var(--success-bg); border-color: var(--tone-delivered-bd); }
.action-card[data-tone="danger"] { --card-accent: var(--danger); background: var(--danger-bg); border-color: var(--tone-cancelled-bd); }
.action-card[data-tone="warning"] { --card-accent: var(--warning); background: var(--warning-bg); border-color: var(--tone-tosign-bd); }
.action-card[data-tone] { border-left-color: var(--card-accent); }
.action-card-body { flex: 1 1 360px; display: grid; gap: var(--sp-8); min-width: 0; }
.action-card-pills { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.action-card-pills:empty { display: none; }
.action-card-badge {
  display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 2px 10px;
  border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text);
  font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; max-width: 100%; overflow-wrap: anywhere;
}
.action-card[data-turn="me"] .action-card-badge { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
[data-turn="me"] .action-card-badge::before {
  content: ""; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: var(--i-arrow-right) center / contain no-repeat; mask: var(--i-arrow-right) center / contain no-repeat;
}
.action-card[data-turn="alert"] .action-card-badge { background: var(--danger-solid); border-color: var(--danger-solid); color: var(--on-danger); }
.action-card[data-turn="done"] .action-card-badge { background: var(--surface); border-color: var(--tone-delivered-bd); color: var(--success); }
/* Correctif L4.1 (P8) : carte grise « Plus disponible » : pastille grise aussi (plus le vert de « Terminé »). */
[data-turn="done"][data-tone="waiting"] .action-card-badge { border-color: var(--border-strong); color: var(--text); }
.action-card-title { margin: 0; font-size: var(--fs-18); line-height: var(--lh-18); font-weight: 600; color: var(--text); }
.action-card-text { margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); color: var(--text); max-width: 75ch; }
.action-card-vigilance { margin: 0; padding: var(--sp-8) var(--sp-12) var(--sp-8) var(--sp-24); border-radius: var(--r-md); background: var(--warning-bg); color: var(--text); font-size: var(--fs-14); line-height: var(--lh-14); }
.action-card-vigilance li + li { margin-top: 4px; }
.action-card-suggestion { display: inline-flex; align-items: center; gap: var(--sp-8); margin: 0; justify-self: start; padding: 6px var(--sp-12); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-size: var(--fs-14); line-height: var(--lh-14); }
.action-card-suggestion .icon { color: var(--text-muted); }
.action-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); }
.action-card-feedback { flex: 1 0 100%; margin-top: 0; }
@media (max-width: 767px) {
  .action-card { padding: var(--sp-16); gap: var(--sp-12); }
  .action-card-body { flex-basis: 100%; }
  .action-card-actions { width: 100%; flex-direction: column; align-items: stretch; }
  .action-card-actions .button { width: 100%; }
}

/* Frise des étapes : horizontale, compacte, date sous chaque étape faite. */
.stepper-list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.step { position: relative; display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; padding: 0 var(--sp-4); border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--text); text-align: center; }
.step + .step::before { content: ""; position: absolute; top: 13px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 2px; border-radius: 2px; background: var(--border); }
.is-done + .step::before { background: var(--success); }
.step-dot {
  position: relative; z-index: 1; display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border: 2px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text-muted);
  font-size: var(--fs-12); line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums;
}
.step.is-done .step-dot { border-color: var(--success); background: var(--success); color: var(--surface); font-size: 0; }
.is-done > .step-dot::before {
  content: ""; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: var(--i-check) center / contain no-repeat; mask: var(--i-check) center / contain no-repeat;
}
.step.is-current .step-dot { border-color: var(--primary); background: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px var(--action-bg); }
.is-done.is-current > .step-dot { border-color: var(--success); background: var(--success); color: var(--surface); font-size: 0; box-shadow: 0 0 0 4px var(--success-bg); }
.step.is-alert .step-dot { border-color: var(--danger-solid); background: var(--danger-solid); color: var(--on-danger); box-shadow: 0 0 0 4px var(--danger-bg); }
.step-label { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 400; color: var(--text-muted); overflow-wrap: anywhere; }
.is-done > .step-label, .is-current > .step-label { font-weight: 600; color: var(--text); }
.step-date { font-size: var(--fs-12); line-height: var(--lh-12); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Historique (onglet Suivi) : une ligne datée par étape. */
.timeline { display: grid; gap: var(--sp-12); margin: 0; padding: 0; list-style: none; }
.tl-item { position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 2px var(--sp-16); padding-left: var(--sp-24); }
.tl-item::before { content: ""; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: var(--r-full); background: var(--tl-dot, var(--success)); }
.tl-item:not(:last-child)::after { content: ""; position: absolute; left: 8px; top: 20px; bottom: calc(-1 * var(--sp-12) + 4px); width: 2px; background: var(--border); }
.tl-item[data-tone="current"] { --tl-dot: var(--primary); }
.tl-time { font-family: var(--font-mono); font-size: var(--fs-14); line-height: var(--lh-16); color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-text { font-size: var(--fs-16); line-height: var(--lh-16); color: var(--text); }
@media (max-width: 767px) {
  .tl-item { grid-template-columns: minmax(0, 1fr); }
}

/* Barre d'action (téléphone, page d'un transport) : le bouton principal reste en bas de l'écran. */
.action-bar { display: none; }
@media (max-width: 1023px) {
  body[data-detail="true"] .action-bar {
    position: sticky; bottom: 0; z-index: var(--z-sticky);
    display: flex; gap: var(--sp-8); margin: 0 calc(-1 * var(--content-pad)) calc(-1 * var(--content-pad));
    padding: var(--sp-8) var(--content-pad) calc(var(--sp-8) + env(safe-area-inset-bottom, 0px));
    background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-2);
  }
  .action-bar > .button { flex: 1 1 auto; }
  .action-bar { transition: transform var(--dur-fast) var(--ease), visibility var(--dur-fast) var(--ease); }
  /* Le bouton principal de la carte d'action est à l'écran : la barre s'efface (place gardée). */
  .action-bar[data-card-in-view="true"] { transform: translateY(100%); visibility: hidden; }
}

/* Message bref (« Référence copiée. ») : en bas, au-dessus de la barre d'action. */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--action-bar-height, 0px) + var(--sp-16) + env(safe-area-inset-bottom, 0px)); z-index: var(--z-toast);
  transform: translateX(-50%); max-width: min(480px, calc(100vw - 32px)); padding: var(--sp-12) var(--sp-16);
  border-radius: var(--r-md); background: var(--text); color: var(--surface); box-shadow: var(--shadow-3);
  font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; animation: ui-in var(--dur-fast) var(--ease);
}
.toast:empty { display: none; }
/* Fenêtre moyenne (assigner le chauffeur) : en-tête, corps qui défile, boutons en bas. */
.dialog-medium { width: min(600px, calc(100vw - 32px)); max-width: min(600px, calc(100vw - 32px)); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-12); }
.dialog-head .icon-button { margin: -10px -12px 0 0; }
.dialog-form { display: grid; gap: var(--sp-16); min-width: 0; }
.dialog-intro { margin: 0; color: var(--text-muted); }
.dialog-form .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-12) var(--sp-16); }
.dialog-form .form-grid > label, .dialog-form .form-grid > .country-field { display: grid; gap: 6px; min-width: 0; }
.dialog-form .form-grid > .full, .dialog-form .form-grid > .driver-picker, .dialog-form .form-grid > .checkbox-field { grid-column: 1 / -1; }
.dialog-form .checkbox-field { display: flex; align-items: flex-start; gap: var(--sp-8); }
.dialog-form .dialog-actions { position: sticky; bottom: calc(-1 * var(--sp-24)); margin: 0 calc(-1 * var(--sp-24)) calc(-1 * var(--sp-24)); padding: var(--sp-12) var(--sp-24) var(--sp-16); background: var(--surface); border-top: 1px solid var(--border); }
@media (max-width: 767px) {
  .dialog-medium { width: 100%; max-width: 100%; }
  .dialog-form .form-grid { grid-template-columns: minmax(0, 1fr); }
  .dialog-form .dialog-actions { bottom: calc(-1 * (var(--sp-16) + env(safe-area-inset-bottom, 0px))); margin: 0 calc(-1 * var(--sp-16)) calc(-1 * (var(--sp-16) + env(safe-area-inset-bottom, 0px))); padding: var(--sp-12) var(--sp-16) calc(var(--sp-12) + env(safe-area-inset-bottom, 0px)); }
}
.dialog-medium .dialog-box { max-height: calc(100vh - 32px); overflow: auto; }
@media (max-width: 767px) {
  /* Relecture du 10 novembre 2026 : la case atteinte au clavier (Tab, « Suivant ») reste au-dessus
     du pied collé (deux boutons empilés sur téléphone). */
  .dialog-medium .dialog-box { max-height: 92vh; scroll-padding-bottom: calc(152px + env(safe-area-inset-bottom, 0px)); }
}
.dialog-form .form-grid > .checkbox-field { display: flex; align-items: flex-start; gap: var(--sp-8); }
.driver-picker > .hint { display: block; }

/* Panneau plein écran (réception de secours) : toute la page sur téléphone, grand panneau sur ordinateur. */
.sheet.sheet-full {
  inset: 0; width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0;
  display: none; flex-direction: column; border-radius: 0; overflow: hidden;
}
.sheet.sheet-full[open] { display: flex; }
.sheet-full::before { content: none; }
.sheet-full .sheet-head { flex: none; border-bottom: 1px solid var(--border); }
.sheet-full .sheet-body { flex: 1 1 auto; display: block; overflow: auto; padding: var(--sp-16) var(--sp-16) var(--sp-24); }
@media (min-width: 768px) {
  .sheet.sheet-full { inset: 4vh 0 auto; width: min(720px, calc(100vw - 48px)); height: auto; max-height: 92vh; margin: 0 auto; border-radius: var(--r-xl); }
  .sheet-full .sheet-body { padding: var(--sp-24); }
}

/* 2.30 Étape L3b (plan L3, 4 et 5) : composants des accueils, des listes, de la Bourse et de la cloche ---- */
/* Titre de la page (M1, M10) : caché à la vue dès 1 024 px quand il répète le titre de la barre du haut. */
.page-head { gap: var(--sp-4); margin: 0 0 var(--sp-16); }
.page-head .page-title { margin: 0; }
.page-head-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-8) var(--sp-16); flex-wrap: wrap; min-width: 0; }
.page-head-action { flex: none; }
.page-back { display: inline-flex; align-items: center; gap: 4px; justify-self: start; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: none; }
.page-back:hover { text-decoration: underline; }
.page-sub { color: var(--text-muted); }
@media (min-width: 1024px) {
  .page-head.is-title-repeat .page-title { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  /* Rien d'autre à montrer : l'en-tête entier sort de la mise en page (pas d'espace vide en tête). */
  .page-head.is-title-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
}
/* Titres de section, petits textes, liens « … › » */
.section-title { margin: 0; font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; color: var(--text); }
.section-count { color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.section-sub, .meta { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
.meta-list { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
.meta-list > * + *::before { content: "·"; margin-inline: .5em; color: var(--text-subtle); }
.muted { color: var(--text-muted); }
.grow { flex: 1 1 auto; }
.link-more { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--link); font-weight: 600; text-decoration: none; }
.link-more:hover { text-decoration: underline; }
.card-flush { padding: 0; overflow: hidden; }
.card-title { margin: 0; font-size: var(--fs-18); line-height: var(--lh-18); font-weight: 600; color: var(--text); }
.tile { min-width: 0; padding: var(--sp-12) var(--sp-16); border-radius: var(--r-md); background: var(--surface-2); color: var(--text); }
.tile > p { margin: 0; }
.tile-label { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
.tile-value { font-weight: 600; }
/* Pastille « À vous » d'une ligne de liste (même teinte que le bouton principal). */
.action-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 2px 10px; border-radius: var(--r-full); background: var(--primary); color: var(--on-primary); font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; white-space: nowrap; }
.action-chip.is-alert { background: var(--danger-solid); color: var(--on-danger); }
.chips-inline { display: inline-flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
/* Filtres en pastilles (liens ; la pastille active porte aria-current) */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-8); min-width: 0; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--r-full); background: var(--surface); color: var(--text); font-size: var(--fs-14); font-weight: 600; text-decoration: none; white-space: nowrap; }
.chip:hover { background: var(--surface-2); }
.chip[aria-current="page"] { background: var(--action-bg); border-color: var(--action-border); color: var(--primary-text); }
.chip-count { color: var(--text-muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.chip[aria-current="page"] .chip-count { color: var(--primary-text); }
/* Recherche */
.search { position: relative; display: flex; align-items: center; min-width: 0; }
.search > .icon { position: absolute; left: 12px; color: var(--text-subtle); pointer-events: none; }
.search > input[type="search"] { width: 100%; padding-left: 40px; padding-right: 44px; }
.search > .list-search-clear { position: absolute; right: 2px; }
/* Lignes « À faire » */
.todo-list { display: grid; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.todo-row {
  --todo-bar: var(--action-border); --todo-ic-bg: var(--action-bg); --todo-ic-fg: var(--primary-text);
  position: relative; display: flex; align-items: center; gap: var(--sp-16); min-width: 0; min-height: 72px;
  padding: var(--sp-12) var(--sp-20) var(--sp-12) var(--sp-24); color: var(--text);
}
.todo-row + .todo-row { border-top: 1px solid var(--border); }
.todo-row::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--todo-bar); }
.todo-row[data-row] { cursor: pointer; }
.todo-row[data-row]:hover { background: var(--surface-2); }
.todo-row[data-tone="alert"] { --todo-bar: var(--danger-solid); --todo-ic-bg: var(--danger-bg); --todo-ic-fg: var(--danger); }
.todo-row[data-tone="tosign"] { --todo-bar: var(--tone-tosign-fg); --todo-ic-bg: var(--tone-tosign-bg); --todo-ic-fg: var(--tone-tosign-fg); }
.todo-row[data-tone="published"] { --todo-bar: var(--tone-published-fg); --todo-ic-bg: var(--tone-published-bg); --todo-ic-fg: var(--tone-published-fg); }
.todo-row[data-tone="neutral"] { --todo-bar: var(--border-strong); --todo-ic-bg: var(--surface-2); --todo-ic-fg: var(--text-muted); }
.todo-row-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r-full); background: var(--todo-ic-bg); color: var(--todo-ic-fg); }
.todo-row-main { flex: 1 1 auto; display: grid; gap: 2px; min-width: 0; }
.todo-row-title { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--sp-8); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 600; color: var(--text); }
.todo-row-detail { margin: 0; font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); overflow-wrap: anywhere; }
.todo-row-ref { color: var(--text); font-weight: 600; text-decoration: none; }
.todo-row-ref:hover { text-decoration: underline; }
.todo-row-actions { flex: none; display: flex; align-items: center; gap: var(--sp-8); }
@media (max-width: 767px) {
  .todo-row { flex-wrap: wrap; align-items: flex-start; gap: var(--sp-8) var(--sp-12); padding: var(--sp-12) var(--sp-16) var(--sp-12) var(--sp-20); }
  .todo-row-icon { width: 32px; height: 32px; }
  .todo-row-main { flex-basis: calc(100% - 44px); }
  .todo-row-actions { width: 100%; padding-left: 44px; }
  .todo-row-actions > .button { flex: 1 1 auto; }
}
/* État vide d'une ligne */
.empty-line { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-12); padding: var(--sp-16) var(--sp-20); color: var(--text); }
.empty-line-icon { flex: none; width: 24px; height: 24px; color: var(--text-subtle); }
.empty-line-icon.is-ok { color: var(--success); }
.empty-line-text { flex: 1 1 240px; min-width: 0; margin: 0; font-size: var(--fs-16); line-height: var(--lh-16); }
/* Tuiles de chiffre (accueil du transporteur) */
.stat-tile { display: grid; gap: 2px; min-width: 0; padding: var(--sp-16); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow-1); }
.stat-tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.stat-tile .stat-value { font-size: var(--fs-30); line-height: var(--lh-30); font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-tile .stat-label { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
/* Fenêtre latérale (cloche, fiche de la Bourse) : panneau à droite, page entière sur téléphone */
.sheet.sheet-side {
  inset: 0 0 0 auto; width: min(440px, 100vw); max-width: 100vw; height: 100%; max-height: 100%; margin: 0 0 0 auto;
  display: none; flex-direction: column; border-radius: 0; overflow: hidden;
}
.sheet.sheet-side[open] { display: flex; animation: ui-in var(--dur-base) var(--ease); }
.sheet-side::before { content: none; }
.sheet-side .sheet-head { flex: none; border-bottom: 1px solid var(--border); }
.sheet-side .sheet-body { flex: 1 1 auto; display: block; overflow: auto; padding: var(--sp-16); }
.sheet-head-spacer { flex: 1 1 auto; }
@media (max-width: 767px) {
  .sheet.sheet-side { width: 100vw; }
}
/* Cloche (lignes rendues par bell.js) */
.sheet-side .bell-body { padding: var(--sp-8) 0 var(--sp-16); }
.bell-loading, .bell-empty, .bell-more { margin: 0; padding: var(--sp-8) var(--sp-16); font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); }
.bell-section + .bell-section { margin-top: var(--sp-8); border-top: 1px solid var(--border); padding-top: var(--sp-8); }
.bell-section-title { margin: 0; padding: var(--sp-8) var(--sp-16) var(--sp-4); font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; color: var(--text-muted); }
.bell-list { list-style: none; margin: 0; padding: 0; }
.bell-row { display: grid; gap: 2px; min-height: 48px; padding: 10px var(--sp-16); color: var(--text); text-decoration: none; }
.bell-row:hover { background: var(--surface-2); }
.bell-row:focus-visible { outline-offset: -2px; }
.bell-row.is-new { box-shadow: inset 3px 0 0 var(--primary); }
.bell-new { justify-self: start; }
.bell-row-title { font-size: var(--fs-14); line-height: var(--lh-14); font-weight: 600; overflow-wrap: anywhere; }
.bell-row-text, .bell-row-meta { font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-muted); overflow-wrap: anywhere; }
.bell-row-meta { color: var(--text-subtle); }
.bell-error { margin: var(--sp-8) var(--sp-16); }
.bell-foot { flex: none; display: flex; justify-content: flex-end; padding: var(--sp-4) var(--sp-16); border-top: 1px solid var(--border); background: var(--surface); }
/* Compteur « À faire » de l'entrée « Accueil » */
.count-todo { background: var(--primary); color: var(--on-primary); }
/* Téléphone seulement / jamais sur téléphone */
@media (min-width: 768px) { .only-phone { display: none; } }
@media (max-width: 767px) { .hide-phone { display: none; } }

/* ------------------------------------------------------------------------
   3. Cadre (contrat 6.1 du plan L1+L2)
   ------------------------------------------------------------------------ */
body[data-space="expediteur"]   { --space-color: var(--space-expediteur);   --space-color-nav: var(--space-on-nav-expediteur); }
body[data-space="transporteur"] { --space-color: var(--space-transporteur); --space-color-nav: var(--space-on-nav-transporteur); }
body[data-space="destinataire"] { --space-color: var(--space-destinataire); --space-color-nav: var(--space-on-nav-destinataire); }
body[data-space="admin"]        { --space-color: var(--space-admin);        --space-color-nav: var(--space-on-nav-admin); }

/* Logo */
.sidebar-logo { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.logo-mark { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--logo-bg); color: var(--logo-fg); }
.logo-mark .icon { width: 22px; height: 22px; stroke-width: 3; }
.logo-text { display: grid; min-width: 0; line-height: 1.1; }
.logo-name { font-size: var(--fs-18); font-weight: 700; letter-spacing: .02em; color: inherit; }
.logo-by { font-size: var(--fs-12); font-weight: 400; color: var(--text-subtle); }

/* Pastille d'espace */
.space-pill {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; text-align: left;
}
button.space-pill { cursor: pointer; }
button.space-pill:hover { background: var(--surface-2); }
.space-dot { width: 8px; height: 8px; flex: none; border-radius: var(--r-full); background: var(--space-color, var(--primary)); }
.space-dot--expediteur { background: var(--space-expediteur); }
.space-dot--transporteur { background: var(--space-transporteur); }
.space-dot--receveur, .space-dot--destinataire { background: var(--space-destinataire); }
.space-dot--admin { background: var(--space-admin); }
.space-pill .brand-subtitle { font-size: var(--fs-16); font-weight: 600; color: inherit; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Disposition générale : document qui défile, barres collées */
@media (min-width: 1024px) {
  .app-shell { background: linear-gradient(to right, var(--nav-bg) var(--sidebar-w), var(--bg) var(--sidebar-w)); }
}
.app-shell { min-height: 100vh; }
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

/* Barre de gauche (ordinateur) */
.sidebar {
  display: none; flex-direction: column; gap: var(--sp-8);
  background: var(--nav-bg); color: var(--nav-fg); border-right: 1px solid var(--nav-border);
  padding: 0 var(--sp-12) var(--sp-16);
}
.sidebar :focus-visible { outline-color: var(--nav-focus); }
.sidebar .menu :focus-visible { outline-color: var(--focus); }
.sidebar .sidebar-logo { height: 64px; flex: none; padding: 0 var(--sp-8); color: var(--nav-fg); }
.sidebar .logo-mark { background: var(--primary); color: var(--on-primary); }
.sidebar .logo-by { color: var(--nav-fg-muted); }
.sidebar .menu-anchor { display: flex; }
.sidebar-space { width: 100%; color: var(--nav-fg); }
.sidebar-space .space-dot { background: var(--space-color-nav, var(--nav-fg)); }
.sidebar-space .icon { color: var(--nav-fg-muted); }
.sidebar-space .brand-subtitle { flex: 1; }
button.sidebar-space:hover { background: var(--nav-hover-bg); }
.sidebar .menu { left: 0; right: auto; width: 100%; min-width: 0; }
.sidebar-new {
  display: flex; align-items: center; gap: var(--sp-8); min-height: var(--control-h); margin: var(--sp-4) 0 var(--sp-8); padding: 0 var(--sp-16);
  border: 1px solid var(--nav-cta-border); border-radius: var(--r-md);
  background: var(--nav-cta-bg); color: var(--nav-cta-fg); font-weight: 600; text-decoration: none;
}
.sidebar-new:hover { background: var(--nav-hover-bg); }
.sidebar-new[aria-current="page"] { background: var(--nav-active-bg); border-color: var(--nav-fg); }
.sidebar-nav { display: block; }
.sidebar-nav ul, .sidebar-nav li { margin: 0; padding: 0; list-style: none; }
.sidebar-nav ul { display: grid; gap: 2px; }
.sidebar-link {
  position: relative; display: flex; align-items: center; gap: var(--sp-12); width: 100%; min-height: 44px; padding: 0 var(--sp-12);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--nav-fg);
  font: inherit; font-size: var(--fs-16); font-weight: 600; text-align: left; text-decoration: none; cursor: pointer;
}
.sidebar-link > .icon { width: 24px; height: 24px; color: var(--nav-fg-muted); }
.sidebar-link:hover { background: var(--nav-hover-bg); }
.sidebar-link[aria-current="page"] { background: var(--nav-active-bg); }
.sidebar-link[aria-current="page"] > .icon { color: var(--nav-fg); }
.sidebar-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--nav-fg); }
.sidebar-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar .count { background: var(--nav-count-bg); color: var(--nav-count-fg); }
/* Revue L1 + L2 (M5) : plus fort que « .sidebar-nav li » (marges remises à zéro) ; aligné sur le texte des entrées. */
.sidebar-nav .sidebar-group, .sidebar-group { margin-top: var(--sp-24); padding: 0 var(--sp-12) var(--sp-4) 48px; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--nav-fg-muted); }
.sidebar-bottom { margin-top: auto; padding-top: var(--sp-12); border-top: 1px solid var(--nav-active-bg); }

/* Barre du haut */
.topbar {
  position: sticky; top: 0; z-index: var(--z-header);
  display: flex; align-items: center; gap: var(--sp-16);
  height: var(--topbar-h); margin: 0; padding: 0 var(--sp-24) 0 var(--content-pad);
  background: var(--surface); color: var(--text); border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none;
}
.topbar-left { flex: 1 1 auto; display: flex; align-items: center; gap: var(--sp-12); min-width: 0; }
.topbar-title { margin: 0; min-width: 0; font-size: var(--fs-20); line-height: var(--lh-20); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-space { display: none; }
.topbar-back { display: none; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 0; color: var(--link); font-weight: 600; text-decoration: none; white-space: nowrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--fs-16); color: var(--text-muted); }
.breadcrumb a { color: var(--link); font-weight: 600; text-decoration: none; white-space: nowrap; }
.breadcrumb a:hover, .topbar-back:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-search:empty { display: none; }
.topbar-actions { display: flex; align-items: center; gap: var(--sp-4); flex: none; }
.topbar-icon-button {
  position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--text-muted); text-decoration: none;
}
.topbar-icon-button .icon { width: 24px; height: 24px; }
.topbar-icon-button:hover, .topbar-icon-button[aria-current="page"] { background: var(--surface-2); color: var(--text); }
.account-button {
  display: inline-flex; align-items: center; gap: var(--sp-8); height: 44px; padding: 0 var(--sp-8) 0 6px;
  border: 0; border-radius: var(--r-full); background: transparent; color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer; box-shadow: none;
}
.account-button:hover, .account-button[aria-expanded="true"] { background: var(--surface-2); }
.account-button > .icon { width: 16px; height: 16px; color: var(--text-muted); }
.avatar {
  width: 32px; height: 32px; flex: none; display: inline-grid; place-items: center; border-radius: var(--r-full);
  background: var(--primary); color: var(--on-primary); font-size: var(--fs-14); line-height: 1; font-weight: 600; letter-spacing: .02em;
}
.avatar-lg { width: 40px; height: 40px; font-size: var(--fs-16); }
.account-menu { top: calc(100% + 6px); }

/* Contenu */
.page-shell { flex: 1 0 auto; width: 100%; max-width: calc(var(--content-max) + 2 * var(--content-pad)); margin: 0 auto; padding: var(--content-pad); min-width: 0; }
.page-shell:focus { outline: none; }
.release-intro, .old-browser-banner { margin: var(--sp-16) var(--content-pad) 0; }
.old-browser-banner { margin: 0; border-radius: 0; }
.release-intro p { margin: 0; }
/* Revue L1 + L2 (M20) : texte courant en 16 px et couleur normale ; seule la première phrase en gras. */
.release-intro.notice-info { color: var(--text); font-size: var(--fs-16); line-height: var(--lh-16); font-weight: 400; }
.release-intro.notice-info::before { color: var(--info); background: var(--info); }
.release-intro strong { font-weight: 700; color: var(--text); }
.release-intro .button { margin-top: var(--sp-8); }

/* Pied de page */
.site-footer {
  flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  padding: var(--sp-20) var(--content-pad); border-top: 1px solid var(--border);
  font-size: var(--fs-14); line-height: var(--lh-14); color: var(--text-subtle);
}
.site-footer a, .site-footer button { color: var(--text-muted); text-decoration: none; background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }
.site-footer a:hover, .site-footer button:hover { color: var(--text); text-decoration: underline; }
.site-footer p { margin: 0; }
.site-footer .link-button { color: var(--text-muted); font-weight: 400; text-decoration: none; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer-links:empty { display: none; }

/* Onglets du bas (téléphone) */
.tabbar { display: none; }
.tab-item {
  position: relative; display: grid; justify-items: center; align-content: center; gap: 2px; min-width: 0; padding: 0 2px;
  border: 0; background: none; color: var(--text-muted); font: inherit; font-size: var(--fs-12); line-height: var(--lh-12); font-weight: 600; text-decoration: none; cursor: pointer;
}
.tab-item > .icon { width: 24px; height: 24px; }
.tab-item[aria-current="page"] { color: var(--link); }
.tab-item[aria-current="page"] > .icon { stroke-width: 2.25; }
.tab-item .count { position: absolute; top: 6px; left: calc(50% + 4px); background: var(--badge-bg); color: var(--badge-fg); box-shadow: 0 0 0 2px var(--surface); }
.tab-item-label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Pages sans menu (connexion, accueil public, page introuvable) */
.auth-shell { display: flex; flex-direction: column; min-height: 100vh; }
.auth-header {
  position: sticky; top: 0; z-index: var(--z-header); flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12);
  height: 64px; padding: 0 var(--sp-32); background: var(--surface); border-bottom: 1px solid var(--border);
}
.auth-header .sidebar-logo { color: var(--text); }
.auth-main { flex: 1 0 auto; padding: var(--sp-48) var(--sp-32); }

/* Ordinateur : barre de gauche entière dès 1 024 px */
@media (min-width: 1024px) {
  .app-shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar { display: flex; position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; z-index: var(--z-header); scrollbar-width: thin; }
  .topbar .breadcrumb { display: flex; }
}
/* Téléphone et petite tablette : barre du haut de 56 px, onglets du bas de 64 px */
@media (max-width: 1023px) {
  .topbar { gap: var(--sp-4); padding: 0 var(--sp-4) 0 var(--sp-12); }
  .topbar-title, .topbar .breadcrumb, .account-name, .account-button > .icon { display: none; }
  .topbar-space { display: inline-flex; }
  body[data-detail="true"] .topbar-space { display: none; }
  body[data-detail="true"] .topbar-back { display: inline-flex; }
  .account-button { width: 44px; padding: 0; justify-content: center; }
  .app-main { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  body[data-detail="true"] .app-main { padding-bottom: 0; }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-header);
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface); border-top: 1px solid var(--border);
  }
  body[data-detail="true"] .tabbar { display: none; }
  .site-footer { padding: var(--sp-16); }
  .auth-header { height: 56px; padding: 0 var(--sp-16); }
  .auth-main { padding: var(--sp-24) var(--sp-16); }
  .menu { position: fixed; top: calc(var(--topbar-h) + 4px); right: var(--sp-8); left: auto; max-height: calc(100vh - var(--topbar-h) - 16px); overflow: auto; }
  /* Revue L1 + L2 (M6) : la liste des espaces s'ouvre sous la pastille, à gauche. */
  .topbar-left .menu { left: var(--sp-8); right: auto; }
}

/* ------------------------------------------------------------------------
   4. Signes des pastilles d'état (data-icon, posé par status-display.js)
   ------------------------------------------------------------------------ */
.status-chip[data-icon]::before {
  width: 14px; height: 14px; border-radius: 0; background: currentColor;
  -webkit-mask: var(--chip-icon) center / contain no-repeat; mask: var(--chip-icon) center / contain no-repeat;
}
.status-chip[data-icon="alert-triangle"]  { --chip-icon: var(--i-alert-triangle); }
.status-chip[data-icon="calendar"]        { --chip-icon: var(--i-calendar); }
.status-chip[data-icon="check"]           { --chip-icon: var(--i-check); }
.status-chip[data-icon="check-circle"]    { --chip-icon: var(--i-check-circle); }
.status-chip[data-icon="clipboard-check"] { --chip-icon: var(--i-clipboard-check); }
.status-chip[data-icon="clock"]           { --chip-icon: var(--i-clock); }
.status-chip[data-icon="help-circle"]     { --chip-icon: var(--i-help); }
.status-chip[data-icon="mail"]            { --chip-icon: var(--i-mail); }
.status-chip[data-icon="megaphone"]       { --chip-icon: var(--i-megaphone); }
.status-chip[data-icon="minus-circle"]    { --chip-icon: var(--i-minus-circle); }
.status-chip[data-icon="send"]            { --chip-icon: var(--i-send); }
.status-chip[data-icon="truck"]           { --chip-icon: var(--i-truck); }
.status-chip[data-icon="user-check"]      { --chip-icon: var(--i-user-check); }
.status-chip[data-icon="x-circle"]        { --chip-icon: var(--i-x-circle); }
/* Nom inconnu : le point de L0. */
.status-chip[data-icon=""]::before { width: 8px; height: 8px; border-radius: 50%; -webkit-mask: none; mask: none; }

/* ------------------------------------------------------------------------
   5. Utilitaires (seule section où « !important » est permis)
   ------------------------------------------------------------------------ */
/* G124 / G114 : un élément marqué « hidden » reste toujours caché, quelle que soit sa règle d'affichage. */
[hidden] { display: none !important; }
.hidden { display: none !important; }
/* Page Administrateurs : encart du mot de passe provisoire (attribut hidden prioritaire sur .stack-card). */
#adminAccountProvisional[hidden] { display: none !important; }
/* Lot 3B2 : comptes (mots de passe provisoires). */
#adminUserProvisional[hidden],
#adminSignupCredentials[hidden] { display: none !important; }
.mfa-open-app[hidden] { display: none !important; }
.account-rotation[hidden], .account-codes[hidden] { display: none !important; }
.sr-only, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
}
/* Impression des codes de secours seulement pendant « Imprimer » (classe posée puis retirée par
   le script) : imprimer un dossier ou un tableau de bord reste inchangé. */
@media print {
    body.print-recovery-codes > *:not(.print-codes-sheet) { display: none !important; }
    body.print-recovery-codes > .print-codes-sheet { display: block !important; background: var(--print-bg) !important; padding: 0; margin: 0; }
    body.print-recovery-codes .print-codes-sheet * { color: var(--print-fg) !important; }
    body.print-recovery-codes .print-only { display: block; }
}
