.photo-crop-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
}

.photo-crop-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(2, 8, 12, 0.82);
  backdrop-filter: blur(10px);
  cursor: default;
}

.photo-crop-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 620px);
  max-height: calc(100vh - 40px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
}

.photo-crop-header,
.photo-crop-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
}

.photo-crop-header {
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.photo-crop-header p,
.photo-crop-header h2,
.photo-crop-actions p { margin: 0; }
.photo-crop-header p {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.photo-crop-header h2 { margin-top: 4px; font-size: 18px; }
.photo-crop-close {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 23px;
  cursor: pointer;
}

.photo-crop-body { padding: 18px; }
.photo-crop-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 4 / 5;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(240, 207, 123, 0.45);
  border-radius: 16px;
  background: #071117;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.photo-crop-stage.is-dragging { cursor: grabbing; }
.photo-crop-stage canvas { width: 100%; height: 100%; display: block; }
.photo-crop-guide {
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12);
}
.photo-crop-guide::before,
.photo-crop-guide::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.18);
}
.photo-crop-guide::before { left: 33.333%; top: 0; width: 1px; height: 100%; box-shadow: calc(100% + 33.333%) 0 rgba(255, 255, 255, 0.18); }
.photo-crop-guide::after { top: 33.333%; left: 0; height: 1px; width: 100%; box-shadow: 0 calc(100% + 33.333%) rgba(255, 255, 255, 0.18); }
.photo-crop-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 10px;
  pointer-events: none;
}

.photo-crop-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px 14px;
  align-items: center;
  margin-top: 16px;
}
.photo-crop-controls label {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}
.photo-crop-controls input { width: 100%; accent-color: var(--accent); }
.photo-crop-controls output { color: var(--text); }
.photo-crop-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--border);
}
.photo-crop-actions .form-message { margin-right: auto; }
.photo-crop-actions .btn,
.photo-crop-actions .mini-btn { min-width: 120px; }
body.photo-crop-open { overflow: hidden; }

@media (max-width: 560px) {
  .photo-crop-modal { padding: 8px; }
  .photo-crop-dialog { width: 100%; max-height: calc(100vh - 16px); border-radius: 14px; }
  .photo-crop-body { padding: 12px; }
  .photo-crop-stage { width: min(100%, 310px); }
  .photo-crop-actions { flex-wrap: wrap; }
  .photo-crop-actions .form-message { width: 100%; }
  .photo-crop-actions .btn,
  .photo-crop-actions .mini-btn { flex: 1; }
}
