/* ============================================================
   Social Media Post Cropper — style.css
   Classes  : sc-social-crop-*
   Approach : Mobile-first (base = mobile, @media min-width = desktop)
   Brand    : #42B5A4 (teal) — same identity as the circle-crop tool
   ============================================================ */


/* ══════════════════════════════════════════
   0. BASE / RESET / BRAND TOKENS
   ══════════════════════════════════════════ */
.sc-social-crop-wrap,
.sc-social-crop-wrap * {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

.sc-social-crop-wrap {
  --sc-brand: #42B5A4;
  --sc-brand-dark: #2E8577;
  --sc-brand-soft: #E8F8F6;

  --sc-ink: #1a1a22;
  --sc-ink-soft: #55555f;
  --sc-line: #e4e4ee;
  --sc-line-strong: #c4c4d4;
  --sc-bg: #f5f5fa;
  --sc-error: #c0392b;

  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 56px;
  touch-action: manipulation;
  overscroll-behavior-y: contain;
}

/* ══════════════════════════════════════════
   1. HEADER / STEPPER
   ══════════════════════════════════════════ */
.sc-social-crop-header {
  text-align: center;
  margin-bottom: 24px;
}

.sc-social-crop-header__title {
  font-weight: 800;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  letter-spacing: -0.8px;
  color: var(--sc-ink);
  margin: 0 0 8px;
}

.sc-social-crop-header__title strong {
  font-weight: 900;
  color: var(--sc-brand);
}

.sc-social-crop-header__subtitle {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--sc-ink-soft);
  line-height: 1.6;
  margin: 0;
}

.sc-social-crop-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 28px;
}

.sc-social-crop-stepper__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.sc-social-crop-stepper__step.is-active,
.sc-social-crop-stepper__step.is-done {
  opacity: 1;
}

.sc-social-crop-stepper__dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #9999a2;
  background: #fff;
  border: 1.5px solid var(--sc-line);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sc-social-crop-stepper__step.is-active .sc-social-crop-stepper__dot {
  background: var(--sc-brand);
  border-color: var(--sc-brand);
  color: #fff;
}

.sc-social-crop-stepper__step.is-done .sc-social-crop-stepper__dot {
  background: var(--sc-brand-soft);
  border-color: var(--sc-brand);
  color: var(--sc-brand);
}

.sc-social-crop-stepper__dot--export {
  width: auto;
  border-radius: 9999px;
  padding: 0 16px;
  font-size: 12px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.sc-social-crop-stepper__label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sc-ink-soft);
}

.sc-social-crop-stepper__line {
  width: 28px;
  height: 2px;
  background: var(--sc-line);
  margin-top: -18px;
}

/* ══════════════════════════════════════════
   2. PANELS
   ══════════════════════════════════════════ */
.sc-social-crop-panel {
  display: none;
}

.sc-social-crop-panel.is-active {
  display: block;
  animation: sc-fade-in 0.25s ease;
}

@keyframes sc-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   3. DROPZONE
   ══════════════════════════════════════════ */
.sc-social-crop-dropzone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 480px;
  margin: 8px auto 0;
  padding: 40px 24px;
  border-radius: 24px;
  cursor: pointer;
}

/* Drag-over affordance: a soft brand-colored halo behind the whole
   card, not a color swap — reads as "drop here" without shouting. */
.sc-social-crop-dropzone__ring {
  position: absolute;
  inset: 0;
  border-radius: 24px;
  border: 1.5px dashed transparent;
  box-shadow: 0 0 0 0 rgba(66, 181, 164, 0);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
  pointer-events: none;
}

.sc-social-crop-dropzone.is-dragover .sc-social-crop-dropzone__ring {
  border-color: rgba(66, 181, 164, 0.45);
  box-shadow: 0 0 0 8px rgba(66, 181, 164, 0.08);
}

.sc-social-crop-dropzone__button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 32px;
  border-radius: 9999px;
  background: var(--sc-brand);
  border: 1.5px solid var(--sc-brand);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.1px;
  box-shadow: 0 2px 10px rgba(66,181,164,0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  cursor: pointer;
}

.sc-social-crop-dropzone__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #fff;
}

.sc-social-crop-dropzone:hover .sc-social-crop-dropzone__button {
  transform: translateY(-2px);
  background: var(--sc-brand-dark);
  border-color: var(--sc-brand-dark);
  box-shadow: 0 14px 32px rgba(66,181,164,0.28);
}

.sc-social-crop-dropzone__button:active {
  transform: translateY(0) scale(0.98);
}

.sc-social-crop-dropzone__divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 300px;
  margin-top: 28px;
  color: #a3a3ae;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.sc-social-crop-dropzone__divider::before,
.sc-social-crop-dropzone__divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--sc-line-strong));
}

.sc-social-crop-dropzone__divider::after {
  background: linear-gradient(to left, transparent, var(--sc-line-strong));
}

.sc-social-crop-dropzone__trust {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 20px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sc-ink-soft);
}

.sc-social-crop-dropzone__trust svg {
  width: 14px;
  height: 14px;
  color: var(--sc-brand);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════
   4. CONTROLS (preset select, custom size, zoom, background)
   ══════════════════════════════════════════ */
.sc-social-crop-controls__row {
  margin-bottom: 18px;
}

.sc-social-crop-controls__label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--sc-ink);
  margin-bottom: 8px;
}

.sc-social-crop-controls__val {
  font-weight: 700;
  color: var(--sc-brand);
  margin-left: 4px;
}

.sc-social-crop-preset {
  position: relative;
}

.sc-social-crop-preset__trigger {
  height: 48px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--sc-line);
  background: #fff;
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sc-ink);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.sc-social-crop-preset__trigger[aria-expanded="true"] {
  border-color: var(--sc-brand);
  box-shadow: 0 0 0 4px var(--sc-brand-soft);
}

.sc-social-crop-preset__trigger-icon svg {
  width: 18px;
  height: 18px;
  color: var(--sc-brand);
  flex-shrink: 0;
}

.sc-social-crop-preset__trigger-text {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sc-social-crop-preset__chevron {
  width: 18px;
  height: 18px;
  color: var(--sc-ink-soft);
  flex-shrink: 0;
  transition: transform 0.18s ease;
}

.sc-social-crop-preset__trigger[aria-expanded="true"] .sc-social-crop-preset__chevron {
  transform: rotate(180deg);
}

.sc-social-crop-preset__panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  background: #fff;
  border: 1.5px solid var(--sc-line);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(26,26,34,0.16);
  max-height: 320px;
  overflow-y: auto;
  padding: 6px;
}

.sc-social-crop-preset__group-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 6px;
  margin: 6px 0 2px;
  color: var(--sc-ink-soft);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--sc-line);
}

.sc-social-crop-preset__group-heading:first-child {
  margin-top: 0;
  border-top: none;
}

.sc-social-crop-preset__group-icon svg {
  width: 14px;
  height: 14px;
  color: var(--sc-brand);
}

.sc-social-crop-preset__option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px 9px 8px;
  border: none;
  border-left: 2.5px solid transparent;
  background: none;
  border-radius: 8px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}

.sc-social-crop-preset__option:hover {
  background: var(--sc-bg);
}

.sc-social-crop-preset__option.is-selected {
  border-left-color: var(--sc-brand);
  background: var(--sc-bg);
}

.sc-social-crop-preset__option-icon svg {
  width: 18px;
  height: 18px;
  color: var(--sc-ink-soft);
  flex-shrink: 0;
}

.sc-social-crop-preset__option.is-selected .sc-social-crop-preset__option-icon svg {
  color: var(--sc-brand);
}

.sc-social-crop-preset__option-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
}

.sc-social-crop-preset__option-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--sc-ink);
}

.sc-social-crop-preset__option-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--sc-ink-soft);
}

.sc-social-crop-preset__check {
  width: 16px;
  height: 16px;
  color: var(--sc-brand);
  flex-shrink: 0;
  opacity: 0;
}

.sc-social-crop-preset__option.is-selected .sc-social-crop-preset__check {
  opacity: 1;
}

.sc-social-crop-custom-size {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin: -6px 0 18px;
}

.sc-social-crop-custom-size__field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sc-social-crop-custom-size__field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--sc-ink-soft);
}

.sc-social-crop-custom-size__field input {
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1.5px solid var(--sc-line);
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: var(--sc-ink);
  width: 100%;
}

.sc-social-crop-custom-size__field input:focus-visible {
  outline: none;
  border-color: var(--sc-brand);
  box-shadow: 0 0 0 4px var(--sc-brand-soft);
}

.sc-social-crop-custom-size__x {
  padding-bottom: 12px;
  color: var(--sc-ink-soft);
  font-weight: 700;
}

.sc-social-crop-slider {
  width: 100%;
  height: 40px;
  accent-color: var(--sc-brand);
  touch-action: manipulation;
}

.sc-social-crop-slider:disabled {
  opacity: 0.4;
  pointer-events: none;
}

.sc-social-crop-controls__row--bg {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.sc-social-crop-bgmode {
  display: flex;
  gap: 8px;
  position: relative;
}

.sc-social-crop-bgmode__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1.5px solid var(--sc-line);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-ink-soft);
  cursor: pointer;
}

.sc-social-crop-bgmode__btn.is-active {
  border-color: var(--sc-brand);
  color: var(--sc-brand);
  background: var(--sc-brand-soft);
}

.sc-social-crop-bgmode__swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--sc-line-strong);
  background: var(--sc-brand);
  flex-shrink: 0;
}

.sc-social-crop-bgmode__swatch--checker {
  background:
    linear-gradient(45deg, #ccc 25%, transparent 25%) 0 0/8px 8px,
    linear-gradient(-45deg, #ccc 25%, transparent 25%) 0 0/8px 8px,
    linear-gradient(45deg, transparent 75%, #ccc 75%) 0 0/8px 8px,
    linear-gradient(-45deg, transparent 75%, #ccc 75%) 0 0/8px 8px,
    #fff;
}

.sc-social-crop-colorinput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sc-social-crop-controls__row--rotate {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sc-social-crop-rotate {
  display: flex;
  gap: 8px;
}

.sc-social-crop-rotatebtn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--sc-line);
  background: #fff;
  color: var(--sc-ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.sc-social-crop-rotatebtn svg {
  width: 18px;
  height: 18px;
}

.sc-social-crop-rotatebtn:active {
  transform: scale(0.9) rotate(0deg);
  background: var(--sc-brand-soft);
  border-color: var(--sc-brand);
  color: var(--sc-brand);
}

/* ══════════════════════════════════════════
   4b. BULK — THUMBNAIL STRIP + "SAME ZOOM & ROTATION FOR ALL" TOGGLE
   Each thumbnail is one image in the batch; every image shares the
   chosen platform size & background, but keeps its own pan position
   so you can recentre each photo yourself.
   ══════════════════════════════════════════ */
.sc-social-crop-thumbs {
  margin: 0 0 14px;
  min-width: 0;
}

.sc-social-crop-thumbs__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 30px;
  margin-bottom: 6px;
}

.sc-social-crop-thumbs__count {
  font-size: 13px;
  font-weight: 800;
  color: var(--sc-ink);
}

.sc-social-crop-thumbs__track {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scrollbar-width: none;
}

.sc-social-crop-thumbs__track::-webkit-scrollbar { display: none; }

.sc-social-crop-thumbs__item {
  position: relative;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  background: #eaeaf1;
  padding: 0;
}

.sc-social-crop-thumbs__item.is-selected {
  border-color: var(--sc-brand);
  box-shadow: 0 0 0 2px var(--sc-brand-soft);
}

.sc-social-crop-thumbs__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.sc-social-crop-thumbs__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26,26,34,0.65);
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.sc-social-crop-thumbs__remove svg {
  width: 10px;
  height: 10px;
}

.sc-social-crop-thumbs__add {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1.5px dashed var(--sc-line-strong);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--sc-ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  font-family: inherit;
}

.sc-social-crop-thumbs__add svg {
  width: 15px;
  height: 15px;
}

.sc-social-crop-thumbs__add span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.sc-social-crop-thumbs__add:active {
  background: var(--sc-bg);
}

.sc-social-crop-linktoggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  cursor: pointer;
  touch-action: manipulation;
}

.sc-social-crop-linktoggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.sc-social-crop-linktoggle__text {
  font-size: 12px;
  font-weight: 700;
  color: var(--sc-ink);
  line-height: 1.2;
  white-space: nowrap;
}

.sc-social-crop-linktoggle__switch {
  flex: 0 0 auto;
  width: 36px;
  height: 22px;
  border-radius: 9999px;
  background: var(--sc-line-strong);
  position: relative;
  transition: background 0.18s ease;
}

.sc-social-crop-linktoggle__switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  transition: transform 0.18s ease;
}

.sc-social-crop-linktoggle input:checked + .sc-social-crop-linktoggle__switch { background: var(--sc-brand); }
.sc-social-crop-linktoggle input:checked + .sc-social-crop-linktoggle__switch::after { transform: translateX(14px); }
.sc-social-crop-linktoggle input:focus-visible + .sc-social-crop-linktoggle__switch { box-shadow: 0 0 0 3px var(--sc-brand-soft); }

/* ══════════════════════════════════════════
   5. STAGE (crop frame — dynamic aspect ratio)
   ══════════════════════════════════════════ */
.sc-social-crop-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 58vh;
  margin: 0 auto 20px;
  border-radius: 16px;
  overflow: hidden;
  background:
    linear-gradient(45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 20px 20px,
    linear-gradient(-45deg, #e9e9ef 25%, transparent 25%) -10px 0/ 20px 20px,
    linear-gradient(45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 20px 20px,
    linear-gradient(-45deg, transparent 75%, #e9e9ef 75%) -10px 0/ 20px 20px,
    #fafafd;
  box-shadow: 0 1px 2px rgba(26,26,34,0.04), 0 8px 24px rgba(26,26,34,0.06);
}

.sc-social-crop-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.sc-social-crop-canvas:active {
  cursor: grabbing;
}

/* Locked: let touches pass through to the page for vertical scroll
   instead of being captured for pan/pinch. */
.sc-social-crop-stage.is-locked,
.sc-social-crop-stage.is-locked .sc-social-crop-canvas {
  touch-action: pan-y;
}

.sc-social-crop-stage.is-locked .sc-social-crop-canvas {
  cursor: default;
}

.sc-social-crop-lockbtn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  color: var(--sc-ink-soft);
  box-shadow: 0 2px 8px rgba(26,26,34,0.18);
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}

.sc-social-crop-lockbtn:active {
  transform: scale(0.92);
}

.sc-social-crop-lockbtn__icon {
  width: 18px;
  height: 18px;
}

.sc-social-crop-lockbtn__icon--locked {
  display: none;
}

.sc-social-crop-lockbtn.is-locked {
  background: var(--sc-brand);
  color: #fff;
}

.sc-social-crop-lockbtn.is-locked .sc-social-crop-lockbtn__icon--unlocked {
  display: none;
}

.sc-social-crop-lockbtn.is-locked .sc-social-crop-lockbtn__icon--locked {
  display: block;
}

.sc-social-crop-gesturehint {
  margin: 0 0 18px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sc-ink-soft);
  opacity: 0.85;
}

.sc-social-crop-safezone {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1.5px dashed rgba(255,255,255,0.9);
  box-shadow: 0 0 0 2000px rgba(26,26,34,0.28);
  pointer-events: none;
  z-index: 2;
}

.sc-social-crop-stage__loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.85);
  z-index: 4;
}

.sc-social-crop-stage__loading.is-visible {
  display: flex;
}

.sc-social-crop-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid var(--sc-brand-soft);
  border-top-color: var(--sc-brand);
  animation: sc-spin 0.7s linear infinite;
}

@keyframes sc-spin {
  to { transform: rotate(360deg); }
}

/* ══════════════════════════════════════════
   6. PREVIEW (Step 3)
   ══════════════════════════════════════════ */
.sc-social-crop-preview-wrap {
  width: 100%;
  max-width: 380px;
  max-height: 50vh;
  margin: 0 auto 14px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--sc-line);
  box-shadow: 0 1px 2px rgba(26,26,34,0.04), 0 8px 24px rgba(26,26,34,0.06);
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
}

.sc-social-crop-preview-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.sc-social-crop-export-meta {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--sc-ink-soft);
  margin: 0 0 20px;
}

.sc-social-crop-startover {
  display: block;
  margin: 18px auto 0;
  background: none;
  border: none;
  color: var(--sc-ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ══════════════════════════════════════════
   6b. BATCH RESULTS GRID (Step 3, 2+ images)
   ══════════════════════════════════════════ */
.sc-social-crop-batchgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
  max-width: 460px;
  margin: 0 auto 18px;
}

.sc-social-crop-batchgrid__item {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--sc-line);
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%),
    linear-gradient(-45deg, #eee 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eee 75%),
    linear-gradient(-45deg, transparent 75%, #eee 75%);
  background-size: 14px 14px;
  background-position: 0 0, 0 7px, 7px -7px, -7px 0px;
}

.sc-social-crop-batchgrid__canvas {
  display: block;
  width: 100%;
  aspect-ratio: var(--sc-frame-ratio, 1);
}

/* ══════════════════════════════════════════
   7. ACTION BUTTONS
   ══════════════════════════════════════════ */
.sc-social-crop-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  position: sticky;
  bottom: 0;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, #fff 70%, rgba(255,255,255,0));
  z-index: 10;
}

.sc-social-crop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  height: 50px;
  padding: 0 20px;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.1px;
  border: 1.5px solid transparent;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.sc-social-crop-btn__icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sc-social-crop-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* Primary carries the visual weight — it's the action that moves you
   forward, so it takes the extra width the ghost button gives up. */
.sc-social-crop-btn--primary {
  background: var(--sc-brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(66,181,164,0.32);
}

.sc-social-crop-btn--primary:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(66,181,164,0.28);
}

/* Ghost/Back stays visually subordinate: compact and auto-width
   instead of matching the primary button's width — a full-width
   Back next to a full-width primary reads as "two equal choices"
   when they're not; this keeps the hierarchy clear at a glance. */
.sc-social-crop-btn--ghost {
  flex: 0 0 auto;
  background: #fff;
  border-color: var(--sc-line);
  color: var(--sc-ink-soft);
  box-shadow: 0 1px 2px rgba(26,26,34,0.04);
}

.sc-social-crop-btn--ghost:active {
  background: var(--sc-bg);
  border-color: var(--sc-line-strong);
  transform: scale(0.97);
}

/* ══════════════════════════════════════════
   8. TOAST
   ══════════════════════════════════════════ */
.sc-social-crop-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  background: var(--sc-ink);
  color: #fff;
  padding: 12px 22px;
  border-radius: 9999px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 999;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  max-width: 90vw;
  text-align: center;
}

.sc-social-crop-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.sc-social-crop-toast.is-error {
  background: var(--sc-error);
}

/* ══════════════════════════════════════════
   9. DESKTOP
   ══════════════════════════════════════════ */
@media (min-width: 768px) {
  .sc-social-crop-wrap {
    padding: 40px 24px 72px;
  }

  .sc-social-crop-header__subtitle {
    font-size: 16px;
  }

  .sc-social-crop-stepper {
    gap: 10px;
    margin-bottom: 36px;
  }

  .sc-social-crop-stepper__line {
    width: 56px;
  }

  .sc-social-crop-dropzone {
    max-width: 520px;
    padding: 56px 24px;
  }

  .sc-social-crop-dropzone__button {
    height: 60px;
    padding: 0 36px;
    font-size: 16.5px;
  }

  .sc-social-crop-stage {
    max-width: 460px;
    max-height: 520px;
  }

  .sc-social-crop-preview-wrap {
    max-height: 460px;
  }

  .sc-social-crop-bgmode__btn:hover {
    border-color: var(--sc-brand);
    color: var(--sc-brand);
  }

  .sc-social-crop-rotatebtn:hover {
    border-color: var(--sc-brand);
    color: var(--sc-brand);
  }

  .sc-social-crop-btn--ghost:hover {
    border-color: var(--sc-ink-soft);
    color: var(--sc-ink);
  }

  .sc-social-crop-btn--primary:hover {
    box-shadow: 0 6px 20px rgba(66,181,164,0.4);
    transform: translateY(-1px);
  }

  .sc-social-crop-actions {
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }

  .sc-social-crop-thumbs__item,
  .sc-social-crop-thumbs__add {
    width: 64px;
    height: 64px;
  }

  .sc-social-crop-batchgrid {
    max-width: 520px;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  }
}

/* ══════════════════════════════════════════
   9b. MORE TOOLS (internal links inside an H2)
   ══════════════════════════════════════════ */
.sc-social-crop-more {
  max-width: 460px;
  margin: 44px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--sc-line);
  text-align: center;
}

.sc-social-crop-more__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  color: var(--sc-ink-soft);
}

.sc-social-crop-more__title a {
  color: var(--sc-brand-dark);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(46,133,119,0.35);
  text-underline-offset: 3px;
  white-space: nowrap;
}

.sc-social-crop-more__title a:hover {
  text-decoration-color: var(--sc-brand-dark);
}

.sc-social-crop-more__title a:focus-visible {
  outline: 2px solid var(--sc-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ══════════════════════════════════════════
   10. ACCESSIBILITY
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  .sc-social-crop-panel.is-active,
  .sc-social-crop-spinner {
    animation: none;
  }

  .sc-social-crop-dropzone__button {
    transition: box-shadow 0.18s ease, border-color 0.18s ease;
  }

  .sc-social-crop-dropzone:hover .sc-social-crop-dropzone__button,
  .sc-social-crop-dropzone__button:active,
  .sc-social-crop-dropzone.is-dragover .sc-social-crop-dropzone__button {
    transform: none;
  }
}
