/* =====================================================================
   Versailles48 Intranet — couche de design « Apple » (aperçu v71)

   Chargée APRÈS style.css, elle ne retire rien : elle reprend les jetons
   et l'habillage des composants. Trois règles la tiennent :

   · TOUT EST SOUS @media screen. Les rapports, fiches papier et registres
     s'impriment exactement comme avant — pas un pixel ne bouge sur papier.
   · LES COULEURS DE LA MAISON RESTENT CELLES DE LA MAISON. --rouge,
     --bouton, --bouton-2 et le fond clair viennent toujours de
     « Apparence » ; la teinte des commandes, c'est --bouton.
   · LE MOUVEMENT VIT DANS mouvement.js (ressorts interruptibles, glisser
     au doigt). Ici, seulement ce qu'une transition CSS fait bien : des
     ressorts amortis écrits en linear(), sans rebond quand aucun geste
     ne l'a lancé.
   ===================================================================== */

@media screen {

/* ─── 1. Jetons ─────────────────────────────────────────────────────── */
:root {
  color-scheme: light;
  --carte:      #ffffff;
  --barre:      #ffffff;
  --champ:      #f5f5f7;   /* surface en retrait : encadrés, tuiles */
  --saisie:     #ffffff;   /* fond d'un champ de saisie */
  --trait:      #e5e5ea;
  --trait-fort: #d1d1d6;
  --trait-saisie: rgba(0, 0, 0, .14);
  --texte:      #1d1d1f;
  --texte-2:    #6e6e73;
  --texte-3:    #7c7c82;
  --fond-2:     #fafafc;
  --fond-3:     #ededf0;
  --ok:         #1f7a4d;
  --warn:       #a15c00;

  /* La teinte : la couleur de bouton de l'entreprise, et sa version
     « encre » lisible quand elle porte du texte. */
  --teinte:       var(--bouton);
  --teinte-ink:   var(--bouton);
  /* Valeurs de repli (navigateurs sans color-mix) : la teinte d'origine.
     Le bloc @supports plus bas les recalcule depuis la couleur de la maison. */
  --teinte-douce: rgba(66, 83, 107, .11);
  --teinte-douce-2: rgba(66, 83, 107, .18);
  --anneau:       rgba(66, 83, 107, .24);
  --survol:       rgba(0, 0, 0, .04);
  --presse:       rgba(0, 0, 0, .07);

  /* Matériaux : la barre du haut et la barre d'onglets sont du verre ;
     le contenu défile DESSOUS. Le bord clair en haut, c'est la lumière
     qui accroche le matériau. */
  --verre:        rgba(250, 250, 252, .72);
  --verre-fort:   rgba(252, 252, 253, .84);
  --verre-bord:   rgba(255, 255, 255, .7);
  --verre-trait:  rgba(0, 0, 0, .08);
  --voile:        rgba(0, 0, 0, .28);

  /* Profondeur : plus une surface est grande et haute, plus son ombre
     est profonde. */
  --ombre-carte:  0 0 0 .5px rgba(0, 0, 0, .05), 0 1px 2px rgba(0, 0, 0, .05);
  --ombre-levee:  0 0 0 .5px rgba(0, 0, 0, .05), 0 6px 18px rgba(0, 0, 0, .09);
  --ombre-flotte: 0 0 0 .5px rgba(0, 0, 0, .06), 0 12px 40px rgba(0, 0, 0, .16),
                  0 2px 8px rgba(0, 0, 0, .06);

  --rayon-s:  8px;
  --rayon:    12px;
  --rayon-l:  16px;
  --rayon-xl: 24px;

  /* Ressorts amortis (amortissement 1, aucun dépassement), écrits point
     par point : la courbe réelle d'un ressort, pas une cubic-bezier qui
     l'imite. Durée = temps de stabilisation pour une réponse de 0,4 s
     (ou 0,3 s pour la version vive). */
  --ressort: cubic-bezier(.2, .8, .25, 1);   /* repli ; le vrai ressort plus bas */
  --duree:     .54s;
  --duree-vif: .4s;

  --bottom-h: 0px;
  --police: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
            "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue",
            Arial, sans-serif;
  --police-titre: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Display",
            "Segoe UI Variable Display", "Segoe UI", Roboto, "Helvetica Neue",
            Arial, sans-serif;
  /* Les gros chiffres : arrondis sur les appareils Apple (SF Pro Rounded),
     la police du système ailleurs. */
  --police-chiffres: ui-rounded, "SF Pro Rounded", system-ui, -apple-system,
            "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;
}

/* Mode sombre : un vrai noir derrière, des surfaces qui montent en gris à
   mesure qu'elles s'élèvent. Sur un écran OLED à cinq heures du matin, le
   noir ne brille pas. */
:root[data-theme="sombre"],
:root[data-theme="auto"].sombre-auto {
  color-scheme: dark;
  --fond:       #000000;
  --carte:      #1c1c1e;
  --barre:      #1c1c1e;
  --champ:      #2c2c2e;
  --saisie:     #2c2c2e;
  --trait:      #38383a;
  --trait-fort: #48484a;
  --trait-saisie: rgba(255, 255, 255, .1);
  --texte:      #f5f5f7;
  --texte-2:    #a1a1a6;
  --texte-3:    #85858b;
  --fond-2:     #161618;
  --fond-3:     #2c2c2e;
  --lien:       #8fb4e6;
  --err-texte:  #ff8a80;
  --ok:         #4cc47a;
  --warn:       #ffb340;
  --rouge-vif:  #e0605a;

  --tint-err:   #3a1a18;  --tint-err-trait:   #64302b;
  --tint-warn:  #33270f;  --tint-warn-trait:  #5e4720;
  --tint-ok:    #11291b;  --tint-ok-trait:    #22503a;
  --tint-info:  #172233;  --tint-info-trait:  #2d4463;

  --teinte-ink:   var(--lien);
  --teinte-douce: rgba(143, 180, 230, .16);
  --teinte-douce-2: rgba(143, 180, 230, .24);
  --anneau:       rgba(143, 180, 230, .32);
  --survol:       rgba(255, 255, 255, .06);
  --presse:       rgba(255, 255, 255, .1);

  --verre:        rgba(22, 22, 24, .72);
  --verre-fort:   rgba(36, 36, 38, .84);
  --verre-bord:   rgba(255, 255, 255, .09);
  --verre-trait:  rgba(255, 255, 255, .08);
  --voile:        rgba(0, 0, 0, .5);
  --menu-fond:    #2c2c2e;

  --ombre-carte:  0 0 0 0 transparent;   /* pas « none » : elle se combine à un liseré */
  --ombre-levee:  0 0 0 .5px rgba(255, 255, 255, .06), 0 8px 24px rgba(0, 0, 0, .5);
  --ombre-flotte: 0 0 0 .5px rgba(255, 255, 255, .08), 0 16px 48px rgba(0, 0, 0, .6);

  --contour-texte: var(--teinte-ink);
  --marque-ink: var(--lien);
  --alerte-ink: var(--err-texte);
}

/* Là où le navigateur sait les calculer : la teinte douce et l'anneau
   viennent de la couleur de la maison, et le ressort est écrit point par
   point. iOS 16.2 et plus, Chrome 111, Firefox 113 ; avant, les valeurs de
   repli ci-dessus. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --teinte-douce: color-mix(in srgb, var(--bouton) 11%, transparent);
    --teinte-douce-2: color-mix(in srgb, var(--bouton) 18%, transparent);
    --anneau:       color-mix(in srgb, var(--bouton) 24%, transparent);
  }
  :root[data-theme="sombre"], :root[data-theme="auto"].sombre-auto {
    --teinte-douce: color-mix(in srgb, var(--lien) 16%, transparent);
    --teinte-douce-2: color-mix(in srgb, var(--lien) 24%, transparent);
    --anneau:       color-mix(in srgb, var(--lien) 32%, transparent);
  }
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --ressort: linear(0, 0.04, 0.131, 0.242, 0.356, 0.464, 0.56, 0.643, 0.714,
      0.772, 0.819, 0.858, 0.889, 0.913, 0.933, 0.948, 0.96, 0.969, 0.976,
      0.982, 0.986, 0.989, 0.992, 0.994, 0.995, 0.996, 0.997, 1);
  }
}

/* ─── 2. Typographie ─────────────────────────────────────────────────
   La police du système d'abord : SF Pro sur iPhone et Mac, Segoe UI
   Variable sous Windows 11 — toutes deux changent de dessin selon la
   taille. L'interlettrage dépend de la taille : serré sur les grands
   titres, neutre sur le texte, un peu ouvert sur les petites mentions.
   Les tailles sont en rem : le réglage de taille du navigateur suit. */
html { font-size: 100%; }
body {
  font-family: var(--police);
  font-size: .9375rem;
  line-height: 1.47;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3 { font-family: var(--police-titre); }
h1 {
  font-size: 1.75rem; line-height: 1.14; font-weight: 700;
  letter-spacing: -.024em; margin: .4rem 0 1rem;
}
h2 { font-size: 1.1875rem; line-height: 1.26; font-weight: 650; letter-spacing: -.017em;
     margin: 1.2rem 0 .55rem; }
h3 { font-size: .9375rem; line-height: 1.33; font-weight: 600; letter-spacing: -.01em;
     color: var(--texte-2); }
/* Pas de taille fixe : <small> reste relatif à son contexte (en-têtes de
   grille, pastilles), comme avant. */
small { letter-spacing: 0; color: var(--texte-2); }
a { color: var(--lien); text-underline-offset: .18em; text-decoration-thickness: from-font; }
hr { border-top-color: var(--trait); }
::selection { background: var(--anneau); }
* { scrollbar-width: thin; scrollbar-color: var(--trait-fort) transparent; }

/* Les chiffres qui se lisent de loin : arrondis, à chasse fixe pour ne pas
   danser d'une mise à jour à l'autre, serrés parce qu'ils sont grands. */
.kpi-valeur, .effectif-n, .tb-chiffres b, .meteo-temp {
  font-family: var(--police-chiffres);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
table, .badge, .notif, .agenda-date { font-variant-numeric: tabular-nums; }

/* ─── 3. Retour immédiat ─────────────────────────────────────────────
   Le retour vient à l'APPUI, pas au relâchement : un bouton s'enfonce
   dès que le doigt le touche (0,08 s), et revient sur un ressort. */
button, .btn, .pill, .desktop-nav a, .bottom-nav a, .bottom-nav .bnav-plus,
.mobile-nav a, .fiche-onglets a, .btn-evenement, .ch-carte, .machine-carte,
.entrepot-carte, a.kpi, .alerte-ligne, .q-option, .choix-duree span,
.pagination a, .resultat-ligne, .msg-liste a, .compte-bouton, .icone-bouton {
  touch-action: manipulation;
  transition: transform var(--duree-vif) var(--ressort),
              background-color .2s ease, color .2s ease, box-shadow .2s ease,
              filter .2s ease, opacity .2s ease;
}
button:active, .btn:active, .pill:active, .desktop-nav a:active,
.bottom-nav a:active, .bottom-nav .bnav-plus:active, .fiche-onglets a:active,
.btn-evenement:active, .ch-carte:active, .machine-carte:active,
.entrepot-carte:active, a.kpi:active, .alerte-ligne:active, .q-option:active,
.pagination a:active, .compte-bouton:active, .icone-bouton:active {
  transform: scale(.97);
  transition-duration: .08s;
}
.mobile-nav a:active, .resultat-ligne:active, .msg-liste a:active,
.compte-menu a:active { background: var(--presse); }
:focus-visible { outline: 3px solid var(--anneau); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible { outline-offset: 3px; }

/* ─── 4. La barre du haut : du verre, et le contenu dessous ─────────
   Au repos elle se fond dans la page, sans trait. Dès que le contenu
   passe dessous, le verre se dépolit et un fondu léger marque le bord —
   seulement là où la barre recouvre vraiment quelque chose. */
.chrome {
  position: sticky; top: 0; z-index: 200;
  background: var(--fond);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  transition: background-color .25s ease, box-shadow .25s ease;
}
html.defile .chrome {
  background: var(--verre);
  box-shadow: 0 .5px 0 var(--verre-trait);
}
.chrome::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px;
  pointer-events: none; opacity: 0; transition: opacity .25s ease;
  background: linear-gradient(to bottom, rgba(0, 0, 0, .04), transparent);
}
html.defile .chrome::after { opacity: 1; }
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .chrome { background: color-mix(in srgb, var(--fond) 82%, transparent); }
  html.defile .chrome { background: var(--verre); }
  .chrome::after {
    background: linear-gradient(to bottom, color-mix(in srgb, var(--fond) 70%, transparent), transparent);
  }
}

.topbar {
  position: relative; top: auto; z-index: auto;
  background: transparent; border-bottom: 0; box-shadow: none;
  padding: 10px 20px; min-height: 58px; flex-wrap: nowrap; gap: 12px;
}
.brand { gap: 10px; font-weight: 650; font-size: 1.0625rem; letter-spacing: -.02em; min-width: 0; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
              transition: opacity .2s ease, transform var(--duree) var(--ressort); }
/* Sans logo : le losange de la maison, posé sur une tuile de sa couleur. */
.brand-mark { width: 30px; height: 30px; transform: none; border-radius: 8px; position: relative;
  background: var(--rouge); box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1); }
.brand-mark::after { content: ""; position: absolute; inset: 10px; background: #fff;
  transform: rotate(45deg); border-radius: 1.5px; }
/* Le logo devient une icône d'app : une tuile blanche aux coins doux, qui
   reste lisible sur le fond sombre comme sur le clair. */
.brand-logo {
  height: 34px; width: 34px; object-fit: contain; padding: 3px;
  background: #fff; border-radius: 9px;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 3px rgba(0, 0, 0, .08);
}

/* Le titre de la page, rappelé dans la barre quand le grand titre est
   passé dessous : on sait toujours où l'on est. */
.topbar-titre {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -30%); opacity: 0; pointer-events: none;
  font-weight: 650; font-size: .9375rem; letter-spacing: -.015em; color: var(--texte);
  white-space: nowrap; max-width: 40vw; overflow: hidden; text-overflow: ellipsis;
  transition: opacity .2s ease, transform var(--duree) var(--ressort);
}
html.titre-passe .topbar-titre { opacity: 1; transform: translate(-50%, -50%); }

.userbox { gap: 8px; flex-wrap: nowrap; margin-left: auto; }
.pill {
  border: 0; background: var(--fond-3); color: var(--texte); border-radius: 999px;
  padding: 6px 12px; font-size: .8125rem; font-weight: 500;
}
.pill:hover { background: var(--trait); }
.pill-out { background: transparent; color: var(--alerte-ink, var(--rouge)); }

/* Boutons ronds de la barre : cloche, menu. */
.icone-bouton, .pill-notif, .menu-burger {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; margin: 0; border-radius: 50%;
  background: var(--fond-3); color: var(--texte); border: 0;
  font-size: 1.05rem; line-height: 1; text-decoration: none; position: relative;
}
.icone-bouton:hover, .pill-notif:hover, .menu-burger:hover { background: var(--trait); filter: none; }
.menu-burger { display: none; }
.pill-notif .notif, .icone-bouton .notif {
  position: absolute; top: -3px; right: -4px; margin: 0;
  box-shadow: 0 0 0 2px var(--fond);
}
.notif {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: #ff3b30; font-size: .6875rem; line-height: 18px; font-weight: 700;
  letter-spacing: 0;
}
:root[data-theme="sombre"] .notif, :root.sombre-auto .notif { background: #ff453a; }
/* Une pastille à zéro ne se montre pas. Le script pose bien `hidden`, mais
   le display de .notif l'emportait : « Message 0 » s'affichait en rouge. */
.notif[hidden] { display: none !important; }

/* ─── 5. Le compte : un menu ancré à son bouton ─────────────────────
   Les sept raccourcis de la barre deviennent un seul bouton. Le menu
   naît du bouton — il grandit depuis son coin, et y retourne. */
.compte { position: relative; }
.compte-bouton {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  padding: 3px 12px 3px 3px; border-radius: 999px;
  background: var(--fond-3); color: var(--texte); font-weight: 600; font-size: .8125rem;
}
.compte-bouton:hover { background: var(--trait); filter: none; }
.compte-bouton .chevron { font-size: .7rem; color: var(--texte-2); transition: transform var(--duree-vif) var(--ressort); }
.compte-bouton[aria-expanded="true"] .chevron { transform: rotate(180deg); }
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--teinte); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: .02em;
}
.avatar-l { width: 44px; height: 44px; font-size: .95rem; }
.compte-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 400;
  width: 290px; padding: 6px;
  /* v72 — Sur un écran bas (téléphone en paysage, petite tablette), le menu
     du compte dépassait le bas de l'écran sans pouvoir défiler : la barre
     est collée en haut, la page ne l'emmène pas. Il défile dans sa hauteur. */
  max-height: calc(100vh - 88px); max-height: calc(100dvh - 88px);
  overflow-y: auto; overscroll-behavior: contain;
  /* Opaque : posé sur la barre de verre, un second verre ne laisserait
     plus rien lire (et le navigateur ne flouterait que la barre). */
  background: var(--menu-fond, var(--carte));
  border-radius: 18px; box-shadow: var(--ombre-flotte);
  transform-origin: calc(100% - 24px) -8px;
  transform: scale(.9); opacity: 0; visibility: hidden;
  transition: transform var(--duree-vif) var(--ressort), opacity .18s ease, visibility 0s linear .4s;
}
.compte-menu.ouvert {
  transform: none; opacity: 1; visibility: visible;
  transition: transform var(--duree-vif) var(--ressort), opacity .12s ease, visibility 0s;
}
.compte-identite { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px; }
.compte-identite b { display: block; font-size: .9375rem; letter-spacing: -.015em; }
.compte-identite small { display: block; font-size: .75rem; line-height: 1.35; }
.compte-groupe { padding: 4px 0; border-top: .5px solid var(--trait); }
.compte-menu a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--texte); text-decoration: none; font-size: .875rem; font-weight: 500;
}
.compte-menu a:hover { background: var(--survol); }
.compte-menu a .ic { width: 22px; text-align: center; }
.compte-menu a.danger { color: var(--alerte-ink, var(--rouge)); }
.compte-affichage { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 10px; font-size: .875rem; font-weight: 500; }

/* Contrôle segmenté : clair / sombre / auto. */
.segmente {
  display: inline-flex; padding: 2px; gap: 0; border-radius: 9px;
  background: var(--fond-3);
}
.segmente form { margin: 0; display: flex; }
.segmente button {
  margin: 0; padding: 5px 10px; border-radius: 7px; min-width: 0;
  background: transparent; color: var(--texte); font-size: .8125rem; font-weight: 500;
  white-space: nowrap;
}
.segmente button:hover { background: transparent; filter: none; }
.segmente button.actif {
  background: var(--carte); font-weight: 600;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .04), 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04);
}
:root[data-theme="sombre"] .segmente button.actif,
:root.sombre-auto .segmente button.actif { background: #636366; }

/* ─── 6. Onglets (ordinateur) ────────────────────────────────────────
   Des capsules dans la barre de verre. L'onglet actif prend la teinte ;
   Opération, à part, est la capsule pleine du début de ligne. Quand la
   ligne déborde, le bord s'estompe du côté où il reste des onglets. */
.desktop-nav {
  background: transparent; border-bottom: 0; overflow: visible;
  gap: 0; padding: 0 20px 10px; align-items: center;
}
/* Les onglets défilent ; Opération, elle, reste en place à gauche. */
.onglets-defilants {
  display: flex; gap: 2px; align-items: center; flex: 1; min-width: 0;
  overflow-x: auto; scrollbar-width: none; position: relative;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
}
.onglets-defilants::-webkit-scrollbar { display: none; }
.onglets-defilants.deborde-d { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.onglets-defilants.deborde-g { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px);
  mask-image: linear-gradient(to right, transparent, #000 40px); }
.onglets-defilants.deborde-g.deborde-d {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 56px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 56px), transparent); }
.desktop-nav a {
  flex: 0 0 auto; min-width: 0; padding: 6px 12px; border-radius: 999px;
  border-bottom: 0; color: var(--texte-2); font-weight: 500; font-size: .875rem;
  letter-spacing: -.01em;
}
.desktop-nav a:hover { color: var(--texte); background: var(--survol); }
.desktop-nav a.on { color: var(--teinte-ink); background: var(--teinte-douce); font-weight: 600; }
.desktop-nav a.tab-op {
  background: var(--teinte); color: #fff; font-weight: 600; margin-right: 10px; flex: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.desktop-nav a.tab-op:hover { filter: brightness(1.08); }
.desktop-nav a.tab-op.on { box-shadow: 0 0 0 3px var(--anneau); }
.desktop-nav .notif { margin-left: 5px; }
.bandeau-op { display: none; }

/* ─── 7. Contenu ─────────────────────────────────────────────────────── */
.page { padding: 12px 24px 72px; max-width: 1100px; }
/* La page large garde ses marges d'origine, au pixel : la grille des heures
   est mesurée pour tenir dans 1222 px sur un écran de 1280 (v60, v66). */
.page-large { max-width: 1460px; padding-left: 14px; padding-right: 14px; }
.page-large .card { padding-left: 14px; padding-right: 14px; }

.card {
  border: 0; border-radius: var(--rayon-l); padding: 18px 20px; margin-bottom: 16px;
  box-shadow: var(--ombre-carte);
}
.card .card { background: var(--champ); box-shadow: none; border-radius: var(--rayon); }
/* Le liseré d'état suit la courbe de la carte au lieu de la casser. */
.card-alerte { border-left: 0; box-shadow: inset 4px 0 0 var(--rouge-vif), var(--ombre-carte); }
.card-ok     { border-left: 0; box-shadow: inset 4px 0 0 var(--ok), var(--ombre-carte); }
.card-warn   { border-left: 0; box-shadow: inset 4px 0 0 var(--warn), var(--ombre-carte); }
.grid2, .grid3 { gap: 16px; }

/* Tableau de bord : l'étiquette au-dessus, le chiffre dessous, comme dans
   Santé. Une pastille de couleur dit l'état avant même qu'on lise. */
.kpi-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.kpi {
  display: flex; flex-direction: column; gap: 6px;
  border: 0; border-radius: var(--rayon-l); padding: 14px 16px 15px;
  box-shadow: var(--ombre-carte);
}
.kpi-label {
  order: -1; margin: 0; text-transform: none; letter-spacing: -.005em;
  font-size: .8125rem; font-weight: 600; color: var(--texte-2); line-height: 1.3;
}
.kpi.err .kpi-label::before, .kpi.warn .kpi-label::before, .kpi.ok .kpi-label::before {
  content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 6px; vertical-align: 1px; background: var(--rouge-vif);
}
.kpi.warn .kpi-label::before { background: var(--warn); }
.kpi.ok .kpi-label::before { background: var(--ok); }
.kpi-valeur { font-size: 2.125rem; font-weight: 700; color: var(--texte); }
.kpi.err .kpi-valeur { color: var(--rouge-vif); }
.kpi-sous { margin: 0; font-size: .75rem; color: var(--texte-2); letter-spacing: 0; }
a.kpi:hover { filter: none; box-shadow: var(--ombre-levee); }

.alerte-ligne {
  border-left: 0; border-radius: var(--rayon); padding: 11px 14px; margin-bottom: 8px;
  font-weight: 500;
}
.alerte-err, .alerte-warn { border-left: 0; }
.alerte-ligne:hover { filter: brightness(.985); }

.tb-chiffres b { font-size: 1.75rem; }
.tb-chiffres span { font-size: .75rem; }
.jauge { height: 6px; border-radius: 3px; background: var(--fond-3); }
.jauge span { border-radius: 3px; background: var(--teinte); }
.barre-graph .barre { border-radius: 4px 4px 1px 1px; background: var(--teinte); opacity: .9; }

/* ─── 8. Boutons ─────────────────────────────────────────────────────
   Des capsules. Le plein pour l'action principale ; le teinté (fond
   léger, texte de la teinte) remplace le bouton à contour. */
button, .btn {
  border-radius: 980px; padding: 9px 18px; font-weight: 600; font-size: .9375rem;
  letter-spacing: -.01em; background: var(--teinte);
}
@media (hover: hover) {
  button:hover, .btn:hover { background: var(--teinte); filter: brightness(1.1); }
}
.btn-accent { background: var(--bouton-2); }
.btn-ok { background: var(--ok); }
:root[data-theme="sombre"] .btn-ok, :root.sombre-auto .btn-ok { background: #248a3d; }
.btn-danger, .btn-danger:hover { background: var(--rouge-vif); }
.btn-ghost, .btn-ghost:hover {
  background: var(--teinte-douce); color: var(--contour-texte, var(--teinte-ink)); border: 0;
}
@media (hover: hover) { .btn-ghost:hover { background: var(--teinte-douce-2); filter: none; } }
.btn-mini { padding: 5px 12px; font-size: .8125rem; border-radius: 980px; }
summary.btn { border-radius: 14px; }
.btn-x { background: none; border-radius: 6px; }

/* ─── 9. Champs ──────────────────────────────────────────────────────
   Plus hauts, plus ronds. À la mise au point : un anneau doux de la
   teinte. Sur téléphone, 16 px : iOS n'agrandit plus la page à chaque
   champ touché. */
input, select, textarea {
  background: var(--saisie); border: 1px solid var(--trait-saisie); border-radius: 10px;
  padding: 9px 12px; transition: border-color .15s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--teinte-ink); box-shadow: 0 0 0 4px var(--anneau);
}
input[type=checkbox], input[type=radio], input[type=range] { accent-color: var(--teinte); padding: 0; box-shadow: none; }
input[type=file] { padding: 7px; background: var(--champ); }
/* :where() garde la spécificité d'un simple « select » : les cases des
   grilles (.case-annexe, .case-projet…) gardent leurs propres marges. */
select:where(:not([multiple])) {
  -webkit-appearance: none; appearance: none; padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 10px 6px;
}
label { font-size: .8125rem; font-weight: 600; letter-spacing: -.005em; margin: 10px 0 5px; }
/* Dans les grilles denses, la liste garde sa flèche native : une case de
   60 px n'a pas la place d'un chevron dessiné. */
.grille-temps select, .table-bureau select {
  -webkit-appearance: auto; appearance: auto; background-image: none; padding-right: 2px;
}

/* Select2, habillé comme le reste : même champ, et une liste qui flotte. */
.select2-container--default .select2-selection--single {
  height: 38px; border-radius: 10px; background: var(--saisie);
  border: 1px solid var(--trait-saisie);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 36px; padding-left: 12px; padding-right: 30px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 36px; width: 30px;
}
/* Dans une case de grille, la place est comptée au pixel. */
.grille-temps .select2-container--default .select2-selection--single .select2-selection__rendered {
  padding-left: 6px; padding-right: 16px;
}
.grille-temps .select2-container--default .select2-selection--single .select2-selection__arrow { width: 16px; }
.grille-temps .select2-container--default .select2-selection--single .select2-selection__arrow b { margin-left: -7px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b {
  border: 0; width: 10px; height: 6px; margin: -3px 0 0 -6px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238e8e93' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
  outline: none; border-color: var(--teinte-ink); box-shadow: 0 0 0 4px var(--anneau);
}
.select2-dropdown {
  border: 0; border-radius: 12px; overflow: hidden; background: var(--carte);
  box-shadow: var(--ombre-flotte);
}
.select2-container--open .select2-dropdown--below { margin-top: 6px; border-radius: 12px; }
.select2-container--open .select2-dropdown--above { margin-top: -6px; border-radius: 12px; }
.select2-results__option { padding: 8px 12px; }
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--teinte); color: #fff;
}
.select2-container--default .select2-results__option--selected {
  background: var(--teinte-douce); color: var(--teinte-ink);
}
.select2-container--default .select2-search--dropdown .select2-search__field {
  border-radius: 8px; border: 1px solid var(--trait-saisie); background: var(--saisie);
  color: var(--texte); padding: 7px 10px;
}

/* ─── 10. Tableaux, pastilles, listes ───────────────────────────────── */
table { font-size: .875rem; }
th {
  text-transform: none; letter-spacing: -.005em; font-size: .75rem; font-weight: 600;
  color: var(--texte-2);
}
th, td { border-bottom-color: var(--trait); padding: 9px 8px; }
@media (hover: hover) {
  /* v72 — Sauf la matrice des compétences : le fond de ses cases EST le
     niveau, le survol de la ligne l'effaçait. Elle a son propre cerne. */
  table:not(.grille-temps):not(.tableau-aimants):not(.rapport-table):not(.mc-table) tbody tr:hover > td {
    background: var(--survol);
  }
}
.badge {
  border-radius: 999px; padding: 2px 9px; font-weight: 600; font-size: .75rem;
  letter-spacing: 0; line-height: 1.45;
}
.badge-accent { background: var(--teinte); }
.role-badge { border-radius: 999px; font-weight: 600; }

.fiche-onglets { gap: 6px; flex-wrap: wrap; }
.fiche-onglets a {
  border: 0; background: var(--fond-3); color: var(--texte); font-weight: 500;
  border-radius: 999px; padding: 7px 14px; font-size: .8125rem;
}
.fiche-onglets a:hover { background: var(--trait); }
.fiche-onglets a.on {
  background: var(--teinte); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.card > .fiche-onglets:only-child { margin: 0; }
/* v75 — le même sélecteur, en boutons (réglages : un onglet à la fois) */
.fiche-onglets button.onglet-bloc {
  border: 0; background: var(--fond-3); color: var(--texte); font-weight: 500;
  border-radius: 999px; padding: 7px 14px; font-size: .8125rem; cursor: pointer;
}
.fiche-onglets button.onglet-bloc:hover { background: var(--trait); }
.fiche-onglets button.onglet-bloc.on {
  background: var(--teinte); color: #fff; font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
}
.fiche-onglets button.onglet-bloc.masque { opacity: .55; }
.page-blocs .reglage-ligne.masque { opacity: .5; }

.pagination a, .pagination span { border: 0; border-radius: 999px; background: var(--fond-3); padding: 6px 12px; }
.pagination .actuelle { background: var(--teinte); }

.flash { border-radius: var(--rayon); border: 0; padding: 11px 14px; }

/* Messagerie : des bulles, la sienne dans la teinte. */
.msg-liste a { border-radius: 10px; padding: 10px 12px; }
.msg-liste a.on { background: var(--teinte); }
.msg-liste a.on small { color: rgba(255, 255, 255, .75); }
.bulle { border-radius: 18px; padding: 8px 13px; background: var(--fond-3); }
.bulle.moi { background: var(--teinte); border-bottom-right-radius: 6px; }
.bulle:not(.moi) { border-bottom-left-radius: 6px; }
.bulle .meta { font-size: .6875rem; letter-spacing: 0; }
.convo { gap: 2px; padding: 8px 2px 12px; }
.msg-retour { display: none; }
.msg-saisie { display: flex; gap: 8px; align-items: flex-end; }
.msg-saisie textarea { min-height: 42px; border-radius: 21px; padding: 10px 16px; resize: none; }
.msg-saisie button { margin: 0; flex: none; height: 42px; }

/* ─── 11. Ma journée ─────────────────────────────────────────────────── */
.mj-texte, .meteo-widget { border: 0; border-radius: var(--rayon); background: var(--champ); }
.tache {
  border: 0; border-radius: var(--rayon); padding: 12px 14px; background: var(--champ);
  box-shadow: inset 4px 0 0 var(--teinte);
}
.tache-faite { box-shadow: inset 4px 0 0 var(--ok); opacity: .72; }
.mj-section-nom { font-size: 1.0625rem; font-weight: 650; letter-spacing: -.015em; }
.effectif-n { font-size: 2.5rem; font-weight: 700; color: var(--teinte-ink); }

/* ─── 12. Tuiles, cartes, grilles ───────────────────────────────────── */
.btn-evenement {
  border: 0; border-radius: 18px; background: var(--carte); padding: 20px 14px;
  box-shadow: var(--ombre-carte);
}
.btn-evenement:hover { transform: none; box-shadow: var(--ombre-levee); }
/* Le type se lit à la pastille de couleur autour de l'icône, comme les
   catégories de Santé ; plus de filet en haut de tuile. */
.ev-icone {
  font-size: 1.75rem; margin: 0 auto 10px; width: 58px; height: 58px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--champ);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
  .ev-icone { background: color-mix(in srgb, var(--ev, var(--teinte)) 15%, transparent); }
}
.ev-accident    { --ev: var(--rouge-vif); }
.ev-presque     { --ev: var(--warn); }
.ev-danger      { --ev: var(--bouton-2); }
.ev-autre       { --ev: var(--texte-3); }
.ev-deversement { --ev: #1f7a4d; }
.ev-incident    { --ev: var(--warn); }
.ev-blessure    { --ev: #e08a3c; }
.ev-harcel      { --ev: #7a3b9c; }
.ev-violence    { --ev: #9c3434; }
.ev-plainte     { --ev: #1f7a4d; }
.ev-accident, .ev-presque, .ev-danger, .ev-autre, .ev-deversement, .ev-incident,
.ev-blessure, .ev-harcel, .ev-violence, .ev-plainte { border-top: 0; }
.btn-evenement b, .btn-evenement strong { font-size: 1rem; letter-spacing: -.015em; }

.machine-carte, .entrepot-carte, .ch-carte, .ent-carte, .photo-carte {
  border: 0; border-radius: var(--rayon-l); box-shadow: var(--ombre-carte);
}
.machine-carte:hover, .entrepot-carte:hover, .ch-carte:hover {
  border-color: transparent; box-shadow: var(--ombre-levee); transform: none;
}
.machine-photo, .machine-photo-vide { background: var(--champ); }
.nc-carte, .demande-carte, .role-ligne, .onglet-config, .onglet-ligne {
  border: 0; border-radius: var(--rayon); box-shadow: var(--ombre-carte);
}
.nc-carte { box-shadow: inset 4px 0 0 var(--warn), var(--ombre-carte); border-left: 0; }
.nc-carte.critique { box-shadow: inset 4px 0 0 var(--rouge-vif), var(--ombre-carte); }
.nc-carte.resolu { box-shadow: inset 4px 0 0 var(--ok), var(--ombre-carte); }
.q-section { border-left: 0; border-radius: var(--rayon); box-shadow: inset 3px 0 0 var(--teinte); }
.q-option, .roles-cases label, .choix-duree span, .journee-case {
  border-color: var(--trait); border-radius: 999px;
}
.choix-duree input:checked + span { background: var(--teinte); border-color: var(--teinte); }

.bandeau-univers, .aimants-barre, .vivier-bandeau, .barre-distances, .legende-carte,
.ch-entete, .bandeau-anonyme, .q-note {
  border: 0; border-radius: var(--rayon);
}
.ch-entete { box-shadow: var(--ombre-carte); }
.tableau-aimants-cadre, .agenda-jour, .recap, .resultats-rapides, #carte, .point-chantier {
  border-color: var(--trait); border-radius: var(--rayon);
}
.tableau-aimants-cadre { border: 0; box-shadow: var(--ombre-carte); }
.agenda-carte { border-radius: 7px; }

/* Les aimants : on les soulève quand on les prend. */
.aimant { font-weight: 600; padding: 3px 9px; letter-spacing: -.005em; }
.aimant.pris {
  outline: 0; transform: scale(1.06);
  box-shadow: 0 0 0 2px var(--ok), 0 6px 16px rgba(0, 0, 0, .22);
}

/* La bulle « des modifications ont été apportées ailleurs » : du verre. */
.bandeau-maj {
  border: 0; background: var(--verre-fort);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--ombre-flotte);
}
.bandeau-maj button { background: var(--teinte); margin: 0; }

/* Volets repliables : le chevron tourne sur un ressort. */
.filtres-pliables > summary::before { transition: transform var(--duree-vif) var(--ressort); }

/* ─── 13. Messages flash : des bulles de verre qui tombent du haut ──── */
.zone-messages { top: 10px; gap: 10px; }
.zone-messages .message-bulle {
  animation: none;
  background: var(--verre-fort); color: var(--texte);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border: 0; border-radius: 18px; padding: 12px 12px 12px 14px;
  box-shadow: var(--ombre-flotte); align-items: center;
  touch-action: none; cursor: grab; will-change: transform;
  font-weight: 500; -webkit-user-select: none; user-select: none;
}
.zone-messages .message-bulle::before {
  content: "✓"; flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ok); color: #fff; font-size: .8rem; font-weight: 800;
}
.zone-messages .flash-error::before { content: "!"; background: var(--rouge-vif); }
.zone-messages .flash-info::before { content: "i"; background: var(--warn); font-style: italic; font-family: Georgia, serif; }
.message-fermer {
  margin: 0; width: 26px; height: 26px; border-radius: 50%; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--fond-3); color: var(--texte-2); font-size: .75rem; opacity: 1;
}
.message-fermer:hover { background: var(--trait); filter: none; }

/* ─── 14. Connexion ──────────────────────────────────────────────────── */
.login-wrap { max-width: 400px; margin: 9vh auto; }
.login-logo img {
  width: 96px; height: 96px; object-fit: contain; padding: 8px; background: #fff;
  border-radius: 22px; box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 10px 30px rgba(0,0,0,.12);
}
.brandbig { font-family: var(--police-titre); font-size: 1.625rem; line-height: 1.2;
  font-weight: 700; letter-spacing: -.024em; margin: 20px 0 22px; }
.login-wrap .card { padding: 22px 22px 18px; border-radius: var(--rayon-xl); }
.login-wrap button[type=submit] { padding: 12px 18px; font-size: 1rem; margin-top: 16px; }

/* ─── 14 bis. v72 — L'onglet Administration ──────────────────────────
   Les mêmes listes groupées que le menu du téléphone : des blocs aux
   coins arrondis, sans bordure, un filet fin qui part après l'icône, et
   la teinte de la maison derrière chaque icône. */
.admin-liste { border: 0; border-radius: var(--rayon-l); box-shadow: var(--ombre-carte); }
.admin-ligne { touch-action: manipulation; transition: background-color .2s ease; }
.admin-ligne + .admin-ligne::before { border-top: .5px solid var(--trait); }
.admin-ligne:active { background: var(--presse); }
.admin-ic { background: var(--teinte-douce); border-radius: 9px; }
.admin-groupe-titre { font-size: .8125rem; letter-spacing: -.005em; }
.barre-enregistrer {
  border: 0; border-radius: var(--rayon-l); background: var(--verre-fort);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--ombre-flotte);
}
/* v72 — La matrice des compétences et son volet. */
.mc-cadre { border: 0; border-radius: var(--rayon-l); box-shadow: var(--ombre-carte); }
.mc-cadre-ligne { box-shadow: none; }
.mc-tuile { border-radius: var(--rayon); }
.mc-pop {
  border: 0; border-radius: var(--rayon-l); background: var(--verre-fort);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--ombre-flotte);
}
.mc-pop-niv { transition: transform var(--duree-vif) var(--ressort); touch-action: manipulation; }
/* v73 — Le résumé au survol d'un nom : du verre, comme le volet. */
.resume-carte {
  border: 0; border-radius: var(--rayon); background: var(--verre-fort);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--ombre-flotte);
}
.mc-pop-niv:active { transform: scale(.94); }
.mc-demande { border: 0; box-shadow: var(--ombre-carte); border-radius: var(--rayon); }
.matrice-blocs th, .matrice-blocs td { border-bottom-width: .5px; }
.matrice-blocs thead th { border-bottom: 1px solid var(--trait-fort); }

/* ═══════════════════════════════════════════════════════════════════
   TÉLÉPHONE
   ═══════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  :root { --bottom-h: calc(64px + 12px + env(safe-area-inset-bottom, 0px)); }
  body { font-size: 1rem; }
  h1 { font-size: 1.625rem; margin: .2rem 0 .8rem; }
  .page { padding: 6px 14px calc(var(--bottom-h) + 20px); }
  .topbar { padding: 8px 14px; min-height: 54px; gap: 8px; }
  .brand-logo { height: 32px; width: 32px; }
  .brand-name { max-width: 52vw; font-size: 1rem; }
  /* Sur téléphone, le titre de page remplace le nom de l'app dans la barre. */
  .topbar-titre { left: 56px; right: 110px; transform: translateY(-30%); max-width: none;
                  text-align: left; }
  html.titre-passe .topbar-titre { transform: translateY(-50%); }
  html.titre-passe .brand-name { opacity: 0; transform: translateY(-6px); }
  .userbox .pill-notif, .menu-burger { display: inline-flex; }
  .compte { display: none; }
  .userbox.sans-menu .compte { display: block; }
  .userbox.sans-menu .compte-nom { display: none; }
  .userbox.sans-menu .compte-bouton { padding-right: 10px; }
  .barre-collee { bottom: var(--bottom-h); }
  .card { padding: 16px; border-radius: 18px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-valeur { font-size: 1.875rem; }

  /* La barre d'onglets du bas flotte, en verre, détachée des bords. */
  .bottom-nav {
    left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 64px; padding: 5px; gap: 2px; border-radius: 32px; border: 0;
    background: var(--verre);
    -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
    box-shadow: var(--ombre-flotte), inset 0 .5px 0 var(--verre-bord);
  }
  .bottom-nav a, .bottom-nav .bnav-plus {
    margin: 0; padding: 4px 0; border-radius: 27px; gap: 2px;
    color: var(--texte-2); font-size: .625rem; font-weight: 600; letter-spacing: 0;
    background: transparent;
  }
  .bottom-nav .bnav-plus:hover { background: transparent; filter: none; }
  .bottom-nav a span:first-child, .bottom-nav .bnav-plus span:first-child { font-size: 1.3rem; line-height: 1.1; }
  .bottom-nav a.on { color: var(--teinte-ink); background: var(--teinte-douce); }
  .bottom-nav small { color: inherit; font-size: .625rem; }
  .bnav-op .bnav-op-bulle {
    width: 44px; height: 44px; margin-top: 0; font-size: 1.2rem;
    background: var(--teinte); box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  }
  .bottom-nav a.bnav-op { background: transparent; }
  .bnav-op.on .bnav-op-bulle { background: var(--rouge-vif); box-shadow: 0 0 0 3px var(--anneau); }
  .bnav-op small { display: none; }
  .notif-bottom { top: 2px; right: calc(50% - 22px); box-shadow: 0 0 0 2px var(--carte); }

  /* Le menu : un panneau qui flotte et se tire au doigt. */
  .mobile-nav {
    top: 8px; bottom: 8px; right: 8px; height: auto;
    width: min(340px, calc(100vw - 40px));
    border-radius: 28px; padding: 6px 0 14px;
    background: var(--verre-fort);
    -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
    box-shadow: var(--ombre-flotte);
    transform: translateX(calc(100% + 16px)); transition: none;
    touch-action: pan-y; overscroll-behavior: contain; will-change: transform;
  }
  .mobile-nav a { -webkit-user-drag: none; }
  .mobile-nav.ouvert { right: 8px; transform: none; }
  /* v72 — LE MENU SE FAIT DÉFILER. Ses groupes sont des boîtes aux coins
     arrondis (overflow: hidden) rangées dans une colonne flexible : rien ne
     les empêchait de rétrécir, et la colonne les écrasait pour tenir dans
     l'écran au lieu de déborder. Le panneau n'avait plus rien à faire
     défiler, et le bas de la liste — pour un admin : Entrepôt, Matériel,
     Documents, Galerie, Facturation, Direction, Notifications, Apparence,
     Mot de passe, Quitter — restait coupé, hors d'atteinte du doigt.
     Chaque bloc garde sa hauteur ; c'est le panneau qui défile. */
  .mobile-nav > * { flex-shrink: 0; }
  .mobile-nav { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .mobile-nav-overlay {
    display: block; opacity: 0; pointer-events: none; background: var(--voile);
    transition: opacity .25s ease;
  }
  .mobile-nav-overlay.visible { pointer-events: auto; opacity: 1; }
  .mobile-nav-header {
    border: 0; padding: 12px 12px 6px 16px; gap: 10px; align-items: center;
  }
  .mnav-identite {
    display: flex; align-items: center; gap: 12px; padding: 0; background: none;
    border: 0; flex: 1; min-width: 0;
  }
  .mnav-identite b { font-size: 1rem; letter-spacing: -.015em; }
  .mnav-identite small { display: block; font-size: .75rem; line-height: 1.35; }
  .mnav-fermer {
    margin: 0; width: 32px; height: 32px; border-radius: 50%; padding: 0; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--fond-3); color: var(--texte-2); font-size: .85rem;
  }
  .mnav-fermer:hover { background: var(--trait); filter: none; }
  .mnav-modes { padding: 8px 16px 4px; }
  .mnav-modes.segmente { display: flex; margin: 6px 16px 4px; padding: 2px; }
  .mnav-modes.segmente form { flex: 1; }
  .mnav-modes.segmente button {
    width: 100%; border: 0; justify-content: center; padding: 6px 4px; font-size: .8125rem;
  }
  .mnav-modes.segmente button.actif { background: var(--carte); color: var(--texte); }
  :root[data-theme="sombre"] .mnav-modes.segmente button.actif,
  :root.sombre-auto .mnav-modes.segmente button.actif { background: #636366; }
  .mnav-groupe {
    margin: 12px 12px 0; border-radius: 16px; overflow: hidden;
    background: var(--carte); box-shadow: var(--ombre-carte);
  }
  .mobile-nav .mnav-groupe a {
    padding: 11px 14px; border: 0; font-weight: 500; font-size: .9375rem; gap: 12px;
    position: relative;
  }
  .mobile-nav .mnav-groupe a + a::before {
    content: ""; position: absolute; top: 0; right: 0; left: 50px;
    border-top: .5px solid var(--trait);
  }
  .mobile-nav .mnav-groupe a::after {
    content: "›"; color: var(--texte-3); font-size: 1.15rem; line-height: 1; margin-left: auto;
  }
  .mobile-nav a.mnav-op { background: transparent; border-left: 0; }
  .mobile-nav a.mnav-op .mnav-label b { color: var(--teinte-ink); }
  .mobile-nav a.on { border-left: 0; background: var(--teinte-douce); }
  .mobile-nav a.mnav-danger .mnav-label { color: var(--alerte-ink, var(--rouge)); }
  .mnav-icon { width: 24px; text-align: center; font-size: 1.1rem; }
  .mnav-section {
    background: none; padding: 18px 28px 0; font-size: .8125rem; font-weight: 600;
    letter-spacing: -.005em; text-transform: none; color: var(--texte-2);
  }
  .mnav-section + .mnav-groupe { margin-top: 6px; }

  .zone-messages { top: calc(8px + env(safe-area-inset-top, 0px)); width: calc(100vw - 20px); }
  .bandeau-maj { bottom: calc(var(--bottom-h) + 12px); }
  .msg-layout.convo-ouverte .msg-liste { display: none; }
  .msg-retour { display: inline-block; margin: -4px 0 4px; font-weight: 500; text-decoration: none;
                color: var(--teinte-ink); }
  .fiche-onglets { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .fiche-onglets::-webkit-scrollbar { display: none; }
  .fiche-onglets a { flex: none; white-space: nowrap; }
  /* v72 — Les blocs de la planification, en cartes sur le téléphone. */
  .matrice-blocs tbody tr { border: 0; border-radius: var(--rayon); box-shadow: var(--ombre-carte); }
  .matrice-blocs .col-vue label { border-radius: 999px; }
  .machine-grille { border: 0; border-radius: var(--rayon-l); box-shadow: var(--ombre-carte); background: var(--carte); }
  .machine-grille .machine-carte { box-shadow: none; border-radius: 0; border-top: .5px solid var(--trait); }
  .machine-grille .machine-carte:first-child { border-top: 0; }
  .machine-grille .machine-carte:active { transform: none; background: var(--presse); }
  .machine-photo, .machine-photo-vide { border-radius: 10px; }
}

/* ═══════════════════════════════════════════════════════════════════
   ACCESSIBILITÉ
   ═══════════════════════════════════════════════════════════════════ */

/* Moins de mouvement : on garde le retour, on retire le déplacement.
   Un bouton pâlit à l'appui au lieu de s'enfoncer ; menus et bulles
   apparaissent en fondu au lieu de glisser (géré aussi dans le script). */
@media (prefers-reduced-motion: reduce) {
  /* Les transitions raccourcissent ; les animations de couleur (une case
     commentée qui clignote) restent : elles ne déplacent rien. */
  *, *::before, *::after { transition-duration: .15s !important; }
  button:active, .btn:active, .pill:active, .desktop-nav a:active, .bottom-nav a:active,
  .fiche-onglets a:active, .btn-evenement:active, .ch-carte:active, .machine-carte:active,
  .entrepot-carte:active, a.kpi:active, .alerte-ligne:active, .compte-bouton:active,
  .icone-bouton:active, .bottom-nav .bnav-plus:active {
    transform: none; filter: brightness(.88);
  }
  .compte-menu, .compte-menu.ouvert { transform: none; }
  .topbar-titre, html.titre-passe .topbar-titre { transform: translate(-50%, -50%); }
  .aimant.pris { transform: none; }
}

/* Moins de transparence : le verre devient opaque. */
@media (prefers-reduced-transparency: reduce) {
  .chrome, html.defile .chrome, .bottom-nav, .mobile-nav, .compte-menu,
  .zone-messages .message-bulle, .bandeau-maj, .barre-enregistrer, .mc-pop, .resume-carte {
    background: var(--barre); -webkit-backdrop-filter: none; backdrop-filter: none;
  }
}

/* Plus de contraste : des bords francs, un texte secondaire plus sombre. */
@media (prefers-contrast: more) {
  :root { --trait: #a1a1a6; --trait-fort: #6e6e73; --texte-2: #3a3a3c; --texte-3: #48484a;
          --trait-saisie: #6e6e73; }
  .card, .kpi, .btn-evenement, .machine-carte, .bottom-nav, .mobile-nav, .compte-menu,
  .admin-liste {
    border: 1px solid var(--trait-fort);
  }
  .chrome, html.defile .chrome { background: var(--barre); box-shadow: 0 1px 0 var(--trait-fort); }
}

} /* fin @media screen */
