:root {
  /* Monochrome chaud, la couleur ne sert qu'à dire quelque chose (hausse, baisse, alerte, actif). */
  --fond: #f7f6f3;
  --papier: #ffffff;
  --encre: #2f3437;
  --gris: #787774;
  --filet: #eaeaea;
  --filet-fort: #c9c7c2;
  --doux: #f1f0ed;
  --btc: #c27a2c;
  --eth: #5a6fbf;
  --sol: #2a8f78;
  --xrp: #6b7078;
  --euro: #a8a6a1;
  --vert: #346538;
  --vert-fond: #edf3ec;
  --rouge: #9f2f2d;
  --rouge-fond: #fdebec;
  --ambre: #956400;
  --ambre-fond: #fbf3db;
  --bleu: #1f6c9f;
  --bleu-fond: #e1f3fe;
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --sans: "Geist", "Segoe UI", system-ui, sans-serif;
  --serif: "Newsreader", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--fond); color: var(--encre); font: 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* Barre du haut */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 12px clamp(16px, 3vw, 40px);
  background: rgba(247, 246, 243, 0.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--filet);
}
.marque { display: flex; align-items: center; gap: 10px; }
.marque strong { font-size: 16px; }
.sous { color: var(--gris); font-size: 13px; }
.pastille { width: 10px; height: 10px; border-radius: 50%; background: var(--euro); }
.pastille.ok { background: var(--vert); box-shadow: 0 0 0 4px var(--vert-fond); }
.pastille.ko { background: var(--rouge); box-shadow: 0 0 0 4px var(--rouge-fond); }
.pastille.pause { background: var(--ambre); box-shadow: 0 0 0 4px var(--ambre-fond); }
.modes { display: flex; border: 1px solid var(--filet); border-radius: 8px; overflow: hidden; }
.modes button { border: 0; background: transparent; padding: 6px 14px; cursor: pointer; color: var(--gris); }
.modes button[aria-pressed="true"] { background: var(--encre); color: #fff; }
.maj { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--gris); font-size: 13px; }
.maj button { border: 1px solid var(--filet); background: var(--papier); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.maj button:hover, .modes button:hover { color: var(--encre); }
.maj button:disabled { opacity: .5; cursor: progress; }

main { padding: 32px clamp(16px, 3vw, 40px) 48px; display: grid; gap: 24px; max-width: 1240px; margin: 0 auto; }

/* Bandeaux d'alerte */
#bandeaux:empty { display: none; }
#bandeaux { display: grid; gap: 10px; }
.bandeau { padding: 12px 16px; border-radius: 10px; border: 1px solid; }
.bandeau strong { display: block; margin-bottom: 2px; }
.bandeau pre { margin: 6px 0 0; white-space: pre-wrap; font: 13px/1.5 var(--mono); }
.bandeau.ko { background: var(--rouge-fond); border-color: #efc2bd; color: #6d1510; }
.bandeau.pause { background: var(--ambre-fond); border-color: #ecd59f; color: #5a3b00; }
.bandeau.info { background: var(--papier); border-color: var(--filet); }

/* Tuiles */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 12px; }
.tuile { background: var(--papier); border: 1px solid var(--filet); border-radius: 12px; padding: 16px 18px; min-width: 0; }
.tuile .lib { color: var(--gris); font-size: 13px; }
.tuile .gros { font: 500 28px/1.2 var(--mono); margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.tuile .gros.date { font: 500 21px/1.3 var(--sans); margin: 6px 0 4px; }
.tuile .petit { color: var(--gris); font-size: 13px; }
.hausse { color: var(--vert); }
.baisse { color: var(--rouge); }

/* Verdict */
.verdict { background: var(--encre); color: #f4f3ef; border-radius: 14px; padding: 22px 26px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.verdict .oeil { color: #f2c14e; font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.verdict h2 { font-size: clamp(20px, 2.2vw, 26px); margin-top: 8px; line-height: 1.3; }
.verdict p { margin: 0; color: #c9c7c0; }
.verdict .action { border-left: 1px solid #3a3d42; padding-left: 24px; }
.verdict .action strong { color: #fff; }
@media (max-width: 760px) { .verdict { grid-template-columns: 1fr; } .verdict .action { border-left: 0; padding-left: 0; border-top: 1px solid #3a3d42; padding-top: 16px; } }

/* Blocs */
.bloc { background: var(--papier); border: 1px solid var(--filet); border-radius: 14px; padding: 20px 22px; min-width: 0; }
.tete { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 24px; align-items: baseline; margin-bottom: 16px; }
.tete p { margin: 0; color: var(--gris); }
@media (max-width: 760px) { .tete { grid-template-columns: 1fr; } }

/* Répartition */
.barres { display: grid; gap: 12px; }
.barre-ligne { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: center; }
.barre-ligne .nom { color: var(--gris); font-size: 13px; }
.pile { display: flex; height: 34px; border-radius: 8px; overflow: hidden; background: var(--doux); }
.pile span { display: flex; align-items: center; padding: 0 10px; color: #fff; font: 500 13px var(--mono); white-space: nowrap; overflow: hidden; min-width: 0; }
.pile .BTC { background: var(--btc); }
.pile .ETH { background: var(--eth); }
.pile .SOL { background: var(--sol); }
.pile .XRP { background: var(--xrp); }
.pile .EUR, .pile .EURC { background: var(--euro); }
.legende { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; color: var(--gris); font-size: 13px; }
.legende i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* Étapes */
.etapes { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: e; }
.etape { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 16px; padding: 16px 0 18px; border-top: 1px solid var(--doux); counter-increment: e; }
.etape:first-child { border-top: 0; padding-top: 0; }
.etape::before { content: counter(e, decimal-leading-zero); font: 500 14px/1 var(--mono); color: var(--gris); padding-top: 4px; }
.etape h3 { font-size: 17px; margin-bottom: 4px; }
.etape > div > p { margin: 0 0 12px; color: var(--gris); max-width: 110ch; }
.etiquette { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 500; margin-left: 8px; vertical-align: 2px; }
.etiquette.oui { background: var(--vert-fond); color: var(--vert); }
.etiquette.non { background: var(--rouge-fond); color: var(--rouge); }
.etiquette.neutre { background: var(--doux); color: var(--gris); }
.calcul { font: 13.5px/1.7 var(--mono); background: var(--fond); border-radius: 8px; padding: 10px 14px; overflow-x: auto; white-space: nowrap; }
.calcul b { font-weight: 500; color: var(--encre); }
.calcul .c { color: var(--gris); }

.defile { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-weight: 500; color: var(--gris); font-size: 12.5px; padding: 6px 10px; border-bottom: 1px solid var(--filet); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--doux); white-space: nowrap; }
td.n, th.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
tr.total td { border-bottom: 0; border-top: 1px solid var(--filet); font-weight: 600; }
.puce { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; }
.puce.BTC { background: var(--btc); } .puce.ETH { background: var(--eth); } .puce.SOL { background: var(--sol); } .puce.XRP { background: var(--xrp); }
.ok-txt { color: var(--vert); } .ko-txt { color: var(--rouge); } .gris { color: var(--gris); }

/* Graphiques */
.graphes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 20px; }
.graphe { min-width: 0; }
.graphe h3 { font-size: 15px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.graphe h3 .num { color: var(--gris); font-weight: 400; font-size: 13px; }
.graphe svg { display: block; width: 100%; height: 260px; margin-top: 8px; cursor: crosshair; }
.graphe svg text { font: 11px var(--mono); fill: var(--gris); }
.vide { color: var(--gris); padding: 20px 0; }
.bulle { position: fixed; pointer-events: none; z-index: 20; background: var(--encre); color: #fff; font: 12.5px/1.5 var(--mono); padding: 8px 10px; border-radius: 8px; white-space: nowrap; }

/* Journal */
.passage { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 16px; padding: 14px 0; border-top: 1px solid var(--doux); }
.passage:first-child { border-top: 0; padding-top: 0; }
.passage .quand { font: 13px/1.5 var(--mono); color: var(--gris); }
.passage .quand b { display: block; color: var(--encre); font-weight: 500; }
.passage ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.passage li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 6px; }
.passage li .sym { font-family: var(--mono); color: var(--gris); }
.passage li.achat .sym { color: var(--vert); } .passage li.vente .sym { color: var(--rouge); } .passage li.erreur .sym, .passage li.erreur { color: var(--rouge); }
.passage .brut { display: block; font: 12px var(--mono); color: var(--gris); opacity: .8; overflow-wrap: anywhere; }
.plus { margin-top: 12px; border: 1px solid var(--filet); background: var(--papier); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
@media (max-width: 640px) { .passage { grid-template-columns: 1fr; gap: 6px; } .barre-ligne { grid-template-columns: 1fr; gap: 4px; } .maj { margin-left: 0; } }

.pied { padding: 0 clamp(16px, 3vw, 40px) 32px; color: var(--gris); font-size: 13px; }

/* Centre de contrôle */
.perime{position:sticky;top:0;z-index:5;background:#b42318;color:#fff;font-weight:600;padding:10px 16px;border-radius:8px;margin-bottom:12px}
.badge{display:inline-block;padding:3px 9px;border-radius:999px;font-size:.78rem;font-weight:600;letter-spacing:.02em;background:#e5e7eb;color:#1f2937}
.mode-reel{background:#7a1d12;color:#fff}.mode-papier{background:#1e3a8a;color:#fff}
.etat-ok{background:#d1fae5;color:#065f46}.etat-attention{background:#fef3c7;color:#92400e}.etat-ko{background:#fee2e2;color:#991b1b}.etat-pause{background:#e5e7eb;color:#374151}
.niveau-info{background:#e0f2fe;color:#075985}.niveau-attention{background:#fef3c7;color:#92400e}.niveau-ko{background:#fee2e2;color:#991b1b}.niveau-critique{background:#7f1d1d;color:#fff}
.etat-ligne{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}.etat-ligne .explication{color:#374151}
.etat-grille{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:8px 18px}.etat-grille .lib{display:block;font-size:.75rem;color:#6b7280;text-transform:uppercase;letter-spacing:.04em}
.incident{border:1px solid #e5e7eb;border-left:5px solid #9ca3af;border-radius:8px;padding:12px 14px;margin:10px 0;background:#fff}
.incident.niveau-attention{border-left-color:#d97706}.incident.niveau-ko{border-left-color:#dc2626}.incident.niveau-critique{border-left-color:#7f1d1d}.incident.niveau-info{border-left-color:#0284c7}
.incident header{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline}.incident .statut-incident{margin-left:auto;font-size:.85rem}
.incident dl{display:grid;grid-template-columns:max-content 1fr;gap:4px 14px;margin:10px 0}.incident dt{color:#6b7280}.incident dd{margin:0}
.incident .boutons{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.incident .retour{font-size:.85rem;color:#065f46}
.chronologie{list-style:none;padding:0;margin:0;max-height:420px;overflow:auto}.chronologie li{padding:4px 0;border-bottom:1px solid #f3f4f6}
@media (max-width:600px){.incident dl{grid-template-columns:1fr}}

/* ---------- Page lisible : l'essentiel en haut ---------- */
.petit { font-size: 13px; }
.maj a { color: var(--gris); font-size: 13px; }
.sur-titre { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin-bottom: 10px; }
.resume { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 32px; align-items: center;
  background: var(--papier); border: 1px solid var(--filet); border-radius: 12px; padding: clamp(24px, 4vw, 40px); }
.valeur-totale { font: 500 clamp(44px, 7vw, 72px)/1.05 var(--serif); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ligne-gain { margin: 12px 0 6px; font-size: 17px; }
.resume-droite .courbe { width: 100%; height: 90px; display: block; }
.legende-courbe { display: flex; gap: 16px; margin: 6px 0 14px; font-size: 12px; color: var(--gris); }
.trait { display: inline-block; width: 18px; height: 0; vertical-align: middle; margin-right: 6px; border-top: 2px solid var(--encre); }
.trait.tirets { border-top: 2px dashed var(--filet-fort); }
.comparaisons { display: grid; gap: 8px; margin: 0; }
.comparaisons div { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--filet); padding-bottom: 6px; }
.comparaisons dt { color: var(--gris); }
.comparaisons dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cartes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cartes { grid-template-columns: 1fr; } }
.carte { background: var(--papier); border: 1px solid var(--filet); border-radius: 12px; padding: 22px 24px; min-width: 0; transition: box-shadow .2s ease; }
.carte:hover { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); }
.carte p { margin: 10px 0 0; }
.carte .grand { font: 500 22px/1.3 var(--serif); letter-spacing: -0.01em; }
.carte-alerte { border-color: #f1c9c7; background: #fffafa; }
.raisons-courtes { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; font-size: 14px; }
.raisons-courtes b { display: inline-block; min-width: 40px; font-family: var(--mono); font-weight: 500; }
.duo { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; }
.panneau { background: var(--papier); border: 1px solid var(--filet); border-radius: 12px; padding: 24px 28px; min-width: 0; }
.panneau h2, .zone-alertes h2, .replis h2 { font: 500 24px/1.2 var(--serif); letter-spacing: -0.02em; margin-bottom: 16px; }
.pile-claire { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--doux); gap: 2px; margin-bottom: 14px; }
.lignes td { padding: 10px 6px; border-bottom: 1px solid var(--filet); }
.lignes tr:last-child td { border-bottom: 0; }
.pastille-actif { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 10px; vertical-align: 0; }
.tendance { padding: 10px 14px; border-radius: 8px; margin: 0 0 18px; }
.tendance.hausse { background: var(--vert-fond); color: var(--vert); }
.tendance.baisse { background: var(--rouge-fond); color: var(--rouge); }
.ligne-actif { padding: 14px 0; border-top: 1px solid var(--filet); }
.ligne-actif-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ligne-actif p { margin: 8px 0 0; }
.jauges { display: grid; grid-template-columns: 48px minmax(0, 1fr) 44px; gap: 6px 10px; align-items: center; margin-top: 10px; }
.jauge { height: 8px; border-radius: 4px; background: var(--doux); overflow: hidden; }
.jauge span { display: block; height: 100%; border-radius: 4px; }
.n { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hausse { color: var(--vert); } .baisse { color: var(--rouge); }
.zone-alertes { background: var(--papier); border: 1px solid #f1c9c7; border-radius: 12px; padding: 24px 28px; }
.replis { margin-top: 8px; }
.replis details { border-bottom: 1px solid var(--filet); }
.replis details:first-of-type { border-top: 1px solid var(--filet); }
.replis summary { list-style: none; cursor: pointer; padding: 16px 4px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.replis summary::-webkit-details-marker { display: none; }
.replis summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--gris); }
.replis details[open] summary::after { content: "-"; }
.replis .contenu { padding: 4px 4px 24px; display: grid; gap: 16px; }
.pied { max-width: 1240px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 40px) 40px; color: var(--gris); font-size: 13px; }
.badge.mode-reel { background: var(--rouge-fond); color: var(--rouge); }
.badge.mode-papier { background: var(--bleu-fond); color: var(--bleu); }
.badge { border-radius: 9999px; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; font-weight: 500; }
.etat-ok { background: var(--vert-fond); color: var(--vert); } .etat-attention { background: var(--ambre-fond); color: var(--ambre); }
.etat-ko { background: var(--rouge-fond); color: var(--rouge); } .etat-pause { background: var(--doux); color: var(--gris); }
@media (prefers-reduced-motion: no-preference) {
  /* À l'ouverture seulement : l'actualisation toutes les 30 secondes ne rejoue pas l'animation. */
  .premier .resume, .premier .carte, .premier .panneau { animation: apparition .6s cubic-bezier(0.16, 1, 0.3, 1) both; }
  .premier .carte:nth-child(2) { animation-delay: 80ms; } .premier .carte:nth-child(3) { animation-delay: 160ms; } .premier .carte:nth-child(4) { animation-delay: 240ms; }
}
@keyframes apparition { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) { .resume, .duo { grid-template-columns: 1fr; } }

/* Mon compte : quatre chiffres lisibles */
.compte { background: var(--papier); border: 1px solid var(--filet); border-radius: 12px; padding: clamp(22px, 3.5vw, 36px); }
.chiffres { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 24px; }
.chiffre { min-width: 0; border-left: 1px solid var(--filet); padding-left: 20px; }
.chiffre:first-child { border-left: 0; padding-left: 0; }
.chiffre-valeur { font: 500 30px/1.15 var(--serif); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chiffre-valeur.principal { font-size: clamp(40px, 5.5vw, 60px); }
.chiffre-valeur small { font: 400 16px var(--sans); }
.chiffre p { margin: 8px 0 0; }
.comparaison-ligne { margin: 22px 0 0; padding-top: 16px; border-top: 1px solid var(--filet); color: var(--gris); }
.comparaison-ligne b { color: var(--encre); font-weight: 500; }
.titre-section { font: 500 28px/1.2 var(--serif); letter-spacing: -0.02em; margin: 16px 0 -8px; }
.lignes { width: 100%; }
.lignes th { font-size: 12px; text-transform: none; }
.lignes tr.total td { border-top: 1px solid var(--filet-fort); }
.badge.op-achat { background: var(--vert-fond); color: var(--vert); }
.badge.op-vente { background: var(--ambre-fond); color: var(--ambre); }
@media (max-width: 1000px) { .chiffres { grid-template-columns: 1fr 1fr; } .chiffre:nth-child(3) { border-left: 0; padding-left: 0; } }
@media (max-width: 560px) { .chiffres { grid-template-columns: 1fr; } .chiffre { border-left: 0; padding-left: 0; } }

/* Statut en marche / arrêté, tout en haut */
.statut { border: 1px solid var(--filet); border-radius: 12px; padding: 22px clamp(20px, 3vw, 32px); background: var(--papier); }
.statut-ok { background: var(--vert-fond); border-color: color-mix(in srgb, var(--vert) 22%, transparent); }
.statut-pause { background: var(--ambre-fond); border-color: color-mix(in srgb, var(--ambre) 25%, transparent); }
.statut-ko { background: var(--rouge-fond); border-color: color-mix(in srgb, var(--rouge) 25%, transparent); }
.statut-tete { display: flex; align-items: center; gap: 18px; }
.statut-tete > div { flex: 1; min-width: 0; }
.statut h1 { font: 500 clamp(26px, 3.4vw, 36px)/1.1 var(--serif); letter-spacing: -0.02em; margin: 0; }
.statut-ok h1 { color: var(--vert); } .statut-pause h1 { color: var(--ambre); } .statut-ko h1 { color: var(--rouge); }
.statut-tete p { margin: 6px 0 0; color: var(--encre); }
.voyant { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--gris); }
.voyant.ok { background: var(--vert); animation: pouls 2.4s ease-out infinite; }
.voyant.pause { background: var(--ambre); }
.voyant.ko { background: var(--rouge); }
@keyframes pouls { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vert) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { .voyant.ok { animation: none; } }
.routines { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(0,0,0,.07); }
.routine { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.routine p { margin: 3px 0 0; color: var(--gris); }
.point { flex: none; width: 9px; height: 9px; margin-top: 6px; border-radius: 50%; background: var(--gris); }
.point.ok { background: var(--vert); } .point.pause { background: var(--ambre); } .point.ko { background: var(--rouge); }
.statut-aide { margin: 16px 0 0; color: var(--gris); }
@media (max-width: 760px) { .routines { grid-template-columns: 1fr; } .statut-tete { flex-wrap: wrap; } }
@media (max-width: 760px) { .statut-tete > .badge { display: none; } }

/* Mode du bot : prudent ou agressif */
.profil { margin-top: 0; }
.profil-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.profil-tete h2 { margin-bottom: 6px; }
.profil-tete p { margin: 0 0 4px; max-width: 62ch; }
.profil .oeil { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin-bottom: 4px; }
.profil-agressif { border-color: color-mix(in srgb, var(--rouge) 35%, transparent); }
.interrupteur { display: inline-flex; border: 1px solid var(--filet-fort); border-radius: 999px; padding: 3px; background: var(--doux); }
.interrupteur button { border: 0; background: transparent; border-radius: 999px; padding: 8px 18px; cursor: pointer; color: var(--gris); font-weight: 500; }
.interrupteur button[aria-pressed="true"] { background: var(--encre); color: #fff; cursor: default; }
.profil-agressif .interrupteur button[aria-pressed="true"] { background: var(--rouge); }
.interrupteur button:disabled:not([aria-pressed="true"]) { cursor: not-allowed; opacity: .55; }
.interrupteur button:not(:disabled):hover { color: var(--encre); }
.avertissement { margin: 14px 0 6px; padding: 10px 14px; border-radius: 8px; background: var(--rouge-fond); color: var(--rouge); }
.profil .gris, .fenetre .gris { color: var(--gris); font-size: 14px; }
.retour-profil:not(:empty) { margin-top: 8px; color: var(--vert); font-weight: 500; }
.voile { position: fixed; inset: 0; z-index: 50; background: rgba(30, 32, 34, .45); display: grid; place-items: center; padding: 16px; }
.fenetre { background: var(--papier); border-radius: 14px; padding: 24px 26px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.fenetre h2 { font: 500 24px/1.2 var(--serif); margin-bottom: 12px; }
.fenetre-danger { border-top: 5px solid var(--rouge); }
.alerte-forte { background: var(--rouge-fond); color: var(--rouge); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; }
.comparaison { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.comparaison th, .comparaison td { border-bottom: 1px solid var(--filet); padding: 6px 8px; text-align: right; }
.comparaison th:first-child, .comparaison td:first-child { text-align: left; }
.comparaison .rouge { color: var(--rouge); font-weight: 600; }
.saisie { display: block; margin: 12px 0; }
.saisie input { display: block; width: 100%; margin-top: 6px; padding: 9px 12px; border: 1px solid var(--filet-fort); border-radius: 8px; font: 500 16px var(--mono); }
.fenetre .boutons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.fenetre .boutons button { border: 1px solid var(--filet-fort); background: var(--papier); border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.fenetre .valider { background: var(--encre); color: #fff; border-color: var(--encre); }
.fenetre-danger .valider { background: var(--rouge); border-color: var(--rouge); }
.fenetre .valider:disabled { opacity: .45; cursor: not-allowed; }
.retour-fenetre:not(:empty) { color: var(--rouge); margin: 10px 0 0; }

/* Changement de mode prévu pour demain */
.prevu { margin: 14px 0 6px; padding: 10px 14px; border-radius: 8px; background: var(--doux); border: 1px solid var(--filet); }
.lien.lien { background: none; border: 0; padding: 0; margin-left: 6px; color: var(--bleu); text-decoration: underline; cursor: pointer; font: inherit; }

/* Simulateur */
.simulateur .oeil { display: block; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--gris); margin-bottom: 4px; }
.sim-champs { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 14px 24px; margin: 4px 0 20px; }
.sim-champs label { display: grid; gap: 6px; font-size: 14px; color: var(--gris); }
.sim-champs label span { display: flex; align-items: center; gap: 8px; color: var(--encre); }
.sim-champs input[type="number"] { width: 100%; min-width: 0; font: 500 18px var(--mono); padding: 8px 10px; border: 1px solid var(--filet-fort); border-radius: 8px; background: var(--papier); color: var(--encre); }
.sim-champs input[type="range"] { flex: 1; min-width: 0; accent-color: var(--encre); }
.sim-champs output { font: 500 18px var(--mono); white-space: nowrap; min-width: 4.5em; text-align: right; }
.sim-verse-total { margin: 0 0 14px; }
.sim-barres { display: grid; gap: 10px; margin-bottom: 18px; }
.sim-barres > div { display: grid; grid-template-columns: 76px 1fr; align-items: center; gap: 12px; }
.sim-nom { font-size: 14px; }
.sim-piste { position: relative; height: 22px; background: var(--doux); border-radius: 6px; }
.sim-plage { position: absolute; top: 5px; height: 12px; border-radius: 6px; }
.sim-plage.prudent { background: color-mix(in srgb, var(--bleu) 30%, transparent); }
.sim-plage.agressif { background: color-mix(in srgb, var(--rouge) 28%, transparent); }
.sim-med { position: absolute; top: 1px; width: 3px; height: 20px; margin-left: -1.5px; border-radius: 2px; }
.sim-med.prudent { background: var(--bleu); }
.sim-med.agressif { background: var(--rouge); }
.sim-verse { position: absolute; top: -3px; width: 1px; height: 28px; background: var(--gris); }
.sim-legende { margin: 2px 0 0; }
.sim-table td:not(:first-child), .sim-table th:not(:first-child) { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sim-verdict { margin: 12px 0 8px; }
.sim-note { margin: 8px 0 0; }

/* Curseur du profil */
.curseur { margin: 18px 0 6px; max-width: 560px; }
.curseur input[type="range"] { width: 100%; accent-color: var(--rouge); }
.curseur-reperes { display: flex; justify-content: space-between; font-size: 12px; color: var(--gris); margin-top: 2px; }
.curseur-choix { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.curseur-libelle { font-weight: 500; }
.appliquer { border: 1px solid var(--encre); background: var(--encre); color: #fff; border-radius: 8px; padding: 8px 16px; cursor: pointer; font: inherit; }
.appliquer:disabled { opacity: .4; cursor: not-allowed; }
/* Simulateur à cinq crans */
.sim-barres > div { grid-template-columns: 150px 1fr; }
.sim-barres > div.sim-actuel .sim-nom { font-weight: 600; }
.sim-defile { overflow-x: auto; }
.sim-table th.sim-actuel, .sim-table td.sim-actuel { background: var(--doux); }
.sim-table td:not(:first-child), .sim-table th:not(:first-child) { min-width: 92px; }
@media (max-width: 560px) { .sim-barres > div { grid-template-columns: 1fr; gap: 4px; } }

/* Stratégie expliquée, dans le rectangle Réglage du bot */
.strategie { margin: 18px 0 8px; padding: 18px 20px; border-radius: 10px; background: var(--doux); border: 1px solid var(--filet); }
.strategie h3 { font: 500 19px/1.25 var(--serif); margin: 0 0 10px; }
.strat-etapes { margin: 0 0 14px; padding-left: 22px; display: grid; gap: 8px; }
.strat-etapes li { line-height: 1.5; }
.strat-defile { overflow-x: auto; }
.strat-table { background: var(--papier); }
.strat-table th.strat-actuel, .strat-table td.strat-actuel { background: color-mix(in srgb, var(--bleu) 10%, var(--papier)); font-weight: 500; }
.strat-exemple { margin: 12px 0 8px; line-height: 1.5; }
.sim-sous { display: block; font-size: 12.5px; color: var(--gris); margin-top: 2px; line-height: 1.35; }
.sim-table td:first-child { min-width: 220px; }

/* =====================================================================
   Version 3 (2026-11-06) : onglets, page plus aérée, lisible sur téléphone.
   Couche posée en fin de fichier : elle reprend la main sur les règles plus haut.
   ===================================================================== */
:root {
  --fond: #f6f5f1;
  --filet: #e7e5df;
  --ombre: 0 1px 2px rgba(31, 30, 26, .04), 0 4px 16px rgba(31, 30, 26, .04);
  --rayon: 16px;
  --haut-barre: 57px;
}
a { color: var(--bleu); }

/* Barre du haut */
.barre { gap: 16px; padding-top: max(12px, env(safe-area-inset-top)); padding-left: max(clamp(16px, 3vw, 40px), env(safe-area-inset-left)); padding-right: max(clamp(16px, 3vw, 40px), env(safe-area-inset-right)); background: rgba(246, 245, 241, .92); }
.maj button { border-radius: 999px; padding: 6px 14px; }

/* Onglets : barre en pilule sous l'en-tête, collée en haut au défilement */
.onglets {
  position: sticky; top: var(--haut-barre); z-index: 9;
  display: flex; gap: 4px; justify-content: center;
  width: max-content; max-width: calc(100% - 32px); margin: 18px auto 0;
  padding: 4px; border: 1px solid var(--filet); border-radius: 999px;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); box-shadow: var(--ombre);
}
.onglets a {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 8px 18px; border-radius: 999px; color: var(--gris); text-decoration: none; font-weight: 500; white-space: nowrap;
  transition: background .15s ease, color .15s ease;
}
.onglets a:hover { color: var(--encre); background: var(--doux); }
.onglets a[aria-current="page"] { background: var(--encre); color: #fff; }
.onglets svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.onglets svg circle { fill: currentColor; stroke: none; }
.onglets a[data-onglet="reglage"] svg circle { fill: none; stroke: currentColor; stroke-width: 1.8; }
.compteur {
  font: 600 11px/18px var(--sans); font-style: normal; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--rouge); color: #fff; text-align: center;
}

/* Contenu */
main { padding-top: 24px; gap: 0; }
.vue { display: grid; gap: 20px; min-width: 0; }
.vue > * { min-width: 0; }
.duo-accueil { display: grid; gap: 20px; }
.panneau, .compte, .statut, .carte, .zone-alertes { border-radius: var(--rayon); border-color: var(--filet); box-shadow: var(--ombre); }
.statut-ok, .statut-pause, .statut-ko { box-shadow: none; }
.statut-ok { border-color: color-mix(in srgb, var(--vert) 22%, transparent); }
.statut-pause { border-color: color-mix(in srgb, var(--ambre) 25%, transparent); }
.statut-ko { border-color: color-mix(in srgb, var(--rouge) 25%, transparent); }
.panneau h2, .zone-alertes h2, .replis h2 { font-size: 26px; }
.cartes { gap: 14px; }
.carte { padding: 20px 22px; }
.carte:hover { box-shadow: var(--ombre); }
.carte .grand { font-size: 21px; }

/* Statut plus compact */
.statut { padding: 20px clamp(18px, 3vw, 28px); }
.routines { margin-top: 16px; padding-top: 14px; }

/* Alertes : en haut de l'accueil, mais sans crier */
.zone-alertes { border-color: color-mix(in srgb, var(--rouge) 25%, transparent); }
.zone-alertes h2 { font-size: 22px; margin-bottom: 8px; }
.incident { border-radius: 12px; }

/* Détails repliés */
.replis { margin-top: 0; background: var(--papier); border: 1px solid var(--filet); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 24px 28px; }
.replis details:first-of-type { border-top: 0; }
.replis details:last-of-type { border-bottom: 0; }

/* Réglage : l'explication est repliée sous le curseur */
.strategie { padding: 0; background: var(--fond); }
.strategie > summary { position: relative; list-style: none; cursor: pointer; padding: 16px 48px 16px 20px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.strategie > summary::-webkit-details-marker { display: none; }
.strategie > summary h3 { margin: 0; }
.strategie > summary::after { content: "+"; position: absolute; right: 20px; top: 18px; font: 400 20px/1 var(--mono); color: var(--gris); }
.strategie[open] > summary::after { content: "-"; }
.strategie[open] > summary { border-bottom: 1px solid var(--filet); margin-bottom: 14px; }
.strategie > :not(summary) { margin-left: 20px; margin-right: 20px; }
.strategie > :last-child { margin-bottom: 18px; }
.curseur { margin-top: 20px; }

.pied { margin-top: 28px; font-size: 12.5px; }


/* ---------- Téléphone ---------- */
@media (max-width: 760px) {
  :root { --haut-barre: 53px; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .barre { gap: 8px 12px; padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: 10px; }
  .marque strong { font-size: 15px; }
  .maj { margin-left: auto; gap: 10px; font-size: 12px; }
  .maj #maj { display: none; }
  .maj button { padding: 5px 12px; font-size: 13px; }

  /* Onglets en bas de l'écran, sous le pouce */
  .onglets {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 30;
    width: auto; max-width: none; margin: 0; justify-content: space-around; gap: 0;
    border-radius: 0; border: 0; border-top: 1px solid var(--filet);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -4px 16px rgba(31, 30, 26, .05);
  }
  .onglets a { flex: 1; min-width: 0; flex-direction: column; gap: 3px; padding: 4px 2px; font-size: 11px; border-radius: 12px; }
  .onglets a:hover { background: transparent; }
  .onglets a[aria-current="page"] { background: transparent; color: var(--encre); font-weight: 600; }
  .onglets svg { width: 48px; height: 28px; padding: 3px 13px; border-radius: 999px; box-sizing: border-box; }
  .onglets a[aria-current="page"] svg { background: var(--encre); color: #fff; }
  .compteur { position: absolute; top: 0; left: calc(50% + 10px); }

  main { padding: 16px 12px 24px; }
  .vue { gap: 14px; }
  .panneau, .compte, .zone-alertes, .replis { padding: 18px 16px; }
  .statut { padding: 18px 16px; }
  .statut h1 { font-size: 26px; }
  .panneau h2, .replis h2 { font-size: 22px; margin-bottom: 12px; }
  .statut-tete { align-items: flex-start; gap: 12px; }
  .voyant { width: 12px; height: 12px; margin-top: 11px; }
  .statut-tete p { font-size: 14px; }
  /* Les quatre chiffres : le montant en grand sur toute la largeur, les trois autres dessous, deux par ligne. */
  .chiffres { grid-template-columns: 1fr 1fr; gap: 16px 14px; }
  .chiffre { border-left: 0; padding-left: 0; }
  .chiffre:first-child { grid-column: 1 / -1; }
  .chiffre:last-child { grid-column: 1 / -1; }
  .chiffre p { font-size: 12.5px; }
  .chiffre-valeur { font-size: 24px; }
  .chiffre-valeur.principal { font-size: 46px; }
  .comparaison-ligne { font-size: 14px; }
  .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .carte { padding: 14px; }
  .carte .grand { font-size: 18px; }
  .carte p { font-size: 13.5px; }
  .raisons-courtes { font-size: 13px; }

  /* Tableaux : sur téléphone, seulement les colonnes qui comptent */
  #mes-cryptos .lignes th:nth-child(2), #mes-cryptos .lignes td:nth-child(2),
  #mes-cryptos .lignes th:nth-child(3), #mes-cryptos .lignes td:nth-child(3),
  #mes-cryptos .lignes th:nth-child(5), #mes-cryptos .lignes td:nth-child(5) { display: none; }
  #mes-ordres .lignes th:nth-child(4), #mes-ordres .lignes td:nth-child(4),
  #mes-ordres .lignes th:nth-child(5), #mes-ordres .lignes td:nth-child(5),
  #mes-ordres .lignes th:nth-child(7), #mes-ordres .lignes td:nth-child(7),
  #mes-ordres .lignes th:nth-child(8), #mes-ordres .lignes td:nth-child(8) { display: none; }
  #mes-cryptos .lignes th:nth-child(7), #mes-cryptos .lignes td:nth-child(7) { display: none; }
  #mes-cryptos .lignes td:first-child .gris { display: none; }
  .lignes td, .lignes th { padding-left: 4px; padding-right: 4px; font-size: 13.5px; }
  .lignes th { white-space: normal; font-family: var(--sans); vertical-align: bottom; }
  .lignes td { white-space: nowrap; }
  #mes-cryptos .lignes td:nth-child(6) { white-space: normal; }
  #mes-ordres .lignes td:first-child { white-space: normal; min-width: 7em; }
  .pied { padding-bottom: 8px; }
}
@media (max-width: 520px) {
  #autre-mode { display: none; }
}
@media (max-width: 380px) {
  .cartes { grid-template-columns: 1fr; }
}

.autre-mode-bas { margin: -8px 0 12px; }
.aide-boutons { margin: 8px 0 0; max-width: 90ch; }
.incident .boutons button { border: 1px solid var(--filet-fort); background: var(--papier); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.incident .boutons button:first-child { background: var(--encre); color: #fff; border-color: var(--encre); }

/* ===================== Thème sombre (2026-11-07, demande de Pascal) ===================== */
:root {
  color-scheme: dark;
  --fond: #0B0C0E; --papier: #131519; --encre: #ECEDEF; --gris: #9097A0;
  --filet: #23272E; --filet-fort: #2E333B; --doux: #1A1D22;
  --btc: #F2A33D; --eth: #7D95F7; --sol: #3FBFA0; --xrp: #C9CDD4; --euro: #646B75;
  --vert: #34D27B; --vert-fond: rgba(52, 210, 123, .12);
  --rouge: #F26B5E; --rouge-fond: rgba(242, 107, 94, .12);
  --ambre: #F2B33D; --ambre-fond: rgba(242, 179, 61, .12);
  --bleu: #6CB6F0; --bleu-fond: rgba(108, 182, 240, .12);
  --ombre: none;
  --action: #34D27B; --sur-action: #06240F; --actif: #262A31;
}
html, body { background: var(--fond); color: var(--encre); -webkit-font-smoothing: antialiased; }
.barre { background: rgba(11, 12, 14, .82) !important; backdrop-filter: blur(14px) saturate(140%); border-bottom: 1px solid var(--filet); }
.onglets { background: rgba(19, 21, 25, .92) !important; border: 1px solid var(--filet); }
.onglets a[aria-current="page"], .onglets a[aria-current="page"] svg { background: var(--actif); color: #fff; }
.modes button[aria-pressed="true"], .interrupteur button[aria-pressed="true"] { background: var(--actif); color: #fff; }
.fenetre .valider, .appliquer, .incident .boutons button:first-child { background: var(--action); color: var(--sur-action); border-color: var(--action); font-weight: 600; }
.bulle { background: #262A31; color: #fff; border: 1px solid var(--filet-fort); }
.verdict { background: linear-gradient(160deg, rgba(52, 210, 123, .08), transparent 60%), var(--papier); color: var(--encre); border: 1px solid rgba(52, 210, 123, .22); }
.verdict p { color: var(--gris); }
.verdict .action { border-color: var(--filet); }
.bandeau.ko { border-color: rgba(242, 107, 94, .35); color: #F7C6C0; }
.bandeau.pause { border-color: rgba(242, 179, 61, .35); color: #F6DDA6; }
.badge { background: #23272E; color: #C9CDD3; }
.mode-reel { background: rgba(242, 107, 94, .16); color: #F7A399; }
.mode-papier { background: rgba(108, 182, 240, .16); color: #A9D3F5; }
.etat-ok { background: var(--vert-fond); color: var(--vert); }
.etat-attention { background: var(--ambre-fond); color: var(--ambre); }
.etat-ko { background: var(--rouge-fond); color: var(--rouge); }
.etat-pause { background: #23272E; color: #C9CDD3; }
.niveau-info { background: var(--bleu-fond); color: var(--bleu); }
.niveau-attention { background: var(--ambre-fond); color: var(--ambre); }
.niveau-ko { background: var(--rouge-fond); color: var(--rouge); }
.etat-ligne .explication, .etat-grille .lib, .incident dt { color: var(--gris); }
.incident { background: var(--papier); border-color: var(--filet); }
.incident .retour { color: var(--vert); }
.chronologie li, .routines { border-color: var(--filet); }
.carte-alerte { border-color: rgba(242, 107, 94, .35); background: rgba(242, 107, 94, .06); }
.zone-alertes { border-color: rgba(242, 107, 94, .35); }
.carte:hover { box-shadow: none; border-color: var(--filet-fort); }
.voile { background: rgba(0, 0, 0, .6); }
input, select, textarea, button { color: inherit; }
input[type="range"] { accent-color: var(--vert); }
@media (max-width: 760px) {
  .onglets { background: rgba(19, 21, 25, .96) !important; box-shadow: none !important; border-top: 1px solid var(--filet); }
}
.compteur { color: #2A0A06 !important; font-weight: 700; }
.pile span { color: #0B0C0E; font-weight: 600; }
/* Correctifs du 2026-11-08 : bouton de validation lisible (la règle des boutons de la fenêtre l'emportait par sa spécificité),
   et tableau du simulateur qui tient dans l'écran sans défilement horizontal. */
.fenetre .boutons .valider { background: var(--action); color: var(--sur-action); border-color: var(--action); font-weight: 600; }
.fenetre-danger .boutons .valider { background: var(--rouge); color: #fff; border-color: var(--rouge); }
.fenetre .boutons .valider:disabled { background: var(--doux, #262A31); color: var(--gris); border-color: var(--filet-fort); opacity: 1; }
.sim-defile { overflow-x: visible; }
.sim-table { width: 100%; table-layout: auto; }
.sim-table td:first-child, .sim-table th:first-child { min-width: 0; white-space: normal; }
.sim-table td:not(:first-child), .sim-table th:not(:first-child) { min-width: 0; }
@media (max-width: 760px) {
  .sim-table, .sim-table tbody { display: block; }
  .sim-table tr { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 4px; padding: 8px 0; border-bottom: 1px solid var(--filet); }
  .sim-table tr > :first-child { grid-column: 1 / -1; text-align: left; padding: 0 0 4px; border: 0; white-space: normal; }
  .sim-table tr:first-child > :first-child { display: none; }
  .sim-table td, .sim-table th { border: 0; padding: 2px; font-size: 12px; }
  .sim-table td:not(:first-child), .sim-table th:not(:first-child) { text-align: center; letter-spacing: -.02em; }
}
/* Écrans de téléphone étroits (Samsung S24 Ultra : 384 px) : rien ne doit dépasser dans l'onglet Détails. */
details .contenu { grid-template-columns: minmax(0, 1fr); }
details .contenu > *, #bilan { min-width: 0; max-width: 100%; }
details .contenu > table, details .contenu > pre { display: block; overflow-x: auto; }
#bilan, #ordres, :has(> table.tableau) { overflow-x: auto; max-width: 100%; }
td[colspan] { white-space: normal; }
:root, :root[data-theme] {
  --fond: #0E1114; --papier: #1A2026; --plateau: #151A1F; --encre: #ECEEF0; --gris: #9AA2AC;
  --filet: rgba(236, 238, 240, .08); --filet-fort: rgba(236, 238, 240, .16); --doux: #222930;
  --vert: #4CC3A6; --vert-fond: rgba(76, 195, 166, .12); --rouge: #F08A80; --rouge-fond: rgba(240, 138, 128, .12);
  --ambre: #E8B866; --ambre-fond: rgba(232, 184, 102, .12); --bleu: #8E9CE6; --bleu-fond: rgba(142, 156, 230, .12);
  --action: #4CC3A6; --sur-action: #062A22; --actif: #ECEEF0;
  --courbe: cubic-bezier(.32, .72, 0, 1);
  --sans: "Schibsted Grotesk", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, monospace; --serif: "Schibsted Grotesk", system-ui, sans-serif;
  color-scheme: dark;
}
html, body { background: var(--fond); color: var(--encre); font-family: var(--sans); }
h1, h2, h3, .tuile .gros, .bloc h2, .panneau h2 { font-family: var(--sans); letter-spacing: -.02em; font-weight: 600; }
code, .num, td, .gros { font-variant-numeric: tabular-nums; }
.barre { position: sticky; top: max(12px, env(safe-area-inset-top)); margin: 12px auto 0; width: min(1180px, calc(100% - 32px)); border-radius: 999px; border: 1px solid var(--filet) !important;
  background: color-mix(in srgb, var(--papier) 84%, transparent) !important; backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 16px 40px -16px rgba(0, 0, 0, .5); padding: 8px 10px 8px 18px; }
.barre .badge { border-radius: 999px; }
.maj button, .barre button { border-radius: 999px; }
@media (min-width: 761px) {
  .onglets { width: max-content; margin: 14px auto 0; padding: 5px; border-radius: 999px; background: var(--plateau) !important; border: 1px solid var(--filet); box-shadow: none; }
  .onglets a { border-radius: 999px; transition: background .4s var(--courbe), color .4s var(--courbe); }
  .onglets a[aria-current="page"], .onglets a[aria-current="page"] svg { background: var(--encre); color: var(--fond); }
}
@media (max-width: 760px) {
  .barre { width: calc(100% - 20px); }
  .onglets { border-radius: 22px; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); border: 1px solid var(--filet); }
  .onglets a { border-radius: 16px; }
  .onglets a[aria-current="page"], .onglets a[aria-current="page"] svg { background: var(--encre); color: var(--fond); }
}
.panneau, .carte, .tuile, .bloc, .zone-alertes, .verdict, .statut, .compte, details {
  background: var(--papier); border: 0 !important; border-radius: 20px;
  box-shadow: 0 0 0 6px var(--plateau), 0 0 0 7px var(--filet), 0 18px 40px -18px rgba(0, 0, 0, .6);
}
.cartes, .duo-accueil, .tuiles, .replis { gap: 22px; }
.panneau, .carte, .bloc { padding: 24px 26px; }
.page { padding-top: 26px; }
.vue > * + * { margin-top: 22px; }
.lignes th, .tableau th, th { font: 500 11px/1.2 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gris); }
td { font-family: var(--mono); }
td:first-child { font-family: var(--sans); }
button, .appliquer, .plus { border-radius: 999px; transition: transform .3s var(--courbe); }
button:active { transform: scale(.98); }
.appliquer, .fenetre .boutons .valider { background: var(--action); color: var(--sur-action); border-color: var(--action); }
.fenetre { background: var(--papier); border-radius: 24px; }
details > summary { padding: 16px 20px; border-radius: 20px; }
@keyframes monte-vue { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.vue:not([hidden]) { animation: monte-vue .6s var(--courbe) both; }
@media (prefers-reduced-motion: reduce) { .vue:not([hidden]) { animation: none; } }
.vue[data-vue="accueil"]:not([hidden]) { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px; grid-template-areas: "s s s s s s s s s s s s" "c c c c c c c c r r r r" "d d d d d d d d k k k k" "a a a a a a a a a a a a"; }
.vue[data-vue="accueil"] > * + * { margin-top: 0; }
.vue[data-vue="accueil"] .duo-accueil { display: contents; }
#statut { grid-area: s; } #compte { grid-area: c; } #mes-cryptos { grid-area: r; } #choix { grid-area: d; } #cartes { grid-area: k; } #zone-alertes { grid-area: a; }
#cartes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; background: var(--papier); border-radius: 20px; padding: 20px; box-shadow: 0 0 0 6px var(--plateau), 0 0 0 7px var(--filet), 0 18px 40px -18px rgba(0, 0, 0, .6); }
#cartes > * { box-shadow: none !important; background: var(--fond); border-radius: 14px; padding: 14px 16px; }
#compte .gros, #compte strong:first-of-type { font-family: var(--mono); letter-spacing: -.04em; }
@media (max-width: 900px) {
  .vue[data-vue="accueil"]:not([hidden]) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "s" "c" "r" "d" "k" "a"; }
}
#compte .compte-tete .chiffre { border: 0; padding: 0; }
#compte .chiffre-valeur { font-family: var(--mono); letter-spacing: -.03em; white-space: nowrap; }
#compte .chiffre-valeur.principal { font-size: clamp(40px, 5vw, 58px); line-height: 1; margin: 10px 0 6px; }
#compte .chiffres.trio { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--filet); }
#compte .trio .chiffre { border: 0; padding: 0; }
#compte .trio .chiffre-valeur { font-size: 21px; margin-top: 6px; }
#compte .trio .chiffre-valeur small { font: 500 13px var(--mono); }
.courbe-valeur { display: block; width: 100%; height: 120px; margin-top: 18px; }
.courbe-legende { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.courbe-legende i { width: 14px; height: 2px; background: var(--vert); display: inline-block; }
.courbe-legende i.tirets { background: none; border-top: 1px dashed var(--gris); margin-left: 10px; }
@media (max-width: 560px) { #compte .chiffres.trio { grid-template-columns: 1fr 1fr; } }
.barre { display: flex; align-items: center; gap: 14px; }
.barre .onglets { position: static; margin: 0 auto; width: auto; padding: 0; background: none !important; border: 0; box-shadow: none; gap: 2px; }
.barre .onglets a { padding: 8px 14px; border-radius: 999px; color: var(--gris); }
.barre .onglets a svg { display: none; }
.barre .onglets a[aria-current="page"] { background: var(--encre); color: var(--fond); }
.barre #autre-mode, .barre .badge { display: none; }
@media (max-width: 1320px) { .barre #maj { display: none; } }
.statut-maq { grid-area: s; background: none !important; box-shadow: none !important; padding: 0 !important; }
.etat-maq { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.pastille-maq { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; background: var(--vert-fond); color: var(--vert); }
.pastille-maq::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.pastille-maq.pause, .pastille-maq.arrete { background: var(--ambre-fond); color: var(--ambre); }
.pastille-maq.ko, .pastille-maq.probleme { background: var(--rouge-fond); color: var(--rouge); }
.titre-maq { font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -.025em; font-weight: 600; margin: 0; }
#compte .sur-titre, #mes-cryptos .sur-titre { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gris); }
.repart-maq { display: flex; height: 10px; gap: 3px; margin: 16px 0 18px; }
.repart-maq span { border-radius: 999px; }
.legende-maq { display: grid; gap: 14px; }
.legende-maq div { display: flex; align-items: center; gap: 10px; }
.legende-maq i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legende-maq span { flex: 1; color: var(--gris); }
.legende-maq small { display: block; font: 400 12px/1.4 var(--mono); color: var(--gris); opacity: .8; }
.legende-maq b { font: 500 15px/1 var(--mono); color: var(--encre); }
#mes-cryptos > p { margin-top: 18px; }
#cartes { display: block; padding: 22px 24px; }
#cartes h2 { margin: 0 0 14px; font-size: 17px; }
.sante-maq { display: grid; gap: 12px; }
.sante-maq div { display: flex; justify-content: space-between; gap: 12px; }
.sante-maq div > span:first-child { color: var(--gris); }
#cartes > p { margin-top: 16px; }
#choix h2 { font-size: 17px; margin: 0 0 8px; }
.decision-maq { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.decision-maq li { display: flex; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--fond); }
.decision-maq b { font-family: var(--mono); font-weight: 500; min-width: 38px; }
.prochaine-maq { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--filet); color: var(--gris); }
.prochaine-maq b { font-family: var(--mono); font-weight: 500; color: var(--encre); }
@media (max-width: 760px) {
  .barre { backdrop-filter: none; background: var(--papier) !important; }
  .barre .onglets { position: fixed; left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); margin: 0; padding: 6px; background: color-mix(in srgb, var(--papier) 94%, transparent) !important; border: 1px solid var(--filet); border-radius: 22px; justify-content: space-around; }
  .barre .onglets a { display: grid; justify-items: center; gap: 3px; padding: 7px 4px; font-size: 11px; border-radius: 16px; flex: 1; }
  .barre .onglets a svg { display: block; width: 22px; height: 22px; padding: 0; }
  .barre .onglets a[aria-current="page"] svg { background: none; color: inherit; }
}
#mes-ordres, #profil, #simulateur, .replis { background: none !important; box-shadow: none !important; padding: 0 !important; border: 0 !important; }
.sous-maq { margin: 6px 0 22px; }
.carte-maq { background: var(--papier); border-radius: 20px; padding: 22px 24px; box-shadow: 0 0 0 6px var(--plateau), 0 0 0 7px var(--filet), 0 18px 40px -18px rgba(0, 0, 0, .6); min-width: 0; }
.carte-maq + .carte-maq { margin-top: 22px; }
.carte-maq h2 { font-size: 17px; margin: 0 0 10px; }
.tableau-maq { width: 100%; border-collapse: collapse; }
.tableau-maq th { text-align: left; font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--gris); padding: 10px 12px; border-bottom: 1px solid var(--filet-fort); }
.tableau-maq td { padding: 14px 12px; border-bottom: 1px solid var(--filet); font-family: var(--mono); }
.tableau-maq td:first-child { font-family: var(--sans); }
.tableau-maq .n { text-align: right; }
.sens-maq { display: inline-block; padding: 3px 10px; border-radius: 999px; font: 600 12px var(--sans); }
.sens-maq.achat { background: var(--vert-fond); color: var(--vert); }
.sens-maq.vente { background: var(--rouge-fond); color: var(--rouge); }
@media (max-width: 760px) { .tableau-maq .secondaire { display: none; } .carte-maq { padding: 18px; } }
.crans-maq { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.crans-maq button { border: 1px solid var(--filet-fort); background: var(--papier); border-radius: 14px; padding: 14px 6px; cursor: pointer; text-align: center; color: var(--encre); transition: background .4s var(--courbe), color .4s var(--courbe); }
.crans-maq button b { display: block; font: 500 18px/1 var(--mono); }
.crans-maq button span { display: block; font-size: 12px; color: var(--gris); margin-top: 6px; }
.crans-maq button[aria-pressed="true"] { background: var(--encre); color: var(--fond); border-color: var(--encre); }
.crans-maq button[aria-pressed="true"] span { color: color-mix(in srgb, var(--fond) 70%, transparent); }
.effet-maq { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--fond); color: var(--gris); }
.principal-maq { display: inline-flex; align-items: center; gap: 12px; margin-top: 18px; padding: 8px 8px 8px 20px; border: 0; font-weight: 600; cursor: pointer; }
.principal-maq i { width: 32px; height: 32px; border-radius: 50%; background: rgba(0, 0, 0, .14); display: grid; place-items: center; font-style: normal; transition: transform .5s var(--courbe); }
.principal-maq:hover:not(:disabled) i { transform: translateX(3px); }
.principal-maq:disabled { background: var(--doux); color: var(--gris); cursor: default; }
#profil .strategie { margin-top: 22px; }
@media (max-width: 420px) { .crans-maq button span { font-size: 10px; } }
.replis > details { margin-top: 14px; }
.replis > details > summary { font-weight: 600; }
.sim-piste { background: var(--fond); border-radius: 999px; }
.sim-plage { background: color-mix(in srgb, var(--vert) 26%, transparent) !important; border-radius: 999px; }
.sim-med { width: 14px !important; height: 14px !important; top: 4px !important; margin-left: -7px !important; border-radius: 50% !important; background: var(--vert) !important; box-shadow: 0 0 0 3px var(--papier); }
.sim-actuel .sim-nom { color: var(--vert); }
.barre .urgence { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 14px 8px 10px; background: var(--rouge); color: #2A0A06; font-weight: 600; cursor: pointer; }
.barre .urgence[hidden] { display: none; }
.barre .urgence i { width: 20px; height: 20px; border-radius: 50%; background: rgba(0, 0, 0, .14); display: grid; place-items: center; font-style: normal; font-size: 11px; }
#moteur { margin-bottom: 22px; }
#moteur .sante-maq { margin: 6px 0 4px; }
.secondaire-maq { background: var(--doux); color: var(--encre); }
@media (max-width: 760px) { .barre .urgence b { display: none; } .barre .urgence { padding: 8px; } }
#cryptos { margin-bottom: 22px; }
.cryptos-maq { display: grid; gap: 10px; margin: 16px 0 4px; }
.crypto-maq { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--filet-fort); cursor: pointer; }
.crypto-maq input { width: 20px; height: 20px; accent-color: var(--vert); flex: none; }
.crypto-maq small { display: block; color: var(--gris); font-size: 12px; }
.pion-maq { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 600 13px/1 var(--mono); flex: none; }
#modes { margin-bottom: 22px; }
.modes-maq { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.modes-maq button { border: 1px solid var(--filet-fort); background: var(--papier); color: var(--encre); border-radius: 16px; padding: 16px; text-align: left; cursor: pointer; }
.modes-maq button b { display: block; margin-bottom: 4px; }
.modes-maq button span { color: var(--gris); font-size: 13px; }
.modes-maq button[aria-pressed="true"] { border-color: var(--vert); box-shadow: 0 0 0 3px var(--vert-fond); }
.modes-maq button:disabled:not([aria-pressed="true"]) { opacity: .55; cursor: not-allowed; }
@media (max-width: 560px) { .modes-maq { grid-template-columns: 1fr; } }
.langue { border: 1px solid var(--filet-fort); background: var(--papier); color: var(--encre); border-radius: 999px; padding: 6px 12px; font: 600 12px var(--mono); letter-spacing: .06em; cursor: pointer; }
.marque-connexion .langue { margin-left: auto; }

#licence .etat-licence { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 4px 0 14px; }
#licence .ligne-licence { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--filet); }
#licence .ligne-licence b { text-align: right; overflow-wrap: anywhere; }
#licence .petit { margin-top: 12px; }
.sim-champs select { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--filet-fort); background: var(--fond); color: var(--encre); font: inherit; }
.sim-comparaison { margin-top: 16px; }
.sim-comparaison-table td.sim-tete { font-weight: 700; color: var(--encre); }
