/* Compact slot shown inline in the host page: small thumbnail + edit button.
   Clicking it opens the shared modal (styles below) where the actual
   upload/crop/adjustments UI lives. */
.pp-slot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; max-width: 100%; }

.pp-slot-thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
  cursor: pointer;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.pp-slot-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.pp-slot-thumb.hidden { display: none; }

.pp-slot-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  line-height: 1.3;
  color: var(--muted, #64748b);
  padding: 4px;
}
.pp-slot-placeholder.hidden { display: none; }

.pp-slot-info { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.pp-slot-status { font-size: 12px; color: var(--muted, #64748b); min-height: 14px; }

/* Shared modal (uses the host page's .modal-overlay / .modal / .modal-actions
   / .field / .checkbox-field / .secondary / .btn-primary, already defined
   identically in every tool's own stylesheet - only picker-specific bits
   are defined here). */
.pp-modal-overlay { padding: 24px 12px; box-sizing: border-box; }

.pp-modal {
  position: relative;
  max-width: 560px;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.pp-modal-title { flex-shrink: 0; }

.pp-modal-body {
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* let the flex child actually shrink+scroll instead of overflowing the modal */
  padding-right: 4px;
  margin-right: -4px;
}

.pp-modal .modal-actions { flex-shrink: 0; }

.pp-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: var(--muted, #64748b);
  cursor: pointer;
  padding: 4px 8px;
}
.pp-modal-close:hover { color: var(--text, #0f172a); }

.pp-modal .pp-crop-mode {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--muted, #64748b);
  margin-bottom: 10px;
}
.pp-modal .pp-crop-mode label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

.pp-modal .pp-canvas-wrap {
  position: relative;
  max-width: 100%;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 12px;
  background:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.pp-modal .pp-canvas-wrap.hidden { display: none; }
.pp-modal canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }
.pp-modal canvas.pp-mode-full { cursor: default; }

.pp-modal .pp-adjustments { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }

.pp-modal .pp-status { min-height: 16px; }
