/* Statistiques & Analyses (maquette : Exemple 45 ; fabriqué par H24ROULETTE-ACCUEIL-FABRIQUE\statistiques.py ; calculs : statistiques.js).
   Chargée après simulateur.css (en-tête des outils, cadres, cartes, tableaux). */

:root { --st-bleu: #2f86ff; --st-rouge: #ff5468; --st-vert: #34d873; }

/* ---------- En-tête : loupe dorée (Exemple 46), cylindre incliné ---------- */
.st-deco { position: absolute; z-index: 0; pointer-events: none; }
.st-deco-gauche { left: clamp(10px, 4vw, 70px); bottom: 14px; width: clamp(130px, 13vw, 210px); filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .7)); }
.st-loupe { display: block; width: 100%; height: auto; }
.st-deco-droite { right: clamp(-150px, -7vw, -60px); bottom: clamp(-210px, -10vw, -90px); width: clamp(260px, 26vw, 420px); perspective: 900px; }
.st-roue { position: relative; width: 100%; aspect-ratio: 1; transform: rotateX(58deg) rotateZ(-12deg); filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .75)); }
.st-roue .cylindre-svg, .st-bille { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }

/* ---------- Grille (ordinateur) ---------- */
.simu.st { align-items: stretch; }
.st-source { grid-column: 1 / 4; }
.st-import { grid-column: 4 / 7; }
.st-param { grid-column: 7 / 10; }
.st-charge { grid-column: 10 / 13; }
.st-saisie { grid-column: 1 / -1; }
.st-cartes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.st-histo { grid-column: 1 / 6; }
.st-thermique { grid-column: 6 / 10; }
.st-top { grid-column: 10 / 13; }
.st-couleurs { grid-column: 1 / 4; }
.st-douz { grid-column: 4 / 7; }
.st-col { grid-column: 7 / 10; }
.st-chances { grid-column: 10 / 13; }
.st-series { grid-column: 1 / 6; }
.st-ecarts { grid-column: 6 / 13; }
.st-fenetres { grid-column: 1 / 6; }
.st-courbe { grid-column: 6 / 13; }
.st-interp { grid-column: 1 / 9; }
.st-export { grid-column: 9 / 13; }
.st .simu-cadre h2 { flex-wrap: nowrap; font-size: clamp(1.05rem, 1.25vw, 1.3rem); line-height: 1.2; }
.st .simu-cadre h2 svg.i { flex: none; }

/* ---------- Commandes ---------- */
.st-petit { display: flex; gap: 6px; margin: 6px 0 0; font-size: .8rem; line-height: 1.4; color: rgba(255, 255, 255, .72); }
.st-petit svg.i { flex: none; width: 15px; height: 15px; margin-top: 1px; color: var(--cyan); }
.st-petit a { color: #9fd0ff; font-weight: 700; }
.st-lib { display: block; margin: 8px 0 4px; font-weight: 700; font-size: .86rem; color: #fff; }
.st-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 8px; font-size: .86rem; font-weight: 700; }
.st-ligne[hidden] { display: none; }
.st-select, .st-nombre, .st-texte {
  min-width: 0; height: 36px; padding: 0 10px; border-radius: 9px; border: 2px solid rgba(70, 150, 255, .85); background: rgba(3, 8, 28, .95);
  color: #fff; font: inherit; font-weight: 700; font-size: .88rem; color-scheme: dark;
}
.st-select { width: 100%; cursor: pointer; }
.st-ligne .st-select { width: auto; flex: 1 1 120px; }
.st-select option { background: #071233; color: #fff; }
.st-nombre { width: 96px; text-align: right; }
.st-texte { display: block; width: 100%; height: auto; min-height: 44px; padding: 8px 10px; resize: vertical; line-height: 1.4; }
.st-select:focus, .st-nombre:focus, .st-texte:focus { outline: none; border-color: var(--simu-or); box-shadow: 0 0 10px rgba(247, 201, 72, .55); }
.st-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 6px 12px; border-radius: 10px;
  border: 1.5px solid rgba(70, 150, 255, .8); background: linear-gradient(180deg, rgba(20, 42, 100, .95), rgba(8, 18, 54, .95));
  color: #fff; font-weight: 800; font-size: .88rem; line-height: 1.2; text-align: center; cursor: pointer; box-shadow: 0 0 10px rgba(47, 134, 255, .3);
}
.st-btn svg.i { flex: none; width: 18px; height: 18px; color: #dfe9ff; }
.st-btn.vert { border-color: #3ee07f; background: linear-gradient(180deg, #1aa152, #0b6b33); box-shadow: 0 0 12px rgba(52, 216, 115, .45); }
.st-btn.rouge, .btn-petit.rouge { border-color: #ff6b7a; background: linear-gradient(180deg, #c8102e, #7c0816); color: #fff; box-shadow: 0 0 12px rgba(255, 84, 104, .45); }
.st-btn.vert svg.i, .st-btn.rouge svg.i { color: #fff; }
.st-btn.petit { min-height: 34px; padding: 4px 10px; font-size: .8rem; }
.st-btn:hover { filter: brightness(1.15); }
.st-import .st-btn.vert { width: 100%; margin-top: 8px; }
.st-message { min-height: 1.2em; margin: 6px 0 0; font-size: .82rem; font-weight: 700; line-height: 1.4; color: var(--simu-or-clair); }
.st-message:empty { display: none; }
.st-message.erreur { color: #ff8a96; }
.st-cache { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.st-fichier { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.st-fichier input:focus-visible + label { outline: 2px solid var(--simu-or); outline-offset: 2px; }
.st-nom-fichier { min-width: 0; font-size: .8rem; color: rgba(255, 255, 255, .75); overflow-wrap: anywhere; }

.st-radios { display: flex; flex-direction: column; gap: 8px; }
.st-radio {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .25);
  background: rgba(3, 8, 28, .6); font-weight: 700; font-size: .9rem; cursor: pointer;
}
.st-radio input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--st-bleu); }
.st-radio small { font-weight: 600; color: rgba(255, 255, 255, .7); }
.st-radio:has(input:checked) { border-color: #4aa6ff; background: linear-gradient(180deg, rgba(30, 80, 170, .7), rgba(12, 34, 90, .8)); box-shadow: 0 0 12px rgba(47, 134, 255, .55); }

.st-gros { display: flex; align-items: center; gap: 10px; margin: 2px 0 0; font-size: clamp(1.6rem, 2.2vw, 2.1rem); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.st-ok { width: 30px; height: 30px; padding: 3px; border-radius: 50%; background: #18b25a; color: #fff; box-shadow: 0 0 10px rgba(52, 216, 115, .7); }
.st-source-nom { margin: 2px 0 0; font-weight: 700; color: var(--simu-or-clair); }
.st-ruban { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 0; padding: 0; list-style: none; }
.st-ruban li { display: contents; }
.st-puce {
  display: grid; place-items: center; min-width: 26px; height: 26px; padding: 0 3px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45);
  font-weight: 800; font-size: .74rem; color: #fff;
}
button.st-puce { cursor: pointer; font-family: inherit; }
button.st-puce:hover, button.st-puce:focus-visible { box-shadow: 0 0 0 2px var(--simu-or); outline: none; }
.st-puce.rouge { background: #c8102e; }
.st-puce.noir { background: #10131f; }
.st-puce.vert { background: #0a8a3e; }
.st-ruban .vide { font-size: .8rem; color: rgba(255, 255, 255, .65); }

/* ---------- Saisie manuelle et carte thermique : le tapis ---------- */
.st-saisie-corps { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 16px; align-items: start; margin-top: 10px; }
.st-saisie-cote .st-btn { width: 100%; }
.st-tapis {
  --h: clamp(15px, 1.45vw, 21px);
  display: grid; grid-template-columns: minmax(0, 1.25fr) repeat(12, minmax(0, 1fr)); grid-template-rows: repeat(6, var(--h)); gap: 3px;
  padding: 6px; border-radius: 10px; border: 2px solid rgba(255, 255, 255, .35);
  background: radial-gradient(ellipse at 50% 40%, #127243, #0a4c2c 70%, #05261a);
}
.st-thermo { --h: clamp(15px, 1.45vw, 21px); }
.st-case {
  position: relative; display: grid; place-items: center; min-width: 0; padding: 0; border-radius: 5px;
  border: 2px solid rgba(255, 255, 255, .28); color: #fff; font: inherit; font-weight: 800; font-size: clamp(.68rem, .85vw, .95rem);
  grid-column: var(--c); grid-row: var(--r) / span 2; cursor: pointer; overflow: hidden;
}
.st-case.rouge { background: linear-gradient(180deg, #db2333, #a10f1c); }
.st-case.noir { background: linear-gradient(180deg, #2c2d36, #0c0c11); }
.st-case.vert { background: linear-gradient(180deg, #16a352, #0a6b33); }
.st-zero { grid-column: 1; grid-row: 1 / span 6; }
.st-zero2 { display: none; }
[data-type="us"] .st-zero { grid-row: 4 / span 3; }
[data-type="us"] .st-zero2 { display: grid; grid-column: 1; grid-row: 1 / span 3; }
.st-pave .st-case:hover, .st-pave .st-case:focus-visible { filter: brightness(1.25); outline: 2px solid var(--simu-or-clair); outline-offset: -2px; }
.st-pave .st-case:active { transform: scale(.94); }
.st-pave .st-freq { display: none; }
.st-pave .st-case.ajoute { animation: st-ajoute .5s ease-out; }
@keyframes st-ajoute { 0% { box-shadow: 0 0 0 0 rgba(255, 226, 122, .9); } 100% { box-shadow: 0 0 0 10px rgba(255, 226, 122, 0); } }
.st-thermo .st-case { border-color: var(--hc, rgba(255, 255, 255, .28)); box-shadow: 0 0 calc(var(--f, 0) * 12px) var(--hc, transparent), inset 0 0 calc(var(--f, 0) * 8px) var(--hc, transparent); }
.st-thermo .st-case[aria-pressed="true"] { outline: 2px solid #fff; outline-offset: 1px; z-index: 1; }
.st-freq { position: absolute; left: 3px; right: 3px; bottom: 2px; height: 3px; border-radius: 2px; background: rgba(0, 0, 0, .45); overflow: hidden; }
.st-freq::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--f, 0) * 100%); background: var(--hc, #fff); }
.st-echelle { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 10px; margin-top: 10px; font-size: .8rem; font-weight: 700; }
.st-echelle i { height: 10px; border-radius: 5px; background: linear-gradient(90deg, #2563eb, #22d3ee 35%, #a3e635 65%, #ffd24a); box-shadow: 0 0 8px rgba(255, 210, 74, .35); }
.st-echelle-val { margin: 4px 0 0; display: flex; justify-content: space-between; font-size: .76rem; color: rgba(255, 255, 255, .7); }
.st-detail { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--simu-or); background: rgba(40, 28, 4, .55); }
.st-detail[hidden] { display: none; }
.st-detail p { margin: 0 0 8px; font-size: .86rem; line-height: 1.45; }

/* ---------- Cartes ---------- */
.st-cartes .carte-res {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; gap: 8px; padding: 10px 10px; text-align: left;
  border-color: rgba(247, 201, 72, .65); box-shadow: 0 0 12px rgba(247, 201, 72, .22), inset 0 0 10px rgba(47, 134, 255, .12);
}
.st-cartes h3 { justify-content: flex-start; margin: 0 0 2px; font-size: .9rem; color: #fff; }
.st-cartes .carte-val { font-size: clamp(1.05rem, 1.35vw, 1.45rem); white-space: nowrap; }
.st-cartes .carte-sous { min-height: 0; margin: 2px 0 0; font-size: .78rem; white-space: nowrap; }
.st-cartes .carte-val.petit { font-size: .84rem; font-weight: 800; line-height: 1.3; white-space: pre-line; }
.st-ic { width: 34px; height: 34px; color: var(--simu-or); filter: drop-shadow(0 0 6px rgba(247, 201, 72, .5)); }
.st-ic-rouge { color: #e11d2e; filter: drop-shadow(0 0 6px rgba(255, 84, 104, .7)); }
.st-ic-noir { color: #111; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .6)); }
.st-ic-zero { display: grid; place-items: center; border-radius: 50%; background: #0a8a3e; border: 2px solid #6ff0a0; color: #fff; font-weight: 900; font-size: 1.05rem; }
.st-c-rouge { border-color: rgba(255, 84, 104, .75) !important; }
.st-c-zero { border-color: rgba(62, 224, 127, .75) !important; }

/* ---------- Graphiques ---------- */
.st-legende { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: -4px 0 8px; font-size: .78rem; color: rgba(255, 255, 255, .8); }
.st-legende span[class^="st-l-"] { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-left: 6px; }
.st-legende span[class^="st-l-"]:first-child { margin-left: 0; }
.st-l-barre { background: linear-gradient(180deg, #4aa6ff, #1d5fd8); }
.st-l-theo { height: 3px !important; background: #ffd24a; }
.st-l-plus { background: linear-gradient(180deg, #5ef08f, #139447); }
.st-l-moins { background: linear-gradient(180deg, #ff6b7a, #a10f1c); }
.st-l-obs { height: 3px !important; background: #4aa6ff; }
.st-l-zone { background: rgba(74, 166, 255, .22); border: 1px solid rgba(74, 166, 255, .5); }
.st-graphe { position: relative; height: clamp(230px, 18vw, 280px); }
.st-graphe-petit { height: 210px; }
.st-graphe-courbe { height: clamp(220px, 17vw, 260px); }
.st-graphe svg { display: block; width: 100%; height: 100%; overflow: visible; }
.st-graphe text { font-size: 10.5px; fill: rgba(255, 255, 255, .78); font-weight: 700; font-family: system-ui, sans-serif; }
.st-graphe .grille { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.st-graphe .axe { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.st-graphe .theo { stroke: #ffd24a; stroke-width: 2; stroke-dasharray: 6 4; }
.st-graphe .st-b { fill: url(#st-bleu); }
.st-graphe .st-b.plus { fill: url(#st-vert); }
.st-graphe .st-b.moins { fill: url(#st-rouge); }
.st-graphe .st-b.dor { fill: url(#st-or); }
.st-graphe .st-b.st-bz { fill: url(#st-vert); }
.st-graphe .st-b:hover, .st-graphe .st-b.actif { stroke: #fff; stroke-width: 1.5; }
.st-graphe .val { font-size: 11px; font-weight: 800; fill: #fff; }
.st-graphe .etiquette rect { fill: rgba(4, 30, 14, .92); stroke: #6ff0a0; stroke-width: 1.2; }
.st-graphe .etiquette.moins rect { fill: rgba(40, 4, 10, .92); stroke: #ff8a96; }
.st-graphe .etiquette text { font-size: 11px; font-weight: 900; fill: #fff; }
.st-graphe .ligne-obs { fill: none; stroke: #4aa6ff; stroke-width: 2.2; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(74, 166, 255, .7)); }
.st-graphe .zone { fill: rgba(74, 166, 255, .16); stroke: rgba(74, 166, 255, .45); stroke-width: 1; }
.st-graphe .vide { font-size: 13px; fill: rgba(255, 255, 255, .6); }
.st-bulle {
  position: absolute; z-index: 5; max-width: 280px; margin: 0; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--simu-or);
  background: #0b1740; color: #fff; font-size: .8rem; font-weight: 700; line-height: 1.4; box-shadow: 0 8px 22px rgba(0, 0, 0, .6); pointer-events: none;
}
.st-bulle[hidden] { display: none; }

.st-anneau-bloc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; justify-items: center; }
.st-anneau { width: min(170px, 70%); }
.st-anneau svg { display: block; width: 100%; height: auto; }
.st-anneau text { fill: #fff; font-family: system-ui, sans-serif; font-weight: 900; }
.st-leg-liste { width: 100%; margin: 0; padding: 0; list-style: none; font-size: .84rem; }
.st-leg-liste li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 2px 8px; align-items: center; padding: 5px 0; }
.st-leg-liste i { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .5); }
.st-leg-liste b { font-variant-numeric: tabular-nums; }
.st-leg-liste small { grid-column: 2; color: rgba(255, 255, 255, .72); font-weight: 700; }

.st-empiles { display: flex; flex-direction: column; gap: 12px; }
.st-empile p { display: flex; justify-content: space-between; gap: 8px; margin: 0 0 4px; font-size: .8rem; font-weight: 700; }
.st-empile p span:last-child { text-align: right; }
.st-barre-empilee { display: flex; height: 18px; border-radius: 6px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); }
.st-barre-empilee i { display: block; height: 100%; min-width: 0; }
.st-theo-note { margin: 2px 0 0; font-size: .74rem; color: rgba(255, 255, 255, .62); }

/* ---------- Top / Flop ---------- */
.st-top-bloc { margin-top: 10px; padding: 8px 10px; border-radius: 10px; }
.st-top-bloc.plus { border: 1.5px solid #3ee07f; background: rgba(6, 50, 24, .55); box-shadow: 0 0 10px rgba(52, 216, 115, .25); }
.st-top-bloc.moins { border: 1.5px solid #ff6b7a; background: rgba(60, 6, 14, .55); box-shadow: 0 0 10px rgba(255, 84, 104, .25); }
.st-top-bloc h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; font-size: .92rem; color: #fff; }
.st-top-bloc h3 svg.i { width: 18px; height: 18px; }
.st-top-bloc.plus h3 svg.i { color: #6ff0a0; transform: rotate(0); }
.st-top-bloc.moins h3 svg.i { color: #ff8a96; }
.st-top-bloc ol { margin: 0; padding: 0; list-style: none; counter-reset: top; }
.st-top-bloc li {
  counter-increment: top; display: grid; grid-template-columns: 1.6em auto minmax(0, 1fr) auto; align-items: center; gap: 6px;
  padding: 3px 0; font-size: .84rem; font-variant-numeric: tabular-nums;
}
.st-top-bloc li::before { content: counter(top) "."; color: rgba(255, 255, 255, .7); font-weight: 700; }
.st-top-bloc li .st-puce { min-width: 24px; height: 24px; font-size: .72rem; }
.st-top-bloc li b { font-weight: 800; }
.st-top-bloc li span:last-child { color: rgba(255, 255, 255, .8); font-weight: 700; }

/* ---------- Séries, écarts, fenêtres ---------- */
.st-series .tableau-comp table, .st-ecarts .tableau-comp table, .st-fenetres .tableau-comp table { font-size: .82rem; }
.st .tableau-comp thead th { padding: .5em .4em; }
.st .tableau-comp td, .st .tableau-comp tbody th { padding: .42em .4em; }
.st .tableau-comp tbody th { font-weight: 700; }
.st-series td.fort { color: var(--simu-or-clair); font-weight: 900; }
.st-sous-titre { margin: 12px 0 6px; font-size: .92rem; color: var(--simu-or-clair); }
.st-resume { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 18px; margin: 0 0 8px; }
.st-resume div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.st-resume dt { font-size: .84rem; color: rgba(255, 255, 255, .88); }
.st-resume dd { margin: 0; font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-verdict { margin: 4px 0 8px; padding: 8px 12px; border-radius: 10px; border: 1.5px solid #3ee07f; background: rgba(6, 50, 24, .5); font-size: .86rem; font-weight: 700; line-height: 1.45; }
.st-verdict.peu { border-color: #ffb547; background: rgba(70, 42, 2, .5); }
.st-verdict.tres { border-color: #ff6b7a; background: rgba(70, 6, 16, .5); }
.st-verdict.neutre { border-color: rgba(255, 255, 255, .3); background: rgba(3, 8, 28, .5); }
.st-defile { max-height: 360px; overflow: auto; }
.st-defile thead th { position: sticky; top: 0; z-index: 1; }
.st-ecarts tr.rare > * { background: rgba(247, 201, 72, .1); }
.st-ecarts .badge-rare { display: inline-block; margin-left: 4px; padding: 0 .4em; border-radius: 999px; border: 1px solid var(--simu-or); font-size: .7rem; color: var(--simu-or-clair); }
.st-fenetres td.theo, .st-fenetres th.theo { color: var(--simu-or-clair); }

/* ---------- Interprétations et export ---------- */
.st-interp-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.st-interp-liste li { padding: 12px 14px; border-radius: 12px; border: 1.5px solid rgba(70, 150, 255, .55); background: rgba(3, 8, 28, .6); }
.st-interp-liste li.vert { border-color: #3ee07f; background: rgba(6, 50, 24, .45); }
.st-interp-liste li.dore { border-color: var(--simu-or); background: rgba(40, 28, 4, .45); }
.st-interp-liste h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1rem; color: #fff; }
.st-interp-liste h3 svg.i { flex: none; width: 24px; height: 24px; color: var(--simu-or); }
.st-interp-liste li.vert h3 svg.i { color: #6ff0a0; }
.st-interp-liste p { margin: 0; font-size: .88rem; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.st-export { border-color: rgba(178, 117, 255, .75) !important; box-shadow: 0 0 18px rgba(178, 117, 255, .35), inset 0 0 14px rgba(178, 117, 255, .12) !important; }
.st-export-boutons { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
.st-export-boutons .st-btn { width: 100%; }
.st-export-boutons .rouge { grid-column: 1 / -1; }

/* ---------- Fenêtres de dialogue ---------- */
.st-dialogue {
  width: min(480px, calc(100vw - 24px)); max-height: calc(100vh - 24px); padding: 18px 18px 16px; border-radius: 16px;
  border: 1.5px solid var(--simu-or); background: linear-gradient(180deg, #0c1a48, #050b26); color: #fff; box-shadow: 0 0 28px rgba(247, 201, 72, .45);
}
.st-dialogue::backdrop { background: rgba(0, 0, 0, .72); }
.st-form h2 { margin: 0 0 10px; font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif; font-size: 1.35rem; color: var(--simu-or); }
.st-form p { margin: 0 0 6px; font-size: .88rem; line-height: 1.45; overflow-wrap: anywhere; }
.st-form p.alerte { color: #ffd27a; }
.st-form p.erreur { color: #ff8a96; font-weight: 700; }
.st-form .valides { font-size: 1.05rem; font-weight: 800; color: #6ff0a0; }
.st-form fieldset { margin: 10px 0 0; padding: 8px 10px; border-radius: 10px; border: 1px solid rgba(70, 150, 255, .5); }
.st-form legend { padding: 0 4px; font-weight: 700; font-size: .86rem; }
.st-form fieldset label { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: .88rem; }
.st-form fieldset input { accent-color: var(--st-bleu); }
.st-form fieldset[hidden] { display: none; }
.st-form > label { display: block; margin: 4px 0; font-weight: 700; font-size: .9rem; }
.st-form-boutons { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; margin-top: 14px; }
.st-form-boutons.trois { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
.st-form-boutons .btn-lancer, .st-form-boutons .btn-petit { min-height: 46px; font-size: .95rem; }
.st-form-boutons .btn-lancer[disabled] { opacity: .45; cursor: not-allowed; }

/* ---------- Tailles intermédiaires ---------- */
@media (max-width: 1199px) {
  .st-source, .st-param { grid-column: 1 / 7; }
  .st-import, .st-charge { grid-column: 7 / 13; }
  .st-cartes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .st-histo { grid-column: 1 / -1; }
  .st-thermique { grid-column: 1 / 8; }
  .st-top { grid-column: 8 / 13; }
  .st-couleurs, .st-col { grid-column: 1 / 7; }
  .st-douz, .st-chances { grid-column: 7 / 13; }
  .st-series, .st-ecarts, .st-fenetres, .st-courbe, .st-interp, .st-export { grid-column: 1 / -1; }
  .st-export-boutons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .st-export-boutons .rouge { grid-column: auto; }
  .st-deco-gauche { width: clamp(110px, 12vw, 150px); }
}

/* ---------- Tablette et téléphone : un bloc sous l'autre ---------- */
@media (max-width: 999px) {
  .st-deco { display: none; }
  .st-source { order: 1; } .st-charge { order: 2; } .st-import { order: 3; } .st-saisie { order: 4; } .st-param { order: 5; }
  .st-cartes { order: 6; } .st-histo { order: 7; } .st-thermique { order: 8; } .st-top { order: 9; } .st-couleurs { order: 10; }
  .st-douz { order: 11; } .st-col { order: 12; } .st-chances { order: 13; } .st-series { order: 14; } .st-ecarts { order: 15; }
  .st-fenetres { order: 16; } .st-courbe { order: 17; } .st-interp { order: 18; } .st-export { order: 19; }
  .st-saisie-corps { grid-template-columns: minmax(0, 1fr); }
  .st-interp-liste { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .st-cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .st-cartes .carte-res { grid-template-columns: 28px minmax(0, 1fr); padding: 8px; gap: 6px; }
  .st-ic { width: 26px; height: 26px; }
  .st-ic-zero { font-size: .9rem; }
  .st-cartes h3 { font-size: .8rem; }
  .st-cartes .carte-val { font-size: 1.05rem; }
  .st-cartes .carte-sous { font-size: .72rem; }
  /* Tapis debout */
  .st-tapis { --h: 30px; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 34px repeat(12, var(--h)); }
  .st-thermo { --h: 28px; }
  .st-case { grid-column: var(--vc) / span 2; grid-row: var(--vr); font-size: .9rem; }
  .st-zero { grid-column: 1 / span 6; grid-row: 1; }
  [data-type="us"] .st-zero { grid-column: 1 / span 3; grid-row: 1; }
  [data-type="us"] .st-zero2 { grid-column: 4 / span 3; grid-row: 1; }
  .st-graphe-histo { height: auto; }
  .st-anneau { width: min(160px, 60%); }
  .st-export-boutons { grid-template-columns: minmax(0, 1fr); }
  .st-ecarts th[data-col="3"], .st-ecarts td[data-col="3"], .st-ecarts th[data-col="4"], .st-ecarts td[data-col="4"] { display: none; }
  .st .tableau-comp table { font-size: .76rem; }
  .st .tableau-comp thead th { font-size: .68rem; padding: .45em .25em; }
  .st .tableau-comp td, .st .tableau-comp tbody th { padding: .4em .25em; }
  .st-form-boutons.trois { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .st-pave .st-case.ajoute { animation: none; }
}
