.lab-experiment-shell {
  width: min(900px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.lab-experiment-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}

.lab-back-link {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  border: 2px solid var(--lab-ink);
  border-radius: 16px;
  background: var(--lab-paper);
  padding: 10px 15px;
  font-weight: 800;
}

.lab-tool-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.lab-tool-button {
  min-height: 52px;
  border: 2px solid var(--lab-ink);
  border-radius: 16px;
  background: var(--lab-paper);
  padding: 9px 14px;
  color: var(--lab-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.lab-tool-button[aria-pressed="true"] {
  background: var(--lab-yellow);
}

.lab-progress {
  display: grid;
  grid-template-columns: repeat(6, minmax(72px, 1fr));
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 20px;
  padding: 0 0 8px;
  list-style: none;
  scrollbar-width: thin;
}

.lab-progress li {
  min-width: 72px;
  margin: 0;
  border: 2px solid rgba(36, 49, 58, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.74);
  padding: 8px 6px;
  color: #66727a;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.lab-progress li[data-status="current"] {
  border-color: var(--lab-ink);
  background: var(--lab-yellow);
  color: var(--lab-ink);
}

.lab-progress li[data-status="complete"] {
  border-color: var(--lab-green);
  background: #eaf8ef;
  color: #28694b;
}

.lab-stage {
  min-height: 560px;
  border: 3px solid var(--lab-ink);
  border-radius: 32px;
  background: var(--lab-paper);
  padding: clamp(24px, 6vw, 48px);
  box-shadow: 10px 12px 0 rgba(36, 49, 58, 0.1);
}

.lab-stage[hidden] {
  display: none;
}

.lab-stage-kicker {
  display: inline-flex;
  margin: 0 0 16px;
  border-radius: 999px;
  background: var(--lab-yellow);
  padding: 7px 13px;
  color: #5f4510;
  font-size: 14px;
  font-weight: 900;
}

.lab-stage h1,
.lab-stage h2 {
  max-width: 760px;
  margin-bottom: 18px;
  font-size: clamp(32px, 7vw, 52px);
  line-height: 1.14;
  letter-spacing: -0.025em;
}

.lab-stage-copy {
  max-width: 720px;
  color: #52616b;
  font-size: clamp(18px, 3vw, 22px);
}

.lab-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.lab-choice {
  min-height: 76px;
  border: 3px solid var(--lab-ink);
  border-radius: 22px;
  background: #f7fbff;
  padding: 16px 18px;
  color: var(--lab-ink);
  font: inherit;
  font-size: 18px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.lab-choice:nth-child(2n) {
  background: #fff5d9;
}

.lab-choice[aria-pressed="true"] {
  background: var(--lab-blue);
  box-shadow: inset 0 0 0 3px #ffffff;
}

.lab-stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.lab-action-button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--lab-ink);
  border-radius: 18px;
  padding: 12px 22px;
  color: var(--lab-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.lab-action-button-primary {
  background: var(--lab-coral);
  color: var(--lab-ink);
  box-shadow: 0 7px 0 #d95d4b;
}

.lab-action-button-secondary {
  background: var(--lab-paper);
}

.lab-action-button:disabled {
  border-color: #aeb7bd;
  background: #e6eaed;
  box-shadow: none;
  color: #78858d;
  cursor: not-allowed;
}

.lab-simulation {
  margin: 24px 0;
  overflow: hidden;
  border: 3px solid var(--lab-ink);
  border-radius: 24px;
  background: #eaf6ff;
}

.lab-simulation canvas {
  display: block;
  width: 100%;
  min-height: 280px;
  touch-action: none;
}

.lab-simulation-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 3px solid var(--lab-ink);
  background: var(--lab-paper);
  padding: 18px;
}

.lab-control-button {
  min-height: 52px;
  border: 3px solid var(--lab-ink);
  border-radius: 17px;
  background: #ffffff;
  padding: 10px 16px;
  color: var(--lab-ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.lab-control-button[aria-pressed="true"] {
  background: var(--lab-yellow);
}

.lab-control-group {
  display: grid;
  flex: 1 1 260px;
  gap: 8px;
}

.lab-control-group label {
  font-weight: 900;
}

.lab-control-group input[type="range"] {
  width: 100%;
  min-height: 52px;
  accent-color: var(--lab-coral);
}

.lab-control-readout {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border-radius: 14px;
  background: #fff5d9;
  padding: 8px 12px;
  color: #654b15;
  font-size: 16px;
  font-weight: 900;
}

.lab-simulation-note {
  margin: 0;
  color: #52616b;
  font-size: 15px;
}

.lab-reality-card {
  display: grid;
  gap: 22px;
  margin-top: 24px;
}

.lab-reality-block {
  border: 2px solid rgba(36, 49, 58, 0.2);
  border-radius: 20px;
  background: #fffdf7;
  padding: 20px;
}

.lab-reality-block h3 {
  font-size: 21px;
}

.lab-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lab-materials li {
  margin: 0;
  border-radius: 999px;
  background: #eaf6ff;
  padding: 8px 12px;
  color: var(--lab-ink);
  font-size: 15px;
  font-weight: 800;
}

.lab-steps {
  margin: 0;
  padding-left: 25px;
}

.lab-steps li {
  color: #46545d;
  font-size: 17px;
}

.lab-safety {
  border-color: #e39180;
  background: #fff0ec;
}

.lab-offscreen-message {
  margin-top: 28px;
  border: 3px dashed var(--lab-green);
  border-radius: 24px;
  background: #eaf8ef;
  padding: 24px;
  text-align: center;
}

.lab-celebration {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 209, 102, 0.55), transparent 12rem),
    radial-gradient(circle at 85% 75%, rgba(116, 192, 252, 0.4), transparent 14rem),
    #ffffff;
}

.lab-celebration-mark {
  display: grid;
  width: 92px;
  height: 92px;
  margin-bottom: 24px;
  place-items: center;
  border: 3px solid var(--lab-ink);
  border-radius: 30px;
  background: var(--lab-yellow);
  font-size: 44px;
}

.lab-reflection-output {
  max-width: 680px;
  border-left: 6px solid var(--lab-green);
  border-radius: 0 18px 18px 0;
  background: #eaf8ef;
  padding: 16px 20px;
  color: #285e47;
  font-size: 19px;
  font-weight: 800;
}

.lab-sr-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .lab-experiment-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .lab-tool-row {
    justify-content: flex-start;
  }

  .lab-tool-button {
    flex: 1 1 auto;
  }

  .lab-stage {
    min-height: 520px;
    border-radius: 26px;
  }

  .lab-choice-grid {
    grid-template-columns: 1fr;
  }

  .lab-stage-actions,
  .lab-action-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lab-action-button,
  .lab-choice,
  .lab-tool-button {
    scroll-behavior: auto;
    transition: none;
  }
}
