:root{color-scheme:light;--bg:#e9edf1;--surface:#f4f6f8;--text:#182a40;--muted:#546579;--border:#c6cfd9;--grid:#dce2e8;--axis:#8391a1;--curve:#15477c;--button:#163f67;--buttontext:#fff;--accent:#885000;--badge:#ffe0a0;--overlay:rgba(244,246,248,.97);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:16px}html[data-theme=dark]{color-scheme:dark;--bg:#090f1a;--surface:#101a2b;--text:#eaf1fc;--muted:#a4b2c8;--border:#344159;--grid:#253147;--axis:#77879f;--curve:#75efb7;--button:#75efb7;--buttontext:#0d291d;--accent:#ffda84;--badge:#654518;--overlay:rgba(16,26,43,.97)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}button,input,select{font:inherit}button,select{border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text);padding:10px 12px}button{cursor:pointer}button:hover{filter:brightness(.94)}button:disabled{opacity:.55;cursor:default}:focus-visible{outline:3px solid var(--curve);outline-offset:3px}header{display:flex;justify-content:space-between;align-items:center;padding:18px 30px;border-bottom:1px solid var(--border);gap:15px}.brand{display:flex;align-items:center;gap:12px;font-size:20px;font-weight:650}.brand b{font-family:Georgia,serif;font-size:32px;color:var(--curve)}.brand span{font-size:14px;color:var(--muted);font-weight:400}.header-actions{display:flex;gap:10px}main{max-width:1600px;margin:auto;padding:24px 30px;display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:28px}.stage{background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;display:flex;flex-direction:column;min-width:0;align-self:start}.topline{display:flex;justify-content:space-between;align-items:center;padding:20px 24px;gap:12px;font-size:14px;color:var(--muted)}#clock{font-size:25px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--text)}#formula{min-height:66px;text-align:center;font-size:clamp(25px,3vw,46px);font-weight:550;padding:0 12px;line-height:1.35}.graph-area{position:relative;min-height:300px}#plot{display:block;width:100%;height:min(65vh,720px);min-height:300px}#grid .grid{stroke:var(--grid);stroke-width:1}#grid .axis{stroke:var(--axis);stroke-width:2}#grid text,.axis-label{fill:var(--muted);font-size:18px}#curve{fill:none;stroke:var(--curve);stroke-width:7;stroke-linejoin:round;stroke-linecap:round}.stage-bottom{display:flex;justify-content:space-between;gap:16px;align-items:center;min-height:65px;padding:12px 24px 22px;color:var(--muted)}#beats{display:flex;gap:6px}#beats span{width:9px;height:9px;border-radius:50%;background:var(--border)}#beats .on{background:var(--curve)}.progress{height:4px;background:var(--grid)}#progress{height:100%;width:0;background:var(--curve)}.overlay{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;flex-direction:column;text-align:center;background:var(--overlay);padding:24px;gap:24px}.overlay p{font-size:clamp(22px,3vw,36px);max-width:620px}.overlay strong{font-size:clamp(54px,8vw,110px);line-height:1.1}.overlay[hidden],#countdown[hidden]{display:none}#countdown{position:absolute;top:10px;right:20px;background:var(--badge);color:var(--text);font-size:clamp(45px,6vw,80px);font-weight:750;line-height:1.1;padding:8px 17px;border-radius:12px;font-variant-numeric:tabular-nums}.urgent{color:var(--accent)!important}h1{font-size:29px;letter-spacing:-.03em;margin:4px 0 10px}.lead{line-height:1.55;color:var(--muted);margin:0 0 22px}fieldset{border:0;padding:0;margin:0 0 18px}legend,label[for]{font-size:14px;color:var(--muted);display:block;margin-bottom:8px}.theme{display:flex;gap:10px}.theme label{flex:1;display:flex;gap:8px;align-items:center;border:1px solid var(--border);border-radius:8px;padding:10px}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:18px}select{max-width:100%}.two select{width:100%;font-size:14px}input[type=checkbox],input[type=radio]{accent-color:var(--curve);width:17px;height:17px;flex-shrink:0}.check{display:flex;gap:9px;align-items:center;font-size:14px;margin:13px 0;line-height:1.5}details{border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0;margin-bottom:14px}summary{cursor:pointer;font-size:14px}.checks{display:grid;grid-template-columns:1fr 1fr;gap:2px 10px;margin-top:8px}.checks label{display:flex;gap:6px;align-items:center;font-size:14px;margin:6px 0}.volume{margin:18px 0 12px}.volume input{width:100%;accent-color:var(--curve)}.small{font-size:14px;line-height:1.55;color:var(--muted);margin:10px 0}.actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:20px}.primary{background:var(--button);color:var(--buttontext);border-color:var(--button);font-weight:650}#error{color:var(--accent);font-size:14px;line-height:1.5}footer{display:flex;gap:14px;flex-wrap:wrap;margin-top:22px;font-size:14px}a{color:var(--curve)}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%)}.present header,.present aside{display:none}.present main{display:block;max-width:none;padding:8px}.present .stage{height:calc(100dvh - 16px)}.present .graph-area{flex:1;min-height:0}.present #plot{height:100%;min-height:0;position:absolute;inset:0}.present #formula{font-size:clamp(28px,4vw,50px)}.present .stage-bottom{font-size:20px}@media(max-width:940px){main{grid-template-columns:1fr;padding:18px;gap:22px}aside{width:100%;max-width:600px;margin:auto}header{padding:12px 18px}.brand span{display:none}#plot{height:55vh}}@media(max-width:460px){.brand{font-size:16px;gap:6px}.header-actions{gap:6px}.header-actions select,.header-actions button{padding:8px;font-size:14px}.topline{padding:16px}.stage-bottom{padding:12px 16px;align-items:start;flex-direction:column}#formula{font-size:25px;min-height:60px}#countdown{right:8px;font-size:40px}}

.axis-arrow{fill:var(--axis)}#formula{min-height:100px;display:flex;align-items:center;justify-content:center;padding:10px 12px}#formula math{font-family:"STIX Two Math","Cambria Math","Latin Modern Math",math;font-size:1em}.present #formula{min-height:110px}@media(max-width:460px){#formula{font-size:24px;min-height:90px}.present #formula{min-height:90px}}

.reference-line{fill:none;stroke:var(--muted);stroke-width:2;stroke-dasharray:8 8;opacity:.7}.key-point{fill:var(--text);stroke:var(--surface);stroke-width:2}.point-label{font:500 20px system-ui;fill:var(--text);paint-order:stroke;stroke:var(--surface);stroke-width:5;stroke-linejoin:round}

[hidden]{display:none!important}

#phase-label{position:absolute;top:10px;left:50%;transform:translateX(-50%);padding:6px 14px;border-radius:16px;background:var(--surface);color:var(--text);border:1px solid var(--border);font-size:14px;white-space:nowrap;pointer-events:none}#beats{flex-wrap:wrap;max-width:180px}
