/* Identité visuelle reprise de report.py : mêmes tokens clair/sombre, mêmes polices. Mobile d'abord. */
:root {
  color-scheme: light;
  --ground: #f4f6f5; --surface: #ffffff; --line: #dfe5e2; --line-soft: #ecf0ee;
  --ink: #16201d; --ink-2: #566360; --ink-3: #6b7672;
  --s1: #2a78d6; --s2: #eb6834; --s1-soft: rgba(42,120,214,.10);
  --s1-ink: #1f66bd; --s2-ink: #c9501f; /* variantes foncées quand elles portent du texte blanc (AA) */
  --up: #1d7f3d; --down: #c9352f; --chip: #eef1f0;
  --warn-bg: #fff4e0; --warn-ink: #7a4b00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #11161a; --surface: #181f23; --line: #2b353a; --line-soft: #202930;
    --ink: #edf1ef; --ink-2: #a5b0ac; --ink-3: #8d9894;
    --s1: #3987e5; --s2: #d95926; --s1-soft: rgba(57,135,229,.14);
    --s1-ink: #1f66bd; --s2-ink: #c9501f;
    --up: #4fc06f; --down: #ef6b64; --chip: #232c31;
    --warn-bg: #3a2a08; --warn-ink: #ffd88a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #11161a; --surface: #181f23; --line: #2b353a; --line-soft: #202930;
  --ink: #edf1ef; --ink-2: #a5b0ac; --ink-3: #8d9894;
  --s1: #3987e5; --s2: #d95926; --s1-soft: rgba(57,135,229,.14);
  --s1-ink: #1f66bd; --s2-ink: #c9501f;
  --up: #4fc06f; --down: #ef6b64; --chip: #232c31;
  --warn-bg: #3a2a08; --warn-ink: #ffd88a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* l'emporte sur les display: grid/flex des composants */
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.55 "IBM Plex Sans", system-ui, sans-serif; }
a { color: var(--s1); }
h1, h2, h3 { font-family: "Bricolage Grotesque", "IBM Plex Sans", sans-serif; text-wrap: balance; margin: 0 0 12px; letter-spacing: -.01em; }
h1 { font-size: clamp(26px, 5vw, 36px); font-weight: 700; line-height: 1.1; }
h1 small { font-size: 15px; font-family: "IBM Plex Sans", sans-serif; font-weight: 400; letter-spacing: 0; }
h2 { font-size: 19px; font-weight: 700; margin-top: 4px; }
h3 { font-size: 16px; font-weight: 600; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .92em; background: var(--chip); padding: 1px 5px; border-radius: 4px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-2); margin: 0 0 6px; font-weight: 500; }
.meta { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
.num { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 500; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }

/* Structure */
.wrap { max-width: 1080px; margin: 0 auto; padding-block: 20px 48px; padding-inline: 16px; }
.wrap-etroit { max-width: 420px; padding-top: 12vh; }
.entete { display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; max-width: 1080px; margin: 0 auto; padding: 14px 16px 0; }
.marque { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.marque-point { width: 10px; height: 10px; border-radius: 50%; background: var(--s1); display: inline-block; }
.nav { display: flex; gap: 4px; overflow-x: auto; width: 100%; padding-bottom: 4px; scrollbar-width: none; }
.nav a { white-space: nowrap; text-decoration: none; color: var(--ink-2); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px; }
.nav a[aria-current="page"] { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.pastille { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--s2-ink); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; vertical-align: middle; }
.pied { max-width: 1080px; margin: 0 auto; padding: 16px; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; color: var(--ink-3); font-size: 13px; border-top: 1px solid var(--line); }
.lien { background: none; border: 0; padding: 0; color: var(--s1); font: inherit; cursor: pointer; text-decoration: underline; }

/* Bandeaux et messages */
.bandeau { padding: 8px 16px; font-size: 13px; text-align: center; }
.bandeau a { color: inherit; font-weight: 600; }
.bandeau-papier { background: var(--s1-ink); color: #fff; font-weight: 500; }
.bandeau-alerte { background: var(--warn-bg); color: var(--warn-ink); }
.flash { padding: 10px 14px; border-radius: 10px; margin: 0 0 16px; font-weight: 500; border: 1px solid; }
.flash-ok { background: rgba(29,127,61,.10); border-color: var(--up); color: var(--up); }
.flash-err { background: rgba(201,53,47,.10); border-color: var(--down); color: var(--down); }

/* Cartes, tuiles, listes */
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.carte.meta { padding: 16px; }
.mise-en-avant { border-color: var(--s1); box-shadow: 0 0 0 3px var(--s1-soft); }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tuile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.tuile .num { font-size: 24px; line-height: 1.15; }
.tuile-label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 500; }
.tuile-sub { font-size: 13px; color: var(--ink-2); }
.colonnes { display: grid; gap: 16px; }
@media (min-width: 760px) { .colonnes { grid-template-columns: 1fr 1fr; } }
.cartes { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.actif-off { opacity: .65; }
.liste, .liste-compacte, .journal { list-style: none; margin: 0; padding: 0; }
.liste li { padding: 10px 0; border-top: 1px solid var(--line-soft); }
.liste li:first-child { border-top: 0; }
.liste li.carte { border-top: 1px solid var(--s1); }
.liste-compacte li { padding: 6px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.liste-compacte li:first-child { border-top: 0; }
.score { display: inline-block; min-width: 44px; }
.journal li { padding: 5px 0; font-size: 14px; border-top: 1px solid var(--line-soft); }
.journal li:first-child { border-top: 0; }
.journal .mono { color: var(--ink-3); margin-right: 6px; font-size: 13px; }
.niveau-alerte { color: var(--warn-ink); } .niveau-erreur { color: var(--down); }
.ligne-titre { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin-bottom: 4px; }
.ligne-titre h2 { margin: 0; }
.pourquoi { margin: 6px 0 8px; color: var(--ink-2); }
.conclusion { font-size: 16px; }
.titre-actions { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.titre-actions h1 { margin: 0; }
.chip { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip); color: var(--ink-2); white-space: nowrap; }
.chip-stop { color: var(--down); }
.statut-validee, .statut-auto { color: var(--up); }
.statut-refusee, .statut-expiree { color: var(--down); }
.meteo-bonne { color: var(--up); } .meteo-mauvaise { color: var(--down); }
.compte { font-size: 13px; color: var(--ink-3); }

/* Tableaux */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
tr.detail td { white-space: normal; padding-top: 0; font-size: 13px; }
tr:last-child td { border-bottom: 0; }

/* Formulaires et boutons */
.formulaire label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 12px; }
.formulaire label small.meta { display: block; font-weight: 400; font-size: 13px; margin: 4px 0 0; }
.formulaire input[type="text"], .formulaire input[type="number"], .formulaire input[type="password"], .formulaire select {
  display: block; width: 100%; margin-top: 4px; font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--ground); color: var(--ink); }
.formulaire input:focus-visible, .formulaire select:focus-visible { outline: 2px solid var(--s1); outline-offset: 1px; }
.grille-2 { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .grille-2 { grid-template-columns: 1fr 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; }
legend { font-weight: 600; font-size: 14px; padding: 0 6px; }
.choix { display: block; font-weight: 400; padding: 6px 0; }
.choix .meta { display: block; margin: 0 0 0 22px; }
.bouton { display: inline-block; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.bouton:hover { border-color: var(--ink); }
.bouton:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; }
.bouton-principal { background: var(--s1-ink); border-color: var(--s1-ink); color: #fff; }
.bouton-danger { color: var(--down); border-color: var(--down); }
.bouton-petit { padding: 5px 12px; font-size: 13px; }
.interrupteur.on { background: var(--s1-soft); border-color: var(--s1); color: var(--s1); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.actions form { margin: 0; }
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filtres a { text-decoration: none; }
.filtres button, .filtres a { font: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; cursor: pointer; }
.filtres button.on, .filtres a.on { color: var(--ink); border-color: var(--ink); }
.catalogue { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-bottom: 14px; }
.entree { cursor: pointer; margin: 0; display: grid; gap: 2px; font-weight: 400; }
.entree.deja { opacity: .55; cursor: default; }
.entree:has(input:checked) { border-color: var(--s1); box-shadow: 0 0 0 3px var(--s1-soft); }
.entree input { margin: 0 6px 0 0; }
.entree-desc { font-size: 13px; color: var(--ink-2); }
.profils { display: grid; gap: 12px; }
.profil { display: grid; gap: 4px; cursor: pointer; font-weight: 400; }
.profil:has(input:checked) { border-color: var(--s1); box-shadow: 0 0 0 3px var(--s1-soft); }
.profil-nom { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; }
.profil-desc { white-space: pre-line; } /* les descriptions de profils.json font deux lignes */
.profil-detail { font-size: 13px; color: var(--ink-3); }

/* Glossaire et infobulles */
abbr.terme { text-decoration: underline dotted var(--ink-3); text-underline-offset: 3px; cursor: help; }
abbr.terme:focus-visible { outline: 2px solid var(--s1); outline-offset: 2px; border-radius: 3px; }
.bulle { position: absolute; z-index: 10; max-width: min(320px, calc(100vw - 32px)); background: var(--ink); color: var(--ground); font-size: 13px; line-height: 1.45; padding: 8px 12px; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.glossaire dt { font-weight: 600; margin-top: 10px; }
.glossaire dd { margin: 2px 0 0; color: var(--ink-2); font-size: 14px; }
.prose h2, .prose h3 { margin-top: 18px; } .prose p, .prose li { color: var(--ink-2); } .prose ul, .prose ol { padding-left: 20px; }

/* Graphique SVG (repris de report.py) */
.graphique { margin: 0; }
.legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--ink-2); margin-bottom: 8px; align-items: center; }
.legende-note { margin-left: auto; color: var(--ink-3); }
.sw { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 7px; }
.sw-1 { background: var(--s1); } .sw-2 { background: var(--s2); }
.pt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.pt-achat { background: var(--up); } .pt-vente { background: var(--down); }
.graphique-boite { position: relative; }
.plot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; max-width: 100%; font-family: "IBM Plex Mono", monospace; }
@media (min-width: 560px) { .plot { aspect-ratio: 16 / 6; } }
.plot .grid { stroke: var(--line-soft); stroke-width: 1; }
.plot .base { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.plot .lbl { fill: var(--ink-3); font-size: 11px; }
.plot .l1 { fill: none; stroke: var(--s1); stroke-width: 2; stroke-linejoin: round; }
.plot .l2 { fill: none; stroke: var(--s2); stroke-width: 1.5; stroke-linejoin: round; opacity: .85; }
.plot .a1 { fill: var(--s1-soft); }
.plot .cross { stroke: var(--ink-3); stroke-width: 1; opacity: 0; }
.plot .dot { opacity: 0; stroke: var(--surface); stroke-width: 2; }
.plot .d1 { fill: var(--s1); } .plot .d2 { fill: var(--s2); }
.plot .m-achat { fill: var(--up); stroke: var(--surface); stroke-width: 1.5; }
.plot .m-vente { fill: var(--down); stroke: var(--surface); stroke-width: 1.5; }
.plot.hover .cross, .plot.hover .dot { opacity: 1; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--ground); font-size: 12px; padding: 7px 10px; border-radius: 6px; line-height: 1.5; white-space: nowrap; transform: translate(-50%, -100%); box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.tip b { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Probabilité « y aller ou pas » */
.proba { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 8px 0 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); border-left-width: 5px; }
.proba-favorable { border-left-color: var(--up); } .proba-favorable .proba-val { color: var(--up); }
.proba-incertain { border-left-color: var(--ink-3); } .proba-incertain .proba-val { color: var(--ink); }
.proba-defavorable { border-left-color: var(--down); } .proba-defavorable .proba-val { color: var(--down); }
.proba-val { font-family: "IBM Plex Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 26px; line-height: 1; }
.proba-compacte .proba-val { font-size: 20px; }
.proba-txt { flex: 1 1 260px; font-size: 14px; color: var(--ink-2); }
.proba-detail { flex-basis: 100%; font-size: 13px; color: var(--ink-2); }
.proba-detail summary { cursor: pointer; color: var(--s1); }
.proba-detail ul { margin: 6px 0 0; padding-left: 4px; list-style: none; }
.proba-detail li { margin: 4px 0; }
.proba-pts { display: inline-block; min-width: 2.6em; text-align: right; margin-right: 6px; }

/* Indicateur de mise à jour automatique (pied de page) */
.auto-maj { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 13px; cursor: help; }
.auto-maj-point { width: 8px; height: 8px; border-radius: 50%; background: var(--up); animation: auto-maj-pulse 2s ease-in-out infinite; }
.auto-maj-attente .auto-maj-point { background: var(--s2); }
@keyframes auto-maj-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .auto-maj-point { animation: none; } }

/* Page Actifs : une carte par symbole, un bloc par stratégie */
.strategie { border-top: 1px solid var(--line-soft); padding-top: 10px; margin-top: 10px; }
.strategie-titre { margin: 0 0 2px; font-weight: 600; }
.strategie-titre a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.strategie-titre a:hover, .strategie-titre a:focus-visible { border-color: var(--s1); outline: none; }
.strategie.actif-off { opacity: .6; }

/* Chiffre de probabilité en tête de proposition et dans les tableaux */
.proba-chip { font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 600; font-size: 14px; padding: 2px 10px; color: var(--ink); }
.proba-chip-favorable { background: color-mix(in srgb, var(--up) 18%, var(--surface)); color: var(--up); }
.proba-chip-incertain { background: var(--chip); }
.proba-chip-defavorable { background: color-mix(in srgb, var(--down) 16%, var(--surface)); color: var(--down); }

.strategie .proba-chip { font-size: 16px; padding: 3px 12px; margin-right: 6px; vertical-align: middle; }
.strategie .proba-detail { margin: 2px 0 6px; }

/* Tableau météo et tendances */
.tendances td, .tendances th { padding: 7px 8px; }
.tend-up { color: var(--up); } .tend-down { color: var(--down); }
