.cropper-tool {
  display: grid;
  gap: 20px;
}

.cropper-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  background: rgb(255 255 255 / 76%);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.cropper-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.file-drop {
  display: grid;
  gap: 8px;
  place-items: center;
  padding: 28px 16px;
  color: var(--muted);
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: 8px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.crop-stage-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 16px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: auto;
}

.crop-stage {
  position: relative;
  display: inline-block;
  line-height: 0;
  max-width: 100%;
  touch-action: none;
}

.crop-stage img {
  display: block;
  max-width: 100%;
  max-height: 70vh;
  height: auto;
  user-select: none;
}

.crop-box {
  position: absolute;
  box-shadow: 0 0 0 9999px rgb(15 23 42 / 55%);
  outline: 2px solid #fff;
  cursor: move;
  touch-action: none;
}

.crop-handle {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: #fff;
  border: 2px solid var(--focus);
  border-radius: 3px;
  cursor: nwse-resize;
  touch-action: none;
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.field input,
.field select {
  padding: 10px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
}

.field output {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.result-row img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #fff 0% 50%) 50% / 12px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.result-row p {
  margin: 0 0 8px;
  color: var(--muted);
  font-weight: 700;
}

@media (max-width: 860px) {
  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  #cropBtn {
    width: 100%;
  }
}
