.lab .velle-lab-grid {
  row-gap: clamp(1.25rem, 2.8vw, 2rem);
}

.velle-lab-heading {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
}

.velle-lab-heading h2 {
  margin: 0;
  font: 400 clamp(3.3rem, 6.7vw, 6.5rem)/.85 var(--display, 'Instrument Serif', Georgia, serif);
  letter-spacing: -.045em;
}

.velle-lab-heading h2 span { color: #8671ad; }

.velle-lab-comparison {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
}

.lab .velle-lab-copy {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
}

.lab #lab-visual {
  --split: 50%;
  --divider: 50%;
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  background: #c4b2c6;
}

.lab #lab-visual img {
  position: absolute;
  inset: 0;
  object-position: center;
}

#lab-image { clip-path: inset(0 0 0 var(--split)); }

.lab-photo-label {
  position: absolute;
  z-index: 1;
  top: .85rem;
  padding: .3rem .6rem;
  border-radius: 50px;
  background: #211a26e6;
  color: #fff8fd;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  pointer-events: none;
}

.lab-photo-before { left: .85rem; }
.lab-photo-after { right: .85rem; }

#lab-visual[data-comparison='after'] .lab-photo-before,
#lab-visual[data-comparison='before'] .lab-photo-after {
  visibility: hidden;
}

.lab-divider {
  position: absolute;
  z-index: 2;
  inset-block: 0;
  left: var(--divider);
  width: 2px;
  transform: translateX(-50%);
  background: #fff8fd;
  pointer-events: none;
}

.lab-divider span {
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid #3e2c4b;
  border-radius: 50%;
  background: #fcf6fc;
  color: #271e2b;
  font-size: 1.15rem;
  box-shadow: 0 2px 12px #211a263b;
}

#lab-compare {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 0;
  width: 100%;
  height: 44px;
  padding: 0;
  margin: 0;
  transform: translateY(-50%);
  opacity: 0;
  appearance: none;
  background: transparent;
  cursor: ew-resize;
  touch-action: pan-y;
}

#lab-compare::-webkit-slider-thumb {
  appearance: none;
  width: 44px;
  height: 44px;
}

#lab-compare::-moz-range-thumb {
  width: 44px;
  height: 44px;
  border: 0;
}

#lab-visual:focus-within .lab-divider span {
  outline: 2px solid #6f318d;
  outline-offset: 3px;
}

.lab-image-message {
  position: absolute;
  z-index: 4;
  inset-inline: .85rem;
  bottom: .75rem;
  width: fit-content;
  margin: 0 auto;
  padding: .4rem .7rem;
  border-radius: .3rem;
  background: #211a26e6;
  color: white;
  text-align: center;
  font-size: .8rem;
  pointer-events: none;
}

.lab-image-message:empty { padding: 0; }

#lab-visual[data-state='unavailable'] img,
#lab-visual[data-state='unavailable'] .lab-photo-label,
#lab-visual[data-state='unavailable'] .lab-divider {
  visibility: hidden;
}

#lab-compare-help {
  margin: .6rem 0 0;
  color: #504957;
  font-size: .8rem;
}

.lab-choices {
  display: grid;
  gap: .85rem;
  margin-bottom: 1.2rem;
}

.lab-options {
  min-inline-size: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.lab-options legend {
  margin-bottom: .45rem;
  padding: 0;
  color: #504957;
  font-size: .8rem;
  font-weight: 700;
}

.lab-pills.velle-swatches { margin: 0; }

.lab-pills input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.lab-pills label {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 44px;
  padding: .42rem .7rem;
  border: 1px solid #9786a0;
  border-radius: 50px;
  color: #271e2b;
  font-size: .8rem;
  cursor: pointer;
}

.lab-pills label:hover { background: #f7eff9; }

.lab-pills input:checked + label {
  border-color: #3e2c4b;
  background: #faf5fc;
  box-shadow: inset 0 0 0 1px #3e2c4b;
  font-weight: 700;
}

.lab-pills input:focus-visible + label {
  outline: 2px solid #6f318d;
  outline-offset: 3px;
}

.lab-swatch-light { background: #edbd9e; }
.lab-swatch-medium { background: #b67d5b; }
.lab-swatch-deep { background: #744634; }

.lab-look-specs {
  display: grid;
  gap: .3rem;
  margin: .8rem 0 0;
  color: #504957;
  font-size: .8rem;
}

.lab-look-specs > div {
  display: grid;
  grid-template-columns: minmax(5rem, auto) 1fr;
  align-items: start;
}

.lab-look-specs dt { font-weight: 700; }
.lab-look-specs dd { margin: 0; }

.lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .55rem;
  margin-top: 1.15rem;
}

.lab-secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 .9rem;
  flex: 1 0 100%;
}

.lab-secondary-actions button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #463653;
  font-size: .8rem;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.lab-secondary-actions button:hover { color: #6f318d; }

.lab-favourite-status {
  margin: 0;
  color: #504957;
  font-size: .8rem;
}

@media (max-width: 760px) {
  .velle-lab-heading,
  .velle-lab-comparison,
  .lab .velle-lab-copy {
    grid-column: 1;
    grid-row: auto;
  }
}
