/* Vue mobile (/m/) — chargée APRÈS style.css, dont elle reprend les variables de
   thème, les boutons, les badges, les modales et les interrupteurs .astreinte-*. */

:root {
  --m-nav-h: 60px;
}

/* L'attribut `hidden` doit gagner sur nos règles de mise en page.
   Le navigateur ne le rend que par `[hidden] { display: none }` dans SA feuille de
   style : n'importe quelle règle d'auteur portant un `display` la bat, quelle que soit
   la spécificité. Sans la ligne ci-dessous, `.m-segments { display: flex }` rendait
   visible le sélecteur VIGIE/PCM d'un cadre de permanence — un sélecteur pourtant sans
   gestionnaire de clic, puisqu'il n'a qu'un seul périmètre autorisé. Deux boutons morts.
   Même piège pour `.m-limit-notice` et `.m-icon-btn`. */
[hidden] { display: none !important; }

.m-body {
  /* Place pour la barre d'onglets fixée en bas (encoche iOS comprise). */
  padding-bottom: calc(var(--m-nav-h) + env(safe-area-inset-bottom));
}

/* ── En-tête ─────────────────────────────────────────────────────────────── */
.m-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .9rem 1rem calc(.9rem - 2px);
  padding-top: calc(.9rem + env(safe-area-inset-top));
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.m-header-id { min-width: 0; flex: 1; }
.m-btn-back { flex: none; margin-right: -.25rem; }
.m-header h1 {
  font-size: 1.15rem; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-user {
  display: block; color: var(--text-muted); font-size: .8rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-header-actions { display: flex; gap: .35rem; flex: none; }
.m-icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer;
}
.m-icon-btn:active { background: var(--border); }
/* Le bouton ⓘ porte l'en-tête à quatre icônes : sur un écran étroit (iPhone SE),
   elles mangeaient le titre. */
@media (max-width: 380px) {
  .m-header-actions { gap: .25rem; }
  .m-icon-btn { width: 40px; height: 40px; }
}

/* ── Bandeau d'installation (PWA) ────────────────────────────────────────── */
/* Affiché tant que l'application n'est pas sur l'écran d'accueil et que le cadre ne
   l'a pas écarté (modules/m/install.js). */
.m-install {
  display: flex; align-items: flex-start; gap: .75rem;
  margin: .9rem 1rem 0; padding: .8rem .9rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
}
.m-install-icon {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 36px; height: 36px; border-radius: 9px;
  background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-text);
}
.m-install-body { flex: 1; min-width: 0; }
.m-install-title { margin: 0 0 .15rem; font-size: .92rem; font-weight: 600; }
.m-install-hint { margin: 0; font-size: .82rem; color: var(--text-muted); line-height: 1.45; }
/* L'icône « Partager » est insérée au fil du texte : elle doit s'aligner dessus. */
.m-install-hint svg { vertical-align: -2px; }
.m-install-btn { width: auto; margin-top: .6rem; padding: .4rem .9rem; font-size: .85rem; }
.m-install-close { width: 40px; height: 40px; flex: none; border-radius: 8px; }

/* Bandeau « nouvelle version » : même gabarit, action alignée à droite plutôt que sous
   le texte — il n'y a rien à lire, juste un bouton à toucher. */
.m-update { align-items: center; }
.m-update-btn { flex: none; width: auto; padding: .45rem .9rem; font-size: .85rem; }

/* ── Onglet Paramètres : cartes ──────────────────────────────────────────── */
/* Trois réglages qui n'ont rien à voir (acheminement du PC, comptes, mes mobiles)
   rendus dans une seule page : chacun dans sa carte bordée, au titre court, et ce qu'il
   y avait à expliquer derrière un ⓘ (modules/m/card.js). Les blocs internes
   (.astreinte-row, .gestion-dest, .gestion-cadre) passent sur --surface2 : une carte
   dans une carte de la même couleur ne se lit plus. */
#gestion-body.pending, #params-body.pending { opacity: .55; pointer-events: none; }
.m-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: .9rem 1rem 1rem; margin-bottom: 1rem;
}
.m-card-head {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  margin: 0 0 .8rem;
}
.m-card-title { margin: 0; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
/* Le ⓘ : 36 px de cible, un cercle discret — il ne doit pas concurrencer l'interrupteur
   voisin, seulement dire « il y a plus à lire ». */
.m-help {
  flex: none; width: 36px; height: 36px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text-muted);
  cursor: pointer;
}
.m-help:active { background: var(--border); color: var(--text); }
.m-card .astreinte-row { background: var(--surface2); padding: .8rem .9rem; margin-bottom: .6rem; }
.m-card .astreinte-actions { margin-bottom: 0; }
.m-card .form-group:last-of-type { margin-bottom: .6rem; }

/* Où sonnent les appels EN CE MOMENT — la seule chose qu'un cadre réveillé à 3 h du
   matin doit pouvoir lire d'un coup d'œil, avant même de toucher un interrupteur. */
.gestion-dest {
  display: flex; flex-direction: column; gap: .2rem;
  border-radius: 12px; padding: .85rem 1rem; margin-bottom: .8rem;
  border: 1px solid var(--border); background: var(--surface2);
  border-left: 4px solid var(--text-muted);
}
.gestion-dest.is-normal   { border-left-color: var(--success); }
.gestion-dest.is-overflow { border-left-color: var(--orange); }
.gestion-dest.is-vigie    { border-left-color: var(--red); }
.gestion-dest-lead   { font-size: .78rem; color: var(--text-muted); }
.gestion-dest-label  { font-size: 1.15rem; font-weight: 700; }
.gestion-dest-detail { font-size: .82rem; color: var(--text-muted); line-height: 1.4; }

/* Levier sans effet dans l'état courant : visible (il dit quelque chose de l'état)
   mais clairement inopérant. */
.astreinte-row.is-muted { opacity: .55; }
.astreinte-toggle:disabled { cursor: not-allowed; }

/* Comptes : le bouton d'ajout d'abord, les listes repliées dessous — on vient ici pour
   ajouter quelqu'un, pas relire vingt noms. L'état ouvert/fermé survit aux rendus
   (gestion.js le mémorise). */
.gestion-add {
  display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%;
  margin-bottom: .6rem;
}
.m-fold { border-top: 1px solid var(--border); }
.m-fold summary {
  list-style: none; display: flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .45rem 0; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.m-fold summary::-webkit-details-marker { display: none; }
.m-fold summary::after {
  content: '▾'; margin-left: auto; color: var(--text-muted); transition: transform .15s;
}
.m-fold[open] summary::after { transform: rotate(180deg); }
.m-fold-count { font-weight: 400; font-size: .85rem; color: var(--text-muted); }
.gestion-cadres { list-style: none; margin: 0 0 .7rem; padding: 0; }
.gestion-cadre {
  display: flex; flex-direction: column; gap: .1rem;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  padding: .6rem .8rem; margin-bottom: .45rem;
}
.gestion-cadre-name { font-size: .95rem; font-weight: 600; }
.gestion-cadre-sub  { font-size: .78rem; color: var(--text-muted); word-break: break-word; }
.gestion-field-hint {
  margin: .3rem 0 0; font-size: .76rem; color: var(--text-muted); line-height: 1.45;
}

/* Rappel des lignes : une liste sobre, un numéro par ligne, lisible et dictable. */
.m-lines { display: flex; flex-direction: column; }
.m-lines-row {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .55rem 0; border-top: 1px solid var(--border);
}
.m-lines-row:first-child { border-top: none; padding-top: 0; }
.m-lines-row:last-child { padding-bottom: 0; }
.m-lines-row span { display: flex; flex-direction: column; min-width: 0; font-size: .92rem; font-weight: 600; }
.m-lines-row small { font-size: .72rem; font-weight: 400; color: var(--text-muted); line-height: 1.3; }
.m-lines-row strong { font-size: 1rem; letter-spacing: .03em; white-space: nowrap; }

/* ── Sections ────────────────────────────────────────────────────────────── */
#m-view { padding: 1.1rem 1rem 1.5rem; }
.m-section { display: none; }
.m-section.active { display: block; }

/* Écran « pas de connexion » (modules/m/connexion.js) : il remplace l'onglet affiché,
   sauf le dépannage, qui fonctionne sans réseau. En-tête et barre d'onglets restent. */
#m-offline { display: none; }
body.m-horsligne:not([data-tab="depannage"]) #m-offline { display: block; }
body.m-horsligne:not([data-tab="depannage"]) .m-section { display: none; }
.m-offline-inner {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .7rem; padding: 2.2rem .6rem 1rem;
}
.m-offline-icon {
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--surface2); color: var(--text-muted);
}
.m-offline-inner h2 { margin: .3rem 0 0; font-size: 1.2rem; }
.m-offline-inner p { margin: 0; font-size: .92rem; line-height: 1.45; color: var(--text-muted); }
/* Même encadré que la page 503 du site : ce qui continue de marcher. */
.m-offline-reassure {
  display: flex; gap: .55rem; align-items: flex-start; text-align: left;
  background: color-mix(in srgb, var(--success) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--success) 30%, transparent);
  border-radius: 10px; padding: .7rem .85rem; margin-top: .3rem;
  font-size: .84rem; line-height: 1.5;
}
.m-offline-reassure svg { flex: none; margin-top: 2px; color: var(--success); }
.m-offline-reassure strong { color: var(--success); }
.m-offline-inner .m-offline-note { font-size: .84rem; }
.m-offline-inner .btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; min-width: 60%; margin-top: .4rem; }
.m-offline-inner .m-offline-auto { font-size: .76rem; }
.m-offline-dep {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  width: 100%; margin-top: 1.2rem; padding-top: 1.2rem; border-top: 1px solid var(--border);
}

.m-empty { color: var(--text-muted); font-size: .9rem; padding: 1.2rem .2rem; text-align: center; }
.m-error { color: var(--danger); }
.m-btn-soft {
  width: auto; background: var(--surface); border: 1px solid var(--border); color: var(--text);
}

/* ── Barre d'onglets ─────────────────────────────────────────────────────── */
.m-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(var(--m-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.m-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; gap: .15rem; padding: 0 2px; border: none; background: none;
  color: var(--text-muted); font-size: .72rem; cursor: pointer;
}
.m-tab.active { color: var(--accent-text); }
.m-tab.active svg { stroke-width: 2.4; }
/* Cinq onglets au plus (au-delà, « Plus » regroupe les autres, mobile.js) : 72 px chacun
   sur un écran de 360 px. Le libellé ne descend pas sous 11 px ; s'il ne tient pas (police
   système agrandie), il est coupé avec des points de suspension au lieu de pousser le
   dernier onglet hors de l'écran — d'où le min-width: 0 du bouton flex. */
.m-tab span {
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 380px) {
  .m-tab { font-size: .68rem; padding: 0 1px; }
}
.m-nav {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Feuille « Plus » : les onglets qui n'ont pas de place dans la barre. */
.m-navplus { display: flex; flex-direction: column; margin: 0 -.25rem; }
.m-navplus-item {
  display: flex; align-items: center; gap: .9rem;
  min-height: 52px; padding: .5rem .5rem;
  background: none; border: none; border-bottom: 1px solid var(--border);
  color: var(--text); font: inherit; font-size: 1rem; text-align: left; cursor: pointer;
}
.m-navplus-item:last-child { border-bottom: none; }
.m-navplus-item span { flex: 1; }
.m-navplus-item svg:first-child { color: var(--accent-text); }
.m-navplus-item svg:last-child { color: var(--text-muted); }

/* ── Mon astreinte ───────────────────────────────────────────────────────── */
/* Interrupteurs du cadre de permanence : venus de style.css avec l'ancienne page
   autonome /astreinte, dont la vue mobile est désormais le seul consommateur. */
/* Une bascule en cours verrouille les autres interrupteurs, mais ne grise plus toute la
   page : c'est l'interrupteur touché qui montre l'attente (.astreinte-toggle.pending),
   là où le doigt regarde. Griser l'écran entier pour un aller-retour de quelques
   dizaines de millisecondes donnait l'impression d'une page qui rame. */
#astreinte-body.pending { pointer-events: none; }
/* Bandeau d'état : c'est la première chose que lit un cadre réveillé à 3 h. Pleine
   largeur (l'ancienne pastille en ligne se perdait en haut de page) et doublé d'une
   phrase qui dit ce que l'état implique. */
.astreinte-status {
  display: flex; flex-direction: column; gap: .15rem; border-radius: 12px;
  padding: .8rem 1rem; margin-bottom: 1.1rem; color: #fff;
}
.astreinte-status-label { font-size: 1.05rem; font-weight: 700; }
.astreinte-status-sub { font-size: .82rem; opacity: .9; line-height: 1.35; }
/* Aplats portant du texte blanc : ils prennent les tokens `-fill`, assez foncés pour
   cela dans les deux thèmes. « En pause » posait du texte sombre sur le jaune vif ;
   comme `--yellow` s'assombrit maintenant en thème clair, ce bandeau repasse lui aussi
   en texte blanc — sans quoi il aurait viré au sombre sur sombre. */
.astreinte-status.st-vigie { background: var(--success-fill); }
.astreinte-status.st-overflow { background: var(--accent-fill); }
.astreinte-status.st-paused { background: var(--warning-fill); color: #fff; }
.astreinte-status.st-inactif { background: var(--surface2); color: var(--text-muted); }
/* COT : pastille jour / nuit, discrète, en bout de ligne du bandeau. */
.cot-m-status-label { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.cot-m-mode {
  display: inline-flex; align-items: center; gap: .25rem; flex: none;
  font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
  background: color-mix(in srgb, currentColor 16%, transparent); opacity: .9;
}
/* Le numéro de la ligne VIGIE, juste sous l'état : c'est LE numéro à connaître —
   celui que composent les appelants et qu'on donne aux correspondants — à ne pas
   confondre avec la présentation « VIGIE → cadre » qui s'affiche quand on est sonné. */
.astreinte-line {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: -.5rem 0 1.1rem; padding: .55rem .9rem; border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: .82rem; color: var(--text-muted);
}
.astreinte-line svg { color: var(--accent); flex: none; }
.astreinte-line strong { margin-left: auto; font-size: 1.1rem; color: var(--text); letter-spacing: .5px; white-space: nowrap; }
.astreinte-section {
  font-size: .78rem; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: .04em; margin: .2rem 0 .6rem;
}
.astreinte-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 1rem 1.1rem; margin-bottom: .9rem;
}
/* Les deux seuls leviers du cadre, groupés en tête : prendre l'astreinte, ou se
   mettre en pause. Le réglage fin (quels mobiles) est relégué en bas de page. */
.astreinte-actions { margin-bottom: 1.3rem; }
.astreinte-actions .astreinte-row:last-child { margin-bottom: 0; }
.astreinte-row-main { border-color: var(--accent); }
.astreinte-row-pause { border-color: var(--warning); }
.astreinte-row-info { display: flex; flex-direction: column; gap: .2rem; }
.astreinte-row-label { font-size: 1rem; font-weight: 600; }
.astreinte-row-num { font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.astreinte-row-sub { font-size: .8rem; color: var(--text-muted); }
/* Qui est joignable — deux blocs côte à côte, chacun de la couleur de son rôle
   (vert = astreinte 690, bleu = débordement 695), pour qu'on lise l'appartenance
   sans lire le titre. Les listes sont disjointes (cf. astreinte.user_state). */
/* `align-items: start` : les deux colonnes n'ont aucune raison d'avoir la même
   hauteur. Étirées (défaut de la grille), « D'astreinte VIGIE » — souvent un seul
   nom — se retrouvait aux deux tiers vide pour s'aligner sur la liste des cadres en
   débordement, qui en compte cinq ou six. Chaque carte tient maintenant à son
   contenu. */
.astreinte-who {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: start;
  gap: .6rem; margin: 0 0 1.3rem;
}
.astreinte-who-grp { border-radius: 12px; padding: .75rem .85rem; border: 1px solid var(--border); }
.astreinte-who-grp.is-vigie {
  background: color-mix(in srgb, var(--success) 9%, transparent);
  border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}
.astreinte-who-grp.is-overflow {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
}
.astreinte-who-title {
  display: flex; align-items: center; gap: .35rem; margin: 0 0 .45rem;
  font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700;
}
.astreinte-who-grp.is-vigie .astreinte-who-title { color: var(--success); }
.astreinte-who-grp.is-overflow .astreinte-who-title { color: var(--accent-text); }
.astreinte-who-list { list-style: none; margin: 0; padding: 0; }
.astreinte-who-item { padding: .2rem 0; line-height: 1.3; }
.astreinte-who-item.is-self { font-weight: 700; }
.astreinte-who-name { display: block; font-size: .92rem; }
.astreinte-who-empty { font-size: .88rem; color: var(--text-muted); }
/* « + les cadres d'astreinte » : rappel que la colonne débordement les inclut sans
   les répéter. Discret — c'est une note de lecture, pas une entrée de la liste. */
.astreinte-who-also {
  padding: .2rem 0; font-size: .82rem; font-style: italic; color: var(--text-muted);
}
.astreinte-you { font-size: .8rem; color: var(--text-muted); font-weight: 400; }
/* Interrupteur on/off */
/* Éteint, la piste est en --surface2 : sur une carte blanche elle se voit, mais sur
   une carte grise (Paramètres → « Renvoi mobile ») c'est exactement la même couleur
   et il ne restait qu'un rond blanc flottant, sans rien qui dise « interrupteur ».
   Un cerne interne le détache de n'importe quel fond ; en box-shadow plutôt qu'en
   border pour ne pas décaler le curseur, positionné au pixel près. */
.astreinte-toggle {
  position: relative; flex: none; width: 64px; height: 36px; border-radius: 999px;
  border: none; background: var(--surface2); cursor: pointer;
  transition: background .2s, box-shadow .2s;
  box-shadow: inset 0 0 0 1px var(--border);
  padding: 0;
}
.astreinte-toggle .astreinte-knob {
  position: absolute; top: 3px; left: 3px; width: 30px; height: 30px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .2s;
}
.astreinte-toggle.on { background: var(--success); box-shadow: none; }
.astreinte-toggle.on .astreinte-knob { transform: translateX(28px); }
.astreinte-toggle.pending { opacity: .5; pointer-events: none; }
.astreinte-empty {
  color: var(--text-muted); font-size: .92rem; line-height: 1.5; background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 1.1rem;
}
/* Le raccourci vers « Paramètres » : sur sa propre ligne, sans quoi il se colle à la
   dernière ligne du texte et ne se lit plus comme un bouton. */
.astreinte-empty .btn { display: block; margin-top: .85rem; }
.astreinte-msg { min-height: 1.2rem; margin: 1rem 0 0; font-size: .9rem; color: var(--success); }
.astreinte-msg.error { color: var(--danger); }

.m-warn {
  background: color-mix(in srgb, var(--orange) 12%, var(--surface));
  border: 1px solid var(--orange); border-radius: 8px;
  padding: .85rem 1rem; margin: 0 0 1.4rem; font-size: .9rem; line-height: 1.5;
}
.m-warn strong:first-child { color: var(--orange); }
.m-warn p { margin: .45rem 0 0; color: var(--text); }
.m-warn-num { font-weight: 700; font-size: 1.05rem; letter-spacing: .5px; white-space: nowrap; }
.m-warn-nums {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
  margin: .6rem 0;
}
.m-warn-nums .m-warn-num {
  padding: .3rem .7rem; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
/* Chaque numéro porte sa légende ; celui de la ligne VIGIE est plein (accent) :
   c'est le vrai numéro de l'astreinte, l'autre n'est qu'une présentation. */
.m-warn-num small {
  display: block; font-size: .64rem; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; opacity: .8; margin-bottom: .1rem;
}
.m-warn-nums .m-warn-num-main { background: var(--accent-fill); color: #fff; border-color: var(--accent-fill); }
.m-warn-num-inline { font-weight: 700; white-space: nowrap; }
/* « C'est fait » : acquitte le bandeau, qui ne revient plus (localStorage). */
/* Le « pourquoi » de la consigne de première configuration : replié par défaut, même
   grammaire de dépliant que .m-fold (chevron à droite, cible de 44 px). */
.m-warn-why { margin-top: .7rem; border-top: 1px solid color-mix(in srgb, var(--orange) 35%, transparent); }
.m-warn-why summary {
  list-style: none; display: flex; align-items: center; gap: .4rem;
  min-height: 44px; padding: .45rem 0; font-weight: 600; cursor: pointer; color: var(--text);
}
.m-warn-why summary::-webkit-details-marker { display: none; }
.m-warn-why summary::after {
  content: '▾'; margin-left: auto; color: var(--text-muted); transition: transform .15s;
}
.m-warn-why[open] summary::after { transform: rotate(180deg); }
.m-warn-ack { width: 100%; margin-top: .9rem; }
/* Même consigne, dans la modale du bouton ⓘ : ni cadre ni couleur d'alerte,
   c'est de la documentation, pas un avertissement. */
.m-setup-modal { font-size: .9rem; line-height: 1.5; }
.m-setup-modal p { margin: .45rem 0 0; }
.m-setup-modal .m-warn-nums { margin: .7rem 0; }

/* ── Planning ────────────────────────────────────────────────────────────── */
.m-planning-current { font-size: .82rem; color: var(--text-muted); margin: 0 0 .8rem; line-height: 1.5; }
.m-planning-actions { display: flex; gap: .5rem; margin-bottom: .8rem; }
.m-planning-actions .btn { flex: 1; width: auto; padding: .6rem .5rem; }
.m-planning-legend { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .9rem; }
/* La barre d'outils de FullCalendar déborde sur un écran étroit. */
/* ── Planning VIGIE en vue liste ──
   Les couleurs viennent de l'habillage FullCalendar de style.css (variables --fc-*),
   qui suit le thème. Ici, seulement ce qui relève de la place disponible sur un
   téléphone. */

/* Barre d'outils : sur 360 px, prev/next + titre + deux boutons de vue ne tiennent
   pas sur une ligne. Le titre prend toute la largeur au-dessus, les commandes se
   partagent celle du dessous. */
#vigie-planning-cal .fc-toolbar { flex-wrap: wrap; gap: .5rem .4rem; justify-content: space-between; }
#vigie-planning-cal .fc-toolbar-title { font-size: 1.05rem; }
#vigie-planning-cal .fc-toolbar-chunk:nth-child(2) { order: -1; flex: 1 0 100%; text-align: center; }
/* 36 px de haut : on vise ces boutons au pouce. */
#vigie-planning-cal .fc .fc-button {
  padding: .4rem .7rem; font-size: .85rem; min-height: 36px;
}

/* Une ligne de créneau = l'heure, une pastille, un nom. Sur un écran étroit, la
   colonne d'heure doit rester compacte et le nom prendre le reste, en passant à la
   ligne plutôt qu'en débordant. */
#vigie-planning-cal .fc .fc-list-table td { padding: .55rem .6rem; }
#vigie-planning-cal .fc-list-event-title { white-space: normal; line-height: 1.35; }
#vigie-planning-cal .fc .fc-list-event-time { font-size: .76rem; max-width: 6.5rem; }
#vigie-planning-cal .fc .fc-list-day-cushion { padding: .45rem .6rem; font-size: .72rem; }
/* La ligne entière est cliquable : elle doit offrir une cible franche. */
#vigie-planning-cal .fc-list-event { cursor: pointer; }
#vigie-planning-cal .fc-list-event:active td { background: var(--surface2); }

/* ── Historique ──────────────────────────────────────────────────────────── */
.m-filters { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.m-filter-row { display: flex; gap: .5rem; }
.m-filter-row input, .m-filter-row select { flex: 1; min-width: 0; }
/* Affinage de l'historique, replié : même grammaire de dépliant que .m-fold. */
.m-filters-more { display: flex; flex-direction: column; gap: .6rem; }
.m-filters-more summary {
  list-style: none; display: flex; align-items: center; gap: .45rem;
  min-height: 44px; font-size: .9rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer;
}
.m-filters-more summary::-webkit-details-marker { display: none; }
.m-filters-more summary::after {
  content: '▾'; margin-left: auto; transition: transform .15s;
}
.m-filters-more[open] summary::after { transform: rotate(180deg); }
/* Un critère posé doit se voir même replié : sans quoi une liste filtrée se lirait
   comme une liste vide. */
.m-filters-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--accent-fill); color: #fff; font-size: .7rem; font-weight: 700;
}
.m-filters-count[hidden] { display: none; }
.m-segments {
  display: flex; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px; gap: 3px;
}
.m-seg {
  flex: 1; min-height: 40px; padding: .5rem .3rem; border: none; border-radius: 7px; background: none;
  color: var(--text-muted); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.m-seg.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.m-limit-notice { font-size: .78rem; color: var(--text-muted); margin: 0; }

.m-calls { display: flex; flex-direction: column; gap: .5rem; }
.m-call {
  display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .8rem .9rem; color: var(--text); cursor: pointer;
}
.m-call:active { background: var(--surface2); }
/* Appel sortant : liseré + flèche + libellé colorés. Déclaré AVANT .m-call-emergency,
   qui doit garder la main sur la couleur du liseré (la largeur, elle, reste acquise). */
.m-call-out { border-left: 3px solid var(--accent); }
.m-call-out .m-call-dir { color: var(--accent-text); }
.m-call-out-tag {
  color: var(--accent-text); font-weight: 700; text-transform: uppercase;
  font-size: .7rem; letter-spacing: .03em;
}
.m-call-out-tag::after { content: ' · '; color: var(--text-muted); font-weight: 400; }
.m-call-emergency { border-color: var(--red); }
.m-call-dir { flex: none; color: var(--text-muted); display: flex; }
.m-call-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.m-call-title {
  font-weight: 600; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-call-sub {
  font-size: .78rem; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-call-emerg { font-size: .75rem; color: var(--red); display: flex; align-items: center; gap: .25rem; }
.m-call-emerg svg { flex: none; }
.m-call-emerg span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-call-right {
  flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: .3rem;
}
/* Marque GesCOT en tête de la ligne secondaire d'un appel (modules/m/cdr.js). */
.m-call-sub .contact-badge-gescot { margin: 0 .35rem 0 0; }
/* Étoile et note : dans le coin bas droit, hors du flux — empilées sous la pastille,
   elles grandissaient les seules cartes qui en portent, et la liste n'avait plus deux
   lignes de même hauteur. */
.m-call { position: relative; }
.m-call-marks {
  position: absolute; right: .9rem; bottom: .3rem;
  display: flex; gap: .25rem; color: var(--text-muted);
}
.m-mark.flagged { color: var(--yellow); }

/* Feuille de détail d'un appel */
.m-detail { font-size: .9rem; }
.m-detail-audio { margin-bottom: 1rem; }
.m-detail-audio audio { width: 100%; }
.m-detail-tools { display: flex; gap: .5rem; margin: 1rem 0 .8rem; flex-wrap: wrap; }
.m-flag { display: flex; align-items: center; justify-content: center; gap: .4rem; flex: 1; }
.m-flag.flagged { border-color: var(--yellow); color: var(--yellow); }
/* Rappel VIGIE : couleur de l'astreinte, comme le bouton du panel de bureau. */
.m-callback {
  display: flex; align-items: center; justify-content: center; gap: .4rem; flex: 1;
  border-color: var(--orange); color: var(--orange);
}
.m-callback:disabled { opacity: .5; }
.m-note {
  width: 100%; min-height: 80px; resize: vertical;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 8px;
  padding: .6rem .7rem; color: var(--text); font-family: inherit; font-size: .9rem;
}
.m-detail-footer { display: flex; gap: .6rem; margin-top: 1rem; }
.m-detail-footer .btn { flex: 1; width: auto; }

/* ── Appeler (appel en cours, composition, annuaire) ─────────────────────── */

/* Carte « appel en cours » (modules/m/call-live.js). En tête de page et pleine largeur :
   c'est la seule chose qui compte tant qu'un appel dure, et elle doit se lire d'un coup
   d'œil, téléphone à bout de bras. */
.m-live {
  display: flex; align-items: center; gap: .7rem;
  background: var(--surface); border: 1px solid var(--border); border-left-width: 3px;
  border-radius: 12px; padding: .8rem .9rem; margin-bottom: .9rem;
}
.m-live-icon { flex: none; display: flex; color: var(--text-muted); }
.m-live-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.m-live-title {
  display: flex; align-items: baseline; gap: .5rem;
  font-weight: 600; font-size: .95rem;
}
.m-live-sub { font-size: .78rem; color: var(--text-muted); line-height: 1.35; }
/* Le numéro composé, en petit à droite : de quoi vérifier qui l'on appelle sans que
   ça dispute la vedette à l'état de l'appel. */
.m-live-num {
  flex: none; align-self: flex-start;
  font-size: .72rem; color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.m-live-timer { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--green); }

/* Le téléphone sonne : liseré et icône d'attente, qui pulsent. Un appel en cours
   d'établissement n'est pas un état stable, et l'écran doit le dire. */
.m-live.is-wait, .m-live.is-ring { border-left-color: var(--orange); }
.m-live.is-wait .m-live-icon, .m-live.is-ring .m-live-icon {
  color: var(--orange); animation: m-live-pulse 1.4s ease-in-out infinite;
}
.m-live.is-talk { border-left-color: var(--green); }
.m-live.is-talk .m-live-icon { color: var(--green); }
.m-live.is-end { border-left-color: var(--border); opacity: .85; }

@keyframes m-live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
/* Respect du réglage système : une pastille qui clignote peut être invalidante. */
@media (prefers-reduced-motion: reduce) {
  .m-live.is-wait .m-live-icon, .m-live.is-ring .m-live-icon { animation: none; }
}

/* Numéro composé à la main : le bouton d'appel sous le champ de saisie, là où le
   pouce vient de taper — et non au milieu des résultats de recherche. */
.m-call-dial { display: flex; flex-direction: column; gap: .5rem; }
/* Vide (aucun numéro composable saisi), le conteneur ne doit pas laisser l'espacement
   de .m-filters sous le champ de recherche. */
.m-call-dial:empty { display: none; }
.m-call-go, .m-call-save {
  display: flex; align-items: center; justify-content: center; gap: .45rem;
  width: 100%; text-decoration: none;
}

/* ── Annuaire ────────────────────────────────────────────────────────────── */
.m-contacts { display: flex; flex-direction: column; gap: .5rem; }
.m-contact {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .7rem .8rem;
}
/* Nom (+ structure) à gauche, crayon à droite sur la même ligne. */
.m-contact-head { display: flex; align-items: flex-start; gap: .5rem; }
/* min-width:0 : sans lui, un nom long pousserait le crayon hors de la carte au lieu
   de passer à la ligne. */
.m-contact-id { flex: 1; min-width: 0; }
.m-contact-name { font-weight: 600; font-size: .95rem; }
.m-contact-company { font-size: .8rem; color: var(--text-muted); margin-top: .1rem; }
.m-contact-nonum { color: var(--text-muted); font-size: .8rem; }
.m-contact-edit {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; margin: -.3rem -.35rem 0 0;
  background: none; border: none; border-radius: 8px;
  color: var(--text-muted); cursor: pointer;
}
/* Marges négatives ci-dessus : la zone tactile déborde dans le rembourrage de la carte,
   ce qui donne 34px sous le doigt sans écarter le texte. */
.m-contact-edit:active { background: var(--surface2); color: var(--accent); }
.m-contact-numbers { display: flex; flex-direction: column; gap: .35rem; margin-top: .55rem; }
.m-contacts-hint {
  font-size: .78rem; color: var(--text-muted); line-height: 1.35; margin: 0 0 .2rem;
}
/* Ajout d'un contact : sous la recherche, donc visible aussi quand une recherche n'a
   rien donné — c'est précisément le moment où l'on veut créer la fiche. */
.m-contacts-add {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  width: 100%; margin-bottom: .8rem;
}
/* Bouton (rappel VIGIE) pour un cadre, lien tel: pour un opérateur : même apparence. */
.m-contact-call {
  display: flex; align-items: center; gap: .5rem; width: 100%; text-align: left;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 9px;
  padding: .6rem .7rem; color: var(--text); font-size: .95rem; font-weight: 600;
  font-family: inherit; text-decoration: none; cursor: pointer;
}
.m-contact-call:active { border-color: var(--accent); color: var(--accent); }
.m-contact-call:disabled { opacity: .5; }

/* ── Ajustements des briques partagées ───────────────────────────────────── */
/* Champs à 16px, et pas moins. iOS zoome d'autorité sur tout champ dont la police est
   sous ce seuil au moment où on le touche, puis laisse la page décalée : c'est ce qui
   donne l'impression que l'application « part en zoom » toute seule dès qu'on tape dans
   la recherche de l'annuaire ou dans un filtre d'historique. Le style commun
   (style.css) descend à .9rem, soit 14,4px (le rem se rapporte à <html>, 16px) — bien
   assez pour déclencher le zoom. Les pages autonomes (connexion, appel, rappel) ont la
   même règle sous 640px, dans style.css. 16px est un seuil technique, pas un choix esthétique : le baisser
   ne serait-ce qu'à 15px ramènerait le problème. Le pincement, lui, reste possible —
   c'est délibéré (accessibilité). */
.m-body input, .m-body select, .m-body textarea { font-size: 16px; }
/* Modales : pleine largeur, hauteur bornée (le clavier virtuel mange l'écran).
   Sous 640px, style.css les ancre déjà en bas (align-items: flex-end) avec des boutons
   pleine largeur empilés — c'est une feuille de bas d'écran, pas une boîte flottante.
   D'où l'importance du dvh : `vh` vaut la hauteur de l'écran SANS tenir compte du
   clavier (iOS ne la réduit jamais), si bien qu'une modale haute voyait son pied — donc
   « Créer » et « Enregistrer » — passer derrière le clavier. `dvh` suit la hauteur
   réellement visible ; la ligne en `vh` reste comme repli pour les vieux navigateurs. */
.m-body .modal-box {
  width: 100%; max-width: none; margin: 0 .5rem;
  max-height: 88vh;
  max-height: 88dvh;
  overflow-y: auto;
}
/* Plein écran (option `plein`) : seulement là où style.css le pose, sous 640px. Hors
   de ce seuil (téléphone en paysage, tablette), la fiche garde la borne de 88dvh :
   sans elle, plus haute que l'écran et centrée, son en-tête sortait par le haut. */
@media (max-width: 640px) {
  .m-body .modal-box.modal-plein { margin: 0; max-height: none; }
}
/* Le toast doit passer au-dessus de la barre d'onglets. */
.m-body #toast { bottom: calc(var(--m-nav-h) + env(safe-area-inset-bottom) + 1rem); }

/* ── STATISTIQUES VIGIE (pied de « Mon astreinte ») ──
   Repliées par défaut : la page sert d'abord à se rendre joignable ou non, et cette
   bascule doit rester à portée de pouce sans faire défiler des chiffres. */
.m-stats { margin-top: 1.75rem; }
.m-stats-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  width: 100%; padding: .8rem .1rem; min-height: 44px;
  background: none; border: none; border-top: 1px solid var(--border);
  color: var(--text); font: inherit; font-weight: 600; font-size: .95rem;
  cursor: pointer; text-align: left;
}
.m-stats-days { display: block; font-weight: 400; font-size: .75rem; color: var(--text-muted); }
.m-stats-caret { color: var(--text-muted); font-size: .9rem; }
.m-stats-empty { color: var(--text-muted); font-size: .88rem; padding: .5rem 0; }

.m-stats-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem;
  margin-bottom: 1.1rem;
}
.m-stat {
  background: var(--surface2); border-radius: 10px; padding: .6rem .7rem;
}
.m-stat-value { font-size: 1.35rem; font-weight: 600; line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.m-stat-label { font-size: .8rem; margin-top: .1rem; }
.m-stat-sub { font-size: .7rem; color: var(--text-muted); margin-top: .1rem; }

.m-cadre-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem; }
.m-cadre-top { display: flex; align-items: baseline; gap: .5rem; }
.m-cadre-name { flex: 1 1 auto; min-width: 0; font-size: .92rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-medal { margin-right: .25rem; }
.m-cadre-ring { flex: none; font-size: .9rem; font-variant-numeric: tabular-nums; }
/* Temps mesuré mais hors classement : lisible, sans inviter à le comparer. */
.m-cadre-ring.is-unranked { opacity: .55; }
.m-cadre-bar {
  height: 6px; border-radius: 3px; background: var(--surface2);
  overflow: hidden; margin: .3rem 0 .2rem;
}
.m-cadre-bar span { display: block; height: 100%; background: var(--accent); min-width: 2px; }
/* Pas de survol sur un téléphone : ce que le bureau met en infobulle est écrit ici. */
.m-cadre-note { font-size: .74rem; color: var(--text-muted); }
.m-stats-podium {
  margin: 1.1rem 0 0; padding-top: .8rem; border-top: 1px solid var(--border);
  font-size: .84rem; color: var(--text-muted);
}
.m-stats-podium strong { color: var(--text); }

/* ── Mes cellules (centre opérationnel) — modules/m/cot.js ────────────────── */
.cot-m-cell { margin-bottom: 1.2rem; }
.cot-m-cell .astreinte-section { display: flex; align-items: center; gap: .4rem; }
.cot-m-state { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--success); text-transform: none; letter-spacing: 0; }
.cot-m-ordered { list-style: decimal; padding-left: 1.3rem; }
/* Mon activation : un résumé, deux gros boutons, puis une ligne par cellule affectée. */
.cot-m-summary { margin: 0 0 .7rem; font-size: 1rem; font-weight: 600; color: var(--text-muted); }
.cot-m-summary.is-on { color: var(--success); }
.cot-m-all { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .9rem; }
.cot-m-all .btn { width: 100%; min-height: 44px; }
.cot-m-all .btn:disabled { opacity: .45; }
.cot-m-row { padding: .75rem .9rem; margin-bottom: .5rem; }
.cot-m-row.is-on { border-color: color-mix(in srgb, var(--success) 55%, var(--border)); }
.cot-m-row .astreinte-row-label { display: flex; align-items: center; gap: .35rem; }
.cot-m-row .cot-digit { margin: 0; }
.cot-m-toggles { display: flex; gap: .7rem; flex: none; }
.cot-m-slot { display: inline-flex; flex-direction: column; align-items: center; gap: .15rem; font-size: .68rem; color: var(--text-muted); }
.cot-m-member-acts { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; margin-top: .6rem; }
.cot-m-member-acts .btn { width: 100%; font-size: .82rem; padding: .5rem; }
.cot-m-member-acts .btn:disabled { opacity: .45; }
.cot-m-chips .vigie-chip.is-assigned { border: 2px solid var(--accent); color: var(--accent-text); }
#cot-m-body.pending { opacity: .55; pointer-events: none; }

/* ── Composer les cellules (cadres / admins) ──
   Un membre par ligne, ses cellules dépliées à la demande — et non chaque cellule
   dépliant tout le monde, qui multipliait les lignes par cinq. Replié par défaut :
   l'onglet sert d'abord à savoir qui sonne. */
.cot-m-compose { margin-top: 1.5rem; }
.cot-m-search { width: 100%; margin: .7rem 0; }
.cot-m-compose-note { font-size: .78rem; color: var(--text-muted); margin: 0 0 .7rem; }
.cot-m-compose-all {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--accent-text); text-decoration: underline;
}
.cot-m-compose-list { display: flex; flex-direction: column; gap: .5rem; }
.cot-m-member {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: .7rem .9rem;
}
.cot-m-member.is-open { border-color: var(--accent); }
.cot-m-member-head {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  width: 100%; min-height: 44px; justify-content: center;
  background: none; border: none; padding: 0; text-align: left;
  color: var(--text); font: inherit; cursor: pointer;
}
.cot-m-member-name { font-size: .95rem; font-weight: 600; }
.cot-m-member-sub { font-size: .78rem; color: var(--text-muted); }
/* Pastilles de cellule : celles du panel de bureau (.vigie-chip), agrandies — un pouce
   ne vise pas un bouton de 0,75 rem de haut. */
.cot-m-chips { margin-top: .7rem; }
.cot-m-chips .vigie-chip { padding: .45rem .7rem; font-size: .82rem; min-height: 44px; }

/* Accès au planning depuis le bas de « Mon astreinte » (onglet retiré de la barre). */
.m-planning-link { width: 100%; margin-top: 1.5rem; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; }

/* ── Paramètres : mes mobiles, le COT dans mes contacts — modules/m/parametres.js ── */
/* Le bouton d'enregistrement est l'action de la carte : pleine largeur, à portée de pouce. */
.m-params-save { width: 100%; margin-top: .2rem; }
/* La consigne « numéro du COT » tient en une ligne sous le numéro ; le pourquoi est
   derrière le ⓘ. Pas de fond orange : une fois le numéro enregistré, il crierait pour rien. */
.m-card .m-warn-nums { margin: 0 0 .7rem; }
.m-params-consigne { margin: 0; font-size: .9rem; line-height: 1.5; }
.m-params-done { margin: .7rem 0 0; color: var(--success); font-weight: 600; }
.m-card .m-warn-ack { margin-top: .7rem; }

/* ── Compte opérateur sur un téléphone — modules/m/operateur.js ───────────── */
/* Écran unique : ni onglets ni actions, seulement la raison pour laquelle il n'y en a
   pas. Centré et aéré, pour qu'on ne le prenne pas pour une page en cours de chargement. */
.m-blocked {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: .3rem; padding: 2.5rem 1rem 1rem; color: var(--text);
}
.m-blocked-icon { color: var(--text-muted); margin-bottom: .6rem; }
.m-blocked-title { margin: 0; font-size: 1.15rem; font-weight: 700; }
.m-blocked-text { margin: .5rem 0 0; font-size: .95rem; line-height: 1.5; max-width: 24rem; }
.m-blocked-sub {
  margin: 1.1rem 0 0; font-size: .82rem; line-height: 1.5;
  color: var(--text-muted); max-width: 24rem;
}

/* ── Dépannage guidé (modules/m/depannage*.js) ───────────────────────────────
   Écrit pour une main, debout, dans une salle où quelque chose ne marche pas. Trois
   partis pris :

   • UNE seule chose à décider par écran. La question en grand, les réponses dessous,
     et tout le contexte (ce que le serveur voit, le déroulé) replié.
   • Des cibles larges. 52 px de haut minimum : on appuie en marchant, parfois avec des
     gants. Un bouton manqué dans une panne, c'est un aller-retour de plus.
   • Aucune réponse privilégiée visuellement. « Oui » et « Non » sont deux constats, pas
     un chemin recommandé et une sortie de secours — les teinter différemment
     orienterait la réponse, ce qui fausserait le diagnostic. */

/* Le bouton d'action, un par écran au plus : lancer un test, appliquer un geste. */
.m-btn-primaire {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  width: 100%; min-height: 52px; padding: .7rem .9rem; margin-top: .3rem;
  border: 0; border-radius: 12px; cursor: pointer;
  background: var(--accent); color: #fff;
  font: inherit; font-size: .95rem; font-weight: 600; text-align: left;
}
.m-btn-primaire > span:first-child { display: flex; align-items: center; gap: .5rem; }
.m-btn-primaire svg { flex: none; }
.m-btn-primaire:active { filter: brightness(.92); }
.m-btn-primaire:disabled { opacity: .5; cursor: default; }
/* La durée annoncée, dans le bouton : on saura combien de temps on attend AVANT
   d'appuyer, pas après. */
.m-btn-note { font-size: .78rem; font-weight: 400; opacity: .85; white-space: nowrap; }

/* La carte d'appel, en tête des Paramètres. */
.m-card-action { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.m-card-pitch { margin: 0 0 .7rem; font-size: .88rem; line-height: 1.45; color: var(--text-muted); }

/* Le choix : symptôme ou réponse. Même famille, deux densités. */
.m-dep-choix {
  display: flex; align-items: center; gap: .7rem;
  width: 100%; min-height: 52px; padding: .65rem .85rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); color: var(--text);
  font: inherit; font-size: .95rem; text-align: left; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.m-dep-choix:active { background: var(--surface2); border-color: var(--accent); }
@media (hover: hover) {
  .m-dep-choix:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
}
.m-dep-choix-texte { flex: 1; min-width: 0; display: grid; gap: .1rem; }
.m-dep-choix-riche strong { font-size: .95rem; font-weight: 600; }
.m-dep-choix-riche span span,
.m-dep-choix-riche .m-dep-choix-texte > span {
  font-size: .82rem; line-height: 1.35; color: var(--text-muted);
}
.m-dep-choix-fleche { flex: none; font-size: 1.3rem; color: var(--text-muted); line-height: 1; }
/* La pastille des réponses : elle dit « choisis-en une », sans suggérer laquelle. */
.m-dep-puce {
  flex: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--border); background: transparent;
}
.m-dep-choix:active .m-dep-puce { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--accent); }

.m-dep-symptomes, .m-dep-reponses { display: grid; gap: .5rem; margin-top: .6rem; }

/* La question : le seul élément qui a le droit d'être gros. */
.m-dep-question {
  margin: .1rem 0 .45rem; font-size: 1.1rem; font-weight: 600; line-height: 1.35;
}
.m-dep-aide { margin: 0 0 .5rem; font-size: .88rem; color: var(--text-muted); line-height: 1.45; }
/* Pourquoi cette question est posée. Discret, mais toujours présent : un diagnostic qui
   ne s'explique pas se fait abandonner au troisième écran. */
.m-dep-raison {
  margin: .8rem 0 0; padding-top: .55rem; border-top: 1px solid var(--border);
  font-size: .78rem; color: var(--text-muted);
}
.m-dep-avert {
  margin: .5rem 0; padding: .55rem .7rem; border-radius: 10px;
  background: color-mix(in srgb, var(--yellow) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent);
  font-size: .85rem; line-height: 1.4;
}
.m-dep-titre {
  margin: 1.1rem 0 .4rem; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-muted); font-weight: 700;
}

/* ── La stratégie en cours (carte « Forcer un chemin ») ────────────────────── */
.m-dep-strategie { display: grid; gap: .7rem; margin-bottom: 1rem; }
.m-dep-usage {
  padding: .6rem .7rem; border-radius: 10px;
  background: var(--surface2); border: 1px solid var(--border);
}
.m-dep-usage-tete {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  margin-bottom: .45rem; font-size: .9rem;
}
.m-dep-chaine { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; }
.m-dep-maillon {
  padding: .18rem .5rem; border-radius: 999px; font-size: .8rem;
  border: 1px solid var(--border); color: var(--text-muted); background: var(--surface);
}
/* La liaison réellement en service, pas celle qu'on préférerait. */
.m-dep-maillon.is-actif {
  border-color: var(--green); color: var(--text); font-weight: 600;
  background: color-mix(in srgb, var(--green) 14%, transparent);
}
.m-dep-fleche { color: var(--text-muted); font-size: .9rem; }
.m-dep-fige { font-size: .78rem; color: var(--text-muted); font-style: italic; }
.m-dep-note { margin: .45rem 0 0; font-size: .78rem; color: var(--text-muted); line-height: 1.4; }

/* ── Contexte replié : constats, déroulé, verdicts ─────────────────────────── */
.m-dep-constats, .m-dep-trace, .m-dep-verdicts { list-style: none; margin: 0; padding: 0; }
.m-dep-constats li {
  display: flex; justify-content: space-between; gap: .75rem;
  padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .85rem;
  line-height: 1.35;
}
.m-dep-constats li:last-child { border-bottom: 0; }
.m-dep-constats em {
  font-style: normal; color: var(--text-muted); font-size: .76rem; white-space: nowrap;
}
.m-dep-trace li {
  padding: .32rem 0 .32rem .8rem; border-left: 2px solid var(--border);
  font-size: .84rem; color: var(--text-muted); line-height: 1.4;
}

.m-dep-verdict {
  display: grid; gap: .2rem; padding: .55rem .7rem; margin-bottom: .45rem;
  border-radius: 10px; border-left: 3px solid var(--border); background: var(--surface2);
  font-size: .87rem; line-height: 1.4;
}
.m-dep-verdict strong { font-weight: 600; }
.m-dep-verdict span { color: var(--text-muted); font-size: .82rem; }
.m-dep-verdict.is-ok { border-left-color: var(--green); }
.m-dep-verdict.is-ko { border-left-color: var(--red); }
.m-dep-verdict.is-flat { border-left-color: var(--text-muted); }

/* Barre d'attente. Indéterminée à dessein : le serveur annonce une durée ESTIMÉE, et
   une barre au pourcentage près mentirait sur une bascule qui dépend du routeur. */
.m-dep-progress {
  height: 4px; border-radius: 2px; background: var(--border); overflow: hidden;
  margin-top: .6rem;
}
.m-dep-progress span {
  display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--accent);
  animation: m-dep-glisse 1.4s ease-in-out infinite;
}
@keyframes m-dep-glisse {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .m-dep-progress span { animation: none; width: 100%; opacity: .5; }
}

/* ── Cibles tactiles ─────────────────────────────────────────────────────────
   44 px au doigt (recommandation iOS / Android). Là où le dessin doit rester petit
   (aide « ? », crayon d'une fiche, interrupteur), la zone touchable déborde du dessin
   par un pseudo-élément transparent plutôt que de grossir l'élément. */
.m-help, .m-contact-edit { position: relative; }
.m-help::after, .m-contact-edit::after,
.astreinte-toggle::after {
  content: ''; position: absolute; left: 50%; top: 50%;
  width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
.m-body .btn { min-height: 44px; }
