.ecom-image-shell {
  display: grid;
  gap: 18px;
}

.ecom-image-hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 18px;
  padding: 24px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 85% 15%, rgba(245, 158, 11, 0.28), transparent 34%),
    linear-gradient(135deg, #111827 0%, #1f2937 52%, #78350f 100%);
  color: #fff7ed;
  box-shadow: 0 22px 60px rgba(120, 53, 15, 0.18);
}

.ecom-image-hero h2 {
  margin: 10px 0;
  font-size: 30px;
  line-height: 1.16;
}

.ecom-image-hero p {
  margin: 0;
  color: rgba(255, 247, 237, 0.82);
  line-height: 1.7;
}

.ecom-image-retention-note {
  width: fit-content;
  margin-top: 14px;
  padding: 8px 12px;
  border: 1px solid rgba(253, 230, 138, 0.34);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.28);
  color: #fde68a;
  font-size: 12px;
  font-weight: 800;
}

.ecom-image-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.ecom-image-hero-card {
  display: grid;
  gap: 10px;
  align-content: center;
  padding: 18px;
  border: 1px solid rgba(253, 230, 138, 0.25);
  border-radius: 20px;
  background: rgba(17, 24, 39, 0.38);
}

.ecom-image-hero-card strong {
  font-size: 22px;
}

.ecom-image-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ecom-image-workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.ecom-image-main {
  min-width: 0;
}

.ecom-image-history {
  position: sticky;
  top: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(254, 215, 170, 0.85);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,.95), rgba(255,251,235,.92));
  box-shadow: 0 14px 36px rgba(120, 53, 15, 0.08);
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.ecom-image-history-head {
  display: grid;
  gap: 10px;
}

.ecom-image-history-head .ecom-image-btn {
  width: 100%;
}

.ecom-image-history-head p,
.ecom-image-history-empty {
  margin: 0;
  color: #8a6a3d;
  font-size: 12px;
  line-height: 1.6;
}

.ecom-image-card {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 20px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.ecom-image-card-head {
  padding: 16px 18px;
  border-bottom: 1px solid #eef2f7;
}

.ecom-image-card-head h3 {
  margin: 0;
  font-size: 17px;
  color: #111827;
}

.ecom-image-card-head p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.6;
}

.ecom-image-card-body {
  padding: 18px;
}

.ecom-image-form {
  display: grid;
  gap: 13px;
}

.ecom-image-form label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

.ecom-image-form input,
.ecom-image-form select,
.ecom-image-form textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 11px 12px;
  font-size: 14px;
  background: #f8fafc;
  color: #0f172a;
  outline: none;
}

.ecom-image-form textarea {
  min-height: 92px;
  resize: vertical;
}

.ecom-image-size-field {
  display: grid;
  gap: 7px;
  color: #334155;
}

.ecom-image-size-title {
  font-size: 13px;
  font-weight: 800;
}

.ecom-image-custom-size-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.ecom-image-custom-size-grid label {
  gap: 5px;
  min-width: 0;
  font-size: 12px;
  color: #64748b;
}

.ecom-image-custom-size-grid input {
  min-width: 0;
}

.ecom-image-custom-size-times {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 900;
}

.ecom-image-size-field small {
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.45;
}

.ecom-image-upload {
  border: 1px dashed #f59e0b;
  border-radius: 16px;
  padding: 14px;
  background: linear-gradient(180deg, #fffbeb, #fff7ed);
}

.ecom-image-upload-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.ecom-image-upload-head strong {
  display: block;
  color: #7c2d12;
  font-size: 13px;
}

.ecom-image-upload-head span {
  display: block;
  margin-top: 3px;
  color: #9a6b34;
  font-size: 11px;
  line-height: 1.45;
}

.ecom-image-upload-btn {
  flex: 0 0 auto;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff !important;
  font-size: 12px !important;
  font-weight: 900 !important;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(249, 115, 22, 0.24);
}

.ecom-image-upload-btn input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ecom-image-upload-btn span {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.ecom-image-paste-zone {
  min-height: 76px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(251, 146, 60, 0.35);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  outline: none;
}

.ecom-image-paste-zone:focus {
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.ecom-image-paste-zone.drag-active {
  border-color: #ea580c;
  background: #fff7ed;
  box-shadow: inset 0 0 0 2px rgba(249, 115, 22, 0.18);
}

.ecom-image-upload-empty {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: #b45309;
  font-size: 12px;
  text-align: center;
}

.ecom-image-thumbs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.ecom-image-thumb {
  position: relative;
  min-width: 0;
}

.ecom-image-thumb img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #fed7aa;
  display: block;
}

.ecom-image-thumb span {
  position: absolute;
  left: 5px;
  bottom: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.ecom-image-thumb-tools {
  position: absolute;
  left: 4px;
  top: 4px;
  display: flex;
  gap: 3px;
}

.ecom-image-thumb-tools button {
  position: static;
  width: 18px;
  height: 18px;
  border-color: rgba(251, 146, 60, 0.55);
  color: #c2410c;
  font-size: 14px;
  line-height: 14px;
}

.ecom-image-thumb button {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  background: #fff;
  color: #dc2626;
  font-size: 15px;
  font-weight: 900;
  line-height: 16px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(127, 29, 29, 0.16);
}

.ecom-image-thumb button:hover {
  background: #fee2e2;
}

.ecom-image-thumb .ecom-image-thumb-tools button {
  position: static;
  top: auto;
  right: auto;
  width: 18px;
  height: 18px;
  border-color: rgba(251, 146, 60, 0.55);
  color: #c2410c;
  font-size: 14px;
  line-height: 14px;
  box-shadow: 0 4px 10px rgba(120, 53, 15, 0.12);
}

.ecom-image-thumb .ecom-image-thumb-tools button:hover {
  background: #ffedd5;
}

.ecom-image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.ecom-image-btn {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.ecom-image-btn:hover {
  transform: translateY(-1px);
}

.ecom-image-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
}

.ecom-image-btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  box-shadow: 0 10px 24px rgba(249, 115, 22, 0.24);
}

.ecom-image-btn.secondary {
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fed7aa;
}

.ecom-image-status {
  padding: 12px 14px;
  border-radius: 14px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 13px;
  line-height: 1.6;
}

.ecom-image-status.error {
  background: #fef2f2;
  color: #991b1b;
}

.ecom-image-status.success {
  background: #ecfdf5;
  color: #065f46;
}

.ecom-image-retention-tip {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #fed7aa;
  border-radius: 14px;
  background: #fffbeb;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.6;
}

.ecom-image-generation-status {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #dbeafe;
  border-radius: 16px;
  background: #eff6ff;
}

.ecom-image-generation-status strong,
.ecom-image-generation-status span {
  display: block;
}

.ecom-image-generation-status strong {
  color: #1e3a8a;
  font-size: 13px;
}

.ecom-image-generation-status span {
  margin-top: 4px;
  color: #475569;
  font-size: 12px;
}

.ecom-image-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbeafe;
}

.ecom-image-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #f97316);
  transition: width .25s ease;
}

.ecom-image-projects {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 1px 5px 1px 1px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.55) rgba(255, 237, 213, 0.65);
}

.ecom-image-projects::-webkit-scrollbar {
  width: 7px;
}

.ecom-image-projects::-webkit-scrollbar-track {
  background: rgba(255, 237, 213, 0.65);
  border-radius: 999px;
}

.ecom-image-projects::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.55);
  border-radius: 999px;
}

.ecom-image-project {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  gap: 9px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.ecom-image-project-delete {
  width: 22px;
  height: 22px;
  align-self: start;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 18px;
  cursor: pointer;
}

.ecom-image-project:hover .ecom-image-project-delete {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.ecom-image-project:hover {
  border-color: #fdba74;
  transform: translateY(-1px);
}

.ecom-image-project-dot {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid #fed7aa;
}

.ecom-image-project-info {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.ecom-image-project.active {
  border-color: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.ecom-image-project strong {
  color: #111827;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecom-image-project span,
.ecom-image-project time {
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ecom-image-project time {
  color: #94a3b8;
}

.ecom-image-plan {
  display: grid;
  gap: 16px;
}

.ecom-image-plan-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fffaf3);
}

.ecom-image-plan-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.ecom-image-plan-section-head h3 {
  margin: 0;
  color: #92400e;
  font-size: 17px;
}

.ecom-image-plan-section-head p {
  margin: 5px 0 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.ecom-image-plan-section-head span {
  flex: 0 0 auto;
  padding: 5px 10px;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}

.ecom-image-plan-grid {
  display: grid;
  gap: 10px;
}

.ecom-image-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 18px;
  align-items: start;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: #fff;
}

.ecom-image-result {
  width: 112px;
  height: 112px;
  min-width: 112px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fafc, #fff7ed);
  border: 1px solid #fed7aa;
  display: grid;
  place-items: center;
  color: #92400e;
  font-size: 12px;
  overflow: hidden;
}

.ecom-image-result-btn {
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}

.ecom-image-result-btn:hover img {
  transform: scale(1.04);
}

.ecom-image-result + div {
  min-width: 0;
  padding-top: 1px;
}

.ecom-image-result img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.18s ease;
}

.ecom-image-item h4 {
  margin: 0 0 6px;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.35;
  word-break: break-word;
}

.ecom-image-item p {
  margin: 0 0 8px;
  color: #475569;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.ecom-image-plan-editor {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.ecom-image-plan-editor label {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.ecom-image-plan-editor input,
.ecom-image-plan-editor textarea {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  padding: 9px 10px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.55;
  outline: none;
}

.ecom-image-plan-editor textarea {
  min-height: 70px;
  resize: vertical;
}

.ecom-image-enable-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.ecom-image-enable-row input {
  width: auto;
}

.ecom-image-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ecom-image-badge {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
}

.ecom-image-badge.success {
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
}

.ecom-image-badge.warning {
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
}

.ecom-image-prompt-details {
  margin-top: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  overflow: hidden;
}

.ecom-image-prompt-details summary {
  padding: 9px 12px;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.ecom-image-prompt-box {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.ecom-image-prompt-box strong {
  color: #0f172a;
  font-size: 12px;
}

.ecom-image-prompt-box pre {
  max-height: 220px;
  margin: 0;
  padding: 10px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 12px;
  line-height: 1.65;
}

.ecom-image-error-text {
  margin-top: 8px !important;
  color: #b91c1c !important;
  font-size: 12px !important;
}

.ecom-image-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.ecom-image-mini-btn {
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 6px 10px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.ecom-image-mini-btn:hover {
  border-color: #f59e0b;
  color: #c2410c;
}

.ecom-image-mini-btn.danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.ecom-image-mini-btn.primary {
  border-color: #fdba74;
  background: #fff7ed;
  color: #c2410c;
  font-weight: 800;
}

.ecom-image-viewer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.ecom-image-viewer {
  width: min(1440px, 96vw);
  max-height: 92vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.42);
}

.ecom-image-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid #e5e7eb;
}

.ecom-image-viewer-head strong,
.ecom-image-viewer-head span {
  display: block;
}

.ecom-image-viewer-head strong {
  color: #0f172a;
  font-size: 16px;
}

.ecom-image-viewer-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.ecom-image-viewer-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ecom-image-viewer-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
}

.ecom-image-viewer-stage {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.ecom-image-viewer-stage img {
  display: block;
  max-width: min(100%, 920px);
  max-height: 78vh;
  margin: 0 auto;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
}

.ecom-image-viewer-meta {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid #e5e7eb;
  background: #fff;
}

.ecom-image-viewer-meta-block {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #f8fafc;
}

.ecom-image-viewer-meta-block + .ecom-image-viewer-meta-block {
  margin-top: 12px;
}

.ecom-image-viewer-meta strong {
  color: #0f172a;
}

.ecom-image-viewer-meta p {
  margin: 6px 0 0;
  color: #475569;
  line-height: 1.6;
  font-size: 13px;
}

.ecom-image-gallery-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(10px);
}

.ecom-image-gallery {
  width: min(1640px, 97vw);
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 32px 96px rgba(2, 6, 23, 0.42);
}

.ecom-image-gallery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #e5e7eb;
}

.ecom-image-gallery-head strong,
.ecom-image-gallery-head span {
  display: block;
}

.ecom-image-gallery-head strong {
  color: #0f172a;
  font-size: 18px;
}

.ecom-image-gallery-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.ecom-image-gallery-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ecom-image-gallery-single {
  min-height: 0;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.ecom-image-gallery-nav {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(251, 146, 60, 0.25);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #c2410c;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
}

.ecom-image-gallery-stage {
  min-height: 0;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 14px;
  padding: 12px;
}

.ecom-image-gallery-stage img {
  display: block;
  max-width: min(100%, 1320px);
  max-height: 70vh;
  border-radius: 22px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.ecom-image-gallery-caption {
  width: min(100%, 980px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #e5e7eb;
}

.ecom-image-gallery-caption strong,
.ecom-image-gallery-caption span {
  color: #0f172a;
  font-size: 13px;
}

.ecom-image-gallery-caption span {
  color: #64748b;
}

.ecom-image-gallery-thumb-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  gap: 10px;
  padding: 0 18px 18px;
  overflow: auto;
}

.ecom-image-gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 16px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.ecom-image-gallery-thumb.active {
  border-color: #fb923c;
  box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.16);
}

.ecom-image-gallery-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.ecom-image-gallery-grid {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  padding: 18px;
}

.ecom-image-gallery-grid-item {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.ecom-image-gallery-grid-item img {
  display: block;
  width: 100%;
  height: 300px;
  object-fit: cover;
  border-radius: 14px;
}

.ecom-image-gallery-grid-meta {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.ecom-image-gallery-grid-meta strong {
  color: #0f172a;
  font-size: 14px;
}

.ecom-image-gallery-grid-meta span {
  color: #64748b;
  font-size: 12px;
}

.ecom-image-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 6, 23, 0.68);
  backdrop-filter: blur(8px);
}

.ecom-image-dialog {
  width: min(760px, 94vw);
  max-height: 92vh;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 28px 90px rgba(2, 6, 23, 0.36);
}

.ecom-image-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.ecom-image-dialog-head strong,
.ecom-image-dialog-head span {
  display: block;
}

.ecom-image-dialog-head strong {
  color: #0f172a;
  font-size: 16px;
}

.ecom-image-dialog-head span {
  margin-top: 4px;
  color: #64748b;
  font-size: 12px;
}

.ecom-image-dialog label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.ecom-image-dialog textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid #dbe3ef;
  border-radius: 14px;
  padding: 11px 12px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.6;
  outline: none;
}

.ecom-image-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.ecom-image-prompt-chip {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #ffedd5;
  color: #c2410c;
  font-size: 12px;
  font-weight: 800;
}

.ecom-image-prompt-box.compact {
  margin-top: 12px;
  max-height: 58vh;
  overflow: auto;
}

.ecom-image-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(8px);
}

.ecom-image-overlay-card {
  width: min(420px, 92vw);
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 28px;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff, #fff7ed);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
  text-align: center;
}

.ecom-image-overlay-card h3 {
  margin: 0;
  color: #111827;
  font-size: 21px;
}

.ecom-image-overlay-card p {
  margin: 0;
  color: #64748b;
  line-height: 1.7;
}

.ecom-image-spinner {
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 5px solid #fed7aa;
  border-top-color: #f97316;
  animation: ecomImageSpin 1s linear infinite;
}

.ecom-image-progress {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: #ffedd5;
}

.ecom-image-progress span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f59e0b, #f97316, #fb7185);
  animation: ecomImageProgress 1.35s ease-in-out infinite;
}

@keyframes ecomImageSpin {
  to { transform: rotate(360deg); }
}

@keyframes ecomImageProgress {
  0% { transform: translateX(-110%); }
  55% { transform: translateX(95%); }
  100% { transform: translateX(240%); }
}

@media (max-width: 1080px) {
  .ecom-image-hero,
  .ecom-image-workspace,
  .ecom-image-grid {
    grid-template-columns: 1fr;
  }

  .ecom-image-viewer-body {
    grid-template-columns: 1fr;
  }

  .ecom-image-gallery-single {
    grid-template-columns: 1fr;
  }

  .ecom-image-gallery-nav {
    display: none;
  }

  .ecom-image-viewer-meta {
    border-left: 0;
    border-top: 1px solid #e5e7eb;
  }

  .ecom-image-history {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .ecom-image-hero {
    padding: 18px;
    border-radius: 18px;
  }

  .ecom-image-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
  }

  .ecom-image-result {
    width: 100%;
    height: auto;
    min-width: 0;
    aspect-ratio: 1;
  }

  .ecom-image-thumbs {
    grid-template-columns: repeat(3, 1fr);
  }

  .ecom-image-gallery-head,
  .ecom-image-viewer-head,
  .ecom-image-dialog-head {
    display: grid;
  }
}
