/* Solubility & Ksp - additions on top of the IMF "Toy Box" suite.css.
   Taste: "Charge colours" (direction A, 2026-11-17). Ions extend the suite's charge rule:
   cations rose (+), anions amber (−). Every ion also carries its symbol and charge glyph.
   Precipitates keep their real colours and are always drawn as faceted crystals, never spheres,
   so amber anions never read as yellow PbI₂. */

:root{
  --sol-cat:#f06a84;        /* cation fill (+) */
  --sol-cat-line:#b3263f;
  --sol-an:#ffd257;         /* anion fill (−): yellow */
  --sol-an-line:#b38a10;
  --sol-water:#e3f1fb;
  --sol-water-line:#7fb3d9;
  --sol-zone-lo:#e3f1fb;    /* Q vs Ksp gauge: Q < Ksp side (more can dissolve) */
  --sol-zone-hi:#fdeccf;    /* Q vs Ksp gauge: Q > Ksp side (a solid forms) */
  /* Real precipitate colours */
  --ppt-pbi2:#f6e39a;       /* yellow, paler than the I⁻ anion yellow so solid and dissolved never look alike (user, 2026-11-20; was #f2c230) */
  --ppt-ag2cro4:#a4452c;    /* red-brown */
  --ppt-white:#fbfbf8;      /* AgCl, SrSO₄, CaCO₃, Mg(OH)₂ (always with an ink outline) */
  --sol-solid:var(--ppt-pbi2);
  /* Acids and bases get their own colours site-wide (user, 2026-11-17): H⁺ / H₃O⁺ and OH⁻
     never use the plain cation / anion colours. "Indicator ends" (user pick, 2026-11-17):
     magenta acid, violet-blue base. The acids and bases unit reuses these. */
  --sol-acid:#c2347a; --sol-acid-line:#86164f;
  --sol-base:#5b5fd6; --sol-base-line:#3438a3;
  --sol-neutral:#e4ebf3; --sol-neutral-line:#7f8ea6;   /* neutral products such as H₂O */
}

/* ---------- Stub rooms (removed once a room is built) ---------- */
.sol-wrap{max-width:1320px;padding-top:1rem;}
.sol-stub{
  margin-top:1.4rem;padding:1.4rem 1.5rem;border:2px solid var(--ink);border-radius:var(--radius-lg);
  background:var(--tray);box-shadow:var(--key-drop);max-width:44rem;
}
.sol-stub h2{margin:0 0 0.5rem;font-size:1.3rem;}
.sol-stub p{margin:0 0 0.6rem;line-height:1.55;}
.sol-stub ul{margin:0.2rem 0 0;padding-left:1.2rem;line-height:1.6;}

/* ---------- Hub grid: three rooms across (one column on narrow screens) ---------- */
.sol-hub .path{grid-template-columns:repeat(3,minmax(0,1fr));}
.sol-hub .path .mod-title{font-size:1.6rem;}
@media (max-width:860px){.sol-hub .path{grid-template-columns:1fr;}}

/* ---------- Hub tile animations (same frame as the IMF hub: .mod-anim / .hub-anim in suite.css) ----------
   These always run (user preference, 2026-11-10: no reduced-motion still frames), so each animation is
   !important to win over suite.css's prefers-reduced-motion rule. Every loop restarts while hidden or at rest. */

/* Guide: AgCl(s) ⇌ Ag⁺ + Cl⁻. Ions leave the crystal and take their dissolved colours (forward arrow),
   then rejoin it and take the crystal's colour again (reverse arrow). Two dissolved ions drift the whole time. */
.anim-eq .eq-fwd{animation:eq-fwd 7s ease-in-out infinite !important;}
.anim-eq .eq-rev{animation:eq-rev 7s ease-in-out infinite !important;}
@keyframes eq-fwd{0%,4%{opacity:0.22}12%,38%{opacity:1}48%,100%{opacity:0.22}}
@keyframes eq-rev{0%,50%{opacity:0.22}60%,86%{opacity:1}96%,100%{opacity:0.22}}
.anim-eq .eq-m{animation:eq-m 7s ease-in-out infinite !important;}
@keyframes eq-m{0%,6%{transform:translate(0,0)}36%,56%{transform:translate(var(--x),var(--y))}88%,100%{transform:translate(0,0)}}
.anim-eq .eq-m.cat circle{animation:eq-cat 7s ease-in-out infinite !important;}
.anim-eq .eq-m.an circle{animation:eq-an 7s ease-in-out infinite !important;}
@keyframes eq-cat{0%,8%{fill:#fbfbf8;stroke:#1d2433}22%,74%{fill:#f06a84;stroke:#b3263f}86%,100%{fill:#fbfbf8;stroke:#1d2433}}
@keyframes eq-an{0%,8%{fill:#fbfbf8;stroke:#1d2433}22%,74%{fill:#ffd257;stroke:#b38a10}86%,100%{fill:#fbfbf8;stroke:#1d2433}}
.anim-eq .eq-bob{animation:eq-bob 3.4s ease-in-out infinite !important;}
.anim-eq .eq-bob.b2{animation:eq-bob 4.2s ease-in-out -1.4s infinite !important;}
@keyframes eq-bob{0%,100%{transform:translate(0,0)}50%{transform:translate(3px,-3px)}}

/* Sandbox: a scoop tips four grains of salt into water. Two dissolve into ions that stay in the water;
   two stay on the bottom, so the solution is saturated. The scene fades out and starts again. */
.anim-scoop .sc-all{animation:sc-all 9s linear infinite !important;}
@keyframes sc-all{0%{opacity:0}4%,90%{opacity:1}97%,100%{opacity:0}}
.anim-scoop .sc-scoop{transform-origin:186px 21px;animation:sc-scoop 9s ease-in-out infinite !important;}
@keyframes sc-scoop{
  0%,4%{transform:translate(30px,-14px) rotate(0deg);opacity:0}
  12%,16%{transform:translate(0,0) rotate(0deg);opacity:1}
  24%,28%{transform:translate(0,0) rotate(-14deg);opacity:1}
  38%,100%{transform:translate(30px,-14px) rotate(0deg);opacity:0}
}
.anim-scoop .sc-g{transform-box:fill-box;transform-origin:center;animation:sc-g 9s ease-in infinite !important;}
.anim-scoop .sc-g.melt{animation-name:sc-melt !important;}
@keyframes sc-g{
  0%,4%{transform:translate(30px,-14px) rotate(0deg) scale(1);opacity:0}
  12%,19%{transform:translate(0,0) rotate(0deg) scale(1);opacity:1}
  36%,100%{transform:translate(var(--x),var(--y)) rotate(var(--r)) scale(1);opacity:1}
}
@keyframes sc-melt{
  0%,4%{transform:translate(30px,-14px) rotate(0deg) scale(1);opacity:0}
  12%,19%{transform:translate(0,0) rotate(0deg) scale(1);opacity:1}
  36%,40%{transform:translate(var(--x),var(--y)) rotate(var(--r)) scale(1);opacity:1}
  58%,100%{transform:translate(var(--x),var(--y)) rotate(var(--r)) scale(0);opacity:0}
}
.anim-scoop .sc-i{animation:sc-i 9s ease-in-out infinite !important;}
@keyframes sc-i{
  0%,40%{transform:translate(0,0);opacity:0}
  46%{opacity:1}
  62%{transform:translate(var(--x),var(--y));opacity:1}
  74%{transform:translate(calc(var(--x) + 3px),calc(var(--y) - 3px));opacity:1}
  86%,100%{transform:translate(var(--x),var(--y));opacity:1}
}

/* Qual Lab: a drop forms on the dropper and falls in; a yellow solid clouds the liquid and settles into a pile.
   The used tube slides away and a clean one slides in (the solid never shrinks back). */
.anim-qual .ql-drop{transform-box:fill-box;transform-origin:50% 0%;animation:ql-drop 7s ease-in infinite !important;}
@keyframes ql-drop{
  0%{transform:translateY(0) scale(0);opacity:0}
  8%,14%{transform:translateY(0) scale(1);opacity:1}
  22%{transform:translateY(21px) scale(1);opacity:1}
  23%,100%{transform:translateY(21px) scale(1);opacity:0}
}
.anim-qual .ql-ripple{transform-box:fill-box;transform-origin:center;animation:ql-ripple 7s ease-out infinite !important;}
@keyframes ql-ripple{0%,22%{transform:scale(0.3);opacity:0}24%{transform:scale(0.5);opacity:1}36%,100%{transform:scale(2);opacity:0}}
.anim-qual .ql-s{animation:ql-s 7s ease-in infinite !important;}
@keyframes ql-s{
  0%,22%{transform:translateY(0);opacity:0}
  30%{transform:translateY(0);opacity:1}
  60%{transform:translateY(var(--d));opacity:1}
  68%,100%{transform:translateY(var(--d));opacity:0}
}
.anim-qual .ql-pile{transform-box:fill-box;transform-origin:50% 100%;animation:ql-pile 7s ease-out infinite !important;}
@keyframes ql-pile{0%,44%{transform:scaleY(0)}66%,86%{transform:scaleY(1)}87%,100%{transform:scaleY(0)}}
.anim-qual .ql-tube{animation:ql-tube 7s ease-in-out infinite !important;}
@keyframes ql-tube{0%,80%{transform:translateX(0);opacity:1}86%{transform:translateX(-40px);opacity:0}87%{transform:translateX(40px);opacity:0}96%,100%{transform:translateX(0);opacity:1}}

/* ---------- Shared components (assets/sol-ui.js) ---------- */
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;}
.num sup,.sol-read sup,.qk sup,.ws sup{font-size:0.68em;line-height:0;vertical-align:0.5em;}
.sol-read sub,.qk sub,.ws sub{font-size:0.7em;line-height:0;vertical-align:-0.25em;}
.num-unit{font-size:0.82em;font-weight:400;color:var(--dim);}

/* Readout panel: label left, value right, big tabular numbers that read from the back row */
.sol-read{margin:0;display:flex;flex-direction:column;}
.sol-read .rd-row{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:0.2rem 1rem;padding:0.5rem 0;border-bottom:1px solid var(--line);}
.sol-read .rd-row:last-child{border-bottom:0;}
.sol-read .rd-row[hidden]{display:none;}
.sol-read dt{font-weight:700;font-size:1.05rem;color:var(--ink-soft);white-space:nowrap;}
.sol-read dd{margin:0 0 0 auto;text-align:right;font-family:var(--font-mono);font-variant-numeric:tabular-nums;}
.sol-read .rd-val{display:block;font-size:1.25rem;font-weight:700;white-space:nowrap;}
.sol-read .rd-sub{display:block;font-size:0.9rem;color:var(--dim);white-space:nowrap;}
.sol-read .rd-sub:empty{display:none;}

/* Q vs Ksp check */
.qk{display:flex;flex-direction:column;gap:0.7rem;}
.qk-head{display:flex;align-items:center;justify-content:center;gap:0.55rem;font-family:var(--font-mono);font-weight:700;font-size:2rem;line-height:1;}
.qk-sym{display:inline-grid;place-items:center;width:1.5em;height:1.3em;border:2.5px solid var(--ink);border-radius:999px;background:#fff;font-size:0.95em;}
.qk-sym.lt{background:var(--sol-zone-lo);}
.qk-sym.gt{background:var(--sol-zone-hi);}
.qk-line{padding-top:1.9rem;}
.qk-track{position:relative;height:2.6rem;border:2px solid var(--ink);border-radius:10px;
  background:linear-gradient(90deg,var(--sol-zone-lo) 0 50%,var(--sol-zone-hi) 50% 100%);}
.qk-zone{position:absolute;top:50%;transform:translateY(-50%);font-size:1rem;font-weight:700;color:var(--ink-soft);pointer-events:none;}
.qk-zone.lo{left:0.7rem;}
.qk-zone.hi{right:0.7rem;}
.qk-ksp{position:absolute;left:50%;top:-7px;bottom:-7px;width:4px;margin-left:-2px;background:var(--ink);border-radius:2px;}
.qk-tick{position:absolute;bottom:0;width:2px;height:9px;margin-left:-1px;background:rgba(29,36,51,0.45);}
.qk-tick.mid{display:none;}
.qk-q{position:absolute;top:-1.95rem;bottom:-2px;width:0;display:flex;flex-direction:column;align-items:center;}
.qk-q b{font-family:var(--font-mono);font-size:1rem;white-space:nowrap;line-height:1;}
.qk-q::before{content:"";order:2;margin-top:3px;border:7px solid transparent;border-top:9px solid var(--ink);border-bottom:0;}
.qk-q::after{content:"";order:3;flex:1;width:3px;background:var(--ink);}
.qk-q.is-eq::after{background:var(--accent);}
.qk-scale{position:relative;height:1.4rem;margin-top:0.35rem;font-family:var(--font-mono);font-size:0.9rem;color:var(--dim);}
.qk-lab{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap;}
.qk-lab:first-child{transform:none;}
.qk-lab:last-child{transform:translateX(-100%);}
.qk-lab.mid{color:var(--ink);font-weight:700;}
.qk-eqn{display:flex;align-items:center;justify-content:center;gap:0.45rem;height:3rem;padding:0 0.6rem;border-radius:var(--radius);background:var(--field);
  font-weight:700;font-size:1.15rem;white-space:nowrap;}
.qk-eqn[hidden]{display:none;}
.qk-arrows{display:inline-flex;align-items:center;gap:2px;padding:0 4px;line-height:1;}
.qk-status{margin:0;font-weight:700;font-size:1.05rem;min-height:1.5em;}

/* Worked steps: one line per tap, lined up on "=", each reason under its line */
.ws-lines{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:max-content max-content minmax(0,1fr);
  column-gap:0.6rem;row-gap:0.2rem;font-size:1.3rem;}
.ws-line{display:grid;grid-template-columns:subgrid;grid-column:1 / -1;align-items:baseline;padding:0.4rem 0.7rem;border-radius:10px;}
.ws-line[hidden]{display:none;}
.ws-line.ws-ice{display:none;}
.ws-line.ws-ice .ws-lhs,.ws-line.ws-ice .ws-eq,.ws-line.ws-ice .ws-rhs{display:none;}
.ws-line.ws-ice .ws-note{grid-column:1 / -1;color:var(--ink);font-size:1.05rem;margin:0;}
.ws-lhs{text-align:right;font-weight:700;white-space:nowrap;}
.ws-eq{color:var(--dim);font-weight:700;}
.ws-rhs{font-weight:700;font-variant-numeric:tabular-nums;}
.ws-line.whole .ws-lhs{grid-column:1 / -1;text-align:left;white-space:normal;}
.ws-line.whole .ws-eq,.ws-line.whole .ws-rhs{display:none;}
.ws-note{grid-column:3;font-size:0.95rem;color:var(--dim);margin-top:0.15rem;}
.ws-line.whole .ws-note{grid-column:1 / -1;}
.ws-stack{display:flex;flex-direction:column;gap:0.25rem;} /* several short lines shown as one step */
/* unit analysis: numerator over denominator; cancelled units struck through */
.ua-frac{display:inline-flex;flex-direction:column;align-items:center;vertical-align:middle;margin:0.15em 0.1em;line-height:1.25;font-size:0.9em;}
.ua-num{padding:0 0.3em 0.12em;border-bottom:2px solid currentColor;white-space:nowrap;}
.ua-den{padding:0.12em 0.3em 0;white-space:nowrap;}
.ua-op{margin:0 0.1em;}
.ua-step{white-space:nowrap;}
.ua-x{text-decoration:line-through;text-decoration-color:var(--accent);text-decoration-thickness:2px;}
.ws-line.is-current{background:var(--accent-soft);box-shadow:inset 4px 0 0 var(--accent);}
.ws-line.is-current .ws-note{color:var(--ink-soft);}
/* ICE table above the worked steps: cells stay laid out but blank until their step */
.ice-wrap{margin:0 0 0.9rem;max-width:100%;overflow-x:auto;}
.ice{border-collapse:collapse;font-weight:700;font-variant-numeric:tabular-nums;font-size:1.25rem;}
.ice th,.ice td{padding:0.4rem 0.75rem;text-align:center;border-bottom:1.5px solid var(--line);white-space:nowrap;}
.ice thead th{border-bottom:2px solid var(--ink);}
.ice th.ice-unit{font-family:var(--font-mono);font-size:0.75rem;font-weight:400;color:var(--dim);text-align:left;padding-left:0.4rem;}
.ice .ice-key{text-align:left;padding-left:0.6rem;color:var(--ink);}
.ice .ice-op{padding:0.4rem 0.1rem;color:var(--dim);}
.ice .ice-solid,.ice .ice-dash{color:var(--dim);}
.ice .is-blank{color:transparent;}
.ice .is-blank>*{visibility:hidden;}
.ice tr.is-current>*{background:var(--accent-soft);}
.ice tr.is-current>:first-child{box-shadow:inset 4px 0 0 var(--accent);}
.ice tr.is-used>*{background:var(--accent-soft);}
.ice tr.is-used>:first-child{box-shadow:inset 4px 0 0 var(--accent);}
.ice-note{margin:0.45rem 0 0;font-size:0.95rem;color:var(--ink-soft);max-width:34rem;}
.ice-note[hidden]{display:none;}
body.learn-mode .sg-tools .ice{font-size:clamp(1.2rem,1.6vw,1.6rem);}
/* a fuller column (Common Ion Effect: check + ICE table + steps): a tighter table, so the steps box and its buttons fit at 1280 × 720 */
body.learn-mode .sg-tools.ice-tight .ice{font-size:clamp(1.1rem,1.35vw,1.35rem);}
body.learn-mode .sg-tools.ice-tight .ice th,body.learn-mode .sg-tools.ice-tight .ice td{padding-top:0.2rem;padding-bottom:0.2rem;}
body.learn-mode .sg-tools.ice-tight .ice-wrap{margin-bottom:0.5rem;}
body.learn-mode .sg-tools .ice-note{font-size:clamp(0.95rem,1.1vw,1.15rem);}
/* narrow tools column (portrait tablet): tighter cells so the whole table fits */
.ice-wrap{container-type:inline-size;}
@container (max-width:24rem){
  .ice,body.learn-mode .sg-tools .ice{font-size:1.05rem;}
  .ice th,.ice td{padding:0.35rem 0.4rem;}
  .ice .ice-op{padding:0.35rem 0;}
  .ice th.ice-unit{font-size:0.65rem;padding-left:0.2rem;}
}
/* mixing two solutions (Part 2): the full equation sits over the empty table, splits into ions, the spectators are
   crossed out, and the net ionic equation slides into the header, one ion over each column (SolUI mixTable) */
.mx-wrap{position:relative;}
.mx-flow{position:absolute;inset:0;display:flex;flex-wrap:wrap;align-content:flex-start;justify-content:center;gap:0.3rem 0.45rem;
  padding:0.25rem 0.4rem;font-weight:700;pointer-events:none;}
.mx-wrap .ice.mx{margin:0 auto;}
.mx-wrap.is-net .mx-flow{display:none;}
.mx-flow,.mx-ghost,.sg-tools .mx-wrap .ice.mx{font-size:1.2rem;}
body.learn-mode .sg-tools .mx-flow,body.learn-mode .sg-tools .mx-ghost,body.learn-mode .sg-tools .mx-wrap .ice.mx{font-size:clamp(1.1rem,1.45vw,1.45rem);}
.mx-tok{display:inline-block;white-space:nowrap;line-height:1.5;}
.mx-st{font-size:0.68em;font-weight:400;color:var(--ink-soft);margin-left:0.05em;}
.mx-op{color:var(--dim);}
.mx-tok.is-struck{position:relative;color:var(--dim);}
.mx-tok.is-struck::after{content:"";position:absolute;left:-0.1em;right:-0.1em;top:52%;height:3px;border-radius:2px;background:var(--accent);
  transform-origin:left center;animation:mx-strike 0.6s ease-out both;}
.mx-tok.mx-op.is-struck{opacity:0.35;transition:opacity 0.6s;}
.mx-tok.mx-op.is-struck::after{display:none;}
@keyframes mx-strike{from{transform:scaleX(0);}to{transform:scaleX(1);}}
.mx-wrap .mx-tok.mx-ghost{position:absolute;margin:0;pointer-events:none;font-weight:700;}
.mx th,.mx td{padding:0.35rem 0.5rem;transition:border-color 0.4s;}
.mx .ice-op{padding:0.35rem 0.1rem;}
.mx thead th{height:2.3em;}
.mx-wrap:not(.is-net) .mx th,.mx-wrap:not(.is-net) .mx td{border-color:transparent;}
.mx-wrap:not(.is-net) .mx .ice-key{color:transparent;}
/* in the Q lines, each ion's Cf in its own colour so the two brackets read as Pb²⁺ and I⁻ */
.mx-grp{display:inline-flex;align-items:center;border-radius:9px;padding:0 0.15em;}
.mx-grp.cat{background:color-mix(in srgb,var(--sol-cat) 22%,transparent);}
.mx-grp.an{background:color-mix(in srgb,var(--sol-an) 35%,transparent);}
@container (max-width:26rem){
  .mx-flow,.mx-ghost,.sg-tools .mx-wrap .ice.mx,body.learn-mode .sg-tools .mx-flow,body.learn-mode .sg-tools .mx-ghost,body.learn-mode .sg-tools .mx-wrap .ice.mx{font-size:1rem;}
  .mx th,.mx td{padding:0.3rem 0.3rem;}
}
.ws-bar{display:flex;align-items:center;gap:0.6rem;margin-top:0.9rem;flex-wrap:wrap;}
.ws-count{margin-left:auto;font-family:var(--font-mono);font-size:0.85rem;color:var(--dim);}
@media (max-width:700px){.ws-lines{font-size:1.1rem;}}
@media (max-width:560px){
  .qk-lab.d2{display:none;}
  .qk-zone{font-size:0.85rem;}
  .qk-eqn{font-size:1rem;}
  .ws-lines{font-size:1rem;column-gap:0.4rem;}
  .ws-line{padding:0.35rem 0.5rem;}
  .ws-rhs{overflow-wrap:anywhere;}
}
.qk-cat,.qk-an{padding:0.05em 0.3em;border-radius:7px;border:1.5px solid var(--sol-cat-line);background:var(--sol-cat);}
.qk-an{border-color:var(--sol-an-line);background:var(--sol-an);}
.qk-base,.qk-acid{padding:0.05em 0.3em;border-radius:7px;border:1.5px solid var(--sol-base-line);background:var(--sol-base);color:#fff;}
.qk-acid{border-color:var(--sol-acid-line);background:var(--sol-acid);}
.btn.btn-sm{padding:0.3rem 0.7rem;font-size:0.85rem;min-height:0;box-shadow:0 2px 0 var(--ink);}
.btn.btn-sm:active{transform:translateY(2px);box-shadow:0 0 0 var(--ink);}
/* Next step: same size as Back and Show all (user, 2026-11-19: it was cut off at the bottom of the screen) */
.ws-bar .btn.ws-next{padding:0.3rem 0.8rem;font-size:0.85rem;min-height:0;box-shadow:0 2px 0 var(--ink);}
.ws-bar .btn.ws-next:active{transform:translateY(2px);box-shadow:0 0 0 var(--ink);}
.btn:disabled{opacity:0.45;cursor:default;}

/* Predict-then-reveal chips (SolUI.chip): nothing saved or scored */
.chip-card{border:2px solid var(--line-strong);border-radius:var(--radius);background:var(--tray);padding:0.8rem 0.9rem;}
.chip-card + .chip-card{margin-top:0.7rem;}
.chip-title{margin:0 0 0.3rem;font-weight:700;font-size:1.1rem;}
.chip-prompt{margin:0 0 0.6rem;font-size:1rem;line-height:1.45;color:var(--ink-soft);}
.chip-opts{display:flex;flex-wrap:wrap;gap:0.45rem;}
.chip-opt{font-size:0.95rem;padding:0.4rem 0.8rem;}
.chip-opt[aria-pressed="true"]{background:var(--ink);color:#fff;transform:translateY(3px);box-shadow:0 0 0 var(--ink);}
.chip-card.is-revealed .chip-opt{cursor:default;}
.chip-opt.is-right{background:#dff3e8;color:var(--ink);box-shadow:0 3px 0 var(--ink);transform:none;}
.chip-opt.is-right::after{content:" ✓";font-weight:700;}
.chip-opt.is-wrong{background:var(--field-2);color:var(--ink);text-decoration:line-through;transform:none;box-shadow:0 3px 0 var(--ink);}
.chip-foot{display:flex;justify-content:flex-end;margin-top:0.55rem;}
.chip-out{margin:0.5rem 0 0;font-size:0.98rem;line-height:1.45;color:var(--ink);}
.chip-out:empty{display:none;}
.chip-foot[hidden]{display:none;}
/* instant chips (Solubility rules): the card itself shows right or wrong */
.chip-card.is-correct{background:#dff3e8;border-color:#2f9e63;}
.chip-card.is-incorrect{background:#fde3e3;border-color:#d14545;}
.chip-card.is-correct .chip-opt.is-right,.chip-card.is-incorrect .chip-opt.is-right{background:#fff;}
.chip-card.compact{padding:0.55rem 0.65rem;}
.chip-card.compact .chip-title{font-size:1.15rem;margin-bottom:0.35rem;}
.chip-card.compact .chip-opt{font-size:0.82rem;padding:0.3rem 0.55rem;}
.chip-card.compact .chip-foot{margin-top:0.4rem;}
.chip-card.compact .chip-out{font-size:0.88rem;}

/* ---------- Guide (guide.html): sticky stage beside the text; presentation view fills the screen ---------- */
/* Each Part is two blocks: Before you begin across the full width, then the Part's sections with the stage
   sticky beside them. guide.js moves the one stage into the active Part's dock (or to the top of the page
   on narrow screens), so it is already there when the sections scroll in. */
.sol-guide .guide-layout{display:block;}
.stage-dock-top{position:relative;z-index:5;}
@media (min-width:861px){
  body:not(.learn-mode) .part-body{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);gap:0 1.8rem;align-items:stretch;}
  body:not(.learn-mode) .part-body .stage-dock{padding:1.4rem 0 1.4rem;}
  .sol-guide .brief-beat .brief-cols{grid-template-columns:repeat(2,minmax(0,1fr));gap:1.6rem;max-width:none;}
}
.sol-guide .guide-beat p,.sol-guide .beat-drivers{max-width:36rem;}
/* top of the page: the four Parts only; each section then carries its own Part's list */
.part-picker{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0.8rem;margin-bottom:2rem;}
.part-picker a{
  display:flex;flex-direction:column;gap:0.3rem;padding:0.85rem 1rem 0.95rem;
  font-family:var(--font-body);font-size:1rem;color:var(--ink);text-decoration:none;
  background:var(--tray);border:2px solid var(--line-strong);border-radius:var(--radius);box-shadow:var(--key-drop);
}
.part-picker a:hover{background:var(--accent-soft);color:var(--ink);}
.part-picker a:active{transform:translateY(3px);box-shadow:0 0 0 var(--ink);}
.pp-title{font-weight:700;line-height:1.25;}
.pp-teaser{font-size:0.88rem;color:var(--ink-soft);line-height:1.4;}
@media (max-width:1100px){ .part-picker{grid-template-columns:repeat(2,minmax(0,1fr));} }

.part-nav{list-style:none;display:flex;flex-wrap:wrap;gap:0.35rem;margin:0 0 1.2rem;padding:0;}
.part-nav a{
  display:inline-block;font-size:0.82rem;font-weight:700;line-height:1.2;text-decoration:none;
  color:var(--ink-soft);padding:0.3rem 0.65rem;border:1.5px solid var(--line-strong);border-radius:999px;background:var(--tray);
}
.part-nav a:hover{color:var(--ink);background:var(--accent-soft);}
.part-nav a:focus-visible{outline:3px solid var(--accent);outline-offset:2px;}

/* the two blocks of each Part alternate white and lavender, with a bold border; sections inside keep thin rules */
body:not(.learn-mode) .sol-guide .brief-beat,
body:not(.learn-mode) .sol-guide .part-body{
  background:var(--tray);border:2px solid var(--line-strong);border-radius:var(--radius-lg);box-shadow:0 4px 0 var(--ink);
}
body:not(.learn-mode) .sol-guide .brief-beat{min-height:0;padding:1.5rem 1.6rem 1.7rem;margin-bottom:1.2rem;scroll-margin-top:1rem;}
body:not(.learn-mode) .sol-guide .part-body{padding:0 1.6rem;}
body:not(.learn-mode) .sol-guide .guide-part:nth-child(even) .brief-beat,
body:not(.learn-mode) .sol-guide .guide-part:nth-child(even) .part-body{background:#eceffd;}
.sol-guide .guide-part:nth-child(even) .beat-drivers li{border-left-color:#c3c9f2;}
.sol-guide .guide-part + .guide-part{margin-top:3rem;}
.sol-guide .part-beats .guide-beat:first-child{padding-top:1.6rem;}
.sol-guide .part-beats .guide-beat:last-child{padding-bottom:2rem;}
/* wide screens: a Part's last section is at least a screen tall, so the sticky stage stays beside it while it is
   read (a short last section let the Part's box end and carried the stage away too soon) */
@media (min-width:861px){
  body:not(.learn-mode) .sol-guide .part-beats .guide-beat:last-child{min-height:calc(100vh - 2rem);}
}
/* each Part opens with its own Before you begin */
.brief-beat h2{margin-bottom:0.4rem;}
.brief-lead{font-size:1.05rem;}
.brief-cols{display:grid;grid-template-columns:1fr;gap:1rem;margin-top:0.9rem;max-width:40rem;}
.brief-block{border-left:4px solid var(--accent);padding:0.1rem 0 0.1rem 1rem;}
.brief-block.cc{border-left-color:var(--ink);}
.brief-block h3{font-size:1rem;margin:0 0 0.35rem;}
.brief-block ul{margin:0;padding-left:1.1rem;}
.brief-block li{margin:0.35rem 0;color:var(--ink-soft);line-height:1.45;}
.brief-block li strong{color:var(--ink);}
.ksp-chain{display:flex;flex-wrap:wrap;align-items:center;gap:0.35rem 0.5rem;margin:0.9rem 0 1rem;font-weight:700;}
.ksp-chain .node{padding:0.3rem 0.6rem;border:2px solid var(--ink);border-radius:10px;background:var(--tray);}
.ksp-chain .how{font-family:var(--font-mono);font-size:0.75rem;font-weight:400;color:var(--dim);display:flex;flex-direction:column;align-items:center;line-height:1.2;}
.ksp-chain .how b{font-size:1.1rem;color:var(--ink);}

/* the stage */
.sol-stage{max-height:calc(100vh - 2rem);overflow:auto;padding:0.9rem 1rem 1rem;}
.sg-grid{display:flex;flex-direction:column;gap:0.8rem;}
.sg-visual{display:flex;flex-direction:column;gap:0.6rem;min-height:0;}
.sg-canvas{position:relative;width:100%;aspect-ratio:900 / 530;}
.sg-canvas canvas{position:absolute;inset:0;width:100%;height:100%;display:block;cursor:pointer;}
.sg-canvas[hidden],.sg-html[hidden],.sg-tabs[hidden],.sg-buttons[hidden]{display:none;}
.sg-tabs{display:flex;gap:0.4rem;flex-wrap:wrap;}
.sg-tabs .btn{font-size:0.9rem;padding:0.35rem 0.8rem;}
.sg-tabs .btn[aria-pressed="true"]{background:var(--ink);color:#fff;transform:translateY(3px);box-shadow:0 0 0 var(--ink);}
.sg-buttons{display:flex;flex-wrap:wrap;gap:0.5rem;}
/* a table under the picture (3.2's original vs new), so the tools column keeps its height for the check and the ICE table */
.sg-ro-under{flex:none;}
/* 3.2 Common Ion Effect: original vs new under the picture. Blue = the saturated solution as it started, red = now;
   each row is named, so the colour is never the only cue (user, 2026-11-20) */
.ro-compare{width:100%;border-collapse:separate;border-spacing:0 4px;font-variant-numeric:tabular-nums;}
.ro-compare thead th{font-size:0.9rem;font-weight:700;color:var(--ink-soft);text-align:left;padding:0 0.55rem;vertical-align:bottom;white-space:nowrap;}
.ro-compare thead th small{display:block;font-family:var(--font-mono);font-weight:400;font-size:0.72rem;color:var(--dim);}
.ro-compare tbody th{font-size:0.88rem;font-weight:700;text-align:left;padding:0.4rem 0.6rem 0.4rem 0.75rem;line-height:1.15;border-radius:10px 0 0 10px;}
.ro-compare td{font-family:var(--font-mono);font-weight:700;font-size:clamp(0.85rem,1.1vw,1.05rem);padding:0.4rem 0.55rem;white-space:nowrap;}
.ro-compare td:last-child{border-radius:0 10px 10px 0;}
.ro-compare .rc-old>*{background:#e3effc;}
.ro-compare .rc-old th{color:#1d4f86;box-shadow:inset 5px 0 0 #2f6fb5;}
.ro-compare .rc-new>*{background:#fde5e5;}
.ro-compare .rc-new th{color:#9b1f28;box-shadow:inset 5px 0 0 #c8323c;}
/* 3.2: the live ICE table and solved Ksp in the tools column; the I row's added ion in the accent colour */
.live-ice{flex:none;display:flex;flex-direction:column;}
.live-ice .ice td.ice-added{color:var(--accent);}
/* presentation view: the solved lines a size smaller than worked steps, so the check, table and lines fit at 1280 × 720 */
body.learn-mode .sg-tools .live-ice .ws-lines{font-size:clamp(1.05rem,1.35vw,1.35rem);}
body.learn-mode .sg-tools .live-ice .ws-line{padding-top:0.25rem;padding-bottom:0.25rem;}
.sg-tools{display:flex;flex-direction:column;gap:0.8rem;min-width:0;}
.sg-tools:empty{display:none;}
.sg-tools .is-marked{outline:3px dashed var(--accent);outline-offset:4px;border-radius:8px;}
.sg-hint{font-family:var(--font-mono);font-size:0.75rem;color:var(--dim);margin:0;}
.sg-link{font-weight:700;}
.sg-tools .ws-lines{font-size:1.15rem;}

/* stage pictures made of HTML: Before you begin, the rules table, observation cards */
.sg-brief{display:grid;grid-template-columns:minmax(0,1fr);gap:0.8rem;align-items:center;}
.sg-brief-pic{position:relative;height:200px;}
.sg-brief-pic svg.hub-anim{position:absolute;inset:0;width:100%;height:100%;}
body.learn-mode .sg-brief-pic{height:min(46vh,420px);}
.sg-brief .sg-brief-list{margin:0;padding-left:1.2rem;font-weight:700;line-height:1.7;}
.sg-brief .learn-only{display:none;}
.rules-find{margin:0 0 0.2rem;font-size:1.2rem;font-weight:700;}
/* columns follow the stage's own width, not the window: four across a wide stage, two when the stage sits
   beside the text (a half-width window), one if it is very narrow */
.rules-wrap{container-type:inline-size;}
.rules-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.7rem;margin-top:0.9rem;align-items:start;}
@container (min-width:52rem){.rules-chips{grid-template-columns:repeat(4,minmax(0,1fr));}}
@container (max-width:20rem){.rules-chips{grid-template-columns:minmax(0,1fr);}}
.rules-chips .chip-card{min-width:0;}
.rules-chips .chip-title{overflow-wrap:anywhere;}
.chip-title sub{line-height:0;} /* a subscript doesn't make its card's title row taller */
.rules-chips .chip-card + .chip-card{margin-top:0;}
.notice-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0.7rem;}
.notice-card{border:2px solid var(--line-strong);border-radius:var(--radius);padding:0.8rem;background:var(--tray);}
.notice-card h3{margin:0 0 0.35rem;font-size:1.05rem;}
.notice-card p{margin:0;color:var(--ink-soft);font-size:0.95rem;line-height:1.45;}
.notice-ask{margin:0.8rem 0 0;font-weight:700;font-size:1.1rem;text-align:center;}

@media (max-width:1100px){
  .notice-cards{grid-template-columns:1fr;}
}
@media (max-width:860px){
  .stage-dock-top{margin-bottom:1.6rem;}
  .sol-stage{max-height:none;overflow:visible;}
  body:not(.learn-mode) .sol-guide .brief-beat{padding:1.1rem 1.1rem 1.3rem;}
  body:not(.learn-mode) .sol-guide .part-body{padding:0 1.1rem;}
}
/* presentation view: the text is hidden, so the Parts lose their spacing */
body.learn-mode .sol-guide .guide-part + .guide-part{margin-top:0;}
body.learn-mode .sol-guide .part-nav{display:none;}

/* presentation view: text hidden, the stage fills the screen; picture on the left, tools on the right */
body.learn-mode .sol-stage{max-height:none;bottom:0.75rem;overflow:hidden;display:flex;flex-direction:column;}
body.learn-mode .sol-stage .guide-stage-head{display:flex;margin-bottom:0.4rem;}
body.learn-mode .sol-stage .force-badge{font-size:1.05rem;}
body.learn-mode .sg-grid{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:1.2rem;}
body.learn-mode .sg-grid.no-tools{grid-template-columns:minmax(0,1fr);}
body.learn-mode .sg-canvas{aspect-ratio:auto;flex:1;min-height:0;}
body.learn-mode .sg-tools{overflow:auto;padding-right:0.3rem;}
/* the column sits in the middle of the stage, not at the top (user, 2026-11-19). Spacers, not justify-content,
   so a column taller than the stage still scrolls from its top */
body.learn-mode .sg-tools::before,body.learn-mode .sg-tools::after{content:"";flex:1 1 0;min-height:0;}
/* the spacers add no gap of their own, so a full column gets that space back (user, 2026-11-20) */
body.learn-mode .sg-tools::before{margin-bottom:-0.8rem;}
body.learn-mode .sg-tools::after{margin-top:-0.8rem;}
body.learn-mode .sg-tools .ws-lines{font-size:clamp(1.15rem,1.6vw,1.6rem);}
body.learn-mode .sg-tools .ws-note{font-size:clamp(0.95rem,1.1vw,1.15rem);}
/* presentation view: the worked steps sit in a box as tall and as wide as all its lines (guide.js sizeStepsBox
   measures it with every line shown), centred in the column with the buttons lined up under it. So the buttons never
   move when a step is added, and there is no empty box to spare (user, 2026-11-19). It shrinks and scrolls if the
   stage is shorter; the newest line scrolls into view */
body.learn-mode .sg-tools .sg-steps{flex:0 1 auto;min-height:0;display:flex;flex-direction:column;}
body.learn-mode .sg-tools .ws{flex:0 1 auto;min-height:0;display:flex;flex-direction:column;align-items:center;}
body.learn-mode .sg-tools .ice-wrap{flex:none;align-self:stretch;}
body.learn-mode .sg-tools .ice{margin:0 auto;}
body.learn-mode .sg-tools .ws-lines{flex:0 1 auto;min-height:5rem;overflow:auto;position:relative;align-content:start;
  width:fit-content;min-width:min(100%,22rem);max-width:100%;
  background:#f6f8fc;border:2px solid var(--line);border-radius:14px;padding:0.45rem 0.6rem;}
body.learn-mode .sg-tools .ws-lines.is-empty{align-content:center;}
body.learn-mode .sg-tools .ws-lines.is-empty::before{content:"Each step appears here as we go.";grid-column:1 / -1;justify-self:center;
  font-size:1rem;font-weight:400;color:var(--dim);}
body.learn-mode .sg-tools .ws-bar{flex:none;margin-top:0.6rem;align-self:center;max-width:100%;}
/* the ICE notes become lines in the box (the table keeps one height), and the readout that waits for the last
   step shows at the end of the box rather than pushing the buttons */
body.learn-mode .sg-tools .ice-note{display:none;}
/* presentation view shows the numbers only (user, 2026-11-19: "I will do the explaining in class"): no reason under
   each line, and the note-only steps (ICE rows, the mixing table) show in the table, not as a line. The scrolling
   view keeps every explanation: under each line, and under the table for the note-only steps */
body.learn-mode .sg-tools .ws-note{display:none;}
/* …except the Ksp sections, which keep their explanations (user, 2026-11-19): preset notes: true */
body.learn-mode .sg-tools.show-notes .ws-note{display:block;}
body.learn-mode .sg-tools.show-notes .ws-line.ws-ice:not([hidden]){display:grid;}
body.learn-mode .sg-tools .ws-ro{grid-column:1 / -1;list-style:none;padding:0.6rem 0.7rem 0.2rem;}
body.learn-mode .sg-tools .chip-prompt,body.learn-mode .sg-tools .chip-out{font-size:1.1rem;}
body.learn-mode .sg-html{flex:1;min-height:0;overflow:auto;}
body.learn-mode .sg-brief{grid-template-columns:minmax(0,0.8fr) minmax(0,1.2fr);height:100%;}
body.learn-mode .sg-brief .learn-only{display:block;}
body.learn-mode .sg-brief .scroll-only{display:none;}
body.learn-mode .sg-brief .brief-block li{font-size:clamp(0.95rem,1.25vw,1.25rem);margin:0.25rem 0;}
body.learn-mode .sg-brief .brief-cols{gap:0.7rem;margin-top:0.4rem;}
body.learn-mode .sg-brief .learn-only{overflow:auto;max-height:100%;}
body.learn-mode .sg-brief h2{font-size:clamp(1.6rem,2.6vw,2.4rem);margin:0 0 0.8rem;}
body.learn-mode .rules-find{font-size:1.5rem;}
/* presentation view: the cards fill the stage (4 × 3) and the formulas are big enough to read across a room */
body.learn-mode .rules-wrap{display:flex;flex-direction:column;height:100%;}
body.learn-mode .rules-chips{flex:1;grid-auto-rows:1fr;align-items:stretch;gap:0.7rem;margin-top:0.7rem;}
body.learn-mode .rules-chips .chip-card{position:relative;display:flex;flex-wrap:wrap;align-content:center;align-items:center;gap:0.4rem 0.6rem;padding:0.5rem 0.9rem;}
body.learn-mode .rules-chips .chip-title{flex-basis:100%;font-size:clamp(1.6rem,2.9vw,2.9rem);line-height:1.1;margin:0;}
body.learn-mode .rules-chips .chip-opts{flex-wrap:nowrap;gap:0.4rem;}
body.learn-mode .rules-chips .chip-opt{font-size:clamp(0.82rem,1.05vw,1.1rem);padding:0.35rem 0.6rem;white-space:nowrap;}
/* answered: Try again becomes a small ↺ in the corner (its name stays "Try again") and the reason goes underneath,
   so a card keeps its size and all three rows stay on screen */
body.learn-mode .rules-chips .chip-foot{position:absolute;top:0.5rem;right:0.5rem;margin:0;}
body.learn-mode .rules-chips .chip-reveal{font-size:0;padding:0.2rem 0.5rem;line-height:1;}
body.learn-mode .rules-chips .chip-reveal::after{content:"↺";font-size:1.15rem;}
body.learn-mode .rules-chips .chip-out{flex-basis:100%;font-size:clamp(0.8rem,0.92vw,0.95rem);line-height:1.3;margin:0;}
body.learn-mode .rules-chips .chip-out:empty{display:none;}
body.learn-mode .notice-card h3{font-size:1.4rem;}
body.learn-mode .notice-card p{font-size:1.2rem;}
body.learn-mode .notice-ask{font-size:1.5rem;}
.qk-q.qk-ghost b{color:var(--dim);font-weight:700;font-size:0.85rem;}
.qk-q.qk-ghost::before{border-top-color:var(--dim);}
.qk-q.qk-ghost::after{background:repeating-linear-gradient(var(--dim) 0 4px,transparent 4px 7px);}
.qk-q[hidden]{display:none;}
.qk-q.at-start b{transform:translateX(calc(50% - 4px));}
.qk-q.at-end b{transform:translateX(calc(-50% + 4px));}

/* ---------- Part 3: absolute Q vs Ksp scale (temperature), stress buttons, temperature table ---------- */
.qk-abs .qk-zone{transform:translate(-50%,-50%);white-space:nowrap;}
.qk-abs .qk-zone[hidden]{display:none;}
.qk-abs .qk-ksp{margin-left:-2px;}
.qk-ksplab{position:absolute;top:calc(100% + 0.45rem);transform:translateX(-50%);font-family:var(--font-mono);font-size:0.9rem;font-weight:700;color:var(--ink);white-space:nowrap;}
.qk-abs .qk-scale{height:1.5rem;}
.sg-buttons .btn small{display:block;font-family:var(--font-mono);font-size:0.68rem;font-weight:400;color:var(--dim);line-height:1.1;}
.sg-temp{display:flex;align-items:center;gap:0.75rem;flex:1 1 16rem;min-width:0;font-weight:700;}
.sg-temp input{flex:1;min-width:6rem;accent-color:var(--ink);}
.sg-temp output{font-family:var(--font-mono);min-width:4.5rem;}
.temp-table{width:100%;border-collapse:collapse;font-size:0.95rem;}
.temp-table caption{text-align:left;font-weight:700;padding-bottom:0.35rem;}
.temp-table th,.temp-table td{padding:0.35rem 0.5rem;border-bottom:1px solid var(--line);text-align:left;white-space:nowrap;}
.temp-table td{font-family:var(--font-mono);}
.temp-table tr.is-hot td,.temp-table tr.is-hot th{background:var(--sol-zone-hi);}
.pred-chips{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.55rem;}
.pred-chips .chip-card + .chip-card{margin-top:0;}
.pred-chips .chip-card.is-hot{outline:3px solid var(--accent);outline-offset:1px;}
.pred-chips .chip-foot{gap:0.4rem;}
.pred-chips .chip-run[hidden]{display:none;}
@media (max-width:520px){.pred-chips{grid-template-columns:1fr;}}
.beat-eqn{font-family:var(--font-mono);font-weight:700;font-size:1.1rem;text-align:center;}
@media (max-width:520px){.sg-temp{flex-basis:100%;}}

/* ---------- Part 4: fixed checks, careers ---------- */
.fixed-checks{display:grid;gap:1rem;}
.sg-note{margin:0;font-size:0.95rem;color:var(--ink-soft);}
.career-tiles{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.9rem;}
.career-tile{padding:1rem 1.1rem;border:2px solid var(--ink);border-radius:var(--radius);background:#fff;box-shadow:0 4px 0 var(--ink);}
.career-tile svg{display:block;margin-bottom:0.4rem;}
.career-tile h3{margin:0 0 0.35rem;font-size:1.2rem;}
.career-tile p{margin:0;}
.career-tile .career-ask{margin-top:0.6rem;font-family:var(--font-mono);font-size:0.8rem;color:var(--dim);}
@media (max-width:520px){.career-tiles{grid-template-columns:1fr;}}

/* ---------- Sandbox ---------- */
.sbx{margin-top:1rem;}
.sbx-modes,.sbx-salts,.sbx-row{display:flex;flex-wrap:wrap;gap:0.5rem;align-items:center;}
.sbx-modes{margin-bottom:0.9rem;}
.sbx-modes .btn[aria-pressed="true"],.sbx-salts .btn[aria-pressed="true"],.ql-picks .btn[aria-pressed="true"]{background:var(--ink);color:#fff;transform:translateY(3px);box-shadow:0 0 0 var(--ink);}
.sbx-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(0,1fr);gap:1.2rem;align-items:start;}
.sbx-main,.sbx-side{border:2px solid var(--ink);border-radius:var(--radius-lg);background:var(--tray);padding:1rem;box-shadow:var(--key-drop);}
.sbx-main{display:flex;flex-direction:column;gap:0.8rem;}
.sbx-side{display:flex;flex-direction:column;gap:1.2rem;position:sticky;top:1rem;}
.sbx-canvas{position:relative;width:100%;aspect-ratio:900 / 530;}
.sbx-canvas canvas{position:absolute;inset:0;width:100%;height:100%;cursor:pointer;}
.sbx-hint{margin:-0.4rem 0 0;font-family:var(--font-mono);font-size:0.75rem;color:var(--dim);}
.sbx-controls{display:flex;flex-direction:column;gap:0.7rem;}
.sbx-controls[hidden]{display:none;}
.sbx-note{margin:0;font-size:0.9rem;color:var(--dim);}
.sbx-mix{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0.8rem;}
.sbx-sol{border:2px solid var(--line-strong);border-radius:var(--radius);padding:0.6rem 0.8rem 0.8rem;margin:0;display:flex;flex-direction:column;gap:0.5rem;min-width:0;}
.sbx-sol legend{font-weight:700;padding:0 0.3rem;}
.sbx-sol label{display:grid;grid-template-columns:6.8rem minmax(0,1fr) 7.2rem;align-items:center;gap:0.5rem;font-size:0.92rem;}
.sbx-sol input{width:100%;accent-color:var(--ink);}
.sbx-sol output{font-size:0.95rem;font-weight:700;text-align:right;white-space:nowrap;}
.sbx-dim{font-weight:400;color:var(--dim);font-size:0.85em;}
.sg-temp input:disabled{opacity:0.4;}
@media (max-width:900px){.sbx-grid{grid-template-columns:1fr;}.sbx-side{position:static;}}
@media (max-width:620px){.sbx-mix{grid-template-columns:1fr;}.sbx-sol label{grid-template-columns:1fr auto;}.sbx-sol label input{grid-column:1 / -1;grid-row:2;}}

/* ---------- Qual Lab ---------- */
.ql{margin-top:1rem;}
.ql-top{display:flex;flex-wrap:wrap;gap:0.8rem 1.2rem;align-items:center;justify-content:space-between;margin-bottom:1rem;}
.ql-lead{margin:0;max-width:52rem;font-size:1.05rem;line-height:1.5;}
.ql-grid{display:grid;grid-template-columns:minmax(15rem,0.8fr) minmax(0,1.4fr) minmax(16rem,1fr);gap:1.1rem;align-items:start;}
.ql-scheme,.ql-bench,.ql-book{border:2px solid var(--ink);border-radius:var(--radius-lg);background:var(--tray);padding:1rem;box-shadow:var(--key-drop);}
.ql-scheme h2,.ql-book h2{margin:0 0 0.7rem;font-size:1.2rem;}
.ql-scheme ol{list-style:none;margin:0;padding:0;}
.ql-node{border:2px solid var(--line-strong);border-radius:var(--radius);padding:0.7rem 0.8rem;background:#fff;}
.ql-node h3{margin:0 0 0.3rem;font-size:1.1rem;}
.ql-node .ql-branch{margin:0 0 0.4rem;font-size:0.9rem;color:var(--ink-soft);}
.ql-node.is-current{border-color:var(--accent);border-width:3px;background:#eef0ff;}
.ql-node.is-done{opacity:0.7;}
.ql-node .sbx-row{margin-top:0.4rem;}
.ql-ask{margin:0.3rem 0 0;font-weight:700;}
.ql-try{margin:0.4rem 0 0;font-size:0.92rem;color:var(--ink-soft);}
.ql-arrow{text-align:left;padding-left:1.2rem;font-weight:700;font-size:1.2rem;line-height:1.6;}
.ql-bench{display:flex;flex-direction:column;gap:0.8rem;}
.ql-canvas{position:relative;width:100%;aspect-ratio:600 / 530;max-height:62vh;}
.ql-canvas canvas{position:absolute;inset:0;width:100%;height:100%;}
.ql-obs{margin:0;font-weight:700;font-size:1.05rem;min-height:1.5em;}
.ql-numbers summary{cursor:pointer;font-weight:700;}
.ql-numbers[hidden]{display:none;}
.ql-numbers #checks{display:grid;gap:1rem;margin-top:0.8rem;}
.ql-qline{margin:0 0 0.3rem;font-size:0.95rem;}
.ql-table{width:100%;border-collapse:collapse;font-size:0.95rem;}
.ql-table th,.ql-table td{text-align:left;padding:0.45rem 0.4rem;border-bottom:1px solid var(--line);vertical-align:top;}
.ql-table thead th{font-size:0.85rem;color:var(--dim);}
.ql-empty td{color:var(--dim);font-style:italic;}
.ql-final{margin-top:1.1rem;display:flex;flex-direction:column;gap:0.6rem;}
.ql-final[hidden]{display:none;}
.ql-final h3{margin:0;font-size:1.1rem;}
.ql-picks{display:flex;flex-wrap:wrap;gap:0.5rem;}
.ql-result{margin:0;line-height:1.5;}
@media (max-width:1100px){.ql-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);}.ql-book{grid-column:1 / -1;}}
@media (max-width:720px){.ql-grid{grid-template-columns:1fr;}.ql-bench{order:-1;}}
