/* ZEEN : système de design commun à toutes les pages.
   Principes : le contenu d'abord, des titres à empattements, un accent discret, des angles nets. */
@font-face { font-family: 'Fraunces'; src: url('/polices/fraunces.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --rayon: 10px; --titre: 'Fraunces', Georgia, 'Times New Roman', serif; --police: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; --zone: clamp(52px, 6.5vw, 84px);
  color-scheme: dark;
}
/* Thème sombre : celui du site, et des zones qui le gardent en thème clair (carrousel, graphiques) */
:root, .theme-sombre {
  --fond: #000; --fond2: #000; --carte: #111113; --carte2: #1a1a1d; --barre: #000; --champ: #000;
  --trait: rgba(255, 255, 255, .1); --ligne-forte: rgba(255, 255, 255, .22); --piste: rgba(255, 255, 255, .14);
  --texte: #f5f5f7; --doux: #a1a1a6; --nav: #d2d2d7; --nav-fort: #fff; --sq1: #161617; --sq2: #242426;
  --or: #38b274; --or-fort: #4cc489; --vert: #38b274; --rouge: #e0695c; --encre: #04140b; --actif-fond: #fff; --actif-texte: #06100a;
  --g-ink: #f5f5f7; --g-muted: #a1a1a6; --g-line: rgba(255, 255, 255, .1); --g-up: #38b274; --g-down: #e0695c; --g-gold: #d9ff8a; --g-panel: #1d1d1f; --g-paper: #000;
}
.theme-sombre { color: var(--texte); }
/* Thème clair : blanc cassé, vert plus foncé pour rester lisible */
:root[data-theme=clair] {
  color-scheme: light;
  --fond: #f7f7f4; --fond2: #f7f7f4; --carte: #fff; --carte2: #f1f1ed; --barre: #f7f7f4; --champ: #fff;
  --trait: rgba(0, 0, 0, .13); --ligne-forte: rgba(0, 0, 0, .28); --piste: rgba(0, 0, 0, .12);
  --texte: #161616; --doux: #5c5f64; --nav: #3c3f44; --nav-fort: #000; --sq1: #ececea; --sq2: #f7f7f4;
  --or: #17794a; --or-fort: #125f3a; --vert: #17794a; --rouge: #b83a2c; --encre: #fff; --actif-fond: #161616; --actif-texte: #fff;
  --g-ink: #161616; --g-muted: #5c5f64; --g-line: rgba(0, 0, 0, .13); --g-up: #17794a; --g-down: #b83a2c; --g-gold: #8a6d00; --g-panel: #f1f1ed; --g-paper: #fff;
}
:root[data-theme=clair] img[src*="/logo-"] { filter: invert(1); }
:root[data-theme=clair] .lampe { background: radial-gradient(circle closest-side, rgba(23, 121, 74, .11), rgba(23, 121, 74, .05) 38%, rgba(23, 121, 74, .015) 70%, transparent); }

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 400 17px/1.5 var(--police); -webkit-font-smoothing: antialiased; }
main { min-height: 70vh; }
h1, h2 { font-family: var(--titre); font-weight: 500; line-height: 1.1; letter-spacing: -.012em; margin: 0 0 .5em; }
h3 { font-weight: 600; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); }
h2 { font-size: clamp(2.1rem, 4.8vw, 3.5rem); }
h3 { font-size: 1.2rem; line-height: 1.25; }
p { margin: 0 0 1em; }
a { color: var(--or); }
img { max-width: 100%; }
small { color: var(--doux); }
:focus-visible { outline: 2px solid var(--or); outline-offset: 2px; }

/* Mise en page */
.large { width: min(1120px, 100% - 44px); margin-inline: auto; }
.etroit { width: min(740px, 100% - 44px); margin-inline: auto; }
.bloc { padding: clamp(40px, 6vw, 72px) 0; }
.grille { display: grid; gap: 16px; }
.grille.trois { grid-template-columns: repeat(3, 1fr); }
.grille.deux { grid-template-columns: repeat(2, 1fr); }
.centre { text-align: center; margin-inline: auto; }

/* Texte */
.sur { color: var(--or); font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .5em; }
.sur a { color: inherit; text-decoration: none; }
.chapo { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.4; color: var(--doux); max-width: 56ch; }
.note { color: var(--doux); font-size: .86rem; }
.doux { color: var(--doux); }

/* Boutons */
.btn { display: inline-block; background: var(--or); color: var(--encre); border: 0; border-radius: 4px; padding: .72em 1.35em; font: 500 1rem var(--police); letter-spacing: -.01em; text-decoration: none; text-align: center; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--or-fort); }
.btn.fantome { background: transparent; color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.btn.fantome:hover { background: rgba(56, 178, 116, .1); }
.btn.petit { padding: .42em .95em; font-size: .86rem; }
.large-btn { display: block; width: 100%; margin-top: .7em; }
.lien { background: none; border: 0; color: var(--doux); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6em; }

/* En-tête */
.barre { position: sticky; top: 0; z-index: 10; background: var(--barre); view-transition-name: barre; }
.barre-in { display: flex; justify-content: space-between; align-items: center; min-height: 54px; }
.logo { display: flex; gap: .55em; align-items: center; text-decoration: none; }
.logo img:first-child { height: 24px; width: auto; } .logo img:last-child { height: 14px; width: auto; }
.nav-large, .menu nav { display: flex; gap: 1.7em; align-items: center; font-size: .82rem; }
.nav-large a:not(.btn), .menu nav a:not(.btn) { color: var(--nav); text-decoration: none; white-space: nowrap; transition: color .2s; }
.nav-large a:not(.btn):hover, .menu nav a:not(.btn):hover { color: var(--nav-fort); }
.nav-large form, .menu nav form { margin: 0; }
.nav-large .lien, .menu nav .lien { color: var(--nav); text-decoration: none; font-size: .82rem; }
.menu { display: none; }
.menu summary { list-style: none; cursor: pointer; padding: 6px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span { display: block; width: 20px; height: 1.5px; background: var(--texte); margin: 5px 0; }

/* Cartes */
.carte { background: var(--carte); border-radius: var(--rayon); padding: 26px; }
.carte p { color: var(--doux); margin-bottom: .4em; }
.chiffres strong { display: block; font-size: 1.8rem; font-weight: 600; letter-spacing: -.03em; color: var(--texte); } .chiffres span { color: var(--doux); font-size: .9rem; }

/* Pied de page */
.pied { padding: 64px 0 28px; font-size: .78rem; color: var(--doux); }
.pied-colonnes { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 28px; margin-bottom: 28px; }
.pied-titre { color: var(--texte); font-weight: 600; margin: 0 0 .7em; }
.pied-colonnes a { display: block; color: var(--doux); text-decoration: none; padding: .2em 0; }
.pied-colonnes a:hover { color: var(--texte); text-decoration: underline; }
.pied .droite { text-align: right; } .pied img { height: 16px; width: auto; display: block; margin: 0 0 .7em auto; }
.risque { max-width: 90ch; padding-top: 6px; } .copyright { margin: 0; }

/* Formulaires */
.auth { padding: clamp(40px, 8vw, 88px) 20px; display: grid; place-items: center; }
.carte-auth { background: var(--carte); border-radius: 4px; padding: clamp(24px, 5vw, 40px); width: min(460px, 100%); }
.carte-auth h1 { font-size: 2rem; }
label { display: block; margin-bottom: 1em; font-size: .9rem; color: var(--doux); }
input:not([type=radio]):not([type=checkbox]), select { display: block; width: 100%; margin-top: .35em; padding: .72em .9em; background: var(--champ); color: var(--texte); border: 1px solid rgba(255, 255, 255, .18); border-radius: 4px; font: 400 1rem var(--police); }
input:focus, select:focus { border-color: var(--or); outline: 0; }
.case, .option { display: flex; gap: .65em; align-items: flex-start; }
.case input, .option input { margin-top: .3em; accent-color: var(--or); flex: none; }
.option { border: 1px solid var(--ligne-forte); border-radius: 4px; padding: .85em 1em; color: var(--texte); cursor: pointer; }
.option:has(input:checked) { border-color: var(--or); box-shadow: 0 0 0 1px var(--or); }
.option small { display: block; }
.choix .sur { margin: 1.2em 0 .6em; }
.alerte { background: rgba(224, 105, 92, .12); padding: .8em 1em; border-radius: 4px; }
.succes { background: rgba(56, 178, 116, .12); padding: .8em 1em; border-radius: 4px; overflow-wrap: anywhere; }
mark { background: var(--or); color: var(--encre); padding: 0 .3em; border-radius: 4px; }
code { overflow-wrap: anywhere; }

/* Espace élève */
.tete { padding: 56px 0 24px; }
.tete.compacte { padding: 36px 0 8px; }
.tete.compacte h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-bottom: .2em; }
.progres { display: flex; align-items: center; gap: 12px; font-size: .84rem; color: var(--doux); margin: .5em 0 1em; }
progress { appearance: none; flex: 1; height: 5px; border: 0; border-radius: 4px; background: var(--piste); overflow: hidden; max-width: 460px; }
progress::-webkit-progress-bar { background: var(--piste); }
progress::-webkit-progress-value { background: var(--or); }
progress::-moz-progress-bar { background: var(--or); }
.partie-titre { margin-top: 2em; font-size: 1.4rem; color: var(--texte); }
.module-carte { color: var(--texte); text-decoration: none; display: block; transition: transform .25s, background .25s; }
.module-carte h3 { font-size: 1.05rem; margin-top: .35em; }
.code { color: var(--or); font-weight: 600; font-size: .84rem; }
.verrou { opacity: .5; }
.services { padding-bottom: 0; }
.module-ligne { border-bottom: 1px solid var(--trait); }
.module-ligne summary { display: flex; gap: 14px; align-items: baseline; padding: 18px 2px; cursor: pointer; list-style: none; font-weight: 500; font-size: 1.05rem; }
.module-ligne summary::-webkit-details-marker { display: none; }
.module-ligne summary::after { content: '+'; margin-left: auto; color: var(--doux); font-size: 1.3rem; font-weight: 300; line-height: 1; }
.module-ligne[open] summary::after { content: '−'; }
.module-ligne > div { padding: 0 2px 18px; color: var(--doux); }

/* Leçons */
.cours { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; width: min(1120px, 100% - 44px); margin-inline: auto; align-items: start; }
.plan { position: sticky; top: 76px; font-size: .88rem; max-height: calc(100vh - 96px); overflow: auto; }
.plan-titre { color: var(--texte); font-weight: 600; text-decoration: none; display: block; margin-bottom: .6em; }
.plan ol { list-style: none; margin: 0; padding: 0; }
.plan a:not(.plan-titre) { display: flex; gap: .6em; padding: .42em .6em; color: var(--doux); text-decoration: none; border-radius: 4px; line-height: 1.35; }
.plan a:not(.plan-titre):hover { color: var(--texte); }
.plan a span { color: var(--doux); font-size: .78rem; min-width: 2.2em; padding-top: .12em; }
.plan li.actif a { background: var(--carte); color: var(--texte); }
.plan li.fait a, .plan li.fait a span { color: var(--or); }
.texte { max-width: 68ch; min-width: 0; font-size: 1.06rem; line-height: 1.6; }
.texte h2 { margin-top: 1.7em; font-size: 1.6rem; }
.texte h2:first-child { margin-top: 0; }
.texte li { margin-bottom: .35em; }
.texte ul, .texte ol { padding-left: 1.3em; }
.encadre { border-radius: 4px; padding: 16px 20px 6px; margin: 1.4em 0; background: var(--carte); }
.encadre-titre { font-size: .84rem; font-weight: 600; margin-bottom: .3em; }
.exemple .encadre-titre { color: #8fb8ff; } .piege .encadre-titre { color: var(--rouge); } .regle .encadre-titre { color: var(--or); }
.formule { background: var(--carte); border-radius: 4px; padding: .95em 1em; text-align: center; font-weight: 600; }
.schema { margin: 1.6em 0; background: var(--carte); border-radius: var(--rayon); padding: 18px; }
.schema svg { width: 100%; height: auto; display: block; font-family: var(--police); }
figcaption { font-size: .84rem; color: var(--doux); margin-top: .6em; text-align: center; }
.tableau { overflow-x: auto; margin: 1.2em 0; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th { text-align: left; padding: .6em .75em; font-weight: 600; white-space: nowrap; border-bottom: 1px solid var(--ligne-forte); }
td { padding: .6em .75em; border-bottom: 1px solid var(--trait); vertical-align: top; }
td form { display: inline-block; margin: 0 .6em .3em 0; }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--rayon); overflow: hidden; margin-bottom: 1.5em; }
.video iframe, .video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.facade { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: #000; cursor: pointer; }
.facade img { width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.facade span { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 72px; height: 72px; line-height: 72px; border-radius: 4px; background: rgba(255, 255, 255, .92); color: #000; font-size: 1.5rem; }
.suite { display: flex; justify-content: space-between; gap: 12px; margin-top: 2.2em; padding-top: 1.3em; border-top: 1px solid var(--trait); }
.suite form { margin: 0; }
.retenir, .exercice { background: var(--carte); border-radius: 4px; padding: 18px 22px 8px; margin-top: 1.4em; }
.score { font-size: 1.6rem; font-weight: 600; color: var(--or); }
.quiz fieldset { border: 0; background: var(--carte); border-radius: 4px; margin: 0 0 12px; padding: 16px 20px; }
.quiz legend { font-weight: 600; float: left; width: 100%; margin-bottom: .5em; color: var(--texte); }
.quiz label { clear: both; display: flex; gap: .6em; margin: .4em 0; color: var(--texte); cursor: pointer; }
.quiz input { accent-color: var(--or); margin-top: .35em; flex: none; }
.quiz .juste { box-shadow: inset 0 0 0 1px var(--or); } .quiz .faux { box-shadow: inset 0 0 0 1px var(--rouge); }
.explication { clear: both; color: var(--doux); font-size: .93rem; margin: .5em 0 .2em; }
.calc output { display: block; color: var(--or); font-weight: 600; font-size: 1.1rem; margin: .4em 0 .7em; min-height: 1.6em; }

/* Administration */
.onglets { display: flex; gap: 1.3em; margin-top: .4em; } .onglets a { color: var(--texte); font-size: .92rem; }
.videos label span { color: var(--texte); }
.recherche { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.recherche input { flex: 1 1 240px; margin: 0; max-width: 360px; } .recherche select { width: auto; margin: 0; }
.pages { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; color: var(--doux); font-size: .9rem; }

/* Chargement */
@view-transition { navigation: auto; }
.sq { background: linear-gradient(100deg, var(--sq1) 30%, var(--sq2) 50%, var(--sq1) 70%) 0 0 / 220% 100%; animation: reflet 1.4s linear infinite; }
.sq.pret { background: none; animation: none; }
@keyframes reflet { to { background-position: -220% 0; } }
.chargement { position: fixed; inset: 54px 0 0; z-index: 9; background: var(--fond); padding: 48px max(22px, calc(50% - 560px)); opacity: 0; pointer-events: none; transition: opacity .15s; }
.chargement.actif { opacity: 1; pointer-events: auto; }
.chargement i { display: block; height: 18px; border-radius: 4px; margin-bottom: 16px; background: linear-gradient(100deg, var(--sq1) 30%, var(--sq2) 50%, var(--sq1) 70%) 0 0 / 220% 100%; animation: reflet 1.4s linear infinite; }
.chargement i:first-child { width: 42%; height: 40px; margin-bottom: 30px; } .chargement i:nth-child(2) { width: 92%; } .chargement i:nth-child(3) { width: 84%; } .chargement i:nth-child(4) { width: 68%; } .chargement i:nth-child(5) { height: 240px; margin-top: 26px; border-radius: 4px; }

@media (max-width: 1000px) {
  .nav-large { display: none; }
  .menu { display: block; }
  .menu nav { display: none; }
  .menu[open] nav { display: flex; flex-direction: column; align-items: stretch; gap: 1em; position: absolute; left: 0; right: 0; top: 54px; padding: 20px 22px 26px; background: var(--barre); border-bottom: 1px solid var(--trait); font-size: 1.05rem; }
  .menu[open] nav .lien { font-size: 1.05rem; }
}
@media (max-width: 860px) {
  body { font-size: 16px; }
  .grille.trois, .grille.deux, .cours { grid-template-columns: minmax(0, 1fr); }
  .plan { position: static; max-height: none; order: 2; border-top: 1px solid var(--trait); padding-top: 18px; }
  .texte { max-width: none; font-size: 1rem; }
  .pied-colonnes { grid-template-columns: repeat(2, 1fr); }
  .pied .droite { text-align: left; } .pied img { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sq, .chargement i { animation: none; }
  @view-transition { navigation: none; }
}

/* Zones de clic confortables au doigt */
.pied-colonnes a { padding: .42em 0; }
.nav-large .btn, .menu nav .btn { min-height: 30px; }
.plan a:not(.plan-titre) { min-height: 32px; }
.carte-auth form + .note, .carte-auth .large-btn + .note { margin-top: 1em; }
.carte-auth h2 { font-size: 1.35rem; margin: 1.1em 0 .25em; }
.carte-auth h2.suite-auth { margin-top: 1.6em; padding-top: 1.2em; border-top: 1px solid var(--trait); }
.creer-acces { display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; margin-bottom: 28px; }
.creer-acces h2 { grid-column: 1 / -1; font-size: 1.35rem; margin: 0; }
.creer-acces label { margin: 0; } .creer-acces .btn { min-height: 44px; }
@media (max-width: 860px) { .creer-acces { grid-template-columns: minmax(0, 1fr); } }

/* Lampe : un halo déplacé par la carte graphique, sans effet sur les clics */
.lampe { position: fixed; left: -300px; top: -300px; width: 600px; height: 600px; z-index: 50; pointer-events: none; opacity: 0; transition: opacity .3s; will-change: transform; background: radial-gradient(circle closest-side, rgba(255, 255, 255, .15), rgba(255, 255, 255, .07) 38%, rgba(255, 255, 255, .02) 70%, transparent); }
.lampe.allumee { opacity: 1; }
.piege { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Espace client */
.espace-nav { display: flex; gap: 24px; overflow-x: auto; margin-top: 20px; scrollbar-width: none; }
.espace-nav a { flex: none; padding: 10px 0; color: var(--doux); font-size: .92rem; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.espace-nav a:hover { color: var(--texte); } .espace-nav a.actif { color: var(--texte); border-bottom-color: var(--or); }
.pos { color: var(--or); } .neg { color: var(--rouge); }
.chiffres { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 0 20px; }
.chiffres.deux { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chiffres > div { border-top: 1px solid var(--trait); padding: 12px 0; min-width: 0; }
.chiffres strong { display: block; font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.chiffres span { color: var(--doux); font-size: .78rem; }
.resume { padding-bottom: 0; }
.titre-bloc { font-size: 1.4rem; margin: 1.8em 0 .7em; }
.calcul { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.calcul-resultat { background: var(--carte); border-radius: var(--rayon); padding: clamp(20px, 3vw, 32px); }
.calcul-resultat .sur { margin-bottom: .1em; }
.calcul-taille { font-family: var(--titre); font-size: clamp(2.6rem, 6vw, 4.2rem); font-weight: 500; line-height: 1.1; margin: 0 0 .3em; font-variant-numeric: lining-nums tabular-nums; }
.calcul-resultat .note:empty { display: none; }
.journal-vue { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: start; }
.courbe { display: block; width: 100%; height: 220px; }
.courbe polyline { fill: none; stroke: var(--or); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.courbe .zero { stroke: var(--ligne-forte); stroke-dasharray: 4 5; vector-effect: non-scaling-stroke; }
.par-actif { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 24px; padding: 0; margin: 12px 0 0; font-size: .86rem; color: var(--doux); }
.par-actif b { margin-left: 6px; font-weight: 600; }
.mois-tete { display: flex; align-items: center; gap: 12px; margin: 2.5em 0 12px; }
.mois-tete strong { flex: 1; text-transform: capitalize; font-weight: 600; } .mois-tete a { color: var(--texte); text-decoration: none; font-size: 1.3rem; padding: 0 6px; }
.mois { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.mois b { text-align: center; color: var(--doux); font-size: .72rem; font-weight: 500; padding-bottom: 4px; }
.mois div { min-height: 52px; padding: 4px 5px; border-radius: 3px; background: var(--carte); font-size: .72rem; color: var(--doux); }
.mois em { display: block; margin-top: 2px; font-style: normal; font-weight: 600; font-size: .7rem; color: var(--texte); }
.mois .pos1 { background: rgba(56, 178, 116, .2); } .mois .pos2 { background: rgba(56, 178, 116, .42); }
.mois .neg1 { background: rgba(224, 105, 92, .2); } .mois .neg2 { background: rgba(224, 105, 92, .42); }
.trade { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px 16px; align-items: end; }
.trade label { margin: 0; } .trade .titre-bloc { grid-column: 1 / -1; margin: 0 0 .1em; } .trade .large-champ { grid-column: 1 / -1; }
.trade .btn { justify-self: start; min-height: 44px; white-space: nowrap; }
textarea { display: block; width: 100%; margin-top: .35em; padding: .72em .9em; background: var(--champ); color: var(--texte); border: 1px solid var(--trait); border-radius: 4px; font: inherit; resize: vertical; }
textarea:focus { border-color: var(--or); outline: 0; }
.note-trade { min-width: 180px; color: var(--doux); font-size: .84rem; }
.lignes { list-style: none; padding: 0; margin: 0; }
.lignes li { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 14px 0; border-top: 1px solid var(--trait); }
.lignes strong { display: block; font-weight: 600; } .lignes span { color: var(--doux); font-size: .86rem; } .lignes p { margin: .3em 0 0; color: var(--doux); font-size: .9rem; }
.replays { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.replays h3 { margin-bottom: .1em; }
.ligne-form { display: flex; gap: 8px; align-items: center; margin: 0; } .ligne-form input { margin: 0; min-width: 220px; }
@media (max-width: 860px) { .calcul, .journal-vue { grid-template-columns: minmax(0, 1fr); } .mois-tete { margin-top: 1em; } .mois div { min-height: 44px; } .lignes li { flex-direction: column; align-items: flex-start; } }

/* Bouton du thème */
.barre-in { gap: 14px; } .logo { margin-right: auto; }
.theme-bouton { flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid var(--trait); border-radius: 4px; background: none; color: var(--nav); cursor: pointer; }
.theme-bouton:hover { color: var(--nav-fort); }
.theme-bouton svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-bouton .soleil { display: none; } :root[data-theme=clair] .theme-bouton .soleil { display: block; } :root[data-theme=clair] .theme-bouton .lune { display: none; }

/* Fluidité : fondu entre les pages, barre du haut immobile. Ignoré sans danger par les navigateurs anciens. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: ease; }
::view-transition-group(barre) { animation-duration: 0s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }

/* Finition : un seul fond, une hiérarchie forte, des surfaces fines */
h2 { font-size: clamp(2.3rem, 5vw, 3.9rem); line-height: 1.05; letter-spacing: -.02em; }
.sur { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .9em; }
.sur a { letter-spacing: inherit; }
.chapo { line-height: 1.45; }
.btn { border-radius: 6px; padding: .8em 1.5em; font-weight: 600; transition: background .2s; }
.btn.petit { padding: .45em 1em; }
.carte, .carte-auth, .calcul-resultat { box-shadow: inset 0 0 0 1px var(--trait); }
.chiffres strong { font-family: var(--titre); font-weight: 500; font-size: 1.75rem; line-height: 1.15; letter-spacing: -.01em; font-variant-numeric: lining-nums tabular-nums; }
.titre-bloc { font-size: 1.6rem; }

/* Sécurité et journal */
.etapes-securite { padding-left: 1.2em; } .etapes-securite li { margin-bottom: .9em; }
.cle { display: block; margin: .5em 0; padding: .7em .9em; background: var(--carte); border-radius: 6px; font-size: .95rem; letter-spacing: .08em; overflow-wrap: anywhere; user-select: all; }
.secours ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; padding: 0; margin: 1em 0 0; }
.secours .titre-bloc { margin-top: 0; }
.etroit .ligne-form { margin-bottom: 14px; flex-wrap: wrap; } .etroit .ligne-form input { flex: 1 1 200px; min-width: 0; max-width: 240px; }
.actions-trade { white-space: nowrap; } .actions-trade a { color: var(--doux); margin-right: 12px; font-size: .92rem; }
/* Le fondu ne doit jamais bloquer un clic, même s'il traîne */
::view-transition { pointer-events: none; }

/* Images : ni clic, ni glisser, ni sélection */
img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
main img { pointer-events: none; }

/* Champs : toujours visibles, quel que soit le fond */
input:not([type=radio]):not([type=checkbox]), select, textarea { border: 1px solid var(--ligne-forte); }
input:not([type=radio]):not([type=checkbox]):focus, select:focus, textarea:focus { border-color: var(--or); box-shadow: inset 0 0 0 1px var(--or); outline: 0; }
:root[data-theme=clair] { --champ: #f4f4f0; }

/* Chargement sur les boutons */
.en-cours { position: relative; color: transparent !important; pointer-events: none; }
.en-cours::after { content: ''; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border: 2px solid var(--encre); border-right-color: transparent; border-radius: 50%; animation: tourne-bouton .7s linear infinite; }
.btn.fantome.en-cours::after { border-color: var(--or); border-right-color: transparent; }
.lien.en-cours::after { width: 13px; height: 13px; border-color: var(--doux); border-right-color: transparent; }
@keyframes tourne-bouton { to { transform: rotate(360deg); } }

/* QR code de la double authentification */
.qr { display: block; width: 220px; height: 220px; margin: .7em 0; border-radius: 6px; }

/* Journal et stats */
.vues, .periodes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin-bottom: 18px; }
.vues a, .periodes a { flex: 1 0 auto; padding: .65em 1.1em; border-radius: 6px; background: var(--carte); box-shadow: inset 0 0 0 1px var(--trait); color: var(--doux); text-align: center; text-decoration: none; font-size: .92rem; font-weight: 600; }
.periodes a { flex: 0 0 auto; padding: .4em .9em; font-size: .82rem; }
.vues a.actif, .periodes a.actif { color: var(--or); box-shadow: inset 0 0 0 1px var(--or); }
.perf { background: var(--carte); box-shadow: inset 0 0 0 1px var(--trait); border-radius: var(--rayon); padding: clamp(18px, 3vw, 28px); margin-bottom: 18px; }
.perf-tete { display: flex; justify-content: space-between; gap: 16px; }
.perf .sur { margin-bottom: .3em; }
.perf-r { font-family: var(--titre); font-size: clamp(3rem, 8vw, 4.6rem); line-height: 1; margin: 0 0 .25em; font-variant-numeric: lining-nums tabular-nums; }
.perf .droite { text-align: right; } .perf .droite strong { display: block; font-family: var(--titre); font-weight: 500; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.1; } .perf .droite span { color: var(--doux); font-size: .8rem; }
.perf .courbe { height: 150px; }
.barres { list-style: none; margin: 0; padding: 0; }
.barres li { display: grid; grid-template-columns: minmax(80px, 150px) minmax(0, 1fr) 3.2em 4em; gap: 12px; align-items: center; padding: 7px 0; font-size: .9rem; }
.barres b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; } .barres small { display: block; color: var(--doux); }
.jauge { display: block; width: 100%; height: 6px; fill: var(--or); } .jauge .fond-barre { fill: var(--piste); }
.jauge.duel { height: 10px; fill: var(--or); } .jauge.duel .fond-barre { fill: var(--rouge); }
.duel-texte { display: flex; justify-content: space-between; margin: 6px 0 0; font-size: .86rem; font-weight: 600; }
.formule { background: var(--fond); border-radius: 6px; padding: 12px 14px; margin: 14px 0; font-size: .86rem; color: var(--doux); }
.formule b { display: block; color: var(--texte); margin-bottom: 2px; } .formule span { display: block; margin-top: 2px; font-variant-numeric: tabular-nums; }
.rediffusions { max-width: 760px; }
@media (max-width: 860px) {
  .espace-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; gap: 0; justify-content: space-between; padding: 4px 10px calc(4px + env(safe-area-inset-bottom)); background: var(--barre); box-shadow: 0 -1px 0 var(--trait); }
  .espace-nav a { padding: 10px 6px; font-size: .74rem; border-bottom: 0; margin: 0; }
  .espace-nav a.actif { color: var(--or); }
  body:has(.espace-nav) { padding-bottom: 60px; }
  .barres li { grid-template-columns: 76px minmax(0, 1fr) 2.8em 3.6em; gap: 8px; }
}

/* Chiffres de l'espace client : police nette, chiffres alignés */
.chiffres strong, .perf-r, .perf .droite strong, .calcul-taille { font-family: var(--police); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chiffres strong { font-size: 1.45rem; }
.perf-r { font-weight: 800; letter-spacing: -.03em; }
.barres, .mois, .formule { font-family: var(--police); }
.valeurs { display: flex; gap: 8px; margin: -.4em 0 1em; }
.formule { text-align: left; font-weight: 400; }

/* Section en cours dans le menu */
.nav-large a.ici { color: var(--or) !important; }

/* Nuage léger sous l'en-tête : un fondu de la couleur du fond, absent en haut de page */
.barre::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none; opacity: 0; transition: opacity .3s ease-out; background: linear-gradient(to bottom, var(--barre), transparent); }
.barre.defile::after { opacity: 1; }

/* Bouton retour en haut à gauche */
.retour { display: inline-block; margin-top: 16px; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--carte); color: var(--doux); font-size: .84rem; text-decoration: none; transition: color .15s; }
.retour:hover { color: var(--texte); }

/* Écran de chargement à l'arrivée sur le site : 2 secondes */
.entree-ecran { display: none; }
.entree .entree-ecran { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; background: var(--fond); animation: entree-fin .35s ease-out 2s forwards; }
.entree-ecran img { display: block; width: auto; }
.entree-ecran img:first-child { height: 60px; } .entree-ecran img:nth-child(2) { height: 24px; }
:root[data-theme=clair] .entree-ecran img { filter: invert(1); }
.entree-ecran span { position: relative; width: 130px; height: 2px; margin-top: 8px; overflow: hidden; border-radius: 2px; background: var(--trait); }
.entree-ecran span::after { content: ''; position: absolute; inset: 0; background: var(--or); transform-origin: left; animation: entree-barre 2s ease-in-out both; }
@keyframes entree-barre { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes entree-fin { to { opacity: 0; visibility: hidden; } }

/* Annonces économiques du jour */
.eco-jour { margin: 0 0 14px; color: var(--doux); font-size: .9rem; }
.eco-jour::first-letter { text-transform: uppercase; }
.eco { list-style: none; display: grid; gap: 10px; margin: 0 0 18px; padding: 0; }
.eco li { display: grid; grid-template-columns: 58px 48px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px 20px; background: var(--carte); border-radius: var(--rayon); box-shadow: inset 0 0 0 1px var(--trait); }
.eco li.passee { opacity: .55; }
.eco time { font-family: var(--titre); font-size: 1.15rem; font-variant-numeric: lining-nums tabular-nums; }
.eco-devise { font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--doux); }
.eco-titre strong { display: block; font-weight: 600; line-height: 1.3; }
.eco-titre small { display: flex; flex-wrap: wrap; gap: 2px 14px; margin-top: 3px; color: var(--doux); font-size: .8rem; }
.eco-titre small:empty { display: none; }
.eco-force { font-size: .78rem; font-weight: 600; white-space: nowrap; }
.eco-force::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: currentColor; }
.eco-force.forte { color: var(--rouge); } .eco-force.moyenne { color: var(--or); }
.eco-vide { margin: 0 0 18px; padding: 34px 20px; text-align: center; color: var(--doux); background: var(--carte); border-radius: var(--rayon); box-shadow: inset 0 0 0 1px var(--trait); }
@media (max-width: 560px) {
  .eco li { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 6px 10px; padding: 14px 16px; }
  .eco-titre { grid-column: 1 / -1; grid-row: 2; }
}
