/* Sigify — Image Cropper — per-tool styles */
.crop-workspace {
  margin-top: 22px; padding: 22px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.crop-workspace h3 {
  font-size: 1.05rem; color: var(--primary);
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.crop-workspace h3::before { content: ''; display: inline-block; width: 4px; height: 18px; background: var(--primary); border-radius: 3px; }
.crop-workspace .muted { color: var(--text-light); font-weight: 600; font-size: 0.85rem; margin-left: 6px; }
.crop-stage {
  position: relative; width: 100%;
  height: clamp(360px, 60vh, 620px);
  background-color: #0f172a;
  background-image:
    linear-gradient(45deg, #222 25%, transparent 25%),
    linear-gradient(-45deg, #222 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #222 75%),
    linear-gradient(-45deg, transparent 75%, #222 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0;
  border-radius: var(--radius); overflow: hidden; user-select: none; touch-action: none;
}
.crop-stage canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.crop-stage.is-panning canvas { cursor: grabbing; }
.crop-stage.is-cropping { cursor: crosshair; }
.crop-overlay { position: absolute; inset: 0; pointer-events: none; }
.crop-rect {
  position: absolute; border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  pointer-events: auto; cursor: move;
}
.crop-rect.circle { border-radius: 50%; }
.crop-rect .dim-readout {
  position: absolute; left: 50%; bottom: -28px; transform: translateX(-50%);
  background: rgba(15,23,42,0.85); color: #fff; padding: 3px 10px;
  border-radius: 999px; font-size: 0.78rem; font-weight: 700; white-space: nowrap;
}
.crop-rect .handle {
  position: absolute; width: 14px; height: 14px; background: #fff;
  border: 2px solid var(--primary); border-radius: 3px; box-shadow: 0 0 0 2px rgba(0,0,0,0.4);
}
.handle-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.handle-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.handle-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.handle-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.handle-n  { left: 50%; top: -9px; transform: translateX(-50%); cursor: ns-resize; }
.handle-s  { left: 50%; bottom: -9px; transform: translateX(-50%); cursor: ns-resize; }
.handle-w  { left: -9px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.handle-e  { right: -9px; top: 50%; transform: translateY(-50%); cursor: ew-resize; }
.crop-controls { display: flex; flex-direction: column; gap: 10px; }
.control-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 0; border-top: 1px dashed var(--border); }
.control-row:first-of-type { border-top: none; }
.control-label { min-width: 110px; color: var(--text-mid); font-size: 0.85rem; font-weight: 700; }
.align-row label { color: var(--text-mid); font-size: 0.92rem; }
.chip-btn-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn {
  background: rgba(55,122,209,0.06); border: 1px solid var(--border);
  color: var(--text-mid); font-weight: 600; font-size: 0.85rem;
  padding: 6px 12px; border-radius: 50px; cursor: pointer; transition: var(--transition);
}
.chip-btn:hover { color: var(--primary); border-color: var(--primary-light); background: rgba(55,122,209,0.10); }
.chip-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(55,122,209,0.25); }
.custom-aspect { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }
.custom-aspect input[type="number"] {
  width: 60px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-weight: 600; color: var(--text-dark); background: #fff;
}
.custom-aspect input[type="number"]:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(55,122,209,0.15); }
.custom-aspect span { font-weight: 800; color: var(--text-mid); }
.dim-wrap { display: inline-flex; flex-direction: column; gap: 4px; font-size: 0.82rem; color: var(--text-mid); font-weight: 600; }
.dim-wrap input, .dim-wrap select {
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  padding: 7px 10px; font-size: 0.95rem; color: var(--text-dark); font-weight: 600; min-width: 120px;
}
.dim-wrap input:focus, .dim-wrap select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(55,122,209,0.15); }
.check-wrap { display: inline-flex; align-items: center; gap: 6px; }
.check-wrap input { accent-color: var(--primary); }
.quality-section { display: inline-flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-mid); font-weight: 600; }
.active-tool { color: var(--primary) !important; font-weight: 700; }
.preview-item .preview-actions { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 720px) {
  .crop-stage { height: 60vh; min-height: 360px; }
  .control-label { min-width: 0; }
}
