.pca-stage {
  --split: 50%;
  --badge-inset: clamp(7px, 1.1vw, 14px);
  position: relative;
  isolation: isolate;
  width: 100%;
  aspect-ratio: 5 / 3;
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  background: #17232b;
  border-radius: 8px;
}

.pca-posters, .pca-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
}

.pca-posters img, .pca-canvas, .pca-fallback-original, .pca-fallback-pca {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}

.pca-poster-right, .pca-fallback-pca { clip-path: inset(0 0 0 var(--split)); }

.pca-stage[data-latent-side="left"] :is(.pca-poster-right, .pca-fallback-pca) {
  clip-path: inset(0 calc(100% - var(--split)) 0 0);
}

.pca-decoder {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.pca-label {
  position: absolute;
  top: var(--badge-inset);
  padding: .42em .64em;
  color: #fff;
  background: rgb(17 25 30 / .84);
  border-radius: 4px;
  font-size: clamp(10px, 1.3vw, 13px);
  line-height: 1.12;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
}

.pca-label-left { left: var(--badge-inset); }
.pca-label-right { right: var(--badge-inset); }

.pca-divider {
  position: absolute;
  inset-block: 0;
  left: var(--split);
  width: 36px;
  transform: translateX(-50%);
  touch-action: pan-y;
  outline: none;
}

.pca-divider::before {
  content: "";
  position: absolute;
  inset-block: 0;
  left: calc(50% - 1px);
  width: 2px;
  background: #fff;
  box-shadow: 0 0 3px rgb(0 0 0 / .62);
}

.pca-handle {
  display: grid;
  place-items: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: #17232b;
  background: #fff;
  box-shadow: 0 1px 8px rgb(0 0 0 / .28);
}

.pca-stage[data-edge="left"] .pca-handle { transform: translate(-15%, -50%); }
.pca-stage[data-edge="right"] .pca-handle { transform: translate(-85%, -50%); }
.pca-stage[data-edge]:not([data-edge=""]) .pca-divider { width: 12px; }
.pca-divider:focus-visible .pca-handle { outline: 3px solid #0872bd; outline-offset: 4px; }

.pca-play {
  position: absolute;
  right: var(--badge-inset);
  bottom: var(--badge-inset);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / .35);
  border-radius: 50%;
  color: #fff;
  background: rgb(17 25 30 / .85);
  cursor: pointer;
}

.pca-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.pca-play svg { grid-area: 1 / 1; }

.pca-stage [hidden] { display: none !important; }
.pca-status { position: absolute; z-index: 2; bottom: 1rem; left: 1rem; color: #fff; background: #17232b; padding: .4rem .65rem; }
