:root{--wine:var(--maroon);--blue:#1971c2;--green:#18794e}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}.lab{max-width:1000px;margin:auto;padding:20px 16px 60px}.lab-grid{display:grid;grid-template-columns:minmax(320px,1.35fr) minmax(250px,.65fr);gap:16px}.panel{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:16px}.panel h2{font-size:1rem;margin-top:0}canvas{display:block;width:100%;height:auto;border-radius:9px;background:var(--card)}label{display:block;font-weight:700;margin:10px 0 4px}input,select,button,textarea{font:inherit;min-height:44px;max-width:100%}input,select,textarea{width:100%;padding:8px;border:1px solid #aaa;border-radius:8px}.row{display:flex;gap:8px;align-items:end;flex-wrap:wrap}.row>*{flex:1}.btn{border:0;border-radius:9px;padding:9px 14px;background:var(--wine);color:#fff;font-weight:700;cursor:pointer}.btn.alt{background:transparent;color:var(--maroon-text);border:1px solid var(--wine)}.readout{line-height:1.55}.muted{color:var(--muted)}.formula{font:700 1.15rem ui-monospace,monospace;color:var(--maroon-text);overflow-wrap:anywhere}.table{width:100%;border-collapse:collapse}.table th,.table td{border-bottom:1px solid var(--line);padding:6px;text-align:right}.callout{border-left:4px solid var(--blue);padding:8px 12px;background:#eef6ff}.error{color:#b42318;min-height:1.3em}@media(max-width:720px){.lab-grid{grid-template-columns:1fr}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* Dark mode. The site toggle (assets/theme.js) sets html[data-theme="dark"] and
   assets/tool.css restyles --bg, --card, --ink, --muted and --line, so only the
   lab's own colours need a hand here. Canvases stay white on purpose: they
   draw hard-coded light colours (see the canvas exception in tool.css).
   The shared palette (--bg, --card, --ink, --muted, --line) and the brand
   colour come from tool.css and brand.css; --wine is the brand. */
html[data-theme="dark"]{--blue:#74b3f5;--green:#4ade80}
html[data-theme="dark"] .callout{background:rgba(116,179,245,.12)}
html[data-theme="dark"] .error{color:#f87171}
