.image-crop-dialog {
  --crop-radius-control: 8px;
  --crop-radius-card: 12px;
  --crop-radius-dialog: 16px;
  width: min(960px, calc(100% - 2rem));
  max-width: none;
  padding: 0;
  border: 0;
  border-radius: var(--crop-radius-dialog);
  color: var(--theme-text, #15231b);
  background: var(--theme-surface, #fff);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .34);
}

.image-crop-dialog::backdrop { background: rgba(1, 16, 9, .76); backdrop-filter: blur(5px); }
.image-crop-card { max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; margin: 0; overflow: hidden; }
.image-crop-card header,
.image-crop-card footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--theme-border, #dfe8e2); }
.image-crop-card footer { justify-content: flex-end; border-top: 1px solid var(--theme-border, #dfe8e2); border-bottom: 0; }
.image-crop-card header span { display: block; color: var(--theme-primary, #0d5c2f); font-size: .7rem; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.image-crop-card h2 { margin: .15rem 0 0; color: var(--theme-text, #15231b); font: 800 1.2rem/1.25 "Poppins", sans-serif; }
.image-crop-close { width: 40px; height: 40px; border: 1px solid var(--theme-border, #dfe8e2); border-radius: 50%; color: var(--theme-text, #15231b); background: var(--theme-card, #fff); }
.image-crop-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 1.25rem; padding: 1.25rem; overflow-y: auto; overscroll-behavior: contain; }
.image-crop-stage { min-width: 0; text-align: center; }
.image-crop-stage canvas { display: block; width: auto; max-width: 100%; height: auto; max-height: 58vh; margin: 0 auto; border-radius: var(--crop-radius-card); object-fit: contain; background: #07150d; box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); cursor: grab; touch-action: none; }
.image-crop-stage canvas:active { cursor: grabbing; }
.image-crop-stage > span { display: block; margin-top: .6rem; color: var(--theme-muted, #66746b); font-size: .74rem; }
.image-crop-controls { display: flex; flex-direction: column; gap: 1rem; }
.image-crop-controls label > span,
.image-crop-zoom-field > span { display: block; margin-bottom: .4rem; font-size: .75rem; font-weight: 700; }
.image-crop-controls select,
.image-crop-controls input[type="range"] { width: 100%; }
.image-crop-controls select { min-height: 43px; padding: 0 .75rem; border: 1px solid var(--theme-border, #dfe8e2); border-radius: var(--crop-radius-control); color: var(--theme-text, #15231b); background: var(--theme-card, #fff); }
.image-crop-controls p { margin: 0; color: var(--theme-muted, #66746b); font-size: .73rem; line-height: 1.6; }
.image-crop-zoom-controls { display: grid; grid-template-columns: 38px minmax(0, 1fr) 38px auto; gap: .45rem; align-items: center; }
.image-crop-zoom-controls button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 1px solid var(--theme-border, #dfe8e2); border-radius: var(--crop-radius-control); color: var(--theme-text, #15231b); background: var(--theme-card, #fff); }
.image-crop-zoom-controls output { min-width: 3.2rem; color: var(--theme-muted, #66746b); font-size: .7rem; font-variant-numeric: tabular-nums; text-align: right; }
.image-crop-reset,
.image-crop-cancel,
.image-crop-save { min-height: 42px; padding: 0 1rem; border-radius: var(--crop-radius-control); font-weight: 700; }
.image-crop-reset,
.image-crop-cancel { border: 1px solid var(--theme-border, #dfe8e2); color: var(--theme-text, #15231b); background: var(--theme-card, #fff); }
.image-crop-save { border: 1px solid var(--theme-primary, #0d5c2f); color: var(--theme-button-text, #fff); background: var(--theme-button-bg, #0d5c2f); }
.image-crop-dialog :is(button, select, input, canvas):focus-visible { outline: 3px solid var(--theme-accent, #f6c445); outline-offset: 2px; }

@media (max-width: 720px) {
  .image-crop-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .image-crop-card { max-height: calc(100dvh - 1rem); }
  .image-crop-body { grid-template-columns: 1fr; padding: .85rem; }
  .image-crop-stage canvas { max-height: 42vh; }
  .image-crop-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .image-crop-controls p,
  .image-crop-reset { grid-column: 1 / -1; }
  .image-crop-card footer { padding: .8rem; }
}

@media (max-width: 480px) {
  .image-crop-controls { grid-template-columns: 1fr; }
  .image-crop-controls p,
  .image-crop-reset { grid-column: auto; }
  .image-crop-zoom-controls { grid-template-columns: 38px minmax(0, 1fr) 38px; }
  .image-crop-zoom-controls output { grid-column: 1 / -1; text-align: center; }
  .image-crop-card footer { flex-wrap: wrap; }
  .image-crop-card footer button { flex: 1 1 130px; }
}
