/* The entrance keeps its aurora; experiment controls use a bright teaching palette. */
body.is-dark .workspace {--ink:#223b4b;--muted:#526c7d;--line:#c6d2db;--panel:#f8fafc;--panel-2:#edf3f7;--accent:#2879b1;--accent-2:#de753c;--blue:#397db8;background:#f5f7f9;color:var(--ink);box-shadow:0 8px 30px #071b2822}
body.is-dark .workspace h2,body.is-dark .workspace h3,body.is-dark .workspace .chart-panel strong,body.is-dark .workspace .analysis-head h3 {color:#233e50}
body.is-dark .workspace .workspace-head {border-color:#c7d5df}
body.is-dark .workspace .eyebrow {color:#247d79}
body.is-dark .workspace .control-panel,body.is-dark .workspace .chart-panel,body.is-dark .workspace .readout,body.is-dark .workspace .tool-section,body.is-dark .workspace .data-console {background:#f8fafc;color:#233e50;border-color:#c6d2dc;box-shadow:none}
body.is-dark .workspace .chart-panel header {background:#e5eff6;color:#233e50;border-color:#c6d2dc}
body.is-dark .workspace .chart-panel header span {color:#21628e}
body.is-dark .workspace .chart-panel canvas {background:#f8fafc}
body.is-dark .workspace .readout div,body.is-dark .workspace .cap-readout-grid span {background:#edf3f7;border-color:#c6d2dc}
body.is-dark .workspace .series-two {background:#7b4db4}
body.is-dark .workspace .formula-box,body.is-dark .workspace .canvas-hint,body.is-dark .workspace .lab-tutor-entry {background:#e7f0f7;color:#35546b;border-color:#bacfdd}
body.is-dark .workspace .control-row,body.is-dark .workspace .control-row b,body.is-dark .workspace .check-row,body.is-dark .workspace .readout strong,body.is-dark .workspace .readout span,body.is-dark .workspace .lab-tutor-copy strong {color:#233e50}
body.is-dark .workspace .action-bar button,body.is-dark .workspace .seg-btn,body.is-dark .workspace .tool-btn,body.is-dark .workspace .plain-btn,body.is-dark .workspace .data-actions button {background:#edf3f7;color:#233e50;border:1px solid #a9bfce;border-radius:6px;box-shadow:none}
body.is-dark .workspace .seg-btn.is-active,body.is-dark .workspace .action-bar button.is-active,body.is-dark .workspace .tool-btn.is-active {background:#347fb4;color:white;border-color:#236491}
body.is-dark .workspace .action-bar button:not(.is-active) {background:#edf3f7;color:#233e50;border-color:#a9bfce;box-shadow:none}
body.is-dark .workspace input[type=range] {accent-color:#287eb7}
body.is-dark .workspace select {background:white;color:#233e50;border-color:#a8bdca;border-radius:4px}
body.is-dark .workspace table {color:#233e50}
body.is-dark .workspace th {background:#e0eaf1;color:#26495e}
body.is-dark .workspace td {color:#29485b;border-color:#cfdae2}
body.is-dark .workspace .chapter-readings b {color:#163c58}
.c1-instrument {background:#fffdf2ed;border:1px solid #acbcc6;color:#294a5e;border-radius:7px;box-shadow:0 2px 8px #14364a0f}
.c1-instrument b {color:#275c7f}.c1-instrument output {color:#294a5e;font-size:.78rem}
.c1-toolbar {background:#fffdf2f2;border:1px solid #aebfca;border-radius:8px;box-shadow:0 2px 8px #14364a15}
.c1-toolbar button {background:#e9f0f6;color:#223f54;border:1px solid #a4b9c8;border-radius:5px;font-size:.75rem;min-height:32px}
.c1-toolbar button[data-c1-action=play] {background:#4d9563;color:white;border-color:#377c4d;font-weight:700}
.c1-toolbar button[data-c1-action=reset] {background:#e9a541;color:#402e14;border-color:#cd8d32}
.c1-toolbar button[aria-pressed=true] {background:#347fb4;color:white;border-color:#236391}
.playback-options {display:flex;gap:2px;padding:2px;border:1px solid #a4b9c8;border-radius:6px;background:#dbe6ee}
.playback-options:has(button[hidden]) {display:none}
.playback-options button {min-height:26px;border:0;padding:.3rem .45rem;white-space:nowrap}
.engine-loading {position:absolute;inset:0;z-index:8;display:grid;place-items:center;background:#dceef8;color:#31546c;font-size:1rem}
.engine-loading[hidden] {display:none}
.newton-help {font-size:.74rem;line-height:1.65;color:#587080;margin:.65rem 0}
.newton-actions {display:flex;gap:.4rem;margin:.7rem 0}
body.is-dark .workspace .newton-actions button,.newton-actions button {flex:1;border:1px solid #a9b9c6;border-radius:5px;background:#f9faf8;color:#284c65;padding:.5rem .25rem;font-size:.73rem;cursor:pointer}
body.is-dark .workspace #newtonRecord {background:#347fb4;color:white;border-color:#236491}
.newton-actions button:disabled {opacity:.45;cursor:default}
#newtonMeasured {display:block;padding:.6rem;background:#f4edcf;color:#62522f;font-size:.76rem;line-height:1.6;border-radius:4px;font-variant-numeric:tabular-nums}
.canvas-wrap.is-c1-3d.is-newton-rig {height:clamp(32rem,calc(100dvh - 20rem),48rem);min-height:32rem;background:#e9e5db}
.is-newton-rig .c1-instrument {left:1rem;right:auto;max-width:calc(100% - 2rem);background:#fffdf2e8}
.lab-layout:has(.is-newton-rig) {grid-template-columns:minmax(0,1fr) 17rem}
.lab-layout:has(.is-newton-rig) #readout {display:none}
@media(max-width:900px){.lab-layout:has(.is-newton-rig){grid-template-columns:minmax(0,1fr)}.canvas-wrap.is-c1-3d.is-newton-rig{height:36rem}}
.vector-board {position:absolute;inset:0;width:100%;height:100%;background:#f6fbff;z-index:6;touch-action:none;user-select:none}
.vector-board[hidden] {display:none}
.canvas-wrap.is-vector-workspace {height:clamp(29rem,calc(100dvh - 18rem),43rem);min-height:29rem;background:#f6fbff}
.canvas-wrap.is-vector-workspace #labCanvas {opacity:0;pointer-events:none;height:100%}
.canvas-wrap.is-vector-workspace .stage-status {display:none}
body:has(.is-vector-workspace) .assistant-toggle {display:none}
.vector-board text {font:600 16px "Microsoft YaHei",sans-serif;paint-order:stroke;stroke:#f6fbff;stroke-width:5px;stroke-linejoin:round}
.vector-board .vector-axis {font-size:13px;fill:#688296;stroke-width:3px}
.vector-board [data-vector-handle] {cursor:grab}.vector-board [data-vector-handle]:focus {outline:none;stroke:#e3ab35;stroke-width:5}
.vector-mode {display:flex;gap:4px;margin-bottom:1rem}.vector-mode button {flex:1;padding:.55rem .4rem;background:#e5eef5;color:#2a4e67;border:1px solid #9eb5c6;border-radius:5px;cursor:pointer;font-size:.8rem}.vector-mode button[aria-pressed=true] {background:#347fb4;color:white}
.lab-layout:has(.tape-panel:not([hidden])) {grid-template-areas:"canvas controls" "hint controls" "tape controls"}
.tape-panel {grid-area:tape;border:1px solid #aebfcb;border-radius:7px;background:#f5f7f8;color:#29475b;overflow:hidden}
.tape-panel[hidden] {display:none}.tape-panel header {display:flex;align-items:center;gap:.7rem;padding:.65rem .8rem;flex-wrap:wrap}.tape-panel header strong {margin-right:auto}.tape-panel header label {font-size:.8rem}
.tape-panel select,.tape-panel button {padding:.35rem .5rem;border:1px solid #a9bdcb;border-radius:4px;background:white;color:#29475b;font-size:.8rem}
#timerTapeCanvas {display:block;width:100%;height:170px;cursor:crosshair;touch-action:pan-y}
.tape-panel output {display:block;padding:.65rem .8rem;background:#fef9e6;border-top:1px solid #d8d0b8;font-size:.8rem;line-height:1.6;min-height:3rem}
@media(max-width:720px){.canvas-wrap.is-vector-workspace{height:34rem}.c1-toolbar{gap:.25rem}.c1-toolbar button{font-size:.67rem;padding:.35rem}.playback-options button{padding:.3rem}.lab-layout:has(.tape-panel:not([hidden])){grid-template-columns:minmax(0,1fr);grid-template-areas:"canvas" "hint" "tape" "controls"}}
