/* =============================================
   CAPTIONS PAGE STYLES
   ============================================= */

.captions-dashboard {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px 16px 100px;
}

/* ---- Prompt Section ---- */
.prompt-section {
  background: #fffdf9;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}

.prompt-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #7a6855;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.prompt-textarea {
  width: 100%;
  min-height: 90px;
  padding: 10px 12px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.prompt-textarea:focus {
  outline: none;
  border-color: #7a6855;
  box-shadow: 0 0 0 2px rgba(122,104,85,0.12);
}
.prompt-textarea::placeholder {
  color: #b5a090;
}

/* Saved prompts row (label + clear) */
.saved-prompts-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.saved-prompts-label {
  font-size: 12px;
  color: #a08060;
  white-space: nowrap;
  font-weight: 500;
}

.saved-prompts-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.saved-prompts-scroll::-webkit-scrollbar { height: 3px; }
.saved-prompts-scroll::-webkit-scrollbar-thumb { background: #d4c5b0; border-radius: 2px; }

.saved-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 5px 10px 5px 12px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.saved-prompt-chip:hover {
  background: #e2d8cb;
}
.saved-prompt-chip .chip-del {
  background: none;
  border: none;
  color: #a08060;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0 0 0 2px;
  display: flex;
  align-items: center;
}
.saved-prompt-chip .chip-del:hover { color: #c0392b; }

.no-saved-prompts {
  font-size: 12px;
  color: #b5a090;
  font-style: italic;
}

/* Save prompt row */
.save-prompt-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.save-prompt-input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  color: #4a3728;
  font-family: inherit;
  min-width: 0;
}
.save-prompt-input:focus {
  outline: none;
  border-color: #7a6855;
}
.save-prompt-input::placeholder { color: #b5a090; }

.save-prompt-btn {
  padding: 8px 14px;
  background: #7a6855;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.save-prompt-btn:hover { background: #5d4f3e; }
.save-prompt-btn:disabled { background: #ccc; cursor: not-allowed; }

/* ---- Upload + Generate Row ---- */
.upload-generate-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.upload-photos-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 10px;
  font-size: 14px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.upload-photos-btn:hover { background: #e2d8cb; }

.generate-all-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}
.generate-all-btn:hover:not(:disabled) { background: #99473A; }
.generate-all-btn:disabled { background: #ccc; cursor: not-allowed; }

.generate-all-btn .btn-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: capSpin 0.7s linear infinite;
  display: none;
}
.generate-all-btn.loading .btn-spinner { display: inline-block; }
.generate-all-btn.loading .btn-label { opacity: 0.8; }

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

/* ---- Photo + Caption Pairs ---- */
.photo-caption-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.photo-caption-pair {
  background: #fffdf9;
  border: 1px solid #e8ddd0;
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

/* Left column: label row + image */
.pair-photo-col {
  width: 140px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #f5efe6;
}

.pair-photo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
  background: #ede7de;
  border-bottom: 1px solid #e0d5c8;
}

.pair-photo-wrap {
  flex: 1;
  display: flex;
  align-items: flex-start;
}
.pair-photo-wrap img {
  width: 140px;
  height: auto;
  object-fit: contain;
  object-position: top center;
  display: block;
}

.pair-photo-num {
  font-size: 11px;
  font-weight: 600;
  color: #7a5c4a;
  letter-spacing: 0.04em;
}

.pair-remove-btn {
  background: none;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a7060;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.pair-remove-btn:hover { color: #c03030; }

.pair-caption-body {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.pair-caption-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.pair-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  font-weight: 500;
}
.pair-copy-btn:hover { background: #e2d8cb; }
.pair-copy-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pair-regen-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f0ebe4;
  border: 1px solid #d8cec4;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #7a5c4a;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.pair-regen-btn:hover { background: #e2d8cb; }
.pair-regen-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.pair-caption-text {
  width: 100%;
  min-height: 60px;
  padding: 10px 12px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.55;
  resize: none;
  overflow: hidden;
  box-sizing: border-box;
}
.pair-caption-text:focus {
  outline: none;
  border-color: #7a6855;
  box-shadow: 0 0 0 2px rgba(122,104,85,0.12);
}
.pair-caption-text::placeholder { color: #b5a090; font-style: italic; }

/* Generating state shimmer */
.pair-caption-text.generating {
  background: linear-gradient(90deg, #f5efe6 25%, #fffdf9 50%, #f5efe6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  color: transparent;
  pointer-events: none;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty / no photos state */
.captions-no-photos {
  text-align: center;
  padding: 40px 20px;
  color: #b0998a;
  font-size: 14px;
  border: 2px dashed #e2d8cb;
  border-radius: 12px;
}

/* =============================================
   HOOK ENGINE
   ============================================= */

.hook-engine-section {
  background: #f5efe6;
  border: 1px solid #62594d;
  border-radius: 16px;
  padding: 24px 20px 28px;
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

/* Subtle warm texture overlay */
.hook-engine-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 0%, rgba(187,93,76,0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 10% 100%, rgba(160,128,96,0.06) 0%, transparent 50%);
  pointer-events: none;
}

.hook-engine-header {
  margin-bottom: 20px;
  position: relative;
}

.hook-engine-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #BB5D4C;
  margin-bottom: 5px;
}

.hook-engine-title {
  font-size: 22px;
  font-weight: 700;
  color: #BB5D4C;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.hook-engine-subtitle {
  font-size: 13px;
  color: #7a6855;
  line-height: 1.5;
}

/* ---- Inputs ---- */
.hook-engine-inputs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}

.hook-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hook-input-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a08060;
}

.hook-input-optional {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: #a08060;
  font-style: italic;
}

.hook-input {
  width: 100%;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid #d4c5b0;
  border-radius: 9px;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s;
}
.hook-input:focus {
  outline: none;
  border-color: #BB5D4C;
  box-shadow: 0 0 0 2px rgba(187,93,76,0.1);
}
.hook-input::placeholder {
  color: #c0a898;
}

/* ---- Slider ---- */
.hook-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}

.hook-slider-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7a6450;
  white-space: nowrap;
  flex-shrink: 0;
}

.hook-slider-track-wrap {
  flex: 1;
  display: flex;
  align-items: center;
}

.hook-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, #BB5D4C 0%, #BB5D4C calc(var(--pct, 33.33%) ), #3d2a1e calc(var(--pct, 33.33%)));
  outline: none;
  cursor: pointer;
}
.hook-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #f5ede3;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}
.hook-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  background: #d96a56;
}
.hook-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #f5ede3;
  cursor: pointer;
}

.hook-count-badge {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #BB5D4C;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  flex-shrink: 0;
  transition: transform 0.1s;
}

/* ---- Generate Button ---- */
.hook-generate-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 11px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
  position: relative;
}
.hook-generate-btn:hover:not(:disabled) {
  background: #99473A;
  transform: translateY(-1px);
}
.hook-generate-btn:active:not(:disabled) {
  transform: translateY(0);
}
.hook-generate-btn:disabled {
  background: #d4c5b0;
  color: #a08060;
  cursor: not-allowed;
}

.hook-btn-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: capSpin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}
.hook-generate-btn.loading .hook-btn-spinner { display: block; }
.hook-generate-btn.loading .hook-btn-label { opacity: 0.75; }
.hook-output-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.hook-card {
  background: #fff;
  border: 1px solid #e2d5c5;
  border-radius: 12px;
  padding: 14px 16px;
  animation: hookFadeIn 0.3s ease both;
}

@keyframes hookFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hook-card-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b5a090;
  margin-bottom: 8px;
}

.hook-card-line1 {
  font-size: 15px;
  font-weight: 600;
  color: #2c1f17;
  line-height: 1.4;
  margin-bottom: 4px;
}

.hook-card-line2 {
  font-size: 14px;
  color: #7a6855;
  line-height: 1.45;
  margin-bottom: 12px;
}

.hook-card-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.hook-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.hook-copy-btn:hover {
  background: #e2d8cb;
}
.hook-copy-btn.copied {
  background: rgba(80,160,100,0.12);
  border-color: rgba(80,160,100,0.35);
  color: #3a8a55;
}

.hook-task-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 13px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.hook-task-btn:hover {
  background: #e2d8cb;
}
.hook-task-btn.added {
  background: rgba(80,160,100,0.12);
  border-color: rgba(80,160,100,0.35);
  color: #3a8a55;
}

/* Skeleton loader cards */
.hook-card-skeleton {
  background: #f0e9de;
  border: 1px solid #e2d5c5;
  border-radius: 12px;
  padding: 14px 16px;
}
.hook-skeleton-line {
  height: 13px;
  border-radius: 6px;
  background: linear-gradient(90deg, #ede5d8 25%, #f5ede3 50%, #ede5d8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite;
  margin-bottom: 8px;
}
.hook-skeleton-line.short { width: 65%; }
.hook-skeleton-line.medium { width: 85%; }
.hook-skeleton-line.tiny { width: 40%; margin-bottom: 0; }

/* ---- Section Divider ---- */
.captions-section-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 20px;
  color: #a08060;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.captions-section-divider::before,
.captions-section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8ddd0;
}

/* Mobile tweaks */
@media (max-width: 480px) {
  .upload-generate-row { flex-direction: column; }
  .upload-photos-btn, .generate-all-btn { width: 100%; }
  .pair-photo-col { width: 110px; }
  .pair-photo-wrap img { width: 110px; }
}

/* =============================================
   STORY MAKER
   ============================================= */

.story-maker-section {
  background: #f5efe6;
  border: 1px solid #62594d;
  border-radius: 16px;
  padding: 22px 20px 26px;
  margin-bottom: 12px;
}

.story-maker-header {
  margin-bottom: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.story-maker-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: #7a6855;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.story-maker-nav-btn:hover { background: #5d4c3c; }

.story-maker-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #BB5D4C;
  margin-bottom: 4px;
}

.story-maker-title {
  font-size: 22px;
  font-weight: 700;
  color: #BB5D4C;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.story-maker-subtitle {
  font-size: 13px;
  color: #7a6855;
  line-height: 1.5;
}

.story-upload-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.story-upload-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #fff;
  border: 1px solid #d4c5b0;
  border-radius: 10px;
  font-size: 14px;
  color: #4a3728;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.story-upload-btn:hover { background: #ede5d8; }
.story-upload-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.story-gen-all-btn {
  flex: 1;
  min-width: 130px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 16px;
  background: #BB5D4C;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.story-gen-all-btn:hover:not(:disabled) { background: #99473A; }
.story-gen-all-btn:disabled { background: #c9b8aa; cursor: not-allowed; }

.story-gen-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: capSpin 0.7s linear infinite;
  display: none;
  flex-shrink: 0;
}
.story-gen-all-btn.loading .story-gen-spinner { display: inline-block; }

.story-empty-state {
  text-align: center;
  padding: 36px 20px;
  color: #b0998a;
  font-size: 14px;
  border: 2px dashed #d4c5b0;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.story-card-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.story-card {
  background: #fff;
  border: 1px solid #e2d5c5;
  border-radius: 14px;
  /* Was overflow:hidden -- switched to visible so the sticky canvas below
     is allowed to detach from the card's own box and pin itself against
     the viewport while the controls scroll underneath it. Corner clipping
     is now handled per-element (canvas-wrap rounds its own top corners,
     controls rounds its own bottom corners) instead of by the card. */
  overflow: visible;
  animation: hookFadeIn 0.25s ease both;
}

.story-canvas-wrap {
  width: 100%;
  background: #1a1410;
  line-height: 0;
  /* Sticks to just below the site header while you scroll through the
     controls beneath it, so you're never scrolling blind -- the edited
     photo stays in view the whole time you're adjusting it. Releases
     naturally once the rest of the card scrolls past. */
  position: sticky;
  top: var(--vv-sticky-top, 64px);
  z-index: 20;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  cursor: pointer;
}

.story-canvas {
  width: 100%;
  height: auto;
  display: block;
  max-height: 520px;
  object-fit: contain;
  /* Drag/pinch on the canvas itself now repositions the photo or text
     (build 426) -- without this the browser intercepts the gesture as
     page scroll/native pinch-zoom before our handlers see it. */
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}
.story-canvas:active { cursor: grabbing; }

.story-controls {
  padding: 14px 16px 16px;
  background: #fff;
  border-radius: 0 0 14px 14px;
}

.story-text-inputs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}

.story-line1-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fdfaf6;
  color: #2c1f17;
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.55;
  resize: none;
  box-sizing: border-box;
  transition: border-color 0.2s;
  min-height: 80px;
}
.story-line1-input:focus {
  outline: none;
  border-color: #BB5D4C;
  box-shadow: 0 0 0 2px rgba(187,93,76,0.1);
}
.story-line1-input::placeholder { color: #c0a898; font-weight: 400; }

.story-style-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.story-style-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.story-style-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a08060;
  white-space: nowrap;
}

.story-position-select {
  padding: 7px 10px;
  border: 1px solid #d4c5b0;
  border-radius: 7px;
  background: #fdfaf6;
  color: #4a3728;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.story-position-select:focus { outline: none; border-color: #BB5D4C; }

.story-color-swatches {
  display: flex;
  gap: 6px;
  align-items: center;
}

.story-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.12s, border-color 0.12s;
  flex-shrink: 0;
}
.story-swatch:hover { transform: scale(1.15); }
.story-swatch.active {
  border-color: #BB5D4C;
  box-shadow: 0 0 0 2px rgba(187,93,76,0.25);
  transform: scale(1.1);
}

.story-scrim-group { flex: 1; min-width: 80px; }

.story-scrim-val {
  font-weight: 400;
  color: #BB5D4C;
  font-style: normal;
  text-transform: none;
  letter-spacing: 0;
}

.story-scrim-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #d4c5b0;
  outline: none;
  cursor: pointer;
}
.story-scrim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
.story-scrim-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  cursor: pointer;
}

.story-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.story-export-btn,
.story-to-carousel-btn,
.story-to-stories-btn,
.story-to-tickets-btn,
.story-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  white-space: nowrap;
  border: none;
  color: #fff;
  flex: 1;
}
/* Distinct soft neutral colors per button -- these used to share one flat
   background and were hard to tell apart at a glance in a five(ish)-wide row. */
.story-export-btn      { background: #94997c; }
.story-to-carousel-btn { background: #b98b76; }
.story-to-stories-btn  { background: #7d95a0; }
.story-to-tickets-btn  { background: #c2a06a; }
.story-remove-btn      { background: #c17b6f; }
.story-export-btn:hover:not(:disabled)      { background: #7e8368; }
.story-to-carousel-btn:hover:not(:disabled) { background: #a2735e; }
.story-to-stories-btn:hover:not(:disabled)  { background: #66808c; }
.story-to-tickets-btn:hover:not(:disabled)  { background: #ab8952; }
.story-remove-btn:hover:not(:disabled)      { background: #a8645a; }
.story-export-btn:disabled,
.story-to-carousel-btn:disabled,
.story-to-stories-btn:disabled,
.story-to-tickets-btn:disabled,
.story-remove-btn:disabled { opacity: 0.6; cursor: not-allowed; }

@media (max-width: 480px) {
  .story-upload-row { flex-direction: column; }
  .story-upload-btn, .story-gen-all-btn { width: 100%; }
  /* Shorter on small screens so the sticky canvas doesn't eat the whole
     viewport and leave no room to see the controls scrolling beneath it. */
  .story-canvas { max-height: 300px; }
}

/* ---- Frame (aspect ratio) row ---- */
.story-frame-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  background: #faf6f0;
  border: 1px solid #e8dcc9;
  border-radius: 8px;
}

.story-frame-checks {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.story-frame-check-opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: #4a3728;
  cursor: pointer;
  white-space: nowrap;
}

.story-frame-check-opt input {
  accent-color: #BB5D4C;
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.story-margincolor-group input[type="color"] {
  width: 32px;
  height: 26px;
  padding: 2px;
  border: 1px solid #d4c5b0;
  border-radius: 6px;
  background: #fdfaf6;
  cursor: pointer;
}

/* Caption under the canvas explaining the drag/pinch gestures -- replaces
   the old separate "Crop" mode, which now lives directly on the canvas. */
.story-canvas-hint {
  font-size: 11px;
  color: #a08060;
  text-align: center;
  padding: 6px 10px 0;
}

/* ---- Photo Zoom slider (was the crop overlay's zoom control) ---- */
.story-imgzoom-group {
  min-width: 140px;
  flex: 1;
}
.story-imgzoom-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: #d4c5b0;
  outline: none;
  cursor: pointer;
}
.story-imgzoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
.story-imgzoom-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  cursor: pointer;
}

.story-drag-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #a08060;
  margin-bottom: 12px;
  font-style: italic;
}

/* Snap buttons */
.story-snap-btns {
  display: flex;
  gap: 4px;
}

.story-snap-btn {
  padding: 5px 9px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #7a6855;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.story-snap-btn:hover {
  background: #BB5D4C;
  border-color: #BB5D4C;
  color: #fff;
}

/* Font size slider group */
.story-fontsize-group { flex: 1; min-width: 80px; }

.story-fontsize-val {
  font-weight: 400;
  color: #BB5D4C;
  text-transform: none;
  letter-spacing: 0;
}

.story-fontsize-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #d4c5b0;
  outline: none;
  cursor: pointer;
}
.story-fontsize-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
.story-fontsize-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  cursor: pointer;
}

/* Text box row */
.story-box-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #fdfaf6;
  border: 1px solid #e8ddd0;
  border-radius: 9px;
}

.story-box-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.story-box-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

/* Pill toggle */
.story-box-toggle-ui {
  display: inline-block;
  width: 36px;
  height: 20px;
  background: #d4c5b0;
  border-radius: 10px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.story-box-toggle-ui::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.story-box-label input:checked + .story-box-toggle-ui {
  background: #BB5D4C;
}
.story-box-label input:checked + .story-box-toggle-ui::after {
  transform: translateX(16px);
}

.story-box-label-text {
  font-size: 13px;
  font-weight: 500;
  color: #4a3728;
}

/* Color picker */
.story-box-color {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 28px;
  padding: 2px;
  border: 1px solid #d4c5b0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}
.story-box-color::-webkit-color-swatch-wrapper { padding: 0; }
.story-box-color::-webkit-color-swatch { border: none; border-radius: 4px; }

/* ---- Story Maker: color picker, width slider, font select ---- */

/* Text color picker (full-width color swatch) */
.story-text-color-picker {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 30px;
  padding: 2px;
  border: 1px solid #d4c5b0;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.story-text-color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.story-text-color-picker::-webkit-color-swatch { border: none; border-radius: 4px; }

/* Text width slider */
.story-textwidth-group { flex: 1; min-width: 80px; }

.story-textwidth-val {
  font-weight: 400;
  color: #BB5D4C;
  text-transform: none;
  letter-spacing: 0;
}

.story-textwidth-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: #d4c5b0;
  outline: none;
  cursor: pointer;
}
.story-textwidth-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  cursor: pointer;
}
.story-textwidth-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #BB5D4C;
  border: 2px solid #fff;
  cursor: pointer;
}

/* Font select */
.story-font-group { flex: 1; min-width: 120px; }

.story-font-select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #d4c5b0;
  border-radius: 7px;
  background: #fdfaf6;
  color: #4a3728;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.story-font-select:focus { outline: none; border-color: #BB5D4C; }

.story-font-default-btn {
  margin-top: 5px;
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #d4c5b0;
  border-radius: 7px;
  background: none;
  color: #8a6f56;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}
.story-font-default-btn:hover { border-color: #BB5D4C; color: #BB5D4C; }

/* ---- Clear prompt button ---- */
.clear-prompt-btn {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  background: #f0e9de;
  border: 1px solid #d4c5b0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #7a6855;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.clear-prompt-btn:hover {
  background: #e2d8cb;
  color: #4a3728;
}

/* ---- Upload select row (above prompt) ---- */
.upload-select-row {
  margin-bottom: 14px;
}
.upload-select-row .upload-photos-btn {
  width: 100%;
}

/* ---- Generate row (below prompt) ---- */
.generate-row {
  margin-bottom: 20px;
}
.generate-row .generate-all-btn {
  width: 100%;
}

/* ---- Caption Input Section (mode tabs) ---- */
.caption-input-section {
  margin-bottom: 14px;
}

.caption-mode-tabs {
  display: flex;
  gap: 0;
  background: #f0e9de;
  border: 1.5px solid #a08060;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 10px;
}

.caption-mode-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: #7a6855;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s;
}
.caption-mode-tab:hover {
  background: rgba(255,255,255,0.5);
  color: #4a3728;
}
.caption-mode-tab.active {
  background: #fff;
  color: #4a3728;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10);
}

.caption-mode-panel { }
.caption-mode-panel.hidden { display: none; }

/* Subject text input */
.caption-subject-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #a08060;
  border-radius: 10px;
  background: #fff;
  color: #4a3728;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.caption-subject-input:focus {
  outline: none;
  border-color: #BB5D4C;
  box-shadow: 0 0 0 2px rgba(187,93,76,0.1);
}
.caption-subject-input::placeholder { color: #b5a090; }

/* =============================================
   CAPTION GENERATOR SECTION CARD
   ============================================= */

.caption-gen-section {
  background: #f5efe6;
  border: 1px solid #62594d;
  border-radius: 16px;
  padding: 22px 20px 26px;
  margin-bottom: 12px;
}

.caption-gen-header {
  margin-bottom: 20px;
}

.caption-gen-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #BB5D4C;
  margin-bottom: 4px;
}

.caption-gen-title {
  font-size: 22px;
  font-weight: 700;
  color: #BB5D4C;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.caption-gen-subtitle {
  font-size: 13px;
  color: #7a6855;
  line-height: 1.5;
}

/* Override prompt-section background inside the card so it doesn't double-up */
.caption-gen-section .prompt-section {
  background: #fff;
  border-color: #62594d;
}


/* On very narrow screens, stack back to single column */
@media (max-width: 400px) {
  .prompt-two-col {
    grid-template-columns: 1fr;
  }
}


/* ---- Saved prompts dropdown row ---- */
.saved-prompts-select {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid #d4c5b0;
  border-radius: 8px;
  background: #fff;
  color: #4a3728;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
}
.saved-prompts-select:focus {
  outline: none;
  border-color: #BB5D4C;
}

/* ---- Delete prompt button (emoji trash) ---- */
.saved-prompt-delete-btn {
  background: none;
  border: none;
  padding: 3px 6px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.1s;
}
.saved-prompt-delete-btn:hover {
  background: rgba(192,57,43,0.1);
  transform: scale(1.15);
}

/* ---- Proof Posts chip (Hook Engine header) ---- */
.hook-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.proof-posts-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: rgba(44,31,23,0.12);
  border: 1px solid rgba(44,31,23,0.2);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: #4a3728;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 3px;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.proof-posts-chip:hover {
  background: rgba(187,93,76,0.18);
  border-color: rgba(187,93,76,0.4);
  color: #BB5D4C;
}

.proof-posts-chip.has-calibration {
  background: rgba(187,93,76,0.14);
  border-color: rgba(187,93,76,0.35);
  color: #BB5D4C;
}


/* ── Send to Carousel Planner modal ─────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 4000;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5ded5;
}
.modal-header h3 {
  margin: 0;
  font-size: 16px;
  color: #4a3728;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
  overflow-y: auto;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.form-group label {
  font-size: 12px;
  font-weight: 700;
  color: #7a6855;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  border: 1px solid #e5ded5;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  color: #4a3728;
  background: #faf7f4;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
  box-sizing: border-box;
  width: 100%;
}
.form-input:focus {
  border-color: #7a6855;
  background: #fff;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #e5ded5;
  flex-wrap: wrap;
}

.modal-footer-right {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.cancel-btn {
  background: #f0e9de;
  color: #4a3728;
  border: 1px solid #d4c5b0;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.cancel-btn:hover { background: #e2d8cb; }

.carousel-modal-confirm-btn {
  background: #BB5D4C;
  color: #fff;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.carousel-modal-confirm-btn:hover:not(:disabled) { background: #99473A; }
.carousel-modal-confirm-btn:disabled { background: #ccc; cursor: not-allowed; }

.cm-modal-date-wrap { position: relative; }
/* Native <input type="date"> renders its own locale format (e.g.
   "08/18/2026") that CSS can't reformat directly -- hide that text (color:
   transparent on the input and its -webkit sub-parts, scoped by id so the
   shared .form-input class elsewhere is untouched) and show our own
   "Tue Aug 18 2026" formatted text in a pointer-events:none overlay on top,
   so the native picker/calendar icon still works normally underneath. */
#carouselModalDate {
  color: transparent;
  padding-right: 34px;
}
#carouselModalDate::-webkit-datetime-edit,
#carouselModalDate::-webkit-datetime-edit-fields-wrapper,
#carouselModalDate::-webkit-datetime-edit-text,
#carouselModalDate::-webkit-datetime-edit-month-field,
#carouselModalDate::-webkit-datetime-edit-day-field,
#carouselModalDate::-webkit-datetime-edit-year-field { color: transparent; }
.cm-modal-date-display {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  font-family: inherit;
  font-size: 0.92rem;
  color: #3a2518;
  white-space: nowrap;
}

.carousel-modal-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ticket-modal-side-row {
  display: flex;
  gap: 16px;
}
.ticket-modal-side-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #3a2518;
  cursor: pointer;
}
.ticket-modal-side-opt input[type="radio"] { accent-color: #BB5D4C; }

.carousel-modal-loading {
  font-size: 13px;
  color: #a08060;
  padding: 4px 0;
}

.carousel-modal-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid #e5ded5;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13.5px;
  color: #4a3728;
}
.carousel-modal-option:hover { border-color: #c8b8a2; }
.carousel-modal-option input[type="radio"] { accent-color: #BB5D4C; width: 16px; height: 16px; flex-shrink: 0; }
.carousel-modal-option .cm-option-label { flex: 1; }
.carousel-modal-option .cm-option-meta { font-size: 11.5px; color: #a08060; }

.set-default-btn.is-default { background: #f6e7b8; border-color: #d9bf6a; color: #6b5200; }
.set-default-btn:disabled { cursor: default; }
