/* classe.css — l'espace Classe : les quatre volets (Élèves, Observations,
   Budget, Outils), la grille du jour, les suivis, la coopérative, les
   feuilles à imprimer et leur aperçu, et l'écran Observer (le geste de
   classe, au pouce).
   La tête de page et la fiche dépliée sont communes (base.css :
   .barre-espace, .fiche-depliee) ; ici, ce que la Classe y pose. Une seule
   colonne, plus large pour les observations et les outils ; rien sur le
   côté : les séances (un menu sous la date du jour), les participations,
   la liste des outils passent au-dessus ou au-dessous. Téléphone : la fiche d'un élève est l'écran.
   Téléphone : la page bord à bord ; l'écran Observer prend tout l'écran (la
   barre des espaces s'efface, « Terminé » tient en bas).
   Les couleurs des pastilles viennent de [data-pastille] (base.css) :
   --o-fond, --o-encre, --o-bord ; celles des blocs de [data-teinte]. En pied :
   les feuilles imprimées (.ic-page), à l'écran dans l'aperçu comme sur papier. */

/* ————— ce que la Classe pose dans la barre d'espace ————— */
.barre-espace .c-periode, .barre-espace .c-choix-compte { min-height: var(--h-ctrl); }
.c-filtre { display: inline-flex; align-items: center; gap: 8px; }

/* ————— ce que la Classe pose dans la fiche dépliée ————— */
.c-fl-compte { padding: 2px 10px; font-size: 12.5px; font-weight: 700; color: var(--encre-2); white-space: nowrap; }
.c-fl-valeur { display: block; padding-top: 5px; overflow-wrap: anywhere; white-space: pre-line; }
.c-fl-montant { font-family: var(--police-titre); font-size: 19px; font-variant-numeric: tabular-nums; }
.fiche-depliee .c-fl-vide { padding-top: 5px; }
.fiche-depliee .c-fiche-obs, .fiche-depliee .c-groupe { min-width: 0; }
.fiche-depliee .c-rangee { padding-top: 3px; }
.fiche-depliee .c-entree { padding: 3px 4px; }
.fiche-depliee .segments { max-width: 100%; }
/* téléphone : la fiche d'un élève est l'écran (la barre porte « ← ») */
.c-page > .fiche-depliee { width: 100%; max-width: 720px; margin: 0 auto; }

/* la tête de section du volet (la période, le tri), sur le papier au-dessus du plan */
.c-sous-tete { padding: 0 var(--gouttiere); margin-bottom: 12px; }
.c-sous-tete[hidden] { display: none; }
/* le compte des élèves est dans la tête de section : la liste ne le redit pas */
.c-sous-tete:not([hidden]) + .c-page .c-effectif { display: none; }

/* ————— la page ————— */
.c-page { flex: 1; width: 100%; padding: 0 var(--gouttiere) 32px; display: flex; flex-direction: column; gap: 12px; }
.c-page.c-page-observer { padding-top: 0; }
.c-plan-eleves .fiche-depliee { margin: 6px 0; }
/* la grille du jour, seule dans sa carte : chaque case porte ses pastilles et sa note */
.c-seance-vue { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.c-contenu { padding: 14px 14px 16px; }
.c-notes-classe { margin: 0 6px 12px; font-size: 14px; color: var(--encre-2); white-space: pre-line; }
.c-effectif { padding: 0 10px 4px; }

.c-volet { display: flex; flex-direction: column; gap: 12px; }
.c-barre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 0 6px; }
.c-rangee { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-periode { max-width: 100%; }
.c-liste { display: flex; flex-direction: column; gap: 1px; }
.c-liste .ligne { min-height: 40px; padding-block: 3px; }
.c-initiale { width: 28px; height: 28px; border-radius: 8px; font-size: 13px; background: var(--creux-2); color: var(--encre-2); }
.c-deux-lignes { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.c-seance { display: flex; flex-direction: column; gap: 6px; padding-top: 8px; }
.c-seance > .section-titre { padding: 0 6px; font-size: 16px; }
.c-seance > p { padding: 0 6px; }
.c-seance > .c-rangee { padding: 0 6px; }
/* une liste à gauche, le détail à droite (modes Suivi et Élève) */
.c-deux-colonnes { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 12px; align-items: start; }
.c-colonne-liste { position: sticky; top: calc(var(--barre-haut) + 62px); max-height: calc(100vh - var(--barre-haut) - 80px); overflow-y: auto; }
.c-colonne-liste .c-seance:first-child { padding-top: 0; }
/* dans la colonne étroite, la grille d'à côté montre le détail : le titre du suivi passe avant ses comptes */
.c-colonne-liste .c-seance .c-bilan { display: none; }

.c-vide { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 36px 16px; }
.c-vide p:not(.titre), .c-accueil p:not(.titre) { max-width: 48ch; color: var(--encre-2); }
.c-gestes-vide { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 6px; }
.c-accueil { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 48px 20px; }
.c-accueil .titre { font-size: 24px; }
.c-accueil-tuile { width: 56px; height: 56px; border-radius: var(--rayon-l); background: var(--accent-doux); color: var(--accent-texte); }

/* ————— pastilles en lecture ————— */
.c-case {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 999px;
  background: var(--o-fond); color: var(--o-encre); border: 1px solid var(--o-bord);
  font-weight: 800; font-size: 14px; line-height: 1;
}
.c-case[data-pastille=''] { border-style: dashed; }
.c-bilan { display: inline-flex; gap: 4px; flex: none; }
.c-compte {
  display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: 999px;
  background: var(--o-fond); color: var(--o-encre); font-size: 12px; font-weight: 700; white-space: nowrap;
}

/* ————— fenêtres : fiche d'un élève, liste collée, choix des blocs ————— */
.c-deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.c-fiche-obs { display: flex; flex-direction: column; gap: 10px; }
.c-groupe { display: flex; flex-direction: column; }
.c-groupe-titre { display: flex; align-items: flex-start; gap: 8px; font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--encre-2); padding: 8px 0 2px; }
.c-entree { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 3px 6px; border: none; background: none; border-radius: var(--rayon-s); text-align: left; width: 100%; font-size: 14px; }
.c-entree .c-case { width: 10px; height: 10px; background: var(--o-bord); }
.c-entree .c-case[data-pastille=''] { background: none; }
.c-entree-texte { flex: 1; min-width: 0; }
.c-entree-note { color: var(--encre-3); }
.c-entree-date { flex: none; margin-left: auto; font-size: 12.5px; color: var(--encre-3); font-variant-numeric: tabular-nums; }
.c-entree:hover { background: var(--creux); }
.c-apercu-liste { display: flex; flex-direction: column; gap: 2px; }
.c-apercu-eleve { padding: 5px 8px; border-radius: var(--rayon-s); font-size: 14px; }
.c-apercu-eleve:nth-child(even) { background: var(--creux); }

.c-coche { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 5px 8px; border-radius: var(--rayon-m); border: 1px solid transparent; background: none; text-align: left; width: 100%; }
.c-coche:hover { background: var(--creux); }
.c-coche[aria-pressed='true'] { background: var(--accent-doux); border-color: var(--accent-bord); }
.c-coche-case { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--trait-fort); display: flex; align-items: center; justify-content: center; color: transparent; background: var(--feuille); }
.c-coche[aria-pressed='true'] .c-coche-case { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

/* ————— l'écran Observer ————— */
.c-observer { flex: 1; display: flex; flex-direction: column; }
.c-obs-tete .entete-texte h1 { font-size: 24px; }
.c-legende { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 20px 12px; }
.c-puce-pastille { background: var(--o-fond); color: var(--o-encre); }
.c-puce-pastille b { font-weight: 800; }
.c-obs-barre { padding: 0 20px 4px; }
.c-tri { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; padding: 12px 20px 16px; align-content: start; }
.c-eleve {
  display: flex; align-items: stretch; min-height: 64px; min-width: 0;
  border-radius: var(--rayon-l); border: 1px solid var(--o-bord); background: var(--o-fond); color: var(--o-encre);
  overflow: hidden; transition: background 120ms, border-color 120ms;
}
.c-eleve[data-pastille=''] { border-color: var(--trait-fort); }
.c-eleve-pastille {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 6px 2px 6px 12px; border: none; background: none; color: inherit; text-align: left;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.c-eleve-pastille:active { background: color-mix(in srgb, var(--o-encre) 8%, transparent); }
.c-signe {
  flex: none; width: 30px; height: 30px; border-radius: 999px;
  background: var(--feuille); border: 1px solid var(--o-bord); color: var(--o-encre);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12.5px; line-height: 1;
}
.c-eleve[data-pastille=''] .c-signe { border-style: dashed; }
.c-eleve-texte { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.c-eleve-nom { font-size: 16px; font-weight: 700; color: var(--encre); }
.c-eleve-etat { font-size: 12px; font-weight: 700; }
.c-eleve-extrait { font-size: 12px; color: var(--encre-2); font-style: italic; }
.c-eleve-note {
  flex: none; width: 44px; border: none; background: none; color: var(--o-encre); opacity: 0.55;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.c-eleve-note:hover, .c-eleve-note:focus-visible { opacity: 1; background: color-mix(in srgb, var(--o-encre) 8%, transparent); }
.c-eleve-note.garnie { opacity: 1; color: var(--accent-texte); }
.c-eleve-note.garnie::after { content: ''; position: absolute; top: 14px; right: 9px; width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }
.c-obs-pied { display: flex; align-items: center; gap: 12px; padding: 4px 20px 16px; }
.c-obs-termine { display: none; }

/* ————— la grille d'un suivi ————— */
.c-suivi-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 6px; }
.c-suivi-tete .section-titre { font-size: 17px; }
.c-suivi-tete .ligne-texte > :nth-child(2) { font-size: 13px; color: var(--encre-3); font-weight: 400; }
.c-volet > .c-tri { padding: 0 6px; }
.c-tableau-boite { overflow-x: auto; border: 1px solid var(--trait); border-radius: var(--rayon-m); -webkit-overflow-scrolling: touch; }
.c-tableau { border-collapse: separate; border-spacing: 0; min-width: 100%; font-size: 14px; }
.c-tableau th, .c-tableau td { padding: 7px 8px; border-bottom: 1px solid var(--trait); text-align: center; white-space: nowrap; position: relative; }
.c-tableau tbody tr:last-child th, .c-tableau tbody tr:last-child td { border-bottom: none; }
.c-tableau thead th { font-size: 13px; font-weight: 700; color: var(--encre-2); background: var(--creux); vertical-align: bottom; }
.c-tableau thead a { display: flex; flex-direction: column; align-items: center; gap: 1px; color: inherit; text-decoration: none; min-width: 44px; padding: 4px 2px; border-radius: var(--rayon-s); }
.c-tableau thead a:hover { color: var(--accent-texte); background: var(--creux-2); }
.c-tableau thead small { font-weight: 400; font-size: 11px; color: var(--encre-3); max-width: 96px; display: block; }
.c-tableau th:first-child {
  position: sticky; left: 0; z-index: 1; text-align: left; font-weight: 700;
  background: var(--feuille); border-right: 1px solid var(--trait); max-width: 38vw; min-width: 96px;
}
.c-tableau thead th:first-child { background: var(--creux); z-index: 2; }
.c-a-note { position: absolute; top: 7px; right: calc(50% - 17px); width: 7px; height: 7px; border-radius: 999px; background: var(--accent); }

/* ————— « Observer des blocs… » ————— */
.c-choix-blocs { display: flex; flex-direction: column; gap: 10px; }
.c-choix-jour { display: flex; flex-direction: column; gap: 2px; border-bottom: 1px solid var(--trait); padding-bottom: 8px; }
.c-choix-jour:last-of-type { border-bottom: none; }
.c-choix-date { display: flex; align-items: center; gap: 8px; }
.c-choix-plier { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 2px 4px; border: none; background: none; border-radius: var(--rayon-s); text-align: left; color: var(--encre-2); }
.c-choix-plier:hover { background: var(--creux); }
.c-choix-plier .ligne-texte > :first-child { color: var(--encre); }
.c-choix-blocs-jour { display: flex; flex-direction: column; gap: 2px; }
.c-choix-plus { align-self: flex-start; min-height: 40px; padding: 4px 8px; }
.c-choix-suite { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.c-coche { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 5px 8px; border-radius: var(--rayon-m); border: 1px solid transparent; background: none; text-align: left; width: 100%; }
.c-coche:hover { background: var(--creux); }
.c-coche[aria-pressed='true'] { background: var(--accent-doux); border-color: var(--accent-bord); }
.c-coche-case { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--trait-fort); display: flex; align-items: center; justify-content: center; color: transparent; background: var(--feuille); }
.c-coche[aria-pressed='true'] .c-coche-case { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }

/* ————— la séance d'un jour : une carte, la tête (‹ date ▾ ›) et la grille ————— */
.c-jour { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.c-jour-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.c-jour-nav { display: flex; align-items: center; gap: 2px; min-width: 0; }
.c-jour-nav .rond:disabled { opacity: 0.35; pointer-events: none; }
.c-jour-date { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 2px 10px; border: none; border-radius: var(--rayon-m); background: none; color: var(--encre); }
.c-jour-date:hover { background: var(--creux); }
.c-jour-date .section-titre { font-size: 18px; }
.c-jour-date svg.ico { color: var(--encre-3); }
.c-col-bilan { display: flex; align-items: center; gap: 8px; flex: none; }
.c-col-compte { font-size: 12px; font-weight: 600; color: var(--encre-3); white-space: nowrap; }

/* ————— le LIVRET : des lignes l'une sous l'autre, les niveaux A, PA, NA, NE en colonnes —————
   Chaque ligne est une grille (--cols) : la première cellule (l'élève, l'objectif),
   le parcours des séances s'il y en a un, les quatre niveaux, la note ou la date. */
.c-livret { --niv: 44px; display: flex; flex-direction: column; min-width: 0; }
.c-livret-ligne { display: grid; grid-template-columns: var(--cols); align-items: center; min-height: 34px; border-bottom: 1px solid var(--trait); }
.c-livret-entete { min-height: 28px; align-items: end; padding-bottom: 3px; border-bottom-color: var(--trait-fort); font-size: 12px; font-weight: 700; color: var(--encre-2); }
.c-l-nom { min-width: 0; font-weight: 600; }
.c-l-nom a { display: block; color: var(--encre); text-decoration: none; }
.c-l-nom a:hover { color: var(--accent-texte); text-decoration: underline; }
.c-livret-entete .c-l-nom { font-weight: 700; }
.c-l-note { min-width: 0; padding-left: 10px; font-size: 13px; color: var(--encre-2); }
.c-l-fin { text-align: right; font-size: 13px; color: var(--encre-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-niv { display: flex; align-items: center; justify-content: center; }
.c-niv-titre { font-size: 12.5px; font-weight: 800; color: var(--o-encre); text-decoration: none; cursor: default; }
.c-niv-marque { width: 18px; height: 18px; box-sizing: border-box; border-radius: 999px; background: var(--o-fond); border: 2px solid var(--o-bord); }
.c-niv-vide { width: 12px; height: 12px; box-sizing: border-box; border-radius: 999px; border: 1.5px solid var(--trait); }
/* le parcours : un point par séance, de la plus ancienne à la plus récente */
.c-parcours { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; padding-right: 14px; }
.c-point { flex: none; width: 12px; height: 12px; box-sizing: border-box; border-radius: 999px; background: var(--o-fond); border: 1.5px solid var(--o-bord); }
a.c-point:hover { transform: scale(1.35); }
.c-livret-domaine { display: flex; align-items: center; gap: 10px; padding: 14px 0 4px; }
.c-livret-domaine .tuile { width: 26px; height: 26px; border-radius: 8px; }
.c-livret-domaine .section-titre { font-size: 15px; }

/* la séance du jour : un bloc sous l'autre, les élèves sur deux colonnes */
.c-livret-bloc { container-type: inline-size; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; border-top: 1px solid var(--trait); }
.c-livret-bloc-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 6px 2px; }
.c-livret-bloc-tete .ligne-texte { flex: 1 1 240px; }
.c-livret-bloc-tete .section-titre { font-size: 17px; }
.c-livret-bloc-tete .ligne-texte > :nth-child(2) { font-size: 12.5px; color: var(--encre-3); font-weight: 400; }
.c-livret-moities { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; padding-bottom: 8px; }
@container (max-width: 880px) {
  .c-livret-moities { grid-template-columns: minmax(0, 1fr); }
  .c-livret-moities > .c-livret + .c-livret .c-livret-entete { display: none; }
}
.c-livret-saisie { --cols: minmax(84px, 130px) repeat(4, var(--niv)) minmax(110px, 1fr); }
.c-livret-saisie .c-cellule { border-radius: var(--rayon-s); }
.c-livret-saisie .c-cellule:hover, .c-livret-saisie .c-cellule[aria-selected='true']:focus-within, .c-livret-saisie .c-cellule:focus { background: var(--creux); }
.c-cellule:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
.c-livret-saisie .c-l-nom { padding-left: 6px; }
/* un niveau à poser : un rond vide ; posé, il se remplit de sa couleur */
.c-pa { width: var(--niv); height: 32px; padding: 0; border: none; border-radius: var(--rayon-s); background: none; display: flex; align-items: center; justify-content: center; }
.c-pa::before { content: ''; width: 12px; height: 12px; box-sizing: border-box; border-radius: 999px; border: 1.5px solid var(--trait-fort); transition: width 0.1s, height 0.1s; }
.c-pa:hover::before { background: var(--o-fond); border-color: var(--o-bord); }
.c-pa[aria-pressed='true']::before { width: 18px; height: 18px; background: var(--o-fond); border: 2px solid var(--o-bord); }
.c-cel-note { width: 100%; min-height: 28px; padding: 3px 8px; font-size: 13px; resize: none; border-color: transparent; background: transparent; }
.c-cellule:hover .c-cel-note, .c-cel-note:focus { border-color: var(--trait); background: var(--feuille); }
.c-cel-note:not(:placeholder-shown) { color: var(--encre); }
/* « Écrire… » ne s'affiche que sur la ligne qu'on survole ou qu'on tient, pas vingt fois */
.c-cel-note::placeholder { color: transparent; }
.c-cellule:hover .c-cel-note::placeholder, .c-cel-note:focus::placeholder { color: var(--encre-4); }

/* un suivi : l'élève, ses séances, son niveau, sa dernière note */
.c-livret-suivi { --cols: minmax(110px, 190px) var(--larg-parcours, 120px) repeat(4, var(--niv)) minmax(0, 1fr); }
/* le livret d'un élève : l'objectif, ses séances, son niveau, la dernière fois */
.c-livret-eleve { --niv: 40px; --cols: minmax(0, 1fr) var(--larg-parcours, 120px) repeat(4, var(--niv)) 84px; }
.c-livret-eleve .c-l-nom { padding: 6px 12px 6px 36px; font-weight: 400; line-height: 1.3; }
.c-livret-eleve .c-livret-entete .c-l-nom { padding: 0; font-weight: 700; }
.c-livret-tete { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 2px 10px; border-bottom: 1px solid var(--trait); }
.c-livret-tete .ligne-texte { flex: 0 1 auto; }
.c-livret-eleve-nom { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; border: none; border-radius: var(--rayon-s); background: none; color: var(--encre); font-family: var(--police-titre); font-weight: 700; font-size: 20px; line-height: 1.2; }
.c-livret-eleve-nom:hover { background: var(--creux); }
.c-livret-tete .ligne-texte > span { padding-left: 6px; font-size: 12.5px; color: var(--encre-3); }

/* ————— un suivi tenu à la main : la grille élèves × critères ————— */
.c-perso thead th.c-perso-col { min-width: 62px; max-width: 140px; padding: 4px; vertical-align: bottom; }
.c-perso-critere {
  display: block; width: 100%; min-height: 36px; padding: 4px 6px; border: none; border-radius: var(--rayon-s); background: none;
  font-size: 12.5px; font-weight: 700; line-height: 1.25; color: var(--encre-2); white-space: normal; text-align: center;
}
.c-perso-critere:hover { background: var(--creux-2); color: var(--accent-texte); }
.c-perso td { padding: 4px 6px; }
.c-perso-case { cursor: pointer; width: 34px; height: 34px; }
.c-perso-case:hover { border-color: var(--encre-3); }
.c-perso-case:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 1px; }
.c-perso .c-perso-plus { width: 44px; padding: 2px; }
.c-perso .c-perso-bilan { text-align: left; min-width: 120px; }
.c-perso tfoot th, .c-perso tfoot td { background: var(--creux); border-top: 1px solid var(--trait); border-bottom: none; }
.c-perso tfoot .c-bilan { flex-direction: column; align-items: center; }

/* ————— le budget ————— */
.c-budget { display: flex; flex-direction: column; gap: 12px; }
.c-budget-plan { display: flex; flex-direction: column; gap: 12px; }
.c-livre-lignes > .fiche-depliee { margin: 6px 0 8px; }
.c-livre-ligne[aria-current='true'] { background: var(--accent-doux); }
.c-chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.c-chiffre { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: var(--rayon-l); background: var(--feuille); border: 1px solid var(--trait); }
.c-chiffre-titre { font-size: 12px; font-weight: 800; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.04em; }
.c-chiffre b { font-family: var(--police-titre); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.c-chiffre.c-solde b { color: var(--accent-texte); }
.c-chiffre.c-negatif b, .c-chiffre-moins b { color: var(--danger); }
.c-chiffre-plus b { color: var(--ok); }
/* le livre, puis dessous les participations et les dépenses, en cartes côte à côte */
.c-budget-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.c-livre { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.c-livre-barre { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 2px 4px 4px; }
.c-budget-recherche { flex: 1 1 220px; min-height: 36px; width: auto; }
.c-livre-lignes { display: flex; flex-direction: column; }
.c-livre-ligne {
  --cols: 92px minmax(0, 2fr) minmax(0, 1.4fr) minmax(0, 1.2fr) 104px 104px 36px;
  display: grid; grid-template-columns: var(--cols); align-items: center; column-gap: 10px;
  border-bottom: 1px solid var(--trait);
}
.c-livre-ligne:last-child { border-bottom: none; }
.c-livre-corps { grid-column: 1 / 7; display: grid; grid-template-columns: subgrid; align-items: center; min-height: 44px; padding: 4px 0 4px 8px; border: none; background: none; border-radius: var(--rayon-s); text-align: left; color: var(--encre); font-size: 14px; }
.c-livre-ligne:not(.c-livre-tete):hover { background: var(--creux); }
.c-livre-tete { border-bottom-color: var(--trait-fort); }
.c-livre-col { display: inline-flex; align-items: center; gap: 3px; min-height: 36px; padding: 0; border: none; background: none; font-size: 12px; font-weight: 800; color: var(--encre-3); text-transform: uppercase; letter-spacing: 0.04em; text-align: left; }
.c-livre-col:first-child { padding-left: 8px; }
.c-livre-col:hover, .c-livre-col[aria-sort] { color: var(--accent-texte); }
.c-livre-col.fin, .c-livre-ligne .fin { justify-content: flex-end; text-align: right; }
.c-livre-date { color: var(--encre-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-livre-libelle { font-weight: 700; }
.c-livre-solde { font-variant-numeric: tabular-nums; color: var(--encre-2); }
.c-montant { font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-plus { color: var(--ok); }
.c-moins { color: var(--danger); }
.c-montant-champ { text-align: right; font-variant-numeric: tabular-nums; }
.c-budget-volet { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; align-items: start; }
.c-budget-carte { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.c-jauge { display: block; height: 6px; border-radius: 999px; background: var(--creux-2); overflow: hidden; }
.c-jauge > span { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.c-jauge-ok > span { background: var(--ok); }
.c-barre-cat { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.c-barre-cat b { font-variant-numeric: tabular-nums; }
.c-notes-compte { white-space: pre-line; color: var(--encre-2); font-size: 14px; }
.c-part-liste { display: flex; flex-direction: column; gap: 2px; }
.c-part { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 10px; border: none; border-radius: var(--rayon-s); background: none; text-align: left; font-size: 14px; color: var(--encre); }
.c-part:hover { background: var(--creux); }
.c-part b { font-variant-numeric: tabular-nums; }
.c-part-signe { flex: none; width: 22px; height: 22px; border-radius: 999px; border: 1px dashed var(--trait-fort); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; }
.c-part[data-statut='paye'] .c-part-signe { background: var(--ok-doux); color: var(--ok); border: 1px solid var(--ok); }
.c-part[data-statut='partiel'] .c-part-signe { background: var(--avert-doux); color: var(--avert); border: 1px solid var(--avert); }
.c-part[data-statut='aucun'] b { color: var(--encre-3); font-weight: 500; }
.c-part-ligne { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.c-part-ligne .champ { flex: 0 0 110px; width: 110px; }
.c-carte-ecriture { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 58px; padding: 8px 12px; border: none; border-bottom: 1px solid var(--trait); background: none; text-align: left; color: var(--encre); }
.c-carte-ecriture:last-child { border-bottom: none; }
.c-carte-ecriture .ligne-texte > :nth-child(2) { font-size: 13px; color: var(--encre-3); }
.c-choix-compte { max-width: 260px; }

/* ————— les outils à imprimer, et l'aperçu ————— */
/* les outils en tuiles au-dessus, puis les réglages de celui qu'on a choisi et son aperçu */
.c-volet-outils { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.c-outils-gauche { display: flex; flex-direction: column; gap: 12px; }
.c-outils { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.c-outil { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 64px; padding: 10px 14px; border: 1px solid var(--trait); border-radius: var(--rayon-l); background: var(--feuille); text-align: left; color: var(--encre); }
.c-outil:hover { border-color: var(--trait-fort); }
.c-outil[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-doux); }
.c-outil[aria-pressed='true'] .tuile { background: var(--accent); color: var(--sur-accent); }
.c-outils-reglages { padding: 6px 14px 8px; }
.c-outil-reglages { display: flex; flex-direction: column; }
.c-outil-reglages > .section-titre { padding: 8px 0 2px; font-size: 15px; }
.c-apercu { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 16px; border-radius: var(--rayon-l); background: var(--creux-2); }
.c-apercu-boite { position: relative; overflow: hidden; }
.c-apercu-page {
  position: absolute; top: 0; left: 0; transform-origin: top left;
  width: 210mm; min-height: 297mm; box-sizing: border-box; padding: 12mm;
  background: var(--feuille); color: var(--encre); outline: 1px solid var(--trait);
}
.c-apercu-page.paysage { width: 297mm; min-height: 210mm; }
.c-apercu-legende { text-align: center; }

@media (max-width: 1180px) {
  /* la place manque : les séances passent au-dessus de la grille, la fiche se resserre */
  .c-livre-ligne { --cols: 80px minmax(0, 2fr) minmax(0, 1.2fr) 0 96px 96px 36px; }
  .c-livre-ligne > :nth-child(4), .c-livre-corps > :nth-child(4) { visibility: hidden; }
}
@media (max-width: 899px) {
  .c-page { padding: 10px 8px 96px; }
  .c-deux-colonnes, .c-volet-outils, .c-budget-cols { grid-template-columns: minmax(0, 1fr); }
  .c-outils-gauche, .c-colonne-liste { position: static; max-height: none; }
  .barre-espace .c-periode { flex: 1 1 160px; }
  .c-chiffres { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; padding: 12px 14px; border-radius: var(--rayon-l); background: var(--feuille); border: 1px solid var(--trait); }
  .c-chiffre { padding: 0; background: none; border: none; }
  .c-chiffre:nth-child(4) { display: none; }
  .c-chiffre b { font-size: 20px; }
  .c-chiffre .petit { display: none; }
  .c-livre { padding: 10px 6px; }
  .c-livre-barre .c-budget-recherche { flex-basis: 100%; order: 3; }
}
@media (max-width: 599px) {
  .c-perso .c-perso-bilan { display: none; }
  /* le livret au téléphone : les séances passent sous l'intitulé, sans note ni date */
  .c-livret { --niv: 38px; }
  .c-livret-suivi, .c-livret-eleve { --cols: minmax(0, 1fr) repeat(4, var(--niv)); }
  .c-livret-suivi .c-livret-ligne, .c-livret-eleve .c-livret-ligne { grid-template-areas: 'nom a pa na ne' 'parcours a pa na ne'; min-height: 46px; }
  .c-livret-suivi .c-l-nom, .c-livret-eleve .c-l-nom { grid-area: nom; align-self: end; padding: 6px 8px 0 0; }
  .c-livret-suivi .c-parcours, .c-livret-eleve .c-parcours { grid-area: parcours; align-self: start; gap: 4px; padding: 4px 0 6px; }
  .c-livret .c-parcours .c-point { width: 9px; height: 9px; }
  .c-livret .c-niv[data-pastille='ok'] { grid-area: a; }
  .c-livret .c-niv[data-pastille='cours'] { grid-area: pa; }
  .c-livret .c-niv[data-pastille='aide'] { grid-area: na; }
  .c-livret .c-niv[data-pastille='abs'] { grid-area: ne; }
  .c-livret-suivi .c-l-note, .c-livret-eleve .c-l-fin, .c-livret-entete .c-parcours { display: none; }
  .c-livret-entete .c-l-nom { grid-row: 1 / 3; align-self: end; padding-bottom: 3px; }
  /* la fiche, écran à elle seule : le choix du sexe tient sur une ligne */
  .fiche-depliee .segments { flex-wrap: nowrap; }
  .fiche-depliee .segments button { flex: 1 1 auto; padding: 0 8px; white-space: nowrap; }
  /* les feuilles restent des cartes posées sur le fond, comme dans les autres espaces */
  .c-page { padding: 12px 12px 110px; gap: 10px; }
  .c-contenu.panneau { padding: 12px 10px 14px; }
  .c-apercu { padding: 12px; }
  .c-barre { padding: 0 4px; }
  .c-barre .bouton { flex: 1 1 auto; }
  .c-periode { flex: 1 1 100%; min-height: 44px; }
  .c-liste .ligne { min-height: 48px; }
  .c-eleve-ligne .c-bilan, .c-seance .ligne .c-bilan { display: none; }
  .c-deux { grid-template-columns: 1fr; }
  .c-chiffre b { font-size: 19px; }

  /* Observer prend tout l'écran : deux colonnes de prénoms, « Terminé » en bas */
  .c-page.c-page-observer { padding: 0 0 16px; }
  .c-legende { padding: 0 12px 8px; }
  .c-obs-barre { padding: 0 12px 2px; }
  .c-obs-barre .bouton { flex: 0 0 auto; }
  .c-grille { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 12px 120px; }
  .c-eleve { min-height: 66px; }
  .c-eleve-pastille { padding-left: 10px; gap: 8px; }
  .c-eleve-note { width: 40px; }
  .c-obs-pied {
    position: fixed; left: 0; right: 0; bottom: var(--barre-bas); z-index: 25;
    flex-direction: column; gap: 6px; padding: 8px 16px 10px;
    background: var(--feuille); border-top: 1px solid var(--trait);
  }
  .c-obs-termine { display: flex; width: 100%; }
  @supports selector(:has(*)) {
    .c-obs-pied { bottom: 0; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  }
}

/* ————— les feuilles imprimées (impression.js) —————
   .ic-page : la feuille, à l'écran dans l'aperçu des outils comme sur papier.
   impression.css masque déjà tout ce qui n'est pas #impression ; ici on
   montre la nôtre, seule sur la page. */
#impression-classe { display: none; }
.ic-page { font-family: var(--police); font-size: 10.5pt; line-height: 1.3; }
.ic-page header { border-bottom: 1.5pt solid currentColor; padding-bottom: 4pt; margin-bottom: 8pt; }
.ic-page h1 { font-family: var(--police-titre); font-size: 18pt; font-weight: 600; line-height: 1.15; }
.ic-page header p { margin: 2pt 0 0; }
.ic-page table { width: 100%; border-collapse: collapse; }
.ic-page tr { break-inside: avoid; }
.ic-page th, .ic-page td { border: 0.5pt solid currentColor; padding: 4.5pt 6pt; text-align: left; vertical-align: middle; font-weight: 400; }
.ic-page thead th { font-weight: 700; font-size: 9pt; background: none; }
.ic-page tbody th { font-weight: 700; white-space: nowrap; }
.ic-page .ic-larges th, .ic-page .ic-larges td { padding-top: 9pt; padding-bottom: 9pt; }
.ic-page .ic-case { width: 17mm; text-align: center; font-size: 12pt; }
.ic-page thead .ic-case { font-size: 8pt; }
.ic-page .ic-rang { width: 9mm; text-align: center; }
.ic-page .ic-moitie { width: 55%; }
.ic-page .ic-nom { width: 46mm; }
.ic-page .ic-vide { min-width: 7mm; height: 8mm; font-size: 8pt; text-align: center; }
.ic-page .ic-hautes thead .ic-vide { height: 24mm; }
.ic-page .ic-obs { width: 34mm; }
.ic-page .ic-large { min-width: 60mm; }
.ic-page .ic-sous { font-size: 9pt; margin: 0 0 6pt; }
.ic-page .ic-col { text-align: center; font-size: 9pt; }
.ic-page td.ic-col small { display: block; font-size: 8pt; text-align: left; }
.ic-page .ic-vide-classe { text-align: center; font-style: italic; }
.ic-page .ic-nombre { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ic-page .ic-p { display: inline-flex; align-items: center; justify-content: center; min-width: 5.5mm; height: 5.5mm; padding: 0 0.8mm; box-sizing: border-box; border: 0.6pt solid currentColor; border-radius: 3mm; font-weight: 700; font-size: 8pt; line-height: 1; }
/* le livret d'un élève : une ligne par objectif, une croix dans la colonne du niveau */
.ic-page .ic-livret .ic-niv { width: 9mm; text-align: center; font-weight: 700; }
.ic-page .ic-livret .ic-seances { width: 52mm; font-size: 8.5pt; }
.ic-page .ic-livret .ic-domaine th { padding-top: 7pt; font-size: 11pt; font-weight: 700; border-left: none; border-right: none; }
/* les étiquettes : en ligne (et non en grille) — c'est ce que l'impression
   coupe proprement d'une page à l'autre ; aucune n'est tranchée */
.ic-page .ic-etiquettes { font-size: 0; }
.ic-page .ic-etiquette {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; vertical-align: top;
  box-sizing: border-box; width: calc(100% / 3 - 4mm); margin: 2mm; min-height: 24mm; padding: 3mm;
  border: 0.8pt dashed currentColor; border-radius: 4mm; text-align: center; break-inside: avoid; font-size: 11pt;
}
.ic-page .ic-grandes .ic-etiquette { width: calc(100% / 2 - 4mm); min-height: 34mm; }
.ic-page .ic-sans-cadre .ic-etiquette { border-color: transparent; }
.ic-page .ic-etiquette b { font-size: 17pt; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.ic-page .ic-grandes .ic-etiquette b { font-size: 22pt; }
.ic-page [data-ecriture='capitales'] .ic-etiquette b { text-transform: uppercase; }
.ic-page [data-ecriture='rondes'] .ic-etiquette b { font-family: var(--police-titre); font-weight: 600; }
.ic-page .ic-etiquette span { font-size: 9pt; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 1mm; }
.ic-page .ic-fiche { break-after: page; }
.ic-page .ic-fiche:last-child { break-after: auto; }
.ic-page .ic-groupe h2 { font-family: var(--police-titre); font-size: 11.5pt; font-weight: 600; margin: 10pt 0 3pt; }
.ic-page .ic-date { width: 30mm; white-space: nowrap; }
@media print {
  html body > #impression-classe { display: block !important; color: black; }
}

/* le parcours d'un élève : une ligne par année, la sienne en bleu */
.c-parcours { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 32px; text-align: left; }
.c-parcours-annee { flex: none; min-width: 84px; font-weight: 700; color: var(--accent-texte); font-variant-numeric: tabular-nums; }
.c-parcours[aria-current='true'] { cursor: default; opacity: 1; }
.c-parcours[aria-current='true'] .c-parcours-annee { color: var(--encre); }
