/* FICHIER GÉNÉRÉ — ne pas éditer.
   Source : css/tokens.css + css/style.css + css/composants-js.css
   Régénérer : node build/css.mjs */

/* ===== css/tokens.css ===== */
/* ==========================================================================
   SUNU INFO — JETONS
   Identité : « beaucoup de trajets droits, une seule forme »
   Encre sur papier chaud. Le trait est la matière principale ; les aplats et
   les ombres sont secondaires.

   Aucune valeur brute (hex, durée, rayon) hors de ce fichier.
   Ratios de contraste MESURÉS : node build/contraste.mjs build/paires.json
   ========================================================================== */

/* --------------------------------------------------------------------------
   POLICES — auto-hébergées, variables, sous-ensemble français
   Générées par build/subset-polices.mjs. Axes figés à ce que le site utilise :
   c'est ce qui fait tomber Archivo de 63,6 Ko à 17,1 Ko.
   Archivo 17,1 Ko · Inter 22,7 Ko · JetBrains Mono 24,1 Ko — total 64,0 Ko.
   -------------------------------------------------------------------------- */

/* Affichage — lourde et condensée, comme le logotype SUNU INFO. */
@font-face {
  font-family: 'Archivo';
  src: url('../fonts/archivo-fr.woff2') format('woff2');
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

/* Texte courant. */
@font-face {
  font-family: 'Inter';
  src: url('../fonts/inter-fr.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

/* Données — dates, montants, durées, codes. Registre « planche technique ». */
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-fr.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  /* ------------------------------------------------------------------------
     COULEURS — six rôles, un seul chromatique
     Ratios mesurés sur --papier / --papier-carte.
     ------------------------------------------------------------------------ */
  --papier:        #F2F1ED;  /* fond de page — la teinte du logotype */
  --papier-carte:  #FAFAF9;  /* surface surélevée : cartes, panneaux */

  --encre:         #1A1915;  /* 15.56:1 / 16.84:1 — texte principal, traits forts */
  --encre-douce:   #4A4840;  /*  8.11:1 /  8.77:1 — texte secondaire */
  --encre-tenue:   #6B685E;  /*  4.93:1 /  5.34:1 — métadonnées, et bordures
                                 d'éléments interactifs (≥ 3:1, WCAG 1.4.11) */

  /* Le seul accent chromatique du site. Il ne sert QU'À signaler le temps qui
     manque : échéance imminente, erreur de saisie à corriger. Rien d'autre sur
     ce site n'est une urgence, donc rien d'autre n'a droit à la couleur. */
  --urgence:       #B3261E;  /*  5.78:1 /  6.26:1 ; blanc sur lui : 6.54:1 */

  /* Filet décoratif. 1,32:1 — il ne porte JAMAIS de sens à lui seul : séparer
     visuellement, rien de plus. Tout contrôle utilise --encre-tenue. */
  --filet:         #D6D3CA;

  /* Fond de survol. Décoratif : l'encre posée dessus reste > 12:1. */
  --voile:         rgba(26, 25, 21, 0.07);

  /* Pilule de navigation : blanc pur en mix-blend-mode difference. */
  --pilule-inverse: #FFFFFF;

  /* Couleur du tracé de la signature, lue par js/signature.js. */
  --signature-trait: #1A1915;

  /* ------------------------------------------------------------------------
     TYPOGRAPHIE — échelle 1.250 (tierce majeure)
     ------------------------------------------------------------------------ */
  --police-affichage: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --police-texte:     'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --police-donnees:   'JetBrains Mono', ui-monospace, 'Cascadia Mono', monospace;

  --t-xs:   0.8125rem;  /* 13 px — métadonnées, étiquettes */
  --t-sm:   0.875rem;   /* 14 px */
  --t-base: 1rem;       /* 16 px — plancher du texte courant */
  --t-md:   1.125rem;   /* 18 px — chapô */
  --t-lg:   1.375rem;   /* 22 px */

  /* Titres fluides : aucun débordement à 320 px, pleine ampleur à 1440 px. */
  --t-titre-3: clamp(1.25rem, 1.12rem + 0.65vw, 1.625rem);
  --t-titre-2: clamp(1.75rem, 1.40rem + 1.75vw, 2.75rem);
  --t-titre-1: clamp(2.5rem,  1.85rem + 3.25vw, 4.5rem);
  --t-nombre:  clamp(1.75rem, 1.35rem + 2.00vw, 2.75rem);

  --interligne-texte:     1.55;
  --interligne-titre:     1.15;
  --interligne-affichage: 0.98;  /* serré : le display doit faire bloc */

  /* Largeur du display, figée sur le condensé du logotype. */
  --largeur-affichage: 'wdth' 88;

  --chasse-affichage: -0.015em;
  --chasse-titre:     -0.01em;
  --chasse-donnees:    0.01em;
  --chasse-etiquette:  0.16em;  /* interlettrage large du sous-titre du logo */

  --gr-moyen:  500;
  --gr-fort:   600;
  --gr-lourd:  800;

  /* ------------------------------------------------------------------------
     ESPACEMENT — base 8 px
     ------------------------------------------------------------------------ */
  --e-1: 0.25rem;  /*  4 px */
  --e-2: 0.5rem;   /*  8 px */
  --e-3: 1rem;     /* 16 px */
  --e-4: 1.5rem;   /* 24 px */
  --e-5: 2rem;     /* 32 px */
  --e-6: 3rem;     /* 48 px */
  --e-7: 4rem;     /* 64 px */
  --e-8: 6rem;     /* 96 px */

  --gouttiere:       1.25rem;  /* 20 px — marge latérale mobile */
  --gouttiere-large: 2.5rem;
  --largeur-max:     74rem;    /* 1184 px */
  --largeur-lecture: 64ch;

  /* ------------------------------------------------------------------------
     TRAITS ET RAYONS
     ------------------------------------------------------------------------ */
  --trait: 1px;
  --trait-fort: 2px;

  /* 3 px : assez pour ne pas basculer dans le brutalisme à angles vifs,
     assez peu pour que le tracé reste un tracé. */
  --rayon: 3px;
  --rayon-carte: 14px;
  --rayon-plein: 999px;

  /* ------------------------------------------------------------------------
     ÉLÉVATION — par le trait, pas par l'ombre.
     Une seule ombre existe, très basse, pour les surfaces flottantes qui
     doivent se détacher du papier (panneau, menu). Partout ailleurs :
     une bordure suffit.
     ------------------------------------------------------------------------ */
  --ombre-flottante: 0 1px 2px rgba(26, 25, 21, 0.06),
                     0 8px 24px -12px rgba(26, 25, 21, 0.18);
  --ombre-entete:    0 6px 20px -14px rgba(26, 25, 21, 0.35);
  --ombre-carte:     0 1px 2px rgba(26, 25, 21, 0.04),
                     0 2px 8px -4px rgba(26, 25, 21, 0.06);
  --ombre-carte-haute: 0 2px 4px rgba(26, 25, 21, 0.05),
                     0 22px 40px -22px rgba(26, 25, 21, 0.32);

  /* ------------------------------------------------------------------------
     PLANS
     ------------------------------------------------------------------------ */
  --plan-fond:      0;
  --plan-contenu:   1;
  --plan-entete:    20;
  --plan-flottant:  30;
  --plan-panneau:   40;
  --plan-modale:    50;
  --plan-evitement: 60;

  /* ------------------------------------------------------------------------
     MOUVEMENT
     ------------------------------------------------------------------------ */
  --duree-micro:  0.18s;  /* survol, pression, bascule (150–250 ms) */
  --duree-entree: 0.55s;  /* révélation (400–700 ms) */
  --duree-sortie: 0.20s;  /* une sortie est plus rapide qu'une entrée */
  --duree-tiroir: 0.38s;

  --courbe-entree: cubic-bezier(0.22, 0.61, 0.36, 1);
  /* Léger dépassement : un ressort sans bibliothèque. */
  --courbe-ressort: cubic-bezier(0.34, 1.56, 0.64, 1);
  --courbe-sortie: cubic-bezier(0.40, 0.00, 1.00, 1);

  /* ------------------------------------------------------------------------
     CIBLES
     ------------------------------------------------------------------------ */
  --cible: 44px;       /* WCAG 2.5.5 */
  --cible-ecart: 8px;
  --focus: 2px;
  --focus-decalage: 2px;
}

/* ==========================================================================
   MOUVEMENT RÉDUIT
   Les durées tombent à ~0 au lieu de supprimer les animations : l'état final
   reste appliqué, donc aucun contenu ne peut rester masqué.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  :root {
    --duree-micro:  0.01ms;
    --duree-entree: 0.01ms;
    --duree-sortie: 0.01ms;
    --duree-tiroir: 0.01ms;
  }
}


/* ===== css/style.css ===== */
/* ==========================================================================
   SUNU INFO — FEUILLE DE STYLE PRINCIPALE
   Encre sur papier chaud. Le trait est la matière ; l'aplat et l'ombre sont
   l'exception. Écrite mobile d'abord (media queries en min-width uniquement).
   Toutes les valeurs viennent de css/tokens.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--t-base);
  line-height: var(--interligne-texte);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style-position: outside; }

h1, h2, h3, h4 {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-weight: var(--gr-lourd);
  line-height: var(--interligne-titre);
  letter-spacing: var(--chasse-titre);
  text-wrap: balance;

  /* Un titre placé dans un conteneur flex ou grid hérite de min-width:auto :
     il s'élargit alors jusqu'à son mot le plus long et sort de son parent.
     Mesuré à 320 px sur 8 fiches filières (« MATHÉMATIQUES-INFORMATIQUE »
     débordait de 80 px). Un titre ne doit jamais imposer la largeur. */
  min-width: 0;

  /* Césure : sur des titres français longs et en capitales, couper au tiret
     de césure est plus lisible que couper au milieu d'une syllabe. */
  hyphens: auto;
}

p { text-wrap: pretty; }

/* Coupure des mots longs, éléments en ligne compris : c'est par eux que le
   débordement revient à 320 px. */
p, li, h1, h2, h3, h4, dd, dt, td, th,
strong, em, b, i, span, a, label, legend, summary,
.card, .tag, .note {
  overflow-wrap: break-word;
  word-break: normal;
}

pre, code { overflow-x: auto; max-width: 100%; }

/* --------------------------------------------------------------------------
   2. MISE EN PAGE
   Les sections sont séparées par un filet, pas par un changement de fond :
   sur une planche, on sépare par un trait.
   -------------------------------------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--largeur-max);
  margin-inline: auto;
  padding-inline: var(--gouttiere);
  position: relative;
  z-index: var(--plan-contenu);
}

@media (min-width: 48em) {
  .wrap { padding-inline: var(--gouttiere-large); }
}

main { display: block; }

section {
  padding-block: var(--e-6);
  position: relative;
}

@media (min-width: 48em) {
  section { padding-block: var(--e-8); }
}

section.alt {
  background: var(--papier-carte);
  border-block: var(--trait) solid var(--filet);
}

/* --------------------------------------------------------------------------
   3. ÉVITEMENT ET FOCUS
   -------------------------------------------------------------------------- */
.skip-link {
  position: absolute;
  top: 0;
  left: var(--gouttiere);
  z-index: var(--plan-evitement);
  transform: translateY(-120%);
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  padding: var(--e-2) var(--e-4);
  background: var(--encre);
  color: var(--papier);
  font-weight: var(--gr-fort);
  text-decoration: none;
  border-radius: 0 0 var(--rayon) var(--rayon);
  transition: transform var(--duree-micro) var(--courbe-entree);
}
.skip-link:focus { transform: translateY(0); }

/* Anneau de focus : encre pleine, 2 px. Jamais supprimé. */
:focus-visible {
  outline: var(--focus) solid var(--encre);
  outline-offset: var(--focus-decalage);
  border-radius: var(--rayon);
}

/* Sur une surface encre, l'anneau passe en papier pour rester visible. */
.btn-primary:focus-visible,
.pill.active:focus-visible,
.assistant-btn:focus-visible {
  outline-color: var(--papier);
  outline-offset: -4px;
}

/* --------------------------------------------------------------------------
   4. ICÔNES — famille unique (Bootstrap Icons), sprite local sous-ensemblé
   Usage : <svg class="ico" aria-hidden="true"><use href="icones/sprite.svg#ico-nom"></use></svg>
   -------------------------------------------------------------------------- */
.ico {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
  vertical-align: -0.125em;
  display: inline-block;
}

/* --------------------------------------------------------------------------
   5. TYPOGRAPHIE DE PAGE
   -------------------------------------------------------------------------- */

/* Étiquette de section : capitales très espacées, comme la ligne
   « B R A N D   L O G O » du logotype, prolongée par un trait de cote. */
.path-label,
.eyebrow {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  font-weight: var(--gr-moyen);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-3);
}

.path-label::after,
.eyebrow::after {
  content: '';
  flex: 1;
  height: var(--trait);
  background: var(--filet);
}

h1 {
  font-size: var(--t-titre-1);
  line-height: var(--interligne-affichage);
  letter-spacing: var(--chasse-affichage);
  font-weight: var(--gr-lourd);
  text-transform: uppercase;
}

h2 {
  font-size: var(--t-titre-2);
  letter-spacing: var(--chasse-affichage);
}

h3 { font-size: var(--t-titre-3); font-weight: var(--gr-fort); }

.lead {
  font-size: var(--t-md);
  color: var(--encre-douce);
  max-width: var(--largeur-lecture);
  margin-top: var(--e-4);
}

.section-head { margin-bottom: var(--e-5); max-width: var(--largeur-lecture); }

.section-desc,
.desc {
  color: var(--encre-douce);
  max-width: var(--largeur-lecture);
  margin-bottom: var(--e-5);
}

.article-body { max-width: var(--largeur-lecture); }
.article-body > * + * { margin-top: var(--e-3); }
.article-body h2 { margin-top: var(--e-6); }
.article-body h3 { margin-top: var(--e-5); }
.article-body ul, .article-body ol { padding-left: var(--e-4); }
.article-body li + li { margin-top: var(--e-2); }

/* :not(.btn) est indispensable : « .article-body a » (0,1,1) l'emporte sur
   « .btn-primary » (0,1,0) et repeindrait un bouton en lien souligné. */
.article-body a:not(.btn) {
  color: var(--encre);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: var(--trait);
}
.article-body a:not(.btn):hover { text-decoration-thickness: var(--trait-fort); }

.source-note,
.foot-note {
  font-size: var(--t-sm);
  color: var(--encre-tenue);
}

/* Toute donnée est en chasse fixe. C'est la convention de lecture du site :
   ce qui est en mono est un fait vérifiable. */
.mono, time, kbd {
  font-family: var(--police-donnees);
  letter-spacing: var(--chasse-donnees);
  font-variant-numeric: tabular-nums;
}

.chiffre {
  display: block;
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-size: var(--t-nombre);
  font-weight: var(--gr-lourd);
  line-height: var(--interligne-affichage);
  letter-spacing: var(--chasse-affichage);
  font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   6. EN-TÊTE — navigation en pilule
   Le flou est porté par ::before : un backdrop-filter sur <header> lui-même
   deviendrait le bloc conteneur du tiroir mobile en position fixe.
   -------------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: var(--plan-entete);
  border-bottom: var(--trait) solid transparent;
  transition:
    border-color var(--duree-micro) var(--courbe-entree),
    box-shadow var(--duree-micro) var(--courbe-entree);
}
header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--papier) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
}
header.defile {
  border-bottom-color: var(--filet);
  box-shadow: var(--ombre-entete);
}

/* Progression de lecture : pilotée par js/animations.js, invisible sans lui. */
.progression {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--encre);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

nav.wrap {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  padding-block: var(--e-2);
  min-height: 64px;
}

.navbar-brand {
  position: relative;
  z-index: calc(var(--plan-panneau) + 1);
  display: flex;
  align-items: center;
  gap: var(--e-2);
  flex: none;
  min-height: var(--cible);
  margin-right: auto;
  color: var(--encre);
  text-decoration: none;
  border-radius: var(--rayon);
}
.brand-symbole { width: 36px; height: 36px; flex: none; }
.brand-mot {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-weight: var(--gr-lourd);
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* --- Mobile : tiroir qui glisse depuis la droite ---
   clip-path plutôt que translateX : un panneau fixe translaté hors écran
   élargit la zone défilable ; un découpage ne le fait pas. */
.navlinks {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: var(--plan-panneau);
  width: min(24rem, 100%);
  display: flex;
  flex-direction: column;
  gap: var(--e-1);
  padding: calc(64px + var(--e-4)) var(--gouttiere) var(--e-5);
  background: var(--papier-carte);
  border-left: var(--trait) solid var(--filet);
  box-shadow: var(--ombre-flottante);
  font-size: var(--t-md);
  overflow-y: auto;
  overscroll-behavior: contain;

  clip-path: inset(0 0 0 100%);
  visibility: hidden;
  transition:
    clip-path var(--duree-sortie) var(--courbe-sortie),
    visibility 0s linear var(--duree-sortie);
}
.navlinks.mobile-open {
  clip-path: inset(0);
  visibility: visible;
  transition:
    clip-path var(--duree-tiroir) var(--courbe-entree),
    visibility 0s;
}

.navlinks a,
.nav-dropdown-toggle {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: var(--e-2);
  width: 100%;
  min-height: var(--cible);
  padding: var(--e-2) var(--e-3);
  border: none;
  border-radius: var(--rayon-plein);
  background: none;
  color: var(--encre-douce);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    color var(--duree-micro) var(--courbe-entree),
    background-color var(--duree-micro) var(--courbe-entree);
}
.navlinks a:hover,
.nav-dropdown-toggle:hover { color: var(--encre); background: var(--voile); }

/* Page courante : pilule encre pleine + graisse, doublée par aria-current. */
.navlinks a[aria-current="page"] {
  color: var(--papier);
  background: var(--encre);
  font-weight: var(--gr-fort);
}

.caret {
  margin-left: auto;
  transition: transform var(--duree-micro) var(--courbe-entree);
}
.nav-dropdown.open .caret { transform: rotate(180deg); }

.nav-dropdown { width: 100%; }
.nav-dropdown-menu {
  display: none;
  flex-direction: column;
  gap: 2px;
  margin: var(--e-1) 0 var(--e-2) var(--e-3);
  padding-left: var(--e-2);
  border-left: var(--trait) solid var(--filet);
}
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.navlinks .nav-dropdown-menu a {
  font-size: var(--t-base);
  border-radius: var(--rayon-carte);
}
.navlinks .nav-dropdown-menu a[aria-current="page"] {
  color: var(--encre);
  background: var(--voile);
}

.nav-pilule { display: none; }

.nav-actions {
  position: relative;
  z-index: calc(var(--plan-panneau) + 1);
  display: flex;
  align-items: center;
  gap: var(--cible-ecart);
  flex: none;
}

.global-search-btn,
.nav-toggle,
.assistant-icon-btn,
.assistant-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--cible);
  min-height: var(--cible);
  padding: 0;
  background: none;
  border: var(--trait) solid transparent;
  border-radius: var(--rayon-plein);
  color: var(--encre-douce);
  font-size: var(--t-lg);
  cursor: pointer;
  transition:
    color var(--duree-micro) var(--courbe-entree),
    border-color var(--duree-micro) var(--courbe-entree),
    background-color var(--duree-micro) var(--courbe-entree);
}
.global-search-btn:hover,
.nav-toggle:hover,
.assistant-icon-btn:hover,
.assistant-close:hover {
  color: var(--encre);
  border-color: var(--encre-tenue);
  background: var(--voile);
}

/* --- Bureau : barre en pilule --- */
@media (min-width: 62em) {
  .nav-toggle { display: none; }

  .navlinks {
    position: relative;
    top: auto; right: auto; bottom: auto;
    z-index: auto;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    width: auto;
    padding: 4px;
    margin-right: var(--e-2);
    background: var(--papier-carte);
    border: var(--trait) solid var(--encre);
    border-radius: var(--rayon-plein);
    box-shadow: none;
    font-size: var(--t-xs);
    overflow: visible;
    clip-path: none;
    visibility: visible;
    transition: none;
  }

  .navlinks > a,
  .nav-dropdown-toggle {
    width: auto;
    min-height: 40px;
    padding: 0 var(--e-3);
    color: var(--encre);
    font-weight: var(--gr-moyen);
    letter-spacing: 0.07em;
    text-transform: uppercase;
    white-space: nowrap;
  }

  /* Avec JS : une pilule blanche en mode « différence » glisse PAR-DESSUS les
     libellés. Elle inverse tout ce qu'elle couvre : fond papier → quasi noir
     (#050506), encre → quasi blanc (#E5E6EA), 17:1. Le texte reste lisible à
     chaque image du glissement, sans changement de couleur à synchroniser. */
  .navlinks.a-pilule { isolation: isolate; }
  .navlinks.a-pilule > a[aria-current="page"],
  .navlinks.a-pilule > a:hover,
  .navlinks.a-pilule .nav-dropdown-toggle:hover { background: transparent; color: var(--encre); }

  .navlinks.a-pilule .nav-pilule {
    display: block;
    position: absolute;
    z-index: 2;
    top: 4px;
    left: 0;
    height: 40px;
    width: 0;
    border-radius: var(--rayon-plein);
    background: var(--pilule-inverse);
    mix-blend-mode: difference;
    pointer-events: none;
    opacity: 0;
    will-change: transform, width;
  }

  .nav-dropdown { position: relative; width: auto; }
  .nav-dropdown-menu {
    position: absolute;
    top: calc(100% + var(--e-3));
    left: 50%;
    translate: -50% 0;
    min-width: 240px;
    margin: 0;
    padding: var(--e-2);
    background: var(--papier-carte);
    border: var(--trait) solid var(--encre-tenue);
    border-radius: var(--rayon-carte);
    box-shadow: var(--ombre-flottante);
    z-index: var(--plan-flottant);
  }
  .navlinks .nav-dropdown-menu a { font-size: var(--t-sm); min-height: 40px; }

  .caret { margin-left: 2px; }
}

/* --------------------------------------------------------------------------
   7. BOUTONS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e-2);
  min-height: var(--cible);
  padding: var(--e-2) var(--e-4);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  background: transparent;
  color: var(--encre);
  font-family: var(--police-texte);
  font-size: var(--t-sm);
  font-weight: var(--gr-fort);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform var(--duree-micro) var(--courbe-entree),
    background-color var(--duree-micro) var(--courbe-entree),
    color var(--duree-micro) var(--courbe-entree);
}

.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--encre); color: var(--papier); }
.btn-primary:hover { background: var(--encre-douce); }

.btn-ghost { border-color: var(--encre-tenue); }
.btn-ghost:hover { background: var(--papier-carte); border-color: var(--encre); }

.btn-lg { min-height: 52px; padding: var(--e-3) var(--e-5); font-size: var(--t-base); }

.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn[data-chargement="true"] { pointer-events: none; opacity: 0.6; }

.cta-row { display: flex; flex-wrap: wrap; gap: var(--e-3); margin-top: var(--e-5); }

.link {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: var(--cible);
  color: var(--encre);
  font-weight: var(--gr-fort);
  font-size: var(--t-sm);
  text-decoration: none;
  border-bottom: var(--trait) solid var(--encre-tenue);
}
.link:hover { border-bottom-width: var(--trait-fort); }
.link .ico { transition: transform var(--duree-micro) var(--courbe-entree); }
.card:hover .link .ico,
.link:hover .ico { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   8. CARTES
   Élévation par le trait : la bordure passe du filet à l'encre. Pas d'ombre.
   -------------------------------------------------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  padding: var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre-carte);
  transition:
    transform 0.45s var(--courbe-ressort),
    box-shadow 0.3s var(--courbe-entree),
    border-color var(--duree-micro) var(--courbe-entree);
}

.card:hover,
.card:focus-within {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--encre-tenue);
  box-shadow: var(--ombre-carte-haute);
}

.card .link {
  padding: 0 var(--e-4);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-plein);
  transition:
    background-color var(--duree-micro) var(--courbe-entree),
    color var(--duree-micro) var(--courbe-entree);
}
.card .link:hover { background: var(--encre); color: var(--papier); border-bottom-width: var(--trait); }

@media (prefers-reduced-motion: reduce) {
  .card:hover, .card:focus-within { transform: none; }
}

.card-top {
  display: flex;
  align-items: baseline;
  gap: var(--e-2);
  flex-wrap: wrap;
}

/* Le niveau de titre d'une carte dépend de la structure de la page ;
   son apparence, elle, ne change jamais. */
.card-top h2, .card-top h3, .card-top h4 {
  font-size: var(--t-lg);
  letter-spacing: var(--chasse-titre);
}

.card p { color: var(--encre-douce); font-size: var(--t-sm); }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-1) var(--e-3);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-tenue);
}
.card-meta > span { display: inline-flex; align-items: center; gap: var(--e-1); }

/* --------------------------------------------------------------------------
   9. ÉTIQUETTES ET PASTILLES
   -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--e-1);
  padding: 1px var(--e-2);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre-tenue);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: var(--cible);
  padding: var(--e-2) var(--e-3);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon-plein);
  background: transparent;
  color: var(--encre-douce);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  cursor: pointer;
  transition:
    background-color var(--duree-micro) var(--courbe-entree),
    color var(--duree-micro) var(--courbe-entree);
}
.pill:hover { color: var(--encre); background: var(--papier-carte); }

/* Actif : inversion encre/papier. Le contraste de forme, pas juste de teinte. */
.pill.active,
.pill[aria-pressed="true"] {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
  font-weight: var(--gr-fort);
}

/* --------------------------------------------------------------------------
   10. NOTES
   -------------------------------------------------------------------------- */
.note {
  /* En block et non en flex : sur les pages existantes le texte de la note
     n'est pas enveloppé. En flex il forme un item anonyme au min-width auto
     qui refuse de se réduire et déborde à 320 px. */
  display: block;
  padding: var(--e-3) var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-left: var(--trait-fort) solid var(--encre);
  border-radius: 0 var(--rayon) var(--rayon) 0;
  color: var(--encre-douce);
  font-size: var(--t-sm);
}
.note .ico { color: var(--encre); margin-right: var(--e-2); vertical-align: -0.15em; }
.note a { color: var(--encre); }

/* --------------------------------------------------------------------------
   11. GRILLES
   -------------------------------------------------------------------------- */
.grid { display: grid; gap: var(--e-3); grid-template-columns: 1fr; }

@media (min-width: 40em) {
  .grid { gap: var(--e-4); }
  .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 64em) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

/* --------------------------------------------------------------------------
   12. HÉROS ET SIGNATURE
   Le canevas porte width/height en attributs : la place est réservée avant
   tout script, donc aucun décalage de mise en page.
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--e-6) var(--e-7);
  overflow: hidden;
}

.hero-grid { position: relative; z-index: var(--plan-contenu); display: grid; gap: var(--e-5); }

#signature {
  position: absolute;
  top: 50%;
  right: calc(var(--gouttiere) * -1);
  transform: translateY(-50%);
  width: min(88vw, 34rem);
  height: min(88vw, 34rem);
  z-index: var(--plan-fond);
  pointer-events: none;
  /* Ambiant : le motif ne concurrence jamais le titre ni le champ de
     recherche. Sur mobile il passe derrière le texte, très atténué. */
  opacity: 0.18;
}

#signature { translate: 0 var(--parallaxe, 0px); }

@media (min-width: 64em) {
  .hero {
    display: flex;
    align-items: center;
    min-height: min(calc(100svh - 64px), 58rem);
    padding-block: var(--e-7);
  }
  .hero > .wrap { width: 100%; }
  .hero-grid { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: var(--e-7); }

  #signature {
    right: 0;
    width: min(46vw, 38rem);
    height: min(46vw, 38rem);
    opacity: 0.5;
  }
}

.hero h1 em { font-style: normal; display: block; color: var(--encre-douce); }

.hero-recherche { margin-top: var(--e-5); max-width: 34rem; }

.champ-recherche {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  padding-inline: var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
}
.champ-recherche:focus-within {
  outline: var(--focus) solid var(--encre);
  outline-offset: var(--focus-decalage);
}
.champ-recherche .ico { color: var(--encre-tenue); }

.search-input,
.champ-recherche input {
  flex: 1;
  min-width: 0;
  min-height: var(--cible);
  background: transparent;
  border: none;
  color: var(--encre);
  font-size: var(--t-base); /* 16 px : empêche le zoom automatique sur iOS */
}
.champ-recherche input:focus { outline: none; }
.search-input::placeholder { color: var(--encre-tenue); }

/* Champ de recherche autonome (pages listes) */
.search-input {
  width: 100%;
  padding: var(--e-2) var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
}
.champ-recherche .search-input { border: none; padding: 0; background: transparent; }

.search-row { display: flex; flex-wrap: wrap; gap: var(--e-2); margin-bottom: var(--e-4); }

/* Chiffres-clés du héros */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: var(--e-4);
  margin-top: var(--e-6);
  padding-top: var(--e-4);
  border-top: var(--trait) solid var(--encre-tenue);
}
.hero-stats > div { display: flex; flex-direction: column; }
.hero-stats dd { order: 1; }
.hero-stats dt {
  order: 2;
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
}

/* --------------------------------------------------------------------------
   13. BARRE DE FILIÈRES, ONGLETS, PANNEAU
   -------------------------------------------------------------------------- */
.filiere-bar {
  padding-block: var(--e-4);
  background: var(--papier-carte);
  border-bottom: var(--trait) solid var(--filet);
}

.filiere-label {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-2);
}

.filiere-categories, .filiere-pills { display: flex; flex-wrap: wrap; gap: var(--cible-ecart); }
.filiere-categories { margin-bottom: var(--e-3); }

.cat-tab {
  min-height: var(--cible);
  padding: var(--e-2) var(--e-1);
  background: none;
  border: none;
  border-bottom: var(--trait-fort) solid transparent;
  color: var(--encre-douce);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  cursor: pointer;
  transition: color var(--duree-micro) var(--courbe-entree);
}
.cat-tab:hover { color: var(--encre); }
.cat-tab.active,
.cat-tab[aria-selected="true"] {
  color: var(--encre);
  border-bottom-color: var(--encre);
  font-weight: var(--gr-fort);
}

.filiere-status {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-tenue);
  margin-top: var(--e-3);
}

.filiere-panel {
  padding: var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  margin-top: var(--e-4);
}

.filiere-panel-head {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  flex-wrap: wrap;
  margin-bottom: var(--e-3);
  padding-bottom: var(--e-3);
  border-bottom: var(--trait) solid var(--filet);
}

.filiere-panel-cols { display: grid; gap: var(--e-4); grid-template-columns: 1fr; }

@media (min-width: 48em) {
  .filiere-panel-cols { grid-template-columns: repeat(3, 1fr); }
}

.fp-col h4 {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  font-weight: var(--gr-moyen);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-2);
}
.fp-col ul { list-style: none; }
.fp-col li + li { margin-top: var(--e-2); }
.fp-col a { color: var(--encre-douce); }
.fp-col a:hover { color: var(--encre); }

/* --------------------------------------------------------------------------
   14. FORMULAIRES
   Étiquette visible et persistante. Jamais de placeholder en guise d'étiquette.
   -------------------------------------------------------------------------- */
.form-group { display: flex; flex-direction: column; gap: var(--e-2); margin-bottom: var(--e-4); }

.form-group label,
.champ-label {
  font-size: var(--t-sm);
  font-weight: var(--gr-fort);
  color: var(--encre);
}

.champ-aide { font-size: var(--t-xs); color: var(--encre-tenue); }

.form-group input,
.form-group select,
.form-group textarea,
.champ {
  width: 100%;
  min-height: var(--cible);
  padding: var(--e-2) var(--e-3);
  background: var(--papier-carte);
  color: var(--encre);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  font-size: var(--t-base);
}
.form-group textarea { min-height: 7rem; resize: vertical; }

.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible,
.champ:focus-visible {
  outline: var(--focus) solid var(--encre);
  outline-offset: 1px;
  border-color: var(--encre);
}

/* Erreur : bordure épaissie + icône + message adjacent. Jamais la couleur seule. */
.form-group[data-erreur="true"] input,
.form-group[data-erreur="true"] select,
.form-group[data-erreur="true"] textarea,
.champ[aria-invalid="true"] {
  border-color: var(--urgence);
  border-width: var(--trait-fort);
}

.champ-erreur {
  display: flex;
  align-items: center;
  gap: var(--e-1);
  font-size: var(--t-sm);
  font-weight: var(--gr-moyen);
  color: var(--urgence);
}
.champ-erreur:empty { display: none; }

fieldset { border: none; }
legend {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-size: var(--t-lg);
  font-weight: var(--gr-fort);
  margin-bottom: var(--e-3);
}

/* --------------------------------------------------------------------------
   15. CHARGEMENT
   -------------------------------------------------------------------------- */
.squelette {
  position: relative;
  overflow: hidden;
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
}

/* Un trait qui balaie la carte : registre du site, et n'anime qu'un transform. */
.squelette::after {
  content: '';
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--filet), transparent);
  transform: translateX(-100%);
  animation: balayage 1.5s var(--courbe-entree) infinite;
}

.squelette-carte { min-height: 9rem; }

@keyframes balayage { to { transform: translateX(350%); } }

@media (prefers-reduced-motion: reduce) {
  .squelette::after { animation: none; opacity: 0.4; }
}

/* --------------------------------------------------------------------------
   16. ÉCHÉANCES
   Contenu le plus lourd d'enjeu du site : donc le bloc le moins décoré.
   Pas d'ombre, pas d'animation d'entrée, pas de survol spectaculaire.
   Dates en chasse fixe, hiérarchie portée par la seule typographie.
   -------------------------------------------------------------------------- */
.echeances { display: flex; flex-direction: column; }

.echeance {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--e-1) var(--e-4);
  align-items: start;
  padding-block: var(--e-4);
  border-top: var(--trait) solid var(--filet);
}
.echeance:last-child { border-bottom: var(--trait) solid var(--filet); }

.echeance-date {
  grid-column: 1;
  font-family: var(--police-donnees);
  font-size: var(--t-sm);
  font-weight: var(--gr-fort);
  color: var(--encre);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.echeance-corps { grid-column: 2; }

.echeance-titre {
  font-family: var(--police-texte);
  font-size: var(--t-base);
  font-weight: var(--gr-fort);
  letter-spacing: normal;
}

.echeance-detail { font-size: var(--t-sm); color: var(--encre-douce); margin-top: var(--e-1); }

/* Le reste à courir : mot + icône + couleur. Jamais la couleur seule. */
.echeance-reste {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: var(--e-1);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-tenue);
}

/* Imminent : trait de rappel, libellé en rouge et en gras. */
.echeance[data-urgence="imminent"] {
  border-left: var(--trait-fort) solid var(--urgence);
  padding-left: var(--e-3);
}
.echeance[data-urgence="imminent"] .echeance-reste {
  color: var(--urgence);
  font-weight: var(--gr-fort);
}
.echeance[data-urgence="passe"] { color: var(--encre-tenue); }
.echeance[data-urgence="passe"] .echeance-date { text-decoration: line-through; }

@media (min-width: 40em) {
  .echeance { grid-template-columns: 9rem 1fr auto; align-items: baseline; }
  .echeance-reste { grid-column: 3; justify-self: end; }
}

/* --------------------------------------------------------------------------
   17. PARCOURS — contenu réellement séquentiel, donc numéroté
   -------------------------------------------------------------------------- */
.parcours { display: flex; flex-direction: column; list-style: none; }

.parcours-etape {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--e-4);
  align-items: start;
  padding-block: var(--e-5);
  border-top: var(--trait) solid var(--filet);
}
.parcours-etape:last-child { border-bottom: var(--trait) solid var(--filet); }

.parcours-num {
  font-family: var(--police-donnees);
  font-size: var(--t-sm);
  font-weight: var(--gr-fort);
  color: var(--encre-tenue);
  font-variant-numeric: tabular-nums;
  padding-top: 0.2em;
}

.parcours-etape h3 { margin-bottom: var(--e-2); }
.parcours-etape p { color: var(--encre-douce); }

/* --------------------------------------------------------------------------
   18. COMPARAISON
   -------------------------------------------------------------------------- */
.comparaison { overflow-x: auto; }

.comparaison table {
  width: 100%;
  min-width: 34rem;
  border-collapse: collapse;
  font-size: var(--t-sm);
}

.comparaison th,
.comparaison td {
  padding: var(--e-3);
  text-align: left;
  vertical-align: top;
  border-bottom: var(--trait) solid var(--filet);
}

.comparaison thead th {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-size: var(--t-base);
  color: var(--encre);
  border-bottom: var(--trait-fort) solid var(--encre);
}

.comparaison tbody th {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  font-weight: var(--gr-moyen);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  white-space: nowrap;
}

.comparaison td { color: var(--encre-douce); }

/* --------------------------------------------------------------------------
   19. FAQ — <details> natif, donc clavier et lecteurs d'écran d'office
   -------------------------------------------------------------------------- */
.faq { display: flex; flex-direction: column; max-width: 52rem; }

.faq-item { border-top: var(--trait) solid var(--filet); }
.faq-item:last-child { border-bottom: var(--trait) solid var(--filet); }

.faq-item > summary {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: var(--cible);
  padding-block: var(--e-3);
  font-weight: var(--gr-fort);
  cursor: pointer;
  list-style: none;
}
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:focus-visible { outline: var(--focus) solid var(--encre); outline-offset: -2px; }

.faq-chevron {
  margin-left: auto;
  color: var(--encre-tenue);
  transition: transform var(--duree-micro) var(--courbe-entree);
}
.faq-item[open] .faq-chevron { transform: rotate(180deg); }

.faq-reponse {
  padding-bottom: var(--e-4);
  color: var(--encre-douce);
  font-size: var(--t-sm);
  max-width: var(--largeur-lecture);
}

/* --------------------------------------------------------------------------
   20. ÉTABLISSEMENTS ET PAGES SECONDAIRES
   -------------------------------------------------------------------------- */
.school-detail {
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  margin-top: var(--e-2);
  padding-top: var(--e-3);
  border-top: var(--trait) solid var(--filet);
  font-size: var(--t-sm);
  color: var(--encre-douce);
}
.school-detail .ico { color: var(--encre-tenue); margin-right: var(--e-1); }

.concours-card { border-left: var(--trait-fort) solid var(--encre); }

.dossier-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cible-ecart);
  margin-bottom: var(--e-5);
  padding-bottom: var(--e-3);
  border-bottom: var(--trait) solid var(--filet);
}
.dossier-nav a {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  padding: var(--e-2) var(--e-3);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon-plein);
  color: var(--encre-douce);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  text-decoration: none;
}
.dossier-nav a:hover { color: var(--encre); background: var(--papier-carte); }
.dossier-nav a.current {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
  font-weight: var(--gr-fort);
}

/* Calculateur de moyenne */
.moy-result {
  padding: var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
}
.moy-result-row, .moy-labels {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: var(--e-2);
  align-items: center;
}
.moy-labels {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: var(--chasse-etiquette);
  color: var(--encre-tenue);
  margin-bottom: var(--e-2);
}
.moy-result-row { margin-bottom: var(--e-2); }
.moy-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--e-1);
  padding: var(--e-1) var(--e-3);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-plein);
  font-family: var(--police-donnees);
  font-weight: var(--gr-fort);
}

/* --------------------------------------------------------------------------
   21. QUIZ / SIMULATEUR
   -------------------------------------------------------------------------- */
.quiz-container { max-width: 44rem; margin-inline: auto; }

.quiz-screen, .quiz-step {
  padding: var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
}

.quiz-progress { height: var(--trait-fort); background: var(--filet); margin-bottom: var(--e-2); }

/* La barre se met à l'échelle : transform seul, jamais width. */
.quiz-progress-bar {
  height: 100%;
  width: 100%;
  background: var(--encre);
  transform-origin: left center;
  transform: scaleX(0);
  transition: transform var(--duree-micro) var(--courbe-entree);
}

.quiz-progress-texte {
  display: flex;
  justify-content: space-between;
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-tenue);
  margin-bottom: var(--e-4);
}

.quiz-options { display: flex; flex-direction: column; gap: var(--cible-ecart); margin-top: var(--e-4); }

/* Un <label> enveloppant un vrai <input radio> : clavier et lecteurs d'écran
   fonctionnent sans code supplémentaire. */
.quiz-option {
  display: flex;
  align-items: center;
  gap: var(--e-3);
  min-height: var(--cible);
  padding: var(--e-3);
  background: var(--papier);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  cursor: pointer;
  transition: border-color var(--duree-micro) var(--courbe-entree);
}
.quiz-option:hover { border-color: var(--encre); }
.quiz-option input { accent-color: var(--encre); width: 20px; height: 20px; flex: none; }
.quiz-option:has(input:checked) { border-color: var(--encre); border-width: var(--trait-fort); }
.quiz-option:has(input:focus-visible) { outline: var(--focus) solid var(--encre); outline-offset: var(--focus-decalage); }

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--e-3);
  margin-top: var(--e-5);
}
/* À 320 px, les deux boutons côte à côte dépassent : ils passent l'un sous
   l'autre plutôt que de déborder. */
.quiz-actions .btn { flex: 1 1 10rem; min-width: 0; }

.quiz-features { display: grid; gap: var(--e-3); grid-template-columns: 1fr; margin-block: var(--e-4); }

@media (min-width: 40em) {
  .quiz-features { grid-template-columns: repeat(3, 1fr); }
}

.quiz-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  color: var(--encre);
  margin-bottom: var(--e-3);
}

.hidden { display: none !important; }

/* --------------------------------------------------------------------------
   22. PANNEAU DE FILTRES
   -------------------------------------------------------------------------- */
.filtres {
  padding: var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
}

.filtres-grille { display: grid; gap: var(--e-3); grid-template-columns: 1fr; }

@media (min-width: 40em) { .filtres-grille { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64em) { .filtres-grille { grid-template-columns: repeat(4, 1fr); } }

.filtres .form-group { margin-bottom: 0; }

.filtres-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  margin-top: var(--e-4);
  padding-top: var(--e-3);
  border-top: var(--trait) solid var(--filet);
}
.filtres-actions .filiere-status { margin-top: 0; }

/* --------------------------------------------------------------------------
   23. PIED DE PAGE
   -------------------------------------------------------------------------- */
footer {
  margin-top: var(--e-8);
  padding-block: var(--e-6) var(--e-4);
  background: var(--papier-carte);
  border-top: var(--trait) solid var(--encre);
}

.foot-grid { display: grid; gap: var(--e-5); grid-template-columns: 1fr; }

@media (min-width: 48em) {
  .foot-grid { grid-template-columns: 1.3fr repeat(3, 1fr); gap: var(--e-6); }
}

/* Bloc de marque : reprend le verrouillage du logotype — nom lourd condensé,
   descripteur en capitales très espacées. */
.logo {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-size: var(--t-lg);
  font-weight: var(--gr-lourd);
  letter-spacing: var(--chasse-affichage);
  text-transform: uppercase;
  color: var(--encre);
  line-height: 1;
}
.logo a { text-decoration: none; color: inherit; }

.logo-descripteur {
  display: block;
  margin-top: var(--e-2);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
}

/* Marque du pied de page : symbole + logotype, cliquable vers l'accueil. */
.foot-marque {
  display: inline-flex;
  align-items: center;
  gap: var(--e-3);
  min-height: var(--cible);
  color: var(--encre);
  text-decoration: none;
  border-radius: var(--rayon);
}
.foot-symbole { width: 48px; height: 48px; flex: none; }
.foot-marque .logo { display: block; }
.foot-marque:hover .logo { text-decoration: underline; text-underline-offset: 0.2em; }

.foot-col h2 {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  font-weight: var(--gr-moyen);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-2);
}
.foot-col ul { list-style: none; display: flex; flex-direction: column; }
.foot-col a {
  display: inline-flex;
  align-items: center;
  min-height: var(--cible);
  color: var(--encre-douce);
  font-size: var(--t-sm);
  text-decoration: none;
}
.foot-col a:hover { color: var(--encre); text-decoration: underline; text-underline-offset: 3px; }

.foot-bas {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-3);
  margin-top: var(--e-6);
  padding-top: var(--e-4);
  border-top: var(--trait) solid var(--filet);
}

.foot-mono { font-family: var(--police-donnees); font-size: var(--t-xs); color: var(--encre-tenue); }

/* --------------------------------------------------------------------------
   24. BARRIÈRE DE CONFIDENTIALITÉ
   -------------------------------------------------------------------------- */
.privacy-gate {
  position: fixed;
  inset: 0;
  z-index: var(--plan-modale);
  /* Visible par défaut : js/main.js la masque avec .hidden une fois le
     consentement enregistré. L'inverse la rendrait invisible sans JavaScript. */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gouttiere);
  background: rgba(26, 25, 21, 0.45);
}

body.no-scroll { overflow: hidden; }

.privacy-card {
  max-width: 34rem;
  padding: var(--e-5);
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-flottante);
}
.privacy-card p { color: var(--encre-douce); font-size: var(--t-sm); margin-block: var(--e-3); }
.privacy-actions { display: flex; flex-wrap: wrap; gap: var(--e-3); margin-top: var(--e-4); }

/* --------------------------------------------------------------------------
   25. ASSISTANT
   -------------------------------------------------------------------------- */
.assistant-btn {
  position: fixed;
  right: var(--gouttiere);
  bottom: var(--gouttiere);
  z-index: var(--plan-flottant);
  display: inline-flex;
  align-items: center;
  gap: var(--e-2);
  min-height: var(--cible);
  padding: var(--e-2) var(--e-4);
  background: var(--encre);
  color: var(--papier);
  border: none;
  border-radius: var(--rayon-plein);
  font-size: var(--t-sm);
  font-weight: var(--gr-fort);
  cursor: pointer;
  box-shadow: var(--ombre-flottante);
}

/* Mobile : pastille ronde, icône seule, pour masquer le moins de contenu possible.
   Le libellé reste dans le bouton (font-size 0) : les lecteurs d'écran l'annoncent.
   Le pied de page garde une marge basse pour que ses derniers liens restent atteignables. */
@media (max-width: 39.99em) {
  .assistant-btn {
    width: 52px;
    height: 52px;
    padding: 0;
    gap: 0;
    justify-content: center;
    font-size: 0;
  }
  .assistant-btn .ico { width: 22px; height: 22px; }
  footer { padding-bottom: calc(var(--e-4) + 72px); }
}

.assistant-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--plan-panneau);
  display: none;
  flex-direction: column;
  max-height: 85dvh;
  background: var(--papier);
  border-top: var(--trait) solid var(--encre);
}
.assistant-panel.open { display: flex; }

@media (min-width: 40em) {
  .assistant-panel {
    left: auto;
    right: var(--gouttiere);
    bottom: calc(var(--gouttiere) + 60px);
    width: 23rem;
    max-height: 32rem;
    border: var(--trait) solid var(--encre);
    border-radius: var(--rayon);
    box-shadow: var(--ombre-flottante);
  }
  .assistant-panel.expanded { width: 32rem; max-height: 42rem; }
}

.assistant-head {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  padding: var(--e-2) var(--e-3);
  border-bottom: var(--trait) solid var(--filet);
  font-weight: var(--gr-fort);
  font-size: var(--t-sm);
}
.assistant-head-actions { display: flex; gap: var(--e-1); margin-left: auto; }

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--e-3);
  display: flex;
  flex-direction: column;
  gap: var(--e-2);
  font-size: var(--t-sm);
}

.assistant-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cible-ecart);
  padding: var(--e-2) var(--e-3);
  border-top: var(--trait) solid var(--filet);
}
.assistant-suggestions button {
  min-height: 36px;
  padding: var(--e-1) var(--e-3);
  background: none;
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon-plein);
  color: var(--encre-douce);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  cursor: pointer;
}
.assistant-suggestions button:hover { color: var(--encre); border-color: var(--encre); }

.assistant-input-row {
  display: flex;
  gap: var(--e-2);
  padding: var(--e-3);
  border-top: var(--trait) solid var(--filet);
}
.assistant-input-row input {
  flex: 1;
  min-width: 0;
  min-height: var(--cible);
  padding: var(--e-2) var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  font-size: var(--t-base);
}
.assistant-input-row button {
  min-width: var(--cible);
  min-height: var(--cible);
  padding-inline: var(--e-3);
  background: var(--encre);
  color: var(--papier);
  border: none;
  border-radius: var(--rayon);
  font-weight: var(--gr-fort);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   26. UTILITAIRES
   -------------------------------------------------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.pile { display: flex; flex-direction: column; gap: var(--e-3); }
.rangee { display: flex; flex-wrap: wrap; gap: var(--e-3); align-items: center; }
.centre { text-align: center; }
.mt-6 { margin-top: var(--e-6); }

/* --------------------------------------------------------------------------
   27. IMPRESSION — les échéances doivent s'imprimer lisiblement
   -------------------------------------------------------------------------- */
@media print {
  header, footer, .assistant-btn, .assistant-panel, .privacy-gate, #signature {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .echeance { break-inside: avoid; }
}


/* ===== css/composants-js.css ===== */
/* ==========================================================================
   SUNU INFO — COMPOSANTS CONSTRUITS PAR JAVASCRIPT
   Ces classes ne figurent dans aucun fichier HTML : elles sont posées à
   l'exécution par js/main.js, js/quiz.js, js/moyenne-calculateur.js et
   js/suggestions.js. Regroupées ici pour que personne ne les supprime en
   croyant à du code mort.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RÉVÉLATION AU DÉFILEMENT (js/main.js)
   Seule animation d'entrée du site, en transitions CSS. L'observateur ajoute
   .reveal puis .visible ; sans JavaScript, .reveal n'est jamais posée et rien
   n'est masqué.
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--duree-entree) var(--courbe-entree),
    transform var(--duree-entree) var(--courbe-entree);
}
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* --------------------------------------------------------------------------
   2. FILTRE PAR FILIÈRE (js/main.js)
   Rien n'est masqué : les cartes hors périmètre sont atténuées, celles qui
   correspondent sont marquées. Une carte atténuée reste lisible et reste
   accessible au clavier.
   -------------------------------------------------------------------------- */
.card.dimmed {
  opacity: 0.6;
  transition: opacity var(--duree-micro) var(--courbe-entree);
}
.card.dimmed:hover,
.card.dimmed:focus-within { opacity: 1; }

/* La correspondance est signalée par la bordure ET par un mot. */
.card.match-badge { border-color: var(--encre); }
.card.match-badge::after {
  content: 'correspond';
  position: absolute;
  top: var(--e-3);
  right: var(--e-3);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-donnees);
  color: var(--encre-tenue);
}

.pill.cat-hidden,
.card.search-hidden { display: none; }

/* Panneau d'information de filière : masqué tant que JS ne l'a pas rempli. */
#filiereInfoWrap { display: none; }
#filiereInfoWrap.visible { display: block; }

/* --------------------------------------------------------------------------
   3. BOUTON FAVORI (js/main.js)
   -------------------------------------------------------------------------- */
.fav-btn {
  position: absolute;
  top: var(--e-2);
  right: var(--e-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* Cible tactile pleine : 44 px, même si l'icône en fait 18. */
  min-width: var(--cible);
  min-height: var(--cible);
  padding: 0;
  background: none;
  border: var(--trait) solid transparent;
  border-radius: var(--rayon);
  color: var(--encre-tenue);
  font-size: var(--t-lg);
  cursor: pointer;
  transition:
    color var(--duree-micro) var(--courbe-entree),
    border-color var(--duree-micro) var(--courbe-entree);
}
.fav-btn:hover { color: var(--encre); border-color: var(--encre-tenue); }
.fav-btn.active { color: var(--encre); }

/* Le titre de carte laisse la place au bouton favori. */
.card:has(.fav-btn) .card-top { padding-right: var(--cible); }

/* --------------------------------------------------------------------------
   4. RECHERCHE GLOBALE (js/main.js) — superposition Ctrl+K
   -------------------------------------------------------------------------- */
.gs-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--plan-modale);
  display: none;
  justify-content: center;
  align-items: flex-start;
  padding: var(--e-6) var(--gouttiere) var(--e-4);
  background: rgba(26, 25, 21, 0.45);
}
.gs-overlay.open { display: flex; }

.gs-box {
  width: 100%;
  max-width: 38rem;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  box-shadow: var(--ombre-flottante);
  overflow: hidden;
}

.gs-input-row {
  display: flex;
  align-items: center;
  gap: var(--e-2);
  padding: var(--e-3);
  border-bottom: var(--trait) solid var(--filet);
}
.gs-input-row .ico { color: var(--encre-tenue); }

.gs-input {
  flex: 1;
  min-width: 0;
  min-height: var(--cible);
  background: transparent;
  border: none;
  color: var(--encre);
  font-size: var(--t-base);
}
.gs-input:focus { outline: none; }
.gs-input::placeholder { color: var(--encre-tenue); }

.gs-close {
  min-height: 32px;
  padding: var(--e-1) var(--e-2);
  background: none;
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  color: var(--encre-douce);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  cursor: pointer;
}

.gs-results { overflow-y: auto; overscroll-behavior: contain; padding: var(--e-2); }

.gs-item {
  display: block;
  padding: var(--e-2) var(--e-3);
  border: var(--trait) solid transparent;
  border-radius: var(--rayon);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.gs-item:hover,
.gs-item.active { background: var(--papier-carte); border-color: var(--encre); }

.gs-item-title { display: block; font-weight: var(--gr-fort); color: var(--encre); }
.gs-item-desc { display: block; font-size: var(--t-sm); color: var(--encre-douce); }
.gs-item-cat {
  display: inline-block;
  margin-top: var(--e-1);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
}

.gs-empty { padding: var(--e-4); text-align: center; color: var(--encre-douce); font-size: var(--t-sm); }

.gs-hint {
  display: flex;
  flex-wrap: wrap;
  gap: var(--e-3);
  padding: var(--e-2) var(--e-3);
  border-top: var(--trait) solid var(--filet);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-tenue);
}

/* --------------------------------------------------------------------------
   5. ASSISTANT — messages (js/main.js)
   -------------------------------------------------------------------------- */
.assistant-messages .msg {
  max-width: 88%;
  padding: var(--e-2) var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
  color: var(--encre-douce);
}
.assistant-messages .msg a { color: var(--encre); }

.assistant-messages .msg.user {
  align-self: flex-end;
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
}
.assistant-messages .msg.bot { align-self: flex-start; }

/* « L'assistant rédige » : c'est un état de chargement, il a donc le droit
   d'exister — il dit que la réponse arrive. */
.typing-dots { display: inline-flex; gap: var(--e-1); align-items: center; }
.typing-dots span {
  width: 5px;
  height: 5px;
  border-radius: var(--rayon-plein);
  background: var(--encre-tenue);
  animation: respire 1.2s ease-in-out infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes respire {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%           { opacity: 1;   transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .typing-dots span { animation: none; opacity: 0.7; }
}

/* --------------------------------------------------------------------------
   6. QUIZ D'ORIENTATION (js/quiz.js)
   -------------------------------------------------------------------------- */
.quiz-step-label {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-2);
}

.quiz-question {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-size: var(--t-titre-3);
  font-weight: var(--gr-fort);
  line-height: var(--interligne-titre);
  margin-bottom: var(--e-4);
}

.quiz-result-top {
  padding: var(--e-4);
  background: var(--papier);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  margin-bottom: var(--e-4);
}

.quiz-result-alt { display: grid; gap: var(--e-3); grid-template-columns: 1fr; }

@media (min-width: 40em) {
  .quiz-result-alt { grid-template-columns: repeat(2, 1fr); }
}

.quiz-alt-card {
  padding: var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
}

/* --------------------------------------------------------------------------
   7. CALCULATEUR DE MOYENNE (js/moyenne-calculateur.js)
   -------------------------------------------------------------------------- */
.moy-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: var(--e-2);
  align-items: center;
  margin-bottom: var(--e-2);
}

.moy-nom, .moy-note, .moy-credits {
  width: 100%;
  min-width: 0;
  min-height: var(--cible);
  padding: var(--e-2);
  background: var(--papier);
  color: var(--encre);
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  font-size: var(--t-base);
}
.moy-note, .moy-credits {
  font-family: var(--police-donnees);
  font-variant-numeric: tabular-nums;
}

.moy-remove {
  min-width: var(--cible);
  min-height: var(--cible);
  background: none;
  border: var(--trait) solid var(--encre-tenue);
  border-radius: var(--rayon);
  color: var(--encre-douce);
  cursor: pointer;
}
.moy-remove:hover { color: var(--urgence); border-color: var(--urgence); }

/* Admis / non admis : la couleur ne fait que doubler le mot et l'icône. */
.moy-badge.pass { border-color: var(--encre); color: var(--encre); }
.moy-badge.fail { border-color: var(--urgence); color: var(--urgence); }

/* --------------------------------------------------------------------------
   Texte découpé en mots par js/animations.js.
   Le masque déborde de 0,15 em en haut et en bas : les accents des
   capitales (À, É) et les jambages ne sont jamais rognés.
   -------------------------------------------------------------------------- */
.mot {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
  padding-block: 0.15em;
  margin-block: -0.15em;
}
.mot-in { display: inline-block; will-change: transform; }

/* Garde posée dans <head> ; retirée par js/animations.js (ou après 1 s au plus).
   visibility plutôt que display : la place reste réservée, aucun décalage. */
.js-anim main h1,
.js-anim .hero .eyebrow,
.js-anim .hero .lead,
.js-anim .hero-recherche,
.js-anim .hero .cta-row,
.js-anim .hero-stats { visibility: hidden; }


/* --------------------------------------------------------------------------
   8. ESPACE PERSONNEL (js/profil.js) — profil.html
   Même registre que le reste : filets, encre, aucune couleur sauf --urgence
   pour ce qui est irréversible ou en erreur.
   -------------------------------------------------------------------------- */
.espace-panneau[hidden], .btn[hidden], .etat-vide[hidden], .doc-outils[hidden],
.note[hidden], .message[hidden], .card[hidden], .squelette[hidden], #profilApp[hidden], #profilChargement[hidden] { display: none; }

.espace-entete {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--e-3);
  padding-bottom: var(--e-4);
  border-bottom: var(--trait) solid var(--filet);
}
.espace-identite { flex: 1 1 12rem; min-width: 0; }
.espace-nom {
  font-family: var(--police-affichage);
  font-variation-settings: var(--largeur-affichage);
  font-weight: var(--gr-lourd);
  font-size: var(--t-lg);
  line-height: var(--interligne-titre);
  overflow-wrap: anywhere;
}
.espace-email { font-family: var(--police-donnees); font-size: var(--t-xs); color: var(--encre-tenue); overflow-wrap: anywhere; }

.avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-plein);
  background: var(--papier-carte);
  font-family: var(--police-affichage);
  font-weight: var(--gr-lourd);
  font-size: var(--t-md);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-grand { width: 88px; height: 88px; font-size: var(--t-titre-3); }
.avatar-rangee { display: flex; align-items: center; flex-wrap: wrap; gap: var(--e-4); margin-bottom: var(--e-4); }

/* Onglets : même dessin que .cat-tab, défilent horizontalement sur mobile. */
.espace-onglets {
  display: flex;
  gap: var(--e-4);
  margin-block: var(--e-4);
  border-bottom: var(--trait) solid var(--filet);
  overflow-x: auto;
  scrollbar-width: none;
}
.espace-onglets::-webkit-scrollbar { display: none; }
.espace-onglets .cat-tab { flex: none; white-space: nowrap; font-size: var(--t-sm); }
.compteur { font-weight: var(--gr-moyen); color: var(--encre-tenue); }

.espace-panneau { padding-block: var(--e-2) var(--e-4); }
.espace-panneau:focus-visible { outline: var(--focus) solid var(--encre); outline-offset: 4px; }
.panneau-tete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--e-3);
  margin-bottom: var(--e-3);
}
.panneau-tete h2 { font-size: var(--t-titre-3); }
.panneau-sous { margin-top: calc(-1 * var(--e-2)); margin-bottom: var(--e-4); max-width: var(--largeur-lecture); }

/* Messages : icône + texte, jamais la couleur seule. */
.message {
  display: flex;
  align-items: flex-start;
  gap: var(--e-2);
  margin-bottom: var(--e-4);
  padding: var(--e-3) var(--e-4);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-left: var(--trait-fort) solid var(--encre);
  border-radius: 0 var(--rayon) var(--rayon) 0;
  font-size: var(--t-sm);
  color: var(--encre-douce);
}
.message:empty { display: none; }
.message.erreur { border-left-color: var(--urgence); color: var(--urgence); font-weight: var(--gr-moyen); }
.message .ico { flex: none; margin-top: 0.15em; }

/* Informations en lecture */
.infos { display: grid; grid-template-columns: 1fr; gap: 0 var(--e-5); }
.infos > div { padding-block: var(--e-3); border-bottom: var(--trait) solid var(--filet); min-width: 0; }
.infos dt {
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  letter-spacing: var(--chasse-etiquette);
  text-transform: uppercase;
  color: var(--encre-tenue);
  margin-bottom: var(--e-1);
}
.infos dd { overflow-wrap: anywhere; }
.infos dd.vide { color: var(--encre-tenue); font-style: italic; }

.grille-form { display: grid; grid-template-columns: 1fr; gap: 0 var(--e-4); }
.form-etroit { max-width: 32rem; }

@media (min-width: 48em) {
  .infos, .grille-form { grid-template-columns: 1fr 1fr; }
  .infos .large, .grille-form .large { grid-column: 1 / -1; }
}

/* Champ de fichier caché : l'étiquette-bouton porte le focus visible. */
label.btn:has(+ input[type="file"]:focus-visible) { outline: var(--focus) solid var(--encre); outline-offset: 2px; }

/* Documents et favoris */
.doc-outils { display: flex; flex-wrap: wrap; gap: var(--e-3); margin-bottom: var(--e-4); }
.doc-outils .champ { flex: 1 1 14rem; width: auto; }
.doc-outils select.champ { flex: 0 1 12rem; }

.doc-liste { list-style: none; display: flex; flex-direction: column; gap: var(--e-2); }
.doc-ligne {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: var(--e-2) var(--e-3);
  padding: var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
}
.doc-type {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  font-weight: var(--gr-fort);
}
.doc-principal { min-width: 0; }
.doc-nom { font-weight: var(--gr-fort); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-nom a { color: var(--encre); }
.doc-meta { display: flex; flex-wrap: wrap; gap: 0 var(--e-3); font-family: var(--police-donnees); font-size: var(--t-xs); color: var(--encre-tenue); }
.doc-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--e-2); }
.doc-actions .btn { flex: 1 1 auto; }

@media (min-width: 40em) {
  .doc-ligne { grid-template-columns: auto 1fr auto; }
  .doc-actions { grid-column: auto; }
  .doc-actions .btn { flex: none; }
}

.quota { max-width: 32rem; margin-bottom: var(--e-4); }
.quota .champ-aide { margin-bottom: var(--e-1); }
.quota[hidden] { display: none; }

.envoi-progression { font-family: var(--police-donnees); font-size: var(--t-xs); color: var(--encre-tenue); margin-bottom: var(--e-3); }
.envoi-progression:empty { display: none; }

.etat-vide {
  padding: var(--e-5) var(--e-4);
  border: var(--trait) dashed var(--encre-tenue);
  border-radius: var(--rayon);
  text-align: center;
}
.etat-vide > .ico { width: 28px; height: 28px; margin-bottom: var(--e-2); }
.etat-vide h3 { font-size: var(--t-lg); margin-bottom: var(--e-2); }
.etat-vide p { color: var(--encre-douce); font-size: var(--t-sm); max-width: 44ch; margin: 0 auto var(--e-3); }

/* Historique de l'assistant */
.historique { list-style: none; display: flex; flex-direction: column; gap: var(--e-2); }
.historique li {
  padding: var(--e-3);
  background: var(--papier-carte);
  border: var(--trait) solid var(--filet);
  border-radius: var(--rayon);
  font-size: var(--t-sm);
  color: var(--encre-douce);
  overflow-wrap: anywhere;
}
.historique li.toi { border-left: var(--trait-fort) solid var(--encre); color: var(--encre); }
.historique .qui { display: block; font-family: var(--police-donnees); font-size: var(--t-xs); color: var(--encre-tenue); margin-bottom: var(--e-1); }

/* Mot de passe */
.mdp-champ { position: relative; }
.mdp-champ input { padding-right: 6.5rem; }
.mdp-voir {
  position: absolute;
  top: 50%;
  right: var(--e-1);
  transform: translateY(-50%);
  min-height: 36px;
  padding: 0 var(--e-2);
  background: none;
  border: none;
  border-radius: var(--rayon);
  font-family: var(--police-donnees);
  font-size: var(--t-xs);
  color: var(--encre-douce);
  cursor: pointer;
}
.mdp-voir:hover { color: var(--encre); background: var(--voile); }
.mdp-jauge { height: 4px; background: var(--filet); border-radius: var(--rayon-plein); overflow: hidden; }
.mdp-jauge span { display: block; height: 100%; width: 0; background: var(--encre); transition: width var(--duree-micro) var(--courbe-entree); }
.mdp-regles { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: var(--e-1) var(--e-3); font-size: var(--t-xs); color: var(--encre-tenue); }
.mdp-regles li::before { content: '○'; display: inline-block; width: 1.4em; font-family: var(--police-donnees); }
.mdp-regles li.ok { color: var(--encre); }
.mdp-regles li.ok::before { content: '✓'; }

/* Zone irréversible : la seule utilisation de --urgence hors erreur de saisie. */
.zone-suppression {
  margin-top: var(--e-6);
  padding: var(--e-4);
  border: var(--trait) solid var(--urgence);
  border-radius: var(--rayon);
}
.zone-suppression h2 { font-size: var(--t-lg); margin-bottom: var(--e-2); }
.zone-suppression > p { color: var(--encre-douce); font-size: var(--t-sm); margin-bottom: var(--e-4); max-width: var(--largeur-lecture); }
.btn-danger { border-color: var(--urgence); color: var(--urgence); }
.btn-danger:hover { background: var(--urgence); color: #fff; }

/* Fenêtre de confirmation */
.confirmation {
  width: calc(100% - 2 * var(--gouttiere));
  max-width: 26rem;
  margin: auto;
  padding: var(--e-5);
  background: var(--papier-carte);
  color: var(--encre);
  border: var(--trait) solid var(--encre);
  border-radius: var(--rayon-carte);
  box-shadow: var(--ombre-carte-haute);
}
.confirmation::backdrop { background: rgba(26, 25, 21, 0.45); }
.confirmation h2 { font-size: var(--t-titre-3); margin-bottom: var(--e-2); }
.confirmation p { color: var(--encre-douce); margin-bottom: var(--e-4); overflow-wrap: anywhere; }
