/* ==========================================================================
   DIVIDOM – Simulateurs Denormandie
   Charte graphique du 7 octobre 2026 :
   bleu signature #2D5BFF (actions, accents) · bleu nuit #142538 (texte, pages sombres)
   ivoire #F4F2EC (fond principal) · bleu brume #E7EDFF (encadrés de soutien) · blanc.
   Manrope 400 / 600 / 700 / 800. Traits fins, repères en capitales espacées,
   chiffres clés en grille ouverte, appel à l'action en bande bleue avec flèche.
   ========================================================================== */

@font-face { font-family: "Manrope"; font-weight: 400; font-style: normal; font-display: swap; src: url("../assets/fonts/Manrope-Regular.woff") format("woff"); }
@font-face { font-family: "Manrope"; font-weight: 600; font-style: normal; font-display: swap; src: url("../assets/fonts/Manrope-SemiBold.woff") format("woff"); }
@font-face { font-family: "Manrope"; font-weight: 700; font-style: normal; font-display: swap; src: url("../assets/fonts/Manrope-Bold.woff") format("woff"); }
@font-face { font-family: "Manrope"; font-weight: 800; font-style: normal; font-display: swap; src: url("../assets/fonts/Manrope-ExtraBold.woff") format("woff"); }

:root {
  /* Palette établie */
  --dividom-blue: #2D5BFF;
  --dividom-night: #142538;
  --dividom-ivory: #F4F2EC;
  --dividom-mist: #E7EDFF;
  --dividom-white: #FFFFFF;
  --dividom-font: "Manrope", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Dérivés d'usage (teintes de la palette) */
  --bleu: var(--dividom-blue);
  --bleu-hover: #1E47E0;
  --nuit: var(--dividom-night);
  --ivoire: var(--dividom-ivory);
  --brume: var(--dividom-mist);
  --blanc: var(--dividom-white);
  --texte: var(--dividom-night);
  --texte-2: #45525F;            /* 7,9:1 sur ivoire */
  --texte-3: #5F6B78;            /* 5,1:1 sur ivoire */
  --trait: rgba(20, 37, 56, .14);
  --trait-moyen: rgba(20, 37, 56, .28);
  --trait-clair: rgba(255, 255, 255, .18);
  --bleu-doux: #A9BCFF;          /* teinte du bleu signature pour les graphiques */

  /* États (usage ponctuel, pictogrammes) */
  --ok: #1D7A4E;
  --ko: #B3392B;
  --vigilance: #9A5B00;

  --contenu: 1240px;
  --gouttiere: clamp(20px, 4vw, 48px);
  --entete: 76px;
  --rayon: 2px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--entete) + 24px); }
body { margin: 0; background: var(--ivoire); color: var(--texte); font: 400 17px/1.55 var(--dividom-font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: var(--bleu); text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; color: var(--nuit); font-weight: 800; letter-spacing: -0.02em; line-height: 1.06; }
h3 { font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 .9em; }
button, input, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bleu { color: var(--bleu); }
.conteneur { max-width: var(--contenu); margin: 0 auto; padding: 0 var(--gouttiere); }

/* --- Repères en capitales espacées : « 01 / LE LIEU » --- */
.repere { display: flex; align-items: center; gap: 0; font-size: .78rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--nuit); margin: 0 0 18px; }
.repere .num { font-variant-numeric: tabular-nums; margin-right: .6em; }
.repere.filet { border-top: 1px solid var(--trait-moyen); padding-top: 14px; }
.sombre .repere, .repere.clair { color: rgba(255,255,255,.82); }
.sombre .repere.filet { border-top-color: var(--trait-clair); }

/* --- Lien avec flèche --- */
.fleche::after { content: ""; display: inline-block; width: 22px; height: 12px; margin-left: 12px; vertical-align: -1px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M0 6h20M15 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / contain;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 12'%3E%3Cpath d='M0 6h20M15 1l5 5-5 5' fill='none' stroke='black' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat center / contain; transition: transform .2s; }
a:hover .fleche::after, a.fleche:hover::after, button:hover .fleche::after { transform: translateX(4px); }
.lien { color: var(--nuit); font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; padding: 6px 0; border-bottom: 1px solid currentColor; }
.lien.bleu { color: var(--bleu); }

/* --- Boutons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px; border-radius: var(--rayon); border: 1px solid transparent; font-weight: 700; font-size: .95rem; text-decoration: none; cursor: pointer; transition: background .15s, color .15s, border-color .15s; white-space: nowrap; }
.btn-bleu { background: var(--bleu); color: #fff; }
.btn-bleu:hover { background: var(--bleu-hover); }
.btn-contour { background: transparent; color: var(--nuit); border-color: var(--trait-moyen); }
.btn-contour:hover { border-color: var(--nuit); }
.sombre .btn-contour { color: #fff; border-color: rgba(255,255,255,.4); }
.sombre .btn-contour:hover { border-color: #fff; }

/* Bande d'appel à l'action bleue avec flèche */
.bande-cta { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--bleu); color: #fff; text-decoration: none; padding: 18px 22px; border-radius: var(--rayon); font-weight: 600; font-size: 1.02rem; transition: background .15s; }
.bande-cta:hover { background: var(--bleu-hover); }
.bande-cta .fleche::after { width: 28px; height: 14px; }

/* --- En-tête --- */
.entete { position: sticky; top: 0; z-index: 40; background: rgba(244, 242, 236, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border-bottom: 1px solid var(--trait); }
.entete .barre { max-width: var(--contenu); margin: 0 auto; height: var(--entete); padding: 0 var(--gouttiere); display: flex; align-items: center; gap: 32px; }
.logo { display: block; flex: none; }
.logo img { height: 48px; width: auto; }
.nav { display: flex; gap: 28px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; color: var(--nuit); font-weight: 600; font-size: .95rem; padding: 6px 0; border-bottom: 1px solid transparent; }
.nav a:hover { border-bottom-color: var(--trait-moyen); }
.nav a[aria-current="page"] { color: var(--bleu); border-bottom-color: var(--bleu); }
.entete .btn { min-height: 42px; padding: 0 18px; font-size: .9rem; }
.menu-mobile { display: none; margin-left: auto; background: none; border: 1px solid var(--trait-moyen); border-radius: var(--rayon); width: 44px; height: 44px; cursor: pointer; color: var(--nuit); }
.menu-mobile span, .menu-mobile span::before, .menu-mobile span::after { display: block; width: 18px; height: 1.5px; background: currentColor; margin: 0 auto; position: relative; }
.menu-mobile span::before, .menu-mobile span::after { content: ""; position: absolute; left: 0; }
.menu-mobile span::before { top: -6px; } .menu-mobile span::after { top: 6px; }
@media (max-width: 980px) {
  .nav, .entete .btn-entete { display: none; }
  .menu-mobile { display: grid; place-items: center; }
  .entete.ouvert .nav { display: flex; flex-direction: column; align-items: stretch; gap: 0; position: absolute; top: var(--entete); left: 0; right: 0; background: var(--ivoire); border-bottom: 1px solid var(--trait); padding: 8px var(--gouttiere) 20px; }
  .entete.ouvert .nav a { padding: 14px 0; border-bottom: 1px solid var(--trait); font-size: 1.05rem; }
  .logo img { height: 42px; }
}

/* --- Ouverture de page (couverture) --- */
.ouverture { position: relative; overflow: hidden; border-bottom: 1px solid var(--trait); }
.ouverture .conteneur { padding-top: clamp(40px, 7vw, 88px); padding-bottom: clamp(36px, 5vw, 64px); position: relative; z-index: 1; }
.ouverture h1 { font-size: clamp(2.5rem, 5.6vw, 4.6rem); max-width: 14ch; }
.ouverture .chapo { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--texte-2); max-width: 54ch; margin: 22px 0 0; line-height: 1.5; }
.ouverture .filet-bleu { width: 56px; height: 3px; background: var(--bleu); margin: 26px 0 0; }
/* Fragment du sigle recadré en bord de page (motif, usage ponctuel) */
.motif { position: absolute; right: 0; top: 0; bottom: 0; width: min(20vw, 250px); overflow: hidden; pointer-events: none; z-index: 0; }
.motif svg { position: absolute; right: -34%; bottom: -30%; height: 112%; width: auto; max-width: none; }
.motif svg path { fill: var(--bleu); }
@media (max-width: 860px) { .motif { display: none; } }

/* Commandes du simulateur */
.reglages { display: flex; flex-wrap: wrap; gap: 18px 40px; margin-top: 34px; }
.reglage .titre { display: block; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--texte-3); margin-bottom: 8px; }
.segment { display: inline-flex; border: 1px solid var(--trait-moyen); border-radius: var(--rayon); background: var(--blanc); }
.segment button { border: 0; background: transparent; color: var(--nuit); font-weight: 600; font-size: .92rem; padding: 0 18px; min-height: 44px; cursor: pointer; border-right: 1px solid var(--trait); }
.segment button:last-child { border-right: 0; }
.segment button[aria-pressed="true"] { background: var(--nuit); color: #fff; }

/* --- Mise en page --- */
.page { max-width: var(--contenu); margin: 0 auto; padding: clamp(32px, 5vw, 56px) var(--gouttiere) 96px; }
.grille { display: grid; grid-template-columns: minmax(0, 1fr) 410px; gap: clamp(28px, 4vw, 56px); align-items: start; }
@media (max-width: 1080px) { .grille { grid-template-columns: 1fr; } }
.colonne-formulaire { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.colonne-resume { position: sticky; top: calc(var(--entete) + 24px); display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1080px) { .colonne-resume { position: static; } }

/* --- Étapes du formulaire --- */
.etape { border-top: 1px solid var(--trait-moyen); padding: 0 0 40px; }
.etape:first-child { border-top-color: var(--nuit); }
.etape > .tete { display: block; width: 100%; background: none; border: 0; padding: 16px 0 0; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.etape .ligne-repere { display: flex; align-items: center; gap: 16px; }
.etape .ligne-repere .repere { margin: 0; }
.etape .resume-etape { margin-left: auto; font-size: .86rem; color: var(--texte-3); font-weight: 600; text-align: right; }
.etape .chevron { width: 9px; height: 9px; border-right: 1.5px solid var(--nuit); border-bottom: 1.5px solid var(--nuit); transform: rotate(45deg); margin: -4px 2px 0 6px; transition: transform .2s; flex: none; }
.etape.ferme .chevron { transform: rotate(-45deg); margin-top: 0; }
.etape .titre-etape { display: flex; align-items: center; gap: 14px; margin-top: 18px; }
.etape .titre-etape h2 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
.picto { width: 34px; height: 34px; flex: none; color: var(--nuit); }
.picto * { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.etape.ferme { padding-bottom: 18px; }
.etape.ferme .titre-etape, .etape.ferme .corps { display: none; }
.etape .corps { padding-top: 16px; }
.etape .description { color: var(--texte-2); margin: 0 0 24px; max-width: 62ch; }
.champs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
@media (max-width: 600px) { .champs { grid-template-columns: 1fr; } .etape .resume-etape { display: none; } }
.champ { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.champ.large { grid-column: 1 / -1; }
.champ > label, .champ > .label { font-size: .92rem; font-weight: 600; color: var(--nuit); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.champ .aide { font-size: .84rem; color: var(--texte-3); line-height: 1.45; }
.mode-essentiel [data-niveau="expert"] { display: none !important; }
.badge-expert { font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; color: var(--bleu); font-weight: 700; border: 1px solid currentColor; padding: 1px 6px; border-radius: var(--rayon); }

.saisie { position: relative; display: flex; align-items: center; }
.saisie input, .champ select, .recherche input {
  width: 100%; min-height: 50px; font: inherit; font-size: 1rem; font-weight: 600; color: var(--nuit);
  background: var(--blanc); border: 1px solid var(--trait-moyen); border-radius: var(--rayon); padding: 11px 14px;
  transition: border-color .15s, box-shadow .15s;
}
.saisie input { padding-right: 52px; font-variant-numeric: tabular-nums; }
.saisie .unite { position: absolute; right: 14px; color: var(--texte-3); font-size: .9rem; font-weight: 600; pointer-events: none; }
.saisie input:hover, .champ select:hover, .recherche input:hover { border-color: var(--nuit); }
.saisie input:focus, .champ select:focus, .recherche input:focus { outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px var(--brume); }
.saisie input:disabled { color: var(--texte-2); background: transparent; border-style: dashed; cursor: not-allowed; }
.champ select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23142538' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; background-size: 12px 8px; }

.choix { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--trait-moyen); border-radius: var(--rayon); background: var(--blanc); overflow: hidden; }
.choix button { min-height: 50px; border: 0; border-right: 1px solid var(--trait); background: transparent; font-weight: 700; color: var(--nuit); cursor: pointer; padding: 8px 6px; line-height: 1.2; font-size: .98rem; }
.choix button:last-child { border-right: 0; }
.choix button small { display: block; font-weight: 600; color: var(--texte-3); font-size: .76rem; margin-top: 3px; }
.choix button:hover { background: var(--ivoire); }
.choix button[aria-pressed="true"] { background: var(--nuit); color: #fff; }
.choix button[aria-pressed="true"] small { color: rgba(255,255,255,.78); }
@media (max-width: 420px) { .choix button { font-size: .9rem; } .choix button small { font-size: .7rem; } }

.bascule { display: flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: .95rem; color: var(--nuit); position: relative; }
.bascule input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.bascule .piste { width: 44px; height: 24px; border-radius: 12px; border: 1px solid var(--trait-moyen); background: var(--blanc); position: relative; flex: none; transition: background .15s, border-color .15s; }
.bascule .piste::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--nuit); transition: transform .15s, background .15s; }
.bascule input:checked + .piste { background: var(--bleu); border-color: var(--bleu); }
.bascule input:checked + .piste::after { transform: translateX(20px); background: #fff; }
.bascule input:focus-visible + .piste { outline: 2px solid var(--bleu); outline-offset: 2px; }
.lien-calcul { align-self: flex-start; background: none; border: 0; padding: 0; color: var(--bleu); font-weight: 600; font-size: .86rem; cursor: pointer; text-align: left; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.lien-calcul:hover { color: var(--bleu-hover); }

/* Chiffres clés : grille ouverte à séparateurs fins */
.calcule, .chiffres-cles { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border-top: 1px solid var(--nuit); margin-top: 6px; }
.calcule > div, .chiffres-cles > div { padding: 14px 18px 4px 0; }
.calcule > div + div, .chiffres-cles > div + div { padding-left: 18px; border-left: 1px solid var(--trait); }
.calcule .l, .chiffres-cles .l { display: block; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: var(--texte-3); }
.calcule .v, .chiffres-cles .v { display: block; font-size: 1.32rem; font-weight: 800; color: var(--nuit); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; margin-top: 4px; line-height: 1.2; }
.calcule .v.ok { color: var(--ok); } .calcule .v.ko { color: var(--ko); }
.calcule .s, .chiffres-cles .s { display: block; font-size: .82rem; color: var(--texte-3); margin-top: 2px; }
@media (max-width: 600px) {
  .calcule, .chiffres-cles { grid-template-columns: 1fr 1fr; }
  .calcule > div, .chiffres-cles > div { border-bottom: 1px solid var(--trait); padding-bottom: 12px; }
  .calcule > div:nth-child(odd), .chiffres-cles > div:nth-child(odd) { padding-left: 0; border-left: 0; }
}
.salaire-aide { display: none; grid-column: 1 / -1; background: var(--brume); padding: 16px; gap: 12px; align-items: end; border-radius: var(--rayon); }
.salaire-aide.ouvert { display: grid; grid-template-columns: 1fr auto; }

/* --- Recherche de commune --- */
.recherche { position: relative; }
.recherche input { padding-left: 44px; }
.recherche .loupe { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--nuit); pointer-events: none; }
.recherche.grand input { min-height: 64px; font-size: 1.2rem; }
.suggestions { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--blanc); border: 1px solid var(--trait-moyen); border-radius: var(--rayon); box-shadow: 0 18px 40px rgba(20, 37, 56, .12); z-index: 30; max-height: 340px; overflow: auto; display: none; }
.suggestions.ouvert { display: block; }
.suggestions button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--trait); padding: 13px 16px; font: inherit; font-size: .98rem; cursor: pointer; color: var(--nuit); font-weight: 600; }
.suggestions button:last-child { border-bottom: 0; }
.suggestions button:hover, .suggestions button.actif { background: var(--brume); }
.suggestions small { color: var(--texte-3); font-weight: 400; }
.puces { display: inline-flex; gap: 6px; flex: none; }
.puce { font-size: .74rem; font-weight: 700; color: var(--nuit); border: 1px solid var(--trait-moyen); padding: 2px 8px; border-radius: var(--rayon); white-space: nowrap; background: var(--blanc); }
.puce.oui { color: var(--ok); border-color: currentColor; }
.puce.non { color: var(--texte-3); }
.puce.a_verifier { color: var(--vigilance); border-color: currentColor; }
.etat-commune { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: .88rem; color: var(--texte-2); min-height: 24px; }

/* --- Panneau de résultat : page sombre bleu nuit --- */
.sombre { background: var(--nuit); color: #fff; }
.sombre h2, .sombre h3 { color: #fff; }
.resultat { border-radius: var(--rayon); overflow: hidden; }
.resultat .haut { padding: 28px 28px 8px; }
.resultat .gros { font-size: clamp(2.6rem, 4.6vw, 3.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.resultat .gros small { font-size: .38em; letter-spacing: 0; font-weight: 600; opacity: .8; margin-left: 6px; }
.resultat .phrase { font-size: .98rem; color: rgba(255,255,255,.86); margin: 16px 0 22px; line-height: 1.55; }
.resultat .phrase strong { color: #fff; font-weight: 700; }
.resultat .grille-chiffres { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--trait-clair); margin: 0 28px; }
.resultat .grille-chiffres > div { padding: 14px 0 14px; }
.resultat .grille-chiffres > div:nth-child(odd) { padding-right: 14px; border-right: 1px solid var(--trait-clair); }
.resultat .grille-chiffres > div:nth-child(even) { padding-left: 18px; }
.resultat .grille-chiffres > div:nth-child(n+3) { border-top: 1px solid var(--trait-clair); }
.resultat .grille-chiffres .l { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: rgba(255,255,255,.7); display: block; }
.resultat .grille-chiffres .v { font-size: 1.38rem; font-weight: 800; font-variant-numeric: tabular-nums; display: block; margin-top: 5px; letter-spacing: -0.01em; }
.resultat .bas { padding: 18px 28px 28px; display: grid; gap: 12px; }
.resultat .lien-detail { color: #fff; font-weight: 600; text-decoration: none; font-size: .92rem; justify-self: start; border-bottom: 1px solid rgba(255,255,255,.5); padding-bottom: 2px; }
.resultat .lien-detail:hover { border-bottom-color: #fff; }

.eligibilite-mini { border-top: 1px solid var(--nuit); padding: 16px 0 0; }
.eligibilite-mini .ligne { display: flex; align-items: center; gap: 14px; }
.jauge { display: flex; gap: 4px; flex: 1; }
.jauge span { height: 4px; flex: 1; background: var(--trait); }
.jauge span.ok { background: var(--ok); } .jauge span.ko { background: var(--ko); } .jauge span.verif { background: #D08A1C; }
.eligibilite-mini .compte { font-weight: 800; font-size: 1rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.eligibilite-mini p { margin: 10px 0 0; font-size: .9rem; color: var(--texte-2); }
.eligibilite-mini a { font-weight: 700; }
.reinit { background: none; border: 0; padding: 0; color: var(--texte-3); font-weight: 600; font-size: .88rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: start; align-self: flex-start; }
.reinit:hover { color: var(--nuit); }

/* --- Sections de détail --- */
.section { margin-top: clamp(56px, 8vw, 104px); }
.section .entete-section { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.section .entete-section h2 { font-size: clamp(2rem, 4vw, 3.2rem); max-width: 16ch; }
.section .entete-section .repere { margin-bottom: 18px; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: clamp(28px, 4vw, 56px); }
.colonnes-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: clamp(24px, 3vw, 44px); }
.bloc { min-width: 0; }
.bloc > h3 { font-size: 1.25rem; padding-top: 14px; border-top: 1px solid var(--nuit); margin-bottom: 14px; }
.panneau { background: var(--blanc); border: 1px solid var(--trait); padding: clamp(18px, 3vw, 30px); border-radius: var(--rayon); }
@media (max-width: 600px) { .colonnes { grid-template-columns: 1fr; } }

.controles { list-style: none; margin: 0; padding: 0; }
.controles li { display: grid; grid-template-columns: 24px minmax(0, 1fr) minmax(0, max-content); gap: 14px; align-items: start; padding: 13px 0; border-bottom: 1px solid var(--trait); font-size: .96rem; }
.controles .icone { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 800; color: #fff; margin-top: 1px; }
.controles .ok .icone { background: var(--ok); }
.controles .ko .icone { background: var(--ko); }
.controles .verif .icone { background: #D08A1C; }
.controles .neutre .icone { background: transparent; color: var(--nuit); border: 1px solid var(--nuit); }
.controles .lib { font-weight: 600; color: var(--nuit); }
.controles .detail-c { color: var(--texte-2); font-variant-numeric: tabular-nums; font-size: .88rem; text-align: right; max-width: 250px; }
@media (max-width: 600px) { .controles li { grid-template-columns: 22px 1fr; } .controles .detail-c { grid-column: 2; text-align: left; } }
.alertes { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.alertes li { background: var(--brume); color: var(--nuit); padding: 14px 16px; border-left: 3px solid var(--bleu); font-size: .92rem; }

.graphique svg { width: 100%; height: auto; }
.legende { display: flex; gap: 22px; flex-wrap: wrap; font-size: .84rem; color: var(--texte-2); margin-top: 12px; font-weight: 600; }
.legende span::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; background: var(--c); }
.legende span.ligne::before { height: 2px; vertical-align: 4px; }

.lignes-cles { display: grid; grid-template-columns: 1fr auto; margin: 0; font-size: .96rem; }
.lignes-cles dt, .lignes-cles dd { padding: 10px 0; border-bottom: 1px solid var(--trait); margin: 0; }
.lignes-cles dt { color: var(--texte-2); padding-right: 12px; }
.lignes-cles dd { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--nuit); white-space: nowrap; }
.lignes-cles .fort { font-weight: 800; color: var(--nuit); border-bottom: 0; border-top: 1px solid var(--nuit); }
.lignes-cles dd.fort { color: var(--bleu); }

.onglets { display: flex; gap: 32px; border-bottom: 1px solid var(--trait-moyen); margin-bottom: 22px; overflow-x: auto; }
.onglets button { background: none; border: 0; padding: 14px 0; font-weight: 600; font-size: 1rem; color: var(--texte-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.onglets button:hover { color: var(--nuit); }
.onglets button[aria-selected="true"] { color: var(--nuit); border-bottom-color: var(--bleu); }
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 11px 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--trait); }
th:first-child, td:first-child { text-align: left; position: sticky; left: 0; background: var(--blanc); font-weight: 700; padding-left: 0; }
thead th { font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-3); font-weight: 600; border-bottom: 1px solid var(--nuit); vertical-align: bottom; white-space: normal; min-width: 96px; line-height: 1.35; }
thead th:first-child { min-width: 62px; }
tbody tr:hover td { background: var(--ivoire); }
tr.total td { font-weight: 800; color: var(--nuit); border-top: 1px solid var(--nuit); border-bottom: 0; }
td.neg { color: var(--ko); }
.note { font-size: .88rem; color: var(--texte-3); margin: 0 0 16px; }

/* --- Barre mobile --- */
.barre-mobile { display: none; }
@media (max-width: 1080px) {
  .barre-mobile { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: var(--nuit); color: #fff; padding: 12px var(--gouttiere) calc(12px + env(safe-area-inset-bottom)); gap: 22px; align-items: center; }
  .barre-mobile div { display: flex; flex-direction: column; line-height: 1.2; }
  .barre-mobile .l { font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: rgba(255,255,255,.72); font-weight: 600; }
  .barre-mobile .v { font-size: 1.12rem; font-weight: 800; font-variant-numeric: tabular-nums; }
  .barre-mobile .btn { margin-left: auto; min-height: 42px; padding: 0 16px; }
  .page { padding-bottom: 120px; }
}

/* --- Accueil --- */
.accueil-ouverture { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
@media (max-width: 900px) { .accueil-ouverture { grid-template-columns: 1fr; } }
.photo { position: relative; margin: 0; }
.photo img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.photo .cadre { position: relative; }
.photo .bande-sigle { position: absolute; left: -14px; top: 12%; bottom: 0; width: 14px; background: var(--bleu); }
.photo figcaption { font-size: .8rem; color: var(--texte-3); margin-top: 10px; }
.liste-outils { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--nuit); }
.liste-outils li { border-bottom: 1px solid var(--trait-moyen); }
.liste-outils a { display: grid; grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1.1fr) 40px; gap: 24px; align-items: center; padding: 28px 0; text-decoration: none; color: var(--nuit); transition: background .15s; }
.liste-outils a:hover { background: rgba(255,255,255,.55); }
.liste-outils .num { color: var(--bleu); font-weight: 700; font-variant-numeric: tabular-nums; font-size: .95rem; padding-left: 4px; }
.liste-outils h3 { font-size: clamp(1.3rem, 2vw, 1.6rem); }
.liste-outils p { margin: 0; color: var(--texte-2); }
.liste-outils .fleche::after { width: 28px; height: 14px; margin: 0; }
@media (max-width: 760px) { .liste-outils a { grid-template-columns: 40px 1fr 28px; } .liste-outils p { grid-column: 2 / 3; } .liste-outils .fleche { grid-row: 1; grid-column: 3; } }
.chiffres-cles.grand .v { font-size: clamp(2rem, 3.6vw, 2.8rem); color: var(--nuit); letter-spacing: -0.02em; }
.chiffres-cles.grand > div { padding-top: 20px; padding-bottom: 8px; }

.final { margin-top: clamp(56px, 8vw, 104px); position: relative; overflow: hidden; }
.final .motif { width: min(28vw, 360px); }
.final .motif svg { right: -18%; bottom: -24%; height: 118%; }
.final .conteneur { padding-top: clamp(48px, 7vw, 88px); padding-bottom: clamp(48px, 7vw, 88px); position: relative; z-index: 1; }
.final h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 16ch; }
.final p { color: rgba(255,255,255,.82); max-width: 52ch; margin: 18px 0 30px; font-size: 1.08rem; }
.final .bande-cta { max-width: 520px; }

/* --- Page commune --- */
.fiche-commune { display: grid; gap: 26px; }
.fiche-commune .entete-fiche { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.zone-badge { width: 112px; height: 112px; background: var(--nuit); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 2.4rem; font-weight: 800; letter-spacing: -0.02em; flex: none; line-height: 1; border-radius: var(--rayon); }
.zone-badge small { display: block; font-size: .62rem; letter-spacing: .22em; font-weight: 600; color: rgba(255,255,255,.72); margin-bottom: 8px; }
.verdict { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.05rem; }
.verdict::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: currentColor; }
.verdict.oui { color: var(--ok); }
.verdict.non { color: var(--ko); }
.verdict.a_verifier { color: var(--vigilance); }
.attente h3 { font-size: clamp(1.7rem, 3vw, 2.3rem); max-width: 14ch; }
.attente p { color: var(--texte-2); max-width: 44ch; margin-top: 14px; }
.exemples { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.exemples button { background: var(--blanc); border: 1px solid var(--trait-moyen); border-radius: var(--rayon); padding: 9px 14px; font-weight: 600; color: var(--nuit); cursor: pointer; font-size: .92rem; }
.exemples button:hover { border-color: var(--nuit); }
.liste-numerotee { list-style: none; margin: 0; padding: 0; counter-reset: n; }
.liste-numerotee li { counter-increment: n; display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.liste-numerotee li::before { content: counter(n, decimal-leading-zero); color: var(--bleu); font-weight: 700; font-variant-numeric: tabular-nums; }
.encadre { background: var(--brume); padding: 20px 22px; border-radius: var(--rayon); }
.encadre .repere { margin-bottom: 8px; }
.encadre p { margin: 0; color: var(--nuit); }

/* --- Pied de page --- */
.pied { background: var(--nuit); color: rgba(255,255,255,.76); }
.pied .conteneur { padding-top: 48px; padding-bottom: 52px; display: grid; grid-template-columns: 260px 1fr; gap: 28px 64px; align-items: start; font-size: .86rem; line-height: 1.6; }
.pied img { height: 54px; width: auto; }
.pied p { margin: 0 0 .6em; max-width: 84ch; }
.pied .bas-pied { grid-column: 1 / -1; border-top: 1px solid var(--trait-clair); padding-top: 18px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.6); }
@media (max-width: 760px) { .pied .conteneur { grid-template-columns: 1fr; padding-bottom: 120px; } }

@media print {
  .entete, .colonne-formulaire, .barre-mobile, .onglets, .reglages, .pas-imprimer, .pied, .motif { display: none !important; }
  body { background: #fff; font-size: 11pt; }
  .grille { display: block; }
  .colonne-resume { position: static; margin-bottom: 24px; }
  [data-panneau] { display: block !important; margin-bottom: 18px; }
  .resultat, .panneau, .bloc { break-inside: avoid; }
  .sombre { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .ouverture { border: 0; }
}

/* Grille de chiffres clés à trois colonnes (plusieurs lignes) */
.chiffres-cles.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chiffres-cles.trois > div { border-bottom: 1px solid var(--trait); padding-bottom: 14px; }
.chiffres-cles.trois > div:nth-child(3n+1) { padding-left: 0; border-left: 0; }
@media (max-width: 600px) {
  .chiffres-cles.trois { grid-template-columns: 1fr 1fr; }
  .chiffres-cles.trois > div:nth-child(3n+1) { padding-left: 18px; border-left: 1px solid var(--trait); }
  .chiffres-cles.trois > div:nth-child(odd) { padding-left: 0; border-left: 0; }
}
.final + .pied .conteneur { border-top: 1px solid var(--trait-clair); }
.segment a { display: inline-flex; align-items: center; text-decoration: none; color: var(--nuit); font-weight: 600; font-size: .92rem; padding: 0 18px; min-height: 44px; border-right: 1px solid var(--trait); }
.segment a:last-child { border-right: 0; }
.segment a[aria-current="page"] { background: var(--nuit); color: #fff; }
.choix.six { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-auto-flow: row; }
@media (max-width: 520px) { .choix.six { grid-template-columns: repeat(3, minmax(0, 1fr)); } .choix.six button:nth-child(3) { border-right: 0; } .choix.six button:nth-child(-n+3) { border-bottom: 1px solid var(--trait); } }

/* ==========================================================================
   Dispositifs clos (archives) : bandeau visible, présentation en retrait
   ========================================================================== */
[hidden] { display: none !important; }
.bandeau-archive { display: flex; gap: 16px; align-items: flex-start; margin: 26px 0 0; padding: 16px 18px; max-width: 760px;
  background: var(--blanc); border: 1px solid var(--nuit); border-left: 4px solid var(--nuit); }
.bandeau-archive .etiquette { flex: none; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 800; color: var(--blanc); background: var(--nuit); padding: 5px 9px; }
.bandeau-archive p { margin: 0; font-size: .95rem; line-height: 1.5; color: var(--texte); }
body.archive .ouverture .motif { opacity: .35; }
body.archive .ouverture h1 { color: var(--texte-2); }
.archive-resultat { margin: 0 0 14px; font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--nuit); background: var(--brume); display: inline-block; padding: 5px 9px; }
.etiquette-clos { display: inline-block; font-size: .66rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--texte-2); border: 1px solid var(--trait-moyen); padding: 2px 7px; }

/* Accueil : archives au second plan */
.archives { margin-top: clamp(40px, 6vw, 72px); padding-top: 28px; border-top: 1px solid var(--trait); }
.archives h3 { font-size: 1.05rem; margin: 0 0 6px; color: var(--texte-2); }
.archives > p { color: var(--texte-3); font-size: .92rem; margin: 0 0 18px; max-width: 70ch; }
.liste-archives { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0; border-top: 1px solid var(--trait); }
.liste-archives li { border-bottom: 1px solid var(--trait); }
.liste-archives a { display: block; padding: 14px 16px 14px 0; color: var(--texte-2); text-decoration: none; }
.liste-archives a:hover strong { color: var(--bleu); }
.liste-archives strong { display: block; font-size: .98rem; color: var(--texte); }
.liste-archives span { display: block; font-size: .82rem; color: var(--texte-3); margin-top: 3px; }
.liste-archives .modes { margin-top: 6px; font-size: .78rem; }
.liste-archives .modes a { display: inline; padding: 0; margin-right: 12px; color: var(--bleu); font-weight: 700; }

/* ==========================================================================
   Coordonnées obligatoires avant un document
   ========================================================================== */
body.modale-ouverte { overflow: hidden; }
.porte-contact { position: fixed; inset: 0; z-index: 100; background: rgba(20, 37, 56, .62); display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.porte-contact .carte { position: relative; background: var(--ivoire); max-width: 620px; width: 100%; padding: clamp(24px, 4vw, 40px); border-top: 4px solid var(--bleu); max-height: calc(100vh - 32px); overflow-y: auto; }
.porte-contact h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 10px 0 8px; max-width: 24ch; }
.porte-contact .intro { color: var(--texte-2); margin: 0 0 18px; }
.porte-contact .champs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; margin-bottom: 20px; }
.porte-contact .champ.large { grid-column: 1 / -1; }
.porte-contact .erreur { display: block; color: var(--ko); font-size: .82rem; font-weight: 600; min-height: 0; margin-top: 4px; }
.porte-contact .champ.invalide .saisie { border-color: var(--ko); }
.porte-contact .fermer { position: absolute; top: 10px; right: 12px; background: none; border: 0; font-size: 1.8rem; line-height: 1; color: var(--texte-2); cursor: pointer; padding: 4px 8px; }
.porte-contact .mention { font-size: .78rem; color: var(--texte-3); margin: 16px 0 0; line-height: 1.5; }
.porte-contact .piege { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.porte-contact .mention a { color: var(--bleu); }
@media (max-width: 560px) { .porte-contact .champs { grid-template-columns: 1fr; } }
@media print { .porte-contact { display: none !important; } }

.liste-outils .nouveau { display: inline-block; vertical-align: middle; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 800; color: var(--blanc); background: var(--bleu); padding: 3px 7px; margin-left: 6px; }
.liste-outils .variante { display: block; font-size: .85rem; color: var(--texte-3); padding: 0 0 18px 88px; margin-top: -14px; }
.liste-outils .variante a { display: inline; padding: 0; color: var(--bleu); font-weight: 700; background: none; }
@media (max-width: 760px) { .liste-outils .variante { padding-left: 64px; } }
.liste-archives .etiquette-clos { display: inline-block; margin: 0 0 0 6px; vertical-align: 2px; }
.liste-archives .modes { display: block; padding: 0 0 12px; }

/* Exports du tableau d'amortissement */
.resultat .exports { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.resultat .exports .l { grid-column: 1 / -1; font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 600; color: rgba(255,255,255,.7); }
.resultat .exports .btn { justify-content: center; min-height: 44px; }
.btn-contour-clair { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn-contour-clair:hover { border-color: #fff; }
@media (max-width: 420px) { .resultat .exports { grid-template-columns: 1fr; } }
