:root {
  --encre: #15172b;
  --gris: #5d6175;
  --ligne: #e6e4de;
  --fond: #f7f5f0;
  --carte: #ffffff;
  --chaos: #e8590c;
  --chaos-doux: #fff1e8;
  --simple: #0c8a6a;
  --simple-doux: #e6f6f1;
  --acc: var(--chaos);
  --acc-doux: var(--chaos-doux);
  --r: 16px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--encre);
}
body.v-optimisee { --acc: var(--simple); --acc-doux: var(--simple-doux); }
* { box-sizing: border-box; }
body { margin: 0; background: var(--fond); transition: background .4s; }
a { color: inherit; }
h1, h2, h3 { letter-spacing: -0.02em; margin: 0 0 .4em; }
p { line-height: 1.55; }

.bandeau { background: var(--encre); color: #fff; font-size: 12px; text-align: center; padding: 6px 10px; letter-spacing: .02em; }
.tete { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 24px; padding: 12px 28px;
  background: rgba(247,245,240,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; text-decoration: none; }
.logo-pastille { width: 30px; height: 30px; border-radius: 9px; background: var(--acc); color: #fff; display: grid; place-items: center;
  font-size: 17px; transition: background .4s; }
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 10px; color: var(--gris); font-size: 14px; font-weight: 500; }
.nav a.actif, .nav a:hover { background: #fff; color: var(--encre); box-shadow: 0 1px 0 var(--ligne); }
.bascule { display: flex; background: #ebe8e1; border-radius: 12px; padding: 4px; gap: 2px; }
.bascule button { border: 0; background: none; padding: 8px 14px; border-radius: 9px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--gris); cursor: pointer; transition: all .25s; }
.bascule button.actif { background: var(--acc); color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.bascule button.verrou { opacity: .6; }

main { max-width: 1120px; margin: 0 auto; padding: 32px 28px 60px; min-height: 70vh; }
.pied { max-width: 1120px; margin: 0 auto; padding: 24px 28px 40px; color: var(--gris); font-size: 13px; border-top: 1px solid var(--ligne); }

.etiquette { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--acc); background: var(--acc-doux); padding: 5px 10px; border-radius: 99px; transition: all .4s; }
.carte { background: var(--carte); border: 1px solid var(--ligne); border-radius: var(--r); padding: 22px; }
.grille { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.bouton { display: inline-flex; align-items: center; gap: 8px; background: var(--acc); color: #fff; border: 0; border-radius: 12px; padding: 13px 20px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .4s, transform .15s; }
.bouton:hover { transform: translateY(-1px); }
.bouton.second { background: #fff; color: var(--encre); border: 1px solid var(--ligne); }
.muet { color: var(--gris); }
.petit { font-size: 13px; }

/* Le projet */
.heros { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; margin-bottom: 56px; }
.heros h1 { font-size: 52px; line-height: 1.02; margin-top: 14px; }
.heros h1 em { font-style: normal; color: var(--acc); transition: color .4s; }
.heros p.chapo { font-size: 19px; color: var(--gris); margin: 18px 0 26px; }
.constellation { position: relative; height: 380px; border-radius: 24px; background: #fff; border: 1px solid var(--ligne); overflow: hidden; }
.puce { position: absolute; padding: 7px 11px; border-radius: 10px; background: var(--chaos-doux); color: #8a3306; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; transition: all .9s cubic-bezier(.6,-0.2,.3,1.3); border: 1px solid #ffd8bf; transform: translate(-50%,-50%); }
.puce-une { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) scale(.3); opacity: 0; padding: 18px 26px; border-radius: 18px;
  background: var(--simple); color: #fff; font-weight: 800; font-size: 22px; transition: all .7s .35s; text-align: center; }
.puce-une small { display: block; font-size: 12px; font-weight: 500; opacity: .85; margin-top: 4px; }
body.v-optimisee .puce { left: 50% !important; top: 50% !important; opacity: 0; transform: translate(-50%,-50%) scale(.4); }
body.v-optimisee .puce-une { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.constellation .compte { position: absolute; right: 16px; bottom: 14px; font-size: 13px; color: var(--gris); }
.constellation .compte b { color: var(--acc); font-size: 22px; }

.etapes3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 20px 0 50px; }
.etape3 { position: relative; }
.etape3 .num { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; margin-bottom: 12px; }
.etape3.a .num { background: var(--chaos); } .etape3.b .num { background: var(--simple); } .etape3.c .num { background: #6b5bd2; }
.etape3 .statut { position: absolute; top: 22px; right: 22px; font-size: 12px; font-weight: 700; color: var(--gris); }
.section-titre { font-size: 30px; margin-top: 10px; }
.feuille { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px; }
.feuille .carte { padding: 16px; }
.feuille b { display: block; font-size: 13px; margin-bottom: 4px; }

/* Connexion + tableau de bord */
.connexion { max-width: 440px; margin: 40px auto; text-align: center; }
.connexion .carte { padding: 34px; }
.avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--acc-doux); color: var(--acc); display: grid; place-items: center;
  font-size: 26px; font-weight: 800; margin: 0 auto 14px; }
.bonjour { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.bonjour h1 { font-size: 34px; margin: 6px 0 2px; }
.jauge { display: flex; gap: 10px; flex-wrap: wrap; }
.jauge div { background: #fff; border: 1px solid var(--ligne); border-radius: 14px; padding: 10px 16px; min-width: 120px; }
.jauge b { display: block; font-size: 26px; color: var(--acc); transition: color .4s; }
.jauge span { font-size: 12px; color: var(--gris); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tuile { display: block; text-decoration: none; background: #fff; border: 1px solid var(--ligne); border-radius: var(--r); padding: 18px; transition: all .2s; position: relative; }
.tuile:hover { border-color: var(--acc); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,.06); }
.tuile .ico { font-size: 26px; }
.tuile h3 { font-size: 16.5px; margin: 10px 0 4px; }
.tuile .badge { display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--acc); background: var(--acc-doux); padding: 4px 9px; border-radius: 8px; transition: all .4s; }
.tuile.grise { opacity: .62; cursor: default; }
.tuile.grise:hover { transform: none; box-shadow: none; border-color: var(--ligne); }
.boite { margin-top: 26px; }
.message { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--ligne); }
.message:first-of-type { border-top: 0; }
.exp { flex: 0 0 auto; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 6px; background: #eef0f6; color: #3c4366; min-width: 96px; text-align: center; }
body.v-optimisee .exp { background: var(--simple-doux); color: var(--simple); }

/* Parcours */
.fil { font-size: 14px; color: var(--gris); text-decoration: none; }
.parcours-tete { display: flex; justify-content: space-between; gap: 30px; align-items: flex-start; margin: 16px 0 28px; flex-wrap: wrap; }
.parcours-tete h1 { font-size: 38px; }
.compteurs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 28px; }
.compteur { background: #fff; border: 1px solid var(--ligne); border-radius: var(--r); padding: 16px 18px; }
.compteur b { display: block; font-size: 34px; color: var(--acc); line-height: 1.1; transition: color .4s; }
.compteur span { font-size: 13px; color: var(--gris); }
.frise { position: relative; padding-left: 34px; }
.frise::before { content: ""; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 2px; background: var(--ligne); }
.pas { position: relative; background: #fff; border: 1px solid var(--ligne); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px;
  animation: entre .45s both; }
.pas::before { content: attr(data-n); position: absolute; left: -34px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--acc);
  color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; transition: background .4s; }
.pas .org { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--acc); transition: color .4s; }
.pas h3 { font-size: 16px; margin: 4px 0 2px; }
.pas p { margin: 0; color: var(--gris); font-size: 14px; }
.pas a.src { font-size: 12px; color: var(--gris); }
@keyframes entre { from { opacity: 0; transform: translateY(8px); } }
.appel { margin-top: 22px; padding: 18px 20px; border-radius: 14px; background: var(--acc-doux); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; transition: background .4s; }

/* Fiche de paie */
.paie-controle { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin: 10px 0 24px; }
.paie-controle input[type=range] { flex: 1; min-width: 240px; accent-color: var(--acc); }
.paie-controle .valeur { font-size: 28px; font-weight: 800; min-width: 260px; }
.fiches { display: grid; grid-template-columns: 1.3fr 1fr; gap: 16px; align-items: start; }
.fiche { background: #fff; border: 2px solid var(--ligne); border-radius: var(--r); padding: 20px; transition: border-color .4s, opacity .4s; }
.fiche.chaos { border-color: #ffd8bf; } .fiche.simple { border-color: #b8e6d8; }
body.v-actuelle .fiche.simple, body.v-optimisee .fiche.chaos { opacity: .55; }
.fiche h3 { display: flex; justify-content: space-between; }
.fiche table { width: 100%; border-collapse: collapse; font-size: 13px; }
.fiche td { padding: 5px 0; border-bottom: 1px dashed var(--ligne); }
.fiche td.m { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 10px; }
.fiche tr.total td { font-weight: 800; border-bottom: 0; border-top: 2px solid var(--encre); padding-top: 8px; font-size: 14px; }
.fiche tr.sous td { color: var(--gris); font-style: italic; }
.fiche .resultat { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--fond); }
.fiche .resultat b { font-size: 26px; display: block; }
.fiche.chaos .resultat b { color: var(--chaos); } .fiche.simple .resultat b { color: var(--simple); }
.ecart { margin-top: 16px; }

/* Chiffres */
.chiffres { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.chiffre b { display: block; font-size: 46px; color: var(--chaos); letter-spacing: -0.03em; line-height: 1.05; }
.chiffre a { font-size: 12px; color: var(--gris); word-break: break-all; }
.ids { columns: 3; column-gap: 24px; font-size: 14px; }
.ids div { break-inside: avoid; padding: 6px 0; border-bottom: 1px solid var(--ligne); }
.ids span { color: var(--gris); font-size: 12px; display: block; }

/* Plan */
.tableau { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--r); overflow: hidden; border: 1px solid var(--ligne); font-size: 14px; }
.tableau th, .tableau td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--ligne); vertical-align: top; }
.tableau th { background: var(--simple-doux); color: var(--simple); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.tableau td:first-child { font-weight: 700; }
.compare { display: flex; align-items: center; gap: 18px; font-size: 64px; font-weight: 900; letter-spacing: -0.04em; margin: 4px 0 10px; }
.compare .de { color: var(--chaos); } .compare .a { color: var(--simple); } .compare .fl { font-size: 36px; color: var(--gris); }
.limites li { margin-bottom: 10px; line-height: 1.5; }

/* Candidats */
.cand { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cand .carte { position: relative; }
.cand .parti { font-size: 12px; font-weight: 800; color: #6b5bd2; text-transform: uppercase; letter-spacing: .05em; }
.cand .etat { position: absolute; top: 18px; right: 18px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #f0eefb; color: #6b5bd2; }
.cand .etat.off { background: #eee; color: #888; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--encre); color: #fff; padding: 12px 18px; border-radius: 12px;
  font-size: 14px; opacity: 0; transition: opacity .3s; pointer-events: none; z-index: 50; }
.toast.vu { opacity: 1; }

@media (max-width: 900px) {
  .heros, .fiches { grid-template-columns: 1fr; }
  .heros h1 { font-size: 38px; }
  .etapes3, .chiffres, .cand, .g3 { grid-template-columns: 1fr; }
  .feuille { grid-template-columns: repeat(2, 1fr); }
  .compteurs, .g4 { grid-template-columns: repeat(2, 1fr); }
  .ids { columns: 1; }
  .tete { padding: 10px 14px; gap: 10px; }
  .nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav a { white-space: nowrap; }
  main { padding: 22px 14px 50px; }
  .compare { font-size: 44px; }
}
