:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: #eef3f5;
  color: #1d252b;
  --ink: #1d252b;
  --muted: #5c6871;
  --line: #c9d4d9;
  --panel: #ffffff;
  --accent: #0c7b8a;
  --accent-dark: #085c66;
  --gold: #d99a24;
  --green: #207a50;
  --red: #b23a2f;
  --shadow: 0 18px 42px rgba(39, 57, 67, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(238, 243, 245, 0.95)),
    repeating-linear-gradient(90deg, rgba(12, 123, 138, 0.08) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(12, 123, 138, 0.06) 0 1px, transparent 1px 56px);
}

button {
  font: inherit;
}

.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(238, 243, 245, 0.98)),
    repeating-linear-gradient(90deg, rgba(12, 123, 138, 0.08) 0 1px, transparent 1px 56px),
    repeating-linear-gradient(0deg, rgba(12, 123, 138, 0.06) 0 1px, transparent 1px 56px);
}

.splash-screen[hidden] {
  display: none;
}

.splash-card {
  width: min(420px, 100%);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.splash-card h1 {
  font-size: 2.4rem;
}

.splash-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 800;
}

.splash-card input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font: inherit;
  color: var(--ink);
}

.student-line {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.app {
  width: min(1280px, calc(100% - 20px));
  margin: 0 auto;
  padding: 10px 0 16px;
}

.topbar,
.workspace,
.tool-tabs {
  display: flex;
  gap: 16px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 1.12rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.eyebrow {
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scoreboard {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
}

.scoreboard span {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1;
}

.scoreboard small {
  color: var(--muted);
}

.icon-btn,
.btn,
.tool-tab {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 1.2rem;
}

.icon-btn span {
  font-size: 0;
}

.icon-btn span::before {
  content: "R";
  font-size: 1rem;
  font-weight: 900;
}

.tool-tabs {
  align-items: center;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tool-tab {
  min-width: 132px;
  padding: 8px 12px;
  border-radius: 8px;
  font-weight: 750;
  white-space: nowrap;
}

.tool-tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.tool-tab:disabled,
.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.lab-brief {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.lab-brief h2 {
  max-width: 680px;
}

.progress-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.progress-pill {
  min-width: 96px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.progress-pill.done {
  border-color: #6fb68d;
  background: #e7f5ee;
  color: var(--green);
}

.workspace {
  align-items: stretch;
}

.side-panel {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#challengePrompt {
  color: var(--muted);
  line-height: 1.3;
  font-size: 0.92rem;
}

.trial-banner {
  padding: 8px 10px;
  border: 1px solid #6fb68d;
  border-radius: 8px;
  background: #e7f5ee;
  color: var(--green);
  font-weight: 950;
  text-align: center;
  text-transform: uppercase;
}

.lesson-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: #f7fafb;
}

.lesson-card h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.2;
}

.lesson-card p:last-child {
  color: var(--muted);
  line-height: 1.28;
  font-size: 0.9rem;
}

.reading-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d7e1e5;
  border-radius: 8px;
  background: #f7fafb;
}

.reading-card.trial-complete {
  border-color: #6fb68d;
  background: #e7f5ee;
}

.trial-status {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid #6fb68d;
  border-radius: 8px;
  background: #e7f5ee;
  color: var(--green);
  font-weight: 900;
}

.trial-status[hidden] {
  display: none;
}

.trial-status span {
  color: var(--green);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.trial-status strong {
  color: var(--ink);
  font-size: 1rem;
}

.reading-card span {
  color: var(--muted);
  font-size: 0.9rem;
}

.reading-card strong {
  min-height: 42px;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 2rem;
  line-height: 1.2;
}

.answer-entry {
  display: grid;
  gap: 6px;
}

.answer-entry input {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 1.2rem;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn {
  min-height: 36px;
  padding: 8px 11px;
  border-radius: 8px;
  font-weight: 800;
}

.btn.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.btn.next-action {
  border-color: #b7791f;
  background: #fff5df;
  color: #7b520b;
  box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.18);
}

.feedback {
  min-height: 40px;
  padding: 9px;
  border-radius: 8px;
  background: #eef3f5;
  color: var(--muted);
  line-height: 1.35;
}

.feedback.correct {
  background: #e7f5ee;
  color: var(--green);
}

.feedback.try {
  background: #fff5df;
  color: #7b520b;
}

.station-summary {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #6fb68d;
  border-radius: 8px;
  background: #e7f5ee;
}

.station-summary h3 {
  margin: 0;
  font-size: 1rem;
}

.station-summary ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  color: var(--ink);
  line-height: 1.5;
  list-style: none;
}

.station-summary li {
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-weight: 800;
}

.lab-report {
  display: grid;
  grid-template-columns: 190px 1fr;
  align-items: start;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
}

.report-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.report-item {
  min-height: 52px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.report-item strong {
  display: block;
  margin-top: 4px;
  font-family: "Segoe UI Mono", Consolas, monospace;
}

.report-item.complete {
  border-color: #6fb68d;
  background: #e7f5ee;
}

.quiz-panel {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.quiz-panel[hidden] {
  display: none;
}

.quiz-answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
}

.quiz-answer {
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.quiz-answer.selected {
  border-color: var(--accent);
  background: #eefbfc;
}

.final-report-panel {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #6fb68d;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.final-report-panel[hidden] {
  display: none;
}

.report-directions {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.report-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
}

.report-form label {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.report-form span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.report-form textarea {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  line-height: 1.4;
}

.instrument-stage {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 540px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.help-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #fff;
  color: var(--accent-dark);
  cursor: pointer;
  font-weight: 900;
}

.station-intro {
  min-height: 540px;
  padding: 16px;
  display: grid;
  align-content: start;
  gap: 12px;
}

.station-intro[hidden] {
  display: none;
}

.instruction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.instruction-card {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
}

.instruction-card h3 {
  margin: 0;
  font-size: 0.95rem;
}

.instruction-card p {
  color: var(--muted);
  line-height: 1.25;
  font-size: 0.88rem;
}

.step-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 0.82rem;
  line-height: 1.25;
}

.step-list li::marker {
  color: var(--accent);
  font-weight: 900;
}

.instruction-art {
  position: relative;
  height: 96px;
  border: 1px solid #d7e1e5;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.instruction-art {
  transform-origin: top left;
}

.instruction-art::before,
.instruction-art::after {
  content: "";
  position: absolute;
}

.art-balance-riders::before {
  left: 24px;
  right: 24px;
  top: 44px;
  height: 8px;
  background: #6f7b82;
  box-shadow: 0 34px 0 #6f7b82;
}

.art-balance-riders::after {
  left: 78px;
  top: 31px;
  width: 34px;
  height: 28px;
  border: 2px solid #5c6871;
  border-radius: 6px;
  background: #d99a24;
  box-shadow: 86px 34px 0 #d99a24;
}

.art-balance-add::before {
  left: 28px;
  top: 28px;
  color: #1d252b;
  content: "200 + 40 + 6.3";
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 1.05rem;
  font-weight: 800;
}

.art-balance-add::after {
  left: 30px;
  right: 30px;
  top: 70px;
  height: 2px;
  background: #33424a;
  box-shadow: 0 26px 0 #0c7b8a;
}

.art-cylinder-eye::before {
  left: 80px;
  top: 16px;
  width: 80px;
  height: 100px;
  border: 4px solid rgba(67, 89, 101, 0.35);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(0deg, rgba(60, 164, 207, 0.42) 0 56%, transparent 56%);
}

.art-cylinder-eye::after {
  left: 64px;
  top: 58px;
  width: 112px;
  height: 18px;
  border-bottom: 4px solid #0d578b;
  border-radius: 0 0 50% 50%;
}

.art-cylinder-meniscus::before {
  left: 48px;
  top: 34px;
  width: 140px;
  height: 54px;
  border-bottom: 5px solid #0d578b;
  border-radius: 0 0 50% 50%;
}

.art-cylinder-meniscus::after {
  left: 92px;
  top: 92px;
  width: 52px;
  height: 3px;
  background: #33424a;
}

.art-cylinder-tenth::before {
  left: 72px;
  top: 18px;
  width: 2px;
  height: 96px;
  background: #33424a;
  box-shadow:
    20px 0 0 #33424a,
    40px 0 0 #33424a,
    60px 0 0 #33424a,
    80px 0 0 #33424a;
}

.art-cylinder-tenth::after {
  left: 34px;
  top: 52px;
  content: "6.4 mL";
  color: #0c7b8a;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-weight: 900;
}

.art-meter-start::before {
  left: 22px;
  right: 22px;
  bottom: 22px;
  height: 48px;
  border: 2px solid #a96f22;
  border-radius: 8px;
  background: #e1a94d;
}

.art-meter-start::after {
  left: 74px;
  top: 34px;
  width: 126px;
  height: 22px;
  border-radius: 999px;
  background: #76b54b;
}

.art-meter-subtract::before {
  left: 28px;
  top: 34px;
  content: "end - start";
  color: #1d252b;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-size: 1.15rem;
  font-weight: 900;
}

.art-meter-subtract::after {
  left: 38px;
  top: 80px;
  width: 160px;
  height: 3px;
  background: #0c7b8a;
}

.art-meter-tenth::before {
  left: 22px;
  right: 22px;
  top: 54px;
  height: 2px;
  background: #513719;
}

.art-meter-tenth::after {
  left: 54px;
  top: 34px;
  width: 1px;
  height: 48px;
  background: #513719;
  box-shadow:
    12px 14px 0 #513719,
    24px 14px 0 #513719,
    36px 14px 0 #513719,
    48px 0 0 #513719,
    60px 14px 0 #513719,
    72px 14px 0 #513719,
    84px 14px 0 #513719,
    96px 0 0 #513719;
}

.art-thermo-dip::before {
  left: 116px;
  bottom: 18px;
  width: 86px;
  height: 72px;
  border: 4px solid rgba(67, 89, 101, 0.35);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  background: linear-gradient(0deg, rgba(60, 164, 207, 0.5) 0 62%, transparent 62%);
}

.art-thermo-dip::after {
  left: 58px;
  top: 18px;
  width: 14px;
  height: 98px;
  border: 3px solid #6a767d;
  border-radius: 99px;
  background: linear-gradient(0deg, #be2034 0 34%, #f5fafb 34%);
  box-shadow: 0 78px 0 14px #be2034;
}

.art-thermo-rise::before {
  left: 78px;
  top: 18px;
  width: 18px;
  height: 96px;
  border: 3px solid #6a767d;
  border-radius: 99px;
  background: linear-gradient(0deg, #be2034 0 72%, #f5fafb 72%);
}

.art-thermo-rise::after {
  left: 126px;
  top: 36px;
  width: 58px;
  height: 3px;
  background: #0c7b8a;
  box-shadow: 0 18px 0 #0c7b8a, 0 36px 0 #0c7b8a;
}

.art-thermo-read::before {
  left: 46px;
  top: 38px;
  content: "read scale";
  color: #1d252b;
  font-family: "Segoe UI Mono", Consolas, monospace;
  font-weight: 900;
}

.art-thermo-read::after {
  left: 84px;
  top: 76px;
  width: 88px;
  height: 3px;
  background: #c01818;
  transform: rotate(-12deg);
}

.instrument-panel {
  min-height: 540px;
  padding: 14px;
}

.balance-scene,
.cylinder-scene,
.meter-scene,
.thermometer-scene {
  width: 100%;
  height: 100%;
  min-height: 512px;
  position: relative;
}

.balance-scene {
  display: grid;
  grid-template-rows: auto 190px auto;
  align-content: start;
}

.walkthrough {
  display: grid;
  gap: 7px;
  margin: 0 10px 8px;
  padding: 10px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: #f7fafb;
}

.walkthrough[hidden] {
  display: none;
}

.walkthrough .feedback {
  min-height: 0;
}

.walkthrough-answer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.walkthrough-answer[hidden] {
  display: none;
}

.walkthrough-answer span {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 900;
  text-transform: uppercase;
}

.walkthrough-answer input {
  width: 110px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-family: "Segoe UI Mono", Consolas, monospace;
}

.balance-top {
  height: 190px;
  display: grid;
  grid-template-columns: minmax(190px, 300px) 1fr;
  align-items: end;
  gap: 18px;
  padding: 4px 16px 0;
}

.pan {
  position: relative;
  height: 54px;
  border: 5px solid #707c84;
  border-top: 0;
  border-radius: 0 0 110px 110px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0)),
    #dce5e9;
}

.pan::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 47px;
  width: 5px;
  height: 88px;
  transform: translateX(-50%);
  background: #69757c;
}

.pan::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -11px;
  height: 14px;
  border-radius: 50%;
  background: #f4f8fa;
  border: 3px solid #707c84;
}

.sample-mass {
  position: absolute;
  left: 50%;
  bottom: 42px;
  width: 82px;
  height: 64px;
  transform: translateX(-50%);
  border-radius: 8px 8px 12px 12px;
  background: var(--sample-color, #b8653c);
  box-shadow: inset -12px -12px 0 rgba(0, 0, 0, 0.08);
  z-index: 3;
}

.sample-mass.cube,
.sample-mass.block {
  border-radius: 8px;
}

.sample-mass.stopper {
  width: 74px;
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  border-radius: 8px;
}

.sample-mass.rock {
  clip-path: polygon(18% 12%, 62% 0, 96% 32%, 84% 86%, 36% 100%, 0 62%);
  border-radius: 16px;
}

.sample-mass.washers {
  height: 54px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 50% 50%, #eef3f5 0 17%, transparent 18%),
    repeating-linear-gradient(0deg, transparent 0 9px, rgba(0, 0, 0, 0.18) 9px 11px),
    var(--sample-color, #9aa5aa);
}

.sample-mass.solid {
  border-radius: 50% 44% 48% 52%;
}

.balance-arm {
  position: relative;
  height: 170px;
  align-self: center;
}

.balance-arm::before {
  content: "";
  position: absolute;
  left: 0;
  right: 238px;
  top: 87px;
  height: 12px;
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent),
    #68747b;
  box-shadow: 0 16px 0 #9aa5aa;
}

.fulcrum {
  position: absolute;
  left: 35%;
  top: 101px;
  width: 94px;
  height: 70px;
  transform: translateX(-50%);
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
  background: linear-gradient(180deg, #94a0a7, #69757c);
}

.pointer {
  position: absolute;
  right: 0;
  top: 14px;
  height: 150px;
  width: 250px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pointer::before {
  content: "";
  position: absolute;
  right: 0;
  top: 88px;
  width: 104px;
  height: 3px;
  background: #15191b;
}

.pointer::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50px;
  color: #050606;
  content: "0";
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
}

.pointer span {
  display: none;
}

.pointer-needle {
  position: absolute;
  left: 0;
  top: 88px;
  width: 166px;
  height: 3px;
  transform-origin: left center;
  background:
    linear-gradient(90deg, #15191b 0 calc(100% - 20px), #c01818 calc(100% - 20px) 100%);
  transition: transform 160ms ease;
  z-index: 3;
}

.balance-status {
  position: absolute;
  right: 0;
  bottom: -18px;
  min-width: 132px;
  padding: 8px 10px;
  border: 1px solid #c9d4d9;
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.balance-status.perfect {
  border-color: #6fb68d;
  background: #e7f5ee;
  color: var(--green);
}

.balance-base {
  height: 34px;
  margin: -6px 18px 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, #8c989f, #5e686e);
}

.beam {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 10px;
  margin: 10px 14px;
}

.beam.walkthrough-active {
  padding: 8px;
  margin: 10px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: #eefbfc;
}

.beam.walkthrough-locked {
  opacity: 0.42;
}

.beam.walkthrough-locked .rider {
  cursor: not-allowed;
}

.beam-label {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1.2;
  text-align: right;
}

.track {
  position: relative;
  height: 56px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f8fafb 0 48%, #6f7b82 48% 56%, #edf2f4 56%),
    #edf2f4;
  border: 1px solid var(--line);
}

.tick-row {
  position: absolute;
  inset: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  pointer-events: none;
}

.tick-row.fine {
  display: block;
}

.tick-row.fine .tick {
  position: absolute;
  bottom: 0;
}

.tick {
  position: relative;
  width: 1px;
  height: 19px;
  background: #748088;
}

.tick.major {
  height: 30px;
  width: 2px;
}

.tick.medium {
  height: 23px;
  width: 2px;
}

.tick.minor {
  height: 14px;
}

.tick span {
  position: absolute;
  left: 50%;
  top: -21px;
  transform: translateX(-50%);
  color: #33424a;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

.rider {
  position: absolute;
  top: 20px;
  left: 0;
  width: 36px;
  height: 28px;
  margin-left: -18px;
  border: 2px solid #5c6871;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 44%, rgba(0, 0, 0, 0.24) 44% 56%, transparent 56%),
    linear-gradient(180deg, #f4c261, #ba7418);
  cursor: grab;
  touch-action: none;
  z-index: 3;
}

.rider:active,
.thermometer:active {
  cursor: grabbing;
}

.cylinder-scene {
  display: grid;
  grid-template-columns: minmax(230px, 360px) minmax(130px, 220px);
  justify-content: center;
  align-items: center;
  gap: 44px;
}

.cylinder {
  position: relative;
  width: min(80vw, 280px);
  height: 500px;
  border: 5px solid rgba(67, 89, 101, 0.35);
  border-top: 0;
  border-radius: 0 0 26px 26px;
  background: rgba(255, 255, 255, 0.42);
}

.glass {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.6), transparent 30%, rgba(255, 255, 255, 0.7) 78%, transparent);
  pointer-events: none;
  z-index: 4;
}

.water {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, rgba(60, 164, 207, 0.52), rgba(21, 120, 174, 0.72));
  transition: height 180ms ease;
}

.meniscus {
  position: absolute;
  left: 20px;
  right: 20px;
  height: 30px;
  border-bottom: 5px solid rgba(13, 87, 139, 0.86);
  border-radius: 0 0 50% 50%;
  z-index: 3;
  transition: bottom 180ms ease;
  pointer-events: none;
}

.cylinder-scale {
  position: absolute;
  inset: 18px 0 18px 0;
  z-index: 5;
}

.scale-tick {
  position: absolute;
  left: 50%;
  width: 24px;
  height: 1px;
  transform: translateX(-50%);
  background: #33424a;
}

.scale-tick.major {
  width: 92px;
  height: 2px;
}

.scale-tick.medium {
  width: 68px;
  height: 2px;
}

.scale-tick.minor {
  width: 28px;
}

.scale-tick span {
  position: absolute;
  right: calc(100% + 8px);
  top: -9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.meter-scene {
  display: grid;
  align-content: center;
  gap: 4px;
}

.object-strip {
  position: relative;
  height: 86px;
  border-radius: 8px;
  background: repeating-linear-gradient(45deg, #eef3f5 0 14px, #e0eaee 14px 28px);
  overflow: visible;
}

.object-strip::before {
  content: "";
  position: absolute;
  left: var(--object-left, 20px);
  top: 18px;
  width: var(--object-width, 160px);
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(90deg, #23806b, #76b54b);
  box-shadow: inset -10px -10px 0 rgba(0, 0, 0, 0.1);
}

.object-strip::after {
  content: "";
  position: absolute;
  left: var(--object-left, 20px);
  top: 62px;
  width: var(--object-width, 160px);
  height: 3px;
  background: #1f2b31;
}

.meter-marker {
  position: absolute;
  top: 62px;
  z-index: 2;
  width: 3px;
  height: 38px;
  background: #0a1d27;
}

.meter-marker-start {
  left: var(--object-left, 20px);
}

.meter-marker-end {
  left: var(--object-end, 180px);
}

.meter-stick {
  position: relative;
  height: 130px;
  border: 2px solid #a96f22;
  border-radius: 8px;
  background: linear-gradient(180deg, #f2cc80, #e1a94d);
  overflow: visible;
}

.cm-ticks {
  position: absolute;
  inset: 0 20px;
}

.cm-tick {
  position: absolute;
  bottom: 0;
  width: 1px;
  background: #513719;
}

.cm-tick.major {
  height: 66px;
  width: 2px;
}

.cm-tick.minor {
  height: 32px;
}

.cm-tick span {
  position: absolute;
  bottom: 72px;
  left: -7px;
  font-size: 0.9rem;
  font-weight: 800;
}

.thermometer-scene {
  position: relative;
  min-height: 572px;
  overflow: hidden;
}

.thermometer {
  position: absolute;
  left: 44px;
  top: 10px;
  height: 520px;
  width: 170px;
  cursor: grab;
  touch-action: none;
  z-index: 5;
  transform: translate(0, 0);
}

.tube {
  position: absolute;
  left: 76px;
  top: 28px;
  width: 26px;
  height: 405px;
  border: 4px solid #6a767d;
  border-radius: 99px;
  background: #f5fafb;
  overflow: hidden;
}

.mercury {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 0;
  height: 35%;
  border-radius: 99px 99px 0 0;
  background: linear-gradient(180deg, #f25e4b, #b9172b);
  transition: height 120ms ease;
}

.bulb {
  position: absolute;
  left: 56px;
  bottom: 26px;
  width: 66px;
  height: 66px;
  border: 4px solid #6a767d;
  border-radius: 50%;
  background: radial-gradient(circle at 45% 35%, #ff8f72, #be2034 64%);
}

.temp-scale {
  position: absolute;
  left: 112px;
  top: 35px;
  width: 58px;
  height: 390px;
}

.temp-tick {
  position: absolute;
  left: 0;
  width: 24px;
  height: 1px;
  background: #33424a;
}

.temp-tick.major {
  width: 38px;
  height: 2px;
}

.temp-tick span {
  position: absolute;
  left: 44px;
  top: -9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.beaker-temp {
  position: absolute;
  right: 90px;
  bottom: 58px;
  width: 250px;
  height: 250px;
  border: 5px solid rgba(67, 89, 101, 0.35);
  border-top: 0;
  border-radius: 0 0 28px 28px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.28);
}

.liquid-temp {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64%;
  background: #58a7c6;
}

.steam {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 38% 30%, rgba(255, 255, 255, 0.9) 0 10px, transparent 11px),
    radial-gradient(circle at 62% 18%, rgba(255, 255, 255, 0.8) 0 9px, transparent 10px);
  opacity: 0;
}

.thermometer-status {
  position: absolute;
  right: 90px;
  bottom: 324px;
  min-width: 190px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafb;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.thermometer-status.submerged {
  border-color: #6fb68d;
  background: #e7f5ee;
  color: var(--green);
}

@media (max-width: 860px) {
  h1 {
    font-size: 2.6rem;
  }

  .workspace,
  .topbar,
  .lab-brief,
  .lab-report {
    flex-direction: column;
    align-items: stretch;
  }

  .side-panel {
    flex-basis: auto;
  }

  .instrument-stage,
  .instrument-panel {
    min-height: 560px;
  }

  .beam {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .beam-label {
    text-align: left;
  }

  .cylinder-scene,
  .thermometer-scene {
    min-height: 540px;
  }

  .beaker-temp {
    right: 20px;
    width: 220px;
  }

  .thermometer-status {
    right: 20px;
  }

  .report-grid {
    grid-template-columns: 1fr 1fr;
  }

  .report-form {
    grid-template-columns: 1fr;
  }

  .instruction-grid {
    grid-template-columns: 1fr;
  }
}
