/* Polices hébergées localement (licence OFL, voir static/blog/fonts) :
   aucune requête vers un service tiers. */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/fraunces-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/outfit-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../fonts/outfit-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

:root {
  --fond: #08111a;
  --fond-2: #101a27;
  --encre: #f4f7fb;
  --muet: #93a4b8;
  --ligne: rgba(228, 236, 246, 0.12);
  --carte: rgba(16, 28, 43, 0.92);
  --menthe: #3ee0a2;
  --menthe-encre: #042117;
  --or: #e4b15c;
  --corail: #ff7384;
  --bleu: #9ec4ff;
  --ombre: 0 18px 40px rgba(0, 0, 0, 0.22);
  --rayon: 16px;
  --sans: "Outfit", "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;
}

html.texte-petite { font-size: 15px; }
html.texte-normale { font-size: 16px; }
html.texte-grande { font-size: 18px; }
html.texte-tres_grande { font-size: 21px; }

html.theme-ocean {
  --fond: #071422;
  --encre: #e7f2ff;
  --muet: #8eabcc;
  --ligne: rgba(180, 210, 255, 0.16);
  --carte: rgba(10, 28, 52, 0.94);
  --menthe: #7ec8ff;
  --menthe-encre: #042033;
  --or: #f0c27a;
  --corail: #ff8b9a;
  --bleu: #b7d4ff;
}

html.theme-clair {
  --fond: #f4f6f8;
  --encre: #15202b;
  --muet: #5c6b7a;
  --ligne: #e3e8ee;
  --carte: #ffffff;
  --menthe: #0f6e56;
  --menthe-encre: #ffffff;
  --or: #8a5a12;
  --corail: #b42318;
  --bleu: #1849a9;
  --ombre: 0 1px 2px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

/* Barre de défilement du document masquée : la page défile toujours
   à la molette, au tactile et au clavier. */
html { scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; }
html::-webkit-scrollbar { width: 0; height: 0; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--encre);
  background:
    linear-gradient(180deg, rgba(62, 224, 162, 0.05), transparent 220px),
    var(--fond);
  line-height: 1.5;
}

a { color: var(--menthe); text-decoration: none; }
a:hover { color: #b9ffe2; }

h1, h2, h3, legend {
  font-family: var(--serif);
  font-weight: 560;
  line-height: 1.15;
  margin: 0 0 0.45rem;
}
h1 { font-size: clamp(2.2rem, 4vw, 3.7rem); }
h2 { font-size: 1.55rem; }
p { margin: 0 0 0.75rem; }

.espace h1 { font-size: clamp(1.7rem, 2.4vw, 2.35rem); }

.aller {
  position: absolute;
  left: -999px;
}
.aller:focus {
  left: 12px;
  top: 12px;
  z-index: 30;
  background: var(--menthe);
  color: var(--menthe-encre);
  padding: 8px 12px;
  border-radius: 8px;
}

.barre, .pied { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.vitrine .coque { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  padding: 18px 0 8px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--encre);
  font-weight: 700;
}
.logo-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--menthe);
  color: var(--menthe-encre);
  font-family: var(--serif);
}

.menu-toggle { position: absolute; opacity: 0; pointer-events: none; }
.menu-bouton {
  display: none;
  margin-left: auto;
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.nav-liens {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-liens a, .lien-nav {
  color: var(--encre);
  background: transparent;
  border: 0;
  font: inherit;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}
.nav-liens a:hover, .lien-nav:hover, .nav-liens a.actif {
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.colonne { min-width: 0; }
.espace main { width: auto; margin: 0; padding: 8px 0 48px; }
.vitrine main { padding: 28px 0 64px; }

/* Espace de travail : le rail occupe toute la hauteur à gauche,
   l'en-tête, le contenu et le pied restent dans la colonne de droite. */
body.espace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}
body.espace > .aller { position: absolute; }
body.espace > .barre {
  grid-column: 2;
  grid-row: 1;
  width: auto;
  margin: 0;
  padding: 18px 32px 8px;
}
body.espace > .coque { display: contents; }
body.espace > .pied {
  grid-column: 2;
  grid-row: 3;
  width: auto;
  margin: 0;
  padding: 18px 32px 32px;
}
body.espace > .bandeau-cookies { grid-column: 1 / -1; }

.rail-app {
  grid-column: 1;
  grid-row: 1 / -1;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  /* Pas d'ascenseur visible : le rail reste défilable si l'écran est très bas. */
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 18px 14px 22px;
  border: 0;
  border-right: 1px solid var(--ligne);
  border-radius: 0;
  background: rgba(8, 14, 22, 0.96);
}
body.espace .colonne { grid-column: 2; grid-row: 2; padding: 0 32px; }
.rail-app p {
  margin: 4px 8px 8px;
  color: var(--muet);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.rail-app::-webkit-scrollbar { display: none; }
.rail-app a {
  color: var(--encre);
  padding: 8px 10px;
  white-space: nowrap;
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease;
}
.rail-app a:hover, .rail-app a.actif { background: rgba(62, 224, 162, 0.12); color: white; }
.rail-app form { display: contents; }
.rail-bouton {
  display: block;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  color: var(--encre);
  padding: 9px 10px;
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease;
}
.rail-bouton:hover { background: rgba(62, 224, 162, 0.12); color: white; }

.pied {
  padding: 18px 0 32px;
  color: var(--muet);
  font-size: 0.92rem;
  border-top: 1px solid var(--ligne);
}

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  align-items: stretch;
  margin-bottom: 36px;
}
.chapeau { font-size: 1.06rem; color: var(--muet); max-width: 62ch; }
.surtitre {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  color: var(--or);
  margin-bottom: 8px;
}
.muet, .aide { color: var(--muet); }
.aide { font-size: 0.85rem; margin: 6px 0 0; }

.carte {
  background: var(--carte);
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  padding: 18px;
  box-shadow: var(--ombre);
  transition: transform 280ms cubic-bezier(0.22, 1, 0.36, 1), border-color 280ms ease, box-shadow 280ms ease;
}
.grille-2 > .carte:hover,
.grille-3 > .carte:hover,
.grille-4 > .carte:hover,
.bandeau > .carte:hover,
.catalogue > .carte:hover,
.hero > .carte:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--menthe) 42%, var(--ligne));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}
.entete-page, .rangee-actions, .appel {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: flex-end;
}
.entete-page { margin-bottom: 18px; align-items: flex-start; }
.entete-page .rangee-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 34rem;
}
.rangee-actions { flex-wrap: wrap; }
.vide { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.bouton, a.bouton, button.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--menthe);
  color: var(--menthe-encre);
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.bouton:hover { transform: translateY(-1px); }
.bouton:hover { background: #6af0bb; color: var(--menthe-encre); }
.bouton.secondaire, a.bouton.secondaire {
  background: transparent;
  color: var(--encre);
  border: 1px solid var(--ligne);
}
.bouton.danger, a.bouton.danger {
  background: transparent;
  color: var(--corail);
  border: 1px solid rgba(255, 115, 132, 0.45);
}
.bouton:disabled { opacity: 0.55; cursor: not-allowed; }
.bouton.petit { padding: 8px 12px; }

.messages { list-style: none; padding: 8px 0 0; margin: 0; }
.alerte {
  border: 1px solid var(--ligne);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.alerte.success { border-color: rgba(62, 224, 162, 0.45); background: rgba(62, 224, 162, 0.08); }
.alerte.error { border-color: rgba(255, 115, 132, 0.5); background: rgba(255, 115, 132, 0.08); }
.alerte.info { border-color: rgba(158, 196, 255, 0.45); background: rgba(158, 196, 255, 0.08); }

.grille-2, .grille-3, .grille-4, .bandeau, .grille-form, .catalogue { display: grid; gap: 14px; }
.grille-2 { grid-template-columns: repeat(2, 1fr); }
.grille-3, .catalogue { grid-template-columns: repeat(3, 1fr); }
.grille-4, .bandeau { grid-template-columns: repeat(4, 1fr); margin: 8px 0 22px; }
.grille-form { grid-template-columns: 1fr 1fr; }
.plein { grid-column: 1 / -1; }

.stat p, .kpi p { color: var(--muet); margin-bottom: 4px; font-size: 0.86rem; }
.stat strong, .kpi strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}
.texte-court { font-size: 1.05rem !important; }

.module-lien {
  display: block;
  color: var(--encre);
  min-height: 118px;
}
.module-lien:hover { border-color: rgba(62, 224, 162, 0.45); color: white; }
.module-lien span {
  display: block;
  color: var(--or);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.rail-modules {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 16px;
  position: sticky;
  top: 0;
  z-index: 5;
  background: linear-gradient(180deg, var(--fond) 70%, transparent);
}
.rail-modules a {
  flex: 0 0 auto;
  color: var(--encre);
  border: 1px solid var(--ligne);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(8, 17, 26, 0.9);
  transition: border-color 180ms ease, color 180ms ease, background 180ms ease, transform 180ms ease;
}
.rail-modules a:hover { transform: translateY(-1px); }
.rail-modules a:hover, .rail-modules a.actif { border-color: var(--menthe); color: white; }
.compte-lien { display: inline-flex; align-items: center; gap: 8px; color: var(--encre); }
.avatar, .avatar-lettre {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.avatar-lettre {
  display: inline-grid;
  place-items: center;
  background: var(--menthe);
  color: var(--menthe-encre);
  font-weight: 700;
  text-transform: uppercase;
}
.avatar-grand, .avatar-lettre.avatar-grand { width: 96px; height: 96px; font-size: 2rem; }
.portrait { display: flex; gap: 18px; align-items: center; margin-bottom: 8px; }

.liste-scenarios, .scenario dl, .mini-indicateurs { list-style: none; padding: 0; margin: 0; }
.liste-scenarios li, .scenario dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--ligne);
}
.mini-indicateurs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.mini-indicateurs dt, .scenario dt, .kpi-liste dt { color: var(--muet); font-size: 0.8rem; }
.mini-indicateurs dd, .scenario dd, .kpi-liste dd { margin: 0; font-weight: 650; }
.kpi-liste { display: grid; gap: 8px; }
.kpi-liste div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--ligne); padding-bottom: 6px; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge.rentable, .badge.faible { background: rgba(62, 224, 162, 0.16); color: var(--menthe); }
.badge.non_rentable, .badge.hypothese, .badge.important, .badge.manquant { background: rgba(228, 177, 92, 0.16); color: var(--or); }
.badge.non_viable, .badge.critique { background: rgba(255, 115, 132, 0.16); color: var(--corail); }
.badge.saisi { background: rgba(158, 196, 255, 0.16); color: var(--bleu); }

/* Le défilement reste possible (molette, tactile, clavier) mais la barre est masquée. */
.table-scroll,
.rail-modules,
.choix-liste { scrollbar-width: none; -ms-overflow-style: none; }
.table-scroll::-webkit-scrollbar,
.rail-modules::-webkit-scrollbar,
.choix-liste::-webkit-scrollbar { width: 0; height: 0; }
.table-scroll { overflow-x: auto; overscroll-behavior-x: contain; }
/* Tableaux du prévisionnel : jusqu'à huit colonnes monétaires. Plus compacts et
   alignés à droite, ils tiennent dans la largeur sans défilement horizontal,
   ce qui compte d'autant plus que les barres de défilement sont masquées. */
.table-chiffres table { font-size: 0.84rem; }
.table-chiffres th,
.table-chiffres td { padding: 9px 7px; text-align: right; font-variant-numeric: tabular-nums; }
.table-chiffres th:first-child,
.table-chiffres td:first-child { text-align: left; }
table caption { caption-side: top; text-align: left; padding: 0 7px 8px; font-size: 0.82rem; }
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 11px 10px;
  border-bottom: 1px solid var(--ligne);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
th { color: var(--muet); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
td.nom, td.nom a { white-space: normal; }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }

.champ, select.champ, textarea.champ {
  width: 100%;
  margin-top: 6px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--ligne);
  background: rgba(5, 12, 20, 0.55);
  color: var(--encre);
  font: inherit;
}
.champ:focus { outline: 2px solid rgba(62, 224, 162, 0.65); border-color: transparent; }
input[type="checkbox"].champ, input[type="file"].champ { width: auto; }
textarea.champ { resize: vertical; }
.champ-bloc { margin-bottom: 4px; }
.errorlist { list-style: none; padding: 0; margin: 6px 0 0; color: var(--corail); font-size: 0.88rem; }
fieldset { border: 0; padding: 0; margin: 0 0 8px; }
legend { font-size: 1.3rem; }
.auth { max-width: 640px; margin: 12px auto; }
.auth form, .formulaire { display: grid; gap: 14px; }
.formulaire fieldset {
  border: 1px solid var(--ligne);
  border-radius: 16px;
  padding: 16px;
  /* L'écart entre blocs vient du gap de la grille du formulaire : une marge
     ici viendrait s'y ajouter et doublerait l'espacement. */
  margin: 0;
}

/* Zones pliables du dossier projet : une case à cocher masquée pilote sa section. */
.bascule-zone { position: absolute; opacity: 0; pointer-events: none; }
.formulaire fieldset.pliable { transition: border-color 220ms ease, background 220ms ease; }
.bascule-zone:checked + .pliable {
  border-color: rgba(62, 224, 162, 0.32);
  background: rgba(62, 224, 162, 0.04);
}
.pliable legend {
  /* Une légende flottante sort de l'encoche de bordure du fieldset : sans cela,
     sur toute la largeur, elle efface le trait supérieur du cadre. */
  float: left;
  width: 100%;
  margin: 0;
  padding: 0;
}
.pliable legend label {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  cursor: pointer;
  padding: 2px 0;
  border-radius: 10px;
}
.pliable legend label:hover { color: var(--menthe); }
.bascule-zone:focus-visible + .pliable legend label {
  outline: 2px solid rgba(62, 224, 162, 0.65);
  outline-offset: 4px;
}
.chevron {
  width: 9px;
  height: 9px;
  flex: none;
  border-right: 2px solid var(--menthe);
  border-bottom: 2px solid var(--menthe);
  transform: rotate(-45deg);
  transition: transform 260ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
.bascule-zone:checked + .pliable .chevron { transform: rotate(45deg); }
.pliable-corps {
  clear: both;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 300ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
.pliable-corps > * {
  /* min-height: 0 est indispensable : un enfant de grille vaut min-height: auto
     par défaut et refuserait alors de se comprimer jusqu'à zéro.
     Le padding suit le même raisonnement : en border-box il ne se comprime pas,
     il n'est donc posé qu'à l'ouverture, sinon la zone repliée garderait
     quatorze pixels de hauteur. */
  min-height: 0;
  padding-top: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  transition:
    opacity 200ms ease,
    padding-top 300ms cubic-bezier(0.22, 0.8, 0.3, 1),
    visibility 0s linear 300ms;
}
.bascule-zone:checked + .pliable .pliable-corps { grid-template-rows: 1fr; }
.bascule-zone:checked + .pliable .pliable-corps > * {
  padding-top: 14px;
  visibility: visible;
  opacity: 1;
  transition:
    opacity 260ms ease 60ms,
    padding-top 300ms cubic-bezier(0.22, 0.8, 0.3, 1),
    visibility 0s;
}
/* Les commandes partagent la ligne d'en-tête avec le titre : sans flex-shrink
   à zéro elles se font comprimer et les libellés passent à la ligne. */
.commandes-zones { align-items: center; gap: 10px; flex: none; }
.commandes-zones .bouton { white-space: nowrap; }
.compte-zones { font-size: 0.9rem; white-space: nowrap; }

.etapes { padding-left: 18px; max-width: 70ch; }
.etapes li { margin: 0 0 12px; }
.scenario.realiste { border-color: rgba(62, 224, 162, 0.5); }
.scenario.pessimiste { border-color: rgba(255, 115, 132, 0.45); }
.scenario.optimiste { border-color: rgba(228, 177, 92, 0.5); }
.scenario.personnalise { border-color: rgba(158, 196, 255, 0.45); }
.scenario header { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.scenario dl { list-style: none; padding: 0; margin: 12px 0 0; }
.scenario dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ligne);
}
.graphe { width: 100%; height: 320px; display: block; margin: 12px 0; }
.legende { display: flex; gap: 16px; list-style: none; padding: 0; color: var(--muet); }
.puce { width: 10px; height: 10px; border-radius: 99px; display: inline-block; margin-right: 6px; }
.puce.flux { background: var(--menthe); }
.puce.cumul { background: var(--or); }
.pistes { white-space: pre-wrap; font: inherit; color: var(--muet); }
.choix-liste { display: grid; gap: 10px; }
.choix { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--ligne); }
.choix small { color: var(--muet); margin-left: auto; }
.methode summary { cursor: pointer; font-weight: 700; }
.barre-outils { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.barre-outils .champ { max-width: 280px; }

.section-module { scroll-margin-top: 64px; margin-bottom: 16px; }
.entete-famille { margin: 22px 0 12px; }
.entete-famille h2 { margin-bottom: 4px; }
.concepts { align-items: start; }
.concept h3 { margin-top: 0; }
.formule {
  border-left: 3px solid var(--or);
  padding: 8px 12px;
  color: var(--encre);
  background: rgba(228, 177, 92, 0.08);
  border-radius: 0 12px 12px 0;
}
.lecture { margin-top: 12px; }
.calculatrice {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--ligne);
}
.jauge {
  height: 8px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 8px;
}
.jauge span {
  display: block;
  height: 100%;
  background: var(--menthe);
  transition: width 340ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
.jauge-risque { display: block; max-width: 130px; margin-top: 6px; }
.jauge-avancement { display: block; max-width: 420px; margin-top: 6px; }
.jauge-risque.important span { background: var(--or); }
.jauge-risque.critique span { background: var(--corail); }
.criticite { display: inline-block; margin-left: 8px; color: var(--muet); font-variant-numeric: tabular-nums; }

@media (max-width: 980px) {
  .hero, .bandeau, .grille-4, .grille-3, .catalogue { grid-template-columns: 1fr 1fr; }
  body.espace {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
  }
  body.espace > .barre { grid-column: 1; grid-row: 1; padding-inline: 16px; }
  .rail-app {
    grid-column: 1;
    grid-row: 2;
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--ligne);
  }
  body.espace .colonne { grid-column: 1; grid-row: 3; padding-inline: 16px; }
  body.espace > .pied { grid-column: 1; grid-row: 4; padding-inline: 16px; }
  .entete-page, .appel { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 720px) {
  .menu-bouton { display: inline-flex; }
  .nav-liens { display: none; width: 100%; flex-direction: column; align-items: stretch; margin-left: 0; }
  .menu-toggle:checked ~ .nav-liens { display: flex; }
  .hero, .bandeau, .grille-4, .grille-3, .grille-2, .grille-form, .catalogue, .mini-indicateurs, .rail-app { grid-template-columns: 1fr; }
  .graphe { height: 220px; }
}
@media print {
  body { background: white; color: black; }
  .barre, .pied, .rail-app, .rail-modules, .rangee-actions, .bouton, .messages, .progression-scroll { display: none !important; }
  body.espace { display: block; }
  .carte { box-shadow: none; background: white; color: black; }
}
html.theme-clair body {
  background: var(--fond);
}
html.theme-clair a:hover { color: #0a5341; }
html.theme-clair .nav-liens a:hover,
html.theme-clair .lien-nav:hover,
html.theme-clair .nav-liens a.actif,
html.theme-clair .rail-app a:hover,
html.theme-clair .rail-app a.actif,
html.theme-clair .rail-bouton:hover {
  background: #e7f5ef;
  color: #0f6e56;
}
html.theme-clair .rail-app { background: #ffffff; }
html.theme-clair .menu-bouton { background: #ffffff; color: var(--encre); }
html.theme-clair .champ,
html.theme-clair select.champ,
html.theme-clair textarea.champ {
  background: #ffffff;
  color: var(--encre);
  border-color: #d5dbe3;
}
html.theme-clair .rail-modules a { background: #ffffff; color: var(--encre); }
html.theme-clair .rail-modules a:hover,
html.theme-clair .rail-modules a.actif { color: #0f6e56; }
html.theme-clair .module-lien:hover { color: var(--encre); }
html.theme-clair .bouton.secondaire,
html.theme-clair a.bouton.secondaire { background: #ffffff; }
html.theme-clair tbody tr:hover { background: #f7faf8; }
html.theme-clair th { background: #f8fafb; }
html.theme-clair .formule { background: #e7f5ef; border-left-color: var(--menthe); }
html.theme-clair .jauge { background: #e6ebf0; }
html.theme-clair .choix-theme ul,
html.theme-clair .champ-bloc ul { background: transparent; }

.bandeau-cookies {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: var(--carte);
  border-top: 1px solid var(--ligne);
}
/* display: flex gagne sur l'attribut hidden du navigateur : sans cette
   règle, « J'ai compris » écrit bien hidden=true mais le bandeau reste visible. */
.bandeau-cookies[hidden] { display: none; }
.echange { padding: 16px 0; border-bottom: 1px solid var(--ligne); }
#fil-ia, #dernier-echange, #form-ia { scroll-margin-top: 80px; }
html.mouvement #contenu #fil-ia {
  opacity: 1;
  transform: none;
}
.echange:last-of-type { border-bottom: 0; }
.echange.assistant p {
  white-space: pre-wrap;
  line-height: 1.6;
  max-width: 46rem;
}
.filtres { margin-bottom: 18px; }
.champ-bloc ul { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.champ-bloc li label { display: flex; gap: 8px; align-items: center; font-weight: 600; }

.onglets { margin: 22px 0 28px; }
.onglets-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.onglets-nav [role="tab"] {
  appearance: none;
  border: 1px solid var(--ligne);
  background: transparent;
  color: var(--encre);
  font: inherit;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  max-width: 100%;
}
.onglets-nav [role="tab"][aria-selected="true"] {
  background: var(--menthe);
  color: var(--menthe-encre);
  border-color: transparent;
}
.onglets-nav [role="tab"]:hover { border-color: var(--menthe); }
.onglets [role="tabpanel"] { min-width: 0; }
.actions-ia-bloc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 8px 14px;
  border: 1px solid var(--ligne);
  border-radius: 14px;
  background: var(--carte);
  scroll-margin-top: 72px;
}
.actions-ia-bloc h2 { margin: 0; font-size: 0.95rem; }
.actions-ia-bloc .muet { display: none; }
.actions-ia {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}
.actions-ia form { margin: 0; }
.actions-ia .bouton {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.stats-publiques {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  margin: 8px 0 22px;
}
html.mouvement #contenu .actions-ia-bloc {
  opacity: 1;
  transform: none;
}
.lecture-dossier { margin-bottom: 16px; }
.lecture-dossier ul { margin: 8px 0 0; padding-left: 18px; }
.glossaire-indicateurs { display: grid; gap: 10px; }
.glossaire-indicateurs details {
  border-bottom: 1px solid var(--ligne);
  padding-bottom: 8px;
}
.glossaire-indicateurs summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--encre);
}
.kpi .aide-indicateur { margin: 8px 0 0; font-size: 0.8rem; }
.kpi .aide-indicateur summary { cursor: pointer; color: var(--muet); font-weight: 600; }
html.theme-clair .onglets-nav [role="tab"] { background: #ffffff; }
html.theme-clair .onglets-nav [role="tab"][aria-selected="true"] {
  background: var(--menthe);
  color: var(--menthe-encre);
}

.progression-scroll {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  height: 3px;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
  background: linear-gradient(90deg, var(--menthe), var(--or));
}
html.mouvement #contenu .entete-page,
html.mouvement #contenu .hero > *,
html.mouvement #contenu .carte,
html.mouvement #contenu .rail-modules,
html.mouvement #contenu .alerte,
html.mouvement #contenu .appel,
html.mouvement #contenu .section-module > h2,
html.mouvement #contenu .section-module > .muet,
html.mouvement #contenu .section-module > .aide,
html.mouvement #contenu .section-module > .etapes,
html.mouvement #contenu .section-module > .rangee-actions,
html.mouvement .dash-kpis article,
html.mouvement .dash-carte,
html.mouvement .dash-catalogue a {
  opacity: 0;
  transform: translateY(8px);
}
html.mouvement #contenu .carte .carte,
html.mouvement #contenu .carte.section-module > h2,
html.mouvement #contenu .carte.section-module > .muet,
html.mouvement #contenu .carte.section-module > .aide,
html.mouvement #contenu .carte.section-module > .etapes,
html.mouvement #contenu .carte.section-module > .rangee-actions {
  opacity: 1;
  transform: none;
}
html.mouvement #contenu .entete-page.vu,
html.mouvement #contenu .hero > *.vu,
html.mouvement #contenu .carte.vu,
html.mouvement #contenu .rail-modules.vu,
html.mouvement #contenu .alerte.vu,
html.mouvement #contenu .appel.vu,
html.mouvement #contenu .section-module > h2.vu,
html.mouvement #contenu .section-module > .muet.vu,
html.mouvement #contenu .section-module > .aide.vu,
html.mouvement #contenu .section-module > .etapes.vu,
html.mouvement #contenu .section-module > .rangee-actions.vu,
html.mouvement .dash-kpis article.vu,
html.mouvement .dash-carte.vu,
html.mouvement .dash-catalogue a.vu {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 200ms ease-out,
    transform 200ms ease-out,
    border-color 200ms ease,
    box-shadow 200ms ease;
  transition-delay: calc(var(--delai, 0) * 20ms);
}
html.mouvement #contenu .grille-2 > .carte.vu:hover,
html.mouvement #contenu .grille-3 > .carte.vu:hover,
html.mouvement #contenu .grille-4 > .carte.vu:hover,
html.mouvement #contenu .bandeau > .carte.vu:hover,
html.mouvement #contenu .stats-publiques > .carte.vu:hover,
html.mouvement #contenu .catalogue > .carte.vu:hover,
html.mouvement #contenu .hero > .carte.vu:hover {
  transform: translateY(-4px);
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto; }
  .pliable-corps,
  .pliable-corps > *,
  .chevron,
  .jauge span,
  .bouton,
  .carte { transition-duration: 0s !important; }
  html.mouvement #contenu .entete-page,
  html.mouvement #contenu .hero > *,
  html.mouvement #contenu .carte,
  html.mouvement #contenu .rail-modules,
  html.mouvement #contenu .alerte,
  html.mouvement #contenu .appel,
  html.mouvement #contenu .section-module > h2,
  html.mouvement #contenu .section-module > .muet,
  html.mouvement #contenu .section-module > .aide,
  html.mouvement #contenu .section-module > .etapes,
  html.mouvement #contenu .section-module > .rangee-actions,
  html.mouvement .dash-kpis article,
  html.mouvement .dash-carte,
  html.mouvement .dash-catalogue a {
    opacity: 1;
    transform: none;
  }
  .progression-scroll { display: none; }
}

/* Comparaison des dossiers */
.groupe-comparaison {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muet);
  background: rgba(62, 224, 162, 0.06);
}
td.meilleur { color: var(--menthe); font-weight: 650; }
