:root{--panel-w:320px}
[hidden]{display:none!important}
#stage{background:radial-gradient(ellipse at 27% 42%,#111e30 0,transparent 60%),#05070d}
#spring{position:absolute;left:0;top:78px;width:100%;height:calc(100% - 140px);touch-action:none}
.stage-head{position:absolute;top:20px;left:28px;right:24px;display:flex;justify-content:space-between;align-items:center;gap:16px}
.stage-head h2{font-size:18px;font-weight:600;margin:0 0 4px;color:#edf3fb}
.stage-head p{font-size:12px;color:#93a4b9;margin:0}
.stage-mark{font-size:11px;letter-spacing:1.6px;color:#7f94ac;border:1px solid #2a3b51;border-radius:6px;padding:5px 9px;white-space:nowrap}
#hint{top:auto;bottom:15px;left:24px;transform:none;background:none;padding:0;max-width:40%;font-size:11px;text-align:left;white-space:normal}
.stage-actions{position:absolute;bottom:13px;right:24px;display:flex;align-items:center;gap:8px}
.stage-actions button{border:1px solid #34455c;background:#142032;color:#dbe7f4;border-radius:8px;min-height:40px;padding:0 16px;font:inherit;font-size:12px;cursor:pointer}
.stage-actions button:last-child{color:#ffc94a;border-color:#7e6534;background:#292419}
.stage-actions button:hover{border-color:#ffc94a}
.stage-actions button:disabled{opacity:.35;cursor:default}
.learn-fab{left:50%;bottom:21px;font-size:11px;background:none;border:0;padding:0}
#panel{background:#0e1520;padding:20px 18px 24px}
#panel h1{font-size:15px;line-height:1.6;margin-bottom:6px}
#panel h2{font-size:12px;letter-spacing:0;color:#c3d1e1}
#panel h2 small{font-size:11px;color:var(--muted);font-weight:400}
#panel section{padding:15px 0;border-color:#263145}
#panel button{min-height:36px}
#panel button:not(.seg button){font:inherit;font-size:12px;background:#182334;color:var(--text);border:1px solid #304057;border-radius:8px;padding:8px 10px;cursor:pointer}
#panel button:hover{border-color:var(--accent)}
#panel button:disabled{opacity:.4;cursor:default}
#panel .seg{display:flex;width:100%;gap:5px}
#panel .seg button{flex:1;border:1px solid #2b3b51;border-radius:7px;font-size:11px;padding:5px}
#panel .seg button.on{border-color:#ffc94a;background:#ffc94a;color:#151b24}
.actions{display:flex;gap:8px;margin-bottom:10px}.actions button{flex:1}
#panel .slider{grid-template-columns:38px 1fr 70px;margin:4px 0;font-size:12px;min-height:36px}
#panel input[type=range]{height:28px}
#panel output{font-size:11px}
#panel .note{line-height:1.7;font-size:11px}
#panel .readout{background:linear-gradient(125deg,#1e2939,#131e2c);padding:12px 14px!important;border-color:#36465b!important;margin:0 0 3px}
.readout .big{color:var(--accent);font-size:18px}
.readout dl{font-size:12px;gap:5px 12px}.readout dd{text-align:right;font-variant-numeric:tabular-nums}
#equation{color:#a8bed5}
#records table{width:100%;font-size:11px;border-collapse:collapse;margin-top:10px}
#records th,#records td{padding:5px;border-bottom:1px solid var(--line);text-align:center}
#panel details{padding:14px 0;border-top:1px solid #263145}
#panel summary{font-size:12px;color:#c3d1e1;cursor:pointer}
#panel details .actions{margin-top:12px}
button:focus-visible,summary:focus-visible{outline:2px solid #78d6ff;outline-offset:3px}
@media(max-width:760px){
 .stage-head{top:14px;left:18px;right:105px}.stage-head h2{font-size:16px;white-space:nowrap}.stage-head p{font-size:11px}.stage-mark{display:none}
 #spring{top:72px;height:calc(100% - 132px)}
 #hint{left:16px;bottom:16px;max-width:42%;font-size:10px;line-height:1.6}
 #panelToggle{top:16px;right:12px;min-height:40px;padding:7px 10px;font-size:11px}
 .stage-actions{right:12px;bottom:12px;gap:6px}.stage-actions button{padding:0 12px;min-height:44px;font-size:11px}
 .learn-fab{display:none}
 #panel{padding:15px 18px 24px;max-height:65%}#panel button{min-height:44px}
}
@media(prefers-reduced-motion:reduce){#panel{transition:none}}
