/* ==========================================================================
   Canon de la Société de Tir de Veyrier — feuille de style commune
   Règles : boutons ≥ 48 px (56 px visés), gros textes, animations seulement
   sur transform/opacity, < 300 ms, et respect de « réduire les animations ».
   ========================================================================== */

/* ---------- Polices (hébergées ici, licence OFL) ---------- */
@font-face { font-family: 'Barlow'; font-weight: 400; font-style: normal; font-display: optional; src: url('/fonts/barlow-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 500; font-style: normal; font-display: optional; src: url('/fonts/barlow-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 600; font-style: normal; font-display: optional; src: url('/fonts/barlow-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow'; font-weight: 700; font-style: normal; font-display: optional; src: url('/fonts/barlow-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 500; font-style: normal; font-display: optional; src: url('/fonts/barlow-condensed-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; font-style: normal; font-display: optional; src: url('/fonts/barlow-condensed-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; font-style: normal; font-display: optional; src: url('/fonts/barlow-condensed-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Barlow Condensed'; font-weight: 800; font-style: normal; font-display: optional; src: url('/fonts/barlow-condensed-latin-800-normal.woff2') format('woff2'); }
/* (lot 9a) Police de SECOURS aux mêmes dimensions que Barlow : si Barlow n'est pas là tout de suite
   (première visite sur un réseau lent), le texte s'affiche en Arial / Helvetica / Roboto RÉGLÉE pour
   prendre la même place (largeur moyenne, hauteur des lettres) — et il ne change plus jamais de forme
   pendant que la page est ouverte (« font-display: optional »). Mesures prises sur les fichiers de
   public/fonts (module fontkit) par rapport à Arial. Seulement pour les lettres que Barlow contient
   (« unicode-range ») : une flèche ou un symbole garde la police du système, comme avant. */
@font-face { font-family: 'Barlow Secours'; font-weight: 100 500; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans'), local('LiberationSans'), local('Roboto'), local('Roboto-Regular'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; size-adjust: 94.4%; ascent-override: 105.9%; descent-override: 21.2%; line-gap-override: 0%; }
@font-face { font-family: 'Barlow Secours'; font-weight: 600 900; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Liberation Sans Bold'), local('LiberationSans-Bold'), local('Roboto Bold'), local('Roboto-Bold'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; size-adjust: 91%; ascent-override: 110%; descent-override: 22%; line-gap-override: 0%; }
@font-face { font-family: 'Barlow Condensed Secours'; font-weight: 100 500; src: local('Arial'), local('ArialMT'), local('Helvetica'), local('Liberation Sans'), local('LiberationSans'), local('Roboto'), local('Roboto-Regular'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; size-adjust: 75.8%; ascent-override: 131.9%; descent-override: 26.4%; line-gap-override: 0%; }
@font-face { font-family: 'Barlow Condensed Secours'; font-weight: 600 900; src: local('Arial Bold'), local('Arial-BoldMT'), local('Helvetica Bold'), local('Helvetica-Bold'), local('Liberation Sans Bold'), local('LiberationSans-Bold'), local('Roboto Bold'), local('Roboto-Bold'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; size-adjust: 75.5%; ascent-override: 132.5%; descent-override: 26.5%; line-gap-override: 0%; }

/* ---------- Couleurs et mesures ---------- */
:root {
  --jaune: #FBE122;
  --vert: #509E2F;
  --noir: #111111;
  --creme: #F6F4EC;
  --rouge: #C62E1F;
  --vert-fonce: #2F7A1F;
  --blanc: #ffffff;

  --texte: var(--noir);
  --texte-doux: #4d4b44;
  --fond: var(--creme);
  --surface: var(--blanc);
  --surface-2: #ece9de;
  --bordure: #d9d5c6;
  --poudre: var(--noir);
  --focus: var(--vert-fonce);

  --police: 'Barlow', 'Barlow Secours', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --police-titre: 'Barlow Condensed', 'Barlow Condensed Secours', 'Barlow', 'Barlow Secours', system-ui, Arial, sans-serif;

  --rayon: 12px;
  --rayon-grand: 18px;
  --ombre: 0 1px 2px rgba(17, 17, 17, .06), 0 4px 14px rgba(17, 17, 17, .07);
  --ombre-forte: 0 10px 40px rgba(17, 17, 17, .22);

  --bouton: 56px;          /* hauteur des boutons (≥ 48 px exigés) */
  --bouton-petit: 48px;
  --nav-bas: 64px;
  --large: 1200px;         /* largeur utile sur un grand écran */

  --rapide: 120ms;
  --normal: 220ms;
  --sortie: cubic-bezier(.2, .8, .2, 1);
  /* (lot 9a) LA transition du site : un fondu léger et court, la même durée et la même courbe partout
     (changement de page, contenu qui arrive, fenêtres, panneaux, messages). Jamais de glissement. */
  --fondu: 180ms;
  --courbe: cubic-bezier(.2, .8, .2, 1);

  --bande: repeating-linear-gradient(45deg, var(--jaune) 0 16px, var(--vert) 16px 28px);
}

/* Thème nuit (écran de la tente, mode tir) — utilisé aux étapes 3 et 4. */
.theme-nuit {
  --texte: #f4f2ea;
  --texte-doux: #b9b6aa;
  --fond: var(--noir);
  --surface: #1c1c1c;
  --surface-2: #262626;
  --bordure: #3a3a3a;
  --poudre: #cfcab7;
  --focus: var(--jaune);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--police);
  font-size: 18px;
  line-height: 1.45;
  color: var(--texte);
  background: var(--fond);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 6vw, 2.75rem); text-transform: uppercase; }
h2 { font-size: 1.6rem; text-transform: uppercase; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[hidden] { display: none !important; }

.lien-evitement {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  background: var(--noir); color: var(--jaune); padding: 12px 16px; border-radius: 8px;
}
.lien-evitement:focus { top: 12px; }
.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Bande décorative (blason de Veyrier) ---------- */
.bande { height: 10px; background: var(--bande); }
.bande-epaisse { height: 16px; }

/* ---------- Cadre des pages de l'équipe (D60) ----------
   Le menu est visible PAR CONSTRUCTION : la page est une grille de la hauteur de l'écran —
   l'en-tête en haut, les rubriques des Réglages, le contenu qui défile SEUL au milieu, la barre du
   bas sur téléphone. Plus rien ne dépend de « position: fixed ». */
body:not(.page-auth):not(:where(.tente)) {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-areas: "haut" "rubriques" "contenu" "bas";
  height: 100vh; height: 100dvh; min-height: 0;
  overflow: hidden;
}
body:not(.page-auth):not(:where(.tente)) > main {
  grid-area: contenu; min-width: 0; min-height: 0;
  /* « relative » : tout ce qui est placé « en absolu » dans le contenu défile AVEC lui (et ne peut pas
     agrandir la page elle-même, qui ne doit jamais défiler). */
  position: relative;
  overflow-x: hidden; overflow-y: auto; scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
  view-transition-name: contenu;
}
body:not(.page-auth):not(:where(.tente)) > main:focus, body:not(.page-auth):not(:where(.tente)) > main:focus-visible { outline: none; }

/* ---------- En-tête ---------- */
.haut { grid-area: haut; position: relative; z-index: 20; view-transition-name: haut; }
.haut .bande { height: 8px; }
.entete {
  display: flex; align-items: center; gap: 10px;
  padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
  padding-top: max(4px, env(safe-area-inset-top));
  background: var(--blanc);
}
.entete-logo { display: inline-flex; align-items: center; flex: none; min-height: var(--bouton-petit); }
.entete-logo img { height: 42px; width: auto; }
.nav-haut { display: none; gap: 2px; margin-left: 6px; min-width: 0; }
.nav-haut a {
  display: inline-flex; align-items: center; min-height: var(--bouton-petit); padding: 0 12px;
  font-family: var(--police-titre); font-weight: 700; font-size: 1.15rem; text-transform: uppercase; white-space: nowrap;
  text-decoration: none; border-radius: 10px; color: var(--texte-doux);
  transition: background-color var(--rapide), color var(--rapide);
}
.nav-haut a:hover { background: var(--surface-2); color: var(--noir); }
.nav-haut a[aria-current="page"] { color: var(--noir); background: var(--jaune); }
.entete .entete-tente { display: none; flex: none; white-space: nowrap; }
.entete-moi {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px; flex: none;
  min-height: var(--bouton-petit); padding: 2px 6px 2px 2px; border-radius: 999px; text-decoration: none;
  font-weight: 600;
}
.entete-moi:hover { background: var(--surface-2); }
.entete-moi[aria-current="page"] .avatar { box-shadow: 0 0 0 3px var(--blanc), 0 0 0 6px var(--vert); }
.entete-moi .prenom { display: none; }

/* Réservé au responsable : montré dès le premier affichage (classe posée par /js/cadre.js, puis
   confirmée par session.js après /api/auth/me). */
html:not(.est-responsable) [data-responsable] { display: none !important; }

/* ---------- Barre du bas (téléphone) ---------- */
.nav-bas {
  grid-area: bas; position: relative; z-index: 30;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  min-height: calc(var(--nav-bas) + env(safe-area-inset-bottom));
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: var(--blanc); border-top: 1px solid var(--bordure);
  view-transition-name: nav-bas;
}
.nav-bas a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: var(--nav-bas);
  text-decoration: none; color: var(--texte-doux);
  font-family: var(--police-titre); font-weight: 700; font-size: .92rem; text-transform: uppercase;
  position: relative;
}
.nav-bas svg { width: 26px; height: 26px; transition: transform var(--normal) var(--sortie); }
.nav-bas a[aria-current="page"] { color: var(--noir); }
.nav-bas a[aria-current="page"]::before {
  content: ''; position: absolute; top: 0; left: 22%; right: 22%; height: 4px; border-radius: 0 0 4px 4px;
  background: var(--vert);
}
.nav-bas a[aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
.nav-bas a:active svg { transform: scale(.9); }

/* Ordinateur, tablette, téléphone couché : tous les onglets dans l'en-tête, plus de barre du bas. */
@media (min-width: 760px) {
  .entete {
    gap: 12px;
    padding: 6px max(20px, env(safe-area-inset-right), calc((100% - var(--large)) / 2)) 6px max(20px, env(safe-area-inset-left), calc((100% - var(--large)) / 2));
    padding-top: max(6px, env(safe-area-inset-top));
  }
  .nav-haut { display: flex; }
  .entete .entete-tente { display: inline-flex; margin-left: auto; }
  .entete-moi { margin-left: 0; }
  .nav-bas { display: none; }
}
@media (min-width: 1000px) {
  .entete-logo img { height: 50px; }
  .nav-haut { gap: 4px; margin-left: 12px; }
  .nav-haut a { padding: 0 16px; }
  .entete-moi .prenom { display: inline; }
}
.ordi-seulement, .btn.ordi-seulement { display: none; }
@media (min-width: 760px) { .ordi-seulement { display: revert; } .btn.ordi-seulement { display: inline-flex; } }

/* ---------- Rubriques des Réglages ----------
   Téléphone : des onglets qui défilent de gauche à droite, juste sous l'en-tête (toujours visibles).
   Ordinateur (900 px et plus) : un menu sur le côté gauche, le contenu à droite. */
.reglages-nav {
  grid-area: rubriques; min-width: 0;
  background: var(--blanc); border-bottom: 1px solid var(--bordure);
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  view-transition-name: reglages-nav;
}
.reglages-nav::-webkit-scrollbar { display: none; }
.reglages-nav-titre { display: none; }
.reglages-nav ul {
  list-style: none; margin: 0; display: flex; gap: 6px; width: max-content;
  padding: 4px max(12px, env(safe-area-inset-right)) 4px max(12px, env(safe-area-inset-left));
}
.reglages-nav a {
  display: inline-flex; align-items: center; gap: 10px; min-height: var(--bouton-petit); padding: 0 16px;
  border-radius: 999px; white-space: nowrap; text-decoration: none;
  font-family: var(--police-titre); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: .01em;
  color: var(--texte-doux); background: var(--surface-2);
  transition: background-color var(--rapide), color var(--rapide);
}
.reglages-nav a svg { display: none; width: 22px; height: 22px; flex: none; }
.reglages-nav a:hover { color: var(--noir); }
.reglages-nav a[aria-current="page"] { background: var(--noir); color: var(--jaune); }
@media (min-width: 900px) {
  body[data-rubrique] {
    grid-template-columns: max(248px, calc(228px + (100% - var(--large)) / 2)) minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "haut haut" "rubriques contenu";
  }
  .reglages-nav {
    overflow-x: hidden; overflow-y: auto; border-bottom: 0; border-right: 1px solid var(--bordure);
    padding: 28px 12px 24px max(20px, calc(100% - 228px));
  }
  .reglages-nav-titre {
    display: block; margin: 0 0 12px; padding-left: 12px;
    font-family: var(--police-titre); font-weight: 800; font-size: 1.7rem; line-height: 1.05; text-transform: uppercase;
  }
  .reglages-nav ul { flex-direction: column; gap: 4px; padding: 0; width: auto; }
  .reglages-nav a { display: flex; border-radius: 12px; padding: 0 12px; background: transparent; white-space: normal; }
  /* (lot 10) « Réglages du planning », le plus long : s'il se plie sur 2 lignes (police de secours), il garde ses 48 px. */
  .reglages-nav a[data-rubrique-lien="planning"] { line-height: 1.15; }
  .reglages-nav a svg { display: block; }
  .reglages-nav a:hover { background: var(--surface-2); }
  .reglages-nav a[aria-current="page"] { background: var(--noir); }
}

/* ---------- Contenu ---------- */
.contenu {
  width: 100%;
  padding: 18px max(16px, env(safe-area-inset-right), calc((100% - var(--large)) / 2)) 40px max(16px, env(safe-area-inset-left), calc((100% - var(--large)) / 2));
}
@media (min-width: 760px) {
  .contenu {
    padding: 28px max(20px, env(safe-area-inset-right), calc((100% - var(--large)) / 2)) 56px max(20px, env(safe-area-inset-left), calc((100% - var(--large)) / 2));
  }
}
@media (min-width: 900px) {
  /* Réglages : le contenu commence juste après le menu du côté et s'arrête au même bord que l'en-tête. */
  body[data-rubrique] > .contenu { padding-left: 28px; padding-right: max(20px, calc((100vw - var(--large)) / 2)); }
}
.titre-page { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.titre-page h1 { margin: 0; }
.sous-titre { color: var(--texte-doux); margin: 4px 0 0; font-size: 1.05rem; }
.section { margin-top: 32px; }
.section > h2 { display: flex; align-items: center; gap: 10px; }

/* ---------- Boutons ---------- */
.btn {
  --btn-fond: var(--surface-2);
  --btn-texte: var(--noir);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--bouton); padding: 6px 22px;
  border: 2px solid transparent; border-radius: var(--rayon);
  text-align: center; line-height: 1.1; /* un texte long se plie proprement, centré */
  background: var(--btn-fond); color: var(--btn-texte);
  font-family: var(--police-titre); font-weight: 700; font-size: 1.3rem; letter-spacing: .02em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform var(--rapide) ease-out, box-shadow var(--rapide), background-color var(--rapide), opacity var(--rapide);
}
.btn:hover { box-shadow: 0 2px 10px rgba(17,17,17,.15); }
/* Petit effet d'enfoncement au toucher (instantané, ne retarde rien). */
.btn:active, .btn.enfonce { transform: scale(.96); box-shadow: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 24px; height: 24px; flex: none; }
/* (lot 8a) Le même petit enfoncement là où il manquait : onglets, rubriques des Réglages, lignes d'événement, croix. */
.nav-haut a:active, .reglages-nav a:active, .fermer:active { transform: scale(.96); }
details.evenement > summary:active { transform: scale(.985); }
.btn-primaire { --btn-fond: var(--noir); --btn-texte: var(--jaune); }
.btn-jaune { --btn-fond: var(--jaune); --btn-texte: var(--noir); }
.btn-vert { --btn-fond: var(--vert-fonce); --btn-texte: var(--blanc); }
.btn-rouge { --btn-fond: var(--rouge); --btn-texte: var(--blanc); }
.btn-contour { --btn-fond: transparent; border-color: currentColor; }
.btn-discret { --btn-fond: transparent; padding: 6px 12px; }
.btn-discret:hover { background: var(--surface-2); box-shadow: none; }
.btn-large { width: 100%; }
.btn-geant { min-height: 80px; font-size: 1.7rem; border-radius: var(--rayon-grand); }
.btn-petit { min-height: var(--bouton-petit); font-size: 1.1rem; padding: 4px 16px; }
.btn .roue {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid currentColor; border-right-color: transparent;
  animation: tourne .7s linear infinite;
}
.groupe-boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.groupe-boutons.empile { flex-direction: column; }

/* ---------- Formulaires ---------- */
.champ { display: block; margin-bottom: 18px; }
.champ > span, .etiquette { display: block; font-weight: 600; margin-bottom: 6px; }
.champ .aide { display: block; font-weight: 400; font-size: .95rem; color: var(--texte-doux); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; min-height: var(--bouton);
  padding: 12px 16px;
  font: inherit; font-size: 1.15rem; /* ≥ 16 px : pas de zoom automatique sur iPhone */
  color: var(--texte); background: var(--surface);
  border: 2px solid var(--bordure); border-radius: var(--rayon);
  transition: border-color var(--rapide), box-shadow var(--rapide);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--noir); box-shadow: 0 0 0 4px rgba(251, 225, 34, .55); }
.champ.erreur input, .champ.erreur select, .champ.erreur textarea { border-color: var(--rouge); }
.champ .message-erreur { display: block; color: var(--rouge); font-weight: 600; margin-top: 6px; font-size: 1rem; }
.mot-de-passe { position: relative; }
.mot-de-passe input { padding-right: 64px; }
.mot-de-passe .voir {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  min-width: var(--bouton-petit); min-height: var(--bouton-petit);
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; color: var(--texte-doux); cursor: pointer; border-radius: 10px;
}
.mot-de-passe .voir svg { width: 26px; height: 26px; }
.case {
  display: flex; align-items: center; gap: 14px; min-height: var(--bouton); cursor: pointer; font-weight: 600;
  margin-bottom: 18px;
}
.case input { width: 30px; height: 30px; accent-color: var(--vert-fonce); flex: none; margin: 0; }
.alerte {
  padding: 14px 18px; border-radius: var(--rayon); margin-bottom: 18px; font-weight: 500;
  border-left: 6px solid var(--noir); background: var(--surface);
}
.alerte-erreur { border-color: var(--rouge); background: #fbe9e6; }
.alerte-succes { border-color: var(--vert-fonce); background: #e8f3e3; }
.alerte-info { border-color: var(--jaune); background: #fffbe0; }
.alerte p:last-child { margin-bottom: 0; }

/* ---------- Pages de connexion / liens / installation ---------- */
.page-auth { display: flex; flex-direction: column; min-height: 100dvh; }
.auth {
  flex: 1; display: flex; align-items: flex-start; justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 16px 32px;
}
@media (min-height: 760px) { .auth { align-items: center; } }
.auth-carte {
  width: 100%; max-width: 480px; background: var(--surface);
  border-radius: var(--rayon-grand); box-shadow: var(--ombre); overflow: hidden;
}
.auth-contenu { padding: 28px 24px 24px; }
@media (min-width: 520px) { .auth-contenu { padding: 36px 36px 28px; } }
.auth-logo { width: 240px; height: auto; margin: 0 auto 18px; }
.auth h1 { text-align: center; font-size: 2.1rem; }
.auth .intro { text-align: center; color: var(--texte-doux); margin-top: -4px; }
.auth-liens { text-align: center; margin-top: 18px; display: grid; gap: 4px; }
.auth-liens a { display: inline-flex; align-items: center; justify-content: center; min-height: var(--bouton-petit); font-weight: 600; }

/* ---------- Cartes et listes ---------- */
.carte {
  background: var(--surface); border-radius: var(--rayon-grand); box-shadow: var(--ombre);
  padding: 20px; margin-bottom: 16px;
}
.carte-titre { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ligne {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border-radius: var(--rayon); padding: 14px 16px; box-shadow: var(--ombre);
}
.ligne-principal { flex: 1; min-width: 0; }
.liste-membres .ligne { align-items: flex-start; }
@media (min-width: 760px) { .liste-membres { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); } }
.ligne-titre { font-weight: 700; font-size: 1.15rem; }
.ligne-detail { color: var(--texte-doux); font-size: 1rem; overflow-wrap: anywhere; }
.ligne-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--noir); color: var(--jaune);
  font-family: var(--police-titre); font-weight: 800; font-size: 1.2rem; text-transform: uppercase;
}
.avatar-grand { width: 64px; height: 64px; font-size: 1.7rem; }

.pastille {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-family: var(--police-titre); font-weight: 700; font-size: 1rem; text-transform: uppercase; letter-spacing: .02em;
  background: var(--surface-2); color: var(--noir); white-space: nowrap;
}
.pastille-responsable { background: var(--jaune); }
.pastille-attente { background: #fff1c2; color: #6b5300; }
.pastille-inactif { background: #e6e3da; color: #6a675e; }
/* États des tirs */
.etat-a_venir { background: var(--surface-2); }
.etat-prochain { background: var(--jaune); color: var(--noir); }
.etat-tire { background: var(--vert-fonce); color: var(--blanc); }
.etat-a_retirer { background: #fbe9e6; color: var(--rouge); box-shadow: inset 0 0 0 2px var(--rouge); }
.etat-retire { background: #e8f3e3; color: var(--vert-fonce); box-shadow: inset 0 0 0 2px var(--vert-fonce); }
.etat-pas_parti { background: var(--rouge); color: var(--blanc); }
.etat-annule { background: #6a675e; color: var(--blanc); }

/* ---------- Tirs ---------- */
.tir {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px;
  padding: 12px 14px; border-radius: var(--rayon); background: var(--surface);
  border-left: 6px solid transparent;
  transition: transform var(--normal) var(--sortie), opacity var(--normal);
}
.tir + .tir { margin-top: 8px; }
.tir-heure { font-family: var(--police-titre); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.tir-nom { font-weight: 700; font-size: 1.1rem; }
.tir-detail { color: var(--texte-doux); font-size: .98rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.tir.est-prochain { border-left-color: var(--jaune); box-shadow: 0 0 0 2px var(--jaune), var(--ombre); }
.tir.est-a-moi .tir-nom::after { content: ' • toi'; color: var(--vert-fonce); font-weight: 700; }
.tir.est-fini { opacity: .62; }
/* Charge d'un tir : verre + nom + position par rapport à la ligne (D39, D43). */
.charge-info { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.charge-info .charge-pos { font-weight: 400; color: var(--texte-doux); }
.charge-a-choisir {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font-weight: 600;
  color: #555; border: 1px dashed #888;
  background: repeating-linear-gradient(135deg, #eeeae0 0 6px, #e2ddd0 6px 12px);
}

/* Verre de poudre avec LA ligne de repère : poudre, liseré et ligne glissent (transform seulement). */
.verre { width: 22px; height: 28px; flex: none; overflow: visible; --fond-verre: var(--blanc); }
.verre-moyen { width: 44px; height: 56px; }
.verre-grand { width: 88px; height: 110px; }
.verre-geant { width: clamp(96px, 15vh, 220px); height: clamp(120px, 18.75vh, 275px); }
.verre-contour { fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.verre-poudre {
  fill: var(--poudre);
  transform-box: fill-box; transform-origin: 50% 100%;
  transform: scaleY(var(--remplissage, 0));
  transition: transform 420ms var(--sortie);
}
.verre-surface {
  fill: var(--couleur-charge, var(--poudre));
  transform: translateY(calc((1 - var(--remplissage, 0)) * 24.2px));
  transition: transform 420ms var(--sortie);
}
.verre-ligne { transform: translateY(calc(var(--ligne, .55) * -24.2px)); transition: transform 420ms var(--sortie); }
.verre-ligne-halo { stroke: var(--fond-verre); stroke-width: 3; stroke-linecap: round; }
.verre-ligne-trait { stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; }

/* Prochain tir (accueil) */
.prochain {
  position: relative; overflow: hidden;
  background: var(--noir); color: var(--blanc);
  border-radius: var(--rayon-grand); padding: 22px 22px 20px; margin-bottom: 24px;
  box-shadow: var(--ombre-forte);
}
.prochain::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 10px; background: var(--bande); }
.prochain .surtitre {
  font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; color: var(--jaune);
  letter-spacing: .06em; font-size: 1.05rem;
}
.prochain .heure { font-family: var(--police-titre); font-weight: 800; font-size: clamp(3.4rem, 15vw, 5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.prochain .nom { font-size: 1.4rem; font-weight: 700; margin: 4px 0; }
.prochain .infos { color: #d6d3c8; display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-bottom: 8px; }
.prochain .verre { color: var(--blanc); --poudre: #cfcab7; --fond-verre: var(--noir); }
.prochain .charge-info .charge-pos { color: #d6d3c8; }
.prochain-vide .verre { color: var(--noir); --poudre: var(--noir); }
.prochain .cible-deco { position: absolute; right: -40px; top: -40px; width: 200px; height: 200px; opacity: .14; color: var(--blanc); }
.prochain .dans { color: var(--jaune); font-weight: 700; font-size: 1.15rem; }
.prochain-vide { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.prochain-vide .surtitre { color: var(--vert-fonce); }
.prochain-vide .cible-deco { color: var(--noir); opacity: .06; }

/* Accueil (D60) : le prochain départ de l'événement en cours, avec le gros bouton pour aller marquer. */
.accueil-grille { display: grid; grid-template-columns: minmax(0, 1fr); }
.accueil-grille .prochain, .accueil-grille .depart-vide { margin-bottom: 16px; }
.accueil-evenements { margin-top: 16px; }
.depart { padding-bottom: 30px; }
.depart-corps { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 24px; }
.depart-texte { flex: 1 1 230px; min-width: 0; }
.depart .nom { font-size: 1.5rem; overflow-wrap: anywhere; }
.depart .infos strong { color: var(--blanc); }
.depart-decale { color: var(--jaune); font-weight: 600; }
.depart-bouton { margin-top: 14px; min-height: 72px; position: relative; padding: 6px 12px; text-align: center; line-height: 1.1; font-size: clamp(1.3rem, 6vw, 1.7rem); }
.depart-vide .surtitre, .prochain-moi .surtitre {
  font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; color: var(--vert-fonce);
  letter-spacing: .06em; font-size: 1.05rem;
}
.depart-vide .nom { font-size: 1.25rem; font-weight: 700; margin: 4px 0; }
.depart-vide p:last-child { margin-bottom: 0; }
/* « Mon prochain tir » : une carte claire, plus petite que le prochain départ. */
.prochain-moi { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); padding: 18px 20px; }
.prochain-moi::after { display: none; }
.prochain-moi .heure { font-size: 2.9rem; }
.prochain-moi .nom { font-size: 1.2rem; overflow-wrap: anywhere; }
.prochain-moi .infos { color: var(--texte-doux); margin-bottom: 4px; }
.prochain-moi .verre { color: var(--noir); --poudre: var(--noir); --fond-verre: var(--blanc); }
.prochain-moi .charge-info .charge-pos { color: var(--texte-doux); }
.prochain-moi .dans { color: var(--vert-fonce); }
/* « Je vais au canon » (lot 5) : ouvre l'écran de marquage sur mon tir. */
.prochain-bouton { margin-top: 12px; position: relative; min-height: 64px; font-size: 1.3rem; }
.prochain-moi .cible-deco { color: var(--noir); opacity: .06; width: 150px; height: 150px; right: -30px; top: -30px; }
.acces-tente .muet { margin: 10px 0 0; font-size: 1rem; }
.acces-tente .btn + .muet + .btn { margin-top: 18px; }
@media (min-width: 640px) and (max-width: 999px) {
  .accueil-cote { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
}
@media (min-width: 1000px) {
  .accueil-grille {
    grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto 1fr;
    grid-template-areas: "depart cote" "evenements cote"; gap: 0 24px; align-items: start;
  }
  .accueil-depart { grid-area: depart; }
  .accueil-cote { grid-area: cote; }
  .accueil-evenements { grid-area: evenements; margin-top: 8px; }
}

/* Profil : deux colonnes sur grand écran. */
@media (min-width: 900px) {
  .profil-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 24px; align-items: start; }
}

/* Lien bien visible vers la « Gestion des tirs » d'un événement (Réglages → Événements). */
.lien-gestion {
  display: flex; align-items: center; gap: 14px; min-height: 72px; padding: 12px 16px; margin-bottom: 10px;
  background: var(--jaune); color: var(--noir); border-radius: var(--rayon); text-decoration: none; box-shadow: var(--ombre);
  transition: transform var(--rapide) ease-out;
}
.lien-gestion:active { transform: scale(.985); }
.lien-gestion > svg { width: 30px; height: 30px; flex: none; }
.lien-gestion > span { flex: 1; min-width: 0; }
.lien-gestion strong { display: block; font-family: var(--police-titre); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; line-height: 1.1; }
.lien-gestion-texte { display: block; font-size: 1rem; }

/* Événements (accueil) */
details.evenement { background: var(--surface); border-radius: var(--rayon-grand); box-shadow: var(--ombre); margin-bottom: 14px; overflow: hidden; }
details.evenement > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 18px; min-height: 72px;
}
details.evenement > summary::-webkit-details-marker { display: none; }
details.evenement > summary .chevron { margin-left: auto; transition: transform var(--normal) var(--sortie); width: 28px; height: 28px; flex: none; }
details.evenement[open] > summary .chevron { transform: rotate(180deg); }
.evenement-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 60px; height: 60px; border-radius: 12px; background: var(--jaune); color: var(--noir);
  font-family: var(--police-titre); font-weight: 800; line-height: 1; text-transform: uppercase;
}
.evenement-date .jour { font-size: 1.7rem; }
.evenement-date .mois { font-size: .85rem; letter-spacing: .04em; }
.evenement-corps { padding: 0 14px 16px; background: var(--surface); }
.progression { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.progression > span { display: block; height: 100%; width: 100%; background: var(--vert-fonce); transform-origin: left; transform: scaleX(var(--p, 0)); transition: transform 600ms var(--sortie); }

/* Titre d'un jour dans une liste de tirs (accueil, Réglages → Événements) quand il y a plusieurs jours. */
.jour-tirs { margin: 14px 0 6px; text-transform: uppercase; color: var(--texte-doux); font-size: 1.15rem; }
.jour-tirs:first-child { margin-top: 0; }
/* Ligne d'un tir : le texte du milieu se plie plutôt que de pousser la pastille d'état hors de la carte. */
.tir > :nth-child(2) { min-width: 0; }
.tir .tir-nom { overflow-wrap: anywhere; }
.tir .charge-info { white-space: normal; flex-wrap: wrap; }
.tir .charge-info .charge-pos { white-space: nowrap; }
.tir > .pastille { justify-self: end; }

/* Consignes de l'événement (accueil, Réglages → Événements) : retours à la ligne gardés. */
.consignes {
  white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2);
  border-radius: var(--rayon); padding: 12px 14px; margin: 0 0 14px;
}
.consignes-titre { display: block; font-family: var(--police-titre); font-weight: 700; text-transform: uppercase; font-size: .95rem; color: var(--texte-doux); }

/* Onglets segmentés (Mes tirs / Toute l'équipe) */
.segments { display: inline-flex; padding: 4px; background: var(--surface-2); border-radius: 14px; gap: 4px; margin: 4px 0 12px; }
.segments button {
  min-height: var(--bouton-petit); padding: 0 16px; border: 0; border-radius: 10px; background: transparent; cursor: pointer;
  font-family: var(--police-titre); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; color: var(--texte-doux);
  transition: background-color var(--rapide), color var(--rapide), transform var(--rapide);
}
.segments button[aria-pressed="true"] { background: var(--noir); color: var(--jaune); }
.segments button:active { transform: scale(.96); }

/* ---------- Fenêtres (dialog) ---------- */
dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px);
  border: 0; border-radius: var(--rayon-grand); padding: 0; background: var(--surface); color: var(--texte);
  box-shadow: var(--ombre-forte); overflow: auto;
}
dialog::backdrop { background: rgba(17, 17, 17, .55); }
dialog[open] { animation: apparait var(--fondu) var(--courbe); }
dialog[open]::backdrop { animation: apparait var(--fondu) var(--courbe); }
.dialog-entete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; }
.dialog-entete h2 { margin: 0; font-size: 1.5rem; }
.dialog-corps { padding: 16px 20px 20px; }
.fermer {
  min-width: var(--bouton-petit); min-height: var(--bouton-petit); border: 0; border-radius: 12px;
  background: var(--surface-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.fermer svg { width: 24px; height: 24px; }
.lien-a-copier {
  display: block; width: 100%; padding: 14px; border-radius: var(--rayon); background: var(--surface-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95rem; overflow-wrap: anywhere; margin-bottom: 14px;
}

/* ---------- Messages éphémères (toasts) ---------- */
.toasts {
  position: fixed; z-index: 200; left: 50%; top: calc(72px + env(safe-area-inset-top));
  transform: translateX(-50%); width: min(520px, calc(100vw - 24px));
  display: grid; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; padding: 14px 18px; border-radius: var(--rayon);
  background: var(--noir); color: var(--blanc); font-weight: 600; box-shadow: var(--ombre-forte);
  display: flex; align-items: center; gap: 12px;
  animation: apparait var(--fondu) var(--courbe) both;
}
.toast.sort { animation: disparait var(--fondu) var(--courbe) both; }
.toast-succes { background: var(--vert-fonce); }
.toast-erreur { background: var(--rouge); }

/* ---------- Squelettes de chargement ---------- */
.squelette {
  position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--rayon);
  min-height: 20px;
}
.squelette::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.65), transparent);
  transform: translateX(-100%);
  animation: miroite 1.2s ease-in-out infinite;
}
.squelette-ligne { height: 76px; margin-bottom: 12px; border-radius: var(--rayon); }
.squelette-carte { height: 190px; margin-bottom: 24px; border-radius: var(--rayon-grand); }
.squelette-texte { height: 22px; width: 60%; margin-bottom: 10px; }
/* Tailles proches du contenu final : rien ne saute quand les données arrivent. */
/* (--h : hauteur sur téléphone ; --ho : hauteur sur ordinateur.) */
.squelette-bloc { height: var(--h, 200px); margin-bottom: 16px; border-radius: var(--rayon-grand); }
.squelette-depart { height: 385px; margin-bottom: 16px; border-radius: var(--rayon-grand); }
.squelette-moi { height: 334px; margin-bottom: 16px; border-radius: var(--rayon-grand); } /* (lot 9a : mesuré) */
.squelette-evenement { height: 130px; margin-bottom: 14px; border-radius: var(--rayon-grand); }
.squelette-evenement-reglages { height: 170px; }
.squelette-membre { height: 198px; }
.squelette-membre-reglages { height: 230px; }
.squelette-appareil { height: 145px; }
.squelette-niveau { height: 220px; }
@media (min-width: 760px) {
  .squelette-evenement { height: 92px; }
  .squelette-evenement-reglages { height: 140px; }
  .squelette-membre-reglages { height: 250px; }
  .squelette-appareil { height: 75px; }
  .squelette-niveau { height: 103px; }
}
@media (min-width: 1000px) {
  .squelette-bloc { height: var(--ho, var(--h, 200px)); }
  .squelette-depart { height: 269px; }
  .squelette-moi { height: 309px; }
}

/* Apparition du contenu chargé : un fondu court, tout ensemble (lot 9a : plus de glissement ni de cascade). */
.entree { animation: apparait var(--fondu) var(--courbe) backwards; }

/* ---------- Connexion par code SMS ---------- */
.etape-connexion { animation: apparait var(--fondu) var(--courbe) backwards; }
.numero-rappel { text-align: center; margin: -4px 0 18px; color: var(--texte-doux); }
.numero-rappel strong { color: var(--noir); font-size: 1.15rem; white-space: nowrap; }
input.champ-code {
  text-align: center; font-family: var(--police-titre); font-weight: 800;
  font-size: 2.4rem; letter-spacing: .35em; padding-left: calc(16px + .35em);
  min-height: 76px; font-variant-numeric: tabular-nums;
}
input.champ-code::placeholder { color: #c9c5b6; letter-spacing: .35em; }
input.champ-tel { font-size: 1.4rem; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.lien-bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--bouton-petit);
  padding: 0 12px; border: 0; background: transparent; font: inherit; font-weight: 600; color: var(--texte);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; border-radius: 10px;
}
.lien-bouton:disabled { color: var(--texte-doux); text-decoration: none; cursor: default; }
.lien-bouton:not(:disabled):hover { background: var(--surface-2); }
.aide-secours { margin-top: 18px; font-size: 1rem; }

/* Code de secours affiché en grand (à dicter de vive voix) */
.code-geant {
  display: block; text-align: center; margin: 8px 0 14px;
  font-family: var(--police-titre); font-weight: 800; font-size: clamp(3.2rem, 16vw, 4.6rem); letter-spacing: .08em;
  font-variant-numeric: tabular-nums; background: var(--noir); color: var(--jaune);
  border-radius: var(--rayon-grand); padding: 14px 8px;
  animation: apparait var(--fondu) var(--courbe) both;
}
.code-validite { text-align: center; font-weight: 600; }

/* ---------- Paramètres ---------- */
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin: 8px 0 14px; }
.chiffre { background: var(--surface-2); border-radius: var(--rayon); padding: 12px 14px; }
.chiffre .valeur { font-family: var(--police-titre); font-weight: 800; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums; }
.chiffre .legende { color: var(--texte-doux); font-size: .95rem; }
.fil-ariane { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 6px; color: var(--texte-doux); font-weight: 600; }
.fil-ariane a { display: inline-flex; align-items: center; min-height: var(--bouton-petit); }

.liste-etat { margin: 0; display: grid; gap: 8px; }
.liste-etat > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 8px 0; border-top: 1px solid var(--bordure); }
.liste-etat > div:first-child { border-top: 0; }
@media (min-width: 640px) { .liste-etat > div { grid-template-columns: 240px 1fr; } }
.liste-etat dt { color: var(--texte-doux); font-weight: 600; }
.liste-etat dd { margin: 0; overflow-wrap: anywhere; }

/* Appareils connectés */
.appareil { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--bordure); }
.appareil:first-child { border-top: 0; }
.appareil svg { width: 30px; height: 30px; flex: none; color: var(--texte-doux); }
.appareil-infos { flex: 1; min-width: 0; }
.appareil-nom { font-weight: 700; }
.appareil-detail { color: var(--texte-doux); font-size: .95rem; }

/* ---------- Divers ---------- */
.vide { text-align: center; color: var(--texte-doux); padding: 28px 12px; }
.muet { color: var(--texte-doux); }
.centre { text-align: center; }
.mt-0 { margin-top: 0; }
.horloge { font-family: var(--police-titre); font-weight: 700; font-variant-numeric: tabular-nums; }
.pied { text-align: center; color: var(--texte-doux); font-size: .95rem; padding: 12px 16px 24px; }
.pied a { font-weight: 600; }
.icone { width: 24px; height: 24px; flex: none; }
.grille-2 { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .grille-2 { grid-template-columns: 1fr 1fr; } }

/* ---------- Animations ---------- */
/* (lot 9a) « entree » et « monte » ne sont plus que des fondus (plus de glissement) : gardés pour les
   pages qui s'en servent encore. */
@keyframes entree { from { opacity: 0; } to { opacity: 1; } }
@keyframes apparait { from { opacity: 0; } to { opacity: 1; } }
@keyframes disparait { to { opacity: 0; } }
@keyframes monte { from { opacity: 0; } to { opacity: 1; } }
@keyframes miroite { to { transform: translateX(100%); } }
@keyframes tourne { to { transform: rotate(360deg); } }
/* (lot 9a) Formulaire refusé : un bref clignement (opacité), plus de secousse de côté. */
@keyframes secoue { 0%, 100% { opacity: 1; } 40% { opacity: .55; } }
.secoue { animation: secoue var(--fondu) var(--courbe); }

/* Changement de page FLUIDE (D60, lot 9a) : le cadre ne bouge pas, seul le contenu change.
   - aucune animation sur toute la page (root) ;
   - l'en-tête, la barre du bas et le menu des Réglages ont chacun leur nom : ils sont posés tout de
     suite à leur place (aucune animation de place ni de taille : ils ne bougent pas d'un pixel) ;
   - seul <main> (« contenu ») fait un FONDU court (opacité seulement : ni glissement, ni agrandissement). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-group(haut), ::view-transition-group(nav-bas), ::view-transition-group(reglages-nav), ::view-transition-group(contenu) {
  animation: none;
}
::view-transition-old(haut), ::view-transition-old(nav-bas) { display: none; }
::view-transition-new(haut), ::view-transition-new(nav-bas) { animation: none; }
::view-transition-old(contenu), ::view-transition-new(contenu) {
  /* Le contenu n'est jamais étiré si la zone change de taille (entrée dans les Réglages). */
  width: 100%; height: 100%; object-fit: none; object-position: left top; overflow: clip;
}
::view-transition-old(contenu) { animation: var(--fondu) var(--courbe) both disparait; }
::view-transition-new(contenu) { animation: var(--fondu) var(--courbe) both apparait; }

/* Respect du réglage « réduire les animations » du téléphone. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .squelette::after { display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- SMS : aperçu du texte (Paramètres) ---------- */
.apercu-sms { margin: 4px 0 14px; }
.bulle-sms {
  white-space: pre-wrap; overflow-wrap: anywhere; margin: 6px 0 0; max-width: 34ch;
  background: var(--surface-2); border-radius: 18px 18px 18px 4px; padding: 12px 16px;
  font-size: 1.05rem; line-height: 1.4;
}
.apercu-infos { margin: 8px 0 0; }
.apercu-infos.erreur { color: var(--rouge); font-weight: 600; }
.sms-texte { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.sms-texte h3 { margin: 0; }

/* ---------- Paramètres > Charges du canon ---------- */
.btn-carre { min-width: var(--bouton); padding: 4px 10px; font-size: 1.2rem; }
.reglage { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.reglage-curseur { flex: 1 1 160px; display: flex; align-items: center; min-height: var(--bouton); }
.reglage-curseur input[type="range"] { width: 100%; height: 40px; accent-color: var(--noir); }
.reglage-valeur { font-family: var(--police-titre); font-weight: 800; font-size: 1.6rem; min-width: 4ch; text-align: right; font-variant-numeric: tabular-nums; }
.ligne-verres { display: flex; flex-wrap: wrap; gap: 14px 20px; padding: 8px 0 4px; }
.ligne-verre { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 600; font-size: .95rem; }
.ligne-phrase { color: var(--texte-doux); min-height: 4.35em; } /* place gardée : rien ne saute au chargement */
.ligne-verres { min-height: 94px; }
@media (min-width: 760px) { .ligne-phrase { min-height: 1.45em; } }
.alerte-douce { color: #7a5a00; font-weight: 600; }

.liste-niveaux { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.niveau {
  display: grid; grid-template-columns: auto auto 1fr; grid-template-areas: "poignee verre texte" "actions actions actions";
  gap: 8px 12px; align-items: center;
  background: var(--surface); border-radius: var(--rayon); padding: 10px 12px; box-shadow: var(--ombre);
  touch-action: pan-y;
}
@media (min-width: 640px) { .niveau { grid-template-columns: auto auto 1fr auto; grid-template-areas: "poignee verre texte actions"; } }
.niveau.glisse { position: relative; z-index: 2; box-shadow: var(--ombre-forte); opacity: .96; }
.poignee {
  grid-area: poignee; width: 56px; height: 56px; display: grid; place-items: center;
  border: 0; border-radius: 12px; background: var(--surface-2); color: var(--texte); cursor: grab; touch-action: none;
}
.poignee svg { width: 26px; height: 26px; fill: currentColor; }
.niveau.glisse .poignee { cursor: grabbing; }
.niveau-verre { grid-area: verre; }
.niveau-texte { grid-area: texte; min-width: 0; }
.niveau-nom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 1.15rem; }
.niveau-detail { color: var(--texte-doux); }
.niveau-desc { margin-top: 2px; overflow-wrap: anywhere; }
.niveau-actions { grid-area: actions; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.champ-couleur, fieldset.champ { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.pastilles-couleur { display: flex; flex-wrap: wrap; gap: 10px; }
.pastille-couleur { position: relative; width: 56px; height: 56px; border-radius: 50%; background: var(--c); cursor: pointer; box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25); }
.pastille-couleur input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.pastille-couleur:has(input:checked) { box-shadow: 0 0 0 4px var(--fond, #fff), 0 0 0 7px var(--noir); }
.pastille-couleur:has(input:focus-visible) { outline: 3px solid var(--jaune); outline-offset: 4px; }
.couleur-autre { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; min-height: var(--bouton); font-weight: 600; cursor: pointer; }
.couleur-autre input { width: 56px; height: 48px; border: 0; padding: 0; background: none; cursor: pointer; }
.hauteur { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.hauteur-reglage { flex: 1 1 220px; }
.hauteur-phrase { margin: 4px 0 0; font-weight: 600; }

.apercu-tente { background: #111; color: #fff; border-radius: var(--rayon); padding: 12px 16px; margin: 4px 0 18px; }
.apercu-tente .verre { color: #fff; --poudre: #cfcab7; --fond-verre: #111; }
.apercu-tente-titre { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: #bdb9ad; }
.apercu-tente-corps { display: flex; gap: 14px; align-items: center; margin-top: 6px; }
.apercu-tente-nom { font-family: var(--police-titre); font-weight: 800; font-size: 1.7rem; text-transform: uppercase; }
.apercu-tente-desc { font-size: 1.15rem; line-height: 1.3; overflow-wrap: anywhere; }

.zone-suppression { border-top: 1px solid var(--surface-2); margin-top: 18px; padding-top: 12px; }
.choix-remplacement { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 12px; }
.choix { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 6px 10px; border-radius: 12px; background: var(--surface-2); font-weight: 600; cursor: pointer; }
.choix:has(input:checked) { box-shadow: 0 0 0 3px var(--noir); }
.choix input { width: 22px; height: 22px; }

/* Réglages → SMS : détails repliables (diagnostic) */
.sms-details { margin: 12px 0; }
.sms-details > summary { min-height: var(--bouton); display: flex; align-items: center; font-weight: 700; cursor: pointer; }
[data-essai-resultat] { margin-top: 10px; }

/* Réglages → Écran de la tente (D51) */
.etapes-simples { margin: 8px 0 12px; padding-left: 1.4em; }
.etapes-simples li { margin: 4px 0; }
.code-tente { margin-top: 12px; }
.code-tente-chiffres { font-family: var(--police-titre); font-weight: 800; font-size: 2.4rem; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.appareil .pastille-tente { margin-left: 4px; }

/* Réglages → SMS : expéditeur, ligne « @domaine #code » (D53) */
.sms-expediteur { margin-top: 18px; }
.sms-expediteur h3 { margin: 0 0 8px; }
.apercu-expediteur { min-height: 1.5em; margin: 4px 0 10px; }
.nom-expediteur { font-family: var(--police-titre); font-weight: 800; font-size: 1.3rem; letter-spacing: .03em; white-space: pre; }
.aide.erreur { color: var(--rouge); font-weight: 600; }
.interrupteur { display: flex; align-items: center; gap: 12px; min-height: var(--bouton); font-weight: 600; cursor: pointer; margin-top: 8px; }
.interrupteur input { width: 28px; height: 28px; accent-color: var(--noir); flex: none; }
.pastille-bloque { background: #fde2df; color: #8a1c12; }

/* ---------- (lot 9a) Un site STABLE : rien ne bouge brusquement ----------
   Place réservée : un bloc qui attend le contenu d'au-dessus (de hauteur inconnue) reste INVISIBLE à sa
   place, puis apparaît en fondu quand tout est là (reveler(), public/js/ui.js). Rien ne saute sous les
   yeux. Sécurité : il devient visible tout seul après 6 s si la page n'a pas pu le montrer. */
[data-attente] { visibility: hidden; animation: attente-securite 0s linear 6s forwards; }
@keyframes attente-securite { to { visibility: visible; } }
/* Erreur d'un champ : écrite à la place de son aide (place déjà là), jamais en poussant le bouton. Le champ est une
   grille : le message occupe les MÊMES lignes que l'aide (cachée le temps de l'erreur), il ne recouvre jamais le
   bouton ; s'il est plus long que l'aide, la zone grandit au lieu de déborder. (Écarts de 6 px comme avant :
   dans une grille, les marges ne se fondent plus, d'où row-gap et des marges à 0.) */
.champ[data-erreur-a-la-place] { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
.champ[data-erreur-a-la-place] > * { grid-column: 1; margin-top: 0; margin-bottom: 0; }
.champ .aide.cache-erreur { visibility: hidden; }
.champ .message-erreur.sur-aide { grid-column: 1; align-self: start; line-height: 1.25; }
/* Connexion, écran du numéro : une seule aide, courte ; on lui garde la place d'un message de 4 lignes (« Numéro
   invalide… », « Trop de demandes… ») pour que le bouton ne descende pas. (L'écran du code a 2 aides : assez.) */
#form-numero .champ[data-erreur-a-la-place] > .aide { min-height: 5rem; }
/* Pages de connexion : la carte reste à sa place en haut (au lieu d'être recentrée) ; un message qui
   apparaît en bas de la carte ne fait rien remonter. */
@media (min-height: 760px) { .auth { align-items: flex-start; padding-top: max(48px, 6vh, env(safe-area-inset-top)); } }
.auth-alerte { margin: 14px 0 0; }
/* Barre du bas : un nombre de colonnes FIXE (5 pour le responsable, 4 sinon), connu dès la 1re image (classe
   posée par cadre.js). Sur un réseau lent, la page peut s'afficher avant que tous les onglets soient lus :
   ils ne se resserrent plus quand les derniers arrivent. */
.nav-bas { grid-auto-flow: row; grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.est-responsable .nav-bas { grid-template-columns: repeat(5, minmax(0, 1fr)); }
