/* Course-specific layout additions; core shell and four themes match the learning hub. */
.computed-equation{font-size:14px;line-height:1.7;margin:10px 0 0;overflow-wrap:anywhere}
.metric-value{font-size:22px;letter-spacing:0}
.metric-label{min-height:44px}
.number-unit{flex-wrap:wrap}
.number-unit input{width:100%;font-size:19px}
.number-unit span{font-size:12px}
.control-panel{overscroll-behavior:contain;padding-bottom:24px}
.range-bounds{gap:8px}
.range-bounds span:last-child{text-align:right}
.model-banner[data-status=valid]{background:var(--cyan);border-color:var(--accent)}
.geometry-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.geometry-grid .diagram{padding:12px}
.geometry-grid .figure-heading h2{font-size:17px}
.geometry-grid svg text{font-size:19px}
.direction-note{font-size:14px;line-height:1.8;padding:14px 16px;border:1px solid var(--border);border-radius:12px;background:var(--surface);margin-top:16px;overflow-wrap:anywhere}
.experiment ol{padding-left:23px;font-size:15px;line-height:1.75}
.experiment li{margin-bottom:12px}
.further-reading{font-size:14px;margin-top:24px}
.further-reading h2{font-size:18px}
.diagram figcaption{overflow-wrap:anywhere}
.provenance p{margin-top:8px}
.invalid-diagram{min-height:180px;display:grid;place-items:center;text-align:center;color:var(--muted)}
@media(max-width:1100px){.geometry-grid{grid-template-columns:1fr}}
@media(max-width:760px){.metric-value{font-size:22px}.control-fields{gap:0 15px}.number-unit input{min-width:0;width:100%;font-size:18px}.control-field{min-width:0}.geometry-grid{grid-template-columns:1fr}.metric-label{min-height:42px}.diagram svg text{font-size:18px}.experiment ol{font-size:16px}.control-footnote{font-size:13px}}

/* Long parameter instructions remain readable within narrow reading cards. */
.experiment li,.experiment .answer{overflow-wrap:anywhere;word-break:normal}

/* A deliberate, persistent view scale for the supported-slider force diagram. */
.force-scale-tools{margin-top:18px;padding:16px 18px;background:var(--surface);border:1px solid var(--border);border-radius:14px;min-width:0}
.force-scale-tools h2{font-size:18px;margin-bottom:9px}
.force-scale-readout{font-size:14px;line-height:1.7;margin-bottom:12px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.force-scale-actions{display:flex;flex-wrap:wrap;gap:8px}
.force-scale-actions button{font-size:14px;min-height:44px;padding:8px 12px}
.force-scale-actions button:disabled{opacity:.5;cursor:default}
.force-scale-note{font-size:13px;color:var(--muted);line-height:1.7;margin:12px 0 0}
.force-view-boundary{fill:none;stroke:var(--border);stroke-width:1;stroke-dasharray:5 5;opacity:.7}
.force-scale-tick{fill:none;stroke:var(--muted);stroke-width:1.2}
.force-break-background{fill:none;stroke:var(--surface);stroke-width:7}
.force-break-mark,.force-continuation{fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}
.force-scale-warning{font-size:14px;line-height:1.7;padding:10px 12px;border-radius:8px;background:var(--wash);margin:12px 0 0;overflow-wrap:anywhere}
.force-scale-warning.is-off-scale{background:var(--pink);border-left:3px solid var(--red)}
.foundation-diagram svg text{font-size:17px}
@media(max-width:760px){.force-scale-tools{padding:15px 13px}.force-scale-actions{gap:7px}.force-scale-actions button{font-size:13px;padding:8px 10px}.foundation-diagram svg text{font-size:17px}}

/* Chapter 3 diagrams keep view state separate from the mechanical state. */
.moment-view-tools{margin:18px 0;padding:16px 18px;background:var(--surface);border:1px solid var(--border);border-radius:14px;min-width:0}
.moment-view-tools h2{font-size:18px;margin-bottom:12px}
.moment-view-actions{display:flex;flex-wrap:wrap;gap:8px}
.moment-view-actions button{min-height:44px;font-size:14px}
#moment-view-readout{font-size:13px;line-height:1.7;margin:12px 0 0;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.moment-comparison{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.moment-comparison .diagram{padding:12px}
.moment-comparison h2{font-size:17px}
.moment-comparison svg text{font-size:20px}
.moment-space-figure h2{font-size:20px}
#moment-space{touch-action:none;user-select:none;cursor:grab;display:block;width:100%;border-radius:8px;background:var(--wash)}
#moment-space:active{cursor:grabbing}
#moment-space text{font-size:18px}
#moment-space-caption.is-off-scale{background:var(--pink);padding:10px;border-left:3px solid var(--red)}
.reading-nav .button{display:flex;margin-top:10px}
@media(max-width:1100px){.moment-comparison{grid-template-columns:1fr}}
@media(max-width:760px){.moment-view-tools{padding:14px 12px}.moment-view-actions button{font-size:13px}.moment-comparison svg text{font-size:18px}.moment-space-figure{padding:12px}#moment-space text{font-size:20px}}

/* The new labs put the visual experiment before its equations and readouts. */
.moment-view-tools{margin:12px 0;padding:12px 14px}.moment-view-tools h2{font-size:15px;margin-bottom:8px}.moment-view-actions{gap:6px}.moment-view-actions button{font-size:13px;min-height:38px;padding:6px 10px}.moment-view-tools .control-footnote{font-size:12px;line-height:1.5;margin:8px 0 0}#moment-view-readout{margin-top:8px;font-size:12px;line-height:1.5}

/* Chapters 1–2: reference-style scene workspace, scoped to preserve Chapter 3. */
.reference-lab .shell{max-width:1440px;padding:24px 32px 60px}
.reference-lab .top-nav{margin-bottom:20px}
.reference-hero{margin-bottom:18px}
.reference-title-row{display:flex;justify-content:space-between;align-items:center;gap:20px}
.reference-title-row h1{font-size:28px;line-height:1.25;margin:0}
.reference-title-row .eyebrow{margin-bottom:6px;font-size:11px}
.reference-title-row .button{white-space:nowrap;font-size:13px;padding:7px 13px;min-height:38px}
.reference-question{font-size:15px;max-width:1040px;margin:12px 0 0;color:var(--muted);line-height:1.6}
.reference-workspace{display:grid;grid-template-columns:minmax(0,1fr)300px;gap:16px 20px;align-items:start}
.reference-stage{border:1px solid var(--border);border-radius:14px;background:var(--surface);padding:12px;min-width:0}
.reference-stage .model-banner{font-size:13px;line-height:1.5;padding:9px 12px;margin:0 0 9px}
.reference-stage .model-error:empty{display:none}
.reference-scene-title{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12px;color:var(--muted);line-height:1.5}
.reference-scene-title h2{font-size:16px;line-height:1.5;margin:0;color:var(--text)}
.reference-scene .diagram{border:0;background:none;border-radius:0;padding:0;margin:8px 0 0;overflow:visible}
.reference-scene .diagram .figure-heading{display:none}
.reference-scene .diagram svg{height:430px;max-height:none;background:var(--wash);border-color:color-mix(in srgb,var(--border) 45%,transparent)}
.reference-scene .diagram figcaption{font-size:12px;line-height:1.5;margin-top:7px}
.reference-scene .foundation-diagram .force-scale-warning{font-size:12px;line-height:1.5;padding:7px 10px;margin-top:7px}
.reference-primary-metrics{display:flex;flex-wrap:wrap;gap:8px 24px;padding:12px 4px;margin-top:8px;border-top:1px solid var(--border)}
.reference-metric{min-width:0;display:grid;grid-template-columns:auto auto;align-items:baseline;column-gap:7px}
.reference-metric>span{font-size:12px;color:var(--muted);grid-column:1/-1}
.reference-metric strong{font-size:22px;line-height:1.4;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.reference-metric small{font-size:12px;color:var(--muted)}
.reference-stage .reference-equation{margin:2px 0 0;padding:10px 12px;background:var(--wash);border-radius:8px}
.reference-equation figcaption{font-size:10px;letter-spacing:.08em}
.reference-equation .equation{font-size:14px;margin:0}
.reference-equation .katex-display{margin:8px 0}
.reference-equation .computed-equation{font-size:12px;line-height:1.5;margin:5px 0 0}
.reference-controls.control-panel{position:sticky;top:66px;max-height:calc(100dvh - 84px);padding:14px;overflow:auto;border-radius:12px}
.reference-controls .control-heading{gap:8px;align-items:center;margin-bottom:10px}
.reference-controls .control-heading h2{font-size:14px;margin:0}
.reference-controls .control-heading button{font-size:12px;padding:5px 8px;min-height:34px}
.reference-control-group{margin:0 0 12px;padding:8px 10px 4px;min-width:0;border:1px solid color-mix(in srgb,var(--border) 65%,transparent);border-radius:9px}
.reference-control-group legend{padding:0 6px;font-size:12px;font-weight:750;color:var(--accent)}
.reference-field.control-field{padding:5px 0 8px;border:0}
.reference-field-row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.reference-field label{font-size:12px;line-height:1.4;max-width:155px}
.reference-field .number-unit{display:flex;flex-wrap:nowrap;gap:4px;align-items:center}
.reference-field .number-unit input{width:82px;min-width:0;padding:4px 6px;font-size:15px;border-radius:5px}
.reference-field .number-unit span{font-size:10px;white-space:nowrap}
.reference-field input[type=range]{width:100%;height:20px;display:block;margin:4px 0 0;accent-color:var(--accent)}
.reference-field .range-bounds{font-size:10px;line-height:1.2}
.reference-controls .control-footnote{font-size:11px;line-height:1.5;margin:0}
.reference-preset-dock{grid-column:1/-1;border:1px solid var(--border);border-radius:12px;padding:12px 16px;background:var(--surface);display:flex;align-items:center;gap:12px 18px;flex-wrap:wrap}
.reference-preset-dock .preset-list{display:flex;gap:7px;flex-wrap:wrap}
.reference-preset-dock button{font-size:12px;padding:7px 12px;min-height:36px}
.reference-preset-dock button[aria-pressed=true]{background:var(--cyan);border-color:var(--accent);color:var(--accent)}
.reference-stage .force-scale-tools,.reference-scale-tools{margin:10px 0 0;border:0;border-top:1px solid var(--border);padding:10px 4px 0;border-radius:0;background:none}
.reference-stage .force-scale-tools h2{font-size:12px;margin:0 0 7px}
.reference-stage .force-scale-readout,.reference-stage .force-scale-note,.reference-scale-tools p{font-size:11px;line-height:1.5;margin:6px 0}
.reference-stage .force-scale-actions button,.reference-scale-actions button{font-size:12px;padding:6px 10px;min-height:34px}
.reference-scale-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}
.reference-diagram-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.reference-diagram-pair h2{font-size:14px;margin:3px 0 5px;color:var(--muted)}
.reference-scene .reference-planar-panel svg{height:360px}
.reference-scene .reference-planar-panel svg text{font-size:20px}
.reference-tabs{display:flex;gap:5px}
.reference-tabs button{font-size:11px;padding:5px 8px;min-height:30px}
.reference-tabs button[aria-pressed=true]{background:var(--cyan);border-color:var(--accent)}
.reference-force-legend{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:12px;padding:8px 4px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.reference-scene-note{font-size:12px;line-height:1.5;color:var(--muted);margin:0;padding:6px 4px}
.reference-scene-note.is-off-scale,.reference-particle-figure figcaption.is-off-scale{background:var(--pink);border-left:3px solid var(--red);padding:8px 10px;color:var(--text)}
.particle-view-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:6px 8px}
.particle-view-toolbar>label{font-size:11px;font-weight:650}
.particle-view-toolbar select{font-size:12px;min-height:32px;padding:4px 8px;max-width:200px}
.particle-view-actions{display:flex;gap:5px;flex-wrap:wrap}
.particle-view-actions button{font-size:11px;min-width:32px;min-height:32px;padding:4px 8px}
#particle-space{touch-action:none;user-select:none;cursor:grab}
#particle-space:active{cursor:grabbing}
#particle-space text{font-size:18px}
#particle-mode-label{font-size:11px;white-space:nowrap}
.reference-detail{margin-top:28px;border-top:1px solid var(--border);padding-top:22px}
.reference-detail h2{font-size:21px}
.reference-detail-grid{display:grid;grid-template-columns:minmax(0,1fr)minmax(0,1fr);gap:28px;align-items:start}
.reference-detail .table-wrap{margin:0}
.reference-detail table{width:100%;font-size:14px;border-collapse:collapse}
.reference-detail th,.reference-detail td{padding:10px 12px;border-bottom:1px solid color-mix(in srgb,var(--border) 50%,transparent);text-align:left;font-variant-numeric:tabular-nums}
.reference-detail th{font-size:13px}
.reference-detail h3{font-size:15px;margin:0 0 10px}
.reference-detail p{font-size:14px;line-height:1.7}
.reference-geometry-metrics{padding:10px 14px;display:flex;flex-wrap:wrap;gap:5px 18px}
.reference-geometry-metrics p{margin:0;font-size:12px}
.reference-detail #particle-projections{margin-top:22px}
.reference-detail #particle-projections .diagram{margin:0}
.reference-reading .reading-method{font-size:13px;color:var(--accent);font-weight:650;margin:14px 0 0}
.reference-reading .reading-section{border-left:3px solid var(--accent);padding:26px 28px}
.reference-reading .reading-section p,.reference-reading .reading-section li{line-height:1.85}
.reference-reading .reading-nav{padding:16px 14px}
.reference-reading .reading-nav a{font-size:12px}
.reference-reading .reading-intro{background:var(--wash)}
@media(max-width:1080px){.reference-workspace{grid-template-columns:minmax(0,1fr)270px;gap:14px}.reference-lab .shell{padding:24px}.reference-diagram-pair{grid-template-columns:1fr}.reference-planar-panel[data-active=false]{display:none}.reference-scene .reference-planar-panel svg{height:400px}.reference-field .number-unit input{width:72px}.reference-field label{max-width:130px}.reference-title-row h1{font-size:26px}}
@media(max-width:760px){
.reference-lab .shell{padding:22px 14px 44px}.reference-lab .top-nav{font-size:12px;margin-bottom:18px}
.reference-title-row{align-items:flex-start;gap:10px;flex-direction:column}.reference-title-row h1{font-size:25px}.reference-title-row .button{font-size:12px;min-height:34px;padding:5px 10px}
.reference-question{font-size:14px;margin-top:12px}.reference-hero{margin-bottom:15px}
.reference-workspace{grid-template-columns:1fr;gap:14px}.reference-stage{padding:10px;order:0}.reference-controls.control-panel{position:static;max-height:none;order:1;padding:15px}.reference-preset-dock{order:2;padding:12px}
.reference-stage .model-banner{font-size:12px;padding:8px 9px}.reference-scene-title{font-size:11px;gap:8px;align-items:flex-start;flex-wrap:wrap}.reference-scene-title h2{font-size:14px}
.reference-scene .diagram svg{height:360px}.reference-scene .foundation-diagram svg text{font-size:18px}.reference-scene .reference-planar-panel svg{height:330px}.reference-scene .reference-planar-panel svg text{font-size:20px}
.reference-primary-metrics{gap:8px 18px;padding:10px 2px}.reference-metric>span{font-size:11px}.reference-metric strong{font-size:20px}.reference-metric small{font-size:11px}
.reference-field label{font-size:13px;max-width:none}.reference-field .number-unit input{width:96px;font-size:17px}.reference-field .number-unit span{font-size:12px}.reference-field input[type=range]{height:28px}.reference-control-group{padding:10px 12px}.reference-control-group legend{font-size:13px}.reference-field.control-field{padding:6px 0 10px}.reference-field .range-bounds{font-size:11px}
.particle-view-toolbar{gap:6px}.particle-view-toolbar select{max-width:210px}.particle-view-actions{gap:4px}.particle-view-actions button{min-height:34px}
#particle-space text{font-size:24px}#particle-mode-label{font-size:10px}
.reference-detail-grid{grid-template-columns:1fr;gap:20px}.reference-detail th,.reference-detail td{padding:9px 10px;font-size:13px}.reference-detail p{font-size:14px}
.reference-reading .reading-section{padding:20px 18px}.reference-reading .reading-method{font-size:12px}
}

/* ROS/RViz world-axis identity, independent of mechanical vector colors. */
:root{--axis-x:#c62828;--axis-y:#16803c;--axis-z:#1d5fd1}
:root[data-theme=dark]{--axis-x:#ff6b6b;--axis-y:#63d471;--axis-z:#6fa8ff}

/* Explanatory vector views in the Chapter 2 reading. */
.theory-vector-figure{margin:18px 0 22px;padding:15px 18px 16px;border:1px solid var(--border);border-radius:12px;background:var(--wash);overflow:hidden}
.theory-vector-label{font-size:11px;font-weight:750;letter-spacing:.12em;color:var(--accent)}
.theory-vector-figure > svg{display:block;width:100%;max-width:520px;height:auto;margin:3px auto}
.theory-vector-figure svg text{font-size:14px;font-weight:650;paint-order:stroke;stroke:var(--wash);stroke-width:4px;stroke-linejoin:round}
.theory-vector-arrow line,.theory-vector-arrow path{fill:none;stroke-width:2.8;stroke-linecap:round;stroke-linejoin:round}
.theory-vector-figure .vector-guide{fill:none;stroke:var(--muted);stroke-width:1.4;stroke-dasharray:5 5;opacity:.7}
.theory-vector-figure figcaption{font-size:14px;line-height:1.65;color:var(--muted)}
@media(max-width:760px){.theory-vector-figure{padding:12px}.theory-vector-figure svg text{font-size:15px}.theory-vector-figure figcaption{font-size:13px}}

:root{--book-force:#c52f59;--book-component:#007ca8}:root[data-theme=dark]{--book-force:#ff87a6;--book-component:#71d4f7}.textbook-views{display:grid;grid-template-columns:1fr;gap:12px}.theory-vector-figure .vector-view-title{font-size:13px;font-weight:650;margin:10px 0 0}.theory-vector-figure .vector-source{font-size:11px;margin:10px 0 0;color:var(--muted)}.theory-vector-figure svg text{font-family:Georgia,serif;font-style:italic}.vector-angle{fill:none;stroke:var(--muted);stroke-width:1}.theory-vector-figure{background:var(--surface)}.theory-vector-figure svg text{stroke:var(--surface)}

/* Reading reference axes are subordinate to force vectors. */
.theory-vector-figure .theory-reference-axes line,.theory-vector-figure .theory-reference-axes path{stroke:#000;stroke-width:1}
:root[data-theme=dark] .theory-reference-axes{filter:drop-shadow(0 0 1px #fff)}

.vector-playback{border-top:1px solid var(--border);margin-top:16px;padding-top:14px}
.vector-playback-buttons{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.vector-playback button{font-size:13px;min-height:42px;padding:7px 10px}
.vector-playback button:disabled{opacity:.45;cursor:default}
.vector-playback button[aria-pressed=true]{background:var(--cyan);border-color:var(--accent)}
.vector-playback-buttons label{display:flex;gap:6px;align-items:center;font-size:13px}
.vector-step-slider{display:flex;align-items:center;gap:10px;font-size:13px;margin:14px 0 10px}
.vector-step-slider input{flex:1;min-width:60px;accent-color:var(--accent)}
.vector-step-slider output{white-space:nowrap;font-variant-numeric:tabular-nums}
.theory-vector-figure .vector-step-note{padding:12px;background:var(--wash);border-radius:8px;font-size:14px;line-height:1.65;min-height:72px;margin-bottom:0}
@media(prefers-reduced-motion:reduce){.theory-vector-figure *{animation:none!important;transition:none!important}}

.vector-phases{list-style:none;padding:0;margin:12px 0;display:flex;flex-wrap:wrap;gap:6px;font-size:12px}
.vector-phases li{padding:5px 8px;border:1px solid var(--border);border-radius:6px;color:var(--muted)}
.vector-phases li[aria-current=step]{background:var(--cyan);color:var(--text);font-weight:750}
.chain-force-legend{display:flex;flex-wrap:wrap;gap:7px 16px;font-size:13px;font-weight:650;min-height:26px}
.theory-vector-figure .chain-result-readout{min-height:26px;font-size:14px;line-height:1.6;margin:6px 0;overflow-wrap:anywhere}

/* Keep force identifiers readable, with a surface halo separating them from geometry. */
.theory-vector-figure .chain-force-label{font-size:18px;font-weight:700;stroke-width:5px}
@media(max-width:760px){.theory-vector-figure .chain-force-label{font-size:22px}.chain-force-legend{font-size:14px}}

.cartesian-basis{margin:10px 0;font-size:15px}
.cartesian-basis small{display:block;margin-top:5px;color:var(--muted);font-size:13px}
[data-theory-vector="rectangular"] .chain-result-readout>span{display:block;margin:7px 0}
[data-theory-vector="rectangular"] .katex{font-size:1em}

/* Cartesian equations share the panel 5 reading rhythm in every section. */
.theory-vector-figure .chain-force-legend{align-items:flex-start;gap:7px 18px}
.theory-vector-figure .chain-force-legend>span{display:block;max-width:100%;overflow-x:auto}
.theory-vector-figure .chain-result-readout>span{display:block;margin:7px 0}
.theory-vector-figure .chain-result-readout small{display:block;font-size:13px;color:var(--muted);margin:7px 0}
.theory-vector-figure .katex{font-size:1em}
.theory-vector-figure .chain-result-readout{overflow-x:auto}
.theory-vector-figure .zero-result-note{font-size:13px;color:var(--muted)}
.theory-vector-figure.has-webgl > svg{display:none}
.vector-webgl-view{margin:12px 0 16px}
.webgl-stage{position:relative;height:360px;border:1px solid var(--border);border-radius:10px;overflow:hidden;background:var(--surface)}
.webgl-stage canvas{display:block;width:100%;height:100%;touch-action:none;cursor:grab;outline-offset:-3px}
.webgl-stage canvas:active{cursor:grabbing}
.webgl-stage canvas:focus-visible{outline:2px solid var(--accent)}
.webgl-labels{position:absolute;inset:0;pointer-events:none;overflow:hidden}
.webgl-label{position:absolute;white-space:nowrap;font:italic 700 17px Georgia,serif;line-height:1.1;padding:2px;text-shadow:1px 0 var(--surface),-1px 0 var(--surface),0 1px var(--surface),0 -1px var(--surface),2px 2px var(--surface),-2px -2px var(--surface)}
.webgl-label sub{font-size:.7em}
.webgl-label[data-label-id^=axis]{font-size:15px;text-shadow:1px 0 #aaa,-1px 0 #aaa,0 1px #aaa,0 -1px #aaa}
.webgl-controls{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
.webgl-controls button{min-height:36px;padding:5px 12px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text);font:inherit;font-size:13px;cursor:pointer}
.theory-vector-figure .webgl-hint{font-size:12px;color:var(--muted);margin:8px 0}
.webgl-fallback{font-size:13px;color:var(--muted)}
@media(max-width:760px){.webgl-stage{height:320px}.webgl-label{font-size:16px}.theory-vector-figure .chain-force-legend{flex-direction:column}.webgl-controls button{min-height:40px}}

@media(max-width:760px){.webgl-controls{gap:4px}.webgl-controls button{padding:5px 8px}}

/* Chapter 3 camera actions keep physical quantities and fixed label anchors intact. */
.chapter3-figure .moment-camera-tools{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}.chapter3-figure .moment-camera-tools button{font-size:13px;min-height:42px}.chapter3-figure svg .theory-reference-axes{paint-order:stroke}.chapter3-figure svg text{font-size:14px}.chapter3-figure .vector-step-slider{display:flex;align-items:center;gap:12px;margin:12px 0}.chapter3-figure .vector-step-slider input{min-width:0;flex:1}

/* Vivid Chapter 3 vector colors shared by arrows, labels and equations. */
.chapter3-figure,.lab2b-view{
 --accent:#008eaf;--book-force:#ed326c;--book-component:#0095df;
 --teal:#129b45;--purple-ink:#913cf0;--amber:#d28a00;--red:#e84b35;
}
:root[data-theme=dark] .chapter3-figure,.lab2b-view{
 --accent:#49d9ed;--book-force:#ff74a4;--book-component:#52caff;
 --teal:#50e68a;--purple-ink:#bf85ff;--amber:#ffd05c;--red:#ff997a;
}

.chapter3-figure .moment-pair-status{margin:10px 0;padding:10px 12px;border:1px solid var(--border);border-left:3px solid var(--purple-ink);border-radius:6px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
.chapter3-figure .moment-pair-status strong,.chapter3-figure .moment-pair-status span{display:block}

/* Chapter 2 vector readouts keep all signed basis components, including zeros. */
.reference-force-legend>[data-vector-components]{display:block;max-width:100%;overflow-x:auto;padding:3px 0;font-size:14px}
.reference-force-legend .katex{font-size:1em}
.component-precision{display:block;flex-basis:100%;color:var(--muted);font-size:12px;line-height:1.6}

/* Cartesian component ghosts: true geometry with alpha 0.3. */
.cartesian-ghost-geometry{pointer-events:none;fill:none;stroke:currentColor}
.cartesian-ghost-shaft{stroke-width:3;stroke-linecap:round}
.cartesian-ghost-head{stroke-width:3;stroke-linejoin:round;fill:none}
.cartesian-ghost-guide{stroke-width:1.4;stroke-dasharray:4 4}
.theory-vector-figure .cartesian-component-label,.reference-lab .cartesian-component-label{fill:currentColor;font:italic 12px Georgia,serif;opacity:.72;stroke:var(--surface);stroke-width:3px;paint-order:stroke;pointer-events:none}
.webgl-label[data-label-id^=ghost-]{font-size:12px;font-weight:500}

.theory-vector-figure .cartesian-ghost-shaft,.theory-vector-figure .cartesian-ghost-head{stroke-width:2.8}

/* Lab2B shares the Chapter3 viewer without adding a second camera toolbar. */
.lab2b-figure.has-webgl>svg{display:none}
.lab2b-figure .webgl-controls{display:none}
.lab2b-figure .webgl-hint{font-size:12px;color:var(--muted);margin:8px 0}
.lab2b-figure .vector-webgl-view{margin:8px 0}
.reference-scene .lab2b-figure #particle-space{background:var(--surface);height:360px}
.lab2b-figure #particle-space text{font:italic 17px Georgia,serif;stroke:var(--surface);stroke-width:3px;paint-order:stroke;stroke-linejoin:round}
.lab2b-figure #particle-space [data-axis] text{stroke:#aaa;stroke-width:2px}

@media(max-width:760px){.reference-scene .lab2b-figure #particle-space{height:320px}.lab2b-figure #particle-space text{font-size:16px}}

.particle-force-toggles{display:flex;flex-wrap:wrap;gap:8px 16px;margin:10px 0;padding:8px 12px 10px;border:1px solid var(--border);border-radius:8px}
.particle-force-toggles[hidden]{display:none}
.particle-force-toggles legend{padding:0 5px;font-size:12px;font-weight:650;color:var(--text)}
.particle-force-toggles label{display:flex;align-items:center;gap:6px;min-height:32px;cursor:pointer;font-size:12px}
.particle-force-toggles input{width:17px;height:17px;margin:0;accent-color:currentColor}
.particle-force-toggles strong{font-size:15px}
.particle-force-toggles small{flex-basis:100%;color:var(--muted);font-size:11px;line-height:1.5}

/* Chapter 4 figures reuse the Chapter 3 stage, camera controls, and vivid palette. */
.chapter4-figure .moment-camera-tools{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.chapter4-figure .moment-camera-tools button{font-size:13px;min-height:42px}

.reading-section p,.reading-section li,.reading-section h2,.check p,.check .answer{overflow-wrap:anywhere}
