:root { color-scheme: dark; --a:#8FBAD1; --a2:#A7CCE0; --warm:#E0A17F; --ink:#ECEAE4; --dim:#B6B3AB; }
* { box-sizing: border-box; }
html, body { background:#141417; }
body { margin:0; padding:8px 0 24px; color:var(--ink); font-family:system-ui,-apple-system,"DM Sans",sans-serif; line-height:1.6; }
.wrap { max-width:620px; margin:0 auto; }
.panel { padding:22px 0; border-top:1px solid rgba(255,255,255,.08); }
.panel:first-child { border-top:0; padding-top:6px; }
.panel h2 { font-family:Georgia,"EB Garamond",serif; font-weight:500; font-size:1.25rem; margin:0 0 6px; }
.lede { color:var(--dim); font-size:.92rem; margin:0 0 14px; }
.eq { margin:12px 0; overflow-x:auto; }

/* Plots */
svg { width:100%; height:auto; display:block; touch-action:none; }
.axis { stroke:#3a3a44; stroke-width:1; }
.tick { fill:#7c7a73; font-size:10px; font-family:ui-monospace,monospace; }
.axis-label { fill:#86847D; font-size:11px; font-family:ui-monospace,monospace; }
.pt { fill:rgba(167,204,224,.55); stroke:none; }
.fit { stroke:var(--warm); stroke-width:2; }
.r2-raw { fill:none; stroke:var(--a2); stroke-width:2.4; }
.r2-log { fill:none; stroke:var(--warm); stroke-width:2.4; }
.mk-raw { fill:var(--a2); stroke:#141417; stroke-width:1.4; }
.mk-log { fill:var(--warm); stroke:#141417; stroke-width:1.4; }
.kline { stroke:#5b5b64; stroke-width:1.1; stroke-dasharray:3 3; }
.leg { font-family:ui-monospace,monospace; font-size:10px; }

/* Buttons */
.btns { display:flex; gap:8px; flex-wrap:wrap; margin:10px 0 4px; }
.lbtn { font-family:ui-monospace,monospace; font-size:.78rem; color:var(--dim); background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.12); border-radius:6px; padding:6px 12px; cursor:pointer; transition:all .14s; }
.lbtn:hover { color:var(--ink); }
.lbtn.active { color:#141417; background:var(--a2); border-color:var(--a2); }

/* Controls */
.ctl { display:grid; grid-template-columns:180px 1fr; gap:12px; align-items:center; margin:10px 0 4px; }
.ctl label { font-family:ui-monospace,monospace; font-size:.82rem; color:var(--a2); }
.ctl output { font-variant-numeric:tabular-nums; color:var(--ink); }
input[type=range] { width:100%; accent-color:var(--a); }

/* Readout */
.readout { font-family:ui-monospace,monospace; font-size:.82rem; color:var(--dim); font-variant-numeric:tabular-nums; margin-top:8px; }
.readout b { color:var(--ink); }
