/* ============================================================
   Nouvelle navigation (refonte, lot 1) : la coquille
   Posée par js/nav-shell.js ; seule navigation depuis le 10/11. Les règles vivent sous
   body[data-nav="v2"], que la coquille pose (le préfixe garde leur spécificité sur celles de
   css/style.css). Couleurs, rayons et ombres : les jetons de css/style.css.
   Tailles : téléphone sous 700 px, tablette de 700 à 1079 px, ordinateur au-delà.
   Stagiaire : en-tête clair (onglets en capsule). Équipe : barre latérale sombre, en colonne
   d'icônes quand body porte data-nav-colonne (tablette, ou barre repliée sur ordinateur).
   Lot 5 : la direction et le siège ont la même barre latérale que l'équipe ; body porte data-barre="laterale"
   pour les trois (js/nav-shell.js, barreLaterale de js/espaces-rules.js), data-espace dit lequel.
   ============================================================ */

/* Hauteur de l'en-tête collant de la coquille (style.css, :root, n'en pose que la valeur de repli) : la barre de jours du Planning se colle dessous (top) et un saut vers un jour pose la carte
   sous les deux (scroll-margin-top : l'en-tête, puis 52 px pour la barre de jours et un peu d'air). En
   px, lue par js/views/planning.js. Stagiaire : 66 px ; équipe : pas d'en-tête (barre latérale), 0 ;
   téléphone : 56 px dans les deux espaces (plus bas). */
body[data-nav="v2"][data-espace="stagiaire"] { --haut-entete: 66px; }
body[data-nav="v2"][data-barre="laterale"] { --haut-entete: 0px; }
body[data-nav="v2"] .p-day-card { scroll-margin-top: calc(var(--haut-entete) + 52px); }

/* Bord bas des bandeaux du bas de l'écran (js/auth-admin.js : aperçu, promos non chargées) : celui de
   style.css (16 px, marge de sécurité comprise pour celui des promos), relevé au-dessus de la barre du bas
   sur téléphone (plus bas). Le panneau de l'assistant s'ouvre au-dessus de leur pile. */
body[data-nav="v2"] { --bas-bandeaux: calc(16px + env(safe-area-inset-bottom, 0px)); }


/* Texte réservé aux lecteurs d'écran : les mots « non lues » de la pastille des Nouveautés, et le titre
   d'un groupe d'entrées dans la colonne d'icônes (il nomme encore le groupe, voir aria-labelledby). */
body[data-nav="v2"] .nav-invisible,
body[data-nav="v2"][data-nav-colonne] .nav-groupe-titre {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ----- Stagiaire, en-tête : logo et promo, onglets en capsule, Assistant et compte ----- */
body[data-nav="v2"] .nav-haut {
  position: sticky;
  top: 0;
  z-index: 10;                 /* comme l'ancienne barre : au-dessus de la barre des jours du planning (9) */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  height: 66px;
  padding: 0 max(1.25rem, env(safe-area-inset-right, 0px)) 0 max(1.25rem, env(safe-area-inset-left, 0px));
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}

/* Colonne de gauche : le logo (lien vers l'accueil) et, à côté, le nom de la promo. */
body[data-nav="v2"] .nav-gauche {
  justify-self: start;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body[data-nav="v2"] .nav-marque {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
  border-radius: var(--r-sm);
}
/* Le logo en noir sur la barre claire, comme sur la page de connexion (.gate-logo). */
body[data-nav="v2"] .nav-logo {
  display: block;
  height: 38px;
  width: auto;
  filter: brightness(0) saturate(100%);
}
/* Le nom de la promo à côté du logo, sur ordinateur, là où la largeur le permet. */
body[data-nav="v2"] .nav-marque-promo {
  max-width: 13rem;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-transform: uppercase;
  color: var(--text-muted);
  /* Un nom long (« Démonstration (données fictives) ») passe sur deux lignes au lieu d'être coupé ; au-delà de deux lignes,
     des points de suspension (la largeur reste plafonnée : la capsule ne se décentre pas). */
  white-space: normal;
  text-wrap: balance;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

body[data-nav="v2"] .nav-onglets {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
}
body[data-nav="v2"] .nav-onglet {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 1rem;
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
body[data-nav="v2"] .nav-onglet .icon { width: 18px; height: 18px; flex: none; }
body[data-nav="v2"] .nav-onglet:hover { color: var(--text); }
body[data-nav="v2"] .nav-onglet[aria-current="page"] {
  background: var(--bg-elev);
  color: var(--accent-strong);
  font-weight: 600;
  box-shadow: var(--shadow-1), 0 0 0 1px var(--line);
}

/* Un libellé garde la largeur de sa version en gras (copie invisible de data-texte, sans hauteur) :
   allumer une entrée ne décale pas ses voisines. */
body[data-nav="v2"] .nav-onglet-texte,
body[data-nav="v2"] .nav-case-texte {
  display: inline-flex;
  flex-direction: column;
}
body[data-nav="v2"] .nav-onglet-texte::after,
body[data-nav="v2"] .nav-case-texte::after {
  content: attr(data-texte);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}
body[data-nav="v2"] .nav-onglet-texte::after { font-weight: 600; }
body[data-nav="v2"] .nav-case-texte::after { font-weight: 700; }

body[data-nav="v2"] .nav-droite {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body[data-nav="v2"] .nav-assistant {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 40px;
  padding: 0 0.95rem 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font: inherit;
  font-size: 0.93rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}
body[data-nav="v2"] .nav-assistant .icon { width: 18px; height: 18px; flex: none; }
body[data-nav="v2"] .nav-assistant:hover { border-color: var(--line-strong); color: var(--text); }

body[data-nav="v2"] .nav-compte {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 44px;
  padding: 3px 0.5rem 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font: inherit;
  cursor: pointer;
}
body[data-nav="v2"] .nav-compte:hover { border-color: var(--line-strong); color: var(--text); }
body[data-nav="v2"] .nav-compte > .icon { width: 16px; height: 16px; flex: none; }
/* Le prénom à côté des initiales, là où la largeur le permet. */
body[data-nav="v2"] .nav-compte-prenom {
  max-width: 5.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 0.1rem 0 0.3rem;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
body[data-nav="v2"] .nav-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-soft-2);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
body[data-nav="v2"] .nav-avatar .icon { width: 18px; height: 18px; }

/* Nouveautés non lues (js/nav-shell.js) : un point au coin de l'avatar des boutons du compte, dans les deux
   espaces et à toute taille. Sans chiffre : un nombre sur le compte se lit comme des choses à traiter, alors
   que ce sont des Nouveautés ; le nombre est sur la ligne « Nouveautés » du menu, et dans le nom du bouton.
   Un liseré de la couleur de la barre le détache de l'avatar. */
body[data-nav="v2"] [data-nav-action="compte"] .nav-avatar { position: relative; }
body[data-nav="v2"] .nav-compte-point {
  position: absolute;
  top: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pastille);   /* = --accent par défaut ; le rouge des repères en Couleurs ECF, comme le point de « Plus » */
  box-shadow: 0 0 0 2px var(--bg-elev);
}
/* Sur la barre sombre de l'équipe (barre latérale, en-tête du téléphone), le point prend le vert clair des repères
   posés sur fond sombre : son vert d'origine (--accent) n'y tient pas 3:1 contre son liseré (2,9:1), celui-ci 8,2:1. */
body[data-nav="v2"] .nav-cote .nav-compte-point {
  background: var(--repere-sombre);
  box-shadow: 0 0 0 2px var(--repere-sombre-lisere);
}

body[data-nav="v2"] [data-nav-coquille] :focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 2px;
}

/* Le nom de la promo et le prénom ne s'affichent que là où l'en-tête les tient sans décentrer la
   capsule. Mesuré : la capsule fait 583 px, chaque côté dispose de (largeur - 655) / 2 ;
   plafonnés en largeur (13 rem, le nom de la promo sur deux lignes au plus, et 5,5 rem, points de
   suspension au-delà), les deux tiennent ensemble avec
   24 px d'air dès 1 225 px. */
@media (max-width: 1239.98px) {
  body[data-nav="v2"] .nav-marque-promo,
  body[data-nav="v2"] .nav-compte-prenom { display: none; }
}
@media (min-width: 1400px) {
  body[data-nav="v2"] .nav-marque-promo { max-width: 18rem; }
  body[data-nav="v2"] .nav-compte-prenom { max-width: 8rem; }
}

/* Tablette : capsule plus serrée, l'Assistant en icône (son nom, aria-label, reste lu et en
   infobulle). Sous 860 px, les onglets n'affichent plus que leur libellé : la barre tient alors dès
   700 px. */
@media (min-width: 700px) and (max-width: 859.98px) {
  body[data-nav="v2"] .nav-onglet .icon { display: none; }
}
@media (min-width: 700px) and (max-width: 1079.98px) {
  body[data-nav="v2"] .nav-onglet { padding: 0 0.75rem; }
  body[data-nav="v2"] .nav-assistant { width: 40px; padding: 0; }
  body[data-nav="v2"] .nav-assistant-texte { display: none; }
}

/* ----- Équipe : barre latérale sombre (ordinateur, tablette), en-tête sombre (téléphone) ----- */
body[data-nav="v2"][data-barre="laterale"] {
  /* Largeur de la barre latérale, marge de sécurité de l'écran comprise (iPhone couché) : le
     contenu, qui garde le défilement de la fenêtre, en est décalé d'autant. */
  --larg-cote: calc(264px + env(safe-area-inset-left, 0px));
}
body[data-nav="v2"][data-barre="laterale"][data-nav-colonne] {
  --larg-cote: calc(74px + env(safe-area-inset-left, 0px));
}

body[data-nav="v2"] .nav-cote {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-deep);
  color: var(--sur-sombre);
}
body[data-nav="v2"] .nav-cote :focus-visible { outline-color: var(--sur-sombre); }

@media (min-width: 700px) {
  body[data-nav="v2"][data-barre="laterale"] #app { margin-left: var(--larg-cote); }
  /* Ce qui se centre en bas de l'écran (message, pastille du mode Modifier du planning) se centre sur le
     contenu, à droite de la barre. */
  body[data-nav="v2"][data-barre="laterale"] .toast,
  body[data-nav="v2"][data-barre="laterale"] .p-edit-pill { left: calc(50% + var(--larg-cote) / 2); }
  body[data-nav="v2"] .nav-cote {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 45;               /* au-dessus de la page, sous les fenêtres (200) et les bandeaux */
    width: var(--larg-cote);
    padding: 12px 10px 10px calc(10px + env(safe-area-inset-left, 0px));
  }
}

body[data-nav="v2"] .nav-cote-tete {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* La promo affichée : marque (ses initiales), « Promo » et son nom ; un bouton (la pastille de
   style.css, redessinée ici) quand on peut en changer. */
body[data-nav="v2"] .nav-contexte {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  min-height: 44px;
  padding: 7px 8px;
  border: 1px solid var(--sombre-bord);
  border-radius: var(--r-lg);
  background: var(--sombre-survol);
  color: var(--sur-sombre);
  font: inherit;
  text-align: left;
  white-space: nowrap;
}
body[data-nav="v2"] button.nav-contexte { cursor: pointer; }
body[data-nav="v2"] button.nav-contexte:hover { background: var(--sombre-allume); }
/* Au survol, le fond s'éclaircit : « Promo » passe en crème plein pour garder 4,5:1 (4,22:1 sinon). */
body[data-nav="v2"] button.nav-contexte:hover .nav-contexte-type { color: var(--sur-sombre); }
body[data-nav="v2"] .nav-contexte-marque {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--r);
  background: var(--sombre-marque);
  color: var(--sur-sombre-marque);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}
body[data-nav="v2"] .nav-contexte-marque .icon { width: 20px; height: 20px; }
body[data-nav="v2"] .nav-contexte-type {
  grid-column: 2;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.25;
  text-transform: uppercase;
  color: var(--sur-sombre-doux);
}
body[data-nav="v2"] .nav-contexte-nom,
body[data-nav="v2"] .nav-contexte .promo-pastille-texte {
  grid-column: 2;
  /* Le nom du centre ou de la promo passe à la ligne, entre deux mots : il reste lu en entier, jamais coupé au
     milieu d'un mot (un mot plus long que la barre, seul, se coupe plutôt que de déborder). */
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}
body[data-nav="v2"] .nav-contexte .promo-pastille-fleche {
  display: block;
  grid-column: 3;
  grid-row: 1 / span 2;
  padding: 0 2px;
  font-size: 0.75rem;
}

body[data-nav="v2"] .nav-replier {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--sur-sombre-doux);
  cursor: pointer;
}
body[data-nav="v2"] .nav-replier:hover { background: var(--sombre-survol); color: var(--sur-sombre); }
body[data-nav="v2"] .nav-replier .icon { width: 20px; height: 20px; }

/* Entrées : la barre défile en hauteur si l'écran est bas, jamais de côté. La marge négative
   laisse la place du trait de l'entrée allumée, au bord de la barre. */
body[data-nav="v2"] .nav-cote-entrees {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px -10px 0;
  padding: 0 10px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
}
body[data-nav="v2"] .nav-groupe {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
body[data-nav="v2"] .nav-groupe-titre {
  margin: 0;
  padding: 16px 10px 8px;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--sur-sombre-doux);
}
body[data-nav="v2"] .nav-entree {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--sur-sombre);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s;
}
body[data-nav="v2"] .nav-entree > .icon { width: 20px; height: 20px; flex: none; opacity: 0.82; }
body[data-nav="v2"] .nav-entree:hover { background: var(--sombre-survol); }
body[data-nav="v2"] .nav-entree[aria-current="page"] { background: var(--sombre-allume); font-weight: 600; }
body[data-nav="v2"] .nav-entree[aria-current="page"] > .icon { opacity: 1; color: var(--sur-sombre-actif); }
body[data-nav="v2"] .nav-entree[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: -10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--repere-sombre);
}
body[data-nav="v2"] .nav-entree-texte {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Entrée d'un module fermé : texte atténué, sauf allumée, survolée ou au clavier (son fond plus clair
   ferait passer le texte atténué sous 4,5:1), comme les onglets repérés de l'ancienne barre. */
body[data-nav="v2"] .nav-entree.module-masque { color: var(--sur-sombre-doux); }
body[data-nav="v2"] .nav-entree.module-masque:hover,
body[data-nav="v2"] .nav-entree.module-masque:focus-visible,
body[data-nav="v2"] .nav-entree.module-masque[aria-current="page"] { color: var(--sur-sombre); }
body[data-nav="v2"] .nav-cote .marque-masque { margin: 0; color: var(--sur-sombre-doux); }

body[data-nav="v2"] .nav-cote-pied {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--sombre-filet);
}
body[data-nav="v2"] .nav-cote-compte {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: var(--r-lg);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
body[data-nav="v2"] .nav-cote-compte:hover { background: var(--sombre-survol); }
body[data-nav="v2"] .nav-cote .nav-avatar { background: var(--sombre-allume); color: var(--sur-sombre); }
body[data-nav="v2"] .nav-cote-compte-texte {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body[data-nav="v2"] .nav-cote-compte-texte b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.25;
}
body[data-nav="v2"] .nav-cote-compte-texte small {
  color: var(--sur-sombre-doux);
  font-size: 0.8rem;
  line-height: 1.25;
}

/* Le bouton qui replie la barre n'existe que sur ordinateur : la tablette a toujours la colonne. */
@media (max-width: 1079.98px) {
  body[data-nav="v2"] .nav-replier { display: none; }
}

/* Colonne d'icônes (tablette, ou barre repliée) : chaque entrée garde son nom en aria-label et en
   infobulle, la promo sa marque, les groupes un filet. */
body[data-nav="v2"][data-nav-colonne] .nav-cote-tete { flex-direction: column; }
body[data-nav="v2"][data-nav-colonne] .nav-contexte {
  flex: none;
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 5px;
}
body[data-nav="v2"][data-nav-colonne] .nav-contexte > :not(.nav-contexte-marque),
body[data-nav="v2"][data-nav-colonne] .nav-entree-texte,
body[data-nav="v2"][data-nav-colonne] .nav-cote-compte-texte { display: none; }
body[data-nav="v2"][data-nav-colonne] .nav-replier { margin-top: 4px; }
body[data-nav="v2"][data-nav-colonne] .nav-entree,
body[data-nav="v2"][data-nav-colonne] .nav-cote-compte { justify-content: center; padding: 0; }
body[data-nav="v2"][data-nav-colonne] .nav-groupe {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--sombre-filet);
}
body[data-nav="v2"][data-nav-colonne] .nav-entree > .marque-masque {
  position: absolute;
  top: 4px;
  right: 6px;
}

/* ----- Téléphone : barre du bas, en-tête de l'équipe ----- */
body[data-nav="v2"] .nav-bas { display: none; }

@media (max-width: 699.98px) {
  body[data-nav="v2"] {
    /* Hauteur de la barre du bas, marge de sécurité de l'écran comprise. Le corps de la page en
       garde autant en marge basse : la fin de la page n'est jamais cachée sous la barre. */
    --haut-barre-bas: calc(65px + env(safe-area-inset-bottom, 0px));
    margin-bottom: var(--haut-barre-bas);
  }
  /* L'en-tête des deux espaces (le stagiaire, et la barre de l'équipe devenue en-tête) : 56 px. */
  body[data-nav="v2"][data-espace] { --haut-entete: 56px; }

  body[data-nav="v2"] .nav-haut {
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    height: 56px;
    padding: 0 max(0.85rem, env(safe-area-inset-right, 0px)) 0 max(0.85rem, env(safe-area-inset-left, 0px));
  }
  body[data-nav="v2"] .nav-onglets { display: none; }
  body[data-nav="v2"] .nav-logo { height: 32px; }
  body[data-nav="v2"] .nav-assistant { height: 44px; }

  /* Équipe : la barre latérale devient l'en-tête (la promo, l'Assistant, le compte) ; ses entrées
     passent dans la barre du bas et le tiroir « Plus » (« Signaler un problème » ; l'Assistant et le compte restent dans l'en-tête). */
  body[data-nav="v2"] .nav-cote {
    position: sticky;
    top: 0;
    z-index: 10;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    height: 56px;
    padding: 0 max(0.75rem, env(safe-area-inset-right, 0px)) 0 max(0.75rem, env(safe-area-inset-left, 0px));
  }
  /* Le liseré de l'habillage sous l'en-tête sombre : collé au bas, hors du flux (position absolue sur la barre collante),
     3 px. Avec « none » (ECSR Promo) il ne peint rien et ne prend aucune place : rien ne bouge au pixel. */
  body[data-nav="v2"] .nav-cote::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: var(--lisere-habillage);
    pointer-events: none;
  }
  body[data-nav="v2"] .nav-cote-tete { flex: 1; min-width: 0; }
  body[data-nav="v2"] .nav-contexte { padding: 3px 8px 3px 5px; }
  body[data-nav="v2"] .nav-contexte-marque { width: 32px; height: 32px; font-size: 0.75rem; }
  /* Un nom long passe sur deux lignes : l'en-tête garde ses 56 px (type 13 px + deux lignes de 15 px + marges, cible de 44 px gardée). */
  body[data-nav="v2"] .nav-contexte-type { line-height: 1.1; }
  body[data-nav="v2"] .nav-contexte-nom,
  body[data-nav="v2"] .nav-contexte .promo-pastille-texte { font-size: 0.85rem; line-height: 1.15; }
  body[data-nav="v2"] .nav-cote-entrees,
  body[data-nav="v2"] .nav-cote-compte-texte { display: none; }
  body[data-nav="v2"] .nav-cote-pied { flex-direction: row; gap: 0.5rem; padding: 0; border: 0; }
  /* L'Assistant (le bouton du pied de la barre, au même geste) reste dans l'en-tête, entre la promo et le
     compte : une icône de 44 px, comme le compte. Son libellé se masque ; son nom, aria-label, reste lu. */
  body[data-nav="v2"] .nav-cote-assistant {
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
  }
  body[data-nav="v2"] .nav-cote-assistant .nav-entree-texte { display: none; }
  /* Module fermé pour la promo : le repère (œil barré) se pose au coin de l'icône, hors du flux, comme en colonne d'icônes. */
  body[data-nav="v2"] .nav-cote-assistant > .marque-masque { position: absolute; top: 3px; right: 3px; }
  body[data-nav="v2"] .nav-cote-compte {
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
  }

  body[data-nav="v2"] .nav-bas {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;               /* au-dessus de la page, sous les fenêtres (200) et les bandeaux */
    display: flex;
    height: var(--haut-barre-bas);
    padding: 4px max(4px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    background: var(--bg-elev);
    border-top: 1px solid var(--line);
  }
  /* Cases de même largeur ; une case ne descend jamais sous son libellé (sur une ligne) ni sous 44 px. */
  body[data-nav="v2"] .nav-case {
    position: relative;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: var(--r);
    color: var(--text-muted);
    font-size: 0.73rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
  }
  /* « Plus » est un bouton : il prend l'allure des cases. */
  body[data-nav="v2"] .nav-plus {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
  }
  body[data-nav="v2"] .nav-case-icone {
    display: grid;
    place-items: center;
    width: 100%;
    max-width: 56px;
    min-width: 44px;
    height: 30px;
    border-radius: 999px;
    transition: background 0.15s;
  }
  body[data-nav="v2"] .nav-case-icone .icon { width: 24px; height: 24px; }
  body[data-nav="v2"] .nav-case[aria-current="page"] { color: var(--accent-strong); font-weight: 700; }
  body[data-nav="v2"] .nav-case[aria-current="page"] .nav-case-icone { background: var(--accent-soft-2); }
  /* Point de « Plus » quand une entrée du tiroir a quelque chose à traiter (lot 2A, js/nav-shell.js) : au coin de
     l'icône, hors du flux, comme le point des Nouveautés sur le compte ; son liseré de la couleur de la barre le détache
     de l'icône et de la pastille de l'entrée allumée (5,5:1 contre la barre). */
  body[data-nav="v2"] .nav-plus-point {
    position: absolute;
    top: 3px;
    left: calc(50% + 7px);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 2px var(--bg-elev);
  }
  body[data-nav="v2"] .nav-bas :focus-visible { outline-offset: -2px; }
  /* Repère d'un module fermé : sur le coin de l'icône, hors du flux. */
  body[data-nav="v2"] .nav-case > .marque-masque {
    position: absolute;
    top: 3px;
    left: calc(50% + 8px);
    margin: 0;
  }

  /* Ce qui se pose en bas de l'écran passe au-dessus de la barre du bas (le panneau de l'assistant :
     voir sa section). Les promos au-dessus de l'aperçu : 48 px plus haut, comme dans style.css. */
  body[data-nav="v2"] { --bas-bandeaux: calc(var(--haut-barre-bas) + 10px); }
  body[data-nav="v2"] .impersonation-banner,
  body[data-nav="v2"] .promos-banner { bottom: var(--bas-bandeaux); }
  body[data-nav="v2"] .promos-banner.au-dessus-apercu { bottom: calc(var(--bas-bandeaux) + 48px); }
  body[data-nav="v2"] .toast { bottom: calc(var(--haut-barre-bas) + 0.75rem); }
  body[data-nav="v2"] .p-edit-pill { bottom: calc(var(--haut-barre-bas) + 0.75rem); }

  /* Zones à toucher de 44 px sur téléphone : sous-onglets des pages, cases des Paramètres, boutons
     du choix de la promo (ouvert par la pastille de l'en-tête de l'équipe). */
  body[data-nav="v2"] .subtabs-bar .subtab { min-height: 44px; min-width: 44px; }
  body[data-nav="v2"] .invite-admin-toggle { min-height: 44px; }
  body[data-nav="v2"] .promo-choix-modal .btn { min-height: 44px; }
  body[data-nav="v2"] .reglage-habillage .reglage-actions .btn { min-height: 44px; }
}

/* ----- Assistant (js/chatbot.js) : ouvert par les boutons « Assistant » de la coquille ----- */
/* Plus de bulle flottante : elle masquait du contenu sur téléphone. */
/* Le panneau s'ouvre près de son bouton : sous l'en-tête, à droite, chez le stagiaire ; en bas, à droite
   de la barre latérale, dans l'équipe (comme le menu du compte). */
body[data-nav="v2"][data-espace="stagiaire"] .chatbot-panel {
  top: calc(var(--haut-entete) + 8px);
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: auto;
}
body[data-nav="v2"][data-barre="laterale"] .chatbot-panel {
  right: auto;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  left: calc(var(--larg-cote) + 8px);
}
/* Bandeaux du bas affichés (data-bandeaux-bas, et la hauteur de leur pile, --haut-bandeaux-bas, posés par
   js/auth-admin.js) : le panneau s'arrête au-dessus d'eux, son champ et « Envoyer » restent à portée. */
body[data-nav="v2"][data-bandeaux-bas] {
  --bas-panneau: calc(var(--bas-bandeaux) + var(--haut-bandeaux-bas, 0px) + 8px);
}
body[data-nav="v2"][data-bandeaux-bas][data-espace="stagiaire"] .chatbot-panel {
  max-height: calc(100dvh - var(--haut-entete) - 8px - var(--bas-panneau));
}
body[data-nav="v2"][data-bandeaux-bas][data-barre="laterale"] .chatbot-panel {
  bottom: var(--bas-panneau);
  max-height: calc(100dvh - var(--bas-panneau) - 12px);
}
/* La croix et les cibles de 44 px du panneau valent pour les deux navigations : css/style.css. */

@media (max-width: 699.98px) {
  /* Téléphone : au-dessus de la barre du bas, sur toute la largeur, jamais sous l'en-tête de 56 px. */
  body[data-nav="v2"][data-espace] .chatbot-panel {
    top: auto;
    right: 8px;
    bottom: calc(var(--haut-barre-bas) + 8px);
    left: 8px;
    width: auto;
    height: min(70dvh, 560px);
    max-height: calc(100dvh - var(--haut-barre-bas) - var(--haut-entete) - 16px);
  }
  body[data-nav="v2"][data-bandeaux-bas][data-espace] .chatbot-panel {
    bottom: var(--bas-panneau);
    max-height: calc(100dvh - var(--bas-panneau) - var(--haut-entete) - 8px);
  }
}

/* ----- Fenêtres de la coquille : menu du compte, tiroir « Plus » (js/nav-fenetre.js) ----- */
/* Le voile des fenêtres de l'app (.modal-backdrop), au-dessus des bandeaux (1400, 1500) et sous
   les messages (2000). */
body[data-nav="v2"] .nav-calque { z-index: 1600; }
body[data-nav="v2"] .nav-fenetre {
  position: fixed;
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px;
  background: var(--bg-elev);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-3);
}
/* Le focus va à la fenêtre elle-même à l'ouverture : pas de contour, Tab mène aux lignes. */
body[data-nav="v2"] .nav-fenetre:focus { outline: none; }
/* Menu du compte : sous son bouton, en haut à droite, chez le stagiaire ; à droite de la barre
   latérale, en bas, dans l'équipe. Sur téléphone, les deux fenêtres montent du bas (plus bas). */
body[data-nav="v2"][data-espace="stagiaire"] .nav-menu-compte {
  top: calc(var(--haut-entete) + 8px);
  right: max(14px, env(safe-area-inset-right, 0px));
  max-height: calc(100vh - var(--haut-entete) - 20px);
  max-height: calc(100dvh - var(--haut-entete) - 20px);
}
body[data-nav="v2"][data-barre="laterale"] .nav-menu-compte {
  bottom: 12px;
  left: calc(var(--larg-cote) + 8px);
}

body[data-nav="v2"] .nav-fenetre-tete {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
  padding: 8px 8px 12px;
  border-bottom: 1px solid var(--line-faint);
}
body[data-nav="v2"] .nav-fenetre-tete .nav-avatar { width: 44px; height: 44px; font-size: 0.95rem; }
body[data-nav="v2"] .nav-fenetre-qui {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
body[data-nav="v2"] .nav-fenetre-qui b { font-size: 1rem; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
body[data-nav="v2"] .nav-fenetre-qui small { color: var(--text-muted); font-size: 0.82rem; line-height: 1.35; }
body[data-nav="v2"] .nav-fenetre-section,
body[data-nav="v2"] .nav-fenetre .nav-groupe-titre,
body[data-nav="v2"] .nav-fenetre .habillage-titre {
  margin: 0;
  padding: 12px 8px 8px;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text-muted);
}
body[data-nav="v2"] .nav-fenetre-lien {
  display: flex;
  flex: none;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--r);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
body[data-nav="v2"] .nav-fenetre-lien:hover { background: var(--bg-subtle); }
body[data-nav="v2"] .nav-fenetre-lien > .icon { width: 20px; height: 20px; flex: none; color: var(--text-muted); }
body[data-nav="v2"] .nav-fenetre-lien > .nav-avatar { width: 28px; height: 28px; font-size: 0.7rem; }
body[data-nav="v2"] .nav-fenetre-lien[aria-current="page"] { background: var(--accent-soft); font-weight: 600; }
body[data-nav="v2"] .nav-fenetre-lien[aria-current="page"] > .icon { color: var(--accent-strong); }
body[data-nav="v2"] .nav-fenetre-lien.module-masque { color: var(--text-muted); }
/* Section « Espace » du menu du compte (lot 5) : l'espace actuel en gras, coché au bout de sa ligne. */
body[data-nav="v2"] .nav-fenetre-lien[aria-current="true"] { font-weight: 600; }
body[data-nav="v2"] .nav-espace-coche { display: inline-flex; flex: none; color: var(--accent-strong); }
body[data-nav="v2"] .nav-espace-coche .icon { width: 18px; height: 18px; }
/* Choix du centre (direction, lot 5) : un centre sans promo est dit, pas choisi. */
body[data-nav="v2"] .promo-choix:disabled { cursor: default; color: var(--text-muted); }
body[data-nav="v2"] .nav-fenetre-lien.module-masque[aria-current="page"] { color: var(--text); }
body[data-nav="v2"] .nav-fenetre-lien > .marque-masque { margin: 0; }
body[data-nav="v2"] .nav-fenetre-texte { flex: 1; min-width: 0; }
body[data-nav="v2"] .nav-fenetre-filet {
  flex: none;
  height: 1px;
  margin: 6px 8px;
  background: var(--line-faint);
}
/* Nouveautés non lues : la pastille de l'ancien onglet Accueil. */
body[data-nav="v2"] .nav-pastille {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pastille);
  color: var(--sur-pastille);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1;
}
/* « À traiter » (lot 2A, js/nav-shell.js) : ce qui attend l'équipe dans Cours et QCM. La pastille chiffrée de l'entrée, à
   la suite de son libellé : la pastille des Nouveautés, à la fin de la ligne qu'elle ne fait pas rétrécir. */
body[data-nav="v2"] .nav-entree > .nav-a-traiter,
body[data-nav="v2"] .nav-fenetre-lien > .nav-a-traiter { flex: none; }
/* Sur la barre sombre, toute pastille prend le vert clair des repères et le texte de la barre : 8,2:1 pour le chiffre comme
   contre le fond de la barre (le vert de la pastille claire, 2,9:1 contre ce fond, s'y confondrait). Celle de « Cours et QCM »
   comme celle de « Signaler un problème » (css/signalement.css, qui n'en règle que la place) ; le tiroir « Plus » et l'en-tête
   clair du stagiaire, hors de .nav-cote, gardent la leur. */
body[data-nav="v2"] .nav-cote .nav-pastille {
  background: var(--repere-sombre);
  color: var(--sur-repere-sombre);
  box-shadow: 0 0 0 2px var(--repere-pastille-lisere);   /* aucun par défaut ; blanc en « Couleurs ECF », sur l'entrée allumée */
}
/* Colonne d'icônes : le libellé est masqué, la pastille se pose au coin haut droit de l'icône, hors du flux ; l'œil des
   modules fermés, qui occupait ce coin, passe en bas. */
body[data-nav="v2"][data-nav-colonne] .nav-entree > .nav-a-traiter {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.68rem;
}
body[data-nav="v2"][data-nav-colonne] .nav-entree[data-a-traiter] > .marque-masque { top: auto; bottom: 4px; }
/* La phrase « 5 à traiter : 5 signalements » en tête du tiroir « Plus » (ruling R20 ; « 8 à traiter : 5 signalements, 3 propositions de l'IA » quand le lot 2B les compte, ruling R56). */
body[data-nav="v2"] .nav-fenetre-atraiter {
  margin: 2px 0 6px;
  padding: 10px 12px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.4;
}
body[data-nav="v2"] .nav-fenetre .view-as-block { margin: 6px 8px 8px; }
/* Titres (étape 3) : « Mon titre » et « Ce que je peux faire » du menu du compte, et le choix « Titre » de l'aperçu du fondateur. */
body[data-nav="v2"] .nav-mon-titre-nom { margin: 0; padding: 2px 10px 6px; font-size: 0.95rem; font-weight: 600; overflow-wrap: anywhere; }
body[data-nav="v2"] .nav-mon-titre-droits > summary { list-style: none; }
body[data-nav="v2"] .nav-mon-titre-droits > summary::-webkit-details-marker { display: none; }
body[data-nav="v2"] .nav-mon-titre-droits > summary::after {
  content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg);
}
body[data-nav="v2"] .nav-mon-titre-droits[open] > summary::after { transform: rotate(-135deg); }
body[data-nav="v2"] .nav-mon-titre-liste { padding: 0 10px 6px 42px; }
body[data-nav="v2"] .nav-mon-titre-sous { margin: 6px 0 2px; font-size: 0.82rem; color: var(--text-muted); overflow-wrap: anywhere; }
body[data-nav="v2"] .nav-mon-titre-vide { margin: 4px 0; font-size: 0.88rem; color: var(--text-muted); }
body[data-nav="v2"] .nav-mon-titre-liste ul { margin: 0; padding: 0; list-style: none; }
body[data-nav="v2"] .nav-mon-titre-liste li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 0.9rem; }
body[data-nav="v2"] .nav-mon-titre-liste li b { flex: none; font-weight: 600; color: var(--text-muted); }
/* En tête de chaque fenêtre (js/nav-fenetre.js) : la poignée du tiroir et « Fermer », sur téléphone
   seulement (plus bas) ; sur ordinateur et tablette, le popover se ferme d'un clic dehors ou par Échap. */
body[data-nav="v2"] .nav-fenetre-haut { display: none; }

@media (max-width: 699.98px) {
  body[data-nav="v2"][data-espace] .nav-fenetre {
    top: auto;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    left: 8px;
    width: auto;
    max-height: 86vh;
    max-height: 86dvh;
    padding: 8px 10px 12px;
  }
  /* Rangée du haut : « Fermer » à droite, sur 44 px, le seul moyen visible de sortir sans choisir une
     ligne (hors du voile) ; la poignée du tiroir au milieu, au-dessus. */
  body[data-nav="v2"] .nav-fenetre-haut {
    position: relative;
    flex: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    min-height: 44px;
  }
  body[data-nav="v2"] .nav-fenetre-haut::before {
    content: "";
    position: absolute;
    top: 4px;
    left: 50%;
    width: 40px;
    height: 5px;
    margin-left: -20px;
    border-radius: 3px;
    background: var(--line-strong);
  }
  body[data-nav="v2"] .nav-fenetre-fermer {
    min-width: 44px;
    min-height: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: var(--r);
    background: transparent;
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
  }
  body[data-nav="v2"] .nav-fenetre-fermer:hover { background: var(--bg-subtle); }
  body[data-nav="v2"] .nav-fenetre .view-as-btn { min-height: 44px; }
}

/* ----- Planning > Semaine : le bouton « Aujourd'hui » (ruling R29, js/views/planning.js) ----- */
/* Le retour au jour, dans la barre de la semaine : 44 px à toute taille. */
body[data-nav="v2"] .p-aujourdhui { min-height: 44px; }

/* ----- Stagiaires > Élèves bénévoles (lot 2A, js/views/stagiaires.js et js/views/benevoles.js) ----- */
/* Le panneau de la banque, posé dans la page : la largeur de l'ancienne fenêtre, son titre (.modal h3) et des règles
   contre le débordement des champs : le select du niveau, aux options très longues, ferait sinon déborder la colonne
   de la grille du formulaire. */
body[data-nav="v2"] .bnv-page { max-width: 680px; }
/* Après « Modifier », le formulaire est ramené en haut du bloc (scrollIntoView, js/views/benevoles.js) : sous l'en-tête collant du téléphone, pas derrière lui. */
body[data-nav="v2"] .bnv-page { scroll-margin-top: calc(var(--haut-entete) + 8px); }
body[data-nav="v2"] .bnv-page h3 { margin: 0 0 1.25rem; font-size: 1.15rem; font-weight: var(--poids-titre-semi); letter-spacing: -0.01em; }
body[data-nav="v2"] .bnv-page .field { min-width: 0; }
body[data-nav="v2"] .bnv-page .field input,
body[data-nav="v2"] .bnv-page .field select { width: 100%; min-width: 0; }
/* iPhone : la fiche d'un stagiaire prend tout l'écran, un seul écran à la fois comme avant les sous-onglets : ni
   l'en-tête de la page ni sa barre de sous-onglets au-dessus de son lien de retour. */
body[data-nav="v2"] .stg-page.stg-fiche-seule > .view-header,
body[data-nav="v2"] .stg-page.stg-fiche-seule > .subtabs > .subtabs-bar { display: none; }
@media (max-width: 699.98px) {
  /* Téléphone : dans la banque, les onglets, boutons, filtres, champs, liens d'appel, cases de disponibilité et
     autres liens font 44 px, comme le reste de la page (la fenêtre d'avant les laissait de 19 à 39 px). */
  body[data-nav="v2"] .bnv-page .btn,
  body[data-nav="v2"] .bnv-page .bnv-tab,
  body[data-nav="v2"] .bnv-page select,
  body[data-nav="v2"] .bnv-page .field input:not([type="checkbox"]),
  body[data-nav="v2"] .bnv-page .bnv-venue-com,
  body[data-nav="v2"] .bnv-page .bnv-dispo-cell,
  body[data-nav="v2"] .bnv-page .bnv-affilie-x { min-height: 44px; }
  body[data-nav="v2"] .bnv-page .bnv-affilie-x { min-width: 44px; }
  body[data-nav="v2"] .bnv-page .bnv-tel,
  body[data-nav="v2"] .bnv-page .bnv-linklike,
  body[data-nav="v2"] .bnv-page .bnv-retires summary { display: inline-flex; align-items: center; min-height: 44px; }
}

/* ----- Mon suivi > La classe : les moyennes EPCF de la classe (lot 2A, js/views/notes.js) ----- */
/* Une section sous la vue de la classe (matrice, synthèse, graphiques), à distance de sa dernière carte. */
body[data-nav="v2"] .notes-epcf-classe { margin-top: 1.5rem; }

/* ----- Bandeau d'émargement sur téléphone (lot 2A, js/emargement-bandeau.js) ----- */
/* Une seule ligne : « Émargement du matin ouvert » et son bouton. Les horaires (côté stagiaire) et le nombre de
   signatures (côté formateur) sont dans la feuille que le bouton ouvre ; le bouton (Signer, Voir) fait 44 px. Le
   bouton donne alors sa hauteur au bandeau : le remplissage vertical passe du bandeau à son texte, qui garde le
   sien (un bandeau sans bouton garde sa hauteur), et le bandeau reste moins haut que sur deux lignes. */
@media (max-width: 699.98px) {
  body[data-nav="v2"] .em-bandeau-detail { display: none; }
  body[data-nav="v2"] .em-bandeau { padding-top: 0.25rem; padding-bottom: 0.25rem; }
  body[data-nav="v2"] .em-bandeau p { padding-top: 0.35rem; padding-bottom: 0.35rem; }
  body[data-nav="v2"] .em-bandeau .btn { min-height: 44px; }
}

/* ----- Fenêtres des QCM (fiche, entraînement, éditeur), ouvertes depuis Cours et QCM (lot 2B, js/views/qcm-stagiaire.js) ----- */
/* La croix de fermeture fait 44 px (elle en faisait 34), et sur téléphone les boutons de la fiche d'un QCM aussi (ils en faisaient 38). */
body[data-nav="v2"] .qcm-close { width: 44px; height: 44px; }
@media (max-width: 699.98px) {
  body[data-nav="v2"] .qcm-sheet-body .btn,
  body[data-nav="v2"] .theme-modal .modal-actions .btn { min-height: 44px; }
}

/* ----- Bandeau d'aperçu de la direction et du siège (lot 5, js/auth-admin.js) ----- */
/* La phrase dit que les modifications sont vraiment enregistrées : elle passe à la ligne au lieu de déborder (pilule d'une ligne
   pour formateur et stagiaire, coins moins ronds quand elle prend deux ou trois lignes). */
/* Largeur explicite : posé à left: 50%, le bandeau n'aurait que la moitié de l'écran et la phrase se casserait mot à mot. */
.impersonation-banner.imp-long { border-radius: 16px; width: max-content; max-width: min(36rem, calc(100vw - 24px)); }
.impersonation-banner.imp-long .imp-text { white-space: normal; }
.impersonation-banner.imp-long .imp-back { flex: none; min-height: 44px; }
/* ----- Apparence : le choix de l'habillage (lot 3, js/habillage-choix.js) ----- */
/* Hors de body[data-nav="v2"], à la différence du reste de cette feuille (la section ne vit que dans Mes préférences ; ses
   classes ne servent nulle part ailleurs). Deux pastilles côte à côte, 52 px de haut à toute taille (44 au moins sur téléphone) ; la pressée
   est bordée de l'accent, avec un anneau. La pastille de couleur montre son habillage (jetons --apercu-*, famille fixe). */
.habillage-pastilles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.habillage-pastille {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 8px 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
}
.habillage-pastille:hover { background: var(--bg-subtle); }
.habillage-pastille[aria-pressed="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.habillage-apercu {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px var(--apercu-contour);
}
.habillage-pastille[data-habillage="ecsr"] .habillage-apercu {
  background: conic-gradient(var(--apercu-ecsr-1) 0 50%, var(--apercu-ecsr-2) 50% 75%, var(--apercu-ecsr-3) 75% 100%);
}
.habillage-pastille[data-habillage="ecf"] .habillage-apercu {
  background: conic-gradient(var(--apercu-ecf-1) 0 50%, var(--apercu-ecf-2) 50% 75%, var(--apercu-ecf-3) 75% 100%);
}
/* Deux lignes dans la pastille : le nom, puis d'où vient l'habillage, plus petit et en texte atténué (4,5:1 au moins sur le
   fond de la pastille, pressée ou survolée, dans les deux habillages). Le retour à la ligne se fait entre deux mots. */
.habillage-textes { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.habillage-libelle { min-width: 0; overflow-wrap: break-word; }
.habillage-legende { min-width: 0; font-size: 0.74rem; font-weight: 500; line-height: 1.2; color: var(--text-muted); overflow-wrap: break-word; }
/* Dans le menu du compte, juste sous sa tête : le titre a l'allure des titres de section de la fenêtre (plus haut), les
   pastilles en retrait comme dans la maquette ; le groupe ne rétrécit pas quand le menu défile. */
body[data-nav="v2"] .nav-fenetre .habillage-choix { flex: none; }
body[data-nav="v2"] .nav-fenetre .habillage-pastilles { padding: 0 6px 6px; }

/* ----- Réglages du centre et du réseau : l'habillage par défaut (lot 5, js/views/reglages-habillage.js) ----- */
.reglage-habillage .reglage-actions { margin-top: 10px; }
.reglage-habillage .reglage-libre { margin-top: 14px; }
.reglage-habillage .reglage-libre p { margin: 4px 0 0; }
.reglage-habillage .promo-refus { margin-top: 10px; }
.reglage-habillage .reglage-statut { margin: 10px 0 0; font-size: 0.9rem; font-weight: 600; }
/* Données personnelles du centre (js/views/reglages-donnees.js) : une ligne par promo, le texte puis le bouton, à la ligne sur
   téléphone ; jamais de défilement horizontal. */
.reglage-donnees .param-block + .param-block { margin-top: 14px; }
.reglage-donnees .donnees-promos li { align-items: center; }
.reglage-donnees .donnees-promo-texte { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.reglage-donnees .donnees-promo-texte p { margin: 2px 0 0; }
.reglage-donnees .btn { min-height: 44px; }
/* Conservation des fiches de la direction (cartes de la page Qualiopi, js/views/conservation.js). */
.reglage-donnees [data-conservation] > .qualiopi-rangee-titre { margin: 0.6rem 0 0.4rem; }
.reglage-donnees [data-conservation] > .cons-statut:not(:empty) { margin-bottom: 0.6rem; }
/* Coche de la pastille choisie, en réglage seulement (le choix personnel du menu du compte ne change pas). */
.habillage-pastille[data-reglage] { position: relative; }
.habillage-pastille[data-reglage][aria-pressed="true"]::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 12px;
  width: 6px;
  height: 11px;
  border: solid var(--accent);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}

/* ----- Impression : ni la coquille, ni ce qu'elle impose à la page ----- */
/* La marge de la barre latérale battrait le « margin: 0 » de l'impression des Indicateurs (style.css,
   body.centre-printable #app) ; la marge basse est celle de la barre du bas du téléphone. */
@media print {
  body[data-nav="v2"] [data-nav-coquille] { display: none !important; }
  body[data-nav="v2"][data-barre="laterale"] #app { margin-left: 0; }
  body[data-nav="v2"] { margin-bottom: 0; }
}

/* Écran de repli (js/main.js, ecranSansNavigation) : la barre n'a pas pu se monter. Hors de body[data-nav="v2"],
   que la coquille n'a pas posé. Une phrase et deux gestes, cibles de 44 px, à la ligne sur téléphone. */
.nav-repli {
  max-width: 32rem;
  margin: 3rem auto;
  padding: 0 16px;
  text-align: center;
}
.nav-repli-titre { margin: 0 0 0.5rem; font-size: 1.25rem; }
.nav-repli-gestes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.nav-repli-gestes .btn { min-height: 44px; min-width: 44px; }
