.scan-stage.has-photo-range #photo {
  object-fit: contain;
  object-position: center;
}

.scan-stage.has-portrait-photo {
  min-height: clamp(300px, 49vh, 450px);
}

.scan-stage.has-photo-range .stage-corners {
  display: none;
}

.photo-range {
  position: absolute;
  z-index: 3;
  inset: 0;
  pointer-events: none;
}

.photo-range[hidden] {
  display: none;
}

.photo-selection {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid #ffa263;
  border-radius: 5px;
  box-shadow: 0 0 0 100vmax rgb(8 8 14 / 58%);
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
  user-select: none;
}

.photo-selection.is-dragging {
  cursor: grabbing;
}

.photo-selection:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.photo-selection-line {
  position: absolute;
  inset: var(--photo-line-position, 50%) 2px auto;
  height: 2px;
  background: repeating-linear-gradient(90deg, #ffb97ae6 0 8px, transparent 8px 13px);
  box-shadow: 0 0 5px #2914079e;
  pointer-events: none;
}

.photo-handle {
  position: absolute;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: nwse-resize;
  touch-action: none;
}

.photo-handle::before {
  position: absolute;
  inset: 11px;
  border: 2px solid #572c17;
  border-radius: 50%;
  background: #ffb879;
  box-shadow: 0 1px 3px #100b07ad;
  content: '';
}

.photo-handle-start {
  top: 0;
  left: 0;
  transform: translate(-50%, -50%);
}

.photo-handle-end {
  right: 0;
  bottom: 0;
  transform: translate(50%, 50%);
}

.photo-handle:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -4px;
}
