/* ==========================================================================
   VERSION MOBILE (13/11/2026) - feuille de style de mobile.js
   --------------------------------------------------------------------------
   🔴 Couleurs par VARIABLES seulement (celles de style.css, redéfinies par
   html.sombre) : le mode sombre suit sans réplique. Seules exceptions, le
   blanc sur le bandeau et sur les fonds pleins, qui sont sombres dans les deux
   thèmes.
   Cibles au doigt : 44 px au moins. Champs en 16 px : en dessous, l'iPhone
   zoome la page à chaque toucher.
   ========================================================================== */

/* ---- L'outil autour : bandeau, tchat et remontée masqués ---- */
html.mobile-plein .topbar,
html.mobile-plein #bureau-banniere,
html.mobile-plein #btn-haut,
html.mobile-plein .tchat-btn,
html.mobile-plein .tchat-panneau,
html.mobile-plein .tchat-mention { display: none !important; }
html.mobile-plein .app { height: 100vh; height: 100dvh; }
html.mobile-plein .toast {
  z-index: 10000;
  bottom: calc(76px + env(safe-area-inset-bottom));
  max-width: calc(100vw - 32px);
  font-size: 15px;
  text-align: center;
}
/* Les bulles de notification descendent du haut, sous le bandeau, comme
   celles du téléphone, et passent au-dessus des feuilles. */
html.mobile-plein .bulles-notif {
  top: calc(58px + env(safe-area-inset-top));
  bottom: auto;
  left: 8px;
  right: 8px;
  width: auto;
  z-index: 9000;
}

/* 🔴 Bande de la barre d'état de l'iPhone (13/11/2026). Ouvert depuis l'écran
   d'accueil, iOS peint la zone de l'heure avec le fond de la PAGE (celui de
   <html>, à défaut celui de <body>) - c'est ce que fait Leo2Stats avec son
   bleu. Notre fond gris clair y faisait une bande claire au-dessus du bandeau
   anthracite ; la page passée sous l'heure (barre transparente) y faisait un
   fondu. Sur écran étroit, le fond de <html> prend donc la couleur du bandeau
   (connexion comprise, dont la colonne du haut est anthracite). <body> et les
   vues gardent le leur : seul ce qui déborde de la page change de couleur. */
@media (max-width: 760px) {
  /* Comme Leo2Stats : le fond est porté par BODY (iOS peint la bande de
     l'heure avec lui) ; les vues gardent le leur. */
  html, body { background: var(--chrome); }
  html.sombre.mobile-plein, html.sombre.mobile-plein body { background: #12161a; }  /* .mb-bandeau en sombre */
  /* Safari (iPhone) ZOOME sur tout champ de moins de 16 px qui prend le focus,
     et ne dézoome pas ensuite : l'identifiant de connexion (autofocus, 14 px)
     zoomait l'outil dès l'arrivée. 16 px au moins, pour tous les champs. */
  input, select, textarea { font-size: 16px !important; }
  /* « Version ordinateur » sur le téléphone : ses vues n'ont pas de fond propre. */
  html:not(.mobile-plein) .app { background: var(--fond); }
}

/* Retour à la version mobile, après « Version ordinateur ». */
.mb-retour-mobile { display: none; }
html.mobile-dispo .mb-retour-mobile {
  display: block;
  position: fixed;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 95;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--chrome);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  box-shadow: var(--ombre);
}

/* ---- La vue ---- */
#view-mobile:not(.hidden) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;               /* .view en pose une, commune aux vues de bureau */
  background: var(--fond);
  color: var(--gris-texte);
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}

.mb-bandeau {
  flex: none;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
  background: var(--chrome);
  color: #fff;
}
html.sombre .mb-bandeau { background: #12161a; }
.mb-marque .diapason-symbole { width: 28px; height: 28px; display: block; }
.mb-marque .diapason-symbole .onde { stroke: #fff; }
.mb-titre { flex: 1; margin: 0; font-size: 19px; font-weight: 700; color: #fff; }
.mb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
}

.mb-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 8px;
  z-index: 150;
  min-width: 230px;
  background: var(--blanc);
  color: var(--gris-texte);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  box-shadow: var(--ombre);
  overflow: hidden;
}
.mb-menu-tete { display: flex; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--bordure); }
.mb-menu-tete span { color: var(--gris-doux); font-size: 13px; }
.mb-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--bordure);
  background: none;
  color: inherit;
  font: inherit;
  font-size: 16px;
  text-align: left;
}
.mb-menu-item:last-child { border-bottom: 0; }
.mb-menu-sortie { color: var(--rouge); }
.mb-menu-bascule input { position: absolute; opacity: 0; pointer-events: none; }
.mb-interrupteur {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 13px;
  background: var(--bordure);
  transition: background .15s;
}
.mb-interrupteur::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blanc);
  transition: transform .15s;
}
.mb-menu-bascule input:checked + .mb-interrupteur { background: var(--vert-bord); }
.mb-menu-bascule input:checked + .mb-interrupteur::after { transform: translateX(18px); }

/* ---- Pages et onglets ---- */
.mb-page {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 12px 12px 24px;
}
.mb-onglets {
  flex: none;
  display: flex;
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
  padding-bottom: env(safe-area-inset-bottom);
}
.mb-onglet {
  flex: 1;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  border-top: 3px solid transparent;
  background: none;
  color: var(--gris-doux);
  font: inherit;
  font-size: 12px;
}
.mb-onglet .ico { width: 24px; height: 24px; }
.mb-onglet.actif { color: var(--gris-texte); border-top-color: var(--chrome-texte); font-weight: 700; }

.mb-entete-date { margin: 0 0 8px; color: var(--gris-doux); font-size: 14px; }
.mb-groupe {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 2px 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gris-doux);
}
.mb-groupe:first-child { margin-top: 4px; }
.mb-groupe span {
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 11px;
  background: var(--chrome-clair);
  color: var(--gris-texte);
  text-align: center;
  font-size: 12px;
}
.mb-groupe.g-retard { color: var(--rouge); }
.mb-vide { margin: 32px 16px; text-align: center; color: var(--gris-doux); line-height: 1.5; }
.mb-compte-liste { margin: 4px 2px 8px; color: var(--gris-doux); font-size: 13px; }

/* ---- Recherche et pastilles de filtre ---- */
.mb-outils { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.mb-recherche {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
}
.mb-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.mb-chip {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--bordure);
  border-radius: 19px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  font-size: 14px;
}
.mb-chip.actif { background: var(--chrome); border-color: var(--chrome); color: #fff; font-weight: 600; }
html.sombre .mb-chip.actif { background: var(--gris-texte); border-color: var(--gris-texte); color: var(--fond); }

/* ---- Cartes d'appel ---- */
/* Souche colorée à gauche : jaune nouveau, bleu en cours, vert résolu, rouge
   en retard - le code couleur du tableau. */
.mb-carte {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-bottom: 8px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.mb-carte:active { background: var(--chrome-clair); }
.mb-souche { flex: none; width: 6px; background: var(--jaune-bord); }
.mb-carte.s-en_cours .mb-souche { background: var(--bleu); }
.mb-carte.s-resolu .mb-souche { background: var(--vert-bord); }
.mb-carte.retard .mb-souche { background: var(--rouge); }
.mb-carte-corps { flex: 1; min-width: 0; padding: 10px 12px; }
.mb-carte-l1 { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.mb-num { font-weight: 700; }
.mb-quand { color: var(--gris-doux); text-align: right; }
.mb-carte.retard .mb-quand { color: var(--rouge); font-weight: 600; }
.mb-carte-client { margin-top: 2px; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mb-ville { font-weight: 400; color: var(--gris-doux); font-size: 14px; }
.mb-carte-motif {
  margin-top: 3px;
  color: var(--gris-texte);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mb-carte-techs { display: flex; gap: 4px; margin-top: 6px; }
.mb-ini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--chrome-clair);
  color: var(--gris-texte);
  font-size: 12px;
  font-weight: 700;
}
.mb-ini.moi { background: var(--chrome); color: var(--accent); }
.mb-carte-tel {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  border-left: 1px solid var(--bordure);
  color: var(--vert-texte);
}
.mb-carte-tel .ico { width: 24px; height: 24px; }

/* ---- Liste des clients ---- */
.mb-ligne-client {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  min-height: 60px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  text-align: left;
}
.mb-ligne-client .ico { grid-column: 2; grid-row: 1 / span 3; width: 20px; height: 20px; color: var(--gris-doux); }
.mb-lc-nom { font-weight: 700; font-size: 16px; overflow-wrap: anywhere; }
.mb-lc-sous { color: var(--gris-doux); font-size: 14px; }
.mb-lc-encours { color: var(--bleu); font-size: 13px; font-weight: 600; }

.mb-sans-contrat, .mb-sous-contrat, .mb-marque-facture {
  display: inline-block;
  margin: 4px 6px 0 0;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: 1px;
}
.mb-sans-contrat { border: 1px solid var(--rouge); color: var(--rouge); }
/* Même règle que l'outil en sombre : texte blanc dans un cadre rouge plein. */
html.sombre .mb-sans-contrat { background: var(--rouge-plein); border-color: var(--rouge-plein); color: #fff; }
.mb-sous-contrat { border: 1px solid var(--vert-bord); color: var(--vert-texte); }
.mb-marque-facture { background: var(--orange); border: 1px solid var(--orange-bord); color: var(--orange-texte); }
.mb-lc-nom .mb-sans-contrat { margin: 0 0 0 8px; }

/* ---- Feuilles (fiche d'appel, fiche client) ---- */
.mb-feuille {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: var(--fond);
  color: var(--gris-texte);
}
.mb-feuille.hidden { display: none; }
.mb-feuille-defile {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: 16px;
}
.mb-feuille-tete {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(6px + env(safe-area-inset-top)) 12px 6px 4px;
  background: var(--chrome);
  color: #fff;
}
html.sombre .mb-feuille-tete { background: #12161a; }
.mb-retour {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: none;
  color: #fff;
}
.mb-retour .ico { width: 26px; height: 26px; }
.mb-feuille-titre { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-feuille-titre b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-feuille-titre span { font-size: 13px; opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mb-pastille {
  flex: none;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: var(--jaune);
  color: var(--gris-texte);
  border: 1px solid var(--jaune-bord);
}
.mb-pastille.s-en_cours { background: var(--bleu-clair); border-color: var(--bleu); }
.mb-pastille.s-resolu { background: var(--vert); border-color: var(--vert-bord); color: var(--vert-texte); }
.mb-pastille.retard { background: var(--rouge-clair); border-color: var(--rouge); color: var(--rouge); }

.mb-verrou {
  margin: 0;
  padding: 10px 14px;
  background: var(--rouge-clair);
  color: var(--rouge);
  border-bottom: 2px solid var(--rouge);
  font-weight: 600;
}

.mb-bloc {
  margin: 10px 10px 0;
  padding: 12px 14px;
  background: var(--blanc);
  border: 1px solid var(--bordure);
  border-radius: 10px;
}
.mb-bloc h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--gris-doux);
}
.mb-compte {
  padding: 0 7px;
  border-radius: 10px;
  background: var(--chrome-clair);
  color: var(--gris-texte);
  font-size: 12px;
  letter-spacing: 0;
}
.mb-bloc h3 .mb-sous { text-transform: none; letter-spacing: 0; font-weight: 400; }
.mb-sous { color: var(--gris-doux); font-size: 14px; }
.mb-motif-long { margin: 0; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

.mb-lien-client {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
}
.mb-lien-client > span { display: flex; flex-direction: column; min-width: 0; }
.mb-lien-client b { font-size: 18px; overflow-wrap: anywhere; }
.mb-lien-client .ico { width: 22px; height: 22px; color: var(--gris-doux); }

.mb-info { margin: 8px 0 0; display: flex; flex-direction: column; font-size: 16px; overflow-wrap: anywhere; }
.mb-info span { color: var(--gris-doux); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.mb-notes { white-space: pre-wrap; }

/* Appeler, itinéraire, mail : de vrais boutons, pas des liens à viser. */
.mb-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.mb-actions:empty { display: none; }
.mb-action {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--vert-bord);
  border-radius: 10px;
  background: var(--vert);
  color: var(--vert-texte);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.mb-action .ico { width: 20px; height: 20px; }
.mb-action[href^="https"], .mb-action[href^="mailto"] {
  background: var(--blanc);
  border-color: var(--bordure);
  color: var(--gris-texte);
}

/* ---- Statut en trois boutons ---- */
.mb-statuts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mb-statut {
  min-height: 48px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.mb-statut.s-nouveau.actif { background: var(--jaune); border: 2px solid var(--jaune-bord); }
.mb-statut.s-en_cours.actif { background: var(--bleu-clair); border: 2px solid var(--bleu); }
.mb-statut.s-resolu.actif { background: var(--vert); border: 2px solid var(--vert-bord); color: var(--vert-texte); }
.mb-statut:disabled { opacity: .55; }

/* `minmax(0, 1fr)` et non `1fr` : une colonne `1fr` ne descend pas sous la largeur
   minimale de son contenu, et Safari donne au champ date une largeur propre. */
.mb-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 12px; }
.mb-champ { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mb-champ span { color: var(--gris-doux); font-size: 13px; }
/* 🔴 iPhone : un champ date/heure natif garde sa largeur « intrinsèque » et
   ignore `width` - Planning et Rappel se chevauchaient (signalé sur iPhone 17
   Pro Max, 13/11/2026). `appearance: none` le rend à la grille ; le sélecteur
   natif s'ouvre toujours au toucher. */
.mb-champ input,
.mb-filtres-periode input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  box-sizing: border-box;
  max-width: 100%;
}
.mb-champ input::-webkit-date-and-time-value,
.mb-filtres-periode input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.mb-champ input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
  color-scheme: light;
}
html.sombre .mb-champ input { color-scheme: dark; }
.mb-champ input:disabled { opacity: .55; }

.mb-techs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.mb-techs .mb-ini { height: 30px; min-width: 38px; font-size: 13px; }
.mb-bouton {
  margin-left: auto;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.mb-bouton.principal { background: var(--chrome); border-color: var(--chrome); color: var(--accent); }
.mb-bouton:disabled { opacity: .55; }

/* ---- Photos et pièces jointes ---- */
.mb-vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.mb-vignette {
  position: relative;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--chrome-clair);
  overflow: hidden;
  color: var(--gris-texte);
  font: inherit;
}
.mb-vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mb-vignette img:not([src]) { visibility: hidden; }
.mb-vignette-fichier {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
}
.mb-vignette-fichier .ico { width: 26px; height: 26px; }
.mb-vignette-fichier span {
  font-size: 11px;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow-wrap: anywhere;
}

/* ---- Suivis ---- */
.mb-suivi { padding: 8px 0; border-top: 1px solid var(--bordure); }
.mb-suivi:first-of-type { border-top: 0; padding-top: 0; }
.mb-suivi-tete { color: var(--gris-doux); font-size: 13px; }
.mb-suivi-tete b { color: var(--gris-texte); margin-right: 4px; }
.mb-suivi-texte { margin-top: 2px; font-size: 15px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- Saisie du suivi, en bas de la fiche ---- */
.mb-envoi {
  flex: none;
  margin: 0;
  padding: 6px 12px;
  background: var(--bleu-clair);
  color: var(--gris-texte);
  font-size: 14px;
  text-align: center;
}
.mb-saisie {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
}
.mb-saisie textarea {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 22px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
  line-height: 1.35;
  resize: none;
}
.mb-saisie-btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--gris-texte);
}
.mb-saisie-btn .ico { width: 24px; height: 24px; }
.mb-envoyer { background: var(--chrome); color: var(--accent); }
.mb-saisie-btn:disabled, .mb-saisie textarea:disabled { opacity: .45; }

/* ---- Photo en grand ---- */
.mb-visionneuse {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, .92);
}
.mb-visionneuse.hidden { display: none; }
.mb-visionneuse img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.mb-visionneuse p { margin: 0; color: #fff; font-size: 13px; text-align: center; overflow-wrap: anywhere; }

/* ---- Filtres de l'onglet Appels (13/11/2026) ---- */
.mb-chip-filtres { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.mb-chip-filtres .ico { width: 16px; height: 16px; }
.mb-nb-filtres {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--chrome);
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.mb-nb-filtres.hidden { display: none; }
.mb-filtres-resume { margin: 0 2px; color: var(--gris-texte); font-size: 13px; line-height: 1.4; }
.mb-filtres-resume.hidden { display: none; }
.mb-chip.inactif { border-style: dashed; color: var(--gris-doux); }
.mb-chip .ico { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; }

.mb-tete-lien {
  flex: none;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.mb-pied-filtres {
  flex: none;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--blanc);
  border-top: 1px solid var(--bordure);
}
.mb-bouton-large { width: 100%; margin: 0; min-height: 50px; font-size: 16px; }

.mb-ligne-bascule {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  font-size: 16px;
}
.mb-ligne-bascule > span:first-child { display: flex; flex-direction: column; }
.mb-ligne-bascule small, .mb-champ small { color: var(--gris-doux); font-size: 12px; }
.mb-ligne-bascule input { position: absolute; opacity: 0; pointer-events: none; }
.mb-ligne-bascule input:checked + .mb-interrupteur { background: var(--vert-bord); }
.mb-ligne-bascule input:checked + .mb-interrupteur::after { transform: translateX(18px); }
.mb-interrupteur { flex: none; }

.mb-champ-plein { margin-top: 10px; }
.mb-bloc > .mb-champ-plein:first-child { margin-top: 0; }
.mb-champ select {
  width: 100%;
  min-height: 46px;
  padding: 0 10px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
}
.mb-champ input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

.mb-recherche-client { margin-top: 10px; }
.mb-suggestions { display: flex; flex-direction: column; }
.mb-suggestion {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  border-bottom: 1px solid var(--bordure);
  background: none;
  color: var(--gris-texte);
  font: inherit;
  text-align: left;
}
.mb-suggestion span { color: var(--gris-doux); font-size: 13px; }

/* ---- Attribution dans la fiche d'appel : tous les techniciens ---- */
.mb-tech-choix { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.mb-tech {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 4px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
}
.mb-tech b { font-size: 15px; }
.mb-tech span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--gris-doux); font-size: 11px; }
.mb-tech.on { background: var(--chrome); border-color: var(--chrome); color: var(--accent); }
.mb-tech.on span { color: #fff; opacity: .8; }
html.sombre .mb-tech.on { background: #12161a; border-color: var(--accent); }
.mb-tech.inactif { border-style: dashed; }
.mb-tech:disabled { opacity: .55; }

/* ==========================================================================
   LOTS 2 ET 3 (13/11/2026) : nouvel appel, atelier, boîtiers, tchat
   ========================================================================== */
/* ---- Bouton « + » : nouvel appel ---- */
.mb-fab {
  position: fixed;
  right: 16px;
  bottom: calc(58px + 16px + env(safe-area-inset-bottom));
  z-index: 90;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: var(--chrome);
  color: var(--accent);
  box-shadow: var(--ombre);
  display: grid;
  place-items: center;
}
.mb-fab .ico { width: 28px; height: 28px; stroke-width: 2.4; }
.mb-fab.hidden { display: none; }
html.sombre .mb-fab { background: #12161a; border: 1px solid var(--accent); }
/* Le dernier élément des listes ne passe pas sous le « + ». */
#mb-page-journee, #mb-page-appels { padding-bottom: 92px; }

/* ---- Onglet Tchat et sa pastille ---- */
.mb-onglet { position: relative; }
.mb-onglet.hidden { display: none; }
.mb-onglet-pastille {
  position: absolute;
  top: 5px;
  left: calc(50% + 6px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--rouge-plein, #d33f3f);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}
.mb-onglet-pastille.hidden { display: none; }
.mb-onglet-pastille.mention { background: var(--orange-bord); }

/* ---- Segments (Atelier) ---- */
.mb-segments {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--chrome-clair);
}
.mb-segment {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--gris-doux);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.mb-segment.actif { background: var(--blanc); color: var(--gris-texte); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.mb-recherche.hidden { display: none; }
.mb-extrait {
  margin-top: 4px;
  color: var(--gris-texte);
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mb-ligne-fiche { text-align: left; }
.mb-lc-retard { color: var(--rouge); font-size: 13px; font-weight: 600; }
.mb-chip-statique { display: inline-flex; align-items: center; }

/* ---- Nouvel appel ---- */
.mb-erreur {
  margin: 10px 10px 0;
  padding: 10px 14px;
  border: 1px solid var(--rouge);
  border-radius: 10px;
  background: var(--rouge-clair);
  color: var(--rouge);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.mb-erreur.hidden { display: none; }
.mb-client-choisi {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.mb-client-choisi.hidden { display: none; }
.mb-client-choisi > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-client-choisi b { font-size: 18px; overflow-wrap: anywhere; }
.mb-client-choisi .mb-sans-contrat { align-self: flex-start; }
.mb-client-choisi .mb-bouton { margin-left: 0; flex: none; }
.mb-nouveau-client { margin: 8px 2px 0; font-size: 13px; line-height: 1.4; }
.mb-chips-sugg { margin-top: 8px; }
.mb-chips-sugg:empty { display: none; }
.mb-zone {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 96px;
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
  line-height: 1.45;
  resize: vertical;
}
#mb-creation .mb-dates .mb-champ input:not([type="date"]):not([type="time"]) { padding: 0 10px; }
.mb-nouvel-pour { margin: 0; }

/* ---- Boîtiers de la fiche d'appel ---- */
.mb-pret {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--bordure);
}
.mb-pret:first-of-type { border-top: 0; padding-top: 0; }
.mb-pret > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mb-pret .mb-bouton { margin-left: 0; flex: none; }
.mb-pret.retard .mb-sous { color: var(--rouge); font-weight: 600; }
.mb-pret.rentre { opacity: .65; }

/* ---- Réservation : liste de références, quantité ---- */
.mb-option-liste {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  min-height: 56px;
  margin-bottom: 8px;
  padding: 8px 12px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
  text-align: left;
}
.mb-option-liste span { color: var(--gris-doux); font-size: 13px; }
.mb-option-liste.on { border: 2px solid var(--chrome-texte); background: var(--blanc); }
.mb-quantite { display: flex; align-items: center; gap: 16px; }
.mb-quantite .mb-bouton { margin: 0; width: 52px; font-size: 22px; }
.mb-quantite b { min-width: 32px; font-size: 22px; text-align: center; }

/* ---- Choix en bas de l'écran ---- */
.mb-choix {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .45);
}
.mb-choix.hidden { display: none; }
.mb-choix-carte {
  width: 100%;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  padding: 16px 14px calc(14px + env(safe-area-inset-bottom));
  border-radius: 16px 16px 0 0;
  background: var(--blanc);
  color: var(--gris-texte);
}
.mb-choix-titre { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.mb-choix-texte { margin: 0 0 12px; color: var(--gris-doux); font-size: 15px; line-height: 1.4; white-space: pre-line; }
.mb-choix-texte.hidden { display: none; }
.mb-choix-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.mb-choix-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 52px;
  padding: 10px 14px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--fond);
  color: var(--gris-texte);
  font: inherit;
  font-size: 16px;
  text-align: left;
}
.mb-choix-option span { margin-top: 2px; color: var(--gris-doux); font-size: 13px; line-height: 1.35; }
.mb-choix-option.principal { background: var(--chrome); border-color: var(--chrome); color: var(--accent); }
.mb-choix-option.principal span { color: #fff; opacity: .8; }
html.sombre .mb-choix-option.principal { background: #12161a; border-color: var(--accent); }

/* ---- Tchat en plein écran ---- */
/* Le panneau flottant du bureau, étiré sur tout l'écran (le bloc du haut le
   masque en `mobile-plein` : on ne le rend qu'ouvert depuis l'onglet). */
html.mobile-plein.mobile-tchat .tchat-panneau:not(.hidden) {
  display: flex !important;
  inset: 0;
  width: auto;
  height: auto;
  min-height: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 15px;
}
html.mobile-plein.mobile-tchat .tchat-panneau .t-tete { padding: 10px 10px 10px 14px; min-height: 54px; }
html.mobile-plein.mobile-tchat .tchat-panneau .t-ib { width: 40px; height: 40px; font-size: 22px; }
html.mobile-plein.mobile-tchat .tchat-panneau .t-tete-txt b { font-size: 17px; }
html.mobile-plein.mobile-tchat .tchat-panneau .t-tete-txt span { font-size: 13px; }

/* ==========================================================================
   ÉCRAN DE LANCEMENT (13/11/2026)
   --------------------------------------------------------------------------
   La fourche vibre (`diapason-vibre`, l'animation du logo cliqué), trois ondes
   s'en échappent, le nom monte ; le tout s'efface après 1,5 s (mobile.js).
   Masqué partout ailleurs que sur un écran de téléphone. Toujours sombre,
   comme le bandeau : pas de réplique `html.sombre`.
   ========================================================================== */
.mb-lancement { display: none; }
@media (max-width: 760px), (pointer: coarse) and (max-height: 500px) {
  .mb-lancement {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #1b2228;
    color: #fff;
    transition: opacity .4s ease, visibility .4s;
  }
}
.mb-lancement.fin { opacity: 0; visibility: hidden; }
/* Le dessin garde l'échelle du premier jet (112 px pour 48 unités) ; la boîte
   est élargie (-6 -6 64 56) pour que les arcs tiennent autour de la fourche. */
.mb-lancement .diapason-symbole { width: 149px; height: 131px; overflow: visible; cursor: default; pointer-events: none; }
.mb-lancement .diapason-symbole .onde { stroke: #fff; }
.mb-lancement .diapason-symbole.vibre .fourche { animation-delay: .15s; }
.mb-lancement .diapason-symbole.vibre .onde { animation-delay: .15s; }
/* Variante C : deux paires d'arcs, à gauche et à droite, qui naissent HORS
   de la fourche (les cercles du premier jet partaient de son centre et se
   dessinaient par-dessus : « recroquevillés », 13/11/2026). */
.mb-arc {
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
  opacity: 0;
  animation: mb-lancement-arc 1s ease-out both;
}
.mb-arc-1 { stroke: #fff; animation-delay: .3s; }
.mb-arc-2 { stroke: #dafe0a; animation-delay: .6s; }
@keyframes mb-lancement-arc {
  0%   { opacity: 0; }
  25%  { opacity: 1; }
  100% { opacity: 0; }
}
.mb-lancement-nom {
  margin-top: 14px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.01em;
  animation: mb-lancement-monte .6s .35s ease-out both;
}
.mb-lancement-sous {
  margin-top: 4px;
  color: #c9d2d8;
  font-size: 14px;
  letter-spacing: .08em;
  animation: mb-lancement-monte .6s .6s ease-out both;
}
@keyframes mb-lancement-monte {
  0%   { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: none; }
}
.mb-lancement-mobile {
  margin-top: -2px;
  color: #dafe0a;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  animation: mb-lancement-monte .6s .45s ease-out both;
}

/* ==========================================================================
   MA JOURNÉE, TIRER POUR RAFRAÎCHIR, RMA (13/11/2026)
   ========================================================================== */
/* ---- « Fait », « Reporter », « Rétablir » sur les cartes ---- */
.mb-carte-actions { display: flex; gap: 8px; margin-top: 10px; }
.mb-geste {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
  color: var(--gris-texte);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
}
.mb-geste .ico { width: 18px; height: 18px; }
.mb-geste-fait { background: var(--vert); border-color: var(--vert-bord); color: var(--vert-texte); }
.mb-geste:disabled, .mb-geste[aria-busy] { opacity: .6; }
.mb-carte.mb-sortie {
  overflow: hidden;
  opacity: 0;
  height: 0 !important;
  margin-bottom: 0;
  transition: opacity .2s ease, height .3s ease .05s, margin .3s ease .05s;
}
.mb-choix-date { display: flex; align-items: flex-end; gap: 8px; margin-top: 4px; }
.mb-choix-date .mb-champ { flex: 1; }
.mb-choix-date .mb-bouton { margin: 0; flex: none; min-height: 46px; }

/* ---- Tirer pour rafraîchir ---- */
.mb-tirer {
  position: fixed;
  left: 50%;
  top: 64px;
  z-index: 80;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blanc);
  color: var(--gris-doux);
  box-shadow: var(--ombre);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translate(-50%, -50px);
  pointer-events: none;
}
.mb-tirer .ico { width: 22px; height: 22px; }
.mb-tirer.pret { color: var(--chrome-texte); }
.mb-tirer.tourne .ico { animation: mb-tourne .8s linear infinite; }
@keyframes mb-tourne { to { transform: rotate(360deg); } }
html:not(.mobile-plein) .mb-tirer { display: none; }

/* ---- Atelier à trois segments ---- */
.mb-segments-3 { grid-template-columns: repeat(3, 1fr); }

/* ---- RMA ---- */
.mb-rma-etat {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
.mb-rma-ligne-etat { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; }
.mb-rma-ligne-etat .mb-sous { font-size: 13px; }
/* Stock occasion : l'exception qui doit se voir (même parti que le bureau). */
.mb-rma-occasion {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--chrome);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
html.sombre .mb-rma-occasion { background: #12161a; border: 1px solid var(--accent); color: var(--accent); }
.mb-segment.occasion.actif { background: var(--chrome); color: #fff; }
html.sombre .mb-segment.occasion.actif { background: #12161a; color: var(--accent); }
.mb-rma-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mb-rma-alerte { margin: 6px 0 0; color: var(--rouge); font-size: 14px; font-weight: 600; }
.mb-rma-alerte.hidden { display: none; }
.mb-rma-dates { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; color: var(--gris-doux); font-size: 14px; }
.mb-rma-dates:empty { display: none; }
#mb-rma .mb-champ select { appearance: auto; }
#mb-rma .mb-bouton .ico { width: 20px; height: 20px; vertical-align: -4px; }

/* ==========================================================================
   MA TOURNÉE (lot B des tournées, 13/11/2026)
   ========================================================================== */
.mb-tournee { margin-bottom: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--bordure); }
.mb-tournee-tete { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.mb-tournee-tete h2 { margin: 0; font-size: 17px; }
.mb-tournee-iti { margin: 4px 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mb-tournee-iti .ico { width: 20px; height: 20px; }
.mb-tournee-vide { margin: 12px 8px; }

.mb-arret {
  margin-bottom: 8px;
  padding: 10px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  background: var(--blanc);
}
.mb-arret.prochain { border: 2px solid var(--chrome-texte); }
.mb-arret.fait { opacity: .6; }
.mb-arret.fait .mb-arret-client { text-decoration: line-through; }
.mb-arret-haut { display: flex; align-items: flex-start; gap: 10px; }
.mb-arret-rang {
  flex: none;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--chrome);
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
  display: grid;
  place-items: center;
}
html.sombre .mb-arret-rang { background: #12161a; border: 1px solid var(--accent); }
.mb-arret-corps {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--gris-texte);
  font: inherit;
  text-align: left;
}
.mb-arret-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; color: var(--gris-doux); font-size: 13px; }
.mb-arret-prochain { padding: 0 6px; border-radius: 4px; background: var(--chrome); color: var(--accent); font-size: 11px; }
html.sombre .mb-arret-prochain { background: #12161a; border: 1px solid var(--accent); }
.mb-arret-client { margin-top: 2px; font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mb-arret-client span { font-weight: 400; color: var(--gris-doux); font-size: 14px; }
.mb-arret-detail {
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.mb-arret-ordre { flex: none; display: flex; flex-direction: column; gap: 4px; }
.mb-arret-ordre button {
  width: 40px;
  height: 34px;
  border: 1px solid var(--bordure);
  border-radius: 8px;
  background: var(--fond);
  color: var(--gris-texte);
  display: grid;
  place-items: center;
}
.mb-arret-ordre button:disabled { opacity: .3; }
.mb-arret-ordre .ico { width: 20px; height: 20px; }
.mb-arret-gestes { display: flex; gap: 8px; margin-top: 10px; }
.mb-arret-gestes .mb-geste { text-decoration: none; }
.mb-geste-retirer { flex: none; width: 46px; }
.mb-tournee-ajouts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.mb-tournee-ajouts .mb-bouton { margin: 0; }

/* Étapes de la fiche de bibliothèque (24/11/2026) */
.mb-etapes { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.mb-etapes li p { margin: 0 0 6px; line-height: 1.4; }
.mb-etape-photo { width: 100%; height: auto; aspect-ratio: 4 / 3; }
.mb-etape-photo img { width: 100%; height: 100%; object-fit: cover; }