.profile-photo-cropper {
  display: grid;
  gap: 10px;
  align-items: start;
}

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

.profile-photo-crop-frame {
  width: min(260px, 100%);
  aspect-ratio: 1;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(148, 163, 184, 0.16) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(148, 163, 184, 0.16) 75%);
  background-size: 18px 18px;
  background-position: 0 0, 0 9px, 9px -9px, -9px 0;
  cursor: grab;
  overflow: hidden;
  position: relative;
  touch-action: none;
}

.profile-photo-crop-frame:active {
  cursor: grabbing;
}

.profile-photo-crop-frame::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  box-shadow: 0 0 0 999px rgba(15, 23, 42, 0.2);
  pointer-events: none;
}

.profile-photo-crop-frame img {
  left: 50%;
  max-width: none;
  position: absolute;
  top: 50%;
  user-select: none;
  will-change: transform;
}

.profile-photo-crop-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.profile-photo-crop-controls label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: min(260px, 100%);
  color: var(--muted);
  font-size: 13px;
}

.profile-photo-crop-controls input[type="range"] {
  flex: 1 1 150px;
}

.profile-photo-crop-help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

body.theme-dark .profile-photo-crop-frame::after {
  border-color: rgba(226, 232, 240, 0.64);
  box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.36);
}
