/* Physics 11: Impeccable layout, typeset and polish pass. */
:root {
  --ink:#263f38; --muted:#59685f; --accent:#356b59; --gold:#946a2f;
  --paper:#faf9f5; --surface:#fffefa; --soft:#f0f4ed; --line:#dde3da;
  --sidebar:264px; --radius:14px;
  --body:1rem; --small:.875rem; --label:.8125rem;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-6:24px; --space-8:32px; --space-12:48px; --space-16:64px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  font-synthesis:none; color:var(--ink); background:var(--paper); line-height:1.6;
  scrollbar-color:#a4b5a1 #edf1e8; scrollbar-width:thin;
}
* {box-sizing:border-box}
body {margin:0}
::selection {background:#d6e8cf;color:#173f37}
input,textarea {caret-color:var(--accent)}
button,input,select,textarea {font:inherit;color:inherit}
button,a,input,select,textarea {-webkit-tap-highlight-color:transparent}
button {cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 16px;border:1px solid var(--line);border-radius:8px;background:var(--surface);font-size:var(--small);font-weight:500;line-height:1.35;transition:background .16s ease-out,border-color .16s ease-out}
button:hover {background:var(--soft);border-color:#a4baa0}
button:active {background:#dcebd4}
button:disabled {cursor:default;opacity:.5}
button.primary {background:var(--ink);border-color:var(--ink);color:#fff}
button.primary:hover {background:#23604f}
button.active {background:#e4eddf;border-color:#9cb398;color:#174c35}
a {color:var(--accent);text-decoration:none;text-underline-offset:.22em}
a:hover {text-decoration:underline}
a.external {display:inline-flex;gap:6px;align-items:center}
:focus-visible {outline:3px solid var(--gold);outline-offset:4px}
.content:focus {outline:none}
.icon {flex:none;vertical-align:middle}
h1,h2,h3,p {margin-top:0}
h1,h2,.serif {font-family:Georgia,"Times New Roman",serif;font-weight:400}
h1 {font-size:clamp(2.25rem,3.8vw,3.5rem);line-height:1.12;letter-spacing:-.025em;margin-bottom:24px;text-wrap:balance;overflow-wrap:break-word}
h2 {font-size:clamp(1.625rem,2.3vw,2rem);line-height:1.25;letter-spacing:-.018em;text-wrap:balance}
h3 {font-size:1.0625rem;line-height:1.4;font-weight:600}
p {line-height:1.75;max-width:72ch}
small,.helper,.graph-caption,.session-note {font-size:var(--small);color:var(--muted);line-height:1.6}
.field-label {font-size:var(--label);font-weight:600;color:var(--muted)}
.shell {min-height:100vh;display:grid;grid-template-columns:var(--sidebar) minmax(0,1fr)}
.sidebar {position:fixed;inset:0 auto 0 0;z-index:40;width:var(--sidebar);padding:32px 16px 20px;background:#f3f4ef;border-right:1px solid var(--line);display:flex;flex-direction:column}
.brand {display:flex;gap:12px;align-items:center;margin:0 12px 28px}
.brand-mark {font-family:Georgia,serif;font-size:36px;line-height:1;color:var(--accent)}
.brand strong {font-family:Georgia,serif;font-size:25px;font-weight:400;display:block;line-height:1.2}
.brand small {font-size:11px;letter-spacing:.08em;display:block;margin-top:5px;color:var(--muted)}
.search {width:100%;padding:11px 12px;background:#fff;border:1px solid var(--line);border-radius:8px;font-size:var(--small);min-height:44px}
input::placeholder,textarea::placeholder {color:#637461;opacity:1}
.side-top {display:flex;gap:8px;margin:12px 0}
.side-top button {flex:1;font-size:var(--label);padding:8px;background:transparent}
.sandbox-nav {justify-content:flex-start;font-size:var(--label);background:transparent;border-color:transparent;margin-bottom:4px}
.chapters {flex:1;overflow:auto;overscroll-behavior:contain;padding-right:4px;scrollbar-width:thin}
.group-label {font-size:12px;font-weight:600;margin:24px 12px 8px;color:#596e53}
.chapter-link {display:flex;width:100%;justify-content:flex-start;gap:10px;text-align:left;padding:10px 12px;border:0;background:transparent;font-size:var(--label);min-height:44px}
.chapter-link .n {min-width:20px;color:#5e7358;font-variant-numeric:tabular-nums}
.chapter-link.selected {background:#e4ebe0;color:#174c35;font-weight:600}
.done-dot {margin-left:auto;color:var(--accent)}
.side-foot {font-size:12px;color:var(--muted);line-height:1.7;margin:20px 10px 0;padding-top:16px;border-top:1px solid var(--line)}
.progress-track {height:5px;border-radius:4px;background:#d6e2d0;margin:10px 0;overflow:hidden}
.progress-track span {display:block;height:100%;background:var(--accent)}
.main {grid-column:2;min-width:0}
.topbar {min-height:72px;padding:16px 40px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);font-size:var(--label);color:var(--muted)}
.breadcrumb {display:flex;align-items:center;gap:12px;min-width:0}
.breadcrumb>span:last-child {overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.menu {display:none}
.content {max-width:1200px;padding:56px clamp(24px,4vw,56px) 88px;margin:auto}
.intro {max-width:78ch}
.intro>p {font-size:var(--body);color:var(--muted);margin-bottom:20px}
.meta {display:flex;gap:8px 20px;flex-wrap:wrap;color:var(--muted);font-size:var(--label);margin:20px 0 28px}
.tabs {display:flex;gap:24px;border-bottom:1px solid var(--line);margin:24px 0 32px;overflow:auto;scrollbar-width:thin}
.tab {padding:14px 0;background:transparent;border:0;border-radius:0;font-size:var(--small);font-weight:500;color:var(--muted);white-space:nowrap}
.tab.selected {color:var(--ink);box-shadow:inset 0 -2px var(--accent)}
.tab:hover {background:transparent;color:var(--ink)}
.section-row {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.section-row h2,.section-row h3 {margin:0}
.lab-tabs {display:flex;gap:8px;flex-wrap:wrap;margin-bottom:20px}
.lab-tabs button {font-size:var(--small)}
.lab-card {border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:var(--surface)}
.lab-header {display:flex;justify-content:space-between;align-items:center;gap:16px;padding:20px 24px;border-bottom:1px solid var(--line)}
.lab-header h3 {margin:0;font-size:1.0625rem}
.status {font-size:12px;color:var(--accent);font-weight:500;white-space:nowrap}
.canvas-wrap {position:relative}
.scene-stage {position:relative;aspect-ratio:840/370;overflow:hidden;background:var(--soft)}
.scene-stage #scene {display:block;width:100%;height:auto}
.drag-layer {position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.drag-handle {pointer-events:all;cursor:grab;touch-action:none}
.drag-handle:active {cursor:grabbing}
.grab-ring {fill:#ffffffcc;stroke:#173f37;stroke-width:2;stroke-dasharray:3 3}
.grabbed,.drag-handle:focus-visible .grab-ring {fill:#f1d6a8;stroke-width:3}
.drag-handle:focus-visible {outline:none}
.canvas-toolbar {display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:16px 24px;background:#fff;border-top:1px solid var(--line)}
.canvas-toolbar #play {background:var(--ink);color:#fff;border-color:var(--ink);min-width:100px}
.canvas-toolbar #play:hover {background:#23604f}
.canvas-toolbar .helper {font-variant-numeric:tabular-nums;margin-right:auto}
.canvas-toolbar button[aria-pressed=true]:not(#play) {background:var(--soft);border-color:#91b086}
.drag-hint {display:flex;align-items:flex-start;gap:10px;font-size:var(--small);color:#365c43;background:var(--soft);padding:16px 24px;margin:0;max-width:none;line-height:1.65}
.drag-hint .icon {margin-top:3px}
.control-panel {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 32px;padding:28px 24px;border-top:1px solid var(--line)}
.control {min-width:0}
.control label {display:flex;justify-content:space-between;align-items:center;gap:12px;margin-bottom:12px;font-size:var(--small);font-weight:500;line-height:1.4}
.number-wrap {display:flex;gap:8px;align-items:center;flex:none}
.number-wrap input {width:88px;min-height:40px;border:1px solid var(--line);padding:8px;text-align:right;font-size:var(--small);font-variant-numeric:tabular-nums;background:#f7faf4;border-radius:6px}
.number-wrap span {min-width:28px;font-size:var(--label);color:var(--muted)}
.control input[type=range] {display:block;width:100%;height:28px;accent-color:var(--accent);cursor:pointer;margin:0}
.range-bounds {display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin-top:4px;font-variant-numeric:tabular-nums}
.equation-box {padding:24px;background:var(--soft);border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:24px}
.formula {font-family:Georgia,serif;font-size:clamp(1.125rem,2vw,1.5rem);line-height:1.55;margin-top:8px;overflow-wrap:anywhere}
.output {text-align:right;min-width:130px}
.output .value {font-family:Georgia,serif;font-size:2rem;line-height:1.3;margin-top:8px;color:var(--accent);font-variant-numeric:tabular-nums}
.output .unit {font-family:inherit;font-size:var(--small);margin-left:8px;color:#46634a}
.live-text {max-width:none;margin:0;padding:20px 24px;color:#365c43;border-top:1px solid var(--line);font-size:var(--body)}
.metric-strip {display:flex;flex-wrap:wrap;gap:24px;padding:20px 24px;border-top:1px solid var(--line)}
.metric-item {flex:1;min-width:130px}
.metric-item small {display:block;font-size:var(--label);margin-bottom:6px}
.metric-item strong {font-size:1.0625rem;font-weight:600;font-variant-numeric:tabular-nums}
.graph-card {padding:28px 0;border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin:40px 0;background:transparent}
.graph-card .section-row h3 {font-size:1.0625rem;max-width:42ch}
select {font-size:var(--small);border:1px solid var(--line);border-radius:8px;padding:10px 12px;min-height:44px;background:#fff;max-width:100%}
.graph-card select {max-width:230px}
.graph-card canvas {display:block;width:100%;height:auto;aspect-ratio:840/270}
.legend {display:flex;flex-wrap:wrap;gap:20px;font-size:var(--label);color:var(--muted);padding:12px 0 20px}
.legend span:before {content:'';display:inline-block;width:20px;height:3px;vertical-align:middle;background:var(--accent);margin-right:8px}
.legend .baseline:before {background:var(--gold)}
.graph-caption {margin-bottom:0}
.split {display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:32px;margin:40px 0}
.card {padding:24px 0;border:0;border-top:1px solid var(--line);background:transparent;border-radius:0}
.card h3 {margin-bottom:12px}
.card p {font-size:var(--body);color:var(--muted);margin-bottom:0}
.assumption {padding:24px;border:0;border-radius:var(--radius);background:#f3f2e7}
.assumption p {color:#615c3b}
.chapter-footer {border-top:1px solid var(--line);margin-top:40px;padding-top:24px;display:flex;gap:12px;justify-content:space-between}
.mark-button.complete {background:#e4efdb;color:#285835}
.home-hero {display:grid;grid-template-columns:minmax(0,1.45fr) minmax(230px,1fr);gap:56px;padding:24px 0 48px;align-items:center}
.home-hero h1 {font-size:clamp(2.5rem,4vw,3.75rem);line-height:1.12;margin-bottom:24px}
.home-hero p {font-size:var(--body);color:var(--muted);max-width:45ch}
.hero-actions {display:flex;align-items:center;gap:20px;flex-wrap:wrap;margin-top:28px}
.hero-actions a {font-size:var(--small)}
.start-experiments {border-left:1px solid var(--line);padding-left:32px}
.start-experiments h2 {font-family:inherit;font-size:var(--small);font-weight:600;margin-bottom:12px}
.start-experiments button {display:flex;justify-content:space-between;width:100%;text-align:left;padding:16px 0;border:0;border-top:1px solid var(--line);border-radius:0;background:transparent;gap:16px}
.start-experiments button:hover {color:var(--accent);background:var(--soft)}
.start-experiments strong {font-size:1.0625rem;font-weight:500;display:block}
.start-experiments small {display:block;margin-top:5px;font-size:var(--label);line-height:1.5}
.book-summary {border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;font-size:var(--label);color:var(--muted);max-width:none;margin:0 0 48px}
.book-summary strong {font-weight:500;color:var(--ink)}
.catalog-heading {margin-bottom:28px}
.catalog-heading a {display:flex;gap:8px;align-items:center;font-size:var(--small)}
.chapter-catalog {display:grid;gap:32px}
.catalog-group {display:grid;grid-template-columns:140px minmax(0,1fr);gap:24px;padding-top:24px;border-top:1px solid var(--line)}
.catalog-group>h3 {margin:12px 0;color:var(--muted);font-size:var(--small);font-weight:500}
.chapter-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 28px}
.chapter-tile {min-height:88px;display:flex;align-items:center;justify-content:flex-start;gap:14px;text-align:left;padding:16px 8px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent}
.chapter-tile:hover {background:var(--soft);border-color:var(--line)}
.chapter-number {font-family:Georgia,serif;font-size:1.25rem;color:#637759;min-width:26px;font-variant-numeric:tabular-nums}
.chapter-description {flex:1;min-width:0}
.chapter-description strong {display:block;font-family:Georgia,serif;font-size:1.2rem;line-height:1.3;font-weight:400}
.chapter-description small {display:block;font-size:12px;margin-top:6px}
.chapter-tile>.icon {color:var(--accent)}
.question {margin-bottom:32px}
.question h3 {font-family:Georgia,serif;font-size:1.375rem;font-weight:400;line-height:1.5;max-width:65ch}
.scenario {display:flex;flex-wrap:wrap;gap:8px;margin:24px 0}
.chip {background:#f0f5eb;border:1px solid var(--line);padding:8px 12px;border-radius:6px;font-size:var(--small);font-variant-numeric:tabular-nums}
.answer-row {display:flex;align-items:center;gap:12px;margin:24px 0;flex-wrap:wrap}
.answer-row input {flex:1;min-width:160px;max-width:360px;min-height:48px;border:1px solid #a6b9a0;border-radius:8px;padding:12px;font-size:var(--body)}
.answer-row span {font-size:var(--small);color:var(--muted)}
.feedback {padding:16px 20px;border-radius:10px;margin:20px 0;background:#e8f3e1;color:#285835;font-size:var(--body);line-height:1.7}
.feedback.wrong {background:#f5ecdd;color:#73521e}
.quiz-options {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.quiz-options button {justify-content:flex-start;text-align:left;font-size:var(--body);padding:14px 16px}
.quiz-options button.correct {background:#e4efdb;border-color:#9bb58f}
.quiz-options button.wrong {background:#f5ecdd;border-color:#c5aa7e}
.worked {font-size:var(--body);line-height:1.8}
.worked code {display:block;padding:16px;background:#edf4e5;white-space:pre-wrap;overflow-wrap:anywhere;border-radius:8px;margin:16px 0;color:#365740;font-size:var(--small)}
.worked ul {padding-left:24px;font-size:var(--small)}
.book-note {padding:20px 24px;background:#f3f1e5;color:#625a38;font-size:var(--small);line-height:1.75;margin-bottom:24px;border-radius:10px;max-width:80ch}
.source-reader {max-width:76ch}
.source-reader pre {font-family:Georgia,serif;font-size:1.0625rem;line-height:1.85;white-space:pre-wrap;overflow-wrap:anywhere;color:#324f3b;margin:24px 0}
.source-figure-note {font-size:var(--small);color:var(--muted);padding-top:24px;border-top:1px solid var(--line)}
.source-list {display:flex;gap:8px;flex-wrap:wrap;margin:20px 0 28px}
.section-link {text-align:left;justify-content:flex-start;background:#eff4e9;border:0;padding:10px 12px;font-size:var(--label);color:var(--accent)}
.source-question {padding:28px 0;border:0;border-top:1px solid var(--line);margin:16px 0;background:transparent}
.source-question .prompt {white-space:pre-wrap;font-family:Georgia,serif;font-size:1.0625rem;line-height:1.75;max-width:72ch;overflow-wrap:anywhere}
.source-question textarea {width:100%;min-height:120px;border:1px solid #b5c5ad;padding:16px;border-radius:8px;font-size:var(--body);line-height:1.7;background:#fff;margin:12px 0;resize:vertical}
.source-question label {font-size:var(--small);font-weight:500;display:block;margin-top:24px}
.source-question header {display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:20px}
.source-question header strong {font-size:var(--small)}
.source-question summary {font-size:var(--small);color:var(--accent)}
.source-question .printed {white-space:pre-wrap;overflow-wrap:anywhere;font-size:var(--body);line-height:1.8;color:#625a38;background:#f3f1e5;padding:20px;border-radius:10px}
.filter-row {display:flex;align-items:center;gap:12px;margin-bottom:24px;flex-wrap:wrap}
.filter-row input {flex:1;min-width:220px;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font-size:var(--small);background:#fff}
.plan-table {overflow:auto;margin:32px 0}
.plan-table table {width:100%;min-width:720px;border-collapse:collapse;font-size:var(--small)}
.plan-table th,.plan-table td {text-align:left;vertical-align:top;padding:20px 16px;border-bottom:1px solid var(--line);line-height:1.7}
.plan-table th {font-size:var(--label);font-weight:600;color:var(--muted);background:var(--soft)}
.plan-table td:first-child {min-width:190px;font-family:Georgia,serif;font-size:1.0625rem}
.plan-table td:last-child {color:var(--muted)}
.lab-plan {margin-bottom:12px}
.page-banner {margin-bottom:32px;font-size:var(--small)}
.plan-intro {font-size:var(--body);color:var(--muted)}
.sandbox-invite {display:flex;align-items:center;justify-content:space-between;gap:24px;margin-top:32px}
.sandbox-invite p {margin:0}
.drop-stage {overflow:hidden;background:var(--soft)}
.drop-stage svg {display:block;width:100%;touch-action:none}
.mass-handle {cursor:grab;touch-action:none}
.mass-handle:active {cursor:grabbing}
.mass-handle:focus-visible {outline:none}
.mass-handle:focus-visible circle:first-child {stroke:#173f37;stroke-width:5}
summary {cursor:pointer;min-height:44px;line-height:1.6;padding:12px 0;font-size:var(--small)}
details[open]>summary {margin-bottom:8px}
.loading,.empty {padding:40px;color:var(--muted);font-size:var(--body)}
.storage-warning,.offline {padding:16px 24px;background:#f5ecdd;color:#73521e;font-size:var(--small)}
.hidden {display:none!important}
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.skip-link {position:fixed;top:12px;left:12px;padding:12px 20px;background:var(--ink);color:white;z-index:100;transform:translateY(-200%);border-radius:8px}
.skip-link:focus {transform:translateY(0)}
.nav-backdrop,.nav-close {display:none}
.nav-empty{padding:16px 12px;font-size:var(--small);color:var(--muted)}
@media(min-width:1500px){:root{--sidebar:280px}.content{padding-top:56px}}
@media(max-width:1120px){:root{--sidebar:236px}.content{padding:36px 28px 64px}.topbar{padding-inline:28px}.home-hero{gap:28px;grid-template-columns:1fr}.start-experiments{border-left:0;padding-left:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}.start-experiments h2{grid-column:1/-1;margin-bottom:0}.start-experiments button{align-items:flex-start}.catalog-group{grid-template-columns:1fr;gap:4px}.catalog-group>h3{margin:0 0 12px}.split{grid-template-columns:1fr;gap:16px}}
@media(max-width:760px){:root{--sidebar:288px}.shell{display:block}.sidebar{height:100dvh;transform:translateX(-100%);transition:transform .2s ease-out}.sidebar.open{transform:translateX(0)}.nav-close{display:inline-flex;align-self:flex-end;min-height:44px;margin:-12px 0 12px}.nav-backdrop{display:block;position:fixed;inset:0;background:#173f3777;border:0;border-radius:0;z-index:35}.nav-backdrop:hover{background:#173f3777}.main{width:100%}.menu{display:inline-flex;min-width:44px;padding:10px}.topbar{min-height:68px;padding:12px 16px;gap:8px}.breadcrumb{gap:8px}.breadcrumb>span{display:none}.topbar>.external{font-size:12px;white-space:nowrap}.content{padding:32px 20px 56px}h1{font-size:2.25rem}.home-hero{padding:0 0 28px;gap:24px}.home-hero h1{font-size:2.75rem}.start-experiments{grid-template-columns:1fr;gap:0}.start-experiments h2{margin-bottom:12px}.start-experiments button{padding:16px 0;align-items:center}.book-summary{margin-bottom:32px}.catalog-heading{align-items:flex-start;flex-direction:column}.chapter-grid{grid-template-columns:1fr;gap:0}.chapter-tile{padding:18px 8px}.chapter-catalog{gap:24px}.meta{gap:8px 16px}.tabs{gap:20px;margin-bottom:24px}.section-row{flex-wrap:wrap;align-items:flex-start}.section-row h2{font-size:1.625rem}.lab-header{padding:16px 20px;flex-wrap:wrap}.scene-stage{aspect-ratio:530/370}.scene-stage #scene{width:100%;max-width:100%}.scene-stage .drag-layer{width:100%;height:100%}.drag-handle circle:first-of-type{r:40}.grab-ring{r:16;stroke-width:2.5}.canvas-toolbar{padding:16px;gap:8px}.canvas-toolbar .helper{width:100%;order:3;margin:0}.canvas-toolbar #play{min-width:100px}.drag-hint{padding:16px 20px}.control-panel{padding:24px 20px;gap:24px;grid-template-columns:1fr}.control label{gap:16px}.number-wrap input{min-height:44px}.equation-box{padding:24px 20px;flex-direction:column;align-items:stretch;gap:20px}.output{text-align:left}.output .value{font-size:2rem}.live-text,.metric-strip{padding:20px}.metric-item{min-width:120px}.graph-card{margin:32px 0;padding:24px 0}.graph-card select{max-width:100%}.graph-card .section-row label{width:100%}.graph-card .section-row label select{width:100%}.graph-card .section-row>div{display:flex;flex-wrap:wrap;gap:8px}.legend{gap:12px;font-size:12px}.split{margin:32px 0}.assumption{padding:20px}.chapter-footer{flex-wrap:wrap}.chapter-footer button{flex:1;min-width:130px}.quiz-options{grid-template-columns:1fr}.answer-row input{max-width:none}.book-note{padding:16px 20px}.filter-row{align-items:stretch}.filter-row input{min-width:0;flex-basis:100%}.filter-row select{flex:1}.source-question header{align-items:flex-start;flex-wrap:wrap}.source-reader pre{font-size:1rem}.sandbox-invite{display:block}.sandbox-invite button{margin-top:20px;width:100%}.drop-stage{aspect-ratio:auto}.drop-stage svg{width:100%;max-width:100%}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
@media print{.sidebar,.topbar,.canvas-toolbar,.lab-tabs,.tabs,.chapter-footer,button,.drag-layer,.skip-link{display:none!important}.shell{display:block}.main{width:100%}.content{padding:0}.lab-card,.source-question{break-inside:avoid}input[type=range]{display:none}.graph-card{break-inside:avoid}}

/* Deliberate physics playback; always starts paused. */
.playback-controls{display:flex;flex-wrap:wrap;gap:20px 24px;padding:20px 24px;border-top:1px solid var(--line);background:#f7faf3}
.playback-controls label{font-size:var(--label);font-weight:500;display:flex;align-items:center;gap:12px}.playback-controls select{min-width:155px}.replay-control{flex:1;min-width:240px}.replay-control input{flex:1;min-width:100px;height:30px;accent-color:var(--accent);cursor:pointer}.animation-readout{flex-basis:100%;margin:0;max-width:78ch;font-size:var(--small);color:#365c43;line-height:1.65;font-variant-numeric:tabular-nums}
@media(max-width:760px){.playback-controls{padding:16px 20px;gap:16px}.playback-controls label{width:100%;justify-content:space-between}.replay-control{min-width:0}.playback-controls select{min-width:0;max-width:210px}.replay-control input{max-width:65%}}

/* Electrical controls share the book's quiet palette. */
.circuit-controls{display:flex;align-items:center;flex-wrap:wrap;gap:16px;padding:18px 24px;border-bottom:1px solid var(--border,#d2dfd5)}
.circuit-controls label{display:flex;align-items:center;gap:10px;font-size:13px}
.circuit-controls .helper{flex:1;min-width:180px}
.mode-buttons{display:flex;gap:6px}.mode-buttons .active{background:#173f37;color:#fff}
@media(max-width:600px){.circuit-controls{padding:14px}.circuit-controls label{flex-wrap:wrap}.circuit-controls select{max-width:100%}}
.optics-card{margin-top:24px}.image-upload{flex-wrap:wrap}.image-upload input{font-size:12px;max-width:240px}.image-upload input::file-selector-button{border:1px solid var(--line);border-radius:7px;background:var(--surface);color:var(--ink);padding:8px 10px;margin-right:8px;cursor:pointer}.optics-card .circuit-controls input[type=checkbox]{accent-color:var(--accent);width:16px;height:16px}.optics-card .graph-caption{padding:0 24px 20px}
.optics-card .drop-stage{overflow:hidden;aspect-ratio:auto}.optics-card .drop-stage svg{width:100%;max-width:100%;touch-action:pan-y pinch-zoom}

/* Phone layouts use complete diagrams and stacked panels, not oversized crops. */
html{scroll-padding-top:88px}body{overflow-wrap:break-word}button,input,select,textarea{touch-action:manipulation}.main,.content,.lab-card,.control-panel,.split>*,.chapter-footer>*{min-width:0}.sidebar>*{flex-shrink:0}.sidebar .chapters{flex-shrink:1;min-height:80px}.drop-stage svg{touch-action:pan-y pinch-zoom}.mass-handle,.drag-handle{touch-action:none}
@media(max-width:760px){
 :root{--radius:12px}html{-webkit-text-size-adjust:100%}.content{padding:24px 12px calc(40px + env(safe-area-inset-bottom))}.topbar{position:sticky;top:0;z-index:20;background:#fcfcf8f5;min-height:60px;padding:8px max(12px,env(safe-area-inset-left));box-shadow:0 1px 0 var(--line)}.topbar>.external{font-size:0;min-width:48px;min-height:48px;justify-content:center}.topbar>.external::after{content:'PDF ↗';font-size:13px}.breadcrumb>a{font-size:14px}.menu{min-width:48px;min-height:48px}
 h1,.home-hero h1{font-size:clamp(2rem,8vw,2.5rem);margin-bottom:16px}p{line-height:1.65}.intro>p{margin-bottom:16px}.meta{margin:16px 0;gap:6px 12px}.meta span{font-size:12px}.tabs{position:relative;gap:18px;margin:16px 0 24px;overscroll-behavior-x:contain;scroll-snap-type:x proximity}.tabs button{min-height:48px;scroll-snap-align:start}.lab-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.lab-tabs button{min-height:48px;padding:10px 12px;white-space:normal;text-align:left;justify-content:flex-start;font-size:14px}
 button{min-height:48px}.canvas-toolbar{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:12px;gap:8px}.canvas-toolbar .helper{grid-column:1/-1;order:3;width:auto}.canvas-toolbar button{width:100%;min-width:0!important;padding:12px 8px}.lab-header{padding:16px;gap:8px}.lab-header h3{font-size:16px}.status{font-size:11px;white-space:normal}.drag-hint{padding:14px 16px;font-size:14px}
 input:not([type=range]):not([type=checkbox]):not([type=file]),select,textarea{font-size:16px!important}input[type=range]{height:44px!important;touch-action:pan-y}.control-panel{padding:20px 16px;gap:22px}.control label{flex-wrap:wrap;align-items:flex-start;gap:8px;font-size:15px}.control label>span:first-child{flex:1;min-width:120px}.number-wrap{max-width:100%}.number-wrap input{width:88px;min-height:48px}.number-wrap span{min-width:20px}.number-wrap input:focus{background:#fff}.range-bounds{margin-top:0}
 .playback-controls{padding:16px;gap:16px}.playback-controls label{display:flex;flex-direction:column;align-items:stretch;gap:8px;min-width:0}.playback-controls select{max-width:100%;width:100%;min-height:48px}.replay-control input{min-width:0;width:100%;max-width:100%;margin:0}.animation-readout{font-size:14px}.circuit-controls{padding:16px;gap:12px}.circuit-controls>label{width:100%;display:flex;flex-direction:column;align-items:stretch;gap:8px;font-size:14px}.circuit-controls select{width:100%;min-width:0}.circuit-controls .helper{min-width:0;flex-basis:100%;font-size:14px}.circuit-controls .mode-buttons{width:100%}.mode-buttons button{flex:1}.image-upload input{max-width:100%;width:100%;min-height:48px;font-size:14px}.optics-card .circuit-controls label:has(input[type=checkbox]){flex-direction:row;align-items:center;min-height:48px}.optics-card .circuit-controls input[type=checkbox]{width:24px;height:24px}
 .metric-strip{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px;padding:16px}.metric-item{min-width:0}.metric-item small{font-size:12px}.metric-item strong{font-size:17px;overflow-wrap:anywhere}.equation-box{padding:20px 16px;gap:14px}.formula{font-size:19px}.live-text{padding:16px;font-size:15px}.optics-card .graph-caption{padding:0 16px 16px;font-size:13px}.graph-card{margin:24px 0}.graph-card canvas{aspect-ratio:420/270}.graph-card .section-row>div{width:100%}.graph-card .section-row>div button{flex:1}.legend{font-size:13px}
 .sidebar{width:min(340px,calc(100vw - 32px));padding:16px max(16px,env(safe-area-inset-left)) max(16px,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain}.sidebar .chapters{overflow:visible;flex:none;min-height:0}.sidebar .brand{margin-bottom:18px}.sidebar .side-foot{margin-top:16px}.sidebar .sandbox-nav{margin-bottom:8px}.sidebar .chapter-link{min-height:48px;font-size:14px}.sidebar .search{font-size:16px}.nav-close{position:sticky;top:0;z-index:1;background:#f1f4ec;margin:0 0 8px}.nav-backdrop{touch-action:none}
 .home-hero{gap:20px}.hero-actions{margin-top:20px;gap:14px}.hero-actions .primary{width:100%}.chapter-description strong{font-size:19px}.book-summary{font-size:13px;line-height:1.7;margin-bottom:28px}.chapter-tile{padding:16px 4px}.chapter-catalog{gap:18px}.split{margin:24px 0}.card{padding-top:20px}.assumption{padding:18px}.question h3{font-size:21px}.answer-row{gap:10px}.answer-row input{min-width:0;width:75%;flex-basis:75%}.answer-row button{width:100%;flex-basis:100%}.filter-row>button{width:100%}.filter-row select{width:100%;flex-basis:100%}.source-question header{gap:10px}.source-question header button{width:100%}.source-list{display:grid;grid-template-columns:1fr}.source-list button{width:100%}.chapter-footer{gap:8px}.chapter-footer button{font-size:13px;padding:10px 8px}.chapter-footer .mark-button{order:3;flex-basis:100%}.plan-table table,.plan-table tbody,.plan-table tr,.plan-table td{display:block;width:100%;min-width:0}.plan-table thead{display:none}.plan-table tr{border:1px solid var(--line);border-radius:12px;margin-bottom:16px;overflow:hidden}.plan-table td{padding:16px;min-width:0!important}.plan-table td:first-child{background:var(--soft)}.plan-table td:nth-child(2)::before{content:'Experiments';display:block;font-weight:600;margin-bottom:10px}.plan-table td:nth-child(3)::before{content:'Reading and practical work';display:block;font-weight:600;margin-bottom:10px}.plan-table td:last-child{border-bottom:0}
}
@media(max-width:360px){.lab-tabs{grid-template-columns:1fr}.control label{flex-direction:column}.number-wrap{width:100%;justify-content:flex-end}.section-row>button{width:100%}.metric-strip{gap:16px 8px}}
@media(min-width:761px) and (max-width:1024px){.shell{display:block}.main{width:100%}.sidebar{height:100dvh;width:320px;transform:translateX(-100%);transition:transform .2s ease-out;overflow:auto;overscroll-behavior:contain}.sidebar.open{transform:translateX(0)}.sidebar .chapters{overflow:visible;flex:none}.nav-close{display:inline-flex;align-self:flex-end;min-height:48px}.nav-backdrop{display:block;position:fixed;inset:0;background:#173f3777;z-index:35;border:0;border-radius:0;touch-action:none}.menu{display:inline-flex;min-width:48px;min-height:48px}}
@media(max-width:760px){.energy-panel text{font-size:24px}.transient-panel text{font-size:22px}.optics-card text{font-size:16px}.optics-card [data-testid=optics-object] text,.optics-card [data-testid=optics-formed-image] text{font-size:inherit}}

/* Calm study surfaces: color recedes while the experiment stays immediate. */
.quark-play [role=button]:focus-visible {outline:none}
.quark-play [role=button]:focus-visible circle:nth-child(2) {stroke:#946a2f;stroke-width:4}
@media(hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference){
 .content h1 {transition:color .2s ease-out,transform .2s cubic-bezier(.16,1,.3,1);transform:translate(var(--heading-x,0px),var(--heading-y,0px))}
 .content h1:hover {color:var(--accent)}
 .content h1 em {text-decoration:underline;text-decoration-color:transparent;text-underline-offset:.14em;transition:text-decoration-color .2s ease-out}
 .content h1:hover em {text-decoration-color:var(--line)}
}
button {transition:background-color .18s cubic-bezier(.16,1,.3,1),border-color .18s cubic-bezier(.16,1,.3,1),color .18s cubic-bezier(.16,1,.3,1)}
button.primary:hover,.canvas-toolbar #play:hover {background:#355b4e}
button.active {background:#e7eee3;border-color:#a8bba1;color:var(--ink)}
.sandbox-nav:hover {border-color:var(--line)}
.sandbox-nav.active {background:#e4ebe0;border-color:transparent}
.topbar {background:var(--paper)}
.meta {gap:8px 16px}
.intro>p {max-width:65ch;line-height:1.8}
.lab-tabs {gap:10px;margin-bottom:24px}
.lab-tabs button {background:transparent}
.lab-tabs button.active {background:#e7eee3}
.lab-header {background:var(--surface);padding-block:24px}
.canvas-toolbar {background:var(--surface)}
.control-panel {background:var(--surface);gap:32px}
.number-wrap input {background:var(--paper)}
.playback-controls {background:var(--paper)}
.source-reader pre {color:var(--ink);line-height:1.9}
.source-reader .search {background:var(--surface)}
.source-reader .book-note {margin-bottom:32px}
.book-summary {border-top:0;padding-top:0;line-height:1.9}
.start-experiments button {padding-inline:12px}
.start-experiments h2 {padding-inline:12px}
.chapter-tile>.icon,.start-experiments button>.icon {color:var(--muted)}
.chapter-tile:hover>.icon,.start-experiments button:hover>.icon {color:var(--accent)}
.chapter-description small {font-size:var(--label);line-height:1.6}
.catalog-group>h3 {font-weight:600}
@media(max-width:1024px){
 .sidebar {transition:transform .28s cubic-bezier(.16,1,.3,1)}
}
@media(max-width:760px){
 .content {padding:32px 20px calc(48px + env(safe-area-inset-bottom))}
 .topbar {background:var(--paper)}
 .home-hero {padding-top:8px;gap:32px}
 .intro>p {line-height:1.75}
 .start-experiments button,.start-experiments h2 {padding-inline:0}
 .lab-tabs {gap:8px;margin-bottom:20px}
 .lab-header {padding:16px}
 .control-panel {gap:24px}
 .nav-close {background:#f3f4ef}
 .source-reader pre {line-height:1.85}
}
@media(prefers-reduced-motion:reduce){
 button,.sidebar {transition:none}
}
