.image-source-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(247, 242, 233, .58);
}

.image-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.image-section-title small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.image-source-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.image-source-divider {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.image-source-divider::before,
.image-source-divider::after {
  content: "";
  width: 1px;
  height: 100%;
  min-height: 20px;
  background: var(--border);
}

.image-source-divider span {
  padding: 5px 0;
}

.image-inline-button {
  width: 100%;
  margin-top: 7px;
}

#giftImageThreshold {
  width: 100%;
  accent-color: var(--primary);
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.image-preview-panel {
  min-width: 0;
  margin: 0;
}

.image-preview-panel figcaption {
  margin-bottom: 7px;
  color: var(--dark);
  font-size: .8rem;
  font-weight: 900;
}

.image-preview-surface {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.image-preview-surface img {
  display: none;
  width: 100%;
  height: 210px;
  object-fit: contain;
  border-radius: 10px;
}

.image-preview-surface.has-image img {
  display: block;
}

.image-preview-surface.has-image .image-preview-empty {
  display: none;
}

.original-surface,
.processed-surface.image-mode-original {
  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%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.processed-surface.image-mode-fit {
  background: #fffdf9;
  box-shadow: inset 0 0 0 7px rgba(216, 193, 163, .2);
}

.processed-surface.image-mode-fit img {
  padding: 8px;
  background: #fffdf9;
}

.processed-surface.image-mode-remove-white {
  background:
    linear-gradient(135deg, rgba(216, 193, 163, .48), rgba(247, 242, 233, .9));
}

.processed-surface.image-mode-remove-white img {
  filter: drop-shadow(0 8px 10px rgba(52, 33, 22, .15));
}

.image-preview-empty {
  color: var(--muted);
  font-size: .82rem;
}

.image-editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.image-editor-actions small {
  color: var(--muted);
  text-align: right;
}

.notice.info {
  color: var(--dark);
  border-color: rgba(98, 51, 6, .18);
  background: rgba(216, 193, 163, .22);
}

@media (max-width: 720px) {
  .image-source-grid,
  .image-preview-grid {
    grid-template-columns: 1fr;
  }

  .image-source-divider {
    grid-template-columns: 1fr auto 1fr;
    gap: 8px;
  }

  .image-source-divider::before,
  .image-source-divider::after {
    width: 100%;
    height: 1px;
    min-height: 0;
  }

  .image-preview-surface {
    min-height: 190px;
  }

  .image-preview-surface img {
    height: 160px;
  }

  .image-editor-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .image-editor-actions .btn {
    width: 100%;
  }

  .image-editor-actions small {
    text-align: left;
  }
}

.admin-gift-thumb{width:58px;height:48px;object-fit:contain;padding:3px;border:1px solid var(--border);border-radius:8px;background:#fffdf9;}
.image-control-disabled{opacity:.55;}

/* TAMANHO DA IMAGEM NO CARD — 2.6.8 */

#giftImageScale {
  width: 100%;
  accent-color: var(--primary);
}

.image-scale-legend {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 3px;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
}

.processed-surface img {
  transform:
    scale(var(--gift-preview-scale, .85));
  transform-origin: center center;
  transition: transform .12s ease;
  will-change: transform;
}

/*
 * A imagem original permanece sem escala.
 * Somente o quadro "Resultado no card" recebe o tamanho escolhido.
 */
.original-surface img {
  transform: none !important;
}
