/* Student workflow: one question, one change, one clearly named side panel. */
.student-start-guide{display:grid;grid-template-columns:minmax(250px,1fr) minmax(0,1.5fr);gap:16px 30px;padding:24px;border:1px solid #c8dcd2;border-radius:14px;background:#f1f7f3;margin:20px 0 16px;color:#203c35}
.student-start-copy .eyebrow{color:#46765d;margin:0 0 7px;font-size:11px}.student-start-copy h2{font-size:21px;line-height:1.35;margin:0 0 9px;letter-spacing:-.4px}.student-start-copy>p:last-child{font-size:14px;line-height:1.65;margin:0;color:#486259}
.student-first-steps{list-style:none;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0;padding:0;align-items:start}.student-first-steps li{display:flex;align-items:flex-start;gap:9px;min-width:0}.step-number{display:grid;place-items:center;flex:none;width:27px;height:27px;border-radius:50%;background:#dcebe1;color:#28553e;font:600 13px/1 'Segoe UI',sans-serif}.student-first-steps strong{display:block;font-size:14px;line-height:1.6;color:#294d3d}.student-first-steps p{font-size:13px;line-height:1.65;color:#4c665a;margin:4px 0 0}
.student-start-actions{grid-column:1/-1;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.student-start-actions .button{min-height:43px;font-size:13px;padding:10px 15px}.student-start-actions>p{margin:0 0 0 auto;max-width:340px;font-size:12px;line-height:1.6;color:#4c665a}
.lesson-library{margin:0 0 17px}.student-lesson-chooser{border:1px solid var(--line);border-radius:11px;background:var(--panel);overflow:hidden}.student-lesson-chooser>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:72px;padding:16px 20px;cursor:pointer;list-style:none}.student-lesson-chooser>summary::-webkit-details-marker{display:none}.student-lesson-chooser>summary>span:first-child{display:block}.student-lesson-chooser .eyebrow{display:block;font-size:10px;line-height:1.5;margin:0 0 4px}.student-lesson-chooser strong{font-size:16px;line-height:1.5;color:var(--ink)}.student-lesson-chooser>summary:after{content:'＋';font:21px/1 'Segoe UI',sans-serif;color:var(--purple);flex:none}.student-lesson-chooser[open]>summary:after{content:'−'}.chooser-help{margin-left:auto;max-width:260px;font-size:12px;line-height:1.6;color:var(--muted)}.student-library-intro{margin:0;padding:0 20px 15px;font-size:13px;line-height:1.7;color:var(--muted)}.student-lesson-chooser .lesson-cards{padding:0 17px 17px}.student-lesson-chooser .lesson-card{min-height:110px}.student-lesson-chooser .lesson-card strong{font-size:14px}.student-lesson-chooser .lesson-card small{font-size:12px;line-height:1.6}
.lab-immersive .student-start-guide{display:none}
/* The panel header and tabs remain available while its content scrolls. */
#investigation-panel .student-inspector-heading{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;height:52px;min-height:52px;padding:6px 10px 6px 16px;background:var(--panel);border-bottom:1px solid var(--line)}
#inspector-heading{font-size:15px;line-height:1.35;margin:0}#close-inspector{flex:none;width:38px;height:38px;min-height:38px}
#investigation-panel .student-panel-tabs{position:sticky;top:52px;z-index:4;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));align-items:stretch;gap:0;margin:0;padding:0 6px;min-height:47px;background:var(--panel);border-bottom:1px solid var(--line)}
#investigation-panel .student-panel-tabs button{min-width:0;min-height:47px;padding:8px 2px;font-size:12px;line-height:1.3;border-bottom-width:3px;text-align:center;color:#526477}.student-panel-tabs button[aria-selected=true]{font-weight:700;background:#eeecf6;border-radius:5px 5px 0 0}
.student-panel-status{margin:0;padding:8px 16px;border-bottom:1px solid var(--line);background:#f3f7f5;color:#4c675b;font-size:12px;line-height:1.6}.student-panel-status:empty{display:none}
.settings-finder{margin:0 0 18px;padding:13px;border:1px solid var(--line);border-radius:8px;background:#f3f7f5}.settings-finder>label{display:block;font-size:14px;font-weight:600;margin:0 0 7px}.settings-finder>select{display:block;width:100%;min-height:43px;font-size:14px}.settings-finder>.button{margin:10px 0 0;min-height:41px;font-size:13px}.settings-finder>.subtle{margin:9px 0 0!important;font-size:12px!important;line-height:1.65}.lab-immersive .settings-finder{background:#173244;border-color:#486477}
#investigation-panel .tab-panel{padding:17px 16px;font-size:14px;line-height:1.65}#investigation-panel .tab-panel>h3{font-size:18px;line-height:1.4;margin:0 0 10px}#investigation-panel .tab-panel>p,#investigation-panel .tab-panel .subtle{font-size:13px;line-height:1.7}
#investigation-panel .tab-panel label,#investigation-panel .range-label,#investigation-panel .settings-group>label:not(.range-label):not(.source-enabled){font-size:13px;line-height:1.6}#investigation-panel .tab-panel select{font-size:13px;min-height:41px}#investigation-panel .tab-panel input[type=number]{font-size:13px;min-height:41px}#investigation-panel .tab-panel summary{font-size:13px;line-height:1.6;min-height:42px}#investigation-panel .tab-panel .button,#investigation-panel .tab-panel .text-button{font-size:13px;min-height:41px}
#question-prompt{font-size:15px;line-height:1.75}#lesson-title{font-size:19px;line-height:1.45}#question-title{font-size:12px;letter-spacing:.6px}#prediction-text{font-size:14px;line-height:1.7;min-height:92px}#lesson-select{min-height:42px;font-size:13px}.lesson-condition{font-size:12px;line-height:1.65}
#investigation-panel .science-readings,#investigation-panel .science-readings dd{font-size:12px}#investigation-panel .science-readings dt{font-size:12px}.science-readings>div{gap:9px}
.measure-panel .probe-panel{padding:0}.measure-panel .probe-reading{margin:6px 0 13px}.measure-panel .probe-reading strong{font-size:33px}.measure-panel .probe-reading small{font-size:13px}.measure-panel .probe-components{font-size:12px;margin:0 0 14px}.measure-panel .probe-position{padding:0;margin:6px 0}.measure-panel .probe-position label{font-size:13px}.measure-place{margin:16px 0 7px}.measure-place button{display:block;width:100%;min-height:43px;border:1px solid #709585;border-radius:6px;background:#edf6f0;color:#24523e;font-size:13px;font-weight:600;padding:9px 12px}.measure-place p{font-size:12px;line-height:1.6;color:var(--muted);margin:8px 0}.measure-coordinate-help{margin:14px 0 6px;font-size:12px;color:var(--muted)}.measure-panel .probe-breakdown{margin:17px 0 0}.measure-panel .record-button{min-height:43px;font-size:13px}
/* The quick actions remain visible; detailed display choices open above this row. */
.probe-tools.student-quick-actions,.lab-immersive .probe-tools.student-quick-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:7px;padding:6px 14px;background:#12283c;align-items:stretch;flex-shrink:0}
.student-quick-actions>button,.lab-immersive .student-quick-actions>button{display:flex;align-items:center;justify-content:center;gap:6px;min-height:40px;min-width:0;padding:6px 8px;border:1px solid #4f6c80;border-radius:6px;background:#1c374b;color:#d4e8ee;font:12px/1.35 'Segoe UI',sans-serif;text-align:center}
.student-quick-actions>button[aria-pressed=true]{border-color:#8ec9b2;background:#284f48;color:#e1fff1}.student-quick-actions>button:hover{background:#2b4b5f}.student-probe-summary{font:10px/1.35 Consolas,monospace;color:#b9dccd;white-space:nowrap}.quick-action-word{white-space:nowrap}
.student-quick-actions #open-measure{flex-wrap:wrap;gap:2px 7px}.student-quick-actions #open-learn>span,.student-quick-actions #open-particles>span,.student-quick-actions #open-settings>span{font-size:13px}
#open-measure .quick-action-word,#open-measure .quick-action-word>span{font-size:inherit}#student-probe-summary{font:12px/1.4 Consolas,monospace}
#sources-panel .panel-heading h2{font-size:15px}#sources-panel .builder-tabs button{font-size:13px;min-height:41px}#sources-panel .source-body{font-size:13px;line-height:1.65}#sources-panel .source-body .subtle,#sources-panel .source-description,#sources-panel .source-body .source-note p{font-size:12px;line-height:1.7}#sources-panel .source-body label,#sources-panel .range-label{font-size:12px}#sources-panel .source-body select,#sources-panel .source-body input[type=number]{font-size:13px;min-height:40px}#sources-panel .control-disclosure>summary,#sources-panel .object-properties>summary{font-size:13px}#sources-panel .source-card strong{font-size:13px}#sources-panel .source-card small{font-size:11px;line-height:1.6}
.student-start-guide button:focus-visible,.student-lesson-chooser summary:focus-visible,#workspace button:focus-visible,#workspace summary:focus-visible,#workspace select:focus-visible,#workspace input:focus-visible,#workspace textarea:focus-visible{outline:3px solid #4a967b;outline-offset:3px}
#workspace input[type=range]:focus-visible{outline-offset:5px}#workspace .drawer-close:focus-visible{outline-offset:1px}
body :is(button,a,input,select,textarea,summary,canvas):focus-visible{outline:3px solid #397b63;outline-offset:3px}body.lab-immersive :is(button,a,input,select,textarea,summary,canvas):focus-visible{outline-color:#b8f1d4}
#investigation-panel{scroll-padding-top:112px;scroll-padding-bottom:15px}#investigation-panel :is(input,select,textarea,button,summary){scroll-margin-top:8px;scroll-margin-bottom:12px}
.lab-immersive #investigation-panel .student-inspector-heading,.lab-immersive #investigation-panel .student-panel-tabs{background:#1a3046}.lab-immersive #investigation-panel .student-panel-tabs button{color:#c6d9e6}.lab-immersive #investigation-panel .student-panel-tabs button[aria-selected=true]{color:#e0ffed;background:#2b4b4a;border-color:#9fd7be}.lab-immersive .student-panel-status{background:#152e3e;color:#bbd5cf}.lab-immersive .measure-place button{background:#24493f;border-color:#76a18a;color:#d1f7df}.lab-immersive #workspace button:focus-visible,.lab-immersive #workspace summary:focus-visible,.lab-immersive #workspace select:focus-visible,.lab-immersive #workspace input:focus-visible,.lab-immersive #workspace textarea:focus-visible{outline-color:#b8f1d4}
@media(min-width:1000px){.probe-tools.student-quick-actions,.lab-immersive .probe-tools.student-quick-actions{grid-template-columns:repeat(5,minmax(100px,150px));justify-content:center}.student-quick-actions>button,.lab-immersive .student-quick-actions>button{min-height:39px}.student-probe-summary{font-size:11px}}
@media(max-width:900px){.student-start-guide{grid-template-columns:1fr;padding:20px;gap:17px}.student-start-actions>p{margin:0;max-width:none;flex:1 1 220px}.student-first-steps{gap:12px}.chooser-help{max-width:220px}}
@media(max-width:760px){.student-start-guide{padding:18px;margin-top:16px}.student-start-copy h2{font-size:20px}.student-start-copy>p:last-child{font-size:14px}.student-first-steps{grid-template-columns:1fr;gap:11px}.student-first-steps p{margin:2px 0 0}.student-first-steps li{align-items:center}.student-start-actions{gap:8px}.student-start-actions .button{min-height:45px;font-size:13px;flex:1 1 145px;justify-content:center}.student-start-actions>p{font-size:12px}.student-lesson-chooser>summary{padding:14px 16px;gap:10px;min-height:72px}.student-lesson-chooser strong{font-size:15px}.chooser-help{display:none}.student-library-intro{font-size:13px;padding:0 16px 13px}.student-lesson-chooser .lesson-cards{padding:0 12px 12px}.student-lesson-chooser .lesson-card{min-height:120px}.student-lesson-chooser .lesson-card strong{font-size:13px}.student-lesson-chooser .lesson-card small{font-size:12px}
  #close-inspector,#close-objects{width:42px;height:42px;min-height:42px}#investigation-panel .student-inspector-heading{height:56px;min-height:56px;padding:5px 8px 5px 15px}#investigation-panel .student-panel-tabs{top:56px;min-height:47px}#investigation-panel .student-panel-tabs button{font-size:12px;min-height:47px}#investigation-panel .tab-panel{padding:15px}#investigation-panel .tab-panel .button,#investigation-panel .tab-panel .text-button,#investigation-panel .tab-panel select,#investigation-panel .tab-panel input[type=number],.measure-place button,.measure-panel .record-button{min-height:44px}#investigation-panel .tab-panel summary{min-height:44px}.student-panel-status{font-size:12px;padding:7px 15px}.probe-tools.student-quick-actions,.lab-immersive .probe-tools.student-quick-actions{gap:5px;padding:5px 9px}.student-quick-actions>button,.lab-immersive .student-quick-actions>button{font-size:11px;min-height:44px;padding:5px 2px;gap:3px}.student-quick-actions #open-measure{flex-direction:column;gap:1px}.student-probe-summary{font-size:9px}.student-quick-actions #open-learn>span,.student-quick-actions #open-particles>span,.student-quick-actions #open-settings>span{font-size:11px}#sources-panel .source-body input[type=number],#sources-panel .source-body select,#sources-panel .builder-tabs button{min-height:44px}}
@media(max-width:350px){.student-quick-actions>button,.lab-immersive .student-quick-actions>button{font-size:10px}.student-quick-actions #open-settings>span{display:none}.student-start-guide{padding:16px}.student-lesson-chooser .lesson-cards{grid-template-columns:1fr}}
@media(max-width:760px){#student-probe-summary{font-size:10.5px}}
@media(prefers-reduced-motion:reduce){.student-lesson-chooser,.student-quick-actions>button{scroll-behavior:auto;transition:none}}
@media(max-width:760px){.scene-header-actions .immersive-control,.lab-immersive .scene-header-actions .immersive-control,.scene-header-actions .immersive-toggle,.lab-immersive .scene-header-actions .immersive-toggle{min-height:44px;height:44px;font-size:11px}.scene-header-actions #reset-view{min-height:44px;height:44px}.stage-topline select,.lab-immersive .stage-topline select{min-height:40px}}

/* Give the experiment the height: three compact top rows and one task bar. */
#scene-panel .scene-header{min-height:48px;height:48px;padding:4px 14px;flex-shrink:0;gap:12px}
#scene-panel .scene-header h2{font-size:13px;white-space:nowrap}
#scene-panel .scene-header-actions{gap:6px}
#scene-panel .scene-header-actions .immersive-control,#scene-panel .scene-header-actions .immersive-toggle{min-height:38px;height:38px;padding:6px 10px;font-size:12px}
#scene-panel .stage-topline{min-height:44px;padding:3px 14px;flex-shrink:0;gap:9px}
#scene-panel .stage-topline select{min-height:36px;padding:5px 8px;font-size:12px}
#scene-panel .edit-toolbar{min-height:44px;padding:4px 14px;gap:10px;flex-shrink:0}
#scene-panel .edit-toolbar button{min-height:33px;font-size:12px}
#scene-panel .object-picker select{min-height:33px;font-size:12px}
#scene-panel .scene-footer{min-height:24px;padding:5px 14px;font-size:10px;flex-shrink:0;gap:12px}
#scene-panel .canvas-wrap{flex:1 1 0;min-height:0}
.scene-tool-dock{position:relative;flex-shrink:0;z-index:10;min-width:0}
.student-quick-actions>button[aria-expanded=true]{border-color:#8ec9b2;background:#284f48;color:#e1fff1}
#workspace:fullscreen,.lab-immersive #workspace:fullscreen{position:relative;inset:auto;display:block;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#07111e;overflow:hidden}
#workspace:fullscreen #scene-panel{position:relative;inset:auto;display:flex;flex-direction:column;width:100%;height:100dvh;margin:0;border:0;border-radius:0}
#workspace:fullscreen .canvas-wrap{flex:1 1 0;min-height:0}

/* Calibration sits beside the legend, clear of the upper ruler and camera controls. */
#scene-panel .scene-scale-strip{position:absolute;z-index:2;top:auto;bottom:12px;left:240px;right:200px;min-height:0;display:flex;align-items:center;justify-content:flex-start;gap:5px 8px;flex-wrap:wrap;padding:5px 7px;border:1px solid #4b6b7d99;border-radius:7px;background:#0c2435e8;box-shadow:0 2px 12px #0002;pointer-events:auto;max-width:620px;margin:0 auto}
#scene-panel .scene-scale-strip button{width:auto;min-width:0;min-height:30px;font-size:11px;gap:5px;padding:4px 7px}
#scene-panel .scene-scale-strip #open-scale{flex:1 1 235px}
#scene-panel .scene-scale-strip #fit-box{flex:0 0 auto;margin:0}
#scene-panel .scene-scale-strip #clock-summary{width:auto;flex:1 1 100%;font-size:10px;padding:0 3px;line-height:1.35}
@media(min-width:761px){body:not(.sources-closed) #scene-panel .scene-scale-strip{left:330px}body:not(.inspector-closed) #scene-panel .scene-scale-strip{right:350px}}

/* View contains the original display controls, with inline disclosures rather than nested popovers. */
#display-panel{position:absolute;right:14px;bottom:calc(100% + 8px);width:360px;max-width:calc(100% - 28px);max-height:min(580px,calc(100dvh - 100px));overflow-y:auto;overscroll-behavior:contain;scroll-padding:62px 0 12px;border:1px solid #658194;border-radius:12px;background:#10283cf7;color:#d5e6ef;box-shadow:0 12px 40px #0007;backdrop-filter:blur(16px);z-index:20;font-size:13px;line-height:1.6;scrollbar-width:thin;scrollbar-color:#627f92 #10283c}
#display-panel[hidden]{display:none!important}
.display-panel-heading{position:sticky;top:0;z-index:3;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:52px;padding:6px 10px 6px 16px;background:#19364a;border-bottom:1px solid #4b6d81}
#display-heading{margin:0;font-size:16px;line-height:1.4;scroll-margin:12px}
#close-display{width:38px;height:38px;min-height:38px;color:#deedf3;border-color:#6b8596}
.display-panel-body{padding:0 16px 16px}
.display-intro{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px 0 9px}
.display-intro p{margin:0;color:#bdd2df;font-size:13px;line-height:1.6;max-width:190px}
#display-panel button:not(.drawer-close){min-height:40px;padding:7px 10px;border:1px solid #709686;border-radius:6px;background:#244b46;color:#dcfff0;font:13px/1.35 'Segoe UI',sans-serif}
#display-panel button:not(.drawer-close):hover{background:#315d55;border-color:#b5e3cb}
#display-panel .scene-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 10px;justify-content:stretch;padding:0;background:none;border:0;backdrop-filter:none;z-index:auto}
#display-panel .scene-controls .toggle{display:flex;align-items:center;gap:8px;min-height:42px;font-size:13px;color:#d5e6ef;white-space:normal}
#display-panel .scene-controls .toggle:has(#auto-rotate){display:flex}
#display-panel .scene-controls input[type=checkbox]{width:17px;height:17px;flex:none;accent-color:#addfca}
#display-panel #line-options{grid-column:1/-1;grid-row:4;margin:7px 0 0;min-width:0}
#display-panel #line-options>summary{justify-content:space-between;min-height:42px;font-size:13px;padding:9px 11px}
#display-panel .field-line-options{position:static;width:100%;max-width:none;max-height:none;padding:12px 2px 5px;margin:0;overflow:visible;background:none;border:0;border-radius:0;box-shadow:none;backdrop-filter:none;color:inherit}
#display-panel .field-line-heading{margin-bottom:5px}
#display-panel .field-line-heading strong{font-size:13px}
#display-panel .field-line-options>label,#display-panel .field-line-options>p{font-size:12px;line-height:1.65}
#display-panel select{min-height:42px;font-size:13px;padding:7px 9px;background:#17364c;color:#e1edf5;border-color:#688296;width:100%;margin:0;max-width:100%}
#display-panel .display-density{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:12px;margin:7px 0}
#display-panel .display-density>label{font-size:13px;color:#d5e6ef}
#display-panel .scene-controls #density{display:block}
#display-panel .slice-controls{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:7px 12px;align-items:center;justify-content:stretch;padding:14px 0 0;margin:12px 0 0;border-top:1px solid #4a697b;background:none;backdrop-filter:none;color:#d5e6ef}
#display-panel .slice-controls label{font-size:13px;line-height:1.5}
#display-panel .slice-controls label[for=slice]{grid-column:1/-1;margin-top:4px}
#display-panel #slice{display:block;min-width:0;width:100%;max-width:none;grid-column:1;height:34px;accent-color:#addfca}
#display-panel #slice-out{font:12px Consolas,monospace;color:#c9eddf;text-align:right;min-width:0}
.display-camera{border-top:1px solid #4a697b;margin-top:16px;padding-top:13px}
.display-camera h4{font-size:13px;line-height:1.5;margin:0 0 9px;color:#d5e6ef}
.display-camera-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px}
#display-panel .display-camera-actions button{font-size:12px;background:#1e3c52;border-color:#607f94;color:#d7e8f2}
.display-camera-actions button:last-child{grid-column:1/-1}

/* Saved evidence belongs with the probe, including in the immersive workspace. */
#view-readings{display:block;width:100%;min-height:40px;margin:7px 0 0;padding:7px 10px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--purple);font-size:13px}
#view-readings:disabled{opacity:.6;cursor:default}
#measure-panel #measurement-section,.lab-immersive #measure-panel #measurement-section{display:block!important;min-width:0;margin:23px 0 0;padding:18px 0 0;border:0;border-top:1px solid var(--line);border-radius:0;background:none;scroll-margin-top:8px}
#measure-panel #measurement-section .library-heading{display:block;margin:0 0 12px}
#measure-panel #measurement-section .eyebrow{font-size:10px;margin:0 0 5px}
#measure-panel #measurement-heading{font-size:17px;line-height:1.45;margin:0 0 12px;scroll-margin-top:8px}
#measure-panel #measurement-section p{font-size:12px;line-height:1.7;margin:10px 0}
#measure-panel .measurement-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:12px;white-space:normal}
#measure-panel .measurement-actions button{min-height:40px;font-size:12px;padding:7px 10px}
#measure-panel .measurement-actions #clear-measurements{padding-left:0}
#measure-panel .table-scroll{max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin}
#measure-panel #measurement-table{width:100%;min-width:430px;font:11px/1.5 Consolas,monospace}
#measure-panel #measurement-table th,#measure-panel #measurement-table td{padding:9px 8px;white-space:nowrap}
#measure-panel #measurement-table caption{font:12px/1.6 'Segoe UI',sans-serif;padding:8px 0;text-align:left}
#measure-panel #measurement-count{font:12px Consolas,monospace;margin-right:auto}

@media(max-width:760px){
  #scene-panel .scene-header{height:52px;min-height:52px;padding:4px 10px}
  #scene-panel .scene-header-actions{gap:4px}
  #scene-panel .scene-header-actions .immersive-control,#scene-panel .scene-header-actions .immersive-toggle{min-height:44px;height:44px;padding:6px 8px;font-size:11px}
  #scene-panel .scene-header-actions #reset-view{min-height:44px;height:44px}
  #scene-panel .stage-topline{min-height:46px;padding:3px 10px;gap:8px}
  #scene-panel .stage-topline select{min-height:40px;font-size:12px}
  #scene-panel .edit-toolbar{min-height:96px;padding:5px 10px;gap:5px 4px}
  #scene-panel .edit-toolbar button{min-height:38px;font-size:11px;padding:5px 7px}
  #scene-panel .tool-segment{padding:2px;gap:1px}
  #scene-panel .scene-transport{gap:3px}
  #scene-panel .scene-transport button:first-child{min-width:64px}
  #scene-panel .object-picker select{min-height:40px;font-size:12px}
  #scene-panel .object-picker #delete-selected{min-height:40px}
  #scene-panel .scene-footer{min-height:25px;padding:5px 10px;font-size:9px;gap:7px}
  #scene-panel .scene-footer #scene-instructions{min-width:0;line-height:1.5}
  .probe-tools.student-quick-actions,.lab-immersive .probe-tools.student-quick-actions{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:4px;padding:5px 8px}
  .student-quick-actions>button,.lab-immersive .student-quick-actions>button{min-height:48px;flex-direction:column;gap:1px;padding:4px 2px;font-size:11px;line-height:1.35}
  .student-quick-actions #open-measure{gap:1px}
  #student-probe-summary{font-size:9.5px}
  #scene-panel .scene-scale-strip{top:auto;left:12px;right:12px;bottom:86px;max-width:370px;margin:0;gap:3px 5px;padding:5px}
  #scene-panel .scene-scale-strip #open-scale{flex:1 1 170px;min-height:34px;font-size:10px}
  #scene-panel .scene-scale-strip #fit-box{flex:none;min-height:34px;font-size:10px;padding:4px 6px}
  #scene-panel .scene-scale-strip #clock-summary{font-size:9px;padding-left:3px}
  #display-panel{left:12px;right:12px;width:auto;max-width:none;max-height:calc(100dvh - 94px);bottom:calc(100% + 7px);border-radius:11px}
  #close-display{width:44px;height:44px;min-height:44px}
  .display-panel-heading{min-height:56px;padding:5px 8px 5px 15px}
  .display-panel-body{padding:0 15px 15px}
  #display-panel button:not(.drawer-close),#display-panel select,#display-panel .scene-controls .toggle,#display-panel #line-options>summary{min-height:44px}
  #view-readings,#measure-panel .measurement-actions button{min-height:44px}
}
@media(max-width:350px){
  #scene-panel .edit-toolbar{padding-left:8px;padding-right:8px;gap:5px 3px}
  #scene-panel .edit-toolbar button{padding:5px;font-size:10px}
  #scene-panel .scene-transport button:first-child{min-width:58px}
  .student-quick-actions>button,.lab-immersive .student-quick-actions>button{font-size:10px}
  #student-probe-summary{font-size:9px}
  #scene-panel .scene-scale-strip{max-width:none}
}
/* On a short screen a drawer covers the edit rows, preserving a real scrolling body. */
@media(max-height:600px){
  #scene-panel .scene-header{min-height:44px;height:44px;padding-top:3px;padding-bottom:3px}
  #scene-panel .scene-header-actions .immersive-control,#scene-panel .scene-header-actions .immersive-toggle,#scene-panel .scene-header-actions #reset-view{min-height:36px;height:36px}
  #scene-panel .stage-topline{min-height:39px;padding-top:2px;padding-bottom:2px}
  #scene-panel .stage-topline select{min-height:33px;font-size:11px}
  #scene-panel .edit-toolbar{min-height:44px;padding-top:3px;padding-bottom:3px}
  #scene-panel .edit-toolbar button,#scene-panel .object-picker select,#scene-panel .object-picker #delete-selected{min-height:32px}
  #scene-panel .scene-footer{min-height:21px;padding-top:3px;padding-bottom:3px}
  #scene-panel .zoom-buttons{display:flex;top:62px;bottom:auto;transform:none;flex-direction:row}
  #scene-panel .zoom-buttons button{width:36px;height:34px;min-height:34px}
  #sources-panel,#investigation-panel,.lab-immersive #sources-panel,.lab-immersive #investigation-panel,.mode-simple.lab-immersive #sources-panel,.mode-simple.lab-immersive #investigation-panel{top:50px;bottom:77px;z-index:12}
  #sources-panel .panel-heading{min-height:42px;padding:4px 10px 4px 14px}
  #sources-panel .panel-heading .drawer-close,#close-inspector{min-height:34px;height:34px;width:34px}
  #sources-panel .builder-tabs{padding:3px 9px;gap:4px}
  #sources-panel .builder-tabs button{min-height:35px;font-size:12px}
  #investigation-panel .student-inspector-heading{height:42px;min-height:42px;padding:4px 10px 4px 14px}
  #investigation-panel .student-panel-tabs{top:42px;min-height:38px}
  #investigation-panel .student-panel-tabs button{min-height:38px;font-size:12px;padding:5px 2px}
  #investigation-panel{scroll-padding-top:90px}
  #investigation-panel :is(input,select,textarea,button,summary),#measure-panel #measurement-heading{scroll-margin-top:8px}
  #investigation-panel .tab-panel{padding:12px 14px}
  #display-panel{max-height:calc(100dvh - 82px)}
  .display-panel-heading{min-height:44px;padding-top:3px;padding-bottom:3px}
  #close-display{min-height:36px;height:36px;width:36px}
  .probe-tools.student-quick-actions,.lab-immersive .probe-tools.student-quick-actions{display:grid;padding-top:4px;padding-bottom:4px}
  .student-quick-actions>button,.lab-immersive .student-quick-actions>button{min-height:44px}
  #scene-panel .scene-scale-strip{top:auto;left:240px;right:105px;bottom:12px;max-width:none;margin:0}
  #scene-panel .scene-scale-strip #clock-summary{display:none}
}
@media(max-height:600px) and (max-width:760px){
  #scene-panel .edit-toolbar{min-height:77px}
  #scene-panel .scene-scale-strip{left:214px;right:100px;bottom:10px}
  #scene-panel .scene-scale-strip #open-scale{flex:1 1 150px;font-size:9px;min-height:29px}
  #scene-panel .scene-scale-strip #fit-box{min-height:29px;font-size:9px}
}
@media(max-height:600px) and (min-width:560px) and (max-width:760px){
  #scene-panel .edit-toolbar{display:flex;flex-wrap:nowrap;min-height:44px;gap:7px}
  #scene-panel .object-picker{flex:1;min-width:100px;max-width:none;width:auto;grid-column:auto;grid-row:auto}
  #scene-panel .scene-transport{margin-left:auto}
}
@media(prefers-reduced-motion:reduce){#display-panel{scroll-behavior:auto;backdrop-filter:none}}

/* A probe starts with a readable result; exact positioning stays one disclosure away. */
/* Object tools stay close to selection; less frequent organisation controls fold away. */
#sources-panel .object-manager{margin:0 0 14px;padding:0 0 8px;border-bottom:1px solid var(--line)}
#sources-panel .object-manager>summary{min-height:42px;cursor:pointer;padding:8px 0;font-size:13px;font-weight:650;color:var(--purple)}
#sources-panel .object-manager label,#sources-panel .object-name-label{display:block;font-size:12px;line-height:1.6;color:var(--muted)}
#sources-panel .object-manager input,#sources-panel .object-name-label input{display:block;width:100%;min-width:0;min-height:40px;margin:5px 0 10px;padding:7px 9px;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink);font:13px/1.4 'Segoe UI',sans-serif}
.object-manager-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;min-width:0}
#sources-panel .object-manager-grid label{min-width:0}
#sources-panel .object-manager select{display:block;width:100%;min-width:0;font-size:12px;margin:5px 0 0;padding:6px 5px}
#sources-panel #object-summary{margin:9px 0 0;font-size:11px;line-height:1.6}
#sources-panel .object-name-label{margin:0 0 7px}
#sources-panel .source-shortcuts{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}
#sources-panel .source-shortcuts button{flex:1 1 auto;min-width:0;min-height:38px;margin:0;padding:6px 8px;font-size:11px;line-height:1.4}
#scene-panel .object-picker{max-width:430px;gap:4px}
#scene-panel .object-picker>button{width:31px;min-width:31px;flex:none;padding:4px 5px;font-size:16px;line-height:1}
#scene-panel .object-picker>select{flex:1;min-width:0}
.context-math{max-width:100%;min-width:0;overflow-x:auto;overflow-y:hidden;line-height:1.8;scrollbar-width:thin}
.context-math:empty{display:none}
.context-math mjx-container{max-width:100%;margin:.35em 0!important}
.context-math mjx-container[jax=SVG]{font-size:103%!important;color:inherit}
.context-math mjx-container[jax=SVG]>svg{max-width:100%}
.lab-math-rendered{display:inline-block;vertical-align:baseline;max-width:100%;font-family:'Cambria Math',Georgia,serif;line-height:1.4}
.lab-math-rendered>mjx-container{display:inline-block!important;margin:0!important;color:inherit}
.lab-math-rendered>mjx-container>svg{vertical-align:-.15em;max-width:100%}
.lab-math-display{display:block;overflow-x:auto;padding:6px 0;line-height:1.8}
.math-ui-source{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
#probe-magnitude .lab-math-rendered>mjx-container{font-size:100%!important}
#particles-panel .contextual-model{margin:10px 0 13px;border-bottom:1px solid var(--line);padding-bottom:5px}
#launch-equations>p{margin:4px 0 10px;font-size:13px;color:var(--ink)}
#launch-physics,#selected-particle-physics{font-size:13px;margin:9px 0;color:var(--purple)}
#launch-physics mjx-container,#selected-particle-physics mjx-container{font-size:100%!important}
.mode-simple #particle-editor{display:block!important}
#particles-panel .playback{display:flex;flex-wrap:wrap;gap:5px;align-items:stretch}
#particles-panel .launch-buttons{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
#particles-panel .launch-buttons button{min-width:0;white-space:normal;line-height:1.4;padding:8px 7px}
#particles-panel .playback button{flex:1 1 auto;margin:0;padding:6px 9px;font-size:12px}
#particles-panel .playback #clear-stopped-particles{flex-basis:100%;padding:4px 7px;min-height:34px;text-align:right;font-size:11px}
#particles-panel .particle-actions{flex-wrap:wrap}
#particles-panel .particle-actions>button{min-width:0;flex:1 1 auto}
#particles-panel .particle-edit-unit-label{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;margin:10px 0}
#particles-panel #particle-edit-units{min-width:0;width:100%;font-size:12px}
#particles-panel #particle-edit-unit-help{font-size:11px;line-height:1.6;margin:5px 0 10px}
#particles-panel .particle-edit-grid label{min-width:0}
#particles-panel .particle-edit-grid input{min-width:0;width:100%;font-size:12px;padding-left:6px;padding-right:6px}
.lab-immersive #sources-panel .object-manager input,.lab-immersive #sources-panel .object-name-label input{background:#142c41;color:#e0eef7;border-color:#4f6d82}
.lab-immersive #launch-equations>p{color:#dceaf6}
@media(max-width:760px){
  #sources-panel .object-manager input,#sources-panel .object-name-label input,#sources-panel .source-shortcuts button{min-height:44px}
  #scene-panel .object-picker>button{width:36px;min-width:36px;min-height:40px}
  #particles-panel .playback #clear-stopped-particles{min-height:44px}
}
@media(max-height:600px) and (min-width:560px){#scene-panel .object-picker>button{width:29px;min-width:29px;min-height:32px;padding:4px;font-size:15px}}
#measure-panel .probe-introduction{font-size:12px;line-height:1.6;margin:0 0 13px}
#measure-panel .probe-reading-card{padding:11px 12px;border:1px solid #ced9e2;border-radius:10px;background:#f4f7fb;min-width:0}
.probe-reading-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.probe-live-label{font-size:10px;letter-spacing:1px;font-weight:700;color:#4f6877;line-height:1.5}
#measure-panel .probe-field-unit-control{display:flex;align-items:center;gap:7px;font-size:11px;white-space:nowrap;margin:0;color:#4f6877}
#measure-panel #probe-field-units{width:65px;min-height:34px;font-size:12px;padding:4px 6px}
#measure-panel .probe-reading{margin:5px 0 9px;gap:8px;flex-wrap:wrap}
#measure-panel .probe-reading strong{font-size:32px;line-height:1.3;letter-spacing:-1px;overflow-wrap:anywhere}
#measure-panel .probe-reading>span{font-size:20px;color:#526f7d}
#measure-panel .probe-reading small{font-size:14px;color:#526f7d}
#measure-panel .probe-component-label{font-size:11px;line-height:1.5;margin:0;color:#526b79}
#measure-panel .probe-components{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:5px 0 0;padding:6px 0 8px;border-top:0;border-bottom:1px solid #cfdce4}
#measure-panel .probe-components>span{min-width:0;font:12px/1.4 'Segoe UI',sans-serif;color:#526b79}
#measure-panel .probe-components b{font:13px/1.45 Consolas,monospace;letter-spacing:-.4px;overflow-wrap:anywhere;margin-top:3px;color:#283f51}
#measure-panel .probe-direction{font:12px/1.6 Consolas,monospace;overflow-wrap:anywhere;color:#395b6c;margin:8px 0 0}
#measure-panel #probe-status{font-size:11px;line-height:1.6;margin:8px 0 10px;overflow-wrap:anywhere}
.probe-reading-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}
#measure-panel .probe-reading-actions button{min-width:0;width:100%;margin:0;min-height:42px;padding:7px 5px;font-size:12px;line-height:1.4}
#measure-panel .probe-reading-actions .view-readings{background:#eef3f7;color:#385e74;border-color:#c4d3de}
#measure-panel .probe-placement-controls{margin:12px 0 0;padding-top:9px;border-top:1px solid var(--line)}
.probe-placement-fields{display:grid;grid-template-columns:1fr 1fr;gap:9px;min-width:0}
#measure-panel .probe-placement-fields>label,#measure-panel .probe-depth-field{display:block;min-width:0;font-size:12px;line-height:1.5;color:var(--muted)}
#measure-panel .probe-depth-field>label{display:block;font-size:12px;line-height:1.5}
#measure-panel .probe-placement-fields select,#measure-panel .probe-placement-fields input{display:block;width:100%;max-width:100%;min-width:0;min-height:41px;margin-top:5px;font-size:13px}
#measure-panel .probe-placement-fields input{border:1px solid var(--line);border-radius:6px;padding:7px 8px;background:var(--panel);color:var(--ink);font-family:Consolas,monospace}
#measure-panel .measure-place{display:flex;align-items:stretch;gap:7px;margin:0 0 7px}
#measure-panel .measure-place button{width:auto;min-width:0;min-height:42px;font-size:12px;line-height:1.4;padding:7px 8px}
#measure-panel #place-probe{flex:1}
#measure-panel #probe-plane-view{flex:0 0 auto;background:#eef3f7;border-color:#c4d3de;color:#385e74;font-weight:400}
#measure-panel #plane-hint{font-size:11px;line-height:1.65;margin:7px 0 0;overflow-wrap:anywhere}
#measure-panel .probe-precision{margin:15px 0 0;padding:0;border-top:1px solid var(--line)}
#measure-panel .probe-precision>summary{min-height:44px;font-size:13px;font-weight:600;line-height:1.6;padding:11px 0}
#measure-panel .probe-unit-label,#measure-panel .probe-step-label{display:grid;grid-template-columns:minmax(0,1fr) 120px;gap:10px;align-items:center;margin:10px 0 0;font-size:12px;color:var(--muted)}
#measure-panel .probe-unit-label select,#measure-panel .probe-step-label input{display:block;width:100%;min-width:0;min-height:41px;font-size:13px}
#measure-panel #probe-unit-help,#measure-panel #probe-step-help,#measure-panel .probe-science-note{font-size:11px;line-height:1.65;margin:7px 0 11px}
#measure-panel .probe-coordinate-rows{display:grid;gap:7px;padding:0;margin:13px 0 12px;min-width:0}
.probe-coordinate-row{display:grid;grid-template-columns:54px 36px minmax(0,1fr) 36px;gap:6px;align-items:center;min-width:0}
#measure-panel .probe-coordinate-row>label{display:block;font:12px/1.45 'Segoe UI',sans-serif;min-width:0;color:var(--muted)}
#measure-panel .probe-coordinate-row input{min-width:0;width:100%;min-height:41px;font:13px Consolas,monospace;text-align:center;padding:6px 4px}
#measure-panel .probe-coordinate-row button{width:36px;min-width:0;min-height:41px;padding:4px;border:1px solid #c4d3de;border-radius:6px;background:#eef3f7;color:#365970;font:20px/1 'Segoe UI',sans-serif}
#measure-panel .probe-step-label input{border:1px solid var(--line);border-radius:6px;padding:7px 8px;background:var(--panel);color:var(--ink);font-family:Consolas,monospace}
#measure-panel .probe-snap{font-size:12px;line-height:1.5;min-height:42px;margin:3px 0 10px}
.probe-shortcuts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
#measure-panel .probe-shortcuts button{min-width:0;min-height:42px;padding:7px 5px;border:1px solid #c4d3de;border-radius:6px;background:#eef3f7;color:#365970;font:12px/1.35 'Segoe UI',sans-serif}
#measure-panel .probe-coordinate-row button:hover,#measure-panel .probe-shortcuts button:hover{border-color:#6e9b8a;filter:brightness(.97)}
#measure-panel #measurement-table button{min-height:34px;min-width:40px;padding:5px 8px;border:1px solid var(--line);border-radius:5px;background:var(--panel);color:var(--purple);font:12px 'Segoe UI',sans-serif}
.lab-immersive #measure-panel .probe-reading-card{background:#173248;border-color:#49677b}
.lab-immersive #measure-panel .probe-live-label,.lab-immersive #measure-panel .probe-field-unit-control,.lab-immersive #measure-panel .probe-reading>span,.lab-immersive #measure-panel .probe-reading small,.lab-immersive #measure-panel .probe-component-label,.lab-immersive #measure-panel .probe-components>span{color:#bdd4df}
.lab-immersive #measure-panel .probe-components{border-color:#4a687a}
.lab-immersive #measure-panel .probe-components b{color:#e4f2fa}
.lab-immersive #measure-panel .probe-direction{color:#c9e5dc}
.lab-immersive #measure-panel .probe-reading-actions .view-readings,.lab-immersive #measure-panel #probe-plane-view,.lab-immersive #measure-panel .probe-coordinate-row button,.lab-immersive #measure-panel .probe-shortcuts button{background:#223f53;color:#d1e7ee;border-color:#5a778c}
.lab-immersive #measure-panel .probe-placement-fields input,.lab-immersive #measure-panel .probe-step-label input{background:#142c41;color:#e0eef7;border-color:#4f6d82}

/* Placement help occupies the free centre of the HUD and never changes canvas height. */
.toast{width:max-content;max-width:calc(100vw - 24px);pointer-events:none}
#probe-placement-banner{position:absolute;top:12px;left:240px;right:200px;z-index:4;max-width:480px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:9px 10px;border:1px solid #91c5b0;border-radius:8px;background:#153e3def;box-shadow:0 3px 16px #0004;color:#e3fff1;pointer-events:auto}
#probe-placement-banner[hidden]{display:none!important}
#probe-placement-text{font-size:12px;line-height:1.55;min-width:0;overflow-wrap:anywhere}
.probe-placement-banner-actions{display:flex;gap:5px;flex-wrap:nowrap;justify-content:flex-end}
.probe-placement-banner-actions button{min-height:36px;padding:6px 9px;border:1px solid #a4d3bd;border-radius:5px;background:#bdebd7;color:#173f32;font:12px 'Segoe UI',sans-serif}
.probe-placement-banner-actions #probe-cancel{background:#244d4c;color:#e2fff1;border-color:#8bb5a7}
@media(min-width:761px){body:not(.sources-closed) #probe-placement-banner{left:330px}body:not(.inspector-closed) #probe-placement-banner{right:520px}}
@media(max-width:760px){
  #measure-panel .probe-reading-actions button,#measure-panel .probe-placement-fields select,#measure-panel .probe-placement-fields input,#measure-panel .measure-place button,#measure-panel .probe-unit-label select,#measure-panel .probe-step-label input,#measure-panel .probe-coordinate-row input,#measure-panel .probe-coordinate-row button,#measure-panel .probe-shortcuts button{min-height:44px}
  #measure-panel .probe-coordinate-row{grid-template-columns:48px 40px minmax(0,1fr) 40px}
  #measure-panel .probe-coordinate-row button{width:40px}
  #measure-panel #measurement-table button{min-height:44px}
  #probe-placement-banner{top:120px;left:12px;right:12px;max-width:none;margin:0;padding:8px 10px;gap:8px}
  #probe-placement-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  .probe-placement-banner-actions button{min-height:44px;font-size:12px;padding:6px 8px}
}
@media(max-height:600px) and (min-width:560px){
  #probe-placement-banner{top:12px;left:240px;right:190px;max-width:480px;gap:7px;padding:7px 8px}
  #probe-placement-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;overflow:hidden;font-size:11px;line-height:1.45}
  .probe-placement-banner-actions{max-width:108px;gap:4px}
  .probe-placement-banner-actions button{min-height:34px;padding:5px 7px;font-size:11px}
}

/* Live TeX changes its inline baseline as values change. Keep the clock out of
   the footer's intrinsic line box so playback cannot resize and clear the scene. */
#scene-panel #particle-clock{display:inline-flex;align-items:center;gap:.25em;height:18px;line-height:1;white-space:nowrap;flex:0 0 auto}
