/* Only creative-scene owns this layout; other model controls stay unchanged. */
body[data-shopao-ai-operation="creative_scene"] .creative-input-footer:has(.shopao-creative-output-controls) {
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 12px;
  max-height: none;
  overflow: visible;
  flex-shrink: 0;
}

body[data-shopao-ai-operation="creative_scene"] .creative-input-footer-left {
  order: 0;
  flex: 1 1 200px;
  min-width: 0;
  flex-wrap: wrap;
}

body[data-shopao-ai-operation="creative_scene"] .creative-input-footer-left-try,
body[data-shopao-ai-operation="creative_scene"] .creative-input-footer-left-try-words {
  min-width: 0;
  flex-wrap: wrap;
}

body[data-shopao-ai-operation="creative_scene"] .creative-input-footer-right {
  order: 2;
  margin-left: auto;
  flex-shrink: 0;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls {
  order: 1;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls .shopao-image-model-choice {
  width: 154px;
  padding: 0;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls .shopao-image-model-label {
  display: none;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls [data-image-model-trigger],
body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls select {
  height: 36px;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid #e4e4e7;
  border-radius: 6px;
  background: #fff;
  color: #27272a;
  font: inherit;
  font-size: 12px;
  box-sizing: border-box;
  cursor: pointer;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls [data-image-model-trigger] {
  gap: 6px;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls [data-image-model-title] {
  font-size: 12px;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls select:focus-visible {
  outline: 2px solid #be4560;
  outline-offset: 2px;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls select[data-creative-output="resolution"] {
  width: 66px;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-output-controls select[data-creative-output="ratio"] {
  width: 112px;
}

body[data-shopao-ai-operation="creative_scene"] .creative-uploader.shopao-creative-reference-host {
  position: relative;
  isolation: isolate;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-reference-preview {
  position: absolute;
  inset: 0;
  border-radius: 4px;
  overflow: hidden;
  background: #f5f6f8;
  z-index: 1000 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-reference-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* The native menu is not a second reference slot. Only this route's preview
   represents its committed reference; a transient shared thumbnail must not
   remain under the upload popover. */
body[data-shopao-ai-operation="creative_scene"] .creative-uploader:has(.shopao-creative-reference-preview) .shopao-upload-preview {
  display: none !important;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-reference-clear {
  top: 4px !important;
  right: 4px !important;
  z-index: 3 !important;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-creative-reference-preview span {
  top: auto;
  bottom: 2px;
  left: 2px;
  right: 2px;
  padding: 1px 0;
  text-align: center;
  font-size: 10px;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-generation-card:has(> img),
body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-generation-reference {
  aspect-ratio: auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-generation-card > img,
body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-generation-reference > img {
  height: auto;
  object-fit: contain;
}

@media (max-width: 760px) {
  body[data-shopao-ai-operation="creative_scene"].shopao-generation-board-active .shopao-generation-board {
    left: 160px !important;
    padding: 16px 8px !important;
  }

  body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-result-panel-shell {
    padding: 8px;
  }

  body[data-shopao-ai-operation="creative_scene"] .shopao-generation-board .shopao-generation-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
