/* ============================================================
   TP ECSR, Design system v3
   Crème ivoire + espresso + accent racing.
   Inspiration : darb + Good Luck Racing + Auto Trade.
   ============================================================ */

/* Self-host Canela (Commercial Type, display serif) */
@font-face {
  font-family: "Canela";
  src: url("fonts/canela_light.otf") format("opentype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Canela";
  src: url("fonts/canela_roman.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Canela";
  src: url("fonts/canela_bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* --- Neutrals, Mint éditorial (seul thème actif) --- */
  --bg:        #F1F4F0;
  --bg-elev:   #FBFCFA;
  --bg-soft:   #E7ECE3;
  --bg-subtle: #EAEFE6;
  --bg-deep:   #14201C;
  /* Lin (DA « Lin », docs/direction-artistique.md) : surface d'accent des chiffres clés, deux ou trois par écran. */
  --bg-lin:    #F5F1E8;
  --line-lin:  #E4DAC4;

  --line:        #D8DED2;
  --line-strong: #B7C0AA;
  --line-faint:  #E2E7DA;

  --text:       #1F2924;
  --text-soft:  #46554A;
  --text-muted: #5D695E;   /* 4,8:1 sur --bg-soft ; était #6E7A6F (4,05:1, sous le seuil AA) */
  --text-faint: #9DA89A;
  --text-etiquette: #556157;   /* étiquettes en capitales du planning (« Au tableau », « Stagiaires ») : 4,9:1 sur la teinte du pédagogue, le --text-muted en faisait 4,34 */

  /* --- Accent (vert mint) --- */
  --accent:        #5B6C42;   /* même vert assombri : 5,2:1 en texte, 5,1:1 sous du texte crème ; était #6B7F4E */
  --accent-strong: #495838;
  --accent-fin-barre: var(--c-go);   /* bout clair du dégradé de la barre « Thèmes officiels » : le vert du défaut, un bleu en Couleurs ECF */
  --accent-soft:   #EAEFD9;
  --accent-soft-2: #D8E1C0;
  /* Vert clair pour les repères posés sur le fond sombre (barre du haut, pastille de date). */
  --accent-on-dark: #A9BC86;

  /* --- Statuts traffic-light --- */
  --c-stop:      #964F33;
  --c-stop-soft: #F6E4D7;
  --c-wait:      #A54C08;
  --c-wait-soft: #FBEACB;
  --c-go:        #47730E;
  --c-go-soft:   #ECF6D5;

  /* --- Tints d'activités (chaudes) --- */
  --act-cours:          #E8E1F0;
  --act-cours-border:   #D6CCE3;
  --act-peda:           #F4DDB0;
  --act-peda-border:    #DEC58A;
  --act-voiture:        #DDE4C2;
  --act-voiture-border: #C5CFA1;
  --act-controle:       #F4C7A4;
  --act-controle-border:#DEAB83;

  /* --- Radii --- */
  --r-xs: 4px;
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* --- Shadows tintées warm --- */
  --shadow-1: 0 1px 2px rgba(60, 40, 20, 0.04), 0 1px 1px rgba(60, 40, 20, 0.03);
  --shadow-2: 0 4px 12px -2px rgba(60, 40, 20, 0.06), 0 2px 4px rgba(60, 40, 20, 0.03);
  --shadow-3: 0 20px 40px -15px rgba(60, 40, 20, 0.12), 0 4px 12px rgba(60, 40, 20, 0.05);

  /* --- Typographies ---
     Une seule écriture pour l'écran (décision de Timy, 09/11, après l'audit par testeurs) : Outfit pour les titres, le
     texte et les chiffres, la hiérarchie par la taille et la graisse. Les chiffres qui se comparent (dates, heures,
     compteurs, notes) prennent les chiffres de même largeur d'Outfit (font-variant-numeric: tabular-nums) au lieu
     d'une police à chasse fixe. --font-mono ne sert plus qu'au code et aux traces techniques ; Canela reste aux
     titres des documents imprimés (--doc-police-titre). */
  --font-display: var(--font);
  --font:         "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Poids des titres d'écran : un seul, le demi-gras d'Outfit, pour tous les titres (une règle ne dit jamais un
     nombre : elle prend un de ces jetons). Les cinq noms restent pour un habillage qui voudrait une autre hiérarchie. */
  --poids-titre:        600;
  --poids-titre-semi:   600;
  --poids-titre-moyen:  600;
  --poids-titre-normal: 600;
  --poids-titre-leger:  600;

  /* --- Barre sombre (ex --nav-creme*, remontés de body[data-nav="v2"] : l'habillage les redéfinit d'un bloc) ---
     Le crème de la barre du haut et ses transparences : texte, texte secondaire, survol, entrée allumée,
     filet, bordure. */
  --sur-sombre:        #F5E8D0;
  --sur-sombre-doux:   rgba(245, 232, 208, 0.55);
  --sombre-survol:     rgba(245, 232, 208, 0.07);
  --sombre-allume:     rgba(245, 232, 208, 0.12);
  --sombre-allume-fort: rgba(245, 232, 208, 0.18);   /* compteur d'une pastille de thème active */
  --sombre-filet:      rgba(245, 232, 208, 0.08);
  --sombre-bord:       rgba(245, 232, 208, 0.25);
  --sombre-2:          #2A211C;                      /* survol d'un bouton sombre */

  /* --- Repères et pastilles sur fond sombre --- */
  --repere-sombre:     var(--accent-on-dark);
  --sur-repere-sombre: var(--bg-deep);
  --sombre-marque:     var(--repere-sombre);       /* pastille d'initiales de la promo, dans la barre sombre */
  --sur-sombre-marque: var(--sur-repere-sombre);
  --sur-sombre-actif:  var(--repere-sombre);       /* icône de l'entrée active de la barre sombre */
  --pastille:          var(--accent);
  --sur-pastille:      var(--bg-elev);
  /* Liseré d'un repère de la barre sombre : le point du compte en a un de la couleur de la barre ; une pastille n'en a pas.
     « Couleurs ECF » les fait blancs : son rouge ne tient que 2,2:1 sur l'entrée allumée et sur l'avatar (fond éclairci),
     le liseré blanc le cerne (5,1:1) et se détache de tout fond sombre (lot 3, tâche 10). */
  --repere-sombre-lisere:   var(--bg-deep);
  --repere-pastille-lisere: transparent;
  --repere-admin:       #6EE7B7;                     /* badge de l'administrateur connecté, dans la barre sombre */
  --repere-admin-fond:  rgba(4, 120, 87, 0.2);
  --repere-admin-bord:  rgba(4, 120, 87, 0.3);
  --repere-admin-survol: rgba(4, 120, 87, 0.3);
  --repere-admin-halo:  rgba(110, 231, 183, 0.15);

  /* --- Texte sur une surface d'accent (boutons pleins) --- */
  --accent-texte:    #FAF1DC;
  /* Couleur de la famille de thèmes « conduite » (fixe : elle la distingue des deux autres familles). */
  --famille-conduite: #4D7C0F;

  /* --- Gris de décor --- */
  --bg-survol: #ECEAE5;                              /* survol d'un en-tête de demi-journée */

  /* --- Halos de focus, lueurs de l'écran de connexion, voile des fenêtres --- */
  --halo-focus:        rgba(4, 120, 87, 0.12);
  --halo-focus-leger:  rgba(4, 120, 87, 0.1);
  --lueur-1:           rgba(4, 120, 87, 0.15);
  --lueur-2:           rgba(180, 83, 9, 0.08);
  --ombre-voile:       rgba(15, 20, 25, 0.4);

  /* --- Couleurs qui disent quelque chose : jamais redéfinies par un habillage --- */
  --c-stop-bord:  rgba(185, 28, 28, 0.35);           /* carte du tableau de bord : urgent */
  --c-wait-bord:  rgba(180, 83, 9, 0.3);             /* carte du tableau de bord : à surveiller */
  --c-retrait:    #A05A3D;                           /* retirer, désaffilier */
  --act-peda-voile:        rgba(180, 83, 9, 0.08);   /* lignes et cases du pédagogue */
  --act-peda-voile-leger:  rgba(180, 83, 9, 0.05);
  --act-peda-voile-fin:    rgba(180, 83, 9, 0.03);
  --act-peda-texte:    #92400E;                      /* texte des étiquettes d'activité */
  --act-voiture-texte: #166534;
  --act-cours-texte:   #1E40AF;

  /* --- Échelle des notes (fixe : une note garde sa teinte dans les deux habillages, jamais un rouge) ---
     Fond et texte des quatre niveaux de la matrice, des indicateurs et des cartes de thème ; le niveau « moyen »
     des QCM ; les points et barres des graphes ; les voiles des pastilles EPCF. */
  --note-bad-fond:    #F1DBC8;
  --note-bad-texte:   #7A4F30;
  --note-warn-fond:   #FBE5C1;
  --note-warn-texte:  #92400E;
  --note-ok-fond:     #DBE9C4;
  --note-ok-texte:    #3F6212;
  --note-great-fond:  #BFE0A6;
  --note-great-texte: #2C5212;
  --note-faible-titre: #A05A3D;                      /* titre « thèmes à travailler » */
  --note-mid-fond:    #FBEEDD;                       /* niveau moyen des QCM */
  --note-mid-texte:   #94602D;                       /* 4,6:1 sur --note-mid-fond ; était #B67A3D (3,5:1 sur la page), gardé pour la barre */
  --note-mid-barre:   #B67A3D;                       /* barre du niveau moyen des QCM */
  --note-warn-point:  #C98A2B;                       /* point ou barre ambre, bouton « à revoir » */
  --note-ok-point:    #7BA23C;
  --note-warn-voile:  rgba(201, 138, 43, 0.18);      /* pastille EPCF « en cours d'acquisition » */
  --c-go-voile:       rgba(77, 124, 15, 0.18);       /* pastilles EPCF « acquis » et « non acquis » */
  --c-stop-voile:     rgba(160, 90, 61, 0.18);
  /* Voiles pâles des lignes de thème colorées par la progression du stagiaire (css/themes-lignes.css). Des jetons fixes, pas un
     color-mix : en Couleurs ECF, seule une couleur fixe exacte garde sa teinte chaude ou verte (garde des teintes restées). */
  --c-go-voile-pale:      rgba(77, 124, 15, 0.07);
  --c-stop-voile-pale:    rgba(160, 90, 61, 0.08);
  --note-warn-voile-pale: rgba(201, 138, 43, 0.09);
  --act-controle-texte: #9A3412;                     /* texte de l'étiquette « contrôle » */

  /* --- Couleurs réelles de la signalisation (donnée pédagogique : un panneau reste jaune, bleu, rouge...
     quel que soit l'habillage) --- */
  --signal-blanc:  #f4f3ee;
  --signal-jaune:  #ffc72c;
  --signal-bleu:   #1f5fbf;
  --signal-rouge:  #cc1f2f;
  --signal-vert:   #00804a;
  --signal-orange: #ef7d00;
  --signal-noir:   #1c1c1c;
  --signal-gris:   #9a9a9a;
  --signal-marron: #7c4a1e;
  --signal-violet: #6c3fa8;

  /* Fond gris des planches de panneaux dans les questions (indépendant du thème : il détache les panneaux blancs). */
  --apercu-planche: #c6cbd1;
  --apercu-scene: #5D635B;                           /* fond du cadre d'une scène animée d'un cours, derrière le dessin */
  /* Pastilles du choix de l'habillage (Apparence, js/habillage-choix.js) : chacune montre les couleurs de son habillage,
     quel que soit celui qui est appliqué (famille fixe). ECSR Promo : vert, barre sombre, fond ; Couleurs ECF : bleu, rouge, blanc. */
  --apercu-ecsr-1: #6B7F4E;
  --apercu-ecsr-2: #16231E;
  --apercu-ecsr-3: #F1F4F0;
  --apercu-ecf-1:  #124483;
  --apercu-ecf-2:  #DB1418;
  --apercu-ecf-3:  #FFFFFF;
  --apercu-contour: rgba(0, 0, 0, 0.12);             /* filet intérieur qui détache le blanc d'une pastille du fond clair */

  /* --- Planning imprimable (feuille A4 : sa palette ne dépend pas de l'habillage de l'écran) --- */
  --doc-texte: #333;
  --doc-texte-fort: #1F2937;
  --doc-texte-doux: #555;
  --doc-texte-gris: #777;
  --doc-texte-pale: #aaa;
  --doc-vide: #bbb;
  --doc-texte-efface: #c9c9c9;
  --doc-theme-num: #6B7F4E;
  --doc-trait-fort: #444;
  --doc-trait-doux: #999;
  --doc-filet: #ccc;
  --doc-fond-doux: #F4F4F3;
  --doc-repos-fond-fort: #9CA3AF;
  --doc-repos-fond: #F3F4F6;
  --doc-repos-texte: #6B7280;
  --doc-repos-texte-fort: #374151;
  --doc-matin-fond: #FEF3C7;
  --doc-matin-texte: #78350F;
  --doc-aprem-fond: #DBEAFE;
  --doc-aprem-texte: #1E3A8A;
  --doc-pause: #B45309;
  --doc-cours-fond: #EFF6FF;
  --doc-peda-fond: #FEFCE8;
  --doc-voiture-fond: #F0FDF4;
  --doc-controle-fond: #FFF7ED;

  /* --- Documents imprimés (feuille d'émargement, certificats et attestations, dossier Qualiopi, dossier
     professionnel) : même aspect quelle que soit la personne qui imprime, donc famille fixe (décision H5).
     Un document n'emploie aucun jeton d'habillage, pas même la police des titres. --- */
  --doc-police-titre: "Canela", "Cormorant Garamond", "Playfair Display", Georgia, serif;   /* titres de document : la pile actuelle de --font-display, figée */
  --doc-poids-titre: 700;                            /* h1, h2, h3 du dossier Qualiopi, titre et sous-titres des attestations */
  --doc-poids-titre-feuille: 600;                    /* titre de la feuille d'émargement */
  --doc-encre: #1F2924;                              /* texte du dossier Qualiopi, encre de la signature rendue */
  --doc-noir: #111;                                  /* texte de la feuille d'émargement et des attestations */
  --doc-en-tete-fond: #eef1ea;                       /* en-tête de tableau de la feuille, avant son habillage vert */
  --doc-absent: #8a3b1f;                             /* absent, observation manquante, total d'absences */
  --doc-absent-fond: #FBEEE6;
  --doc-sans-fond-1: #f3f3f3;                        /* hachures d'une case sans séance */
  --doc-sans-fond-2: #e6e6e6;
  --doc-trait-pointille: #888;
  --doc-vert: #556641;                               /* vert du centre : bandeau, titres de colonne, cadres */
  --doc-vert-moyen: #6B7F4E;                         /* en-tête des tableaux de la feuille */
  --doc-vert-sombre: #33402a;
  --doc-vert-trait: #B7C0AA;
  --doc-vert-fond: #EAEFD9;
  --doc-vert-fond-doux: #EEF2E7;
  --doc-vert-fond-pale: #F4F7F0;                     /* ligne paire d'un tableau */
  --doc-vert-total: #DDE9C4;
  --doc-total-ko-fond: #F6E4D7;
  --doc-gris-vert: #46554A;
  --doc-avertissement: #8A6A1F;                      /* fiche des résultats à publier : bandeau d'avertissement */
  --doc-avertissement-fond: #FBF2D9;
  --doc-dp-vide: #737373;                            /* dossier professionnel : repère de saisie et sommaire vide ; 4,7:1, était #9a9a9a (2,8:1), décision du 10/11 */
  --doc-dp-note: #716D63;                            /* coupure de page et mention d'une fiche exclue, à l'écran seulement : 5:1 ; était #8a8578 (3,6:1) */
  --doc-dp-exclu-fond: #fbfbfa;
  --doc-dp-exclu-trait: #c9c6bd;

  /* --- Graphes des notes (habillage : leurs classes `notes-*` posent ces couleurs, un attribut SVG ne suivrait pas) --- */
  --graphe-axe:        var(--line-strong);           /* axe de référence : zéro ou dix sur vingt */
  --graphe-grille:     var(--line-faint);            /* graduations en pointillés */
  --graphe-graduation: #7A6650;                      /* chiffres des axes et noms anonymisés : 5,3:1 sur la carte ; était #8A7458 (4,3:1) */
  --graphe-texte:      var(--text);                  /* valeurs et noms */
  --graphe-libelle:    var(--text-soft);             /* tranches de note */
  --graphe-piste:      #F0F0EC;                      /* rail gris derrière une barre */
  --graphe-radar-moi:  rgba(107, 127, 78, 0.25);     /* surface du radar EPCF (ancien vert de l'accent) */

  /* --- Autres teintes de décor --- */
  --line-moyenne:      #C9D2BC;                      /* filet de la ligne « moyenne du groupe » */
  --line-popover:      #ccc;                         /* bord des champs et boutons du petit éditeur de note */
  --line-popover-cadre: #ddd;                        /* cadre de ce petit éditeur */
  --text-popover:      #222;
  --text-popover-doux: #666;
  --ombre-illustration: rgba(60, 40, 20, 0.10);      /* ombre portée sous l'illustration de l'accueil */
  --ombre-voile-fort:  rgba(20, 32, 28, 0.55);       /* voile derrière un questionnaire en plein écran */
  --sombre-survol-fort: rgba(245, 232, 208, 0.16);   /* survol de la pastille de promo, dans la barre sombre */

  /* Le liseré de l'habillage (aucun par défaut) et la couleur de la barre d'état du navigateur
     (celle de <meta name="theme-color">). */
  --lisere-habillage: none;
  --barre-etat: #1A1612;

  /* --- Barre collante du haut --- */
  /* Sa hauteur : la barre de jours du Planning se colle juste dessous. La coquille de navigation pose
     celle de son en-tête (css/navigation.css) ; 0 sans coquille montée. En px seulement :
     js/views/planning.js la lit par parseFloat. */
  --haut-entete: 0px;
}



/* ============================================================
   Reset & globals
   ============================================================ */

* { box-sizing: border-box; }
*::selection { background: var(--accent-soft); color: var(--accent-strong); }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  /* `hidden` d'abord (repli pour les navigateurs anciens), puis `clip` : `hidden` fait
     de <body> un conteneur de défilement, ce qui casse silencieusement TOUT élément
     collant à l'intérieur (constaté sur la barre de jours du planning, qui sortait de
     l'écran au lieu de rester en haut). `clip` coupe le débordement horizontal sans
     créer ce conteneur, donc le collage fonctionne. */
  overflow-x: hidden;
  overflow-x: clip;
  width: 100%;
}

/* Écran plein cadre ouvert (cours, Informations légales, éditeur, QCM, signature) : la page derrière ne défile plus.
   Le verrou se pose aussi sur <html> : comme <html> a un overflow-x autre que `visible` (ci-dessus), c'est lui qui
   donne son overflow à la fenêtre, et `body { overflow: hidden }` seul ne figeait que <body>. La page restait donc
   défilante sous l'écran ouvert ; sur iPhone, le geste allait à elle et le cours ouvert en haut de la page Cours et QCM
   ne défilait pas (11/11/2026). Garde : tests/verrou-defilement.test.mjs. */
html:has(> body.cours-open),
html:has(> body.qcm-open),
html:has(> body.sig-ouverte) { overflow: hidden; }

h1, h2, h3, .display {
  font-family: var(--font-display);
  font-weight: var(--poids-titre);
  letter-spacing: -0.01em;
}

a { color: inherit; text-decoration: none; }

.hidden { display: none !important; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-muted); }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1.5px;
  background: var(--accent);
  display: inline-block;
}
.error { color: var(--c-stop); font-size: 0.88rem; margin: 0.5rem 0 0; }

.icon {
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: -2px;
}

/* ============================================================
   Gate
   ============================================================ */

.gate {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  overflow: hidden;
}

.gate-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 30% 20%, var(--lueur-1), transparent 70%),
    radial-gradient(ellipse 60% 40% at 80% 80%, var(--lueur-2), transparent 60%);
  pointer-events: none;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(transparent 95%, rgba(255,255,255,0.04) 95%),
    linear-gradient(90deg, transparent 95%, rgba(255,255,255,0.04) 95%);
  background-size: 60px 60px;
  pointer-events: none;
}

.gate-card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 2.2rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-3);
  text-align: left;
}

.gate-logo {
  display: block;
  width: 130px;
  height: auto;
  margin: 0 0 1.5rem;
  filter: brightness(0) saturate(100%);  /* assure noir pur sur crème */
}

.gate-card h1 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: var(--poids-titre);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--text);
}

.gate-card .muted { margin: 0 0 1.5rem; font-size: 0.9rem; }

.gate-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.gate-form input {
  width: 100%;
  padding: 0.8rem 0.95rem;
  font-size: 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.gate-form input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--halo-focus);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  border: 1px solid var(--line);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-elev);
  color: var(--text);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--line-strong);
}
.btn:active { transform: translateY(1px) scale(0.99); }

.btn.primary {
  background: var(--accent);
  color: var(--accent-texte);
  border-color: var(--accent);
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.accent {
  background: var(--accent);
  color: var(--accent-texte);
  border-color: var(--accent);
}
.btn.accent:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

.btn.ghost {
  background: transparent;
  border-color: var(--line);
}

.btn.danger {
  color: var(--c-stop);
  border-color: var(--line);
  background: transparent;
}
.btn.danger:hover { background: var(--c-stop-soft); border-color: var(--c-stop); }

.btn.small {
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
  border-radius: var(--r-sm);
}

.btn.icon-only {
  padding: 0.55rem;
  gap: 0;
}

.btn.full { width: 100%; }

.ghost-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.55rem;
  border-radius: var(--r-sm);
  color: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.ghost-btn:hover { background: rgba(255,255,255,0.08); }
.ghost-btn .icon { width: 18px; height: 18px; }

/* ============================================================
   Main view
   ============================================================ */

main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: var(--poids-titre);
  letter-spacing: -0.015em;
  line-height: 1.05;
  color: var(--text);
}

h3 {
  font-family: var(--font-display);
  font-weight: var(--poids-titre);
  letter-spacing: -0.01em;
}

.view-header h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  background: var(--accent);
  margin-top: 0.55rem;
  border-radius: 2px;
}

.view-header {
  margin-bottom: 2rem;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.view-header-text { flex: 1; min-width: 280px; }
.view-header .subtitle {
  color: var(--text-muted);
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  max-width: 60ch;
}

/* ============================================================
   Dashboard
   ============================================================ */

.dashboard-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.dashboard-meta .stat-block {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.dashboard-meta .stat-block .value {
  font-size: 1.5rem;
  font-weight: 600;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.dashboard-meta .stat-block .label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 0.7rem;
}

.dashboard-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 0.8rem 0.9rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}

.dashboard-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.dashboard-card.urgent {
  border-color: var(--c-stop-bord);
}

.dashboard-card.urgent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c-stop);
}

.dashboard-card.warn {
  border-color: var(--c-wait-bord);
}

.dashboard-card.warn::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c-wait);
}

.dashboard-card.ok::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--c-go);
  opacity: 0.5;
}

.dashboard-card .name {
  font-weight: var(--poids-titre-semi);
  font-size: 1rem;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
  line-height: 1.1;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dashboard-stats {
  display: flex;
  gap: 0.4rem;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.55rem;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.stat-pill .icon { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.stat-pill .add  { color: var(--c-wait); font-size: 0.72rem; margin-left: 2px; font-weight: 600; }

.priority-row {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.55rem;
}

.priority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--r-sm);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  width: 100%;
  justify-content: flex-start;
}
.priority-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.priority-badge .scope {
  font-weight: 700;
  min-width: 50px;
  font-size: 0.68rem;
}

.priority-badge.a-prioriser { background: var(--c-stop-soft); color: var(--c-stop); }
.priority-badge.a-prioriser .dot { background: var(--c-stop); animation: pulse 2s ease-in-out infinite; }
.priority-badge.a-jour { background: var(--c-go-soft); color: var(--c-go); }
.priority-badge.a-jour .dot { background: var(--c-go); }
.priority-badge .plabel { white-space: nowrap; }
/* Retard sur la moyenne : nombre en gras poussé à droite (plus c'est grand, plus c'est prioritaire) */
.priority-badge .retard {
  margin-left: auto;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0;
}

/* Encart « Comment ça marche ? » (logique de priorité) */
.dash-explain {
  margin: 0.85rem 0 0;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r);
  font-size: 0.88rem;
}
.dash-explain summary {
  cursor: pointer;
  padding: 0.6rem 0.85rem;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
}
.dash-explain summary::-webkit-details-marker { display: none; }
.dash-explain summary::before { content: "\24D8\00A0\00A0"; }
.dash-explain[open] summary { border-bottom: 1px solid var(--line); }
.dash-explain-body { padding: 0.65rem 0.95rem 0.85rem; }
.dash-explain-body p { margin: 0 0 0.55rem; line-height: 1.5; }
.dash-explain-body p:last-child { margin-bottom: 0; }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.2); }
}

.dashboard-legend {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.dashboard-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.dashboard-legend .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ============================================================
   Planning
   ============================================================ */

.week-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.week-bar input[type="date"] {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  background: var(--bg-elev);
  color: var(--text);
}
.week-bar input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}


/* Layout en cards par jour, empilées verticalement, lanes en parallèle horizontales */

.p-days {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.p-day-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  /* Pas d'overflow:hidden ici : il clippait les dropdowns (sujet, élèves,
     formateur) qui s'ouvrent vers le bas et débordent sur le jour suivant.
     Les coins arrondis sont gérés par le border-radius des enfants. */
  transition: border-color 0.15s;
  display: grid;
  grid-template-columns: 78px 1fr;
  min-width: 0;
}

.p-day-card:hover { border-color: var(--line-strong); }

.p-day-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.7rem 0.4rem;
  background: var(--bg-deep);
  color: white;
  text-align: center;
  border-right: 1px solid var(--line);
  border-top-left-radius: calc(var(--r) - 1px);
  border-bottom-left-radius: calc(var(--r) - 1px);
}

/* Lien discret « désactiver / réactiver » un jour (en-tête, admin) : volontairement
   léger pour ne pas alourdir le bandeau vertical du jour. */
.p-day-toggle {
  margin-top: 0.35rem;
  padding: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.38);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s ease, background 0.12s ease;
}
.p-day-toggle:hover {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
}
.p-day-toggle .icon {
  width: 14px;
  height: 14px;
  display: block;
}

/* Jour désactivé / férié : carte grisée + bandeau, aucune activité */
/* Finitions du 09/11 (audit, lot E) : plus de voile à 72 % ni de gris pâle sous du blanc (2,3:1) ; le texte secondaire
   (--text-muted) porte le blanc à plus de 4,5:1, et le bandeau rayé dit déjà « fermé ». */
.p-day-card.off .p-day-head { background: var(--text-muted); }
.p-day-off-banner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 1.4rem 1rem;
  background: repeating-linear-gradient(45deg, var(--bg-subtle), var(--bg-subtle) 10px, var(--bg-deep-soft, var(--bg-elev)) 10px, var(--bg-deep-soft, var(--bg-elev)) 20px);
  color: var(--text-muted);
  text-align: center;
}
.p-day-off-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--text-muted);
  color: white;
}
.p-day-off-label { font-size: 0.95rem; font-weight: 700; color: var(--text); }

.p-day-name {
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.p-day-date {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.6);
}

.p-day-content {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.p-half {
  display: flex;
  flex-direction: column;
}
.p-half + .p-half {
  border-top: 1px solid var(--line);
}
/* Coin haut-droit de la carte jour : bandeau bg-subtle de la 1re demi-journée
   (compense le retrait de overflow:hidden sur .p-day-card). */
.p-day-content > .p-half:first-child .p-half-head {
  border-top-right-radius: calc(var(--r) - 1px);
}

@media (max-width: 720px) {
  .p-day-card {
    grid-template-columns: 1fr;
  }
  .p-day-head {
    flex-direction: row;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem;
  }

  /* === Anti-zoom iOS : tous les inputs/selects à 16px === */
  .p-lane-activite-wrap select,
  .p-lane-prof-wrap select,
  .p-lane-role.pedagogue select,
  .p-lane-notes-input,
  .sujet-chip-input,
  .sujet-multi .sujet-chips {
    font-size: 16px !important;
  }

  /* Touch targets plus confortables */
  .p-lane-activite-wrap select,
  .p-lane-prof-wrap select,
  .p-lane-role.pedagogue select {
    min-height: 40px;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }
  .p-lane-header { min-height: 44px; }
  .p-lane-prof-wrap { max-width: 130px; }

  /* Plus d'air dans les cellules */
  .p-lane-sujet { padding: 0.5rem 0.6rem 0.4rem; }
  .p-lane-participants { padding: 0.4rem 0.6rem 0.5rem; gap: 0.4rem; }
  .p-lane-role { min-height: 40px; }
  .p-lane-role-label { font-size: 0.62rem; min-width: 64px; }

  /* Notes : placeholder discret, taille input correcte */
  .p-lane-notes { padding: 0 0.6rem 0.55rem; }
  .p-lane-notes-input {
    font-size: 16px;
    padding: 0.4rem 0.5rem;
  }
  .p-lane-notes-input::placeholder { font-size: 0.78rem; }

  /* Boutons + parallèle et + à la suite : plus tapables */
  .p-add-parallele-mini { width: 40px; }
  .p-add-suite { padding: 0.55rem 0.7rem; }

  /* Bouton suppression cellule : plus accessible */
  .p-lane-delete { padding: 0 0.7rem; }
  .p-lane-delete .icon { width: 16px; height: 16px; }

  /* Chips sujet : largeur input correcte sans pousser hors écran */
  .sujet-chip-input { min-width: 100px; flex: 1 1 100px; }
  .sujet-chip { font-size: 0.95rem; padding: 0.22rem 0.55rem; }
  .sujet-chip-label { max-width: 180px; }
}

.p-half-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.7rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
  border-top: none;
  border-left: none;
  border-right: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  cursor: default;
  flex-wrap: wrap;
  font-size: 0.78rem;
}

.p-half-head.editable {
  cursor: pointer;
  transition: background 0.15s;
}
.p-half-head.editable:hover { background: var(--bg-survol); }
.p-half-head.editable:hover .p-half-hours { text-decoration: underline; }

.p-half-pause {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  background: var(--c-wait-soft);
  color: var(--c-wait);
  font-size: 0.62rem;
  font-weight: 500;
}
.p-half-pause .pause-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--c-wait);
}

.p-half-tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.p-half-tag.matin {
  background: var(--c-wait-soft);
  color: var(--c-wait);
}

.p-half-tag.aprem {
  background: var(--accent-soft);
  color: var(--accent);
}

.p-half-hours {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* === Slot row (séquentiel) === */

.p-slots-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.55rem;
}

.p-slot-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 0.3rem;
  align-items: stretch;
}

.p-slot-marker {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.35rem;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  color: var(--accent);
  font-weight: 700;
  user-select: none;
}

.p-slot-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--accent);
  color: white;
}

/* === Lanes (parallèle au sein d'un slot) === */

.p-lanes {
  display: grid;
  gap: 0.4rem;
  align-items: stretch;
}
.p-lanes > .p-lane-cell {
  min-width: 0;
}

/* Mobile : cartes empilées sur une colonne. Les activités d'un même créneau
   (parallèle = même horaire) sont regroupées dans un cadre accent avec un label
   « en même temps », pour les distinguer nettement des créneaux « à la suite ».
   Le « + » parallèle devient un vrai bouton labellisé sous le créneau. */
@media (max-width: 760px) {
  .p-lanes {
    grid-template-columns: 1fr !important;
    gap: 0.4rem;
  }
  .p-lanes > .p-lane-cell {
    grid-column: 1 !important;
  }
  /* « + En parallèle » : bouton pleine largeur sous les cartes du créneau */
  .p-lanes > .p-add-parallele-mini {
    grid-column: 1 / -1 !important;
    width: auto;
    min-height: 38px;
    gap: 0.35rem;
  }
  /* Sélecteur plus spécifique que la règle desktop `.p-add-parallele-label{display:none}`
     (qui suit dans le fichier) pour gagner la cascade sur mobile. */
  .p-add-parallele-mini .p-add-parallele-label {
    display: inline;
    font-size: 0.74rem;
    font-weight: 600;
  }

  /* Cadre « en même temps » : seulement quand 2+ activités en parallèle */
  .p-lanes.has-parallel {
    border: 1.5px solid var(--accent);
    background: var(--bg-subtle);
    border-radius: var(--r);
    padding: 0.45rem;
  }
  .p-lanes.has-parallel::before {
    content: "∥ En même temps";
    grid-column: 1 / -1;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--accent);
    padding: 0 0.1rem;
  }

  /* Espacement net entre créneaux séquentiels (à la suite) */
  .p-slots-wrap { gap: 0.7rem; }
}

.p-lane-cell {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
  /* overflow: visible pour ne pas clipper le dropdown sujet/thème */
  position: relative;
}
.p-lane-header {
  border-top-left-radius: calc(var(--r) - 1px);
  border-top-right-radius: calc(var(--r) - 1px);
}

.p-lane-cell:hover {
  border-color: var(--line-strong);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.p-lane-cell[data-activite="Cours"]              { background: var(--act-cours); }
.p-lane-cell[data-activite="Pédagogie salle"]    { background: var(--act-peda); }
.p-lane-cell[data-activite="Voiture (conduite)"] { background: var(--act-voiture); }
.p-lane-cell[data-activite="Contrôle"]           { background: var(--act-controle); }

/* === Header strip : activité (badge) + prof + delete === */
.p-lane-header {
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: rgba(255,255,255,0.45);
}
.p-lane-cell[data-activite=""] .p-lane-header,
.p-lane-cell:not([data-activite]) .p-lane-header {
  background: transparent;
  border-bottom-color: var(--line);
}
.p-lane-activite-wrap {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}
.p-lane-activite-wrap select {
  width: 100%;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.005em;
  padding: 0.35rem 1rem 0.35rem 0.65rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.25rem center;
  background-size: 12px;
}
.p-lane-prof-wrap {
  flex: 0 0 auto;
  min-width: 130px;
  max-width: 180px;
  display: flex;
  align-items: center;
  border-left: 1px solid rgba(0,0,0,0.06);
  padding: 0.2rem 0.35rem;
}

/* === Profs multi-select compact === */
.p-prof-multi { position: relative; width: 100%; }
.p-prof-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  padding: 0.25rem 0.4rem;
  min-height: 28px;
  cursor: pointer;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.p-prof-display:hover { background: rgba(255,255,255,0.5); border-color: var(--line); }
.p-prof-display.open { background: var(--bg-elev); border-color: var(--accent); }
.p-prof-placeholder { color: var(--text-muted); font-size: 0.82rem; }
.p-prof-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 4px 1px 7px;
  background: var(--c-wait-soft);
  color: var(--c-wait);
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
}
.p-prof-x {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9em;
  line-height: 1;
  display: inline-flex;
  width: 13px;
  height: 13px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.7;
}
.p-prof-x:hover { background: var(--c-wait); color: white; opacity: 1; }
/* Chips « Autre » (formateur externe) et « Groupe (autonomie) » : distincts des vrais profs */
.p-prof-chip.autre { background: var(--bg-subtle); color: var(--text); }
.p-prof-chip.autonomie { background: var(--accent-soft); color: var(--accent-strong); }
/* Séparateur + options spéciales du menu formateur */
.p-prof-dropdown-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.p-prof-dropdown-item.special { font-style: italic; }
.p-prof-autre-row { display: flex; gap: 4px; padding: 4px 6px; }
.p-prof-autre-input {
  flex: 1; min-width: 0; padding: 3px 6px; font-size: 0.8rem;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-elev); color: var(--text);
}
.p-prof-autre-ok {
  flex: none; width: 26px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; cursor: pointer;
}
/* Suggestions « Autre » : noms déjà utilisés, clic = réutiliser, × = oublier */
.p-prof-autre-sugg { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 6px 6px; }
.p-prof-autre-tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 2px 1px 7px; font-size: 0.75rem;
  background: var(--bg-subtle); border: 1px solid var(--line); border-radius: 8px;
}
.p-prof-autre-tag-name { cursor: pointer; color: var(--text); }
.p-prof-autre-tag-name:hover { color: var(--accent-strong); }
.p-prof-autre-tag-x {
  cursor: pointer; width: 15px; height: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--text-muted); font-size: 0.9em;
}
.p-prof-autre-tag-x:hover { background: var(--c-wait); color: #fff; }
.p-prof-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  z-index: 60;
  min-width: 130px;
  padding: 3px;
}
.p-prof-dropdown.hidden { display: none; }
.p-prof-dropdown-item {
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--r-sm);
  transition: background 0.1s;
}
.p-prof-dropdown-item:hover { background: var(--bg-subtle); }
.p-prof-dropdown-item.selected {
  background: var(--c-wait-soft);
  color: var(--c-wait);
  font-weight: 700;
}
.p-prof-dropdown-item.selected::after {
  content: "✓";
  float: right;
  margin-left: 0.3rem;
}
.p-lane-prof-wrap select:focus,
.p-lane-activite-wrap select:focus {
  outline: none;
  background-color: rgba(255,255,255,0.7);
}

/* === Body : sujet (prominent) + participants + notes === */
.p-lane-body {
  display: flex;
  flex-direction: column;
}

.p-lane-sujet {
  padding: 0.4rem 0.55rem 0.3rem;
}

.p-lane-participants {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem 0.35rem;
  border-top: 1px dashed rgba(0,0,0,0.07);
}

/* === Pédagogie salle : sélecteur 1 / 2 groupes + libellés de groupe === */
.p-salle-groupes {
  display: flex;
  justify-content: flex-end;
  padding: 0.3rem 0.55rem 0;
}
.p-salle-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}
.p-salle-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.p-salle-toggle-btn + .p-salle-toggle-btn { border-left: 1px solid var(--line); }
.p-salle-toggle-btn.active { background: var(--accent); color: #fff; }
.p-salle-group + .p-salle-group { border-top-style: solid; }
.p-salle-group-tag {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 0.1rem 0 0.05rem;
}
/* Sujet propre à un groupe (salle 2 groupes) : sans le retrait du sujet global de la carte */
.p-salle-group-sujet { padding: 0 0 0.1rem; }
.read-only .p-salle-toggle { display: none; }
.p-lane-role {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 26px;
}
.p-lane-role-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-etiquette);
  font-weight: 600;
  min-width: 72px;
}
.p-lane-role.pedagogue select {
  flex: 1;
  border: 1px solid transparent;
  background: var(--act-peda-voile);
  border-radius: var(--r-sm);
  padding: 0.22rem 1rem 0.22rem 0.45rem;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.3rem center;
  background-size: 11px;
}
.p-lane-role.pedagogue select:focus {
  outline: none;
  border-color: var(--accent);
}
.p-lane-role.eleves { align-items: flex-start; padding-top: 1px; }
.p-lane-role.eleves > .chips-select { flex: 1; }

/* Élèves : chips au-dessus, toolbar dé en-dessous (évite que les chips se compriment) */
.p-lane-eleves-col {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.p-lane-eleves-col > .chips-select { width: 100%; }
.p-eleves-dice-toolbar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding-top: 0.15rem;
  border-top: 1px dashed rgba(0,0,0,0.06);
}

/* ============================================================
   Home v2 (post-refonte)
   ============================================================ */

.home-hero-v2 {
  padding: 1.5rem 0 2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

/* Bandeau date du jour */
.home-today-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.home-today-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-deep);
  color: var(--bg);
  border-radius: 999px;
  font-family: var(--font); font-variant-numeric: tabular-nums;
}
.home-today-weekday {
  font-size: 0.78rem;
  text-transform: capitalize;
  opacity: 0.75;
}
.home-today-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-on-dark);
  letter-spacing: -0.02em;
}
.home-today-month {
  font-size: 0.8rem;
  opacity: 0.85;
}

@media (max-width: 600px) {
  .home-today-num { font-size: 1.2rem; }
}
/* Le titre d'accueil (« Aujourd'hui », « Bonjour, … ») a la taille des autres titres de page (h2 : 2,2 rem, 1,4 rem sur
   téléphone) : une page, un titre, une seule échelle (unification du 09/11). */
.home-title-v2 {
  font-family: var(--font-display);
  font-weight: var(--poids-titre-leger);
  font-size: 2.2rem;
  line-height: 1.1;
  margin: 0.2rem 0 0.8rem;
  letter-spacing: -0.01em;
}
.home-title-v2 em {
  font-style: normal;
  font-weight: var(--poids-titre); /* le prénom garde le poids plein du titre, quel que soit l'habillage */
  color: var(--accent);
}
/* Accueil du stagiaire : la salutation sous le titre « Accueil » (une page, un nom : décision du 10/11). */
.home-salut-v2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin: -0.4rem 0 0.35rem;
  color: var(--text);
}
.home-salut-v2 em {
  font-style: normal;
  font-weight: var(--poids-titre);
  color: var(--accent);
}
.home-lead-v2 {
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text-soft);
  max-width: 640px;
  margin: 0;
}

.home-info-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.home-info-list li {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-soft);
  padding-left: 1.2rem;
  position: relative;
}
.home-info-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.home-info-list li strong { color: var(--text); font-weight: 600; }

.home-footer-v2 {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
.home-footer-v2 p { margin: 0.15rem 0; }
.home-footer-v2 a { color: inherit; text-decoration: underline; }
.home-footer-v2 .footer-role { color: var(--accent); font-weight: 600; }

/* ============================================================
   En-têtes de section de la page Documents (la page Contacts a css/contact.css)
   ============================================================ */

.contacts-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.3rem;
}
.contacts-section-head h3 { margin: 0; }
.contacts-section-sub { margin: 0 0 1rem; font-size: 0.85rem; }

/* Pair de champs côte à côte qui se replient sur mobile */
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.field-pair > .field { min-width: 0; }
.field-pair input { width: 100%; min-width: 0; }
@media (max-width: 540px) {
  .field-pair { grid-template-columns: 1fr; }
}

/* ============================================================
   Calendrier (agenda)
   ============================================================ */

.agenda-filters {
  display: flex;
  gap: 0.4rem;
  margin: 0.4rem 0 1.5rem;
}
.filter-pill {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-pill:hover { color: var(--text); border-color: var(--line-strong); }
.filter-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.agenda-month { margin-bottom: 2rem; }
.agenda-month-title {
  margin: 0 0 0.6rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: var(--poids-titre);   /* un h3 : la police des titres, donc leur poids (l'habillage le remappe) */
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
}
.agenda-month-items { display: flex; flex-direction: column; gap: 0.5rem; }

.agenda-card {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 0.9rem;
  align-items: stretch;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.7rem 1rem 0.8rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.agenda-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-1); }
.agenda-card.past { opacity: 0.55; }
.agenda-card.today { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }

.agenda-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 0.2rem;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  min-width: 56px;
  text-align: center;
}
.agenda-date-day {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 1.45rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.agenda-date-month {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 2px;
}

.agenda-card.agenda-examen     .agenda-date { background: var(--c-stop-soft); }
.agenda-card.agenda-examen     .agenda-date-day { color: var(--c-stop); }
.agenda-card.agenda-stage      .agenda-date { background: var(--c-wait-soft); }
.agenda-card.agenda-stage      .agenda-date-day { color: var(--c-wait); }
.agenda-card.agenda-formation  .agenda-date { background: var(--accent-soft); }
.agenda-card.agenda-formation  .agenda-date-day { color: var(--accent); }
.agenda-card.agenda-ferie      .agenda-date { background: var(--c-go-soft); }
.agenda-card.agenda-ferie      .agenda-date-day { color: var(--c-go); }

.agenda-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agenda-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.agenda-emoji { font-size: 1rem; line-height: 1; }
.agenda-title { margin: 0; font-size: 1rem; font-weight: 600; font-family: var(--font); }
.agenda-today-pill {
  background: var(--accent);
  color: white;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
}
.agenda-countdown {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.agenda-countdown.today { background: var(--c-stop); color: white; }
.agenda-countdown.soon  { background: var(--c-wait-soft); color: var(--c-wait); }
.agenda-countdown.later { background: var(--c-go-soft); color: var(--c-go); }
.agenda-meta { font-size: 0.82rem; color: var(--text-muted); font-family: var(--font); font-variant-numeric: tabular-nums; }
.agenda-meta-duration { font-style: italic; }
.agenda-desc { margin: 0.3rem 0 0; font-size: 0.88rem; color: var(--text-soft); line-height: 1.4; }
.agenda-actions { display: flex; gap: 0.3rem; align-self: flex-start; }

.agenda-empty {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-elev);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.agenda-empty p { margin: 0 0 0.3rem; }

@media (max-width: 720px) {
  .agenda-card {
    grid-template-columns: 50px 1fr;
    grid-template-areas: "date body" "actions actions";
    gap: 0.6rem;
    padding: 0.6rem 0.7rem 0.7rem;
  }
  .agenda-date { grid-area: date; min-width: 48px; }
  .agenda-body { grid-area: body; }
  .agenda-actions { grid-area: actions; justify-self: end; margin-top: 0.4rem; }
  .agenda-date-day { font-size: 1.25rem; }
}

/* Bouton tirage aléatoire (dé), discret, à côté des chips élèves */
.p-dice-btn {
  flex: 0 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0.18rem 0.45rem;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
  height: 30px;
  align-self: center;
}
.p-dice-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: rotate(15deg);
}
.p-dice-btn:active { transform: rotate(360deg) scale(0.92); transition: transform 0.4s; }

/* Picker compact 1/2/3 (Voiture) qui sort du bouton 🎲 */
.p-dice-picker-wrap { position: relative; display: inline-block; }
.p-dice-picker {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-2);
  z-index: 60;
}
.p-dice-picker.hidden { display: none; }
.p-dice-option {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.p-dice-option:hover { background: var(--accent); color: white; }

.p-lane-notes {
  padding: 0 0.6rem 0.45rem;
}
.p-lane-notes-input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  font-family: inherit;
  font-size: 0.74rem;
  font-style: italic;
  color: var(--text-muted);
  padding: 0.2rem 0.35rem;
  border-radius: var(--r-sm);
}
.p-lane-notes-input::placeholder {
  color: var(--text-muted);
  font-style: italic;
}
.p-lane-notes-input:hover {
  background: rgba(0,0,0,0.025);
  border-color: var(--line);
}
.p-lane-notes-input:focus {
  outline: none;
  background: var(--bg-elev);
  border-color: var(--accent);
  font-style: normal;
  color: var(--text);
}

.p-lane-cell select,
.p-lane-cell input {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 0.22rem 0.3rem;
  font-family: inherit;
  font-size: 0.78rem;
  border-radius: var(--r-sm);
  color: var(--text);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 0;
  text-overflow: ellipsis;
}

.p-lane-cell select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.2rem center;
  background-size: 12px;
  padding-right: 1rem;
}

.p-lane-cell select:hover,
.p-lane-cell input:hover {
  background-color: var(--bg-subtle);
  border-color: var(--line);
}

.p-lane-cell select:focus,
.p-lane-cell input:focus {
  outline: none;
  background-color: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--halo-focus);
}

.p-lane-delete {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.p-lane-delete:hover { background: var(--c-stop-soft); color: var(--c-stop); }
.p-lane-delete .icon { width: 12px; height: 12px; }

/* === Drag & drop des cartes (échange dans la demi-journée) === */
.p-lane-drag {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: grab;
  touch-action: none;        /* glisser depuis la poignée ne déclenche pas le scroll */
  transition: color 0.15s;
}
.p-lane-drag:hover { color: var(--accent); }
.p-lane-drag:active { cursor: grabbing; }
.p-lane-drag .icon { width: 16px; height: 16px; }
.read-only .p-lane-drag { display: none !important; }

/* Carte source pendant le glisser */
.p-drag-source { opacity: 0.35; }

/* Fantôme qui suit le doigt / curseur */
.p-drag-ghost {
  position: fixed;
  z-index: 9999;
  margin: 0;
  pointer-events: none;       /* laisse elementFromPoint « voir » la carte sous le fantôme */
  opacity: 0.95;
  transform: rotate(1.5deg);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.25);
  border-radius: var(--r);
  border: 1px solid var(--accent);
}

/* Cible de dépôt valide surlignée */
.p-drop-target {
  outline: 2px dashed var(--accent);
  outline-offset: 2px;
}
.p-drop-target::after {
  content: "Échanger ici";
  position: absolute;
  top: 5px;
  right: 6px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--bg-elev);
  padding: 1px 5px;
  border-radius: 4px;
  pointer-events: none;
  z-index: 3;
}

/* Cible dans une AUTRE demi-journée / un autre jour : déplacement (friction),
   surligné en ambre pour le distinguer de l'échange intra-demi-journée. */
.p-drop-target.cross { outline-color: var(--c-wait); }
.p-drop-target.cross::after { content: "Déplacer ici"; color: var(--c-wait); }

body.p-dragging-active {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing;
}

/* === Add buttons === */

/* Bouton parallèle compact, barre verticale au bout */
.p-add-parallele-mini {
  align-self: stretch;
  width: 32px;
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
  flex-shrink: 0;
}
.p-add-parallele-mini:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
}
.p-add-parallele-mini .icon { width: 14px; height: 14px; }
/* Label « En parallèle » : masqué en desktop (barre verticale icône seule),
   affiché sur mobile où le bouton devient pleine largeur (cf. media query). */
.p-add-parallele-label { display: none; }

.p-add-suite {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  background: transparent;
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  margin-left: 26px;
  transition: all 0.15s;
}

.p-add-suite:hover {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
  border-style: solid;
}

.p-add-suite .icon { width: 12px; height: 12px; }

/* === Autocomplete Sujet/Thème === */

.sujet-ac {
  position: relative;
  width: 100%;
}

/* === Sujet multi-thèmes : chips inline + input continu === */
.sujet-multi .sujet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  padding: 0.3rem 0.4rem;
  min-height: 32px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sujet-multi:focus-within .sujet-chips {
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 2px var(--halo-focus-leger);
}
.sujet-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  padding: 0.18rem 0.6rem 0.18rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  max-width: 100%;
}
.sujet-chip.has-num { padding-left: 0.25rem; }
.sujet-chip-num {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.sujet-chip-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.sujet-chip-x {
  border: none;
  background: transparent;
  color: var(--accent);
  opacity: 0.7;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
}
.sujet-chip-x:hover { opacity: 1; background: rgba(0,0,0,0.05); }
.sujet-chip-input {
  flex: 1 1 80px;
  min-width: 60px;
  border: none !important;
  background: transparent !important;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  padding: 0.15rem 0 !important;
  box-shadow: none !important;
}
.sujet-chip-input::placeholder { color: var(--text-muted); }

.sujet-ac-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  z-index: 100;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.25rem;
  min-width: 280px;
}
/* Garantit que la cellule active passe au-dessus de ses voisines */
.p-lane-cell:focus-within { z-index: 50; }

.sujet-ac-empty { padding: 0.6rem 0.75rem; font-size: 0.85rem; font-style: italic; }

.sujet-ac-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.45rem 0.65rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.1s;
}
.sujet-ac-item:hover { background: var(--bg-subtle); }
.sujet-ac-item.notion { background: var(--act-peda-voile-fin); }
.sujet-ac-item.notion:hover { background: var(--act-peda-voile); }

.sujet-ac-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  padding: 1px 4px;
}
.sujet-ac-num.notion { background: var(--c-wait-soft); color: var(--c-wait); }

.sujet-ac-titre { font-weight: 500; color: var(--text); }
.sujet-ac-cat { font-size: 0.72rem; }

/* === Themes view === */

/* === Pills de navigation entre familles === */

.theme-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

/* Lecture des cours ou des QCM en échec : le message et « Réessayer », à la ligne si l'écran est étroit. */
.lecture-echec {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--c-wait-soft);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  color: var(--text);
}
.lecture-echec p { margin: 0; flex: 1 1 14rem; }
.lecture-echec .btn { min-height: 44px; }

.theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: var(--bg-elev);
  border: 1.5px solid var(--line);
  border-radius: 22px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-pill:hover { border-color: var(--line-strong); color: var(--text); }
.theme-pill.active {
  background: var(--bg-deep);
  border-color: var(--bg-deep);
  color: var(--sur-sombre);
}
.theme-pill.active .theme-pill-count {
  background: var(--sombre-allume-fort);
  color: var(--sur-sombre);
}

.theme-pill-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 0 0.4rem;
  height: 18px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border-radius: 9px;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 600;
}

/* === Section par famille === */

.theme-section {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.theme-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem 1.4rem 0.85rem;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.theme-section-title-wrap { min-width: 200px; }

.theme-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: var(--poids-titre);
  letter-spacing: -0.01em;
  color: var(--text);
  line-height: 1.1;
}

.theme-section-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.theme-section-stats {
  display: flex;
  gap: 1.25rem;
}

.theme-section-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1;
}

.theme-section-stat-value {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

.theme-section-stat-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Couleurs distinctes par famille */
.theme-section-themes-officiels      .theme-section-title { color: var(--text); }
.theme-section-competences-formateur .theme-section-title { color: var(--accent); }
.theme-section-competences-conduite  .theme-section-title { color: var(--famille-conduite); }
.theme-section-notions-pedagogiques  .theme-section-title { color: var(--c-wait); }

/* Pills couleurs */
.theme-pill.theme-pill-competences-formateur.active { background: var(--accent); border-color: var(--accent); }
.theme-pill.theme-pill-competences-conduite.active  { background: var(--famille-conduite); border-color: var(--famille-conduite); }
.theme-pill.theme-pill-notions-pedagogiques.active  { background: var(--c-wait); border-color: var(--c-wait); }

/* === Barre de progression === */

.theme-progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.5rem 1.4rem 0.85rem;
  border-bottom: 1px solid var(--line);
}

.theme-progress {
  flex: 1;
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.theme-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-fin-barre));
  border-radius: 3px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-progress-label {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
  min-width: 44px;
  text-align: right;
}

.themes-list {
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
}

.theme-group-head {
  padding: 0.85rem 1rem 0.55rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.theme-group-head:first-child { border-top: none; }

.theme-row {
  display: grid;
  grid-template-columns: 50px 1fr 130px 90px 36px;
  gap: 0.6rem;
  align-items: center;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
  transition: background 0.15s;
}
.theme-row:hover { background: var(--bg-subtle); }
.theme-row:last-child { border-bottom: none; }

.theme-row.theme-header {
  background: var(--bg-subtle);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 1rem;
}
.theme-row.theme-header:hover { background: var(--bg-subtle); }

.theme-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.theme-titre-block { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.theme-titre-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  line-height: 1.3;
  border-radius: 2px;
  transition: color 0.12s;
}
.theme-titre-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.theme-titre-link:focus { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

/* === Theme modal (placeholder contenu thématique) === */
.theme-modal { max-width: 540px; }
.theme-modal-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.25rem;
}
.theme-modal-num {
  display: inline-block;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  min-width: 32px;
  text-align: center;
}
.theme-modal-titre { margin: 0; font-size: 1.15rem; line-height: 1.3; }
.theme-modal-cat { margin: 0 0 0.8rem; font-size: 0.82rem; }
.theme-modal-placeholder {
  background: var(--bg-subtle);
  border: 1px dashed var(--line);
  border-radius: var(--r);
  padding: 1.2rem;
  margin: 0.5rem 0 1rem;
  text-align: center;
}
.theme-modal-placeholder p { margin: 0.3rem 0; }

/* === Invite form (Paramètres → Accès) === */
.invite-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.invite-row {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem 0.6rem;
}
.invite-row label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
.invite-row select,
.invite-row input[type="email"] {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--r-sm);
  padding: 0.4rem 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--text);
}
.invite-row select:focus,
.invite-row input[type="email"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.invite-row .btn {
  grid-column: 4;
  justify-self: end;
}
@media (max-width: 720px) {
  .invite-row {
    grid-template-columns: 1fr;
  }
  .invite-row .btn { grid-column: 1; justify-self: stretch; }
}

/* === Role pills (liste invités) === */
.role-pill {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 70px;
  text-align: center;
}
.role-pill.role-admin     { background: var(--accent-soft);   color: var(--accent-strong); }
.role-pill.role-prof      { background: var(--c-wait-soft);   color: var(--c-wait); }
.role-pill.role-stagiaire { background: var(--bg-subtle);     color: var(--text-muted); }

.role-pills {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.invite-admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  padding: 0.3rem 0;
  text-transform: none;
  letter-spacing: 0;
}
.invite-admin-toggle input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--accent);
}

/* === Tabs gate (Connexion / Créer un compte) === */
.gate-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--r-sm);
  margin-bottom: 1rem;
}
.gate-tab {
  background: transparent;
  border: none;
  padding: 0.55rem 0.6rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: calc(var(--r-sm) - 2px);
  transition: background 0.15s, color 0.15s;
}
.gate-tab:hover { color: var(--text); }
.gate-tab.active {
  background: var(--bg-elev);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.gate-hint {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  line-height: 1.4;
}

/* Lien discret sous le bouton de la gate (oubli, retour). Bouton plutôt que
   lien : aucune navigation, on change de mode dans la même carte. */
.gate-link {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.gate-link:hover { color: var(--accent); }

/* « Réessayer » après une lecture des affectations ratée à l'ouverture : cible de 44 px, pleine largeur de la carte. */
#gate .gate-reessayer { display: block; width: 100%; min-height: 44px; margin-top: 1rem; }

.gate-info {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text);
}

/* === État erreur Paramètres (timeout / réseau) === */
.param-error {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1.5rem;
  text-align: center;
  margin: 1rem 0;
}
.param-error p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

/* === Toolbar tri (dashboard, notes) === */
.dash-toolbar,
.matrice-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.dash-toolbar {
  margin: 0.4rem 0 1rem;
  padding: 0.5rem 0.7rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.dash-toolbar label,
.matrice-toolbar-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
.dash-sort,
.notes-sort {
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: var(--r-sm);
  padding: 0.3rem 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}
.dash-sort:focus,
.notes-sort:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.theme-cat { font-size: 0.7rem; color: var(--text-muted); }
.theme-titre-meta { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }


.theme-statut {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.28rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: none;
  font-family: inherit;
  cursor: default;
  width: fit-content;
}
.theme-statut.clickable { cursor: pointer; transition: opacity 0.15s; }
.theme-statut.clickable:hover { opacity: 0.8; }

.theme-statut-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.theme-statut.todo  { background: var(--bg-subtle); color: var(--text-muted); }
.theme-statut.todo  .theme-statut-dot { background: var(--text-faint); }
.theme-statut.doing { background: var(--c-wait-soft); color: var(--c-wait); }
.theme-statut.doing .theme-statut-dot { background: var(--c-wait); animation: pulse 2s ease-in-out infinite; }
.theme-statut.done  { background: var(--c-go-soft); color: var(--c-go); }
.theme-statut.done  .theme-statut-dot { background: var(--c-go); }

.theme-date { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.78rem; color: var(--text-soft); }
button.theme-date.editable {
  background: transparent;
  border: 1px dashed transparent;
  border-radius: var(--r-sm);
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
button.theme-date.editable:hover { background: var(--bg-subtle); border-color: var(--line); }
button.theme-date.editable.muted { color: var(--text-muted); }

/* === Mobile : restructure des lignes thème === */
@media (max-width: 720px) {
  .theme-row {
    grid-template-columns: 36px 1fr auto auto;
    grid-template-areas:
      "num titre statut del"
      "num meta meta meta";
    gap: 0.3rem 0.4rem;
    padding: 0.7rem 0.7rem;
    align-items: start;
  }
  .theme-row .theme-num { grid-area: num; align-self: center; }
  .theme-row .theme-titre-block { grid-area: titre; min-width: 0; }
  .theme-row .theme-statut { grid-area: statut; align-self: center; justify-self: end; }
  /* Bouton supprimer notion : placé dans sa propre colonne à droite du statut */
  .theme-row > .btn.danger {
    grid-area: del;
    align-self: center;
  }
  /* Si pas de delBtn, le span vide ne prend pas de place */
  .theme-row > span:empty {
    grid-area: del;
    display: none;
  }
  /* La date et les notes vivent en bas dans une zone "meta" */
  .theme-row > .theme-date,
  .theme-row > button.theme-date {
    grid-area: meta;
    grid-row: 2;
    grid-column: 2 / -1;
    justify-self: start;
    font-size: 0.78rem;
  }
  /* On masque l'en-tête de tableau (les libellés N°, THÈME, STATUT...) sur mobile */
  .theme-row.theme-header { display: none; }
}

/* Chip select (Élèves) */

.chips-select {
  position: relative;
  width: 100%;
  min-height: 30px;
}

.chips-display {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  padding: 0.18rem 0.25rem;
  cursor: text;
  min-height: 22px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
}

.chips-display:hover { background: var(--bg-elev); border-color: var(--line); }
.chips-display.open {
  background: var(--bg-elev);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--halo-focus);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px 1px 7px;
  background: var(--bg-subtle);
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 500;
  font-family: var(--font);
  line-height: 1.3;
}

.chip .x {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.95em;
  line-height: 1;
  display: inline-flex;
  width: 14px;
  height: 14px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.chip .x:hover { background: var(--text); color: white; }

.chips-placeholder {
  color: var(--text-muted);
  padding: 2px 4px;
  font-size: 0.85rem;
}

.chips-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  z-index: 50;
  max-height: 260px;
  overflow-y: auto;
  min-width: 200px;
  padding: 0.25rem;
}

.chips-dropdown-item {
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--r-sm);
  transition: background 0.1s;
}
.chips-dropdown-item:hover { background: var(--bg-subtle); }
.chips-dropdown-item.selected { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
/* Bénévoles (voiture) : badge « dispo » dans le menu déroulant */
.bnv-dispo-badge {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0 0.45rem;
  flex: none;
}
.chips-dropdown-item::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-xs);
  flex-shrink: 0;
}
.chips-dropdown-item.selected::before {
  background: var(--accent);
  border-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-position: center;
  background-size: 10px;
  background-repeat: no-repeat;
}
/* === Classement de priorité (tableau + élèves + voiture) === */
/* Légende en tête de menu, pour expliquer les compteurs */
.prio-legend {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.25rem 0.5rem 0.35rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.2rem;
  position: sticky;
  top: 0;
  background: var(--bg-elev);
}
/* Badge compteur : nb de passages cette semaine. 0 = prioritaire => mis en avant (accent). */
.prio-count {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-radius: 999px;
  min-width: 20px;
  text-align: center;
  padding: 0.05rem 0.4rem;
}
.prio-count.zero { color: var(--accent-strong); background: var(--accent-soft); font-weight: 700; }

/* Sélecteur d'UNE personne (tableau) : même habillage que les chips, single-select */
.person-select { position: relative; width: 100%; }
.p-lane-role.pedagogue .person-select { flex: 1; }
.person-display {
  display: flex;
  align-items: center;
  min-height: 30px;
  padding: 0.22rem 1.5rem 0.22rem 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: var(--act-peda-voile);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  background-size: 11px;
}
.person-display.open { border-color: var(--accent); box-shadow: 0 0 0 2px var(--halo-focus); }
.person-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-placeholder { color: var(--text-muted); font-weight: 500; }
.person-item {
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: var(--r-sm);
  transition: background 0.1s;
}
.person-item:hover { background: var(--bg-subtle); }
.person-item.selected { background: var(--accent-soft); color: var(--accent-strong); font-weight: 500; }
.person-item-name { flex: 1; min-width: 0; }
.person-none { color: var(--text-muted); }
.read-only .person-display { background: transparent; cursor: default; background-image: none; }
.read-only .person-display { pointer-events: none; }

.planning-helper {
  margin-top: 0.85rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  color: var(--text-soft);
  border-left: 3px solid var(--accent);
}

.planning-helper strong { color: var(--text); font-weight: 600; }

/* === Valider la semaine (planning -> passages) === */
.valider-modal { max-width: 460px; width: 100%; }
.valider-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  max-height: 52vh;
  overflow-y: auto;
  margin: 0.2rem 0 0.9rem;
  padding-right: 0.2rem;
}
.valider-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  cursor: pointer;
}
.valider-row-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.valider-row input[type="checkbox"] { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--accent); }
.valider-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.valider-row-name { font-weight: 600; font-size: 0.9rem; }
.valider-row-meta { font-size: 0.76rem; color: var(--text-muted); }
.valider-row.already { opacity: 0.6; background: var(--bg-subtle); cursor: default; }
.valider-summary-head { margin: 0 0 0.5rem; font-size: 0.85rem; }
.valider-row.valider-summary { cursor: default; }
.valider-section { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.9rem; }
.valider-section:first-of-type { margin-top: 0; }
.valider-section-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.4rem; }
.valider-section-count { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.valider-already-head {
  margin-top: 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* État désactivé générique des boutons (retour visuel pendant une action async) */
.btn[aria-disabled="true"],
.btn:disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

/* ============================================================
   Passages
   ============================================================ */

.passages-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.passages-filters {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.passages-filters select,
.passages-filters input {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--bg-elev);
}

.passages-table-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.passages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.passages-table th {
  background: var(--bg-subtle);
  padding: 0.65rem 0.95rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--line);
}

.passages-table td {
  padding: 0.65rem 0.95rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.passages-table tr:last-child td { border-bottom: none; }
.passages-table tr:hover td { background: var(--bg-subtle); }

.passages-table td.date { font-family: var(--font); font-variant-numeric: tabular-nums; color: var(--text-soft); font-size: 0.85rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.55rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border: 1px solid transparent;
}

.tag.salle { background: var(--act-peda); color: var(--act-peda-texte); border-color: var(--act-peda-border); }
.tag.voiture { background: var(--act-voiture); color: var(--act-voiture-texte); border-color: var(--act-voiture-border); }
/* Élève en salle : une présence, pas un passage, volontairement en retrait des
   tags colorés Salle / Voiture. */
.tag.eleve { background: var(--bg-subtle); color: var(--text-soft); border-color: var(--line); }
.tag.effectue { background: var(--c-go-soft); color: var(--c-go); }
.tag.absence { background: var(--c-stop-soft); color: var(--c-stop); }
.tag.bonus { background: var(--c-wait-soft); color: var(--c-wait); }
.tag.report { background: var(--bg-subtle); color: var(--text-muted); }

.tag.who {
  background: var(--bg-subtle);
  color: var(--text-soft);
  border-color: var(--line);
  font-family: var(--font);
}
.tag.who.admin {
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-color: var(--accent-soft-2);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
}

.audit-summary {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.25rem;
  font-family: var(--font); font-variant-numeric: tabular-nums;
}

/* ============================================================
   Config
   ============================================================ */

/* === Paramètres (sections) === */

.param-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  max-width: 820px;
}

.param-section {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1.5rem 1.6rem;
  min-width: 0;
  overflow: hidden;
}
.param-section * { min-width: 0; }
.param-section input,
.param-section select { max-width: 100%; }

@media (max-width: 600px) {
  .param-section { padding: 1.1rem 0.9rem; }
  .param-section-head { grid-template-columns: 36px 1fr; gap: 0.6rem; }
  .param-section h3 { font-size: 1.2rem; }
  .admin-item {
    grid-template-columns: auto 1fr auto;
    gap: 0.4rem;
  }
  .admin-item .admin-email-text {
    font-size: 0.78rem;
    word-break: break-all;
  }
}

.param-section-head {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 0.85rem;
  align-items: start;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.param-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r);
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.param-icon .icon { width: 22px; height: 22px; }

.param-section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--poids-titre);
  letter-spacing: -0.01em;
  color: var(--text);
}
.param-section .param-section-head p { margin: 0.25rem 0 0; font-size: 0.88rem; }

.param-block {
  margin-top: 1.25rem;
}
.param-block:first-of-type { margin-top: 0; }

.param-block h4 {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.3rem;
}

.param-block .block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.param-block .block-head h4 { margin: 0; }
.param-block .count {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.param-block p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
}

/* === Admin list === */

.admin-list {
  list-style: none;
  margin: 0.5rem 0 0.85rem;
  padding: 0;
  border-top: 1px solid var(--line);
}

.admin-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.admin-item:last-child { border-bottom: none; }

.admin-item .icon { color: var(--text-muted); }

.admin-email-text {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  color: var(--text);
}

.admin-you {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}

/* === Info list === */

.info-list {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.info-list dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-top: 0.2rem;
}
.info-list dd {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text);
}
.info-list dd a { color: var(--accent); text-decoration: underline; }
.info-list dd a:hover { color: var(--accent-strong); }

/* Backward compat, anciennes classes (Promo block réutilise) */

.config-section { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.5rem 1.6rem; }
.config-section h3 { margin: 0 0 0.75rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: var(--poids-titre); }
.config-section .count { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.78rem; color: var(--text-muted); }

.config-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.config-list li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.config-list li:last-child { border-bottom: none; }

/* Abandons (stagiaires désactivés, données conservées) */
.config-list .abandon-name {
  flex: 1;
  padding: 0.4rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.abandons-block .abandons-hint { margin: 0 0 0.5rem; font-size: 0.82rem; }
.abandon-btn { color: var(--text-muted); }

.config-list input {
  flex: 1;
  padding: 0.4rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-family: inherit;
  background: transparent;
  color: var(--text);
}

.config-list input:hover { background: var(--bg-subtle); }
.config-list input:focus {
  outline: none;
  background: var(--bg-elev);
  border-color: var(--accent);
}

.config-add {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.config-add input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.92rem;
  font-family: inherit;
}

.config-add input:focus { outline: none; border-color: var(--accent); }

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.field input,
.field select {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.92rem;
  background: var(--bg-elev);
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ============================================================
   Modal
   ============================================================ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--ombre-voile);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: backdrop-in 0.18s ease-out;
}

/* Formulaire de question de l'éditeur QCM : il s'ouvre PAR-DESSUS .qcm-overlay
   (z-index 1000), sinon il apparaît derrière et tous les clics vont à l'overlay. */
.modal-backdrop.qcm-form-backdrop { z-index: 1100; }
/* Une confirmation (js/confirmer.js) répond au geste qu'on vient de faire, où qu'il soit : au-dessus de l'examen QCM
   (1000), du formulaire de question (1100), des calques de la navigation (1600), sous les messages du bas (2000). */
.modal-backdrop.confirmer-fond { z-index: 1700; }
/* demander() : un champ sous la question, et ce qui ne va pas dans la saisie. */
.confirmer-champ { display: flex; flex-direction: column; gap: 0.3rem; margin: 0 0 0.6rem; font-weight: 600; }
.confirmer-champ input { min-height: 44px; font: inherit; font-weight: 400; }
.confirmer-erreur { margin: 0 0 0.6rem; color: var(--c-stop); }
.confirmer-erreur:empty { display: none; }
/* La fenêtre de confirmation ne sort jamais de l'écran, quel que soit le libellé de ses boutons (« Continuer l'examen »,
   « Changer les questions » à 375 px de large) : les boutons passent à la ligne au lieu de pousser le premier hors du
   cadre, et un mot trop long se coupe. Sur téléphone, ils s'empilent sur toute la largeur, cibles de 44 px. */
.modal.confirmer { overflow-wrap: anywhere; }
.modal.confirmer .modal-actions { flex-wrap: wrap; }
.modal.confirmer .modal-actions .btn { min-height: 44px; min-width: 0; max-width: 100%; white-space: normal; text-align: center; }
@media (max-width: 640px) {
  .modal.confirmer .modal-actions .btn { flex: 1 1 100%; }
}

@keyframes backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  max-width: 460px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-3);
  animation: modal-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal h3 {
  margin: 0 0 1.25rem;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  font-weight: var(--poids-titre-semi);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.modal-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
  justify-content: flex-end;
}

/* Sur téléphone, les boutons des fenêtres de l'app font au moins 44 px de haut : une cible qu'un doigt atteint sans viser
   (ouvrirModale, js/nav-fenetre.js ; ménage du 11/11/2026). */
@media (max-width: 699.98px) {
  .modal .btn { min-height: 44px; }
}
/* La fenêtre reçoit le focus à l'ouverture (ouvrirModale) : pas de contour autour d'elle, seulement autour de ses boutons et
   champs, comme les fenêtres de la navigation (.nav-fenetre:focus, css/navigation.css). */
.modal:focus { outline: none; }

/* ============================================================
   Panneau Élèves bénévoles (banque voiture, formateurs/admins)
   ============================================================ */

/* Onglets du panneau (Bénévoles / Auto-écoles) */
.bnv-tabs { display: flex; gap: 0.4rem; margin: 0.2rem 0 0.9rem; }
.bnv-tab { border: 1px solid var(--line); border-radius: 999px; padding: 0.3rem 0.95rem;
  background: transparent; cursor: pointer; font-size: 0.85rem; color: var(--text-muted); }
.bnv-tab.active { background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-strong); font-weight: 600; }
.bnv-intro { margin: 0.1rem 0 0.8rem; font-size: 0.85rem; }
.bnv-toolbar { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.bnv-filter-label { font-size: 0.82rem; color: var(--text-muted); }
.bnv-toolbar select { max-width: 11rem; }
.bnv-empty { margin: 1rem 0; }
.bnv-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
  padding: 0.65rem 0.2rem; border-top: 1px solid var(--line); }
.bnv-row.inactive { opacity: 0.65; }
.bnv-name { font-weight: 600; }
.bnv-niveau { font-size: 0.8rem; color: var(--accent-strong); font-weight: 500; margin-top: 0.1rem; }
.bnv-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: 0.1rem; }
.bnv-badges { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem; }
.bnv-badge { font-size: 0.7rem; border: 1px solid var(--accent); color: var(--accent);
  border-radius: 999px; padding: 0.05rem 0.5rem; }
.bnv-badge.empty { border-color: var(--line); color: var(--text-muted); font-style: italic; }
.bnv-note { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin-top: 0.25rem; }
.bnv-side { display: flex; flex-direction: column; align-items: flex-end; gap: 0.4rem;
  flex: 0 1 auto; min-width: 0; }
.bnv-tel { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--accent);
  text-decoration: none; white-space: nowrap; }
/* Email : peut être long → autorisé à se couper (le téléphone reste insécable) */
.bnv-mail { white-space: normal; overflow-wrap: anywhere; text-align: right; max-width: 100%; }
.bnv-tel:hover { text-decoration: underline; }
.bnv-retires { margin-top: 1rem; }
.bnv-retires summary { cursor: pointer; font-size: 0.85rem; color: var(--text-muted); }
.bnv-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.bnv-form-2col > .field { min-width: 0; }
.bnv-dispo-grid { display: grid; grid-template-columns: 3rem 1fr 1fr; gap: 0.25rem 0.5rem;
  align-items: center; }
.bnv-dispo-head { font-size: 0.75rem; color: var(--text-muted); text-align: center; }
.bnv-dispo-jour { font-size: 0.8rem; font-weight: 600; }
.bnv-dispo-cell { display: flex; justify-content: center; padding: 0.35rem 0; cursor: pointer; }
.bnv-dispo-cell input { width: 19px; height: 19px; accent-color: var(--accent); cursor: pointer; }
.bnv-remove { color: var(--c-retrait); }
/* Bénévoles affiliés sur la fiche auto-école */
.bnv-affilies { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.bnv-affilies-titre { font-size: 0.8rem; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.bnv-affilie { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; flex-wrap: wrap; }
.bnv-affilie-nom { font-weight: 500; }
.bnv-affilie-niv { font-size: 0.72rem; color: var(--accent-strong); border: 1px solid var(--accent-soft-2);
  border-radius: 999px; padding: 0 0.4rem; }
.bnv-affilie .bnv-tel { margin-left: auto; }
/* Nom cliquable (ouvre la fiche du bénévole, retour fiche école) */
.bnv-linklike { background: none; border: none; padding: 0; font: inherit; font-weight: 500;
  color: var(--accent-strong); cursor: pointer; text-decoration: underline;
  text-underline-offset: 2px; text-decoration-color: var(--accent-soft-2); }
.bnv-linklike:hover { text-decoration-color: var(--accent); }
/* Désaffilier (le bénévole reste dans la banque). Padding généreux + marges
   négatives : zone tactile ~40px sans gonfler la hauteur de ligne. */
.bnv-affilie-x { background: none; border: none; color: var(--c-retrait); font-size: 1.15rem;
  cursor: pointer; padding: 0.5rem 0.85rem; margin: -0.5rem -0.35rem -0.5rem 0; line-height: 1; flex: none; }
/* Sélecteur d'affiliation (existant ou + Nouveau bénévole) */
.bnv-affilie-add { margin-top: 0.5rem; max-width: 100%; }
/* Suivi des venues (fiche bénévole) */
.bnv-suivi { margin-top: 1rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }
.bnv-venue { padding: 0.45rem 0; border-bottom: 1px dashed var(--line-faint); }
.bnv-venue-head { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.bnv-venue-date { font-weight: 600; font-size: 0.85rem; }
.bnv-venue-avec { font-size: 0.8rem; color: var(--text-muted); }
.bnv-venue-futur { font-size: 0.7rem; border: 1px solid var(--line-strong); color: var(--text-muted);
  border-radius: 999px; padding: 0 0.45rem; }
.bnv-venue-sujet { font-size: 0.8rem; color: var(--accent-strong); margin-top: 0.15rem; }
.bnv-venue-com { width: 100%; margin-top: 0.3rem; font-size: 0.82rem; }
.bnv-venue.orpheline { opacity: 0.75; }
@media (max-width: 560px) {
  .bnv-form-2col { grid-template-columns: 1fr; }
  .bnv-row { flex-direction: column; }
  .bnv-side { flex-direction: row; align-items: center; flex-wrap: wrap; max-width: 100%; }
  .bnv-mail { text-align: left; }
}

/* ============================================================
   Notes, Matrice (toolbar date + cellules + édition inline)
   ============================================================ */

.matrice-toolbar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 0.85rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg-subtle);
  border: 1px solid var(--line);
  border-radius: var(--r);
  flex-wrap: wrap;
}

.matrice-toolbar-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

.matrice-toolbar input[type="date"] {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
  background: var(--bg-elev);
}

.matrice-toolbar-hint {
  font-size: 0.78rem;
  font-style: italic;
}

.matrice-inline-input {
  width: 100%;
  height: 100%;
  min-width: 30px;
  border: 2px solid var(--accent);
  background: var(--bg-elev);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: 0;
  border-radius: 3px;
  outline: none;
  /* Hide spin buttons */
  -moz-appearance: textfield;
}
.matrice-inline-input::-webkit-outer-spin-button,
.matrice-inline-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Graphes des notes : la couleur vient d'une classe (donc d'un jeton) et non d'un attribut SVG, pour suivre
   un changement d'habillage en direct. */
.notes-axe { stroke: var(--graphe-axe); }
.notes-grille { stroke: var(--graphe-grille); }
.notes-graduation { fill: var(--graphe-graduation); }
.notes-nom-anonyme { fill: var(--graphe-graduation); }
.notes-valeur, .notes-nom { fill: var(--graphe-texte); }
.notes-libelle { fill: var(--graphe-libelle); }
.notes-piste { fill: var(--graphe-piste); }
/* « Aucune note » : posé sur le rail gris, en texte atténué (5,0:1 ; l'ancien #9DA89A n'atteignait que 2,2:1). */
.notes-valeur-faible { fill: var(--text-muted); }

/* Petit éditeur d'une note, ancré sous la cellule de la matrice. */
.matrice-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 200;
  background: #fff; border: 1px solid var(--line-popover-cadre); border-radius: 8px; padding: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  display: flex; gap: 6px; align-items: center; white-space: nowrap;
}
.matrice-popover .matrice-popover-input {
  width: 90px; padding: 6px 8px; font-size: 0.95em; border: 1px solid var(--line-popover); border-radius: 4px;
  outline: none; background: #fff; color: var(--text-popover);
}
.matrice-popover-ok {
  padding: 7px 12px; background: var(--accent); color: #fff; border: 0; cursor: pointer;
  font-size: 0.85em; line-height: 1; border-radius: 4px; font-weight: 600; white-space: nowrap;
}
.matrice-popover-annuler {
  padding: 7px 10px; background: #fff; color: var(--text-popover-doux); border: 1px solid var(--line-popover);
  cursor: pointer; font-size: 0.85em; line-height: 1; border-radius: 4px;
}
/* Bouton « valider » de l'édition d'une note sur la fiche du stagiaire. */
.matrice-inline-ok {
  padding: 0 10px; background: var(--accent); color: #fff; border: 0; cursor: pointer;
  font-size: 0.9em; border-radius: 3px;
}

/* Matrice */

.matrice-wrap {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: auto;
  max-width: 100%;
  /* La matrice tient dans la fenêtre et scrolle EN INTERNE (et non au niveau de la page) :
     ainsi l'en-tête sticky reste toujours visible, y compris pour atteindre les dernières
     lignes. La synthèse est en dessous (on scrolle la page pour l'atteindre).
     min-height = plancher : sur un écran court ou zoomé, « 100vh - X » devenait minuscule
     (l'en-tête vertical très haut ne laissait que ~3 lignes). Le plancher garantit une
     hauteur utilisable, la page scrolle si besoin. dvh = hauteur viewport dynamique (mobile). */
  max-height: calc(100dvh - 230px);
  min-height: 460px;
}

.matrice-table {
  border-collapse: separate;
  border-spacing: 0;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  width: max-content;
  min-width: 100%;
}

.matrice-table th,
.matrice-table td {
  padding: 0.3rem 0.4rem;
  text-align: center;
  border-bottom: 1px solid var(--line-faint);
  border-right: 1px solid var(--line-faint);
  white-space: nowrap;
  background: var(--bg-elev);
}

.matrice-table thead th {
  background: var(--bg-subtle);
  position: sticky;
  top: 0;
  z-index: 2;
  font-weight: 600;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.5rem 0.4rem;
}

/* Sticky première colonne (prénom) */
.matrice-table .sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-elev);
  text-align: left;
  font-family: var(--font);
  font-weight: 600;
  padding-left: 0.7rem;
  padding-right: 0.7rem;
  min-width: 92px;
  max-width: 110px;
  box-shadow: 2px 0 4px -2px rgba(0,0,0,0.08);
}
.matrice-table tbody .sticky { z-index: 1; }
.matrice-table thead .sticky { z-index: 4; }

/* Bouton prénom dans la cellule sticky */
.m-name-btn {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  width: 100%;
  min-height: 24px;   /* cible de 24 px sur ordinateur, 44 px sur téléphone (lot C, critère G) */
  border-radius: 3px;
  transition: color 0.12s;
}
@media (max-width: 720px) { .m-name-btn { min-height: 44px; } }
.m-name-btn:hover { color: var(--accent); }
.m-name-btn:focus { outline: 2px solid var(--accent-soft); outline-offset: 2px; }

.matrice-table thead .sticky {
  z-index: 3;
  background: var(--bg-subtle);
}

/* Colonnes spéciales : séparateur visuel */
.matrice-table .m-th-spe,
.matrice-table .m-td-cell:nth-child(-n+6) {
  /* avg + 4 spe = colonnes 2 à 6 */
}

.matrice-table th.m-th-avg,
.matrice-table th.m-th-spe {
  background: var(--bg-soft);
  color: var(--text);
  font-family: var(--font);
}

/* Header thèmes : titre rotaté à la verticale (bottom-up, lecture confortable) */
.matrice-table th.m-th-theme {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
  height: 160px;          /* place pour le titre vertical (réduite : moins de « gros bloc ») */
  vertical-align: bottom;
  padding: 0.4rem 0;
  background: var(--bg-subtle);
  /* DOIT rester sticky (comme thead th) sinon les thèmes défilent et disparaissent au scroll,
     ne laissant que les en-têtes de gauche (eux sticky) → effet « gros bloc » vide. */
  position: sticky;
  top: 0;
  z-index: 2;
}

.matrice-table .m-th-theme-label {
  /* On bascule tout le bloc à la verticale (lecture bottom→top) */
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  /* writing-mode + rotate(180deg) = lecture bottom→top dans le bon sens */
  white-space: nowrap;
  line-height: 1.2;
  margin: 0 auto;
  padding-bottom: 0.4rem;
  max-height: 150px;
  overflow: hidden;
}

.matrice-table .m-th-theme-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  padding: 0.18rem 0.35rem;
  background: var(--accent-soft);
  border-radius: 3px;
  /* compense la rotation pour rester lisible horizontalement */
  writing-mode: horizontal-tb;
  transform: rotate(180deg);
}

.matrice-table .m-th-theme-title {
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-soft);
  text-overflow: ellipsis;
  overflow: hidden;
}

.matrice-table .m-td-avg {
  font-weight: 700;
  border-right: 2px solid var(--line);
}

.matrice-table .m-td-cell.editable {
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.matrice-table .m-td-cell.editable:hover {
  transform: scale(1.15);
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  position: relative;
}

/* Couleurs par note ratio */
.matrice-table .empty { color: var(--text-faint); background: transparent; }
.matrice-table .empty.editable:hover::after { content: "+"; }
.matrice-table .bad    { background: var(--note-bad-fond); color: var(--note-bad-texte); font-weight: 700; }
.matrice-table .warn   { background: var(--note-warn-fond); color: var(--note-warn-texte); font-weight: 700; }
.matrice-table .ok     { background: var(--note-ok-fond); color: var(--note-ok-texte); font-weight: 700; }
.matrice-table .great  { background: var(--note-great-fond); color: var(--note-great-texte); font-weight: 800; }

/* Alternance des lignes pour bien repérer chaque stagiaire */
.matrice-table tbody tr:nth-child(even) td { background: var(--bg-subtle); }
.matrice-table tbody tr:nth-child(even) td.sticky { background: var(--bg-soft); }
.matrice-table tbody tr:nth-child(even) td.bad   { background: var(--note-bad-fond); }
.matrice-table tbody tr:nth-child(even) td.warn  { background: var(--note-warn-fond); }
.matrice-table tbody tr:nth-child(even) td.ok    { background: var(--note-ok-fond); }
.matrice-table tbody tr:nth-child(even) td.great { background: var(--note-great-fond); }
.matrice-table tbody tr:nth-child(odd) td.sticky { background: var(--bg-elev); }
.matrice-table tbody tr:hover td.sticky { background: var(--accent-soft); }

/* Border droite plus marquée après la dernière colonne spéciale (GDE) pour séparer des thèmes */
.matrice-table th:nth-child(6),
.matrice-table td:nth-child(6) {
  border-right: 2px solid var(--line);
}

/* Mobile : tightening */
@media (max-width: 720px) {
  .matrice-table { font-size: 0.74rem; }
  .matrice-table th, .matrice-table td { padding: 0.25rem 0.3rem; }
  .matrice-table .sticky { min-width: 78px; max-width: 92px; padding-left: 0.5rem; padding-right: 0.5rem; }
  .matrice-table th.m-th-theme { width: 28px; min-width: 28px; max-width: 28px; height: 160px; }
  .matrice-table .m-th-theme-label { max-height: 150px; }
  .matrice-table th.m-th-avg, .matrice-table th.m-th-spe { font-size: 0.65rem; }
  .matrice-wrap { max-height: calc(100dvh - 180px); min-height: 340px; }
}

/* === Graphique synthèse Notes === */
.notes-chart, .notes-synthese {
  margin-top: 1.8rem;
  padding: 1.2rem 1.4rem 1.4rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.notes-chart-title {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
}
.notes-chart-sub { margin: 0 0 1rem; font-size: 0.82rem; }
.notes-chart-svg-wrap { padding-top: 0.5rem; }
.notes-chart-svg { width: 100%; height: auto; display: block; }   /* à la largeur de son conteneur (viewBox) : jamais de défilement de côté */

/* Tabs de graphiques */
.chart-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--r-sm);
  margin-bottom: 0.5rem;
  width: fit-content;
}
.chart-tab {
  background: transparent;
  border: none;
  padding: 0.45rem 0.85rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: calc(var(--r-sm) - 2px);
  transition: background 0.15s, color 0.15s;
}
.chart-tab:hover { color: var(--text); }
.chart-tab.active {
  background: var(--bg-elev);
  color: var(--accent);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* === KPIs Synthèse === */
.notes-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 1.4rem;
}
.notes-kpi {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.75rem 0.9rem;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
}
.notes-kpi-value {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}
.notes-kpi-label {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
/* Sur un fond de niveau, le libellé prend le texte secondaire : le texte atténué n'y tenait pas 4,5:1 (3,96:1 sur le vert du niveau haut). */
.notes-kpi:is(.bad, .warn, .ok, .great) .notes-kpi-label { color: var(--text-soft); }
.notes-kpi.bad   { background: var(--note-bad-fond); }
.notes-kpi.bad   .notes-kpi-value { color: var(--note-bad-texte); }
.notes-kpi.warn  { background: var(--note-warn-fond); }
.notes-kpi.warn  .notes-kpi-value { color: var(--note-warn-texte); }
.notes-kpi.ok    { background: var(--note-ok-fond); }
.notes-kpi.ok    .notes-kpi-value { color: var(--note-ok-texte); }
.notes-kpi.great { background: var(--note-great-fond); }
.notes-kpi.great .notes-kpi-value { color: var(--note-great-texte); }

/* === Top 3 thèmes === */
.notes-rankings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 720px) {
  .notes-rankings { grid-template-columns: 1fr; }
}
.ranking-block { display: flex; flex-direction: column; gap: 0.4rem; }
.ranking-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
}
.ranking-title.weak   { color: var(--note-faible-titre); }
.ranking-title.strong { color: var(--note-ok-texte); }
.ranking-sub { margin: -0.2rem 0 0.3rem; font-size: 0.75rem; }

.theme-stat-card {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.7rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
}
.theme-stat-card.bad   { background: var(--note-bad-fond); }
.theme-stat-card.warn  { background: var(--note-warn-fond); }
.theme-stat-card.ok    { background: var(--note-ok-fond); }
.theme-stat-card.great { background: var(--note-great-fond); }
.theme-stat-card.bad   strong { color: var(--note-bad-texte); }
.theme-stat-card.warn  strong { color: var(--note-warn-texte); }
.theme-stat-card.ok    strong { color: var(--note-ok-texte); }
.theme-stat-card.great strong { color: var(--note-great-texte); }

.theme-stat-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  background: rgba(255,255,255,0.6);
  padding: 6px 8px;
  border-radius: var(--r-sm);
  text-align: center;
}
.theme-stat-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.theme-stat-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.theme-stat-meta { font-size: 0.74rem; color: var(--text-soft); font-family: var(--font); font-variant-numeric: tabular-nums; }

.m-name-btn.anon {
  font-style: italic;
  color: var(--text-muted);
  font-weight: 500;
}

/* Anonymat renforcé : ligne « Moyenne du groupe » (vue du stagiaire anonymisé)
   et mention sous la matrice (profils masqués / rappel de réciprocité). */
.m-row-group-avg td { border-top: 2px solid var(--line-moyenne); }
/* La cellule prénom est sticky et bornée à 110px : le libellé passe sur deux
   lignes dans la cellule (jamais en débordement sur la colonne Moy.). */
.m-row-group-avg .m-td-name {
  white-space: normal;
  background: var(--bg-subtle);
}
.m-group-avg-label {
  display: block;
  font-style: italic;
  font-weight: 600;
  font-size: 0.72rem;
  line-height: 1.2;
  color: var(--text-muted);
}
.matrice-anon-note { margin: 0.5rem 0 0; font-size: 0.82rem; }

/* === Vue détaillée stagiaire (modale) === */
.sd-modal { max-width: 540px; width: 100%; }
.sd-head { margin-bottom: 0.8rem; }
.sd-head h3 {
  margin: 0 0 0.3rem;
  font-family: var(--font-display);
  font-weight: var(--poids-titre-normal);
  font-size: 1.7rem;
}
.sd-body {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 0.3rem;
  margin: 0 -0.25rem 1rem;
}
.sd-avg {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.7rem 0.9rem;
  background: var(--bg-subtle);
  border-radius: var(--r);
  margin-bottom: 1rem;
}
.sd-avg.bad    { background: var(--c-stop-soft); }
.sd-avg.warn   { background: var(--c-wait-soft); }
.sd-avg.ok     { background: var(--act-cours); }
.sd-avg.great  { background: var(--c-go-soft); }
.sd-avg-num { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 2rem; font-weight: 700; line-height: 1; }
.sd-avg-max { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 1rem; color: var(--text-muted); }
.sd-avg-count { margin-left: auto; font-size: 0.78rem; }
.sd-avg.empty { padding: 1rem; justify-content: center; }

.sd-section-title {
  margin: 1.2rem 0 0.5rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.sd-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: var(--r-sm);
  border-bottom: 1px solid var(--line-faint);
}
.sd-row:hover { background: var(--bg-subtle); }

.sd-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sd-label-main { font-size: 0.88rem; font-weight: 500; line-height: 1.3; }
.sd-label-sub  { font-size: 0.72rem; line-height: 1.2; }

.sd-value {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  min-width: 44px;
  justify-content: flex-end;
}
.sd-value.editable { cursor: pointer; }
.sd-value.editable:hover .sd-note { transform: scale(1.1); }
.sd-note {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: var(--r-sm);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  transition: transform 0.12s;
}
.sd-note.empty { background: var(--bg-subtle); color: var(--text-muted); font-weight: 400; }
.sd-note.bad    { background: var(--c-stop-soft); color: var(--c-stop); }
.sd-note.warn   { background: var(--c-wait-soft); color: var(--c-wait); }
.sd-note.ok     { background: var(--act-cours); color: var(--act-cours-texte); }
.sd-note.great  { background: var(--c-go-soft); color: var(--c-go); }
.sd-edit-input {
  width: 60px;
  height: 32px;
  border: 2px solid var(--accent);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  text-align: center;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

/* ============================================================
   Audit log
   ============================================================ */

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
  margin: -0.25rem 0 0.5rem;
  padding-right: 0.25rem;
}

.audit-item {
  border-left: 3px solid var(--line);
  padding: 0.5rem 0.85rem;
  background: var(--bg-subtle);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}

.audit-item.insert { border-left-color: var(--c-go); }
.audit-item.update { border-left-color: var(--c-wait); }
.audit-item.delete { border-left-color: var(--c-stop); }

.audit-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.audit-action {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.audit-action.insert { color: var(--c-go); }
.audit-action.update { color: var(--c-wait); }
.audit-action.delete { color: var(--c-stop); }

.audit-time {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.audit-meta { font-size: 0.85rem; color: var(--text-soft); margin-bottom: 0.4rem; }

/* ============================================================
   Ressources
   ============================================================ */

.ressource-section {
  margin-bottom: 2rem;
}

.ressource-section-title {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}

.ressource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.85rem;
}

.ressource-card {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  color: inherit;
  text-decoration: none;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.ressource-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-2);
}

.ressource-card:hover .ressource-title { color: var(--accent); }

.ressource-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--bg-subtle);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ressource-icon .icon { width: 18px; height: 18px; }

.ressource-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ressource-title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: color 0.15s;
}

.ressource-badge {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ressource-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ressource-host {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  margin-top: 0.3rem;
  color: var(--text-muted);
}

.ressource-actions {
  display: flex;
  gap: 0.25rem;
  align-self: flex-start;
}

/* ============================================================
   Read-only mode (lecture seule du Planning)
   ⚠️ PORTÉE : uniquement `.p-days`, la zone des cartes. Ces règles visent les
   contrôles d'ÉDITION du planning, jamais la NAVIGATION. Tant que `.read-only`
   n'était posé que pour les stagiaires, la nuance ne se voyait pas ; depuis que
   la lecture seule est le mode par défaut (spec 2026-07-20), un sélecteur trop
   large neutralise aussi le champ de date de la barre de semaine, c'est arrivé,
   la navigation par mois était devenue impossible pour les formateurs.
   ============================================================ */

.read-only .p-days select,
.read-only .p-days input,
.read-only .p-days .chips-display {
  pointer-events: none;
  background: transparent !important;
  border-color: transparent !important;
  cursor: default !important;
}
.read-only .p-days select { background-image: none !important; padding-right: 0.4rem !important; }
.read-only .p-add-suite,
.read-only .p-add-parallele-mini,
.read-only .p-lane-delete,
.read-only .chips-display .x,
.read-only .sujet-chip-x,
.read-only .p-dice-btn,
/* ⊘ marquage d'absence : ajouté par la refonte absences du 20/07 sans rejoindre ce
   groupe, donc visible et cliquable côté stagiaire jusqu'au 20/07 (écriture bloquée
   par le backstop canEditWeek() + RLS, mais UI trompeuse). Gotcha récurrent : tout
   nouveau contrôle d'édition doit être ajouté ICI. */
.read-only .p-abs-btn,
/* × de retrait du formateur, même histoire (sélecteur maison, donc invisible aux
   règles génériques `select`/`input` du groupe ci-dessus). */
.read-only .p-prof-x,
.read-only .p-eleves-dice-toolbar,
.read-only .p-dice-picker-wrap,
.read-only .p-dice-picker { display: none !important; }
/* Le bandeau de demi-journée (MATIN/APRÈS-MIDI + horaires + pause) reste VISIBLE en
   lecture seule : le JS rend un div statique (non éditable) aux non-admins.
   Ne jamais le re-masquer ici, sans lui les demi-journées sont indistinguables. */
.read-only .p-half-head { cursor: default; }
/* Sélecteur de formateur : c'est une div `tabindex=0` qui ouvre un menu au clic, pas un
   <select>, donc les règles génériques plus haut ne l'atteignaient pas. En lecture seule
   il restait cliquable et ouvrait son menu (constaté 20/07). Neutralisé ici, et son menu
   forcé fermé au cas où il aurait été ouvert avant la bascule en lecture seule. */
.read-only .p-prof-display {
  pointer-events: none;
  background: transparent !important;
  border-color: transparent !important;
  cursor: default !important;
}
.read-only .p-prof-dropdown { display: none !important; }

/* ============================================================
   Toast
   ============================================================ */

.toast {
  /* Rien de cliquable dans le message : il laisse passer les touchers. Sinon, sur téléphone, le message du
     démarrage recouvrait pendant 6 s la ligne « Signaler un problème » qu'il désigne. */
  pointer-events: none;
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-deep);
  color: white;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r);
  box-shadow: var(--shadow-3);
  font-size: 0.88rem;
  font-weight: 500;
  /* Au-dessus de tout ce qui peut couvrir l'écran (.qcm-overlay 1000, formulaire 1100,
     bandeau d'aperçu 1500) : un toast invisible équivaut à une confirmation perdue. */
  z-index: 2000;
  border: 1px solid rgba(255,255,255,0.06);
  animation: toast-in 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.error { background: var(--c-stop); }
.toast.success { background: var(--accent); }

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ============================================================
   Loading
   ============================================================ */

.loading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 2.5rem 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

/* État d'erreur de vue (timeout réseau, etc.) avec bouton Réessayer */
.view-error-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  margin: 1rem auto;
  max-width: 440px;
}
.view-error-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.view-error-sub {
  margin: 0 0 0.6rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* ============================================================
   Responsive
   ============================================================ */

/* ============================================================
   Print / PDF, DOM dédié (rendu compact 1 page A4 paysage)
   ============================================================ */

@page {
  size: A4 landscape;
  margin: 6mm;
}

/* DOM d'impression rendu EN PERMANENCE, hors écran, pour rester MESURABLE : la mise à
   l'échelle automatique (fitPrintToPage en JS) a besoin de la hauteur réelle du contenu,
   impossible à obtenir avec display:none. Les règles de mise en page s'appliquent donc en
   continu au conteneur (caché hors écran) ; @media print ne fait plus que le basculer. */
#print-container {
  position: fixed;
  left: -9999px;          /* hors écran (px fixe : robuste quel que soit le viewport) */
  top: 0;
  /* Largeur FIXE (pas 100 %) : la mesure hors écran se fait à la MÊME largeur que
     l'impression → l'échelle calculée est exacte. 270mm ≤ largeur imprimable A4 paysage
     même avec les marges latérales d'iOS Safari (~271mm) → jamais de rognage horizontal. */
  width: 270mm;
  /* JS fixe une hauteur explicite (= hauteur VISUELLE après scale) ; overflow:hidden rend
     cette hauteur autoritaire pour la pagination d'impression, car `transform: scale` ne
     réduit pas la boîte de layout (sinon certains navigateurs pagineraient sur la taille
     non-scalée → 2 pages malgré le rendu réduit). */
  overflow: hidden;
  pointer-events: none;
}

/* Reset, police chargée par l'app (Outfit) → rendu identique sur tous les OS. */
#print-container .print-root,
#print-container .print-root * {
  color: #000;
  font-family: "Outfit", -apple-system, "Segoe UI", Roboto, sans-serif;
}

.print-root {
  width: 100%;
  /* Pas de max-width : fitPrintToPage pré-élargit (>100%) avant de scaler pour garder la
     pleine largeur ; un max-width:100% l'écraserait. */
  /* Plancher de hauteur (évite un rendu minuscule sur une semaine quasi vide). La hauteur
     CIBLE réelle est gérée en JS (PRINT_FIT_MM, par plateforme) qui réduit le contenu via
     `transform: scale` pour ne jamais dépasser → 1 seule page partout, automatiquement. */
  min-height: 140mm;
  display: flex;
  flex-direction: column;
  page-break-after: avoid;
}

  /* En-tête */
  .pp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4mm;
    padding-bottom: 2mm;
    border-bottom: 1.5px solid #000;
  }
  .pp-title {
    font-size: 14pt;
    font-weight: 600;
    letter-spacing: -0.01em;
  }
  .pp-week {
    font-size: 10pt;
    color: var(--doc-texte-doux);
    font-variant: small-caps;
  }

  /* Grille 5 colonnes de jours, 2 demi-journées par jour.
     flex:1 + lignes en minmax(0,1fr) → la grille absorbe la hauteur restante et
     les colonnes-jours s'étirent jusqu'en bas de la page (occupe l'espace). */
  .pp-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: 0.3mm;   /* écart quasi nul entre jours : les bordures suffisent → colonnes plus larges */
  }

  .pp-day {
    display: flex;
    flex-direction: column;
    border: 0.7px solid var(--doc-trait-fort);
    border-radius: 2mm;
    overflow: hidden;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Jour désactivé / férié à l'impression : grisé, bandeau, aucune activité */
  .pp-day.off .pp-day-head { background: var(--doc-repos-fond-fort) !important; }
  .pp-day-off {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2mm;
    padding: 6mm 2mm;
    background: var(--doc-repos-fond) !important;
    color: var(--doc-repos-texte) !important;
    text-align: center;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .pp-day-off .pp-day-off-tag {
    font-size: 7.5pt; font-weight: 800; letter-spacing: 0.1em;
    padding: 0.4mm 2mm; border-radius: 1mm;
    background: var(--doc-repos-texte) !important; color: #fff !important;
    print-color-adjust: exact; -webkit-print-color-adjust: exact;
  }
  .pp-day-off > span:last-child { font-size: 9pt; font-weight: 700; color: var(--doc-repos-texte-fort) !important; }

  .pp-day-head {
    background: var(--doc-texte-fort) !important;
    color: white !important;
    padding: 1.6mm 2.4mm;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .pp-day-head .pp-day-name { font-size: 11pt; font-weight: 600; color: white !important; }
  .pp-day-head .pp-day-date { font-size: 8.5pt; color: rgba(255,255,255,0.7) !important; }

  .pp-half { border-top: 0.5px solid var(--doc-trait-doux); }
  .pp-half:first-child { border-top: none; }

  .pp-half-head {
    display: flex;
    align-items: center;
    gap: 1.5mm;
    padding: 1mm 2.2mm;
    background: var(--doc-fond-doux) !important;
    border-bottom: 0.4px solid var(--doc-filet);
    font-size: 8.3pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    flex-wrap: wrap;
  }
  .pp-half-tag {
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.4mm 1.4mm;
    border-radius: 1mm;
    font-size: 7.8pt;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .pp-half-tag.matin { background: var(--doc-matin-fond) !important; color: var(--doc-matin-texte) !important; }
  .pp-half-tag.aprem { background: var(--doc-aprem-fond) !important; color: var(--doc-aprem-texte) !important; }
  .pp-half-hours { font-family: "Geist Mono", monospace; color: var(--doc-texte-doux); font-size: 8.3pt; }
  .pp-half-pause { color: var(--doc-pause) !important; font-weight: 500; font-size: 7.8pt; }

  /* Slots : empilés verticalement dans une demi-journée */
  .pp-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    grid-auto-flow: column;
    gap: 0.3mm;
    border-bottom: 0.3px dashed var(--doc-filet);
  }
  .pp-row:last-child { border-bottom: none; }

  .pp-cell {
    padding: 1.5mm 2.2mm;
    font-size: 8.7pt;
    line-height: 1.27;
    border-right: 0.3px dashed var(--doc-filet);
    min-width: 0;
  }
  .pp-cell:last-child { border-right: none; }
  .pp-cell[data-activite="Cours"]              { background: var(--doc-cours-fond) !important; }
  .pp-cell[data-activite="Pédagogie salle"]    { background: var(--doc-peda-fond) !important; }
  .pp-cell[data-activite="Voiture (conduite)"] { background: var(--doc-voiture-fond) !important; }
  .pp-cell[data-activite="Contrôle"]           { background: var(--doc-controle-fond) !important; }

  .pp-cell-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5mm 1.5mm;
    margin-bottom: 0.5mm;
    flex-wrap: wrap;
  }
  .pp-act { font-weight: 700; font-size: 9.6pt; letter-spacing: -0.01em; min-width: 0; overflow-wrap: anywhere; }
  .pp-act.muted { color: var(--doc-texte-pale); font-weight: 400; }
  .pp-prof { font-size: 8.3pt; color: var(--doc-texte-doux); font-style: italic; }

  /* Les longs contenus (noms multiples, sujets) cassent au lieu de déborder/être rognés. */
  .pp-sujet, .pp-line, .pp-val, .pp-notes { overflow-wrap: anywhere; }

  .pp-sujet { font-size: 8.7pt; color: var(--doc-texte-fort); line-height: 1.24; margin-bottom: 0.6mm; }
  /* Thèmes abordés : un par ligne, numéro en tête (gras, accent mint). */
  .pp-theme { display: flex; gap: 1.2mm; align-items: baseline; }
  .pp-theme + .pp-theme { margin-top: 0.3mm; }
  .pp-theme-num { flex: none; font-weight: 700; color: var(--doc-theme-num) !important; font-variant-numeric: tabular-nums; }
  /* Étiquette de groupe (G1/G2) devant le sujet d'une salle 2 groupes */
  .pp-theme-grp { flex: none; font-weight: 700; font-size: 7.5pt; color: var(--doc-texte-doux); }
  .pp-theme-titre { min-width: 0; overflow-wrap: anywhere; }
  .pp-line { font-size: 8.3pt; line-height: 1.25; color: var(--doc-texte); }
  .pp-key { color: var(--doc-texte-gris); }
  .pp-val { color: #000; }
  .pp-notes { color: var(--doc-texte-doux); font-style: italic; margin-top: 0.6mm; }
  /* Élèves listés un par ligne, légèrement indentés sous leur label. */
  .pp-eleve { padding-left: 2.4mm; color: #000; }
  /* Bénévoles (voiture) : italique pour les distinguer des élèves moniteurs. */
  .pp-benevole { font-style: italic; color: var(--doc-texte); }

  .pp-empty { padding: 1.7mm 2.2mm; color: var(--doc-vide); font-size: 8.3pt; font-style: italic; }

  .pp-footer {
    margin-top: 3mm;
    text-align: right;
    font-size: 8.5pt;
    color: var(--doc-trait-doux);
    font-style: italic;
  }
  /* Ligne diagnostic (remplie par fitPrintToPage) : volontairement quasi invisible sur le
     papier, mais lisible sur une photo de l'aperçu pour débugger une machine à distance. */
  .pp-diag {
    color: var(--doc-texte-efface);
    font-size: 6.5pt;
    font-style: normal;
  }

/* Bascule écran → impression : on masque l'app et on remet le conteneur d'impression
   (sinon caché hors écran) en flux normal, pleine largeur imprimable. La mise à l'échelle
   (transform sur .print-root) est posée en inline par JS et persiste ici. */
@media print {
  body.planning-printable > *:not(#print-container) { display: none !important; }
  body.planning-printable { background: #fff; }
  html, body.planning-printable { height: auto; }
  body.planning-printable #print-container {
    position: static;
    left: auto;
    top: auto;
    margin: 0 auto;        /* largeur fixe (270mm) centrée dans la zone imprimable */
    pointer-events: auto;
    /* Hauteur de coupe calculée par le MOTEUR au moment du print (mm → px du contexte
       d'impression), indépendante du px figé côté écran : même si le rendu print diffère
       de la mesure écran (polices, pilote…), la coupe reste au budget par plateforme
       (--print-clip posé par ensurePrintContainer) → headroom + toujours 1 seule page. */
    height: var(--print-clip, 188mm) !important;
  }
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 760px) {
  main { padding: 1.25rem 1rem 4rem; }

  .passages-table { font-size: 0.82rem; }
  .passages-table th, .passages-table td { padding: 0.5rem 0.6rem; }

  .view-header { flex-direction: column; align-items: flex-start; }
  h2, .home-title-v2 { font-size: 1.4rem; }

  .dashboard-meta {
    flex-wrap: wrap;
    gap: 0.9rem 1.5rem;
    padding-bottom: 1rem;
  }
}

/* ============================================================
   QCM, puce (liste), bloc modale, player plein écran
   ============================================================ */

/* Puce d'entraînement sous le titre du thème */
.theme-qcm-hint {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  margin-top: 0;
  padding: 5px 12px;
  border: 1px solid var(--accent-soft-2);
  background: var(--accent-soft);
  color: var(--accent-strong);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.theme-qcm-hint:hover { background: var(--accent-soft-2); border-color: var(--accent); }
.theme-qcm-hint .icon { width: 15px; height: 15px; }

/* Colonne QCM dédiée (vue Thèmes, fondateur uniquement via .qcm-on) */
.theme-qcm-cell { display: flex; align-items: center; min-width: 0; }
.theme-qcm-cell .theme-qcm-hint { align-self: center; margin-top: 0; }
/* Sans la colonne notes, la place revient au QCM (bouton + notes d'examen
   et d'entraînement respirent). */
.themes-list.qcm-on .theme-row {
  grid-template-columns: 50px 1.2fr 120px 80px minmax(170px, 0.8fr) 36px;
}
@media (max-width: 720px) {
  /* On garde la mise en page mobile (grid-areas héritées) ; on neutralise juste
     la grille 6 colonnes desktop et on place la cellule QCM sous la date. */
  .themes-list.qcm-on .theme-row { grid-template-columns: 36px 1fr auto auto; }
  .themes-list.qcm-on .theme-row .theme-qcm-cell {
    grid-column: 2 / -1; grid-row: 3; justify-self: start; margin-top: 0.4rem;
  }
}

/* Overlay plein écran */
body.qcm-open { overflow: hidden; }
.qcm-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--ombre-voile-fort);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  display: flex; justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
}
.qcm-player {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  width: 100%; max-width: 640px;
  margin: auto 0;
  padding: 1.2rem 1.3rem 1.5rem;
}

.qcm-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.8rem; margin-bottom: 1rem; }
.qcm-head-text { min-width: 0; }
.qcm-badge {
  display: inline-block;
  background: var(--accent); color: #fff;
  font-size: 0.64rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; margin-bottom: 0.4rem;
}
.qcm-head-title { margin: 0; font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.qcm-head-sub { margin: 0.2rem 0 0; font-size: 0.74rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.qcm-close {
  flex-shrink: 0;
  background: var(--bg-subtle); border: 1px solid var(--line);
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; cursor: pointer; color: var(--text-soft);
}
.qcm-close:hover { background: var(--c-stop-soft); color: var(--c-stop); }
.qcm-close .icon { width: 18px; height: 18px; }

.qcm-progress-wrap { margin-bottom: 1.1rem; }
.qcm-progress-info { display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 6px; }
.qcm-progress { height: 7px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.qcm-progress-fill { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.35s ease; }

.qcm-question { font-size: 1.08rem; font-weight: 600; line-height: 1.45; margin: 0 0 1rem; }
.qcm-multi-hint { margin: -0.5rem 0 0.9rem; font-size: 0.82rem; font-weight: 600; color: var(--accent-strong); }
.qcm-question-img { display: block; max-width: 100%; height: auto; margin: 0 0 1rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.qcm-recap-img { display: block; max-width: 150px; height: auto; margin: 0.35rem 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.qcm-choices { display: flex; flex-direction: column; gap: 0.5rem; }
.qcm-choice {
  display: flex; align-items: flex-start; gap: 0.7rem;
  width: 100%; text-align: left;
  padding: 0.8rem 0.9rem;
  border: 2px solid var(--line); border-radius: 10px;
  background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: 0.96rem; line-height: 1.4;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.qcm-choice:hover:not(.disabled) { border-color: var(--accent); background: var(--accent-soft); }
.qcm-choice-letter {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--bg-subtle); border: 2px solid var(--line);
  font-weight: 700; font-size: 0.8rem; color: var(--text-soft);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.qcm-choice-text { padding-top: 1px; }
.qcm-choice.disabled { cursor: default; }
.qcm-choice.correct { border-color: var(--c-go); background: var(--c-go-soft); }
.qcm-choice.correct .qcm-choice-letter { background: var(--c-go); border-color: var(--c-go); color: #fff; }
.qcm-choice.wrong { border-color: var(--c-stop); background: var(--c-stop-soft); }
.qcm-choice.wrong .qcm-choice-letter { background: var(--c-stop); border-color: var(--c-stop); color: #fff; }

.qcm-explain { margin-top: 0.8rem; padding: 0.7rem 0.85rem; border-radius: 9px; font-size: 0.88rem; line-height: 1.5; }
.qcm-explain.ok { background: var(--c-go-soft); border-left: 3px solid var(--c-go); color: var(--accent-strong); }
.qcm-explain.ko { background: var(--c-stop-soft); border-left: 3px solid var(--c-stop); color: var(--c-stop); }

.qcm-next { margin-top: 1.1rem; width: 100%; }

/* Résultats */
.qcm-results { text-align: center; margin-bottom: 1rem; }
.qcm-score-circle {
  width: 128px; height: 128px; border-radius: 50%;
  border: 7px solid var(--accent);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin: 0.5rem auto 0.8rem; color: var(--accent-strong);
}
.qcm-score-big { font-size: 1.9rem; font-weight: 800; line-height: 1; }
.qcm-score-circle small { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }
.qcm-results-sub { margin: 0; color: var(--text-muted); }

.qcm-recap { border-top: 1px solid var(--line); margin-top: 0.5rem; }
.qcm-recap-item { display: flex; gap: 0.6rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line-faint); align-items: flex-start; }
.qcm-recap-mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: #fff; }
.qcm-recap-item.ok .qcm-recap-mark { background: var(--c-go); }
.qcm-recap-item.ko .qcm-recap-mark { background: var(--c-stop); }
.qcm-recap-body { min-width: 0; }
.qcm-recap-q { margin: 0; font-size: 0.88rem; font-weight: 500; line-height: 1.4; }
.qcm-recap-a { margin: 0.2rem 0 0; font-size: 0.82rem; color: var(--accent-strong); }

.qcm-actions { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.qcm-actions .btn { flex: 1; }

@media (max-width: 600px) {
  .qcm-player { padding: 1rem 1rem 1.3rem; border-radius: var(--r); }
  .qcm-question { font-size: 1rem; }
  .qcm-choice { font-size: 0.92rem; padding: 0.75rem 0.8rem; }
}

/* ============================================================
   Fondateur, « Voir en tant que » (aperçu de rôle)
   ============================================================ */

/* Sélecteur dans le menu profil */
.view-as-block { margin: 0.2rem 0 1rem; }
.view-as-seg {
  /* Cinq boutons pour le fondateur : ils passent à la ligne plutôt que de déborder (jamais de défilement de côté). */
  display: flex; flex-wrap: wrap; gap: 0.3rem;
  background: var(--bg-subtle); padding: 3px; border-radius: 10px;
}
.view-as-btn {
  flex: 1 1 5.5rem; padding: 0.5rem 0.4rem;
  border: none; background: transparent; border-radius: 8px;
  font: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text-soft); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.view-as-btn:hover:not(.active) { color: var(--text); }
.view-as-btn.active {
  background: var(--bg-elev); color: var(--accent-strong);
  font-weight: 600; box-shadow: var(--shadow-1);
}

/* Formateur et direction : une seule ligne, « Voir comme un stagiaire » / « Quitter l'aperçu ». */
.view-as-ligne {
  width: 100%; min-height: 44px; padding: 0.5rem 0.8rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-subtle);
  font: inherit; font-size: 0.9rem; font-weight: 500; color: var(--text); cursor: pointer;
}
.view-as-ligne:hover { background: var(--bg-elev); }
.promo-choix-apercu { margin-top: 0.6rem; min-height: 44px; }
/* Choix « Titre » de l'aperçu (fondateur, étape 3) : les boutons passent à la ligne, 44 px à toute taille. */
.view-as-titre { margin-top: 0.6rem; }
.view-as-titre-label { margin: 0 0 0.3rem; font-size: 0.82rem; }
.view-as-titre-btn { min-height: 44px; overflow-wrap: anywhere; }
@media (max-width: 699.98px) {
  .view-as-btn { min-height: 44px; }
}

/* Bandeau permanent d'aperçu */
.impersonation-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 1500;
  display: flex; align-items: center; gap: 0.7rem;
  max-width: calc(100vw - 24px);
  background: var(--bg-deep); color: #fff;
  padding: 0.45rem 0.5rem 0.45rem 0.9rem;
  border-radius: 999px;
  box-shadow: var(--shadow-3);
  font-size: 0.85rem;
}
.impersonation-banner .imp-eye { display: inline-flex; align-items: center; flex: none; }
.impersonation-banner .imp-eye .icon { width: 1.1rem; height: 1.1rem; }
.impersonation-banner .imp-text { white-space: nowrap; }
.impersonation-banner strong { font-weight: 600; }
.impersonation-banner .imp-back {
  background: var(--accent); color: #fff; border: none;
  padding: 0.35rem 0.75rem; border-radius: 999px;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; white-space: nowrap;
}
.impersonation-banner .imp-back:hover { background: var(--accent-strong); }

/* === Examen (Lot 2) === */
.qcm-badge.exam { background: var(--c-stop-soft); color: var(--c-stop); }

.qcm-timer {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 12px;
  align-self: center;
}
.qcm-timer.low { color: var(--c-stop); background: var(--c-stop-soft); }

.qcm-prescreen { text-align: center; padding: 0.6rem 0; }
.qcm-prescreen-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 0.9rem; }
.qcm-prescreen-list {
  list-style: none; padding: 0; margin: 0 auto 0.9rem; max-width: 320px;
  text-align: left; display: flex; flex-direction: column; gap: 0.5rem;
}
.qcm-prescreen-list li {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 10px; padding: 0.6rem 0.8rem; font-size: 0.92rem;
}

.qcm-choice.selected { border-color: var(--accent); background: var(--accent-soft-2); box-shadow: inset 0 0 0 1px var(--accent); }
.qcm-choice.selected .qcm-choice-letter { background: var(--accent); border-color: var(--accent); color: #fff; }

.qcm-exam-nav { display: flex; gap: 0.6rem; margin-top: 1rem; }
.qcm-exam-nav .btn { flex: 1; }
.qcm-exam-nav .btn:disabled { opacity: 0.45; cursor: default; }

.qcm-exam-grid {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.9rem;
  justify-content: center;
}
.qcm-grid-dot {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg-elev);
  font-size: 0.8rem; font-weight: 600; cursor: pointer; color: var(--text-muted);
}
.qcm-grid-dot.done { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.qcm-grid-dot.current { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Téléphone : cibles de 44 px (référentiel, critère G) pour les boutons du QCM (avant l'examen, pendant, à la fin) et les
   numéros des questions. */
@media (max-width: 720px) {
  .qcm-actions .btn, .qcm-exam-nav .btn, .qcm-next { min-height: 44px; }
  .qcm-grid-dot { width: 44px; height: 44px; }
}

.theme-exam-panel { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.theme-exam-panel-title {
  margin: 0 0 0.5rem; font-size: 0.74rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700;
}
.theme-exam-status { margin: 0 0 0.6rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.exam-badge {
  font-size: 0.72rem; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.exam-badge.on  { background: var(--c-go-soft); color: var(--c-go); }
.exam-badge.off { background: var(--bg-subtle); color: var(--text-muted); }

.theme-exam-actions { display: flex; flex-direction: column; gap: 0.45rem; }
.theme-exam-actions .btn { width: 100%; }

.exam-pick-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 0.35rem; margin: 0.5rem 0; }
.exam-pick-item { display: flex; gap: 0.5rem; align-items: flex-start; font-size: 0.88rem; padding: 0.35rem; }
.exam-pick-item input { margin-top: 3px; flex-shrink: 0; }

.exam-attempts-list { display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.exam-attempt-row {
  display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
  font-size: 0.9rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line-faint);
}

/* Panneau formateur : mise en ligne (brouillon) vs gestion (en ligne) */
.theme-exam-draw-line { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; font-size: 0.9rem; }
.theme-exam-draw-line input { width: 70px; }

/* Cellule QCM de la liste (bouton + mes notes) + fiche QCM dédiée */
.theme-qcm-cell2 { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; padding: 2px 0; }
.qcm-note-pills { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; }
.qcm-note-pill { font-size: 0.74rem; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
/* Notes de la cellule en texte étiqueté (plus de pastilles répétées) */
.qcm-cell-notes { display: flex; flex-direction: column; gap: 1px; align-self: stretch; }
.qcm-cell-note-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.7rem; line-height: 1.15; }
.qcm-cell-note-lab { color: var(--text-muted); }
.qcm-cell-note-val { font-weight: 700; font-variant-numeric: tabular-nums; }
.qcm-cell-note-val.is-muted { color: var(--text-muted); font-weight: 600; }
.qcm-cell-note-val.n-great { color: var(--c-go); }
.qcm-cell-note-val.n-ok { color: var(--accent-strong); }
.qcm-cell-note-val.n-mid { color: var(--note-mid-texte); }
.qcm-cell-note-val.n-low { color: var(--c-stop); }
.qcm-cell-note-val.n-none { color: var(--text-muted); }
.qcm-note-pill.exam { background: var(--accent-soft-2); color: var(--accent-strong); }
.qcm-note-pill.train { background: var(--bg-subtle); color: var(--text-muted); }
.qcm-sheet-body { display: flex; flex-direction: column; }
.qcm-sheet-notes {
  display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.9rem;
  padding: 0.6rem 0.8rem; background: var(--bg-elev); border: 1px solid var(--line); border-radius: 10px;
}
.qcm-note-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.9rem; }
.qcm-note-line strong { color: var(--accent-strong); }

/* Grandes cartes de notes (fiche QCM) : lacunes visibles d'un coup d'œil */
.qcm-note-cards { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.qcm-note-card {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 0.9rem 0.5rem; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-elev);
}
.qcm-note-card-val { font-size: 1.7rem; font-weight: 800; line-height: 1; }
.qcm-note-card-lab { font-size: 0.72rem; color: var(--text-muted); text-align: center; }
.qcm-note-card.n-great { background: var(--c-go-soft); border-color: var(--c-go-soft); }
.qcm-note-card.n-great .qcm-note-card-val { color: var(--c-go); }
.qcm-note-card.n-ok { background: var(--accent-soft); border-color: var(--accent-soft); }
.qcm-note-card.n-ok .qcm-note-card-val { color: var(--accent-strong); }
.qcm-note-card.n-mid { background: var(--note-mid-fond); border-color: var(--note-mid-fond); }
.qcm-note-card.n-mid .qcm-note-card-val { color: var(--note-mid-texte); }
.qcm-note-card.n-low { background: var(--c-stop-soft); border-color: var(--c-stop-soft); }
.qcm-note-card.n-low .qcm-note-card-val { color: var(--c-stop); }
.qcm-note-card.n-none .qcm-note-card-val { color: var(--text-muted); }

/* Pills de note colorées (cellule QCM de la liste) */
.qcm-note-pill.n-great { background: var(--c-go-soft); color: var(--c-go); }
.qcm-note-pill.n-ok { background: var(--accent-soft); color: var(--accent-strong); }
.qcm-note-pill.n-mid { background: var(--note-mid-fond); color: var(--note-mid-texte); }
.qcm-note-pill.n-low { background: var(--c-stop-soft); color: var(--c-stop); }

/* Modale « Modifier l'examen » (formateur) */
.config-section { margin-bottom: 0.9rem; }
.config-label { margin: 0 0 0.4rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); font-weight: 700; }
.config-field { display: flex; flex-direction: column; gap: 4px; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; max-width: 220px; }
.config-field input { width: 100%; }

/* === Mémo des règles de placement (planning) === */
.planning-rules { margin: 0.6rem 0 0.2rem; background: var(--bg-subtle); border: 1px solid var(--line); border-radius: var(--r); padding: 0.55rem 0.9rem; font-size: 0.9rem; }
.planning-rules > summary { cursor: pointer; font-weight: 600; color: var(--text-muted); list-style: none; }
.planning-rules > summary .icon { margin-right: 0.4rem; vertical-align: -0.15em; }   /* l'icône d'aide (lot E) */
.planning-rules > summary::-webkit-details-marker { display: none; }
.planning-rules[open] > summary { margin-bottom: 0.5rem; color: var(--text); }
.planning-rules-body p { margin: 0.55rem 0 0.2rem; }
.planning-rules-body ul { margin: 0.1rem 0 0.4rem; padding-left: 1.2rem; }
.planning-rules-body li { margin: 0.15rem 0; line-height: 1.4; }
.planning-rules-foot { margin-top: 0.7rem; padding-top: 0.5rem; border-top: 1px dashed var(--line); color: var(--text-muted); font-style: italic; }

/* ===== Mon suivi ===== */
.ms-body { display: flex; flex-direction: column; gap: 2rem; margin-top: 1.5rem; }
.ms-section-title { margin: 0 0 0.9rem; font-size: 1.05rem; }
.ms-empty { padding: 1.5rem 0; }

.ms-passage-list { display: flex; flex-direction: column; gap: 0.6rem; }
.ms-passage {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.75rem 1rem; border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-elev);
}
/* Créneau où le stagiaire est seulement élève : même gabarit, fond en retrait. */
.ms-passage.eleve { background: transparent; }
.ms-passage.past { opacity: 0.5; }
.ms-passage.today { border-color: var(--accent); }
.ms-passage.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.ms-passage-when { display: flex; flex-direction: column; gap: 0.15rem; }
.ms-passage-day { font-weight: 600; }
.ms-passage-half { font-size: 0.85rem; }
.ms-passage-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.ms-passage-sujet { font-size: 0.85rem; }
.ms-passage-prof { font-size: 0.85rem; }
.ms-passage-badge { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ms-passage-badge.today, .ms-passage-badge.next { color: var(--accent-strong); font-weight: 600; }

.ms-chart-outer { position: relative; }
/* La sonde : un bloc sans hauteur de la largeur du graphe, que le ResizeObserver de js/views/mon-suivi.js observe pour dessiner le graphe à la largeur de son conteneur. */
.ms-chart-sonde { height: 0; }
.ms-chart-wrap { width: 100%; }
.ms-chart { display: block; width: 100%; max-width: 760px; height: auto; }   /* à la largeur de son conteneur (viewBox) : jamais de défilement de côté */
.ms-month-band { fill: var(--bg-subtle); opacity: 0.55; }
.ms-grid { stroke: var(--line); stroke-width: 1; }
.ms-axis-label { fill: var(--text-muted); font-size: 12px; }
.ms-axis-label.small { font-size: 10px; }
.ms-avg-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
/* Le point visible ne capte rien : c'est .ms-pt-hit (transparent, plus large) qui
   reçoit survol et tap, indispensable pour viser au doigt sur mobile. */
.ms-pt { stroke: var(--bg-elev); stroke-width: 1.5; pointer-events: none; }
.ms-pt-hit { fill: transparent; stroke: none; cursor: pointer; }
/* L'échelle douce des notes (pêche, abricot, verts), partagée par les points de Mon évolution et les barres des
   graphes de Notes : jamais un rouge. */
.ms-pt.bad,   .notes-bar.bad   { fill: var(--c-stop); }
.ms-pt.warn,  .notes-bar.warn  { fill: var(--note-warn-point); }
.ms-pt.ok,    .notes-bar.ok    { fill: var(--note-ok-point); }
.ms-pt.great, .notes-bar.great { fill: var(--c-go); }
.ms-pt.hover { stroke: var(--text); stroke-width: 2.5; }
.ms-chart-legend { margin: 0.5rem 0 0; font-size: 0.85rem; }

/* Tooltip stylé du graphe (suit le point survolé) */
.ms-tip {
  position: absolute;
  /* Horizontal : géré + clampé en JS (left en px). Ici, décalage vertical seul. */
  transform: translateY(calc(-100% - 10px));
  background: var(--text);
  color: var(--bg-elev);
  padding: 0.4rem 0.6rem;
  border-radius: var(--r-sm);
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 240px;
  pointer-events: none;
  z-index: 5;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}
.ms-tip.below { transform: translateY(12px); }
.ms-tip-lib { font-weight: 600; }
.ms-tip-date { opacity: 0.7; margin-top: 0.1rem; }

/* Historique voiture : tuiles + barres par formateur */
.histo-stats { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 0.9rem; }
.histo-stat { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.5rem 0.8rem; min-width: 5rem; }
.histo-stat-value { font-size: 1.3rem; font-weight: 700; }
.histo-stat-label { font-size: 0.78rem; color: var(--text-muted); }
.histo-profs-title { font-size: 0.85rem; font-weight: 600; margin: 0.2rem 0 0.5rem; }
.histo-prof-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.histo-prof-nom { flex: 0 0 5.5rem; font-size: 0.88rem; }
.histo-prof-bar { flex: 1; height: 8px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; }
.histo-prof-bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.histo-prof-n { flex: 0 0 auto; font-size: 0.82rem; }

/* ===== Mon suivi, historique ===== */
.suivi-histo { background: var(--bg-subtle); border-radius: var(--r); padding: 0.9rem 1.1rem; }

/* ===== Sous-onglets (navigation interne à une vue : Mon suivi, Notes…) ===== */
.subtabs-bar {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}
.subtab {
  appearance: none;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
}
.subtab:hover { color: var(--text); }
.subtab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ===== EPCF ===== */
.epcf-table-wrap { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.epcf-table { width: 100%; border-collapse: collapse; }
.epcf-table th, .epcf-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); text-align: left; }
.epcf-statut { font-size: 0.82rem; margin-right: 0.4rem; }
.epcf-statut.ok { color: var(--c-go); }

.epcf-form-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.epcf-form-head h3 { margin: 0; }
.epcf-form-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.epcf-form-meta .field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
.epcf-form-meta input, .epcf-form-meta select { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; background: var(--bg-elev); color: var(--text); }
.epcf-form-section, .epcf-form-comment { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 0.7rem 0.9rem; margin-bottom: 0.8rem; }
.epcf-form-section h4, .epcf-form-comment h4 { margin: 0 0 0.6rem; font-size: 0.95rem; }
.epcf-form-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-top: 1px dashed var(--line); }
.epcf-form-row:first-of-type { border-top: none; }
.epcf-form-lib { flex: 1; font-size: 0.9rem; }
.epcf-seg { display: flex; gap: 0.25rem; flex-shrink: 0; }
.epcf-seg-btn { padding: 0.25rem 0.55rem; font-size: 0.78rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); color: var(--text-muted); cursor: pointer; }
.epcf-seg-btn.active.A  { background: var(--c-go);  border-color: var(--c-go);  color: #fff; }
.epcf-seg-btn.active.R  { background: var(--note-warn-point);      border-color: var(--note-warn-point);      color: #fff; }
.epcf-seg-btn.active.NA { background: var(--c-stop); border-color: var(--c-stop); color: #fff; }
.epcf-form-comps { margin: 0.8rem 0; }
.epcf-comp-cb { margin-right: 1.2rem; }
.epcf-commentaire-ta { width: 100%; box-sizing: border-box; resize: vertical; padding: 0.5rem 0.7rem; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; background: var(--bg-elev); color: var(--text); }

.epcf-radar-wrap { max-width: 420px; margin: 0 auto; }
.epcf-radar { width: 100%; height: auto; display: block; }
.epcf-radar-ring { fill: none; stroke: var(--line); }
.epcf-radar-spoke { stroke: var(--line); }
.epcf-radar-label { fill: var(--text-muted); font-size: 11px; }
.epcf-radar-serie.moi { fill: var(--graphe-radar-moi); stroke: var(--accent); stroke-width: 2; }
.epcf-radar-serie.groupe { fill: none; stroke: var(--text-muted); stroke-width: 1.5; stroke-dasharray: 4 3; }
.epcf-legende { text-align: center; font-size: 0.82rem; }
.epcf-leg { display: inline-block; width: 14px; height: 3px; vertical-align: middle; margin-right: 4px; }
.epcf-leg.moi { background: var(--accent); }
.epcf-leg.groupe { background: var(--text-muted); }

.epcf-chip { display: inline-block; min-width: 5.5rem; text-align: center; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
/* Le texte de chaque pastille : celui de l'échelle des notes, 4,8:1 au moins sur son voile, sur la page comme sur une rangée de tableau
   (le statut et le point d'avant n'en tenaient que 3,9 et 2,2:1). */
.epcf-chip.A  { background: var(--c-go-voile); color: var(--note-ok-texte); }
.epcf-chip.R  { background: var(--note-warn-voile); color: var(--note-warn-texte); }
.epcf-chip.NA { background: var(--c-stop-voile); color: var(--note-bad-texte); }
.epcf-chip.vide { background: var(--bg-subtle); color: var(--text-muted); }

.epcf-actions { margin: 1rem 0 2rem; }
.epcf-detail { margin-top: 0.5rem; }
/* border-left transparent par défaut ; la couleur de phase est posée en inline (JS). */
.epcf-detail-section { margin-top: 0.9rem; border-left: 3px solid transparent; padding-left: 0.7rem; }
.epcf-detail-title { margin: 0 0 0.4rem; font-size: 0.9rem; }
.epcf-detail-tp { font-weight: 400; font-size: 0.8rem; }
.epcf-detail-row { display: flex; align-items: baseline; gap: 0.6rem; padding: 0.2rem 0; font-size: 0.88rem; }
.epcf-comps, .epcf-commentaire { margin-top: 0.8rem; font-size: 0.9rem; }
.epcf-resti { margin-bottom: 1.6rem; }
.epcf-resti-title { margin: 0 0 0.5rem; }
.epcf-eval-select-wrap { margin-bottom: 0.6rem; }
.epcf-eval-select { padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-sm); font: inherit; background: var(--bg-elev); color: var(--text); }
.epcf-eval-meta { font-size: 0.82rem; }
.epcf-classe-trame { margin-bottom: 2rem; }
.epcf-classe-lib { font-size: 0.85rem; overflow-wrap: anywhere; }
.epcf-classe-phase td { background: var(--bg-subtle); }

/* ===== EPCF, responsive mobile. Bloc SÉPARÉ du @media principal (plus haut dans le
   fichier) : placé APRÈS les règles EPCF pour gagner la cascade à spécificité égale.
   Toute règle mobile EPCF doit venir ICI, jamais dans le @media principal (sinon la
   règle d'ici l'écraserait silencieusement). Même seuil maison : 760px. ===== */
@media (max-width: 760px) {
  .epcf-form-row { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .epcf-seg { align-self: flex-end; }
  .epcf-radar-label { font-size: 14px; }  /* unités du viewBox : compense l'échelle ~0.8 à 375px → ~11px affichés */
}

/* === Absence annoncée par le stagiaire (espace contact, tâche 16) : une marque à côté du nom === */
.marque-absence { font-size: 0.78rem; font-weight: 600; color: var(--c-wait); white-space: normal; }

/* === Absences de derniere minute (spec 2026-07-19) === */
.chip.chip-absent { text-decoration: line-through; background: var(--c-stop-soft); color: var(--c-stop); }
.chip.chip-clickable { cursor: pointer; }
.role-absent .person-value { text-decoration: line-through; color: var(--c-stop); }
.p-abs-btn { background: none; border: 1px solid transparent; border-radius: 6px;
  cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 2px 5px; opacity: 0.55; color: var(--text-muted); }
.p-abs-btn:hover { opacity: 1; }
.p-abs-btn.active { color: var(--c-stop); opacity: 1; }
.abs-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; width: 100%; }
.abs-rows:empty { display: none; }
.abs-row { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; flex-wrap: wrap; }
.abs-row-name { color: var(--c-stop); font-weight: 600; }
.abs-occupied { background: var(--c-wait-soft); color: var(--c-wait); }


/* ============================================================
   OVERRIDES DE FIN DE FICHIER, verrou, mode édition, vue compacte,
   barre de jours (specs 2026-07-20, volets 1 à 6).
   ⚠️ Ce bloc DOIT rester en fin de fichier : plusieurs de ses règles ont la
   même spécificité que les règles de base du planning (ex. .p-compact
   .sujet-chips vs .sujet-multi .sujet-chips) et ne gagnent que par l'ordre
   de déclaration. Le remonter plus haut casse silencieusement la densité.
   ============================================================ */
/* Verrouillage semaine : badge « ✓ Semaine validée » + déverrouillage discret */
.p-locked-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.82rem; font-weight: 600; padding: 0.3rem 0.65rem;
  border-radius: 999px; background: var(--c-go-soft); color: var(--c-go);
  white-space: nowrap;
}
.p-unlock-btn { opacity: 0.75; }
.p-unlock-btn:hover { opacity: 1; }
.valider-lock-row { display: flex; align-items: center; gap: 0.45rem;
  margin: 0.6rem 0 0; font-size: 0.88rem; cursor: pointer; user-select: none; }

/* Ergonomie du mode édition (volet 4) : liseré pointillé + pill flottante */
.p-editing .p-days {
  outline: 2px dashed color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 6px;
  border-radius: var(--r-sm);
}
.p-edit-pill {
  position: fixed;
  bottom: 1.1rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;                       /* sous les modales (backdrop plus haut) */
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.45rem 0.6rem 0.45rem 1rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}
.p-edit-pill-label { display: inline-flex; align-items: center; gap: 0.35rem; }   /* le crayon (lot E) */
.p-edit-pill-btn {
  border: none;
  border-radius: 999px;
  padding: 0.32rem 0.75rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent);
}
.p-edit-pill-btn:hover { background: #fff; }
@media print {
  .p-edit-pill { display: none !important; }
  .p-editing .p-days { outline: none; }
}

/* ============================================================
   Vue compacte (semaine verrouillée) : le vide disparaît,
   les espacements se resserrent, spec 2026-07-20.
   ============================================================ */
.p-compact .is-empty { display: none !important; }
.p-compact .p-lane-cell { padding: 0.4rem 0.55rem; }
.p-compact .p-slots-wrap { gap: 0.35rem; }
.p-compact .p-day-content { gap: 0.4rem; }
.p-compact .p-half { padding-bottom: 0.3rem; }
.p-compact .p-lane-body { gap: 0.25rem; }

/* --- Densification (volet 6) : hors édition, la carte se lit comme du texte.
   Rien ici ne doit ressembler à un champ : c'est ce qui faisait croire aux
   utilisateurs que le planning était modifiable alors qu'il ne l'est pas. --- */

/* Sujet : plus de pastille ni de champ de saisie, un simple libellé accentué. */
.p-compact .sujet-chip {
  background: none;
  padding: 0;
  border-radius: 0;
  font-weight: 600;
  gap: 0.25rem;
}
.p-compact .sujet-chip-num {
  background: none;
  color: var(--accent-strong);
  padding: 0;
  min-width: 0;
}
.p-compact .sujet-chip-num::after { content: " ·"; }
.p-compact .sujet-chip-input,
.p-compact .sujet-ac-dropdown { display: none !important; }
.p-compact .p-lane-sujet { margin: 0; }

/* Hauteurs de confort tactile : indispensables pour viser un contrôle au doigt,
   pur gâchis en lecture seule (32 px pour une ligne de 17, 40 px par déroulant).
   Les neutraliser est le plus gros levier de densité. */
.p-compact .sujet-chips {
  min-height: 0;
  padding: 0;
  border: none;
  background: none;
  gap: 0.15rem 0.5rem;
}
.p-compact .p-lane-activite-wrap,
.p-compact .p-lane-prof-wrap { min-height: 0; }
.p-compact .p-lane-activite-wrap select,
.p-compact .p-lane-prof-wrap select,
.p-compact .p-lane-header select {
  min-height: 0;
  height: auto;
  padding: 0;
  font-size: 0.86rem;
  font-weight: 600;
}
.p-compact .p-lane-header { gap: 0.5rem; align-items: baseline; }

/* Salle 2 groupes : « GROUPE 1 » remonte sur la ligne du sujet au lieu d'occuper
   sa propre ligne (16 px × 2 groupes × 5 jours de gagnés). Les rôles restent
   dessous, pleine largeur. */
.p-compact .p-salle-group {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.4rem;
  align-items: baseline;
}
.p-compact .p-salle-group > .p-salle-group-tag { grid-column: 1; grid-row: 1; }
.p-compact .p-salle-group > .p-lane-sujet { grid-column: 2; grid-row: 1; }
.p-compact .p-salle-group > *:not(.p-salle-group-tag):not(.p-lane-sujet) { grid-column: 1 / -1; }
.p-compact .p-salle-group-tag { font-size: 0.6rem; line-height: 1.2; }

/* Espacements généraux resserrés */
.p-compact .p-lane-body { gap: 0.15rem; }
.p-compact .p-days { gap: 0.4rem; }
.p-compact .p-slot-row { gap: 0.25rem; }
.p-compact .p-slot-marker { padding-top: 0.15rem; }
.p-compact .p-day-head { padding-top: 0.3rem; padding-bottom: 0.3rem; }
.p-compact .p-lane-role.eleves { align-items: baseline; }

/* Rôles : label discret, valeurs en texte courant, chips sans pastille. */
.p-compact .p-lane-role { min-height: 0; gap: 0.35rem; align-items: baseline; }
.p-compact .p-lane-role-label { min-width: 0; font-size: 0.64rem; }
.p-compact .chip {
  background: none !important;
  padding: 0 !important;
  border-radius: 0;
  font-size: 0.84rem;
}
.p-compact .chips-display .chip:not(:last-child)::after { content: ","; }
.p-compact .chips-display,
.p-compact .person-display { padding: 0; min-height: 0; gap: 0.3rem; }
.p-compact .chips-display { row-gap: 0.1rem; }
.p-compact .p-lane-eleves-col { gap: 0.1rem; }
.p-compact .p-lane-header { min-height: 0; }
.p-compact .p-lane-participants { gap: 0.15rem; }
.p-compact .p-salle-group { padding: 0.25rem 0.4rem; }
.p-compact .p-half-head { padding-top: 0.3rem; padding-bottom: 0.3rem; }

/* --- Barre de jours colante (volet 6) : appui = saut au jour, jour visible surligné.
   Présente dans les deux modes : c'est de la navigation, pas de l'édition. --- */
/* La barre de semaine et la barre de jours forment UN bloc de navigation : l'écart
   entre les deux est resserré (le mémo des règles, qui s'intercalait, est passé
   sous les jours). `.week-bar` n'existe que dans le planning, où elle est toujours
   suivie de `.p-daynav` : pas besoin de `:has()`, qui exclurait les vieux Safari. */
.week-bar { margin-bottom: 0.45rem; }

/* Deux groupes empilés : « se déplacer » (date, flèches, Cette semaine) puis « agir »
   (Modifier, Bénévoles, Valider, Imprimer…), séparés par un filet. Avant, les huit
   contrôles partageaient un seul flux et retombaient en trois lignes sans hiérarchie
   sur téléphone. */
.week-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.week-bar-nav,
.week-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.week-bar-nav { padding-bottom: 0.55rem; }
.week-bar-actions {
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.week-bar-actions:empty { display: none; }
/* Libellés d'action en deux versions : la longue sur grand écran, la courte sous
   560 px, pour que les actions tiennent sur une ligne sur téléphone. Deux libellés
   complets plutôt qu'un mot tronqué : `text-transform: capitalize` produisait
   « Placer La Semaine ». Le title au survol reste toujours complet. */
.btn-short { display: none; }
@media (max-width: 560px) {
  .week-bar-actions .btn-long { display: none; }
  .week-bar-actions .btn-short { display: inline; }
}
.p-daynav {
  position: sticky;
  top: var(--haut-entete);   /* sous la barre collante du haut */
  z-index: 9;
  display: flex;
  gap: 0.3rem;
  padding: 0.35rem;
  margin-bottom: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.p-daynav-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: none;
  border-radius: var(--r-sm);
  padding: 0.3rem 0.1rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  cursor: pointer;
  line-height: 1.25;
}
.p-daynav-btn span { display: block; font-size: 0.68rem; font-weight: 400; color: var(--text-muted); }   /* et non plus 75 % d'opacité : 4,1:1 */
.p-daynav-btn.off span { color: inherit; }
.p-daynav-btn:hover { background: var(--bg-deep-soft, rgba(0, 0, 0, 0.05)); }
.p-daynav-btn.current { background: var(--accent); color: #fff; }
.p-daynav-btn.current span { color: inherit; opacity: 0.9; }
.p-daynav-btn.off { color: var(--text-muted); font-weight: 400; }   /* et non plus --text-faint : 2,3:1 (lot E) */
.p-day-card { scroll-margin-top: calc(var(--haut-entete) + 52px); }   /* barre du haut + barre de jours */
@media print { .p-daynav { display: none !important; } }

/* ============================================================
   Mon suivi, historique des passages effectués (volet 2026-07-23)
   Bloc en FIN de fichier : l'ordre de déclaration départage les
   spécificités égales (piège documenté du 2026-07-20).
   ============================================================ */
.ms-histo-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.85rem;
}
.ms-histo-item {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 0.88rem;
}
.ms-histo-date {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
  min-width: 5.2rem;
}
.ms-histo-comment { font-size: 0.82rem; }

/* ===== Éditeur de QCM (formateur) =====
   Sans ces règles, les cartes de questions n'avaient AUCUNE délimitation : les
   actions se lisaient comme appartenant à la question suivante (on éditait la
   précédente). Chaque question est donc une carte fermée, actions dans son
   en-tête, à côté de son numéro. */
.qcm-editor-list { display: flex; flex-direction: column; gap: 0.85rem; }

.qcm-editor-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg-elev);
  padding: 0.85rem 0.95rem 0.95rem;
}

.qcm-editor-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding-bottom: 0.6rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid var(--line-faint);
}

.qcm-editor-card-num {
  flex: 0 0 auto;
  min-width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.qcm-editor-section {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-soft);
}

.qcm-editor-multi {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-strong);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}

/* Actions poussées à droite de l'en-tête */
.qcm-editor-card-order {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.qcm-editor-enonce { margin: 0 0 0.6rem; font-weight: 600; line-height: 1.4; }
.qcm-editor-thumb {
  display: block;
  max-width: 180px;
  height: auto;
  margin: 0 0 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.qcm-editor-opts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.qcm-editor-opt {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.88rem;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}
.qcm-editor-opt.correct { background: var(--c-go-soft); font-weight: 600; }
.qcm-editor-opt-mark { flex: 0 0 1rem; color: var(--c-go); font-weight: 700; }

/* Formulaire de question */
.qcm-form-modal .qcm-form-body { display: flex; flex-direction: column; gap: 0.7rem; }
.qcm-form-opts { display: flex; flex-direction: column; gap: 0.4rem; }
.qcm-form-opt { display: flex; align-items: center; gap: 0.45rem; }
.qcm-form-opt .qcm-form-opt-text { flex: 1 1 auto; min-width: 0; }
/* Flèches de réordonnancement des réponses : compactes, pour ne pas manger le champ. */
.qcm-form-opt .icon-only { flex: 0 0 auto; padding-left: 0.4rem; padding-right: 0.4rem; }
.qcm-form-opt-check { display: inline-flex; align-items: center; }
.qcm-form-img { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
/* Position : petit champ numérique, l'aide tient sur une ligne discrète. */
.qcm-form-pos input { width: 5.5rem; }
.qcm-form-pos p.muted { font-size: 0.78rem; margin: 0.25rem 0 0; }

/* --- Signalement d'une question douteuse (lecteur d'entraînement) ---
   Discret par construction : c'est un recours, il ne doit pas concurrencer
   « Question suivante » ni donner envie de fuir une question difficile. */
.qcm-signal-wrap { margin-top: 0.75rem; }
.qcm-signal-btn {
  background: none; border: 0; padding: 0.2rem 0; cursor: pointer;
  font: inherit; font-size: 0.78rem; color: var(--text-muted);
  text-decoration: underline; text-underline-offset: 2px;
}
.qcm-signal-btn:hover { color: var(--c-stop); }
.qcm-signal-form {
  margin-top: 0.5rem; padding: 0.75rem; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.qcm-signal-intro { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.qcm-signal-motif, .qcm-signal-comment {
  width: 100%; padding: 0.45rem 0.55rem; border: 1px solid var(--border);
  border-radius: 8px; background: var(--surface); color: var(--text);
  font: inherit; font-size: 0.85rem;
}
.qcm-signal-comment { resize: vertical; min-height: 2.4rem; }
.qcm-signal-actions { display: flex; gap: 0.5rem; }
.qcm-signal-done { margin: 0.4rem 0 0; font-size: 0.82rem; font-weight: 600; color: var(--c-go); }

/* --- Côté formateur : signalements dans l'éditeur de QCM --- */
.qcm-signal-panel {
  margin: 0 0 1rem; padding: 0.85rem 1rem; border-radius: 12px;
  background: var(--c-stop-soft); border: 1px solid var(--c-stop);
}
.qcm-signal-panel h4 { margin: 0 0 0.6rem; font-size: 0.9rem; color: var(--c-stop); }
.qcm-signal-item {
  padding: 0.55rem 0; border-top: 1px solid rgba(0,0,0,0.08);
  display: flex; flex-direction: column; gap: 0.3rem;
}
.qcm-signal-item:first-of-type { border-top: 0; }
.qcm-signal-item-meta { font-size: 0.76rem; color: var(--text-muted); }
.qcm-signal-item-motif { font-size: 0.85rem; font-weight: 600; }
.qcm-signal-item-comment { font-size: 0.85rem; font-style: italic; }
.qcm-signal-item-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.15rem; } /* libellés du lot D plus longs : à la ligne sur téléphone */
.qcm-editor-signal {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.1rem 0.45rem; border-radius: 999px;
  background: var(--c-stop); color: #fff; font-size: 0.72rem; font-weight: 700;
}

/* Signalements ouverts d'un QCM, visibles depuis la liste des thèmes : sans ce
   repère, le formateur devrait ouvrir chaque QCM pour les découvrir. */
.theme-qcm-signal {
  display: inline-flex; align-items: center; gap: 0.2rem; margin-top: 0.25rem;
  padding: 0.08rem 0.4rem; border-radius: 999px;
  background: var(--c-stop); color: #fff; font-size: 0.7rem; font-weight: 700;
  white-space: nowrap;
}

/* Panneau en illustration de question : taille contenue, sinon le dessin ecrase
   l'enonce. Les photos de situation gardent toute la largeur. */
.qcm-question-img.is-panneau {
  /* Plafond de HAUTEUR et non de largeur : un panneau est carre, une planche de
     balises ou un schema de marquage est en format paysage. Une limite de largeur
     ecraserait les seconds ; une limite de hauteur laisse les deux lisibles. */
  max-height: 155px; width: auto; max-width: 100%;
  margin-left: auto; margin-right: auto;
  /* Fond gris neutre, VOLONTAIREMENT independant du theme : beaucoup de panneaux
     sont blancs ou tres clairs (balises J, fin d'interdiction B31) et
     disparaissaient sur fond clair. Le gris est aussi la presentation habituelle
     des planches de signalisation. Valeur choisie par le calcul : elle detache le
     blanc (rapport 1,63) sans eteindre le rouge des panneaux (rapport 3,01) ; un
     gris plus fonce ferait l'inverse. */
  background: var(--apercu-planche);
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
}

/* ============================================================
   Nouveautés : cartes, puces, pastille d'onglet
   ============================================================ */

.nv-liste { display: flex; flex-direction: column; gap: 0.7rem; }

.nv-carte {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 1rem 1.2rem;
}

.nv-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}

.nv-date { color: var(--text-muted); font-size: 0.78rem; }

.nv-puce-neuf,
.nv-puce-role {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  line-height: 1.5;
}

.nv-puce-neuf { background: var(--accent); color: #FFF; }
.nv-puce-role { background: var(--accent-soft); color: var(--accent-strong); }

.nv-titre { margin: 0 0 0.35rem; font-size: 1rem; }
.nv-resume { margin: 0; color: var(--text-soft); font-size: 0.9rem; line-height: 1.55; }

.nv-ou {
  display: inline-flex;
  align-items: center;
  min-height: 24px;   /* cible du référentiel sur ordinateur (44 px au téléphone : css/pages.css) */
  margin-top: 0.7rem;
  font-size: 0.84rem;
  color: var(--accent-strong);
  text-decoration: none;
}
.nv-ou:hover { text-decoration: underline; }

/* Filet de séparation : le guide est un bloc à part dans la carte, pas la suite
   du résumé. Sans lui, « Comment faire » se lisait comme une ligne de plus. */
.nv-guide {
  margin-top: 0.8rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line-faint);
}
.nv-guide summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--text-muted);
}
.nv-guide ol {
  margin: 0.45rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.86rem;
  color: var(--text-soft);
  line-height: 1.55;
}
.nv-guide li { margin-bottom: 0.25rem; }


/* --- Fenêtre d'ouverture des examens --- */
/* Bandeau d'échéance dans le panneau formateur. */
.exam-echeance {
  margin-left: 0.4rem; padding: 0.08rem 0.45rem; border-radius: 999px;
  background: var(--c-go-soft); color: var(--accent-strong);
  font-size: 0.74rem; font-weight: 700; white-space: nowrap;
}
/* Choix de la durée à l'ouverture : une colonne de boutons pleine largeur. */
.exam-duree-choix { display: flex; flex-direction: column; gap: 0.4rem; }
/* Pastille de la liste des thèmes : repérer un examen ouvert sans entrer dans la
   fiche. C'est le filet contre l'oubli d'une ouverture sans limite. */
.theme-qcm-exam-on {
  display: inline-flex; align-items: center; margin-top: 0.25rem;
  padding: 0.08rem 0.45rem; border-radius: 999px;
  background: var(--c-go); color: #fff; font-size: 0.7rem; font-weight: 700;
  white-space: nowrap;
}

/* --- Instruction automatique d'un signalement ---------------------------------
   Tout est gris, sans exception. Le vert et le rouge du thème restent la signature
   des boutons « Corrigé » / « Rien à corriger », c'est-à-dire de la DÉCISION du
   formateur. Colorer l'avis reviendrait à le faire passer pour un classement. */
.qcm-signal-instr {
  margin-top: 0.5rem; padding: 0.45rem 0.6rem;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg-subtle);
}
.qcm-signal-instr-tete { cursor: pointer; list-style: none; }
.qcm-signal-instr-tete::-webkit-details-marker { display: none; }
.qcm-signal-instr-titre {
  display: block; font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted);
}
.qcm-signal-instr-conclusion {
  display: block; margin-top: 0.15rem; font-size: 0.85rem; color: var(--text);
}
.qcm-signal-instr-plus {
  display: inline-block; margin-top: 0.3rem;
  font-size: 0.76rem; font-weight: 600; color: var(--text-muted);
  text-decoration: underline;
}
.qcm-signal-instr[open] .qcm-signal-instr-plus { text-decoration: none; }
.qcm-signal-instr-date {
  display: block; margin-top: 0.1rem; font-size: 0.72rem; color: var(--text-muted);
}
.qcm-signal-instr-analyse {
  margin-top: 0.5rem; padding-top: 0.45rem; border-top: 1px solid var(--line);
}
.qcm-signal-instr-ligne {
  margin: 0 0 0.25rem; font-size: 0.82rem; line-height: 1.45; color: var(--text-muted);
  overflow-wrap: anywhere;   /* l'adresse d'un lien Légifrance est longue et sans espace */
}
.qcm-signal-instr-ligne a { color: var(--text-muted); text-decoration: underline; }
.qcm-signal-instr-vide {
  margin: 0.5rem 0 0; font-size: 0.76rem; font-style: italic; color: var(--text-muted);
}
/* Réponse visée par le signalement : factuelle, pas une alerte, c'est un repère de
   lecture, au même rang que le motif. */
.qcm-signal-item-option {
  font-size: 0.82rem; color: var(--text-muted);
}

/* --- Console des signalements ------------------------------------------------- */
.signal-console-barre {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.75rem; flex-wrap: wrap; margin-bottom: 0.75rem;
}
.signal-console-barre h3 { margin: 0; font-size: 1rem; }
.signal-console-groupe {
  display: flex; align-items: center; gap: 0.5rem;
  margin: 1.25rem 0 0.5rem; font-size: 0.9rem;
}
.signal-console-compte {
  padding: 0.05rem 0.4rem; border-radius: 999px;
  background: var(--bg-subtle); color: var(--text-muted);
  font-size: 0.72rem; font-weight: 700;
}
.signal-console-vide, .signal-console-erreur {
  padding: 1.5rem 0; text-align: center; color: var(--text-muted);
}
/* La ligne de contexte concaténée (thème · QCM · énoncé) et sa troncature à deux lignes
   ont disparu : le thème est passé en surtitre, le titre du QCM a été retiré comme
   redondant, et l'énoncé porte seul le titre, il n'a plus besoin d'être rogné. */

/* Question atteinte depuis la console : un halo bref, le temps de la retrouver des yeux.
   Neutre à dessein, ce n'est pas un état de la question, juste un repère de navigation. */
.qcm-editor-card-cible {
  box-shadow: 0 0 0 2px var(--text-muted);
  transition: box-shadow 0.4s ease;
}

/* Dans la console, chaque signalement est une carte détachée. Le filet de 1 px qui
   suffit dans le panneau de l'éditeur s'y perd : les signalements s'enchaînent, et
   l'encart d'avis, gris et large, noie la limite entre deux cartes. Fond clair
   plutôt que gris, pour que l'encart d'avis ressorte À L'INTÉRIEUR de sa carte. */
.signal-console-carte {
  margin-bottom: 0.9rem; padding: 0.75rem 0.9rem;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg-elev);
}
/* Le panneau de l'éditeur retire la bordure haute de sa première carte ; ici chaque
   carte est close, la première comme les autres. */
.signal-console-carte:first-of-type { border-top: 1px solid var(--line); }
.signal-console-carte:last-of-type { margin-bottom: 0; }

/* --- Hiérarchie de lecture d'une carte de signalement ------------------------------
   On lit dans cet ordre : ce qui est visé, le grief, puis qui l'a écrit. Le surtitre
   situe sans peser, le titre porte, le commentaire de l'élève est le contenu utile -
   c'est lui qu'on vient chercher, il ne peut pas rester le plus maigre de la carte. */
.qcm-signal-item-surtitre {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--text-muted);
}
.qcm-signal-item-titre {
  margin: 0.1rem 0 0.15rem; font-size: 0.95rem; font-weight: 600;
  line-height: 1.35; color: var(--text);
}
/* Le motif devient une pastille : c'est une étiquette, pas une phrase. En gras sur sa
   propre ligne, il concurrençait la question. */
.qcm-signal-item-motif {
  align-self: flex-start;
  padding: 0.08rem 0.5rem; border-radius: 999px;
  background: var(--bg-soft); border: 1px solid var(--line);
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}
.qcm-signal-item-comment {
  margin: 0.1rem 0; padding-left: 0.6rem;
  border-left: 2px solid var(--line-strong);
  font-size: 0.88rem; font-style: normal; line-height: 1.45; color: var(--text);
}
/* La signature se lit en dernier : elle situe le grief, elle ne l'annonce pas. */
.qcm-signal-item-meta { margin-top: 0.1rem; }

/* ============================================================
   Lecteur de cours (js/views/cours-reader.js)
   Écran de lecture plein cadre ouvert par-dessus la liste des thèmes.
   Mobile d'abord : la lecture se fait surtout sur iPhone.
   ============================================================ */

/* Le corps ne défile plus derrière le lecteur. */
body.cours-open { overflow: hidden; }

.cours-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;               /* au-dessus des modales (200), sous le toast (2000) */
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Progression de lecture : 3 px en haut d'écran, repère discret sur un cours long. */
.cours-progress {
  flex: 0 0 auto;
  height: 3px;
  background: var(--line-faint);
}
.cours-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.12s linear;
}

/* --- En-tête fixe --- */
.cours-head {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem 0.75rem;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--line);
}
.cours-head-main {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  flex: 1 1 auto;
  min-width: 0;
}
.cours-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.55rem;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
  font-weight: 600;
}
.cours-head-titre {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--poids-titre-normal);
  font-size: 1.18rem;
  line-height: 1.25;
  color: var(--text);
}
.cours-head-meta {
  margin: 0.15rem 0 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.cours-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--bg);
  color: var(--text-soft);
  cursor: pointer;
}
.cours-close:hover { background: var(--bg-soft); color: var(--text); }
.cours-close svg { width: 1.05rem; height: 1.05rem; }
@media (max-width: 720px) { .cours-close { width: 44px; height: 44px; } }   /* cible du téléphone */

/* --- Zone défilante --- */
.cours-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: clip;            /* sinon un tableau large casse le sticky */
  -webkit-overflow-scrolling: touch;
}

/* Sommaire : pastilles qui passent à la ligne (jamais de défilement de côté), collantes sous l'en-tête. Sur téléphone
   elles ne collent plus : plusieurs lignes de pastilles collées couvriraient le texte (lot 2B, tâche 1). Vaut aussi pour
   les onglets des Informations légales (.legal-onglets). */
.cours-sommaire {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  background: var(--bg);
  border-bottom: 1px solid var(--line-faint);
}
.cours-somm-item {
  flex: 0 1 auto;
  max-width: 100%;             /* un intitulé long passe à la ligne dans sa pastille au lieu de la pousser hors de l'écran */
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--text-soft);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}
@media (max-width: 699.98px) {
  .cours-sommaire { position: static; }
  .cours-somm-item { min-height: 44px; padding-inline: 0.8rem; }   /* zone à toucher du téléphone */
}
.cours-somm-item:hover { border-color: var(--accent); color: var(--accent-strong); }
.cours-somm-num {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--accent);
}

/* --- Corps du cours --- */
.cours-article {
  max-width: 44rem;
  margin: 0 auto;
  padding: 1.1rem 1rem 4rem;
}

.cours-p {
  margin: 0.7rem 0;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-soft);
}
.cours-p strong { color: var(--text); font-weight: 600; }

.cours-h2 {
  margin: 2.3rem 0 0.5rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
  font-family: var(--font-display);
  font-weight: var(--poids-titre-normal);
  font-size: 1.32rem;
  line-height: 1.25;
  color: var(--text);
  scroll-margin-top: 3.5rem;
}
.cours-article > .cours-h2:first-child { margin-top: 0.6rem; border-top: none; padding-top: 0; }

.cours-h3 {
  margin: 1.7rem 0 0.4rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.cours-h4 {
  margin: 1.2rem 0 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.cours-ul, .cours-ol { margin: 0.6rem 0; padding-left: 1.15rem; }
.cours-ul li, .cours-ol li {
  margin: 0.32rem 0;
  font-size: 0.93rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.cours-ul li::marker { color: var(--accent); }
.cours-ol li::marker { color: var(--accent); font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.cours-ul li strong, .cours-ol li strong { color: var(--text); }

/* Fiche synthèse d'ouverture : ce qu'on retient même sans lire le cours. */
.cours-essentiel {
  margin: 0 0 1.4rem;
  padding: 0.9rem 1rem 0.95rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
}
.cours-essentiel-titre {
  margin: 0 0 0.45rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent-strong);
}
.cours-essentiel ul { margin: 0; padding-left: 1rem; }
.cours-essentiel li {
  margin: 0.3rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text);
}
.cours-essentiel li::marker { color: var(--accent); }

/* Note de bas de section (barème, méthode de vérification, article-cadre). */
.cours-note {
  margin: 0.9rem 0;
  padding: 0.7rem 0.85rem;
  background: var(--bg-subtle);
  border-left: 2px solid var(--line-strong);
  border-radius: 0.4rem;
}
.cours-note .cours-p { margin: 0.35rem 0; font-size: 0.87rem; }
.cours-note .cours-p:first-child { margin-top: 0; }
.cours-note .cours-p:last-child { margin-bottom: 0; }
.cours-note .cours-table { font-size: 0.82rem; }

/* Mention de source : disponible, jamais envahissante.
   Repliée par défaut, elle se déplie au survol (ordinateur) ou au clic. */
.cours-source {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 0.4rem;
  margin: 0.5rem 0 0;
}
.cours-source-btn {
  flex: 0 0 auto;
  padding: 0.05rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  min-height: 24px;   /* cible du référentiel : 24 px sur ordinateur, 44 px au téléphone */
}
@media (max-width: 720px) { .cours-source-btn { min-height: 44px; padding-inline: 0.7rem; } }
.cours-source-btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.cours-source-val {
  display: none;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.74rem;
  color: var(--text-muted);
}
.cours-source.open .cours-source-val { display: inline; }
@media (hover: hover) {
  .cours-source:hover .cours-source-val { display: inline; }
}

/* --- Planches de schémas de panneaux --- */
.signaux-bloc { margin: 1.1rem 0; }
.signaux-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.2rem, 1fr));
  gap: 0.7rem;
}
.signal-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.7rem 0.5rem 0.6rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-faint);
  border-radius: 0.55rem;
  text-align: center;
}
.signal-vis { width: 3.6rem; height: 3.6rem; }
.signal-svg { width: 100%; height: 100%; display: block; object-fit: contain; }
.signal-cap { display: flex; flex-direction: column; gap: 0.1rem; }
.signal-code {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.signal-nom { font-size: 0.78rem; font-weight: 600; line-height: 1.25; color: var(--text); }
.signal-detail { font-size: 0.68rem; line-height: 1.3; color: var(--text-muted); }
.signaux-legende {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

/* --- Tableaux --- */
/* Jamais de défilement de côté (lot 2B, tâche 1) : au-dessus de 700 px le tableau tient en largeur, ses mots coupés au
   besoin ; en dessous, un tableau de plus de deux colonnes devient une liste (voir plus bas). */
.cours-table-wrap { margin: 0.9rem 0; }
.cours-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.87rem;
}
.cours-table th {
  padding: 0.45rem 0.6rem;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line-strong);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: left;
}
.cours-table td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--line-faint);
  line-height: 1.55;
  color: var(--text-soft);
  vertical-align: top;
}
.cours-table td strong { color: var(--text); }
.cours-table tbody tr:last-child td { border-bottom: none; }

/* --- Sanctions en fiches --- */
/* Un tableau à cinq colonnes ne tient pas sur un téléphone : l'infraction est une
   phrase, le reste de courtes valeurs. Chaque sanction devient donc une fiche. */
.sanctions-liste { display: flex; flex-direction: column; gap: 0.5rem; margin: 0.9rem 0; }
.sanction {
  padding: 0.65rem 0.75rem 0.6rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-faint);
  border-left: 3px solid var(--line-strong);
  border-radius: 0.5rem;
}
.sanction-infraction {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text);
}
.sanction-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
}
.sanction-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  border-radius: 0.3rem;
  font-size: 0.74rem;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip-article { background: var(--bg-soft); color: var(--text-soft); }
.chip-amende { background: var(--bg-soft); color: var(--text); font-weight: 600; }
.chip-points { background: var(--c-stop-soft); color: var(--c-stop); font-weight: 700; }
.chip-points.chip-zero { background: var(--bg-soft); color: var(--text-muted); font-weight: 500; }
.chip-source {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--text-muted);
  text-decoration: none;
}
.chip-source:hover { border-color: var(--accent); color: var(--accent-strong); }
.sanction-note {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Aucun tableau ne doit pousser la page : les cellules passent à la ligne entre les mots, et un mot plus large que sa
   colonne est coupé plutôt que de faire défiler ou d'être masqué par la zone de lecture. Les tableaux de plus de deux
   colonnes ne sont des colonnes qu'au-dessus de 700 px (là, « Couleur » n'est jamais écrasé en pile de lettres). */
.cours-table td, .cours-table th { overflow-wrap: anywhere; hyphens: auto; }

/* Téléphone : chaque ligne d'un tableau de plus de deux colonnes est une carte, le titre de la colonne (data-label,
   posé par le lecteur) devant chaque valeur. L'en-tête reste à la disposition des lecteurs d'écran. Un tableau de deux
   colonnes (terme, définition) garde sa forme. */
@media (max-width: 699.98px) {
  .cours-table:not(.cours-table-2col),
  .cours-table:not(.cours-table-2col) tbody,
  .cours-table:not(.cours-table-2col) tr,
  .cours-table:not(.cours-table-2col) td { display: block; }
  .cours-table:not(.cours-table-2col) thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .cours-table:not(.cours-table-2col) tr {
    margin: 0 0 0.6rem; padding: 0.55rem 0.8rem;
    border: 1px solid var(--line-faint); border-radius: var(--r); background: var(--bg-elev);
  }
  .cours-table:not(.cours-table-2col) tbody tr:last-child { margin-bottom: 0; }
  .cours-table:not(.cours-table-2col) td,
  .cours-table:not(.cours-table-2col) tbody tr:last-child td { padding: 0.2rem 0; border: 0; }
  .cours-table:not(.cours-table-2col) td:empty { display: none; }   /* une valeur absente n'écrit pas son titre pour rien */
  .cours-table:not(.cours-table-2col) td[data-label]::before {
    content: attr(data-label); display: block;
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted);
  }
  .cours-table:not(.cours-table-2col) td:first-child { font-weight: 600; color: var(--text); }
}

.cours-article code {
  padding: 0.05rem 0.3rem;
  border-radius: 0.25rem;
  background: var(--bg-soft);
  font-family: "Geist Mono", ui-monospace, monospace;
  font-size: 0.84em;
}
.cours-article a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }

/* --- Écran large : marges plus généreuses, texte un peu plus grand --- */
@media (min-width: 760px) {
  .cours-head { padding: 1rem 1.5rem 0.9rem; }
  .cours-sommaire { padding: 0.7rem 1.5rem; }
  .cours-article { padding: 1.6rem 1.5rem 5rem; }
  .cours-head-titre { font-size: 1.35rem; }
  .cours-p { font-size: 0.99rem; }
  .cours-h2 { font-size: 1.5rem; }
}

/* Entrée « Lire le cours » dans la fiche de thème. */
.theme-cours-cta { margin: 0 0 0.9rem; }
.theme-cours-hint {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  text-align: center;
  color: var(--text-muted);
}

/* --- Planches de marquage au sol --- */
.marquage-bloc { margin: 1.1rem 0; }
.marquage-grille { display: flex; flex-direction: column; gap: 0.6rem; }
.marquage-card {
  margin: 0;
  padding: 0.6rem 0.7rem 0.55rem;
  background: var(--bg-elev);
  border: 1px solid var(--line-faint);
  border-radius: 0.55rem;
}
.marquage-svg { display: block; width: 100%; height: auto; border-radius: 0.3rem; }
.marquage-cap {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem 0.5rem;
  margin-top: 0.45rem;
}
.marquage-nom {
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-strong);
}
.marquage-detail { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.marquage-mesure {
  margin-left: auto;
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===== Éditeur de cours ===== */
.cours-editeur { display: flex; flex-direction: column; }
.editeur-actions { display: flex; align-items: center; gap: 10px; }
.editeur-statut { font-size: 0.82rem; color: var(--text-muted); }
.editeur-bandeau { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px 14px; background: var(--accent-soft); border-bottom: 1px solid var(--line);
  font-size: 0.9rem; }
.editeur-outils { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px;
  border-bottom: 1px solid var(--line); }
.editeur-corps { display: flex; flex: 1; min-height: 0; }
.editeur-zone { flex: 1; min-width: 0; resize: none; border: 0; outline: none;
  padding: 14px; font: 0.88rem/1.55 ui-monospace, "Cascadia Mono", monospace;
  color: var(--text); background: var(--bg-elev); border-right: 1px solid var(--line); }
.editeur-apercu { flex: 1; min-width: 0; overflow-y: auto; padding: 14px; }
.editeur-versions { padding: 8px 14px; border-bottom: 1px solid var(--line);
  max-height: 200px; overflow-y: auto; }
.editeur-version { display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 4px 0; font-size: 0.88rem; }
.editeur-bascule { display: none; }
@media (max-width: 800px) {
  .editeur-bascule { display: flex; gap: 6px; padding: 8px 14px;
    border-bottom: 1px solid var(--line); }
  .editeur-bascule .btn.on { background: var(--accent); color: #fff; }
  .cours-editeur[data-mode="edite"] .editeur-apercu { display: none; }
  .cours-editeur[data-mode="apercu"] .editeur-zone { display: none; }
}

/* ===== Images de cours ===== */
.cours-image { margin: 14px 0; }
.cours-image img { max-width: 100%; border-radius: var(--r); display: block; }

/* ===== Pastilles de couleur des tableaux de cours =====
   Teintes de la signalisation réelle (donnée pédagogique, comme les couleurs
   des panneaux dans signaux.js) : hors palette de l'app, à dessein. */
.cours-pastille {
  display: inline-block;
  width: 0.72em; height: 0.72em;
  border-radius: 50%;
  margin-right: 0.4em;
  border: 1px solid var(--line-strong);
  vertical-align: -0.05em;
}
.cours-pastille-blanc { background: var(--signal-blanc); }
.cours-pastille-jaune { background: var(--signal-jaune); }
.cours-pastille-bleu { background: var(--signal-bleu); }
.cours-pastille-rouge { background: var(--signal-rouge); }
.cours-pastille-vert { background: var(--signal-vert); }
.cours-pastille-orange { background: var(--signal-orange); }
.cours-pastille-noir { background: var(--signal-noir); }
.cours-pastille-gris { background: var(--signal-gris); }
.cours-pastille-marron { background: var(--signal-marron); }
.cours-pastille-violet { background: var(--signal-violet); }

/* ===== Galerie de planches de l'éditeur de cours =====
   Choisir un panneau ou un marquage en le voyant : vignettes cliquables,
   reprises des cartes du lecteur (signal-card / marquage-card). */
.editeur-galerie {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 14px; border-bottom: 1px solid var(--line);
  max-height: 340px; overflow-y: auto;
}
.editeur-galerie-grille { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.editeur-vignette {
  padding: 6px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-elev); cursor: pointer; text-align: center;
}
.editeur-vignette:hover, .editeur-vignette:focus-visible { border-color: var(--accent); }
.editeur-vignette .signal-card, .editeur-vignette .marquage-card { margin: 0; border: 0; }
.editeur-vignette .signal-cap, .editeur-vignette .marquage-cap { max-width: 8.5rem; }
.editeur-vignette .marquage-svg { width: 10rem; height: auto; }

/* ===== Filtres et recherche de la galerie de panneaux (catalogue 384 codes) =====
   Puces de série + champ de recherche, au-dessus de la grille de vignettes. */
.editeur-galerie-filtres { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.editeur-puce {
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--bg-elev); color: var(--text-soft);
  font-size: 0.76rem; font-family: var(--font); cursor: pointer; white-space: nowrap;
}
.editeur-puce:hover, .editeur-puce:focus-visible { border-color: var(--accent); }
.editeur-puce.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.editeur-recherche {
  width: 100%; padding: 5px 10px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg-elev); color: var(--text); font: 0.85rem var(--font);
}
.editeur-recherche:focus { outline: none; border-color: var(--accent); }

/* ===== Fin de cours : enchaînement vers le QCM du thème ===== */
.cours-qcm-cta {
  margin: 1.6rem 0 0.4rem;
  padding: 0.9rem 1rem 1rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0.5rem;
  text-align: center;
}
.cours-qcm-cta-texte {
  margin: 0 0 0.6rem;
  font-size: 0.9rem;
  color: var(--text);
}

/* ===== Reprise de lecture (autonomie) : bandeau sous l'en-tête de la fiche du cours =====
   Mêmes variables que la fin de cours (.cours-qcm-cta) : suit les deux habillages. */
.cours-reprise {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.8rem;
  padding: 0.55rem 1rem;
  background: var(--accent-soft);
  border-bottom: 1px solid var(--line-faint);
  color: var(--text);
  font-size: 0.9rem;
}
.cours-reprise .btn { flex: 0 0 auto; }

/* ===== Colonne Cours de la liste des thèmes =====
   Bouton vif tant que le cours n'a jamais été ouvert sur l'appareil,
   atténué ensuite (mémoire locale, comme les nouveautés vues). */
.theme-cours-cell { display: flex; align-items: center; min-width: 0; }
.theme-cours-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0.4rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--accent); background: var(--accent);
  color: #fff; font-weight: 600; font-size: 0.82rem;
  font-family: inherit; cursor: pointer; white-space: nowrap;
}
.theme-cours-btn .icon { width: 15px; height: 15px; }
.theme-cours-btn:hover { filter: brightness(1.06); }
.theme-cours-btn.deja-lu {
  background: transparent; border-color: var(--line);
  color: var(--text-muted); font-weight: 500;
}
.theme-cours-btn.deja-lu:hover { border-color: var(--accent); color: var(--text); filter: none; }

/* Grilles : la colonne Cours s'insère entre la date et le QCM. */
.themes-list.cours-on .theme-row { grid-template-columns: 50px 1fr 120px 90px 100px 36px; }
.themes-list.cours-on.qcm-on .theme-row {
  grid-template-columns: 50px 1fr 110px 78px 100px minmax(170px, 0.7fr) 36px;
}
@media (max-width: 720px) {
  .themes-list.cours-on .theme-row { grid-template-columns: 36px 1fr auto auto; }
  .themes-list.cours-on .theme-row .theme-cours-cell {
    grid-column: 2 / -1; grid-row: 3; justify-self: start; margin-top: 0.4rem;
  }
  .themes-list.cours-on.qcm-on .theme-row .theme-qcm-cell { grid-row: 4; }
}

/* ===== Cellule QCM : pleine largeur et barre d'entraînement =====
   Le bouton et les notes se partagent la largeur de la colonne ; la barre
   sous la cellule se remplit avec la dernière note d'entraînement (mêmes
   paliers de couleur que les notes). */
.theme-qcm-cell .theme-qcm-cell2 { width: 100%; }
.qcm-cell-entete {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; width: 100%;
}
.qcm-cell-barre {
  width: 100%; height: 5px; margin-top: 6px;
  border-radius: 999px; background: var(--line-faint); overflow: hidden;
}
.qcm-cell-barre-fill { height: 100%; border-radius: 999px; }
.qcm-cell-barre-fill.n-great { background: var(--c-go); }
.qcm-cell-barre-fill.n-ok { background: var(--accent-strong); }
.qcm-cell-barre-fill.n-mid { background: var(--note-mid-barre); }
.qcm-cell-barre-fill.n-low { background: var(--c-stop); }

/* ===== Assistant (panneau) : sa place et ses tailles sous la coquille sont dans css/navigation.css ===== */
.chatbot-panel {
  position: fixed;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 61;
  width: min(380px, calc(100vw - 32px));
  height: min(540px, calc(100dvh - 120px));
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.chatbot-panel.hidden { display: none; }
.chatbot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
}
.chatbot-titre { font-weight: 600; margin: 0; }
.chatbot-beta {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
}
.chatbot-disclaimer {
  margin: 0;
  padding: 6px 14px;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--line);
}
.chatbot-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chatbot-msg {
  max-width: 88%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.chatbot-msg.user { align-self: flex-end; background: var(--accent-soft); }
.chatbot-msg.assistant { align-self: flex-start; background: var(--bg-soft); }
.chatbot-msg.assistant a { color: var(--accent-strong); text-decoration: underline; }
.chatbot-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}
.chatbot-form textarea { flex: 1; resize: none; }
@media (max-width: 600px) {
  .chatbot-panel { right: 8px; left: 8px; width: auto; height: min(70dvh, 560px); }
}
/* La croix reprenait le blanc des boutons de la barre sombre (.ghost-btn), illisible sur le panneau clair.
   Sur téléphone, la croix et « Envoyer » font 44 px au moins, comme toute zone à toucher. */
.chatbot-panel .chatbot-close { color: var(--text-soft); }
.chatbot-panel .chatbot-close:hover { background: var(--bg-subtle); color: var(--text); }
@media (max-width: 699.98px) {
  .chatbot-panel .chatbot-close,
  .chatbot-panel .chatbot-form .btn { min-width: 44px; min-height: 44px; }
}
@media print {
  .chatbot-panel { display: none !important; }
}

/* ============================================================
   Thèmes sur mobile : correctif de spécificité + carte compacte
   (fix/themes-mobile, 18/08/2026)
   ============================================================ */

/* 1) Correctif : la grille desktop `.themes-list.cours-on.qcm-on .theme-row`
   (4 classes) battait les overrides mobiles à 3 classes des media queries
   existantes. Dès que la liste porte les DEUX colonnes Cours et QCM (le cas
   courant depuis les cours en base), le téléphone recevait la grille desktop
   à 7 colonnes : numéro large, titre écrasé mot à mot, zone vide à droite.
   Même sélecteur, même media query, plus bas dans le fichier : l'ordre des
   sources fait gagner celui-ci. */
@media (max-width: 720px) {
  .themes-list.cours-on.qcm-on .theme-row {
    grid-template-columns: 36px 1fr auto auto;
  }
}

/* 2) Petits écrans (<= 480px) : carte compacte.
   Numéro en pastille inline avec le titre (colonne auto), titre sur toute la
   largeur restante, statut sur sa ligne (corbeille des notions à droite),
   date sur sa ligne, puis Cours et QCM (notes + barre) en pleine largeur.
   Les sélecteurs reprennent les variantes .qcm-on / .cours-on existantes pour
   gagner à égalité de spécificité par l'ordre des sources. */
@media (max-width: 480px) {
  .themes-list .theme-row,
  .themes-list.qcm-on .theme-row,
  .themes-list.cours-on .theme-row,
  .themes-list.cours-on.qcm-on .theme-row {
    grid-template-columns: auto 1fr auto;
    grid-template-areas:
      "num    titre  titre"
      "statut statut del"
      "date   date   date"
      "cours  cours  cours"
      "qcm    qcm    qcm";
    gap: 0.45rem 0.55rem;
    padding: 0.75rem 0.8rem;
  }
  /* Numéro : pastille compacte, calée sur la première ligne du titre. */
  .themes-list .theme-row .theme-num {
    grid-area: num;
    align-self: start;
    justify-self: start;
    margin-top: 1px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 0.72rem;
    line-height: 1.4;
  }
  .themes-list .theme-row .theme-titre-block { grid-area: titre; }
  /* Statut : à gauche sur sa propre ligne (il était collé au titre). */
  .themes-list .theme-row .theme-statut {
    grid-area: statut;
    justify-self: start;
    align-self: center;
  }
  .theme-row > .theme-date,
  .theme-row > button.theme-date {
    grid-area: date;
    justify-self: start;
  }
  .themes-list.cours-on .theme-row .theme-cours-cell {
    grid-area: cours;
    margin-top: 0;
  }
  /* Cellule QCM : étirée sur toute la largeur pour que le bouton, les scores
     (Examen / Entraîn.) et la barre de progression s'alignent proprement. */
  .themes-list.qcm-on .theme-row .theme-qcm-cell,
  .themes-list.cours-on.qcm-on .theme-row .theme-qcm-cell {
    grid-area: qcm;
    justify-self: stretch;
    margin-top: 0;
  }
}

/* ===== Assistant : correctif ouverture mobile (2026-08-18) =====
   iOS Safari zoome automatiquement le viewport au focus d'un champ dont la
   font-size calculee est < 16px. Le textarea du chatbot n'avait aucune regle
   de police : il tombait sur le defaut navigateur (petit monospace ~13px),
   d'ou le zoom brutal a l'ouverture du panneau sur iPhone. 16px partout, pas
   seulement sous 600px : un iPad depasse ce seuil et zoome pareil. */
.chatbot-form textarea {
  font: inherit;
  font-size: 16px;
}

/* ===== Modules débloqués par les formateurs (chantier B, 2026-10) =====
   Repère « Masqué aux stagiaires » : posé chez un formateur sur ce qui est fermé
   pour la promo (entrées de la barre, tuiles, sous-onglets, en-têtes de colonnes) par
   repereMasque() de js/modules-etat.js. */
/* Lot 3, tâche 10 : l'œil « Masqué aux stagiaires » (et le titre de l'élément) repère seul ce qui est masqué. L'opacité
   réduite d'avant (55 %) faisait tomber le libellé d'un onglet, d'un sous-onglet ou d'un en-tête à 2,2:1, sous le seuil AA,
   comme dans la coquille, où le repère avait déjà retrouvé l'opacité pleine. */
.marque-masque {
  display: inline-flex;
  align-items: center;
  margin-left: 0.3rem;
  color: var(--text-muted);
  vertical-align: middle;
}
.marque-masque .icon { width: 13px; height: 13px; }

/* ===== Thèmes : repère des modules fermés, visible sur téléphone (chantier B, 2026-10) =====
   Sous 720 px, le bloc mobile des lignes de thèmes masque l'en-tête du tableau
   (« .theme-row.theme-header { display: none; } »). Or les en-têtes des colonnes Cours
   et QCM portent le repère « Masqué aux stagiaires » (œil barré) : sur iPhone, un
   formateur n'aurait plus aucun signe que ces modules sont fermés pour sa promo.
   Quand l'en-tête porte au moins un repère, themes.js lui pose « a-repere » : on le
   rétablit en bande horizontale, où ne restent que les colonnes repérées (N°, Thème,
   Statut et Fait le restent masqués comme avant).
   Spécificité : trois classes (0,3,0) contre deux (0,2,0) pour la règle qui masque, donc
   elle gagne quel que soit l'ordre des règles, sans forcer la priorité. Les autres
   règles mobiles du tableau (grilles à 3 à 5 classes) règlent grille, espacement et
   alignement : aucune ne pose « display » sur .theme-row, et « .theme-row > span:empty »
   ne vise que les cellules vides. */
@media (max-width: 720px) {
  .theme-row.theme-header.a-repere { display: flex; }
  .theme-row.theme-header.a-repere > span:not(.module-masque) { display: none; }
}

/* Section « Modules de la promo » (Paramètres). Une colonne, lignes à cible
   tactile de 44 px au moins. */
.modules-bandeau {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--r);
  background: var(--accent-soft);
}
.modules-bandeau p { margin: 0; font-weight: 600; color: var(--text); }
.modules-socle { margin: 0 0 0.5rem; font-size: 0.85rem; }
.modules-ligne {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 0.6rem;
  align-items: start;
  min-height: 44px;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-faint);
}
.modules-ligne:last-child { border-bottom: none; }
.modules-ligne.enfant { padding-left: 1.5rem; }
.modules-ligne input[type="checkbox"] {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}
.modules-ligne input[type="checkbox"]:disabled { cursor: not-allowed; }
.modules-libelle {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.modules-nom { font-weight: 600; color: var(--text); }
.modules-parent,
.modules-explication,
.modules-date { font-size: 0.82rem; }
.modules-date { color: var(--accent-strong); }

/* ===== Multi-promo : pastille de la promo affichée (2026-10) =====
   Visible seulement à qui a au moins deux promos. Sur téléphone, la flèche
   s'efface pour tenir dans la barre. */
.promo-pastille {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--sombre-bord);
  background: var(--sombre-filet);
  color: var(--sur-sombre);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.promo-pastille:hover { background: var(--sombre-survol-fort); }
/* Bascule en cours (jusqu'au rechargement) : la pastille reste affichée, sans réagir. */
.promo-pastille:disabled { opacity: 0.6; cursor: default; background: var(--sombre-filet); }
.promo-pastille-fleche { font-size: 0.7rem; opacity: 0.7; }
.promo-choix-liste {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.8rem 0;
}
.promo-choix {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-elev);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.promo-choix.active { border-color: var(--accent); background: var(--bg-subtle); font-weight: 600; }
.promo-choix-puce { color: var(--accent); }
.promo-choix-liste.en-cours { opacity: 0.6; pointer-events: none; }
.config-list .config-nom { flex: 0 1 40%; }
@media (max-width: 760px) {
  .promo-pastille { padding: 0.35rem 0.5rem; font-size: 0.74rem; }
  .promo-pastille-fleche { display: none; }
}

/* Bandeau d'état dégradé : promos non chargées après deux essais. Persistant, retiré dès qu'un
   chargement réussit. En bas de l'écran comme le bandeau d'aperçu, au-dessus de lui s'ils sont
   là tous les deux ; le texte passe à la ligne sur téléphone (width: max-content borne la
   largeur au contenu, max-width à l'écran). */
.promos-banner {
  position: fixed;
  left: 50%;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1400;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: max-content;
  max-width: calc(100vw - 24px);
  padding: 0.5rem 0.55rem 0.5rem 0.9rem;
  background: var(--c-wait-soft);
  color: var(--text);
  border: 1px solid var(--act-peda-border);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  font-size: 0.85rem;
  line-height: 1.35;
}
.promos-banner.au-dessus-apercu { bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
.promos-banner-btn {
  flex: none;
  background: var(--c-wait);
  color: #fff;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.promos-banner-btn:hover { filter: brightness(0.92); }

/* Multi-promo : sous 360 px, la pastille ne garde que la date (« sept. 2026 ») ; le lieu
   reste lisible dans la liste des promos. */
@media (max-width: 360px) {
  .promo-pastille-lieu { display: none; }
}

/* ===== Chantier D : parcours CCP2 ===== */
.ccp2-dates {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.ccp2-dates h3 { margin: 0 0 0.6rem; font-size: 1.1rem; }
.ccp2-epreuve-points { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.4rem; }
.ccp2-liens {
  list-style: none;
  margin: 0.8rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  font-size: 0.9rem;
}
.ccp2-liens a { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 2px; }
.ccp2-dates-liste { list-style: none; margin: 0; padding: 0; }
.ccp2-date {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.2rem 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line-faint);
}
.ccp2-date:last-child { border-bottom: none; }
.ccp2-date-periode { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.85rem; color: var(--text-soft); }
.ccp2-date.passe { color: var(--text-muted); }
.ccp2-date.passe .ccp2-date-periode { color: var(--text-muted); }
.ccp2-etapes-titre { margin: 1.4rem 0 0.7rem; font-size: 1.15rem; }
.ccp2-etapes { display: grid; gap: 0.6rem; }
.ccp2-etape {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.ccp2-etape[open] { border-color: var(--line-strong); }
.ccp2-etape > summary {
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  column-gap: 0.8rem;
  row-gap: 0.15rem;
  align-items: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  cursor: pointer;
  list-style: none;
}
.ccp2-etape > summary::-webkit-details-marker { display: none; }
.ccp2-etape-num {
  grid-row: 1 / span 2;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-family: var(--font); font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.ccp2-etape[open] .ccp2-etape-num { background: var(--accent); color: #fff; }
.ccp2-etape-titre { font-weight: 600; color: var(--text); }
.ccp2-etape-bref { font-size: 0.9rem; color: var(--text-muted); }
.ccp2-etape-corps { padding: 0 1rem 1rem calc(1rem + 2.1rem + 0.8rem); }
.ccp2-rubrique h4 { margin: 0.9rem 0 0.35rem; font-size: 0.95rem; color: var(--accent-strong); }
.ccp2-rubrique ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.ccp2-rubrique .ccp2-liens { margin-top: 0; }
.ccp2-source { margin: 1rem 0 0; font-size: 0.8rem; color: var(--text-muted); }
@media (max-width: 760px) {
  .ccp2-etape-corps { padding: 0 1rem 1rem; }
  .ccp2-dates { padding: 0.9rem 1rem; }
  /* Titre puis période, toujours empilés : sinon les lignes courtes tiennent sur une
     ligne et les longues sur deux, et la liste perd son alignement. */
  .ccp2-date { flex-direction: column; }
}
@media (max-width: 760px) {
  /* Barres de sous-onglets sur iPhone : jusqu'à cinq sous-onglets sur une ligne
     (Mon espace en a cinq depuis l'arrivée du livret). Toutes les barres de l'app
     suivent la même règle, pour qu'elles se ressemblent. */
  .subtabs-bar { gap: 0.1rem; }
  .subtab { padding: 0.5rem 0.5rem; font-size: 0.86rem; }
}

/* ===== Chantier D, lot 2 : fiche en sommaire et page Stagiaires ===== */

/* Fiche : nom de la personne ou de la partie, lien de retour (iPhone). */
.fiche-titre { margin: 0 0 0.9rem; font-size: 1.3rem; }
.fiche-retour {
  display: inline-flex; align-items: center; gap: 0.15rem;
  margin: 0 0 0.6rem; color: var(--accent-strong); text-decoration: none; font-size: 1rem;
}
.fiche-retour svg { width: 18px; height: 18px; }

/* Sommaire (iPhone) : une grande ligne par partie, à la manière des Réglages. */
.fiche-sommaire {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
}
.fiche-ligne {
  display: flex; align-items: center; gap: 0.6rem; min-height: 50px; padding: 0.7rem 0.9rem;
  color: var(--text); text-decoration: none; border-top: 1px solid var(--line-faint);
}
.fiche-ligne:first-child { border-top: none; }
.fiche-ligne:active { background: var(--bg-subtle); }
.fiche-ligne-nom { flex: 1; font-size: 1rem; }
.fiche-ligne-etat { color: var(--text-muted); font-size: 0.92rem; }
.fiche-ligne > svg { width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.fiche-ligne-etat.afaire, .stg-etat.afaire { color: var(--c-wait); }

/* Page Stagiaires : ordinateur, la liste à gauche et la fiche à droite. */
.stg-colonnes {
  display: grid; grid-template-columns: minmax(0, 270px) minmax(0, 1fr);
  gap: 1.75rem; align-items: start; margin-top: 1.25rem;
}
.stg-liste { display: flex; flex-direction: column; gap: 0.2rem; }
.stg-ligne {
  display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem;
  border-radius: 10px; color: var(--text); text-decoration: none;
}
.stg-ligne:hover { background: var(--bg-subtle); }
.stg-ligne.active { background: var(--accent-soft); }
.stg-ligne.active .stg-nom { color: var(--accent-strong); }
.stg-ligne-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.stg-nom { font-weight: 600; }
.stg-etats { font-size: 0.84rem; color: var(--text-muted); }
.stg-ligne > svg { display: none; width: 18px; height: 18px; color: var(--text-faint); flex: none; }
.stg-fiche { min-width: 0; }
@media (max-width: 760px) {
  /* iPhone : la liste devient un groupe de grandes lignes, avec la flèche. */
  .stg-liste {
    gap: 0; margin-top: 1rem; overflow: hidden;
    background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px;
  }
  .stg-ligne { min-height: 56px; padding: 0.7rem 0.9rem; border-radius: 0; border-top: 1px solid var(--line-faint); }
  .stg-ligne:first-child { border-top: none; }
  .stg-ligne.active { background: transparent; }
  .stg-ligne > svg { display: block; }
}

/* Partie EPCF de la fiche, chez un formateur : une ligne par épreuve. */
.epcf-fiche-actions { display: flex; flex-direction: column; gap: 0.5rem; margin: 0 0 1.25rem; }
.epcf-fiche-ligne {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; padding: 0.6rem 0.8rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev);
}
.epcf-fiche-epreuve { font-weight: 600; min-width: 5.5rem; }
.epcf-fiche-ligne .epcf-statut { flex: 1; }

/* ===== Multi-promo : seconde ligne des choix de promo (stagiaires en cours, jours avant la fin) =====
   Le nom et son résumé forment une colonne à droite de la puce, alignée sur la première ligne. Le résumé
   tient sur une ligne à 375 px ; sinon (écran étroit, texte agrandi) il passe à la ligne entre ses deux
   parties, chacune restant d'un bloc. */
.promo-choix { align-items: flex-start; }
.promo-choix-texte { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.promo-choix-detail {
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text-soft);
}
.promo-choix-segment { display: inline-block; }

/* ===== Planning : le numéro d'un élève bénévole, au toucher (formateurs, 2026-10) =====
   Sur une carte Voiture, le nom d'un élève bénévole est un bouton chez le formateur : un toucher
   affiche son numéro (lien tel:) à côté du nom, un second le masque. Chez le stagiaire, le nom reste
   du texte (voir benevoleNomEtNumero dans planning.js).
   ⚠️ EXCEPTION ASSUMÉE À LA LECTURE SEULE. Ce bouton n'est pas un contrôle d'édition : il doit rester
   actif quand `.read-only` coupe les contrôles des cartes (bloc « Read-only mode » plus haut).
   `.chips-display` y est en `pointer-events: none` et ses enfants en héritent : sans la règle
   ci-dessous, le nom serait inerte là où on en a besoin. L'audit « zéro contrôle actif » (boutons,
   champs et [tabindex] visibles de `.p-days` dont pointer-events n'est pas none) écarte donc les
   éléments marqués [data-hors-edition] : le nom-bouton, le lien du numéro et le texte « pas de
   numéro », et rien d'autre. Un contrôle d'édition ne reçoit JAMAIS cet attribut.
   Bloc en fin de fichier : la vue compacte (`.p-compact .chip`, plus haut) a la même spécificité que
   ces règles et ne cède que par l'ordre de déclaration. */
.read-only .p-days .chips-display .bnv-nom-btn,
.read-only .p-days .chips-display .bnv-nom-num { pointer-events: auto; }

/* Le nom : du texte courant, simplement souligné en pointillés (discret, mais on le voit). */
.bnv-nom-btn {
  position: relative;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline dotted var(--text-faint);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  touch-action: manipulation;   /* pas de zoom au double toucher (afficher puis masquer) */
}
/* Zone de toucher élargie sans toucher à la mise en page : le texte fait 16 px de haut en vue
   compacte, la zone atteint 28 px (minimum conseillé : 24). Côtés à 3 px seulement, pour ne pas
   mordre sur la croix de retrait de la puce en édition. */
.bnv-nom-btn::after {
  content: "";
  position: absolute;
  top: -0.4rem;
  right: -0.2rem;
  bottom: -0.4rem;
  left: -0.2rem;
}
/* Souligné plein au survol, souris seulement : sur téléphone le survol reste collé après le toucher. */
@media (hover: hover) { .bnv-nom-btn:hover { text-decoration-style: solid; } }
.bnv-nom-btn[aria-expanded="true"] { color: var(--accent-strong); text-decoration-color: var(--accent); }
.bnv-nom-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* Le numéro : un lien d'appel bien gros à toucher, ou « pas de numéro » en simple texte. */
.bnv-nom-num[hidden] { display: none !important; }
a.bnv-nom-num {
  position: relative;   /* au-dessus de la zone de toucher élargie des noms voisins (::after plus haut) */
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0 0.7rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 600;
  touch-action: manipulation;
}
span.bnv-nom-num { font-size: 0.8rem; font-style: italic; color: var(--text-muted); }
/* En édition les puces sont petites (0,7 rem) : la pastille du numéro suit, sans perdre sa zone de toucher. */
.p-editing a.bnv-nom-num { min-height: 1.75rem; padding: 0 0.55rem; font-size: 0.8rem; }

/* Puce ouverte : le nom et son numéro côte à côte, le numéro passe sous le nom si la place manque.
   En lecture, la puce prend toute sa ligne (sans virgule) : on ne lit pas un numéro collé au nom
   suivant. */
.chip.bnv-ouvert { flex-wrap: wrap; align-items: center; gap: 0.15rem 0.5rem; max-width: 100%; }
.p-compact .chips-display .chip.bnv-ouvert { flex: 1 0 100%; }
.p-compact .chips-display .chip.bnv-ouvert::after { content: none; }
/* En édition, la pastille garde sa croix : le nom et la croix sur la première ligne, le numéro dessous.
   Avec un simple retour à la ligne, la croix se retrouve seule sur une troisième ligne à 320 px. */
.p-editing .chip.bnv-ouvert {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}
.p-editing .chip.bnv-ouvert .bnv-nom-btn { grid-column: 1; grid-row: 1; justify-self: start; }
.p-editing .chip.bnv-ouvert .x { grid-column: 2; grid-row: 1; }
.p-editing .chip.bnv-ouvert .bnv-nom-num { grid-column: 1 / -1; grid-row: 2; justify-self: start; }

/* Jamais de numéro sur papier : l'impression a son propre DOM, ceci n'est qu'une ceinture. */
@media print {
  .bnv-nom-num { display: none !important; }
  .bnv-nom-btn { text-decoration: none; }
}

/* === Informations légales (conditions d'utilisation, mentions) === */
/* Le plein écran reprend le lecteur de cours ; seuls les onglets et la fenêtre
   d'acceptation ont leurs règles. Bloc en fin de fichier : il gagne sur les règles
   génériques de même spécificité. */
.legal-onglet.actif { border-color: var(--accent); color: var(--accent-strong); background: var(--accent-soft); }
.legal-titre {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-weight: var(--poids-titre-normal);
  font-size: 1.6rem;
  line-height: 1.2;
  color: var(--text);
}
.legal-modal { max-width: 34rem; }
.legal-intro { margin: 0 0 0.6rem; font-size: 0.92rem; }
.legal-essentiel {
  margin: 0 0 0.9rem;
  padding: 0.75rem 0.9rem 0.75rem 1.9rem;
  max-height: 40vh;
  overflow-y: auto;
  border-radius: 0.6rem;
  background: var(--bg-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}
.legal-essentiel li + li { margin-top: 0.3rem; }
.legal-lire { margin-bottom: 0.9rem; }
.legal-accord {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0 0 0.9rem;
  font-size: 0.92rem;
  cursor: pointer;
}
.legal-accord input { margin-top: 0.2rem; flex: 0 0 auto; width: 1.05rem; height: 1.05rem; }
.legal-deconnexion { display: block; margin: 0.7rem auto 0; }
.gate-legal { display: block; margin: 0.9rem auto 0; font-size: 0.8rem; }
/* Les tableaux des pages légales (jusqu'à 5 colonnes) suivent ceux des cours : des cartes sur téléphone (lot 2B, tâche 1). */

/* === Paramètres : données personnelles (effacement, durées de conservation) === */
.donnees-texte { margin: 0 0 0.7rem; font-size: 0.88rem; line-height: 1.45; }
.donnees-liste li { display: flex; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; font-size: 0.88rem; }
.abandon-row .btn.danger { white-space: nowrap; }

/* === Mon espace : bandeau « Ton avis sur l'app » (avis.js) === */
.avis-bandeau {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--accent-soft-2);
  border-radius: var(--r-lg);
  background: var(--accent-soft);
}
.avis-bandeau[hidden] { display: none; }
.avis-texte { flex: 1 1 18rem; min-width: 0; }
.avis-titre { margin: 0; font-weight: 600; color: var(--accent-strong); }
.avis-sous-titre { margin: 0.2rem 0 0; font-size: 0.86rem; line-height: 1.4; color: var(--text-soft); }
.avis-actions { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; }
.avis-refus {
  padding: 0.3rem 0.2rem;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}
.avis-refus:hover { color: var(--text); }

/* === Questions proposées par l'IA (éditeur QCM, formateurs) ===
   Teinte « cours » (lilas) : l'IA ne travaille que sur le cours vérifié du thème. */
.qcm-ia-panel {
  margin: 0 0 1rem; padding: 0.85rem 1rem; border-radius: 12px;
  background: var(--act-cours); border: 1px solid var(--act-cours-border);
}
.qcm-ia-panel h4 { margin: 0 0 0.3rem; font-size: 0.9rem; color: var(--text); }
.qcm-ia-note { margin: 0 0 0.7rem; font-size: 0.8rem; color: var(--text-soft); line-height: 1.45; }
.qcm-ia-card {
  margin-top: 0.6rem; padding: 0.75rem 0.85rem; border-radius: 10px;
  background: var(--bg-elev); border: 1px dashed var(--act-cours-border);
}
.qcm-ia-badge {
  font-size: 0.72rem; font-weight: 700; color: var(--text-soft);
  background: var(--act-cours); border-radius: 999px; padding: 0.1rem 0.5rem;
}
.qcm-ia-explication { margin: 0.55rem 0 0; font-size: 0.82rem; color: var(--text-soft); line-height: 1.45; }
.qcm-ia-ecartes-bloc { margin-top: 0.8rem; padding-top: 0.6rem; border-top: 1px solid var(--act-cours-border); }
.qcm-ia-ecartes-titre { margin: 0 0 0.35rem; font-size: 0.8rem; font-weight: 700; color: var(--c-stop); }
.qcm-ia-ecartes { margin: 0; padding-left: 1.1rem; font-size: 0.8rem; color: var(--text-soft); }
.qcm-ia-ecartes li { margin: 0.2rem 0; }
.qcm-ia-ecarte-enonce { font-style: italic; }
.qcm-ia-ecarte-motif { margin-left: 0.4rem; font-weight: 600; color: var(--c-stop); }
.qcm-ia-ecarte-motif::before { content: "("; }
.qcm-ia-ecarte-motif::after { content: ")"; }
.qcm-ia-etat { min-height: 1.2em; margin: 0.4rem 0 0; font-size: 0.85rem; color: var(--text-soft); }
.qcm-ia-modal select { width: 100%; }
.qcm-editor-ia {
  font-size: 0.72rem; font-weight: 600; color: var(--text-soft);
  background: var(--act-cours); border: 1px solid var(--act-cours-border);
  border-radius: 999px; padding: 0.1rem 0.45rem;
}
@media (max-width: 600px) {
  .qcm-actions:has(.qcm-ia-bouton) { flex-direction: column; }
}

/* ============================================================
   Tableau de bord du centre (#/centre, personnel seulement)
   ============================================================ */

.centre { max-width: 1100px; }
.centre-entete { margin-bottom: 1rem; }
.centre-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.centre-legende { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 1.25rem; line-height: 1.8; }
.centre-section { margin: 0 0 1.75rem; }
.centre-section > h3, .centre-section-tete h3 { font-size: 1.05rem; margin: 0 0 0.75rem; }
.centre-section-tete { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.centre-section-tete h3 { margin: 0; }
.centre-intro { color: var(--text-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }

.centre-grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.75rem;
}
.centre-carte {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.85rem 0.95rem 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
/* Un titre long garde sa largeur : la pastille passe dessous plutôt que de l'écraser en colonne (lot 3, relevé hors lot ;
   audit du 09/11, lot E). */
.centre-carte-tete { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 0.3rem 0.5rem; }
.centre-carte h4 { flex: 1 1 9rem; min-width: 0; margin: 0; font-size: 0.85rem; font-weight: 600; color: var(--text-soft); }
.centre-valeur { margin: 0.15rem 0 0; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 1.45rem; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.centre-valeur.vide { font-family: var(--font); font-size: 1rem; font-weight: 500; color: var(--text-muted); }
.centre-detail { margin: 0; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }

.centre-nature {
  flex: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.centre-nature.mesure { background: var(--c-go-soft); color: var(--c-go); }
.centre-nature.estime { background: var(--accent-soft); color: var(--accent-strong); }  /* olive, plus d'ambre (film, 11/11) */
.centre-nature.non-mesure { background: var(--bg-soft); color: var(--text-muted); }

.centre-methode { margin-top: auto; padding-top: 0.25rem; font-size: 0.8rem; }
.centre-methode summary { cursor: pointer; color: var(--accent-strong); font-weight: 500; }
.centre-methode p { margin: 0.35rem 0 0; color: var(--text-soft); line-height: 1.45; }
.centre-section > .centre-methode { margin-top: 0.75rem; }

.centre-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.centre-themes-liste {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.8rem 0.95rem;
  min-width: 0;
}
.centre-themes-liste h4 { margin: 0 0 0.5rem; font-size: 0.85rem; color: var(--text-soft); }
.centre-themes-liste ol { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
.centre-themes-liste li { font-size: 0.88rem; }
.centre-theme-nom { display: block; }
.centre-theme-val { display: block; font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.8rem; color: var(--text-muted); }
.centre-themes-tout { margin-top: 0.75rem; font-size: 0.9rem; }
.centre-themes-tout summary, .centre-methodes summary { cursor: pointer; font-weight: 500; color: var(--accent-strong); }

.centre-defile { overflow-x: auto; margin-top: 0.5rem; -webkit-overflow-scrolling: touch; }
.centre-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; background: var(--bg-elev); }
.centre-table th, .centre-table td { border-bottom: 1px solid var(--line-faint); padding: 0.4rem 0.55rem; text-align: left; vertical-align: top; }
.centre-table thead th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); white-space: nowrap; }
.centre-table td.num { font-family: var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.centre-comparaison td.courante { background: var(--accent-soft); }
.centre-comparaison tbody th { font-weight: 500; color: var(--text-soft); }

.centre-suivre { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.centre-suivre li {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.6rem 0.8rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}
.centre-suivre-nom { font-weight: 600; color: var(--text); }
.centre-signaux { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.centre-signal { background: var(--c-wait-soft); color: var(--c-wait); white-space: normal; }
/* Une feuille ouverte n'est pas une alerte : le vert de « Ouverte » (Aujourd'hui), pas l'ambre des signaux (film, 11/11). */
.centre-ouverte { background: var(--c-go-soft); color: var(--c-go); }

.centre-methodes dl { margin: 0.5rem 0 0; font-size: 0.85rem; }
.centre-methodes dt { font-weight: 600; margin-top: 0.6rem; }
.centre-methodes dd { margin: 0.15rem 0 0; color: var(--text-soft); line-height: 1.45; }

.centre-modal p { line-height: 1.5; font-size: 0.92rem; }
.centre-avertissement { background: var(--c-wait-soft); color: var(--text); border-radius: var(--r-sm); padding: 0.55rem 0.7rem; }
.centre-case { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; }
/* Saisie des résultats du jury (fenêtre de la page Indicateurs) : une ligne par stagiaire, la liste défile en hauteur seulement. */
.centre-jury-saisir { margin-top: 0.6rem; align-self: flex-start; min-height: 44px; }
.centre-jury-date { display: flex; flex-direction: column; gap: 0.3rem; font-weight: 500; margin-top: 0.5rem; }
.centre-jury-liste { list-style: none; margin: 0.75rem 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem;
  max-height: min(50vh, 26rem); overflow-y: auto; overflow-x: hidden; }
.centre-jury-liste li { display: flex; flex-direction: column; gap: 0.3rem; padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }
.centre-jury-liste li:last-child { border-bottom: 0; }
.centre-jury-nom { font-weight: 600; }
.centre-jury-liste select { width: 100%; min-height: 44px; }
.centre-jury-repasse { font-weight: 400; font-size: 0.85rem; min-height: 44px; }
.centre-erreur { padding: 1rem 0; }
/* Pages de la direction qui regardent tout le centre (lot 5, Task 7) : Vue d'ensemble, Émargement, Notes et examens. */
.centre-promo { margin-left: 0.5rem; background: var(--bg-soft); color: var(--text-soft); white-space: normal; }
.centre-vide { padding: 1rem 0; }
.centre-vide p { margin: 0 0 0.75rem; color: var(--text-soft); }
.centre-detail-promo { min-width: 0; }
.centre-table td.liste-actions { white-space: nowrap; text-align: right; }
.centre-table td.liste-actions .btn { min-height: 44px; }
/* L'export du tableau du centre (CSV) est offert sur ordinateur seulement. */
@media screen and (max-width: 1079.98px) {
  .solo-ordinateur, .btn.solo-ordinateur, .at-tout.solo-ordinateur, .em-ligne-actions.solo-ordinateur { display: none; }
}

/* Vue d'ensemble du réseau et fiche d'un centre (lot 5, Task 11). */
.reseau-lien { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent-strong); font-weight: 600; text-decoration: none; }
.reseau-lien:hover { text-decoration: underline; }
.reseau-remarque { color: var(--text-soft); }
.reseau-table td { vertical-align: middle; }
.reseau-table td.num { text-align: left; }

/* Page Promos de la direction (lot 5, Task 8). */
.promo-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0.75rem; align-items: start; }
.promo-carte { gap: 0.45rem; }
.promo-carte-tete { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.promo-carte-tete h4 { font-size: 1rem; color: var(--text); margin-right: 0.2rem; overflow-wrap: anywhere; }
.promo-carte-tete .centre-promo { margin-left: 0; }
.promo-etat { background: var(--bg-soft); color: var(--text-soft); white-space: nowrap; }
.promo-etat-cours { background: var(--c-go-soft); color: var(--c-go); }
.promo-etat-venir { background: var(--c-wait-soft); color: var(--c-wait); }
.promo-ligne { margin: 0; font-size: 0.88rem; line-height: 1.4; display: flex; flex-wrap: wrap; gap: 0.1rem 0.6rem; align-items: baseline; }
.promo-etiquette { flex: none; min-width: 5.6rem; font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.promo-avancement { align-items: center; }
.promo-barre { flex: 1 1 6rem; min-width: 5rem; height: 0.55rem; border-radius: 999px; background: var(--bg-soft); overflow: hidden; display: block; }
.promo-barre-remplie { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.promo-pct { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: 0.82rem; color: var(--text-soft); white-space: nowrap; }
.promo-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.35rem; }
.promo-actions .btn { min-height: 44px; }
.promo-modules { grid-column: 1 / -1; min-width: 0; }
.promo-refus { margin: 0; min-height: 1.2em; font-size: 0.9rem; color: var(--c-stop); }
.promo-fenetre input, .promo-fenetre select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.promo-fenetre .modal-actions .btn { min-height: 44px; }

@media (max-width: 640px) {
  .centre-themes { grid-template-columns: 1fr; }
  .centre-grille { grid-template-columns: 1fr; }
  .centre-valeur { font-size: 1.3rem; }
}

@media print {
  body.centre-printable > *:not(#app) { display: none !important; }
  body.centre-printable #app > *:not(#view) { display: none !important; }
  body.centre-printable, body.centre-printable #app, body.centre-printable #view { background: #fff; padding: 0; margin: 0; }
  body.centre-printable .centre { max-width: none; font-size: 10pt; }
  body.centre-printable .centre-actions { display: none !important; }
  /* Les méthodes des cartes sont toutes dans la section « Méthodes de calcul », dépliée à l'impression. */
  body.centre-printable .centre-carte .centre-methode,
  body.centre-printable .centre-section > .centre-methode { display: none !important; }
  body.centre-printable .centre-grille { grid-template-columns: repeat(3, 1fr); gap: 2.5mm; }
  body.centre-printable .centre-carte,
  body.centre-printable .centre-themes-liste,
  body.centre-printable .centre-suivre li,
  body.centre-printable .centre-table tr { break-inside: avoid; }
  body.centre-printable .centre-section > h3,
  body.centre-printable .centre-section-tete { break-after: avoid; }
  body.centre-printable .centre-defile { overflow: visible; }
  body.centre-printable .centre-methode summary,
  body.centre-printable .centre-themes-tout summary,
  body.centre-printable .centre-methodes summary { color: var(--text); }
  body.centre-printable .centre-themes { grid-template-columns: 1fr 1fr; }
}

/* ===== Tableaux en listes hors ordinateur (lot 2A, tâche 5 ; spec § 4.1 : aucun défilement de côté) =====
   Sous 1 080 px, un tableau marqué par tableauEnListe (js/utils.js) devient une liste : chaque ligne est une carte, son
   titre (.liste-titre, ou l'en-tête de ligne) en tête, puis ses valeurs, chacune précédée du titre de sa colonne
   (data-label). L'en-tête du tableau reste à la disposition des lecteurs d'écran. À l'écran seulement : l'export PDF
   du tableau de bord du centre (impression A4) garde ses tableaux. */
@media screen and (max-width: 1079.98px) {
  .centre-defile { overflow: visible; }
  .tableau-liste, .tableau-liste tbody, .tableau-liste tr, .tableau-liste th, .tableau-liste td { display: block; }
  .tableau-liste thead {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
    clip-path: inset(50%); white-space: nowrap;
  }
  .tableau-liste tr {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.9rem;
    padding: 0.7rem 0.95rem; border-bottom: 1px solid var(--line);
  }
  .tableau-liste tbody tr:last-child { border-bottom: 0; }
  .tableau-liste th, .tableau-liste td { min-width: 0; padding: 0; border: 0; text-align: left; overflow-wrap: anywhere; }
  .tableau-liste td:empty { display: none; }   /* une valeur absente n'écrit pas son titre pour rien */
  .tableau-liste td[data-label]::before {
    content: attr(data-label); margin-right: 0.4rem;
    font-family: var(--font); font-size: 0.68rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted);
  }
  .tableau-liste .liste-titre, .tableau-liste tbody th { order: -2; flex: 1 1 12rem; font-weight: 600; color: var(--text); }
  .tableau-liste .liste-actions { order: -1; margin-left: auto; }
  .centre-table td.liste-titre { flex-basis: 100%; }   /* le thème seul sur sa ligne, ses chiffres dessous */
  .passages-table tbody tr:hover td { background: transparent; }   /* le survol colore la carte, pas chaque valeur */
  .passages-table tbody tr:hover { background: var(--bg-subtle); }

  /* Comparer les promos : l'indicateur en titre, puis une ligne par promo (nom à gauche, valeur à droite). */
  .centre-comparaison tbody tr { flex-direction: column; align-items: stretch; gap: 0.2rem; }
  .centre-comparaison tbody th { flex: 0 0 auto; }   /* en colonne, la base de 12 rem du titre serait une hauteur */
  .centre-comparaison td { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.2rem 0.4rem; border-radius: var(--r-sm); }
  .centre-comparaison td[data-label]::before { margin-right: 0; font-size: 0.8rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
}

@media screen and (max-width: 699.98px) {
  .passages-table .btn { min-width: 44px; min-height: 44px; }   /* zones à toucher du téléphone */
}

/* Porte de connexion sur téléphone : cibles de 44 px. C'est l'écran que voient un compte du siège ou sans promo, avec
   la phrase qui leur dit pourquoi ils n'entrent pas (lot 4, comptes réels). */
@media (max-width: 760px) {
  .gate-tab, .gate-form .btn, .gate-link { min-height: 44px; }
  .gate-link { display: block; margin-left: auto; margin-right: auto; padding: 0 0.5rem; }
}

/* Page Stagiaires de la direction (lot 5, Task 9). */
.stg-filtre { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 0.75rem; margin: 0 0 1.25rem; }
.stg-filtre .field { min-width: 0; }
.stg-filtre input, .stg-filtre select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.stg-phrase { margin: 0 0 1rem; padding: 0.6rem 0.8rem; border-radius: 10px; background: var(--bg-soft); color: var(--text); }
.stg-groupe .stg-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.2rem 0.75rem; }
.stg-groupe .stg-ligne { min-height: 44px; }
.stg-compte { font-size: 0.88rem; }
.stg-anonymises { margin: 0.5rem 0 0; font-size: 0.85rem; }
.stg-abandons { margin-top: 0.5rem; }
.stg-abandons summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--text-soft); }
.stg-ligne-abandon .stg-nom { color: var(--text-soft); font-weight: 500; }
.stg-gestion { margin-top: 1rem; }
.stg-groupe .promo-actions { margin-top: 0.75rem; }
.stg-gestion .config-list li, .stg-gestion .config-add, .stg-gestion .abandon-row { flex-wrap: wrap; }
.stg-gestion .config-list input, .stg-gestion .config-add input { flex: 1 1 8rem; min-width: 0; }
.stg-centre .btn, .stg-gestion .config-list input, .stg-gestion .config-add input, .stg-gestion .invite-form select,
.stg-gestion .invite-form input { min-height: 44px; box-sizing: border-box; }
@media (max-width: 760px) {
  .stg-filtre { grid-template-columns: minmax(0, 1fr); }
  .stg-groupe .stg-liste { display: flex; }
}

/* Page Équipe de la direction (lot 5, Task 10). */
.equipe-nom { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; }
.equipe-adresse { font-size: 0.82rem; overflow-wrap: anywhere; }
.equipe-role { background: var(--bg-soft); color: var(--text-soft); white-space: nowrap; }
.equipe-role-direction { background: var(--accent-soft); color: var(--accent-strong); }
.equipe-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }
.equipe-centre .btn { min-height: 44px; }
.equipe-actions .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.equipe-actions .btn svg { width: 16px; height: 16px; flex: none; }
.equipe-fenetre { max-height: calc(100dvh - 2rem); overflow-y: auto; }
.equipe-intro, .equipe-note { margin: 0; font-size: 0.88rem; overflow-wrap: anywhere; }
.equipe-fenetre input[type="email"], .equipe-fenetre select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.equipe-cases { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.equipe-cases legend { padding: 0; margin-bottom: 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.equipe-case { display: flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 0.5rem; border-radius: var(--r-sm); cursor: pointer; overflow-wrap: anywhere; }
.equipe-case:hover { background: var(--bg-subtle); }
.equipe-case input { width: 20px; height: 20px; flex: none; margin: 0; }
/* Titres et droits à la carte (étape 3, Task 31) : personnes, invitation, titres du centre, éditeur de titre, journal. */
.equipe-pastilles { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.equipe-centre .centre-defile { overflow-x: visible; }
.equipe-sous-titre { margin: 1rem 0 0.25rem; font-size: 1rem; }
.equipe-cadenas { display: inline-flex; color: var(--text-soft); }
.equipe-cadenas svg { width: 16px; height: 16px; }
.equipe-inviter { display: flex; flex-direction: column; gap: 0.9rem; max-width: 34rem; }
.equipe-inviter .field { margin: 0; min-width: 0; }
.equipe-inviter input[type="email"], .equipe-inviter select { width: 100%; min-width: 0; min-height: 44px; box-sizing: border-box; }
.equipe-inviter [hidden] { display: none; }
.equipe-apercu h4, .equipe-barre h4 { margin: 0 0 0.35rem; font-size: 0.9rem; }
.equipe-droits { margin: 0 0 0.4rem; padding-left: 1.1rem; font-size: 0.9rem; }
.equipe-formulaire-actions { display: flex; }
.equipe-formulaire-actions .btn { display: inline-flex; align-items: center; gap: 0.35rem; }
.equipe-formulaire-actions .btn { min-height: 44px; }
.equipe-formulaire-actions .btn svg { width: 16px; height: 16px; flex: none; }
.equipe-pages { display: flex; flex-direction: column; gap: 0.4rem; }
.equipe-page { margin: 0; padding: 0.4rem 0.6rem; border: 1px solid var(--line); border-radius: var(--r-sm); min-width: 0; }
.equipe-page legend { padding: 0 0.3rem; font-size: 0.9rem; font-weight: 600; color: var(--text); }
.equipe-choix-groupe { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.equipe-choix { display: inline-flex; align-items: center; gap: 0.45rem; min-height: 44px; min-width: 44px; padding: 0 0.6rem; border-radius: var(--r-sm); cursor: pointer; }
.equipe-choix:hover { background: var(--bg-subtle); }
.equipe-choix input { width: 20px; height: 20px; flex: none; margin: 0; }
.equipe-releve:empty { display: none; }
.equipe-releve, .equipe-bandeau, .equipe-porteurs { margin: 0; padding: 0.55rem 0.75rem; border-radius: var(--r-sm); font-size: 0.88rem; overflow-wrap: anywhere; }
.equipe-releve { background: var(--accent-soft); color: var(--accent-strong); }
.equipe-bandeaux { display: flex; flex-direction: column; gap: 0.4rem; }
.equipe-bandeau { background: var(--c-wait-soft); color: var(--text); }
.equipe-porteurs { background: var(--bg-soft); color: var(--text); }
.equipe-barre-liste { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.equipe-barre-liste li { padding: 0.2rem 0.6rem; border-radius: 8px; background: var(--bg-soft); color: var(--text-soft); font-size: 0.85rem; }
.equipe-journal summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; }
.equipe-journal-liste { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.9rem; overflow-wrap: anywhere; }
.equipe-journal-liste li { margin: 0.25rem 0; }
@media screen and (max-width: 1079.98px) {
  .equipe-table .liste-actions { order: 5; flex-basis: 100%; margin-left: 0; }
  .equipe-actions { justify-content: flex-start; }
}

/* ===== Cours et QCM du siège : sans promo, ni statut ni date (lot 5, tâche 13) =====
   Le siège rédige les contenus communs : la liste des thèmes n'a que le numéro, le titre, le cours et le QCM. Les grilles
   reprennent celles d'au-dessus sans les colonnes Statut et Fait le (même ordre des sources, une classe de plus). */
.themes-list.sans-promo .theme-row { grid-template-columns: 50px 1fr 36px; }
.themes-list.sans-promo.qcm-on .theme-row { grid-template-columns: 50px 1.2fr minmax(170px, 0.8fr) 36px; }
.themes-list.sans-promo.cours-on .theme-row { grid-template-columns: 50px 1fr 100px 36px; }
.themes-list.sans-promo.cours-on.qcm-on .theme-row { grid-template-columns: 50px 1fr 100px minmax(170px, 0.7fr) 36px; }
@media (max-width: 720px) {
  .themes-list.sans-promo .theme-row,
  .themes-list.sans-promo.qcm-on .theme-row,
  .themes-list.sans-promo.cours-on .theme-row,
  .themes-list.sans-promo.cours-on.qcm-on .theme-row {
    grid-template-columns: 36px 1fr;
    grid-template-areas: "num titre" ". cours" ". qcm";
  }
  .themes-list.sans-promo .theme-row .theme-cours-cell { grid-area: cours; margin-top: 0.2rem; justify-self: start; }
  .themes-list.sans-promo .theme-row .theme-qcm-cell { grid-area: qcm; margin-top: 0.2rem; justify-self: stretch; }
  .themes-list.sans-promo .theme-titre-link { min-height: 44px; }
}
@media (max-width: 480px) {
  .themes-list.sans-promo .theme-row,
  .themes-list.sans-promo.qcm-on .theme-row,
  .themes-list.sans-promo.cours-on .theme-row,
  .themes-list.sans-promo.cours-on.qcm-on .theme-row {
    grid-template-columns: auto 1fr;
    grid-template-areas: "num titre" "cours cours" "qcm qcm";
  }
}

/* ============================================================
   Planning, audit du 09/11 (lot B) : l'éditeur et la barre de la semaine.
   ============================================================ */
/* B1 : une carte étroite (trois activités au même horaire) garde le nom de son activité ; le formateur passe à la ligne
   au lieu de l'écraser, la corbeille reste au bout de la première ligne. */
.p-lane-header { flex-wrap: wrap; }
.p-lane-activite-wrap { flex: 1 1 9.5rem; min-width: min(9.5rem, 100%); }
.p-lane-delete { margin-left: auto; }

/* B5 : le dé et l'absence disent ce qu'ils font. Le mot suit l'icône ; ni opacité ni gris pâle (contraste AA). */
.p-dice-btn, .p-abs-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  font-size: 0.78rem; font-weight: 600; line-height: 1;
}
.p-dice-btn svg, .p-abs-btn svg { width: 15px; height: 15px; flex: none; }
.p-dice-mot { white-space: nowrap; }
.p-dice-btn { color: var(--text); }
/* Le dé tourne, pas le mot : la rotation passe du bouton à son icône. */
.p-dice-btn:hover, .p-dice-btn:active { transform: none; }
.p-dice-btn svg { transition: transform 0.12s; }
.p-dice-btn:hover svg { transform: rotate(15deg); }
.p-dice-btn:active svg { transform: rotate(360deg) scale(0.92); transition: transform 0.4s; }
.p-abs-btn {
  height: 30px; padding: 0.18rem 0.45rem; opacity: 1;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg-elev); color: var(--text-soft);
}
.p-abs-btn:hover { border-color: var(--c-stop); color: var(--c-stop); }
.p-abs-btn.active { background: var(--c-stop-soft); border-color: var(--c-stop); color: var(--c-stop); }
/* « Au tableau » : le choix du stagiaire garde sa largeur, « Tirer » et « Absent » passent à la ligne s'il le faut. */
.p-lane-role.pedagogue { flex-wrap: wrap; row-gap: 0.35rem; }
.p-lane-role.pedagogue .person-select { flex: 1 1 8rem; min-width: 0; }

/* « Vider les placements » à l'écart de « Placer la semaine » : en bout de barre. */
.week-bar-actions .p-vider-btn { margin-left: auto; }

/* Téléphone, mode Modifier : les commandes de l'éditeur à 44 px (le bloc des cibles du lot E l'écartait). */
@media (max-width: 699.98px) {
  .p-editing .p-dice-btn, .p-editing .p-abs-btn, .p-editing .p-lane-delete, .p-editing .p-lane-drag,
  .p-editing .p-salle-toggle-btn, .p-editing .p-day-toggle, .p-editing .p-add-suite,
  .p-editing .p-add-parallele-mini, .p-editing .p-dice-option, .p-edit-pill-btn {
    min-height: 44px; min-width: 44px;
  }
  .p-editing .p-dice-btn, .p-editing .p-abs-btn { height: auto; }
  .p-editing :is(.p-half-head.editable, .p-lane-activite-wrap select, .p-prof-display, .chips-display, .person-display,
    .p-lane-notes-input, .sujet-chip-input) { min-height: 44px; }
  /* La croix d'un thème : 44 px à toucher, sans grandir la pastille (marges négatives, fond transparent). */
  .p-editing .sujet-chip-x { min-width: 44px; min-height: 44px; margin: -0.6rem -0.6rem -0.6rem -0.3rem; }
  /* Barre des jours de la liste (lecture et édition) : 44 px aussi. */
  .p-daynav-btn { min-height: 44px; }
}

/* ===== Saisie des notes (lot C de l'audit du 09/11) =====
   Sous-onglet « Saisir » de Notes et examens : la liste de ce qu'on note, puis une ligne par stagiaire avec un grand
   champ. Pensé d'abord pour le téléphone (cibles de 44 px, rien qui déborde). */
.saisie { display: flex; flex-direction: column; gap: 0.6rem; max-width: 640px; }
.saisie-titre { margin: 0.2rem 0 0; font-size: 1.1rem; }
.saisie-recherche {
  width: 100%; box-sizing: border-box; min-height: 44px; padding: 0.5rem 0.75rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg-elev);
  color: var(--text); font: inherit;
}
.saisie-liste { display: flex; flex-direction: column; gap: 0.35rem; }
.saisie-section {
  margin: 0.8rem 0 0.2rem; font-size: 0.78rem; letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--text-etiquette);
}
.saisie-cible {
  display: grid; grid-template-columns: 3.4rem 1fr auto; align-items: center; gap: 0.6rem;
  width: 100%; min-height: 44px; padding: 0.45rem 0.75rem; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-elev);
  color: var(--text); font: inherit; cursor: pointer;
}
.saisie-cible:hover, .saisie-cible:focus-visible { border-color: var(--accent); }
.saisie-cible-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-strong); }
.saisie-cible-titre { min-width: 0; overflow-wrap: anywhere; }
.saisie-cible-avancement { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.saisie-cible.complete .saisie-cible-avancement { color: var(--accent-strong); font-weight: 600; }
.saisie-aucune { margin: 0.4rem 0; }
.saisie-entete { display: flex; flex-direction: column; gap: 0.3rem; }
.saisie-retour { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: 0.3rem; }
.saisie-retour svg { width: 18px; height: 18px; }
.saisie-compteur { margin: 0; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.saisie-date { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; }
.saisie-changer-date, .saisie-reessayer {
  min-height: 44px; padding: 0 0.4rem; border: 0; background: none; font: inherit;
  color: var(--accent-strong); text-decoration: underline; cursor: pointer;
}
.saisie-date input[type="date"] { min-height: 44px; font: inherit; }
.saisie-lignes { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.4rem; }
.saisie-ligne {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.75rem; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-elev);
}
.saisie-qui { display: flex; flex-direction: column; min-width: 0; gap: 0.15rem; }
.saisie-nom { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.saisie-etat { font-size: 0.82rem; color: var(--text-muted); }
.saisie-etat.erreur { color: var(--c-stop); }
/* L'état d'une ligne et, après une connexion perdue, « Réessayer » à côté (finitions du lot C). */
.saisie-etat-ligne { display: flex; flex-wrap: wrap; align-items: center; column-gap: 0.2rem; }
.saisie-reessayer { padding: 0 0.3rem 0 0; font-size: 0.9rem; }   /* bord gauche aligné sur le texte quand il passe à la ligne */
.saisie-champ {
  flex: 0 0 5.5rem; width: 5.5rem; height: 48px; min-height: 48px; box-sizing: border-box; padding: 0.4rem 0.5rem;
  border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg);
  color: var(--text); font: inherit; font-size: 20px; font-variant-numeric: tabular-nums; text-align: center;
}
.saisie-champ:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
/* Ce que veulent dire les sigles de la matrice : une ligne sous le tableau. */
.matrice-legende { margin: 0.5rem 0 0; font-size: 0.82rem; line-height: 1.5; }

/* État vide des notes (lot C) : une carte, une phrase, une action, à la place des tirets et des barres vides. */
.notes-vide {
  margin: 0.4rem 0 1rem; padding: 1.2rem 1rem; text-align: center;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg-elev);
}
.notes-vide-titre { margin: 0 0 0.35rem; font-size: 1.05rem; }
.notes-vide-phrase { margin: 0 auto 0.9rem; max-width: 34rem; color: var(--text-soft); line-height: 1.45; }
.notes-vide-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
.notes-vide-actions .btn { min-height: 44px; }
/* Moyennes EPCF de la classe vides : la même carte, et l'avancement pour l'équipe (« Pour l'instant : 1 stagiaire évalué
   en salle, aucun en véhicule. »), entre la phrase et le bouton. */
.notes-vide-info { margin: -0.45rem auto 0.9rem; max-width: 34rem; font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.notes-sans-note { margin: 0.3rem 0 0; font-size: 0.85rem; }

/* Bloc d'examen de la liste des thèmes (lot C) : l'état en clair (« Ouvert jusqu'à 16 h 30 ») et le bouton pour
   ouvrir ou fermer, pour le formateur. Pleine largeur et 44 px sur téléphone. */
.theme-qcm-examen { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; align-self: stretch; margin-top: 6px; }
.theme-qcm-examen-etat { font-size: 0.74rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.theme-qcm-examen.ouvert .theme-qcm-examen-etat { color: var(--accent-strong); font-weight: 600; }
.theme-qcm-examen .btn { min-height: 28px; white-space: nowrap; }
.exam-duree-theme { margin: 0 0 0.2rem; font-weight: 600; }
.exam-duree-resume { margin: 0 0 0.5rem; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .theme-qcm-examen { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .theme-qcm-examen-etat { flex: 1 1 100%; }
  .theme-qcm-examen .btn { flex: 1 1 auto; min-height: 44px; }
}

/* === Ordre de passage (Planning), refonte du 11/11 : chacun sa vue ===
   docs/superpowers/specs/2026-11-11-ordre-passage-resultats-design.md. Téléphone d'abord, lignes de 44 px. */
.op-carte, .res-carte { background: var(--bg-elev); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 0.75rem 1rem; margin: 0 0 0.75rem; }
.op-cle, .res-cle { background: var(--bg-lin); border: 1px solid var(--line-lin); border-radius: var(--r-lg);
  padding: 0.85rem 1rem; margin: 0 0 0.75rem; }
.op-carte-titre, .res-carte-titre { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 0.25rem;
  font-size: 0.95rem; font-weight: 600; color: var(--accent-strong); }
.op-carte-titre svg { width: 18px; height: 18px; }
.op-file { list-style: none; margin: 0; padding: 0; }
.op-ligne { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 44px;
  border-top: 1px solid var(--line-faint); }
.op-file .op-ligne:first-child, .op-cle .op-carte-titre + .op-ligne { border-top: 0; }
.op-ligne-type { display: inline-flex; align-items: center; gap: 0.45rem; }
.op-ligne-type svg { width: 18px; height: 18px; color: var(--accent); }
.op-nom { display: inline-flex; align-items: center; gap: 0.6rem; min-width: 0; overflow-wrap: anywhere; }
.op-rang { color: var(--text-muted); font-variant-numeric: tabular-nums; min-width: 1.2em; }
.op-ligne-fin { display: inline-flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: flex-end; }
.op-etat { font-weight: 600; color: var(--accent-strong); white-space: nowrap; }
.op-etat.retard { background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px;
  padding: 0.15rem 0.6rem; font-size: 0.85rem; }
.op-place { font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.op-vide { margin: 0.35rem 0 0.2rem; color: var(--text-soft); }
.op-phrase { margin: 0 0 0.4rem; font-size: 1.05rem; color: var(--text); }
.op-prochain { display: flex; align-items: center; gap: 0.45rem; margin: 0 0 1rem; color: var(--text-soft); }
.op-prochain svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.op-chiffres { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.op-chiffre { display: flex; flex-direction: column; gap: 0.15rem; }
.op-chiffre-val { font-size: 1.75rem; font-weight: 600; color: var(--accent-strong); line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.op-chiffre-lib { font-size: 0.85rem; color: var(--text-soft); line-height: 1.25; }
.op-files { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; }
@media (min-width: 761px) { .op-files { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.op-ajour { margin: 0 0 0.75rem; }
.op-ajour summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; color: var(--accent-strong);
  font-weight: 600; }
.op-ajour p { margin: 0 0 0.5rem; color: var(--text-soft); }
.op-actions { margin: 0 0 1rem; }
.op-actions .btn { min-height: 44px; }
.op-historique { margin-top: 2.5rem; }

/* === Mon suivi > Résultats, vue « Moi » : le tableau de bord (refonte du 11/11) === */
.res-cle-ligne { display: flex; align-items: baseline; gap: 0.4rem; margin: 0; }
.res-cle-moy { font-size: 2.25rem; font-weight: 600; color: var(--accent-strong); line-height: 1.1;
  font-variant-numeric: tabular-nums; }
.res-cle-sur { color: var(--text-soft); }
.res-cle-detail { margin: 0.2rem 0 0; color: var(--text-soft); }
.res-forces { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1rem; margin-top: 1rem; }
@media (min-width: 761px) { .res-forces { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.res-sujets { list-style: none; margin: 0; padding: 0; }
.res-sujet { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; min-height: 44px;
  border-top: 1px solid var(--line-faint); }
.res-sujet:first-child { border-top: 0; }
.res-sujet-lib { min-width: 0; overflow-wrap: anywhere; }
.res-sujet-note { font-weight: 600; color: var(--accent-strong); font-variant-numeric: tabular-nums; }
.res-lien { display: flex; align-items: center; justify-content: space-between; min-height: 44px; box-sizing: border-box;
  color: var(--text); text-decoration: none; font-weight: 600; }
.res-lien:hover { border-color: var(--line-strong); }
.res-lien-fin { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--text-soft); font-weight: 400; }
.res-lien-fin svg { width: 18px; height: 18px; }
.op-ajour summary { list-style: none; gap: 0.4rem; }
.op-ajour summary::-webkit-details-marker { display: none; }
.op-ajour summary::after { content: ""; width: 0.45em; height: 0.45em; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-left: 0.35rem; }
.op-ajour[open] summary::after { transform: rotate(-135deg) translateY(-1px); }
