/* Bougie : terminal de trading sombre, un seul accent bleu, vert/rouge réservés aux prix. */
:root, :root[data-theme="dark"] {
  --bg: #0b0e11; --surface: #15191f; --surface-2: #1d222a; --line: #2a3039;
  --text: #eaecef; --muted: #8a93a2; --faible: #5e6673;
  --up: #2ebd85; --down: #f6465d; --accent: #5b8cff; --accent-fort: #7ea4ff; --sur-accent: #0b0e11;
  --or: #f0b90b;
  --ombre: 0 1px 0 rgb(255 255 255 / .03) inset, 0 12px 32px rgb(0 0 0 / .35);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --line: #e0e3e8;
  --text: #15181d; --muted: #5b6370; --faible: #8a919c;
  --up: #0f9d6b; --down: #d6334f; --accent: #2f62e0; --accent-fort: #234fc0; --sur-accent: #ffffff;
  --or: #b7860b;
  --ombre: 0 1px 2px rgb(21 24 29 / .05), 0 8px 24px rgb(21 24 29 / .06);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) { --bg: #f4f5f7; --surface: #ffffff; --surface-2: #eef0f3; --line: #e0e3e8; --text: #15181d; --muted: #5b6370; --faible: #8a919c; --up: #0f9d6b; --down: #d6334f; --accent: #2f62e0; --accent-fort: #234fc0; --sur-accent: #ffffff; }
}

* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.6 Geist, system-ui, sans-serif; min-height: 100dvh; font-feature-settings: "ss01"; }
a { color: var(--accent); text-decoration: none; }
button, a, [role="button"], .puce, label.btn { touch-action: manipulation; }
button, .btn, .puce, .onglets button, .bascule button { -webkit-user-select: none; user-select: none; font: inherit; }
input, select, textarea { font: inherit; font-size: 16px; color: inherit; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
.saut { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--sur-accent); padding: 8px 12px; border-radius: 8px; z-index: 50; }
.saut:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hausse { color: var(--up); } .baisse { color: var(--down); } .muet { color: var(--muted); }
b, .num { font-variant-numeric: tabular-nums; }

/* ---------- barre de navigation ---------- */
.barre { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; height: 60px; padding: 0 max(20px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.marque { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 650; font-size: 17px; letter-spacing: -0.02em; }
.marque svg { width: 26px; height: 26px; }
.m-bas, .m-meche-bas { fill: var(--down); stroke: var(--down); stroke-width: 2; stroke-linecap: round; }
.m-haut, .m-meche-haut { fill: var(--up); stroke: var(--up); stroke-width: 2; stroke-linecap: round; }
.m-bas, .m-haut { stroke: none; }
.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; font-size: 14px; transition: color .15s, background .15s; }
.nav a i { font-size: 18px; }
.nav a.actif { color: var(--text); background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .nav a:hover { color: var(--text); } }

@media (max-width: 760px) {
  .barre { height: 52px; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--bg); }
  .nav { position: fixed; left: 0; right: 0; bottom: 0; margin: 0; justify-content: space-around; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .nav a { flex-direction: column; gap: 2px; font-size: 11px; padding: 4px 6px; background: none !important; }
  .nav a i { font-size: 22px; }
  .nav a.actif { color: var(--accent); }
  main { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
}

/* ---------- pages ---------- */
.page { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }
.page.etroite { max-width: 680px; }
.page-tete { margin-bottom: 28px; max-width: 70ch; }
.page-tete h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 680; }
.page-tete p { color: var(--muted); margin: 10px 0 0; }
.titre-section { font-size: 20px; font-weight: 650; margin: 40px 0 16px; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--ombre); }
.w-note { color: var(--muted); font-size: 13.5px; margin: 10px 0 0; }
.ok-note { color: var(--up); display: flex; gap: 8px; align-items: center; font-weight: 500; margin: 8px 0 0; }
.alerte { color: var(--down); background: color-mix(in srgb, var(--down) 10%, transparent); border-radius: 8px; padding: 10px 12px; margin: 10px 0 0; display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
.etiquette { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.etiquette.ok { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }

/* ---------- boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 550; font-size: 14.5px; cursor: pointer; white-space: nowrap; transition: transform .1s ease-out, background .15s, border-color .15s, opacity .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-principal { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.btn-grand { min-height: 50px; padding: 0 22px; font-size: 15.5px; }
.btn-petit { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn-danger { color: var(--down); }
.btn.vente, .btn-ordre.vente { color: #fff; background: var(--down); border-color: var(--down); }
.btn-ordre.achat { color: #fff; background: var(--up); border-color: var(--up); }
.btn.btn-petit.vente { background: color-mix(in srgb, var(--down) 14%, transparent); color: var(--down); border-color: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn:hover:not(:disabled) { border-color: var(--faible); }
  .btn-principal:hover:not(:disabled) { background: var(--accent-fort); border-color: var(--accent-fort); }
  .btn-ordre:hover:not(:disabled) { filter: brightness(1.08); }
}
.boutons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.puces { display: flex; flex-wrap: wrap; gap: 6px; }
.puce { min-height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 550; cursor: pointer; transition: all .15s; }
.puce.actif { color: var(--text); background: var(--surface-2); border-color: var(--faible); }

/* ---------- champs ---------- */
.champ { min-width: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 500; }
.champ small { font-size: 12.5px; color: var(--faible); }
.saisie { display: flex; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 12px; min-height: 44px; transition: border-color .15s; }
.saisie:focus-within { border-color: var(--accent); }
.saisie input, .saisie select { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 9px 0; font-variant-numeric: tabular-nums; color: var(--text); }
.saisie select { cursor: pointer; }
.saisie select option { background: var(--surface); }
.saisie em { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 8px; }
.saisie.petite { min-height: 34px; padding: 0 8px; }
.saisie.petite input { padding: 4px 0; width: 60px; }
.saisie .max { border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; margin-left: 8px; font-size: 13px; }
.champ.case { flex-direction: row; align-items: center; gap: 10px; color: var(--text); font-size: 14px; cursor: pointer; align-self: end; min-height: 44px; }
.champ.case input { width: 18px; height: 18px; accent-color: var(--accent); }
.champ.curseur span { display: flex; justify-content: space-between; }
.champ.curseur b { color: var(--text); }
input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; touch-action: pan-y; }
.grille-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

/* ---------- accueil ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 32px; align-items: center; padding: 24px 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 700; letter-spacing: -0.035em; max-width: 14ch; }
.hero p { font-size: 17px; color: var(--muted); max-width: 44ch; margin: 16px 0 0; }
.hero .boutons { margin-top: 28px; }
.hero-graphe { padding: 14px 14px 6px; }
.hg-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 0 4px 8px; font-size: 13px; }
.hg-tete span { color: var(--muted); }
.hero-graphe .graphe { height: 300px; }
.progression { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 0; margin-top: 32px; overflow: hidden; }
.progression > * { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.progression > * + * { border-left: 1px solid var(--line); }
.progression span { color: var(--muted); font-size: 13px; }
.progression b { font-size: 22px; font-weight: 650; }
.barre-prog { height: 4px; background: var(--surface-2); border-radius: 4px; margin-top: 8px; overflow: hidden; }
.barre-prog i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.suite { color: var(--text); background: color-mix(in srgb, var(--accent) 7%, transparent); transition: background .15s; }
.suite b { font-size: 16px !important; }
.suite small { color: var(--muted); }
@media (hover: hover) and (pointer: fine) { a.suite:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); } }
.parcours { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.parcours a { display: grid; grid-template-columns: 40px 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); transition: border-color .15s, transform .1s ease-out; }
.parcours a:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .parcours a:hover { border-color: var(--faible); } }
.p-num { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-weight: 650; font-variant-numeric: tabular-nums; }
.parcours a.complet .p-num { background: color-mix(in srgb, var(--up) 15%, transparent); color: var(--up); }
.p-texte { display: flex; flex-direction: column; min-width: 0; }
.p-texte small { color: var(--muted); font-size: 13px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p-etat { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.avertissement { display: flex; gap: 14px; margin-top: 40px; padding: 18px 20px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--or) 35%, var(--line)); background: color-mix(in srgb, var(--or) 6%, transparent); }
.avertissement i { font-size: 24px; color: var(--or); flex: none; }
.avertissement p { margin: 0; color: var(--muted); font-size: 14.5px; }
.avertissement b { color: var(--text); }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .hero-graphe .graphe { height: 220px; }
  .progression { grid-template-columns: 1fr 1fr; }
  .progression .suite { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .parcours { grid-template-columns: 1fr; }
}
@media (max-width: 760px) { .page { padding: 20px 16px 40px; } .hero .boutons .btn { flex: 1; } }

/* ---------- cours ---------- */
.module { margin-bottom: 36px; scroll-margin-top: 80px; }
.module-tete { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 14px; }
.module-icone { width: 44px; height: 44px; flex: none; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 22px; }
.module-num { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.module-tete h2 { font-size: 21px; font-weight: 650; }
.module-tete p { color: var(--muted); margin: 4px 0 0; font-size: 14px; max-width: 70ch; }
.lecons { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.lecons li + li { border-top: 1px solid var(--line); }
.lecons a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--text); transition: background .15s; }
.lecons a i { font-size: 20px; color: var(--faible); }
.lecons a.faite i { color: var(--up); }
.lecons a span { flex: 1; }
.lecons a small { color: var(--muted); font-size: 12.5px; }
@media (hover: hover) and (pointer: fine) { .lecons a:hover { background: var(--surface-2); } }

/* ---------- leçon ---------- */
.lecon { max-width: 760px; }
.fil { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.lecon h1 { font-size: clamp(28px, 4.2vw, 38px); font-weight: 690; }
.lecon-meta { color: var(--muted); font-size: 13.5px; display: flex; gap: 6px; align-items: center; margin: 10px 0 8px; }
.texte { font-size: 16.5px; line-height: 1.72; }
.texte p, .texte ul, .texte ol { margin: 14px 0; }
.texte h2 { font-size: 23px; font-weight: 660; margin: 36px 0 6px; }
.texte h3 { font-size: 18px; margin: 26px 0 4px; }
.texte li { margin: 5px 0; }
.texte li::marker { color: var(--faible); }
.texte strong { font-weight: 640; }
.texte code { font-family: "Geist Mono", ui-monospace, monospace; font-size: .88em; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.texte input[type="checkbox"] { accent-color: var(--accent); margin-right: 8px; }
.texte ul:has(input[type="checkbox"]) { list-style: none; padding-left: 4px; }
.tableau { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 10px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tableau table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.tableau th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--surface-2); }
.tableau th, .tableau td { padding: 9px 12px; white-space: nowrap; }
.tableau td { border-top: 1px solid var(--line); }
.texte .tableau td { white-space: normal; min-width: 90px; }
.encadre { margin: 20px 0; padding: 14px 18px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--c, var(--accent)); font-size: 15.5px; }
.encadre p { margin: 6px 0; }
.encadre ul { margin: 6px 0; padding-left: 20px; }
.encadre-titre { display: flex; align-items: center; gap: 8px; font-weight: 640; color: var(--c, var(--accent)); font-size: 14px; }
.encadre-titre i { font-size: 18px; }
.encadre-def { --c: var(--accent); }
.encadre-histoire { --c: #b48cff; }
.encadre-attention { --c: var(--down); }
.encadre-astuce { --c: var(--up); }
.encadre-retenir { --c: var(--or); }
.encadre-exemple { --c: #3cc6d6; }
.bloc-widget { margin: 24px 0; }
.quiz { margin: 22px 0; padding: 18px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s; }
.quiz.reussi { border-color: color-mix(in srgb, var(--up) 45%, var(--line)); }
.quiz-q { display: flex; gap: 10px; font-weight: 600; margin: 0 0 14px; font-size: 16px; }
.quiz-q i { color: var(--accent); font-size: 20px; flex: none; margin-top: 2px; }
.quiz-choix, .sc-choix { display: flex; flex-direction: column; gap: 8px; }
.btn-choix { justify-content: flex-start; text-align: left; white-space: normal; padding: 10px 14px; min-height: 46px; line-height: 1.4; background: var(--surface-2); }
.btn-choix.rate { border-color: var(--down); color: var(--down); }
.btn-choix.bonne { border-color: var(--up); color: var(--up); opacity: 1; }
.quiz-retour, .sc-retour { display: none; }
.quiz-retour.ok, .quiz-retour.ko, .sc-retour.ok, .sc-retour.ko { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-top: 12px; padding: 12px 14px; border-radius: 8px; animation: entre .2s ease-out; }
.quiz-retour p, .sc-retour p { margin: 0; flex: 1; min-width: 200px; font-size: 14.5px; }
.quiz-retour i, .sc-retour i { font-size: 20px; }
.ok { background: color-mix(in srgb, var(--up) 10%, transparent); } .ok > i { color: var(--up); }
.ko { background: color-mix(in srgb, var(--down) 10%, transparent); } .ko > i { color: var(--down); }
.sc-retour .btn { margin-left: auto; }
.fin-lecon { margin: 28px 0 0; }
.lecon-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.lecon-nav .btn { min-height: 54px; white-space: normal; text-align: left; justify-content: space-between; }
.lecon-nav .btn span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.lecon-nav > :last-child { justify-self: end; width: 100%; }
.mission-lien { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 24px 0; color: var(--text); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.mission-lien > i { font-size: 24px; color: var(--accent); }
.mission-lien div { flex: 1; display: flex; flex-direction: column; }
.mission-lien span { font-size: 12.5px; color: var(--muted); }
.mission-lien small { color: var(--muted); font-size: 13px; }
@keyframes entre { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- widgets ---------- */
.widget { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.graphe-box { margin: 0; padding: 12px 12px 10px; }
.graphe-box figcaption { color: var(--muted); font-size: 13px; margin-top: 8px; padding: 0 4px; }
.graphe { height: 340px; position: relative; touch-action: pan-y; }
.graphe.petit { height: 140px; margin-top: 4px; }
.ma-choix { margin-top: 10px; }
.legende-series { display: flex; gap: 16px; margin-top: 8px; font-size: 13px; color: var(--muted); }
.legende-series i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
@media (max-width: 760px) { .graphe { height: 280px; } }
.squelette { height: 100%; min-height: 200px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: brille 1.4s linear infinite; }
.squelette.grand { height: 70dvh; }
@keyframes brille { to { background-position: -200% 0; } }
.resultats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.resultats > p { grid-column: 1 / -1; }
.res { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.res span { font-size: 12.5px; color: var(--muted); }
.res b { font-size: 18px; font-weight: 650; }
.res small { font-size: 12.5px; color: var(--muted); }
.res.grand b { font-size: 30px; }
.mini-graphe { width: 100%; height: 160px; display: block; margin-top: 14px; }
.calc .boutons { margin-top: 12px; }
.calc .puces { margin-bottom: 14px; }
.scenario { padding: 18px; }
.sc-etape p { margin: 0 0 12px; }
.sc-num { display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.annonces { display: grid; gap: 8px; margin: 4px 0 14px; }
.annonce { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); font-size: 13.5px; }
.annonce span { color: var(--muted); }
.annonce b { color: var(--text); }
.chaine { display: flex; align-items: center; gap: 6px; overflow-x: auto; padding-bottom: 4px; overscroll-behavior-x: contain; }
.chaine-lien { color: var(--faible); font-size: 20px; flex: none; }
.bloc { flex: 1 0 220px; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--surface-2); transition: border-color .2s, background .2s; }
.bloc.casse { border-color: var(--down); background: color-mix(in srgb, var(--down) 8%, var(--surface-2)); }
.bloc-tete { font-weight: 650; margin-bottom: 8px; }
.bloc-ligne { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); padding: 3px 0; }
.bloc-ligne code { font-family: "Geist Mono", monospace; color: var(--text); font-size: 12.5px; }
.bloc.casse .b-prec { color: var(--down); text-decoration: line-through; }
.carnet-grille { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.carnet { font-family: "Geist Mono", monospace; font-size: 12.5px; }
.niv { position: relative; display: flex; justify-content: space-between; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.niv.tete { color: var(--muted); font-family: Geist, sans-serif; }
.niv .barre-prof { position: absolute; right: 0; top: 1px; bottom: 1px; opacity: .14; border-radius: 2px; transition: width .3s ease-out; }
.niv.ask { color: var(--down); } .niv.ask .barre-prof { background: var(--down); }
.niv.bid { color: var(--up); } .niv.bid .barre-prof { background: var(--up); }
.niv.mange { opacity: .3; text-decoration: line-through; }
.niv.milieu { font-size: 16px; font-weight: 600; justify-content: flex-start; padding: 6px 8px; color: var(--text); }
.bougie-w { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; }
.bougie-svg { width: 100%; max-width: 220px; }
.bougie-w .champ { margin-bottom: 4px; }
.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.figure { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 10px; border-radius: 10px; background: var(--surface-2); }
.figure svg { width: 80px; height: 110px; }
.figure b { font-size: 13.5px; } .figure span { font-size: 12px; color: var(--muted); }
.graphe.petit-moyen { height: 260px; }
.plan-liste { margin: 14px 0; padding-left: 22px; font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.plan-liste b { font-weight: 640; }
.plan-resultat .sc-retour { margin-top: 0; }
.chartistes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.chartiste { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; background: var(--surface-2); }
.chartiste svg { width: 100%; height: 100px; margin-bottom: 6px; }
.chartiste b { font-size: 14.5px; }
.chartiste span { font-size: 13px; color: var(--muted); line-height: 1.45; }
.tend-choix { margin-top: 10px; }
.widget .deux-boutons { margin-top: 12px; }
.jauge { position: relative; height: 34px; margin: 18px 0 4px; border-radius: 8px; background: var(--surface-2); overflow: hidden; }
.jauge::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--entree); width: 2px; background: var(--text); opacity: .5; }
.jauge-zone { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--down) 35%, transparent) 0 6px, color-mix(in srgb, var(--down) 20%, transparent) 6px 12px); transition: width .15s ease-out; }
.jauge-curseur { position: absolute; top: 4px; bottom: 4px; width: 6px; margin-left: -3px; border-radius: 3px; background: var(--accent); transition: left .1s ease-out; }
@media (max-width: 640px) { .carnet-grille, .bougie-w { grid-template-columns: 1fr; } .bougie-svg { margin: 0 auto; } }

/* ---------- simulateur : liste ---------- */
.missions { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.mission { display: flex; flex-direction: column; gap: 8px; padding: 18px; color: var(--text); transition: border-color .15s, transform .1s ease-out; }
.mission:active { transform: scale(.99); }
@media (hover: hover) and (pointer: fine) { .mission:hover { border-color: var(--faible); } }
.mission-haut { display: flex; justify-content: space-between; align-items: center; }
.mission-paire { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mission h3 { font-size: 18px; font-weight: 650; }
.mission p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.mission-bas { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 550; padding-top: 6px; }
.mission-bas i { margin-left: auto; color: var(--faible); }
.niveau-debutant { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); }
.niveau-intermediaire { color: var(--or); background: color-mix(in srgb, var(--or) 12%, transparent); }
.niveau-avance { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); }
.libre { padding: 20px; }
.libre p { margin: 0 0 16px; color: var(--muted); }
.libre .btn { margin-top: 16px; }
.vide { text-align: center; padding: 60px 20px; color: var(--muted); }
.vide i { font-size: 40px; }
.vide h2 { color: var(--text); margin: 10px 0; }

/* ---------- simulateur : écran ---------- */
body[data-page="simulateur"] .page.sim { max-width: none; }
.sim { max-width: 1440px; margin: 0 auto; padding: 0 0 40px; }
.sim-tete { display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.retour { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: var(--text); background: var(--surface-2); font-size: 18px; }
.sim-paire { display: flex; flex-direction: column; line-height: 1.3; }
.sim-paire b { font-size: 17px; }
.sim-paire span { font-size: 12.5px; color: var(--muted); }
.sim-prix { display: flex; flex-direction: column; line-height: 1.25; }
.sim-prix b { font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; }
.sim-prix span { font-size: 12.5px; }
.sim-date { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.sim-consigne { margin: 12px 20px 0; padding: 0 16px; border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line)); font-size: 14.5px; }
.sim-consigne summary { cursor: pointer; padding: 12px 0; font-weight: 600; display: flex; gap: 8px; align-items: center; list-style: none; }
.sim-consigne summary::-webkit-details-marker { display: none; }
.sim-consigne p { margin: 0 0 12px; color: var(--muted); }
.sim-consigne p b { color: var(--text); }
.sim-corps { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; padding: 16px 20px 0; align-items: start; }
.sim-gauche, .sim-droite { min-width: 0; }
.sim-graphe { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 6px 4px; }
#s-graphe { height: min(58dvh, 520px); min-height: 300px; touch-action: pan-y; }
.lecture { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.lecture select { min-height: 42px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 0 10px; }
.btn-lecture { background: var(--accent); border-color: var(--accent); color: var(--sur-accent); }
.lecture-prog { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.btn-fin { margin-left: auto; }
.lecture.termine button:not(.btn-fin), .lecture.termine select { opacity: .4; pointer-events: none; }
.sim-droite { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.valeur-totale { display: flex; flex-direction: column; }
.valeur-totale span { font-size: 12.5px; color: var(--muted); }
.valeur-totale b { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.valeur-totale small { font-size: 13px; color: var(--muted); }
.soldes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.soldes > div:not(.transfert) { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); font-size: 13px; }
.soldes span { color: var(--muted); font-size: 12px; }
.soldes .btn { grid-column: 1 / -1; }
.transfert { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 10px; }
.transfert .boutons { margin: 0; }
.onglets { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.onglets button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 6px; color: var(--muted); font-weight: 600; cursor: pointer; font-size: 14px; white-space: nowrap; transition: color .15s, border-color .15s; }
.onglets button.actif { color: var(--text); border-color: var(--accent); }
#s-form { display: flex; flex-direction: column; gap: 10px; }
.bascule { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface-2); border-radius: 8px; padding: 3px; }
.bascule button { border: 0; background: none; padding: 8px; border-radius: 6px; color: var(--muted); font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.bascule button.actif.achat { background: var(--up); color: #fff; }
.bascule button.actif.vente { background: var(--down); color: #fff; }
.types .puce { min-height: 30px; font-size: 13px; }
.champ-fixe { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; background: var(--surface-2); font-size: 13px; color: var(--muted); }
.champ-fixe b { color: var(--text); font-weight: 500; }
.parts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.parts button { border: 1px solid var(--line); background: none; color: var(--muted); border-radius: 6px; min-height: 30px; font-size: 12.5px; cursor: pointer; }
.parts button:active { background: var(--surface-2); }
.infos { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.infos > div { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); }
.infos b { color: var(--text); font-weight: 550; text-align: right; }
.astuce-sim { margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--text); display: flex; gap: 8px; font-size: 12.5px; }
.astuce-sim.alerte-douce { background: color-mix(in srgb, var(--or) 12%, transparent); }
.btn-ordre { min-height: 46px; font-size: 15px; width: 100%; }
.deux-boutons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fut-tete { display: flex; align-items: center; gap: 12px; }
.levier-l { flex: 1; display: flex; flex-direction: column; font-size: 12.5px; color: var(--muted); }
.levier-l b { color: var(--text); }
.tpsl { border-top: 1px solid var(--line); padding-top: 8px; }
.tpsl summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--muted); padding: 2px 0 8px; }
.tpsl-champs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sim-bas { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0 14px 14px; }
.sim-bas .onglets { margin-bottom: 12px; overflow-x: auto; }
.vide-petit { color: var(--muted); font-size: 14px; text-align: center; padding: 20px 0; margin: 0; }
.position { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; }
.pos-tete { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pos-tete span { color: var(--muted); font-size: 13px; }
.pos-pnl { margin-left: auto; text-align: right; font-weight: 650; display: flex; flex-direction: column; font-size: 15px !important; }
.pos-pnl.hausse { color: var(--up) !important; } .pos-pnl.baisse { color: var(--down) !important; }
.pos-pnl small { font-size: 12px; font-weight: 500; }
.pos-grille { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; font-size: 13px; }
.pos-grille div { display: flex; flex-direction: column; }
.pos-grille span { color: var(--muted); font-size: 11.5px; }
.position .boutons { margin-top: 10px; }
.position .tpsl-champs { margin-top: 10px; }
.actifs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.actifs > div { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 8px; background: var(--surface-2); }
.actifs span, .actifs small { color: var(--muted); font-size: 12.5px; }
#s-liste .tableau { margin: 0; }
#s-liste td small { color: var(--muted); }
.bilan { margin: 24px 20px 0; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: 70px; animation: entre .3s ease-out; }
.bilan-tete h2 { font-size: 26px; }
.bilan-tete p { color: var(--muted); margin: 6px 0 0; }
.bilan-chiffres { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.courbe-bilan { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); }
.courbe-bilan span { font-size: 12.5px; color: var(--muted); }
.courbe-bilan .mini-graphe { height: 140px; margin-top: 6px; }
.histoire { max-width: 75ch; margin-top: 18px; }
@media (max-width: 980px) {
  .sim-corps { grid-template-columns: minmax(0, 1fr); }
  .sim-corps > *, .sim-gauche > * { min-width: 0; }
  .sim-droite { position: static; order: 2; }
  .sim-gauche { display: contents; }
  .sim-graphe { order: 0; } .lecture { order: 1; margin: 0; } .sim-bas { order: 3; }
  .bilan-chiffres { grid-template-columns: 1fr 1fr; }
  .bilan-chiffres .grand { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .sim-tete { padding: 8px 16px; gap: 12px; }
  .sim-date { width: 100%; margin: 0; order: 5; }
  .sim-corps { padding: 12px 12px 0; gap: 12px; }
  .sim-consigne { margin: 10px 12px 0; }
  #s-graphe { height: 46dvh; min-height: 260px; }
  .lecture { position: sticky; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); padding: 8px 0; }
  .lecture .btn span { display: none; }
  .btn-lecture span { display: inline !important; }
  .lecture-prog { display: none; }
  .pos-grille { grid-template-columns: 1fr 1fr; }
  .bilan { margin: 16px 12px 0; padding: 18px; }
}

/* ---------- marché ---------- */
.usdt-ligne { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin-bottom: 14px; overflow: hidden; }
.usdt-ligne > div { padding: 14px 16px; display: flex; flex-direction: column; }
.usdt-ligne > div + div { border-left: 1px solid var(--line); }
.usdt-ligne span { color: var(--muted); font-size: 12.5px; }
.cotes { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.cote { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-align: left; transition: border-color .15s; }
.cote.actif { border-color: var(--accent); }
.cote-nom, .cote-prix { display: flex; flex-direction: column; line-height: 1.3; }
.cote-nom small, .cote-prix small { color: var(--muted); font-size: 12px; }
.cote-prix { text-align: right; font-variant-numeric: tabular-nums; }
.cote-var { min-width: 76px; text-align: center; padding: 6px 8px; border-radius: 6px; font-weight: 600; font-size: 13px; font-variant-numeric: tabular-nums; color: #fff; background: var(--surface-2); }
.fond-hausse { background: var(--up); } .fond-baisse { background: var(--down); }
.graphe-direct { margin-top: 16px; padding: 12px; }
.gd-tete { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; padding: 0 4px; }
@media (max-width: 640px) { .usdt-ligne { grid-template-columns: 1fr; } .usdt-ligne > div + div { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- compte ---------- */
.compte { display: flex; align-items: center; }
.compte:empty { display: none; }
@media (max-width: 760px) { .compte { margin-left: auto; } }
.avatar { width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); color: var(--text); font-weight: 650; border: 1px solid var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.btn-google { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn-google i { font-size: 17px; }
@media (hover: hover) and (pointer: fine) { .btn-google:hover:not(:disabled) { opacity: .9; border-color: var(--text); } }
.connexion { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-top: 14px; }
.connexion > i { font-size: 28px; color: var(--accent); flex: none; }
.connexion div { flex: 1; display: flex; flex-direction: column; }
.connexion span { color: var(--muted); font-size: 14px; }
@media (max-width: 640px) { .connexion { flex-wrap: wrap; } .connexion .btn { width: 100%; } }
.compte-ligne { display: flex; align-items: center; gap: 12px; margin: 0; }
.compte-ligne img { width: 44px; height: 44px; border-radius: 50%; }
.compte-ligne span { display: flex; flex-direction: column; }
.compte-ligne small { color: var(--muted); }

/* ---------- réglages ---------- */
.reglages { padding: 20px; display: flex; flex-direction: column; gap: 18px; margin-bottom: 14px; }
.reglages h2 { font-size: 18px; }
.reglages .boutons { margin: 0; }

/* ---------- toasts ---------- */
#toasts { position: fixed; z-index: 40; left: 50%; transform: translateX(-50%); top: calc(68px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 24px)); pointer-events: none; }
.toast { padding: 11px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--ombre); font-size: 14px; font-weight: 500; animation: entre .2s ease-out; transition: opacity .3s, transform .3s; }
.toast.ok { border-left: 3px solid var(--up); }
.toast.erreur { border-left: 3px solid var(--down); }
.toast.sort { opacity: 0; transform: translateY(-6px); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
