/* FIVE Calcul — FIVE SARL — logiciel conçu par Thierry Zola Kwandi */
@font-face { font-family: 'Plex'; src: url(polices/ibmplexsans-latin.woff2) format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Plex'; src: url(polices/ibmplexsans-latin-ext.woff2) format('woff2'); font-weight: 100 700; font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'PlexMono'; src: url(polices/ibmplexmono-latin-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'PlexMono'; src: url(polices/ibmplexmono-latin-500.woff2) format('woff2'); font-weight: 500 700; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(polices/fraunces-latin.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url(polices/fraunces-latin-ext.woff2) format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF; }

:root {
  --fond: #f4f1ea;
  --fond-2: #ebe6db;
  --carte: #fffdf8;
  --texte: #16202e;
  --doux: #4f5b6b;
  --trait: #d9d2c3;
  --bleu: #12397a;
  --bleu-2: #1d4fa3;
  --bleu-pale: #e3eaf6;
  --or: #9a6a00;
  --or-pale: #f6ecd2;
  --vert: #1b6b3a;
  --vert-pale: #e2f1e6;
  --rouge: #a3261c;
  --rouge-pale: #f8e3e0;
  --ombre: 0 1px 2px rgba(22, 32, 46, .06), 0 4px 14px rgba(22, 32, 46, .06);
  --fam-alcalin: #f7c9b9; --fam-alcalino-terreux: #f6dfae; --fam-transition: #d7dcef; --fam-post-transition: #cfe3d9; --fam-metalloide: #d9e8b8;
  --fam-non-metal: #bfe4ef; --fam-halogene: #b8ecd6; --fam-gaz-noble: #e3d1f2; --fam-lanthanide: #f2d3e6; --fam-actinide: #f3c7cf;
  --bloc-s: #f7c9b9; --bloc-p: #bfe4ef; --bloc-d: #d7dcef; --bloc-f: #f2d3e6; --tp-s: 70%; --tp-l: 80%;
  --rayon: 14px;
  --police: 'Plex', 'Segoe UI', system-ui, sans-serif;
  --titre: 'Fraunces', Georgia, serif;
  --mono: 'PlexMono', ui-monospace, 'Cascadia Mono', monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fond: #0e141d; --fond-2: #151d29; --carte: #18212e; --texte: #e8ecf2; --doux: #a3afbf; --trait: #2a3646;
    --bleu: #8db4ff; --bleu-2: #a9c6ff; --bleu-pale: #1b2a44; --or: #e7b84a; --or-pale: #33290f;
    --vert: #6fd08f; --vert-pale: #12301d; --rouge: #ff8f84; --rouge-pale: #3a1814; --ombre: 0 1px 2px rgba(0, 0, 0, .3); --fam-alcalin: #6b3424; --fam-alcalino-terreux: #66501d; --fam-transition: #2f3a5c; --fam-post-transition: #24493a; --fam-metalloide: #43521f; --fam-non-metal: #1e4a58; --fam-halogene: #1d5442; --fam-gaz-noble: #4a3463; --fam-lanthanide: #5a2c48; --fam-actinide: #5e2a33; --bloc-s: #6b3424; --bloc-p: #1e4a58; --bloc-d: #2f3a5c; --bloc-f: #5a2c48; --tp-s: 45%; --tp-l: 30%; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fond: #0e141d; --fond-2: #151d29; --carte: #18212e; --texte: #e8ecf2; --doux: #a3afbf; --trait: #2a3646;
  --bleu: #8db4ff; --bleu-2: #a9c6ff; --bleu-pale: #1b2a44; --or: #e7b84a; --or-pale: #33290f;
  --vert: #6fd08f; --vert-pale: #12301d; --rouge: #ff8f84; --rouge-pale: #3a1814; --ombre: 0 1px 2px rgba(0, 0, 0, .3); --fam-alcalin: #6b3424; --fam-alcalino-terreux: #66501d; --fam-transition: #2f3a5c; --fam-post-transition: #24493a; --fam-metalloide: #43521f; --fam-non-metal: #1e4a58; --fam-halogene: #1d5442; --fam-gaz-noble: #4a3463; --fam-lanthanide: #5a2c48; --fam-actinide: #5e2a33; --bloc-s: #6b3424; --bloc-p: #1e4a58; --bloc-d: #2f3a5c; --bloc-f: #5a2c48; --tp-s: 45%; --tp-l: 30%; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-size: 16px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--or); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

/* En-tête */
.entete { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--fond) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--trait); }
.entete-in { max-width: 1120px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.marque { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texte); flex-shrink: 0; }
.marque img { width: 36px; height: 36px; border-radius: 9px; }
.marque b { font-family: var(--titre); font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; }
.version { font-family: var(--mono); font-size: .72rem; color: var(--doux); border: 1px solid var(--trait); border-radius: 99px; padding: 1px 7px; }
.recherche { flex: 1; min-width: 0; position: relative; }
.recherche input { width: 100%; border: 1px solid var(--trait); background: var(--carte); border-radius: 99px; padding: 9px 14px 9px 38px; min-height: 44px; }
.recherche svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--doux); }
.btn-icone { width: 44px; height: 44px; border-radius: 99px; border: 1px solid var(--trait); background: var(--carte); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.btn-icone svg { width: 19px; height: 19px; }
@media (max-width: 560px) { .marque b { display: none; } .version { display: none; } }

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 20px 16px 40px; }

/* Accueil */
.accroche { margin: 8px 0 22px; }
.accroche h1 { font-family: var(--titre); font-weight: 600; font-size: clamp(1.7rem, 4.6vw, 2.6rem); line-height: 1.12; letter-spacing: -.02em; margin: 0 0 8px; max-width: 22ch; }
.accroche p { color: var(--doux); margin: 0; max-width: 60ch; }
.chiffres { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chiffres span { font-size: .85rem; background: var(--carte); border: 1px solid var(--trait); border-radius: 99px; padding: 4px 11px; }
.chiffres b { font-family: var(--mono); color: var(--bleu); }
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.carte { background: var(--carte); border: 1px solid var(--trait); border-radius: var(--rayon); box-shadow: var(--ombre); }
a.tuile { display: flex; gap: 14px; align-items: flex-start; padding: 16px; text-decoration: none; color: var(--texte); transition: transform .15s ease, border-color .15s ease; }
a.tuile:hover { border-color: var(--bleu); transform: translateY(-2px); }
.tuile .ico { font-size: 1.6rem; width: 46px; height: 46px; border-radius: 12px; background: var(--bleu-pale); display: grid; place-items: center; flex-shrink: 0; }
.tuile h3 { margin: 0 0 2px; font-size: 1.02rem; font-weight: 600; }
.tuile p { margin: 0; font-size: .87rem; color: var(--doux); }
.tuile .nb { font-family: var(--mono); font-size: .75rem; color: var(--or); margin-top: 4px; display: block; }
h2.section { font-family: var(--titre); font-weight: 600; font-size: 1.25rem; margin: 30px 0 12px; }
.liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
a.ligne { display: block; padding: 13px 15px; text-decoration: none; color: var(--texte); }
a.ligne:hover { border-color: var(--bleu); }
a.ligne b { display: block; font-weight: 600; }
a.ligne span { font-size: .86rem; color: var(--doux); }
a.ligne small { font-size: .74rem; color: var(--or); font-family: var(--mono); }
.vide { padding: 28px; text-align: center; color: var(--doux); }

/* Fil d'Ariane */
.fil { font-size: .88rem; margin-bottom: 10px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; color: var(--doux); }
.fil a { text-decoration: none; }
.titre-calc { font-family: var(--titre); font-weight: 600; font-size: clamp(1.45rem, 4vw, 2rem); line-height: 1.15; margin: 0 0 4px; letter-spacing: -.015em; }
.sous { color: var(--doux); margin: 0 0 18px; }

/* Calculatrice */
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 820px) { .calc { grid-template-columns: 1fr; } }
.form { padding: 16px; display: grid; gap: 13px; }
.champ label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.champ .aide { font-size: .78rem; color: var(--doux); margin-top: 3px; }
.saisie { display: flex; border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); overflow: hidden; }
.saisie:focus-within { border-color: var(--bleu); box-shadow: 0 0 0 3px var(--bleu-pale); }
.saisie input, .saisie select, .saisie textarea { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; min-height: 46px; outline: none; }
.saisie input { font-family: var(--mono); font-size: 1.02rem; }
.saisie textarea { font-family: var(--mono); font-size: .9rem; min-height: 120px; resize: vertical; }
.saisie .unite { border: 0; border-left: 1px solid var(--trait); background: var(--fond-2); padding: 0 10px; flex: 0 0 auto; min-width: 64px; font-size: .9rem; }
.saisie .u-fixe { display: flex; align-items: center; padding: 0 12px; background: var(--fond-2); border-left: 1px solid var(--trait); font-size: .88rem; color: var(--doux); white-space: nowrap; }
.select { border: 1px solid var(--trait); border-radius: 10px; background: var(--fond); padding: 10px 12px; width: 100%; min-height: 46px; }
.apercu { font-family: var(--mono); font-size: .78rem; color: var(--bleu); margin-top: 3px; }
.apercu.err { color: var(--rouge); }
.boutons { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--trait); background: var(--carte); border-radius: 10px; padding: 8px 14px; min-height: 42px; cursor: pointer; font-weight: 500; font-size: .92rem; text-decoration: none; color: var(--texte); }
.btn:hover { border-color: var(--bleu); }
.btn.plein { background: var(--bleu); color: #fff; border-color: var(--bleu); }
:root[data-theme="dark"] .btn.plein { color: #0e141d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.plein { color: #0e141d; } }

.resultats { padding: 16px; position: sticky; top: 76px; }
@media (max-width: 820px) { .resultats { position: static; } }
.resultats h2 { margin: 0 0 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); font-weight: 600; }
.res { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--trait); align-items: baseline; }
.res:last-child { border-bottom: 0; }
.res .l { color: var(--doux); font-size: .9rem; }
.res .v { font-family: var(--mono); text-align: right; font-weight: 500; overflow-wrap: anywhere; }
.res.fort .l { color: var(--texte); font-weight: 600; }
.res.fort .v { color: var(--bleu); font-size: 1.12rem; font-weight: 600; }
.res.fort:first-child { background: var(--bleu-pale); margin: 0 -10px 4px; padding: 12px 10px; border-radius: 10px; border-bottom: 0; }
.res.fort:first-child .v { font-size: 1.35rem; }
.formule { margin-top: 14px; padding: 11px 12px; background: var(--or-pale); border-radius: 10px; font-size: .86rem; }
.formule b { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--or); margin-bottom: 3px; }
.formule code { font-family: var(--mono); font-size: .86rem; white-space: pre-wrap; }
.note { margin-top: 10px; font-size: .86rem; color: var(--doux); border-left: 3px solid var(--trait); padding-left: 10px; }
.alerte { margin-top: 10px; padding: 10px 12px; border-radius: 10px; font-size: .9rem; background: var(--rouge-pale); color: var(--rouge); }
.erreur { padding: 14px; border-radius: 10px; background: var(--rouge-pale); color: var(--rouge); font-size: .93rem; }
.attente { padding: 18px; color: var(--doux); text-align: center; border: 1px dashed var(--trait); border-radius: 10px; font-size: .93rem; }
.copie-ok { color: var(--vert); font-size: .85rem; }

/* Barre du résultat principal (téléphone, pendant la saisie) */
.barre-res { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 14px; padding: 10px 14px; min-height: 52px; background: var(--bleu); color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); cursor: pointer; text-align: left; }
.barre-res span:first-child { flex: 1; font-size: .85rem; opacity: .9; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barre-res b { font-family: var(--mono); font-size: 1.05rem; white-space: nowrap; }
:root[data-theme="dark"] .barre-res { color: #0e141d; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .barre-res { color: #0e141d; } }
@media (min-width: 821px) { .barre-res { display: none !important; } }
@media (max-width: 820px) { .calc { padding-bottom: 70px; } }

/* Calculatrice scientifique */
.sci { max-width: 460px; padding: 14px; }
.ecran { background: var(--fond); border: 1px solid var(--trait); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; }
.ecran input { width: 100%; border: 0; background: transparent; font-family: var(--mono); font-size: 1.15rem; outline: none; padding: 4px 0; }
.ecran .total { font-family: var(--mono); font-size: 2rem; text-align: right; color: var(--bleu); min-height: 2.6rem; overflow-wrap: anywhere; line-height: 1.25; }
.ecran .total.err { font-size: 1rem; color: var(--rouge); }
.ecran .mode { font-size: .75rem; color: var(--doux); display: flex; justify-content: space-between; }
.touches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.touches button { min-height: 50px; border-radius: 11px; border: 1px solid var(--trait); background: var(--carte); cursor: pointer; font-family: var(--mono); font-size: 1rem; }
.touches button:hover { border-color: var(--bleu); }
.touches .f { background: var(--fond-2); font-size: .88rem; }
.touches .op { color: var(--bleu); font-weight: 600; }
.touches .egal { background: var(--bleu); color: var(--carte); border-color: var(--bleu); font-weight: 600; }
.touches .eff { color: var(--rouge); }
.histo { margin-top: 12px; font-family: var(--mono); font-size: .86rem; }
.histo button { display: flex; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px dashed var(--trait); padding: 7px 2px; cursor: pointer; }
.histo button span:last-child { color: var(--bleu); }

/* Pied de page */
.pied { border-top: 1px solid var(--trait); padding: 18px 16px 26px; text-align: center; font-size: .8rem; color: var(--doux); }
.pied b { color: var(--texte); }
.pied .legal { font-family: var(--mono); font-size: .72rem; margin-top: 4px; }
.bandeau { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); background: var(--texte); color: var(--fond); padding: 10px 16px; border-radius: 99px; font-size: .88rem; box-shadow: var(--ombre); z-index: 20; max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Tableau périodique */
.doux-txt { color: var(--doux); font-size: .88rem; }
.tp-haut { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 14px; }
@media (max-width: 820px) { .tp-haut { grid-template-columns: 1fr; } }
.tp-fiche { padding: 16px; display: flex; gap: 16px; align-items: flex-start; }
.tp-gros { width: 104px; height: 118px; flex-shrink: 0; border-radius: 14px; display: flex; flex-direction: column; justify-content: center; align-items: center; border: 1px solid var(--trait); transition: background .3s ease; }
.tp-gros small { font-family: var(--mono); font-size: .85rem; }
.tp-gros b { font-family: var(--titre); font-size: 2.6rem; line-height: 1.05; }
.tp-gros span { font-family: var(--mono); font-size: .78rem; }
.tp-infos { min-width: 0; flex: 1; }
.tp-infos h2 { font-family: var(--titre); margin: 0; font-size: 1.4rem; }
.tp-infos dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 10px 0 12px; font-size: .88rem; }
.tp-infos dt { color: var(--doux); }
.tp-infos dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 460px) { .tp-fiche { flex-direction: column; } .tp-gros { width: 100%; height: 96px; } }
.tp-compo { padding: 16px; display: grid; gap: 10px; align-content: start; }
.tp-barre { display: grid; grid-template-columns: 70px 1fr 64px; gap: 8px; align-items: center; font-size: .86rem; margin-top: 6px; }
.tp-barre div { height: 12px; background: var(--fond); border-radius: 99px; overflow: hidden; border: 1px solid var(--trait); }
.tp-barre i { display: block; height: 100%; border-radius: 99px; transition: width .4s ease; }
.tp-barre span:last-child { text-align: right; }
.tp-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tp-legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; font-size: .82rem; }
.leg { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 3px 0; cursor: pointer; color: var(--texte); }
.leg i { width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--trait); }
.leg.actif { font-weight: 700; text-decoration: underline; }
.tp-defile { overflow-x: auto; padding-bottom: 6px; }
.tp-grille { display: grid; grid-template-columns: repeat(18, minmax(42px, 1fr)); grid-template-rows: repeat(7, auto) 12px auto auto; gap: 3px; min-width: 790px; }
.tp-el { border: 1px solid transparent; border-radius: 7px; padding: 4px 2px 3px; cursor: pointer; display: flex; flex-direction: column; align-items: center; line-height: 1.1; color: var(--texte); min-height: 50px; transition: transform .12s ease, opacity .2s ease, background .3s ease; }
.tp-el small { font-family: var(--mono); font-size: .62rem; opacity: .8; }
.tp-el b { font-size: 1.02rem; font-family: var(--police); }
.tp-el span { font-family: var(--mono); font-size: .56rem; opacity: .8; }
.tp-el:hover { transform: scale(1.12); z-index: 2; border-color: var(--texte); }
.tp-el.choisi { outline: 3px solid var(--bleu); outline-offset: 1px; z-index: 1; }
.tp-el.eteint { opacity: .18; }
.tp-renvoi { display: grid; place-items: center; font-family: var(--mono); font-size: .62rem; color: var(--doux); border: 1px dashed var(--trait); border-radius: 7px; }

/* Laboratoire virtuel */
:root { --verre: rgba(110, 130, 160, .9); }
.labo { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.labo-scene { grid-row: span 2; padding: 12px; display: grid; gap: 10px; }
@media (max-width: 820px) { .labo { grid-template-columns: minmax(0, 1fr); gap: 10px; } .labo-scene { grid-row: auto; } #lb-c { height: clamp(240px, 44vh, 420px) !important; } .labo-jetons { max-height: 34vh; } .labo-actions .btn { padding: 6px 10px; min-height: 40px; font-size: .86rem; } }
#lb-c { width: 100%; height: clamp(300px, 58vh, 520px); display: block; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, var(--carte), var(--fond-2)); touch-action: none; transition: box-shadow .2s ease; }
#lb-c.cible { box-shadow: inset 0 0 0 2px var(--bleu-pale); }
#lb-c.survol { box-shadow: inset 0 0 0 3px var(--bleu), 0 0 24px var(--bleu-pale); }
.labo-jauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.jauge { background: var(--fond); border: 1px solid var(--trait); border-radius: 10px; padding: 7px 10px; position: relative; overflow: hidden; }
.jauge span { display: block; font-size: .74rem; color: var(--doux); }
.jauge b { font-family: var(--mono); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.jauge i { position: absolute; right: 8px; top: 50%; width: 22px; height: 22px; border-radius: 50%; transform: translateY(-50%); border: 1px solid var(--trait); transition: background .5s ease; }
.labo-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.labo-dose { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.labo-dose .select { width: auto; min-height: 42px; padding: 6px 10px; }
.labo-palette { padding: 14px; display: grid; gap: 10px; }
.labo-onglets { display: flex; flex-wrap: wrap; gap: 6px; }
.labo-onglets .btn { flex: 1; justify-content: center; }
.labo-jetons { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); grid-auto-rows: max-content; align-content: start; gap: 7px; max-height: 360px; overflow-y: auto; padding: 2px; }
.jeton { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 7px; align-items: center; text-align: left; border: 1px solid var(--trait); background: var(--fond); border-radius: 10px; padding: 7px 9px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; min-height: 52px; }
.jeton:hover { border-color: var(--bleu); }
.jeton:active { cursor: grabbing; }
.jeton i { grid-row: span 2; width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }
.jeton b { font-family: var(--mono); font-size: .95rem; }
.jeton span { font-size: .72rem; color: var(--doux); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jeton.exp { display: block; cursor: pointer; font-weight: 500; font-size: .88rem; touch-action: manipulation; }
.labo-fantome { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: flex; align-items: center; gap: 7px; background: var(--carte); border: 2px solid var(--bleu); border-radius: 99px; padding: 8px 14px; font-family: var(--mono); font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.labo-fantome i { width: 16px; height: 16px; border-radius: 50%; }
.labo-recit { padding: 16px; min-width: 0; }
.labo-recit h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); font-weight: 600; margin: 0 0 8px; }
.labo-recit-tete { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.labo-recit-tete h2 { margin: 0; }
.labo-evt { animation: arrive .35s ease-out; }
@keyframes arrive { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.labo-evt-tete { display: flex; gap: 6px; flex-wrap: wrap; }
.pastille-type { font-size: .76rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; background: var(--bleu-pale); color: var(--bleu); }
.pastille-type.chaud { background: var(--rouge-pale); color: var(--rouge); }
.pastille-type.froid { background: var(--bleu-pale); color: var(--bleu); }
.labo-eq { font-family: var(--mono); font-size: 1.08rem; margin: 10px 0 6px; padding: 10px 12px; background: var(--or-pale); border-radius: 10px; overflow-wrap: anywhere; }
.labo-evt p { margin: 6px 0; }
.labo-dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: .88rem; margin: 8px 0; }
.labo-dl dt { color: var(--doux); }
.labo-dl dd { margin: 0; overflow-wrap: anywhere; }
.labo-indice { margin-top: 8px; padding: 9px 11px; border-radius: 10px; background: var(--or-pale); font-size: .9rem; }
.labo-histo { margin-top: 10px; font-size: .85rem; }
.labo-histo div { padding: 3px 0; overflow-wrap: anywhere; }
.tab-defile { overflow-x: auto; }
.labo-table { font-size: .86rem; border-collapse: collapse; width: 100%; }
.labo-table th { text-align: left; font-size: .72rem; color: var(--doux); font-weight: 600; padding: 4px 6px; border-bottom: 1px solid var(--trait); }
.labo-table td { padding: 6px; border-bottom: 1px dashed var(--trait); vertical-align: middle; }
.pastille-coul { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .2); }

/* Laboratoire « Faites varier » (toutes les calculatrices) */
.varier { margin-top: 16px; padding: 16px; display: grid; gap: 10px; }
.varier h2 { margin: 0; font-family: var(--titre); font-size: 1.15rem; }
.varier p { margin: 0; }
.varier-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.varier-choix label, .sol-reglages label, .sol-form label, .sol-2 label, .bet-res label { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; }
@media (max-width: 560px) { .varier-choix { grid-template-columns: 1fr; } }
.varier-curseur { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; font-size: .8rem; color: var(--doux); }
.varier-curseur input { width: 100%; accent-color: var(--bleu); height: 32px; }
.varier-lecture { font-size: .95rem; min-height: 1.4em; }
.varier-svg { overflow-x: auto; }
.varier-svg svg { width: 100%; min-width: 320px; height: auto; display: block; }
.var-grille { stroke: var(--trait); stroke-width: 1; }
.var-txt { fill: var(--doux); font: 12px var(--mono); }
.var-titre { fill: var(--texte); font: 600 12px var(--police); }
.var-ligne { fill: none; stroke: var(--bleu); stroke-width: 2.5; stroke-linejoin: round; }
.var-aire { fill: var(--bleu-pale); opacity: .7; }
.var-repere { stroke: var(--or); stroke-dasharray: 4 4; }
.var-point { fill: var(--or); stroke: var(--carte); stroke-width: 3; }

/* Laboratoire solaire */
.sol { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.sol-scene { padding: 12px; display: grid; gap: 10px; }
.sol-palette, .sol-maison, .sol-kit, .bet-palette, .bet-res { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.sol-scene, .bet-scene, .labo-scene, .labo-palette, .varier { grid-template-columns: minmax(0, 1fr); }
.sol-maison h2, .sol-kit h2, .bet-res h2 { margin: 0; font-family: var(--titre); font-size: 1.15rem; }
@media (max-width: 820px) { .sol, .bet { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; } #s-c, #b-c { height: clamp(220px, 40vh, 380px) !important; } }
.sol-jauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bet .sol-jauges { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .sol-jauges { grid-template-columns: repeat(2, 1fr); } }
#s-c, #b-c { width: 100%; height: clamp(280px, 50vh, 460px); display: block; border-radius: 12px; touch-action: none; transition: box-shadow .2s ease; }
#b-c { background: radial-gradient(ellipse at 40% 40%, var(--carte), var(--fond-2)); }
#s-c.survol, #b-c.survol { box-shadow: inset 0 0 0 3px var(--bleu), 0 0 24px var(--bleu-pale); }
.sol-temps { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.sol-temps input { width: 100%; accent-color: var(--or); height: 32px; }
.sol-temps .select { width: auto; min-height: 42px; padding: 6px 8px; }
.sol-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.sol-cats .btn { min-height: 36px; padding: 5px 10px; font-size: .84rem; }
.jeton .ico { grid-row: span 2; font-style: normal; font-size: 1.3rem; width: auto; height: auto; border: 0; }
.sol-ok { padding: 10px 12px; border-radius: 10px; background: var(--vert-pale); color: var(--vert); font-size: .93rem; }
.sol-in { width: 70px; border: 1px solid var(--trait); border-radius: 8px; background: var(--fond); padding: 6px; font-family: var(--mono); min-height: 38px; }
.sol-q { display: inline-flex; align-items: center; gap: 6px; }
.sol-q .btn, .sol-pas .btn, .labo-table .btn { min-height: 34px; min-width: 34px; padding: 2px 8px; justify-content: center; }
.sol-perso summary, .sol-kit summary, .bet-res summary { cursor: pointer; padding: 6px 0; }
.sol-form { display: grid; gap: 10px; margin-top: 8px; }
.sol-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sol-va { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.sol-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; font-weight: 500 !important; }
.sol-reglages { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 460px) { .sol-reglages, .sol-2 { grid-template-columns: 1fr; } }
.sol-essai { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--trait); border-radius: 10px; }
.sol-pas { display: flex; align-items: center; gap: 8px; }
.sol-pas span { flex: 1; }
.sol-pas b { font-family: var(--mono); min-width: 2ch; text-align: center; }

/* Laboratoire de la bétonnière */
.bet { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.bet-scene { padding: 12px; display: grid; gap: 10px; grid-row: span 2; }
.bet-ings { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bet-ing { display: grid; gap: 6px; }
.bet-ing .sol-q { justify-content: center; }

/* Jetons à noms longs (solaire, bétonnière) : le nom passe à la ligne sans chevaucher */
.sol .jeton, .bet .jeton { display: flex; flex-wrap: wrap; align-items: center; column-gap: 8px; row-gap: 2px; height: auto; padding-bottom: 9px; }
.sol .jeton .ico, .bet .jeton .ico { flex: 0 0 auto; }
.sol .jeton b, .bet .jeton b { flex: 1 1 0; min-width: 0; font-family: var(--police); font-size: .86rem; line-height: 1.25; }
.sol .jeton span, .bet .jeton span { flex-basis: 100%; white-space: normal; }

/* Raccourcis de l'accueil */
.raccourcis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 10px; margin-bottom: 8px; }
a.raccourci { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; padding: 12px 14px; text-decoration: none; color: var(--texte); border-color: var(--bleu-pale); }
a.raccourci:hover { border-color: var(--bleu); }
a.raccourci span { grid-row: span 2; font-size: 1.6rem; }
a.raccourci small { color: var(--doux); }

/* Compter par photo */
.cpt { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cpt-haut, .cpt-zone, .cpt-res { padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cpt-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cpt-modes .btn { justify-content: center; text-align: center; }
@media (max-width: 560px) { .cpt-modes { grid-template-columns: 1fr; } }
.cpt-etapes { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .86rem; color: var(--doux); }
.cpt-etape { padding: 3px 10px; border-radius: 99px; background: var(--fond-2); }
.cpt-etape.actif { background: var(--bleu); color: var(--carte); font-weight: 600; }
.cpt-fichier { position: relative; overflow: hidden; }
.cpt-fichier input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.cpt-outils { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cpt-sens { display: flex; align-items: center; gap: 8px; font-size: .88rem; flex: 1 1 200px; }
.cpt-sens input { flex: 1; accent-color: var(--bleu); height: 32px; }
.cpt-defile { overflow: auto; max-height: 75vh; border-radius: 10px; background: var(--fond-2); }
#cpt-c { display: block; cursor: crosshair; }
.cpt-total { display: flex; align-items: baseline; gap: 12px; }
.cpt-total span { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--doux); }
.cpt-total b { font-family: var(--mono); font-size: 2.6rem; color: var(--bleu); line-height: 1; }

/* Laboratoires de physique */
#c-c, #l-c, #p-c { width: 100%; display: block; border-radius: 12px; background: radial-gradient(ellipse at 50% 40%, var(--carte), var(--fond-2)); touch-action: manipulation; transition: box-shadow .2s ease; }
#c-c { height: clamp(240px, 42vh, 380px); }
#l-c { height: clamp(220px, 34vh, 300px); }
#p-c { height: 300px; }
#c-c.survol, #l-c.survol { box-shadow: inset 0 0 0 3px var(--bleu), 0 0 24px var(--bleu-pale); }
#p-tirer { justify-content: center; user-select: none; -webkit-user-select: none; touch-action: none; }

/* Mesurer par photo, niveau */
.mes-outils { display: flex; flex-wrap: wrap; gap: 6px; }
.mes-ref, .mes-lg { display: grid; gap: 4px; font-size: .86rem; font-weight: 600; }
.mes-defile { max-height: none; }
#m-c { display: block; cursor: crosshair; }
.niv-zone { justify-items: stretch; }
#n-c { width: 100%; height: clamp(240px, 46vh, 420px); display: block; border-radius: 14px; background: radial-gradient(ellipse at 50% 45%, var(--carte), var(--fond-2)); }
.niv-lecture { text-align: center; display: grid; gap: 2px; }
.niv-lecture b { font-family: var(--mono); font-size: clamp(2rem, 9vw, 3.2rem); color: var(--bleu); line-height: 1.1; }
.niv-lecture span { color: var(--doux); font-size: .9rem; }

/* Télémètre laser par caméra */
.tel-video { position: relative; border-radius: 12px; overflow: hidden; background: #111; min-height: 180px; }
.tel-video video { display: block; width: 100%; height: auto; }
.tel-video canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tel-video .attente { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; border: 0; }
.tel-etapes { margin: 8px 0; padding-left: 20px; display: grid; gap: 6px; font-size: .92rem; }
