.sales-prompt-panel {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.sales-prompt-panel h3 {
  margin: 0 0 6px;
  color: #1f2a44;
  font-size: 18px;
}

.sales-prompt-panel .row {
  margin-top: 12px;
}

.sales-prompt-panel textarea {
  min-height: 76px;
}

.sales-text-panel {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #cbdaf0;
  border-radius: 14px;
  background: #ffffffcc;
}

.final-prompt-panel {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #d9e4f5;
  border-radius: 16px;
  background: #f8fbff;
}

.final-prompt-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.final-prompt-head strong {
  color: #1f2a44;
}

#final-prompt-preview {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: #ffffff;
}

.final-prompt-head button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #1f65d6;
  border-radius: 999px;
  background: #ffffff;
  color: #1f65d6;
  font-weight: 800;
  cursor: pointer;
}

.final-prompt-head button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

@media (max-width: 720px) {
  .final-prompt-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.history-tools {
  display: flex;
  align-items: end;
  gap: 10px;
  margin: 8px 0 8px;
}

.history-tools label {
  margin: 0;
  min-width: 180px;
}

.history-tools button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #c9d8ee;
  border-radius: 999px;
  background: #ffffff;
  color: #1f65d6;
  font-weight: 800;
  cursor: pointer;
}

.history-record-details {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #dce6f4;
  border-radius: 14px;
  background: #f8fbff;
}

.history-source {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.history-source strong {
  color: #1f2a44;
}

.history-source-preview {
  padding: 0;
  border: 1px solid #d4dfef;
  border-radius: 10px;
  background: #ffffff;
  cursor: pointer;
  overflow: hidden;
}

.history-source-preview img {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: contain;
  background: #eef3fb;
}

.history-source span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #53627a;
  font-size: 12px;
}

.muted-source {
  color: #7b8798;
}

.history-prompt summary {
  cursor: pointer;
  color: #1f65d6;
  font-weight: 800;
}

.history-prompt textarea {
  margin-top: 8px;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  background: #ffffff;
}

.history-prompt label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: #17233a;
  font-weight: 800;
}

@media (max-width: 760px) {
  .history-tools,
  .history-record-details {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }
}

/* Image type picker */
.image-type-picker {
  display: block;
  margin: 10px 0 0;
}

.image-type-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.image-type-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr)) minmax(58px, 72px);
  gap: 6px;
}

.image-type-option {
  position: relative;
  display: flex;
  min-height: 38px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 7px 22px 7px 8px;
  border: 1px solid #c6d3e6;
  border-radius: 10px;
  background: #fff;
  color: #1c2a3f;
  cursor: pointer;
  text-align: left;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease, transform .16s ease;
}

.image-type-select-all {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #2467d8;
  border-radius: 10px;
  background: #f7fbff;
  color: #0f4fc5;
  cursor: pointer;
  font-weight: 700;
}

.image-type-select-all:hover {
  background: #eef5ff;
  box-shadow: 0 6px 16px rgba(36, 103, 216, .1);
}

.image-type-option strong {
  padding-right: 0;
  font-size: 13px;
  line-height: 1.25;
}

.image-type-option span {
  color: #62718a;
  font-size: 11px;
  line-height: 1.25;
}

.image-type-option::before {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  border: 2px solid #b9c7dc;
  border-radius: 999px;
  background: #fff;
}

.image-type-option.active {
  border-color: #2467d8;
  background: #eef5ff;
  box-shadow: 0 6px 16px rgba(36, 103, 216, .1);
}

.image-type-option.active::before {
  border-color: #2467d8;
  background: radial-gradient(circle at center, #2467d8 0 42%, #fff 46% 100%);
}

.image-type-option:hover:not(:disabled) {
  border-color: #2467d8;
  transform: none;
}

.image-type-option.viewing {
  border-color: #0f4fc5;
  box-shadow: 0 0 0 2px rgba(36, 103, 216, .18);
}

.image-type-option:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 20;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 8px);
  padding: 10px 12px;
  border-radius: 12px;
  background: #142033;
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 14px 34px rgba(20, 32, 51, .22);
  pointer-events: none;
}

.image-type-option:disabled,
.image-type-option[hidden],
.image-type-select-all[hidden] {
  display: none;
}

.packaging-only {
  opacity: .78;
}

.image-type-review-panel {
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #d6e2f2;
  border-radius: 12px;
  background: #f8fbff;
}

.image-type-review-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.image-type-review-head h3 {
  margin: 0;
  font-size: 16px;
}

.image-type-review-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.image-type-review-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d8e2f0;
  border-radius: 8px;
  background: #fff;
}

.image-type-review-card.active {
  border-color: #2467d8;
  box-shadow: 0 8px 18px rgba(36, 103, 216, .1);
}

.image-type-review-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.image-type-review-card-head > div {
  display: grid;
  gap: 3px;
}

.image-type-review-card-head span {
  color: #64748b;
  font-size: 12px;
}

.image-type-active-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.12fr) minmax(360px, .96fr) minmax(310px, .72fr);
  gap: 10px;
  align-items: stretch;
}

.image-type-module-fields {
  border: 1px dashed #d3deee;
  border-radius: 8px;
  padding: 8px;
  background: #fbfdff;
}

.image-type-module-fields summary {
  cursor: pointer;
  color: #1f5fc8;
  font-weight: 700;
}

.image-type-module-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  margin-top: 6px;
}

.image-type-review-card label {
  margin: 0;
}

.image-type-review-card input {
  font-size: 12px;
  min-height: 30px;
  padding: 6px 8px;
}

.image-type-review-card textarea {
  min-height: 58px;
  font-size: 12px;
  line-height: 1.5;
  padding: 7px 8px;
}

.image-type-description-fields {
  display: grid;
  gap: 8px;
}

.image-type-description-fields textarea {
  min-height: 82px;
}

.image-type-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.image-type-card-actions button {
  padding: 7px 10px;
  border-radius: 6px;
}

.summarize-description-btn {
  width: 100%;
  min-height: 30px;
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #eef5ff;
  color: #1f5fc8;
}

.image-type-active-settings {
  display: grid;
  gap: 8px;
  min-width: 0;
  border: 1px dashed #d3deee;
  border-radius: 8px;
  background: #fbfdff;
  padding: 8px;
}

.image-type-active-settings-title {
  color: #1f5fc8;
  font-weight: 800;
  line-height: 1.35;
}

.image-type-active-settings-body {
  display: grid;
  gap: 8px;
}

.image-type-active-settings .row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.image-type-active-settings label {
  margin: 0;
}

.image-type-active-settings .field-note {
  display: none;
}

.image-type-active-settings input,
.image-type-active-settings select {
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
}

.text-image-mode-field {
  display: grid;
  gap: 4px;
}

.text-image-mode-toggle {
  min-height: 32px;
  width: 100%;
  border: 1px solid #1f65d6;
  border-radius: 8px;
  background: #1f65d6;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.text-image-mode-toggle.is-text-mode {
  background: #0f766e;
  border-color: #0f766e;
}

.image-type-active-settings .advanced-settings {
  margin: 0;
  border-radius: 8px;
  background: #ffffff;
}

.image-type-active-settings .advanced-settings summary {
  padding: 8px 10px;
}

.image-type-active-settings .advanced-settings label {
  padding: 0 10px 10px;
}

.image-type-active-settings .advanced-settings textarea {
  min-height: 70px;
  font-size: 12px;
}

.summarize-description-btn:hover,
.summarize-description-btn:focus-visible {
  background: #dbeafe;
}

@media (max-width: 1320px) {
  .image-type-review-grid,
  .image-type-active-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .image-type-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .image-type-review-grid,
  .image-type-active-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .image-type-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .image-type-options {
    grid-template-columns: 1fr;
  }

  .image-type-review-grid {
    grid-template-columns: 1fr;
  }

  .image-type-module-field-grid {
    grid-template-columns: 1fr;
  }
}

.sales-text-panel input:disabled {
  background: #eef2f7;
  color: #8a96a8;
  cursor: not-allowed;
}

