/* ============================================================
   iwg — interaction web g
   Stéphane Guevremont · fait à la main, HTML + CSS + un peu de JS
   Police : Poppins (OFL), hébergée sur le site. Aucun service externe.
   ============================================================ */

@font-face { font-family: "Poppins"; src: url("/fonts/poppins-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("/fonts/poppins-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --fond: #f2f3f5;
  --surface: #ffffff;
  --encre: #000000;
  --texte: #3a3d42;
  --doux: #6b7078;
  --trait: #dcdfe4;
  --ecran: #e9ebef;

  /* Couleurs des apps */
  --app-parle: #14a06f;
  --app-guides: #0b8fa8;
  --app-celi: #2457e6;
  --app-interets: #e88a00;
  --app-portfolio: #d6334f;
  --app-parcours: #000000;
  --app-contact: #5b6270;
  --app-flux: #7448e0;

  --rayon: 0;
  --largeur: 1120px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fond: #000000;
    --surface: #16181c;
    --encre: #ffffff;
    --texte: #c9cdd3;
    --doux: #8d939c;
    --trait: #2b2f35;
    --ecran: #1d2025;
    --app-parcours: #2b2f35;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
}

h1, h2, h3 { color: var(--encre); line-height: 1.15; font-weight: 600; letter-spacing: -0.02em; }
a { color: var(--encre); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
img { max-width: 100%; height: auto; display: block; }
:focus-visible { outline: 3px solid var(--app-celi); outline-offset: 3px; border-radius: 0; }

.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 20px; }

.aller-contenu { position: absolute; left: -9999px; }
.aller-contenu:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 0; }

/* ---------- En-tête ---------- */
.entete .conteneur {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px;
}
.logo { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--encre); }
.logo svg { width: 40px; height: 40px; fill: currentColor; flex: none; }
.logo span { font-weight: 500; font-size: 0.98rem; letter-spacing: -0.01em; line-height: 1.1; }
.nav { display: flex; flex-wrap: wrap; gap: 2px; }
.nav a {
  text-decoration: none; color: var(--doux); font-weight: 500; font-size: 0.95rem;
  padding: 6px 12px; border-radius: 0;
}
.nav a:hover { color: var(--encre); }
.nav a[aria-current="page"] { color: var(--encre); box-shadow: inset 0 -2px 0 var(--encre); }

/* ---------- Héros ---------- */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px; align-items: center;
  padding-top: 40px; padding-bottom: 72px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 700; letter-spacing: -0.035em; line-height: 1.02;
  margin: 0 0 22px; max-width: 13ch;
}
.hero p { font-size: 1.15rem; margin: 0 0 30px; max-width: 46ch; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600; font-size: 1rem; cursor: pointer;
  padding: 13px 24px; border-radius: 0; border: 0;
  background: var(--encre); color: var(--fond); text-decoration: none;
}
.bouton:hover { opacity: .86; }
.bouton-secondaire { background: transparent; color: var(--encre); box-shadow: inset 0 0 0 2px var(--encre); }

/* ---------- Démo Parle-moi : le carré du logo devient un tableau de communication ---------- */
.demo { margin: 0; justify-self: center; width: 100%; max-width: 440px; }
.demo-cadre {
  position: relative; aspect-ratio: 1 / 1;
  border: 6px solid var(--encre); background: var(--surface);
  display: grid; grid-template-rows: auto 1fr auto;
}
.demo-phrase {
  display: flex; align-items: center; gap: 10px;
  min-height: 74px; padding: 12px 12px 12px 16px;
  border-bottom: 2px solid var(--encre);
}
.demo-mots { flex: 1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0; }
.demo-vide { color: var(--doux); font-size: 0.9rem; }
.demo-mot {
  display: inline-block; padding: 4px 10px; font-weight: 600; font-size: 1.05rem; line-height: 1.3;
  color: #000; background: var(--c);
}
@media (prefers-reduced-motion: no-preference) {
  .demo-mot { animation: arriver .3s cubic-bezier(.3,1.5,.6,1); }
  @keyframes arriver { from { transform: translateY(8px) scale(.8); opacity: 0; } }
}
.demo-parler {
  flex: none; width: 50px; height: 50px; display: grid; place-items: center; cursor: pointer;
  background: var(--encre); color: var(--fond); border: 0; border-radius: 0;
}
.demo-parler svg { width: 26px; height: 26px; }
.demo-parler:disabled { opacity: .35; cursor: default; }
.demo-parler .onde { opacity: 1; }
.demo-parler.parle .onde1 { animation: onde 0.9s ease-in-out infinite; }
.demo-parler.parle .onde2 { animation: onde 0.9s ease-in-out .15s infinite; }
@keyframes onde { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

.demo-grille { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 10px; padding: 14px; }
.picto {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--encre); cursor: pointer;
  background: var(--surface); border: 2px solid var(--trait); border-top: 8px solid var(--c);
  border-radius: 0; padding: 6px 4px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.picto svg { width: 54%; max-width: 56px; height: auto; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.picto:hover { border-color: var(--encre); border-top-color: var(--c); }
.picto:active, .picto.presse { transform: translate(2px, 2px); box-shadow: inset 0 0 0 999px color-mix(in srgb, var(--c) 18%, transparent); }
.pronom { --c: #f2c230; }
.action { --c: #2fb67c; }
.social { --c: #e86aa6; }

.demo-lien {
  display: block; padding: 12px 16px; border-top: 2px solid var(--encre);
  font-size: 0.9rem; font-weight: 600; text-decoration: none; color: var(--encre);
}
.demo-lien:hover { background: var(--encre); color: var(--fond); }
.demo figcaption { margin-top: 12px; font-size: 0.88rem; color: var(--doux); }

/* Le « doigt » de la démo automatique : un carré qui vient toucher les pictos */
.demo-doigt {
  position: absolute; left: 0; top: 0; width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 3px solid var(--encre); background: color-mix(in srgb, var(--encre) 12%, transparent);
  pointer-events: none; opacity: 0;
  transition: transform .7s cubic-bezier(.6,0,.2,1), opacity .3s, width .12s, height .12s, margin .12s;
}
.demo-doigt.touche { width: 24px; height: 24px; margin: -12px 0 0 -12px; }

/* Une app = une icône + son nom */
.app {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; color: var(--encre); min-width: 0;
}
.app-icone {
  position: relative; display: grid; place-items: center;
  width: 64px; height: 64px; border-radius: 0;
  background: var(--c); color: #fff;
  transition: transform .18s cubic-bezier(.3,1.5,.6,1), box-shadow .18s;
}
.app-icone svg { width: 54%; height: 54%; }
.app:hover .app-icone, .app:focus-visible .app-icone { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--encre); }
.app:active .app-icone { transform: none; box-shadow: none; }
.app-nom { font-size: 0.74rem; font-weight: 500; text-align: center; line-height: 1.2; }
.app-bientot .app-icone { filter: opacity(.38); }   /* filter, pour ne pas être écrasé par l'animation */
.app-bientot .app-nom { color: var(--doux); }

.parle { --c: var(--app-parle); }
.guides { --c: var(--app-guides); }
.celi { --c: var(--app-celi); }
.interets { --c: var(--app-interets); }
.portfolio { --c: var(--app-portfolio); }
.parcours { --c: var(--app-parcours); }
.contact { --c: var(--app-contact); }
.flux { --c: var(--app-flux); }
.vide .app-icone { background: transparent; box-shadow: inset 0 0 0 2px var(--trait); color: var(--doux); }


/* ---------- Sections ---------- */
.section { padding-top: 64px; padding-bottom: 64px; border-top: 1px solid var(--trait); }
.section-tete { display: flex; align-items: end; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 28px; }
.section-tete h2 { font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0; }
.section-tete p { margin: 0; color: var(--doux); max-width: 44ch; }

/* Liste d'apps façon « magasin d'applications » */
.rayons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; }
.rayon h3 { font-size: 1.15rem; margin: 0 0 4px; }
.rayon > p { margin: 0 0 14px; color: var(--doux); font-size: 0.95rem; }
.fiches { list-style: none; margin: 0; padding: 0; }
.fiche {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--trait);
}
.fiche .app-icone { width: 56px; height: 56px; animation: none; }
.fiche-titre { display: block; font-weight: 600; color: var(--encre); line-height: 1.3; }
.fiche-titre a { text-decoration: none; }
.fiche-titre a:hover { text-decoration: underline; }
.fiche-desc { display: block; font-size: 0.92rem; color: var(--doux); line-height: 1.45; }
.statut {
  display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 0;
  font-size: 0.72rem; font-weight: 600; vertical-align: 2px;
  background: var(--fond); color: var(--doux); box-shadow: inset 0 0 0 1px var(--trait);
}
.statut-live { background: var(--app-parle); color: #fff; box-shadow: none; }

/* ---------- Parcours (frise) ---------- */
.frise {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 0;
  position: relative;
}
.frise::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: var(--trait); }
.frise li { position: relative; padding: 26px 12px 0 0; }
.frise li::before {
  content: ""; position: absolute; top: 4px; left: 0;
  width: 10px; height: 10px; border-radius: 0;
  background: var(--fond); box-shadow: inset 0 0 0 2px var(--encre);
}
.frise li:last-child::before { background: var(--encre); }
.frise-an { display: block; font-size: 1.1rem; font-weight: 700; color: var(--encre); letter-spacing: -0.03em; line-height: 1; }
.frise-role { display: block; font-weight: 600; color: var(--encre); margin-top: 6px; line-height: 1.3; font-size: 0.84rem; }
.frise-lieu { display: block; font-size: 0.86rem; color: var(--doux); margin-top: 2px; }
.outils { display: block; font-size: 0.86rem; color: var(--doux); margin-top: 8px; }
.frise .outils { font-size: 0.76rem; margin-top: 4px; line-height: 1.45; }

/* ---------- Pages ---------- */
.page-tete { padding-top: 40px; padding-bottom: 40px; display: flex; gap: 22px; align-items: center; }
.page-tete .app-icone { width: 84px; height: 84px; flex: none; animation: none; }
.page-tete h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 700; margin: 0 0 6px; }
.page-tete p { margin: 0; color: var(--doux); font-size: 1.1rem; max-width: 56ch; }
.page-corps { padding-bottom: 72px; max-width: 760px; }
.page-corps h2 { font-size: 1.45rem; margin: 40px 0 10px; }
.page-corps .fiches { margin-top: 10px; }

.avertissement {
  background: var(--surface); border-radius: 0; padding: 16px 20px; margin: 8px 0 24px;
  box-shadow: inset 4px 0 0 var(--app-celi);
}

/* À propos */
.portrait {
  position: relative; border-radius: 0; overflow: hidden; margin-bottom: 8px;
  aspect-ratio: 1357 / 668; background: var(--surface);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); }
.portrait-titre {
  position: absolute; right: 5%; bottom: 10%; margin: 0; max-width: 10ch;
  font-size: clamp(1.8rem, 5.5vw, 4rem); font-weight: 700; letter-spacing: -0.035em; line-height: 1;
  color: #000;
}
.experiences { list-style: none; padding: 0; margin: 0; }
.experiences li { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 22px 0; border-top: 1px solid var(--trait); }
.experiences .an { font-weight: 600; color: var(--encre); }
.experiences h3 { margin: 0; font-size: 1.12rem; }
.experiences .lieu { color: var(--doux); font-size: 0.92rem; }
.experiences p { margin: 8px 0 0; }

.realisations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; list-style: none; padding: 0; margin: 20px 0 0; }
.realisations figure { margin: 0; }
.realisations img { border-radius: 0; aspect-ratio: 800 / 520; object-fit: cover; object-position: top; background: var(--surface); }
.realisations figcaption { font-size: 0.92rem; font-weight: 500; color: var(--encre); margin-top: 8px; }

/* Formulaire */
.formulaire { display: grid; gap: 18px; max-width: 560px; margin-top: 12px; }
.champ label { display: block; font-weight: 600; color: var(--encre); margin-bottom: 6px; font-size: 0.95rem; }
.champ input, .champ textarea {
  width: 100%; font: inherit; color: var(--encre);
  background: var(--surface); border: 2px solid var(--trait); border-radius: 0;
  padding: 12px 14px;
}
.champ input:focus, .champ textarea:focus { outline: none; border-color: var(--encre); }
.champ textarea { min-height: 160px; resize: vertical; }
.champ .aide { display: block; font-size: 0.85rem; color: var(--doux); margin-top: 4px; }
.pot-de-miel { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.message-etat { margin: 0; padding: 12px 16px; border-radius: 0; background: var(--surface); }
.message-etat[data-type="ok"] { box-shadow: inset 4px 0 0 var(--app-parle); }
.message-etat[data-type="erreur"] { box-shadow: inset 4px 0 0 var(--app-portfolio); }

/* ---------- Pied de page ---------- */
.pied { border-top: 1px solid var(--trait); padding: 30px 0 40px; font-size: 0.9rem; color: var(--doux); }
.pied .conteneur { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.pied nav { display: flex; flex-wrap: wrap; gap: 20px; }
.pied a { color: var(--doux); }

/* ---------- Adaptatif ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 16px; }
  .rayons { grid-template-columns: 1fr; gap: 32px; }
  .frise { grid-template-columns: 1fr; }
  .frise::before { left: 6px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .frise li { padding: 0 0 16px 26px; }
  .frise li::before { top: 4px; }
  .frise::before { left: 4px; width: 1px; }
  .realisations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .experiences li { grid-template-columns: 1fr; gap: 4px; }
  .realisations { grid-template-columns: 1fr; }
  .page-tete { flex-direction: column; align-items: flex-start; }
  .demo-grille { gap: 8px; padding: 10px; }
  .picto { font-size: 0.82rem; }
  .app-icone { width: 56px; height: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-icone { transition: none; }
}

/* ---------- Fond animé de l'accueil : un champ de carrés ---------- */
.hero-zone { position: relative; overflow: hidden; isolation: isolate; }
.hero-fond {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: -1; pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
          mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

/* ---------- Menu mobile (moins de 768 px) ---------- */
.menu-bouton {
  display: none;
  position: relative; z-index: 60;
  width: 44px; height: 44px; padding: 0; margin-right: -8px; cursor: pointer;
  background: transparent; color: var(--encre); border: 0; border-radius: 0;
}
.menu-traits { position: absolute; inset: 0; }
/* Trois barres inégales, alignées à droite : elles s'égalisent au survol */
.menu-traits i {
  position: absolute; right: 8px; height: 3px; background: currentColor;
  transition: transform .35s cubic-bezier(.7,0,.2,1), width .35s cubic-bezier(.7,0,.2,1), opacity .2s;
}
.menu-traits i:nth-child(1) { top: 12px; width: 28px; }
.menu-traits i:nth-child(2) { top: 20.5px; width: 19px; }
.menu-traits i:nth-child(3) { top: 29px; width: 11px; }
.menu-bouton:hover .menu-traits i { width: 28px; }
.menu-bouton[aria-expanded="true"] .menu-traits i:nth-child(1) { width: 28px; transform: translateY(8.5px) rotate(45deg); }
.menu-bouton[aria-expanded="true"] .menu-traits i:nth-child(2) { width: 0; opacity: 0; }
.menu-bouton[aria-expanded="true"] .menu-traits i:nth-child(3) { width: 28px; transform: translateY(-8.5px) rotate(-45deg); }

.menu-mobile {
  position: fixed; inset: 0; z-index: 55;
  background: var(--surface);
  border: 6px solid var(--encre);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 92px 26px 26px;
  /* Le panneau grandit à partir du bouton, comme un carré qui s'ouvre */
  clip-path: inset(0 0 100% 100%);
  transition: clip-path .5s cubic-bezier(.7,0,.2,1);
}
.menu-mobile.ouvert { clip-path: inset(0 0 0 0); }
.menu-liens { display: flex; flex-direction: column; }
.menu-liens a {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--trait);
  font-size: 1.3rem; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3;
  color: var(--encre); text-decoration: none;
  opacity: 0; transform: translateY(14px);
  transition: opacity .3s, transform .4s cubic-bezier(.2,.8,.2,1);
}
.menu-liens a::before {
  content: ""; width: 10px; height: 10px; flex: none;
  box-shadow: inset 0 0 0 2px var(--encre);
}
.menu-liens a[aria-current="page"]::before { background: var(--encre); }
.menu-liens a:active { color: var(--doux); }
.menu-mobile.ouvert .menu-liens a { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 45ms + 180ms); }
.menu-pied { display: flex; align-items: center; gap: 14px; color: var(--doux); font-size: 0.9rem; line-height: 1.4; }
.menu-pied svg { width: 44px; height: 44px; fill: var(--encre); flex: none; }
body.menu-ouvert { overflow: hidden; }

@media (max-width: 767px) {
  .nav { display: none; }
  .menu-bouton { display: block; }
  .entete .conteneur { flex-wrap: nowrap; }
}
@media (min-width: 768px) {
  .menu-mobile { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  .menu-mobile, .menu-liens a, .menu-traits i { transition: none; }
}

/* Section parcours de l'accueil : version compacte */
.section-parcours { padding-top: 40px; padding-bottom: 48px; }
.section-parcours .section-tete { margin-bottom: 20px; }
.section-parcours .section-tete h2 { font-size: 1.25rem; }
.section-parcours .section-tete p { font-size: 0.88rem; }

/* Promesses sous les boutons de l'accueil */
.promesses { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 0.92rem; color: var(--encre); font-weight: 500; }
.promesses li { display: inline-flex; align-items: center; gap: 9px; }
.promesses li::before { content: ""; width: 8px; height: 8px; background: var(--encre); flex: none; }

/* ---------- Fiches entièrement cliquables (meilleur au toucher) ---------- */
.fiche { position: relative; padding-left: 12px; padding-right: 12px; margin-left: -12px; margin-right: -12px; transition: background-color .15s; }
/* Le lien du titre s'étire sur toute la fiche */
.fiche-titre a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.fiche-titre a:focus-visible { outline: none; }
.fiche:has(a:focus-visible) { outline: 3px solid var(--app-celi); outline-offset: -3px; }
.fiche:has(a):hover, .fiche:has(a):active { background: color-mix(in srgb, var(--encre) 5%, transparent); }
.fiche:has(a):hover .fiche-titre a { text-decoration: underline; }
.fiche:has(a):hover .app-icone { transform: translate(-3px, -3px); box-shadow: 3px 3px 0 var(--encre); }
.fiche .app-icone { transition: transform .18s cubic-bezier(.3,1.5,.6,1), box-shadow .18s; }
@media (hover: none) { .fiche:has(a):hover .app-icone { transform: none; box-shadow: none; } }

/* Outils pas encore disponibles : même traitement partout (fiches) */
.fiche:not(:has(a)) .app-icone { filter: opacity(.38); }
.fiche:not(:has(a)) .fiche-titre { color: var(--doux); }

/* Version en test (Parle-moi v2) */
.parle3 { --c: #0c7a55; }
.statut-test { background: var(--encre); color: var(--fond); box-shadow: none; }

/* Page Parcours : le nom sous le titre */
.page-tete .page-nom { color: var(--encre); font-weight: 600; font-size: 1.15rem; margin: 0 0 4px; }
.page-tete.parcours { align-items: flex-start; }
.page-tete.parcours .app-icone { margin-top: 10px; }

/* ---------- Menu fixe en haut ---------- */
html { scroll-padding-top: 96px; }           /* les ancres (#atelier) ne se cachent pas sous le menu */
.entete {
  position: sticky; top: 0; z-index: 56;     /* au-dessus du panneau mobile (55) pour garder le bouton accessible */
  /* Fond opaque, sans backdrop-filter : le flou sur un élément « sticky » scintille au défilement
     (surtout Safari / iOS) et laissait transparaître le contenu blanc qui passe dessous. */
  background: var(--fond);
  transition: box-shadow .2s;
}
.entete.defile { box-shadow: 0 2px 0 var(--encre); }
body.menu-ouvert .entete { background: var(--surface); box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

/* ---------- Bouton « retour en haut » ---------- */
.haut {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer;
  background: var(--encre); color: var(--fond); border: 0; border-radius: 0;
  box-shadow: 0 0 0 2px var(--fond);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .25s, transform .25s cubic-bezier(.2,.8,.2,1);
}
.haut svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: square; }
.haut.visible { opacity: 1; transform: none; pointer-events: auto; }
body.menu-ouvert .haut { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
  .entete, .haut { transition: none; }
}

/* ============================================================
   Calculateur : intérêts composés (/finances/interets-composes/)
   ============================================================ */
.calc { display: grid; grid-template-columns: minmax(0, 330px) minmax(0, 1fr); gap: 28px; align-items: start; }

/* Réglages : carte blanche, bande de couleur de l'app en haut */
.reglages { background: var(--surface); border-top: 8px solid var(--c); padding: 22px 22px 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.reglage { min-width: 0; }
.reglage label { display: block; font-weight: 600; color: var(--encre); font-size: 0.95rem; margin-bottom: 6px; }
.reglage-saisie { display: flex; align-items: center; background: var(--surface); border: 2px solid var(--trait); transition: border-color .15s; }
.reglage-saisie:focus-within { border-color: var(--encre); }
.reglage-saisie input {
  flex: 1; min-width: 0; width: 100%; font: inherit; font-size: 1.35rem; font-weight: 600; color: var(--encre);
  font-variant-numeric: tabular-nums; letter-spacing: -0.01em;
  background: transparent; border: 0; border-radius: 0; padding: 8px 12px; outline: none;
}
.unite { padding: 0 14px; font-weight: 600; color: var(--doux); }
.reglage-note { margin: 0; font-size: 0.84rem; color: var(--doux); line-height: 1.5; }

/* Curseur carré : piste remplie à la couleur de l'app jusqu'au pouce */
.curseur { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; margin: 10px 0 0; background: transparent; cursor: pointer; }
.curseur:focus-visible { outline-offset: 2px; }
.curseur::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(to right, var(--c) var(--p, 50%), var(--trait) var(--p, 50%)); }
.curseur::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 22px; height: 22px; margin-top: -8px;
  background: var(--encre); border: 0; border-radius: 0; box-shadow: 0 0 0 3px var(--surface);
  transition: transform .12s;
}
.curseur:active::-webkit-slider-thumb { transform: scale(1.15); }
.curseur::-moz-range-track { height: 6px; background: var(--trait); border: 0; }
.curseur::-moz-range-progress { height: 6px; background: var(--c); }
.curseur::-moz-range-thumb { width: 22px; height: 22px; background: var(--encre); border: 0; border-radius: 0; box-shadow: 0 0 0 3px var(--surface); }

/* Résultats en direct */
.calc-sortie { display: grid; gap: 20px; min-width: 0; }
.resultats { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2px; background: var(--trait); }
.resultat { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resultat-etiquette { font-size: 0.82rem; color: var(--doux); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.resultat-valeur {
  font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 700; color: var(--encre);
  letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.resultat-sous { font-size: 0.82rem; font-weight: 600; }
.resultat-principal { background: var(--encre); }
.resultat-principal .resultat-etiquette, .resultat-principal .resultat-sous { color: color-mix(in srgb, var(--fond) 70%, transparent); }
.resultat-principal .resultat-valeur { color: var(--fond); font-size: clamp(1.5rem, 3.2vw, 2.1rem); }

.pastille { display: inline-block; width: 12px; height: 12px; flex: none; }
.pastille-base { background: var(--encre); }
.pastille-gain { background: var(--app-interets); }

/* Graphique à bandes : départ (noir) + intérêts (orange), une bande par année */
.graphique { margin: 0; background: var(--surface); padding: 18px 18px 14px; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 0.85rem; font-weight: 500; color: var(--encre); margin-bottom: 18px; }
.legende span { display: inline-flex; align-items: center; gap: 8px; }
.graph { position: relative; height: 300px; --gouttiere: 58px; }
.graph-axe { position: absolute; inset: 0; }
.graph-ligne { position: absolute; left: var(--gouttiere); right: 0; height: 0; border-top: 1px solid var(--trait); }
.graph-ligne:first-child { border-top: 2px solid var(--encre); }
.graph-ligne span {
  position: absolute; right: calc(100% + 8px); top: 0; transform: translateY(-50%);
  font-size: 0.72rem; color: var(--doux); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.graph-barres { position: absolute; top: 0; bottom: 0; left: var(--gouttiere); right: 0; display: flex; gap: 2px; padding: 0 2px; }
.barre { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; cursor: crosshair; }
.barre span { display: block; height: 0; transition: height .35s cubic-bezier(.2,.8,.2,1), opacity .15s; }
.barre-base { background: var(--encre); }
.barre-gain { background: var(--app-interets); }
.graph-barres:hover .barre:not(.active) span, .graph-barres:has(.active):hover .barre:not(.active) span { opacity: .45; }
.barre.active .barre-gain { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--encre) 35%, transparent); }
.graph-x { display: flex; gap: 2px; padding: 6px 2px 0; margin-left: 58px; font-size: 0.72rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.graph-x span { flex: 1; min-width: 0; text-align: center; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.graph-info { margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--trait); font-size: 0.92rem; color: var(--texte); font-variant-numeric: tabular-nums; min-height: 1.65em; }
.graph-info strong { color: var(--encre); }
.info-plus { box-shadow: inset 0 -3px 0 var(--app-interets); }

/* Tableau mois par mois */
.calc-tableau { margin-top: 48px; }
.tableau-tete { display: flex; align-items: end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.tableau-tete h2 { font-size: 1.45rem; margin: 0; }
.bascule { display: inline-flex; align-items: center; gap: 10px; font-size: 0.92rem; font-weight: 500; color: var(--encre); cursor: pointer; user-select: none; }
.bascule input {
  -webkit-appearance: none; appearance: none; margin: 0; width: 20px; height: 20px; flex: none; cursor: pointer;
  border: 2px solid var(--encre); border-radius: 0; background: var(--surface); display: grid; place-items: center;
}
.bascule input::after { content: ""; width: 10px; height: 10px; background: var(--encre); transform: scale(0); transition: transform .12s; }
.bascule input:checked::after { transform: scale(1); }

.tableau-zone { max-height: 520px; overflow: auto; background: var(--surface); border-top: 2px solid var(--encre); overscroll-behavior: contain; }
.tableau { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.tableau th {
  position: sticky; top: 0; z-index: 1; background: var(--surface); color: var(--encre);
  font-weight: 600; font-size: 0.8rem; text-align: right; padding: 10px 14px; white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--trait);
}
.tableau td { padding: 7px 14px; text-align: right; border-bottom: 1px solid var(--trait); white-space: nowrap; }
.tableau th:nth-child(-n+2), .tableau td:nth-child(-n+2) { text-align: left; }
.tableau td:nth-child(-n+2) { color: var(--doux); }
.tableau td:last-child { color: var(--encre); font-weight: 500; }
.tableau tbody tr:hover td { background: color-mix(in srgb, var(--encre) 4%, transparent); }
.tableau tr.depart td { color: var(--encre); font-weight: 600; }
.tableau tr.fin-annee td { background: color-mix(in srgb, var(--app-interets) 9%, transparent); color: var(--encre); font-weight: 600; border-bottom-color: color-mix(in srgb, var(--app-interets) 40%, transparent); }
.fin-marque { display: inline-block; margin-left: 4px; padding: 0 6px; font-size: 0.68rem; font-weight: 600; background: var(--app-interets); color: #000; vertical-align: 1px; }
.tableau.seulement-annees tbody tr:not(.fin-annee):not(.depart) { display: none; }
.tableau.seulement-annees .fin-marque { display: none; }

@media (max-width: 900px) {
  .calc { grid-template-columns: 1fr; }
  .reglages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .reglage-note { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .reglages { grid-template-columns: 1fr; }
  .resultats { grid-template-columns: 1fr 1fr; }
  .resultat-principal { grid-column: 1 / -1; }
  .graph { height: 240px; --gouttiere: 46px; }
  .graph-x { margin-left: 46px; }
  .graph-barres, .graph-x { gap: 1px; }
  .graphique { padding: 14px 12px 12px; }
  .tableau { font-size: 0.82rem; }
  .tableau th, .tableau td { padding-left: 9px; padding-right: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .barre span, .curseur::-webkit-slider-thumb { transition: none; }
}

/* ============================================================
   Démo : garder ses placements ou rembourser (/finances/garder-ou-rembourser/)
   A = garder (encre), B = le saut (violet)
   ============================================================ */
.reglages-groupe {
  grid-column: 1 / -1; margin: 0 0 -12px; padding-top: 16px; border-top: 1px solid var(--trait);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; color: var(--doux);
}
.reglages-groupe:first-child { border-top: 0; padding-top: 0; }
.reglages .bascule { font-size: 0.86rem; line-height: 1.35; }

.choix { border: 0; margin: 0; padding: 0; min-width: 0; }
.choix legend { display: block; padding: 0; margin-bottom: 6px; font-weight: 600; color: var(--encre); font-size: 0.95rem; }
.choix-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; background: var(--trait); border: 2px solid var(--trait); }
.choix-options label {
  position: relative; cursor: pointer; background: var(--surface); padding: 8px 6px; text-align: center;
  font-size: 0.8rem; font-weight: 500; line-height: 1.25; color: var(--texte); transition: background-color .12s, color .12s;
}
.choix-options small { display: block; margin-top: 2px; font-size: 0.7rem; opacity: 0.7; }
.choix-options input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.choix-options label:hover { background: color-mix(in srgb, var(--encre) 5%, var(--surface)); }
.choix-options label:has(input:checked) { background: var(--encre); color: var(--fond); font-weight: 600; }
.choix-options label:has(input:focus-visible) { outline: 3px solid var(--app-celi); outline-offset: -3px; }

.pastille-a { background: var(--encre); }
.pastille-b { background: var(--app-flux); }
.duo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.86rem; color: var(--doux); }
.duo > span { display: inline-flex; align-items: center; gap: 8px; }
.duo strong { font-size: 1.1rem; font-weight: 700; color: var(--encre); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.verdict { margin: 0; background: var(--surface); padding: 16px 20px; box-shadow: inset 4px 0 0 var(--app-flux); color: var(--encre); font-size: 0.98rem; line-height: 1.6; }
.verdict-bloc { background: var(--surface); box-shadow: inset 4px 0 0 var(--app-flux); padding: 16px 20px; }
.verdict-bloc .verdict { padding: 0; box-shadow: none; background: none; font-size: 1.02rem; font-weight: 500; }
.verdict-details { list-style: none; margin: 10px 0 0; padding: 10px 0 0; border-top: 1px solid var(--trait); display: grid; gap: 3px; font-size: 0.82rem; color: var(--doux); line-height: 1.45; }
.verdict-details li { position: relative; padding-left: 14px; }
.verdict-details li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 6px; height: 6px; background: var(--doux); }
.verdict-details:empty { display: none; }

.graphique-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.graphique-tete .legende { margin: 0; }
.graphique-titre { margin: 0 0 14px; font-weight: 600; color: var(--encre); font-size: 0.95rem; }
.graphique-titre span { display: block; font-weight: 400; font-size: 0.82rem; color: var(--doux); }
.onglets { display: inline-flex; gap: 2px; background: var(--trait); border: 2px solid var(--trait); }
.onglets button { font: inherit; font-size: 0.8rem; font-weight: 500; border: 0; border-radius: 0; padding: 5px 10px; cursor: pointer; background: var(--surface); color: var(--texte); }
.onglets button[aria-pressed="true"] { background: var(--encre); color: var(--fond); font-weight: 600; }

.graph-lignes .graph-ligne:first-child, .graph-flux .graph-ligne:first-child { border-top: 1px solid var(--trait); }
.graph .graph-ligne.zero { border-top: 2px solid var(--encre); }
.graph-trace { position: absolute; top: 0; bottom: 0; left: var(--gouttiere); right: 8px; cursor: crosshair; }
.graph-trace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.graph-trace polyline { fill: none; stroke-width: 3; stroke-linejoin: miter; vector-effect: non-scaling-stroke; }
.ligne-a { stroke: var(--encre); }
.ligne-b { stroke: var(--app-flux); }
.guide { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--doux); pointer-events: none; }
.point { position: absolute; width: 11px; height: 11px; transform: translate(-50%, 50%); box-shadow: 0 0 0 2px var(--surface); pointer-events: none; }
.point-a { background: var(--encre); }
.point-b { background: var(--app-flux); }
.graph-x2 { position: relative; height: 1.6em; margin: 6px 8px 0 58px; font-size: 0.72rem; color: var(--doux); font-variant-numeric: tabular-nums; }
.graph-x2 span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
#g-x2 { margin-right: 0; }
.info-a, .info-b { display: inline-block; margin-left: 10px; padding-left: 16px; position: relative; white-space: nowrap; }
.info-a::before, .info-b::before { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; transform: translateY(-50%); }
.info-a::before { background: var(--encre); }
.info-b::before { background: var(--app-flux); }

.zone-rouge { position: absolute; left: var(--gouttiere); right: 0; bottom: 0; background: color-mix(in srgb, var(--app-portfolio) 9%, transparent); }
.graph-groupes { position: absolute; top: 0; bottom: 0; left: var(--gouttiere); right: 0; display: flex; gap: 4px; padding: 0 2px; }
.groupe { flex: 1; min-width: 0; display: flex; gap: 2px; cursor: crosshair; }
.bflux { flex: 1; position: relative; }
.bflux i { position: absolute; left: 0; right: 0; height: 0; transition: height .35s cubic-bezier(.2,.8,.2,1), bottom .35s cubic-bezier(.2,.8,.2,1), opacity .15s; }
.bflux-a i { background: var(--encre); }
.bflux-b i { background: var(--app-flux); }
.graph-groupes:hover .groupe:not(.active) i { opacity: .45; }

/* Cinq résultats : le mois en vedette, quatre comparaisons à côté */
.resultats-quatre { grid-template-columns: 1.3fr 1fr 1fr; }
.resultats-quatre .resultat-principal { grid-row: span 2; justify-content: center; }
.resultats-quatre .resultat-principal .resultat-sous { font-size: 0.9rem; }

@media (max-width: 900px) {
  .reglages.flux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reglages.flux .choix, .reglages.flux .bascule { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .reglages.flux { grid-template-columns: 1fr; }
  .resultats-quatre { grid-template-columns: 1fr; }
  .resultats-quatre .resultat-principal { grid-row: auto; grid-column: auto; }
  .resultats-quatre .resultat { padding: 14px 16px; }
  .choix-options { grid-template-columns: 1fr; }
  .choix-options label { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; text-align: left; padding: 11px 14px; font-size: 0.9rem; }
  .choix-options small { margin: 0; font-size: 0.78rem; white-space: nowrap; }
  .graphique-tete { flex-direction: column; align-items: flex-start; }
  .graphique-tete .legende { flex-direction: column; gap: 6px; }
  .onglets { width: 100%; }
  .onglets button { flex: 1 1 0; padding: 8px 6px; }
  .graph-info { font-size: 0.86rem; }
  .info-a, .info-b { display: block; margin: 4px 0 0; }
  .verdict-bloc { padding: 14px 16px; }
  .graph-x2 { margin-left: 46px; }
  .graph-groupes { gap: 2px; }
  .groupe { gap: 1px; }
  .info-a, .info-b { margin-left: 0; margin-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bflux i { transition: none; }
}

/* Valeurs des résultats : jamais coupées */
.duo > span { white-space: nowrap; }
.duo strong { text-align: right; }
@media (min-width: 641px) and (max-width: 900px) {
  .resultats-quatre { grid-template-columns: 1fr 1fr; }
  .resultats-quatre .resultat-principal { grid-column: 1 / -1; grid-row: auto; }
}
@media (hover: none) { .astuce-clavier { display: none; } }

/* Résumé collant (mobile) */
.resume-mobile { display: none; }
@media (max-width: 900px) {
  .resume-mobile:not([hidden]) {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 54;
    display: flex; align-items: center; gap: 12px; padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
    background: var(--encre); color: var(--fond); text-decoration: none;
    box-shadow: inset 0 4px 0 var(--app-flux);
  }
  .resume-etiquette { font-size: 0.82rem; opacity: 0.75; }
  .resume-mobile strong { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
  .resume-voir { margin-left: auto; font-size: 0.82rem; font-weight: 600; }
  .resume-mobile.negatif { box-shadow: inset 0 4px 0 var(--app-portfolio); }
  body.avec-resume .haut { opacity: 0; pointer-events: none; }
  body.avec-resume .pied { padding-bottom: 72px; }
}

/* ============================================================
   Simulateur anti-panique : garder le cap (/finances/garder-le-cap/)
   Garder le cap = prune, panique = encre, investi = tirets, vous = orange
   ============================================================ */
:root { --app-cap: #a8327f; }
@media (prefers-color-scheme: dark) { :root { --app-cap: #c94a9a; } }
.cap { --c: var(--app-cap); }

.pastille-cap { background: var(--app-cap); }
.pastille-pan { background: var(--encre); }
.pastille-vous { background: var(--app-interets); }
.pastille-perte { background: var(--app-portfolio); }
.pastille-inv { height: 0; width: 16px; background: none; border-top: 3px dashed var(--doux); }
.pastille-baisse { background: color-mix(in srgb, var(--app-portfolio) 22%, transparent); }
.legende-groupe { display: inline-flex; flex-wrap: wrap; gap: 6px 20px; }

/* Bandeau du scénario : numéro du marché + actions */
.scenario { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); padding: 12px 14px; border-top: 8px solid var(--app-cap); }
.scenario-nom { margin-right: auto; font-size: 0.86rem; color: var(--doux); }
.scenario-nom strong { color: var(--encre); font-variant-numeric: tabular-nums; }
.bouton-petit { padding: 9px 16px; font-size: 0.9rem; }

.verdict-cap, .verdict-cap .verdict { box-shadow: inset 4px 0 0 var(--app-cap); }
.verdict-cap .verdict { box-shadow: none; }

/* Lignes du graphique */
.ligne-cap { stroke: var(--app-cap); }
.ligne-pan { stroke: var(--encre); }
.ligne-vous { stroke: var(--app-interets); }
.graph-trace polyline.ligne-inv { stroke: var(--doux); stroke-width: 2; stroke-dasharray: 7 6; }
.point-cap { background: var(--app-cap); }
.point-pan { background: var(--encre); }
.point-vous { background: var(--app-interets); }
.zone-baisse { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--app-portfolio) 11%, transparent); pointer-events: none; }
#c-zones, #c-marques { position: absolute; inset: 0; pointer-events: none; }

/* Ventes (carré rouge) et rachats (carré vide) ; les vôtres sont cerclés d'orange */
.marque { position: absolute; width: 12px; height: 12px; transform: translate(-50%, 50%); pointer-events: none; }
.marque-vente { background: var(--app-portfolio); box-shadow: 0 0 0 2px var(--surface); }
.marque-achat { background: var(--surface); box-shadow: inset 0 0 0 3px var(--encre), 0 0 0 2px var(--surface); }
.marque-vous.marque-vente { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--app-interets); }
.marque-vous.marque-achat { box-shadow: inset 0 0 0 3px var(--app-interets), 0 0 0 2px var(--surface); }
.graph-note { margin: 8px 0 0; font-size: 0.8rem; color: var(--doux); display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.marque-legende { display: inline-block; width: 11px; height: 11px; margin-left: 8px; }
.marque-legende:first-child { margin-left: 0; }

/* Infos au survol */
.info-s { display: inline-block; margin-left: 10px; padding-left: 16px; position: relative; white-space: nowrap; }
.info-s::before { content: ""; position: absolute; left: 0; top: 50%; width: 10px; height: 10px; transform: translateY(-50%); background: var(--s); }
.s-cap { --s: var(--app-cap); }
.s-pan { --s: var(--encre); }
.s-vous { --s: var(--app-interets); }
.s-inv { color: var(--doux); }
.s-inv::before { height: 0; border-top: 2px dashed var(--doux); background: none; }
.info-baisse { color: var(--app-portfolio); font-weight: 600; }
.info-occasion { display: block; margin-top: 4px; font-size: 0.86rem; color: var(--encre); }
.info-occasion::before { content: "↓ "; color: var(--app-cap); font-weight: 700; }
.barre-perte { background: var(--app-portfolio); }
.barre.active .barre-perte { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--encre) 35%, transparent); }

/* Mode « Vivre la simulation » */
.jeu-barre { position: relative; display: flex; align-items: stretch; gap: 2px; flex-wrap: wrap; margin-bottom: 14px; background: var(--trait); border: 2px solid var(--trait); }
.jeu-date { flex: 1 1 auto; display: flex; align-items: center; background: var(--surface); padding: 6px 12px; font-size: 0.88rem; font-weight: 600; color: var(--encre); font-variant-numeric: tabular-nums; }
.jeu-barre button { font: inherit; font-size: 0.8rem; font-weight: 500; border: 0; border-radius: 0; padding: 8px 12px; cursor: pointer; background: var(--surface); color: var(--texte); }
.jeu-barre button:hover { background: color-mix(in srgb, var(--encre) 6%, var(--surface)); }
.jeu-barre button:disabled { opacity: .4; cursor: default; }
.jeu-barre button[hidden] { display: none; }
#c-jeu-action { background: var(--encre); color: var(--fond); font-weight: 600; }
.jeu-progres { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; }
.jeu-progres i { display: block; height: 100%; width: 0; background: var(--app-cap); transition: width .2s linear; }

.epreuve { background: var(--encre); color: var(--fond); padding: 18px 20px 20px; margin-bottom: 16px; box-shadow: inset 6px 0 0 var(--app-portfolio); }
.epreuve.rachat { box-shadow: inset 6px 0 0 var(--app-parle); }
.epreuve-titre { margin: 0 0 6px; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.epreuve-texte { margin: 0 0 16px; font-size: 0.95rem; line-height: 1.55; color: color-mix(in srgb, var(--fond) 82%, transparent); }
.epreuve-texte strong { color: var(--fond); }
.epreuve-choix { display: flex; flex-wrap: wrap; gap: 10px; }
.epreuve .bouton { background: var(--fond); color: var(--encre); }
.epreuve .bouton-secondaire { background: transparent; color: var(--fond); box-shadow: inset 0 0 0 2px var(--fond); }
@media (prefers-reduced-motion: no-preference) {
  .epreuve:not([hidden]) { animation: epreuve .25s cubic-bezier(.2,.8,.2,1); }
  @keyframes epreuve { from { transform: translateY(-6px); opacity: 0; } }
}

@media (max-width: 900px) {
  .reglages.cap { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reglages.cap .choix { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .reglages.cap { grid-template-columns: 1fr; }
  .scenario-nom { flex-basis: 100%; }
  .scenario .bouton { flex: 1 1 0; }
  .info-s { display: block; margin: 4px 0 0; }
  .jeu-date { flex-basis: 100%; }
  .jeu-barre button { flex: 1 1 auto; }
  .epreuve-choix .bouton { flex: 1 1 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .jeu-progres i { transition: none; }
}
/* L'attribut hidden l'emporte toujours sur les display ci-dessus */
.jeu-barre[hidden], .epreuve[hidden], .legende [hidden], .scenario [hidden] { display: none !important; }

/* Garder le cap : phase retraite (coussin = sarcelle, transition = bleu) */
.pastille-cous { background: var(--app-guides); }
.pastille-trans { background: var(--app-celi); }
.ligne-cous { stroke: var(--app-guides); }
.ligne-trans { stroke: var(--app-celi); }
.point-cous { background: var(--app-guides); }
.point-trans { background: var(--app-celi); }
.s-cous { --s: var(--app-guides); }
.s-trans { --s: var(--app-celi); }
.info-danger::before { content: "↑ "; color: var(--app-portfolio); }
.zone-transition { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--app-celi) 6%, transparent); pointer-events: none; }
.ligne-retraite { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--encre); pointer-events: none; }
.ligne-retraite span {
  position: absolute; top: 4px; left: 6px; white-space: nowrap; font-style: normal;
  font-size: 0.72rem; font-weight: 600; color: var(--encre); background: var(--surface); padding: 0 4px;
}
.barre.apres-retraite .barre-perte { background: color-mix(in srgb, var(--app-portfolio) 70%, #000); }
.resultat-valeur.a-sec { color: var(--app-portfolio); }
.reglage-note strong { color: var(--encre); font-weight: 600; }
.epreuve-choix .bouton[hidden] { display: none; }
.taux-retrait { display: block; margin-top: 4px; }
.taux-retrait.eleve { color: #ff8fa3; }

/* Garder le cap : option maison */
.maison-reglages { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 16px; margin-top: -8px; background: var(--fond); }
.maison-reglages[hidden] { display: none; }
.maison-reglages .reglage-saisie { background: var(--surface); }
.ligne-vente { border-left-style: dashed; border-left-color: var(--app-parle); }
.ligne-vente span { top: 24px; color: var(--app-parle); }
@media (max-width: 900px) { .reglages.cap .maison-reglages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .maison-reglages .reglage-note { grid-column: 1 / -1; } }
@media (max-width: 640px) { .reglages.cap .maison-reglages { grid-template-columns: 1fr; } }
.ligne-retraite.gauche span { left: auto; right: 6px; }

/* ---------- Parrainage (Finances) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.parrainage {
  margin: 40px 0 24px; padding: 26px 26px 22px; border-radius: 0;
  background: var(--surface); box-shadow: inset 0 0 0 2px var(--encre);
}
.page-corps .parrainage h2 { margin: 10px 0 8px; font-size: 1.35rem; }
.parrainage > p { margin: 0 0 18px; }
.parrainage-etiquette {
  display: inline-block; padding: 1px 8px; font-size: 0.72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em; background: var(--encre); color: var(--fond);
}
.parrainage-bouton { gap: 8px; }
.parrainage-note { margin: 18px 0 0 !important; font-size: 0.82rem; color: var(--doux); line-height: 1.5; }
.parrainage-note strong { color: var(--texte); font-weight: 600; }
.parrainage-note a { color: inherit; }
@media (max-width: 640px) { .parrainage { padding: 20px 18px 18px; } .parrainage-bouton { width: 100%; } }

/* ---------- Partager un scénario (Finances) ---------- */
.partage { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.partage .bouton { gap: 8px; }
.partage .bouton svg { width: 18px; height: 18px; flex: none; }
.partage-etat { font-size: 0.88rem; color: var(--doux); }
.partage-etat:empty { display: none; }
@media (max-width: 640px) { .partage .bouton { width: 100%; } }

/* ---------- Soutenir le site + page Merci ---------- */
.parrainage + .parrainage { margin-top: 16px; }
.soutien { box-shadow: inset 0 0 0 2px var(--encre), inset 8px 0 0 var(--app-parle); padding-left: 34px; }
.soutien .parrainage-etiquette { background: var(--app-parle); color: #fff; }
.merci { --c: var(--app-parle); }
.merci-message { font-size: 1.2rem; color: var(--encre); }
.merci-actions { margin-top: 28px; }
@media (max-width: 640px) { .soutien { padding-left: 26px; } .merci-actions .bouton { width: 100%; } }

/* ============================================================
   Comparateur de FNB (/finances/comparateur-fnb/)
   Jusqu'à cinq séries : encre, sarcelle, orange, violet, bleu
   ============================================================ */
:root { --app-fnb: #0f766e; }
@media (prefers-color-scheme: dark) { :root { --app-fnb: #1aa898; } }
.fnb { --c: var(--app-fnb); }
.s-f1 { --s: var(--encre); }
.s-f2 { --s: var(--app-fnb); }
.s-f3 { --s: var(--app-interets); }
.s-f4 { --s: var(--app-flux); }
.s-f5 { --s: var(--app-celi); }
.pastille-s { background: var(--s); }
/* Choix des FNB : des puces carrées */
.fnb-choix { position: relative; }
.fnb-compte { font-weight: 500; color: var(--doux); }
.fnb-puces { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fnb-puces:empty { display: none; }
.fnb-puce { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 10px; background: var(--encre); color: var(--fond); font-size: 0.86rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.fnb-puce i { width: 10px; height: 10px; background: var(--s); box-shadow: 0 0 0 1px var(--fond); }
.fnb-puce button { font: inherit; font-size: 1.1rem; line-height: 1; background: none; border: 0; color: inherit; cursor: pointer; padding: 2px 6px; opacity: .75; }
.fnb-puce button:hover { opacity: 1; }
.fnb-choix .reglage-saisie input { font-size: 1.05rem; text-transform: uppercase; }
.fnb-choix .reglage-saisie input::placeholder { text-transform: none; font-weight: 500; color: var(--doux); }
.fnb-ajouter { flex: none; width: 44px; align-self: stretch; font: inherit; font-size: 1.4rem; font-weight: 600; cursor: pointer; border: 0; border-left: 2px solid var(--trait); background: var(--surface); color: var(--encre); }
.fnb-ajouter:hover { background: var(--encre); color: var(--fond); }
.fnb-suggestions { position: absolute; z-index: 20; left: 0; right: 0; margin-top: -2px; background: var(--surface); border: 2px solid var(--encre); max-height: 290px; overflow: auto; }
.fnb-suggestions button { display: grid; grid-template-columns: auto 1fr; gap: 0 10px; width: 100%; text-align: left; font: inherit; font-size: 0.86rem; padding: 8px 12px; border: 0; border-bottom: 1px solid var(--trait); background: var(--surface); color: var(--texte); cursor: pointer; }
.fnb-suggestions button:hover, .fnb-suggestions button.actif { background: color-mix(in srgb, var(--app-fnb) 12%, var(--surface)); }
.fnb-suggestions b { color: var(--encre); font-variant-numeric: tabular-nums; }
.fnb-suggestions span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fnb-suggestions small { grid-column: 2; color: var(--doux); font-size: 0.74rem; }
.fnb-rapides { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.fnb-rapides button { font: inherit; font-size: 0.76rem; font-weight: 500; padding: 3px 8px; cursor: pointer; background: var(--surface); color: var(--texte); border: 0; box-shadow: inset 0 0 0 1px var(--trait); }
.fnb-rapides button:hover { box-shadow: inset 0 0 0 2px var(--encre); color: var(--encre); }
.reglage-saisie input[type="date"] { font-size: 1.05rem; }
.fnb-frequences { grid-template-columns: repeat(2, minmax(0, 1fr)); }
/* Notes et période */
.fnb-notes:empty { display: none; }
.fnb-notes p { margin: 0 0 2px; background: var(--surface); padding: 10px 16px; font-size: 0.88rem; line-height: 1.5; box-shadow: inset 4px 0 0 var(--app-interets); }
.fnb-notes p.erreur { box-shadow: inset 4px 0 0 var(--app-portfolio); }
.fnb-notes p.charge { box-shadow: inset 4px 0 0 var(--app-fnb); color: var(--doux); }
.fnb-periode { margin: 0; font-size: 0.92rem; color: var(--doux); }
.fnb-periode:empty { display: none; }
.fnb-periode strong { color: var(--encre); font-variant-numeric: tabular-nums; }
/* Résultats : une case par FNB, le meilleur en noir */
.fnb-resultats { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.fnb-resultats:empty { display: none; }
.fnb-resultats .resultat { box-shadow: inset 0 4px 0 var(--s); padding-top: 18px; }
.fnb-resultats .resultat-principal { box-shadow: inset 0 4px 0 var(--s), inset 0 0 0 0 transparent; }
.resultat-nom { font-size: 0.74rem; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.resultat-principal .resultat-nom { color: color-mix(in srgb, var(--fond) 60%, transparent); }
.fnb-resultats .resultat-etiquette strong { color: var(--encre); font-weight: 700; font-size: 0.92rem; }
.fnb-resultats .resultat-principal .resultat-etiquette strong { color: var(--fond); }
.fnb-resultats .resultat-principal .pastille { box-shadow: 0 0 0 1px var(--fond); }
.etiquette-meilleur { margin-left: auto; padding: 0 6px; font-size: 0.68rem; font-weight: 600; background: var(--app-fnb); color: #fff; }
.resultat-sous.pos { color: var(--app-parle); }
.resultat-sous.neg { color: var(--app-portfolio); }
.resultat-principal .resultat-sous.pos, .resultat-principal .resultat-sous.neg { color: color-mix(in srgb, var(--fond) 80%, transparent); }
/* Lignes du graphique */
.graph-trace polyline.ligne-s { stroke: var(--s); stroke-width: 2.5; }
.point-s { background: var(--s); }
/* Tableau : FNB en colonnes */
.fnb-tableau-zone { max-height: none; }
.fnb-tableau th, .fnb-tableau td { text-align: right; }
.fnb-tableau th:first-child, .fnb-tableau td:first-child { text-align: left; }
.fnb-tableau td:nth-child(2) { color: inherit; text-align: right; }
.fnb-tableau td:first-child { color: var(--encre); font-weight: 500; white-space: normal; min-width: 190px; }
.fnb-tableau td:last-child { font-weight: 400; color: inherit; }
.fnb-tableau th span { display: inline-flex; align-items: center; gap: 6px; }
.fnb-tableau td.meilleur { background: color-mix(in srgb, var(--app-fnb) 12%, transparent); color: var(--encre); font-weight: 700; }
.fnb-tableau td small { display: block; font-size: 0.74rem; color: var(--doux); font-weight: 400; }
@media (max-width: 900px) {
  .reglages.fnb { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reglages.fnb .fnb-choix, .reglages.fnb .choix, .reglages.fnb .bascule { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .reglages.fnb { grid-template-columns: 1fr; }
  .fnb-resultats { grid-template-columns: 1fr 1fr; }
  .fnb-resultats .resultat { padding: 14px 14px 12px; }
  .fnb-frequences { grid-template-columns: 1fr 1fr; }
  .fnb-frequences label { display: block; text-align: center; }
}

/* ---- Variante « fiche technique » du comparateur : cadres fins, chiffres à chasse fixe ---- */
:root { --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.reglages.fnb { border: 1px solid var(--trait); border-top: 4px solid var(--encre); }
.fnb-puce, .fnb-rapides button, .fnb-suggestions b { font-family: var(--mono); }
.fnb-puce { font-size: 0.82rem; }
.fnb-choix .reglage-saisie input, .reglages.fnb .reglage-saisie input { font-family: var(--mono); letter-spacing: 0; }
.fnb-choix .reglage-saisie input::placeholder { font-family: "Poppins", system-ui, sans-serif; }
.fnb-notes p { margin-bottom: 6px; background: color-mix(in srgb, var(--app-interets) 10%, var(--surface)); }
.fnb-notes p.erreur { background: color-mix(in srgb, var(--app-portfolio) 9%, var(--surface)); }
.fnb-notes p.charge { background: var(--surface); }
.fnb-periode strong { font-family: var(--mono); font-weight: 600; }
.fnb-resultats { gap: 12px; background: none; }
.fnb-resultats .resultat { position: relative; border: 1px solid var(--trait); border-top: 4px solid var(--s); box-shadow: none; padding: 14px 16px; }
.fnb-resultats .resultat-etiquette strong { font-family: var(--mono); font-size: 0.95rem; }
.fnb-resultats .resultat-valeur { font-family: var(--mono); font-size: clamp(1.3rem, 2.4vw, 1.65rem); letter-spacing: -0.03em; margin-top: 6px; }
.fnb-resultats .resultat-sous { font-family: var(--mono); font-weight: 500; font-size: 0.8rem; }
.fnb-resultats .etiquette-meilleur { margin-left: auto; background: var(--encre); color: var(--fond); font-family: var(--mono); text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; }
.fnb-resultats .est-meilleur { border-color: var(--encre); border-top-color: var(--s); box-shadow: 4px 4px 0 var(--encre); }
.fnb-graphique { border: 1px solid var(--trait); }
.fnb-graphique .graph-info { font-family: var(--mono); font-size: 0.84rem; }
.fnb-graphique .graph-info strong { font-family: "Poppins", system-ui, sans-serif; }
.fnb-graphique .legende { font-family: var(--mono); font-size: 0.8rem; }
.fnb-graphique .onglets { border-color: var(--encre); background: var(--encre); }
.fnb-tableau-zone { border: 1px solid var(--trait); border-top: 2px solid var(--encre); }
.fnb-tableau thead th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--doux); background: color-mix(in srgb, var(--encre) 3%, var(--surface)); }
.fnb-tableau thead th span { font-family: var(--mono); color: var(--encre); font-size: 0.8rem; text-transform: none; letter-spacing: 0; }
.fnb-tableau td { font-family: var(--mono); padding-top: 11px; padding-bottom: 11px; }
.fnb-tableau td:first-child { font-family: "Poppins", system-ui, sans-serif; font-weight: 600; }
.fnb-tableau td.meilleur { background: color-mix(in srgb, var(--app-parle) 14%, transparent); }
@media (max-width: 640px) {
  .fnb-resultats { gap: 8px; }
}
.fnb-graphique[hidden], .calc-sortie .partage[hidden], .calc-tableau[hidden] { display: none; }
.fnb-notes code { font-family: var(--mono); font-size: 0.82rem; background: color-mix(in srgb, var(--encre) 8%, transparent); padding: 1px 5px; white-space: nowrap; }

/* ---- Comparateur de FNB : montants ponctuels (achats à des dates précises, achats dans les baisses) ---- */
.reglages.fnb .fnb-ponctuels { grid-column: 1 / -1; }
.fnb-ponctuels-titre { margin: 0 0 6px; font-weight: 600; color: var(--encre); font-size: 0.95rem; }
.fnb-ponctuels-liste { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.fnb-ponctuels-liste:empty { display: none; }
.fnb-ponctuel .reglage-saisie input { font-size: 0.95rem; font-weight: 600; padding: 6px 10px; }
.fnb-ponctuel .reglage-saisie input[type="date"] { flex: 0 0 auto; width: 10.2em; font-size: 0.86rem; padding: 6px 6px 6px 10px; border-right: 2px solid var(--trait); }
.fnb-ponctuel .unite { padding: 0 10px; }
.fnb-retirer { flex: none; width: 40px; align-self: stretch; font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; border: 0; border-left: 2px solid var(--trait); background: var(--surface); color: var(--doux); }
.fnb-retirer:hover { background: var(--encre); color: var(--fond); }
.fnb-bouton-ligne { font: inherit; font-size: 0.86rem; font-weight: 600; padding: 7px 12px; cursor: pointer; background: var(--surface); color: var(--encre); border: 0; border-radius: 0; box-shadow: inset 0 0 0 2px var(--encre); }
.fnb-bouton-ligne:hover { background: var(--encre); color: var(--fond); }
.fnb-bouton-ligne:disabled { opacity: .45; cursor: default; background: var(--surface); color: var(--encre); }
.fnb-creux { margin-top: 14px; padding: 12px 14px; display: grid; gap: 8px; background: color-mix(in srgb, var(--app-fnb) 7%, var(--surface)); box-shadow: inset 4px 0 0 var(--app-fnb); }
.fnb-creux-titre { margin: 0; font-weight: 600; color: var(--encre); font-size: 0.9rem; }
.fnb-creux-ligne { display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.fnb-creux-ligne .reglage-saisie { flex: 1 1 130px; }
.fnb-creux-ligne .reglage-saisie input { font-size: 0.95rem; padding: 6px 10px; }
.fnb-creux-ligne select { flex: 1 1 170px; font: inherit; font-size: 0.88rem; color: var(--encre); background: var(--surface); border: 2px solid var(--trait); border-radius: 0; padding: 6px 8px; }
.fnb-creux-ligne select:focus { outline: none; border-color: var(--encre); }
.graph-trace line.ligne-ponctuel { stroke: var(--app-fnb); stroke-width: 1.5; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.pastille-ponctuel { width: 0; height: 14px; background: none; border-left: 2px dotted var(--app-fnb); }
.info-s.s-ponctuel { color: var(--app-fnb); font-weight: 600; }
.info-s.s-ponctuel::before { width: 0; height: 12px; background: none; border-left: 2px dotted var(--app-fnb); }

/* ---------- Soutenir : adresse Interac ---------- */
.interac-adresse { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.interac-adresse[hidden], .interac .bouton[hidden] { display: none; }
.interac-courriel { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.05rem; font-weight: 600; color: var(--encre); padding: 10px 14px; background: var(--fond); box-shadow: inset 0 0 0 2px var(--encre); user-select: all; word-break: break-all; }
@media (max-width: 640px) { .interac-adresse .bouton { width: 100%; } .interac-courriel { width: 100%; } }
