/* =====================================================================
   Logistique DUO 3.4 — finitions des composants communs
   Chargé après toutes les autres feuilles. Une seule définition par
   composant partagé : popups, champs, boutons icône, groupes de boutons
   d'en-tête, filtres, lignes de liste et liste de détails.
   Préfixe « html body » : passe devant les règles historiques sans !important.
   ===================================================================== */

/* ---------------------------------------------------------------- boutons */
html body .btn {
  min-height: 42px;
  padding: 0 18px;
  font-size: 14px;
  line-height: 1.2;
  font-weight: 600;
  border-radius: var(--r-sm);
  gap: 8px;
}
html body .btn .icon {
  width: 17px;
  height: 17px;
}
html body .btn.secondary {
  background: var(--secondary-bg);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
html body .btn.secondary:hover:not(:disabled) {
  background: var(--secondary-hover);
  border-color: var(--selection-line);
}

/* Bouton icône : discret, sans cadre, fond au survol seulement. */
html body .icon-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  display: inline-grid;
  place-items: center;
  flex: none;
  cursor: pointer;
}
html body .icon-btn .icon {
  width: 18px;
  height: 18px;
}
html body .icon-btn:hover:not(:disabled),
html body a.icon-btn:hover {
  background: var(--soft-hover);
  color: var(--text);
}
html body .icon-btn.danger-icon-v4,
html body .icon-btn.danger {
  color: var(--red);
  background: var(--red-soft);
}
html body .icon-btn.danger-icon-v4:hover:not(:disabled) {
  background: var(--danger-hover);
  color: var(--red);
}

/* ---------------------------------------------------------------- en-tête de page */
html body .page-heading {
  align-items: flex-end;
  gap: 16px 24px;
}
html body .page-heading .page-heading-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0 0 0 auto;
  width: auto;
}
html body .page-heading .page-heading-actions > .btn,
html body .page-heading .page-heading-actions > a.btn {
  margin: 0;
  min-height: 42px;
  font-size: 14px;
  flex: none;
  width: auto;
}

/* ---------------------------------------------------------------- champs */
html body .label {
  display: grid;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
html body .input,
html body select.input,
html body textarea.input,
html body .modal textarea {
  min-height: 42px;
  padding: 9px 13px;
  font-size: 14.5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  box-shadow: none;
}
/* Tous les champs d'une ligne ont la même hauteur (44 px, cible tactile),
   y compris les dates dont le cadre est porté par .date-control (iOS). */
html body .input:not(textarea),
html body select.input {
  min-height: 44px;
}
html body .date-control {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 10px;
}
html body .date-control > input.input {
  min-height: 0;
}
html body .input::placeholder,
html body textarea::placeholder {
  color: var(--faint);
}
html body .form-grid {
  gap: 16px;
}
html body .checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
}
html body .checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--action-bg);
  flex: none;
}

/* ---------------------------------------------------------------- popups */
html body .modal-backdrop {
  padding: 24px;
}
html body .modal {
  width: 100%;
  max-width: 580px;
  max-height: min(88dvh, 900px);
  padding: 0 26px;
  border: 0;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: auto;
  overscroll-behavior: contain;
}
html body .modal.modal-wide {
  max-width: 780px;
}
html body .modal.modal-xl {
  max-width: 1100px;
}
html body .modal:not(:has(.modal-footer, .nt-foot)) {
  padding-bottom: 24px;
}
html body .modal > .modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 -26px 20px;
  padding: 20px 20px 16px 26px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
html body .modal > .modal-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
html body .modal > .modal-header .modal-pill {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  flex: none;
  background: color-mix(in srgb, var(--hue) 14%, var(--surface));
  color: var(--hue);
}
html body .modal > .modal-header .modal-pill .icon {
  width: 19px;
  height: 19px;
}
html body .modal form,
html body .modal .stack {
  display: grid;
  gap: 18px;
}
html body .modal form > .form-grid,
html body .modal .stack > .form-grid {
  margin: 0;
}
html body .modal .form-section {
  margin: 4px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}
html body .modal .form-section > h3 {
  margin: 0;
  font-size: 15px;
}
html body .modal .form-section > p {
  margin: -6px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
html body .modal .form-error:empty {
  display: none;
}
/* Pied de popup : toujours visible, collé au bas. */
html body .modal .modal-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 20px -26px 0;
  padding: 14px 26px;
  background: var(--surface2);
  border-top: 1px solid var(--line);
}
html body .modal .modal-footer.has-delete {
  justify-content: space-between;
}
html body .modal .modal-footer .config-save-actions-v4 {
  display: flex;
  gap: 10px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
html body .modal .modal-footer .btn {
  min-height: 42px;
  margin: 0;
}
/* Liste de détails (consultation) : libellé discret, valeur alignée à droite. */
html body .details-list {
  display: grid;
  gap: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
html body .details-list > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--line);
  min-height: 0;
}
html body .details-list > div:first-child {
  border-top: 0;
}
html body .details-list > div > span {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
}
html body .details-list > div > strong {
  text-align: right;
  font-size: 14px;
  font-weight: 600;
}
html body .details-list + p,
html body .details-list + .page-caption {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 13.5px;
}

/* ---------------------------------------------------------------- notices */
html body .notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
html body .notice > .icon {
  margin-top: 1px;
  width: 17px;
  height: 17px;
}

/* ---------------------------------------------------------------- état vide */
html body .empty-state {
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 8px;
  padding: 40px 24px;
}
html body .empty-state > .icon {
  width: 52px;
  height: 52px;
  padding: 13px;
  margin: 0 0 6px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--c-materiel) 12%, var(--surface));
  color: var(--c-materiel);
  justify-self: center;
}
html body .empty-state h2 {
  margin: 0;
  font-size: 18px;
}
html body .empty-state p {
  margin: 0;
  color: var(--muted);
}

/* ---------------------------------------------------------------- mobile */
@media (max-width: 760px) {
  html body .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  html body .modal,
  html body .modal.modal-wide,
  html body .modal.modal-xl {
    max-width: none;
    width: 100%;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    padding: 0 18px;
  }
  html body .modal > .modal-header {
    margin: 0 -18px 16px;
    padding: 16px 14px 14px 18px;
  }
  html body .modal .modal-footer {
    margin: 8px -18px 0;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  }
  html body .modal .modal-footer .config-save-actions-v4 {
    flex: 1;
  }
  html body .modal .modal-footer .config-save-actions-v4 .btn,
  html body .modal .modal-footer > .btn {
    flex: 1 1 0;
    min-width: 0;
  }
  html body .form-grid {
    grid-template-columns: 1fr;
  }
  html body .page-heading .page-heading-actions {
    width: 100%;
    justify-content: stretch;
    margin: 0;
  }
  html body .page-heading .page-heading-actions > .btn,
  html body .page-heading .page-heading-actions > a.btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 12px;
    font-size: 14px;
  }
  html body .page-heading .page-heading-actions > .btn.pdf-export {
    flex: 0 0 42px;
    width: 42px;
    padding: 0;
  }
  html body .page-heading .page-heading-actions > .btn.pdf-export > span {
    display: none;
  }
}

/* ---------------------------------------------------------------- groupes de champs */
html body .modal .form-block {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
html body .modal .form-block > h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
html body .modal .form-hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
html body #stock-form:not(:has([name="perishable"]:checked)) .stock-batches {
  display: none;
}
html body .stock-batches {
  display: grid;
  gap: 12px;
}
html body .stock-batches > .btn {
  justify-self: start;
}

/* Zone dépliable dans une popup (« Date et numéro de lot — facultatif »…). */
html body .modal details:not(.st-help) > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  color: var(--active-text);
  font-size: 13.5px;
  font-weight: 600;
}
html body .modal details:not(.st-help) > summary::-webkit-details-marker {
  display: none;
}
html body .modal details:not(.st-help) > summary:not(:has(> .icon))::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
html body .modal details:not(.st-help)[open] > summary::before {
  transform: rotate(45deg);
}
html body .modal details:not(.st-help)[open] > summary {
  margin-bottom: 12px;
}

/* ---------------------------------------------------------------- listes à cocher */
html body .choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  margin: 0;
}
html body .modal .selection-card.choice-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 0;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: none;
  cursor: pointer;
}
html body .modal .selection-card.choice-row:hover {
  border-color: var(--selection-line);
}
html body .modal .selection-card.choice-row:has(input:checked) {
  border-color: color-mix(in srgb, var(--action-bg) 55%, var(--line));
  background: color-mix(in srgb, var(--action-bg) 6%, var(--surface));
}
html body .modal .selection-card.choice-row > span:not(.choice-thumb) {
  display: grid;
  gap: 1px;
  min-width: 0;
}
html body .modal .selection-card.choice-row strong {
  font-size: 13.5px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .modal .selection-card.choice-row small {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
html body .modal .selection-card.choice-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--action-bg);
}
html body .choice-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: color-mix(in srgb, var(--c-materiel) 10%, var(--surface2));
  color: var(--c-materiel);
}
html body .choice-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}
html body .choice-thumb .icon {
  width: 19px;
  height: 19px;
}
html body .modal .lot-selection-count {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Ancien bouton icône « compact » (cadre dessiné en ::before) : aligné sur le bouton icône discret. */
html body .icon-btn.compact-icon,
html body .mission-configure {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  flex: 0 0 36px;
  padding: 0;
}
html body .icon-btn.compact-icon::before {
  display: none;
}
html body .icon-btn.compact-icon:hover:not(:disabled) {
  background: var(--soft-hover);
}

/* Compteur d'en-tête aligné sur les compteurs des lignes suivies d'un chevron. */
html body .ds-chip.ds-chip-chev {
  margin-right: 28px;
}

/* ---------------------------------------------------------------- inventaire */
/* Ligne vérifiée : vert très léger ; écart (quantité inférieure à l'attendu) : ambre léger. */
html body .inventory-line.is-verified {
  background: var(--inventory-ok-bg);
}
html body .inventory-line.has-shortage {
  background: var(--inventory-gap-bg);
}
html body .inventory-line.has-shortage .inventory-tick input:checked + span {
  background: var(--amber-strong);
  border-color: var(--amber-strong);
}

/* Titre précédé d'une icône : icône dans une pastille, alignée sur la première ligne du texte. */
html body :is(h2, h3, h4):has(> .icon:first-child) {
  display: flex;
  align-items: center;
  gap: 10px;
}
html body :is(h2, h3, h4) > .icon:first-child {
  flex: none;
  width: 18px;
  height: 18px;
}
html body #check-form header h2 > .icon:first-child,
html body .inventory-group header h2 > .icon:first-child {
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c-materiel) 12%, var(--surface));
  color: var(--c-materiel);
}

/* ---------------------------------------------------------------- bandeau de mission / contrôle de dotation */
html body .mission-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--hue, var(--c-missions));
  border-radius: var(--r);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
}
html body .mission-banner::before,
html body .mission-banner::after {
  display: none;
}
html body .mission-banner .mission-banner-info {
  display: grid;
  gap: 8px;
  min-width: 0;
  flex: 1 1 360px;
}
html body .mission-banner .mission-type {
  display: flex;
  margin: 0;
}
html body .mission-banner .mission-type-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  background: none;
  color: var(--hue, var(--c-missions));
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html body .mission-banner .mission-type-label .icon {
  width: 16px;
  height: 16px;
}
html body .mission-banner h2 {
  margin: 0;
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
html body .mission-banner .mission-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
}
html body .mission-banner .mission-meta-context {
  display: contents;
}
html body .mission-banner .mission-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html body .mission-banner .mission-meta .icon {
  width: 15px;
  height: 15px;
  color: var(--faint);
}
html body .mission-banner .mission-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
}
html body .mission-banner .progress-caption strong {
  display: block;
  font-size: 14px;
  max-width: 180px;
}

/* Rubriques historiques des popups (form-section) : même carte que les groupes de champs. */
html body .modal .form-section {
  margin: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
html body .modal .form-section > h3,
html body .modal .form-section > summary {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
html body .modal .form-section > p {
  margin: 0;
  font-size: 12.5px;
}
html body .modal details.form-section:not([open]) > summary {
  margin: 0;
}

/* ---------------------------------------------------------------- notifications */
html body .nt-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
html body .nt-bar .ds-segs,
html body .nt-bar .btn.nt-prefs {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
html body .nt-bar .btn.nt-prefs {
  padding: 0 16px;
  font-size: 13.5px;
  border-radius: 12px;
}
html body .nt-sub {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
}

/* Aide (ⓘ) des préférences de notification : petit rond net collé au dernier mot du libellé ;
   l'explication s'ouvre sous la ligne, sur toute sa largeur (jamais coupée par un bord). */
html body .st-pref-row {
  flex-wrap: wrap;
}
html body .st-pref-event {
  display: block;
  min-width: 0;
}
html body .st-pref-event b {
  display: inline;
}
html body .st-help {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  min-width: 0;
  min-height: 0;
  margin: -4px 0 -4px 4px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--faint);
  vertical-align: middle;
  cursor: pointer;
  position: relative;
}
/* Zone de toucher agrandie sans grossir le rond. */
html body .st-help::after {
  content: "";
  position: absolute;
  inset: -10px;
}
html body .st-help:hover,
html body .st-help[aria-expanded="true"] {
  background: color-mix(in srgb, var(--hue, var(--blue)) 14%, transparent);
  color: var(--hue, var(--blue));
}
html body .st-help .icon {
  width: 15px;
  height: 15px;
}
html body .st-help-text {
  flex-basis: 100%;
  margin: 2px 0 2px 42px;
  padding: 8px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--hue, var(--blue)) 8%, var(--surface));
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.45;
}
html body .st-help-text[hidden] {
  display: none;
}
/* Canaux : coché = teinté, décoché = contour net, indisponible = pointillés sans teinte
   (auparavant un « coché » indisponible ressemblait à un « décoché »). */
html body .st-pref-row .st-chan {
  color: var(--muted);
}
html body .st-pref-row .st-chan:has(input:disabled) {
  opacity: 1;
  border-style: dashed;
  background: transparent;
  color: color-mix(in srgb, var(--faint) 60%, transparent);
}

/* ---------------------------------------------------------------- marque du menu */
html body .sidebar .brand {
  padding: 2px 6px 18px;
}
html body .sidebar .local-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
html body .sidebar .local-brand > .icon {
  width: 38px;
  height: 38px;
  padding: 7px;
  border-radius: 11px;
  box-shadow: none;
  flex: none;
}
html body .sidebar .brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}
html body .sidebar .brand-text strong {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  line-height: 1.15;
  color: #fff;
}
html body .sidebar .brand-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--side-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.3;
}
html body .sidebar .brand-tag {
  font-size: 10px;
  padding: 2px 6px;
}
/* Teinte « structure » lisible en mode sombre (Identité du site, Contact, Premiers pas…). */
html[data-theme="dark"] {
  --c-home: #ff8a9a;
}

/* ---------------------------------------------------------------- équipe et accès */
html body .us-toolbar {
  justify-content: space-between;
}
html body .us-search {
  flex: 0 1 360px;
  margin-left: auto;
}
html body .us-search .input {
  min-height: 44px;
  margin: 0;
}
html body .us-row[hidden] {
  display: none;
}
@media (max-width: 760px) {
  html body .us-search {
    flex: 1 1 100%;
    margin: 0;
  }
}

/* ---------------------------------------------------------------- popup « Mon compte » */
html body .modal.account-menu-dialog {
  max-width: 420px;
}
html body .account-menu-dialog .account-menu-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface2);
}
html body .account-menu-dialog .account-menu-identity .avatar {
  width: 46px;
  height: 46px;
  font-size: 15px;
}
html body .account-menu-dialog .account-menu-identity h3 {
  margin: 0;
  font-size: 16px;
}
html body .account-menu-dialog .account-menu-identity p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
html body .account-menu-links {
  display: grid;
  gap: 2px;
}
html body .account-menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 6px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
html body .account-menu-link > span:not(.ds-pill) {
  flex: 1;
}
html body .account-menu-link .ds-pill {
  --hue: var(--c-equipe);
  width: 34px;
  height: 34px;
}
html body .account-menu-link:hover {
  background: var(--surface2);
}
html body .account-menu-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
html body .account-menu-link.is-logout {
  color: var(--red);
}
html body .account-menu-link.is-logout .ds-pill {
  --hue: var(--red);
}
html body .account-menu-footer {
  display: grid;
  gap: 10px;
  margin: 12px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
}
html body .account-menu-footer .site-copyright {
  margin: 0;
  text-align: center;
  color: var(--faint);
  font-size: 12px;
}

/* ---------------------------------------------------------------- informations légales */
html body .legal-tabs {
  position: sticky;
  top: 75px;
  z-index: 2;
  display: inline-flex;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface2);
}
html body .legal-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
html body .legal-tabs button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
html body .legal-content {
  display: grid;
  gap: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
html body .legal-content :is(h2, h3) {
  margin: 12px 0 0;
  font-size: 15px;
}
html body .legal-content p,
html body .legal-content li {
  margin: 0;
  color: var(--muted);
}

/* Encadrés de champs (fieldset) dans les popups. */
html body .modal fieldset {
  margin: 0;
  padding: 12px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: grid;
  gap: 8px;
  min-width: 0;
}
html body .modal fieldset > legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
html body .modal .dts-qr-management {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
}
html body .modal .dts-qr-management > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
}
html body .modal .inline-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------------- mobile : boutons d'en-tête et filtres */
@media (max-width: 760px) {
  html body .page-heading .page-heading-actions > .btn:not(.pdf-export),
  html body .page-heading .page-heading-actions > a.btn {
    font-size: 13.5px;
    white-space: normal;
    line-height: 1.15;
    text-align: center;
    min-height: 44px;
    padding: 4px 10px;
  }
  html body .page-heading .page-heading-actions > .btn:not(.pdf-export) > .icon,
  html body .page-heading .page-heading-actions > a.btn > .icon {
    display: none;
  }
  html body .page-heading .page-heading-actions > .btn.pdf-export {
    flex: 0 0 44px;
    width: 44px;
    min-height: 44px;
  }
  html body .ds-segs {
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body .ds-segs::-webkit-scrollbar {
    display: none;
  }
  html body #stock-filter-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  html body .stock-select select.input {
    max-width: none;
    width: 100%;
  }
  html body .stock-reset {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

@media (max-width: 760px) {
  html body .mc-foot {
    flex-wrap: wrap;
  }
  html body .mc-foot .btn {
    flex: 1 1 100%;
    order: 5;
  }
  html body .mc-head .mc-tools .ds-chip {
    font-size: 11.5px;
  }
}

/* Bouton vert (« Je prends ») : vert aussi en mode sombre. */
html body .btn.green {
  background: var(--green);
  border-color: transparent;
  color: #fff;
}
html[data-theme="dark"] body .btn.green {
  color: #0d2b22;
}

/* ================================================================
   Popups 3.4 : fiche et formulaire.
   Règle : un seul niveau de cadre. On sépare par l'espacement,
   les titres et des traits fins, jamais par des boîtes imbriquées.
   ================================================================ */

/* En-tête et pied débordent sur le rembourrage de la popup :
   l'ancienne règle « .modal > * { max-width: 100% } » (terrain.css) les coupait. */
html body .modal > .modal-header,
html body .modal .modal-footer {
  max-width: none;
}

/* Rubriques de formulaire : plates, séparées par un trait fin. */
html body .modal .form-block {
  gap: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
html body .modal .form-block + .form-block,
html body .modal .form-block + .pp-more,
html body .modal .form-block + details.form-section {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
html body .modal .form-block > h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
}
html body .modal .form-grid.pp-grid-2 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

/* Fiche (consultation) */
html body .modal .pp-sheet {
  display: grid;
  gap: 22px;
}
html body .modal .pp-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2);
}
html body .modal .pp-status > .icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--muted);
}
html body .modal .pp-status b {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}
html body .modal .pp-status span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
html body .modal .pp-status.danger {
  background: var(--red-soft);
}
html body .modal .pp-status.danger > .icon,
html body .modal .pp-status.danger b {
  color: var(--red);
}
html body .modal .pp-status.warn {
  background: var(--amber-soft);
}
html body .modal .pp-status.warn > .icon,
html body .modal .pp-status.warn b {
  color: var(--amber);
}
html body .modal .pp-status.ok {
  background: var(--green-soft);
}
html body .modal .pp-status.ok > .icon,
html body .modal .pp-status.ok b {
  color: var(--green);
}

html body .modal .pp-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px 24px;
}
html body .modal .pp-info-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
html body .modal .pp-info-row > .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  color: var(--faint);
}
html body .modal .pp-info-row > div {
  min-width: 0;
}
html body .modal .pp-info-row span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}
html body .modal .pp-info-row b {
  display: block;
  margin-top: 1px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

html body .modal .pp-section {
  display: grid;
  gap: 6px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
html body .modal .pp-section > h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
html body .modal .pp-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
html body .modal .pp-list > li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 0;
}
html body .modal .pp-list > li + li {
  border-top: 1px solid var(--line);
}
html body .modal .pp-list > li > div {
  min-width: 0;
}
html body .modal .pp-list b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
html body .modal .pp-list span:not(.ds-chip):not(.pp-list-end) {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--muted);
}
html body .modal .pp-list-end {
  flex: none;
}
html body .modal .pp-empty,
html body .modal .pp-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-line;
}

/* Options repliées */
html body .modal .pp-more {
  display: grid;
}
html body .modal .pp-more > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--active-text);
  cursor: pointer;
  list-style: none;
}
html body .modal .pp-more > summary::-webkit-details-marker {
  display: none;
}
html body .modal .pp-more > summary .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}
html body .modal .pp-more[open] > summary .icon {
  transform: rotate(180deg);
}
html body .modal .pp-more-body {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

/* Interrupteur */
html body .modal .pp-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  cursor: pointer;
}
html body .modal .pp-switch > span {
  min-width: 0;
}
html body .modal .pp-switch b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
html body .modal .pp-switch small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
html body .modal .pp-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 48px;
  height: 28px;
  margin: 0;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.15s ease;
}
html body .modal .pp-switch input[type="checkbox"]::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
html body .modal .pp-switch input[type="checkbox"]:checked {
  background: var(--action-bg);
}
html body .modal .pp-switch input[type="checkbox"]:checked::before {
  transform: translateX(20px);
}
html body .modal .pp-switch input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Lignes de dates d'un article */
html body .modal .batch-row.pp-batch {
  display: grid;
  grid-template-columns: none;
  gap: 12px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
html body .modal .pp-batch-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 44px;
  gap: 12px;
  align-items: end;
}
/* Même grille que la ligne du dessus : les bords des champs tombent l'un sous l'autre. */
html body .modal .pp-batch-extra {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) 44px;
  gap: 12px;
}
html body .modal .pp-batch-extra > .label:last-child {
  grid-column: 2 / 4;
}
/* Date d'abord, quantité ensuite : deux colonnes égales. */
html body .modal .pp-batch-main,
html body .modal .pp-batch-extra {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 44px;
}
html body .modal .pp-batch .label {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
}
html body .modal .pp-batch-main > .icon-btn {
  grid-column: auto;
  grid-row: auto;
  width: 44px;
  height: 44px;
}
html body .modal .stock-batches {
  display: grid;
  gap: 4px;
}
html body .modal .stock-batches > .pp-add {
  justify-self: start;
  margin-top: 4px;
}

/* Pied de popup sur ordinateur : boutons d'action de largeur égale. */
html body .modal .modal-footer > .btn {
  min-width: 140px;
}
/* Bordure transparente sur les boutons pleins : même gabarit que les boutons secondaires. */
html body .modal .modal-footer .btn:not(.secondary):not([class*="danger"]) {
  border: 1px solid transparent;
}

/* Lignes cliquables d'une popup : toute la ligne ouvre l'élément. */
html body .modal .pp-links {
  display: grid;
}
html body .modal .pp-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .modal .pp-link + .pp-link {
  border-top: 1px solid var(--line);
}
html body .modal .pp-link-main {
  flex: 1;
  min-width: 0;
}
html body .modal .pp-link-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
html body .modal .pp-link-main small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html body .modal .pp-link-main small.pp-link-note {
  color: var(--amber);
}
html body .modal .pp-link-end {
  flex: none;
}
html body .modal .pp-link > .icon {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--faint);
}
html body .modal .pp-link:hover .pp-link-main b {
  color: var(--active-text);
}
html body .modal .pp-link:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 8px;
}
html body .modal .pp-hint {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--muted);
}
/* Première rubrique d'une fiche : pas de trait au-dessus. */
html body .modal .pp-sheet > .pp-section:first-child,
html body .modal .pp-sheet > .pp-hint + .pp-section {
  padding-top: 0;
  border-top: 0;
}
/* Vignette photo dans l'en-tête d'une popup. */
html body .modal > .modal-header .modal-pill.pp-thumb {
  overflow: hidden;
  padding: 0;
  background: var(--surface2);
}
html body .modal > .modal-header .modal-pill.pp-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
html body .modal .pp-info.pp-info-compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Liste à cocher plate */
html body .modal .pp-checks {
  display: grid;
}
html body .modal .pp-check {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  margin: 0;
  padding: 10px 0;
  cursor: pointer;
}
html body .modal .pp-check + .pp-check {
  border-top: 1px solid var(--line);
}
html body .modal .pp-check.is-disabled {
  cursor: default;
  opacity: 0.55;
}
html body .modal .pp-check-main {
  flex: 1;
  min-width: 0;
}
html body .modal .pp-check-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
html body .modal .pp-check-main small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
html body .modal .pp-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 2px solid var(--faint);
  border-radius: 7px;
  background: var(--surface);
  cursor: inherit;
}
html body .modal .pp-check input[type="checkbox"]:checked {
  border-color: var(--action-bg);
  background: var(--action-bg);
}
html body .modal .pp-check input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
html body .modal .pp-check input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html body .modal .pp-link > .ds-pill,
html body .modal .pp-check > .ds-pill {
  flex: none;
}
/* Les grilles des popups ne s'élargissent jamais au-delà de la popup
   (un texte coupé par « … » ne doit pas pousser la largeur). */
html body .modal .pp-links,
html body .modal .pp-checks,
html body .modal .pp-sheet,
html body .modal .form-block {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
html body .modal .pp-check[hidden],
html body .modal .pp-link[hidden] {
  display: none;
}

/* Dispositif DT : une infirmerie par rubrique, sans cadre. */
html body .modal #dt-assignments {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}
html body .modal .dt-assignment {
  min-width: 0;
  margin: 0;
  padding: 18px 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}
html body .modal .dt-assignment:first-of-type {
  border-top: 0;
  padding-top: 4px;
}
html body .modal .dt-assignment legend {
  float: left;
  width: 100%;
  padding: 0;
  font-size: 15px;
  font-weight: 700;
}
html body .modal .dt-assignment legend + * {
  clear: both;
}
html body .modal .dt-assignment h4 {
  clear: both;
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
html body .modal .dt-assignment .pp-check {
  margin: 0;
}
html body .modal .pp-check.dt-assignment-unavailable {
  opacity: 0.5;
}
html body .modal .dt-assignment,
html body .modal .dt-assignment:first-of-type {
  padding-top: 0;
}

/* Dispositif DT : une infirmerie à la fois.
   Ordinateur : liste d'infirmeries à gauche, détail à droite.
   Mobile : pastilles qui défilent, détail dessous. */
html body .modal .dt-assign-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
html body .modal .dt-assign-tabs {
  display: grid;
  gap: 4px;
  position: sticky;
  top: 0;
}
html body .modal .dt-assign-tab {
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .modal .dt-assign-tab[hidden] {
  display: none;
}
html body .modal .dt-assign-tab b {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
}
html body .modal .dt-assign-tab small {
  font-size: 12.5px;
  color: var(--green);
  font-weight: 600;
}
html body .modal .dt-assign-tab.is-empty small {
  color: var(--faint);
  font-weight: 500;
}
html body .modal .dt-assign-tab:hover {
  background: var(--surface2);
}
html body .modal .dt-assign-tab[aria-selected="true"] {
  border-color: color-mix(in srgb, var(--c-live) 30%, transparent);
  background: color-mix(in srgb, var(--c-live) 9%, var(--surface));
}
html body .modal .dt-assign-tab:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html body .modal .dt-assignment:not(.is-current) {
  display: none;
}
html body .modal .dt-assignment,
html body .modal .dt-assignment:first-of-type {
  padding: 0;
  border: 0;
}
html body .modal .dt-assignment > h4:first-of-type {
  margin-top: 0;
}
@media (max-width: 760px) {
  html body .modal .dt-assign-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  html body .modal .dt-assign-tabs {
    position: static;
    display: flex;
    gap: 8px;
    margin: 0 -18px;
    padding: 0 18px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body .modal .dt-assign-tabs::-webkit-scrollbar {
    display: none;
  }
  html body .modal .dt-assign-tab {
    flex: none;
    width: auto;
    min-height: 52px;
    border-color: var(--line);
  }
}

/* Sélecteur de quantité − / + : même allure que dans les inventaires. */
html body .pp-stepper-field > label {
  font-size: 13px;
  font-weight: 600;
}
html body .pp-stepper {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
html body .pp-stepper:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
html body .pp-step {
  height: 100%;
  min-width: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
html body .pp-step:hover {
  background: var(--active-bg);
  color: var(--active-text);
}
html body .pp-stepper > input.input {
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  outline: none;
  text-align: center;
  font-size: 16px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}
html body .pp-stepper > input::-webkit-inner-spin-button,
html body .pp-stepper > input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
/* Vignette (photo ou icône) en tête d'une ligne à cocher ou cliquable. */
html body .modal .pp-check > .choice-thumb,
html body .modal .pp-link > .choice-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  overflow: hidden;
}
html body .modal .pp-check > .ds-thumb.choice-thumb {
  display: grid;
  place-items: center;
  background: var(--surface2);
}
html body .modal .pp-check > .ds-thumb.choice-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 3px;
}

/* Illustration de connexion (règle reprise de l'ancienne feuille d'onboarding). */
html body .login-art img {
  mix-blend-mode: normal;
}

/* Bouton clair / sombre, même gabarit que la cloche. */
html body .top-actions .theme-button {
  color: var(--muted);
}
html body .top-actions .theme-button:hover {
  color: var(--text);
}

/* Tiroir des notifications : la phrase d'introduction respire sous le trait de l'en-tête,
   et « Mes préférences » a exactement l'allure du sélecteur voisin (sans ombre). */
html body .modal.nt-modal .nt-sub {
  margin: 0;
  padding: 14px 20px 12px;
}
html body .nt-bar .btn.nt-prefs {
  box-shadow: none;
  border: 1px solid var(--line);
  background: var(--surface);
}
html body .nt-bar .btn.nt-prefs:hover {
  background: var(--surface2);
}
@media (max-width: 860px) {
  html body .nt-bar .btn.nt-prefs {
    width: 44px;
    padding: 0;
    justify-content: center;
  }
}
html body .nt-row .nt-new {
  flex: none;
  white-space: nowrap;
}

/* Missions : la légende DPS / PAPS / Autre est centrée sur la barre d'onglets ; masquée sur mobile. */
html body .mission-toolbar {
  align-items: center;
}
html body .mission-toolbar .mission-legend {
  align-self: center;
  margin: 0;
}
@media (max-width: 760px) {
  html body .mission-toolbar .mission-legend {
    display: none;
  }
}
/* Onglet Modèles : une ligne d'explication et le bouton de création. */
html body .mission-models-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}
html body .mission-models-head p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
html body .mission-models-head .btn {
  margin: 0;
}
html body .mission-toolbar {
  margin-bottom: 28px;
}
html body .mission-toolbar > .mission-tabs {
  margin: 0;
}

/* Photo agrandie */
html body .photo-zoom-trigger {
  padding: 0;
  border: 0;
  cursor: zoom-in;
  overflow: hidden;
}
html body .photo-zoom {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 56px 16px calc(24px + env(safe-area-inset-bottom));
  background: rgba(10, 16, 22, 0.88);
  cursor: zoom-out;
  animation: photo-zoom-in 0.15s ease;
}
html body .photo-zoom img {
  max-width: min(100%, 720px);
  max-height: calc(100dvh - 160px);
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
}
html body .photo-zoom p {
  margin: 0;
  color: #fff;
  font-weight: 650;
  text-align: center;
}
html body .photo-zoom-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  cursor: pointer;
}
html body .photo-zoom-close .icon {
  width: 20px;
  height: 20px;
}
@keyframes photo-zoom-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ================================================================
   Assistant « Préparer une mission » : mise en page propre, qui passe
   devant les règles générales des popups (un seul défilement par zone).
   ================================================================ */
html body .modal.ds-wizard {
  width: min(1080px, calc(100vw - 48px));
  max-width: none;
  height: min(800px, calc(100dvh - 48px));
  max-height: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
html body .modal.ds-wizard > .modal-header {
  position: static;
  flex: none;
  margin: 0;
  padding: 18px 24px 16px;
  border-bottom: 1px solid var(--line);
}
html body .modal.ds-wizard .ds-wiz-form {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
}
/* Étapes : trois icônes reliées par un trait, libellé à côté. */
html body .modal.ds-wizard .ds-wiz-steps {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
html body .modal.ds-wizard .ds-wiz-step {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--muted);
  cursor: pointer;
}
html body .modal.ds-wizard .ds-wiz-step:last-child {
  flex: none;
}
html body .modal.ds-wizard .ds-wiz-step:not(:last-child)::after {
  content: "";
  flex: 1;
  min-width: 16px;
  height: 2px;
  margin: 0 14px 0 4px;
  border-radius: 1px;
  background: var(--line);
}
html body .modal.ds-wizard .ds-wiz-step.done:not(:last-child)::after {
  background: var(--green);
}
html body .modal.ds-wizard .ds-wiz-step .num {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--surface2);
  color: var(--muted);
}
html body .modal.ds-wizard .ds-wiz-step .num .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
html body .modal.ds-wizard .ds-wiz-step.active .num {
  background: var(--c-missions);
  color: #fff;
}
html body .modal.ds-wizard .ds-wiz-step.done .num {
  background: var(--green);
  color: #fff;
}
html body .modal.ds-wizard .ds-wiz-step .txt {
  min-width: 0;
  text-align: left;
}
html body .modal.ds-wizard .ds-wiz-step .txt b {
  display: block;
  font-size: 13.5px;
  color: var(--text);
  white-space: nowrap;
}
html body .modal.ds-wizard .ds-wiz-step .txt small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
html body .modal.ds-wizard .ds-wiz-step:not(.active) .txt b {
  color: var(--muted);
  font-weight: 600;
}
/* Corps : contenu qui défile à gauche, récapitulatif fixe à droite (ordinateur). */
html body .modal.ds-wizard .ds-wiz-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  min-height: 0;
}
html body .modal.ds-wizard .ds-wiz-main {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 28px;
}
html body .modal.ds-wizard .ds-wiz-side {
  position: static;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 20px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: var(--surface2);
}
html body .modal.ds-wizard .ds-wiz-form > .modal-footer {
  position: static;
  max-width: none;
  margin: 0;
  padding: 14px 24px;
}
/* Récapitulatif à plat : pas de carte dans le panneau. */
html body .modal.ds-wizard .wz-recap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
html body .modal.ds-wizard .wz-recap-band {
  display: none;
}
html body .modal.ds-wizard .wz-recap-in {
  padding: 0;
}
html body .modal.ds-wizard .wz-recap-type .ds-pill {
  flex: none;
}
html body .modal.ds-wizard .wz-recap-row > div {
  min-width: 0;
}
html body .modal.ds-wizard .wz-recap-row b {
  overflow-wrap: anywhere;
}
@media (max-width: 1100px) {
  html body .modal.ds-wizard .ds-wiz-step .txt small {
    display: none;
  }
}
/* Mobile : feuille montant du bas comme les autres fenêtres (92 % de l'écran), mais de
   hauteur fixe pour que les boutons ne bougent pas d'une étape à l'autre ; pas de
   récapitulatif, libellé seulement pour l'étape en cours. */
@media (max-width: 760px) {
  html body .modal.ds-wizard,
  html body .modal.ds-wizard.modal-wide {
    width: 100%;
    height: 92dvh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
  }
  html body .modal.ds-wizard > .modal-header {
    padding: 14px 16px 12px;
  }
  html body .modal.ds-wizard .ds-wiz-steps {
    padding: 12px 16px;
  }
  html body .modal.ds-wizard .ds-wiz-step:not(.active) .txt {
    display: none;
  }
  html body .modal.ds-wizard .ds-wiz-step:not(:last-child)::after {
    margin: 0 8px 0 2px;
  }
  html body .modal.ds-wizard .ds-wiz-body {
    grid-template-columns: minmax(0, 1fr);
  }
  html body .modal.ds-wizard .ds-wiz-side {
    display: none;
  }
  html body .modal.ds-wizard .ds-wiz-main {
    padding: 16px;
  }
  html body .modal.ds-wizard .ds-wiz-form > .modal-footer {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 760px) {
  html body .modal.ds-wizard .ds-wiz-step.active {
    flex: 2.4;
  }
  html body .modal.ds-wizard .ds-wiz-step .txt {
    overflow: hidden;
  }
  html body .modal.ds-wizard .ds-wiz-step .txt b {
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* Contenu d'un sac ou d'un modèle : une ligne par article, sans tableau. */
html body .modal .pp-items {
  display: grid;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px auto;
  grid-template-areas: "name qty opts";
  align-items: end;
  gap: 12px 14px;
  margin: 0;
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
  min-width: 0;
}
html body .modal :is(#equipment-form, #model-form) .pp-items > .item-edit-row.pp-item:first-child {
  border-top: 0;
  padding-top: 4px;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .item-name {
  grid-area: name;
  display: grid;
  gap: 8px;
  min-width: 0;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-qty {
  grid-area: qty;
  display: grid;
  gap: 8px;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-opts {
  grid-area: opts;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
}
html body .modal .pp-mini {
  position: relative;
  margin: 0;
  cursor: pointer;
}
html body .modal .pp-mini input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html body .modal .pp-mini span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
html body .modal .pp-mini span .icon {
  width: 15px;
  height: 15px;
}
html body .modal .pp-mini input:checked + span {
  border-color: color-mix(in srgb, var(--action-bg) 45%, transparent);
  background: var(--active-bg);
  color: var(--active-text);
}
html body .modal .pp-mini input:focus-visible + span {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .item-trace,
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .source-row {
  margin: 0;
}
@media (max-width: 760px) {
  html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name name"
      "qty opts";
  }
  html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-qty {
    width: 140px;
  }
  html body .modal .pp-mini span {
    padding: 0 10px;
  }
  html body .modal .pp-mini span .icon {
    display: none;
  }
}

html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > * {
  grid-column: auto;
  grid-row: auto;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .item-name {
  grid-area: name;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-qty {
  grid-area: qty;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-opts {
  grid-area: opts;
}

/* Ligne d'article : corbeille à part ; bloc du nom empilé (origine POS sous le champ). */
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item {
  grid-template-columns: minmax(0, 1fr) 150px auto 44px;
  grid-template-areas: "name qty opts del";
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-del {
  grid-area: del;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .item-name {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .item-name > .source-row {
  order: 2;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 760px) {
  html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item {
    grid-template-columns: 140px minmax(0, 1fr) 44px;
    grid-template-areas:
      "name name del"
      "qty opts opts";
  }
  html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-qty {
    width: auto;
  }
  html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-opts {
    justify-content: flex-end;
  }
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-del {
  align-self: start;
  margin-top: var(--pp-label-offset, 25px);
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .item-name .input {
  height: 44px;
  min-height: 44px;
}
/* Tout s'aligne sur le haut des champs : libellés sur une même ligne, options au niveau des champs. */
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item {
  align-items: start;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item > .pp-item-opts {
  margin-top: var(--pp-label-offset, 25px);
}
/* Libellé du sélecteur : même hauteur de ligne que celui des champs voisins. */
html body .pp-stepper-field > label {
  line-height: normal;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .item-name > .label {
  line-height: normal;
}
html body .modal :is(#equipment-form, #model-form) .item-edit-row.pp-item .item-name > .label {
  font-size: 13px;
}
html body .pp-stepper-field > label {
  min-height: 18px;
  line-height: 18px;
}

/* Dates d'un article dans un sac : même ligne que dans l'armoire (passe devant les règles liées au formulaire). */
html body #equipment-dates-form .batch-row.pp-batch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 16px 0;
  border: 0;
  border-top: 1px solid var(--line);
}
html body #equipment-dates-form .pp-batch-main,
html body #equipment-dates-form .pp-batch-extra {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: end;
}
html body #equipment-dates-form .pp-batch-extra > .label:last-child {
  grid-column: 2 / 4;
}
html body #equipment-dates-form .pp-batch .label,
html body #equipment-dates-form .pp-batch .icon-btn {
  grid-column: auto;
  grid-row: auto;
  min-width: 0;
}
html body #equipment-dates-form .pp-batch-extra > .label:last-child {
  grid-column: 2 / 4;
}
html body #equipment-dates-form .pp-batch-main > .icon-btn {
  width: 44px;
  height: 44px;
}
/* Bouton « Ajouter… » d'une liste : à sa taille, aligné à gauche, partout. */
html body .pp-form .btn.pp-add {
  justify-self: start;
  width: auto;
}

/* ================================================================
   Popups pas encore réécrites : leurs anciennes briques prennent
   l'allure du nouveau modèle (un seul niveau de cadre, traits fins).
   ================================================================ */
/* Liste de détails : lignes plates, sans cadre autour. */
html body .modal .details-list {
  border: 0;
  border-radius: 0;
  overflow: visible;
}
html body .modal .details-list > div {
  padding-left: 0;
  padding-right: 0;
}
/* Lignes de liste : trait fin entre les lignes, pas de carte. */
html body .modal .list-row {
  margin: 0;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: none;
  box-shadow: none;
}
html body .modal .list-row:first-of-type {
  border-top: 0;
}
/* Panneaux et cartes imbriqués dans une popup : à plat. */
html body .modal .panel,
html body .modal .card,
html body .modal .summary-cards > div {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  padding-left: 0;
  padding-right: 0;
}
html body .modal .summary-cards {
  gap: 0;
}
html body .modal .summary-cards > div + div {
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
/* Rubriques repliables : même allure que « Plus d'options ». */
html body .modal details.form-section {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
html body .modal details.form-section > summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: var(--active-text);
  cursor: pointer;
}
/* Messages d'information : même allure que l'état d'une fiche. */
html body .modal .notice {
  border: 0;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
}
/* Cases à cocher simples : alignées, cible tactile confortable. */
html body .modal .checkbox-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: 0;
  font-size: 14.5px;
  font-weight: 500;
}
html body .modal .checkbox-label input[type="checkbox"] {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--action-bg);
}
/* Groupes de boutons dans le contenu. */
html body .modal .inline-actions,
html body .modal .row.wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
html body .modal .inline-actions .btn,
html body .modal .row.wrap .btn {
  margin: 0;
}
html body .modal .mt16 {
  margin-top: 12px;
}
html body .modal .mt24 {
  margin-top: 16px;
}
/* Titres internes d'anciennes popups. */
html body .modal h3:not(.pp-section > h3):not(.form-block > h3) {
  font-size: 15px;
}

/* Menus déroulants : une seule allure sur tout le site (champ standard de 44 px). */
html body select.input.vf-select {
  height: 44px;
  min-height: 44px;
  max-width: none;
  padding: 0 36px 0 13px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 500;
}
/* Signalements véhicules : sélecteur d'état et menu des véhicules sur une ligne (empilés sur mobile). */
html body .vf-incident-filters {
  display: flex;
  align-items: center;
  gap: 10px;
}
html body .vf-incident-filters .ds-segs {
  flex: none;
}
html body .vf-incident-filters .ds-seg {
  height: 34px;
}
@media (max-width: 760px) {
  html body .vf-incident-filters {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  html body .vf-incident-filters .ds-segs {
    display: flex;
  }
  html body .vf-incident-filters .ds-seg {
    flex: 1;
    justify-content: center;
  }
  html body select.input.vf-select {
    width: 100%;
  }
}
@media (max-width: 760px) {
  html body .vf-incident-filters .ds-segs {
    width: 100%;
    align-self: stretch;
  }
}
/* Fiche suivie d'un formulaire dans la même popup : séparées par un trait. */
html body .modal .pp-sheet + form.pp-form {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- retours du 23/11 (2) */
/* iOS (Safari et Chrome) zoome sur tout champ de moins de 16 px et ne dézoome pas :
   page agrandie, menu du bas hors de l'écran après la connexion. */
@media (max-width: 760px) {
  html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
    font-size: 16px;
  }
}
/* Préférences : une ligne par alerte, libellé sur toute la largeur, canaux à droite. */
html body .st-pref-row .st-ev-ch {
  order: 0;
  width: auto;
  padding-left: 0;
}
.st-ap-short {
  display: none;
}
@media (max-width: 760px) {
  html body .st-appear {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  html body .st-ap {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 6px;
  }
  html body .st-ap-prev {
    width: auto;
    height: 40px;
  }
  html body .st-ap-label {
    justify-content: center;
  }
  html body .st-ap-long {
    display: none;
  }
  html body .st-ap-short {
    display: inline;
  }
}
/* Informations légales : onglets côte à côte, non collés au-dessus du texte. */
html body .legal-tabs {
  position: static;
}
@media (max-width: 760px) {
  html body .modal.legal-dialog {
    min-height: 70dvh;
  }
  html body .legal-tabs {
    display: flex;
  }
  html body .legal-tabs button {
    flex: 1 1 0;
    text-align: center;
  }
}
/* Notifications : fenêtre comme les autres (feuille par le bas sur mobile), hauteur fixe
   pour que le changement de filtre ne fasse pas sauter la fenêtre. */
html body .modal.nt-modal {
  height: min(680px, 88dvh);
  max-width: 560px;
}
html body .nt-bar {
  padding-top: 14px;
}
html body .nt-bar .ds-segs {
  height: 44px;
  box-sizing: border-box;
  align-items: stretch;
}
html body .nt-bar .btn.nt-prefs {
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
}
@media (max-width: 760px) {
  html body .nt-bar .ds-segs {
    flex: 1;
    display: flex;
  }
  html body .nt-bar .ds-segs .ds-seg {
    flex: 1;
    justify-content: center;
  }
  html body .nt-bar .btn.nt-prefs {
    flex: none;
  }
}
/* Menu du bas : un seul effet sur l'onglet actif (le fond), pas de rond derrière l'icône. */
html body .mobile-nav :is(a, button).active > .icon,
html body .mobile-nav .active .icon {
  background: none;
  box-shadow: none;
}
/* Armoire (mobile) : le chevron est toujours à droite de la ligne, centré, qu'il y ait
   une alerte, des boutons ou rien. */
@media (max-width: 1100px) {
  html body .stock-line {
    position: relative;
    padding-right: 34px;
  }
  html body .stock-line .stock-line-chev {
    display: none;
  }
  html body .stock-line::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    width: 7px;
    height: 7px;
    border-top: 2px solid var(--faint);
    border-right: 2px solid var(--faint);
    transform: translateY(-50%) rotate(45deg);
  }
  html body .stock-line.device-row:not(:has(.stock-line-status .ds-chip)) {
    grid-template-areas: "visual main";
  }
}

/* Prélever : en-tête en simple ligne (pas de cadre dans le cadre), sélecteur à sa taille,
   case « Produits vérifiés » à côté. */
html body .take-form .take-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
}
html body .take-form .take-head h3 {
  margin: 0;
  font-size: 16px;
}
html body .take-form .take-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
html body .take-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
}
html body .take-row .take-qty {
  flex: none;
  margin: 0;
}
html body .take-row .take-stepper {
  display: inline-flex;
  width: auto;
}
html body .take-row .take-stepper input {
  width: 64px;
  flex: none;
}
html body .take-row .take-check {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  display: flex;
  align-items: center;
}
/* Sélecteur à recherche : pastilles retirables + champ, liste sous le champ. */
html body .pp-picker {
  display: grid;
  gap: 8px;
  min-width: 0;
}
html body .pp-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
html body .pp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
html body .pp-chips:empty {
  display: none;
}
html body .pp-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 34px;
  margin: 0;
  padding: 0 4px 0 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
html body .pp-chip > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .pp-chip button {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
html body .pp-chip button:hover {
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
}
html body .pp-chip button .icon {
  width: 14px;
  height: 14px;
}
html body .pp-picker-box {
  position: relative;
}
html body .pp-picker-ico {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--faint);
  pointer-events: none;
}
html body .pp-picker-ico .icon {
  width: 16px;
  height: 16px;
}
html body .pp-picker-q {
  width: 100%;
  padding-left: 38px;
}
html body .pp-picker-list {
  display: grid;
  max-height: 290px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
html body .pp-picker-list[hidden] {
  display: none;
}
html body .pp-picker-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .pp-picker-opt[hidden] {
  display: none;
}
html body .pp-picker-opt + .pp-picker-opt {
  border-top: 1px solid var(--line);
}
html body .pp-picker-opt:hover,
html body .pp-picker-opt:focus-visible {
  background: var(--surface2);
}
html body .pp-picker-opt:disabled {
  opacity: 0.5;
  cursor: default;
}
html body .pp-picker-opt > span {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 1px;
}
html body .pp-picker-opt b {
  font-size: 14px;
}
html body .pp-picker-opt small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .pp-picker-opt > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--faint);
}
html body .pp-picker-none {
  margin: 0;
  padding: 14px;
}
html body .st-people-pick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 10px;
}
@media (max-width: 760px) {
  html body .st-people-pick {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Réglages > Notifications : le dépliant ne fait plus élargir la carte. */
html body .st-ev,
html body .st-ev-more,
html body .st-ev-roles {
  min-width: 0;
  max-width: 100%;
}
html body .st-ev-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Le formulaire prend toute la largeur : fermé, il ne rétrécit plus selon la longueur des textes (DT surtout). */
html body .st-body > .st-notifs {
  align-self: stretch;
  width: 100%;
}
/* Bandeau Missions : chaque tuile tient sur une ligne (« 2 missions », « 6 IS engagés »). */
html body .ds-hero-stat .ds-hs-txt {
  margin: 0;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}
html body .ds-hero-stat .ds-hs-txt b {
  display: inline;
  font-size: 20px;
}
html body .ds-hero-stat .ds-hs-txt span {
  display: inline;
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}
@media (max-width: 760px) {
  html body .ds-hero-stat {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px;
  }
  html body .ds-hero-stat > .ds-hs-ic {
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }
  html body .ds-hero-stat > .ds-hs-ic .icon {
    width: 16px;
    height: 16px;
  }
  html body .ds-hero-stat .ds-hs-txt {
    width: 100%;
  }
  html body .ds-hero-stat .ds-hs-txt b {
    font-size: 17px;
  }
  html body .ds-hero-stat .ds-hs-txt span {
    font-size: 12px;
  }
}

/* Cartes de mission : lieu toujours sur sa ligne (hauteur identique sur un ou deux jours),
   moyens plafonnés (4 vignettes, puis « +N ») et résumé en une ligne. */
html body .mission-card .mission-meta {
  flex-wrap: wrap;
}
html body .mission-card .mission-meta > span:last-child {
  flex-basis: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .mission-card .mc-lots {
  min-width: 0;
  display: grid;
  gap: 8px;
  align-content: center;
}
html body .mission-card .mc-lots small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .mission-card .mc-more {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  flex: none;
  margin-left: -8px;
  border: 2px solid var(--surface);
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}
/* Cartes d'une même rangée à la même hauteur, pied de carte aligné en bas. */
html body .mission-cards {
  align-items: stretch;
}
html body .mission-card .mc-body {
  flex: 1;
}
html body .mission-card .mc-foot {
  margin-top: auto;
}
/* Parc : l'export PDF est dans l'en-tête du carnet, à droite. */
html body .ds-panel-h .vf-export {
  margin-left: auto;
  flex: none;
}
@media (max-width: 760px) {
  html body .ds-panel-h .vf-export {
    width: 40px;
    padding: 0;
    justify-content: center;
  }
  html body .ds-panel-h .vf-export span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}
html body .ds-hero-stat .ds-hs-txt span.hs-short {
  display: none;
}
@media (max-width: 760px) {
  html body .ds-hero-stats {
    gap: 8px;
  }
  html body .ds-hero-stat {
    padding: 9px 8px;
  }
  html body .ds-hero-stat .ds-hs-txt span {
    font-size: 11.5px;
  }
  html body .ds-hero-stat .ds-hs-txt span.hs-long {
    display: none;
  }
  html body .ds-hero-stat .ds-hs-txt span.hs-short {
    display: inline;
  }
}
/* Onglets Missions (mobile) : les quatre tiennent sans défiler (pas d'icône, compteur
   seulement sur l'onglet actif). */
@media (max-width: 760px) {
  html body .ds-segs.mission-tabs {
    display: flex;
    overflow: hidden;
  }
  html body .ds-segs.mission-tabs .ds-seg {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
    padding: 0 6px;
    gap: 5px;
    font-size: 13px;
  }
  html body .ds-segs.mission-tabs .ds-seg > .icon,
  html body .ds-segs.mission-tabs .ds-seg:not([aria-pressed="true"]) .ds-count {
    display: none;
  }
}
/* Notifications : liste à plat, séparée par un trait fin ; non lue = point bleu + titre gras. */
html body .modal.nt-modal .nt-list {
  padding: 0 20px;
}
html body .modal.nt-modal .nt-row {
  gap: 14px;
  padding: 16px 0;
  border-radius: 0;
  background: none;
}
html body .modal.nt-modal .nt-row + .nt-row {
  border-top: 1px solid var(--line);
}
html body .modal.nt-modal .nt-row:hover {
  background: none;
}
html body .modal.nt-modal .nt-row:hover b {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}
html body .nt-main {
  gap: 4px;
}
html body .nt-label {
  font-size: 12.5px;
}
html body .nt-main b {
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.4;
}
html body .nt-row.unread .nt-main b {
  font-weight: 700;
}
html body .nt-main small {
  font-size: 12.5px;
}
html body .nt-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--blue);
}
html body .nt-row > .icon {
  margin-top: 12px;
}
/* ---------------------------------------------------------------- retours du 23/11 (3) */
/* Sur mobile, toutes les fenêtres s'ouvrent en feuille sur toute la largeur. */
@media (max-width: 760px) {
  html body .modal-backdrop > .modal {
    max-width: none !important;
  }
}
/* Notifications : même gabarit que les autres fenêtres (marges, traits pleine largeur),
   séparateurs en pointillés légers entre les notifications. */
html body .modal.nt-modal {
  max-width: 580px;
  padding: 0 26px;
}
html body .modal.nt-modal > .modal-header {
  margin: 0 -26px;
  padding: 20px 20px 16px 26px;
  border-bottom: 1px solid var(--line);
}
html body .modal.nt-modal .nt-bar {
  margin: 0 -26px;
  padding: 16px 26px;
  border-bottom: 0;
}
html body .modal.nt-modal .nt-list {
  padding: 0;
  border-top: 1px solid var(--line);
}
html body .modal.nt-modal .nt-row + .nt-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 85%, var(--muted));
}
html body .modal.nt-modal .nt-foot {
  margin: 0 -26px;
  padding: 12px 26px calc(12px + env(safe-area-inset-bottom));
}
@media (max-width: 760px) {
  html body .modal.nt-modal {
    height: 88dvh;
  }
}

/* Bas des fenêtres sans pied : un vrai espace (le padding du bas d'une zone qui défile
   n'est pas toujours respecté). */
html body .modal:not(:has(.modal-footer)) {
  padding-bottom: 0;
}
html body .modal:not(:has(.modal-footer, .nt-foot))::after {
  content: "";
  display: block;
  height: 24px;
}
/* Ligne simple (texte + bouton) dans une rubrique de fenêtre. */
html body .pp-plain-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
html body .pp-plain-row + .pp-plain-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 85%, var(--muted));
}
html body .pp-plain-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
html body .pp-plain-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .pp-row-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
html body .vehicle-access .guest-qr {
  display: grid;
  justify-items: center;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
}
/* Carnet : une ligne par déplacement, séparées par des pointillés légers. */
html body .vf-log-modal .vf-log {
  display: grid;
  gap: 0;
}
html body .vf-log-row {
  display: grid;
  gap: 4px;
  padding: 14px 0;
}
html body .vf-log-row + .vf-log-row {
  border-top: 1px dashed color-mix(in srgb, var(--line) 85%, var(--muted));
}
html body .vf-log-row-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
html body .vf-log-row-h b {
  font-size: 15px;
}
html body .vf-log-row small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}
html body .vf-log-row small .icon {
  flex: none;
  width: 14px;
  height: 14px;
}
html body .vf-log-row small.warn-text {
  color: var(--amber-strong);
}
/* ================================================================ Ma mission (maquette validée) */
html body .me-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 20px;
  border-top: 4px solid var(--hue);
}
html body .me-banner-info {
  flex: 1;
  min-width: 0;
}
html body .me-banner h2 {
  margin: 4px 0 8px;
  font-size: 21px;
  line-height: 1.25;
}
html body .me-banner .mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--muted);
  font-size: 13.5px;
}
html body .me-banner .mission-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html body .me-banner .mission-meta .icon {
  width: 15px;
  height: 15px;
}
html body .me-progress {
  flex: none;
  width: 240px;
  display: grid;
  gap: 8px;
}
html body .me-progress b {
  font-size: 13.5px;
}
html body .me-workspace {
  margin-top: 18px;
}
html body .me-group + .me-group {
  margin-top: 18px;
}
html body .me-group-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 10px;
}
html body .me-group-h h2 {
  margin: 0;
  font-size: 15px;
}
html body .me-group-h small {
  color: var(--muted);
  font-size: 12.5px;
  text-align: right;
}
html body .me-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
html body .me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  margin: 0;
  padding: 11px 16px;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .me-row + .me-row {
  border-top: 1px solid var(--line);
}
html body button.me-row:hover {
  background: var(--surface2);
}
html body .me-row:disabled {
  cursor: default;
  opacity: 0.75;
}
html body .me-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
html body .me-thumb :is(img, picture) {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
html body .me-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
html body .me-main b {
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .me-main small {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .me-main small .icon {
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
}
html body .me-main .me-warn {
  color: var(--amber-strong);
}
html body .me-main .me-ok {
  color: var(--green);
}
html body .me-row > .ds-chip {
  flex: none;
}
html body .ds-chip.todo {
  background: var(--surface);
  color: var(--action-bg);
  border: 1px solid color-mix(in srgb, var(--action-bg) 30%, var(--line));
}
html body .me-row > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--faint);
}
/* Véhicule : même tuile que le parc. */
html body .me-vehicle {
  display: grid;
  gap: 12px;
  padding: 16px;
}
html body .me-veh-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
html body .me-veh-thumb {
  flex: none;
  width: 64px;
  height: 48px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--c-vehicules);
  display: grid;
  place-items: center;
  overflow: hidden;
}
html body .me-veh-thumb :is(img, picture) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
html body .me-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .me-facts > div {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface2);
}
html body .me-facts small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
html body .me-facts b {
  font-size: 14px;
}
html body .me-gauge {
  display: flex;
  gap: 3px;
  margin-top: 5px;
}
html body .me-gauge i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}
html body .me-gauge i.on {
  background: var(--green);
}
html body .me-gauge.mid i.on {
  background: #e3b11c;
}
html body .me-gauge.low i.on {
  background: var(--red);
}
html body .me-trip {
  margin: 0;
}
html body .me-vehicle .btn {
  margin: 0;
}
html body .me-team {
  padding: 16px;
}
html body .me-actions {
  display: grid;
  padding: 0;
  overflow: hidden;
}
html body .me-action {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 8px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .me-action + .me-action {
  border-top: 1px solid var(--line);
}
html body .me-action:hover {
  background: var(--surface2);
}
html body .me-action b {
  flex: 1;
  font-size: 14.5px;
  font-weight: 600;
}
html body .me-action-ic {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--surface2);
  color: var(--muted);
}
html body .me-action-ic .icon {
  width: 16px;
  height: 16px;
}
html body .me-action > .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
html body .me-action.is-end b {
  color: var(--red);
}
@media (max-width: 760px) {
  html body .me-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 16px;
  }
  html body .me-banner h2 {
    font-size: 18px;
  }
  html body .me-progress {
    width: auto;
  }
  html body .me-group-h {
    flex-direction: column;
    gap: 2px;
  }
  html body .me-group-h small {
    text-align: left;
  }
  html body .me-row {
    padding: 11px 14px;
  }
}

/* ================================================================ Inventaire (maquette validée) */
html body .inventory-heading {
  margin-top: 6px;
}
@media (max-width: 760px) {
  html body .inventory-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 14px;
  }
  html body .inventory-heading .inventory-cover {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 12px;
  }
  html body .inventory-heading h1 {
    margin: 0;
    font-size: 17px;
    line-height: 1.25;
  }
  html body .inventory-heading .eyebrow,
  html body .inventory-heading p {
    margin: 0;
    font-size: 12.5px;
  }
  /* Progression sur une ligne : compteur, barre, état d'enregistrement. */
  html body .inventory-progress {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
  }
  html body .inventory-progress > div:first-child span {
    display: none;
  }
  html body .inventory-progress > div:first-child strong {
    font-size: 14px;
    white-space: nowrap;
  }
  html body .inventory-progress .inventory-save-state {
    margin: 0;
    font-size: 12px;
  }
  /* Rubriques : pastilles défilantes avec leur avancement, à la place de la liste déroulante. */
  html body #check-form .inventory-layout-choice,
  html body #check-form .inventory-group-picker {
    display: none;
  }
  html body #check-form .inventory-group-tabs {
    display: flex;
    gap: 6px;
    margin: 0 -16px 12px;
    padding: 0 16px 2px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  html body #check-form .inventory-group-tabs .btn {
    flex: none;
    min-height: 36px;
    margin: 0;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 13px;
    box-shadow: none;
  }
  html body #check-form .inventory-group-tabs .btn .icon {
    display: none;
  }
  html body #check-form .inventory-group-tabs .btn.active {
    background: var(--action-bg);
    border-color: var(--action-bg);
    color: #fff;
  }
  html body #check-form .inventory-group-tabs .btn.is-done:not(.active) {
    background: var(--green-soft);
    border-color: color-mix(in srgb, var(--green) 25%, var(--line));
    color: var(--green);
  }
  html body #check-form .ig-count {
    margin-left: 5px;
    font-weight: 600;
    opacity: 0.85;
  }
  html body #check-form.inventory-paged .inventory-section > header {
    display: none;
  }
  html body #check-form .inventory-section > header p {
    display: none;
  }
  html body #check-form .inventory-section {
    padding: 0;
    overflow: hidden;
  }
  html body #check-form .inventory-section-controls {
    display: none;
  }
}
@media (max-width: 760px) {
/* Ligne d'article : intitulé sur toute la largeur, puis « Attendu · manque », sélecteur, coche. */
  html body #check-form .inventory-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "name name name"
    "meta qty tick"
    "more more more";
  align-items: center;
  gap: 8px 10px;
  padding: 12px 16px;
}
  html body #check-form .inventory-line + .inventory-line {
  border-top: 1px solid var(--line);
}
  html body #check-form .inventory-line .inventory-item {
  display: contents;
}
  html body #check-form .inventory-line h3 {
  grid-area: name;
  margin: 0;
  font-size: 14.5px;
  line-height: 1.3;
}
  html body #check-form .inventory-line .inventory-item-meta {
  grid-area: meta;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12.5px;
}
  html body #check-form .inventory-line .inventory-item-meta > span + span:not([hidden])::before {
  content: " · ";
}
  html body #check-form .inventory-line .inventory-variance {
  color: var(--amber-strong);
}
  html body #check-form .inventory-line .material-origins,
  html body #check-form .inventory-line .check-expiry {
  grid-area: more;
  margin: 0;
}
  html body #check-form .inventory-line .check-quantity {
  grid-area: qty;
  margin: 0;
}
  html body #check-form .inventory-line .inventory-tick {
  grid-area: tick;
  margin: 0;
}
}
/* Barre du bas : enregistrer (icône), rubrique suivante, récapitulatif. */
html body #check-form .check-actions .check-next {
  display: none;
}
html body #check-form.inventory-paged .check-actions .check-next {
  display: inline-flex;
}
@media (max-width: 760px) {
  html body #check-form .check-actions {
    display: flex;
    gap: 8px;
  }
  html body #check-form .check-actions .btn {
    flex: 1;
    margin: 0;
  }
  html body #check-form .check-actions [data-action="check-save"] {
    flex: none;
    width: 44px;
    padding: 0;
  }
  html body #check-form .check-actions [data-action="check-save"] span {
    display: none;
  }
}
/* Ordre de la page mission : équipements, puis véhicule, équipe, actions. */
html body .me-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  align-items: start;
  gap: 18px;
}
html body .me-workspace > .mission-equipment-groups {
  order: 0;
}
html body .me-workspace > .mission-aside {
  order: 1;
  position: static;
  display: grid;
  gap: 12px;
}
html body .me-workspace > .mission-aside > * {
  order: 0;
  margin: 0;
}
html body .me-banner .mission-type-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--hue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
html body .me-banner .mission-type-label .icon {
  width: 15px;
  height: 15px;
}
@media (max-width: 960px) {
  html body .me-workspace {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* L'ancienne carte .mission-equipment ne doit plus rien imposer à la ligne. */
html body .me-list > .me-row.mission-equipment {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  height: auto;
  max-width: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  transform: none;
}
html body .me-list > .me-row.mission-equipment + .me-row {
  border-top: 1px solid var(--line);
}
html body .mission-aside > .panel.me-actions {
  padding: 0;
}
html body .mission-aside > .panel.me-team,
html body .mission-aside > .panel.me-vehicle {
  padding: 16px;
}
@media (max-width: 760px) {
  html body #check-form.inventory-workspace .inventory-group-tabs {
    display: flex;
  }
}
@media (max-width: 760px) {
/* Sélecteur compact et coche alignée sur la même ligne que « Attendu ». */
  html body #check-form .inventory-line .check-stepper {
  height: 42px;
}
  html body #check-form .inventory-line .check-step {
  width: 38px;
  min-width: 38px;
  height: 100%;
}
  html body #check-form .inventory-line .check-count {
  width: 50px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  text-align: center;
}
  html body #check-form .inventory-line .inventory-tick {
  display: grid;
  place-items: center;
  align-self: center;
  width: 42px;
  height: 42px;
}
  html body #check-form .inventory-line .check-stepper {
  grid-template-columns: 38px 50px 38px;
  width: auto;
}
  html body #check-form .inventory-line .check-quantity {
  width: auto;
}
}
@media (max-width: 760px) {
  /* Compteur, barre et « Enregistré » sur une seule ligne, alignés au centre. */
  html body .inventory-progress {
    grid-template-columns: auto 1fr auto;
    align-items: center;
  }
  html body .inventory-progress .inventory-save-state {
    grid-column: auto;
    white-space: nowrap;
  }
  html body .inventory-progress .inventory-progress-track {
    margin: 0;
  }
}

/* ================================================================ Accueil d'une infirmerie DT (QR) */
html body .dtp-progress {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 12px;
  margin-top: 8px;
}
html body .dtp-progress .dtp-score {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
html body .dtp-progress .dtp-score b {
  font-size: 16px;
}
html body .dtp-progress .dtp-score small {
  color: var(--muted);
  font-size: 13px;
}
html body .dtp-progress .dtp-progress-bar {
  grid-column: 1 / -1;
}
html body .dtp-eq-list {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
html body .dtp-eq.dtp-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 68px;
  margin: 0;
  padding: 11px 14px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .dtp-eq.dtp-row + .dtp-eq.dtp-row {
  border-top: 1px solid var(--line);
}
html body .dtp-eq.dtp-row:hover {
  background: var(--surface2);
}
html body .dtp-row .dtp-eq-art {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
html body .dtp-row .dtp-eq-art :is(img, svg, picture) {
  max-width: 100%;
  max-height: 100%;
}
html body .dtp-row-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
html body .dtp-row-main b {
  font-size: 14.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .dtp-row-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .dtp-row > .ds-chip {
  flex: none;
}
html body .dtp-row > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--faint);
}

/* ---------------------------------------------------------------- inventaire, retours (4) */
/* Liseré : petite barre arrondie en retrait des coins ; verte si conforme, ambre si écart. */
html body #check-form .inventory-line {
  position: relative;
}
html body #check-form .inventory-line.is-verified::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--green);
}
html body #check-form .inventory-line.is-verified.has-shortage::before {
  background: var(--amber-strong);
}
html body #check-form .inventory-tick input:checked + span {
  background: var(--green);
  border-color: var(--green);
}
/* Rubriques (mobile) : barre collante, fondu au bord droit, la rubrique s'arrête sous la barre. */
@media (max-width: 760px) {
  html body #check-form.inventory-workspace .inventory-group-tabs {
    position: sticky;
    top: var(--topbar-h, 56px);
    z-index: 5;
    margin: 0 -16px 12px;
    padding: 10px 28px 10px 16px;
    background: var(--bg);
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent);
  }
  html body #check-form .inventory-section {
    scroll-margin-top: calc(var(--topbar-h, 56px) + 70px);
  }
}
/* Barre du bas : Pause (icône) · Terminer · Rubrique suivante (principal, à droite).
   Sur la dernière rubrique, « Suivante » disparaît et « Terminer » redevient principal. */
html body #check-form .check-actions .check-next:disabled {
  display: none;
}
html body #check-form.inventory-paged .check-actions:has(.check-next:not(:disabled)) button[type="submit"] {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
}
html body #check-form.inventory-paged .check-actions:has(.check-next:not(:disabled)) button[type="submit"] .icon {
  display: none;
}
html body #check-form .check-actions .check-next {
  background: var(--action-bg);
  border-color: var(--action-bg);
  color: #fff;
}

/* ================================================================ Armoire, retours (4) */
html body .stock-line-qty-inline {
  display: none;
}
html body .stock-line-qty-inline b {
  color: var(--text);
}
/* Tuiles : icône à gauche, chiffre et libellé à côté (moitié moins hautes). */
html body .ds-tile.stock-tile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 14px 16px;
}
html body .ds-tile.stock-tile .ds-tile-body {
  display: grid;
  gap: 1px;
  min-width: 0;
}
html body .ds-tile.stock-tile .ds-tile-body b {
  font-size: 22px;
  line-height: 1.1;
}
@media (max-width: 1100px) {
  /* Ligne : icône · nom + « 48 en stock · Péremption » + pastille · Je prends · chevron. */
  html body .stock-line-qty-inline {
    display: inline;
  }
  html body .stock-line:not(.device-row) .stock-line-qty {
    display: none;
  }
  html body .stock-line,
  html body .stock-line.device-row:not(:has(.stock-line-status .ds-chip)) {
    grid-template-columns: 36px minmax(0, 1fr) auto;
    grid-template-areas:
      "visual main act"
      "visual status act";
    align-items: center;
    row-gap: 6px;
  }
  html body .stock-line .stock-line-visual {
    align-self: center;
  }
  html body .stock-line .stock-line-foot,
  html body .stock-line .stock-line-foot:not(:has(.ds-chip)):not(:has(.btn, .icon-btn)) {
    display: contents;
  }
  html body .stock-line .stock-line-status {
    grid-area: status;
    display: flex;
    min-width: 0;
  }
  html body .stock-line .stock-line-status:not(:has(.ds-chip)) {
    display: none;
  }
  html body .stock-line .stock-line-actions {
    grid-area: act;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
  }
  html body .stock-line .stock-line-actions:empty {
    display: none;
  }
  html body .stock-line .stock-line-actions .btn {
    margin: 0;
  }
}
@media (max-width: 760px) {
  html body .ds-tile.stock-tile {
    padding: 12px;
    gap: 10px;
  }
  html body .ds-tile.stock-tile .ds-tile-body b {
    font-size: 19px;
  }
  html body .ds-tile.stock-tile .ds-tile-body strong {
    font-size: 13px;
    line-height: 1.25;
  }
  html body .ds-tile.stock-tile .ds-tile-body small {
    font-size: 11.5px;
  }
}
@media (max-width: 1100px) {
  html body .stock-line .stock-line-meta {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    display: block;
  }
}
@media (max-width: 760px) {
  html body .ds-tile.stock-tile {
    align-items: flex-start;
  }
  html body .ds-tile.stock-tile > .ds-pill {
    width: 34px;
    height: 34px;
    flex: none;
  }
}

/* ================================================================ Boutons : un seul gabarit fin */
/* Même hauteur pour les boutons principaux et secondaires (40 px, 34 px pour les petits),
   trait d'1 px sans ombre pour les secondaires, bordure transparente pour les principaux. */
html body .btn,
html body .modal .modal-footer .btn,
html body .page-heading .page-heading-actions > .btn,
html body .page-heading .page-heading-actions > a.btn {
  min-height: 40px;
  font-size: 13.5px;
  border: 1px solid transparent;
  box-shadow: none;
}
html body .btn.secondary,
html body .modal .modal-footer .btn.secondary {
  border-color: var(--line);
  box-shadow: none;
}
html body .btn.sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 13px;
}
html body .nt-bar .ds-segs,
html body .nt-bar .btn.nt-prefs {
  height: 40px;
  min-height: 40px;
}
@media (max-width: 760px) {
  html body .page-heading .page-heading-actions > .btn:not(.pdf-export),
  html body .page-heading .page-heading-actions > a.btn {
    min-height: 40px;
  }
  html body .page-heading .page-heading-actions > .btn.pdf-export {
    flex-basis: 40px;
    width: 40px;
    min-height: 40px;
  }
}
html body #check-form .inventory-line.has-shortage .inventory-tick input:checked + span {
  background: var(--amber-strong);
  border-color: var(--amber-strong);
}
@media (max-width: 760px) {
  html body #check-form .inventory-line .inventory-item-meta {
    white-space: normal;
    overflow: visible;
  }
}

/* ================================================================ Récapitulatif d'inventaire */
html body .inventory-review.rv {
  max-width: 1100px;
  margin: 8px 0 0;
  text-align: left;
}
html body .rv-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}
html body .rv-col {
  display: grid;
  gap: 16px;
  min-width: 0;
}
html body .rv-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
}
html body .rv-status.warn {
  background: var(--amber-soft, #fdf3e1);
}
html body .rv-status.ok {
  background: var(--green-soft);
}
html body .rv-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 999px;
}
html body .rv-status.warn .rv-ic {
  background: color-mix(in srgb, var(--amber-strong) 18%, transparent);
  color: var(--amber-strong);
}
html body .rv-status.ok .rv-ic {
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green);
}
html body .rv-ic .icon {
  width: 18px;
  height: 18px;
}
html body .rv-status b {
  display: block;
  font-size: 15.5px;
}
html body .rv-status small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}
html body .rv-sec h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 2px 8px;
  font-size: 14px;
}
html body .rv-sec h3 small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
html body .rv-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
html body .rv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin: 0;
  padding: 10px 14px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
}
html body button.rv-row {
  cursor: pointer;
}
html body button.rv-row:hover {
  background: var(--surface2);
}
html body .rv-row + .rv-row {
  border-top: 1px solid var(--line);
}
html body .rv-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
html body .rv-main b {
  font-size: 14.5px;
}
html body .rv-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .rv-row > .ds-chip {
  flex: none;
}
html body .rv-row > .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--faint);
}
html body .rv-note {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  white-space: pre-line;
}
html body .rv-side {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
html body .rv-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .rv-facts > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
}
html body .rv-facts small {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
}
html body .rv-facts b {
  font-size: 17px;
}
html body .rv-buttons {
  display: grid;
  gap: 8px;
}
html body .rv-buttons .btn {
  width: 100%;
  margin: 0;
}
html body .rv-buttons-row {
  display: flex;
  gap: 8px;
}
html body .rv-side .rv-actions {
  border: 0;
  border-radius: 0;
}
html body .rv-side .rv-actions .rv-row {
  padding-left: 0;
  padding-right: 0;
  min-height: 48px;
}
@media (max-width: 960px) {
  html body .rv-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }
  html body .rv-col,
  html body .rv-side {
    display: contents;
  }
  html body .rv-status {
    order: 1;
  }
  html body .rv-facts {
    order: 2;
  }
  html body .rv-col > .rv-sec,
  html body .rv-col > .form-error {
    order: 3;
  }
  html body .rv-side .rv-actions {
    order: 4;
    border: 1px solid var(--line);
    border-radius: 16px;
  }
  html body .rv-side .rv-actions .rv-row {
    padding: 10px 14px;
  }
  html body .rv-facts > div {
    background: var(--surface);
    border: 1px solid var(--line);
  }
  /* Boutons toujours visibles en bas, au-dessus du menu. */
  html body .rv-buttons {
    order: 9;
    position: sticky;
    bottom: 76px;
    z-index: 4;
    margin: 4px -16px 0;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
}

/* ================================================================ Récupérer les manquants */
html body .rs-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0 18px;
}
html body .rs-head h1 {
  margin: 0;
  font-size: 20px;
}
html body .rs-head small {
  color: var(--muted);
  font-size: 13px;
}
html body .rs-form {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}
html body .rs-sec {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 8px;
  font-size: 14px;
}
html body .rs-form .rs-sec {
  margin-bottom: -4px;
}
html body .rs-sec small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}
html body .rs-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
html body .rs-item {
  display: grid;
  gap: 8px;
  padding: 12px 16px;
}
html body .rs-item + .rs-item,
html body .rs-row + .rs-row {
  border-top: 1px solid var(--line);
}
html body .rs-item > b {
  font-size: 14.5px;
}
html body .rs-r2 {
  display: flex;
  align-items: center;
  gap: 10px;
}
html body .rs-r2 small {
  flex: 1;
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
}
html body .rs-step {
  flex: none;
  width: auto;
}
html body .rs-step .input {
  width: 52px;
}
html body .rs-detail {
  justify-self: start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--action-bg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
html body .rs-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
}
html body button.rs-row {
  cursor: pointer;
}
html body .rs-main {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
html body .rs-main b {
  font-size: 14.5px;
}
html body .rs-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .rs-row > .ds-chip {
  flex: none;
}
html body .rs-row > .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
html body .rs-check {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--amber-soft, #fdf3e1);
  font-weight: 600;
  font-size: 13.5px;
}
html body .rs-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
html body .rs-foot .btn {
  margin: 0;
}
@media (max-width: 760px) {
  html body .rs-foot {
    position: sticky;
    bottom: 76px;
    z-index: 4;
    margin: 0 -16px;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  html body .rs-foot .btn {
    flex: 1;
  }
  html body .rs-foot .btn[type="submit"] {
    flex: 2;
  }
}
html body .rs-r2 .pp-stepper.rs-step {
  display: inline-flex;
  flex: none;
  width: auto;
  height: 40px;
}
html body .rs-r2 .pp-stepper.rs-step .pp-step {
  width: 38px;
  min-width: 38px;
  height: 100%;
}
html body .rs-r2 .pp-stepper.rs-step .input {
  width: 52px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  text-align: center;
}
/* Récapitulatif et manquants en fenêtre : pas de colonne latérale, boutons dans le pied. */
html body .modal.rv-modal .inventory-review.rv {
  margin: 0;
}
html body .modal.rv-modal .rv-wrap {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
html body .modal.rv-modal .rv-col,
html body .modal.rv-modal .rv-side {
  display: contents;
}
html body .modal.rv-modal .rv-status { order: 1; }
html body .modal.rv-modal .rv-facts { order: 2; }
html body .modal.rv-modal .rv-col > .rv-sec,
html body .modal.rv-modal .rv-col > .form-error { order: 3; }
html body .modal.rv-modal .rv-side .rv-actions {
  order: 4;
  border: 1px solid var(--line);
  border-radius: 16px;
}
html body .modal.rv-modal .rv-side .rv-actions .rv-row {
  padding: 10px 14px;
}
html body .modal.rv-modal .rv-facts > div {
  background: var(--surface2);
  border: 0;
}
html body .modal.rv-modal .rv-buttons {
  order: 9;
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin: 4px -26px 0;
  padding: 14px 26px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
}
html body .modal.rs-modal .rs-form {
  gap: 14px;
}
html body .modal.rs-modal .rs-context {
  margin: 0;
}
html body .modal.rs-modal .rs-block {
  display: grid;
  gap: 10px;
}
html body .modal.rs-modal .rs-sec {
  margin: 0 2px;
}
html body .modal.rs-modal .restock-conclusion {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
}
html body .modal.rs-modal .restock-conclusion h2 {
  margin: 0 0 4px;
  font-size: 15px;
}
/* ================================================================ Retour de mission */
html body .rt-progress {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
}
html body .rt-progress .return-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
html body .rt-progress .return-progress-head strong {
  font-size: 15px;
}
html body .rt-sec {
  margin: 20px 2px 8px;
  font-size: 14px;
}
html body .rt-list {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}
html body .rt-bag {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
}
html body .rt-bag + .rt-bag,
html body .rt-line + .rt-line {
  border-top: 1px solid var(--line);
}
html body .rt-bag .return-bag-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 16px;
}
html body .rt-thumb {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface2);
  overflow: hidden;
  display: grid;
  place-items: center;
}
html body .rt-thumb :is(img, picture) {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
html body .rt-main {
  flex: 1;
  min-width: 0;
  display: grid;
  justify-items: start;
  gap: 4px;
}
html body .rt-main b {
  font-size: 14.5px;
}
html body .rt-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .rt-acts {
  display: flex;
  flex: none;
  gap: 6px;
}
html body .rt-acts .btn {
  margin: 0;
}
html body .rt-bag .return-bag-editor:empty,
html body .rt-bag .return-conflict:empty {
  display: none;
}
html body .rt-bag .return-conflict {
  padding: 0 16px 12px;
}
html body .rt-line {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .rt-line:hover {
  background: var(--surface2);
}
html body .rt-line-ic {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--c-vehicules);
}
html body .rt-line > .icon {
  width: 16px;
  height: 16px;
  color: var(--faint);
}
html body .rt-summary {
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
}
html body .rt-summary p {
  margin: 4px 0;
}
html body .rt-summary strong {
  color: var(--text);
}
html body .rt-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
html body .rt-foot .btn {
  margin: 0;
}
html body .rt-form .rt-results:empty {
  display: none;
}
html body .rt-form .rt-results {
  display: grid;
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}
html body .rt-form .rt-results .pp-picker-opt + .pp-picker-opt {
  border-top: 1px solid var(--line);
}
html body .rt-used {
  display: grid;
}
html body .rt-used:empty::before {
  content: "Aucun consommable ajouté.";
  color: var(--muted);
  font-size: 13px;
}
html body .rt-used-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}
html body .rt-used-row + .rt-used-row {
  border-top: 1px solid var(--line);
}
html body .rt-used-row .return-used-name {
  flex: 1;
  min-width: 0;
}
@media (max-width: 760px) {
  html body .rt-bag .return-bag-bar {
    flex-wrap: wrap;
  }
  html body .rt-acts {
    flex-basis: 100%;
    padding-left: 60px;
  }
  html body .rt-acts .btn {
    flex: 1;
  }
  html body .rt-foot {
    position: sticky;
    bottom: 76px;
    z-index: 4;
    margin: 14px -16px 0;
    padding: 12px 16px;
    background: var(--surface);
    border-top: 1px solid var(--line);
  }
  html body .rt-foot .btn {
    flex: 1;
  }
}
@media (max-width: 760px) {
  html body .rt-bag:not(:has(.rt-acts .btn + .btn)) .return-bag-bar {
    flex-wrap: nowrap;
  }
  html body .rt-bag:not(:has(.rt-acts .btn + .btn)) .rt-acts {
    flex-basis: auto;
    padding-left: 0;
  }
}
/* Bandeau Missions : retours en attente, une ligne discrète sous les chiffres. */
html body .ds-hero .ds-hero-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 560px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 196, 84, 0.22);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
html body .ds-hero .ds-hero-alert:hover {
  background: rgba(255, 196, 84, 0.32);
}
html body .ds-hero .ds-hero-alert > span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .ds-hero .ds-hero-alert .icon {
  flex: none;
  width: 16px;
  height: 16px;
  color: #ffd27a;
}

/* Départ / retour d'un véhicule : carburant sans cadre (pas de cadre dans la fenêtre). */
html body .vf-trip .vf-field.fuel-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
html body .vf-trip .vf-field.fuel-field > legend {
  padding: 0;
  margin-bottom: 8px;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  font-weight: 600;
}
/* Réglages > Installation : actions en lignes (pas de cadre par action dans la carte). */
html body .st-tools {
  display: grid;
  gap: 0;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
html body .st-tools .st-tool {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  margin: 0;
  padding: 8px 14px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--surface);
}
html body .st-tools .st-tool + .st-tool {
  border-top: 1px solid var(--line);
}
html body .st-tools .st-tool:hover {
  background: var(--surface2);
}
html body .st-tools .st-tool::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-top: 2px solid var(--faint);
  border-right: 2px solid var(--faint);
  transform: rotate(45deg);
  flex: none;
}

html body .pp-plain {
  display: grid;
}
html body .pp-plain-row .icon-btn {
  flex: none;
}
html body .modal .rs-r2 .label {
  flex: 1;
  margin: 0;
}
html body .modal .rs-r2 .btn {
  align-self: flex-end;
  margin: 0;
}

/* Journal : filtres repliés ; base de données : les deux chiffres côte à côte. */
html body .modal .audit-more {
  margin: 4px 0 8px;
}
html body .modal .audit-filters .inline-actions {
  display: flex;
  gap: 8px;
}
html body .modal .database-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .modal .database-summary > div {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface2);
}
html body .modal .database-summary strong {
  display: block;
  font-size: 18px;
}
html body .modal .database-summary p,
html body .modal .database-summary span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

/* Matériel de l'UL (vue IS) : accès armoire en ligne, recherche, sacs en lignes. */
html body .terrain-cta {
  width: 100%;
  margin: 4px 0 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-decoration: none;
}
html body .terrain-search {
  margin-bottom: 12px;
}
html body .me-list > .me-row[hidden] {
  display: none;
}

/* Réglages > Modèles de contenu : une ligne par modèle, « Appliquer… » à droite si utile. */
html body .model-rows .model-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 12px;
}
html body .model-rows .model-row + .model-row {
  border-top: 1px solid var(--line);
}
html body .model-rows .model-row .me-row {
  flex: 1;
  min-width: 0;
}
html body .model-rows .model-apply-btn {
  flex: none;
  margin: 0;
}
html body .model-rows .me-main b,
html body .model-rows .me-main small {
  white-space: normal;
  overflow: visible;
}

/* Choix unique en segments (ppSeg) : hauteur et rayon d'un champ, aucun cadre autour. */
html body .pp-seg-field,
html body .modal fieldset.pp-seg-field {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
html body .pp-seg-field > legend,
html body .modal fieldset.pp-seg-field > legend {
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
html body .pp-seg {
  display: flex;
  gap: 4px;
  height: 45px;
  padding: 3px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
html body .pp-seg > label {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
}
html body .pp-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html body .pp-seg span {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0 6px;
  border-radius: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}
html body .pp-seg label:hover span {
  color: var(--text);
}
html body .pp-seg input:checked + span {
  background: color-mix(in srgb, var(--hue, var(--action-bg)) 12%, var(--surface));
  color: var(--hue, var(--active-text));
}
html body .pp-seg label:has(input:focus-visible) span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
html body .pp-seg label:has(input:disabled) span {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Départ / retour : contexte sur une ligne discrète, relevé sans icône. */
html body .vf-trip .vf-trip-ctx {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}
html body .vf-trip .vf-trip-ctx .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
html body .vf-trip .vf-hint {
  margin-top: 6px;
}

/* Notifications : sélecteur standard (bleu), à 40 px sans écraser ses segments. */
html body .nt-bar .ds-segs {
  padding: 3px;
  gap: 3px;
  align-items: center;
}
html body .nt-bar .ds-segs .ds-seg {
  height: 32px;
}

/* Carte véhicule : saisies sans compte à vérifier = pastille sur l'icône QR. */
html body .vf-tool {
  position: relative;
}
html body .vf-tool .vf-tool-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--amber-strong, #b26a00);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* Segment choisi : teinte bleue standard (ou la couleur de la rubrique si --hue est défini). */
html body .ds-seg.sel,
html body .ds-seg[aria-pressed="true"],
html body .pp-seg input:checked + span {
  background: color-mix(in srgb, var(--hue, var(--blue)) 14%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue, var(--blue)) 35%, transparent);
  color: var(--hue, var(--blue));
}

/* Choix d'une photo dans une fenêtre : à plat, bouton + nom du fichier et format à droite. */
html body .modal .file-picker-body {
  gap: 12px;
  margin-top: 7px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
html body .modal .file-preview {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}
html body .modal .file-preview img {
  object-fit: cover;
}
html body .modal .file-picker-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  flex: 1;
}
html body .modal .file-picker-actions > * {
  grid-column: 2;
  margin: 0;
}
html body .modal .file-picker-actions > .file-pick-button {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-height: 40px;
}
html body .modal .file-picker-actions > .form-error {
  grid-column: 1 / -1;
}
html body .modal .file-picker-actions > .text-btn {
  justify-self: start;
  padding: 0;
  min-height: 0;
}

/* Écrans tactiles : la règle « 44 px minimum par bouton » ne doit pas agrandir les segments
   (c'est la piste entière qui fait la zone de toucher) — sinon ils débordent de leur cadre. */
html body .ds-segs .ds-seg {
  min-height: 0;
}
html body .nt-list {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
html body .ds-seg.sel .ds-count,
html body .ds-seg[aria-pressed="true"] .ds-count {
  background: var(--hue, var(--blue));
}

/* Notifications : la barre du bas est le pied de la fenêtre (fond, trait, boutons centrés). */
html body .modal.nt-modal .nt-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
html body .modal.nt-modal .nt-foot .btn {
  margin: 0;
}

/* Libellé long / court selon la largeur (boutons d'en-tête). */
html body .t-short {
  display: none;
}
@media (max-width: 760px) {
  html body .t-long {
    display: none;
  }
  html body .t-short {
    display: inline;
  }
}

/* Armoire : ligne 1 = recherche + catégories + états ; ligne 2 = nature + compteur.
   Mobile : recherche, nature, puis les deux menus côte à côte, puis le compteur. */
html body .stock-filters .stock-filter-line {
  flex-wrap: nowrap;
  gap: 10px;
}
html body .stock-filters .sf-search .stock-search {
  flex: 1 1 auto;
  max-width: none;
}
html body .stock-filters .sf-search #stock-filter-controls {
  flex: none;
  flex-wrap: nowrap;
}
html body .stock-filters .sf-search .stock-select select.input {
  height: 42px;
  min-height: 42px;
  max-width: 220px;
}
html body .stock-filters .sf-nature .stock-count {
  margin-left: auto;
}
@media (max-width: 760px) {
  html body .stock-filters .stock-filter-line {
    display: contents;
  }
  html body .stock-filters .stock-search {
    order: 1;
    flex: none;
  }
  html body .stock-filters #stock-nature {
    order: 2;
  }
  html body .stock-filters #stock-filter-controls {
    order: 3;
  }
  html body .stock-filters .stock-count {
    order: 4;
    margin: 0;
  }
  html body .stock-filters #stock-nature .ds-segs {
    display: flex;
  }
  html body .stock-filters #stock-nature .ds-seg {
    flex: 1 1 0;
    min-width: 0;
    padding: 0 8px;
  }
  html body .stock-filters #stock-nature .ds-seg > .icon {
    display: none;
  }
  html body .stock-filters .sf-search .stock-select select.input {
    max-width: none;
  }
}
@media (max-width: 760px) {
  html body .stock-filters .stock-count {
    text-align: left;
    align-self: flex-start;
  }
  html body .stock-filters .stock-select select.input {
    font-weight: 500;
  }
}

/* Rubriques de l'armoire : pastille d'en-tête au même gabarit (36 px) que celles des articles,
   donc les icônes tombent exactement sur le même axe. */
html body .stock-group-h > .ds-pill {
  width: 36px;
  height: 36px;
  flex: none;
}
html body .stock-group-h {
  grid-template-columns: 36px minmax(0, 1fr) auto;
}
@media (max-width: 760px) {
  html body .stock-filters .sf-nature .stock-count {
    margin: 0;
  }
}

/* Carte de mission : moyens sur une ligne ; l'avancement est une barre fine au-dessus du pied. */
html body .mission-card .mc-means-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
html body .mission-card .mc-veh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  font-weight: 600;
  color: var(--c-vehicules);
}
html body .mission-card .mc-veh .icon {
  width: 16px;
  height: 16px;
}
html body .mission-card .mc-thumbs {
  display: flex;
  flex: none;
}
html body .mission-card .mc-thumbs img,
html body .mission-card .mc-thumbs .mc-more {
  width: 28px;
  height: 28px;
  margin-left: -6px;
  border: 2px solid var(--surface);
  border-radius: 8px;
  background: var(--surface2);
  object-fit: contain;
  box-sizing: border-box;
}
html body .mission-card .mc-thumbs > :first-child {
  margin-left: 0;
}
html body .mission-card .mc-thumbs .mc-more {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
html body .mission-card .mc-count {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}
html body .mission-card .mc-bottom {
  margin-top: auto;
}
html body .mission-card .mc-progress {
  height: 3px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--line);
}
html body .mission-card .mc-progress > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}
html body .mission-card .mc-bottom .mc-foot {
  margin-top: 0;
  border-top: 0;
  padding-top: 12px;
}
html body .mission-card .mc-foot-text {
  flex: 1;
}

/* Fenêtre à étapes : titre + « Étape x sur n », barre fine sous l'en-tête (un seul trait). */
html body .modal-header .pp-head-txt {
  flex: 1;
  min-width: 0;
}
html body .modal-header .pp-head-txt h2 {
  margin: 0;
}
html body .modal-header .pp-head-sub {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html body .modal-header.has-prog {
  flex-wrap: wrap;
}
html body .modal-header .pp-prog {
  display: flex;
  flex: 1 0 100%;
  gap: 4px;
  margin-top: 12px;
}
html body .modal-header .pp-prog i {
  flex: 1;
  height: 4px;
  border-radius: 99px;
  background: var(--line);
}
html body .modal-header .pp-prog i.on {
  background: var(--blue);
}

/* Sélecteur en lignes (ppPicker rows) : une ligne par élément, retirée par la croix. */
html body .pp-picker-rows .pp-pick-list {
  border-top: 1px solid var(--line);
}
html body .pp-picker-rows .pp-pick-list:empty {
  display: none;
}
html body .pp-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
html body .pp-pick-row > .ds-pill {
  flex: none;
  width: 36px;
  height: 36px;
}
html body .pp-pick-main {
  flex: 1;
  min-width: 0;
}
html body .pp-pick-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
html body .pp-pick-main small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
html body .pp-pick-row .icon-btn {
  flex: none;
  color: var(--muted);
}
html body .pp-picker-rows .pp-picker-box {
  margin-top: 10px;
}
/* Petit menu sous le nom (usage d'un véhicule…) : texte discret, pas un champ encadré. */
html body .pp-pick-main .pp-pick-sel {
  appearance: none;
  -webkit-appearance: none;
  height: auto;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0 18px 0 0;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a6b7b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right center / 14px;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* Onglet Modèles : un intertitre par type (pastille de couleur, nombre). */
html body .model-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html body .model-group i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--hue);
}
html body .model-group span {
  font-weight: 600;
  letter-spacing: 0;
}
html body .modal .pp-section > h3 .pp-count {
  color: var(--muted);
  font-weight: 600;
}
html body .pp-seg span {
  gap: 6px;
}
html body .pp-seg span .icon {
  flex: none;
  width: 16px;
  height: 16px;
}

/* Usage d'un véhicule sous son nom : trois petites puces de choix (pas de menu à 16 px). */
html body .pp-usage {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
html body .pp-usage label {
  position: relative;
  margin: 0;
}
html body .pp-usage input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html body .pp-usage span {
  display: inline-flex;
  align-items: center;
  height: 26px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
html body .pp-usage input:checked + span {
  border-color: color-mix(in srgb, var(--blue) 35%, transparent);
  background: color-mix(in srgb, var(--blue) 14%, var(--surface));
  color: var(--blue);
}
html body .pp-usage label:has(input:focus-visible) span {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
/* Première rubrique d'une étape : pas de trait au-dessus (l'en-tête en a déjà un). */
html body .modal [data-mw-step] > .pp-section:first-child,
html body .modal [data-rt-step] > .pp-section:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
/* Pied de fenêtre : la corbeille à la même hauteur que les boutons (40 px), même au doigt. */
html body .modal .modal-footer .icon-btn.danger-icon-v4 {
  width: 40px;
  height: 40px;
  min-height: 40px;
}
html body .pp-usage {
  gap: 3px;
}
html body .pp-usage span {
  padding: 0 7px;
  font-size: 12px;
}

/* Préparer une mission : modèles en lignes, rangés par type, choix par rond. */
html body .wz-model-q {
  margin-bottom: 6px;
}
html body .wz-mgroup[hidden],
html body .wz-mrow[hidden] {
  display: none;
}
html body .wz-mgroup-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
html body .wz-mgroup:first-child .wz-mgroup-h {
  margin-top: 4px;
}
html body .wz-mgroup-h i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
html body .wz-mrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  margin: 0;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
html body .wz-mrow input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html body .wz-mrow-main {
  flex: 1;
  min-width: 0;
}
html body .wz-mrow-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
html body .wz-mrow-main small {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
html body .wz-radio {
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid #b8c4cf;
  border-radius: 50%;
  box-sizing: border-box;
}
html body .wz-mrow input:checked ~ .wz-radio {
  border: 7px solid var(--blue);
}
html body .wz-mrow input:focus-visible ~ .wz-radio {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html body .ds-sec[data-wz-type][hidden] {
  display: none;
}

/* Étape 1 : les trois champs (nom, modèle, type) portent le même libellé simple. */
html body .wz-lab {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

/* ================================================================ Fin de l'inventaire */
html body .modal.fi-modal .pp-status {
  margin-bottom: 4px;
}
html body .fi-h {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
html body .fi-list {
  border-top: 1px solid var(--line);
}
html body .fi-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  width: 100%;
  min-height: 60px;
  margin: 0;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
html body button.fi-row {
  cursor: pointer;
}
html body .fi-row > .icon {
  flex: none;
  color: var(--faint, var(--muted));
}
html body .fi-main {
  flex: 1;
  min-width: 0;
}
html body .fi-main b {
  display: block;
  font-size: 15px;
  font-weight: 600;
}
html body .fi-main small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}
html body .fi-later .fi-main {
  opacity: 0.65;
}
html body .fi-step.pp-stepper {
  display: inline-flex;
  flex: none;
  width: auto;
  height: 40px;
}
html body .fi-step .pp-step {
  width: 38px;
  min-width: 38px;
  height: 100%;
  min-height: 0;
}
html body .fi-step .input {
  width: 48px;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  text-align: center;
}
html body .fi-lot {
  display: grid;
  flex: 1 0 100%;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
html body .fi-lot[hidden] {
  display: none;
}
html body .fi-lot .input {
  height: 40px;
  min-height: 40px;
}
html body .modal .fi-check {
  margin: 14px 0 0;
  font-weight: 600;
}
html body .fi-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
html body .fi-more .icon {
  width: 15px;
  height: 15px;
  transition: transform 0.15s ease;
}
html body .fi-more.is-open .icon {
  transform: rotate(180deg);
}
html body .modal .fi-form {
  display: block;
}
html body .modal .fi-form > .pp-status {
  margin: 0 0 4px;
}
html body .modal .fi-form .fi-h {
  margin: 18px 0 8px;
}
html body .modal .fi-row .pp-stepper.fi-step {
  display: inline-flex;
  flex: none;
  width: auto;
  max-width: none;
  margin: 0;
}
html body .modal .fi-form > .form-error:empty {
  display: none;
}
html body .modal .fi-row .pp-stepper.fi-step {
  display: grid;
  grid-template-columns: 38px 48px 38px;
  width: 126px;
}
html body .modal .fi-row .pp-stepper.fi-step .input {
  width: 100%;
}

html body .fi-lot-f {
  display: grid;
  gap: 4px;
  margin: 0;
  min-width: 0;
}
html body .fi-lot-f span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* ================================================================ Retour de mission (fenêtre à étapes) */
html body .modal .rf-form {
  display: block;
}
html body .modal .rf-form > .form-error:empty {
  display: none;
}
html body .rf-q {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}
html body .rf-hint {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 13px;
}
html body .modal .rf-form .fi-h.rf-first {
  margin-top: 0;
}
html body .modal .rf-form .fi-list + .rf-q {
  margin-top: 20px;
}
html body .rf-bag {
  position: relative;
  cursor: pointer;
}
html body .rf-bag input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
html body .rf-cb {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  border: 2px solid #b8c4cf;
  border-radius: 7px;
}
html body .rf-bag input:checked + .rf-cb {
  border-color: var(--blue);
  background: var(--blue);
}
html body .rf-bag input:checked + .rf-cb::after {
  content: "";
  width: 6px;
  height: 11px;
  border: solid #fff;
  border-width: 0 2.4px 2.4px 0;
  transform: translate(0, -1px) rotate(45deg);
}
html body .rf-bag input:disabled + .rf-cb {
  opacity: 0.45;
}
html body .rf-bag input:focus-visible + .rf-cb {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
html body .fi-row[hidden] {
  display: none;
}
html body .fi-main small.rf-warn {
  color: var(--amber-strong);
}
html body .rf-search {
  margin-bottom: 4px;
}
html body .modal .rf-form .rf-search + .fi-h {
  margin-top: 14px;
}
html body .modal .rf-form > .fi-h:first-child {
  margin-top: 0;
}
html body .rf-take {
  margin-top: 8px;
  padding: 12px 0 0;
  border-top: 0;
}
html body .modal .rf-form .fi-check {
  margin-top: 6px;
}
html body .modal .rf-form .fi-row > .ds-pill {
  flex: none;
  width: 36px;
  height: 36px;
}

html body .fi-main small:empty {
  display: none;
}

html body .rf-q-veh {
  margin-bottom: 10px;
}

/* Contrôle consulté en fenêtre (checkSheet) : une ligne de chiffres, commentaire à plat. */
html body .modal .fi-form .fi-facts {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13.5px;
}
html body .modal .fi-form .fi-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-line;
}
html body .modal.fi-modal .modal-footer {
  justify-content: flex-end;
}

html body .modal .fi-form .fi-h.fi-first {
  margin-top: 0;
}

/* Accès QR : saisie à vérifier = texte à gauche, « Ignorer » et « Corriger » à droite (dessous sur mobile). */
html body .ga-row {
  align-items: flex-start;
}
html body .ga-acts {
  display: flex;
  flex: none;
  gap: 8px;
}
html body .ga-acts .btn {
  margin: 0;
}
@media (max-width: 760px) {
  html body .ga-row {
    flex-wrap: wrap;
  }
  html body .ga-acts {
    flex: 1 0 100%;
    justify-content: flex-end;
  }
}

/* Vignette du relevé : la photo reste dans son cadre, quel que soit son format (portrait ou carré). */
html body .inventory-heading .inventory-cover {
  overflow: hidden;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
html body .inventory-heading .inventory-cover img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}

/* Relevé conservé (lecture seule) : sur grand écran, « Voir le récapitulatif » est déjà dans le panneau de droite. */
@media (min-width: 901px) {
  html body #check-form.is-readonly .check-actions {
    display: none;
  }
}

/* ================================================================ Accès QR des infirmeries (maquette validée le 23/11) */
html body .dt-public {
  max-width: 600px;
  padding: 14px 16px 40px;
}
html body .dt-public.dt-native-inventory,
html body .dt-public.dt-native-review {
  max-width: 760px;
}
html body .dt-public .dtp-brand {
  margin-bottom: 10px;
}
/* En-tête de l'infirmerie : compact, dispositif et horaires sur une ligne. */
html body .dt-public header.dtp-station {
  gap: 12px;
  margin: 6px 0 14px;
}
html body .dt-public .dtp-station-ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}
html body .dt-public .dtp-station-ic .icon {
  width: 22px;
  height: 22px;
}
html body .dt-public .dtp-station h1 {
  margin: 0;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}
html body .dt-public .dtp-station-txt p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
/* Progression sur une ligne, sans cadre. */
html body .dt-public .dtp-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 0 0 6px;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}
html body .dt-public .dtp-progress b {
  font-size: 15px;
  white-space: nowrap;
}
html body .dt-public .dtp-progress b em {
  font-style: normal;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
html body .dt-public .dtp-progress .dtp-progress-bar {
  flex: 1;
  grid-column: auto;
}
html body .dt-public .dtp-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}
/* Prénom et nom : un simple champ, puis une ligne « Camille Test · Modifier ». */
html body .dt-public .dtp-name {
  display: block;
  margin: 12px 0 4px;
}
html body .dt-public .dtp-name > span {
  display: block;
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
}
html body .dt-public .dtp-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  margin: 12px 0 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
html body .dtp-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--action-bg);
  color: var(--action-text);
  font-size: 11.5px;
  font-weight: 700;
}
html body .dtp-who b {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html body .dtp-link {
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--blue);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
/* Écran du code du dispositif (après le scan). */
html body .dtp-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 26px 4px 24px;
  text-align: center;
}
html body .dtp-code.is-idle {
  padding-top: 80px;
}
html body .dtp-code-pill {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 14px;
  border-radius: 15px;
  background: color-mix(in srgb, var(--c-live) 14%, var(--surface));
  color: var(--c-live);
}
html body .dtp-code.is-idle .dtp-code-pill {
  background: var(--surface2);
  color: var(--muted);
}
html body .dtp-code-pill .icon {
  width: 24px;
  height: 24px;
}
html body .dt-public .dtp-code h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
}
html body .dtp-code-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 12px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}
html body .dtp-code-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
html body .dtp-code-meta .icon,
html body .dtp-code-safe .icon,
html body .dtp-code-err .icon {
  width: 15px;
  height: 15px;
}
html body .dtp-code-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  margin-top: 34px;
}
html body .dtp-code-form.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
html body .dtp-code-q {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
}
html body .dtp-code-s {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
}
html body .dtp-code.is-idle .dtp-code-s {
  max-width: 300px;
  margin: 10px 0 0;
}
html body .dtp-digits {
  position: relative;
}
html body .dtp-digits > span {
  display: flex;
  gap: 12px;
}
html body .dtp-digits i {
  display: grid;
  place-items: center;
  width: 58px;
  height: 68px;
  border: 1.5px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgb(0 0 0 / 4%);
  color: var(--text);
  font-size: 30px;
  font-style: normal;
  font-weight: 700;
}
html body .dtp-digits i.on {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 16%, transparent);
}
html body .dtp-digits i.on:empty::after {
  content: "";
  width: 2px;
  height: 30px;
  border-radius: 2px;
  background: var(--blue);
  animation: dtp-caret 1s steps(1) infinite;
}
@keyframes dtp-caret {
  50% {
    opacity: 0;
  }
}
/* Le vrai champ couvre les cases : un toucher ouvre le clavier numérique. */
html body .dtp-digits input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  opacity: 0;
}
html body .dtp-code-form.is-error .dtp-digits i {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}
html body .dtp-code-form.is-error .dtp-digits > span {
  animation: dtp-shake 0.35s;
}
@keyframes dtp-shake {
  20%,
  60% {
    transform: translateX(-6px);
  }
  40%,
  80% {
    transform: translateX(6px);
  }
}
html body .dtp-code-err {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
}
html body .dtp-code-safe {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 12px;
}
@media (max-width: 380px) {
  html body .dtp-digits > span {
    gap: 10px;
  }
  html body .dtp-digits i {
    width: 54px;
    height: 64px;
  }
}
/* Inventaire d'un sac : en-tête sur une ligne, une seule colonne, sans panneau latéral. */
html body .dt-public .dtp-ihead {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}
html body .dtp-ihead-back {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
html body .dt-public .dtp-ihead .inventory-cover {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 11px;
}
html body .dtp-ihead-txt {
  flex: 1;
  min-width: 0;
}
html body .dt-public .dtp-ihead h1 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}
html body .dtp-ihead-txt p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
html body .dt-public .inventory-aside {
  display: none;
}
html body .dt-public #check-form.inventory-workspace {
  display: block;
}
@media (min-width: 901px) {
  html body .dt-public #check-form.is-readonly .check-actions {
    display: flex;
  }
}
html body .fi-who {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12.5px;
}
/* Noms de sacs longs : deux lignes plutôt que des points de suspension. */
html body .dt-public .dtp-row-main b {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  text-overflow: clip;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
/* Progression de l'inventaire (UL et DT) : le compteur n'a plus de marge basse, il s'aligne sur la barre. */
html body .inventory-progress > div:first-child {
  margin: 0;
}

/* ================================================================ DT : code du dispositif et préparation en trois étapes */
/* Tuile : pastille d'état à gauche, code à droite sur la même ligne. */
html body .dts-event-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}
html body .dts-code-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  margin-left: auto;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface2);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
  cursor: pointer;
}
html body .dts-code-chip .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}
html body .dts-code-chip:hover {
  border-color: var(--selection-line, var(--line));
}
/* Code en grand, centré, avec son texte. */
html body .dt-code-sheet {
  text-align: center;
}
html body .dt-code-intro {
  margin: 0 0 10px;
  font-weight: 700;
}
html body .dt-code-digits {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 12px;
}
html body .dt-code-digits i {
  display: grid;
  place-items: center;
  width: 60px;
  height: 62px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface2);
  color: var(--text);
  font-size: 30px;
  font-style: normal;
  font-weight: 800;
}
html body .dt-code-hint {
  max-width: 340px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 13px;
}
html body .dt-code-sheet .pp-more {
  margin-top: 16px;
  text-align: left;
}
html body .dt-code-sheet .pp-more .btn {
  width: 100%;
  margin-top: 10px;
}
html body .btn.dt-danger-soft {
  border-color: color-mix(in srgb, var(--red) 45%, var(--surface));
  color: var(--red);
}
/* Assistant : liste des infirmeries, une infirmerie à la fois. */
html body .dtw-posts {
  display: grid;
  border-top: 1px solid var(--line);
}
html body .dtw-post {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 60px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
html body .dtw-post.is-static {
  cursor: default;
}
html body .dtw-post > .icon {
  color: var(--muted);
}
html body .dtw-post-main {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 2px;
}
html body .dtw-post-main b {
  font-size: 14.5px;
}
html body .dtw-post-main small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .dtw-post.is-empty .dtw-post-main small {
  color: var(--muted);
  font-style: italic;
}
html body .dtw-post-h {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
}
html body .dtw-post-h b {
  flex: 1;
  font-size: 16px;
}
html body .dtw-post-h .dts-mono {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}
html body .dtw-form .dt-assignment {
  display: none;
  margin: 0;
  padding: 0;
  border: 0;
}
html body .dtw-form .dt-assignment.is-current {
  display: block;
}
html body .dtw-form .dt-assignment h4 {
  margin: 16px 0 2px;
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
/* Récapitulatif (colonne de droite et dernière étape). */
html body .dtw-side-h {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
html body .dtw-rc {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
html body .dtw-rc:last-child {
  border-bottom: 0;
}
html body .dtw-rc > .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--muted);
}
html body .dtw-rc b {
  display: block;
  font-size: 13.5px;
}
html body .dtw-rc small {
  color: var(--muted);
}
html body .dtw-recap {
  padding: 2px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}
html body .dtw-codecard {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}
html body .dtw-codecard-h {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
}
html body .dtw-codecard-h .icon {
  width: 18px;
  height: 18px;
  color: var(--blue);
}
/* Le récapitulatif est déjà l'étape 3 : pas de doublon dans la colonne de droite à cette étape. */
html body .dtw-form[data-step="2"] .ds-wiz-side {
  display: none;
}
html body .dtw-form[data-step="2"] .ds-wiz-body {
  grid-template-columns: minmax(0, 1fr);
}
html body button.dts-code-chip {
  min-height: 30px;
  height: 30px;
  min-width: 0;
}
/* Pied de l'assistant DT sur mobile : « Retour » à sa largeur, le bouton principal prend le reste. */
@media (max-width: 760px) {
  html body .dtw-form .modal-footer .btn[data-action="dtw-back"] {
    flex: none;
    width: auto;
    min-width: 0;
    padding-inline: 14px;
  }
  html body .dtw-form .modal-footer .btn:is([data-submit], [data-next], [data-post-done]) {
    flex: 1 1 auto;
    min-width: 0;
  }
}
@media (max-width: 760px) {
  html body .dtw-form .modal-footer :is(.ds-spacer, .ds-wiz-hint:empty) {
    display: none;
  }
}

/* Pied de fenêtre grisé : bordure plus marquée des boutons secondaires (même gabarit, mieux visibles). */
html body .modal .modal-footer .btn.secondary {
  border-color: color-mix(in srgb, var(--text) 24%, var(--line));
}
/* Retour de mission : la colonne des compteurs est titrée « Utilisé », centrée au-dessus des compteurs (126 px). */
html body .fi-h.rf-cols {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
html body .fi-h.rf-cols .rf-col-used {
  flex: none;
  width: 126px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* Armoire sur ordinateur : recherche, nature, catégories et états sur une seule ligne ;
   le compteur passe au-dessus de la liste. Mobile inchangé. */
html body .stock-count-top {
  display: none;
}
@media (min-width: 761px) {
  html body .stock-filters {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
  }
  html body .stock-filters .stock-filter-line {
    display: contents;
  }
  html body .stock-filters .sf-search .stock-search {
    order: 1;
    flex: 1 1 160px;
    min-width: 0;
    max-width: none;
    margin: 0;
  }
  html body .stock-filters #stock-nature {
    order: 2;
    flex: none;
  }
  html body .stock-filters #stock-filter-controls {
    order: 3;
    flex: none;
    margin: 0;
  }
  html body .stock-filters .sf-search .stock-select select.input {
    width: 150px;
    max-width: 150px;
  }
  html body .stock-filters .stock-count {
    display: none;
  }
  html body .stock-count-top {
    display: block;
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12.5px;
    text-align: right;
  }
}
/* Bandeau Missions (ordinateur) : l'icône remonte de 1,5 px pour tomber sur l'axe du texte. */
@media (min-width: 761px) {
  html body .ds-hero-stat > .ds-hs-ic {
    margin-bottom: 3px;
  }
}

/* Récapitulatif d'une mission avec beaucoup d'IS : compte par fonction, puis avatars superposés. */
html body .wz-crew-sum {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}
html body .wz-crew-sum > b {
  font-size: 13px;
  line-height: 1.4;
}
html body .wz-faces {
  display: flex;
  align-items: center;
}
html body .wz-faces > .avatar {
  flex: none;
  margin-left: -7px;
  border: 2px solid var(--surface);
  font-size: 10px;
}
html body .wz-faces > .avatar:first-child {
  margin-left: 0;
}
html body .wz-faces-more {
  display: grid;
  place-items: center;
  flex: none;
  min-width: 30px;
  height: 30px;
  margin-left: -7px;
  padding: 0 6px;
  border: 2px solid var(--surface);
  border-radius: 999px;
  background: var(--surface2);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
}

/* Textes des emails : variables en petites étiquettes serrées sur une ligne, juste après
   « Insérer : », et la phrase d'aide collée dessous. */
html body .email-variables {
  gap: 6px;
  margin-top: 2px;
}
html body .email-variables > span {
  margin-right: 2px;
}
html body .email-variables .text-btn {
  min-height: 0;
  height: 26px;
  margin: 0;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface2, var(--surface));
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
}
html body .email-variables .text-btn:hover {
  border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
  color: var(--blue);
}
/* La pile espace ses blocs de 18 px : on rapproche la phrase d'aide des étiquettes. */
html body .email-variables + .page-caption {
  margin-top: -10px;
}
/* En-tête de section sans sous-titre (ex. « Créneau ») : titre centré sur son icône. */
html body .ds-sec-h:not(:has(p)) {
  align-items: center;
}

/* Imports : colonnes du modèle en liste compacte, catégories de l'armoire en étiquettes. */
html body .import-cols {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 14px;
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
}
html body .import-cols dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}
html body .import-cols dd {
  margin: 0;
  color: var(--muted);
}
html body .import-help .label {
  margin: 16px 0 8px;
}
html body .import-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
html body .import-cats span {
  padding: 3px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.4;
}
@media (max-width: 760px) {
  html body .import-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  html body .import-cols dd {
    margin-bottom: 8px;
  }
}

/* ---------------------------------------------------------------- séparateurs (lot 3, 23/11)
   Trait plein uniquement entre un titre et son contenu (en-tête et pied de fenêtre, barres,
   en-têtes de panneau, de tableau, de groupe, barres de boutons). Entre deux lignes ou deux
   blocs : pointillés légers, comme dans le volet des notifications. Seuls le style et la
   couleur changent, et uniquement là où l'écran d'origine dessine déjà un trait : un élément
   sans trait déclaré prendrait sinon l'épaisseur par défaut du navigateur (3 px). */
:root {
  --sep-line: color-mix(in srgb, var(--line) 85%, var(--muted));
}
html body :is(
    .modal .form-block + .form-block,
    .modal .form-block + .pp-more,
    .modal .form-block + details.form-section,
    .st-pref-row:not(:first-child),
    .ds-row:not(:first-child),
    .stock-line:not(:first-child),
    .mission-card .mc-means-line,
    .model-rows .model-row + .model-row,
    .st-switch:not(:first-child, .compact),
    .st-tools .st-tool + .st-tool,
    .st-ev-more,
    .modal .pp-check + .pp-check,
    .wz-recap-row,
    .dts-res-row:not(:first-child)
  ) {
  border-top-style: dashed !important;
  border-top-color: var(--sep-line) !important;
}
html body :is(td, .wz-mrow, .dtw-rc:not(:last-child)) {
  border-bottom-style: dashed !important;
  border-bottom-color: var(--sep-line) !important;
}

/* ---------------------------------------------------------------- connexion (lot 3, 23/11)
   Un champ email, un bouton principal, les autres moyens en liens ; « ou » en pointillés. */
html body .login-form .lg-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
html body .login-form .lg-stack .label,
html body .login-form .lg-stack .checkbox-label {
  margin: 0;
}
html body .login-form .lg-stack > .btn {
  width: 100%;
  margin: 0;
}
html body .login-form .lg-stack .form-error:empty {
  display: none;
}
html body .login-form > h1 + p {
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
}
html body .lg-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
}
html body .lg-or::before,
html body .lg-or::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--sep-line);
}
html body .lg-alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 12px;
}
html body .lg-alt .text-btn {
  min-height: 36px;
  margin: 0;
  padding: 0 4px;
  font-size: 13px;
}
html body .lg-alt:empty {
  display: none;
}
html body .lg-sent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--green) 10%, var(--surface));
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.45;
}
html body .lg-sent .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--green);
}
html body .lg-sent b {
  overflow-wrap: anywhere;
}
html body .lg-who {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
html body .lg-who .avatar {
  flex: none;
  width: 38px;
  height: 38px;
}
html body .lg-who b {
  display: block;
  font-size: 14.5px;
}
html body .lg-who small {
  color: var(--muted);
  font-size: 12.5px;
}
html body .lg-who .text-btn {
  margin: 0 0 0 auto;
  font-size: 13px;
}
html body .login-form #otp-form input[name="code"] {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
}
/* Lien de récupération centré sous les boutons (il était aligné à gauche). */
html body .login-form .login-recovery {
  display: block;
  width: fit-content;
  margin: 4px auto 0;
  text-align: center;
}

/* ---------------------------------------------------------------- retours du 23/11 au soir
   Assistant DT, étape « Dispositif » : les champs étaient collés les uns aux autres. */
html body .modal.ds-wizard section[data-wz-step="0"]:not([hidden]) {
  display: grid;
  gap: 16px;
}
html body .modal.ds-wizard section[data-wz-step="0"] .dt-event-dates {
  margin: 0;
}

/* Page QR des infirmeries : de l'air sous la barre d'état du téléphone, entre la carte
   « qui compte » et l'inventaire, et l'encart « Inventaires terminés » mis en forme
   (son style n'existait que dans les fenêtres). */
html body .dt-public {
  padding-top: calc(env(safe-area-inset-top) + 22px);
}
html body .dt-public .dtp-who {
  margin: 14px 0 26px;
}
/* Entre la barre « Logistique · Accès infirmerie » et le nom de l'infirmerie : un vrai espace. */
html body .dt-public .dtp-brand {
  margin-bottom: 22px;
}
html body .dt-public .dtp-brand + * {
  margin-top: 0;
}
html body .dt-public .dtp-summary {
  display: grid;
  gap: 18px;
}
html body .dt-public .dtp-summary-t {
  margin: 6px 0 0;
}
html body .dt-public .pp-status {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface2);
}
html body .dt-public .pp-status > .icon {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--muted);
}
html body .dt-public .pp-status b {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}
html body .dt-public .pp-status span {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--muted);
}
html body .dt-public .pp-status.ok {
  background: var(--green-soft);
}
html body .dt-public .pp-status.ok > .icon,
html body .dt-public .pp-status.ok b {
  color: var(--green);
}

/* Assistant DT, étape « Infirmeries » (variante validée le 23/11) : en-tête de l'infirmerie avec
   site et dispositif, lots rangés Infirmerie / Binôme, « Prendre un autre lot » pour l'exception. */
html body .dtw-post-h {
  gap: 12px;
  margin: 0 0 4px;
}
html body .dtw-post-h .dts-mono {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}
html body .dtw-post-t {
  flex: 1;
  min-width: 0;
}
html body .dtw-post-t b {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}
html body .dtw-post-t small {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 13px;
}
html body .modal .dt-assignment h4 {
  margin: 22px 0 2px;
}
html body .modal .dt-assignment > h4:first-of-type {
  margin-top: 14px;
}
html body .modal .dt-assignment .pp-checks .pp-check:first-child,
html body .modal .dt-assignment .pp-checks .pp-check.is-first {
  border-top-style: none !important;
}
html body .dtw-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
html body .dtw-note[hidden] {
  display: none;
}
html body .dtw-note .icon {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}
html body .dtw-more {
  margin: 10px 0 0;
}
/* Le lien fait 44 px de haut (cible tactile) : son texte est centré, on compense pour garder
   le même écart visuel (22 px) au-dessus et au-dessous. */
html body .modal .dt-assignment > .dtw-more + h4 {
  margin-top: 10px;
}
html body .dtw-more[hidden] {
  display: none;
}
html body .dtw-more > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--blue);
  font-size: 14.5px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
html body .dtw-more > summary::-webkit-details-marker {
  display: none;
}
html body .dtw-more > summary .icon {
  width: 18px;
  height: 18px;
}
html body .dtw-more > summary small {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
html body .dtw-more[open] > summary .icon {
  transform: rotate(45deg);
}
html body .dtw-more > .dtw-note {
  margin: 0 0 4px;
}
/* Fiche du lot : « Assigné à », seulement avec une infirmerie habituelle. */
html body .lot-dt-role[hidden] {
  display: none;
}
html body .lot-dt-role .form-hint {
  margin: 6px 0 0;
}

/* Confirmation d'identité (lot 5) : même gabarit que les autres fenêtres, au-dessus d'elles. */
html body #reauth-dialog {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
html body #reauth-dialog::backdrop {
  background: transparent;
}
html body .reauth-modal {
  max-width: 460px;
}
html body .reauth-body {
  gap: 14px;
}
html body .reauth-why {
  margin: 0;
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.5;
}
html body .reauth-main,
html body .reauth-wide {
  width: 100%;
}
html body .reauth-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 12.5px;
  font-weight: 600;
}
html body .reauth-or::before,
html body .reauth-or::after {
  content: "";
  flex: 1;
  border-top: 1px dashed var(--sep-line);
}
html body .reauth-alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}
html body .reauth-alt .text-btn {
  min-height: 44px;
  color: var(--blue);
  font-size: 14.5px;
  font-weight: 600;
}
html body .reauth-sent {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--green-soft);
  font-size: 14px;
  line-height: 1.45;
}
html body .reauth-sent .icon {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  color: var(--green);
}
html body .reauth-code {
  font-size: 22px !important;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-align: center;
}
html body .reauth-body .form-error:empty {
  display: none;
}

/* Réglage d'une infirmerie, sous-page de « Infirmeries et QR » : retour vers la liste en tête. */
html body .dts-sub-h {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}
html body .dts-crumb {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-height: 40px;
  color: var(--blue);
  font-size: 14.5px;
  font-weight: 600;
}
html body .dts-crumb .icon {
  width: 18px;
  height: 18px;
}
html body .dts-sub-t {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Commandes d’inventaire dans le flux, sous la rubrique en cours. */
.inventory-progress-actions {
  display: none;
}
html body .dt-public #check-form.is-readonly .inventory-progress-actions {
  display: flex;
  margin: 0 0 12px;
}
html body .dt-public #check-form.is-readonly .check-actions,
html body #check-form.is-paused .check-actions,
html body #check-form.is-paused .inventory-progress-actions {
  display: none;
}
html body .dt-public .dtp-ihead {
  margin-bottom: 18px;
}
html body .dt-public .inventory-lock-message {
  margin: 0 0 16px;
  scroll-margin-top: 16px;
  overflow-wrap: anywhere;
}
@media (max-width: 920px) {
  html body #check-form.is-readonly .inventory-progress-actions {
    display: flex;
    margin: 0 0 12px;
  }
  html body #check-form .inventory-progress-actions .btn {
    min-height: 40px;
  }
  html body #check-form .check-actions {
    position: static;
    display: flex;
    flex-wrap: wrap;
    margin: 16px 0 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    isolation: auto;
    transform: none;
  }
  html body #check-form .check-actions .btn {
    flex: 1;
    min-height: 44px;
    font-size: 14px;
  }
  html body #check-form .check-actions .check-next {
    color: var(--action-text);
  }
  html body #check-form.is-readonly .check-actions,
  html body #check-form.inventory-paged:has(.check-next:not(:disabled)) .check-actions button[type="submit"],
  html body #check-form.inventory-paged:has(.check-next:not(:disabled)) .inventory-details {
    display: none;
  }
  html body #check-form .check-actions [data-action="check-save"] {
    order: 2;
    flex: 0 0 100%;
    width: auto;
    padding: 0 12px;
  }
  html body #check-form .check-actions [data-action="check-save"] .check-label-full {
    display: inline;
  }
  html body #check-form .check-actions [data-action="check-save"] .check-label-compact {
    display: none;
  }
  html body .dt-public #check-form.inventory-workspace {
    padding-bottom: 0;
  }
  html body .dt-public #check-form .inventory-progress {
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 6px;
  }
  html body .dt-public #check-form .inventory-save-state {
    grid-column: 1 / -1;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

html body .stock-batch-group {
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.stock-batch-group > summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 46px;
  padding: 7px 0;
  cursor: pointer;
  list-style: none;
}
.stock-batch-group > summary::-webkit-details-marker { display: none; }
.stock-batch-group > summary small { display: block; color: var(--muted); }
.stock-batch-group-toggle { color: var(--blue); font-size: 13px; }
.stock-batch-group-toggle::after { content: " ▾"; }
.stock-batch-group[open] .stock-batch-group-toggle::after { content: " ▴"; }
.take-form [data-withdrawal-check][hidden],
#restock-form [data-withdrawal-check][hidden],
.withdrawal-details[hidden] { display: none; }
.take-head .dt-place-chip { margin-top: 6px; }
@media (max-width: 760px) {
  html body .dt-public #check-form.inventory-workspace .inventory-group-tabs {
    top: env(safe-area-inset-top, 0px);
  }
  html body .dt-public #check-form .inventory-section {
    scroll-margin-top: calc(env(safe-area-inset-top, 0px) + 64px);
  }
  html[data-theme="dark"] body #check-form .inventory-group-tabs .btn {
    color: var(--muted);
  }
  html[data-theme="dark"] body #check-form .inventory-group-tabs .btn.active {
    background: color-mix(in srgb, var(--action-bg) 24%, var(--surface));
    border-color: color-mix(in srgb, var(--action-bg) 44%, var(--line));
    color: var(--text);
  }
  html[data-theme="dark"] body #check-form .inventory-group-tabs .btn.is-done:not(.active) {
    background: var(--surface);
    border-color: var(--line);
    color: var(--muted);
  }
  html[data-theme="dark"] body #check-form .inventory-group-tabs .btn.is-done .ig-count {
    color: var(--green);
    opacity: 1;
  }
  html[data-theme="dark"] body #check-form .inventory-group-tabs .btn.is-done .ig-count .icon {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-inline-end: 4px;
    vertical-align: -2px;
  }
}

/* Connexion et parc : les métadonnées peuvent passer à la ligne sans recouvrir les actions. */
html body .st-pref-sec .st-pref-event {
  display: grid;
  gap: 3px;
}
.vf-identity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 3px;
}
.vf-identity .ds-chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
html .vf-grid .vf-acts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
}
html .vf-grid .vf-acts .btn {
  min-height: 42px;
  white-space: normal;
}
@media (min-width: 860px) {
  html .vf-grid {
    align-items: stretch;
  }
  html .vf-grid .vf-acts {
    min-height: 92px;
  }
}
