/* Bornalier
   Idée directrice : la ligne frontière des cartes (trait-point magenta) sert de fil conducteur.
   Elle relie les étapes du parcours, longe le texte des fiches et sépare « côté France » et « côté Suisse ».
   Tout le reste reste calme : papier froid, encre bleutée, une seule couleur vive. */

:root {
  --papier: #f6f8f7;
  --papier-fort: #ffffff;
  --encre: #1b2531;
  --encre-douce: #4a5563;
  --frontiere: #a3336e;
  --lac: #23688a;
  --lac-pale: #e7f0f4;
  --trait: #d5dcd8;

  --titres: "Avenir Next", Avenir, "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  --texte: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;

  --mesure: 66ch;
  --largeur: 72rem;  /* la grille commune : en-tête, contenu et pied s'alignent sur ce conteneur */
  --lac-fonce: #1b5470;
  --alerte-fond: #fff4d6;
  --alerte-trait: #ecd9a0;
  --alerte-encre: #5c4400;
  --frontiere-clair: #f1c6dc;               /* magenta lisible sur fond encre (bandeau) */

  /* Rôles des couleurs (une couleur = un sens) :
     magenta (--frontiere) = la frontière, la position dans le parcours et le temps (dates, échéances, dépassements) ;
     bleu lac (--lac)      = ce qu'on peut faire : liens, boutons, outils, titres de section ;
     encre                 = le texte, le focus clavier ; papier = les fonds. */

  --arrondi: 3px;          /* encadrés, boutons, champs, cases de la carte */
  --arrondi-pilule: 999px; /* puces (sommaire, filtres) */
  --encadre-pad: 1.25rem 1.4rem;
  --duree: 0.15s;          /* micro-interactions */
  --duree-longue: 0.25s;   /* barres de progression */
  --marge: clamp(1.25rem, 5vw, 3rem);
  --bord: max(var(--marge), calc((100% - var(--largeur)) / 2));

  /* La ligne frontière : tiret long, blanc, point, blanc. */
  --ligne-v: repeating-linear-gradient(
    to bottom,
    var(--frontiere) 0 14px, transparent 14px 20px,
    var(--frontiere) 20px 23px, transparent 23px 29px
  );
  --ligne-h: repeating-linear-gradient(
    to right,
    var(--frontiere) 0 14px, transparent 14px 20px,
    var(--frontiere) 20px 23px, transparent 23px 29px
  );
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--texte);
  font-size: 1.1875rem;
  line-height: 1.65;
  font-kerning: normal;
  hyphens: auto;
}

h1, h2, h3, .marque, .entete__nav, .fiche__etape, .fiche__verif, .frontiere__titre,
.suite, .pied, .bandeau-brouillon, .evitement, .offre__mention, .offre__lien {
  font-family: var(--titres);
  hyphens: manual;
}

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { color: var(--encre); }
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 2.9rem); font-weight: 700; letter-spacing: -0.015em; margin: 0 0 0.6em; }
/* Deux niveaux qu'on distingue d'un coup d'œil : la partie (grande, bleue) et le point dans la partie (petit, encre). */
h2 { font-size: clamp(1.75rem, 1.45rem + 1vw, 2.05rem); font-weight: 700; letter-spacing: -0.01em; margin: 2.2em 0 0.6em; color: var(--lac); }
h3 { font-size: 1.2rem; font-weight: 700; margin: 1.8em 0 0.35em; color: var(--encre); }

p, ul, ol, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; }
li + li { margin-top: 0.45em; }
p { margin-bottom: 1.1em; }
strong { font-weight: 700; }

a { color: var(--lac); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

/* Boutons : un seul composant (cible de 44 px au moins).
   .bouton = action principale (fond bleu lac) ; .bouton--grand = sur l'accueil ;
   .bouton--discret = action secondaire, présentée comme un lien ; .lien-fort = lien d'action à côté d'un bouton. */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.6rem 1.2rem;
  font-family: var(--titres); font-size: 1rem; font-weight: 600; line-height: 1.2; cursor: pointer; hyphens: manual;
  background: var(--lac); color: var(--papier-fort); border: 0; border-radius: var(--arrondi); text-decoration: none;
  transition: background-color var(--duree) ease-out, transform 0.1s ease-out;
}
.bouton:hover { background: var(--lac-fonce); }
.bouton:active { transform: scale(0.97); }
.bouton--grand { min-height: 3rem; padding: 0.7rem 1.35rem; font-size: 1.05rem; }
.bouton--discret { background: transparent; color: var(--lac); padding: 0.3rem 0; text-decoration: underline; text-underline-offset: 0.18em; font-weight: 500; font-size: 0.95rem; }
.bouton--discret:hover { background: transparent; color: var(--encre); }
.lien-fort { display: inline-flex; align-items: center; min-height: 3rem; font-family: var(--titres); font-weight: 600; font-size: 1.05rem; color: var(--lac); hyphens: manual; }
:focus-visible { outline: 3px solid var(--encre); outline-offset: 3px; border-radius: 2px; }
.bandeau :focus-visible { outline-color: var(--papier-fort); }

.evitement {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--encre); color: var(--papier-fort);
  padding: 0.5rem 0.9rem; z-index: 10;
}
.evitement:focus { top: 1rem; }

/* En-tête -------------------------------------------------------------- */

.entete {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem;
  padding: 1.1rem var(--bord);
  border-bottom: 1px solid var(--trait);
  background: var(--papier-fort);
}

.marque {
  display: inline-flex; align-items: center; gap: 0.7rem;
  color: var(--encre); text-decoration: none;
  font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em;
}
.marque__nom span { font-weight: 400; }
.marque__trait { width: 2.5rem; height: 0.5rem; }
.marque__trait line { stroke: var(--frontiere); stroke-width: 3; stroke-dasharray: 9 4 2 4; }

.entete { position: relative; }
.entete__nav { display: flex; align-items: center; gap: 1.5rem; font-size: 0.95rem; }
.entete__nav > a, .menu__bouton { color: var(--encre-douce); text-decoration: none; padding-block: 0.65rem; }
.entete__nav > a:hover, .entete__nav > a[aria-current], .menu__bouton:hover, .menu__bouton.est-courant, .menu__bouton[aria-expanded="true"] {
  color: var(--encre); box-shadow: inset 0 -2px 0 var(--frontiere);
}

/* Menu « Le guide » : un bouton qui ouvre, sous l'en-tête, toutes les pages rangées par thème.
   Sans JavaScript, le bouton reste un lien vers la page /guide/, qui montre la même liste. */
.menu__bouton {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: inherit; font-family: var(--titres); background: none; border: 0; border-radius: 0; cursor: pointer;
}
.menu__bouton svg { width: 0.7rem; height: 0.7rem; transition: transform var(--duree) ease-out; }
.menu__bouton[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 30;
  padding: 1.6rem var(--bord) 1.2rem;
  background: var(--papier-fort); border-bottom: 1px solid var(--trait);
  box-shadow: 0 18px 30px -12px rgb(27 37 49 / 0.18);
  max-height: calc(100vh - 7rem); overflow-y: auto; overscroll-behavior: contain;
  font-size: 1rem;
}
.menu:not([hidden]) { animation: menu-ouvre var(--duree-longue) ease-out; }
@keyframes menu-ouvre { from { opacity: 0; transform: translateY(-0.5rem); } }
.menu__pied {
  display: flex; flex-wrap: wrap; gap: 0.2rem 2rem; margin: 1.4rem 0 0; padding-top: 0.6rem;
  border-top: 1px solid var(--trait); font-family: var(--titres); font-weight: 600;
}
.menu__pied a { display: inline-flex; align-items: center; min-height: 2.75rem; }

/* Liste par thème (dans le menu et sur la page /guide/) */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr)); gap: 1.6rem 2.5rem; }
.theme__nom {
  font-family: var(--titres); font-weight: 700; font-size: 1rem; color: var(--encre);
  margin: 0 0 0.3rem; padding-bottom: 0.45rem; border-bottom: 2px solid var(--encre);
}
.theme__liste, .theme__articles { list-style: none; padding: 0; margin: 0; }
.theme__liste li, .theme__articles li { margin: 0; }
.theme__liste a { font-family: var(--titres); line-height: 1.3; text-decoration: none; color: var(--lac); hyphens: manual; }
.theme__liste a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
.theme__liste a[aria-current="page"] { color: var(--encre); font-weight: 700; }
.theme__fiche { display: flex; align-items: center; min-height: 2.6rem; font-weight: 600; }
.theme__articles { margin: -0.15rem 0 0.35rem 0.15rem; padding-left: 0.85rem; border-left: 2px solid var(--trait); }
.theme__articles a { display: flex; align-items: center; min-height: 2.3rem; font-size: 0.95rem; }

/* Page /guide/ */
.plan { max-width: var(--largeur); margin: 0 auto; }
.plan .themes { margin-top: 2.2rem; }
.plan .theme__nom { font-size: 1.25rem; }

.bandeau-brouillon {
  margin: 0; padding: 0.7rem var(--bord);
  background: var(--alerte-fond); color: var(--alerte-encre); font-size: 0.9rem;
  border-bottom: 1px solid var(--alerte-trait);
}

main { padding: clamp(2rem, 6vw, 4.5rem) var(--marge) 4rem; }

/* Accueil -------------------------------------------------------------- */
/* Direction A : la carte des cantons en premier écran, le parcours posé sur la ligne frontière. */

.accueil { max-width: var(--largeur); margin: 0 auto; }

.accueil-heros { display: grid; gap: 2rem 3.5rem; align-items: start; margin-bottom: clamp(3.5rem, 8vw, 6rem); }
@media (min-width: 64rem) {
  .accueil-heros { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .accueil-heros__texte { position: sticky; top: 2rem; padding-top: 0.5rem; }
}
.accueil-titre { font-size: clamp(2rem, 1.3rem + 2.2vw, 2.9rem); letter-spacing: -0.025em; line-height: 1.08; margin: 0 0 0.5em; }
.accueil-intro { font-size: 1.2rem; color: var(--encre-douce); margin-bottom: 1.8rem; }
.accueil-confiance { font-family: var(--titres); font-size: 0.92rem; color: var(--encre-douce); max-width: 34em; margin: 0; }

/* La carte en tête : sur fond blanc, l'explication dessous. */
.accueil-heros__carte .carte { margin: 0; padding: clamp(1rem, 3vw, 1.8rem); }
.accueil-heros__carte .carte__titre { font-size: 1.35rem; color: var(--encre); margin-bottom: 0.2rem; }
.accueil-heros__carte .carte__consigne { font-size: 1rem; margin-bottom: 1.2rem; }
.accueil-heros__carte .carte__corps { grid-template-columns: 1fr; gap: 1.2rem; }
.accueil-heros__carte .carte__legende { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }
.accueil-heros__carte .carte__fiche { border-width: 4px 0 0; border-radius: 0; background: var(--papier); }
.accueil-heros__carte .carte__fiche--accord { border-top-color: var(--lac); }
.accueil-heros__carte .carte__fiche--geneve, .accueil-heros__carte .carte__fiche--autres { border-top-color: var(--encre); }
@media (max-width: 40rem) {
  .accueil-heros__carte .carte { margin-inline: calc(-1 * var(--marge)); border-inline: 0; border-radius: 0; }
  .accueil-heros__carte .carte__grille { margin-inline: calc(-1 * clamp(1rem, 3vw, 1.8rem) + 0.35rem); }
}

.accueil-section { margin-bottom: clamp(3.5rem, 8vw, 6rem); scroll-margin-top: 1.5rem; }
/* Page 404 : le parcours complet, pour repartir. */
.introuvable { padding-top: clamp(1rem, 4vw, 3rem); }
.introuvable__titre { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem); max-width: 20ch; hyphens: manual; }
.introuvable .etapes { margin-block: 2rem 2.5rem; }
.titre-section { font-size: clamp(1.45rem, 1.15rem + 1.1vw, 1.9rem); color: var(--encre); margin: 0 0 1.4rem; }

/* Actions de l'accueil. */
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.6rem; margin: 0 0 1.4rem; }

/* Les étapes : des bornes posées sur la ligne frontière ; toute l'étape est cliquable. */
.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; position: relative; }
.etapes li { margin: 0; }
.etapes::before { content: ""; position: absolute; left: 1.05rem; top: 1rem; bottom: 1rem; width: 3px; background: var(--ligne-v); }
.etape { position: relative; display: grid; gap: 0.15rem; min-height: 3rem; padding: 0.2rem 0 0.9rem 3.6rem; color: var(--encre); text-decoration: none; }
.etape__num {
  position: absolute; left: 0; top: 0; width: 2.4rem; height: 2.4rem; display: grid; place-items: center;
  background: var(--papier); border: 2px solid var(--frontiere); color: var(--frontiere);
  font-family: var(--titres); font-weight: 700; transition: background-color 0.15s ease-out, color 0.15s ease-out;
}
.etape__titre { font-family: var(--titres); font-weight: 600; font-size: 1.2rem; line-height: 1.3; hyphens: manual; }
.etape__quand { font-family: var(--titres); font-size: 0.92rem; color: var(--encre-douce); }
.etape:hover .etape__titre { color: var(--lac); text-decoration: underline; text-underline-offset: 0.18em; }
.etape:hover .etape__num { background: var(--frontiere); color: var(--papier-fort); }
@media (min-width: 56rem) {
  .etapes { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1.5rem; }
  .etapes::before { left: 1.2rem; right: calc((100% - 6rem) / 5 - 1.2rem); top: 1.05rem; bottom: auto; width: auto; height: 3px; background: var(--ligne-h); }
  .etape { padding: 3.4rem 0 0; }
}

/* Les rendez-vous de l'année : la date d'abord, comme un agenda. */
.rdv { list-style: none; padding: 0; margin: 0; display: grid; gap: 0 3rem; border-top: 1px solid var(--trait); }
@media (min-width: 56rem) { .rdv { grid-template-columns: 1fr 1fr; } }
.rdv li { margin: 0; display: grid; grid-template-columns: 9.5rem 1fr; gap: 0.1rem 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--trait); }
.rdv__quand { grid-row: span 2; font-family: var(--titres); font-weight: 600; font-size: 0.92rem; color: var(--frontiere); padding-top: 0.15rem; }
.rdv__titre { font-family: var(--titres); font-weight: 600; font-size: 1.08rem; color: var(--encre); hyphens: manual; }
.rdv__resume { font-size: 0.98rem; color: var(--encre-douce); line-height: 1.5; }
@media (max-width: 30rem) { .rdv li { grid-template-columns: 1fr; } .rdv__quand { grid-row: auto; } }
.accueil-faq { font-family: var(--titres); font-weight: 600; margin: 1.8rem 0 0; }

/* Méthode : trois garanties, sous un trait d'encre. */
.methode { padding-top: 2rem; border-top: 3px solid var(--encre); }
.methode__colonnes { display: grid; gap: 0.5rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); font-size: 1.02rem; }
.methode strong { font-family: var(--titres); display: block; margin-bottom: 0.15rem; }
.methode__lien { font-size: 1rem; color: var(--encre-douce); margin: 0.4rem 0 0; }

/* Fiches --------------------------------------------------------------- */

.fiche { max-width: calc(var(--mesure) + 4rem); margin: 0 auto; }

.fiche__etape { font-size: 0.95rem; font-weight: 600; color: var(--frontiere); margin: 0 0 0.6rem; }
.chapo { font-size: 1.3rem; color: var(--encre-douce); margin-bottom: 1.2rem; }
.fiche__verif { font-size: 0.92rem; color: var(--encre-douce); margin: 0; }
.fiche__verif time { color: var(--encre); font-weight: 600; }

.fiche__tete { padding-bottom: 2rem; margin-bottom: 2.5rem; position: relative; }
.fiche__tete::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--ligne-h); }

/* Le corps du texte longe la frontière ; chaque intertitre y pose une borne. */
.fiche__corps { position: relative; padding-left: 2.25rem; }
.fiche__corps::before {
  content: ""; position: absolute; left: 0; top: 0.4rem; bottom: 0; width: 3px;
  background: var(--ligne-v); opacity: 0.55;
}
.fiche__corps h2 { position: relative; }
.fiche__corps h2::before {
  content: ""; position: absolute; left: calc(-2.25rem - 5px); top: 0.3em;
  width: 13px; height: 13px; background: var(--papier); border: 3px solid var(--frontiere);
}
/* Changement de partie : un grand blanc et un trait qui part de la ligne frontière,
   la borne descend au niveau du titre. Pas de trait avant la première partie. */
.fiche__corps h2:not(:first-child) { margin-top: 3.6rem; padding-top: 2.4rem; }
.fiche__corps h2:not(:first-child)::before { top: calc(2.4rem + 0.3em); }
.fiche__corps h2:not(:first-child)::after {
  content: ""; position: absolute; top: 0; left: -2.25rem; right: 0; height: 2px; background: var(--trait);
}
.fiche__corps > *:first-child { margin-top: 0; }

.fiche__corps table { width: 100%; border-collapse: collapse; font-size: 1rem; line-height: 1.45; }
.fiche__corps th, .fiche__corps td { text-align: left; vertical-align: top; padding: 0.6rem 0.75rem 0.6rem 0; border-bottom: 1px solid var(--trait); }
.fiche__corps th { font-family: var(--titres); font-weight: 600; font-size: 0.92rem; color: var(--encre-douce); }
.tableau { overflow-x: auto; margin-bottom: 1.2rem; }
/* Sur mobile, un tableau large (plus de 4 colonnes) devient une fiche par ligne :
   la première cellule sert de titre, les autres affichent le titre de leur colonne (data-label). */
@media (max-width: 40rem) {
  .tableau--fiches table, .tableau--fiches tbody, .tableau--fiches tr, .tableau--fiches td { display: block; }
  .tableau--fiches thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tableau--fiches tr { background: var(--papier-fort); border: 1px solid var(--trait); border-radius: var(--arrondi); padding: 0.3rem 1rem 0.5rem; margin-bottom: 0.8rem; }
  .tableau--fiches td { display: grid; grid-template-columns: minmax(0, 9.5rem) minmax(0, 1fr); gap: 0.8rem; padding: 0.5rem 0; }
  .tableau--fiches td::before { content: attr(data-label); font-family: var(--titres); font-weight: 600; font-size: 0.88rem; color: var(--encre-douce); }
  .tableau--fiches td:first-child { display: block; font-family: var(--titres); font-weight: 700; font-size: 1.08rem; }
  .tableau--fiches td:first-child::before { content: none; }
  .tableau--fiches td:last-child { border-bottom: 0; }
}

/* Encadrés : un seul modèle, décliné en trois usages.
   - Bloc : fond blanc, filet gris, petit arrondi (outils, liste à cocher, courbe, encarts).
   - Bloc avec accent haut (4 px) : la réponse ou la synthèse (« L'essentiel », explication de la carte).
   - Renvoi : bloc avec accent à gauche, cliquable en entier (« Article détaillé »).
   - Note : fond bleu pâle, accent à gauche, sans filet ni arrondi (résultat d'un calcul). */
.bref, .outil, .convertisseur, .courbe, .a-cocher, .carte__fiche, .offre, .detail, .accueil-heros__carte .carte {
  background: var(--papier-fort); border: 1px solid var(--trait); border-radius: var(--arrondi);
}
.outil__resultat, .convertisseur__resultat {
  display: block; font-size: 1.05rem; line-height: 1.5; padding: 0.8rem 1rem;
  background: var(--lac-pale); border-left: 4px solid var(--lac);
}

/* Côté France / côté Suisse, séparés par la ligne frontière. */
.frontiere {
  display: grid; grid-template-columns: 1fr 3px 1fr; gap: 0 1.6rem;
  margin: 1.8rem 0;
}
.frontiere::before {
  content: ""; grid-column: 2; grid-row: 1; background: var(--ligne-v);
}
.frontiere__cote:first-child { grid-column: 1; grid-row: 1; }
.frontiere__cote:last-child { grid-column: 3; grid-row: 1; }
.frontiere__titre { font-weight: 600; font-size: 1rem; margin-bottom: 0.4rem; }
.frontiere__cote > :last-child { margin-bottom: 0; }

/* Deux cas dans le texte : deux cartes face à face, de part et d'autre de la ligne frontière,
   avec une borne au niveau des titres. (L'outil d'estimation garde la forme simple ci-dessus.) */
.frontiere:not(.frontiere--outil) { grid-template-columns: 1fr 13px 1fr; gap: 0 0.9rem; }
.frontiere:not(.frontiere--outil)::before { justify-self: center; width: 3px; }
.frontiere:not(.frontiere--outil)::after {
  content: ""; grid-column: 2; grid-row: 1; align-self: start; margin-top: 1.05rem;
  width: 13px; height: 13px; background: var(--papier); border: 3px solid var(--frontiere);
}
.frontiere:not(.frontiere--outil) > .frontiere__cote {
  background: var(--papier-fort); border: 1px solid var(--trait); border-radius: var(--arrondi);
  padding: 0 1.25rem 1.15rem;
}
.frontiere:not(.frontiere--outil) .frontiere__titre {
  margin: 0 -1.25rem 1rem; padding: 0.8rem 1.25rem;
  background: var(--lac-pale); border-bottom: 1px solid var(--trait);
  color: var(--lac-fonce); font-weight: 700; font-size: 1.05rem; line-height: 1.3;
}
.frontiere:not(.frontiere--outil) .frontiere__cote p { margin-bottom: 0.75em; }
.frontiere:not(.frontiere--outil) .frontiere__cote > :last-child { margin-bottom: 0; }

@media (max-width: 40rem) {
  .frontiere { grid-template-columns: 1fr; gap: 1.2rem; }
  .frontiere::before { grid-column: 1; grid-row: 2; height: 3px; background: var(--ligne-h); }
  .frontiere__cote:first-child { grid-column: 1; grid-row: 1; }
  .frontiere__cote:last-child { grid-column: 1; grid-row: 3; }
  .frontiere:not(.frontiere--outil) { grid-template-columns: 1fr; gap: 0.9rem 0; }
  .frontiere:not(.frontiere--outil)::before { width: auto; justify-self: stretch; align-self: center; }
  .frontiere:not(.frontiere--outil)::after { grid-column: 1; grid-row: 2; justify-self: center; align-self: center; margin-top: 0; }
  .suite__prochaine { padding: 1.1rem 1.1rem; column-gap: 0.9rem; }
  .suite__num { width: 2.6rem; height: 2.6rem; font-size: 1.1rem; }
  .fiche__corps { padding-left: 1.4rem; }
  .fiche__corps h2::before { left: calc(-1.4rem - 5px); }
  .fiche__corps h2:not(:first-child) { margin-top: 2.8rem; padding-top: 1.9rem; }
  .fiche__corps h2:not(:first-child)::before { top: calc(1.9rem + 0.3em); }
  .fiche__corps h2:not(:first-child)::after { left: -1.4rem; }
}

/* Encart d'offre affiliée (masqué tant qu'aucun programme n'est actif). */
.offre { padding: var(--encadre-pad); margin: 2rem 0; }
.offre__mention { font-size: 0.82rem; color: var(--encre-douce); margin-bottom: 0.4rem; }
.offre__titre { font-family: var(--titres); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.4rem; }
.offre__lien {
  display: inline-block; background: var(--lac); color: var(--papier-fort); text-decoration: none;
  padding: 0.6rem 1.1rem; font-weight: 600; font-size: 1rem;
}
.offre__lien:hover { background: var(--lac-fonce); }
.offre__note { font-size: 0.85rem; color: var(--encre-douce); margin: 0.8rem 0 0; }

.a-verifier { background: var(--alerte-fond); padding: 0 0.2em; }

.sources { margin-top: 3.5rem; font-size: 0.95rem; }
.sources h2 { font-size: 1.15rem; margin-top: 0; }
.sources li { overflow-wrap: anywhere; }

.avertissement { font-size: 0.95rem; color: var(--encre-douce); border-top: 1px solid var(--trait); padding-top: 1.2rem; margin-top: 2.5rem; }

/* La suite du parcours : un grand bloc cliquable, avec le numéro de l'étape comme sur l'accueil. */
.suite { display: grid; gap: 1rem; margin-top: 2.5rem; }
.suite__prochaine {
  position: relative; display: grid; grid-template-columns: auto 1fr; column-gap: 1.1rem; align-items: center;
  padding: 1.3rem 1.5rem; text-decoration: none; color: var(--encre);
  background: var(--papier-fort); border: 2px solid var(--lac); border-radius: var(--arrondi);
  transition: background-color var(--duree) ease-out;
}
.suite__prochaine:hover { background: var(--lac-pale); }
.suite__num {
  grid-row: span 2; width: 3rem; height: 3rem; display: grid; place-items: center;
  border: 2px solid var(--frontiere); border-radius: 50%; color: var(--frontiere); background: var(--papier);
  font-family: var(--titres); font-weight: 700; font-size: 1.25rem;
  transition: background-color var(--duree) ease-out, color var(--duree) ease-out;
}
.suite__prochaine:hover .suite__num { background: var(--frontiere); color: var(--papier-fort); }
.suite__label { font-size: 0.92rem; font-weight: 600; color: var(--frontiere); }
.suite__titre { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.4rem); font-weight: 700; line-height: 1.25; color: var(--lac); text-wrap: balance; }
.suite__prochaine:hover .suite__titre { text-decoration: underline; text-underline-offset: 0.18em; }
.suite__avant { font-size: 0.95rem; color: var(--encre-douce); }

/* Pied de page --------------------------------------------------------- */

.pied { border-top: 1px solid var(--trait); padding: 2.5rem var(--bord) 3rem; font-size: 0.92rem; color: var(--encre-douce); background: var(--papier-fort); }
.pied__principe { max-width: 46em; margin-bottom: 1.2rem; }
.pied__liens { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.5rem; margin: 0 0 1.2rem; }
.pied__liens li + li { margin-top: 0; }
.pied__liens a { color: var(--encre); }
.pied__copie { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
  .entete__nav, .pied nav, .suite, .offre { display: none; }
  body { background: #fff; font-size: 11pt; }
}

.visuellement-cache {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* Convertisseur CHF ↔ EUR : les deux montants de part et d'autre de la ligne frontière. */
.convertisseur { padding: var(--encadre-pad); margin: 1.2rem 0 2rem; }
.convertisseur__titre { font-family: var(--titres); font-weight: 600; font-size: 1.05rem; margin: 0 0 0.9rem; }
.convertisseur__champs { display: grid; grid-template-columns: minmax(0, 1fr) 3px minmax(0, 1fr); gap: 0 1.4rem; align-items: end; }
.convertisseur__champs::before { content: ""; grid-column: 2; grid-row: 1; align-self: stretch; background: var(--ligne-v); }
.convertisseur__champ { margin: 0; display: grid; gap: 0.35rem; }
.convertisseur__champ:first-child { grid-column: 1; grid-row: 1; }
.convertisseur__champ:last-child { grid-column: 3; grid-row: 1; }
.convertisseur label { font-family: var(--titres); font-size: 0.92rem; color: var(--encre-douce); }
.convertisseur__saisie { display: flex; min-width: 0; align-items: center; border: 2px solid var(--encre); border-radius: var(--arrondi); background: var(--papier-fort); }
.convertisseur__saisie:focus-within { outline: 3px solid var(--encre); outline-offset: 2px; }
.convertisseur__saisie input {
  flex: 1; min-width: 0; width: 100%; border: 0; padding: 0.55rem 0.7rem; background: transparent; color: var(--encre);
  font-family: var(--titres); font-size: 1.5rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.convertisseur__saisie input:focus { outline: none; }
.convertisseur__saisie span { padding: 0 0.75rem; font-family: var(--titres); font-weight: 600; color: var(--encre-douce); }
.convertisseur__marge { margin: 1.1rem 0 0.8rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.8rem; }
.convertisseur select { font: inherit; font-size: 1rem; padding: 0.35rem 0.5rem; min-height: 2.75rem; border-radius: var(--arrondi); border: 1px solid var(--encre-douce); background: var(--papier-fort); color: var(--encre); }
.convertisseur__note { font-size: 0.85rem; color: var(--encre-douce); margin: 0.8rem 0 0; }

@media (max-width: 40rem) {
  .convertisseur__champs { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
  .convertisseur__champs::before { grid-column: 1; grid-row: 2; height: 3px; background: var(--ligne-h); }
  .convertisseur__champ:last-child { grid-column: 1; grid-row: 3; }
}

/* Liste à cocher (fiche « premier mois ») */
.a-cocher { padding: var(--encadre-pad); margin: 1.5rem 0; }
.a-cocher > p { font-family: var(--titres); font-weight: 600; margin: 1.25rem 0 0.4rem; }
.a-cocher > p:first-child { margin-top: 0; }
.a-cocher ul { list-style: none; padding-left: 0; margin: 0; }
.a-cocher li { position: relative; padding-left: 1.9rem; margin: 0.45rem 0; }
.a-cocher li::before {
  content: ""; position: absolute; left: 0; top: 0.28em;
  width: 1rem; height: 1rem; border: 2px solid var(--encre-douce); border-radius: 2px; background: var(--papier-fort);
}

/* Impression : la fiche seule, lisible sur papier.
   On garde le logo (d'où vient la feuille), le texte, la liste à cocher, la carte et les sources avec leurs adresses ;
   on retire ce qui ne sert qu'à l'écran (menu, bandeau, calculs à saisir, boutons). */
@page { margin: 16mm 15mm 18mm; }
@media print {
  .bandeau, .entete__nav, .pied, .suite, .evitement, .bandeau-brouillon { display: none !important; }
  .entete { padding: 0 0 0.6rem; border: 0; }
  body { background: #fff; }
  main { padding: 0; }
  .fiche__corps { padding-left: 0; }
  .fiche__corps::before, .fiche__corps h2::before { display: none; }
  .a-cocher, .bref, .detail, .frontiere, .carte, .courbe, tr { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  a { color: inherit; }
  /* Calculs à saisir : inutiles sur papier (le calendrier reste s'il a été rempli). */
  .convertisseur, [data-teletravail], [data-sante], .outil[data-calendrier]:has(.echeancier__vide) { display: none; }
  .sources a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: var(--encre-douce); word-break: break-all; }
  .tableau { overflow: visible; }
}

/* =====================================================================
   Outils interactifs (src/js/site.js). Même langage que le convertisseur :
   boîte blanche, saisie à bord épais, ligne frontière comme repère.
   ===================================================================== */

.outil { padding: var(--encadre-pad); margin: 1.6rem 0 2.2rem; }
.outil__titre { font-family: var(--titres); font-weight: 600; font-size: 1.1rem; margin: 0 0 1rem; }
.outil__champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem 1.5rem; align-items: start; }
.outil__champs--trois { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; }
.outil__champ { margin: 0; display: grid; gap: 0.35rem; }
.outil label, .outil legend { font-family: var(--titres); font-size: 0.92rem; color: var(--encre-douce); }
.outil input[type="date"], .outil input[type="number"], .outil select, .saisie {
  font-family: var(--titres); font-size: 1.15rem; font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums;
  border: 2px solid var(--encre); background: var(--papier-fort); padding: 0.45rem 0.6rem; border-radius: var(--arrondi); min-width: 0; width: 100%; min-height: 2.75rem;
}
.saisie { display: flex; align-items: center; padding: 0; }
.saisie input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.45rem 0.6rem; font: inherit; color: inherit; }
.saisie input:focus { outline: none; }
.saisie:focus-within { outline: 3px solid var(--encre); outline-offset: 2px; }
.saisie span { padding: 0 0.6rem; color: var(--encre-douce); }
.outil__choix { border: 0; padding: 0; margin: 0; display: grid; gap: 0.3rem; }
.outil__choix legend { padding: 0; margin-bottom: 0.35rem; }
.outil__choix label { font-family: var(--texte); font-size: 1rem; color: var(--encre); display: flex; gap: 0.5rem; align-items: baseline; }
.outil input[type="radio"], .outil input[type="checkbox"], .a-cocher input, .filtres input { accent-color: var(--lac); }
.outil__choix input, .a-cocher input { width: 1.25rem; height: 1.25rem; flex: none; }
.outil__resultat { margin-top: 1rem; }
.outil__chiffre { display: block; font-family: var(--titres); font-size: 1rem; line-height: 1.45; margin-top: 0.9rem; min-height: 3em; }
.outil__chiffre strong { display: block; font-size: 1.7rem; color: var(--encre); font-variant-numeric: tabular-nums; }
.outil__paire { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: 0.7rem 0.8rem; align-items: end; }
.outil__note { font-size: 0.85rem; color: var(--encre-douce); margin: 0.9rem 0 0; }
.outil__actions { margin: 1rem 0 0; }
.frontiere--outil { margin: 0; }


/* Carte des cantons -------------------------------------------------- */

.carte { margin: 0 0 4.5rem; }
.carte__titre { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); margin: 0 0 0.3rem; }
.carte__consigne { color: var(--encre-douce); max-width: 40em; margin-bottom: 1.4rem; }
.carte__corps { display: grid; gap: 1.5rem 2.5rem; align-items: start; }
@media (min-width: 52rem) { .carte__corps { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); } }

.carte__grille {
  position: relative; display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr));
  aspect-ratio: 8 / 5;
}
.carte__frontiere { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; z-index: 1; }
.carte__frontiere path { fill: none; stroke: var(--frontiere); stroke-width: 3; stroke-dasharray: 12 5 2.5 5; stroke-linejoin: round; }
.carte__pays {
  position: absolute; left: 0; top: 0; width: 25%; height: 20%; display: grid; place-items: center;
  font-family: var(--titres); font-style: italic; font-size: clamp(0.85rem, 0.6rem + 1vw, 1.15rem); color: var(--encre-douce);
}
.carte__canton {
  margin: 2px; min-width: 0; border: 2px solid transparent; border-radius: var(--arrondi); cursor: pointer;
  font-family: var(--titres); font-weight: 700; font-size: clamp(0.8rem, 0.55rem + 1vw, 1.05rem); letter-spacing: 0.02em;
  transition: transform var(--duree) ease-out, box-shadow var(--duree) ease-out;
}
.carte__canton--accord { background: var(--lac); color: var(--papier-fort); }
.carte__canton--geneve { background: var(--lac-pale); color: var(--encre); border-color: var(--encre); }
.carte__canton--autres { background: var(--lac-pale); color: var(--encre-douce); }
.carte__canton:hover { transform: translateY(-2px); box-shadow: 0 3px 0 var(--trait); }
.carte__canton[aria-pressed="true"] { outline: 3px solid var(--frontiere); outline-offset: 2px; z-index: 2; position: relative; }

.carte__legende { list-style: none; padding: 0; margin: 1rem 0 0.4rem; font-family: var(--titres); font-size: 0.9rem; display: grid; gap: 0.3rem; }
.carte__legende li { display: flex; gap: 0.55rem; align-items: center; margin: 0; }
.carte__pastille { width: 1rem; height: 1rem; border-radius: 2px; flex: none; }
.carte__pastille--accord { background: var(--lac); }
.carte__pastille--geneve { background: var(--lac-pale); border: 2px solid var(--encre); }
.carte__pastille--autres { background: var(--lac-pale); }
.carte__note { font-size: 0.85rem; color: var(--encre-douce); margin: 0; }

.carte__fiche { border-top: 4px solid var(--trait); padding: var(--encadre-pad); font-size: 1.02rem; line-height: 1.55; }
.carte__fiche--accord { border-top-color: var(--lac); }
.carte__fiche--geneve, .carte__fiche--autres { border-top-color: var(--encre); }
.carte__fiche ul { padding-left: 1.1em; margin-bottom: 0.6rem; }
.carte__vide { font-family: var(--titres); font-weight: 600; margin-bottom: 0.4rem; }
.carte__canton-nom { font-family: var(--titres); font-size: 1.45rem; font-weight: 700; line-height: 1.2; margin: 0; }
.carte__regime { font-family: var(--titres); font-weight: 600; color: var(--lac); margin: 0.1rem 0 0.7rem; }
.carte__fiche--geneve .carte__regime, .carte__fiche--autres .carte__regime { color: var(--encre-douce); }
.carte__lien { margin: 0; font-family: var(--titres); font-size: 0.95rem; }
.fiche__corps .carte { margin: 1.5rem 0 2.5rem; }
.fiche__corps .carte__titre { font-size: 1.2rem; }
.fiche__corps .carte__titre::before { display: none; }
@media (min-width: 52rem) { .fiche__corps .carte__corps { grid-template-columns: 1fr; } }
/* Dans une fiche, la carte ne prend pas toute la colonne : des cases de 60 à 70 px suffisent. */
.fiche__corps .carte__grille { max-width: 34rem; }

/* Calendrier des échéances ------------------------------------------- */

.echeancier { list-style: none; padding: 0; margin: 1.5rem 0 0; position: relative; }
.echeancier::before { content: ""; position: absolute; left: 0.55rem; top: 0.6rem; bottom: 0.6rem; width: 3px; background: var(--ligne-v); }
.echeancier__etape { position: relative; padding-left: 2.2rem; margin: 0; }
.echeancier__etape + .echeancier__etape { margin-top: 1.3rem; }
.echeancier__etape::before {
  content: ""; position: absolute; left: 0; top: 0.3rem; width: 1.15rem; height: 1.15rem;
  background: var(--papier-fort); border: 3px solid var(--frontiere);
}
.echeancier__etape--important::before { background: var(--frontiere); }
.echeancier__etape--passee { opacity: 0.55; }
.echeancier__date { font-family: var(--titres); font-size: 0.9rem; font-weight: 600; color: var(--frontiere); margin: 0; }
.echeancier__titre { font-family: var(--titres); font-size: 1.1rem; font-weight: 600; margin: 0 0 0.2rem; }
.echeancier__titre a { color: var(--encre); }
.echeancier__etape ul { font-size: 1rem; margin: 0; padding-left: 1.1em; color: var(--encre-douce); }
.echeancier__vide { color: var(--encre-douce); }

/* Liste à cocher, version active -------------------------------------- */

.a-cocher--active li { padding-left: 0; display: flex; gap: 0.7rem; align-items: flex-start; }
.a-cocher--active li::before { display: none; }
.a-cocher--active input { width: 1.5rem; height: 1.5rem; flex: none; margin: 0.2rem 0 0; cursor: pointer; }  /* 24 px : cible tactile minimale */
.a-cocher--active label { cursor: pointer; }
.a-cocher--active input:checked + label { color: var(--encre-douce); text-decoration: line-through; text-decoration-color: var(--encre-douce); }
.a-cocher__etat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; margin-bottom: 0.4rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--trait); }
.a-cocher__compteur { font-family: var(--titres); font-weight: 600; margin: 0; }
/* Liste terminée : une pulsation brève, pas de fête. */
.a-cocher__compteur--fini { color: var(--lac-fonce); animation: pulsation 0.4s ease-out; transform-origin: left center; }
@keyframes pulsation { 40% { transform: scale(1.08); } }
.a-cocher__piste { flex: 1 1 8rem; height: 8px; background: var(--lac-pale); position: relative; overflow: hidden; }
.a-cocher__barre { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--lac); transition: width var(--duree-longue) ease-out; }

/* Jauge du télétravail ------------------------------------------------ */

.jauge { margin: 1.4rem 0 0.2rem; }
.jauge__piste { position: relative; height: 16px; background: var(--lac-pale); }
.jauge__barre { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--lac); transition: width var(--duree-longue) ease-out, background-color var(--duree-longue) ease-out; }
.outil--depasse .jauge__barre { background: var(--frontiere); }
.jauge__seuil { position: absolute; left: 40%; top: -8px; bottom: -8px; width: 3px; margin-left: -1.5px; background: var(--encre); }
.jauge__echelle { position: relative; display: flex; justify-content: space-between; font-family: var(--titres); font-size: 0.82rem; color: var(--encre-douce); margin-top: 0.45rem; }
.jauge__repere { position: absolute; left: 40%; transform: translateX(-50%); font-weight: 700; color: var(--encre); }

/* Filtre des forfaits ------------------------------------------------- */

.filtres { border: 0; padding: 0; margin: 1.2rem 0 0.8rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filtres legend { font-family: var(--titres); font-weight: 600; font-size: 0.95rem; padding: 0; margin-bottom: 0.5rem; }
.filtres__puce {
  display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
  font-family: var(--titres); font-size: 0.92rem; padding: 0.35rem 0.9rem; min-height: 2.75rem; border: 2px solid var(--encre); border-radius: var(--arrondi-pilule); background: var(--papier-fort);
}
.filtres__puce:has(input:checked) { background: var(--encre); color: var(--papier-fort); }
.filtres__puce:has(input:focus-visible) { outline: 3px solid var(--encre); outline-offset: 2px; }
.filtres__message { font-family: var(--titres); font-size: 0.95rem; color: var(--lac); min-height: 1.4em; }
.ligne--ecartee { opacity: 0.38; }
.case--manque { text-decoration: line-through; text-decoration-color: var(--encre-douce); }
tbody tr { transition: opacity var(--duree) ease-out; }

@media print {
  .outil__actions, .a-cocher__etat .bouton, .filtres, .carte__consigne, .carte__vide { display: none; }
  .outil, .carte__fiche { break-inside: avoid; }
}

/* Courbe du franc (une seule série : pas de légende, le titre la nomme) */
.courbe { margin: 1.4rem 0 2rem; padding: var(--encadre-pad); }
.courbe__titre { font-family: var(--titres); font-weight: 600; font-size: 1.02rem; margin-bottom: 0.6rem; }
.courbe__zone { position: relative; }
.courbe svg { display: block; width: 100%; height: auto; overflow: visible; touch-action: pan-y; cursor: crosshair; }
.courbe__grille { stroke: var(--trait); stroke-width: 1; }
.courbe__base { stroke: var(--encre-douce); stroke-width: 1; }
.courbe__graduation { stroke: var(--encre-douce); stroke-width: 1; }
.courbe__axe { font-family: var(--titres); font-size: 13px; fill: var(--encre-douce); }
.courbe__ligne { fill: none; stroke: var(--lac); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.courbe__point { fill: var(--lac); stroke: var(--papier-fort); stroke-width: 2; }
.courbe__point--fin { fill: var(--frontiere); }
.courbe__note { font-family: var(--titres); font-size: 13px; fill: var(--encre); }
.courbe__fin { font-family: var(--titres); font-size: 15px; font-weight: 700; fill: var(--encre); }
.courbe__curseur { stroke: var(--encre-douce); stroke-width: 1; stroke-dasharray: 3 3; }
.courbe__bulle {
  position: absolute; transform: translate(-50%, calc(-100% - 14px)); pointer-events: none; white-space: nowrap;
  background: var(--encre); color: var(--papier-fort); font-family: var(--titres); font-size: 0.85rem; padding: 0.3rem 0.6rem; border-radius: 3px;
}
.courbe__resume { font-size: 0.88rem; color: var(--encre-douce); margin: 0.7rem 0 0; }

/* Illustrations des fiches : dessin au trait, la ligne frontière traverse chaque dessin. */
.fiche__tete--illustree { display: grid; grid-template-columns: minmax(0, 1fr); }
.fiche__illu { width: 8.5rem; margin-bottom: 0.8rem; }
@media (min-width: 52rem) {
  .fiche__tete--illustree { grid-template-columns: minmax(0, 1fr) 11.5rem; column-gap: 2rem; }
  .fiche__tete--illustree > :not(.fiche__illu) { grid-column: 1; }
  .fiche__illu { grid-column: 2; grid-row: 1 / span 4; align-self: center; width: 100%; margin: 0; }
}
.illu { display: block; width: 100%; height: auto; overflow: visible; }
.illu__trait, .illu__coche, .illu__onde, .illu__plus { fill: none; stroke: var(--encre); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.illu__fond { fill: var(--lac-pale); }
.illu__points { fill: var(--encre-douce); }
.illu__accent { fill: none; stroke: var(--frontiere); stroke-width: 2.6; }
.illu__coche { stroke: var(--lac); stroke-width: 4; }
.illu__plus { stroke: var(--lac); stroke-width: 6; stroke-linecap: butt; }
.illu__onde { stroke: var(--lac); }
.illu__onde--ch { stroke: var(--frontiere); }
.illu__frontiere { fill: none; stroke: var(--frontiere); stroke-width: 3; stroke-dasharray: 12 5 2.5 5; opacity: 0.85; }
.illu__texte { font-family: var(--titres); font-weight: 700; font-size: 22px; fill: var(--encre); }

/* Lien vers un article détaillé : la fiche reste courte, le détail est à un clic. */
.detail {
  display: grid; gap: 0.15rem; margin: 1.2rem 0 1.8rem; padding: 0.9rem 1.1rem 0.95rem;
  border-left: 4px solid var(--lac);
  text-decoration: none; color: var(--encre);
}
.detail:hover { border-color: var(--lac); }
.detail__etiquette { font-family: var(--titres); font-size: 0.85rem; font-weight: 600; color: var(--lac-fonce); }
.detail__titre { font-family: var(--titres); font-size: 1.12rem; font-weight: 700; color: var(--lac); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.detail:hover .detail__titre { text-decoration-thickness: 2px; }
.detail__texte { font-size: 1rem; color: var(--encre-douce); }

/* Article détaillé : rappel de la fiche dont il dépend. */
.fiche__parent { font-family: var(--titres); font-size: 0.95rem; font-weight: 600; margin: 0 0 0.6rem; }
.fiche__parent a { color: var(--lac); }
.retour { margin-top: 2.5rem; font-family: var(--titres); font-weight: 600; }

/* Fil d'Ariane ------------------------------------------------------- */
.ariane ol { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: 0.2rem 0; font-family: var(--titres); font-size: 0.88rem; color: var(--encre-douce); }
.ariane li { margin: 0; }
.ariane li + li::before { content: "›"; margin: 0 0.5rem; color: var(--trait); }
.ariane a { color: var(--encre-douce); }
.ariane [aria-current] { color: var(--encre); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* L'essentiel : la réponse en une phrase, puis les chiffres à retenir ---- */
.bref { border-top: 4px solid var(--lac); padding: var(--encadre-pad); margin: 0 0 2rem; }
.bref__etiquette { font-family: var(--titres); font-weight: 700; font-size: 0.9rem; color: var(--lac); margin: 0 0 0.4rem; }
.bref__texte { font-size: 1.25rem; line-height: 1.5; margin: 0; }
.bref__chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 1.5rem; margin: 1.3rem 0 0; padding-top: 1.1rem; border-top: 1px solid var(--trait); }
.bref__chiffre { margin: 0; }
.bref__chiffre dt { font-family: var(--titres); font-weight: 700; font-size: 1.75rem; line-height: 1.1; color: var(--lac-fonce); font-variant-numeric: tabular-nums; }
.bref__chiffre dd { margin: 0.25rem 0 0; font-family: var(--titres); font-size: 0.92rem; line-height: 1.35; color: var(--encre-douce); hyphens: manual; }

/* Sommaire ------------------------------------------------------------ */
.sommaire { margin: 0 0 2.5rem; padding-left: 2.25rem; }
.sommaire__titre { font-family: var(--titres); font-weight: 700; font-size: 0.9rem; color: var(--encre-douce); margin: 0 0 0.5rem; }
.sommaire ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; counter-reset: sommaire; }
.sommaire li { margin: 0; counter-increment: sommaire; }
.sommaire a {
  display: inline-flex; gap: 0.45rem; align-items: baseline; padding: 0.6rem 0.85rem; line-height: 1.3;
  font-family: var(--titres); font-size: 0.92rem; color: var(--encre); text-decoration: none;
  background: var(--papier-fort); border: 1px solid var(--trait); border-radius: var(--arrondi-pilule);
}
.sommaire a { hyphens: manual; }
.sommaire a::before { content: counter(sommaire); font-weight: 700; color: var(--lac); }
.sommaire a:hover { border-color: var(--lac); color: var(--lac); }
.fiche__corps h2 { scroll-margin-top: 1.5rem; }
@media (max-width: 40rem) { .sommaire { padding-left: 0; } .bref { padding: 1.1rem 1.1rem 1.2rem; } .bref__texte { font-size: 1.12rem; } }
@media print { .sommaire, .ariane { display: none; } }

/* Fiches sur grand écran : le texte à gauche (aligné sur le logo), le sommaire à droite,
   toujours visible pendant la lecture, avec la section en cours surlignée (src/js/site.js). */
@media (min-width: 72rem) {
  .fiche:has(> .sommaire) {
    max-width: var(--largeur);
    display: grid; grid-template-columns: minmax(0, calc(var(--mesure) + 4rem)) 15rem; justify-content: space-between; column-gap: 3rem;
  }
  .fiche:has(> .sommaire) > * { grid-column: 1; }
  .fiche > .sommaire {
    grid-column: 2; grid-row: 1 / span 40; align-self: start;
    position: sticky; top: 1.5rem; padding: 0.2rem 0 0; margin: 0;
    max-height: calc(100vh - 3rem); overflow-y: auto;
  }
  .fiche > .sommaire ol { display: grid; gap: 0; border-left: 2px solid var(--trait); }
  .fiche > .sommaire a {
    display: flex; gap: 0.6rem; align-items: baseline; min-height: 2.75rem; padding: 0.55rem 0 0.55rem 0.9rem; margin-left: -2px;
    border: 0; border-left: 2px solid transparent; border-radius: 0; background: none; line-height: 1.35;
    transition: color var(--duree) ease-out, border-color var(--duree) ease-out;
  }
  .fiche > .sommaire a:hover { color: var(--lac); border-left-color: var(--lac); }
  .fiche > .sommaire a[aria-current="true"] { color: var(--lac-fonce); font-weight: 600; border-left-color: var(--lac); }
}

/* Bandeau du haut : échéances et informations clés qui défilent, cours du franc fixe ---- */
.bandeau {
  display: flex; align-items: center; gap: 0.3rem 1rem;
  padding: 0.45rem var(--bord); background: var(--encre); color: var(--papier-fort);
  font-family: var(--titres); font-size: 0.88rem;
}
.bandeau a { color: var(--papier-fort); text-decoration: none; }
.bandeau__fil {
  flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  /* les infos apparaissent et disparaissent en fondu sur les bords */
  mask-image: linear-gradient(to right, transparent, #000 1.5rem, #000 calc(100% - 2.5rem), transparent);
}
.bandeau__fil::-webkit-scrollbar { display: none; }
.bandeau__piste { display: flex; width: max-content; margin: 0; padding: 0 1.5rem; list-style: none; }
.bandeau__info { display: flex; align-items: center; white-space: nowrap; }
/* entre deux infos : une petite borne, le motif de la ligne frontière */
.bandeau__info::before {
  content: ""; flex: none; width: 7px; height: 7px; margin: 0 1.1rem;
  border: 2px solid var(--frontiere); background: var(--encre);
}
.bandeau__piste > .bandeau__info:first-child::before { display: none; }
.bandeau__info a { padding-block: 0.2rem; }
.bandeau__info a:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.bandeau__compte { display: inline-block; background: var(--frontiere); color: var(--papier-fort); font-weight: 700; padding: 0.05rem 0.45rem; border-radius: var(--arrondi); margin-right: 0.35rem; font-variant-numeric: tabular-nums; }
.bandeau__sujet { font-weight: 700; color: var(--frontiere-clair); margin-right: 0.3rem; }

/* Défilement (activé par site.js, qui double la liste pour boucler sans à-coup) */
.bandeau--anime .bandeau__fil { overflow: hidden; }
.bandeau--anime .bandeau__rail { display: flex; width: max-content; animation: bandeau-defile var(--duree-fil, 90s) linear infinite; }
.bandeau--anime .bandeau__piste .bandeau__info:first-child::before { display: flex; }
.bandeau--anime .bandeau__piste { padding: 0; }
.bandeau--anime:hover .bandeau__rail,
.bandeau--anime .bandeau__fil:focus-within .bandeau__rail { animation-play-state: paused; }
@keyframes bandeau-defile { from { transform: translateX(0); } to { transform: translateX(-50%); } }

.bandeau__taux { flex: none; white-space: nowrap; padding-block: 0.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bandeau__taux span { font-weight: 400; opacity: 0.75; margin-left: 0.3rem; }
.bandeau__taux:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.bandeau__info--taux { display: none; }
/* Sur téléphone, le cours du franc passe dans le défilé : toute la largeur pour lire. */
@media (max-width: 40rem) {
  .bandeau { gap: 0.6rem; }
  .bandeau__taux { display: none; }
  .bandeau__info--taux { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .bandeau--anime .bandeau__rail { animation: none; }
  .bandeau--anime .bandeau__fil { overflow-x: auto; }
}

/* FAQ : questions dépliables ; la réponse ouverte longe la ligne frontière -------- */
.faq { border-top: 1px solid var(--trait); margin: 0 0 2.2rem; }
.faq__item { border-bottom: 1px solid var(--trait); }
.faq__question {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
  padding: 0.95rem 0.2rem; font-family: var(--titres); font-weight: 600; font-size: 1.08rem; line-height: 1.35; color: var(--encre); hyphens: none;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::after {
  content: "+"; flex: none; font-weight: 500; font-size: 1.4rem; line-height: 1; color: var(--lac);
  transition: transform var(--duree) ease-out;
}
.faq__item[open] > .faq__question::after { transform: rotate(45deg); color: var(--lac-fonce); }
.faq__question:hover { color: var(--lac); }
.faq__reponse { position: relative; padding: 0 0.2rem 1.1rem 1.2rem; }
.faq__reponse::before { content: ""; position: absolute; left: 0; top: 0.2rem; bottom: 1.2rem; width: 2px; background: var(--lac); }
.faq__reponse p { margin: 0 0 0.6rem; }
/* Ouverture : la réponse glisse de quelques pixels et apparaît en fondu (entrée en ease-out). */
.faq__item[open] > .faq__reponse { animation: deplie var(--duree-longue) ease-out; }
@keyframes deplie { from { opacity: 0; transform: translateY(-0.4rem); } }
.faq__lien { font-family: var(--titres); font-size: 0.95rem; font-weight: 600; margin: 0; }
.faq__item:target > .faq__question { color: var(--lac-fonce); }
@media print { .faq__question::after { content: none; } }
