/* Grisbi — feuille de style unique du site.
   Un fond papier, des panneaux « nuit », des filets fins, un seul accent : l'Iris de l'app
   (Grisbi/UI/Design/Theme.swift). Aucun style en ligne dans les pages : la politique de sécurité
   du serveur (style-src 'self') les refuserait. */

@font-face {
  font-family: "Instrument Sans";
  src: url("../fonts/instrument-sans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;

  --papier: #fbfaf7;
  --papier-2: #f2f0eb;
  --encre: #131210;
  --encre-2: #5d5a54;
  --encre-3: #8f8b84;
  --filet: rgb(19 18 16 / 0.13);
  --filet-fort: rgb(19 18 16 / 0.28);

  --accent: #5b5bf5;
  --accent-fonce: #4646dc;
  --accent-clair: #a8a8ff;

  --nuit: #0c0b12;
  --nuit-texte: #fbfaf7;
  --nuit-texte-2: rgb(251 250 247 / 0.62);
  --nuit-texte-3: rgb(251 250 247 / 0.42);
  --nuit-filet: rgb(251 250 247 / 0.14);

  --rayon-petit: 4px;
  --rayon: 8px;
  --rayon-panneau: clamp(18px, 2.4vw, 32px);
  --gouttiere: clamp(20px, 3.4vw, 48px);
  --largeur: 1280px;
  --barre: 56px;

  --sans: "Instrument Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

/* ---------- Base ---------- */

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

/* Le fond de la racine est ce que le navigateur montre quand on tire la page au-delà de son bord
   (le rebond de macOS et d'iOS). Sur l'accueil et la page introuvable, le haut et le bas sont des
   panneaux nuit : la racine l'est aussi, sinon une bande claire apparaît au-dessus du haut de page. */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 96px;
  background: var(--papier);
}

html[data-fond="nuit"] {
  background: var(--nuit);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  font-weight: 500;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
picture,
canvas,
svg {
  display: block;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.nuit :focus-visible {
  outline-color: var(--accent-clair);
}

code,
kbd {
  font-family: var(--mono);
  font-size: 0.86em;
}

code {
  padding: 0.1em 0.35em;
  border: 1px solid var(--filet);
  border-radius: var(--rayon-petit);
  background: var(--papier-2);
  overflow-wrap: anywhere;
}

.nuit kbd {
  border-color: rgb(251 250 247 / 0.32);
}

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0.05em 0.4em;
  border: 1px solid var(--filet-fort);
  border-bottom-width: 2px;
  border-radius: var(--rayon-petit);
  text-align: center;
  line-height: 1.4;
}

.conteneur {
  width: 100%;
  max-width: calc(var(--largeur) + 2 * var(--gouttiere));
  margin-inline: auto;
  padding-inline: var(--gouttiere);
}

.evitement {
  position: absolute;
  left: 12px;
  top: -80px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: var(--rayon-petit);
  background: var(--encre);
  color: var(--papier);
  text-decoration: none;
}

.evitement:focus {
  top: 12px;
}

/* Présent pour les lecteurs d'écran, absent de l'écran. */
.invisible {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Les panneaux sombres : haut de page, données, appel final, pied. */
.nuit {
  background: var(--nuit);
  color: var(--nuit-texte);
}

/* ---------- Petites pièces ---------- */

/* L'étiquette : un petit cartouche en chasse fixe, au-dessus d'un titre. */
.etiquette {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 7px;
  border: 1px solid var(--filet-fort);
  border-radius: var(--rayon-petit);
  font-family: var(--mono);
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.nuit .etiquette {
  border-color: rgb(251 250 247 / 0.3);
}

.etiquette b {
  font-weight: 500;
  color: var(--accent);
}

.nuit .etiquette b {
  color: var(--accent-clair);
}

a.etiquette:hover {
  border-color: currentColor;
}

/* Un repère en chasse fixe : numéro, catégorie, moment. */
.repere {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--encre-3);
}

.nuit .repere {
  color: var(--nuit-texte-3);
}

/* La seconde moitié d'un titre, en retrait. */
.estompe {
  color: var(--encre-3);
}

.nuit .estompe {
  color: var(--nuit-texte-3);
}

/* Un lien d'action en chasse fixe, avec sa flèche. */
.lien-fleche {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--accent-fonce);
}

.nuit .lien-fleche {
  color: var(--accent-clair);
}

.lien-fleche::after {
  content: "→";
  transition: transform 0.18s ease;
}

.lien-fleche:hover::after {
  transform: translateX(4px);
}

/* ---------- Boutons ---------- */

.bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: var(--rayon-petit);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bouton:hover {
  background: var(--accent-fonce);
}

.bouton svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.bouton--court {
  padding: 9px 13px;
  font-size: 0.875rem;
}

/* Bouton au contour : l'action secondaire. « bouton--clair » est le nom qu'écrit generer.py. */
.bouton--contour,
.bouton--clair,
.bouton--fantome,
.bouton[data-etat="bientot"] {
  border-color: currentColor;
  border-color: color-mix(in srgb, currentColor 34%, transparent);
  background: transparent;
  color: inherit;
}

.bouton--contour:hover,
.bouton--clair:hover,
.bouton--fantome:hover,
.bouton[data-etat="bientot"]:hover {
  border-color: currentColor;
  background: transparent;
}

.bouton[data-etat="bientot"] svg {
  display: none;
}

.bouton-note {
  margin-top: 12px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--encre-3);
}

.nuit .bouton-note {
  color: var(--nuit-texte-3);
}

.bouton-note a {
  color: inherit;
}

/* ---------- Barre de navigation ---------- */

/* Une barre flottante, détachée des bords. Claire par défaut ; site.js la passe en sombre
   (data-ton="sombre") quand elle survole un panneau nuit. */
.barre {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  padding: 12px var(--gouttiere) 0;
  pointer-events: none;
}

.barre-cadre {
  position: relative;
  display: flex;
  align-items: center;
  max-width: var(--largeur);
  height: var(--barre);
  margin-inline: auto;
  padding: 0 8px 0 16px;
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
  background: rgb(251 250 247 / 0.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  backdrop-filter: blur(24px) saturate(1.2);
  box-shadow: 0 4px 16px rgb(19 18 16 / 0.06);
  color: var(--encre);
  pointer-events: auto;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.barre[data-ton="sombre"] .barre-cadre {
  border-color: rgb(251 250 247 / 0.1);
  background: rgb(29 28 36 / 0.62);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.4);
  color: var(--nuit-texte);
}

.marque {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.marque img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.barre-nav {
  margin-left: auto;
}

.barre-nav ul {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.barre-nav a {
  display: flex;
  align-items: center;
  height: var(--barre);
  padding: 0 16px;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.barre-nav a:hover,
.barre-nav a[aria-current="page"] {
  color: var(--accent-fonce);
}

.barre[data-ton="sombre"] .barre-nav a:hover,
.barre[data-ton="sombre"] .barre-nav a[aria-current="page"] {
  color: var(--accent-clair);
}

.barre-actions {
  display: flex;
  gap: 6px;
  margin-left: 14px;
}

/* Le tiroir : sur petit écran, la barre s'ouvre en panneau (un <details>, sans JavaScript). */
.barre-tiroir {
  display: none;
  margin-left: auto;
}

.barre-tiroir summary {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--rayon-petit);
  list-style: none;
  cursor: pointer;
}

.barre-tiroir summary::-webkit-details-marker {
  display: none;
}

.barre-tiroir summary span,
.barre-tiroir summary span::before,
.barre-tiroir summary span::after {
  display: block;
  width: 18px;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.barre-tiroir summary span {
  position: relative;
}

.barre-tiroir summary span::before,
.barre-tiroir summary span::after {
  content: "";
  position: absolute;
  left: 0;
}

.barre-tiroir summary span::before {
  transform: translateY(-6px);
}

.barre-tiroir summary span::after {
  transform: translateY(6px);
}

.barre-tiroir[open] summary span {
  background: transparent;
}

.barre-tiroir[open] summary span::before {
  transform: rotate(45deg);
}

.barre-tiroir[open] summary span::after {
  transform: rotate(-45deg);
}

.tiroir-contenu {
  position: absolute;
  top: 100%;
  left: -1px;
  right: -1px;
  padding: 4px 12px 12px;
  border: 1px solid var(--filet);
  border-top: 0;
  border-radius: 0 0 var(--rayon) var(--rayon);
  background: var(--papier);
  box-shadow: 0 12px 24px rgb(19 18 16 / 0.08);
}

.barre[data-ton="sombre"] .tiroir-contenu {
  border-color: rgb(251 250 247 / 0.1);
  background: #16151c;
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.4);
}

/* Ouverte, la barre devient opaque et ne fait qu'un avec son panneau. */
.barre-cadre:has(.barre-tiroir[open]) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  background: var(--papier);
}

.barre[data-ton="sombre"] .barre-cadre:has(.barre-tiroir[open]) {
  background: #16151c;
}

.tiroir-contenu ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tiroir-contenu li a {
  display: block;
  padding: 14px 4px;
  border-top: 1px solid var(--filet);
  font-size: 1.0625rem;
  text-decoration: none;
}

.barre[data-ton="sombre"] .tiroir-contenu li a {
  border-color: var(--nuit-filet);
}

.tiroir-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--filet);
}

.barre[data-ton="sombre"] .tiroir-actions {
  border-color: var(--nuit-filet);
}

.tiroir-actions .bouton {
  padding-block: 12px;
  font-size: 1rem;
}

@media (max-width: 899px) {
  .barre-nav,
  .barre-actions {
    display: none;
  }

  .barre-tiroir {
    display: block;
  }

  .barre-cadre {
    padding-right: 6px;
  }
}

/* ---------- Haut de page de l'accueil ---------- */

/* L'introduction de l'app : le halo naît case par case, la mascotte se pose sous son sommet. */
.heros {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  /* Le sommet de l'arc est à 28 % de la hauteur de la fenêtre (halo.js). */
  padding: calc(max(28vh, 157px) + 56px) 0 clamp(48px, 6vw, 88px);
  border-radius: 0 0 var(--rayon-panneau) var(--rayon-panneau);
  text-align: center;
}

.halo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.heros .halo {
  z-index: -1;
  height: min(100%, max(100vh, 560px) + 260px);
  -webkit-mask-image: linear-gradient(#000 0 68%, transparent 100%);
  mask-image: linear-gradient(#000 0 68%, transparent 100%);
}

/* Sans JavaScript, le halo figé prend la place du canevas. */
html:not(.js) .halo {
  background: url("../img/halo.webp") center top / max(100%, 1600px) auto no-repeat;
  opacity: 0.7;
}

.heros-texte {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.heros h1 {
  font-size: clamp(3.1rem, 1.5rem + 6.4vw, 6.75rem);
  line-height: 0.96;
  letter-spacing: -0.045em;
}

.heros .estompe {
  color: var(--nuit-texte-2);
}

.heros .chapeau {
  max-width: 36rem;
  margin-top: 26px;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.45;
  color: var(--nuit-texte-2);
}

.heros .telechargement {
  margin-top: 34px;
}

/* La mascotte : deux calques, la fourrure et les yeux (qui clignent). */
.mascotte {
  position: relative;
  width: 112px;
  aspect-ratio: 1;
}

.mascotte img,
.mascotte svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Le petit saut quand on la survole (site.js pose la classe). */
.mascotte--saute {
  animation: respire 3.8s ease-in-out infinite, saute 0.55s cubic-bezier(0.3, 0.7, 0.4, 1) !important;
}

@keyframes saute {
  0%,
  100% {
    translate: 0 0;
  }
  42% {
    translate: 0 -13%;
  }
}

.heros .mascotte {
  margin-bottom: 18px;
}

@media (prefers-reduced-motion: no-preference) {
  .mascotte {
    transform-origin: 50% 100%;
    animation: respire 3.8s ease-in-out infinite;
  }

  .mascotte .mascotte-yeux {
    transform-origin: 50% 47%;
    animation: cligne 5.3s infinite;
  }
}

@keyframes respire {
  0%,
  100% {
    transform: scale(1, 1.01);
  }
  50% {
    transform: scale(1.025, 0.975);
  }
}

@keyframes cligne {
  0%,
  44%,
  48%,
  88%,
  91%,
  100% {
    transform: scaleY(1);
  }
  46%,
  89.5% {
    transform: scaleY(0.1);
  }
}

/* ---------- La démonstration : la fenêtre de l'app, ses onglets, sa légende ---------- */

.demo {
  margin-top: clamp(56px, 8vw, 104px);
}

.demo-fenetre {
  position: relative;
  overflow: hidden;
  border-radius: clamp(8px, 1vw, 14px);
  background: #f4f2ee;
  box-shadow: 0 0 0 1px rgb(251 250 247 / 0.14), 0 40px 90px -30px rgb(0 0 0 / 0.7);
  text-align: left;
}

/* La capture de secours, tant que le script n'a pas pris la main. */
.demo-fenetre > img {
  width: 100%;
}

.demo-onglets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: clamp(20px, 2.4vw, 30px);
}

.demo-onglets button {
  position: relative;
  overflow: hidden;
  padding: 9px 15px;
  border: 1px solid var(--nuit-filet);
  border-radius: var(--rayon-petit);
  background: transparent;
  color: var(--nuit-texte-2);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.3;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.demo-onglets button:hover {
  color: var(--nuit-texte);
}

.demo-onglets .actif {
  border-color: rgb(251 250 247 / 0.4);
  background: rgb(251 250 247 / 0.07);
  color: var(--nuit-texte);
}

/* Le trait qui avance sous l'onglet en lecture : la durée de l'écran. */
.demo-onglets i {
  position: absolute;
  inset: auto 0 0;
  height: 2px;
  background: var(--accent-clair);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.demo-lecture {
  display: grid;
  place-items: center;
  width: 40px;
  padding: 0 !important;
}

.demo-lecture svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

.demo-lecture .d-jouer,
.demo-lecture.d-arret .d-pause {
  display: none;
}

.demo-lecture.d-arret .d-jouer {
  display: block;
}

.demo-chapitres {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 40px 32px;
  margin: clamp(28px, 3.4vw, 44px) 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.demo-chapitres h3 {
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.demo-chapitres p {
  margin-top: 10px;
  color: var(--nuit-texte-2);
}

.demo-points {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--nuit-texte-3);
}

.demo-points li + li {
  margin-top: 6px;
}

/* Avec le script : un seul chapitre à la fois, centré sous les onglets. */
.demo--active .demo-chapitres {
  display: block;
  min-height: 13.5rem;
}

.demo--active .demo-chapitres > li {
  display: none;
  text-align: center;
}

.demo--active .demo-chapitres > li.actif {
  display: block;
  animation: d-monte 0.45s ease both;
}

.demo--active .demo-chapitres h3 {
  font-size: clamp(1.6rem, 3vw, 2.375rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.demo--active .demo-chapitres p {
  max-width: 40rem;
  margin: 14px auto 0;
  font-size: clamp(1rem, 1.3vw, 1.125rem);
}

.demo--active .demo-points {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 32px;
  max-width: 62rem;
  margin: 22px auto 0;
  font-size: 0.9375rem;
}

.demo--active .demo-points li {
  flex: 1 1 15rem;
  max-width: 19rem;
  margin: 0;
}

@keyframes d-monte {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* --- L'app elle-même. Tout est dessiné à taille fixe (1180 × 730), puis mis à l'échelle par demo.js. --- */

.d-app {
  --d-fond: #f4f2ee;
  --d-surface: #fcfbf9;
  --d-creux: #ece8e1;
  --d-texte: #1b1a18;
  --d-texte-2: #6e6b65;
  --d-positif: #1f9d6b;
  --c: #1b1a18;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px;
  background: var(--d-fond);
  color: var(--d-texte);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Instrument Sans", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.35;
  transform-origin: 0 0;
  -webkit-user-select: none;
  user-select: none;
}

.d-app h4,
.d-app h5,
.d-app p,
.d-app ul,
.d-app ol,
.d-app dl,
.d-app dd {
  margin: 0;
  padding: 0;
  list-style: none;
  text-wrap: wrap;
}

.d-app button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.d-app button:disabled {
  cursor: default;
}

.d-app small {
  font-size: 10.5px;
  color: var(--d-texte-2);
}

.d-ico {
  width: 14px;
  height: 14px;
  flex: none;
  fill: currentColor;
}

/* Les couleurs des postes : une variable, reprise par les rubans, les pastilles et les jauges. */
.c-rouge { --c: #e5685e; }
.c-vert { --c: #4fb783; }
.c-rose { --c: #e07fb9; }
.c-ambre { --c: #dba63f; }
.c-violet { --c: #8f7ff0; }
.c-orange { --c: #ef9950; }
.c-turquoise { --c: #4fbdb6; }
.c-gris { --c: #aaa59b; }
.c-bleu { --c: #5f85ee; }
.c-positif { --c: #2aa873; }
.c-source { --c: #7c93f2; }
.c-alerte { --c: #e0564b; }
.c-accent { --c: #5b5bf5; }

.d-ton-positif,
.d-ton-positif b {
  color: var(--d-positif);
}

.d-feux {
  display: flex;
  gap: 7px;
  height: 30px;
  padding: 11px 4px 0;
}

.d-feux i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}

.d-feux i:nth-child(2) {
  background: #febc2e;
}

.d-feux i:nth-child(3) {
  background: #28c840;
}

.d-scene {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.d-entete {
  position: relative;
  overflow: hidden;
  padding: 14px 18px 15px;
  border-radius: 16px;
  background: var(--d-surface);
}

.d-pixels {
  position: absolute;
  top: 0;
  right: 0;
  width: 320px;
  height: 120px;
  pointer-events: none;
}

.d-titre h4 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.d-titre p {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--d-texte-2);
}

.d-entete-droite {
  position: absolute;
  top: 14px;
  right: 16px;
}

.d-stats {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.d-stat span {
  display: block;
  font-size: 10.5px;
  color: var(--d-texte-2);
}

.d-stat b {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.d-stat small {
  display: block;
}

.d-filtres {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.d-pilules,
.d-segment {
  display: flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--d-creux);
}

.d-pilules button,
.d-segment button {
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: 11px;
  color: var(--d-texte-2) !important;
}

.d-pilules .actif,
.d-segment .actif {
  background: #fff;
  box-shadow: 0 1px 2px rgb(27 26 24 / 0.1);
  font-weight: 600;
  color: var(--d-texte) !important;
}

.d-pas,
.d-comptes,
.d-bouton-clair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--d-creux);
  font-size: 11px;
}

.d-pas .d-ico,
.d-comptes .d-ico {
  width: 11px;
  height: 11px;
  color: var(--d-texte-2);
}

.d-bouton-clair {
  font-weight: 600;
}

.d-bouton-clair .d-ico {
  width: 11px;
  height: 11px;
}

.d-corps {
  display: flex;
  flex: 1;
  gap: 10px;
  min-height: 0;
}

.d-deux > :first-child {
  flex: 1;
  min-width: 0;
}

.d-carte {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--d-surface);
}

.d-cote {
  flex: none;
  width: 296px;
}

.d-cote h5 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}

.d-cote h5 span {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--d-texte-2);
}

.d-note {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--d-texte-2);
}

.d-note b {
  color: var(--d-texte);
}

.d-petit {
  margin: 14px 0 6px !important;
  font-size: 10.5px;
  color: var(--d-texte-2);
}

/* Les lignes entrent l'une après l'autre (le délai est posé par demo.js). */
.d-entre {
  animation: d-monte 0.4s ease both;
}

.d-jauge {
  position: relative;
  height: 5px;
  border-radius: 3px;
  background: var(--d-creux);
}

.d-jauge i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 3px;
  background: var(--c);
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.d-jauge em {
  position: absolute;
  top: -3px;
  width: 1.5px;
  height: 11px;
  background: var(--d-texte);
  opacity: 0.5;
}

.d-pastille {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--c);
  background: color-mix(in srgb, var(--c) 16%, transparent);
  color: var(--c);
}

.d-rond {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

/* Le dock, en bas de la fenêtre. */
.d-dock {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 6px 8px 6px 6px;
  border-radius: 18px;
  background: var(--d-surface);
  box-shadow: 0 8px 24px rgb(27 26 24 / 0.1), 0 0 0 1px rgb(27 26 24 / 0.05);
}

.d-tuile {
  position: relative;
  flex: none;
  overflow: hidden;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #17163a;
}

.d-tuile img {
  position: absolute;
  top: 9px;
  left: 3px;
  width: 28px;
  height: 28px;
  max-width: none;
}

.d-dock-liens {
  display: flex;
  gap: 2px;
}

.d-dock button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--d-texte) !important;
}

.d-dock button .d-ico {
  width: 16px;
  height: 16px;
}

.d-dock button:not(:disabled):hover,
.d-dock button.actif {
  background: var(--d-creux);
}

.d-dock button:disabled {
  opacity: 0.45;
}

.d-champ {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 270px;
  padding: 7px 10px;
  border-radius: 11px;
  background: var(--d-creux);
  font-size: 11.5px;
  color: var(--d-texte-2);
}

.d-champ span {
  flex: 1;
}

.d-champ kbd {
  min-width: 0;
  padding: 1px 5px;
  border: 0;
  border-radius: 5px;
  background: rgb(27 26 24 / 0.07);
  font-size: 9.5px;
}

/* Flux */
.d-carte-sankey {
  display: flex;
  flex: 1;
  padding: 12px 18px 16px;
}

.d-carte-sankey[data-revele] {
  clip-path: inset(0 100% 0 0);
  transition: clip-path 1.2s cubic-bezier(0.3, 0.6, 0.2, 1);
}

.d-carte-sankey.d-vu {
  clip-path: inset(0);
}

.d-sankey {
  width: 100%;
  height: 100%;
}

.d-ruban {
  fill: var(--c);
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.d-noeud {
  fill: var(--c);
}

.d-budget {
  fill: var(--d-texte);
}

.d-etq {
  fill: var(--d-texte);
  font-size: 11px;
  font-weight: 600;
}

.d-etq-2 {
  fill: var(--d-texte-2);
  font-size: 10px;
  font-weight: 400;
}

.d-fin {
  text-anchor: end;
}

.d-milieu {
  text-anchor: middle;
}

.d-survol .d-poste:not(.d-vise) .d-ruban {
  opacity: 0.16;
}

.d-vise .d-ruban {
  opacity: 0.78;
}

/* Budget */
.d-total p {
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--d-texte-2);
}

.d-envs {
  display: grid;
  gap: 11px;
  margin-top: 16px !important;
}

.d-env {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 11px;
}

.d-env .d-jauge {
  grid-column: 2 / -1;
}

.d-env-nom b,
.d-env-montant b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.d-env-montant {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.d-badge {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgb(224 86 75 / 0.13);
  color: #c9453b;
  font-size: 9.5px;
  font-weight: 600;
}

.d-alerte .d-env-montant b {
  color: #c9453b;
}

.d-table {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px 12px;
  margin: 12px 0 20px !important;
  font-size: 12px;
}

.d-table dt {
  color: var(--d-texte-2);
}

.d-table dd {
  font-weight: 600;
  text-align: right;
}

.d-cote .d-note {
  margin-top: 8px;
}

/* Cagnottes */
.d-cagnottes {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  gap: 10px;
}

.d-cagnotte {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 14px;
  border: 2px solid transparent;
  border-radius: 16px;
  background: var(--d-surface);
  text-align: left;
}

.d-cagnotte.actif {
  border-color: var(--accent);
}

.d-cag-tete {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
}

.d-etat {
  justify-self: start;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgb(31 157 107 / 0.12);
  color: var(--d-positif);
  font-size: 9.5px;
  font-weight: 600;
}

.d-cag-somme {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 11px;
  color: var(--d-texte-2);
}

.d-cag-somme b {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--d-texte);
  font-variant-numeric: tabular-nums;
}

.d-cag-somme em {
  margin-left: auto;
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.d-colonne {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.d-colonne .d-cagnottes {
  flex: none;
}

.d-versements {
  flex: 1;
}

.d-versements h5 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 700;
}

.d-versements h5 span {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--d-texte-2);
}

.d-partage {
  display: flex;
  gap: 3px;
  height: 10px;
  margin: 14px 0 12px;
}

.d-partage i {
  width: 0;
  border-radius: 5px;
  background: var(--c);
  transition: width 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.d-legende {
  display: flex;
  gap: 28px;
  margin-bottom: 14px !important;
  font-size: 12px;
}

.d-legende li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.d-legende i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.d-legende b {
  font-weight: 600;
}

.d-nouvelle {
  place-items: center;
  align-content: center;
  min-height: 150px;
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--d-creux);
  color: var(--d-texte-2);
  text-align: center;
}

.d-nouvelle b {
  color: var(--d-texte);
  font-size: 12px;
}

.d-ajouts {
  display: flex;
  gap: 6px;
}

.d-ajouts button {
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--d-creux);
  font-size: 11.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.d-ajouts button:hover,
.d-ajouts .d-presse {
  background: var(--accent);
  color: #fff !important;
}

.d-ajouts .d-presse {
  transform: scale(0.94);
}

.d-courbe {
  width: 100%;
  height: 96px;
}

.d-aire {
  fill: rgb(91 91 245 / 0.12);
}

.d-trait {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.d-mouvements li,
.d-echeances li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  font-size: 12px;
}

.d-mouvements span small,
.d-echeances span small,
.d-marchand small {
  display: block;
}

.d-neuf {
  animation: d-eclat 1.2s ease both;
}

@keyframes d-eclat {
  from {
    background: rgb(91 91 245 / 0.16);
    box-shadow: 0 0 0 6px rgb(91 91 245 / 0.16);
  }
}

/* Abonnements */
.d-calendrier {
  display: flex;
  flex-direction: column;
  padding: 12px 14px 14px;
}

.d-semaine,
.d-jours {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.d-semaine {
  margin-bottom: 6px !important;
  font-size: 10px;
  color: var(--d-texte-2);
  text-align: center;
}

.d-jours {
  flex: 1;
  grid-auto-rows: minmax(0, 1fr);
}

.d-jour {
  position: relative;
  overflow: hidden;
  padding: 5px 7px;
  border-radius: 9px;
  background: var(--d-fond);
}

.d-hors {
  background: none;
}

.d-numero {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  font-weight: 600;
  color: var(--d-texte-2);
}

.d-aujourdhui .d-numero {
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
}

.d-paiement {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  line-height: 1.25;
}

.d-paiement i {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.d-paiement b {
  display: block;
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d-paye {
  opacity: 0.5;
}

.d-echeances {
  margin: 8px 0 14px !important;
}

.d-echeances li > span {
  flex: 1;
}

.d-echeances b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Agent */
.d-conversations {
  width: 190px;
}

.d-conversations p {
  margin-top: 4px;
  padding: 7px 9px;
  border-radius: 9px;
  font-size: 11.5px;
  color: var(--d-texte-2);
}

.d-conversations p.actif {
  background: var(--d-creux);
  color: var(--d-texte);
  font-weight: 600;
}

.d-conversations h5 {
  margin-bottom: 8px;
}

.d-fil {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 26px;
}

.d-app .d-question {
  align-self: flex-end;
  padding: 7px 12px;
  border-radius: 14px 14px 4px 14px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
}

.d-reponse {
  max-width: 660px;
  font-size: 12.5px;
}

.d-proposition {
  padding: 12px 16px 12px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(27 26 24 / 0.06);
}

.d-prop-tete {
  display: flex;
  align-items: center;
  gap: 11px;
}

.d-prop-tete b {
  display: block;
  font-size: 13px;
}

.d-compteur {
  margin-left: auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--d-creux);
  font-size: 9.5px;
  color: var(--d-texte-2);
}

.d-lignes {
  margin: 8px 0 !important;
}

.d-ligne {
  display: grid;
  grid-template-columns: 18px 22px minmax(0, 1.5fr) auto 12px minmax(0, 1.15fr) 62px;
  align-items: center;
  gap: 9px;
  padding: 4.5px 0;
  font-size: 11.5px;
  transition: opacity 0.2s ease;
}

.d-case {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  padding: 0;
  border: 1.5px solid #cdc8be;
  border-radius: 5px;
  background: #fff;
  color: transparent !important;
}

.d-case.coche {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff !important;
}

.d-case .d-ico {
  width: 11px;
  height: 11px;
}

.d-marchand {
  min-width: 0;
}

.d-marchand b {
  font-weight: 600;
}

.d-marchand small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.d-puce {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--c) 15%, transparent);
  color: color-mix(in srgb, var(--c) 78%, #000);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.d-puce .d-ico {
  width: 10px;
  height: 10px;
}

.d-vide {
  background: #fbf0dc;
  color: #b47a1c;
  transition: opacity 0.3s ease;
}

.d-fleche {
  width: 11px;
  height: 11px;
  color: var(--d-texte-2);
  transition: opacity 0.3s ease;
}

.d-somme {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.d-ecartee {
  opacity: 0.38;
}

.d-faite .d-vide,
.d-faite .d-fleche {
  opacity: 0.22;
}

.d-prop-pied {
  display: flex;
  align-items: center;
  gap: 16px;
}

.d-prop-pied small {
  flex: 1;
}

.d-appliquer {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.25s ease;
}

.d-appliquer .d-ico {
  width: 12px;
  height: 12px;
}

.d-appliquer.d-fait {
  background: var(--d-positif);
}

.d-appliquer:disabled {
  background: var(--d-creux);
  color: var(--d-texte-2) !important;
}

/* Accueil : la vue d'ensemble, en trois cartes. */
.d-entete-droite {
  display: flex;
  align-items: center;
  gap: 6px;
}

.d-badge-demo {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fbf0dc;
  color: #b47a1c;
  font-size: 10.5px;
  font-weight: 600;
}

.d-accueil > * {
  flex: 1;
  min-width: 0;
}

.d-accueil .d-cote {
  width: auto;
}

.d-accueil h5 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
}

.d-accueil h5 > span:last-child {
  font-size: 10.5px;
  font-weight: 400;
  color: var(--d-texte-2);
}

.d-intitule {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.d-point {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.d-accueil .d-petit {
  margin: 12px 0 1px !important;
}

.d-grand {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  font-variant-numeric: tabular-nums;
}

.d-app .d-ligne-grand {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.d-tendance {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--d-positif);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
}

.d-tendance .d-ico {
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
}

.d-duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 10px 0 12px !important;
}

.d-duo dt {
  font-size: 10.5px;
  color: var(--d-texte-2);
}

.d-duo dd {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.d-courbe-solde {
  position: relative;
  height: 112px;
}

.d-projection {
  width: 100%;
  height: 100%;
}

.d-pointille {
  stroke-dasharray: 2 4;
}

/* Le point d'aujourd'hui, au bout du trait plein (aux trois quarts de la courbe). */
.d-repere-jour {
  position: absolute;
  top: 63%;
  left: 75%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgb(91 91 245 / 0.2);
}

.d-app .d-axe {
  position: relative;
  height: 13px;
  margin-top: 4px;
  font-size: 9.5px;
  color: var(--d-texte-2);
}

.d-axe span {
  position: absolute;
  top: 0;
}

.d-axe span:nth-child(2) {
  left: 75%;
  transform: translateX(-50%);
}

.d-axe span:nth-child(3) {
  right: 0;
}

.d-accueil .d-note {
  margin-top: 8px;
}

.d-comptes-liste {
  display: grid;
  gap: 5px;
  margin-top: 12px !important;
}

.d-comptes-liste li {
  display: flex;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--d-creux);
  font-size: 11.5px;
  font-weight: 600;
}

.d-comptes-liste b {
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.d-bandeau {
  padding: 9px 11px 11px;
  border-radius: 11px;
  background: rgb(224 86 75 / 0.1);
  color: #c9453b;
}

.d-app .d-bandeau p {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 11.5px;
}

.d-bandeau p span {
  margin-left: auto;
  font-weight: 600;
}

.d-bandeau .d-jauge {
  background: rgb(224 86 75 / 0.18);
}

.d-six-tete {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 8px;
  font-size: 11.5px;
  color: var(--d-texte-2);
}

.d-legende-mois {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  font-size: 10px;
}

.d-legende-mois i {
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 2px;
}

.d-b-revenus {
  background: #dcd7ce;
}

.d-b-depenses {
  background: var(--d-texte);
}

.d-b-epargne {
  background: var(--accent);
}

.d-mois {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.d-mois li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.d-colonnes {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
}

.d-colonnes i {
  display: block;
  width: 17px;
  height: 0;
  border-radius: 4px;
  transition: height 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.d-mois small {
  font-size: 9.5px;
  white-space: nowrap;
}

.d-courant small {
  color: var(--d-texte);
  font-weight: 700;
}

/* Fenêtre étroite (petit écran) : la colonne de droite s'efface, l'essentiel reste lisible. */
.d-app[data-etroit="true"] .d-cote,
.d-app[data-etroit="true"] .d-comptes,
.d-app[data-etroit="true"] .d-nouvelle,
.d-app[data-etroit="true"] .d-vide,
.d-app[data-etroit="true"] .d-fleche,
.d-app[data-etroit="true"] .d-champ kbd,
.d-app[data-etroit="true"] .d-pixels {
  display: none;
}

.d-app[data-etroit="true"] .d-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.d-app[data-etroit="true"] .d-cagnottes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.d-app[data-etroit="true"] .d-ligne {
  grid-template-columns: 18px 22px minmax(0, 1.3fr) minmax(0, 1fr) 58px;
}

.d-app[data-etroit="true"] .d-champ {
  min-width: 170px;
}

.d-app[data-etroit="true"] .d-fil {
  padding: 14px 16px;
}

.d-app[data-etroit="true"] .d-entete-droite {
  position: static;
  margin-top: 10px;
}

/* ---------- Sections ---------- */

.section {
  padding: clamp(72px, 9vw, 136px) 0;
}

.section--teinte {
  background: var(--papier-2);
}

/* L'en-tête d'une section : étiquette et titre à gauche, chapeau à droite, calé en bas. */
.entete-section {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(20px, 5vw, 72px);
  margin-bottom: clamp(40px, 5vw, 72px);
}

.titre-section {
  margin-top: 22px;
  font-size: clamp(2.1rem, 4.6vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.titre-section span {
  display: block;
}

.entete-section .chapeau {
  justify-self: end;
  max-width: 26rem;
  padding-bottom: 0.35rem;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.45;
  color: var(--encre-2);
}

.nuit .entete-section .chapeau {
  color: var(--nuit-texte-2);
}

@media (max-width: 899px) {
  .entete-section {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .entete-section .chapeau {
    justify-self: start;
  }
}

/* ---------- Les atouts : des cartes, sans filet ---------- */

.cartes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cartes li {
  padding: clamp(20px, 2.4vw, 30px);
  border-radius: var(--rayon);
  background: var(--papier-2);
}

.cartes h3 {
  margin-bottom: 8px;
  font-size: 1.1875rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.cartes p {
  font-size: 0.9688rem;
  color: var(--encre-2);
}

@media (max-width: 899px) {
  .cartes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 559px) {
  .cartes {
    grid-template-columns: 1fr;
  }
}

/* ---------- Pour commencer : trois étapes ---------- */

.etapes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 64px);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: etape;
}

.etape {
  counter-increment: etape;
}

.etape::before {
  content: counter(etape);
  display: block;
  margin-bottom: 16px;
  font-size: clamp(2.6rem, 4.4vw, 3.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--encre-3);
}

.etape h3 {
  margin-bottom: 10px;
  font-size: 1.375rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.etape p {
  max-width: 24rem;
  font-size: 0.9688rem;
  color: var(--encre-2);
}

@media (max-width: 759px) {
  .etapes {
    grid-template-columns: 1fr;
  }
}

/* ---------- Questions ---------- */

.questions-grille {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  gap: clamp(24px, 4.4vw, 72px);
}

.faq {
  border-bottom: 1px solid var(--filet);
}

.faq details {
  border-top: 1px solid var(--filet);
}

.faq summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 0;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  font-weight: 500;
  letter-spacing: -0.012em;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--encre-3);
}

.faq details[open] summary::after {
  content: "−";
}

.faq summary:hover::after {
  color: var(--accent);
}

.reponse {
  max-width: 44rem;
  padding: 0 0 26px;
  color: var(--encre-2);
}

.reponse > * + * {
  margin-top: 0.8em;
}

.reponse ol,
.reponse ul {
  padding-left: 1.3em;
}

.reponse li + li {
  margin-top: 0.4em;
}

.reponse strong {
  font-weight: 600;
  color: var(--encre);
}

@media (min-width: 900px) {
  .questions-tete {
    position: sticky;
    top: 104px;
  }
}

@media (max-width: 899px) {
  .questions-grille {
    grid-template-columns: 1fr;
  }
}

/* ---------- Appel final et pied : un seul bloc nuit ---------- */

.appel {
  position: relative;
  overflow: hidden;
  padding: clamp(80px, 10vw, 152px) 0 clamp(72px, 9vw, 128px);
  border-radius: var(--rayon-panneau) var(--rayon-panneau) 0 0;
}

html:not(.js) .appel .halo,
html:not(.js) .introuvable .halo {
  background-size: cover;
  opacity: 0.22;
}

.appel .conteneur {
  position: relative;
}

.appel-grille {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: clamp(24px, 5vw, 72px);
}

.appel .titre-section {
  margin-top: 0;
  font-size: clamp(2.6rem, 6.4vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.appel .estompe {
  color: var(--nuit-texte-2);
}

.appel .chapeau {
  max-width: 30rem;
  margin: 22px 0 30px;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: var(--nuit-texte-2);
}

.appel .mascotte {
  width: clamp(96px, 14vw, 184px);
}

@media (max-width: 699px) {
  .appel-grille {
    grid-template-columns: 1fr;
  }

  .appel .mascotte {
    order: -1;
  }
}

.pied {
  padding: 28px 0 40px;
  border-radius: var(--rayon-panneau) var(--rayon-panneau) 0 0;
}

/* À la suite de l'appel final, le pied prolonge le même bloc. */
.pied--suite {
  border-radius: 0;
}

main + .pied:not(.pied--suite) {
  margin-top: clamp(40px, 6vw, 88px);
}

.pied-grille {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px clamp(24px, 4vw, 56px);
  padding-top: 28px;
  border-top: 1px solid var(--nuit-filet);
}

.pied--suite .pied-grille {
  padding-top: 28px;
}

.pied nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px clamp(16px, 2.4vw, 32px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pied nav a {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--nuit-texte-2);
}

.pied nav a:hover,
.pied nav a[aria-current="page"] {
  color: var(--nuit-texte);
}

.pied .mention {
  grid-column: 1 / -1;
  max-width: 46rem;
  font-size: 0.8438rem;
  color: var(--nuit-texte-3);
}

@media (max-width: 599px) {
  .pied-grille {
    grid-template-columns: 1fr;
  }

  .pied nav ul {
    justify-content: flex-start;
  }
}

/* ---------- Pages intérieures ---------- */

.entete-page {
  padding: clamp(132px, 17vh, 184px) 0 0;
}

.entete-page-grille {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  align-items: end;
  gap: clamp(20px, 5vw, 72px);
}

/* Un filet sur toute la largeur ferme l'en-tête. */
.entete-page .conteneur::after {
  content: "";
  grid-column: 1 / -1;
  height: 1px;
  margin-top: clamp(8px, 2vw, 24px);
  background: var(--filet);
}

.entete-page h1 {
  margin-top: 24px;
  font-size: clamp(2.8rem, 7vw, 5.75rem);
  line-height: 0.97;
  letter-spacing: -0.042em;
}

.entete-page-cote {
  justify-self: end;
  max-width: 27rem;
  padding-bottom: 0.4rem;
}

.entete-page .chapeau {
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  line-height: 1.45;
  color: var(--encre-2);
}

.entete-page .telechargement {
  margin-top: 24px;
}

.entete-page + .section {
  padding-top: 0;
}

@media (max-width: 899px) {
  .entete-page-grille {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .entete-page-cote {
    justify-self: start;
  }
}

/* Nouveautés : une version par ligne. */
.version {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  align-items: start;
  gap: clamp(20px, 4.4vw, 72px);
  padding: clamp(32px, 4.6vw, 64px) 0;
  border-top: 1px solid var(--filet);
}

.version:first-of-type {
  border-top: 0;
}

.version-entete h2 {
  margin-bottom: 14px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.version-entete p:not(.etiquette) {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  line-height: 1.9;
  text-transform: uppercase;
  color: var(--encre-3);
}

.version-notes {
  max-width: 44rem;
}

.version-notes > * + * {
  margin-top: 0.9em;
}

.version-notes h3 {
  margin-top: 1.8em;
  font-size: 1.1875rem;
  letter-spacing: -0.015em;
}

.version-notes ul {
  padding: 0;
  border-top: 1px solid var(--filet);
  list-style: none;
}

.version-notes li {
  position: relative;
  padding: 11px 0 11px 22px;
  border-bottom: 1px solid var(--filet);
  color: var(--encre-2);
}

.version-notes li::before {
  content: "";
  position: absolute;
  top: 1.2em;
  left: 1px;
  width: 7px;
  height: 7px;
  background: var(--accent);
}

.version-corps > p {
  margin-top: 28px;
}

.version-vide {
  padding: 40px 0;
  border-top: 1px solid var(--filet);
  color: var(--encre-2);
}

@media (min-width: 900px) {
  .version-entete {
    position: sticky;
    top: 104px;
  }
}

@media (max-width: 899px) {
  .version {
    grid-template-columns: 1fr;
  }
}

/* Confidentialité, mentions légales : un texte long, dans la colonne de droite. */
/* La colonne de texte s'aligne sur la colonne de droite des autres grilles (4 + 8). */
.prose {
  --ecart: clamp(20px, 4.4vw, 72px);
  max-width: 46rem;
  margin-left: calc((100% - var(--ecart)) / 3 + var(--ecart));
  padding-top: clamp(32px, 4.6vw, 64px);
}

@media (max-width: 899px) {
  .prose {
    margin-left: 0;
  }
}

.prose > * + * {
  margin-top: 1em;
}

.prose > h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.prose h2 {
  margin-top: 2.2em;
  padding-top: 1.1em;
  border-top: 1px solid var(--filet);
  font-size: clamp(1.5rem, 2.4vw, 1.9375rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
}

.prose h3 {
  margin-top: 1.9em;
  font-size: 1.1875rem;
  letter-spacing: -0.015em;
}

.prose p,
.prose li {
  color: var(--encre-2);
}

.prose strong {
  font-weight: 600;
  color: var(--encre);
}

.prose ul,
.prose ol {
  padding-left: 1.25em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose a {
  color: var(--accent-fonce);
}

.prose .maj {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--encre-3);
}

.a-completer {
  padding: 0.05em 0.4em;
  border-radius: var(--rayon-petit);
  background: #fff0c2;
  color: #5c4200;
  font-family: var(--mono);
  font-size: 0.82em;
  font-weight: 500;
}

/* Page introuvable : un panneau nuit sur toute la hauteur. */
.introuvable {
  position: relative;
  display: grid;
  align-content: center;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: 140px var(--gouttiere) 72px;
}

.introuvable > div {
  position: relative;
  width: 100%;
  max-width: var(--largeur);
  margin-inline: auto;
}

.introuvable .mascotte {
  width: clamp(96px, 12vw, 136px);
  margin-bottom: 28px;
}

.introuvable h1 {
  font-size: clamp(2.6rem, 6.4vw, 5.5rem);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.introuvable .chapeau {
  max-width: 30rem;
  margin: 22px 0 30px;
  font-size: clamp(1.0625rem, 1.4vw, 1.1875rem);
  color: var(--nuit-texte-2);
}

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

/* ---------- Impression ---------- */

@media print {
  .barre,
  .halo,
  .champ,
  .pied nav {
    display: none;
  }

  .nuit {
    background: none;
    color: #000;
  }
}
