.hdf-cropper-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 18, 15, 0.84);
  backdrop-filter: blur(8px);
}

.hdf-cropper-dialog {
  width: min(1040px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(255, 253, 247, 0.25);
  background: #fffdf7;
  color: #1c1917;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.5);
  outline: none;
}

.hdf-cropper-header,
.hdf-cropper-footer,
.hdf-cropper-controls,
.hdf-cropper-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hdf-cropper-header {
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(28, 25, 23, 0.18);
}

.hdf-cropper-kicker {
  margin: 0 0 5px;
  color: #bc5136;
  font: 800 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hdf-cropper-header h2 {
  margin: 0;
  font: 800 clamp(22px, 3vw, 34px)/1.1 Georgia, "Times New Roman", serif;
}

.hdf-cropper-help {
  max-width: 760px;
  margin: 8px 0 0;
  color: #625b53;
  font: 14px/1.5 system-ui, sans-serif;
}

.hdf-cropper-stage-wrap {
  position: relative;
  margin: 22px 24px 12px;
  overflow: hidden;
  border: 1px solid #302b27;
  background: #161411;
  aspect-ratio: 16 / 9;
}

.hdf-cropper-stage {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.hdf-cropper-stage.is-dragging {
  cursor: grabbing;
}

.hdf-cropper-stage-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(255, 253, 247, 0.78);
  box-shadow: inset 0 0 0 1px rgba(28, 25, 23, 0.5);
}

.hdf-cropper-safe-area {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52.875%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border: 1px dashed rgba(255, 253, 247, 0.78);
}

.hdf-cropper-safe-label {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 4px 7px;
  background: rgba(28, 25, 23, 0.75);
  color: #fffdf7;
  font: 700 9px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hdf-cropper-meta {
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 0 24px 16px;
  color: #625b53;
  font: 700 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hdf-cropper-meta .is-warning {
  color: #9f3e2c;
}

.hdf-cropper-controls {
  justify-content: space-between;
  padding: 16px 24px;
  border-top: 1px solid rgba(28, 25, 23, 0.14);
  border-bottom: 1px solid rgba(28, 25, 23, 0.14);
  background: #f6f0e5;
}

.hdf-cropper-controls label {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 220px;
  font: 800 11px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hdf-cropper-controls input[type="range"] {
  flex: 1;
  min-width: 140px;
  accent-color: #bc5136;
}

.hdf-cropper-footer {
  justify-content: flex-end;
  padding: 18px 24px 22px;
}

.hdf-cropper-primary,
.hdf-cropper-secondary,
.hdf-cropper-icon-button {
  min-height: 42px;
  border: 1px solid #1c1917;
  padding: 0 16px;
  cursor: pointer;
  font: 800 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hdf-cropper-primary {
  background: #1c1917;
  color: #fffdf7;
}

.hdf-cropper-primary:hover {
  background: #bc5136;
  border-color: #bc5136;
}

.hdf-cropper-primary:disabled {
  cursor: wait;
  opacity: 0.55;
}

.hdf-cropper-secondary,
.hdf-cropper-icon-button {
  background: #fffdf7;
  color: #1c1917;
}

.hdf-cropper-secondary:hover,
.hdf-cropper-icon-button:hover {
  background: #f6f0e5;
}

.hdf-cropper-icon-button {
  min-width: 42px;
  padding: 0;
  font-size: 24px;
  letter-spacing: 0;
}

@media (max-width: 680px) {
  .hdf-cropper-overlay {
    padding: 0;
  }

  .hdf-cropper-dialog {
    width: 100%;
    min-height: 100vh;
    max-height: 100vh;
    border: 0;
  }

  .hdf-cropper-header,
  .hdf-cropper-footer,
  .hdf-cropper-controls,
  .hdf-cropper-meta {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hdf-cropper-stage-wrap {
    margin-left: 0;
    margin-right: 0;
    border-left: 0;
    border-right: 0;
  }

  .hdf-cropper-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .hdf-cropper-footer {
    position: sticky;
    bottom: 0;
    background: #fffdf7;
  }

  .hdf-cropper-footer button {
    flex: 1;
  }
}
