:root {
  color-scheme: light;
  font-family:
    system-ui,
    -apple-system,
    "PingFang TC",
    "Noto Sans TC",
    sans-serif;
  color: #233b33;
  background: #f6f5ef;
  font-size: 17px;
  line-height: 1.85;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
main {
  max-width: 1180px;
  margin: auto;
  padding: 32px 28px 60px;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  line-height: 1.35;
  max-width: 850px;
}
h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  line-height: 1.5;
}
h3 {
  font-size: 1.1rem;
}
header p,
.caption {
  color: #52635c;
}
.caption {
  font-size: 0.84rem;
  line-height: 1.65;
}
a {
  color: #2c6c56;
  text-underline-offset: 4px;
}
.unit-picker {
  display: block;
  border-block: 1px solid #c7cec4;
  padding: 18px 0;
  margin: 25px 0;
}
select,
button,
textarea,
input {
  font: inherit;
  color: inherit;
}
select {
  max-width: 100%;
  width: 100%;
  min-height: 48px;
  background: #fff;
  border: 1px solid #adb9ae;
  padding: 8px;
}
.lead {
  font-size: 1.2rem;
  max-width: 880px;
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.workspace > div {
  position: sticky;
  top: 15px;
  min-width: 0;
}
#visual {
  height: 390px;
  background: #e9ece4;
  position: relative;
  overflow: hidden;
}
#visual canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
#visual svg {
  display: block;
  width: 100%;
  height: 100%;
}
#visual button {
  position: absolute;
  left: 20px;
  top: 20px;
}
#explanation p {
  margin-top: 0;
}
button {
  min-height: 44px;
  border: 1px solid #9eafa0;
  background: #fff;
  padding: 8px 15px;
  cursor: pointer;
}
button[aria-pressed="true"] {
  background: #285c47;
  color: #fff;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid #b36d35;
  outline-offset: 3px;
}
.controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 15px;
}
.controls label {
  width: 100%;
  display: block;
}
.controls input[type="range"] {
  width: 100%;
  min-height: 32px;
}
.practice {
  border-top: 1px solid #c7cec4;
  margin-top: 30px;
  padding-top: 20px;
}
.gym {
  border-left: 4px solid #285c47;
  padding: 6px 14px;
  margin: 14px 0;
  background: #eef2ea;
}
.gym h4 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.practice textarea {
  display: block;
  width: 100%;
  background: #fff;
  border: 1px solid #aebbad;
  padding: 12px;
}
.practice button {
  margin: 7px 6px 0 0;
}
.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
}
details {
  border-block: 1px solid #c7cec4;
  padding: 16px 0;
  margin-top: 24px;
}
summary {
  cursor: pointer;
  min-height: 44px;
}
.skip {
  position: absolute;
  left: 8px;
  top: -100px;
  background: #fff;
  padding: 10px;
  z-index: 5;
}
.skip:focus {
  top: 0;
}
.reading {
  max-width: 850px;
}
.reading section {
  margin: 40px 0;
}
.reading table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9rem;
}
.reading th,
.reading td {
  border-bottom: 1px solid #ccd3c9;
  text-align: left;
  padding: 10px;
  vertical-align: top;
}
footer {
  margin-top: 35px;
}
#readout {
  font-size: 0.93rem;
  line-height: 1.6;
}
svg text {
  font-family: inherit;
  fill: #233b33;
}
.bone-label {
  position: absolute;
  pointer-events: none;
  left: 12px;
  bottom: 12px;
  background: #fff;
  padding: 3px 8px;
  font-size: 0.8rem;
  max-width: 90%;
}
@media (max-width: 760px) {
  main {
    padding: 20px 16px 40px;
  }
  .workspace {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .workspace > div {
    position: static;
  }
  #visual {
    height: 300px;
  }
  .lead {
    font-size: 1.05rem;
  }
  .reading td,
  .reading th {
    padding: 6px;
    font-size: 0.82rem;
  }
}
@media print {
  button,
  .controls,
  .unit-picker,
  .pager {
    display: none;
  }
  .reading {
    max-width: none;
  }
  body {
    background: #fff;
  }
  h2,
  h3 {
    break-after: avoid;
  }
  section {
    break-inside: auto;
  }
}
header p {
  margin: 8px 0;
}
header h1 {
  margin: 12px 0;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
}
.unit-picker {
  margin: 18px 0;
  padding: 12px 0;
}
#unit-count {
  margin: 10px 0;
}
#question {
  margin: 12px 0;
}
#visual svg text {
  font-size: 22px;
}
@media (max-width: 760px) {
  header h1 {
    font-size: 1.45rem;
  }
  header p {
    font-size: 0.88rem;
  }
  #question {
    font-size: 1.25rem;
  }
  .unit-picker {
    font-size: 0.9rem;
  }
  #visual {
    height: 280px;
  }
  #unit-count {
    font-size: 0.85rem;
  }
  .lead {
    font-size: 1rem;
  }
}
/* Native bone study: match M3's surface palette and leave the anatomy unobscured. */
#visual {
  background: #ecece3;
  min-height: 340px;
}
.bone-label {
  margin: 0;
  left: 12px;
  right: 12px;
  bottom: 12px;
  max-width: none;
  background: #faf8f0ef;
  border: 1px solid #dbd7c8;
  font-size: 14px;
  line-height: 1.5;
  padding: 8px 10px;
}
.bone-orientation {
  position: absolute;
  top: 12px;
  left: 12px;
  margin: 0;
  padding: 4px 8px;
  background: #faf8f0ef;
  font-size: 14px;
  color: #41524b;
  pointer-events: none;
}
.controls label.bone-picker {
  font-size: 15px;
}
.controls label.bone-picker select {
  margin-top: 5px;
}
.controls input[type="range"] {
  min-height: 44px;
}
@media (max-width: 760px) {
  #visual {
    height: 340px;
    min-height: 340px;
  }
}
.learning-path {
  display: flex;
  gap: 0;
  overflow: auto;
  border-bottom: 1px solid #c7cec4;
  padding: 12px 0 0;
  margin-top: 22px;
}
.learning-path button {
  flex: 1 0 150px;
  max-width: 200px;
  text-align: left;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  line-height: 1.5;
  font-size: 0.85rem;
  padding: 12px;
}
.learning-path button span {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 5px;
  color: #67776d;
}
.learning-path button[aria-current="true"] {
  border-color: #285c47;
  background: #e7ece2;
}
.learning-path button[aria-current="true"] span {
  color: #285c47;
}
.activity {
  border-top: 1px solid #c7cec4;
  margin: 20px 0;
}
.activity h3 {
  margin-bottom: 12px;
}
.activity-track {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.activity-track button {
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}
.activity p {
  margin-bottom: 16px;
}
.answer-prompt {
  border-left: 3px solid #b88a51;
  padding: 10px 16px;
  background: #f1eee2;
}
.workspace aside details {
  margin: 16px 0;
}
.workspace aside summary {
  font-weight: 600;
}
.workspace aside #explanation {
  margin-top: 12px;
}
.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.lab-table td,
.lab-table th {
  padding: 7px;
  border-bottom: 1px solid #d2d9cf;
  text-align: left;
  vertical-align: top;
}
.lab-table caption {
  text-align: left;
  font-weight: 600;
  margin: 12px 0;
}
.lab-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.lab-status {
  font-size: 0.85rem;
}
.lab-equations {
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}
.lab-select {
  width: 100%;
}
#visual.mechanism {
  height: auto;
  min-height: 340px;
  padding: 8px;
}
#visual.mechanism svg {
  height: auto;
  min-height: 280px;
  max-height: 430px;
}
#visual.mechanism button {
  position: static;
}
#visual.mechanism svg text {
  font-size: 17px;
}
.lab-heading {
  font-size: 0.8rem;
  padding: 6px 10px;
  margin: 0;
  color: #52635c;
}
.lab-measurements {
  font-variant-numeric: tabular-nums;
  line-height: 1.6;
  padding: 8px 12px;
  background: #f5f5ef;
  font-size: 0.85rem;
}
.lab-measurements p {
  margin: 5px 0;
}
@media (max-width: 760px) {
  .learning-path button {
    flex-basis: 136px;
  }
  .activity-track button {
    flex: 1 1 120px;
  }
  .workspace aside details {
    margin-top: 8px;
  }
  .lab-table {
    font-size: 0.8rem;
  }
}

[hidden] {
  display: none !important;
}
.foot-anchor-leader {
  position: absolute;
  top: 0;
  left: 0;
  height: 1px;
  background: #667d70b8;
  transform-origin: 0 0;
  pointer-events: none;
  z-index: 1;
}
.foot-anchor {
  z-index: 2;
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  font: 13px/1.4 system-ui;
  color: #304139;
  background: #f8f6eedf;
  border-left: 2px solid #7d9585;
  padding: 3px 6px;
  max-width: 170px;
  border-radius: 2px;
  white-space: nowrap;
}
.foot-orientation,
.foot-identify {
  position: absolute;
  left: 14px;
  top: 10px;
  pointer-events: none;
  font: 13px/1.4 system-ui;
  color: #5b6d60;
  background: #f6f4ecbf;
  padding: 3px 6px;
}
.foot-identify {
  top: auto;
  bottom: 10px;
  max-width: 75%;
  font-size: 12px;
}
.foot-identify:empty {
  display: none;
}
.foot-inset-label {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 11px;
  background: #e2e6dc;
  color: #384c3e;
  max-width: 160px;
}
.foot-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.foot-stats div {
  background: #171d18;
  padding: 10px;
  border-radius: 5px;
}
.foot-stats small {
  display: block;
  color: #aebca7;
  font-size: 12px;
}
.foot-stats strong {
  display: block;
  font-size: 19px;
  color: #eff1e6;
  font-variant-numeric: tabular-nums;
}
.foot-transport {
  display: flex;
  gap: 5px;
}
.foot-transport button {
  flex: 1;
}
.foot-options {
  margin-top: 8px;
}
.foot-options label {
  margin: 10px 0;
}
.foot-options input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 8px;
  accent-color: #d1ff00;
}
#learning-workspace #controls {
  margin: 0;
  display: block;
}
#learning-workspace .foot-range-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
#learning-workspace .foot-range-label output {
  font-variant-numeric: tabular-nums;
  color: #e5f4a3;
}
#learning-workspace .foot-measure-detail {
  font-size: 12px;
  line-height: 1.6;
  color: #a3b29d;
}
#learning-workspace #foot-status {
  color: #ffd7a6;
  font-size: 13px;
}
#learning-workspace #readout > p:first-child {
  color: #ebefe1;
  font-weight: 600;
  margin-top: 0;
}

.foot-energy {
  display: grid;
  gap: 8px;
}
.foot-energy label {
  display: grid;
  gap: 3px;
}
.foot-energy meter {
  width: 100%;
  height: 12px;
  accent-color: #bad36c;
}

/* M4 mechanism workspace: the primary control and its measurements never join the reading scroll. */
html[data-workspace-chapter="4"] #learning-workspace {
  --lw-paper: #eceae2;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-header {
  min-height: 58px;
  padding: 7px 18px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-heading h2 {
  font-size: 17px;
  line-height: 1.4;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-chapter {
  font-size: 10px;
  letter-spacing: 0.08em;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-body {
  grid-template-columns: minmax(0, 1fr) 354px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-inspector {
  grid-template-rows: auto auto minmax(0, 1fr);
  background: #202622;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-operation {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  padding: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
  padding: 17px 20px 10px;
  gap: 10px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-secondary {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 0 20px 20px;
  min-height: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-mode {
  display: flex;
  padding: 9px 16px 0;
  gap: 6px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-mode button {
  min-height: 34px;
  font-size: 12px;
  flex: 1;
  background: transparent;
  border: 0;
}
html[data-workspace-chapter="4"]
  #learning-workspace
  .scene-mode
  button[aria-pressed="true"] {
  background: #36402c;
  color: #e0ecaa;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-tabs {
  padding: 0 14px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-tabs button {
  padding: 8px;
  min-height: 40px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-step-heading {
  margin-bottom: 12px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-panel-kind {
  display: block;
  color: #b2c393;
  letter-spacing: 0.06em;
  font-size: 11px;
  margin-bottom: 5px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
  display: block;
  font-size: 18px;
  line-height: 1.5;
  font-weight: 550;
  color: #eef0e8;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-primary-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-control {
  display: block;
  min-width: 0;
  font-size: 13px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-control-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  line-height: 1.4;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-control output {
  color: #dfedb2;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  white-space: nowrap;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-control select {
  font-size: 13px;
  margin-top: 5px;
  padding: 6px;
}
html[data-workspace-chapter="4"] #learning-workspace #readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
  padding: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-metric {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 7px;
  min-height: 70px;
  border: 0;
  border-top: 1px solid #68715b;
  background: #2a312a;
  border-radius: 0;
  text-align: left;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-metric span {
  font-size: 11px;
  line-height: 1.35;
  color: #b8c3ad;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-metric strong {
  font-size: 17px;
  line-height: 1.2;
  color: #f0f2e6;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-help {
  font-size: 12px;
  line-height: 1.65;
  color: #b1bbaa;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-status,
html[data-workspace-chapter="4"] #learning-workspace .scene-selection {
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-status:empty,
html[data-workspace-chapter="4"] #learning-workspace .scene-selection:empty {
  display: none;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-selection {
  color: #d9e2c7;
  max-height: 50px;
  overflow: auto;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-compare {
  display: flex;
  gap: 5px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-compare button {
  font-size: 11px;
  min-height: 38px;
  padding: 6px;
  flex: 1;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-metric-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-metric-list button {
  font-size: 12px;
  text-align: left;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-experiment {
  margin: 0;
  padding: 5px 0;
  border: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-experiment label {
  margin: 8px 0;
}
html[data-workspace-chapter="4"]
  #learning-workspace
  .scene-experiment
  [disabled] {
  opacity: 0.65;
  cursor: default;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-experiment summary,
html[data-workspace-chapter="4"]
  #learning-workspace
  .scene-all-metrics
  summary {
  font-size: 12px;
  color: #bac7af;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-scenarios {
  padding: 8px 14px;
  gap: 12px;
  min-height: 56px;
  overflow: hidden;
}
html[data-workspace-chapter="4"] #learning-workspace #activity-track {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  gap: 5px;
  margin: 0;
  flex-wrap: nowrap;
}
html[data-workspace-chapter="4"] #learning-workspace #activity-track button {
  flex: none;
  max-width: 200px;
  white-space: nowrap;
  font-size: 12px;
  min-height: 36px;
  border: 0;
  padding: 6px 9px;
  background: transparent;
  color: #54604d;
}
html[data-workspace-chapter="4"]
  #learning-workspace
  #activity-track
  button[aria-pressed="true"] {
  background: #ccd4ba;
  color: #233322;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav span {
  font-size: 11px;
  color: #5a664f;
  white-space: nowrap;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav button {
  min-height: 36px;
  padding: 5px 9px;
  font-size: 12px;
  color: #32432b;
  background: #f2f2e8;
  border-color: #acb799;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-views {
  display: flex;
  position: static;
  min-height: 50px;
  padding: 4px 14px;
  gap: 6px;
  width: auto;
  max-height: none;
  max-width: none;
  overflow: auto;
  box-shadow: none;
  border-radius: 0;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-views > * {
  display: block;
  flex: none;
  width: auto;
  min-height: 40px;
  max-width: 130px;
  font-size: 12px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-views select {
  color: #394632;
  background: transparent;
  border-color: #b3bda8;
  padding: 5px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-view-toggle {
  display: none;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-cue {
  font-size: 14px;
  padding: 9px 18px;
  line-height: 1.55;
  max-height: 68px;
}
html[data-workspace-chapter="4"] #learning-workspace .lw-stage {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
html[data-workspace-chapter="4"] #learning-workspace #visual {
  position: relative;
  height: 100%;
  min-height: 0;
}
html[data-workspace-chapter="4"] .scene-render-mount {
  position: absolute;
  inset: 0;
}
html[data-workspace-chapter="4"] .scene-stage-caption {
  position: absolute;
  top: 12px;
  left: 16px;
  right: 12px;
  pointer-events: none;
  color: #465442;
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 3;
}
html[data-workspace-chapter="4"] .scene-stage-caption span {
  font-size: 10px;
  letter-spacing: 0.07em;
}
html[data-workspace-chapter="4"] .scene-stage-caption strong {
  font-size: 14px;
  font-weight: 500;
  max-width: 80%;
}
html[data-workspace-chapter="4"] .foot-orientation {
  top: auto;
  bottom: 8px;
  left: auto;
  right: 8px;
  font-size: 10px;
}
html[data-workspace-chapter="4"] .scene-series svg {
  display: block;
  width: 100%;
  height: 100px;
}
@media (min-width: 1500px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-columns: 205px minmax(0, 1fr) 354px;
  }
}
@media (max-width: 1100px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
    padding: 12px 14px 8px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-secondary {
    padding: 0 14px 14px;
  }
}
@media (max-width: 700px) and (min-height: 501px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-header {
    min-height: 46px;
    height: 46px;
    padding: 3px 9px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-heading h2 {
    font-size: 13px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(185px, 1fr) 282px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenarios {
    height: 42px;
    min-height: 42px;
    padding: 0 8px;
    gap: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace #activity-track {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenario-select {
    display: block;
    flex: 1;
    min-width: 0;
    font-size: 12px;
    min-height: 40px;
    height: 40px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav {
    display: flex;
  }
  html[data-workspace-chapter="4"] #learning-workspace #scene-back,
  html[data-workspace-chapter="4"] #learning-workspace #scene-step-count {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views {
    min-height: 40px;
    padding: 0 7px;
    gap: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views > * {
    min-height: 38px;
    font-size: 11px;
    padding: 4px 7px;
    max-width: 100px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-cue {
    height: auto;
    max-height: 42px;
    font-size: 12px;
    padding: 4px 10px;
    line-height: 1.4;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode {
    padding: 4px 10px 0;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode button {
    min-height: 28px;
    font-size: 11px;
    padding: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-tabs button {
    height: 32px;
    min-height: 32px;
    font-size: 12px;
    padding: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
    padding: 8px 12px;
    gap: 6px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-panel-kind {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
    font-size: 14px;
    line-height: 1.4;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-heading {
    margin-bottom: 7px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control-label {
    font-size: 12px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control output {
    font-size: 14px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric {
    min-height: 51px;
    padding: 5px 6px;
    gap: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric span {
    font-size: 10px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric strong {
    font-size: 15px;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption {
    top: 6px;
    left: 10px;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption strong {
    font-size: 12px;
  }
}
@media (max-height: 500px) and (min-width: 501px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-header {
    height: 44px;
    min-height: 44px;
    padding: 3px 10px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-heading h2 {
    font-size: 13px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-columns: minmax(0, 1fr) minmax(245px, 44%);
    grid-template-rows: minmax(0, 1fr);
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
    padding: 7px 12px;
    gap: 6px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
    font-size: 14px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-heading {
    margin-bottom: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-panel-kind {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode {
    padding: 3px 8px 0;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode button {
    min-height: 28px;
    padding: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-tabs button {
    min-height: 32px;
    height: 32px;
    padding: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric {
    min-height: 53px;
    padding: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric strong {
    font-size: 15px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenarios {
    height: 40px;
    min-height: 40px;
    padding: 0 7px;
  }
  html[data-workspace-chapter="4"] #learning-workspace #activity-track {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenario-select {
    display: block;
    min-height: 38px;
    height: 38px;
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav {
    display: flex;
  }
  html[data-workspace-chapter="4"] #learning-workspace #scene-back,
  html[data-workspace-chapter="4"] #learning-workspace #scene-step-count {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views {
    min-height: 38px;
    padding: 0 6px;
    gap: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views > * {
    min-height: 36px;
    font-size: 10px;
    max-width: 85px;
    padding: 3px 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-cue {
    height: auto;
    max-height: 38px;
    padding: 3px 8px;
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-footer {
    display: none;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption {
    top: 5px;
    left: 8px;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption strong {
    font-size: 11px;
  }
}
@media (max-width: 700px) and (min-height: 501px) and (max-height: 650px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-rows: minmax(185px, 1fr) 245px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
    font-size: 13px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control select {
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-cue {
    max-height: 34px;
    font-size: 11px;
  }
}
html[data-workspace-chapter="4"] #learning-workspace .scene-range-domain {
  display: block;
  font-size: 10px;
  color: #aeba9e;
  line-height: 1.2;
  margin-top: -2px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-series-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10px;
  line-height: 1.3;
  padding: 0 3px 8px;
}
html[data-workspace-chapter="4"] #learning-workspace .scene-compact-mode {
  display: none;
}
/* A phone inside the learner shell may have only 430px of iframe height.
   Height alone must never switch a narrow phone into a 75px-wide model column. */
@media (max-width: 500px) and (max-height: 500px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-header {
    height: 38px;
    min-height: 38px;
    padding: 2px 6px;
    gap: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-heading h2 {
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-outline-toggle {
    min-height: 32px;
    width: 32px;
    height: 32px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-compact-mode {
    display: block;
    font-size: 10px;
    min-height: 32px;
    max-width: 60px;
    padding: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-view-toggle {
    display: block;
    font-size: 10px;
    min-height: 32px;
    padding: 3px 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-body,
  html[data-workspace-chapter="4"]
    #learning-workspace.lw-outline-open
    .lw-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(150px, 1fr) 198px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-inspector {
    grid-template-rows: auto minmax(0, 1fr);
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-tabs button {
    height: 28px;
    min-height: 28px;
    font-size: 11px;
    padding: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
    padding: 7px 10px;
    gap: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-heading {
    margin-bottom: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
    font-size: 12px;
    line-height: 1.4;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-panel-kind {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control-label {
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control output {
    font-size: 13px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control select {
    font-size: 10px;
    min-height: 36px;
    padding: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric {
    min-height: 48px;
    padding: 4px 5px;
    gap: 2px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric span {
    font-size: 10px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric strong {
    font-size: 14px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenarios {
    height: 34px;
    min-height: 34px;
    padding: 0 7px;
    gap: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace #activity-track {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenario-select {
    display: block;
    min-height: 32px;
    height: 32px;
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav {
    display: flex;
  }
  html[data-workspace-chapter="4"] #learning-workspace #scene-back,
  html[data-workspace-chapter="4"] #learning-workspace #scene-step-count {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav button {
    min-height: 30px;
    font-size: 10px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views {
    display: none;
    position: absolute;
    right: 6px;
    top: 38px;
    bottom: auto;
    z-index: 12;
    max-width: 170px;
    flex-wrap: wrap;
    max-height: 180px;
    overflow: auto;
    background: #e4e7da;
    padding: 6px;
    border: 1px solid #b3bda8;
    border-radius: 6px;
  }
  html[data-workspace-chapter="4"] #learning-workspace.lw-views-open .lw-views {
    display: flex;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views > * {
    min-height: 36px;
    max-width: 150px;
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-stage {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-cue {
    height: auto;
    max-height: 30px;
    padding: 3px 9px;
    font-size: 11px;
    line-height: 1.3;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption {
    top: 5px;
    left: 8px;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption span {
    font-size: 9px;
  }
  html[data-workspace-chapter="4"] .scene-stage-caption strong {
    font-size: 11px;
  }
}
/* The energy cursor stays beside its pose, including when the phone's inspector
   has no spare scroll area. This is a readout, not a replacement for the bones. */
html[data-workspace-chapter="4"] #scene-series {
  position: absolute;
  z-index: 4;
  right: 12px;
  bottom: 12px;
  width: clamp(145px, 25%, 230px);
  padding: 7px 8px 0;
  border-radius: 7px;
  background: #242b26ed;
  pointer-events: none;
}
html[data-workspace-chapter="4"] #scene-series[hidden] {
  display: none;
}
html[data-workspace-chapter="4"] #scene-series svg {
  display: block;
  width: 100%;
}
@media (max-width: 500px) {
  html[data-workspace-chapter="4"] #scene-series {
    width: 128px;
    right: 5px;
    bottom: 5px;
    padding: 4px 5px 0;
  }
  html[data-workspace-chapter="4"] #scene-series .scene-series-legend {
    gap: 2px 5px;
    font-size: 8px;
    padding-bottom: 4px;
  }
}
/* Browser zoom leaves a short iframe after the outer course navigation. */
@media (min-width: 501px) and (max-height: 310px) {
  html[data-workspace-chapter="4"] #learning-workspace .lw-header {
    height: 34px;
    min-height: 34px;
    padding: 2px 7px;
    gap: 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-outline-toggle {
    min-height: 30px;
    height: 30px;
    padding: 3px 6px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-heading h2 {
    font-size: 12px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-mode {
    display: none;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-compact-mode {
    display: block;
    font-size: 10px;
    min-height: 30px;
    max-width: 62px;
    padding: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-view-toggle {
    display: block;
    font-size: 10px;
    min-height: 30px;
    padding: 3px 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-inspector {
    grid-template-rows: auto minmax(0, 1fr);
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-tabs button {
    min-height: 26px;
    height: 26px;
    padding: 3px;
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-primary {
    padding: 5px 9px;
    gap: 4px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-heading {
    margin-bottom: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-question {
    font-size: 12px;
    line-height: 1.3;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control-label {
    font-size: 11px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control output {
    font-size: 12px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control input {
    height: 34px;
    min-height: 34px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-control select {
    font-size: 10px;
    height: 32px;
    min-height: 32px;
    padding: 3px;
    margin-top: 3px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric {
    min-height: 42px;
    padding: 3px;
    gap: 2px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric span {
    font-size: 9px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .scene-metric strong {
    font-size: 13px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenarios {
    height: 32px;
    min-height: 32px;
    padding: 0 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-scenario-select,
  html[data-workspace-chapter="4"] #learning-workspace .scene-step-nav button {
    height: 30px;
    min-height: 30px;
    font-size: 10px;
    padding: 3px 5px;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-stage {
    grid-template-rows: auto minmax(0, 1fr) auto;
  }
  html[data-workspace-chapter="4"] #learning-workspace .lw-views {
    display: none;
    position: absolute;
    right: 68px;
    top: 34px;
    bottom: auto;
    z-index: 12;
    max-width: 190px;
    flex-wrap: wrap;
    background: #e4e7da;
    padding: 5px;
    border: 1px solid #b3bda8;
    border-radius: 6px;
  }
  html[data-workspace-chapter="4"] #learning-workspace.lw-views-open .lw-views {
    display: flex;
  }
}
