.lab-hero {
  display: grid;
  grid-template-columns: 1fr 1.02fr;
  min-height: 335px;
  overflow: hidden;
  border: 1px solid #efcdd8;
  border-radius: 25px;
  background: #f8e4ec;
}
.lab-hero-copy { align-self: center; position: relative; z-index: 1; padding: 42px clamp(22px, 5vw, 60px); padding-right: 8px; }
.lab-hero h1 { margin-block: .45rem .78rem; font-size: clamp(3.6rem, 8vw, 6.25rem); letter-spacing: -.065em; line-height: .96; }
.lab-hero h1 em { color: var(--wine); }
.lab-hero-copy > p:not(.eyebrow) { max-width: 33ch; color: #604552; }
.lab-hero-copy .btn { margin-top: 1.25rem; }
.lab-hero-copy .lab-completed { margin-top: .75rem; font-size: .82rem; font-weight: 750; }
.lab-hero img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: center; }
.lab-route { margin-top: 29px; }
.lab-route h2 { font-size: clamp(1.7rem, 3.2vw, 2.45rem); margin-bottom: 13px; }
.lab-route-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 0; padding: 0; list-style: none; }
.lab-route-list li { display: flex; gap: .63rem; align-items: center; min-height: 58px; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 11px; background: var(--white); font-size: .87rem; font-weight: 750; line-height: 1.25; }
.lab-route-icon { display: grid; place-items: center; flex: 0 0 29px; height: 29px; border-radius: 8px; color: var(--tone-ink); background: var(--tone); font-size: 1.13rem; }

.lab-game { width: min(100%, 890px); margin-inline: auto; }
.lab-game-header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.lab-game-title { color: var(--wine); font: 650 1.46rem/1.2 var(--serif); }
.lab-game-header .btn { font-size: .81rem; }
.lab-progress { margin: .4rem 0 18px; }
.lab-progress div { display: flex; align-items: baseline; justify-content: space-between; gap: .84rem; margin-bottom: .35rem; color: var(--muted); font-size: .82rem; font-weight: 740; }
.lab-progress strong { color: var(--wine); }
.lab-workbench { padding: clamp(14px, 3.7vw, 32px); border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: 0 8px 24px #4e223608; }
.lab-round-heading { display: flex; align-items: center; gap: .72rem; }
.lab-round-heading .eyebrow { color: var(--tone-ink); margin-bottom: .28rem; }
.lab-round-heading h1 { font-size: clamp(1.9rem, 5.6vw, 3.25rem); letter-spacing: -.04em; }
.lab-round-heading h1:focus, .lab-finish h1:focus, .lab-feedback:focus { outline: none; }
.lab-prompt { margin-block: .78rem 1.05rem; color: #59444e; }
.lab-actions { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .4rem; margin-top: 15px; }
.lab-actions .btn { min-height: 45px; }
.lab-hint, .lab-feedback { margin-top: .85rem; padding: .65rem .85rem; border-radius: .65rem; color: var(--ink); background: #f7eee2; font-size: .9rem; }
.lab-hint strong { margin-right: .28rem; color: #6d4827; }
.lab-feedback { border-left: 3px solid #bc6c8a; background: #f9e8ed; }
.lab-feedback p { margin-top: .22rem; }
.lab-feedback.lab-correct { border-color: #7f9f88; background: #e8f1e8; }
.lab-feedback.lab-correct strong { color: #365b46; }

.lab-choice {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  padding: .55rem .68rem;
  border: 1px solid #e1ccd5;
  border-radius: 9px;
  background: #fffdfa;
  color: var(--ink);
  text-align: center;
  font-size: .88rem;
  font-weight: 750;
  overflow-wrap: anywhere;
}
.lab-choice[aria-pressed="true"], .lab-choice:hover:not(:disabled) { border-color: var(--wine); background: var(--tone, var(--pink)); color: var(--tone-ink, var(--ink)); }
.lab-choice[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--wine); }
.lab-options { display: flex; flex-wrap: wrap; align-items: stretch; gap: 7px; }
.lab-options .lab-choice { flex: 1 1 auto; }

.lab-formula, .lab-equation, .lab-repeat { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .42rem .65rem; color: var(--tone-ink); }
.lab-formula { margin-bottom: 10px; border: 1px solid #ebd9de; border-radius: 10px; padding: .53rem .67rem; background: #fcf4f7; }
.lab-formula span { color: var(--muted); font-size: .83rem; font-weight: 740; }
.lab-formula strong, .lab-equation strong, .lab-repeat strong { font-variant-numeric: tabular-nums; font-size: clamp(1.03rem, 4.2vw, 1.27rem); }
.lab-atom-jars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.lab-atom-jar { min-width: 0; padding: .62rem; border: 1px solid #ebd7db; border-radius: 12px; background: var(--tone); color: var(--tone-ink); }
.lab-atom-heading { display: flex; align-items: center; min-width: 0; gap: .36rem; white-space: nowrap; font-size: .86rem; }
.lab-atom-symbol { display: grid; place-items: center; width: 29px; height: 29px; border: 1px solid currentColor; border-radius: 50%; flex-shrink: 0; font-weight: 850; }
.lab-jar-dots { display: grid; align-content: center; grid-template-columns: repeat(6, 7px); gap: 3px; min-height: 44px; }
.lab-jar-dots i { width: 7px; height: 7px; background: currentColor; border-radius: 50%; }
.lab-atom-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.lab-atom-options .lab-choice { padding-inline: .24rem; }
.lab-atom-options .lab-choice[aria-pressed="true"] { background: var(--tone-ink); border-color: var(--tone-ink); color: white; }

.lab-carbon-board, .lab-branch-board { padding: .76rem; border: 1px solid var(--line); border-radius: 12px; background: #fcf5f2; text-align: center; }
.lab-carbon-board > p, .lab-branch-board > p { color: var(--tone-ink); margin-bottom: .48rem; font-size: .83rem; font-weight: 760; }
.lab-carbon-chain { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; }
.lab-carbon-chain .lab-choice { display: grid; gap: .12rem; padding-inline: .24rem; }
.lab-carbon-chain button span { font-size: .69rem; color: var(--muted); }
.lab-ring-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lab-ring-choice { display: grid; justify-items: center; align-content: start; grid-template-columns: minmax(0, 1fr); gap: .16rem; min-width: 0; background: #f5edf8; padding: .18rem .3rem .62rem; }
.lab-ring-choice:hover:not(:disabled), .lab-ring-choice[aria-pressed="true"] { background: #f5edf8; }
.lab-ring-choice .haworth { width: min(100%, 210px); }

.lab-photo-board { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.45fr); align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fbf4f6; }
.lab-photo-board > img { display: block; height: 100%; max-height: 218px; min-height: 0; object-fit: cover; }
.lab-photo-content { display: grid; gap: 8px; padding: clamp(8px, 2vw, 15px); }
.lab-sugar-slots { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 5px; }
.lab-slot { display: inline-flex; gap: 4px; min-width: 0; min-height: 44px; justify-content: center; align-items: center; border: 1px dashed #c39cae; border-radius: 8px; background: #fffdfb; color: var(--muted); text-align: center; padding: .3rem; font-size: .81rem; font-weight: 740; }
.lab-slot.filled { border-style: solid; background: var(--tone); color: var(--tone-ink); }
.lab-slot-bond { white-space: nowrap; color: var(--wine); font-size: .81rem; font-weight: 800; }
.lab-sugar-slots .filled:disabled span { display: none; }

.lab-equation, .lab-repeat { margin-bottom: 9px; min-height: 58px; padding: .5rem; border-radius: 10px; background: var(--tone); font-size: clamp(.89rem, 3.5vw, 1.06rem); font-weight: 770; }
.lab-equation > span, .lab-equation > strong { white-space: nowrap; }
.lab-equation > strong, .lab-repeat > strong { min-width: 40px; border: 1px dashed #b18c9b; border-radius: 6px; padding: .14rem .31rem; background: #fffdfb; text-align: center; }
.lab-equation .lab-water { padding: .24rem .36rem; border-radius: 50%; background: #deedf6; color: #375a76; }
.lab-repeat { margin: 0; background: #e4edf6; }
.lab-branch-board { margin-bottom: 9px; background: #faf1df; }
.lab-branch-picture { display: grid; place-items: center; color: var(--tone-ink); gap: 9px; margin-block: .24rem .46rem; }
.lab-branch-picture .bead-row { --bead-size: 17px; gap: 5px; margin: 0; }
.lab-branch-unit { position: relative; width: 17px; height: 17px; background: var(--tone); border: 1px solid currentColor; border-radius: 50%; }
.lab-branch-unit::after { position: absolute; bottom: -10px; left: 50%; height: 9px; border-left: 1px solid currentColor; content: ''; }

.lab-finish { max-width: 650px; text-align: center; margin-inline: auto; background: #fff7fa; }
.lab-finish-heart { display: grid; place-items: center; width: 56px; height: 56px; margin: .3rem auto .85rem; color: #fff6fa; background: var(--wine); border-radius: 20px; font-size: 1.6rem; }
.lab-finish h1 { color: var(--wine); font-size: clamp(2.5rem, 7vw, 4.1rem); letter-spacing: -.046em; margin-bottom: .6rem; }
.lab-finish > p { color: #5d4350; }
.lab-finish-hearts { display: flex; flex-wrap: wrap; justify-content: center; gap: .45rem; color: var(--wine); font-size: 1.12rem; margin: .82rem auto 1rem; }
.lab-finish .lab-letter { border-radius: 11px; padding: .78rem; max-width: 39ch; margin: .82rem auto; background: #f9e4ed; color: var(--wine); font: italic 1.13rem/1.48 var(--serif); }
.lab-replay { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem .75rem; margin-top: .66rem; }

@media (max-width: 740px) {
  .lab-route-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-atom-jars { grid-template-columns: minmax(0, 1fr); }
  .lab-atom-jar { display: grid; grid-template-columns: minmax(87px, .75fr) minmax(104px, 1.25fr); column-gap: 5px; }
  .lab-atom-options { grid-area: 1 / 2 / 3 / 3; align-content: center; }
}
@media (max-width: 570px) {
  .lab-hero { grid-template-columns: 1fr; border-radius: 18px; }
  .lab-hero-copy { padding: 24px 18px 17px; }
  .lab-hero h1 { font-size: clamp(3.45rem, 13vw, 4.8rem); }
  .lab-hero img { height: clamp(168px, 45vw, 240px); object-position: 50% 56%; }
  .lab-route { margin-top: 20px; }
  .lab-route-list { gap: 6px; }
  .lab-route-list li { padding: .44rem; gap: .35rem; font-size: .77rem; min-height: 52px; }
  .lab-route-icon { flex-basis: 25px; height: 25px; font-size: .95rem; }
  .lab-atom-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lab-carbon-chain { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lab-photo-board { grid-template-columns: minmax(0, 1fr); }
  .lab-photo-board > img { height: clamp(120px, 36vw, 192px); max-height: none; }
}
