.compare {
  /*max-width: 1400px;*/
/*  margin: 4rem auto;*/
  position: relative;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  user-select: none;
}

/* Aspect ratio: 2370x1400 */
.compare__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 2370 / 1400;
  overflow: hidden;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  background: #111;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.compare__after {
  clip-path: inset(0 0 0 var(--cut, 50%));
}

.compare__divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--cut, 50%);
  width: 2px;
  transform: translateX(-1px);
  background: rgba(255,255,255,.9);
  box-shadow: 0 0 0 1px rgba(0,0,0,.2);
  pointer-events: none;
}

.compare__handle {
  position: absolute;
  left: var(--cut, 50%);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.compare__handle::before,
.compare__handle::after {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid #111;
  border-right: 2px solid #111;
  transform: rotate(45deg);
  display: inline-block;
}
.compare__handle::before {
  margin-right: 8px;
  transform: rotate(225deg);
}
.compare__handle::after {
  margin-left: 8px;
  transform: rotate(45deg);
}

.compare__range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.compare__labels {
  display: flex;
  justify-content: space-between;
  margin: .75rem .25rem 0;
  font-size: .95rem;
  color: #333;
}

.badge {
  padding: .25rem .5rem;
  border-radius: 999px;
  background: #f1f1f1;
}

@media (max-width: 640px) {
  .compare { margin: 2rem 1rem; }
  .compare__handle { width: 40px; height: 40px; }
}