/* Ogrelo · figures exactes (figure.js) et opérations posées (pose.js), partagées par l'appli, l'espace parents et l'aperçu du professeur */
/* figures exactes des fiches (figure.js) : mêmes couleurs qu'autour, clair comme sombre */
.fig{margin:6px 0 2px;padding:10px 8px 8px;border-radius:16px;background:color-mix(in srgb,var(--card) 70%,var(--bg,transparent));border:2px solid var(--line)}
.fig-svg{display:block;width:100%;max-width:420px;height:auto;margin:0 auto;overflow:hidden}
.fig-svg .tr{stroke:var(--ink);stroke-width:2;fill:none;stroke-linecap:round;stroke-linejoin:round}
.fig-svg .tr.fin{stroke-width:1.6}
.fig-svg .tir{stroke-dasharray:5 4}
.fig-svg .acc{stroke:var(--ogre);fill:var(--ogre)}
.fig-svg .tr.acc{fill:none}
.fig-svg .pt{fill:var(--ink)}
.fig-svg circle.pt{stroke:none}
.fig-svg .ax{stroke:var(--ink);stroke-width:1.6;fill:none}
.fig-svg .gr{stroke:var(--line);stroke-width:1}
.fig-svg .flm{fill:var(--ink)}
.fig-svg .pg{fill:none;stroke:none}
.fig-svg .pg.rem{fill:color-mix(in srgb,var(--ogre) 16%,transparent)}
.fig-svg text{font:700 13px/1 inherit;font-family:inherit;fill:var(--ink)}
.fig-svg text.me{font-weight:600;font-size:12px;fill:var(--soft)}
.fig-svg text.acc{fill:var(--ogre)}
.fig figcaption{margin-top:6px;text-align:center;font-size:.85rem;color:var(--soft);line-height:1.4}
.fig-svg .tr.epais{stroke-width:4}
.fig-svg .tr.bg{fill:var(--card)}
.fig-svg .fla{fill:var(--ogre)}
.fig-svg .per{stroke:none;opacity:.85}
.fig-svg .per.p0{fill:color-mix(in srgb,var(--ogre) 45%,transparent)}
.fig-svg .per.p1{fill:color-mix(in srgb,#3B7BC8 45%,transparent)}
.fig-svg .per.p2{fill:color-mix(in srgb,#D9702A 45%,transparent)}
.fig-svg .per.p3{fill:color-mix(in srgb,#7B3FD1 45%,transparent)}
.fig-svg text.ev{font-weight:700;font-size:12px;fill:var(--ink)}
.fig-svg text{paint-order:stroke fill;stroke:var(--card);stroke-width:4px;stroke-linejoin:round}
.fig{background:var(--card)}
/* figure : bouton plein écran, frise large qui défile, vue plein écran */
.fig{position:relative}
.fig-zoom{position:absolute;top:6px;right:6px;z-index:1;width:34px;height:34px;border-radius:10px;border:0;display:grid;place-items:center;background:color-mix(in srgb,var(--ink) 7%,transparent);color:var(--soft);cursor:pointer}
.fig-zoom i{width:18px;height:18px}
.fig-svg{cursor:zoom-in}
.fig-defile{overflow-x:auto;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.fig-svg.large{width:var(--w);max-width:none}
.fig-plein{position:fixed;inset:0;z-index:1000;background:color-mix(in srgb,var(--bg,#000) 92%,transparent);display:flex;align-items:center;justify-content:center;padding:56px 12px 24px;touch-action:pinch-zoom}
.fig-plein-in{width:100%;max-height:100%;overflow:auto;background:var(--card);border-radius:20px;padding:14px;border:2px solid var(--line)}
.fig-plein .fig-svg{width:100%;max-width:none;cursor:default}
.fig-plein .fig-svg.large{width:max(100%,var(--w))}
.fig-plein figcaption{margin-top:8px;text-align:center;color:var(--soft)}
.fig-fermer{position:absolute;top:12px;right:12px;width:44px;height:44px;border-radius:14px;border:2px solid var(--line);background:var(--card);color:var(--ink);display:grid;place-items:center;cursor:pointer}
.fig-fermer i{width:22px;height:22px}
@media (orientation:landscape){.fig-plein{padding:12px 64px}}
.fig-svg .pg{fill:none;stroke:var(--ink);stroke-width:2;stroke-linejoin:round}.fig-svg .pg.acc{stroke:var(--ogre);fill:none}.fig-svg .pg.rem{fill:color-mix(in srgb,var(--ogre) 16%,transparent)}
.fig-zoom{top:auto;bottom:6px;right:6px}.fig figcaption{min-height:34px;padding:0 40px;display:flex;align-items:center;justify-content:center}

/* opérations posées (pose.js) : chiffres à chasse fixe, alignés, ligne du résultat, retenues et zéros ajoutés en couleur */
.pose{margin:6px 0 2px;padding:14px 10px 10px;border-radius:16px;background:var(--card);border:2px solid var(--line);display:flex;flex-direction:column;align-items:center;gap:8px;overflow-x:auto}
.pose-t{border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:1.25rem;font-weight:700;color:var(--ink);line-height:1.15}
.pose-t td{width:.72em;min-width:.72em;padding:1px 1px;text-align:center}
.pose-t td.pv{width:.3em;min-width:.3em;padding:0}
.pose-t td.op{width:1em;color:var(--soft);font-weight:800}
.pose-t td.ajout{color:var(--ogre)}
.pose-t td.ret{font-size:.7rem;color:var(--ogre);vertical-align:bottom}
.pose-t tr.r-ret td{padding-bottom:0}
.pose-t tr.r-der td{border-bottom:2.5px solid var(--ink);padding-bottom:3px}
.pose-t tr.r-der td.op{border-bottom-color:transparent}
.pose-t tr.r-res td{padding-top:4px;color:var(--ogre)}
.pose-t tr.r-res td.op{color:var(--soft)}
.pose-t td.abaisse{color:var(--ogre)}
.pose-t td.reste{color:var(--ogre)}
.pose-div{display:flex;align-items:flex-start}
.pose-g{border-right:2.5px solid var(--ink)}
.pose-q td{text-align:left;padding:1px 10px;width:auto;min-width:0}
.pose-q tr.r-div td{border-bottom:2.5px solid var(--ink)}
.pose-q td.quot{color:var(--ogre)}
.pose figcaption{text-align:center;font-size:.85rem;color:var(--soft);line-height:1.4}
.pose-t td.sous{border-bottom:2.5px solid var(--ink)}
.fig-svg .lab-fond{fill:var(--card);opacity:.9}

/* illustrations dessinées (sans texte) : numéros sur l'image, légende en dessous */
.illus{margin:6px 0 2px}
.illus-c{position:relative;display:block;width:100%;padding:0;border:1px solid var(--line);border-radius:14px;overflow:hidden;background:#fff;cursor:zoom-in}
.illus-c img{display:block;width:100%;height:auto}
.illus-n{position:absolute;transform:translate(-50%,-50%);min-width:24px;height:24px;padding:0 6px;border-radius:12px;background:#2F6B26;color:#fff;font-weight:800;font-size:13px;line-height:24px;text-align:center;box-shadow:0 0 0 2px #fff,0 2px 6px rgba(0,0,0,.35);pointer-events:none}
.illus-l{margin:10px 0 0;padding:0;list-style:none;counter-reset:il;display:grid;grid-template-columns:repeat(auto-fill,minmax(118px,1fr));gap:6px 14px}
.illus-l li{counter-increment:il;display:flex;gap:8px;align-items:center;font-size:.9rem;line-height:1.3}
.illus-l li::before{content:counter(il);flex:none;width:22px;height:22px;border-radius:11px;background:#2F6B26;color:#fff;font-weight:800;font-size:.75rem;display:grid;place-items:center}
.illus figcaption{margin-top:8px;text-align:center;font-size:.85rem;color:var(--soft);line-height:1.4}
.illus-plein{position:fixed;inset:0;z-index:1000;background:color-mix(in srgb,var(--bg,#000) 94%,transparent);overflow:auto;padding:max(64px,env(safe-area-inset-top)) 12px 16px}
.illus-plein-in{max-width:900px;margin:0 auto;background:var(--card);border-radius:20px;padding:14px}
.illus-plein .illus-c{cursor:default}

/* cellules et chromosomes (figure.js) : couleurs fixes, lisibles en clair comme en sombre */
.fig-svg .cel{fill:color-mix(in srgb,#F4C9A0 30%,var(--card));stroke:#C98A55;stroke-width:2}
.fig-svg .noy{fill:color-mix(in srgb,#B9A3E3 30%,var(--card));stroke:#8E73C9;stroke-width:1.6;stroke-dasharray:4 3}
.fig-svg .chr{stroke-linecap:round}
.fig-svg .chr-b{stroke-linecap:butt}
.fig-svg .chr-bleu{stroke:#4F86D9}.fig-svg .chr-rose{stroke:#E57BA6}.fig-svg .chr-violet{stroke:#8E5BD6}.fig-svg .chr-vert{stroke:#49A35B}
.fig-svg .chr-orange{stroke:#E8913A}.fig-svg .chr-gris{stroke:#9AA0A6}.fig-svg .chr-rouge{stroke:#D9534F}.fig-svg .chr-jaune{stroke:#E7B92E}.fig-svg .chr-blanc{stroke:#FFFFFF}
.fig-etapes{margin:10px 6px 2px;grid-template-columns:1fr}.fig-etapes li{align-items:flex-start;font-size:.92rem;line-height:1.4}.fig-etapes li::before{margin-top:1px}
.fig-svg .num circle{fill:#2F6B26;stroke:#fff;stroke-width:2}.fig-svg .num text{fill:#fff;font-weight:800;font-size:12px;stroke:none;paint-order:normal}
/* légende des couleurs d'une figure : pastille + texte */
.fig-cles{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px;margin:10px 4px 2px}
.fig-cle{display:inline-flex;align-items:center;gap:7px;font-size:.9rem;font-weight:700;color:var(--ink)}
.fig-cle .sw{flex:none;width:22px;height:10px;border-radius:5px}
.sw-bleu{background:#4F86D9}.sw-rose{background:#E57BA6}.sw-violet{background:#8E5BD6}.sw-vert{background:#49A35B}.sw-orange{background:#E8913A}.sw-gris{background:#9AA0A6}.sw-rouge{background:#D9534F}.sw-jaune{background:#E7B92E}.sw-blanc{background:#fff;box-shadow:inset 0 0 0 1.5px var(--line)}
