/* ── Collage Maker ─────────────────────────────────────────── */

.collage-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 100px;
}

.collage-page-header {
  margin-bottom: 24px;
}

.collage-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: #BB5D4C;
  margin: 0 0 4px;
}

.collage-subtitle {
  font-size: 14px;
  color: #7a6855;
  margin: 0;
}

/* ── URL Input ─────────────────────────────────────────────── */

.url-input-section {
  background: #fff;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 28px;
}

.url-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8ddd0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: 'DM Mono', 'Courier New', monospace;
  color: #4a3728;
  background: #fdf9f4;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 14px;
}

.url-textarea:focus {
  outline: none;
  border-color: #BB5D4C;
}

.url-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.extract-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.15s;
}

.extract-btn:hover { background: #99473A; }
.extract-btn:disabled { background: #ccc; cursor: not-allowed; }

.download-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: transparent;
  color: #4a3728;
  border: 1.5px solid #c8b8a2;
  border-radius: 9px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.download-all-btn:hover { border-color: #BB5D4C; background: #fdf3f1; }
.download-all-btn.hidden { display: none; }

.url-hint {
  font-size: 12px;
  color: #a08060;
  margin: 12px 0 0;
}

/* ── Image Grid ───────────────────────────────────────────── */

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* ── Image Card ───────────────────────────────────────────── */

.collage-card {
  background: #fff;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.collage-card.is-loading {
  min-height: 220px;
  align-items: center;
  justify-content: center;
}

/* Loading state */
.card-loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 32px;
  color: #a08060;
  font-size: 13px;
  text-align: center;
}

.card-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e8ddd0;
  border-top-color: #BB5D4C;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.card-url-label {
  font-size: 11px;
  color: #b8a590;
  word-break: break-all;
  max-width: 200px;
}

/* Image area */
.card-image-wrap {
  position: relative;
  background: #f5efe6;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: grab;
}

.card-image-wrap:active { cursor: grabbing; }

.card-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 8px;
  box-sizing: border-box;
  draggable: true;
}

.card-image-wrap.is-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: #a08060;
  font-size: 13px;
}

.card-gen-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e8ddd0;
  border-top-color: #BB5D4C;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Generated badge */
.card-generated-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(187,93,76,0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 20px;
  letter-spacing: 0.04em;
}

/* Card body */
.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #4a3728;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-source {
  font-size: 11px;
  color: #b8a590;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Alternatives strip */
.card-alts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.alt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  background: #f5efe6;
  transition: border-color 0.15s, opacity 0.15s;
}

.alt-thumb:hover { border-color: #BB5D4C; }
.alt-thumb.active { border-color: #BB5D4C; }
.alt-thumb.broken { display: none; }

/* Card action buttons */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid #e8ddd0;
  background: #fff;
  color: #4a3728;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.card-btn:hover { border-color: #BB5D4C; background: #fdf3f1; }
.card-btn:disabled { opacity: 0.45; cursor: not-allowed; }

.card-btn--copy {
  flex: 1;
  justify-content: center;
  background: #f0f4fa;
  border-color: #c8d4e8;
}

.card-btn--copy:hover { background: #dde6f5; border-color: #8fa8d0; }

.card-btn--generate {
  flex: 1;
  justify-content: center;
}

/* Error card */
.card-error {
  padding: 20px 16px;
  text-align: center;
  color: #a08060;
  font-size: 13px;
}

.card-error-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.card-error-msg {
  font-size: 12px;
  color: #c8a888;
  margin-top: 4px;
  word-break: break-word;
}

/* Copy feedback */
.copy-feedback {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: #4a3728;
  color: #fff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 9999;
  pointer-events: none;
  animation: feedbackFade 2s forwards;
}

@keyframes feedbackFade {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px); }
  15%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  75%  { opacity: 1; }
  100% { opacity: 0; }
}

/* Mobile */
@media (max-width: 480px) {
  .image-grid { grid-template-columns: 1fr; }
  .collage-main { padding: 16px 12px 90px; }
}

/* ── Manual URL input (fallback for bot-protected sites) ──── */
.card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: #a08060;
  font-size: 13px;
}

.manual-url-wrap {
  border: 1px dashed #d4c5b0;
  border-radius: 10px;
  padding: 12px;
  background: #fdf9f4;
}

.manual-url-label {
  font-size: 11px;
  color: #a08060;
  margin-bottom: 8px;
  line-height: 1.4;
}

.manual-url-row {
  display: flex;
  gap: 6px;
}

.manual-url-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #e8ddd0;
  border-radius: 7px;
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  color: #4a3728;
  background: #fff;
  transition: border-color 0.15s;
}

.manual-url-input:focus { outline: none; border-color: #BB5D4C; }

.manual-url-btn {
  white-space: nowrap;
  background: #BB5D4C;
  color: #fff;
  border-color: #BB5D4C;
  padding: 7px 12px;
}

.manual-url-btn:hover { background: #99473A; border-color: #99473A; }

/* ── Bookmarklet install section ─────────────────────────── */
.bookmarklet-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #ede5d8;
}

.bookmarklet-section--standalone {
  margin-top: 32px;
  padding: 24px;
  border: 1px solid #ede5d8;
  border-radius: 12px;
  background: #fdf8f2;
  max-width: 520px;
}

.bookmarklet-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #7a6855;
  margin-bottom: 10px;
}

.bookmarklet-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.bookmarklet-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: #4a3728;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: grab;
  white-space: nowrap;
  user-select: none;
  transition: background 0.15s;
}

.bookmarklet-link:hover { background: #2c1a10; }
.bookmarklet-link:active { cursor: grabbing; }

.bookmarklet-instructions {
  font-size: 11px;
  color: #a08060;
  line-height: 1.5;
}

/* ── Collage Requests list (bookmarklet-fed checklist) ─────── */
.cr-section {
  margin-top: 28px;
  max-width: 960px;
}

.cr-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.cr-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cr-upload-btn {
  padding: 5px 12px;
  background: none;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #7a6855;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.cr-upload-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }
.cr-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cr-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: #4a3728;
  margin: 0;
}

.cr-count {
  font-size: 12px;
  font-weight: 600;
  color: #BB5D4C;
}

.cr-subtitle {
  font-size: 12.5px;
  color: #7a6855;
  margin: 0 0 14px;
  line-height: 1.5;
}

.cr-list {
  display: flex;
  flex-direction: column;
}

.cr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid #ede5d8;
}

.cr-row--done { opacity: 0.55; }
.cr-row--done .cr-link { text-decoration: line-through; }

.cr-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #f5efe6;
  border: 1px solid #e8ddd0;
  flex-shrink: 0;
}

.cr-thumb--link {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  text-decoration: none;
  color: #a08060;
}
.cr-thumb--link:hover { color: #BB5D4C; border-color: #BB5D4C; }

.cr-body { flex: 1; min-width: 0; }

.cr-link {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  color: #4a3728;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cr-link:hover { color: #BB5D4C; text-decoration: underline; }

.cr-meta {
  font-size: 11px;
  color: #a08060;
  margin-top: 2px;
}

.cr-caption {
  font-size: 12.5px;
  font-style: italic;
  color: #7a6855;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-caption-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  min-width: 0;
}
.cr-caption-row .cr-caption { margin-top: 0; flex: 1; min-width: 0; }

.cr-caption-toggle-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  font-weight: 500;
  color: #a08060;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}
.cr-caption-toggle-btn:hover { color: #BB5D4C; }

.cr-caption-edit {
  margin-top: 6px;
  max-width: 420px;
}
.cr-caption-edit.hidden { display: none; }

.cr-caption-input {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  color: #4a3728;
  padding: 6px 8px;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  background: #fff;
}
.cr-caption-input:focus { outline: none; border-color: #BB5D4C; }

.cr-caption-edit-actions {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.cr-caption-save-btn {
  padding: 3px 12px;
  background: #4a3728;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.cr-caption-save-btn:hover { background: #2c1a10; }
.cr-caption-save-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.cr-caption-cancel-btn {
  padding: 3px 12px;
  background: none;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  color: #7a6855;
  cursor: pointer;
  font-family: inherit;
}
.cr-caption-cancel-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

.cr-check-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #7a6855;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
}
.cr-check-wrap input { accent-color: #BB5D4C; width: 15px; height: 15px; cursor: pointer; }

.cr-delete {
  background: none;
  border: none;
  color: #c9beb0;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.cr-delete:hover { background: #f3ece2; color: #a8493a; }

.cr-done-divider {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #b3a698;
  margin: 14px 0 4px;
}

.cr-empty {
  font-size: 13px;
  color: #a08060;
  padding: 6px 4px;
}
.cr-empty.hidden { display: none; }

/* ── AI captioning prompt config ─────────────────────────── */
.cr-prompt-section {
  margin-top: 28px;
  max-width: 640px;
}

.cr-prompt-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8ddd0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  font-family: inherit;
  color: #4a3728;
  background: #fdf9f4;
  resize: vertical;
  line-height: 1.6;
  margin-bottom: 10px;
}
.cr-prompt-textarea:focus { outline: none; border-color: #BB5D4C; }

.cr-prompt-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cr-prompt-save-btn {
  padding: 8px 18px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.cr-prompt-save-btn:hover { background: #99473A; }
.cr-prompt-save-btn:disabled { background: #ccc; cursor: not-allowed; }

.cr-prompt-select {
  padding: 8px 10px;
  border: 1px solid #e8ddd0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #4a3728;
  background: #fff;
  flex: 1;
  max-width: 320px;
}

.cr-prompt-active-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4a8f5b;
  background: #eaf5ec;
  padding: 3px 9px;
  border-radius: 12px;
}
.cr-prompt-active-tag.hidden { display: none; }

.cr-prompt-name-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e8ddd0;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: inherit;
  color: #4a3728;
  background: #fff;
  margin: 10px 0;
}
.cr-prompt-name-input:focus { outline: none; border-color: #BB5D4C; }

.cr-prompt-use-btn {
  padding: 8px 18px;
  background: #fff;
  color: #4a3728;
  border: 1.5px solid #c8b8a2;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
}
.cr-prompt-use-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }
.cr-prompt-use-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.cr-prompt-delete-btn {
  padding: 8px 14px;
  background: none;
  color: #b5493a;
  border: none;
  font-size: 12.5px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.cr-prompt-delete-btn.hidden { display: none; }

.cr-style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 4px 0 14px;
}

.cr-style-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cr-style-field span {
  font-size: 11px;
  font-weight: 600;
  color: #7a6855;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cr-style-select {
  padding: 7px 9px;
  border: 1px solid #e8ddd0;
  border-radius: 7px;
  font-size: 12.5px;
  font-family: inherit;
  color: #4a3728;
  background: #fff;
}

.cr-style-color {
  width: 100%;
  height: 34px;
  padding: 2px;
  border: 1px solid #e8ddd0;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}

.cr-style-range {
  width: 100%;
  accent-color: #BB5D4C;
}

.cr-prompt-status {
  font-size: 12px;
  color: #4a8f5b;
}

/* ── Generated image state on each request row ─────────────── */
.cr-gen-status {
  font-size: 11.5px;
  margin-top: 4px;
}
.cr-gen-status--pending { color: #a08060; }
.cr-gen-status--error   { color: #b5493a; }

.cr-download-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 10px;
  background: #4a3728;
  color: #fff;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}
.cr-download-btn:hover { background: #2c1a10; }

.cr-download-original-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 10px;
  background: none;
  color: #7a6855;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.cr-download-original-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

.cr-edit-btn {
  display: inline-block;
  margin-top: 4px;
  margin-left: 6px;
  padding: 4px 10px;
  background: none;
  color: #7a6855;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.cr-edit-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

.cr-download-edited-btn {
  display: inline-block;
  margin-top: 4px;
  margin-left: 6px;
  padding: 4px 10px;
  background: none;
  color: #7a6855;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
}
.cr-download-edited-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }
.cr-download-edited-btn--dim {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.cr-storyify-btn {
  display: inline-block;
  margin-top: 4px;
  margin-left: 6px;
  padding: 4px 10px;
  background: none;
  color: #7a6855;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.cr-storyify-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

/* ── Story-ify prompt settings ──────────────────────────────── */
.storyify-settings {
  margin: 4px 0 14px;
}
.storyify-toggle-btn {
  background: none;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: #7a6855;
  cursor: pointer;
  font-family: inherit;
}
.storyify-toggle-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

.storyify-editor {
  margin-top: 10px;
  padding: 12px;
  background: #f5efe6;
  border: 1px solid #ede5d8;
  border-radius: 8px;
}
.storyify-editor.hidden { display: none; }

.storyify-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  color: #4a3728;
  padding: 8px 10px;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  background: #fff;
}

.storyify-hint {
  font-size: 11px;
  color: #a08060;
  margin: 6px 0 0;
}
.storyify-hint code {
  background: #ede5d8;
  padding: 1px 4px;
  border-radius: 3px;
}

.storyify-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.storyify-save-btn {
  padding: 5px 14px;
  background: #4a3728;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.storyify-save-btn:hover { background: #2c1a10; }

.storyify-reset-btn {
  padding: 5px 14px;
  background: none;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: #7a6855;
  cursor: pointer;
}
.storyify-reset-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

.cr-regen-btn {
  display: inline-block;
  margin-top: 4px;
  margin-left: 6px;
  padding: 4px 10px;
  background: none;
  color: #7a6855;
  border: 1px solid #d6c9bb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}
.cr-regen-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }
.cr-regen-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Delete-undo toast ───────────────────────────────────── */
.cr-undo-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(20px);
  display: flex;
  align-items: center;
  gap: 14px;
  background: #2c1a10;
  color: #fff;
  padding: 12px 16px 12px 18px;
  border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  z-index: 5000;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100vw - 32px);
}
.cr-undo-toast.cr-undo-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.cr-undo-toast-msg {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-undo-toast-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.5);
  color: #fff;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}
.cr-undo-toast-btn:hover { background: rgba(255,255,255,0.15); }


/* ══════════════════════════════════════════════════════════════════════════
   OUTFIT BREAKDOWN SECTION
   ══════════════════════════════════════════════════════════════════════════ */

.outfit-section {
  margin-top: 36px;
  background: #fff;
  border: 1px solid #e8ddd0;
  border-radius: 16px;
  padding: 24px 20px 28px;
}

.outfit-header { margin-bottom: 20px; }
.outfit-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-weight: 600;
  color: #BB5D4C;
  margin: 0 0 4px;
}
.outfit-subtitle {
  font-size: 13px;
  color: #7a6855;
  margin: 0;
  line-height: 1.5;
}

.outfit-upload-area { margin-bottom: 16px; }
.outfit-drop-zone {
  border: 2px dashed #d6c9bb;
  border-radius: 12px;
  padding: 36px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: #fdf9f4;
}
.outfit-drop-zone:hover,
.outfit-drop-zone.drag-over { border-color: #BB5D4C; background: #fff5f2; }
.outfit-drop-label { font-size: 15px; color: #4a3728; font-weight: 500; }
.outfit-drop-sub   { font-size: 12px; color: #a08060; }

.outfit-preview-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.outfit-source-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.outfit-source-img {
  width: 140px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid #e8ddd0;
  display: block;
}
.outfit-change-btn {
  font-size: 12px;
  color: #a08060;
  background: none;
  border: 1px solid #e8ddd0;
  border-radius: 7px;
  padding: 5px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.12s, border-color 0.12s;
}
.outfit-change-btn:hover { color: #BB5D4C; border-color: #BB5D4C; }

.outfit-analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: center;
}
.outfit-analyze-btn:hover    { background: #99473A; }
.outfit-analyze-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.outfit-progress { margin: 16px 0; }
.outfit-progress-bar {
  height: 6px;
  background: #f0e9de;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.outfit-progress-fill {
  height: 100%;
  background: #BB5D4C;
  border-radius: 3px;
  width: 0%;
  transition: width 0.4s ease;
}
.outfit-progress-label { font-size: 13px; color: #7a6855; }

.outfit-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.outfit-item-card {
  background: #fdf9f4;
  border: 1px solid #e8ddd0;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.outfit-item-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}
.outfit-item-label {
  font-size: 10px;
  color: #7a6855;
  padding: 5px 6px;
  text-align: center;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-canvas-section { margin-top: 20px; }
.outfit-canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}
.outfit-canvas-title { font-size: 15px; font-weight: 600; color: #4a3728; }
.outfit-canvas-actions { display: flex; gap: 8px; }
.outfit-canvas-btn {
  padding: 8px 14px;
  background: #f5efe6;
  border: 1px solid #e8ddd0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: #4a3728;
  cursor: pointer;
  transition: background 0.12s;
}
.outfit-canvas-btn:hover { background: #ede5d8; }
.outfit-canvas-btn--primary {
  background: #BB5D4C;
  color: #fff;
  border-color: #BB5D4C;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.outfit-canvas-btn--primary:hover { background: #99473A; }

.outfit-canvas-hint { font-size: 12px; color: #a08060; margin-bottom: 10px; }
.outfit-canvas-wrap {
  width: 100%;
  background: #f5f0eb;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e8ddd0;
  line-height: 0;
}
#outfitCanvas {
  display: block;
  width: 100%;
  cursor: grab;
  touch-action: none;
}
#outfitCanvas:active { cursor: grabbing; }

@media (max-width: 600px) {
  .outfit-preview-row { flex-direction: column; }
  .outfit-analyze-btn { width: 100%; justify-content: center; }
  .outfit-canvas-header { flex-direction: column; align-items: flex-start; }
  .outfit-canvas-actions { width: 100%; }
  .outfit-canvas-btn { flex: 1; text-align: center; justify-content: center; }
}
