/* The original reading palette, refined for the expanded physics chapters. */
.ch-mechanics .hero { position: relative; padding-top: 42px; }
.ch-mechanics[data-page="laws"], .ch-mechanics[data-page="friction"], .ch-mechanics[data-page="work"], .ch-mechanics[data-page="rotation"] { --accent: var(--coral); --accent-soft: var(--coral-soft); }
.ch-mechanics[data-page="gravitation"], .ch-mechanics[data-page="oscillations"] { --accent: var(--water); --accent-soft: var(--water-soft); }
.ch-mechanics[data-page="waves"], .ch-mechanics[data-page="thermal-properties"], .ch-mechanics[data-page="kinetic-theory"], .ch-mechanics[data-page="thermodynamics"] { --accent: var(--plum); --accent-soft: var(--plum-soft); }
.lesson-overview { background: linear-gradient(125deg,var(--surface),var(--accent-soft)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 14px; margin-bottom: 22px; box-shadow: 0 8px 28px rgba(27,34,51,.035); }
.lesson-overview-stats { display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: 14px; color: var(--ink-2); }
.lesson-overview-stats strong { font-family: var(--f-display); font-size: 25px; margin-right: 5px; color: var(--accent); }
.lesson-overview > p { font-size: 15px; color: var(--ink-2); }
.experiment-links { display: flex; flex-wrap: wrap; gap: 8px; }
.experiment-links a { color: var(--accent); background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 13px; font-weight: 600; padding: 7px 11px; border-radius: 9px; transition: transform .18s, border-color .18s; }
.experiment-links a:hover { transform: translateY(-2px); border-color: var(--accent); }
.ch-mechanics .content > section { padding-top: 38px; margin-block: 38px; gap: 22px; }
.ch-mechanics .sec-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.ch-mechanics .prose { max-width: 70ch; }
.lesson-note { display: grid; gap: 12px; padding: 20px 0; border-top: 1px dashed var(--line); }
.lesson-note h3 { font-size: 21px; }
.lesson-note .prose > p + p { margin-top: 12px; }
.derivation-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.derivation-controls .btn { font-size: 13px; padding: 7px 11px; }
.lesson-note .prose > ol { display: grid; gap: 12px; padding-left: 1.4em; }
.lesson-note li::marker { color: var(--accent); font-weight: 600; }
.lesson-note .current-step { border-radius: 8px; background: var(--accent-soft); padding: 10px; animation: physics-step-in .2s ease-out; }
.physics-lab { margin: 10px 0; min-width: 0; border: 1px solid var(--line-2); border-radius: 20px; overflow: hidden; background: var(--surface); box-shadow: 0 6px 22px rgba(27,34,51,.045); scroll-margin-top: calc(var(--topbar-h) + 20px); }
.lab-heading { display: grid; gap: 10px; padding: 24px 26px; border-bottom: 1px solid var(--line); background: linear-gradient(120deg,var(--surface),var(--accent-soft)); }
.lab-heading .eyebrow { color: var(--accent); font-size: 11px; }
.lab-heading h3 { font-size: clamp(22px,3vw,27px); }
.lab-heading p { color: var(--ink-2); font-size: 16px; max-width: 65ch; }
.lab-workbench { padding: 16px 18px; background-image: radial-gradient(var(--line) .75px,transparent .75px); background-size: 18px 18px; }
.lab-stage { min-width: 0; width: 100%; }
.lab-stage svg { display: block; width: 100%; height: auto; overflow: hidden; }
.lab-stage > p { padding: 20px; }
.lab-metrics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,160px),1fr)); gap: 10px; margin: 8px 0 0; }
.lab-metrics > div { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.lab-metrics dt { font-size: 12px; color: var(--muted); line-height: 1.4; min-height: 32px; }
.lab-metrics dd { margin: 5px 0 0; font-family: var(--f-mono); color: var(--accent); font-size: 19px; line-height: 1.45; overflow-wrap: anywhere; }
.lab-metrics dd span { font-size: 11px; color: var(--ink-2); margin-left: 6px; font-family: var(--f-body); }
.lab-controls { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,210px),1fr)); gap: 20px; padding: 20px 26px 10px; border-top: 1px solid var(--line); }
.lab-control { display: grid; gap: 9px; min-width: 0; font-size: 14px; }
.lab-control > span { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; font-weight: 600; }
.lab-control output { font: 12px var(--f-mono); color: var(--accent); background: var(--accent-soft); padding: 3px 6px; border-radius: 5px; }
.lab-control input { width: 100%; accent-color: var(--accent); cursor: pointer; min-height: 28px; margin: 0; }
.lab-control select { width: 100%; border: 1px solid var(--line-2); color: var(--ink); background: var(--surface); padding: 9px; border-radius: 8px; font: inherit; }
.lab-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 26px 20px; }
.lab-toolbar .btn { font-size: 13px; }
.lab-toolbar p { flex: 1 1 190px; font-size: 12px; }
.lab-prediction { border-top: 1px solid var(--line); background: var(--surface-2); padding: 17px 26px; }
.lab-prediction summary { font-weight: 600; font-size: 14px; cursor: pointer; color: var(--accent); }
.lab-prediction > p, .lab-prediction .row { margin-top: 12px; font-size: 14px; }
.lab-prediction .btn { font-size: 13px; white-space: normal; text-align: left; }
.lab-prediction .btn[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.lab-prediction-feedback { border-left: 3px solid var(--accent); padding-left: 12px; }
.equation-story { padding: 24px 26px; }
.equation-story > .eyebrow { font-size: 11px; color: var(--accent); }
.equation-story > ol { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 20px; }
.equation-story > ol > li { display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 12px; }
.equation-step-number { display: grid; place-items: center; height: 28px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--line); border-radius: 50%; font: 12px var(--f-mono); }
.equation-story h4 { font-size: 15px; margin-bottom: 8px; }
.equation-story p { font-size: 14px; color: var(--ink-2); margin-top: 8px; line-height: 1.65; }
.equation-step-math { background: var(--surface-2); border-radius: 8px; padding: 10px 12px; min-width: 0; font-size: 17px; overflow-x: auto; }
.equation-step-math mjx-container { margin-block: 0 !important; }
.lab-assumptions { padding: 16px 26px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); }
.ch-mechanics .eg { box-shadow: 0 2px 8px rgba(27,34,51,.025); }
.ch-mechanics .eg details[open] .eg-a { animation: physics-step-in .22s ease-out; }
.ch-mechanics .fig { padding: 20px; }
@keyframes physics-step-in { from { opacity: .5; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 480px) {
 .lab-heading, .lab-controls, .equation-story { padding: 18px 14px; }
 .lab-workbench { padding: 12px 4px; }
 .lab-metrics { padding-inline: 10px; grid-template-columns: repeat(2,minmax(0,1fr)); }
 .lab-metrics dd { font-size: 16px; }
 .lab-toolbar, .lab-prediction, .lab-assumptions { padding: 14px; }
 .equation-story > ol > li { grid-template-columns: 23px minmax(0,1fr); gap: 8px; }
 .equation-step-number { height: 23px; }
 .lesson-overview { padding: 16px; }
 .ch-mechanics .content > section { gap: 18px; }
}
@media print {
 .physics-lab { box-shadow: none; break-inside: auto; }
 .lab-controls, .lab-toolbar, .lab-prediction, .derivation-controls { display: none !important; }
 .lesson-note li[hidden] { display: list-item !important; }
 .equation-story li { break-inside: avoid; }
 .lab-workbench, .lab-heading { break-inside: avoid; }
}
/* Keep the default path short: concept, experiment, application, practice. */
.lesson-depth { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: var(--surface); }
.lesson-depth > summary, .lab-equation-depth > summary { font-size: 14px; font-weight: 600; color: var(--accent); cursor: pointer; }
.lesson-depth[open] > summary { margin-bottom: 16px; }
.lesson-depth > .eg + .eg { margin-top: 16px; }
.lesson-depth .formula-grid { grid-template-columns: minmax(0,1fr); }
.lab-problem-guide { padding: 22px 26px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.lab-problem-guide .eyebrow { font-size: 11px; color: var(--accent); }
.lab-problem-guide > p { font-size: 15px; color: var(--ink); font-weight: 600; }
.lab-problem-guide > ol { display: grid; gap: 8px; margin: 0; padding-left: 1.5em; font-size: 14px; color: var(--ink-2); }
.lab-problem-guide li::marker { font: 600 13px var(--f-mono); color: var(--accent); }
.lab-equation-depth { padding: 14px 26px; border-top: 1px solid var(--line); }
.lab-equation-depth .equation-story { padding: 0; }
@media (max-width:480px) { .lab-problem-guide, .lab-equation-depth { padding: 16px 14px; } .lesson-depth { padding: 12px; } }
/* Long inline equations scroll locally instead of widening the reading page. */
.ch-mechanics .prose, .ch-mechanics .prose > * { min-width: 0; }
.ch-mechanics mjx-container:not([display="true"]) { display: inline-block; max-width: 100%; overflow-x: auto; overflow-y: hidden; vertical-align: middle; }
.ch-mechanics mjx-container > svg { max-width: none; }
.ch-mechanics .prose .table-wrap { min-width: 0; max-width: 100%; }
