body:has(.editor-crop[open]) { overflow: hidden; }
dialog.editor-crop {
  --crop-accent: #f9ee3a;
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: min(580px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  margin: auto;
  padding: 20px;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #333;
  border-radius: 14px;
  background: #101010;
  color: #ededed;
  color-scheme: dark;
  font: 14px/1.5 Satoshi, Pretendard, system-ui, sans-serif;
  box-shadow: 0 22px 80px #0009;
}
.editor-crop *, .editor-crop *::before, .editor-crop *::after { box-sizing: border-box; }
.editor-crop::backdrop { background: #000b; backdrop-filter: blur(5px); }
.editor-crop h2 { margin: 0; font: inherit; font-size: 18px; font-weight: 600; }
.editor-crop-hint { margin: 7px 0 16px; color: #a0a0a0; font-size: 13px; }
.editor-crop-stage-wrap { display: flex; justify-content: center; width: 100%; overflow: hidden; }
.editor-crop-stage {
  position: relative;
  width: min(100%, calc(34dvh * var(--crop-aspect)));
  aspect-ratio: var(--crop-aspect);
  overflow: hidden;
  border-radius: 6px;
  outline: 1px solid #666;
  background: #080808;
  touch-action: none;
  cursor: grab;
  user-select: none;
}
.editor-crop-stage:active { cursor: grabbing; }
.editor-crop .editor-crop-photo { position: absolute; display: block; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; object-fit: fill; pointer-events: none; user-select: none; }
.editor-crop-grid { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to right, transparent calc(100% / 3 - .5px), #fff4 calc(100% / 3), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), #fff4 calc(200% / 3), transparent calc(200% / 3 + .5px)), linear-gradient(to bottom, transparent calc(100% / 3 - .5px), #fff4 calc(100% / 3), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), #fff4 calc(200% / 3), transparent calc(200% / 3 + .5px)); }
.editor-crop-controls { display: grid; gap: 12px; margin-top: 18px; }
.editor-crop-ratio-label, .editor-crop-slider { display: grid; grid-template-columns: 75px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; color: #a0a0a0; }
.editor-crop select { width: 100%; min-width: 0; min-height: 40px; padding: 7px 10px; border: 1px solid #3a3a3a; border-radius: 7px; background: #1a1a1a; color: #ededed; font: inherit; }
.editor-crop input[type=range] { width: 100%; min-width: 0; height: 28px; margin: 0; accent-color: var(--crop-accent); }
.editor-crop input:disabled { opacity: .35; }
.editor-crop-error { color: #ff7474; font-size: 13px; margin: 12px 0 0; }
.editor-crop-error:empty { display: none; }
.editor-crop-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.editor-crop button { min-height: 44px; padding: 10px 13px; border: 1px solid #3a3a3a; border-radius: 8px; background: #1a1a1a; color: #ededed; font: inherit; cursor: pointer; }
.editor-crop-actions button:first-child { margin-right: auto; }
.editor-crop .editor-crop-primary { border-color: var(--crop-accent); background: var(--crop-accent); color: #000; font-weight: 650; }
.editor-crop button:disabled { opacity: .4; cursor: not-allowed; }
.editor-crop :is(button, select, input, .editor-crop-stage):focus-visible { outline: 2px solid var(--crop-accent); outline-offset: 3px; }
@media (max-width: 360px) { dialog.editor-crop { padding: 16px; } .editor-crop-ratio-label, .editor-crop-slider { grid-template-columns: 64px minmax(0, 1fr); gap: 8px; } }
