.ai-customizer {
  box-sizing: border-box;
  max-width: 100%;
  margin: 24px 0;
  color: #111111;
  font-family: "Helvetica Neue", Arial, sans-serif;
  --ai-control-border: #d8d8d8;
  --ai-accent: var(--ai-theme-color);
  --ai-card-width: 144px;
  --ai-image-card-width: 158px;
}

.ai-customizer *,
.ai-customizer *::before,
.ai-customizer *::after {
  box-sizing: border-box;
}

.ai-customizer__card {
  padding: clamp(22px, 2.2vw, 30px);
  border: 1px solid var(--ai-card-border-color);
  border-radius: 10px;
  background: var(--ai-theme-surface);
}

.ai-customizer__heading {
  margin-bottom: clamp(22px, 2vw, 28px);
  padding-bottom: clamp(18px, 1.8vw, 23px);
  border-bottom: 1px solid #ebebeb;
  text-align: center;
}

.ai-customizer__heading h2 {
  margin: 0;
  font-size: clamp(26px, 2.4vw, 34px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.ai-customizer__heading p {
  margin: 9px 0 0;
  color: #646464;
  font-size: 15px;
}

.ai-customizer__form {
  display: grid;
  gap: clamp(18px, 1.6vw, 22px);
}

.ai-customizer__field {
  display: grid;
  gap: 8px;
}

.ai-customizer__field>label,
.ai-customizer__field-label,
.ai-customizer__field--upload>label:first-child {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.ai-customizer__required {
  margin-right: 2px;
  color: #e61b23;
}

.ai-customizer__field small {
  color: #818181;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.ai-customizer__upload {
  position: relative;
  display: grid;
  place-items: center;
  width: 152px;
  min-height: 152px;
  padding: 15px;
  overflow: hidden;
  border: 2px dashed #d2d2d2;
  border-radius: 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color .18s ease, background .18s ease;
}

.ai-customizer__uploads {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ai-customizer__add-upload {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  flex: 0 0 64px;
  border: 2px dashed #d2d2d2;
  border-radius: 12px;
  color: #565656;
  background: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 31px;
  font-weight: 300;
  line-height: 1;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.ai-customizer__add-upload:hover,
.ai-customizer__add-upload:focus-visible {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.5) !important;
  color: rgba(var(--color-text, 22, 22, 22), 0.92) !important;
  background: var(--ai-theme-surface, #fff) !important;
  outline: none;
}

.ai-customizer__add-upload:disabled {
  cursor: default;
  opacity: .45;
  transform: none;
}

.ai-customizer__upload:hover,
.ai-customizer__upload:focus-within {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.5);
  background: var(--ai-theme-surface);
}

.ai-customizer__upload.has-file {
  border-style: solid;
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  background: var(--ai-theme-surface);
}

.ai-customizer__upload input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-customizer__upload-trigger {
  position: relative;
  z-index: 1;
  display: grid;
  width: 100%;
  min-height: 118px;
  place-items: center;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  transition: background .18s ease, opacity .18s ease;
}

.ai-customizer__upload-trigger:focus-visible {
  outline: 2px solid rgba(var(--color-text, 22, 22, 22), 0.95);
  outline-offset: 4px;
}

.ai-customizer__upload-copy {
  display: grid;
  gap: 5px;
  pointer-events: none;
}

.ai-customizer__upload-preview {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-customizer__upload.has-file .ai-customizer__upload-trigger {
  color: #fff;
  opacity: 0;
  background: rgba(0, 0, 0, .5);
}

.ai-customizer__upload.has-file:hover .ai-customizer__upload-trigger,
.ai-customizer__upload.has-file:focus-within .ai-customizer__upload-trigger {
  opacity: 1;
}

.ai-customizer__upload.has-file .ai-customizer__upload-copy strong {
  color: #fff;
  font-size: 0;
}

.ai-customizer__upload.has-file .ai-customizer__upload-copy strong::after {
  content: "Change photo";
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.ai-customizer__upload.has-file .ai-customizer__upload-copy small,
.ai-customizer__upload.has-file .ai-customizer__file-name {
  display: none;
}

.ai-customizer__upload-copy strong {
  color: #202020;
  font-size: 15px;
  font-weight: 650;
}

.ai-customizer__upload-copy small {
  color: #8b8b8b;
  font-size: 11px;
}

.ai-customizer__file-name {
  max-width: 100%;
  overflow: hidden;
  color: var(--ai-theme-color, currentColor);
  font-size: 11px;
  font-weight: 700;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.ai-customizer__field textarea,
.ai-customizer__field select,
.ai-customizer__field>input:not([type="checkbox"]) {
  width: 100%;
  min-height: 48px;
  padding: 13px 15px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  outline: none;
  color: #191919;
  background: #ffffff;
  font: inherit;
  font-size: 15px;
  line-height: 1.5;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ai-customizer__field textarea {
  resize: vertical;
}

.ai-customizer__field select {
  min-height: 48px;
  resize: none;
}

.ai-customizer__field textarea:focus,
.ai-customizer__field select:focus,
.ai-customizer__field>input:not([type="checkbox"]):focus {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  box-shadow: 0 0 0 3px var(--ai-theme-ring);
}
.ai-customizer__field select.ai-customizer__select-native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  border: 0;
}
.ai-customizer__select {
  position: relative;
}
.ai-customizer__select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border: 1px solid #cfcfcf;
  border-radius: 8px;
  background: #fff;
  color: #191919;
  font: inherit;
  font-size: 15px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.ai-customizer__select-trigger:hover {
  border-color: #b6b6b6;
}
.ai-customizer__select.is-open .ai-customizer__select-trigger,
.ai-customizer__select-trigger:focus-visible {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  box-shadow: 0 0 0 3px var(--ai-theme-ring);
  outline: none;
}
.ai-customizer__select-trigger-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.ai-customizer__select-thumb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
}
.ai-customizer__select-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ai-customizer__select-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-customizer__select-chevron {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  color: #6b6b6b;
  transition: transform .2s ease;
}
.ai-customizer__select.is-open .ai-customizer__select-chevron {
  transform: rotate(180deg);
}
.ai-customizer__select-panel {
  /* 【v3】面板参与文档流占位：展开时下方内容整体下移，折叠时 display:none 零高度不抖动 */
  display: none;
  margin: 8px 0 0;
  padding: 10px;
  list-style: none;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  transform-origin: top center;
  animation: ai-select-pop .16s ease;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.ai-customizer__select.is-open .ai-customizer__select-panel {
  display: grid;
}
@media (max-width: 560px) {
  .ai-customizer__select-panel {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
  }
}
@media (max-width: 400px) {
  .ai-customizer__select-panel {
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    padding: 6px;
  }
}
@keyframes ai-select-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-customizer__select-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 4px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, background-color .12s ease;
}
.ai-customizer__select-option:hover,
.ai-customizer__select-option.is-active {
  border-color: #b6b6b6;
  background: #fafafa;
}
.ai-customizer__select-option.is-selected {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  box-shadow: 0 0 0 1.5px rgba(var(--color-text, 22, 22, 22), 0.95);
}
.ai-customizer__select-option::after {
  content: "";
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 15px;
  height: 15px;
  border-radius: 4px 0 0 0;
  background-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-8' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 10px 10px;
  opacity: 0;
  transform: scale(.6);
  transform-origin: center;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
  z-index: 3;
}
.ai-customizer__select-option.is-selected::after {
  opacity: 1;
  transform: scale(1);
}
.ai-customizer__select-option-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.ai-customizer__select-option-thumb.ai-customizer__select-option-thumb--empty {
  background: #f0f0f0;
  border-radius: 6px;
}
.ai-customizer__select-option-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.ai-customizer__select-option-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.ai-customizer__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  color: #343434;
  cursor: pointer;
}

.ai-customizer__checkbox input {
  width: 17px;
  height: 17px;
  margin: 3px 0 0;
  accent-color: rgba(var(--color-text, 22, 22, 22), 0.9);
}

.ai-customizer__checkbox span {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.45;
}

.ai-customizer__checkbox small {
  grid-column: 2;
  margin-top: -5px;
}

.ai-customizer__form .ai-customizer__consent {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  color: #5f5f5f;
  font-size: 13px;
  line-height: 1.45;
}

.ai-customizer__consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: rgba(var(--color-text, 22, 22, 22), 0.9);
}

/* Only what the mirrored `--ai-button-*` block below does NOT set lives here.
   Border, colour, radius, shadow, metrics and font are owned by that block — it
   needs `!important` to outrank the host theme's own `button` rules, so the
   identical declarations that used to sit here were never applied. */
.ai-customizer__form>button {
  cursor: pointer;
  transition: transform .18s ease, background .18s ease;
}

.ai-customizer__form>button:hover {
  background: var(--ai-theme-hover) !important;
  transform: translateY(-1px);
}

.ai-customizer__form>button:disabled {
  cursor: wait;
  opacity: .65;
  transform: none;
}

.ai-customizer__status {
  position: fixed;
  z-index: 2147483002;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: min(92vw, 560px);
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 14px 16px;
  border: 1px solid #f0d9a8;
  border-left: 4px solid #e0962a;
  border-radius: 8px;
  background: #fffaf0;
  color: #6b4e16;
  font-size: 14px;
  line-height: 1.55;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity .24s ease, transform .24s ease, visibility .24s ease;
}

.ai-customizer__status.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* 【要点】空状态必须隐藏：否则未生成预览 / 无提示时，页面上会常驻一个空的告警框。 */
.ai-customizer__status:empty {
  display: none;
}

.ai-customizer__status::before {
  content: "!";
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background: #e0962a;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* 语义状态变体由普通与级联定制器共同使用；默认状态仍保持原有告警样式。 */
.ai-customizer__status--info {
  border-color: #cfe0ff;
  border-left-color: #2f6fed;
  background: #f4f7ff;
  color: #234b93;
}

.ai-customizer__status--warning {
  border-color: #f0d9a8;
  border-left-color: #e0962a;
  background: #fffaf0;
  color: #6b4e16;
}

.ai-customizer__status--error {
  border-color: #f1c4c8;
  border-left-color: #d9232e;
  background: #fff4f5;
  color: #8f1720;
}

.ai-customizer__status--success {
  border-color: #bde3cb;
  border-left-color: #1f9d55;
  background: #f1fbf4;
  color: #176b3a;
}

.ai-customizer__status--info::before {
  content: "i";
  background: #2f6fed;
}

.ai-customizer__status--warning::before {
  content: "!";
  background: #e0962a;
}

.ai-customizer__status--error::before {
  content: "×";
  background: #d9232e;
}

.ai-customizer__status--success::before {
  content: "✓";
  background: #1f9d55;
}

.ai-customizer__results {
  margin-top: 30px;
  padding-top: 23px;
  border-top: 1px solid #ebebeb;
}

.ai-customizer__results-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 15px;
}

.ai-customizer__results h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.02em;
}

.ai-customizer__results-heading p {
  margin: 4px 0 0;
  color: #757575;
  font-size: 12px;
  line-height: 1.4;
}

.ai-customizer__result-count {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--ai-theme-color, currentColor);
  background: var(--ai-theme-surface, transparent);
  font-size: 11px;
  font-weight: 700;
}

.ai-customizer__result-track {
  position: relative;
}

/* A generated-design rail scrolls horizontally instead of wrapping into
   multiple rows; the first screenful shows four cards on wide viewports. */
.ai-customizer__result-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 14px;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.ai-customizer__result-grid::-webkit-scrollbar {
  display: none;
}

.ai-customizer__result-grid>.ai-customizer__result-card {
  flex: 0 0 calc((100% - 3 * 14px) / 4);
  scroll-snap-align: start;
}

/* Short-lived guidance used after the validation dialog sends the buyer back
 * to the next required action. It is intentionally shared by the Preview
 * button and the generated-design rail. */
.ai-customizer__attention-flash {
  animation: aiCustomizerAttentionFlash 2.1s ease-in-out 1;
}

@keyframes aiCustomizerAttentionFlash {
  0%,
  100% {
    outline: 0 solid transparent;
    outline-offset: 0;
    box-shadow: none;
  }

  18%,
  58% {
    outline: 3px solid #e0962a;
    outline-offset: 5px;
    box-shadow: 0 0 0 7px rgba(224, 150, 42, .2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-customizer__attention-flash {
    animation: none;
    outline: 3px solid #e0962a;
    outline-offset: 5px;
    box-shadow: 0 0 0 7px rgba(224, 150, 42, .2);
  }
}

.ai-customizer__results-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: #161616;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  cursor: pointer;
  opacity: 1;
  transform: translateY(-50%);
  transition: opacity .18s ease, border-color .18s ease, color .18s ease,
    box-shadow .18s ease;
}

.ai-customizer__results-nav svg {
  width: 18px;
  height: 18px;
}

.ai-customizer__results-nav:hover,
.ai-customizer__results-nav:focus-visible {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  color: rgba(var(--color-text, 22, 22, 22), 0.92);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
  outline: none;
}

.ai-customizer__results-nav.is-disabled {
  opacity: 0;
  pointer-events: none;
}

.ai-customizer__results-nav--prev {
  left: -13px;
}

.ai-customizer__results-nav--next {
  right: -13px;
}

.ai-customizer__result-card {
  position: relative;
  overflow: hidden;
  border: 2px solid #dfdfdf;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .04);
}

.ai-customizer__result-card.is-selected {
  border-color: var(--aic-checked, var(--ai-theme-color, #161616)) !important;
}


.ai-customizer__result-card[data-ai-cart-state="loading"] {
  opacity: .62;
  pointer-events: none;
}


.ai-customizer__result-image {
  display: block;
  overflow: hidden;
  background: #f3f3f3;
}

.ai-customizer__result-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: #f3f3f3;
  transition: transform .2s ease;
}

.ai-customizer__result-image:hover img {
  transform: scale(1.03);
}

.ai-customizer__result-card strong {
  display: block;
  margin: 3px 9px 0;
  color: #181818;
  font-size: 14px;
  text-align: center;
}

.ai-customizer__result-image {
  display: block !important;
  width: 100% !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  color: inherit;
  background: transparent !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  font: inherit;
  line-height: 0;
  appearance: none;
  text-align: inherit;
}

.ai-customizer__result-image img {
  pointer-events: none;
}

.ai-customizer__result-remove {
  position: absolute;
  z-index: 1;
  top: 8px;
  right: 8px;
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: #d9232e;
  box-shadow: 0 2px 8px rgba(91, 0, 0, .2);
  cursor: pointer;
  font: 400 25px/1 Arial, sans-serif;
}

.ai-customizer__result-remove:hover,
.ai-customizer__result-remove:focus-visible {
  background: #b8101a;
  outline: 2px solid #fff;
  outline-offset: 1px;
}

.ai-customizer__field-disclosure {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.ai-customizer__field-disclosure>summary {
  position: relative;
  z-index: 1;
  display: flex !important;
  flex-direction: row !important;
  direction: ltr !important;
  min-height: 28px;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  width: 100%;
  margin: 0 !important;
  padding: 0 !important;
  color: inherit;
  cursor: pointer !important;
  pointer-events: auto !important;
  user-select: none;
  font-size: 16px;
  font-weight: 750;
  line-height: 1.35;
  list-style: none;
  text-align: left !important;
}

.ai-customizer__field-disclosure>summary::-webkit-details-marker {
  display: none;
}

.ai-customizer__field-disclosure>summary::marker {
  display: none;
  content: "";
}

.ai-customizer__disclosure-icon {
  position: static !important;
  display: inline-grid !important;
  width: 22px !important;
  height: 22px !important;
  flex: 0 0 22px !important;
  order: 1 !important;
  place-items: center;
  margin: 0 0 0 8px !important;
  padding: 0 !important;
  border: 1px solid #c9cdd3;
  border-radius: 6px;
  color: #4a4a4a;
  background: #fff;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s ease, background .18s ease, border-color .18s ease;
}

.ai-customizer__disclosure-icon i {
  display: block;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.ai-customizer__field-disclosure:not([open]) .ai-customizer__disclosure-icon {
  transform: rotate(-90deg);
}

.ai-customizer__field-disclosure>summary:hover .ai-customizer__disclosure-icon,
.ai-customizer__field-disclosure>summary:focus-visible .ai-customizer__disclosure-icon {
  border-color: currentColor;
  background: #f4f4f4;
}

.ai-customizer__disclosure-label {
  position: static !important;
  display: inline-flex !important;
  width: auto !important;
  min-width: 0;
  max-width: calc(100% - 30px);
  align-items: center;
  flex: 0 1 auto !important;
  order: 0 !important;
  gap: 3px;
  justify-content: flex-start !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
}

.ai-customizer__disclosure-label .ai-customizer__required {
  flex: 0 0 auto;
}

.ai-customizer__disclosure-text {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left !important;
}

.ai-customizer__field-disclosure-body {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.ai-customizer__field-disclosure-body>.ai-customizer__field {
  margin: 0;
}

.ai-customizer__canvas {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid var(--ai-control-border, #d8dbe2);
  border-radius: 10px;
  background: var(--ai-theme-surface, #fff);
}

.ai-customizer__canvas-stage {
  position: relative;
  width: 100%;
  max-width: 680px;
  aspect-ratio: var(--ai-canvas-width) / var(--ai-canvas-height);
  margin: 0 auto;
  overflow: hidden;
  border: 1px dashed var(--ai-card-border-color, #161616);
  border-radius: 8px;
  background-color: #f7f8fa;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.ai-customizer__canvas-empty {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  color: #747985;
  font-size: 13px;
  pointer-events: none;
}

.ai-customizer__canvas-empty[hidden] {
  display: none;
}

.ai-customizer__canvas-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 8%;
  color: #8a909b;
  pointer-events: none;
}

.ai-customizer__canvas-layer:not(.has-preview) {
  opacity: .45;
}

.ai-customizer__canvas-layer>span {
  padding: 4px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  font-size: 11px;
}

.ai-customizer__canvas-layer.has-preview>span {
  display: none;
}

.ai-customizer__canvas-layer img[data-ai-canvas-preview] {
  display: block;
  width: min(78%, 420px);
  height: auto;
  max-height: 88%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(16, 24, 40, .16));
}

.ai-customizer__canvas-layer img[data-ai-canvas-preview]+img[data-ai-canvas-preview] {
  margin-top: -28%;
  margin-left: 12%;
  transform: scale(.82);
}

.ai-customizer__viewer[hidden] {
  display: none !important;
}

.ai-customizer__viewer:not([hidden]) {
  display: grid !important;
}

.ai-customizer__viewer {
  position: fixed !important;
  z-index: 2147483000 !important;
  inset: 0 !important;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(16px, 4vw, 48px);
  pointer-events: auto;
}

.ai-customizer__viewer,
.ai-customizer__viewer * {
  box-sizing: border-box !important;
}

.ai-customizer__viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 12, .78);
  cursor: zoom-out;
}

.ai-customizer__viewer-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(96vw, 1440px);
  height: min(92vh, 1000px);
  min-height: 480px;
  max-height: 92vh;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: clamp(18px, 2.4vw, 34px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 14px;
  background: #111;
  box-shadow: 0 22px 80px rgba(0, 0, 0, .45);
}

.ai-customizer__viewer-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  display: grid;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  border-radius: 999px;
  color: #fff !important;
  background: rgba(0, 0, 0, .45) !important;
  cursor: pointer;
  font: 400 25px/1 Arial, sans-serif;
}

.ai-customizer__viewer-nav {
  display: grid !important;
  width: 48px !important;
  height: 60px !important;
  min-width: 48px !important;
  min-height: 60px !important;
  place-items: center;
  padding: 0 !important;
  border: 1px solid rgba(255, 255, 255, .3) !important;
  border-radius: 10px;
  color: #fff !important;
  background: rgba(255, 255, 255, .12) !important;
  cursor: pointer;
  font: 400 38px/1 Arial, sans-serif;
  touch-action: manipulation;
}

.ai-customizer__viewer-nav[hidden] {
  display: none !important;
}

.ai-customizer__viewer-nav:disabled {
  cursor: default;
  opacity: .35;
}

.ai-customizer__viewer-nav:hover,
.ai-customizer__viewer-close:hover {
  background: rgba(255, 255, 255, .24);
}

.ai-customizer__viewer-figure {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  margin: 0;
  place-items: center;
  overflow: hidden;
}

/* The image box fills the available canvas, while contain preserves the
   source aspect ratio and prevents a theme rule from cropping its edges. */
.ai-customizer__viewer-media {
  position: relative;
  display: grid;
  grid-column: 1;
  grid-row: 1;
  width: 100% !important;
  height: 100% !important;
  min-width: 0;
  min-height: 0;
  place-items: center;
  overflow: visible !important;
  background-color: transparent;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  cursor: zoom-in;
}

.ai-customizer__viewer-image {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  max-width: 1px !important;
  max-height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  object-fit: contain !important;
}

.ai-customizer__viewer-media.is-changing-next {
  animation: ai-viewer-change-next .24s ease both;
}

.ai-customizer__viewer-media.is-changing-prev {
  animation: ai-viewer-change-prev .24s ease both;
}

.ai-customizer__viewer.is-zoomed .ai-customizer__viewer-panel {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  border: 0;
  border-radius: 0;
}

.ai-customizer__viewer.is-zoomed .ai-customizer__viewer-media {
  cursor: zoom-out;
}

.ai-customizer__viewer-caption {
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  text-align: center;
}

.ai-customizer__viewer-thumbs {
  display: flex;
  grid-column: 1 / -1;
  grid-row: 3;
  max-width: 100%;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0;
}

.ai-customizer__viewer-thumb {
  width: 58px !important;
  height: 58px !important;
  min-width: 58px !important;
  min-height: 58px !important;
  flex: 0 0 58px;
  padding: 2px !important;
  border: 1px solid rgba(255, 255, 255, .25) !important;
  border-radius: 5px;
  background: transparent !important;
  cursor: pointer;
  opacity: .7;
}

.ai-customizer__viewer-thumb.is-active {
  border-color: #fff;
  opacity: 1;
}

.ai-customizer__viewer-thumb img {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  object-fit: cover !important;
  border-radius: 3px;
}

.ai-customizer-viewer-open {
  overflow: hidden;
}

html.ai-customizer-viewer-open,
body.ai-customizer-viewer-open {
  overflow: hidden !important;
}

@keyframes ai-viewer-change-next {
  from {
    opacity: .35;
    transform: translateX(18px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes ai-viewer-change-prev {
  from {
    opacity: .35;
    transform: translateX(-18px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {

  .ai-customizer__viewer-media.is-changing-next,
  .ai-customizer__viewer-media.is-changing-prev {
    animation: none;
  }
}

.ai-customizer__choice {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ai-customizer__choice legend {
  padding: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -.015em;
}

.ai-customizer__choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, var(--ai-card-width)));
  justify-content: start;
  gap: 10px;
}

.ai-customizer__choice-card {
  position: relative;
  display: grid !important;
  min-height: 76px;
  align-content: start;
  gap: 7px;
  padding: 9px;
  border: 1px solid var(--ai-control-border);
  border-radius: 9px;
  background: #fff;
  cursor: pointer;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.ai-customizer__choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ai-customizer__choice-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.ai-customizer__choice-card:has(input:checked) {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  color: var(--ai-theme-surface-contrast);
  background: var(--ai-theme-surface);
}
/* 选中态右下角图片角标：对齐 CALLIE c-select-item-style3 / c-select-active 的 el-pointer 效果。
   复用自定义器自身选中色（--color-text）作圆底，保证视觉一致；::after 不与 radio 变体的 ::before 冲突。 */
.ai-customizer__choice-card::after {
  content: "";
  position: absolute;
  right: 0px;
  bottom: 0px;
  width: 22px;
  height: 22px;
  border-radius: 6px  0 0 1px;
  background-color: rgba(var(--color-text, 22, 22, 22), 0.95);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-8' fill='none' stroke='%23ffffff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transform: scale(0.5);
  transform-origin: center;
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
  z-index: 3;
}

.ai-customizer__choice-card:has(input:checked)::after,
.ai-customizer__choice-card.is-selected::after {
  opacity: 1;
  transform: scale(1);
}

/* pills 变体卡片较矮，角标略缩小并贴角，避免压住居中文字。 */
.ai-customizer__choice--pills .ai-customizer__choice-card::after {
  width: 16px;
  height: 16px;
  right: 5px;
  bottom: 5px;
  background-size: 10px 10px;
}


.ai-customizer__choice-card:has(input:focus-visible) {
  outline: 2px solid rgba(var(--color-text, 22, 22, 22), 0.95);
  outline-offset: 2px;
}

.ai-customizer__choice--pills .ai-customizer__choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-customizer__choice--pills .ai-customizer__choice-card {
  display: inline-flex !important;
  min-height: 40px;
  width: auto;
  min-width: 72px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 8px;
}

.ai-customizer__choice--size-grid .ai-customizer__choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(76px, 108px));
  max-width: 620px;
}

.ai-customizer__choice--size-grid .ai-customizer__choice-card {
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border-radius: 8px;
}

.ai-customizer__choice--swatch .ai-customizer__choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-customizer__choice--swatch .ai-customizer__choice-card {
  display: inline-flex !important;
  min-height: 42px;
  width: auto;
  min-width: 74px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 8px;
}

.ai-customizer__choice-swatch {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 999px;
  background: var(--choice-color);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.ai-customizer__choice--image-swatch .ai-customizer__choice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ai-customizer__choice--image-swatch .ai-customizer__choice-card {
  display: inline-grid !important;
  min-height: 0;
  width: 78px;
  gap: 5px;
  padding: 5px;
  border-radius: 8px;
  font-size: 11px;
}

.ai-customizer__choice--image-swatch .ai-customizer__choice-card img {
  aspect-ratio: 1;
}

.ai-customizer__choice--image-cards .ai-customizer__choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(122px, var(--ai-image-card-width)));
  gap: 12px;
}

.ai-customizer__choice--image-cards .ai-customizer__choice-card {
  min-height: 0;
  padding: 8px;
}

.ai-customizer__choice--image-cards .ai-customizer__choice-card>span {
  min-height: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-customizer__choice--radio .ai-customizer__choice-grid {
  grid-template-columns: 1fr;
  gap: 8px;
}

.ai-customizer__choice--radio .ai-customizer__choice-card {
  display: flex !important;
  min-height: 44px;
  align-items: center;
  justify-content: flex-start;
  padding: 11px 13px;
  text-align: left;
}

.ai-customizer__choice--radio .ai-customizer__choice-card::before {
  width: 14px;
  height: 14px;
  border: 1px solid #8e8e8e;
  border-radius: 50%;
  content: "";
}

.ai-customizer__choice--radio .ai-customizer__choice-card:has(input:checked)::before {
  border: 4px solid rgba(var(--color-text, 22, 22, 22), 0.95);
}

@media (min-width: 641px) and (max-width: 1024px) {
  .ai-customizer {
    --ai-card-width: 132px;
    --ai-image-card-width: 146px;
  }

  .ai-customizer__card {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .ai-customizer {
    --ai-card-width: 100%;
    --ai-image-card-width: 100%;
    margin: 18px 0;
  }

  .ai-customizer__card {
    padding: 20px 14px;
    border-radius: 8px;
  }

  .ai-customizer__heading {
    margin-bottom: 20px;
    padding-bottom: 17px;
  }

  .ai-customizer__heading h2 {
    font-size: 27px;
  }

  .ai-customizer__heading p {
    font-size: 14px;
  }

  .ai-customizer__field>label,
  .ai-customizer__field-label,
  .ai-customizer__field--upload>label:first-child {
    font-size: 16px;
  }

  .ai-customizer__upload {
    width: 128px;
    min-height: 128px;
    padding: 12px;
    border-radius: 12px;
  }

  .ai-customizer__upload-trigger {
    min-height: 98px;
  }

  .ai-customizer__upload-copy strong {
    font-size: 14px;
  }

  .ai-customizer__add-upload {
    width: 56px;
    height: 56px;
    flex-basis: 56px;
    font-size: 28px;
  }

  .ai-customizer__form>button {
    min-height: 52px;
    font-size: 18px;
  }

  .ai-customizer__choice legend {
    font-size: 16px;
  }

  .ai-customizer__choice-grid,
  .ai-customizer__choice--image-cards .ai-customizer__choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .ai-customizer__choice-card {
    min-height: 68px;
    padding: 8px;
    font-size: 12px;
  }

  .ai-customizer__choice--image-cards .ai-customizer__choice-card {
    padding: 7px;
  }

  .ai-customizer__choice-card img {
    aspect-ratio: 1 / 1;
  }

  .ai-customizer__choice--pills .ai-customizer__choice-grid,
  .ai-customizer__choice--swatch .ai-customizer__choice-grid,
  .ai-customizer__choice--image-swatch .ai-customizer__choice-grid {
    display: flex;
    flex-wrap: wrap;
  }

  .ai-customizer__choice--size-grid .ai-customizer__choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: none;
  }

  .ai-customizer__result-grid {
    gap: 10px;
  }

  .ai-customizer__result-grid>.ai-customizer__result-card {
    flex: 0 0 calc((100% - 10px) / 2);
  }

  .ai-customizer__results {
    margin-top: 24px;
    padding-top: 19px;
  }

  .ai-customizer__viewer {
    padding: 10px;
  }

  .ai-customizer__viewer-panel {
    width: 100%;
    height: calc(100dvh - 20px);
    min-height: 0;
    max-height: none;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    gap: 6px;
    padding: 14px 8px 12px;
    border-radius: 10px;
  }

  .ai-customizer__viewer-nav {
    width: 32px !important;
    height: 44px !important;
    min-width: 32px !important;
    min-height: 44px !important;
    font-size: 27px;
  }
}

/* Visual choice density. Medium is the commerce-safe default: short lists
   stay compact instead of becoming full-width posters in a product column. */
.ai-customizer__choice--image-cards .ai-customizer__choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(104px, 136px));
  gap: 10px;
}

.ai-customizer__choice--image-cards .ai-customizer__choice-card {
  min-height: 0;
  padding: 8px;
}

.ai-customizer__choice--image-cards .ai-customizer__choice-card img {
  width: 100%;
  height: 112px;
  aspect-ratio: auto;
  object-fit: contain;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(76px, 102px));
  gap: 8px;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-card {
  padding: 6px;
  font-size: 12px;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-card img {
  height: 72px;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-grid {
  grid-template-columns: repeat(auto-fill, minmax(128px, 172px));
  gap: 12px;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-card {
  padding: 10px;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-card img {
  height: 156px;
}

.ai-customizer__choice--image-swatch.ai-customizer__choice--size-small .ai-customizer__choice-card {
  width: 62px;
}

.ai-customizer__choice--image-swatch.ai-customizer__choice--size-small .ai-customizer__choice-card img {
  height: 52px;
}

.ai-customizer__choice--image-swatch.ai-customizer__choice--size-large .ai-customizer__choice-card {
  width: 96px;
}

.ai-customizer__choice--image-swatch.ai-customizer__choice--size-large .ai-customizer__choice-card img {
  height: 84px;
}

@media (max-width:640px) {

  .ai-customizer__choice--image-cards .ai-customizer__choice-grid,
  .ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .ai-customizer__choice--image-cards .ai-customizer__choice-card img {
    height: 94px;
  }

  .ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-card img {
    height: 70px;
  }

  .ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-card img {
    height: 112px;
  }
}

/* SHOPLINE themes may apply global image rules (for example `img {
   height:auto; max-width:none; }`) with !important. Keep visual option
   thumbnails inside their cards regardless of those host defaults. */
.ai-customizer__choice,
.ai-customizer__choice-grid,
.ai-customizer__choice-card {
  min-width: 0 !important;
  max-width: 100% !important;
}

.ai-customizer__choice-grid {
  overflow: hidden;
}

.ai-customizer__choice-card {
  overflow: hidden !important;
}

.ai-customizer__choice-card img {
  position: static !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 112px !important;
  max-height: 112px !important;
  min-height: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  border-radius: 6px !important;
}

.ai-customizer__choice--image-swatch .ai-customizer__choice-card {
  width: 78px !important;
  max-width: 78px !important;
}

.ai-customizer__choice--image-swatch .ai-customizer__choice-card img {
  width: 100% !important;
  height: 58px !important;
  max-height: 58px !important;
  aspect-ratio: 1 / 1 !important;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-card img {
  height: 72px !important;
  max-height: 72px !important;
}

.ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-card img {
  height: 156px !important;
  max-height: 156px !important;
}

@media (max-width: 640px) {
  .ai-customizer__choice--image-cards .ai-customizer__choice-card img {
    height: 94px !important;
    max-height: 94px !important;
  }

  .ai-customizer__choice--image-cards.ai-customizer__choice--size-small .ai-customizer__choice-card img {
    height: 70px !important;
    max-height: 70px !important;
  }

  .ai-customizer__choice--image-cards.ai-customizer__choice--size-large .ai-customizer__choice-card img {
    height: 112px !important;
    max-height: 112px !important;
  }

  .ai-customizer__choice--image-swatch .ai-customizer__choice-card {
    width: 70px !important;
    max-width: 70px !important;
  }

  .ai-customizer__choice--image-swatch .ai-customizer__choice-card img {
    height: 52px !important;
    max-height: 52px !important;
  }
}

/* Start from a neutral palette. The script replaces these values with the
   live purchase-button color as soon as the product form has hydrated. */
.ai-customizer {
  --ai-theme-color: #000;
  --ai-theme-color-rgb: 255, 255, 255;
  --ai-theme-surface: #ffffff;
  --ai-theme-selected-surface: #f5f5f5;
  --ai-theme-hover: #eeeeee;
  --ai-theme-ring: rgba(0, 0, 0, .12);
  --ai-theme-contrast: #161616;
  --ai-theme-selected-contrast: #161616;
  --ai-theme-surface-contrast: #161616;
  --ai-card-border-color: #161616;
  --ai-button-radius: var(--button-border-radius, 4px);
  --ai-button-border-color: #161616;
  --ai-button-border-width: 1px;
  --ai-button-border-style: solid;
  --ai-button-outline: none;
  --ai-accent: var(--ai-theme-color);
}

.ai-customizer__card {
  border: 2px solid var(--ai-card-border-color) !important;
  border-color: var(--ai-card-border-color) !important;
  background: var(--ai-theme-surface) !important;
}

.ai-customizer__upload:hover,
.ai-customizer__upload:focus-within {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.5) !important;
  background: var(--ai-theme-surface, #fff) !important;
}

.ai-customizer__upload.has-file {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95) !important;
  background: var(--ai-theme-surface) !important;
}

.ai-customizer__file-name {
  color: rgba(var(--color-text, 22, 22, 22), 0.92) !important;
}

.ai-customizer__field textarea:focus,
.ai-customizer__field select:focus,
.ai-customizer__field>input:not([type="checkbox"]):focus {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95) !important;
}

.ai-customizer__checkbox input,
.ai-customizer__consent input {
  accent-color: rgba(var(--color-text, 22, 22, 22), 0.9) !important;
}

/* These four need `!important` to beat the host theme's own `button` rules.
   The `:hover` background lives with the base block above. */
.ai-customizer__form>button {
  border: var(--ai-button-border-width) var(--ai-button-border-style) var(--ai-button-border-color) !important;
  border-radius: var(--ai-button-radius) !important;
  box-shadow: var(--ai-button-outline) !important;
  color: var(--ai-theme-contrast) !important;
  background: var(--ai-theme-color) !important;
}

.ai-customizer__result-count {
  color: rgba(var(--color-text, 22, 22, 22), 0.92) !important;
  background: var(--ai-theme-surface) !important;
}

.ai-customizer__choice-card {
  border: 1px solid var(--ai-control-border) !important;
  background: #fff !important;
}

.ai-customizer__choice-card:has(input:checked),
.ai-customizer__choice-card.is-selected {
  border: 2px solid rgba(var(--color-text, 22, 22, 22), 0.95) !important;
  color: var(--ai-theme-selected-contrast) !important;
  background: var(--ai-theme-selected-surface) !important;
}

.ai-customizer__choice-card:has(input:focus-visible) {
  outline: 1px solid rgba(var(--color-text, 22, 22, 22), 0.95) !important;
}

.ai-customizer__choice--radio .ai-customizer__choice-card:has(input:checked)::before,
.ai-customizer__choice--radio .ai-customizer__choice-card.is-selected::before {
  border-color: rgba(var(--color-text, 22, 22, 22), 0.95) !important;
}

/* Mirror the live SHOPLINE purchase button once the script has sampled it —
   from `.pay-button-common-item` where the theme renders it, otherwise from the
   purchase-shaped candidates. The max-width guard keeps compact buttons inside
   a narrow product column while preserving a full-width source button. */
.ai-customizer__form>button {
  width: min(100%, var(--ai-button-width, 100%)) !important;
  height: var(--ai-button-height, var(--style-block--button--size__height, auto)) !important;
  min-height: var(--ai-button-height, var(--style-block--button--size__height, auto)) !important;
  padding: var(--ai-button-padding-y, var(--style-block--button--spacing__padding-block-start, 10px)) var(--ai-button-padding-x, var(--style-block--button--spacing__padding-inline-start, 18px)) !important;
  font-family: var(--ai-button-font-family, inherit) !important;
  font-size: var(--ai-button-font-size, var(--style-block--button--size__font-size, 16px)) !important;
  font-weight: var(--ai-button-font-weight, var(--style-block--button--font-weight, 400)) !important;
  line-height: var(--ai-button-line-height, normal) !important;
  letter-spacing: var(--ai-button-letter-spacing, normal) !important;
  text-transform: var(--ai-button-text-transform, none) !important;
  background-image: var(--ai-button-background-image, none) !important;
}

/* Price suffix appended to the theme's own Add to cart control. The amount and
   its formatting belong to SHOPLINE, so nothing is restyled here: the span
   inherits the button's font and color, and only keeps the amount on one line
   and spaced away from the label. */
.ai-customizer__native-price {
  margin-inline-start: 0.35em;
  white-space: nowrap;
}

/* Result cards are intentionally narrower than the product form. Do not
   carry the full purchase button's fixed geometry into this compact grid:
   margins plus a 100% width otherwise clip the label at the card edge. */
.ai-customizer__result-card {
  min-width: 0;
}

/* `.ai-customizer__cart-button` intentionally carries no styles: the script
   keeps it permanently hidden (`hidden` + inline `display:none !important`) and
   only ever clicks it programmatically, so SHOPLINE stays the sole purchase
   control. Its former geometry, label, spinner and success rules were dead code
   and have been removed. */

@keyframes ai-customizer-spin {
  to {
    transform: rotate(360deg);
  }
}

/* The final-price variant is one real cart line; this detail is appended
   beneath it for a clear customization-fee breakdown. */
.ai-customizer-cart-surcharge {
  display: block;
  margin-top: 5px;
  color: inherit;
  font-size: .875em;
  line-height: 1.35;
  opacity: .78;
}

/* Final host-theme isolation for the generated-design viewer. Keep the real
   image visible and let `contain` calculate its size from the source ratio;
   this prevents global `img { object-fit: cover }` rules from cropping it. */
.ai-customizer__result-card img {
  object-fit: contain !important;
  object-position: center !important;
}

.ai-customizer__viewer-figure {
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.ai-customizer__viewer-media {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background-image: none !important;
}

.ai-customizer__viewer-image {
  position: static !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  object-fit: contain !important;
  object-position: center !important;
}

.ai-customizer__viewer-thumb img {
  object-fit: contain !important;
  object-position: center !important;
}

/* Keep every disclosure in the required order: required mark, field label,
   then the fold control. These rules outrank product-theme summary styles. */
.ai-customizer__field-disclosure>summary {
  display: flex !important;
  flex-direction: row !important;
  direction: ltr !important;
  align-items: center !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  white-space: nowrap !important;
}

.ai-customizer__field-disclosure>summary::before,
.ai-customizer__field-disclosure>summary::after {
  display: none !important;
  content: none !important;
}

.ai-customizer__field-disclosure>summary>.ai-customizer__disclosure-label {
  position: static !important;
  display: inline-flex !important;
  flex: 0 1 auto !important;
  order: 1 !important;
  min-width: 0 !important;
  max-width: calc(100% - 30px) !important;
  margin: 0 !important;
  padding: 0 !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
}

.ai-customizer__field-disclosure>summary>.ai-customizer__disclosure-label>.ai-customizer__disclosure-text {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.ai-customizer__field-disclosure>summary>.ai-customizer__disclosure-icon {
  position: static !important;
  display: inline-grid !important;
  flex: 0 0 22px !important;
  order: 2 !important;
  align-self: center !important;
  margin: 0 0 0 8px !important;
  transform: rotate(0deg) !important;
}

.ai-customizer__field-disclosure:not([open])>summary>.ai-customizer__disclosure-icon {
  transform: rotate(-90deg) !important;
}

/* Itemised surcharge rows stay compact and readable below the product price. */
.ai-customizer__price-detail-block {
  display: grid;
  gap: 7px;
  padding-top: 5px;
  border-top: 1px solid #f0f0f0;
}

.ai-customizer__price-detail-heading {
  color: #666;
  font-size: 12px;
  font-weight: 700;
}

.ai-customizer__price-detail {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: #555;
  font-size: 13px;
}

.ai-customizer__price-detail span {
  min-width: 0;
}

.ai-customizer__price-detail span small {
  display: block;
  margin-top: 2px;
  color: #8a8a8a;
  font-size: 11px;
  font-weight: 400;
}

.ai-customizer__price-detail strong {
  flex: 0 0 auto;
  color: #222;
  font-size: 13px;
  font-weight: 700;
}

.ai-customizer__history-detail {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #ececec;
}

.ai-customizer__history-detail-title {
  color: #555;
  font-size: 12px;
  font-weight: 700;
}

.ai-customizer__history-values {
  display: grid;
  gap: 6px;
}

.ai-customizer__history-values span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #555;
  font-size: 12px;
}

.ai-customizer__history-values small {
  color: #888;
}

.ai-customizer__history-values strong {
  max-width: 65%;
  overflow-wrap: anywhere;
  color: #222;
  font-weight: 600;
  text-align: right;
}

/* In-flight generation viewer: a centered storefront modal with the current
   buyer image visible, a dark progress treatment, and the product page still
   recognizable behind a neutral backdrop. */
.ai-customizer__generation-viewer[hidden] {
  display: none !important;
}

.ai-customizer__generation-viewer {
  position: fixed !important;
  z-index: 2147483001 !important;
  inset: 0 !important;
  display: grid !important;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  place-items: center;
  padding: 24px;
}

.ai-customizer__generation-viewer,
.ai-customizer__generation-viewer * {
  box-sizing: border-box !important;
}

.ai-customizer__generation-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 20, 24, .42);
  backdrop-filter: blur(1px);
}

.ai-customizer__generation-panel {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(92vw, 760px);
  max-height: calc(100dvh - 48px);
  gap: 18px;
  padding: 28px 30px 24px;
  overflow: auto;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(12, 18, 28, .24);
  text-align: center;
}

.ai-customizer__generation-close {
  position: absolute !important;
  z-index: 3;
  top: 10px;
  right: 10px;
  display: grid !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  min-height: 36px !important;
  place-items: center;
  margin: 0 !important;
  padding: 0 0 2px !important;
  border: 0 !important;
  border-radius: 50%;
  color: #242424 !important;
  background: rgba(255, 255, 255, .9) !important;
  box-shadow: 0 1px 7px rgba(0, 0, 0, .12);
  cursor: pointer;
  font: 400 27px/1 Arial, sans-serif !important;
}

.ai-customizer__generation-close:hover,
.ai-customizer__generation-close:focus-visible {
  background: #fff !important;
  outline: 2px solid #202020;
  outline-offset: 2px;
}

.ai-customizer__generation-stage {
  position: relative;
  display: grid;
  width: 100%;
  height: min(58dvh, 530px);
  min-height: 320px;
  place-items: center;
  overflow: hidden;
  border-radius: 2px;
  background: #292a2d;
}

.ai-customizer__generation-stage>img {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  opacity: .58 !important;
  visibility: visible !important;
  object-fit: contain !important;
  object-position: center !important;
  filter: saturate(.82);
}

.ai-customizer__generation-stage>img[hidden] {
  display: none !important;
}

.ai-customizer__generation-stage-shade {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 15, .32);
}

.ai-customizer__generation-stage:not(.has-preview) .ai-customizer__generation-stage-shade {
  background: linear-gradient(145deg, #303238, #1f2023);
}

.ai-customizer__generation-stage-content {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 12px;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .38);
}

.ai-customizer__generation-stage-content strong {
  color: #fff !important;
  font-size: clamp(42px, 7vw, 64px);
  font-weight: 760;
  line-height: 1;
}

.ai-customizer__generation-stage-content p {
  max-width: 360px;
  margin: 0;
  color: #fff !important;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.4;
}

.ai-customizer__generation-spinner {
  width: 52px;
  height: 52px;
  border: 3px solid rgba(255, 255, 255, .32);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ai-customizer-spin .8s linear infinite;
}

.ai-customizer__generation-meter {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.ai-customizer__generation-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0f1f3;
}

.ai-customizer__generation-track>span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #17181b;
  /* 宽度改由 JS requestAnimationFrame 每帧驱动缓动，避免与 CSS 过渡叠加成双重动画 */
  transition: none;
}

.ai-customizer__generation-meter>strong {
  min-width: 42px;
  color: #17181b !important;
  font-size: 13px;
  font-weight: 750;
  text-align: right;
}

.ai-customizer__generation-footer {
  margin: -4px 0 0 !important;
  color: #555 !important;
  font-size: 13px !important;
  line-height: 1.45;
}

.ai-customizer__generation-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 2px;
}

.ai-customizer__generation-actions[hidden] {
  display: none !important;
}

.ai-customizer__generation-action {
  min-width: 92px;
  min-height: 40px;
  padding: 8px 18px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.ai-customizer__generation-action:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.ai-customizer__generation-action--cancel {
  color: #27282b;
  background: #f0f1f3;
}

.ai-customizer__generation-action--cancel:hover,
.ai-customizer__generation-action--cancel:focus-visible {
  background: #e5e7eb;
}

.ai-customizer__generation-action--confirm {
  color: #fff;
  background: #17181b;
}

.ai-customizer__generation-action--confirm:hover,
.ai-customizer__generation-action--confirm:focus-visible {
  background: #303238;
}

.ai-customizer__generation-viewer.is-complete .ai-customizer__generation-stage>img {
  opacity: 1 !important;
  filter: none !important;
}

.ai-customizer__generation-viewer.is-complete .ai-customizer__generation-stage-shade,
.ai-customizer__generation-viewer.is-complete .ai-customizer__generation-sparkles,
.ai-customizer__generation-viewer.is-complete .ai-customizer__generation-stage-content,
.ai-customizer__generation-viewer.is-complete .ai-customizer__generation-meter {
  display: none !important;
}

html.ai-customizer-generation-open,
body.ai-customizer-generation-open {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .ai-customizer__generation-viewer {
    padding: 10px;
  }

  .ai-customizer__generation-panel {
    width: 100%;
    max-height: calc(100dvh - 20px);
    gap: 14px;
    padding: 18px 16px 16px;
  }

  .ai-customizer__generation-stage {
    height: min(52dvh, 430px);
    min-height: 260px;
  }

  .ai-customizer__generation-stage-content strong {
    font-size: 44px;
  }
}

/* Live product preview and the generated-design viewer. These rules are kept
   at the end so they win over both SHOPLINE's image defaults and the legacy
   viewer declarations above. */
img[data-ai-customizer-preview="true"] {
  cursor: zoom-in !important;
}

.ai-customizer[data-ai-generation-locked="true"] .ai-customizer__form {
  pointer-events: none !important;
}

.ai-customizer__viewer-panel {
  display: grid !important;
  grid-template-columns: 64px minmax(0, 1fr) 64px !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
  width: min(96vw, 1440px) !important;
  height: min(92vh, 1000px) !important;
  max-height: 92vh !important;
  padding: 18px 24px 20px !important;
  overflow: hidden !important;
  border-color: rgba(0, 0, 0, .1) !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .32) !important;
}

.ai-customizer__viewer-toolbar {
  position: static;
  grid-column: 1 / -1;
  grid-row: 1;
  min-height: 34px;
}

.ai-customizer__viewer-mode-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #e2e4e8;
  border-radius: 999px;
  color: #4b5563;
  background: #f7f8fa;
  font: 700 11px/1 Arial, sans-serif;
  letter-spacing: .02em;
}

.ai-customizer__viewer-nav {
  grid-row: 2;
  align-self: center;
  color: #202124 !important;
  border-color: #d8dadd !important;
  background: rgba(255, 255, 255, .94) !important;
}

.ai-customizer__viewer-nav:hover {
  background: #f4f5f6 !important;
}

.ai-customizer__viewer-figure {
  grid-column: 2 !important;
  grid-row: 2 !important;
  border-radius: 4px;
  background: #111318;
}

.ai-customizer__viewer-media {
  cursor: zoom-in;
  touch-action: none;
}

.ai-customizer__viewer-zoom-stack {
  position: absolute;
  z-index: 5;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-customizer__viewer-zoom-stack button {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  flex: 0 0 44px !important;
  border: 1px solid rgba(0, 0, 0, .18) !important;
  border-radius: 50% !important;
  color: #202124 !important;
  background: #fff !important;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .28) !important;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .15s ease;
}

.ai-customizer__viewer-zoom-stack button:hover,
.ai-customizer__viewer-zoom-stack button:focus-visible {
  border-color: rgba(0, 0, 0, .35) !important;
  color: #111 !important;
  background: #f1f3f5 !important;
  /* 白色轮廓落在白色按钮上不可见，改用文字色 */
  outline: 2px solid rgba(var(--color-text, 22, 22, 22), 0.95);
  outline-offset: 2px;
  transform: scale(1.04);
}

.ai-customizer__viewer-zoom-stack button:disabled {
  cursor: default;
  opacity: .46;
  transform: none;
}

.ai-customizer__viewer-zoom-stack svg {
  display: block;
  width: 22px !important;
  height: 22px !important;
}

.ai-customizer__viewer-image {
  pointer-events: auto !important;
  user-select: none;
  transition: transform .18s ease;
}

.ai-customizer__viewer.is-zoomed .ai-customizer__viewer-image {
  transition: none;
}

.ai-customizer__viewer-caption {
  color: rgba(255, 255, 255, .86);
}

.ai-customizer__viewer-thumbs {
  grid-column: 1 / -1;
  grid-row: 3;
  min-height: 68px;
  padding: 8px 0 0;
  justify-content: flex-start;
}

.ai-customizer__viewer-thumb--preview {
  border-color: rgba(31, 93, 255, .45) !important;
}

.ai-customizer__viewer-thumb--preview.is-active {
  border-color: #1f5dff !important;
}

/* Keep the generated image as the first item in SHOPLINE's native product
   media track. The source gallery remains in the same carousel and can be
   selected normally after the preview. */
.ai-customizer__preview-media-item {
  position: relative;
  box-sizing: border-box;
  flex: 0 0 100% !important;
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
}

.ai-customizer__preview-media-item[hidden] {
  display: none !important;
}

.ai-customizer__preview-media-item .ai-customizer__preview-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #f5f6f7;
}

.ai-customizer__product-preview-label {
  position: absolute;
  z-index: 2;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 4px 7px;
  border-radius: 4px;
  color: #25282d;
  background: rgba(255, 255, 255, .88);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.2;
  text-transform: uppercase;
  pointer-events: none;
}

.ai-customizer__product-preview-media {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  cursor: zoom-in;
  line-height: 0;
  appearance: none;
}

.ai-customizer__product-preview-media:focus-visible {
  outline: 2px solid #1f5dff;
  outline-offset: 3px;
}

.ai-customizer__product-preview-image {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: min(72vh, 720px) !important;
  margin: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
}

.media-gallery__thumbnail.ai-customizer__preview-thumbnail,
.ai-customizer__preview-thumbnail {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  cursor: pointer;
  opacity: 1;
}

.media-gallery__thumbnail.ai-customizer__preview-thumbnail[hidden],
.ai-customizer__preview-thumbnail[hidden] {
  display: none !important;
}

.ai-customizer__preview-thumbnail-wrapper[hidden] {
  display: none !important;
}

.media-gallery__thumbnail.ai-customizer__preview-thumbnail img,
.ai-customizer__preview-thumbnail img {
  display: block !important;
}

/* Four-point creative sparkles used by the in-flight generation treatment. */
.ai-customizer__generation-sparkles {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.ai-customizer__generation-sparkles .sparkle {
  position: absolute;
  display: block;
  width: 24px;
  height: 24px;
  background: #d9f56a;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  filter: drop-shadow(0 0 8px rgba(217, 245, 106, .5));
  animation: ai-customizer-sparkle 2.8s ease-in-out infinite;
}

.ai-customizer__generation-sparkles .sparkle--a {
  top: 14%;
  left: 14%;
  width: 28px;
  height: 28px;
  animation-delay: -.4s;
}

.ai-customizer__generation-sparkles .sparkle--b {
  top: 18%;
  right: 18%;
  width: 16px;
  height: 16px;
  animation-delay: -1.6s;
}

.ai-customizer__generation-sparkles .sparkle--c {
  top: 42%;
  left: 8%;
  width: 12px;
  height: 12px;
  animation-delay: -2.2s;
}

.ai-customizer__generation-sparkles .sparkle--d {
  top: 54%;
  right: 10%;
  width: 30px;
  height: 30px;
  animation-delay: -.9s;
}

.ai-customizer__generation-sparkles .sparkle--e {
  bottom: 16%;
  left: 12%;
  width: 18px;
  height: 18px;
  animation-delay: -2.5s;
}

.ai-customizer__generation-sparkles .sparkle--f {
  bottom: 22%;
  right: 24%;
  width: 20px;
  height: 20px;
  animation-delay: -1.2s;
}

.ai-customizer__generation-sparkles .sparkle--g {
  bottom: 42%;
  left: 48%;
  width: 13px;
  height: 13px;
  animation-delay: -.2s;
}

.ai-customizer__generation-sparkles .sparkle--h {
  top: 30%;
  left: 34%;
  width: 11px;
  height: 11px;
  animation-delay: -1.9s;
}

@keyframes ai-customizer-sparkle {

  0%,
  100% {
    opacity: .25;
    transform: scale(.62) rotate(0deg);
  }

  45% {
    opacity: 1;
    transform: scale(1.12) rotate(45deg);
  }

  70% {
    opacity: .6;
    transform: scale(.82) rotate(90deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-customizer__generation-sparkles .sparkle {
    animation: none;
    opacity: .72;
    transform: scale(.9);
  }
}

@media (max-width: 640px) {
  .ai-customizer__viewer {
    align-items: start !important;
    padding: max(10px, env(safe-area-inset-top)) 10px 14px !important;
  }

  .ai-customizer__viewer-panel {
    grid-template-columns: 36px minmax(0, 1fr) 36px !important;
    width: min(100%, 520px) !important;
    height: min(82dvh, 438px) !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 24px) !important;
    margin-top: 0 !important;
    padding: 10px 8px 12px !important;
    border-radius: 10px !important;
  }

  .ai-customizer__viewer.is-zoomed .ai-customizer__viewer-panel {
    width: min(100%, 520px) !important;
    height: min(82dvh, 438px) !important;
    max-height: calc(100dvh - 24px) !important;
    border: 1px solid rgba(0, 0, 0, .1) !important;
    border-radius: 10px !important;
  }

  .ai-customizer__viewer-thumbs {
    min-height: 58px;
    max-height: 64px;
    overflow-x: auto;
  }
}

/* ── 全局 Toast 提示（顶部居中、按类型着色、自动消失）── */
.ai-customizer__toast-host {
  position: fixed;
  z-index: 2147483003;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(92vw, 420px);
  pointer-events: none;
}

.ai-customizer__toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, .08);
  box-shadow: 0 12px 34px rgba(12, 18, 28, .18);
  color: #1c2024;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  background: #fff;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity .26s ease, transform .26s ease;
}

.ai-customizer__toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ai-customizer__toast-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 50%;
}

.ai-customizer__toast--success .ai-customizer__toast-icon {
  background: #1f9d55;
}

.ai-customizer__toast--error .ai-customizer__toast-icon {
  background: #d9232e;
}

.ai-customizer__toast--warning .ai-customizer__toast-icon {
  background: #e0962a;
}

.ai-customizer__toast--info .ai-customizer__toast-icon {
  background: #2f6fed;
}

.ai-customizer__toast--success {
  border-left: 4px solid #1f9d55;
}

.ai-customizer__toast--error {
  border-left: 4px solid #d9232e;
}

.ai-customizer__toast--warning {
  border-left: 4px solid #e0962a;
}

.ai-customizer__toast--info {
  border-left: 4px solid #2f6fed;
}

/* ── 统一提示弹窗：严格对齐参考实现 kibifig.html 的 .custom-modal ── */
/* 【要点】遮罩 fixed 全屏 + 半透明黑 + flex 居中 + overflow:hidden + z-index:9999 + fadeIn .25s，
   容器白底、固定 460x380、max-height:45vh，max-width:calc(100vw - 32px) 防止小屏溢出（移动端不再占满全屏）。 */
.ai-customizer__modal[hidden] {
  display: none !important;
}

.ai-customizer__modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  background-color: rgba(0, 0, 0, .5);
  z-index: 9999;
  animation: aiCustomizerModalFadeIn .25s ease;
}

.ai-customizer__modal-container {
  display: flex;
  flex-direction: column;
  background: #fff;
  width: 460px;
  max-width: calc(100vw - 32px);
  height: 380px;
  max-height: 45vh;
  border-radius: 6px;
  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, .1), 0 2px 5px 0 rgba(0, 0, 0, .2);
}


.ai-customizer__modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  padding: 0 20px;
  height: 50px;
  border-bottom: 1px solid #ebeef5;
  font-weight: 600;
  font-size: 16px;
}

.ai-customizer__modal-title {
  color: #1c2024;
}

.ai-customizer__modal-close {
  cursor: pointer;
  font-size: 26px;
  line-height: 26px;
  color: #333;
}

.ai-customizer__modal-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 18px;
  overflow-y: auto;
  color: #333;
  font-size: 14px;
}

.ai-customizer__modal-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2f6fed;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

.ai-customizer__modal[data-variant="error"] .ai-customizer__modal-icon {
  background: #d9232e;
}

.ai-customizer__modal[data-variant="warning"] .ai-customizer__modal-icon {
  background: #e0962a;
}

.ai-customizer__modal[data-variant="success"] .ai-customizer__modal-icon {
  background: #1f9d55;
}

.ai-customizer__modal-message {
  margin: 0;
  max-width: 420px;
  color: #333;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.7;
  white-space: pre-line;
  text-align: center;
}

.ai-customizer__modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 0 0 auto;
  padding: 15px 20px;
  height: 70px;
  border-top: 1px solid #ebeef5;
}

.ai-customizer__modal-footer[hidden] {
  display: none !important;
}

.ai-customizer__modal-footer--single {
  justify-content: center;
}

.ai-customizer__modal-footer--confirm-only {
  justify-content: flex-end;
}

.ai-customizer__modal-footer--single .ai-customizer__modal-btn {
  min-width: 140px;
}

.ai-customizer__modal-btn {
  padding: 10px 20px;
  border: 0;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .3s ease;
}

.ai-customizer__modal-btn[hidden] {
  display: none !important;
}

.ai-customizer__modal-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

.ai-customizer__modal-btn--cancel {
  background: #f5f5f5;
  color: #333;
}

.ai-customizer__modal-btn--cancel:hover {
  background: #e0e0e0;
}

.ai-customizer__modal-btn--confirm {
  background: #000;
  color: #fff;
}

.ai-customizer__modal-btn--confirm:hover {
  background: #333;
}

@keyframes aiCustomizerModalFadeIn {
  from {
    opacity: 0;
    transform: scale(.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ==========================================================================
   买家端加载态 —— Callie 同款「三方块变色 spinner」，三档色跟随 SHOPLINE 主题色
   机制：
   · JS（setThemeColor）把主题购买按钮色写入 --ai-spinner-rgb（"R, G, B"）；
     主题色近白（白底上不可见）或尚未取到时，回退 Callie 品牌橙 255, 158, 44。
   · 三个动画相位共用一个 keyframes，用 alpha 三档（1 / .5 / .23）区分深浅 ——
     白底上与 Callie 原版「向白混合」(#FF9E2C→#FFCE95→#FFE9CE) 逐像素等价。
   · ::before/::after 用负 animation-delay（-.4s / -.8s）做 1/3 周期相位差，
     与原版三个独立 keyframes 数学等价，且保证三档永远同步于同一变量。
   ========================================================================== */
.ai-customizer-root[data-ai-customizer-state='loading'] {
  min-height: 150px;
}
.ai-customizer-loading {
  position: relative;
  min-height: 150px;
}
.ai-customizer-loading .loading {
  width: 20px;
  height: 20px;
  display: inline-block;
  position: fixed;
  transform: rotate(45deg);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.85);
  animation: animloader 1.2s ease infinite;
}
.ai-customizer-loading .loading::before {
  content: '';
  width: 20px;
  height: 20px;
  position: absolute;
  left: 0;
  top: -20px;
  background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.85);
  animation: animloader 1.2s ease infinite;
  animation-delay: -0.4s;
}
.ai-customizer-loading .loading::after {
  content: '';
  position: absolute;
  left: -20px;
  top: 0;
  width: 20px;
  height: 20px;
  background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.85);
  animation: animloader 1.2s ease infinite;
  animation-delay: -0.8s;
}
/* 三档深浅：1（原色）→ .5（≈Callie #FFCE95）→ .23（≈Callie #FFE9CE），白底等价 */
@keyframes animloader {
  0%,
  100% {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 1);
  }
  33% {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.5);
  }
  66% {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.23);
  }
}
/* 无障碍：尊重系统「减少动态效果」—— 停住接力动画，固定为三档深浅静态 */
@media (prefers-reduced-motion: reduce) {
  .ai-customizer-loading .loading,
  .ai-customizer-loading .loading::before,
  .ai-customizer-loading .loading::after {
    animation: none;
  }
  .ai-customizer-loading .loading {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 1);
  }
  .ai-customizer-loading .loading::before {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.5);
  }
  .ai-customizer-loading .loading::after {
    background: rgba(var(--ai-spinner-rgb, 255, 158, 44), 0.23);
  }
}
