/*
 * Composants reutilisables. Chacun est presente dans /styleguide, dans les
 * deux themes : tout composant ajoute ici y prend sa place.
 *
 * Toutes les couleurs passent par les jetons de tokens.css, jamais par une
 * valeur en dur, sans quoi le composant ne suit pas le theme.
 */

/* --- Marque ------------------------------------------------------------- */
/* « Lycee en ligne » d'une seule couleur, celle du texte (blanc en sombre,
   fonce en clair), sans accent : 22 px (kit), comme l'en-tete commun
   (`.site-top__brand`). */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  text-decoration: none;
}

.brand .brand__flame {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

/* Flamme de la marque : memes couleurs dans les deux themes */
.flame {
  fill: var(--flame);
  stroke: var(--flame-dark);
  stroke-linejoin: round;
}

/* --- Boutons ------------------------------------------------------------ */
/*
 * Bouton de jeu (kit) : fond plein, reflet clair en haut et relief en
 * `box-shadow` sous le bouton, hors du flux. Violet (principal) pour
 * apprendre, flamme pour defier ; un seul principal par ecran. Une variante
 * ne change que ses variables : `--button-edge` (couleur du relief),
 * `--button-edge-size` (epaisseur) et `--button-hi` (reflet).
 */
.button {
  --button-edge: var(--violet-edge);
  --button-edge-size: var(--edge-md);
  --button-hi: var(--relief-hi-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--button-h);
  padding: 0 var(--sp-5);
  border: 0;
  border-radius: var(--r-lg);
  background: var(--violet);
  box-shadow: var(--button-hi), 0 var(--button-edge-size) 0 var(--button-edge);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-button-m);
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: transform 80ms ease, box-shadow 80ms ease;
}

.button :is(svg, .site-icon) {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* Le relief s'ecrase a l'appui, comme une touche : le bouton descend de ce
   qu'il perd de relief (2 px restent). */
.button:active {
  transform: translateY(calc(var(--button-edge-size) - min(2px, var(--button-edge-size))));
  box-shadow: var(--button-hi), 0 min(2px, var(--button-edge-size)) 0 var(--button-edge);
}

.button--flame {
  --button-edge: var(--flame-edge);
  --button-edge-size: var(--relief-xl);
  --button-hi: var(--relief-hi);
  background: var(--flame);
  color: var(--on-flame);
  letter-spacing: 0.03em;
}

/*
 * Icone jaune du kit (etoile, eclair, crayon) sur un aplat flamme : elle s'y
 * confondrait (1,8:1). Silhouette sombre, comme le texte de l'aplat.
 */
:is(.button--flame, .chapter-more__icon--flame) > img:is([src*="/icones/etoile."], [src*="/icones/eclair."], [src*="/icones/crayon."]) {
  filter: brightness(0);
}

/* Cyan : sujets du bac, couleur de la bordure de leur carte */
.button--cyan {
  --button-edge: var(--cyan-edge);
  --button-edge-size: var(--relief-lg);
  --button-hi: var(--relief-hi-cyan);
  background: var(--cyan);
  color: var(--on-cyan);
  letter-spacing: 0.04em;
}

.button--violet {
  background: var(--violet);
  color: var(--on-accent);
}

/* Fond doux sans relief (kit) */
.button--soft {
  --button-edge-size: 0px;
  --button-hi: var(--relief-none);
  background: var(--soft);
  color: var(--text);
}

/* Contour seul (kit) */
.button--ghost {
  --button-edge-size: 0px;
  --button-hi: var(--relief-none);
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text);
}

/* Or sur fond sombre (kit) */
.button--dark {
  --button-edge: var(--dark-edge);
  --button-edge-size: var(--edge-sm);
  --button-hi: var(--relief-none);
  background: var(--on-flame);
  color: var(--flame);
}

/* Action d'appoint a cote d'un principal */
.button--secondary {
  --button-edge: var(--surface);
  --button-edge-size: var(--relief);
  --button-hi: var(--relief-none);
  min-height: 52px;
  padding: 0 var(--sp-5);
  background: var(--soft);
  color: var(--text);
  font-size: var(--fs-body);
}

.button--block {
  width: 100%;
}

/* Grand bouton (kit) */
.button--lg {
  min-height: 64px;
  border-radius: var(--r-xl);
  font-size: var(--fs-button);
}

/* Petit bouton (kit) : garde le relief de sa couleur */
.button--sm {
  min-height: var(--touch-min);
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
}

/* Compact : dans une carte de liste (« Jouer », « Defier »), sans relief */
.button--small {
  --button-edge-size: 0px;
  --button-hi: var(--relief-none);
  min-height: var(--touch-min);
  padding: 0 14px;
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: var(--fs-small);
}

/* Action tertiaire sous les boutons : un lien, sans fond */
.button--link {
  --button-edge-size: 0px;
  --button-hi: var(--relief-none);
  min-height: var(--touch-min);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: var(--fs-small);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.button--link:active {
  transform: none;
}

.button:disabled,
.button[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Bouton carre a icone seule : son nom vient de `aria-label` */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
}

.icon-button :is(svg, .site-icon) {
  width: 22px;
  height: 22px;
}

.icon-button .site-icon {
  width: 24px;
  height: 24px;
}

/*
 * Bascule de theme : le soleil propose le mode clair (affiche en sombre), la
 * lune le mode sombre. Le choix suit l'attribut pose par theme.js, ou, avant
 * lui, la preference du systeme. Bouton rond, sans relief.
 */
.icon-button[data-theme-toggle] {
  border-bottom-width: 2px;
  border-radius: var(--radius-pill);
}

.icon-button[data-theme-toggle] svg {
  width: 20px;
  height: 20px;
}

.theme-toggle__moon {
  display: none;
}

:root[data-theme="clair"] .theme-toggle__sun {
  display: none;
}

:root[data-theme="clair"] .theme-toggle__moon {
  display: block;
}

@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] .theme-toggle__sun {
    display: none;
  }

  :root[data-theme="auto"] .theme-toggle__moon {
    display: block;
  }
}

/* --- Puces -------------------------------------------------------------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--soft);
  color: var(--text);
  font-weight: 800;
  font-size: 0.8125rem;
  line-height: 1.2;
}

.chip :is(svg, .site-icon) {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.chip--warm {
  background: var(--warm-bg);
  color: var(--warm-strong);
}

.chip--accent {
  background: var(--sel-bg);
  color: var(--sel-text);
}

.chip--success {
  background: var(--green-bg);
  color: var(--green-strong);
}

/* Gemmes, adversaire */
.chip--cyan {
  background: var(--cyan-bg);
  color: var(--cyan-text);
}

/* Perdu, rate, expiration */
.chip--error {
  background: var(--red-bg);
  color: var(--red-strong);
}

/* Mise en avant (Bac 2026) */
.chip--flame {
  background: var(--flame);
  color: var(--on-flame);
}

/* Pastille sur le fond de la page (kit `.chip`) : surface, 34 px, 14 px.
   Le `.chip` du site, sur fond doux, reste celui des cartes. */
.chip--surface {
  min-height: 34px;
  padding: 0 var(--sp-3);
  border: 0;
  background: var(--surface);
  font-size: var(--fs-small);
  gap: 6px;
}

/* Pastille « Profs » de l'en-tete : contour violet, 46 px */
.chip--profs {
  min-height: 46px;
  padding: 0 var(--sp-4);
  border-color: var(--sel-border);
  border-radius: var(--r-sm);
  background: var(--sel-bg);
  color: var(--sel-text);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  text-decoration: none;
}

/* Puce selectionnable (choix de matiere, de classe...) */
.chip--choice {
  padding: 10px var(--sp-4);
  border-color: var(--border);
  background: var(--surface);
  font-size: 0.9375rem;
}

.chip--choice[aria-pressed="true"] {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  color: var(--sel-text);
}

/* --- Cartes ------------------------------------------------------------- */
/*
 * Conteneur arrondi : sa couleur dit son role (surface, defi, adversaire,
 * selection, teinte). Jamais de bordure epaisse en haut ni a gauche ; une
 * carte entierement cliquable est un <a> et prend le relief.
 */
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
}

/* Carte au contour de 2 px (kit) */
.card--outline {
  border: 2px solid var(--border);
}

a.card {
  border-bottom: var(--relief) solid var(--border);
  text-decoration: none;
}

/* Defi du jour, serie, indice */
.card--warm {
  border: 2px solid var(--warm-border);
  background: var(--warm-bg);
  color: var(--warm-text);
}

.card--warm .card__title {
  color: var(--warm-strong);
}

/* Rival, score a battre, sujets du bac */
.card--cyan {
  border: 2px solid var(--cyan);
  background: var(--cyan-bg);
  color: var(--cyan-text);
}

/* Reprendre un chapitre, choix selectionne, sa ligne au classement */
.card--selected {
  border: 2px solid var(--sel-border);
  background: var(--sel-bg);
}

/* Bloc de notion d'une capsule : couleur du role a 10 %, contour a 35 % */
.card--tinted {
  border: 1px solid color-mix(in srgb, var(--tint, var(--violet)) 35%, transparent);
  background: color-mix(in srgb, var(--tint, var(--violet)) 10%, transparent);
}

.card--tinted[data-tint="flame"] { --tint: var(--flame); }
.card--tinted[data-tint="cyan"] { --tint: var(--cyan); }

/* Sur-titre en capitales (REPRENDRE, SCORE A BATTRE) */
.card__eyebrow {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--sel-text);
}

@media (min-width: 960px) {
  .card {
    padding: var(--space-8);
  }
}

.card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  background: var(--soft);
  color: var(--accent-text);
}

.card__icon :is(svg, .site-icon) {
  width: 48px;
  height: 48px;
}

.card__icon--warm {
  border-color: var(--warm-border);
  background: var(--warm-bg);
}

.card__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
}

.card__text {
  color: var(--muted);
}

/* Une puce garde sa largeur naturelle dans la colonne de la carte */
.card > .chip {
  align-self: flex-start;
}

/* Carte « notification » inclinee de la page d'accueil */
.bubble {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: var(--sp-4) var(--sp-5);
  border: 2px solid var(--sel-border);
  border-bottom-width: 5px;
  border-radius: 20px;
  background: var(--sel-bg);
}

.bubble--warm {
  border-color: var(--warm-border);
  background: var(--warm-bg);
}

.bubble__big {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--warm-strong);
}

.bubble__strong {
  font-weight: 800;
}

.bubble__warm-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--warm-text);
}

.bubble__accent-text {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--accent-text);
}

/* --- Champs ------------------------------------------------------------- */
.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.field__label {
  font-weight: 800;
}

.field__hint {
  font-size: 0.875rem;
  color: var(--muted);
}

.field__input {
  min-height: 52px;
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 600;
  font-size: 1.0625rem;
}

/* Listes deroulantes (mois, annee) : plus hautes, valeur en gras */
select.field__input {
  min-height: 56px;
  font-weight: 700;
  font-size: 1.125rem;
}

.field__input::placeholder {
  color: var(--muted-2);
}

.field__input:focus-visible {
  border-color: var(--violet);
  outline-offset: 1px;
}

.field__input[aria-invalid="true"] {
  border-color: var(--red-strong);
}

.field__error {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--red-strong);
}

/* --- Barre de progression ---------------------------------------------- */
.progress {
  height: 10px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--track);
}

.progress__bar {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--violet);
}

/* Chapitre en cours */
.progress__bar--flame {
  background: var(--flame);
}

/* Quete faite */
.progress__bar--success {
  background: var(--green-strong);
}

/* Matiere : couleur posee par `data-subject` sur un parent (voir carres matiere) */
.progress__bar--subject {
  background: var(--subject-color, var(--violet));
}

/* Largeurs par pas de 10 % : la CSP interdit les styles en ligne */
.progress__bar[data-value="0"] { width: 0; }
.progress__bar[data-value="10"] { width: 10%; }
.progress__bar[data-value="20"] { width: 20%; }
.progress__bar[data-value="30"] { width: 30%; }
.progress__bar[data-value="40"] { width: 40%; }
.progress__bar[data-value="50"] { width: 50%; }
.progress__bar[data-value="60"] { width: 60%; }
.progress__bar[data-value="70"] { width: 70%; }
.progress__bar[data-value="80"] { width: 80%; }
.progress__bar[data-value="90"] { width: 90%; }
.progress__bar[data-value="100"] { width: 100%; }

/*
 * Barre de questions : 10 segments egaux. Toujours accompagnee d'un texte
 * (« 3/10 ») : la couleur seule ne suffit pas.
 */
.segments {
  display: flex;
  gap: var(--sp-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.segments__item {
  flex: 1;
  height: 10px;
  border-radius: var(--radius-pill);
  background: var(--soft);
}

.segments__item[data-state="correct"] { background: var(--green-strong); }
.segments__item[data-state="wrong"] { background: var(--error-accent); }
.segments__item[data-state="current"] { background: var(--flame); }

/*
 * Anneau chrono : un cercle SVG de perimetre 100 (`pathLength="100"`), vide
 * a mesure que le temps passe. `data-value` donne les secondes restantes,
 * de 0 a 30 : la CSP interdit le style en ligne, chaque pas a sa regle.
 */
.ring {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.ring__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring__track,
.ring__arc {
  fill: none;
  stroke-width: 4;
}

.ring__track { stroke: var(--soft); }

.ring__arc {
  stroke: var(--flame);
  stroke-dasharray: 100;
  transition: stroke-dashoffset 200ms linear;
}

.ring__arc[data-value="0"] { stroke-dashoffset: 100; }
.ring__arc[data-value="1"] { stroke-dashoffset: 96.67; }
.ring__arc[data-value="2"] { stroke-dashoffset: 93.33; }
.ring__arc[data-value="3"] { stroke-dashoffset: 90; }
.ring__arc[data-value="4"] { stroke-dashoffset: 86.67; }
.ring__arc[data-value="5"] { stroke-dashoffset: 83.33; }
.ring__arc[data-value="6"] { stroke-dashoffset: 80; }
.ring__arc[data-value="7"] { stroke-dashoffset: 76.67; }
.ring__arc[data-value="8"] { stroke-dashoffset: 73.33; }
.ring__arc[data-value="9"] { stroke-dashoffset: 70; }
.ring__arc[data-value="10"] { stroke-dashoffset: 66.67; }
.ring__arc[data-value="11"] { stroke-dashoffset: 63.33; }
.ring__arc[data-value="12"] { stroke-dashoffset: 60; }
.ring__arc[data-value="13"] { stroke-dashoffset: 56.67; }
.ring__arc[data-value="14"] { stroke-dashoffset: 53.33; }
.ring__arc[data-value="15"] { stroke-dashoffset: 50; }
.ring__arc[data-value="16"] { stroke-dashoffset: 46.67; }
.ring__arc[data-value="17"] { stroke-dashoffset: 43.33; }
.ring__arc[data-value="18"] { stroke-dashoffset: 40; }
.ring__arc[data-value="19"] { stroke-dashoffset: 36.67; }
.ring__arc[data-value="20"] { stroke-dashoffset: 33.33; }
.ring__arc[data-value="21"] { stroke-dashoffset: 30; }
.ring__arc[data-value="22"] { stroke-dashoffset: 26.67; }
.ring__arc[data-value="23"] { stroke-dashoffset: 23.33; }
.ring__arc[data-value="24"] { stroke-dashoffset: 20; }
.ring__arc[data-value="25"] { stroke-dashoffset: 16.67; }
.ring__arc[data-value="26"] { stroke-dashoffset: 13.33; }
.ring__arc[data-value="27"] { stroke-dashoffset: 10; }
.ring__arc[data-value="28"] { stroke-dashoffset: 6.67; }
.ring__arc[data-value="29"] { stroke-dashoffset: 3.33; }
.ring__arc[data-value="30"] { stroke-dashoffset: 0; }

.ring__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

/* « Pret ? 3 » : grand anneau qui bat */
.ring--large {
  width: 180px;
  height: 180px;
}

.ring--large .ring__value {
  font-size: 4.5rem;
}

.ring--pulse {
  animation: ring-pulse 1s ease-in-out infinite;
}

@keyframes ring-pulse {
  50% { transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .ring--pulse { animation: none; }
  .ring__arc { transition: none; }
}

/* --- Avatars ------------------------------------------------------------ */
/* Cinq couleurs au choix a l'inscription ; l'initiale du pseudonyme au centre */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--avatar-violet);
  color: var(--on-avatar);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
}

.avatar--large {
  width: 64px;
  height: 64px;
  font-size: 1.75rem;
}

/* Couleurs des maquettes (refonte v2, phase 6), initiale foncee */
.avatar--flame { background: var(--avatar-flame); }
.avatar--green { background: var(--avatar-green); }
.avatar--red { background: var(--avatar-red); }
.avatar--blue { background: var(--avatar-blue); }

/* Tailles : listes et piles (32), defi (64, plus haut), defi recu (96) */
.avatar--small {
  width: 32px;
  height: 32px;
  font-size: 0.8125rem;
}

.avatar--xl {
  width: 96px;
  height: 96px;
  font-size: 2.5rem;
}

/* Le joueur porte un anneau flamme ; l'adversaire, un fond et un anneau cyan */
.avatar--player {
  border: 3px solid var(--flame);
}

.avatar--opponent {
  border: 3px solid var(--cyan);
  background: var(--opponent);
  color: var(--on-accent);
}

/* Pile d'avatars superposes (membres, joueurs du jour) */
.avatar-stack {
  display: flex;
}

.avatar-stack > .avatar {
  border: 2px solid var(--bg);
}

.avatar-stack > .avatar + .avatar {
  margin-left: -10px;
}

/* Gagnant ou premier : couronne pleine au-dessus de l'avatar */
.avatar-crowned {
  position: relative;
  display: inline-flex;
}

.avatar-crowned__crown {
  position: absolute;
  top: -22px;
  left: 50%;
  width: 26px;
  height: 26px;
  transform: translateX(-50%);
  filter: drop-shadow(var(--shadow-glyph));
}

/* --- Interrupteur ------------------------------------------------------- */
/* Un <button role="switch" aria-checked> : l'etat se lit sans JavaScript */
.switch {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--border);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--on-accent);
  transition: transform 150ms ease;
}

/* Allume : le vert des maquettes (compte/Compte*, refonte v2) */
.switch[aria-checked="true"] {
  background: var(--success);
}

.switch[aria-checked="true"]::after {
  transform: translateX(22px);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  font-weight: 700;
}

/* --- Composants du kit de la refonte v2 -------------------------------- */
/*
 * Repris de docs/maquettes/kit/components.css, couleurs en jetons. Un nom du
 * kit qui avait deja un autre sens sur le site a pris un nom distinct
 * (`.matiere-card` pour la carte matiere a bandeau, `--tile-icon-*` pour
 * les variables de `.tile-icon`). Le champ de code du kit (`.code-field`)
 * n'est pas repris : `.code-entry` reste le seul champ de code.
 */

/* Carre d'icone en relief, couleur et relief par variables */
.tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--tile-icon-bg, var(--soft));
  box-shadow: 0 var(--edge-sm) 0 var(--tile-icon-edge, transparent);
}

/* Argument court : icone, titre, sous-titre */
.feature {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-3);
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.feature__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1.05;
}

.feature__sub {
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
  line-height: 1.35;
}

/* Defi du jour (piste A) : un des trois cas ou degrade et ombre portee sont
   autorises (carte, medaille ; bandeau des matieres). */
.defi-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin-top: 64px;
  padding: 18px;
  border-radius: var(--r-2xl);
  background: radial-gradient(120% 80% at 50% 0%, var(--defi-glow) 0%, var(--violet) 45%, var(--violet-edge) 100%);
  box-shadow: var(--relief-hi-defi), 0 var(--edge-lg) 0 var(--defi-edge);
  color: var(--on-accent);
}

.defi-medal {
  position: relative;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  background: conic-gradient(var(--flame), var(--flame-deep), var(--error), var(--violet-light), var(--cyan), var(--flame));
  box-shadow: 0 10px 0 var(--medal-edge), 0 18px 30px var(--medal-shadow);
}

.defi-card > .defi-medal {
  position: absolute;
  top: -64px;
  left: 50%;
  transform: translateX(-50%);
}

.defi-medal__inner {
  position: absolute;
  inset: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--medal-ring);
  border-radius: 50%;
  background: radial-gradient(circle at 40% 30%, var(--medal-core), var(--medal-core-deep));
}

.defi-medal__label {
  color: var(--violet-light);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  letter-spacing: 0.14em;
}

.defi-medal__number {
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.1875rem;
  line-height: 0.9;
}

/* Contenu de la carte (piste A) : titre, pastilles, JOUER, prochain defi ;
   etat « deja joue » : score, gains, defier un ami (accueil de l'eleve). */
.defi-card__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-top: 54px;
  text-align: center;
}

.defi-card__title {
  margin: 0;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
}

.defi-card__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.defi-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--on-violet-soft);
  color: var(--on-accent);
  font-weight: 800;
  font-size: var(--fs-small);
  white-space: nowrap;
}

.defi-chip .site-icon,
.defi-card__next .site-icon {
  width: 16px;
  height: 16px;
}

.defi-card__play {
  --button-edge-size: var(--relief-xl);
  gap: 10px;
  min-height: 60px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  letter-spacing: 0.03em;
}

.defi-card__next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  color: var(--on-violet-muted);
  font-weight: 800;
  font-size: var(--fs-small);
}

.defi-card__next[hidden] { display: none; }

.defi-card__score {
  margin: 0;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1;
}

.defi-card__score strong {
  color: var(--flame);
  font-size: 3.5rem;
}

.defi-card__gains {
  margin: 0;
  color: var(--on-violet-muted);
  font-weight: 800;
  font-size: var(--fs-small);
}

.defi-card__gains:empty { display: none; }

.defi-card__again {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  background: var(--on-violet-soft);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  text-align: center;
  text-decoration: none;
}

/* Classe et filieres (accueil, `/cours/`) : tuiles en texte blanc plein */
.class-block {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.class-block__level {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.375rem;
  line-height: 0.9;
}

.class-block__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
}

.class-block__hint {
  color: var(--muted);
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

/* Nom du niveau en capitales, la consigne en minuscules (maquettes) */
.class-block__name {
  text-transform: uppercase;
}

.class-block__level[data-class="premiere"] { color: var(--class-1re-generale); }
.class-block__level[data-class="terminale"] { color: var(--class-tle-generale); }

.class-block__tracks {
  display: flex;
  gap: 10px;
}

.filiere {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 96px;
  padding: 14px;
  border-radius: 20px;
  background: var(--filiere-bg);
  box-shadow: var(--relief-hi-soft), 0 var(--edge-md) 0 var(--filiere-edge);
  color: var(--on-accent);
  text-decoration: none;
}

.filiere__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
}

.filiere__sub {
  font-weight: 800;
  font-size: var(--fs-tiny);
}

.class-2de { --filiere-bg: var(--class-2de); --filiere-edge: var(--class-2de-edge); }
.class-1re-generale { --filiere-bg: var(--class-1re-generale); --filiere-edge: var(--class-1re-generale-edge); }
.class-1re-stmg { --filiere-bg: var(--class-1re-stmg); --filiere-edge: var(--class-1re-stmg-edge); }
.class-tle-generale { --filiere-bg: var(--class-tle-generale); --filiere-edge: var(--class-tle-generale-edge); }
.class-tle-stmg { --filiere-bg: var(--class-tle-stmg); --filiere-edge: var(--class-tle-stmg-edge); }

/* Grille des classes (accueil, `/cours/`) : la seconde seule, puis les
   blocs de premiere et de terminale avec leurs filieres. */
.class-grid {
  display: grid;
  gap: var(--sp-3);
}

.class-grid__seconde {
  justify-content: center;
  height: 96px;
  padding: 18px var(--sp-5);
  border-radius: var(--r-xl);
  box-shadow: var(--relief-hi-soft), 0 var(--relief-xl) 0 var(--filiere-edge);
}

.class-grid__seconde .filiere__name {
  font-size: 3.125rem;
  line-height: 0.9;
}

.class-grid__seconde .filiere__sub {
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (min-width: 960px) {
  .class-block__level { font-size: 2.75rem; }
  .filiere { min-height: 120px; }
  .filiere__name { font-size: 1.875rem; }

  .class-grid {
    grid-template-columns: 1fr 1.4fr 1.4fr;
    gap: var(--sp-4);
  }

  .class-grid__seconde {
    justify-content: flex-start;
    height: auto;
    min-height: 230px;
  }

  .class-grid__seconde .filiere__name {
    font-size: 4rem;
  }
}

/* --- Etapes d'un chapitre (Comprendre, S'entrainer, Verifier, Garder) ---- */
/* Carre d'icone a la couleur de l'etape (`data-etape`), numero en pastille. */
[data-etape="comprendre"] { --step: var(--step-comprendre); --step-edge: var(--step-comprendre-edge); }
[data-etape="entrainer"] { --step: var(--step-entrainer); --step-edge: var(--step-entrainer-edge); }
[data-etape="verifier"] { --step: var(--step-verifier); --step-edge: var(--step-verifier-edge); }
[data-etape="garder"] { --step: var(--step-garder); --step-edge: var(--step-garder-edge); }

.step-icon {
  position: relative;
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 15px;
  background: var(--step);
  box-shadow: 0 var(--edge-sm) 0 var(--step-edge);
}

.step-icon .site-icon {
  width: 26px;
  height: 26px;
}

.step-icon__number {
  position: absolute;
  top: -7px;
  right: -7px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border: 2px solid var(--step);
  border-radius: 50%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-tiny);
  line-height: 1;
}

/* Tuiles des quatre etapes : en colonne sur mobile, en ligne sur ordinateur */
.step-tiles {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-tile {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.step-tile__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.step-tile__name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
}

.step-tile__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  line-height: 1.15;
}

.step-tile__detail {
  margin: 0;
  line-height: normal;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
}

@media (min-width: 960px) {
  .step-tiles {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .step-tile {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--sp-3);
    padding: 18px;
  }

  .step-tile .step-icon {
    position: static;
    width: 58px;
    height: 58px;
    border-radius: 17px;
  }

  .step-tile .step-icon .site-icon {
    width: 29px;
    height: 29px;
  }

  /* Le numero passe dans le coin de la tuile (maquette) */
  .step-tile .step-icon__number {
    top: 11px;
    right: 11px;
  }

  .step-tile__name {
    font-size: 1.625rem;
  }
}

/* Carte matiere a bandeau colore (kit `.subject-card`, renommee : le site
   a deja une `.subject-card` de progression). Couleur par `data-subject`. */
.matiere-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: 0 var(--relief-lg) 0 var(--subject-edge);
  color: var(--text);
  text-decoration: none;
}

.matiere-card__band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 var(--sp-3);
  overflow: hidden;
  background: linear-gradient(150deg, var(--subject-color, var(--violet)), var(--subject-edge));
  box-shadow: var(--relief-hi-band);
}

.matiere-card__glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--glyph-bg);
  position: relative;
  z-index: 1;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1;
}

.matiere-card__count {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  background: var(--count-bg);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8125rem;
  position: relative;
  z-index: 1;
}

.matiere-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 10px var(--sp-3) var(--sp-3);
}

.matiere-card__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-body);
  line-height: 1.1;
}

.matiere-card__sub {
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
  line-height: 1.3;
}

/* Icone de la matiere (masque `--subject-icon`) ou ses initiales, en blanc ;
   le meme signe en filigrane, penche, au bas du bandeau (maquettes
   `cours/Matieres*`). */

.matiere-card__glyph[data-length="4"] { font-size: 0.875rem; }

.matiere-card__glyph--icon::before,
.matiere-card__mark--icon::before {
  content: '';
  width: 26px;
  height: 26px;
  background: var(--on-accent);
  mask: var(--subject-icon) center / contain no-repeat;
}

.matiere-card__mark {
  position: absolute;
  right: -10px;
  bottom: -26px;
  display: flex;
  color: var(--on-accent);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 3.625rem;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.14;
  transform: rotate(-12deg);
}

.matiere-card__mark--icon::before {
  width: 84px;
  height: 84px;
}

.matiere-card:hover .matiere-card__name { text-decoration: underline; }

@media (min-width: 960px) {
  .matiere-card__band { height: 72px; }
  .matiere-card__glyph { width: 48px; height: 48px; font-size: 1.1875rem; }
  .matiere-card__name { font-size: 1.0625rem; }
}

/* Encart « Crée ton compte » (or) et ses gains en pastilles */
.account-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-radius: var(--r-xl);
  background: var(--flame);
  box-shadow: var(--relief-hi), 0 var(--relief-xl) 0 var(--flame-edge);
  color: var(--on-flame);
  text-align: center;
}

.account-card__gains { display: flex; }

.account-card__gain {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-left: -8px;
  border-radius: 50%;
  background: var(--on-accent);
  box-shadow: 0 3px 0 var(--flame-edge);
}

.account-card__gain:first-child { margin-left: 0; }

/* --- Gabarit commun : en-tete, barre du bas, pied de page ------------- */
/*
 * Un seul composant chacun (`server/src/lib/site-navigation.js`), sur toutes
 * les pages, d'apres les maquettes `offre/Accueil*` et `eleve/Tableau*`.
 * Mobile : la marque seule (serie et gemmes pour un eleve), barre de cinq
 * cases en bas avec JOUER au centre. Ordinateur : marque, menu en pilule au
 * centre, a droite loupe, « Profs », « Connexion » et « Créer mon compte »
 * (compteurs et avatar pour un eleve) ; pas de barre du bas.
 */
.site-top {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  max-width: var(--content-max-width);
  margin-inline: auto;
  padding: 14px var(--content-gutter) var(--sp-3);
}

.site-top__brand {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--sp-2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
}

.site-top__brand .site-icon {
  width: 34px;
  height: 34px;
}

/* Pages d'arrivee par lien : l'en-tete commun sur mobile, le leur au-dela
   (`TOP_PAGES` de `site-shell.js`). */
.mobile-top { display: contents; }

.site-menu { display: none; }

.site-top__end {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-left: auto;
}

/* Loupe : carre de 46 px au contour du theme (recherche, phase 8) */
.site-top__search {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
}

.site-top__search .site-icon,
.site-menu__link .site-icon {
  width: 22px;
  height: 22px;
}

.site-menu__link .site-menu__logo {
  width: auto;
  height: 30px;
}

.site-top__login,
.site-top__signup {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 800;
  white-space: nowrap;
  text-decoration: none;
}

.site-top__login {
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

/* « Créer mon compte » : texte seul, or, relief de 4 px */
.site-top__signup {
  background: var(--flame);
  box-shadow: 0 var(--edge-sm) 0 var(--flame-edge);
  color: var(--on-flame);
}

.site-top__profs,
.site-top__signup { display: none; }

.site-counters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-counter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 var(--sp-3);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 800;
  text-decoration: none;
}

.site-counter .site-icon {
  width: 20px;
  height: 20px;
}

.site-counter--flame { color: var(--flame-text); }
.site-counter--gem { color: var(--gem-text); }
.site-counter--league { gap: 6px; }

/* Losange de la division de la semaine, aux couleurs des ligues */
.site-counter__league {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--league-quartz);
  box-shadow: 0 2px 0 var(--league-quartz-edge);
  transform: rotate(45deg);
}

.site-counter__league[data-league="2"] { background: var(--league-topaze); box-shadow: 0 2px 0 var(--league-topaze-edge); }
.site-counter__league[data-league="3"] { background: var(--league-amethyste); box-shadow: 0 2px 0 var(--league-amethyste-edge); }
.site-counter__league[data-league="4"] { background: var(--league-saphir); box-shadow: 0 2px 0 var(--league-saphir-edge); }
.site-counter__league[data-league="5"] { background: var(--league-emeraude); box-shadow: 0 2px 0 var(--league-emeraude-edge); }
.site-counter__league[data-league="6"] { background: var(--league-diamant); box-shadow: 0 2px 0 var(--league-diamant-edge); }

.site-top__avatar {
  display: flex;
  border-radius: 50%;
  text-decoration: none;
}

/* Barre du bas (kit) : cinq cases, JOUER en or au centre avec « Défi »
   dessous ; la marge du bas suit l'encoche des iPhone. */
.tabbar {
  position: fixed;
  right: var(--sp-3);
  bottom: calc(var(--sp-2) + env(safe-area-inset-bottom));
  left: var(--sp-3);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  height: 78px;
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.tabbar__link,
.tabbar__play {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  min-height: var(--touch-min);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 0.6875rem;
  font-weight: 800;
  text-decoration: none;
}

.tabbar__play {
  justify-self: center;
}

.tabbar__link[aria-current="page"],
.tabbar__play[aria-current="page"] {
  color: var(--text);
}

.tabbar__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 30px;
  border-radius: var(--r-xs);
}

.tabbar__link[aria-current="page"] .tabbar__icon {
  background: var(--soft);
}

.tabbar__play-button .site-icon {
  width: 22px;
  height: 22px;
}

/* Le carre or n'occupe que la hauteur d'une icone (30 px) : il deborde vers
   le haut, et « Defi » s'aligne sur les quatre autres libelles. */
.tabbar__play-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: -14px;
  border-radius: 15px;
  transform: translateY(-6px);
  background: var(--flame);
  box-shadow: var(--relief-hi), 0 var(--edge-md) 0 var(--flame-edge), 0 0 0 var(--edge-md) var(--bg);
}

/* Pied de page : marque (ordinateur), liens en zone de 44 px, theme */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 18px;
  width: 100%;
  max-width: var(--content-max-width);
  margin: var(--sp-6) auto 0;
  padding: var(--sp-4) var(--content-gutter) var(--sp-5);
  color: var(--muted);
  font-size: 0.8125rem;
}

/* Le filet du haut a la largeur du contenu, pas des marges */
.site-foot::before {
  content: '';
  flex-basis: 100%;
  margin-bottom: var(--sp-4);
  border-top: 2px solid var(--border);
}

.site-foot__brand {
  display: none;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
}

.site-foot__brand .site-icon {
  width: 20px;
  height: 20px;
}

.site-foot__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.site-foot__links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--touch-min);
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
}

/* Sans soulignement : le survol et le focus clavier eclairent le lien */
.site-foot__links a:hover,
.site-foot__links a:focus-visible {
  color: var(--text);
}

.site-foot [data-theme-toggle] { margin-left: auto; }

/* Mobile : le bouton de theme (absent des maquettes) se range au bout de la
   derniere ligne de liens, qui a la place, plutot que sur une ligne a lui. */
@media (min-width: 360px) and (max-width: 767px) {
  .site-foot { position: relative; }

  .site-foot [data-theme-toggle] {
    position: absolute;
    right: var(--content-gutter);
    bottom: var(--sp-5);
  }
}

@media (max-width: 767px) {
  /* Pages d'arrivee par lien : leur en-tete propre laisse la place au commun */
  .mobile-top + header { display: none; }
  /* Leur conteneur porte deja la marge laterale */
  .mobile-top .site-top { padding-inline: 0; }
  .parent-page > .mobile-top .site-top { padding-inline: var(--content-gutter); }

  /* Avec la barre du bas, le compte passe par elle : rien d'autre en haut
     pour un visiteur, serie et gemmes pour un eleve. */
  body:has([data-site-tabbar]) .site-top__login[data-guest],
  .site-counter--league,
  .site-top__avatar { display: none; }

  /* Rien ne passe sous la barre du bas */
  body:has([data-site-tabbar]) {
    padding-bottom: calc(132px + env(safe-area-inset-bottom));
  }
}

@media (min-width: 768px) {
  /* Repli si la place manque (page a marges larges) : sur deux lignes,
     jamais au-dela du bord, comme la maquette. */
  .site-top {
    flex-wrap: wrap;
    gap: var(--sp-5) var(--sp-3);
    padding-top: var(--sp-5);
  }

  .site-top__brand { font-size: 1.375rem; }

  .site-top__brand .site-icon {
    width: 36px;
    height: 36px;
  }

  /* Cinq entrees et les boutons du visiteur tiennent sur une ligne des
     1280 px : menu et boutons resserres. */
  .site-menu {
    display: flex;
    gap: 2px;
    margin-inline: auto;
    padding: 5px;
    border-radius: var(--r-md);
    background: var(--surface);
  }

  .site-menu__link {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 10px;
    border-radius: var(--r-sm);
    color: var(--muted);
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
  }

  .site-menu__link[aria-current="page"] {
    background: var(--soft);
    color: var(--text);
  }

  .site-top__end {
    gap: var(--sp-2);
    margin-left: 0;
  }

  .site-top__login,
  .site-top__signup { padding-inline: 14px; }

  .site-top__search { display: flex; }
  .site-top__profs,
  .site-top__signup { display: inline-flex; }
  .site-counters { gap: var(--sp-2); }

  .site-counter {
    height: 44px;
    font-size: var(--fs-button-m);
  }

  /* Avatar de 44 px cerne de la surface (maquette eleve/TableauDesktop) */
  .site-top__avatar .avatar {
    width: 44px;
    height: 44px;
    border: 3px solid var(--surface);
    font-size: var(--fs-button-m);
  }

  .mobile-top { display: none; }
  [data-site-tabbar] { display: none; }

  .site-foot {
    gap: 0 22px;
    padding-top: 0;
  }

  .site-foot::before { margin-bottom: 22px; }
  .site-foot__brand { display: flex; }
  .site-foot__links { gap: 0 22px; }
}

/* Tablette et petit ordinateur : le menu passe en icones, ses libelles
   restent lus par les lecteurs d'ecran (texte a taille nulle) ; sous 960 px,
   la marque garde sa flamme et son nom accessible. */
@media (min-width: 768px) and (max-width: 1279px) {
  .site-menu__link {
    gap: 0;
    padding: 0 var(--sp-2);
    font-size: 0;
  }
}

@media (min-width: 768px) and (max-width: 959px) {
  .site-top { gap: var(--sp-3); }
  .site-top__name { font-size: 0; }
  .site-top__end { gap: 6px; }
  .site-top__login,
  .site-top__signup { padding-inline: var(--sp-3); }
}

/* --- Formulaires ------------------------------------------------------- */
/* Deux champs cote a cote (mois et annee de naissance) */
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
}

/* Code a 6 chiffres : grands caracteres espaces */
.field__input--code {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: 0.4em;
}

/* Message d'etat d'un formulaire (region aria-live) */
.form-status {
  font-weight: 700;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status[data-tone="error"] {
  color: var(--red-strong);
}

.form-status[data-tone="success"] {
  color: var(--green-strong);
}

/* Case a cocher et son libelle */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 700;
}

.checkbox-row__input {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  accent-color: var(--violet);
}

/* Bouton ou lien d'action secondaire, sans relief */
.text-link {
  align-self: center;
  padding: var(--sp-2);
  border: 0;
  background: none;
  color: var(--accent-text);
  font-weight: 800;
  text-decoration: underline;
}

/* --- Choix (boutons radio et cases a cocher en puces) ------------------ */
.choice-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.choice-group > legend {
  margin-bottom: 10px;
  padding: 0;
}

.choice-group__options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice-group__options--grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
}

.choice,
.avatar-choice {
  position: relative;
  display: inline-flex;
}

/* Le vrai champ reste dans la page, lisible au clavier et par les lecteurs d'ecran */
.choice__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice__box {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  min-height: 44px;
  padding: 10px var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 800;
  font-size: 0.9375rem;
}

.choice__box--stacked {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.choice__sub {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--muted);
}

.choice__input:checked + .choice__box {
  border-color: var(--violet);
  background: var(--sel-bg);
  color: var(--sel-text);
}

.choice__input:checked + .choice__box .choice__sub {
  color: var(--sel-text);
}

.choice__input:disabled {
  cursor: not-allowed;
}

.choice__input:disabled + .choice__box {
  opacity: 0.55;
}

/* Une case imposee (specialites STMG) reste lisible : cochee, mais inerte */
.choice__input:checked:disabled + .choice__box {
  opacity: 1;
}

.choice__input:focus-visible + .choice__box,
.choice__input:focus-visible + .avatar {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* Avatar a choisir : une pastille de couleur, cerclee du texte une fois choisie */
.avatar-choice .avatar {
  width: 54px;
  height: 54px;
  border: 3px solid var(--bg);
  font-size: 1.375rem;
}

.choice__input:checked + .avatar {
  border-color: var(--text);
}

/* Choix sur une rangee de colonnes egales (classe, voie), texte centre */
.choice-group__options--row {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: var(--sp-2);
}

:is(.choice-group__options--row, .choice-group__options--grid) .choice__box {
  justify-content: center;
  min-height: 48px;
  text-align: center;
}

.choice-group__options--grid .choice__box--stacked {
  align-items: center;
  min-height: 56px;
  padding-block: 6px;
}

/* Puce a coche (matieres) : la coche apparait devant le nom une fois choisie */
.choice--check .choice__input:checked + .choice__box::before {
  content: "";
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-right: -2px;
  background: currentColor;
  mask: url('/icones/interface/valider.svg?v=720fe4c2e8') center / contain no-repeat;
}

/* Retour d'un ecran de formulaire : un chevron seul, sans cadre */
.back-button {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: var(--touch-min);
  height: var(--touch-min);
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: none;
  color: var(--muted-2);
  cursor: pointer;
}

.back-button svg {
  width: 26px;
  height: 26px;
}

.back-button:hover {
  color: var(--text);
}

/* Carte d'option : un choix avec son titre et sa description */
.option-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.option-group > legend {
  margin-bottom: var(--sp-3);
  padding: 0;
}

.option-card {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
  cursor: pointer;
}

.option-card:has(:checked) {
  border-color: var(--violet);
  background: var(--sel-bg);
}

.option-card__input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--violet);
}

.option-card__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-card__title {
  font-weight: 800;
}

.option-card__text {
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Etapes ------------------------------------------------------------ */
/* Barre segmentee : un segment par etape de l'inscription */
.steps {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  flex-grow: 1;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps__item {
  height: 14px;
  border-radius: var(--radius-pill);
  background: var(--track);
}

.steps__item[data-state="done"],
.steps__item[aria-current="step"] {
  background: var(--violet);
}

/* Etapes nommees (inscription, maquettes auth/Inscription*) : barre or et nom dessous */
.steps__item:has(.steps__label) {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: auto;
  background: none;
}

.steps__item:has(.steps__label)::before {
  content: "";
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--track);
}

.steps__item:has(.steps__label):is([data-state="done"], [aria-current="step"])::before {
  background: var(--flame);
}

.steps__label {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.75rem;
}

.steps__item[aria-current="step"] .steps__label {
  color: var(--text);
}

/* Parcours express : deux etapes, sans les noms du parcours complet */
.steps[data-mode="express"] .steps__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* Deux points (connexion : adresse, puis code) */
.steps--dots {
  flex-grow: 0;
  grid-auto-columns: 34px;
  margin-inline: auto;
}

.steps--dots .steps__item {
  height: 8px;
}

.steps--dots .steps__item:is([data-state="done"], [aria-current="step"]) {
  background: var(--flame);
}

/* --- Encarts ----------------------------------------------------------- */
.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--soft);
  font-size: 0.9375rem;
  font-weight: 600;
}

.notice:empty {
  display: none;
}

.notice > :is(svg, .site-icon) {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--accent-text);
}

.notice > p {
  flex: 1;
}

/* Encart sans contour (regle de confidentialite de l'inscription) */
.notice--plain {
  padding: var(--sp-4);
  border: 0;
  background: var(--soft);
}

/* Bilan des matieres choisies : une ligne forte, a la couleur d'accent */
.notice--summary {
  color: var(--accent-text);
  font-weight: 800;
}

.notice--warm {
  border-color: var(--warm-border);
  background: var(--warm-bg);
  color: var(--warm-text);
}

.notice--warm a {
  color: var(--warm-strong);
}

/* Information (confidentialite de l'age, expiration de la demande d'accord) */
.notice--info {
  border-color: var(--cyan);
  background: var(--cyan-bg);
  color: var(--cyan-text);
}

.notice--danger {
  border-color: var(--red-border);
  background: var(--red-bg);
}

.notice__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

/* Liste a coches (regles, donnees collectees) */
.check-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 600;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.check-list :is(svg, .site-icon) {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  color: var(--green-strong);
}

/* Separateur « ou » entre deux facons de faire */
.divider-or {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font-weight: 800;
  color: var(--muted);
}

.divider-or::before,
.divider-or::after {
  content: '';
  flex: 1;
  height: 2px;
  background: var(--divider);
}

/* Lien a copier a la main quand le partage est indisponible */
.link-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.link-box .button {
  align-self: flex-start;
}

/* Grande icone ronde en tete d'un ecran d'etat */
.status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--sel-bg);
  color: var(--sel-text);
}

.status-icon :is(svg, .site-icon) {
  width: 36px;
  height: 36px;
}

.status-icon--warm {
  background: var(--warm-bg);
  color: var(--warm-strong);
}

/* Les illustrations fournies possèdent leur propre forme et leurs couleurs. */
.status-icon:has(> .site-icon) {
  background: transparent;
}

.status-icon > .site-icon {
  width: 64px;
  height: 64px;
}

/* Couples intitule / valeur en tuiles (demande envoyee, expiration) */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
}

.info-grid__item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 14px var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.info-grid dt {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
}

.info-grid dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
}

/* Etapes numerotees (ajout a l'ecran d'accueil) */
.install-steps {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: install;
}

.install-steps li {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-weight: 700;
  counter-increment: install;
}

.install-steps li::before {
  content: counter(install);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--violet);
  color: var(--on-accent);
  font-weight: 800;
}

.install-steps svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-left: auto;
  color: var(--accent-text);
}

/* --- Encarts : variantes --------------------------------------------------- */
/* Encart a titre et paragraphes empiles (serie en pause, liste vide) */
.notice--stacked {
  flex-direction: column;
  flex-wrap: nowrap;
}

.notice__title {
  font-size: 1.25rem;
}

.progress--thin {
  height: 10px;
  border-bottom-width: 2px;
}

/* --- Compteurs : serie, XP, gemmes ------------------------------------------ */
.stat-bar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 800;
}

.stat {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}

.stat :is(svg, .site-icon) {
  width: 24px;
  height: 24px;
}

.stat--flame { color: var(--flame-text); }
.stat--xp { color: var(--accent-text); }
.stat--gem { color: var(--gem-text); }

.stat--xp svg {
  fill: var(--xp-fill);
  stroke: var(--accent-text);
}

.stat--gem svg {
  fill: var(--gem-fill);
  stroke: var(--gem-text);
}

/* --- Bouton de matiere (ouvre la fenetre « Quelle matiere aujourd'hui ? ») --- */
.subject-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  padding: 0 var(--sp-3);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-weight: 800;
  font-size: 0.9375rem;
}

.subject-button__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.subject-button svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

/* --- Fenetre de dialogue ---------------------------------------------------- */
/* <dialog> ouvert par showModal : centre au-dessus de la page assombrie */
.dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 2px solid var(--border);
  border-bottom-width: 6px;
  border-radius: var(--radius-xl);
  background: var(--surface);
  color: var(--text);
}

.dialog::backdrop {
  background: var(--backdrop);
}

/* Confirmation d'une action qui fait sortir (deconnexion) */
.logout-sheet__confirm { color: var(--red-strong); }

/* Feuille de confirmation : posee en bas de l'ecran sur mobile */
@media (max-width: 767px) {
  .dialog--sheet {
    width: 100%;
    max-width: none;
    margin: auto 0 0;
    border-bottom: 0;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }

  .dialog--sheet .dialog__body {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

.dialog__body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: var(--space-6);
}

.dialog__body--center {
  align-items: center;
  text-align: center;
}

.dialog__title {
  font-size: 1.625rem;
}

.dialog__text {
  color: var(--muted);
}

.dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.freeze-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--sel-bg);
  color: var(--accent-text);
}

.freeze-badge :is(svg, .site-icon) {
  width: 52px;
  height: 52px;
}

/* --- Objectif du jour ------------------------------------------------------- */
.goal-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.goal-card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
}

.goal-card__title {
  font-size: 1.25rem;
}

.goal-card__value {
  font-weight: 800;
  color: var(--muted);
}

.goal-card__met {
  align-self: flex-start;
}

/* --- Chapitre ---------------------------------------------------------------- */
.chapter {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.chapter__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter__position {
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.chapter__title {
  font-size: 1.25rem;
}

.chapter__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--muted);
}

.chapter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chapter__empty {
  font-weight: 700;
  color: var(--muted);
}

/* --- Reponse a un QCM : un choix numerote, touches 1 a 4 --------------------- */
.answers {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  border: 0;
}

.answer {
  position: relative;
  display: block;
}

.answer__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.answer__box {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-bottom-width: var(--relief-lg);
  border-radius: var(--radius-lg);
  background: var(--surface);
  font-weight: 700;
  font-size: 0.9375rem;
}

.answer__key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: var(--soft);
  color: var(--accent-text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

.answer__input:checked + .answer__box {
  border-color: var(--sel-border);
  background: var(--sel-bg);
}

.answer__input:focus-visible + .answer__box {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.answer__input:disabled {
  cursor: default;
}

/* Apres correction : la bonne reponse, la reponse fausse, les autres */
.answer[data-state="correct"] .answer__box {
  border-color: var(--green-strong);
  background: var(--green-bg);
}

.answer[data-state="wrong"] .answer__box {
  border-color: var(--error-accent);
  background: var(--red-bg);
}

.answer[data-state="dimmed"] .answer__box {
  background: transparent;
  color: var(--muted);
}

.answer[data-state="correct"] .answer__key {
  color: var(--green-strong);
}

.answer[data-state="wrong"] .answer__key {
  color: var(--red-strong);
}

/* --- Correction d'une reponse -------------------------------------------------- */
.feedback {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px var(--sp-5) var(--space-6);
  border-top: 2px solid var(--green-strong);
  border-radius: var(--radius-lg);
  background: var(--green-bg);
  color: var(--green-strong);
}

.feedback[data-tone="wrong"] {
  border-top-color: var(--red-border);
  background: var(--red-bg);
  color: var(--red-strong);
}

.feedback__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.1;
}

.feedback__answer {
  font-weight: 800;
}

.feedback__why {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-3) 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
}

.feedback__why-title {
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-text);
}

/* CONTINUER en or, juste ou rate (refonte 2026, maquettes cours/Question, bacfr/Quiz) */
.feedback .button {
  --button-edge: var(--flame-edge);
  background: var(--flame);
  color: var(--on-flame);
}

.feedback__review {
  align-self: center;
  color: inherit;
}

/* --- Fin de session ---------------------------------------------------------- */
.streak-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: var(--warm-bg);
  color: var(--warm-strong);
  font-weight: 800;
}

.streak-badge :is(svg, .site-icon) {
  width: 48px;
  height: 48px;
}

.streak-badge__value {
  font-family: var(--font-display);
  font-size: 2.75rem;
  line-height: 1;
}

.streak-badge__label {
  font-size: 0.875rem;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.result-grid__item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--sel-border);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--sel-text);
}

.result-grid__item dt {
  padding: var(--sp-1) 0;
  background: var(--sel-bg);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.result-grid__item dd {
  margin: 0;
  padding: var(--sp-3) 0;
  font-weight: 800;
  font-size: 1.375rem;
}

.result-grid__item--score {
  border-color: var(--success);
  color: var(--green-strong);
}

.result-grid__item--score dt {
  background: var(--green-bg);
}

.result-grid__item--time {
  border-color: var(--warm-border);
  color: var(--warm-strong);
}

.result-grid__item--time dt {
  background: var(--warm-bg);
}

/* Correction detaillee d'une question, a la fin d'un test de maitrise */
.correction {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: left;
}

/* Contour juste ou rate sur tout le tour, jamais un filet a gauche */
.correction[data-state="correct"] {
  border-color: var(--green-strong);
}

.correction[data-state="wrong"] {
  border-color: var(--error-accent);
}

.correction__prompt {
  font-weight: 800;
}

.correction__line {
  font-weight: 700;
  color: var(--muted);
}

.correction__line--right {
  color: var(--green-strong);
}

.correction__why {
  font-size: 0.9375rem;
}

/* --- Pages de cours ------------------------------------------------------------ */
/* Fil d'Ariane : Cours > Classe > Matiere > Chapitre */
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--muted);
}

.breadcrumb__list li + li::before {
  content: "›";
  margin-right: var(--sp-2);
  color: var(--muted-2);
}

.breadcrumb__list a {
  color: var(--accent-text);
}

/*
 * Fil d'Ariane en pastilles (mobile) : retour, puis les etapes en pastilles
 * (maquettes cours/ChapitresMobile, sujets/Matiere* et sujets/Sujet*).
 * Commun aux cours et aux sujets du bac.
 */
.breadcrumb--chips .breadcrumb__list {
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-small);
}

.breadcrumb--chips .breadcrumb__list li + li::before { content: none; }

.breadcrumb--chips :is(a, [aria-current]) {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.breadcrumb--chips .breadcrumb__back {
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-right: 2px;
  padding: 0;
  border-radius: var(--r-sm);
  color: var(--muted);
}

.breadcrumb__back::before {
  content: '';
  width: 10px;
  height: 10px;
  margin-left: var(--sp-1);
  border-bottom: 2.5px solid currentColor;
  border-left: 2.5px solid currentColor;
  transform: rotate(45deg);
}

/* Lien vers une classe, une matiere ou un chapitre */
.course-link {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 14px var(--sp-4);
  border: 1px solid var(--border);
  border-bottom: var(--relief) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.course-link:hover {
  border-color: var(--sel-border);
  background: var(--sel-bg);
}

.course-link__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.15;
}

.course-link__meta {
  font-weight: 800;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.course-link__text {
  padding-inline: var(--sp-1);
  color: var(--muted);
  font-size: 0.9375rem;
}

/* Sommaire d'un chapitre */
.course-toc__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px var(--sp-4);
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--soft);
  list-style: none;
  font-weight: 700;
  font-size: 0.9375rem;
}

/* Carte de cours, teintee selon sa sorte */
.course-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
  scroll-margin-top: var(--sp-4);
}

/* L'etiquette s'affiche au-dessus du titre, mais se lit apres lui */
.course-card__header {
  display: flex;
  flex-direction: column-reverse;
  gap: var(--sp-1);
}

.course-card__title {
  font-size: 1.375rem;
}

.course-card__kind {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--sel-bg);
  color: var(--sel-text);
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.course-card--definition,
.course-card--formula {
  border-color: var(--sel-border);
}

.course-card--rules {
  border-color: var(--success);
}

.course-card--rules .course-card__kind {
  background: var(--green-bg);
  color: var(--green-strong);
}

.course-card--warning {
  border-color: var(--warm-border);
  background: var(--warm-soft);
}

.course-card--warning .course-card__kind {
  background: var(--warm-bg);
  color: var(--warm-strong);
}

.course-card--visual .course-card__kind,
.course-card--intro .course-card__kind {
  background: var(--soft);
  color: var(--muted);
}

/* HTML du contenu : paragraphes, listes, tableaux, encadres */
.course-html {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.course-html h3,
.course-html h4,
.course-html h5,
.course-html h6 {
  margin: var(--sp-2) 0 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.2;
}

.course-html ul,
.course-html ol,
.course-html dl,
.course-html figure,
.course-html blockquote,
.course-html pre {
  margin: 0;
}

.course-html ul,
.course-html ol {
  padding-left: 1.25rem;
}

.course-html li + li {
  margin-top: 6px;
}

.course-html dt {
  font-weight: 800;
}

.course-html dd {
  margin: 0 0 var(--sp-2) 1rem;
}

.course-html blockquote {
  padding: var(--sp-2) 14px;
  border-left: 4px solid var(--sel-border);
  color: var(--muted);
}

.course-html figure {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.course-html figcaption {
  font-weight: 800;
  color: var(--accent-text);
}

.course-html code {
  padding: 1px var(--sp-1);
  border-radius: 4px;
  background: var(--soft);
  font-size: 0.9375em;
}

.course-html pre {
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  background: var(--soft);
  overflow-x: auto;
}

.course-html pre code {
  padding: 0;
}

/* Encadre « Exemple » */
.course-html aside {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-3) 14px;
  border: 2px solid var(--warm-border);
  border-radius: var(--radius-lg);
  background: var(--warm-bg);
  color: var(--warm-text);
}

.course-html aside::before {
  content: "Exemple";
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--flame-text);
}

.course-html details {
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
}

.course-html summary,
.exercise__solution summary {
  font-weight: 800;
  color: var(--accent-text);
  cursor: pointer;
}

/* Un tableau large defile seul, sans elargir la page */
.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
}

.table-scroll table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table-scroll th,
.table-scroll td {
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--divider);
  text-align: left;
  vertical-align: top;
}

.table-scroll th {
  background: var(--soft);
  font-weight: 800;
}

/* Exercice et son corrige repliable */
.exercise {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 18px var(--sp-5);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.exercise__title {
  font-size: 1.1875rem;
}

.exercise__solution {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: var(--sp-3) 14px;
  border-radius: var(--radius-md);
  background: var(--green-bg);
  color: var(--green-text);
}

.exercise__solution[open] summary {
  margin-bottom: 10px;
}

/* QCM embarque dans une page de cours */
.course-quiz {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border: 2px solid var(--sel-border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--soft);
  scroll-margin-top: var(--sp-4);
}

.course-quiz__lead,
.course-quiz__note {
  color: var(--muted);
  font-weight: 600;
}

.course-quiz__member,
.course-quiz__end {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

.course-quiz__question {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.question-context {
  margin-block: var(--sp-1) var(--sp-5);
  padding-inline-start: var(--sp-4);
  border-inline-start: 3px solid var(--border);
  text-align: start;
}

.question-context__label {
  margin-block: 0 var(--sp-2);
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.question-context__text {
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.course-quiz__prompt {
  margin-bottom: var(--sp-3);
  padding: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.2;
}

.course-quiz__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--sel-text);
}

.course-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-3);
}

.course-pager__link--next {
  margin-left: auto;
  text-align: right;
}

.course-pager__link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 100%;
  font-weight: 800;
}

.course-pager__label {
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* --- Defis : partage, apercu, minuteur, scores compares ------------------- */
.button--danger {
  --button-edge: var(--danger-dark);
  background: var(--danger);
}

/* Bouton de partage : logo officiel tel quel (jamais recolore), puis le nom */
.share-button {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 88px;
  padding: 10px var(--sp-2);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-weight: 800;
  font-size: 0.875rem;
  text-align: center;
  text-decoration: none;
}
.share-button:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}
.share-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.share-button__logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  color: var(--accent-text);
}

/* Apercu : ce que verra l'ami, la carte de l'adversaire (cyan) */
.challenge-preview {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 2px solid var(--cyan);
  border-radius: var(--radius-xl);
  background: var(--cyan-bg);
  color: var(--cyan-text);
}
.challenge-preview__avatar {
  border: 3px solid var(--cyan);
}
.challenge-preview__lines {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.challenge-preview__title {
  font-weight: 800;
  color: var(--text);
}
.challenge-preview__text {
  font-weight: 700;
  font-size: 0.875rem;
}

.challenge-timer {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.challenge-timer__counter,
.challenge-timer__value {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--muted-2);
}
.challenge-timer__value {
  min-width: 3.5ch;
  text-align: right;
}
.challenge-timer__bar {
  flex-grow: 1;
}
.challenge-timer[data-urgent="true"] .challenge-timer__value {
  color: var(--red-strong);
}

.versus {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.versus__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "avatar name score" "avatar time score";
  align-items: center;
  column-gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
}
/* Le joueur a l'anneau flamme, l'adversaire l'anneau cyan ; le gagnant, la flamme */
.versus__row--me .avatar { border: 3px solid var(--flame); }
.versus__row--rival .avatar { border: 3px solid var(--cyan); }
.versus__row[data-winner="true"] {
  border-color: var(--flame);
}
.versus__row[data-winner="true"] .versus__score {
  color: var(--flame-text);
}
.versus__row .avatar {
  grid-area: avatar;
}
.versus__name {
  grid-area: name;
  font-weight: 800;
}
.versus__time {
  grid-area: time;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--muted);
}
.versus__score {
  grid-area: score;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
}

/* Ligne d'une liste de defis ou d'amis : avatar, textes, action */
.challenge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 14px;
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.challenge-row__text {
  display: flex;
  flex: 1 1 160px;
  flex-direction: column;
  min-width: 0;
}
.challenge-row__title {
  font-weight: 800;
}
.challenge-row__meta {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}

/* --- Series a deux : avatars groupes, carte, invitation, membres, semaine ---- */
/* Avatars qui se chevauchent, chacun cerne du fond de la carte */
.duo-avatars {
  display: inline-flex;
  flex-shrink: 0;
}
.duo-avatars .avatar {
  border: 3px solid var(--surface);
}
.duo-avatars .avatar + .avatar {
  margin-left: -12px;
}
.duo-avatars--large .avatar {
  width: 64px;
  height: 64px;
  border-width: 4px;
  font-size: 1.75rem;
}
.duo-avatars--large .avatar + .avatar {
  margin-left: -16px;
}

/* Carte « Serie a deux avec Lea · 12 j » : un lien vers la page de la serie */
.duo-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-4);
  border: 2px solid var(--warm-border);
  border-bottom-width: 5px;
  border-radius: var(--radius-xl);
  background: var(--warm-bg);
  color: var(--warm-text);
  text-decoration: none;
}
.duo-card .duo-avatars .avatar {
  border-color: var(--warm-bg);
}
.duo-card[data-status="suspended"] {
  border-color: var(--red-border);
  background: var(--red-bg);
  color: var(--text);
}
.duo-card[data-status="suspended"] .duo-avatars .avatar {
  border-color: var(--red-bg);
}
.duo-card__text {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}
.duo-card__title {
  font-weight: 800;
  color: var(--warm-strong);
}
.duo-card[data-status="suspended"] .duo-card__title {
  color: var(--red-strong);
}
.duo-card__status {
  font-weight: 600;
  font-size: 0.9375rem;
}
.duo-card__chevron {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

/* Invitation recue : avatar, texte, Accepter / Refuser */
.duo-invitation {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) 14px;
  border: 2px solid var(--sel-border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--sel-bg);
  color: var(--sel-text);
}
.duo-invitation__text {
  display: flex;
  flex: 1 1 180px;
  flex-direction: column;
  min-width: 0;
}
.duo-invitation__title {
  font-weight: 800;
}
.duo-invitation__meta {
  font-weight: 600;
  font-size: 0.875rem;
}
.duo-invitation__actions {
  display: flex;
  gap: var(--sp-2);
}

/* Membre et son etat du jour */
.duo-member {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.duo-member__name {
  flex-grow: 1;
  min-width: 0;
  font-weight: 800;
}
.duo-member__state {
  flex-shrink: 0;
  padding: var(--sp-1) 10px;
  border-radius: var(--radius-pill);
  background: var(--warm-bg);
  color: var(--warm-strong);
  font-weight: 800;
  font-size: 0.875rem;
}
.duo-member__state[data-done="true"] {
  background: var(--green-bg);
  color: var(--green-strong);
}

/* Semaine : sept pastilles, pleines les jours valides ensemble */
.duo-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.duo-week__day {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  max-width: 48px;
  margin: 0 auto;
  width: 100%;
  border: 2px solid var(--track-edge);
  border-radius: 50%;
  background: var(--track);
  color: var(--muted);
  font-weight: 800;
}
.duo-week__day[data-validated="true"] {
  border-color: var(--flame-dark);
  background: var(--flame);
  color: var(--on-flame);
}

/* Carte a partager d'un palier atteint */
.duo-share-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  padding: var(--sp-5) var(--sp-4);
  border-bottom: 6px solid var(--violet-dark);
  border-radius: var(--radius-xl);
  background: var(--violet);
  color: var(--on-accent);
  text-align: center;
}
.duo-share-card .duo-avatars .avatar {
  border-color: var(--violet);
}
.duo-share-card__days {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.5rem;
  line-height: 1.1;
}
.duo-share-card__label,
.duo-share-card__brand {
  font-weight: 700;
}
.duo-share-card__names {
  font-weight: 800;
  font-size: 1.125rem;
}
.duo-share-card__brand {
  margin-top: 6px;
  font-size: 0.875rem;
  opacity: 0.85;
}

/* --- Onglets : barre segmentee (motif « tabs » de l'ARIA) --------------------- */
/* Des <button role="tab"> dans un role="tablist" ; l'onglet actif porte aria-selected */
/* Aussi pour un segmente sans onglets (choix du theme) : `aria-pressed` */
.tabs {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 6px;
  padding: var(--sp-1);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.tabs__tab {
  min-height: var(--touch-min);
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
}

.tabs__tab:is([aria-selected="true"], [aria-pressed="true"], :has(input:checked)) {
  background: var(--violet);
  color: var(--on-accent);
}

/* Segmente en boutons radio (reglage du theme) : le libelle porte l'option */
label.tabs__tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tabs__tab:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Sur un bandeau chaud (defi du jour) : voile sombre, option active flamme */
.tabs--warm {
  background: var(--shade);
}

.tabs--warm .tabs__tab {
  color: var(--warm-text);
}

.tabs--warm .tabs__tab:is([aria-selected="true"], [aria-pressed="true"]) {
  background: var(--flame);
  color: var(--on-flame);
}

/* --- Classement : division, lignes, zones, fin de semaine ----------------------- */
/* Bandeau de division : fond des bandeaux, joyau et contour a la couleur de la ligue
   (`data-league`, pose par leagues.js) */
.league-banner {
  --league: var(--violet);
  --league-edge: var(--violet-dark);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px var(--sp-4);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--text);
}

.league-banner__icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.league-banner__text {
  display: flex;
  flex-direction: column;
}

.league-banner__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
}

.league-banner__meta {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--muted);
}

.league-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Une ligne par eleve (maquette classement/Classement) : rang, avatar, pseudo, XP */
.league-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 52px;
  padding: 6px 14px;
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.league-row[data-me="true"] {
  border: 2px solid var(--violet-light);
  background: var(--sel-bg);
}

.league-row__rank {
  flex-shrink: 0;
  width: 26px;
  font-weight: 800;
  text-align: center;
  color: var(--muted-2);
}

.league-row[data-zone="up"] .league-row__rank {
  color: var(--flame-text);
}

.league-row[data-zone="down"] .league-row__rank {
  color: var(--red-strong);
}

.league-row__avatar {
  width: 36px;
  height: 36px;
  font-size: 1.0625rem;
}

.league-row__pseudo {
  flex-grow: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.league-row__xp {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--sp-1);
  font-weight: 800;
  font-size: 0.9375rem;
  color: var(--text);
}

.league-row__xp::before {
  content: "";
  width: 18px;
  height: 18px;
  background: url("/icones/eclair.svg?v=c5edf1fdfa") center / contain no-repeat;
}

/* Limite de zone : « Les 5 premiers montent en division Saphir » */
.league-zone {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-1);
  font-weight: 800;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--green-strong);
}

.league-zone::before,
.league-zone::after {
  content: '';
  flex-grow: 1;
  min-width: 16px;
  border-top: 2px solid currentColor;
}

/* Grand bouton or des maquettes de la refonte (CREER LE LIEN DU DEFI, RELEVER LE DEFI) */
.cta-caps {
  min-height: var(--button-h);
  --button-edge-size: var(--relief-xl);
  font-family: var(--font-display);
  font-size: 1.125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.challenge-launch {
  gap: 10px;
  min-height: 64px;
  --button-edge-size: var(--relief-xl);
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Face a face : corrections repliees derriere « Voir les corrections » */
.corrections--folded > summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  list-style: none;
  cursor: pointer;
}

.corrections--folded > summary::-webkit-details-marker { display: none; }

.corrections--folded > summary::before {
  content: "";
  width: 20px;
  height: 20px;
  background: url("/icones/question.svg?v=7d5e737cfc") center / contain no-repeat;
}

.corrections--folded > summary .corrections__title {
  margin: 0;
  font-size: 1rem;
}

.corrections--folded[open] > summary {
  margin-bottom: var(--sp-3);
}

/* Ecran d'etat (classement indisponible…) : icone, titre, texte, deux actions */
.state-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 480px;
  margin: 0 auto;
  padding-top: 30px;
  text-align: center;
}

.state-screen[hidden] { display: none; }

/* Maquette classement/IndisponibleMobile : carre de 120, titre de 30, texte de 16 */
.state-screen__icon {
  display: grid;
  place-items: center;
  width: 120px;
  height: 120px;
  border-radius: 36px;
  background: var(--surface);
}

.state-screen__icon .site-icon {
  width: 52px;
  height: 52px;
}

.state-screen__title {
  margin: 0;
  padding-inline: 6px;
  font-size: 1.875rem;
  line-height: 1.05;
}

.state-screen__text {
  margin: 0 0 10px;
  padding-inline: 6px;
  color: var(--muted);
  font-weight: 700;
}

.state-screen > .button { margin-top: 6px; }

.state-screen > .button--flame {
  min-height: 64px;
  border-radius: var(--r-xl);
  font-size: 1.25rem;
}

.state-screen__back {
  --button-edge-size: 0px;
  min-height: 56px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  box-shadow: none;
  font-size: 1.0625rem;
}

.league-zone[data-zone="down"] {
  color: var(--red-strong);
}

/* Fenetre « Semaine terminee » */
.league-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: var(--radius-xl);
  background: var(--sel-bg);
  color: var(--accent-text);
}

.league-badge :is(svg, .site-icon) {
  width: 52px;
  height: 52px;
}

.league-badge[data-outcome="up"] {
  background: var(--green-bg);
  color: var(--green-strong);
}

.league-badge[data-outcome="down"] {
  background: var(--red-bg);
  color: var(--red-strong);
}

.league-result {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 10px;
  width: 100%;
  margin: 0;
}

.league-result__item {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: 14px var(--sp-2);
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.league-result__item dt {
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--muted);
}

.league-result__item dd {
  margin: 0;
  font-weight: 800;
  font-size: 1.625rem;
}

/* Les gemmes sont cyan, comme leur pastille */
.league-result__item--gems {
  background: var(--cyan-bg);
  color: var(--cyan-text);
}

.league-result__item--gems dt {
  color: var(--cyan-text);
}

.league-result__next {
  width: 100%;
  text-align: left;
}

/* --- Cartes de cours (/cartes) : paquet, carte a retourner, bilan ----------- */
.cards-chapters,
.cards-subject,
.cards-deck,
.cards-player,
.cards-end {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.cards-chapters__lead,
.flashcard__hint,
.cards-end__text {
  color: var(--muted);
  font-weight: 600;
}

.cards-subject__title {
  font-size: 1.25rem;
}

.cards-deck__eyebrow,
.cards-player__counter {
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.cards-deck__title,
.cards-end__title {
  font-size: 1.75rem;
  line-height: 1.15;
}

.cards-deck__header {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

/* Filtre « Toutes » / « A revoir » : deux boutons bascule (aria-pressed). */
.cards-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.cards-filter__button {
  padding: var(--sp-2) 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  font-size: 0.875rem;
  cursor: pointer;
}

.cards-filter__button[aria-pressed="true"] {
  border-color: var(--sel-border);
  background: var(--sel-bg);
  color: var(--sel-text);
}

.flashcard {
  min-height: 240px;
  cursor: pointer;
}

.flashcard[data-side="back"] {
  border-color: var(--sel-border);
}

.flashcard__flip {
  align-self: flex-start;
  margin-top: auto;
}

.cards-player__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.cards-end {
  align-items: center;
  text-align: center;
}

.cards-end__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
  width: 100%;
  margin: 0;
}

.cards-end__stat {
  padding: 14px var(--sp-2);
  border-radius: var(--radius-lg);
  background: var(--soft);
}

.cards-end__stat dt {
  font-weight: 800;
  font-size: 0.8125rem;
  color: var(--muted);
}

.cards-end__stat dd {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.75rem;
}

.cards-end__stat--known {
  background: var(--green-bg);
  color: var(--green-strong);
}

.cards-end__stat--again {
  background: var(--warm-bg);
  color: var(--warm-strong);
}

.cards-end__stat--known dt,
.cards-end__stat--again dt {
  color: inherit;
}

.cards-end__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
}

/* Bloc de l'eleve connecte sur une page de cours, et proposition d'ajouter une matiere */
.course-member {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
}

.subject-suggestion {
  width: 100%;
}

.subject-suggestion__text {
  font-weight: 800;
}

/* --- Defi de classe (lot V4.1) --------------------------------------------- */
.class-eyebrow {
  align-self: center;
  margin: 0;
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--radius-pill);
  background: var(--flame);
  color: var(--on-flame);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.class-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px var(--sp-4);
  border: 2px solid var(--warm-border);
  border-radius: var(--radius-lg);
  background: var(--warm-bg);
  color: var(--warm-strong);
  font-weight: 800;
}

.class-board {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.class-board__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.class-row {
  display: grid;
  grid-template-columns: 28px auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.class-row[data-me="true"] {
  border-color: var(--violet);
  background: var(--sel-bg);
}

.class-row__rank {
  color: var(--muted-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  text-align: center;
}

.class-row:first-child .class-row__rank {
  color: var(--flame-text);
}

.class-row__name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.class-row__score {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}

.class-row__time {
  color: var(--muted);
  font-size: 0.875rem;
}

.class-board__more {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

/* Bloc « Defie un ami » des pages publiques (lot V5.1). Sur mobile, il suit
   l'introduction ; sur un grand ecran, il occupe une colonne collante a
   droite de son conteneur (`.has-challenge-cta`), sans etre duplique : les
   autres enfants restent dans la premiere colonne, une ligne chacun. */
.challenge-cta {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 2px solid var(--warm-border);
  border-radius: var(--radius-xl);
  background: var(--warm-bg);
  color: var(--warm-text);
}

.challenge-cta__title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warm-strong);
  font-size: 1.25rem;
  line-height: 1.15;
}

.challenge-cta__title .site-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.challenge-cta__text {
  font-size: 1rem;
  line-height: 1.45;
}

.challenge-cta__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-decoration: none;
}

.challenge-cta__button .site-icon {
  width: 22px;
  height: 22px;
}

.challenge-cta__note {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--warm-text);
}

/* Page de sujet : le PDF et le corrige ont deja leurs colonnes ; le bloc
   reste en ligne, compact, texte a gauche et boutons a droite. */
@media (min-width: 960px) {
  .exam .challenge-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    column-gap: var(--sp-4);
    row-gap: 6px;
  }

  .exam .challenge-cta__title,
  .exam .challenge-cta__text,
  .exam .challenge-cta__note {
    grid-column: 1;
  }

  .exam .challenge-cta__button {
    grid-row: 1 / span 3;
    width: auto;
  }

  .exam .challenge-cta__button:nth-of-type(1) {
    grid-column: 2;
  }

  .exam .challenge-cta__button:nth-of-type(2) {
    grid-column: 3;
  }
}

/* Chapitre en cartes : colonne collante a droite. `article.course` l'emporte
   sur la regle `.course` de layout.css, chargee apres. */
@media (min-width: 1280px) {
  article.has-challenge-cta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: var(--space-8);
    row-gap: 0;
    align-items: start;
  }

  article.has-challenge-cta > * {
    grid-column: 1;
  }

  /* L'ecart des lignes passe en marge : le bloc couvre toutes les lignes. */
  article.has-challenge-cta > * + * {
    margin-top: var(--space-6);
  }

  article.has-challenge-cta > .challenge-cta {
    position: sticky;
    top: 24px;
    grid-column: 2;
    grid-row: 1 / span 40;
    margin-top: 0;
  }
}

/* Fin de la partie d'auteur (`/creer-defi`) : texte puis boutons, espaces. */
.draft-actions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
}

/* Preuve sociale (lot V5.3) : trois avatars generiques qui se chevauchent,
   puis le nombre de joueurs du jour. */
.social-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  font-weight: 700;
}

.social-proof[hidden] {
  display: none;
}

.social-proof__avatars {
  display: inline-flex;
  flex-shrink: 0;
}

.social-proof__avatar {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border: 2px solid var(--surface);
  background-image: url("/icones/ami.svg?v=178248e342");
  background-position: center;
  background-size: 16px;
  background-repeat: no-repeat;
}

.social-proof__avatar + .social-proof__avatar {
  margin-left: -8px;
}

/* Bandeau d'un temps fort (lot V5.5) : bac, vacances, rentree. */
.moment-banner {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--violet);
  border-radius: 16px;
  background: var(--sel-bg);
  color: var(--sel-text);
  text-align: left;
}

.moment-banner[hidden] {
  display: none;
}

.moment-banner__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  color: inherit;
}

.moment-banner__text {
  font-size: 0.9375rem;
}

/* --- Carres matiere : couleur vive, icone blanche duotone ------------------ */
/*
 * `data-subject` (slug du catalogue) pose la couleur et l'icone de la matiere
 * sur l'element et ses enfants : carre, barre de progression, bordure basse.
 * Une matiere sans icone dediee garde l'icone de revision ; un slug inconnu,
 * le violet.
 * L'icone est un masque : elle prend la couleur `--on-accent`, sans <img>.
 */
[data-subject] {
  --subject-color: var(--violet);
  --subject-icon: url('/icones/interface/reviser.svg?v=df7fc71fcb');
}

[data-subject="philosophie"] {
  --subject-color: var(--subject-philo);
  --subject-edge: var(--subject-philo-edge);
  --subject-icon: url('/icones/matieres/philosophie.svg?v=ab76cc44a5');
}

[data-subject="mathematiques"],
[data-subject="mathematiques-specialite"] {
  --subject-color: var(--subject-maths);
  --subject-edge: var(--subject-maths-edge);
  --subject-icon: url('/icones/matieres/mathematiques.svg?v=76c03c495e');
}

[data-subject="histoire-geographie"] {
  --subject-color: var(--subject-histoire-geo);
  --subject-edge: var(--subject-histoire-geo-edge);
  --subject-icon: url('/icones/matieres/histoire-geographie.svg?v=8c0fbfacb6');
}

[data-subject="ses"] {
  --subject-color: var(--subject-ses);
  --subject-edge: var(--subject-ses-edge);
  --subject-icon: url('/icones/matieres/ses.svg?v=061e21f583');
}

[data-subject="physique-chimie"] {
  --subject-color: var(--subject-physique-chimie);
  --subject-edge: var(--subject-physique-chimie-edge);
  --subject-icon: url('/icones/matieres/physique-chimie.svg?v=88a2f2ad01');
}

[data-subject="svt"] {
  --subject-color: var(--subject-svt);
  --subject-edge: var(--subject-svt-edge);
  --subject-icon: url('/icones/matieres/svt.svg?v=da48dd242b');
}

[data-subject="francais"] {
  --subject-color: var(--subject-francais);
  --subject-edge: var(--subject-francais-edge);
  --subject-icon: url('/icones/matieres/francais.svg?v=d457b275fb');
}

[data-subject="hggsp"] {
  --subject-color: var(--subject-hggsp);
  --subject-edge: var(--subject-hggsp-edge);
  --subject-icon: url('/icones/matieres/hggsp.svg?v=99635572e2');
}

/* Matieres sans icone dediee : leur couleur, l'icone de revision */
[data-subject="anglais"] { --subject-color: var(--subject-anglais); --subject-edge: var(--subject-anglais-edge); }
[data-subject="espagnol"] { --subject-color: var(--subject-espagnol); --subject-edge: var(--subject-espagnol-edge); }
[data-subject="emc"] { --subject-color: var(--subject-emc); --subject-edge: var(--subject-emc-edge); }
[data-subject="enseignement-scientifique"] { --subject-color: var(--subject-ens-scientifique); --subject-edge: var(--subject-ens-scientifique-edge); }
[data-subject="snt"] { --subject-color: var(--subject-snt); --subject-edge: var(--subject-snt-edge); }
[data-subject="droit-economie"] { --subject-color: var(--subject-droit-eco); --subject-edge: var(--subject-droit-eco-edge); }
[data-subject="gestion-finance"] { --subject-color: var(--subject-gestion-finance); --subject-edge: var(--subject-gestion-finance-edge); }
[data-subject="mercatique"] { --subject-color: var(--subject-mercatique); --subject-edge: var(--subject-mercatique-edge); }
[data-subject="rh-communication"] { --subject-color: var(--subject-rh-com); --subject-edge: var(--subject-rh-com-edge); }
[data-subject="sig"] { --subject-color: var(--subject-sig); --subject-edge: var(--subject-sig-edge); }

[data-subject="management"],
[data-subject="sgn"],
[data-subject="msgn"] {
  --subject-color: var(--subject-management);
  --subject-edge: var(--subject-management-edge);
}

.subject-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--subject-color, var(--violet));
}

.subject-tile::before {
  content: '';
  width: 28px;
  height: 28px;
  background: var(--on-accent);
  mask: var(--subject-icon) center / contain no-repeat;
}

.subject-tile--small {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.subject-tile--small::before {
  width: 22px;
  height: 22px;
}

.subject-tile--large {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
}

.subject-tile--large::before {
  width: 38px;
  height: 38px;
}

/* Carre et nom dessous (grille des matieres) */
.subject-pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 72px;
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

/* Carte matiere : surface, relief a la couleur de la matiere, progression */
.subject-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: 14px;
  border: 1px solid var(--border);
  border-bottom: var(--relief) solid var(--subject-color, var(--violet));
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.subject-card__name {
  font-weight: 800;
  font-size: 0.9375rem;
}

.subject-card__progress {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.subject-card__progress .progress {
  flex: 1;
  height: 6px;
}

.subject-card__count {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

/* --- Filigranes : grandes icones au trait derriere le contenu --------------- */
/*
 * Un <svg class="watermark" aria-hidden="true"> d'une icone d'interface, pose
 * dans un conteneur `.has-watermark` qui le coupe. Le trait reste fin quelle
 * que soit la taille (`non-scaling-stroke`). Deux ou trois par ecran au plus.
 */
.has-watermark {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.watermark {
  position: absolute;
  z-index: -1;
  width: 240px;
  height: 240px;
  fill: none;
  stroke: var(--mark);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.watermark :is(path, circle, rect, line, polyline) {
  stroke-width: 1.2px;
  vector-effect: non-scaling-stroke;
}

.watermark--small { width: 150px; height: 150px; }

.watermark--top-right { top: -20px; right: -30px; transform: rotate(14deg); }
.watermark--bottom-left { bottom: -40px; left: -30px; transform: rotate(-12deg); }

/*
 * Fond des pages de l'application : un calque fixe, derriere tout le contenu
 * (z-index negatif sous le fond du corps, propage au canevas), qui porte deux
 * ou trois filigranes choisis selon la page. Il ne defile pas et n'intercepte
 * rien. Les pages de texte long (CGU, mentions) n'en ont pas.
 */
.page-marks {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.page-marks__mark--1 { top: 72px; right: -50px; width: 220px; height: 220px; transform: rotate(14deg); }
.page-marks__mark--2 { top: 46%; left: -56px; width: 160px; height: 160px; transform: rotate(-12deg); }
.page-marks__mark--3 { right: 8%; bottom: 96px; width: 180px; height: 180px; transform: rotate(10deg); }

@media (min-width: 960px) {
  .page-marks__mark--1 { top: 40px; right: 3%; width: 340px; height: 340px; }
  .page-marks__mark--2 { top: auto; bottom: -60px; left: 22%; width: 260px; height: 260px; }
  .page-marks__mark--3 { right: 30%; bottom: auto; top: 38%; width: 200px; height: 200px; }
}

/* --- Escalier des ligues : de Quartz a Diamant ------------------------------ */
/*
 * Six marches de plus en plus hautes, un joyau plein au-dessus de chacune.
 * `data-league` pose les couleurs de la division sur la marche et son joyau.
 */
.league-ladder {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  align-items: end;
  margin: 0;
  padding: 0;
  list-style: none;
}

.league-ladder__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

[data-league="quartz"] { --league: var(--league-quartz); --league-edge: var(--league-quartz-edge); --step-h: 36px; --gem-size: 18px; }
[data-league="topaze"] { --league: var(--league-topaze); --league-edge: var(--league-topaze-edge); --step-h: 50px; --gem-size: 20px; }
[data-league="amethyste"] { --league: var(--league-amethyste); --league-edge: var(--league-amethyste-edge); --step-h: 64px; --gem-size: 22px; }
[data-league="saphir"] { --league: var(--league-saphir); --league-edge: var(--league-saphir-edge); --step-h: 78px; --gem-size: 24px; }
[data-league="emeraude"] { --league: var(--league-emeraude); --league-edge: var(--league-emeraude-edge); --step-h: 92px; --gem-size: 26px; }
[data-league="diamant"] { --league: var(--league-diamant); --league-edge: var(--league-diamant-edge); --step-h: 110px; --gem-size: 30px; }

/* Joyau en trois calques : corps, table claire, facette sombre */
.gem {
  width: var(--gem-size, 24px);
  height: var(--gem-size, 24px);
  overflow: visible;
  filter: drop-shadow(var(--shadow-glyph));
}

.gem__body {
  fill: var(--league);
  stroke: var(--league);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

.gem__table {
  fill: var(--on-accent);
  fill-opacity: 0.45;
}

.gem__facet {
  fill: var(--league-edge);
}

.league-ladder__block {
  display: flex;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--step-h);
  padding-top: 6px;
  border-bottom: var(--relief-lg) solid var(--league-edge);
  border-radius: 12px 12px 6px 6px;
  background: var(--league);
  color: var(--on-league);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

.league-ladder__name {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 800;
}

.league-ladder__step[data-league="diamant"] .league-ladder__name {
  color: var(--cyan-strong);
}

.league-ladder__crown {
  width: 22px;
  height: 22px;
  filter: drop-shadow(var(--shadow-glyph));
}

/* --- Fiche d'oeuvre du bac de francais (/bac-de-francais/oeuvres/...) ------ */
/* Corps de 17 px, interligne 1,6, lignes de 70 caracteres au plus. */
.work {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  min-width: 0;
  font-size: 1.0625rem;
  line-height: 1.6;
}

.work p {
  max-width: 70ch;
}

.work-hero__actions,
.work-tags,
.work-quiz__challenge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Hero d'une fiche d'oeuvre : couverture a gauche, texte a droite, puis la
   fiche d'identite compacte, dans une seule carte. */
.oeuvre-card {
  border-bottom-width: var(--relief);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  border: 0;
  background: none;
}

.oeuvre-hero__hook {
  max-width: 600px;
  font-size: 1.0625rem;
  line-height: 1.5;
}

/* Encadre du parcours, aux couleurs chaudes */
.work-route-box {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--warm-border);
  border-radius: var(--radius-md);
  background: var(--warm-bg);
}

.work-route-box__label {
  color: var(--warm-strong);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.work-route-box__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-1) var(--sp-3);
}

.work-route-box__name {
  color: var(--warm-text);
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 800;
}

/* Fiche d'identite compacte, sous le hero, dans la meme carte */
.work-id {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0 var(--sp-4);
  padding: var(--sp-4) 0 var(--sp-5);
  border-top: 1px solid var(--border);
}

.work-id__cases {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-id__case {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-3);
  border-radius: var(--radius-md);
  background: var(--bg);
}

.work-id__label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.work-id__value {
  font-weight: 800;
  line-height: 1.3;
}

.work-id__more summary {
  color: var(--accent-text);
  font-weight: 800;
  cursor: pointer;
}

.work-id__list {
  display: grid;
  gap: var(--sp-3);
  margin: var(--sp-3) 0 0;
}

.work-id__list dt {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

.work-id__list dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.4;
}

.work-id__list dd strong {
  color: var(--accent-text);
}

.work-id__list dd strong + span {
  display: block;
  color: var(--muted);
  font-size: 0.8125rem;
}

@media (min-width: 720px) {
  .oeuvre-hero__crumbs .breadcrumb__list > li:last-child {
    display: list-item;
  }

  .oeuvre-hero__hook {
    font-size: 1.1875rem;
  }

  .work-route-box {
    flex-direction: row;
    align-items: center;
    gap: var(--sp-4);
    max-width: 600px;
  }

  .work-route-box__label {
    flex-shrink: 0;
  }

  .work-route-box__row {
    flex: 1;
  }

  .work-id {
    margin: 0 var(--sp-5);
    padding: var(--sp-4) 0 var(--sp-5);
  }

  .work-id__cases {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Sommaire colle en haut au defilement ; la section lue est surlignee (js/bac-francais.js). */
.work-toc {
  position: sticky;
  top: 0;
  z-index: 3;
  padding-block: var(--sp-2);
  background: var(--bg);
  overflow-x: auto;
}

.work-toc__list {
  display: flex;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-toc__list a {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: var(--touch-min);
  padding: 6px 14px 6px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.work-toc__number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--accent-text);
  font-size: 0.8125rem;
}

.work-toc__list a[aria-current="true"] {
  border-color: var(--violet-dark);
  background: var(--violet);
  color: var(--on-accent);
}

.work-toc__list a[aria-current="true"] .work-toc__number {
  background: var(--on-accent);
  color: var(--violet-dark);
}

.work-section {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  scroll-margin-top: 72px;
}

.work-section__heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}

.work-section__title {
  font-size: 1.875rem;
}

.work-section__lead,
.work-note {
  color: var(--muted);
}

.work-note {
  font-size: 0.875rem;
}

/* L'essentiel en 30 secondes */
.work-essentials {
  padding: 0;
  border: 0;
  border-radius: var(--radius-xl);
  background: none;
}

.work-essentials__list {
  display: grid;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-essential {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: var(--sp-4);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.work-essential__number {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-bottom: var(--relief) solid var(--objet-edge);
  border-radius: var(--radius-md);
  background: var(--objet-color);
  color: var(--objet-ink);
  font-size: 1.125rem;
}

.work-essential h3 {
  color: var(--text);
  font-size: 1.125rem;
}

/* Resume en frise : pastille d'acte, trait vertical, carte */
.work-counter {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  border: 2px solid var(--warm-border);
  border-radius: var(--radius-lg);
  background: var(--warm-bg);
  color: var(--warm-text);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.2;
}

.work-counter strong {
  color: var(--warm-strong);
  font-family: var(--font-display);
  font-size: 2rem;
}

.work-timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-timeline__item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--sp-4);
}

.work-timeline__item:not(:last-child)::before {
  position: absolute;
  top: 56px;
  bottom: calc(-1 * var(--sp-4));
  left: 23px;
  width: 2px;
  background: var(--border);
  content: '';
}

.work-timeline__marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-bottom: var(--relief) solid var(--subject-francais-edge);
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  border-bottom-color: var(--objet-edge);
  background: var(--objet-color);
  color: var(--objet-ink);
}

.work-timeline__card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-timeline__card h3 {
  font-size: 1.25rem;
}

/* Personnages : quiproquo, puis grille de cartes */
.work-quiproquo {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--sel-border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-quiproquo__title {
  color: var(--accent-text);
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-quiproquo__scheme {
  display: grid;
  gap: var(--sp-3);
}

.work-quiproquo__side {
  display: flex;
  flex-direction: column;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.work-quiproquo__side span {
  color: var(--muted);
  font-size: 0.875rem;
}

.work-quiproquo__side strong {
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.work-quiproquo__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--flame-text);
  font-size: 0.875rem;
  font-weight: 800;
  text-align: center;
}

.work-quiproquo__link span {
  font-size: 1.5rem;
  line-height: 1;
}

.work-cast {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-person {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-person--main {
  border-color: var(--sel-border);
  background: var(--sel-bg);
}

.work-person__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  background: var(--violet);
  color: var(--on-accent);
}

.work-person--main .work-person__avatar {
  background: var(--subject-francais);
  color: var(--on-accent);
}

.work-person__name {
  font-size: 1.125rem;
}

.work-person .chip {
  margin-block: 2px 6px;
  padding: 2px 10px;
}

.work-person__role {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
}

/* Themes et citations */
.work-themes {
  display: grid;
  gap: var(--sp-4);
}

.work-theme {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-theme__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--sel-bg);
}

.work-theme h3 {
  font-size: 1.25rem;
}

.work-quote {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--sp-1) var(--sp-3);
  margin: auto 0 0;
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--soft);
}

.work-quote blockquote {
  margin: 0;
}

.work-quote blockquote p {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  line-height: 1.25;
}

.work-quote figcaption {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

.work-quote__share {
  grid-row: 1 / span 2;
  grid-column: 2;
}

.work-route {
  display: grid;
  gap: var(--sp-4);
  padding: var(--space-6);
  border: 2px solid var(--sel-border);
  border-radius: var(--radius-xl);
  background: var(--sel-bg);
  color: var(--sel-text);
}

.work-route__title {
  color: var(--sel-text);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-quote--route {
  background: var(--surface);
}

/* Dissertation : plan en colonnes, sujets a construire */
.work-subjects {
  display: grid;
  gap: var(--sp-4);
}

.work-subject {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-subject h3 {
  font-size: 1.25rem;
}

.work-plan {
  display: grid;
  gap: var(--sp-3);
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-plan__part {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--radius-md);
  background: var(--soft);
  font-size: 0.9375rem;
  line-height: 1.5;
}

.work-plan__number {
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1;
}

.work-plan__part h4 {
  margin: 0;
  font-size: 1.0625rem;
}

.work-plan__part ul {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding-left: 1.1em;
}

/* Quiz « Tu l'as vraiment lu ? » : badges, segments, reponses en 2 x 2 */
.work-quiz {
  gap: var(--sp-4);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--sel-bg);
}

.work-quiz .course-section__title {
  font-size: 2rem;
}

.work-ranks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-ranks li {
  display: flex;
  flex-direction: column;
  padding: var(--sp-2) var(--sp-3);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 0.8125rem;
  line-height: 1.3;
}

.work-ranks span {
  color: var(--muted);
}

.work-quiz__segments {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-quiz__segments li {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.work-quiz__segments li[data-state="done"] {
  background: var(--violet);
}

.work-quiz__segments li[data-state="current"] {
  background: var(--flame);
}

.work-quiz .answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.work-quiz .answer__box {
  align-items: flex-start;
  min-height: var(--button-h);
  height: 100%;
  font-size: 1rem;
}

.work-quiz__challenge {
  margin-top: var(--sp-2);
}

/* FAQ en accordeons */
.work-faq {
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.work-faq summary {
  display: flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: var(--sp-4);
  font-weight: 800;
  cursor: pointer;
}

.work-faq p {
  padding: 0 var(--sp-4) var(--sp-4);
}

/* Pour aller plus loin : cartes cliquables */
.work-related {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work-related__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-1);
  height: 100%;
  padding: var(--sp-4);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

a.work-related__card:hover {
  border-color: var(--sel-border);
  background: var(--sel-bg);
}

.work-related__kicker {
  color: var(--accent-text);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.work-related__title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
}

.work-related__meta {
  color: var(--muted);
  font-size: 0.875rem;
}

@media (min-width: 760px) {
  .work-essentials__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .work-quiproquo__scheme {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .work-themes,
  .work-subjects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-subject--plan {
    grid-column: 1 / -1;
  }

  .work-plan {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .work-route {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
  }
}

@media (max-width: 520px) {
  .work-quiz,
  .work-route {
    padding: var(--sp-4);
  }

  .work-quiz .answer__box {
    gap: var(--sp-2);
    padding: 10px;
    font-size: 0.9375rem;
  }
}

/* --- Programme du bac de francais (/bac-de-francais/oeuvres/) --------------- */
/* Couleur de l'objet d'etude : `data-objet` pose --objet-color, son relief et son texte. */
[data-objet="roman"] { --objet-color: var(--objet-roman); --objet-edge: var(--objet-roman-edge); --objet-ink: var(--objet-roman-text); }
[data-objet="theatre"] { --objet-color: var(--objet-theatre); --objet-edge: var(--objet-theatre-edge); --objet-ink: var(--objet-theatre-text); }
[data-objet="poesie"] { --objet-color: var(--objet-poesie); --objet-edge: var(--objet-poesie-edge); --objet-ink: var(--objet-poesie-text); }
[data-objet="idees"] { --objet-color: var(--objet-idees); --objet-edge: var(--objet-idees-edge); --objet-ink: var(--objet-idees-text); }

/* Sur une fiche d'oeuvre, les pastilles d'acte prennent la couleur de l'objet d'etude. */
.work[data-objet] .work-timeline__marker {
  border-bottom-color: var(--objet-edge);
  background: var(--objet-color);
  color: var(--objet-ink);
}

.programme {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--sp-5);
}

.programme-hero {
  grid-template-columns: minmax(0, 1fr);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  padding: 0;
  border: 0;
  background: none;
}

/* Choix de la voie : controle segmente */
.voie-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

.voie-switch__label {
  font-weight: 800;
}

.voie-switch__options {
  display: flex;
  width: 100%;
  max-width: 360px;
  height: 46px;
  gap: var(--sp-1);
  padding: var(--sp-1);
  border-radius: 16px;
  background: var(--soft);
  box-sizing: border-box;
}

.voie-switch__options button {
  flex: 1;
  min-height: 38px;
  padding: 0 var(--sp-3);
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font: 800 0.9375rem var(--font-display);
  cursor: pointer;
}

/* Voie choisie en or (maquettes bacfr/*) */
.voie-switch__options button[aria-pressed="true"] {
  background: var(--flame);
  color: var(--on-flame);
  box-shadow: 0 3px 0 var(--flame-edge);
}

/* Bandeau colle « Mon programme » */
.programme-bar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  border: 2px solid var(--sel-border);
  background: var(--sel-bg);
  flex-wrap: nowrap;
  gap: 14px;
  padding: var(--sp-3) 14px;
  border-radius: var(--r-lg);
  color: var(--text);
}

.programme-bar__count {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1;
}

.programme-bar__count strong {
  margin-right: var(--sp-1);
  font-family: var(--font-display);
  margin: 0;
  color: var(--flame-text);
  font-size: inherit;
}

.programme-bar__status:empty {
  display: none;
}

.programme-bar__status {
  font-size: 0.875rem;
  flex-basis: auto;
}

/* Une section par objet d'etude */
.programme-objet {
  display: flex;
  flex-direction: column;
  scroll-margin-top: 96px;
  gap: var(--sp-3);
}

.programme-objet__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.programme-objet__number {
  border-bottom: var(--relief) solid var(--objet-edge);
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: var(--objet-color);
  box-shadow: 0 4px 0 var(--objet-edge);
  color: var(--objet-ink);
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
}

.programme-objet__title {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.05;
}

/* Grille de cartes : 2 colonnes, 4 a partir de 960 px */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.programme-card {
  border-bottom-width: var(--relief);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: none;
}

.programme-card__cover {
  grid-template-columns: 56px minmax(0, 1fr);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: var(--sp-1);
  text-align: left;
  min-height: 150px;
  padding: 14px;
  border: 0;
  border-radius: 20px;
  background: var(--objet-color);
  box-shadow: 0 6px 0 var(--objet-edge);
  box-sizing: border-box;
  color: var(--objet-ink);
  text-decoration: none;
}

.programme-card__title {
  margin: 0;
  color: inherit;
  font-size: 1.0625rem;
  line-height: 1.05;
}

.programme-card__author {
  margin: 0;
  font-size: var(--fs-tiny);
  font-weight: 800;
  opacity: 0.85;
}

.programme-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: var(--sp-2);
  padding: var(--sp-4);
}

.programme-card__label {
  font-weight: 800;
  color: var(--lock);
  font-size: inherit;
  letter-spacing: 0;
  text-transform: uppercase;
}

.programme-card__parcours {
  color: var(--warm-strong);
  font-size: 0.9375rem;
  font-weight: 800;
  line-height: 1.35;
}

.programme-card__absent {
  line-height: 1.4;
  display: none;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin: 0;
  border-radius: var(--r-sm);
  background: var(--soft);
  color: var(--lock);
  font-size: var(--fs-tiny);
  font-weight: 800;
}

.programme-card__route + .programme-card__route,
.programme-card__route + .programme-card__absent,
.programme-card__absent + .programme-card__route {
  padding-top: var(--sp-2);
  border-top: 1px solid var(--divider);
}

.programme-card__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin-top: auto;
  padding-top: var(--sp-2);
}

.programme-card__pick[aria-pressed="true"] {
  border: 2px solid var(--success);
  border-color: var(--success);
  background: var(--green-bg);
  color: var(--green-strong);
}

.programme-card[data-chosen] {
  border-color: var(--success);
  border: 0;
}

/* Sans voie choisie (sans script), les deux voies s'affichent, nommees. */
.programme:not([data-voie]) .programme-card__absent {
  display: none;
}

[data-voie] .programme-card__voie {
  display: none;
}

[data-voie="generale"] [data-voie-only="technologique"],
[data-voie="technologique"] [data-voie-only="generale"] {
  display: none;
}

/* Oeuvre hors de la voie choisie : attenuee, sans selection. */
[data-voie="generale"] .programme-card:not([data-voies~="generale"]),
[data-voie="technologique"] .programme-card:not([data-voies~="technologique"]) {
  border-bottom-width: 2px;
  order: 1;
  opacity: 0.45;
}

[data-voie="generale"] .programme-card:not([data-voies~="generale"]) .programme-card__cover,
[data-voie="technologique"] .programme-card:not([data-voies~="technologique"]) .programme-card__cover {
  background: var(--objet-color);
  color: var(--objet-ink);
}

[data-voie="generale"] .programme-card:not([data-voies~="generale"]) .programme-card__actions,
[data-voie="technologique"] .programme-card:not([data-voies~="technologique"]) .programme-card__actions {
  display: none;
}

.programme-source {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.875rem;
}

/* Sur une fiche, chaque voie a son parcours ; la voie choisie masque l'autre. */
.work-id__voie {
  display: flex;
  flex-direction: column;
}

/* --- Hub du bac de francais (/bac-de-francais/) ------------------------------ */
/* Nom de la voie devant un bloc propre a une voie : utile seulement sans voie choisie. */
[data-voie] .voie-label {
  display: none;
}

.voie-label {
  font-weight: 800;
}

.programme-source ul {
  margin: var(--sp-1) 0 0;
  padding: 0;
  list-style: none;
}

/* --- Oeuvres au programme, refonte v2 (phase 11, maquettes bacfr/Oeuvres*) ----- */
/* Fil d'Ariane en pastilles, commun aux pages du bac de francais */
.breadcrumb--pills .breadcrumb__list { gap: var(--sp-2); }
.breadcrumb--pills .breadcrumb__list li + li::before { content: none; }
/* Sur mobile, la page courante d'une fiche ou d'une methode est deja son titre */
@media (max-width: 959px) {
  .oeuvre-hero__crumbs .breadcrumb--pills .breadcrumb__list > li:last-child { display: none; }
}
.method-crumbs .breadcrumb--pills .breadcrumb__list > li:last-child { display: none; }
.breadcrumb--pills .breadcrumb__list :is(a, span) { display: flex; align-items: center; height: 36px; padding: 0 var(--sp-3); border-radius: 12px; background: var(--surface); color: var(--text); font-family: var(--font-display); font-size: 0.9375rem; font-weight: 800; text-decoration: none; }
.programme-hero .breadcrumb { margin-bottom: var(--sp-2); }
.programme-hero__title { margin: 0; font-family: var(--font-display); font-size: 2.125rem; font-weight: 800; line-height: 0.95; }
.programme-hero__count { color: var(--flame-text); }
.programme-hero__lead { margin: 0; color: var(--muted); font-size: 0.9375rem; font-weight: 800; }
.programme-bar[hidden] { display: none; }
.programme-bar__main { display: flex; flex: 1; flex-direction: column; gap: 6px; min-width: 0; }
.programme-bar__segments { display: flex; gap: var(--sp-1); max-width: 240px; margin: 0; padding: 0; list-style: none; }
.programme-bar__segments li { flex: 1; height: 10px; border-radius: 4px; background: var(--border); }
.programme-bar__segments li[data-chosen] { background: var(--objet-color); }
.programme-bar__share { flex-shrink: 0; gap: 10px; height: 46px; min-height: 0; padding: 0 var(--sp-4); font-size: 0.9375rem; letter-spacing: 0.03em; text-transform: uppercase; }
.programme-objet__badge { display: inline-flex; align-items: center; height: 26px; margin: 0; padding: 0 11px; border-radius: var(--r-pill); background: var(--error); color: var(--on-accent); font-size: 0.6875rem; font-weight: 900; text-transform: uppercase; }
a.programme-card__cover:hover .programme-card__title { text-decoration: underline; }
.programme-card__cover .chip { align-self: flex-start; }
.programme-card__route { margin: 0; color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; line-height: 1.3; }
.programme-card__pick { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border: 2px solid var(--border); border-radius: var(--r-sm); background: transparent; color: var(--accent-text); font: 800 var(--fs-small) var(--font-display); cursor: pointer; }
.programme-card__pick[hidden] { display: none; }
.programme-card__pick[aria-pressed="true"]::before { content: ""; width: 16px; height: 16px; background: url("/icones/reussi.svg?v=b5a64f7782") center / contain no-repeat; }
.programme-card[data-chosen] .programme-card__cover { outline: 3px solid var(--success); outline-offset: 3px; }
[data-voie="generale"] .programme-card:not([data-voies~="generale"]) .programme-card__absent,
[data-voie="technologique"] .programme-card:not([data-voies~="technologique"]) .programme-card__absent { display: flex; }
[data-voie="generale"] .programme-card:not([data-voies~="generale"]) .programme-card__pick,
[data-voie="technologique"] .programme-card:not([data-voies~="technologique"]) .programme-card__pick { display: none; }
.programme-source-line { margin: 0; color: var(--muted); font-size: var(--fs-tiny); font-weight: 700; }

@media (min-width: 960px) {
  .programme { gap: var(--sp-6); }
  .programme-hero__title { font-size: 3.25rem; }
  .programme-objet__title { font-size: 1.75rem; }
  .programme-grid,
  .programme-objet[data-objet] .programme-grid:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
  .programme-card__cover { min-height: 180px; }
  .programme-card__title { font-size: 1.25rem; }
}

/* --- Fiche d'oeuvre, refonte 2026 (phase 8, maquettes bacfr/Fiche*) ------------ */
/* Hero de la fiche, refonte v2 (phase 11) : aplat de l'objet, pastilles et parcours sur un voile sombre */
.oeuvre-hero { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--space-6); border: 0; border-radius: var(--r-2xl); background: var(--objet-color); box-shadow: var(--relief-hi-defi), 0 9px 0 var(--objet-edge); color: var(--objet-ink); }
.oeuvre-hero__tag { display: inline-flex; align-items: center; align-self: flex-start; height: 30px; margin: 0; padding: 0 11px; border-radius: var(--r-pill); background: var(--on-color-chip); color: inherit; font-size: var(--fs-tiny); font-weight: 900; letter-spacing: 0; text-transform: uppercase; white-space: nowrap; }
.oeuvre-hero .oeuvre-hero__title { margin: 0; color: inherit; font-size: 2.75rem; line-height: 0.9; }
.oeuvre-hero .oeuvre-hero__byline { margin: 0; color: inherit; font-family: var(--font-display); font-size: 1.25rem; font-weight: 800; opacity: 0.9; }
.oeuvre-hero__chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.oeuvre-hero__chips li { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: var(--r-pill); background: var(--on-color-chip); color: inherit; font-size: 0.8125rem; font-weight: 900; white-space: nowrap; }
.oeuvre-hero .oeuvre-hero__hook { max-width: none; margin: 0; color: inherit; }
.oeuvre-hero .work-route-box { flex-direction: column; align-items: stretch; max-width: none; gap: var(--sp-2); padding: var(--sp-3) 14px; border: 0; border-radius: var(--r-md); background: var(--on-color-chip); }
.oeuvre-hero .work-route-box__row { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.oeuvre-hero .work-route-box__label { margin: 0; color: inherit; font-size: var(--fs-tiny); font-weight: 900; letter-spacing: 0.08em; opacity: 0.85; }
.oeuvre-hero .work-route-box__name { margin: 0; color: inherit; font-size: 1.25rem; }
.oeuvre-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin: 0; }
.work :is(.oeuvre-actions, .oeuvre-hero__hook) { max-width: none; }
.oeuvre-actions__quiz { height: 64px; }
.oeuvre-actions__link { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); height: 58px; padding: 0 var(--sp-4); border: 0; border-radius: var(--r-md); background: var(--soft); color: var(--text); font: 800 1.0625rem var(--font-display); text-decoration: none; cursor: pointer; }
.oeuvre-actions__share { display: none; }
.work-id__pdf { display: inline-flex; align-items: center; gap: var(--sp-2); align-self: flex-start; color: var(--accent-text); font-family: var(--font-display); font-weight: 800; }

/* Deux colonnes (maquettes bacfr/Fiche*) : le contenu a gauche ; personnages,
   themes et quiz a droite. Sur mobile, l'ordre du sommaire est garde. */
.work-layout, .work-main, .work-side { display: flex; flex-direction: column; gap: var(--space-8); min-width: 0; }
.work-essentials .work-section__title { color: var(--text); }
.work-person:nth-child(5n + 2) .work-person__avatar { background: var(--cyan); color: var(--on-flame); }
.work-person:nth-child(5n + 3) .work-person__avatar { background: var(--flame); color: var(--on-flame); }
.work-person:nth-child(5n + 4) .work-person__avatar { background: var(--subject-francais); }
.work-person:nth-child(5n) .work-person__avatar { background: var(--success-action); }
.work-side__quiz { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5); border-radius: var(--radius-xl); background: var(--sel-bg); color: var(--text); text-decoration: none; }
.work-side__quiz-title { font-family: var(--font-display); font-size: 1.375rem; font-weight: 800; }
.work-side__quiz-meta { margin-bottom: var(--sp-2); color: var(--muted); font-size: 0.875rem; font-weight: 800; }

@media (min-width: 1100px) {
  .work-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; column-gap: var(--space-6); }
  .work-main { grid-column: 1; }
  .work-main--end { grid-row: 2; }
  .work-side { grid-column: 2; grid-row: 1 / span 2; gap: var(--space-6); }
  .work-side :is(.work-cast, .work-themes, .work-quiproquo__scheme) { grid-template-columns: minmax(0, 1fr); }
  .work-side .work-route { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 960px) {
  .oeuvre-hero { padding: var(--space-8); }
  .oeuvre-hero .oeuvre-hero__title { font-size: 4.25rem; }
  .oeuvre-hero .oeuvre-hero__byline { font-size: 1.5rem; }
  .oeuvre-hero .work-route-box__name { font-size: 1.375rem; }
  .oeuvre-actions { grid-template-columns: 1.4fr 1fr 1fr; align-items: start; }
  .oeuvre-actions__share:not([hidden]) { display: flex; }
}

/* --- Methodes du bac de francais, refonte 2026 (phase 8, maquettes bacfr/Methode* ;
   phase 11 : grande lettre, etapes en ronds de 52 px, pieges en tuiles) --- */
/* Lettre d'une methode, a sa couleur : D violet, C francais, O cyan, E neutre. */
.method-letter { display: inline-grid; place-items: center; flex-shrink: 0; width: 36px; height: 36px; border-bottom: var(--relief) solid var(--violet-dark); border-radius: var(--radius-md); background: var(--violet); color: var(--on-accent); font-family: var(--font-display); font-weight: 800; }
.method-letter--large { width: 56px; height: 56px; border-radius: var(--radius-lg); font-size: 1.75rem; }
.method-letter[data-method="commentaire-de-texte"] { border-bottom-color: var(--subject-francais-edge); background: var(--subject-francais); }
.method-letter[data-method="oral"] { border-bottom-color: var(--cyan-edge); background: var(--cyan); color: var(--on-flame); }
.method-letter[data-method="contraction-et-essai"] { border-bottom-color: var(--border); background: var(--soft); color: var(--muted); }
.method, .methods { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.method { gap: var(--sp-5); }
.method-hero { display: flex; align-items: center; background: var(--surface); flex-wrap: wrap; gap: 18px; padding: var(--sp-5); border: 3px solid var(--violet); border-radius: 30px; }
.method-hero .method-letter--large { width: 68px; height: 68px; border: 0; border-radius: 24px; font-size: 2.125rem; }
.method-hero__text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; flex: 1 1 200px; }
.method-hero__tag { align-self: flex-start; margin: 0; border-radius: var(--radius-pill); background: var(--soft); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; display: inline-flex; align-items: center; height: 28px; padding: 0 11px; font-weight: 900; }
.method-hero__title { margin: 0; font-family: var(--font-display); font-size: 2rem; line-height: 0.95; }
.method-hero__meta { margin: 0; color: var(--muted); font-size: 0.875rem; font-weight: 800; }
.method-lead { margin: 0; color: var(--muted); }
.method-layout { display: grid; gap: var(--space-6); }
.method-main, .method-side { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.method-steps { display: flex; flex-direction: column; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.method-step { display: flex; align-items: flex-start; gap: var(--sp-3); }
.method-step__number { display: grid; place-items: center; flex-shrink: 0; border-radius: 50%; background: var(--soft); font-family: var(--font-display); font-weight: 800; width: 52px; height: 52px; color: var(--muted); font-size: 1.375rem; }
.method-step:first-child .method-step__number { border-bottom: var(--relief) solid var(--flame-button-edge); background: var(--flame); color: var(--on-flame); border: 0; box-shadow: 0 4px 0 var(--flame-edge); }
.method-step__title { margin: var(--sp-2) 0 0; font-family: var(--font-display); font-weight: 800; margin-top: 14px; font-size: 1.125rem; }
.method-step__text { margin: var(--sp-1) 0 0; color: var(--muted); }
.method-traps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.method-trap { display: flex; gap: var(--sp-2); border: 2px solid var(--subject-francais); background: var(--red-bg); align-items: center; min-height: 58px; padding: var(--sp-2) var(--sp-3); border-color: var(--error); border-radius: var(--r-md); font-family: var(--font-display); font-size: 0.9375rem; font-weight: 800; line-height: 1.1; }
.method-trap .site-icon { flex-shrink: 0; }
.method-side__example { display: flex; flex-direction: column; border: 2px solid var(--subject-francais); background: var(--red-bg); color: var(--text); text-decoration: none; gap: var(--sp-2); padding: 18px; border-radius: 24px; }
.method-side__example strong { font-family: var(--font-display); font-size: 1.1875rem; line-height: 1.2; }
.method-side__kicker { font-size: 0.75rem; text-transform: uppercase; color: var(--red-strong); font-weight: 900; letter-spacing: 0.08em; }
.method-side__quiz { display: flex; flex-direction: column; background: var(--sel-bg); gap: var(--sp-3); padding: 18px; border-radius: 24px; }
.method-side__title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.375rem; }
.method-side__meta { margin: 0 0 var(--sp-2); color: var(--muted); font-size: 0.875rem; font-weight: 800; }
.method-side__others { display: flex; flex-direction: column; gap: var(--sp-2); }
.method-side__heading { margin: 0; font-family: var(--font-display); font-size: 1.125rem; }
.method-side__others ul { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }
.method-link { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); font-weight: 800; text-decoration: none; }
.methods-list { display: grid; gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
.methods-list__card { display: flex; align-items: flex-start; gap: var(--sp-4); height: 100%; padding: var(--sp-4); border: 1px solid var(--border); border-bottom-width: var(--relief); border-radius: var(--radius-lg); background: var(--surface); color: var(--text); text-decoration: none; }
.methods-list__text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.methods-list__text strong { font-family: var(--font-display); font-size: 1.25rem; }
.methods-list__text > span:not(.methods-list__tag):not(.chip) { color: var(--muted); font-size: 0.9375rem; }
.methods-list__tag { color: var(--muted); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.methods-list .chip { align-self: flex-start; }

@media (min-width: 720px) {
  .method-letter--large { width: 88px; height: 88px; border-radius: var(--radius-xl); font-size: 2.5rem; }
  .methods-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .method-layout { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); align-items: start; }
  .method-side { position: sticky; top: var(--sp-4); }
  .method-traps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .method-hero { padding: var(--sp-6); }
  .method-hero .method-letter--large { width: 90px; height: 90px; font-size: 2.75rem; }
  .method-hero__title { font-size: 2.75rem; }
}

/* --- Quiz d'oeuvre en ecran de jeu, refonte 2026 (phase 10, maquettes bacfr/Quiz*) --- */
.course-quiz__play { margin: 0; }
.course-quiz__bar { display: flex; align-items: center; gap: var(--sp-3); }
.course-quiz__bar-fill { flex: 1; }
.course-quiz__timer { display: inline-flex; align-items: center; gap: var(--sp-1); margin: 0; padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-pill); background: var(--surface); font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.course-quiz__timer[data-low="true"] { color: var(--subject-francais); }
.course-quiz[data-playing] { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; gap: var(--sp-4); margin: 0; padding: var(--sp-4) var(--content-gutter) calc(var(--space-6) + env(safe-area-inset-bottom)); overflow-y: auto; border: 0; border-radius: 0; background: var(--bg); box-shadow: none; }
.course-quiz[data-playing] > :not(.course-quiz__bar, .work-quiz__segments, .course-quiz__question, .course-quiz__end, script) { display: none; }
.course-quiz[data-playing] > .course-quiz__bar { order: 0; }
.course-quiz[data-playing] > .work-quiz__segments { order: 1; }
.course-quiz[data-playing] > :is(.course-quiz__bar, .work-quiz__segments, .course-quiz__question, .course-quiz__end) { width: 100%; max-width: 720px; margin-inline: auto; }
.course-quiz[data-playing] > :is(.course-quiz__question, .course-quiz__end) { order: 2; }
.course-quiz[data-playing] .feedback .button { width: 100%; }
.work-quiz__xp { display: flex; flex-direction: column; gap: var(--sp-2); margin: 0; }

/* Ecran de jeu du quiz d'oeuvre, refonte v2 (phase 11, maquettes bacfr/Quiz*) :
   fermer, segments et minuteur sur une ligne ; question centree ; reponses en
   colonne sur mobile, en deux colonnes sur ordinateur ; segments reussis en vert. */
.work-quiz[data-playing] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-auto-rows: min-content; align-content: start; gap: var(--sp-5) var(--sp-3); }
.work-quiz[data-playing] > .course-quiz__bar { display: contents; }
.work-quiz[data-playing] .course-quiz__bar-fill { display: none; }
.work-quiz[data-playing] .course-quiz__close { grid-column: 1; grid-row: 1; }
.work-quiz[data-playing] .course-quiz__timer { grid-column: 3; grid-row: 1; align-self: center; height: 40px; }
.work-quiz[data-playing] > .work-quiz__segments { grid-column: 2; grid-row: 1; align-self: center; gap: var(--sp-1); width: auto; max-width: none; margin: 0; }
.work-quiz[data-playing] .work-quiz__segments li { height: 10px; background: var(--soft); }
.work-quiz[data-playing] .work-quiz__segments li[data-state="done"] { background: var(--success); }
.work-quiz[data-playing] .work-quiz__segments li[data-state="current"] { background: var(--flame); }
.work-quiz[data-playing] > :is(.course-quiz__question, .course-quiz__end) { grid-column: 1 / -1; grid-row: 2; width: 100%; max-width: 860px; justify-self: center; margin: 0; }
.work-quiz[data-playing] .quiz__eyebrow { color: var(--muted); font-size: 0.8125rem; font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; }
.work-quiz[data-playing] .course-quiz__prompt { font-size: 1.5rem; line-height: 1.15; }
.work-quiz[data-playing] .answers { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.work-quiz[data-playing] .answer__box { align-items: center; min-height: 58px; padding: var(--sp-2) 14px; border-radius: var(--r-md); font-family: var(--font-display); font-size: 1.125rem; font-weight: 800; }
.work-quiz[data-playing] .answer__key { width: 32px; height: 32px; border-radius: var(--r-xs); }
@media (min-width: 960px) {
  .work-quiz[data-playing] { padding-top: var(--sp-3); }
  .work-quiz[data-playing] .course-quiz__prompt { font-size: 1.875rem; }
  .work-quiz[data-playing] .answers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* --- Hub du bac de francais, refonte v2 (phase 11, maquettes bacfr/Hub*) ----- */
/* Pages du bac de francais : le contenu commence 20 px sous l'en-tete (28 sur ordinateur) */
[data-page^="bac-"] .site-frame > .course-page { padding-top: var(--sp-2); }
@media (min-width: 960px) {
  [data-page^="bac-"] .site-frame > .course-page { padding-top: var(--sp-4); }
}
.hub { display: flex; flex-direction: column; gap: var(--sp-5); min-width: 0; }
.hub .work-section { gap: var(--sp-3); }
.hub .work-section__title { margin: 0; font-size: 1.5rem; line-height: 1.05; }
.hub .work-section__heading { flex-wrap: nowrap; gap: 10px; }
.hub .work-section__more { flex-shrink: 0; color: var(--accent-text); font-family: var(--font-display); font-size: var(--fs-small); font-weight: 800; text-decoration: none; white-space: nowrap; }

/* En-tete : pastille, titre, voie ; compte a rebours ; CHOISIR MES OEUVRES
   (sous le compte a rebours sur mobile, sous la voie sur ordinateur) */
.hub-hero { display: grid; grid-template-areas: "head" "count" "cta"; gap: var(--sp-5); }
.hub-hero__main { grid-area: head; display: flex; flex-direction: column; gap: var(--sp-3); min-width: 0; }
.hub-hero__kicker { display: inline-flex; align-items: center; align-self: flex-start; height: 30px; margin: 0; padding: 0 11px; border-radius: var(--r-pill); background: var(--red-bg); color: var(--red-strong); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; }
.hub-hero__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-hero-m); font-weight: 800; line-height: 0.95; }
.hub-hero__year { color: var(--flame-text); }
.hub-hero__hook { max-width: 560px; margin: 0; color: var(--muted); font-size: var(--fs-small); font-weight: 700; line-height: 1.45; }
.hub-hero__cta { grid-area: cta; height: 66px; font-size: 1.25rem; }
.hub-hero .voie-switch__label,
.programme-hero .voie-switch__label { display: none; }

/* Compte a rebours : anneau or, « J- » au-dessus du nombre de jours */
.hub-countdown { grid-area: count; display: flex; flex-direction: column; gap: var(--sp-4); padding: var(--sp-5); border: 3px solid var(--subject-francais); border-radius: 30px; background: var(--red-bg); color: var(--text); }
.hub-countdown__head { display: flex; flex: 1; align-items: center; gap: var(--sp-4); min-width: 0; }
.hub-countdown__days { display: flex; flex-direction: column; flex-shrink: 0; align-items: center; justify-content: center; width: 116px; height: 116px; margin: 0; border: 6px solid var(--flame); border-radius: 50%; background: var(--bg); box-shadow: 0 6px 0 var(--flame-edge); box-sizing: border-box; color: var(--flame-text); font-family: var(--font-display); font-size: 1.75rem; font-weight: 800; line-height: 0.9; text-align: center; }
.hub-countdown__days[hidden] { display: none; }
.hub-countdown__prefix { color: var(--red-strong); font-family: var(--font-body); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: 0.1em; line-height: 1.3; }
.hub-countdown__count { font-size: 3rem; }
.hub-countdown__text { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.hub-countdown__text p { margin: 0; }
.hub-countdown__label { color: var(--red-strong); font-size: var(--fs-tiny); font-weight: 900; letter-spacing: 0.1em; text-transform: uppercase; }
.hub-countdown__date { font-family: var(--font-display); font-size: 1.375rem; font-weight: 800; line-height: 1.05; }
.hub-countdown__hours { color: var(--muted); font-size: 0.9375rem; font-weight: 800; }
.hub-countdown__ics { display: flex; flex-shrink: 0; align-items: center; justify-content: center; gap: var(--sp-2); height: 52px; padding: 0 var(--sp-4); border-radius: var(--r-md); background: var(--soft); color: var(--text); font-family: var(--font-display); font-size: var(--fs-body); font-weight: 800; text-decoration: none; }

/* Plan de bataille : quatre ronds, l'etape en cours en flamme, en escalier sur mobile */
.hub-plan { gap: 14px; }
.hub-steps { display: flex; flex-direction: column; gap: var(--sp-4); margin: 0; padding: 0; list-style: none; }
.hub-steps li:nth-child(2), .hub-steps li:nth-child(4) { margin-left: 50px; }
.hub-steps li:nth-child(3) { margin-left: 100px; }
.hub-step { display: flex; align-items: center; gap: 14px; color: var(--text); text-decoration: none; }
.hub-step__number { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 62px; height: 62px; border-radius: 50%; background: var(--soft); color: var(--muted); font-family: var(--font-display); font-size: 1.625rem; font-weight: 800; }
.hub-step[data-current="true"] .hub-step__number { background: var(--flame); color: var(--on-flame); box-shadow: 0 4px 0 var(--flame-edge); }
.hub-step[data-state="done"] .hub-step__number { background: var(--success); color: var(--on-accent); box-shadow: 0 4px 0 var(--success-dark); }
.hub-step__body { display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
.hub-step__title { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; line-height: 1.1; }
.hub-step__status { color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
.hub-step__progress { width: 100%; max-width: 160px; height: 6px; border: 0; border-radius: var(--r-pill); background: var(--soft); appearance: none; }
.hub-step__progress::-webkit-progress-bar { border-radius: var(--r-pill); background: var(--soft); }
.hub-step__progress::-webkit-progress-value { border-radius: var(--r-pill); background: var(--flame); }
.hub-step__progress::-moz-progress-bar { border-radius: var(--r-pill); background: var(--flame); }
.hub-step__progress[hidden] { display: none; }
.hub-plan__note { margin: 0; color: var(--muted); font-size: 0.8125rem; font-weight: 700; }

/* Objets d'etude : quatre tuiles pleines vers la page des oeuvres */
.hub-objets,
.hub-methods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.hub-objet { display: flex; flex-direction: column; gap: var(--sp-3); }
.hub-objet__works { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0 var(--sp-1); list-style: none; color: var(--muted); font-size: 0.8125rem; font-weight: 700; line-height: 1.35; }
.hub-objet__works a { color: var(--text); }
/* Textes d'appoint des epreuves, sous les cases (contenu indexable) */
.hub-notes { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: 0.8125rem; font-weight: 700; line-height: 1.4; }
.hub-notes strong { color: var(--text); }
.hub-objet-tile { display: flex; flex-direction: column; justify-content: space-between; min-height: 104px; padding: 14px; border-radius: var(--r-lg); background: var(--objet-color); box-shadow: 0 6px 0 var(--objet-edge); box-sizing: border-box; color: var(--objet-ink); font-family: var(--font-display); font-weight: 800; text-decoration: none; }
.hub-objet-tile__number { font-size: 1.75rem; line-height: 1; opacity: 0.6; }
.hub-objet-tile__name { font-size: 1.3125rem; line-height: 1.05; }

/* Epreuves : chiffres en cases, sujets de l'ecrit en pastilles, bareme de l'oral */
.hub-exams { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.hub-exam { display: flex; flex: 1 1 300px; flex-direction: column; gap: var(--sp-3); min-width: 0; padding: var(--sp-4); border-radius: 24px; background: var(--surface); }
.hub-exam__title { margin: 0; font-size: 1.375rem; line-height: 1.05; }
.hub-figures { display: flex; gap: var(--sp-2); margin: 0; }
.hub-figures div { display: flex; flex: 1; flex-direction: column-reverse; align-items: center; justify-content: center; height: 66px; border-radius: 16px; background: var(--soft); }
.hub-figures dt { color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
.hub-figures dd { margin: 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; line-height: 1; }
.hub-subjects { display: flex; align-items: center; gap: var(--sp-2); margin: 0; }
.hub-subject { display: inline-flex; flex: 1; align-items: center; justify-content: center; height: 42px; padding: 0 11px; border-radius: var(--r-pill); background: var(--soft); font-size: var(--fs-small); font-weight: 900; white-space: nowrap; }
.hub-subjects__or { color: var(--lock); font-weight: 900; }
.hub-trap { display: flex; align-items: center; gap: var(--sp-3); margin: 0; padding: var(--sp-3) 14px; border: 2px solid var(--warm-border); border-radius: var(--r-md); background: var(--warm-bg); color: var(--warm-text); font-size: var(--fs-small); font-weight: 800; line-height: 1.35; }
.hub-trap img { flex-shrink: 0; }
.hub-scale { display: flex; gap: var(--sp-1); }
.hub-scale__part { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 8px; color: var(--on-flame); font-family: var(--font-display); font-size: 0.9375rem; font-weight: 800; }
.hub-scale__part[data-points="1"] { flex: 1; }
.hub-scale__part[data-points="2"] { flex: 2; }
.hub-scale__part[data-points="3"] { flex: 3; }
.hub-scale__part[data-points="4"] { flex: 4; }
.hub-scale__part[data-points="5"] { flex: 5; }
.hub-scale__part[data-points="6"] { flex: 6; }
.hub-scale__part[data-points="7"] { flex: 7; }
.hub-scale__part[data-points="8"] { flex: 8; }
.hub-scale__part[data-points="9"] { flex: 9; }
.hub-scale__part[data-points="10"] { flex: 10; }
.hub-scale__part[data-points="11"] { flex: 11; }
.hub-scale__part[data-points="12"] { flex: 12; }
.hub-scale__part--1, .hub-scale__key--1::before { background: var(--objet-roman); }
.hub-scale__part--2, .hub-scale__key--2::before { background: var(--objet-theatre); }
.hub-scale__part--3, .hub-scale__key--3::before { background: var(--objet-idees); }
.hub-scale__part--4, .hub-scale__key--4::before { background: var(--objet-poesie); }
.hub-scale__part--4 { color: var(--on-flame); }
.hub-scale__legend { display: flex; flex-wrap: wrap; gap: 6px var(--sp-3); margin: 0; padding: 0; list-style: none; }
.hub-scale__legend li { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
.hub-scale__legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; }

/* Methodes : la carte entiere est le lien ; hors de la voie choisie, attenuee et en dernier */
.hub-method { display: flex; }
.hub-method__card { display: flex; flex: 1; flex-direction: column; justify-content: space-between; gap: var(--sp-3); min-height: 108px; padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-sizing: border-box; color: var(--text); text-decoration: none; }
.hub-method .method-letter { width: 40px; height: 40px; border: 0; border-radius: 12px; font-size: 1.25rem; }
.hub-method__body { display: flex; flex-direction: column; }
.hub-method__title { font-family: var(--font-display); font-size: var(--fs-body); font-weight: 800; line-height: 1.1; }
.hub-method__tag { color: var(--muted); font-size: var(--fs-tiny); font-weight: 800; }
/* La voie d'une methode ne se lit que sur une carte hors de la voie choisie */
[data-voie="generale"] .hub-method[data-voies~="generale"] .hub-method__voie,
[data-voie="technologique"] .hub-method[data-voies~="technologique"] .hub-method__voie { display: none; }
[data-voie="generale"] .hub-method:not([data-voies~="generale"]),
[data-voie="technologique"] .hub-method:not([data-voies~="technologique"]) { order: 1; opacity: 0.5; }
[data-voie="generale"] .hub-method:not([data-voies~="generale"]) .method-letter,
[data-voie="technologique"] .hub-method:not([data-voies~="technologique"]) .method-letter { background: var(--lock); color: var(--on-accent); }

/* Annales du bac de francais : une ligne vers la page des sujets */
.hub-annals { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) 14px; border-radius: 20px; background: var(--surface); color: var(--text); text-decoration: none; }
.hub-annals__icon { display: flex; flex-shrink: 0; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 15px; background: var(--soft); }
.hub-annals__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.hub-annals__text strong { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 800; line-height: 1.15; }
.hub-annals__text span { color: var(--muted); font-size: 0.8125rem; font-weight: 800; }
.hub-annals__count { display: inline-flex; align-items: center; height: 30px; padding: 0 11px; border-radius: var(--r-pill); background: var(--soft); font-size: 0.8125rem; font-weight: 900; }

/* Questions frequentes : accordeons sans bordure */
.hub #faq { gap: var(--sp-2); }
.hub #faq .work-section__title { font-size: 1.375rem; }
.hub .work-faq { border: 0; border-radius: var(--r-md); background: var(--surface); }
.hub .work-faq summary { min-height: 0; padding: 14px var(--sp-4); font-family: var(--font-display); font-size: var(--fs-body); }

@media (min-width: 960px) {
  .hub { gap: var(--sp-6); }
  .hub .work-section__title { font-size: 1.875rem; }
  .hub-hero { grid-template-columns: minmax(0, 556fr) minmax(0, 596fr); grid-template-areas: "head count" "cta count"; align-items: center; gap: var(--sp-5) var(--sp-6); }
  .hub-hero__title { font-size: 3.75rem; }
  .hub-hero__cta { align-self: start; max-width: 420px; height: 70px; font-size: 1.375rem; }
  .hub-countdown { flex-direction: row; align-items: center; padding: 26px; }
  .hub-countdown__days { width: 140px; height: 140px; }
  .hub-countdown__count { font-size: 3.625rem; }
  .hub-countdown__date { font-size: 1.75rem; }
  .hub-plan { gap: var(--sp-3); padding: var(--space-6); border-radius: 24px; background: var(--surface); }
  .hub-steps { flex-direction: row; }
  .hub-steps li { flex: 1; margin: 0; }
  .hub-steps li:nth-child(n) { margin-left: 0; }
  .hub-step { flex-direction: column; gap: 10px; text-align: center; }
  .hub-step__body { align-items: center; }
  .hub-step__title { font-size: 1.125rem; }
  .hub-objets,
  .hub-methods { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Lien vers le site jumeau du college, en fin de pied de page : discret */
.sister-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: .8;
}

.sister-link:hover,
.sister-link:focus-visible {
  opacity: 1;
}

.sister-link img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

/* --- Fenetre d'explication (« A quoi ca sert ? ») ------------------------- */
/* Voile de la page, feuille au centre (en bas de l'ecran sur mobile) :
   cadenas de l'accueil, aide des reglages de l'espace profs. */
.info-dialog {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: var(--backdrop);
}

.info-dialog[hidden] { display: none; }

.info-dialog__sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  width: min(440px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: var(--space-6) var(--sp-5) var(--sp-5);
  border: 2px solid var(--border);
  border-bottom-width: var(--relief);
  border-radius: var(--radius-xl);
  background: var(--surface);
  text-align: center;
}

.info-dialog__close { position: absolute; top: var(--sp-3); right: var(--sp-3); }
.info-dialog__text p { margin: 0; color: var(--muted); }
.info-dialog__text { display: flex; flex-direction: column; gap: var(--sp-2); }
.info-dialog__title { margin: 0; font-size: 1.75rem; }
.info-dialog__title:focus { outline: none; }

@media (max-width: 767px) {
  .info-dialog { align-items: flex-end; padding: 0; }
  .info-dialog__sheet { width: 100%; border-bottom: 0; border-radius: var(--radius-2xl) var(--radius-2xl) 0 0; padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom)); }
}

/* --- Recherche (refonte v2, phase 8, maquettes recherche/*) -------------- */
/*
 * Champ de recherche (page `/recherche`, panneau de l'en-tete), pastilles des
 * filtres, groupes de resultats et ligne d'un resultat. Le champ actif porte
 * le contour violet et son halo ; les mots trouves sont en `<mark>` or.
 */
.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
  height: 56px;
  padding: 0 var(--sp-3) 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--lock);
  font-weight: 700;
  text-decoration: none;
}

.search-field .site-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.search-field--active {
  border-color: var(--sel-border);
  box-shadow: 0 0 0 4px var(--sel-bg);
}

.search-field__label {
  flex: 1;
  font-size: var(--fs-body);
}

.search-field__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  caret-color: var(--sel-border);
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 800;
  appearance: none;
}

.search-field__input::placeholder {
  color: var(--lock);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 700;
}

.search-field__input::-webkit-search-cancel-button { appearance: none; }

.search-field__clear {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 800;
  cursor: pointer;
}

.search-field__clear[hidden] { display: none; }

/* Champ des pages Cours sur mobile : un lien vers `/recherche` */
.search-field--link:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.search-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

.search-results[hidden] { display: none; }

.search-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.search-filter {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
}

.search-filter[aria-pressed="true"] {
  background: var(--sel-bg);
  color: var(--sel-text);
}

.search-results__class,
.search-results__empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.search-group__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.search-group__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: normal;
  letter-spacing: 0.02em;
}

.search-group__count {
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 800;
}

.search-group__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-group__more {
  align-self: center;
  min-height: 44px;
  padding: 0 var(--sp-4);
  border: 0;
  background: transparent;
  color: var(--accent-text);
  font-family: var(--font-display);
  font-size: 0.9375rem;
  font-weight: 800;
  cursor: pointer;
}

.search-hit {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.search-hit:hover { color: var(--text); }

.search-hit__tile {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--soft);
  --tile-edge: transparent;
  box-shadow: 0 4px 0 var(--tile-edge);
}

.search-hit__tile .site-icon {
  width: 22px;
  height: 22px;
}

.search-hit__tile.subject-tile {
  background: var(--subject-color, var(--violet));
  --tile-edge: var(--subject-edge, var(--violet-edge));
}

.search-hit__tile.subject-tile::before {
  width: 22px;
  height: 22px;
}

.search-hit__tile--fiche { background: var(--class-tle-generale); --tile-edge: var(--class-tle-generale-edge); }
.search-hit__tile--exercices { background: var(--success); --tile-edge: var(--success-dark); }
.search-hit__tile--cartes { background: var(--violet); --tile-edge: var(--violet-edge); }
.search-hit__tile--oeuvre { background: var(--cyan); --tile-edge: var(--cyan-edge); }
.search-hit__tile--methode { background: var(--subject-francais); --tile-edge: var(--subject-francais-edge); }
.search-hit__tile--suggestion { background: var(--sel-bg); }

.search-hit__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.search-hit__title {
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 800;
  line-height: 1.15;
}

.search-hit__title mark {
  padding: 0;
  border-radius: 4px;
  background: var(--warm-bg);
  color: var(--warm-strong);
}

.search-hit__meta {
  color: var(--muted);
  font-size: var(--fs-tiny);
  font-weight: 800;
}

/* Page `/recherche` : plein ecran sur mobile (ni en-tete ni barre du bas),
   gabarit commun sur ordinateur. */
.search-page {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  box-sizing: border-box;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 14px var(--content-gutter) var(--space-6);
}

.search-page__bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-page__bar .search-field { flex: 1; }

.search-page__back {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-display);
  font-size: var(--fs-button);
  font-weight: 800;
  text-decoration: none;
}

.search-page__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

.search-page:not([data-state="none"]) .search-page__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Aucun resultat : la loupe dans un carre de 80 px, au-dessus du titre */
.search-page[data-state="none"] .search-page__title { margin-top: 40px; }

.search-page[data-state="none"] .search-page__title::before {
  content: '';
  display: block;
  width: 80px;
  height: 80px;
  margin: 0 auto 10px;
  border-radius: 24px;
  background: var(--soft) url('/icones/loupe.svg?v=9b05288df9') center / 40px no-repeat;
}

.search-page[data-state="none"] .search-results { margin-top: -10px; }

.search-none__text {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 700;
  text-align: center;
}

.search-none__browse,
.search-start {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.search-start { gap: 10px; }

.search-none__browse h2,
.search-start h2,
.search-recent h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h3-m);
  font-weight: 800;
  line-height: 1.05;
}

.search-none__classes {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 52px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  background: var(--soft);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-body);
  font-weight: 800;
  text-decoration: none;
}

.search-examples {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.search-example {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
}

.search-recent {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.search-recent[hidden],
.search-page:not([data-state="start"]) :is(.search-start, .search-recent, .search-page__hint) { display: none; }

.search-recent__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-recent__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--text);
  font-size: var(--fs-body);
  font-weight: 800;
  text-decoration: none;
}

.search-recent__link .site-icon {
  width: 20px;
  height: 20px;
}

.search-page__hint {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 0.8125rem;
  font-weight: 700;
  text-align: center;
}

.search-page__status:empty,
.search-page:not([data-state="error"]) .search-page__status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.search-page__status {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

@media (max-width: 767px) {
  [data-page="recherche"] :is(.site-top, .tabbar) { display: none; }
  /* Pastilles des filtres jusqu'au bord de l'ecran, comme la maquette */
  .search-page .search-filters { margin-right: calc(-1 * var(--content-gutter)); }
  /* Ecran plein : le pied de page commence sous la hauteur de l'ecran */
  [data-page="recherche"] .site-foot { margin-top: 0; }
}

@media (min-width: 768px) {
  .search-field--link { display: none; }
  [data-page="recherche"] .site-top__search { display: none; }

  .search-page {
    max-width: 640px;
    min-height: 0;
    margin-inline: auto;
    padding-block: var(--sp-6) var(--sp-7);
  }

  .search-page__back { display: none; }

  /* En-tete : le champ prend la place du menu, le panneau s'ouvre dessous */
  [data-site-top][data-search-open] :is(.site-menu, .site-top__search) { display: none; }

  .site-search {
    position: relative;
    width: 520px;
    margin-inline: auto;
  }

  .site-search[hidden] { display: none; }

  .search-field--header {
    gap: var(--sp-2);
    height: 46px;
    padding: 0 var(--sp-3);
    border-radius: var(--r-sm);
  }

  .search-field--header .site-icon {
    width: 20px;
    height: 20px;
  }

  .search-field--header .search-field__input { font-size: var(--fs-body); }

  .site-search__panel {
    position: absolute;
    top: 56px;
    left: 0;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    width: 556px;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: var(--sp-4);
    border: 2px solid var(--border);
    border-radius: 24px;
    background: var(--search-panel);
    box-shadow: var(--search-shadow);
  }

  .site-search__panel[hidden] { display: none; }
  .site-search__panel .search-results { gap: 14px; }
  .site-search__panel .search-filters { flex-wrap: wrap; }

  .site-search__all {
    display: flex;
    align-items: center;
    align-self: center;
    min-height: 44px;
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 800;
  }

  .site-search__all[hidden] { display: none; }
}
/* --- fin de la recherche --- */

/* --- Refonte v2, phase 6 : composants partages ------------------------- */
/*
 * Fil du haut des ecrans secondaires sur mobile (maquettes classement/*,
 * compte/Badges, Boutique, Series, defis/*) : retour, puis une ou deux
 * pastilles, a la place de la marque, a gauche des compteurs de l'en-tete
 * commun. Element du corps, juste apres l'en-tete : il se pose sur sa ligne.
 * Sur ordinateur, l'en-tete commun et le titre de la page suffisent.
 */
.subbar {
  position: absolute;
  top: 14px;
  left: var(--content-gutter);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: calc(100% - 2 * var(--content-gutter) - 150px);
}

.subbar[hidden] { display: none; }

.subbar__back {
  display: grid;
  flex-shrink: 0;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--muted);
}

.subbar__back svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.subbar__crumb {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--r-xs);
  background: var(--surface);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.875rem;
  white-space: nowrap;
  text-decoration: none;
}

@media (max-width: 767px) {
  body:has(> .subbar:not([hidden])) .site-top { min-height: 70px; }
  body:has(> .subbar:not([hidden])) .site-top__brand { visibility: hidden; }
  body:has(> .subbar:not([hidden])) .app-content { padding-top: var(--sp-2); }
}

@media (min-width: 768px) {
  .subbar { display: none; }
}

/* Encart d'information cyan des maquettes (classement ouvert, badges) */
.notice--note {
  flex-wrap: nowrap;
  align-items: center;
  padding: var(--sp-3) 14px;
  border-color: var(--cyan-edge);
  border-radius: var(--r-md);
  background: var(--cyan-bg);
  color: var(--cyan-text);
  font-weight: 800;
  font-size: 0.875rem;
  line-height: 1.35;
}

/*
 * Ecusson d'un badge (maquettes compte/Badges*, charte/Couleurs) : l'image
 * de `/icones/badges/`, et, une fois gagne, le halo de sa couleur (seul
 * degrade, celui de la maquette).
 */
.badge-shield {
  position: relative;
  display: block;
  flex-shrink: 0;
  width: 68px;
  height: 76px;
}

.badge-shield > img {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
}

.badge-shield[data-earned="true"]::before {
  content: '';
  position: absolute;
  left: -12%;
  top: -8%;
  width: 124%;
  height: 110%;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--badge-glow) 33%, transparent) 0%, transparent 65%);
}

[data-badge="mastery"] { --badge-glow: var(--badge-mastery); }
[data-badge="streak_7"] { --badge-glow: var(--badge-streak-7); }
[data-badge="challenge_win"] { --badge-glow: var(--badge-challenge-win); }
[data-badge="exam"] { --badge-glow: var(--badge-exam); }
[data-badge="duo_10"] { --badge-glow: var(--badge-duo-10); }
[data-badge="streak_30"] { --badge-glow: var(--badge-streak-30); }

/* Pastille « Obtenu le 2 oct. » */
.badge-chip {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 6px;
  height: 28px;
  margin-top: var(--sp-1);
  padding: 0 11px;
  border-radius: var(--r-pill);
  background: var(--green-bg);
  color: var(--green-strong);
  font-weight: 900;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* Onglets des maquettes (classement/*) : fond doux, onglet choisi en carte a relief */
.tabs--soft {
  gap: var(--sp-1);
  padding: var(--sp-1);
  border-radius: var(--r-md);
  background: var(--soft);
}

.tabs--soft .tabs__tab {
  min-height: 44px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-size: 1rem;
}

.tabs--soft .tabs__tab[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 3px 0 var(--border);
}

/* Joyau d'une division (carre tourne a la couleur de la ligue, `data-league`) */
.league-gem {
  display: block;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 6px;
  border-radius: 12px;
  background: var(--league, var(--league-quartz));
  box-shadow: 0 5px 0 var(--league-edge, var(--league-quartz-edge));
  transform: rotate(45deg);
}

/* Guide de style : le fil du haut a sa place dans la page */
.styleguide__section .subbar { position: static; display: flex; max-width: none; }

/* --- Pilotage (administration, chantier admin) --------------------------- */
/* Pastille « Pilotage » de l'en-tete : contour violet, 30 px */
.chip--pilotage {
  min-height: 30px;
  padding: 0 var(--sp-3);
  border-color: var(--sel-border);
  background: var(--sel-bg);
  color: var(--sel-text);
  font-family: var(--font-display);
  font-size: 0.8125rem;
}

/* Rubriques : liens a fragment dans une barre, la rubrique courante porte `aria-current` */
.rubrics {
  display: flex;
  gap: var(--sp-1);
  padding: 5px;
  border-radius: var(--r-md);
  background: var(--surface);
}

.rubrics__tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  white-space: nowrap;
  text-decoration: none;
}

.rubrics__tab:hover {
  color: var(--text);
}

.rubrics__tab[aria-current] {
  background: var(--soft);
  color: var(--text);
}

/* Rubrique secondaire (Outils) : apres un filet, en texte courant */
.rubrics__tab--quiet {
  position: relative;
  margin-left: var(--sp-2);
  font-family: var(--font-body);
  font-size: var(--fs-small);
}

.rubrics__tab--quiet::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--sp-2) - 1px);
  top: 10px;
  bottom: 10px;
  border-left: 2px solid var(--border);
}

/* Groupe de pastilles a choix unique (periode, outils) : `aria-pressed` */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-group__item {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 900;
  font-size: var(--fs-small);
  white-space: nowrap;
  cursor: pointer;
}

.pill-group__item:hover {
  color: var(--text);
}

.pill-group__item[aria-pressed="true"] {
  background: var(--sel-bg);
  color: var(--sel-text);
}

/* Donnee pas encore construite : « Non mesuré » et la phase qui la construira, jamais un chiffre */
.unmeasured {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
}

.unmeasured__label {
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1.1;
}

.unmeasured__phase {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 2px dashed var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-weight: 900;
  font-size: var(--fs-tiny);
}

/* Bloc entier (graphique, tableau, grille) en attente : zone en pointilles */
.unmeasured--block {
  justify-content: center;
  min-height: 120px;
  padding: var(--sp-4);
  border: 2px dashed var(--border);
  border-radius: var(--r-md);
}

/* Tuile d'indicateur : titre, valeur, evolution, phrase */
.metric-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.metric-tile__title {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.8125rem;
}

.metric-tile__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.125rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric-tile__text {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
  line-height: 1.35;
}

/* Voyant : icone, libelle, valeur, etat a droite (icone et libelle, jamais la couleur seule) */
.signal {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: var(--sp-3) 14px;
  border: 2px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.signal__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.signal__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.signal__label {
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
}

.signal__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1.15;
}

.signal--unmeasured .signal__value {
  color: var(--muted);
}

/* Carte de donnees : titre, phrase, graphique ou tableau */
.data-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.data-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.data-card__kicker {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.8125rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.data-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1875rem;
  line-height: 1.25;
}

.data-card__text {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.data-card__link {
  color: var(--accent-text);
  font-weight: 800;
  font-size: var(--fs-small);
}

/* Statut d'un prof : icone propre et libelle (Actif, A relancer, Decroche) */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px 0 6px;
  border: 2px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--text);
  font-weight: 900;
  font-size: var(--fs-tiny);
  white-space: nowrap;
}

.status-pill .site-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.status-pill[data-status="actif"] {
  border-color: var(--good-border);
}

.status-pill[data-status="relancer"] {
  border-color: var(--warm-strong);
}

.status-pill[data-status="decroche"] {
  border-color: var(--red-strong);
}

/* --- Pilotage, phase 3 : voyant mesure, tendance, courbe, entonnoir, grille, recommandations, revue */

/* Etat d'un voyant : libelle a droite, icone propre a gauche (jamais la couleur seule) */
.signal__state {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 2px dashed var(--border);
  border-radius: var(--r-pill);
  color: var(--muted);
  font-weight: 900;
  font-size: var(--fs-tiny);
  white-space: nowrap;
}

.signal[data-state="unmeasured"] .signal__value {
  color: var(--muted);
}

.signal[data-state="ok"] .signal__state {
  border-style: solid;
  border-color: var(--good-border);
  color: var(--text);
}

.signal[data-state="warn"] {
  border-color: var(--signal-warn);
}

.signal[data-state="warn"] .signal__state {
  border-style: solid;
  border-color: var(--signal-warn);
  color: var(--text);
}

/* Evolution d'un indicateur : fleche decorative, sens lu (« En hausse : ») */
.trend {
  margin: 0;
  color: var(--muted);
  font-weight: 900;
  font-size: 0.8125rem;
}

.trend[data-direction="up"] {
  color: var(--trend-up);
}

.trend[data-direction="down"] {
  color: var(--trend-down);
}

.is-unmeasured .unmeasured__label {
  font-size: inherit;
}

/* Courbe sur 8 semaines : aire, ligne, points, repere pointille, infobulle */
.week-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.week-chart .admin-chart__grid line {
  stroke: var(--divider);
  stroke-width: 1;
}

.week-chart__area {
  fill: var(--pilot-line);
  fill-opacity: 0.14;
}

.week-chart__line {
  fill: none;
  stroke: var(--pilot-line);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.week-chart__dot {
  fill: var(--pilot-line);
  stroke: var(--surface);
  stroke-width: 2;
  opacity: 0;
}

.week-chart__dot.is-active {
  opacity: 1;
}

.week-chart__cursor {
  stroke: var(--muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}

.week-chart__tip rect {
  fill: var(--bg);
  stroke: var(--border);
  stroke-width: 2;
}

.week-chart .week-chart__tip-title {
  font: 800 11px var(--font-body);
  fill: var(--muted);
}

.week-chart .week-chart__tip-value {
  font: 800 15px var(--font-display);
  fill: var(--text);
}

.week-chart .week-chart__label {
  font: 800 11px var(--font-body);
  fill: var(--muted);
}

.week-chart .admin-chart__hits rect {
  fill: transparent;
  outline: none;
}

.week-chart .admin-chart__hits rect:focus-visible {
  stroke: var(--focus);
  stroke-width: 2;
}

/* Barre des arrivees par source : parts mesurees, legende ecrite */
.source-bar {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin-top: 6px;
}

.source-bar__track {
  display: block;
  width: 100%;
  height: 16px;
  border-radius: 4px;
  background: var(--soft);
}

.source-bar__part--links,
.source-bar__swatch--links {
  fill: var(--chart-3);
  background: var(--chart-3);
}

.source-bar__part--codes,
.source-bar__swatch--codes {
  fill: var(--chart-1);
  background: var(--chart-1);
}

.source-bar__swatch--none {
  border: 2px dashed var(--border);
}

.source-bar__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-1) 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 800;
  font-size: var(--fs-tiny);
}

.source-bar__legend li {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.source-bar__swatch {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  box-sizing: border-box;
}

.source-bar__share {
  color: var(--muted);
}

/* Entonnoir : etape, effectif, barre a l'echelle de la plus grande, part de l'etape precedente */
.funnel {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.funnel__step {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}

.funnel__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.funnel__label {
  font-weight: 800;
  font-size: var(--fs-small);
}

.funnel__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

.funnel__track {
  display: block;
  width: 100%;
  height: 14px;
  border-radius: 4px;
  background: var(--soft);
}

.funnel__bar {
  fill: var(--pilot-line);
}

.funnel--teachers .funnel__bar {
  fill: var(--chart-1);
}

.funnel__share {
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
}

.funnel__step .unmeasured__label {
  font-size: 1rem;
}

/* Grille coloree (part des chapitres complets) : 4 paliers, pourcentage ecrit dans chaque case */
.heat-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.heat-grid thead th {
  padding: 6px var(--sp-1);
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
  text-align: center;
}

.heat-grid thead td {
  width: 84px;
}

.heat-grid tbody th {
  padding: 3px 10px 3px 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-small);
  text-align: left;
  white-space: nowrap;
}

.heat-grid td {
  padding: 3px;
}

.heat-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  border-radius: var(--r-xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

[data-heat="0"] { background: var(--heat-0); color: var(--heat-0-text); }
[data-heat="1"] { background: var(--heat-1); color: var(--heat-1-text); }
[data-heat="2"] { background: var(--heat-2); color: var(--heat-2-text); }
[data-heat="3"] { background: var(--heat-3); color: var(--heat-3-text); }

.heat-cell--absent {
  border: 2px dashed var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
}

.heat-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
}

.heat-legend li {
  display: flex;
  align-items: center;
  gap: 5px;
}

.heat-legend__swatch {
  width: 18px;
  height: 12px;
  border-radius: 3px;
}

/* Recommandations de la semaine : texte saisi par l'administration, rendu tel quel */
.reco-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 2px solid var(--sel-border);
  border-radius: var(--r-lg);
  background: var(--sel-bg);
}

.reco-card__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  line-height: 1.2;
}

.reco-card__text {
  margin: 0;
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.45;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

/* Revue du lundi : ecart dans une pastille (le signe porte le sens), puis la phrase */
.review__list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
}

.review-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  list-style: none;
}

.review-item--empty {
  color: var(--muted);
  font-weight: 700;
}

.review-item__badge {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 40px;
  padding: 0 var(--sp-2);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  white-space: nowrap;
}

.review-item__badge[data-tone="good"] {
  border-color: var(--trend-up);
}

.review-item__badge[data-tone="bad"] {
  border-color: var(--trend-down);
}

.review-item__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.review-item__label {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  line-height: 1.1;
}

.review-item__text {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-small);
  line-height: 1.4;
}

/* --- Pilotage, phase 4 : liste de barres, tableau de retour, colonnes par jour, tableau de donnees, relances */

/* Liste de barres : libelle, barre a l'echelle de la plus grande valeur mesuree, valeur ecrite */
.bar-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.bar-list__row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 24px;
}

.bar-list__label {
  display: flex;
  flex: 0 0 110px;
  flex-direction: column;
  min-width: 0;
  font-weight: 800;
  font-size: var(--fs-small);
  line-height: 1.25;
}

.bar-list--wide .bar-list__label {
  flex-basis: 210px;
}

.bar-list--steps .bar-list__label {
  flex-basis: 160px;
}

.bar-list__hint {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

.bar-list__track {
  display: block;
  flex: 1;
  min-width: 0;
  height: 14px;
  border-radius: 4px;
  background: var(--soft);
}

.bar-list__bar {
  fill: var(--pilot-line);
}

.bar-list--teachers .bar-list__bar {
  fill: var(--chart-1);
}

.bar-list__value {
  flex: 0 0 64px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-list__row .unmeasured {
  flex: 1;
  justify-content: flex-end;
}

.bar-list__row .unmeasured__label {
  font-size: 0.9375rem;
}

/* Tableau du retour par semaine d'arrivee : 4 paliers, part ecrite dans chaque case */
.retention-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.retention-grid thead th {
  padding: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
  text-align: center;
}

.retention-grid tbody th {
  padding: 3px var(--sp-2);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-small);
  text-align: left;
}

.retention-grid td {
  padding: 3px;
}

.retention-grid__size {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.retention-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  border-radius: var(--r-xs);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

[data-retention="0"] { background: var(--retention-0); color: var(--retention-0-text); }
[data-retention="1"] { background: var(--retention-1); color: var(--retention-1-text); }
[data-retention="2"] { background: var(--retention-2); color: var(--retention-2-text); }
[data-retention="3"] { background: var(--retention-3); color: var(--retention-3-text); }

.retention-cell--pending {
  border: 2px dashed var(--border);
  color: var(--muted);
  font-family: var(--font-body);
  font-size: var(--fs-tiny);
}

/* Colonnes par jour (joueurs du defi du jour) : une colonne focalisable par jour, infobulle de la courbe */
.day-columns__axis {
  stroke: var(--divider);
  stroke-width: 1;
}

.day-columns__bar {
  fill: var(--pilot-line);
}

.day-columns__bar.is-active {
  opacity: 0.8;
}

/* Tableau de donnees : en-tetes discrets, lignes separees, nombres a droite ; defile seul sur mobile */
.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-small);
}

.data-table th {
  padding: var(--sp-2);
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 10px var(--sp-2);
  border-top: 2px solid var(--border);
  font-weight: 800;
  text-align: left;
  vertical-align: middle;
}

.data-table .is-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table__muted {
  color: var(--muted);
}

.data-table a {
  color: var(--sel-text);
}

.data-table__note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

/* Relances : statut (icone et libelle), nom et motif, lien e-mail */
.relaunch-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.relaunch-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border-radius: var(--r-md);
  background: var(--bg);
}

.relaunch-item--empty {
  color: var(--muted);
  font-weight: 700;
}

.relaunch-item__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.relaunch-item__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9375rem;
}

.relaunch-item__reason {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.35;
}

.relaunch-item__write {
  flex-shrink: 0;
}

/* Legende des statuts : la pastille, puis sa regle */
.status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2) var(--sp-4);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8125rem;
}

.status-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- Pilotage, phase 5 : grille complete, barres des etapes, questions a relire, tendance inversee */

/* Tendance d'un indicateur dont la baisse est une bonne nouvelle (questions a relire) : le sens lu ne change pas */
.trend[data-better="down"][data-direction="down"] {
  color: var(--trend-up);
}

.trend[data-better="down"][data-direction="up"] {
  color: var(--trend-down);
}

/*
 * Grille complete (toutes les matieres) : colonne des classes fixe, matieres
 * en colonnes egales qui se partagent le reste ; sous 720 px, le cadre defile
 * seul, la classe toujours visible ; en-tetes coupes au besoin.
 */
.heat-wrap--full {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  max-width: 100%;
  overflow-x: auto;
}

.heat-wrap--full .heat-grid {
  min-width: 720px;
}

.heat-wrap--full .heat-grid thead td {
  width: 88px;
}

.heat-wrap--full .heat-grid thead th {
  padding-inline: 2px;
  vertical-align: bottom;
  line-height: 1.2;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.heat-wrap--full .heat-grid td {
  padding: 5px 3px;
}

/* Cases de 44 px tous les 54 px (maquette ContenuDesktop), plus hautes que celles de la vue d'ensemble */
.heat-wrap--full .heat-cell {
  height: 44px;
}

.heat-wrap--full .heat-grid tbody th {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.heat-wrap--full .heat-legend {
  position: sticky;
  left: 0;
}

/* Barres des etapes : la couleur de chaque etape (`data-step` sur la ligne) */
.bar-list--step-colors .bar-list__row[data-step="comprendre"] .bar-list__bar { fill: var(--pilot-step-comprendre); }
.bar-list--step-colors .bar-list__row[data-step="entrainer"] .bar-list__bar { fill: var(--pilot-step-entrainer); }
.bar-list--step-colors .bar-list__row[data-step="verifier"] .bar-list__bar { fill: var(--pilot-step-verifier); }
.bar-list--step-colors .bar-list__row[data-step="garder"] .bar-list__bar { fill: var(--pilot-step-garder); }

/* Questions a relire : enonce, chapitre, taux d'echec, lien « Relire » */
.review-questions {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.review-question {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto auto;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px var(--sp-2);
  border-top: 2px solid var(--border);
}

.review-question--empty {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-small);
}

.review-question__prompt {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-small);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.review-question__chapter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  margin: 0;
}

.review-question__title {
  font-weight: 800;
  font-size: var(--fs-small);
}

.review-question__meta {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

.review-question__rate {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  margin: 0;
  text-align: right;
}

.review-question__value {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
  font-variant-numeric: tabular-nums;
}

.review-question__unit {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

.review-question__action {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .review-question {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .review-question__prompt,
  .review-question__chapter {
    grid-column: 1 / -1;
  }
}

/* --- Pilotage, phase 6 (Technique) : etats des mesures et des taches, colonnes des erreurs, signaux d'une tache */

/* Etats d'une mesure ou d'une tache : meme pastille que les statuts des profs, icone et libelle propres */
.status-pill[data-status="ok"] {
  border-color: var(--good-border);
}

.status-pill[data-status="slow"],
.status-pill[data-status="late"] {
  border-color: var(--warm-strong);
}

.status-pill[data-status="failed"] {
  border-color: var(--red-strong);
}

.status-pill[data-status="never"],
.status-pill[data-status="unmeasured"] {
  border-style: dashed;
  color: var(--muted);
}

/* Erreurs 429 et 5xx par jour (colonnes de `dayColumns`, variante `errors`) */
.day-columns--errors .day-columns__bar {
  fill: var(--pilot-error);
}

/* Signal d'une tache planifiee (base differente de l'API, migration en retard, passages manques) */
.tech-flag {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin-top: var(--sp-1);
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

.tech-flag .site-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

/* Test de charge : resultat (pastille) et phrase */
.tech-load {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.tech-load__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin: 0;
}

.tech-load__title {
  font-weight: 800;
  font-size: var(--fs-small);
}

/* Source sans mesure, avec sa raison (journaux Apache) */
.tech-apache {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.data-card__text code {
  font-size: var(--fs-tiny);
  overflow-wrap: anywhere;
}

.tech-table code {
  font-size: var(--fs-small);
}

/* --- Pilotage, phase 7 (Comptes) : recherche, en-tete d'un compte, faits, etapes, actions, motif, notes, chronologie, lecture seule */

/* Recherche unique : champ a contour violet (maquettes Compte*), filtre a droite */
.admin .account-search {
  flex-direction: row;
  align-items: center;
  gap: var(--sp-3);
}

.account-search__field {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding: 0 14px;
  border: 2px solid var(--sel-border);
  border-radius: var(--r-md);
  background: var(--surface);
}

.account-search__field:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.account-search__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.account-search__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
}

.account-search__input:focus {
  outline: none;
}

.account-search__hint {
  flex-shrink: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8125rem;
}

.account-search__kinds .pill-group__item {
  min-height: 40px;
}

/* Resultats : un lien par compte, avatar, nom, ce qui l'a trouve */
.account-results {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-result {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 10px var(--sp-3);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.account-result:hover,
.account-result:focus-visible {
  border-color: var(--sel-border);
}

.account-result__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.account-result__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.0625rem;
}

.account-result__detail {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

/* En-tete d'un compte : avatar de 72 px, nom, pastilles, ligne d'etat, chiffres */
.account-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: var(--sp-5);
  border: 2px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.account-head:empty {
  display: none;
}

.avatar--account {
  width: 72px;
  height: 72px;
  font-size: 2rem;
}

.account-head__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.account-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.account-head__name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 2.25rem;
  line-height: 1;
  overflow-wrap: anywhere;
}

.account-head__kind {
  min-height: 28px;
  font-size: 0.8125rem;
}

.account-head__meta {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-small);
}

.account-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin: 0;
}

.account-stats__item {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
}

.account-stats__value {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.625rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.account-stats__label {
  color: var(--muted);
  font-weight: 800;
  font-size: var(--fs-tiny);
}

/* Faits d'un compte : terme a gauche (170 px), valeur a droite */
.fact-list {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.fact-list dt {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.8125rem;
}

.fact-list dd {
  margin: 0;
  font-weight: 800;
  font-size: var(--fs-small);
  overflow-wrap: anywhere;
}

.fact-list__note {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
  line-height: 1.5;
}

.account-email[data-revealed="true"] {
  color: var(--accent-text);
}

/* Bouton a l'allure d'un lien (« Afficher ») */
.link-button {
  margin-left: var(--sp-2);
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Quatre etapes d'un chapitre : case de 24 px, couleur et coche quand l'etape est faite (ou demandee) */
.step-checks {
  display: inline-flex;
  gap: var(--sp-1);
  vertical-align: middle;
}

.step-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--soft);
  color: var(--on-step);
}

.step-check[data-done="true"][data-step="comprendre"] { background: var(--pilot-step-comprendre); }
.step-check[data-done="true"][data-step="entrainer"] { background: var(--pilot-step-entrainer); }
.step-check[data-done="true"][data-step="verifier"] { background: var(--pilot-step-verifier); }
.step-check[data-done="true"][data-step="garder"] { background: var(--pilot-step-garder); }

.step-check__mark path {
  fill: none;
  stroke: currentColor;
  stroke-width: 3.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Actions d'un compte : icone, titre, phrase ; suppression au contour rouge */
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.account-action {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.account-action:hover,
.account-action:focus-visible {
  border-color: var(--sel-border);
}

.account-action--danger {
  border-color: var(--red-strong);
}

.account-action .site-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.account-action__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.account-action__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-small);
}

.account-action__text {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
  line-height: 1.4;
}

.account-actions__note {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

/* Panneau d'un geste : avertissement, motif, confirmation */
.account-panel {
  padding: var(--sp-4);
  border: 2px dashed var(--border);
  border-radius: var(--r-sm);
}

.account-warning p {
  margin: 0 0 var(--sp-3);
  font-weight: 800;
  font-size: var(--fs-small);
}

.reason-form__set {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.reason-form__set legend {
  margin-bottom: var(--sp-2);
  font-weight: 900;
  font-size: var(--fs-small);
}

.reason-form__choice {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 700;
  font-size: var(--fs-small);
}

.reason-form label:not(.reason-form__choice) {
  font-weight: 800;
  font-size: 0.8125rem;
}

.reason-form .field__input {
  width: 100%;
}

.reason-form__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

/* Notes de suivi : date et auteur, texte brut garde tel quel */
.note-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.note-item {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  padding: 10px var(--sp-3);
  border-radius: var(--r-sm);
  background: var(--bg);
}

.note-item__meta {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.6875rem;
}

.note-item__body {
  font-weight: 800;
  font-size: var(--fs-small);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.note-form__text {
  width: 100%;
  font-size: var(--fs-small);
  min-height: 100px;
  resize: vertical;
}

/* Chronologie : une pastille par sorte d'evenement, titre puis date */
.timeline {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline__item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding-left: 22px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--chart-1);
}

.timeline__item[data-kind="live"]::before { background: var(--signal-warn); }
.timeline__item[data-kind="signup"]::before { background: var(--trend-up); }

.timeline__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--fs-small);
}

.timeline__when {
  color: var(--muted);
  font-weight: 700;
  font-size: var(--fs-tiny);
}

/* Lecture seule : bandeau toujours visible au-dessus des classes d'un prof */
.readonly-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: var(--sp-3) var(--sp-4);
  border: 2px dashed var(--warm-strong);
  border-radius: var(--r-md);
  background: var(--warm-soft);
  color: var(--text);
  font-weight: 700;
  font-size: var(--fs-small);
}

.readonly-banner__text {
  flex: 1;
  min-width: 0;
}

.readonly-subtitle {
  margin: var(--sp-3) 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.readonly-questions {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.readonly-question {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-weight: 700;
  font-size: var(--fs-small);
}

/* Battle School, fin de partie : ce que la partie a rapporte au clan (total seul). */
.battle-report {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-small);
  text-align: center;
}
