: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; }

/* Heatmap */
.plot { position:relative; }
.heat { width:100%; height:auto; display:block; border-radius:6px; cursor:crosshair; touch-action:none; background:#141417; }

/* Plots (profile) */
svg { width:100%; height:auto; display:block; touch-action:none; }
.axis { stroke:#3a3a44; stroke-width:1; }
.grid { stroke:#26262d; stroke-width:1; }
.axis-label { fill:#86847D; font-size:11px; font-family:ui-monospace,monospace; }
.tick { fill:#7c7a73; font-size:10px; font-family:ui-monospace,monospace; }
.prof-line { fill:none; stroke:var(--a2); stroke-width:2.5; }
.opt-line { stroke:var(--warm); stroke-width:1.5; stroke-dasharray:4 3; }
.opt-dot { fill:var(--warm); stroke:#141417; stroke-width:1.5; }
.end-lbl { fill:var(--dim); font-family:ui-monospace,monospace; font-size:10px; }

/* Controls */
.ctl { display:grid; grid-template-columns:190px 1fr; gap:12px; align-items:center; margin:9px 0; }
.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); }

/* Buttons + readout */
.inline { display:flex; align-items:center; gap:14px; margin-top:12px; flex-wrap:wrap; }
.btn { font-family:ui-monospace,monospace; font-size:.82rem; color:#141417; background:var(--a2); border:0; border-radius:6px; padding:7px 14px; cursor:pointer; transition:background .15s; }
.btn:hover { background:var(--a); }
.btn:active { transform:translateY(1px); }
.readout { font-family:ui-monospace,monospace; font-size:.82rem; color:var(--dim); font-variant-numeric:tabular-nums; }
.readout b { color:var(--ink); }

/* Legend */
.legend { display:flex; gap:18px; flex-wrap:wrap; margin:10px 0 2px; font-family:ui-monospace,monospace; font-size:.76rem; color:var(--dim); }
.legend span { display:inline-flex; align-items:center; gap:6px; }
.sw { width:12px; height:12px; display:inline-block; }
.sw-target { border:2px solid var(--warm); border-radius:50%; background:transparent; }
.sw-rest { width:0; height:0; border-left:6px solid transparent; border-right:6px solid transparent; border-bottom:11px solid var(--dim); }
.sw-opt { color:var(--warm); font-weight:700; line-height:1; }
.sw-ball { background:var(--a2); border-radius:50%; box-shadow:0 0 6px var(--a); }
