/* ============================================
   COMPONENT STYLES
   Reusable UI components: buttons, inputs,
   modals, sheets, credit packs, etc.
   ============================================ */

/* ============================================
   BODY SCROLL LOCK
   Applied when modals/sheets are open
   ============================================ */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  /* height set dynamically via JS for iOS Safari */
}

/* Prevent touch scroll passthrough on iOS */
body.modal-open .sheet-overlay,
body.modal-open .modal-overlay {
  touch-action: none;
  -webkit-overflow-scrolling: auto;
}

/* Hide GDPR consent banner when modals/sheets are open */
body.modal-open #gdpr-banner,
body.modal-open [id*="gdpr"],
body.modal-open [class*="gdpr"],
body.modal-open [class*="consent-banner"] {
  display: none !important;
}

/* ============================================
   BUTTONS - General
   ============================================ */
.btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(139, 124, 246, 0.3), 0 1px 2px rgba(0, 0, 0, 0.06);
}

.btn-primary:active {
  background: var(--primary-hover);
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(139, 124, 246, 0.2);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-dimmed);
}

.btn-secondary:active {
  background: var(--border);
  transform: scale(0.96);
}

/* ============================================
   DRAG & DROP OVERLAY
   Full-viewport overlay when dragging files
   ============================================ */
.drag-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(139, 124, 246, 0.08);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drag-overlay.visible {
  display: flex;
  animation: drag-overlay-in 0.15s ease-out;
}

@keyframes drag-overlay-in {
  from {
    opacity: 0;
    backdrop-filter: blur(0px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(2px);
  }
}

.drag-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 64px;
  background: var(--bg);
  border: 3px dashed var(--primary);
  border-radius: 24px;
  box-shadow:
    0 0 0 8px rgba(139, 124, 246, 0.1),
    0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: drag-content-pulse 1.5s ease-in-out infinite;
}

@keyframes drag-content-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 0 8px rgba(139, 124, 246, 0.1),
      0 25px 50px -12px rgba(0, 0, 0, 0.25);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      0 0 0 12px rgba(139, 124, 246, 0.15),
      0 30px 60px -12px rgba(0, 0, 0, 0.3);
  }
}

.drag-overlay-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glow);
  border-radius: 20px;
  color: var(--primary);
}

.drag-overlay-icon svg {
  width: 40px;
  height: 40px;
}

.drag-overlay-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.drag-overlay-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Hide hint when no photo loaded yet */
body:not(.has-image) .drag-overlay-hint {
  display: none;
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .drag-overlay {
    background: rgba(139, 124, 246, 0.12);
  }

  .drag-overlay-content {
    background: var(--bg-secondary);
    border-color: var(--primary);
  }
}

/* Mobile */
@media (max-width: 768px) {
  .drag-overlay-content {
    padding: 32px 40px;
    margin: 16px;
  }

  .drag-overlay-icon {
    width: 64px;
    height: 64px;
  }

  .drag-overlay-icon svg {
    width: 32px;
    height: 32px;
  }

  .drag-overlay-text {
    font-size: 1.25rem;
  }
}

/* ============================================
   EDIT CARD - Premium unified input
   ============================================ */
.edit-card {
  background: var(--bg);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-md);
  transition: all 0.2s ease;
}

.edit-card:focus-within {
  border-color: var(--primary);
  box-shadow:
    0 0 0 3px rgba(139, 124, 246, 0.12),
    var(--shadow-md);
}

/* Post-upload attention animation - draws user to prompt input */
.edit-card.attention {
  animation: edit-card-attention 1.5s ease-in-out;
}

@keyframes edit-card-attention {
  0% {
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.03);
  }
  25% {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.2), 0 4px 20px rgba(139, 124, 246, 0.15);
    transform: scale(1.01);
  }
  50% {
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(139, 124, 246, 0.15), 0 4px 24px rgba(139, 124, 246, 0.2);
    transform: scale(1.01);
  }
  75% {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.1), 0 4px 16px rgba(139, 124, 246, 0.1);
    transform: scale(1.005);
  }
  100% {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--glow), 0 4px 16px rgba(0, 0, 0, 0.06);
    transform: scale(1);
  }
}

/* ============================================
   PROMPT SUGGESTIONS - Post-upload guidance
   Shows clickable example prompts to help users
   understand what to type
   ============================================ */
.prompt-suggestions {
  display: none;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  animation: prompt-suggestions-appear 0.3s ease-out;
}

.prompt-suggestions.visible {
  display: block;
}

@keyframes prompt-suggestions-appear {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt-suggestions-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.prompt-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  background: rgba(139, 124, 246, 0.08);
  border: 1px solid rgba(139, 124, 246, 0.2);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.prompt-chip:hover {
  background: rgba(139, 124, 246, 0.15);
  border-color: rgba(139, 124, 246, 0.4);
  transform: translateY(-1px);
}

.prompt-chip:active {
  transform: translateY(0);
  background: rgba(139, 124, 246, 0.2);
}

/* Mobile: smaller chips, allow wrapping */
@media (max-width: 480px) {
  .prompt-chip {
    padding: 5px 10px;
    font-size: 12px;
  }

  .prompt-suggestions-list {
    gap: 6px;
  }
}

/* Task prompts guidance — used by suggestions.js for reference-image tasks */
.task-prompts-guidance .guidance-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.task-prompts-guidance .guidance-text {
  line-height: 1.4;
}

/* ============================================
   RESULT TOOLBAR - Compact pill buttons (post-edit)
   ============================================ */
.result-toolbar {
  display: none;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 0 12px;
}

.result-toolbar.visible {
  display: flex;
  animation: result-toolbar-in 0.25s ease-out;
}

@keyframes result-toolbar-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 36px;
  border-radius: var(--radius-pill, 100px);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
}

.result-pill svg {
  flex-shrink: 0;
}

.result-pill-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.result-pill-primary:active {
  transform: scale(0.95);
}

.result-pill-primary:hover {
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
  transform: translateY(-1px);
}

.result-pill-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.result-pill-secondary:active {
  transform: scale(0.95);
  background: var(--bg);
}

.result-pill-secondary:hover {
  background: rgba(139, 124, 246, 0.1);
  border-color: rgba(139, 124, 246, 0.3);
  transform: translateY(-1px);
}

.result-pill:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Mobile: icon-only pills */
@media (max-width: 480px) {
  .result-pill {
    padding: 8px 12px;
  }
}

/* ============================================
   SUGGESTIONS PANEL - Collapsible ideas section
   ============================================ */
.suggestions-panel {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-top: 8px;
}

.suggestions-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.suggestions-toggle:hover {
  color: var(--text);
}

.suggestions-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.suggestions-toggle-icon {
  font-size: 14px;
  line-height: 1;
}

.suggestions-chevron {
  margin-left: auto;
  transition: transform 0.25s ease;
}

.suggestions-panel.expanded .suggestions-chevron {
  transform: rotate(180deg);
}

.suggestions-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
  padding-top: 0;
}

.suggestions-panel.expanded .suggestions-content {
  max-height: 300px;
  opacity: 1;
  padding-top: 8px;
}

/* Chip layout inside suggestions */
.suggestions-content .suggestions-chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Reuse existing suggestion-chip style for all chip types in suggestions panel */
.suggestions-content .suggestion-chip {
  position: static;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: var(--radius-pill, 100px);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.2;
}

.suggestions-content .suggestion-chip:hover {
  background: rgba(139, 124, 246, 0.15);
  border-color: rgba(139, 124, 246, 0.4);
  transform: translateY(-1px);
}

.suggestions-content .suggestion-chip:active {
  transform: scale(0.95);
  background: var(--glow);
  border-color: var(--primary);
}

.suggestions-content .suggestion-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.suggestions-content .suggestion-chip.popular::before {
  content: "\2605";
  font-size: 11px;
  margin-right: 2px;
}

.suggestions-content .suggestions-more {
  appearance: none;
  -webkit-appearance: none;
  padding: 5px 12px;
  border-radius: var(--radius-pill, 100px);
  background: none;
  border: 1px dashed var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  transition: all 0.15s ease;
}

.suggestions-content .suggestions-more:hover {
  color: var(--primary);
  border-color: var(--primary);
  border-style: solid;
}

/* Reference image guidance inside suggestions */
.suggestions-content .task-prompts-guidance {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(139, 124, 246, 0.06);
  border-radius: 10px;
}

.edit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================
   PROMPT INPUT - Clean textarea
   ============================================ */
.prompt-input {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 1rem;
  resize: none;
  min-height: 72px;
  max-height: 160px;
  line-height: 1.55;
  cursor: text;
  transition: background-color 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.prompt-input:hover {
  border-color: rgba(var(--primary-rgb, 139, 124, 246), 0.4);
  background: var(--bg);
}

.prompt-input:focus {
  outline: none;
  background: var(--bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 139, 124, 246), 0.12);
}

.prompt-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.prompt-input:focus::placeholder {
  opacity: 0.4;
}

.prompt-wrapper {
  position: relative;
  width: 100%;
  cursor: text;
}

.prompt-char-count {
  position: absolute;
  right: 12px;
  bottom: 6px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.prompt-char-count.visible {
  opacity: 0.6;
}

.prompt-char-count.warning {
  color: #f59e0b;
  opacity: 1;
}

.prompt-char-count.danger {
  color: #ef4444;
  opacity: 1;
}

/* ============================================
   REFERENCE PHOTO SECTION
   Prominent add/preview for reference images
   ============================================ */
.reference-photo-section {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* Add Reference Button */
.add-reference-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.add-reference-btn:hover {
  background: var(--glow);
  border-color: var(--primary);
  border-style: solid;
}

.add-reference-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 124, 246, 0.08);
  border-radius: 8px;
  color: var(--primary);
}

.add-reference-icon svg {
  width: 16px;
  height: 16px;
}

.add-reference-text {
  flex: 1;
  min-width: 0;
}

.add-reference-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}

.add-reference-hint {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
  line-height: 1.3;
}

.add-reference-plus {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.add-reference-btn:hover .add-reference-plus {
  color: var(--primary);
}

/* Reference Preview (when photo added) */
.reference-preview {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.reference-preview.visible {
  display: block;
}

.reference-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(139, 124, 246, 0.05);
  border-bottom: 1px solid var(--border);
}

.reference-preview-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
}

.reference-remove-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.reference-remove-btn:hover {
  color: var(--error, #EF4444);
  border-color: var(--error, #EF4444);
  background: rgba(239, 68, 68, 0.1);
}

.reference-preview-content {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.reference-preview-content img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  border: 2px solid var(--primary);
  background: var(--bg);
}

.reference-preview-hint {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Hide add button when preview is visible */
.reference-preview.visible ~ .add-reference-btn,
.reference-photo-section:has(.reference-preview.visible) .add-reference-btn {
  display: none;
}

/* When reference is added, also hide the photo strip add button */
body.has-two-photos .add-reference-btn {
  display: none;
}

/* Show reference preview when in two-photo mode */
body.has-two-photos .reference-preview {
  display: block;
}

/* Reference section stays visible in result state for chain editing */

/* Mobile: more compact */
@media (max-width: 768px) {
  .reference-photo-section {
    margin-top: 10px;
    padding-top: 10px;
  }

  .add-reference-btn {
    padding: 8px 12px;
    gap: 8px;
  }

  .add-reference-icon {
    width: 28px;
    height: 28px;
  }

  .add-reference-icon svg {
    width: 14px;
    height: 14px;
  }

  .add-reference-label {
    font-size: 0.75rem;
  }

  .add-reference-hint {
    font-size: 0.65rem;
  }

  .reference-preview-content {
    padding: 10px;
    gap: 10px;
  }

  .reference-preview-content img {
    width: 48px;
    height: 48px;
  }

  .reference-preview-hint {
    font-size: 0.75rem;
  }
}

/* ============================================
   EDIT COST INDICATOR
   ============================================ */
.edit-cost-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.edit-cost-indicator .cost-text {
  display: flex;
  align-items: center;
  gap: 4px;
}

.edit-cost-indicator.free .cost-text {
  color: #10b981;
  font-weight: 500;
}

.edit-cost-indicator.pro .cost-text {
  color: var(--primary);
}

.edit-cost-indicator.insufficient .cost-text {
  color: #f59e0b;
  font-weight: 500;
}

/* Edit button needs-credits state */
.edit-btn.needs-credits {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.edit-btn.needs-credits:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

/* Countdown waiting state - greyed out, showing time until free edit */
.edit-btn.countdown-waiting {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%);
  cursor: pointer;
}

.edit-btn.countdown-waiting:hover {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

/* Edit cost caption - subtle text below quality toggle */
.edit-cost-caption {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: center;
}

.edit-cost-caption.free {
  color: #10b981;
  font-weight: 500;
}

.edit-cost-caption.warning {
  color: #f59e0b;
}

/* ============================================
   QUALITY TOGGLE - iOS-style segmented control
   ============================================ */
.quality-toggle {
  display: flex;
}

.toggle-track {
  position: relative;
  display: flex;
  background: var(--bg-secondary);
  border-radius: 8px;
  padding: 2px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
}

.toggle-indicator {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(50% - 2px);
  height: calc(100% - 4px);
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 6px rgba(139, 124, 246, 0.08);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toggle-indicator.right {
  transform: translateX(100%);
}

.toggle-option {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 10px 16px;
  min-height: 40px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.toggle-option.active {
  color: var(--text);
}

.toggle-option#proOption.active {
  color: var(--primary);
}

/* Disabled state for Smart when insufficient credits */
.toggle-option#proOption.insufficient {
  opacity: 0.5;
}

/* ============================================
   QUALITY HELP TOOLTIP
   ============================================ */
.quality-toggle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  position: relative;
  z-index: 20;
}

/* Smart mode inline upsell - appears when Smart selected but can't afford */
.smart-upsell {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(139, 124, 246, 0.1);
  border: 1px solid rgba(139, 124, 246, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 4px;
}

.smart-upsell.visible {
  display: flex;
}

.smart-upsell:hover {
  background: rgba(139, 124, 246, 0.15);
  border-color: rgba(139, 124, 246, 0.5);
}

.smart-upsell-text {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 500;
}

.smart-upsell-arrow {
  font-size: 0.8rem;
  color: var(--primary);
}

.quality-help-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.quality-help-btn:hover {
  background: var(--bg);
  color: var(--text);
  border-color: var(--primary);
}

.quality-help-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 32px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.quality-help-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.quality-help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.quality-help-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.quality-help-close:hover {
  color: var(--text);
}

.quality-help-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quality-help-option {
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: 10px;
}

.quality-help-option.smart {
  background: linear-gradient(135deg, rgba(139, 124, 246, 0.1) 0%, rgba(139, 124, 246, 0.05) 100%);
  border: 1px solid rgba(139, 124, 246, 0.2);
}

.quality-help-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.quality-help-cost {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 10px;
}

.quality-help-option.smart .quality-help-title {
  color: var(--primary);
}

.quality-help-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.quality-help-examples {
  margin: 0;
  padding-left: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.quality-help-examples li {
  margin-bottom: 2px;
}

/* Mobile: center tooltip */
@media (max-width: 480px) {
  .quality-help-tooltip {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.97);
    width: calc(100vw - 32px);
    max-width: 360px;
    opacity: 0;
    visibility: hidden;
  }

  .quality-help-tooltip.visible {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
  }
}

/* ============================================
   SMART RECOMMENDATION BANNER
   ============================================ */
.smart-recommend {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(139, 124, 246, 0.06);
  border: 1px solid rgba(139, 124, 246, 0.12);
  border-radius: 10px;
  margin-top: 8px;
  margin-bottom: 0;
}

.smart-recommend.visible {
  display: flex;
}

.smart-recommend-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.smart-recommend-text strong {
  color: var(--primary);
  font-weight: 600;
}

.smart-recommend-btn {
  padding: 5px 12px;
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.smart-recommend-btn:hover {
  background: var(--primary);
  color: white;
}

/* ============================================
   EDIT BUTTON - Primary action
   ============================================ */
.edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 28px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
  box-shadow: 0 2px 8px rgba(139, 124, 246, 0.25);
  flex-shrink: 0;
  letter-spacing: 0.01em;
}

.edit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 124, 246, 0.35);
}

.edit-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(139, 124, 246, 0.2);
}

.edit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Highlight animation for quick edit flow - draws attention to confirm */
.edit-btn.highlight {
  animation: editBtnHighlight 1.5s ease-out;
}

@keyframes editBtnHighlight {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(139, 124, 246, 0.25);
  }
  20% {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.3), 0 4px 16px rgba(139, 124, 246, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(139, 124, 246, 0.25);
  }
}

.edit-btn-text {
  font-weight: 600;
}

.edit-btn-icon {
  transition: transform 0.2s ease;
}

.edit-btn:hover .edit-btn-icon {
  transform: translateX(2px);
}

/* Free edit button state - keep standard purple styling */
.edit-btn.free-edit {
  /* Intentionally no override — stays on-brand */
}

/* ============================================
   REFERENCE IMAGE BUTTON
   ============================================ */
/* ============================================
   REFERENCE IMAGE CARD
   Mobile: Compact thumbnail strip (60px)
   Desktop: Larger preview in sidebar
   ============================================ */
.reference-card {
  display: none;
  flex-direction: column;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 12px;
}

.reference-card.visible {
  display: flex;
}

.reference-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.reference-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.reference-card-label svg {
  color: var(--primary);
}

.reference-card-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.reference-card-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.reference-card-image {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
  cursor: pointer;
}

.reference-card-image img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  display: block;
}

.reference-card-hint {
  font-size: 0.75rem;
  color: var(--text-dimmed);
  margin-top: 8px;
  text-align: center;
}

/* Tap hint for mobile */
.reference-card-tap-hint {
  display: none;
  font-size: 0.7rem;
  color: var(--text-dimmed);
  text-align: center;
  margin-top: 4px;
}

/* ============================================
   MOBILE: Compact thumbnail strip
   ============================================ */
@media (max-width: 768px) {
  .reference-card {
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    gap: 10px;
    margin-bottom: 8px;
  }

  .reference-card-header {
    display: none; /* Hide header on mobile, use inline layout */
  }

  .reference-card-image {
    width: 52px;
    height: 52px;
    flex-shrink: 0;
    border-radius: 8px;
  }

  .reference-card-image img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
  }

  /* Mobile inline content */
  .reference-card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .reference-card-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .reference-card-title svg {
    width: 12px;
    height: 12px;
    color: var(--primary);
  }

  .reference-card-tap-hint {
    display: block;
    text-align: left;
    margin-top: 0;
  }

  .reference-card-hint {
    display: none; /* Hide verbose hint on mobile */
  }

  /* Remove button - inline on mobile */
  .reference-card-remove-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .reference-card-remove-mobile:hover,
  .reference-card-remove-mobile:active {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error);
  }
}

/* Desktop: Show full card layout */
@media (min-width: 769px) {
  .reference-card-content {
    display: none;
  }

  .reference-card-remove-mobile {
    display: none;
  }
}

/* ============================================
   REFERENCE IMAGE OVERLAY (Mobile expand)
   Full-screen view when tapping thumbnail
   ============================================ */
.reference-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.reference-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.reference-overlay-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

.reference-overlay-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 8px;
}

.reference-overlay-title svg {
  color: var(--primary);
}

.reference-overlay-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  cursor: pointer;
  font-size: 1.5rem;
  transition: all 0.15s ease;
}

.reference-overlay-close:hover,
.reference-overlay-close:active {
  background: rgba(255, 255, 255, 0.2);
}

.reference-overlay-image {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  border-radius: 12px;
}

.reference-overlay-hint {
  position: absolute;
  bottom: 20px;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
}

/* Add Reference Button */
.reference-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  min-height: 44px; /* Touch target */
}

.reference-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--glow);
}

.reference-btn:active {
  transform: scale(0.98);
}

.reference-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.reference-btn-text {
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

/* Hide button when reference is visible */
.reference-card.visible ~ .edit-card .reference-btn {
  display: none;
}

/* ============================================
   PHOTO STRIP (Equal Photos Architecture)
   Horizontal strip of numbered photo thumbnails
   Positioned inside image-area, below the image-container
   ============================================ */
.photo-strip {
  display: none; /* Hidden until photo loaded */
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  flex-shrink: 0;
}

.photo-strip.visible {
  display: flex;
}

.photo-strip-scroll {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
}

/* Extra bottom padding for labels in two-photo mode */
.photo-strip.two-photos .photo-strip-scroll {
  padding-bottom: 20px;
}

.photo-strip-scroll::-webkit-scrollbar {
  display: none;
}

.photo-strip-item {
  position: relative;
  flex-shrink: 0;
  cursor: pointer;
  border-radius: 10px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  background: var(--bg-secondary);
  padding: 4px;
  transition: all 0.15s ease;
}

.photo-strip-item:hover {
  border-color: var(--border);
}

.photo-strip-item.active {
  border-color: var(--primary);
  background: var(--glow);
  box-shadow: var(--shadow-md);
}

/* Number badge */
.photo-strip-badge {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.photo-strip-item.active .photo-strip-badge {
  background: var(--primary);
}

/* Reference badge - different color */
.photo-strip-badge-ref {
  font-size: 0.55rem;
  padding: 0 2px;
  width: auto;
  min-width: 20px;
  background: var(--orange, #F97316);
}

.photo-strip-item.active .photo-strip-badge-ref {
  background: var(--orange, #F97316);
}

/* Photo strip label (shown below thumbnail in two-photo mode) */
.photo-strip-label {
  display: none;
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.photo-strip.two-photos .photo-strip-label {
  display: block;
}

/* Thumbnail wrapper */
.photo-thumb-wrapper {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg);
}

.photo-thumb-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Markers badge (shows marker count) */
.photo-markers-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--orange, #F97316);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  display: none;
}

.photo-markers-badge:not(:empty) {
  display: block;
}

/* Remove button (on hover) */
.photo-remove-btn {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid white;
  background: var(--error, #EF4444);
  color: white;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  z-index: 3;
  transition: transform 0.1s ease;
}

.photo-strip-item:hover .photo-remove-btn {
  display: flex;
}

.photo-remove-btn:hover {
  transform: scale(1.1);
}

/* ============================================
   PHOTO STRIP - Result Showing State
   When showing edit result, strip is view-only
   ============================================ */

/* Disable interaction styling when result is showing */
.has-result .photo-strip-item {
  cursor: default;
  opacity: 0.7;
}

.has-result .photo-strip-item:hover {
  border-color: transparent;
}

.has-result .photo-strip-item.active {
  opacity: 1;
  border-color: var(--primary);
}

/* Hide remove buttons when result is showing */
.has-result .photo-remove-btn {
  display: none !important;
}

/* Hide add button when result is showing */
.has-result .photo-strip-add {
  display: none !important;
}

/* View-only label on strip when result showing */
.photo-strip-view-label {
  display: none;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 4px 8px;
  background: var(--bg-secondary);
  border-radius: 6px;
  white-space: nowrap;
}

.has-result .photo-strip.two-photos .photo-strip-view-label {
  display: block;
}

/* Shake animation for blocked interactions */
.photo-strip.shake,
.photo-strip-item.shake {
  animation: photo-strip-shake 0.4s ease-out;
}

@keyframes photo-strip-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}

/* Add photo button */
.photo-strip-add {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  gap: 4px;
  transition: all 0.15s ease;
}

.photo-strip-add:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--glow);
}

.photo-strip-add span {
  font-size: 0.7rem;
  font-weight: 500;
}

.photo-strip-add svg {
  width: 18px;
  height: 18px;
}

/* Hide add button when both photos loaded */
.photo-strip.two-photos .photo-strip-add {
  display: none;
}

/* Hide photo strip when showing result - UNLESS user has 2 photos */
.has-result .photo-strip:not(.two-photos) {
  display: none !important;
}

/* When 2 photos, show strip even with result (so user can switch) */
.has-result .photo-strip.two-photos {
  display: flex !important;
}

/* ============================================
   PHOTO STRIP MOBILE RESPONSIVENESS
   ============================================ */
@media (max-width: 768px) {
  /* Show photo strip on mobile when visible (image loaded) */
  .photo-strip.visible {
    display: flex !important;
    justify-content: center;
    padding: 8px 16px;
  }

  .photo-thumb-wrapper {
    width: 48px;
    height: 48px;
  }

  .photo-strip-add {
    width: 56px;
    height: 56px;
  }

  .photo-strip-badge {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  /* Remove button always visible on mobile (no hover state) */
  .photo-strip-item .photo-remove-btn {
    display: flex;
    width: 32px;
    height: 32px;
    top: -10px;
    right: -10px;
    font-size: 16px;
  }

  /* Hide strip when keyboard is open to prevent layout jumps */
  .keyboard-open .photo-strip {
    display: none !important;
  }

  .keyboard-open .reference-preview {
    display: none !important;
  }

  .photo-strip.two-photos .photo-strip-label {
    display: none;
  }
  .photo-strip.two-photos .photo-thumb-wrapper {
    width: 40px;
    height: 40px;
  }
  .photo-strip.two-photos {
    padding: 4px 12px;
  }
  .photo-strip.two-photos .photo-strip-scroll {
    padding-bottom: 0;
  }
}

/* ============================================
   DONE EDITING BUTTON
   ============================================ */
.done-editing-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 8px 0;
  margin-top: 4px;
  transition: color 0.15s ease;
}

.done-editing-btn:hover {
  color: var(--text);
}

.done-editing-btn.hidden {
  display: none;
}

/* Legacy support */
.quality-chip {
  display: none;
}

.quality-row {
  display: none;
}

.quality-row.hidden {
  display: none;
}

.quality-btn {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 40px;
}

.quality-btn:hover {
  border-color: var(--text-dimmed);
}

.quality-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.quality-btn .cost {
  opacity: 0.7;
  font-size: 0.8rem;
}

/* ============================================
   BOTTOM SHEET (default for buySheet etc)
   ============================================ */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10001; /* Above GDPR banner (9999) and interstitial (1000) */
  opacity: 0;
  visibility: hidden;
  /* Closing animation */
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* Opening: faster appearance */
  transition: opacity 0.1s ease, visibility 0.1s ease;
  /* Prevent iOS touch scroll passthrough */
  touch-action: none;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: contain;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-bottom));
  z-index: 10002; /* Above GDPR banner (9999) and sheet-overlay (10001) */
  transform: translateY(100%);
  /* Closing animation */
  transition: transform 0.25s ease;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  max-height: calc(85dvh - var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bottom-sheet.visible {
  transform: translateY(0);
  /* Opening: faster slide-up for snappier feel */
  transition: transform 0.15s ease-out;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 20px;
  /* Larger touch area without changing visual size */
  padding: 12px 32px;
  margin-top: -12px;
  background-clip: content-box;
  cursor: grab;
  touch-action: pan-y;
}

/* ============================================
   USER SHEET - Centered modal on desktop
   ============================================ */
#userSheetOverlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

#userSheet {
  position: fixed;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) scale(0.95) !important;
  width: 90%;
  max-width: 380px;
  border-radius: 16px !important;
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.05),
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 20px 40px -4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#userSheet.visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1) !important;
}

#userSheet .sheet-handle {
  display: none;
}

/* Mobile: userSheet becomes bottom sheet */
@media (max-width: 640px) {
  #userSheet {
    top: auto !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    transform: translateY(100%) !important;
    width: 100%;
    max-width: none;
    border-radius: 20px 20px 0 0 !important;
    padding: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
    border: none;
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    opacity: 1;
  }

  #userSheet.visible {
    transform: translateY(0) !important;
  }

  #userSheet .sheet-handle {
    display: block;
  }
}

/* Close button for user sheet */
.sheet-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: none;
  background: var(--bg-subtle);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.1s ease, color 0.1s ease, transform 0.1s ease;
  z-index: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sheet-close-btn:hover {
  background: var(--border);
  color: var(--text);
}

.sheet-close-btn:active {
  transform: scale(0.9);
  background: var(--border);
}

@media (max-width: 640px) {
  .sheet-close-btn {
    top: 16px;
    right: 16px;
  }
}

.sheet-title {
  font-size: 1.25rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 8px;
}

.sheet-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
}

.sheet-btn {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 10px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.sheet-btn-primary {
  background: var(--primary);
  color: white;
}

.sheet-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.sheet-btn-secondary {
  background: var(--bg);
  color: var(--text-muted);
}

.sheet-btn-secondary:hover {
  background: var(--border);
  color: var(--text);
}

/* Magic link button loading state */
.sheet-btn.loading {
  opacity: 0.7;
  cursor: not-allowed;
}

.sheet-btn.loading:hover {
  transform: none;
  box-shadow: none;
}

.magic-link-spinner {
  animation: none;
}

.magic-link-spinner.spinning {
  animation: spin 1s linear infinite;
}

/* ============================================
   CREDIT PACKS
   ============================================ */
.credit-pack {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-subtle);
  border: 2px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.credit-pack:hover {
  border-color: var(--text-dimmed);
}

.credit-pack.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
}

.pack-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pack-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text);
}

.pack-edits {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pack-detail {
  font-size: 0.75rem;
  color: var(--text-dimmed);
}

.pack-per-edit {
  font-size: 0.75rem;
  color: var(--success);
  font-weight: 600;
  margin-top: 2px;
}

.pack-tagline {
  font-size: 0.75rem;
  color: var(--text-dimmed);
  font-style: normal;
  font-weight: 500;
}

.credit-pack.selected .pack-tagline {
  color: var(--success);
  font-weight: 600;
}

.pack-badge {
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.credit-pack.selected .pack-badge {
  background: linear-gradient(135deg, #10b981, #059669);
  animation: pulse-badge 2s ease-in-out infinite;
}

.pack-badge-best {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.pack-badge-new {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.credit-pack.first-time-discount {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.pack-price-original {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 6px;
}

.pack-trust {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.pack-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--success);
}

.pack-credits {
  font-size: 0.9rem;
}

.pack-bonus {
  font-size: 0.7rem;
}

/* ============================================
   BUY SHEET V9 - SUBSCRIPTION FIRST (Premium)
   Credits-first visual hierarchy with brand accent
   ============================================ */

.buy-sheet-v9 {
  max-height: 85dvh;
  background: #0a0a0f;
  color: #e8e8ec;
  display: flex;
  flex-direction: column;
  padding: 0; /* Remove base padding, children handle it */
}

.buy-sheet-v9 .sheet-handle {
  flex-shrink: 0;
  margin: 12px auto 0;
  background-color: rgba(255, 255, 255, 0.15);
}

.buy-sheet-v9 .buy-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px 16px;
  -webkit-overflow-scrolling: touch;
}

/* Close button styling */
.buy-sheet-v9 .buy-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  transition: all 0.15s ease;
  z-index: 10;
}

.buy-sheet-v9 .buy-sheet-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.15);
}

.buy-sheet-v9 .buy-sheet-close:active {
  transform: scale(0.95);
}

.sheet-headline-v9 {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  color: #e8e8ec;
  letter-spacing: -0.02em;
}

/* PPP Badge */
.buy-sheet-v9 .buy-ppp-badge {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: #34D399;
  background: rgba(52, 211, 153, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  margin: 0 auto 12px;
  width: fit-content;
}

/* Buy Sheet Billing Toggle - Segmented Control (dark) */
.buy-billing-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 3px;
  display: flex;
  margin: 12px 0 20px;
}

.buy-billing-option {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.buy-billing-option--active {
  background: rgba(139, 124, 246, 0.18);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.buy-save-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Legacy toggle hidden (replaced by segmented control) */
.annual-toggle-v9 {
  display: none;
}

/* Subscription Tier Cards - 3-Column Confident Numbers (dark) */
.sub-tiers-v9 {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 16px;
}

.sub-tier-v9 {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  flex: 1;
  padding: 20px 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.sub-tier-v9:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.sub-tier-v9--selected {
  border-color: rgba(139, 124, 246, 0.45);
  background: linear-gradient(165deg, rgba(139, 124, 246, 0.1), rgba(139, 124, 246, 0.03));
  box-shadow:
    0 0 0 1px rgba(139, 124, 246, 0.1),
    0 8px 32px -8px rgba(139, 124, 246, 0.15);
}

.sub-tier-v9--selected:hover {
  border-color: rgba(139, 124, 246, 0.55);
  transform: translateY(-2px);
}

.sub-tier-v9--popular {
  padding-top: 24px;
}

.sub-tier-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

/* Tier Name - tiny uppercase label */
.sub-tier-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 4px;
}

.sub-tier-v9--selected .sub-tier-name {
  color: rgba(167, 139, 250, 0.65);
}

/* Credits - Hero Metric */
.sub-tier-credits-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sub-tier-credits-num {
  font-size: 2.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.sub-tier-v9--selected .sub-tier-credits-num {
  color: #a78bfa;
}

.sub-tier-credits-label {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

/* Tier Info - hidden on new layout, name moved above */
.sub-tier-main {
  display: none;
}

.sub-tier-credits {
  display: none;
}

/* Price - Secondary */
.sub-tier-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  white-space: nowrap;
}

.sub-tier-v9--selected .sub-tier-price {
  color: rgba(255, 255, 255, 0.6);
}

.sub-tier-price-annual {
  display: block;
  font-size: 0.7rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 2px;
}

/* Subscription Benefits (dark) */
.sub-benefits-v9 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sub-benefit {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.sub-benefit svg {
  width: 13px;
  height: 13px;
  stroke: #34D399;
}

/* One-time Pack Section (dark) */
.onetime-section-v9 {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
  margin-top: 4px;
}

.onetime-divider-v9 {
  color: rgba(255, 255, 255, 0.18);
  font-size: 0.75rem;
  text-align: center;
  text-transform: lowercase;
  letter-spacing: 0.02em;
}

.onetime-toggle {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0;
  width: 100%;
  text-align: center;
  transition: color 0.15s;
}

.onetime-toggle:hover {
  color: rgba(255, 255, 255, 0.7);
}

.onetime-toggle-link {
  color: #a78bfa;
  font-weight: 600;
}

/* Credits Slider */
.credits-slider-container {
  margin-top: 10px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
}

.onetime-section-v9.expanded .credits-slider-container {
  display: block;
}

.credits-slider-display {
  text-align: center;
  margin-bottom: 16px;
}

.credits-slider-total {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
}

.credits-slider-count {
  font-size: 2rem;
  font-weight: 800;
  color: #e8e8ec;
  transition: opacity 0.15s;
}

.credits-slider-label {
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.5);
}

.credits-slider-bonus {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
  padding: 2px 8px;
  border-radius: 20px;
  margin-top: 4px;
  transition: opacity 0.2s;
}

.credits-slider-bonus.hidden {
  display: none;
}

.credits-slider-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e8e8ec;
  margin-top: 4px;
  transition: opacity 0.15s;
}

.credits-slider-per-edit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
  transition: opacity 0.15s;
}

/* Range input track */
.credits-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 0;
}

.credits-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #a78bfa;
  border: 2px solid #c4b5fd;
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.4);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.credits-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 12px rgba(167, 139, 250, 0.6);
}

.credits-slider::-webkit-slider-thumb:active {
  transform: scale(1.05);
}

.credits-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #a78bfa;
  border: 2px solid #c4b5fd;
  box-shadow: 0 2px 8px rgba(167, 139, 250, 0.4);
  cursor: pointer;
}

/* Notch labels below slider */
.credits-slider-notches {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px 0;
}

.credits-slider-notches span {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 500;
  min-width: 24px;
  text-align: center;
  transition: color 0.15s;
}

.credits-slider-notches span.active {
  color: #a78bfa;
  font-weight: 700;
}

/* Buy button (full-width below slider) */
.credits-slider-buy {
  width: 100%;
  margin-top: 14px;
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 18px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.credits-slider-buy:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.8);
}

/* Paywall slider variant — slightly more compact */
.paywall-slider {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 16px;
}

/* Subscriber: promoted one-time pack */
.onetime-section-v9.subscriber-primary .onetime-divider-v9 {
  font-size: 1rem;
  font-weight: 600;
  color: #e8e8ec;
}

/* Upgrade CTA (same green, just override if needed) */
.cta-primary-v9.cta-upgrade {
  background: linear-gradient(135deg, #34D399, #10B981);
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3);
}

/* Footer V9 - Sticky at bottom (dark) */
.buy-sheet-footer-v9 {
  flex-shrink: 0;
  padding: 14px 20px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  background: #0a0a0f;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  /* Ensure footer is always visible */
  position: sticky;
  bottom: 0;
  z-index: 5;
}

.cta-primary-v9 {
  width: 100%;
  background: linear-gradient(135deg, #34D399, #10B981);
  color: white;
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 20px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3);
  letter-spacing: 0.01em;
  position: relative;
  overflow: hidden;
}

.cta-primary-v9::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: ctaShimmer 2.5s ease-in-out 1s infinite;
}

.cta-primary-v9:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.35);
}

.cta-primary-v9:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
}

/* Reassurance text below CTA */
.footer-reassurance {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.55);
  margin: 8px 0 0;
}

/* Footer Social Proof */
.footer-social-proof {
  text-align: center;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.45);
  margin: 6px 0 0;
  letter-spacing: 0.02em;
}

/* Footer Trust Line (dark) */
.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
}

.footer-trust svg {
  width: 12px;
  height: 12px;
  stroke: rgba(255, 255, 255, 0.4);
}

.footer-dot {
  opacity: 0.6;
}

.footer-signin {
  background: none;
  border: none;
  color: #a78bfa;
  font-weight: 500;
  padding: 0;
}

.footer-signin:hover {
  text-decoration: underline;
}

.footer-signin.hidden {
  display: none;
}

/* Price strikethrough for PPP discounts */
.price-original {
  text-decoration: line-through;
  opacity: 0.5;
  font-weight: 400;
  margin-right: 4px;
}

/* Desktop: Lightbox modal with breathing room */
@media (min-width: 900px) {
  .buy-sheet-v9 {
    max-width: 720px;
    max-height: 85vh;
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  }

  .buy-sheet-v9 .buy-sheet-scroll {
    padding: 32px 40px 24px;
  }

  .sheet-headline-v9 {
    font-size: 1.85rem;
    margin-bottom: 8px;
  }

  /* 3-column tier layout already set as default, just adjust sizing */
  .sub-tiers-v9 {
    gap: 16px;
    margin-bottom: 20px;
  }

  .sub-tier-v9 {
    padding: 24px 14px 18px;
  }

  .sub-tier-v9--popular {
    padding-top: 30px;
  }

  .sub-tier-credits-num {
    font-size: 2.8rem;
  }

  .sub-tier-price {
    font-size: 0.85rem;
  }

  /* Benefits row with breathing room */
  .sub-benefits-v9 {
    margin-bottom: 16px;
    padding: 12px 16px;
  }

  .cta-primary-v9 {
    padding: 18px 28px;
    font-size: 1.1rem;
  }

  .buy-sheet-footer-v9 {
    padding: 16px 40px 28px;
  }

  .footer-trust {
    margin-top: 12px;
  }
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  padding: 20px;
}

.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg);
  border-radius: 16px;
  padding: 32px 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.25s;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
}

.modal-overlay.visible .modal-content {
  transform: scale(1);
}

.modal-icon {
  width: 56px;
  height: 56px;
  background: rgba(139, 124, 246, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 3rem;
}

.modal-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}

.modal-text {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;
}

.subscription-success-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: 10px;
}

/* Subscription success variant - blue accent */
.subscription-success .modal-icon {
  background: rgba(56, 189, 248, 0.1);
}

.subscription-success .modal-stat-value {
  color: var(--accent);
}

.subscription-success .modal-value .value-item {
  color: var(--accent);
}

.success-detail {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: 12px;
}

.modal-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.modal-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--success);
}

.modal-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.modal-value {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--bg-subtle);
  border-radius: 12px;
}

.modal-value .value-item {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-btn {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 10px;
}

.modal-btn:last-child {
  margin-bottom: 0;
}

.modal-btn-primary {
  background: var(--primary);
  color: white;
}

.modal-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.modal-btn-secondary {
  background: transparent;
  color: var(--text-muted);
}

.modal-btn-secondary:hover {
  color: var(--text);
}

/* ============================================
   CELEBRATION MODALS - Success states
   ============================================ */
.celebration-modal {
  overflow: hidden;
}

.celebration-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  transform: scale(0);
}

.modal-overlay.visible .celebration-icon {
  animation: celebration-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.celebration-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes celebration-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.checkmark-draw {
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
}

.modal-overlay.visible .checkmark-draw {
  animation: checkmark-draw 0.4s 0.3s ease forwards;
}

@keyframes checkmark-draw {
  to { stroke-dashoffset: 0; }
}

.celebration-stat {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 4px;
  opacity: 0;
  transform: translateY(10px);
}

.modal-overlay.visible .celebration-stat {
  animation: stat-entrance 0.5s 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.celebration-pack .celebration-stat {
  background: linear-gradient(135deg, #34D399, #10b981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.celebration-sub .celebration-stat {
  background: linear-gradient(135deg, #8B7CF6, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.celebration-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(8px);
}

.modal-overlay.visible .celebration-stat-label {
  animation: stat-entrance 0.5s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes stat-entrance {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.celebration-modal .modal-title,
.celebration-modal .modal-text,
.celebration-modal .subscription-success-details,
.celebration-modal .modal-btn {
  opacity: 0;
}

.celebration-modal .success-detail {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
}

.modal-overlay.visible .celebration-modal .modal-title {
  animation: stat-entrance 0.4s 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.visible .celebration-modal .modal-text {
  animation: stat-entrance 0.4s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.visible .celebration-modal .subscription-success-details {
  animation: stat-entrance 0.4s 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.visible .celebration-modal .success-detail {
  animation: stat-entrance 0.3s calc(0.7s + var(--i) * 60ms) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay.visible .celebration-modal .modal-btn {
  animation: stat-entrance 0.4s 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.celebration-pack .celebration-icon svg circle {
  stroke: rgba(52, 211, 153, 0.2);
}

.celebration-sub .celebration-icon svg circle {
  stroke: rgba(var(--primary-rgb), 0.2);
}

/* ============================================
   SHARE MODAL
   ============================================ */
.share-modal {
  max-width: 340px;
}

.share-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.share-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.share-option-btn:hover {
  background: var(--card-hover);
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.share-option-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.modal-overlay.visible .share-option-btn {
  animation: share-btn-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.modal-overlay:not(.visible) .share-option-btn {
  opacity: 0;
}

.modal-overlay.visible .share-option-btn:nth-child(1) { animation-delay: 0.1s; }
.modal-overlay.visible .share-option-btn:nth-child(2) { animation-delay: 0.16s; }
.modal-overlay.visible .share-option-btn:nth-child(3) { animation-delay: 0.22s; }

@keyframes share-btn-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.share-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(var(--primary-rgb), 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
  transition: background 0.2s;
}

.share-option-btn:hover .share-icon {
  background: rgba(var(--primary-rgb), 0.15);
}

.share-icon-svg {
  width: 20px;
  height: 20px;
}

.share-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
}

.share-link-result {
  text-align: center;
  padding: 16px 0;
}

.share-success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px auto;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.share-success-text {
  color: var(--text);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.share-link-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
  cursor: pointer;
}

.share-link-input:focus {
  outline: none;
  border-color: var(--primary);
}

/* ============================================
   AD BLOCKER MODAL
   Pre-flight detection modal with two options
   ============================================ */
.adblocker-modal {
  max-width: 380px;
  padding: 32px 24px 24px;
  text-align: center;
  position: relative;
}

/* Entrance animation */
#adBlockerModal.visible .adblocker-modal {
  animation: adBlockerReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes adBlockerReveal {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Dismiss button */
.adblocker-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: var(--bg-subtle);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.2s, background 0.2s;
}

.adblocker-dismiss:hover {
  opacity: 1;
  background: var(--border);
}

/* Icon - red circle with slash */
.adblocker-icon {
  width: 64px;
  height: 64px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: #ef4444;
}

.adblocker-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.adblocker-message {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Two option buttons */
.adblocker-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.adblocker-option {
  width: 100%;
  padding: 16px 20px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.adblocker-option:hover {
  background: var(--card-hover);
  border-color: var(--text-dimmed);
  transform: translateY(-1px);
}

.adblocker-option:active {
  transform: translateY(0);
}

/* Primary option - Get Credits */
.adblocker-option.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.adblocker-option.primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.adblocker-option.primary .adblocker-option-title,
.adblocker-option.primary .adblocker-option-subtitle {
  color: white;
}

.adblocker-option.primary .adblocker-option-subtitle {
  opacity: 0.85;
}

.adblocker-option-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.adblocker-option-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Trust note at bottom */
.adblocker-note {
  font-size: 0.8rem;
  color: var(--text-dimmed);
  margin: 0;
}

/* Mobile: Full-width treatment */
@media (max-width: 599px) {
  .adblocker-modal {
    max-width: calc(100vw - 32px);
    padding: 28px 20px 20px;
  }

  .adblocker-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 16px;
  }

  .adblocker-icon svg {
    width: 28px;
    height: 28px;
  }

  .adblocker-title {
    font-size: 1.2rem;
  }

  .adblocker-message {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .adblocker-option {
    padding: 14px 16px;
  }
}

/* Small screens (iPhone SE) */
@media (max-width: 375px) {
  .adblocker-modal {
    padding: 24px 16px 16px;
  }

  .adblocker-options {
    gap: 10px;
  }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .adblocker-icon {
    background: rgba(239, 68, 68, 0.15);
  }

  .adblocker-dismiss {
    background: var(--bg-secondary);
  }
}

/* ============================================
   ONBOARDING MODAL
   ============================================ */
.onboarding-modal {
  max-width: 420px;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  text-align: center;
}

/* Mobile: Compact onboarding to fit small screens */
@media (max-height: 700px) {
  .onboarding-modal {
    padding: 20px 16px;
    max-height: 95vh;
    max-height: 95dvh;
  }

  .onboarding-header h2 {
    font-size: 1.2rem;
    margin-bottom: 2px;
  }

  .onboarding-subtitle {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .onboarding-steps {
    gap: 8px;
    margin-bottom: 12px;
  }

  .onboarding-step {
    gap: 8px;
  }

  .step-number {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
  }

  .step-text {
    font-size: 0.85rem;
  }

  .onboarding-comparison {
    padding: 12px;
    margin-bottom: 12px;
  }

  .onboarding-comparison h3 {
    font-size: 0.8rem;
    margin-bottom: 4px;
  }

  .comparison-prompt {
    font-size: 0.75rem;
    margin-bottom: 8px;
  }

  .compare-img {
    border-radius: 6px;
  }

  .compare-label,
  .compare-verdict {
    font-size: 0.65rem;
  }

  .compare-mode-label {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  .onboarding-btn {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
}

/* Very small screens - hide comparison to ensure modal fits */
@media (max-height: 550px) {
  .onboarding-comparison {
    display: none;
  }
}

.onboarding-header h2 {
  margin: 0 0 4px 0;
  font-size: 1.4rem;
  color: var(--text);
}

.onboarding-subtitle {
  margin: 0 0 20px 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.onboarding-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
  text-align: left;
}

.onboarding-step {
  display: flex;
  align-items: center;
  gap: 12px;
}

.step-number {
  width: 28px;
  height: 28px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.95rem;
  color: var(--text);
}

.onboarding-comparison {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
}

.onboarding-comparison h3 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 600;
}

.comparison-prompt {
  margin: 0 0 14px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

.onboarding-compare-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.compare-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.compare-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.compare-column.smart .compare-img {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(139, 124, 246, 0.2);
}

.compare-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.compare-mode-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.compare-mode-label.smart {
  color: var(--primary);
}

.compare-mode-label .mode-cost {
  font-size: 0.6rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 5px;
  border-radius: 6px;
}

.compare-verdict {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}

.compare-column.smart .compare-verdict {
  color: var(--primary);
  font-weight: 500;
}

.onboarding-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-btn:hover {
  background: var(--primary-hover);
}

/* ============================================
   CONVERSION MODAL V2 - Cinematic Celebration
   ============================================ */

.conversion-modal-v2 {
  max-width: 400px;
  width: 100%;
  padding: 0;
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  max-height: 90dvh;
  overflow: hidden;
  position: relative;
  border-radius: 20px;
  background: var(--bg);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.04),
    0 24px 80px rgba(0, 0, 0, 0.18),
    0 8px 24px rgba(0, 0, 0, 0.08);
}

/* Entrance animation */
#conversionModal.visible .conversion-modal-v2 {
  animation: conversionReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes conversionReveal {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Subtle X dismiss - delayed visibility */
.conversion-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease 0.8s, background 0.2s;
}

#conversionModal.visible .conversion-dismiss {
  opacity: 0.6;
}

.conversion-dismiss:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.6);
}

/* Hero image - cinematic dark frame */
.conversion-preview-v2 {
  width: 100%;
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  background: linear-gradient(135deg, #0f0f0f 0%, #1a1a1a 100%);
  overflow: hidden;
  padding: 24px;
}

/* Ambient glow behind image */
.conversion-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(139, 124, 246, 0.15) 0%,
    transparent 70%
  );
  pointer-events: none;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.conversion-preview-v2 img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 1px rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 1;
  animation: imageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

@keyframes imageReveal {
  0% {
    opacity: 0;
    transform: scale(0.96);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Save badge - cleaner, more intentional */
.conversion-save-badge {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  color: #1a1a1a;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
  z-index: 2;
  animation: badgeReveal 0.4s ease 0.6s both;
}

@keyframes badgeReveal {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.conversion-save-badge svg {
  opacity: 0.7;
}

/* Legacy save hint - hidden, replaced by badge */
.conversion-save-hint {
  display: none;
}

/* Content area */
.conversion-content {
  padding: 24px 24px 28px;
  text-align: center;
  background: var(--bg);
}

/* Header with staggered reveal */
.conversion-header {
  margin-bottom: 20px;
}

.conversion-celebration {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  animation: textReveal 0.4s ease 0.2s both;
}

@keyframes textReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.conversion-message {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  animation: textReveal 0.4s ease 0.3s both;
}

/* Primary CTA - prominent, confident */
.conversion-cta {
  width: 100%;
  background: var(--primary);
  border: none;
  border-radius: 14px;
  padding: 18px 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  animation: ctaReveal 0.4s ease 0.4s both;
  position: relative;
  overflow: hidden;
}

@keyframes ctaReveal {
  0% {
    opacity: 0;
    transform: translateY(8px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Shimmer effect on CTA */
.conversion-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: ctaShimmer 2.5s ease-in-out 1s infinite;
}

@keyframes ctaShimmer {
  0% { transform: translateX(-100%); }
  50%, 100% { transform: translateX(100%); }
}

.conversion-cta:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow:
    0 8px 24px rgba(var(--primary-rgb), 0.35),
    0 4px 12px rgba(var(--primary-rgb), 0.2);
}

.conversion-cta:active {
  transform: translateY(0);
}

.conversion-cta-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: white;
  position: relative;
  z-index: 1;
}

.conversion-cta-subtext {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 1;
}

.conversion-cta-price {
  font-weight: 600;
}

.conversion-cta-unit {
  opacity: 0.9;
}

/* Trust signals - subtle, credible */
.conversion-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.8rem;
  color: var(--text-dimmed);
  animation: textReveal 0.4s ease 0.5s both;
}

.conversion-trust-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.conversion-trust-item svg {
  color: #f59e0b;
}

.conversion-trust-sep {
  opacity: 0.4;
}

/* One-time CTA - for users who don't want a subscription */
.conversion-onetime-cta {
  width: 100%;
  background: transparent;
  border: none;
  padding: 10px 20px;
  margin-top: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: textReveal 0.4s ease 0.5s both;
  text-decoration: underline;
  text-decoration-color: rgba(139, 124, 246, 0.3);
  text-underline-offset: 3px;
}

.conversion-onetime-cta:hover {
  text-decoration-color: var(--primary);
}

.conversion-onetime-cta:active {
  transform: scale(0.98);
}

/* Secondary CTA */
.conversion-secondary-cta {
  width: 100%;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-top: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: textReveal 0.4s ease 0.55s both;
}

.conversion-secondary-cta:hover {
  background: var(--glow);
  border-color: var(--primary-light);
  color: var(--text);
}

.conversion-secondary-cta:active {
  transform: scale(0.98);
}

/* Legacy elements - hidden in new design */
.conversion-value-anchor,
.conversion-features-inline,
.conversion-social-proof {
  display: none;
}

/* Legacy intro offer styles (kept for backward compatibility) */
.conversion-intro-offer {
  width: 100%;
}

.conversion-cta-intro {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.conversion-cta-intro:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.conversion-cta-intro:active {
  transform: translateY(0);
}

.conversion-cta-intro-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.conversion-cta-intro-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.conversion-cta-intro-period {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.conversion-cta-intro-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.conversion-cta-intro-credits {
  font-weight: 600;
}

.conversion-cta-intro-renewal {
  opacity: 0.9;
}

.conversion-intro-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.conversion-intro-badge {
  background: #dc2626;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.conversion-intro-cancel {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   MOBILE: Full-screen cinematic mode
   ============================================ */
@media (max-width: 599px) {
  .conversion-modal-v2 {
    position: fixed;
    inset: 0;
    z-index: 10002;
    max-width: none;
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
    background: var(--bg);
  }

  .conversion-preview-v2 {
    min-height: min(40dvh, 240px);
    max-height: 45dvh;
    flex: 0 1 auto;
    padding: 20px;
  }

  .conversion-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .conversion-header {
    margin-bottom: 16px;
  }

  .conversion-celebration {
    font-size: 1.5rem;
  }

  .conversion-message {
    font-size: 0.9rem;
  }

  .conversion-cta {
    padding: 16px 24px;
  }

  .conversion-trust {
    margin-top: 12px;
  }
}

/* Very small height screens */
@media (max-width: 599px) and (max-height: 600px) {
  .conversion-preview-v2 {
    min-height: 120px;
    max-height: 140px;
    padding: 16px;
  }

  .conversion-content {
    padding: 16px 20px;
  }

  .conversion-header {
    margin-bottom: 12px;
  }

  .conversion-celebration {
    font-size: 1.25rem;
    margin-bottom: 4px;
  }

  .conversion-message {
    font-size: 0.85rem;
  }

  .conversion-cta {
    padding: 14px 20px;
  }

  .conversion-cta-value {
    font-size: 1rem;
  }

  .conversion-trust {
    margin-top: 10px;
  }

  .conversion-secondary-cta {
    padding: 12px 16px;
    margin-top: 10px;
  }
}

.conversion-signup-box {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.conversion-signup-offer {
  margin-bottom: 16px;
  text-align: center;
}

.conversion-signup-badge {
  display: inline-block;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 8px;
}

.conversion-signup-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.conversion-email-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  margin-bottom: 12px;
  box-sizing: border-box;
}

.conversion-email-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-btn-signup {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  width: 100%;
  margin-bottom: 0;
}

.modal-btn-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
}

.modal-btn-signup:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.conversion-divider {
  display: flex;
  align-items: center;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.conversion-divider::before,
.conversion-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.conversion-divider span {
  padding: 0 16px;
}

/* ============================================
   UNIFIED PAYWALL — 3-Screen Exit Flow
   Dark cinema design with progressive commitment.
   Mobile: full-screen (100dvh)
   Desktop: centered lightbox (max-width 520px)
   ============================================ */

/* Container — dark foundation */
.paywall {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  max-height: 85dvh;
  border-radius: 20px;
  background: #0a0a0f;
  color: #e8e8ec;
  overflow: hidden;
  position: relative;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

#conversionModal.visible .paywall {
  animation: paywallReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes paywallReveal {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(16px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Screen visibility system */
.paywall-screen {
  display: none;
  flex-direction: column;
}

.paywall[data-active-screen="1"] .paywall-screen[data-screen="1"] {
  display: flex;
}
.paywall[data-active-screen="2"] .paywall-screen[data-screen="2"] {
  display: flex;
  flex: 1;
}
.paywall[data-active-screen="3"] .paywall-screen[data-screen="3"] {
  display: flex;
  flex: 1;
}

/* Close button — delayed appearance */
.paywall-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.3);
  opacity: 0;
  transition: opacity 0.3s ease 1.5s, background 0.15s, color 0.15s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.paywall-close svg {
  pointer-events: none;
}

#conversionModal.visible .paywall-close {
  opacity: 1;
}

.paywall-close:hover {
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.paywall-close:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.15);
}

/* ---- Hero: User's edit with cinematic dark frame ---- */
.paywall-hero {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background:
    radial-gradient(ellipse 120% 100% at 50% 40%, rgba(139, 124, 246, 0.12), transparent 70%),
    linear-gradient(160deg, #0a0a0f 0%, #141420 50%, #0f0f18 100%);
  overflow: hidden;
  padding: 24px;
  transition: height 0.3s ease, flex 0.3s ease, min-height 0.3s ease, max-height 0.3s ease;
}

/* Screen 1: hero is the star — flex to fill */
.paywall[data-active-screen="1"] .paywall-hero {
  flex: 1 0 200px;
  min-height: 200px;
  max-height: 50dvh;
}

/* Screen 1: screen content should shrink to give hero space */
.paywall[data-active-screen="1"] .paywall-screen[data-screen="1"] {
  flex-shrink: 1;
  overflow: hidden;
}

/* Screens 2/3: hero grows to fill space above the drawer */
.paywall[data-active-screen="2"] .paywall-hero,
.paywall[data-active-screen="3"] .paywall-hero {
  flex: 1 1 auto;
  min-height: 140px;
  max-height: none;
}

.paywall-hero img {
  max-width: 85%;
  max-height: 85%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 1px rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
  animation: imageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
}

/* SD quality badge — red/amber limitation signal */
.paywall-sd-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  animation: textReveal 0.4s ease 0.3s both;
}

/* ---- Screen 1: The Showcase ---- */

.paywall-headline {
  font-size: 1.3rem;
  font-weight: 700;
  color: #e8e8ec;
  margin: 0 0 16px;
  padding-top: 16px;
  text-align: center;
  letter-spacing: -0.02em;
  animation: textReveal 0.4s ease 0.2s both;
}

/* Value props — vertical list with left accent */
.paywall-features {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.paywall-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  border-left: 2px solid rgba(52, 211, 153, 0.2);
  padding-left: 12px;
  animation: textReveal 0.35s ease both;
}

.paywall-feature:nth-child(1) { animation-delay: 0.35s; }
.paywall-feature:nth-child(2) { animation-delay: 0.4s; }
.paywall-feature:nth-child(3) { animation-delay: 0.45s; }
.paywall-feature:nth-child(4) { animation-delay: 0.5s; }

.paywall-feature svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  stroke: #34D399;
}

/* Social proof divider */
.paywall-social-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 14px;
  animation: textReveal 0.4s ease 0.55s both;
}

.paywall-social-proof::before,
.paywall-social-proof::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

/* Single plan card (screen 1) */
.paywall-plan-card {
  background: linear-gradient(165deg, rgba(139, 124, 246, 0.08), rgba(139, 124, 246, 0.02));
  border: 1px solid rgba(139, 124, 246, 0.2);
  border-radius: 16px;
  padding: 18px 20px 16px;
  text-align: center;
  margin-bottom: 14px;
  animation: textReveal 0.4s ease 0.6s both;
}

.paywall-plan-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.7);
  margin-bottom: 2px;
}

.paywall-plan-credits {
  font-size: 2.2rem;
  font-weight: 800;
  color: #e8e8ec;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.paywall-plan-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.02em;
}

.paywall-plan-price {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.78rem;
  margin-top: 4px;
}

/* ---- Drawer (screens 2 & 3) ---- */

.paywall-drawer {
  background: rgba(255, 255, 255, 0.07);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px 20px 0 0;
  padding: 24px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  animation: drawerSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.paywall-drawer-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #e8e8ec;
  margin: 0 0 4px;
}

.paywall-drawer-subtitle {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 16px;
}

/* ---- Billing toggle (screen 2) ---- */

.paywall-billing-toggle {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 3px;
  display: flex;
  margin-bottom: 18px;
}

.paywall-billing-option {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.paywall-billing-option--active {
  background: rgba(139, 124, 246, 0.18);
  color: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.paywall-save-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(52, 211, 153, 0.15);
  color: #34D399;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ---- Tier cards (screen 2) — always 3 columns ---- */

.paywall-tiers {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 16px;
}

.paywall-tier {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  flex: 1;
  padding: 20px 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}

.paywall-tier:hover {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.paywall-tier--selected {
  border-color: rgba(139, 124, 246, 0.45);
  background: linear-gradient(165deg, rgba(139, 124, 246, 0.1), rgba(139, 124, 246, 0.03));
  box-shadow:
    0 0 0 1px rgba(139, 124, 246, 0.1),
    0 8px 32px -8px rgba(139, 124, 246, 0.15);
}

.paywall-tier--selected:hover {
  border-color: rgba(139, 124, 246, 0.55);
  transform: translateY(-2px);
}

.paywall-tier-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #7c3aed, #a78bfa);
  color: #fff;
  padding: 2px 10px;
  border-radius: 20px;
  white-space: nowrap;
}

.paywall-tier-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 4px;
}

.paywall-tier--selected .paywall-tier-name {
  color: rgba(167, 139, 250, 0.65);
}

.paywall-tier-credits {
  font-size: 2.4rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.paywall-tier--selected .paywall-tier-credits {
  color: #a78bfa;
}

.paywall-tier-unit {
  font-size: 0.58rem;
  color: rgba(255, 255, 255, 0.28);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.paywall-tier-price {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
}

.paywall-tier--selected .paywall-tier-price {
  color: rgba(255, 255, 255, 0.6);
}

/* ---- Screen 3: One-Time Pack ---- */

.paywall-screen3-header {
  text-align: center;
  margin-bottom: 16px;
}

.paywall-screen3-pill {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.2);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.paywall-screen[data-screen="3"] .paywall-drawer-title {
  text-align: center;
}

.paywall-screen[data-screen="3"] .paywall-drawer-subtitle {
  text-align: center;
}

.paywall-onetime-card {
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(251, 191, 36, 0.06), transparent 70%),
    rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(251, 191, 36, 0.15);
  border-radius: 16px;
  padding: 24px 20px 20px;
  text-align: center;
  margin-bottom: 16px;
  animation: textReveal 0.35s ease 0.1s both;
}

.paywall-onetime-credits {
  font-size: 3rem;
  font-weight: 800;
  color: #fbbf24;
  line-height: 1;
  letter-spacing: -0.04em;
}

.paywall-onetime-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
}

.paywall-onetime-price-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.paywall-onetime-price-big {
  font-size: 1.6rem;
  font-weight: 800;
  color: #e8e8ec;
  letter-spacing: -0.02em;
}

.paywall-onetime-once {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.35);
}

.paywall-onetime-perks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.paywall-onetime-perks li {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.paywall-onetime-perks li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.5);
  flex-shrink: 0;
}

/* Amber CTA variant for one-time pack */
.paywall-cta--amber {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.paywall-cta--amber:hover {
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.35);
}

.paywall-cta--amber::after {
  animation: ctaShimmer 2.5s ease-in-out 0.8s infinite;
}

/* ---- CTA button — GREEN gradient, 65px tall ---- */

.paywall-cta {
  width: 100%;
  background: linear-gradient(135deg, #34D399, #10B981);
  color: white;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 14px rgba(52, 211, 153, 0.3);
  position: relative;
  overflow: hidden;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 20px;
}

.paywall-cta-label {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.paywall-cta-price {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.paywall-cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 60%
  );
  transform: translateX(-100%);
  animation: ctaShimmer 2.5s ease-in-out 1.2s infinite;
}

.paywall-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(52, 211, 153, 0.35);
}

.paywall-cta:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(52, 211, 153, 0.3);
}

.paywall-cta:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Reassurance text */
.paywall-reassurance {
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.35);
  margin: 10px 0 0;
  letter-spacing: 0.01em;
}

/* "No thanks" links */
.paywall-no-thanks {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.8rem;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.25);
  text-underline-offset: 3px;
  background: none;
  border: none;
  cursor: pointer;
  display: block;
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.paywall-no-thanks:hover {
  color: rgba(255, 255, 255, 0.6);
  text-decoration-color: rgba(255, 255, 255, 0.3);
}

/* Screen 3 save button — prominent secondary action */
.paywall-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 340px;
  margin: 16px auto 0;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}

.paywall-save-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
}

.paywall-save-btn:active {
  transform: scale(0.97);
}

.paywall-save-btn svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* (or-divider and onetime-inline removed — one-time pack is now Screen 3) */

/* Screen content padding */
.paywall-screen {
  padding: 0 28px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

/* ---- Mobile: Full-screen paywall ---- */
@media (max-width: 599px) {
  #conversionModal.visible {
    padding: 0;
  }

  .paywall {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    border-radius: 0;
  }

  .paywall[data-active-screen="2"] .paywall-hero,
  .paywall[data-active-screen="3"] .paywall-hero {
    min-height: 120px;
  }

  .paywall-hero {
    padding: 20px;
  }

  .paywall-screen {
    padding: 0 20px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }

  .paywall-headline {
    font-size: 1.15rem;
    margin-bottom: 12px;
  }

  .paywall-drawer {
    padding: 20px;
  }

  .paywall-tier {
    padding: 16px 6px 12px;
  }

  .paywall-tier-badge {
    font-size: 0.5rem;
    padding: 2px 8px;
    top: -8px;
  }

  .paywall-tier-name {
    font-size: 0.55rem;
  }

  .paywall-tier-credits {
    font-size: 1.9rem;
  }

  .paywall-tier-unit {
    font-size: 0.52rem;
    margin-bottom: 6px;
  }

  .paywall-tier-price {
    font-size: 0.72rem;
  }
}

/* Very short mobile screens */
@media (max-width: 599px) and (max-height: 580px) {
  .paywall[data-active-screen="1"] .paywall-hero {
    min-height: 140px;
  }

  .paywall[data-active-screen="2"] .paywall-hero,
  .paywall[data-active-screen="3"] .paywall-hero {
    min-height: 80px;
  }

  .paywall-hero {
    padding: 16px;
  }

  .paywall-screen {
    padding: 0 16px 12px;
  }

  .paywall-headline {
    font-size: 1.05rem;
    margin-bottom: 10px;
  }

  .paywall-features {
    gap: 6px;
    margin-bottom: 10px;
  }

  .paywall-feature {
    font-size: 0.78rem;
  }

  .paywall-drawer {
    padding: 16px;
  }
}

/* ---- Desktop: Lightbox refinements (600-767px tablet) ---- */
@media (min-width: 600px) {
  .paywall-hero {
    padding: 28px;
  }

  .paywall-screen {
    padding: 0 32px 28px;
  }

  .paywall-headline {
    font-size: 1.4rem;
  }

  .paywall-drawer {
    padding: 28px;
  }

  .paywall-cta {
    padding: 16px 24px;
  }
}

/* ---- Desktop wide: Horizontal split layout (768px+) ---- */
@media (min-width: 768px) {
  .paywall {
    flex-direction: row;
    max-width: 840px;
    min-height: min(480px, 80dvh);
  }

  /* Hero: fixed-width left panel, full height */
  .paywall-hero {
    flex: 0 0 45%;
    width: 45%;
    padding: 32px;
  }

  /* Override ALL per-screen hero rules (vertical layout only) */
  .paywall[data-active-screen="1"] .paywall-hero,
  .paywall[data-active-screen="2"] .paywall-hero,
  .paywall[data-active-screen="3"] .paywall-hero {
    flex: 0 0 45%;
    min-height: unset;
    max-height: unset;
  }

  /* Hero image: larger, more dramatic on desktop */
  .paywall-hero img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 12px;
    box-shadow:
      0 12px 40px rgba(0, 0, 0, 0.5),
      0 0 1px rgba(255, 255, 255, 0.08),
      0 0 80px rgba(139, 124, 246, 0.08);
  }

  /* Right panel: subtle tint to separate from hero */
  .paywall-screen {
    background: rgba(255, 255, 255, 0.02);
    overflow-y: auto;
  }

  /* Screen 1: fill right panel, undo vertical-mode overflow:hidden */
  .paywall[data-active-screen="1"] .paywall-screen[data-screen="1"] {
    flex: 1;
    flex-shrink: unset;
    overflow: visible;
    padding: 32px;
  }

  /* Screens 2/3: screen has no padding, let drawer handle it */
  .paywall-screen[data-screen="2"],
  .paywall-screen[data-screen="3"] {
    padding: 0;
  }

  /* Drawer: fill right panel, no mobile bottom-sheet styling */
  .paywall-drawer {
    flex: 1;
    border-radius: 0;
    border-top: none;
    background: transparent;
    padding: 32px;
    justify-content: flex-start;
  }

  /* Push CTA + reassurance + "no thanks" to panel bottom */
  .paywall-screen[data-screen="1"] .paywall-cta,
  .paywall-drawer .paywall-cta {
    margin-top: auto;
  }

  /* Close button: over right panel */
  .paywall-close {
    right: 16px;
    top: 16px;
  }

  /* SD badge: breathe in larger panel */
  .paywall-sd-badge {
    top: 20px;
    left: 20px;
  }
}

/* ============================================
   LOGIN FORM
   ============================================ */
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 12px;
}

.login-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--glow);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.user-email {
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 20px;
  padding: 12px;
  background: var(--bg-subtle);
  border-radius: 12px;
  border: 1px solid var(--border);
}

/* ============================================
   LOGIN FORM - Enhanced Styling
   ============================================ */
.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
}

.login-form-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.login-footer {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

/* Email Sent State */
.login-sent {
  text-align: center;
  padding: 20px 0;
}

.login-sent-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--success);
}

.login-sent-email {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
  margin: 8px 0 16px;
}

/* ============================================
   ACCOUNT SHEET - Logged In View
   ============================================ */
.account-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  flex-shrink: 0;
}

.account-details {
  flex: 1;
  min-width: 0;
}

.account-email {
  font-weight: 500;
  color: var(--text);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.account-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.account-action-card:hover {
  border-color: var(--primary);
  background: var(--glow);
  transform: translateY(-1px);
}

.account-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  flex-shrink: 0;
}

.account-action-text {
  flex: 1;
  min-width: 0;
}

.account-action-title {
  display: block;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text);
}

.account-action-desc {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.account-action-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
}

.account-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

.account-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.account-link:hover {
  color: var(--error);
  background: rgba(239, 68, 68, 0.1);
}

/* Account credits display */
.account-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 12px;
}

.account-credits-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.account-credits-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

/* Sheet language section */
.sheet-lang-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.sheet-lang-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}

.sheet-lang-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============================================
   FIRST-TIME OFFER BANNER
   ============================================ */
.first-offer-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 1500;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.first-offer-banner.visible {
  display: flex;
}

.first-offer-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.first-offer-text {
  font-weight: 600;
  font-size: 0.95rem;
}

.first-offer-countdown {
  font-family: monospace;
  font-size: 0.85rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
}

.first-offer-btn {
  background: white;
  color: #667eea;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.first-offer-btn:hover {
  transform: scale(1.05);
}

.first-offer-close {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

/* ============================================
   LANGUAGE SWITCHER
   ============================================ */
.lang-switcher {
  position: relative;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lang-btn:hover {
  border-color: var(--primary);
  background: var(--glow);
  transform: translateY(-1px);
}

.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  overflow: hidden;
}

.lang-menu.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  padding: 12px 16px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  transition: background 0.1s;
  cursor: pointer;
}

.lang-option:first-child {
  border-radius: 11px 11px 0 0;
}

.lang-option:last-child {
  border-radius: 0 0 11px 11px;
}

.lang-option:hover {
  background: var(--bg-subtle);
}

.lang-option.active {
  background: var(--primary);
  color: white;
}

/* ============================================
   MOBILE RESPONSIVE - Standard phones
   ============================================ */
@media (max-width: 599px) {
  .modal-content {
    padding: 24px 20px;
    max-width: calc(100vw - 40px);
  }

  .modal-stats {
    gap: 24px;
    padding: 14px;
  }

  .modal-stat-value {
    font-size: 1.3rem;
  }

  .bottom-sheet {
    padding: 16px;
    padding-bottom: calc(16px + var(--safe-bottom));
  }

  .pack-info {
    gap: 3px;
  }

  .pack-detail {
    font-size: 0.8rem;
  }
}

/* ============================================
   MOBILE RESPONSIVE - Small screens (iPhone SE)
   ============================================ */
@media (max-width: 375px) {
  .modal-content {
    padding: 20px 16px;
  }

  .credit-pack {
    padding: 14px 12px;
  }

  .quality-toggle {
    gap: 6px;
  }

  .quality-chip {
    padding: 8px 10px;
    font-size: 0.75rem;
  }

  /* Compact buy sheet for small screens (iPhone SE) */
  #buySheet .buy-sheet-title {
    font-size: 1.1rem;
  }

  #buySheet .plan-option {
    padding: 8px 10px;
    gap: 8px;
  }

  #buySheet .plan-radio {
    width: 16px;
    height: 16px;
  }

  #buySheet .plan-name {
    font-size: 0.8rem;
    min-width: 50px;
  }

  #buySheet .plan-credits {
    font-size: 0.7rem;
  }

  #buySheet .plan-price {
    font-size: 0.85rem;
  }

  #buySheet .benefit {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .credit-pack {
    padding: 10px 10px;
    margin-bottom: 6px;
  }

  .pack-credits {
    font-size: 0.9rem;
  }

  .pack-detail, .pack-per-edit {
    font-size: 0.7rem;
  }

  .pack-bonus {
    font-size: 0.7rem;
  }

  .pack-price {
    font-size: 1rem;
  }

  .pack-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    top: -7px;
  }

  .pack-trust {
    font-size: 0.7rem; /* Smaller on mobile but still visible */
  }

  .sheet-btn {
    padding: 14px;
    font-size: 0.9rem;
    margin-top: 6px;
    min-height: 48px; /* Touch target minimum */
  }

  .sheet-btn-secondary {
    padding: 10px;
    font-size: 0.85rem;
    min-height: 44px;
  }
}

/* ============================================
   MOBILE RESPONSIVE - Edit card
   ============================================ */
@media (max-width: 480px) {
  .edit-card {
    padding: 12px;
    border-radius: 14px;
  }

  .prompt-input {
    min-height: 56px;
    padding: 10px;
    font-size: 0.95rem;
  }

  .edit-card-footer {
    flex-wrap: wrap;
    gap: 10px;
  }

  .footer-left {
    width: 100%;
    justify-content: space-between;
  }

  .quality-toggle {
    flex: 1;
    min-width: 0; /* Prevent overflow */
  }

  .toggle-option {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.85rem;
  }

  .edit-btn {
    width: 100%;
    padding: 14px 20px;
    min-height: 48px;
    justify-content: center;
  }

  .reference-btn {
    padding: 8px 12px;
    min-height: 40px;
  }

  .reference-btn svg {
    width: 18px;
    height: 18px;
  }

  .reference-btn-text {
    font-size: 0.8rem;
  }

  /* Smart recommendation - stack on mobile */
  .smart-recommend {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }

  .smart-recommend-text {
    font-size: 0.75rem;
  }

  .smart-recommend-btn {
    width: 100%;
    padding: 10px 14px;
    text-align: center;
  }
}

/* ============================================
   MOBILE RESPONSIVE - First offer banner
   ============================================ */
@media (max-width: 600px) {
  .first-offer-banner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
  }

  .first-offer-text {
    font-size: 0.85rem;
  }
}

/* ============================================
   DESKTOP RESPONSIVE
   ============================================ */
@media (min-width: 900px) {
  /* Bottom sheets - centered */
  .bottom-sheet {
    max-width: 440px;
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    border-radius: 20px 20px 0 0;
  }

  .bottom-sheet.visible {
    transform: translateX(-50%) translateY(0);
  }

  /* Buy sheet V9 - Centered lightbox modal on desktop */
  .buy-sheet-v9 {
    max-width: 720px;
    bottom: auto;
    top: 50%;
    border-radius: 24px;
    transform: translateX(-50%) translateY(-50%) scale(0.95);
    opacity: 0;
    pointer-events: none; /* CRITICAL: Don't block clicks when hidden */
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease;
  }

  .buy-sheet-v9.visible {
    transform: translateX(-50%) translateY(-50%) scale(1);
    opacity: 1;
    pointer-events: auto;
  }

  /* Hover states */
  .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--glow);
  }

  .btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
  }

  .btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
  }

  .quality-btn:hover:not(.active) {
    border-color: var(--primary);
    color: var(--text);
  }

  .text-link:hover {
    color: var(--primary) !important;
  }

  .credit-pack:hover:not(.selected) {
    border-color: var(--primary-light);
  }
}

/* ============================================
   HERO SHOWCASE - Text left, Video dominant right
   ============================================ */
.hero-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 20px 16px;
  gap: 12px;
}

/* On mobile, flatten the structure to allow reordering */
.hero-left {
  display: contents;
}

.hero-right {
  display: contents;
}

/* Mobile order: title → video → subtitle → button → etc */
.hero-title { order: 1; text-align: center; margin: 0; }
.hero-video { order: 2; width: 100%; margin: 8px 0; }
.hero-subtitle { order: 3; text-align: center; max-width: 360px; margin: 0 0 4px; }
.hero-upload-btn { order: 4; }
.hero-free-hint { order: 5; margin: 4px 0 0; }
.hero-proof { order: 6; margin-top: 8px; }
.hero-tags-waterfall { order: 7; display: none; } /* Hide on mobile for cleaner look */

.hero-video {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--border);
}

/* Waterfall tags under video */
.hero-tags-waterfall {
  position: relative;
  height: 100px;
  margin-top: 12px;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, black 0%, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 40%, transparent 100%);
}

.waterfall-tag {
  position: absolute;
  top: -5px;
  padding: 5px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  animation: waterfallDrop var(--fall-duration, 1.8s) linear forwards;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

@keyframes waterfallDrop {
  0% {
    transform: translateY(0);
    opacity: 0;
  }
  5% {
    opacity: 0.9;
  }
  60% {
    opacity: 0.9;
  }
  100% {
    transform: translateY(110px);
    opacity: 0;
  }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: rgba(139, 124, 246, 0.06);
  border: 1px solid rgba(139, 124, 246, 0.12);
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--primary);
  letter-spacing: 0.01em;
}

.hero-badge svg {
  width: 12px;
  height: 12px;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
  max-width: 360px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 2px;
}

.hero-tag {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.hero-upload-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 4px 16px rgba(139, 124, 246, 0.3);
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hero-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 124, 246, 0.4);
}

.hero-upload-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(139, 124, 246, 0.3);
}

.hero-upload-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.hero-upload-btn.loading .upload-icon {
  animation: spin 1s linear infinite;
}

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

.hero-upload-btn .upload-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.hero-free-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}

.hero-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.hero-avatars {
  display: flex;
}

.hero-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  margin-left: -6px;
  border: 2px solid var(--bg);
}

.hero-avatar:first-child {
  margin-left: 0;
}

.hero-proof-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Desktop hero - aligned with nav, video dominant */
@media (min-width: 900px) {
  .hero-showcase {
    flex-direction: row;
    align-items: flex-start;
    padding: 32px 24px;
    gap: 40px;
    max-width: none;
  }

  /* Restore container behavior on desktop */
  .hero-left {
    display: flex;
    flex-direction: column;
    flex: 0 0 280px;
    max-width: 280px;
    align-items: flex-start;
    text-align: left;
    gap: 14px;
    padding-top: 8px;
  }

  .hero-right {
    display: block;
    flex: 1;
  }

  /* Reset order and mobile styles on desktop */
  .hero-title,
  .hero-video,
  .hero-subtitle,
  .hero-upload-btn,
  .hero-free-hint,
  .hero-proof,
  .hero-tags-waterfall {
    order: unset;
    margin: 0;
  }

  .hero-title {
    font-size: 2rem;
    text-align: left;
  }

  .hero-subtitle {
    font-size: 0.95rem;
    max-width: none;
    text-align: left;
  }

  .hero-video {
    width: 100%;
    margin: 0;
  }

  .hero-tags-waterfall {
    display: block;
    margin-top: 20px;
  }

  .hero-proof {
    margin-top: 2px;
  }

  .hero-upload-btn {
    padding: 14px 28px;
    font-size: 1rem;
  }
}

/* Large desktop */
@media (min-width: 1100px) {
  .hero-showcase {
    padding: 40px 24px;
    gap: 56px;
  }

  .hero-left {
    flex: 0 0 320px;
    max-width: 320px;
  }

  .hero-title {
    font-size: 2.35rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }
}

/* Extra large desktop */
@media (min-width: 1400px) {
  .hero-showcase {
    padding: 48px 24px;
    gap: 72px;
  }

  .hero-left {
    flex: 0 0 380px;
    max-width: 380px;
  }

  .hero-title {
    font-size: 2.65rem;
  }
}

/* ============================================
   VIDEO SHOWCASE SECTION (legacy, below fold)
   ============================================ */
.showcase-section {
  margin: 32px 0;
  text-align: center;
}

.showcase-video {
  width: 100%;
  max-width: 720px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.showcase-tagline {
  margin-top: 20px;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
}

/* ============================================
   TRUST BAR
   ============================================ */
.trust-bar {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 32px 0;
  padding: 20px;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.trust-item svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ============================================
   SOCIAL PROOF
   ============================================ */
.social-proof {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 24px 0 40px;
}

/* Mobile responsive */
@media (max-width: 600px) {
  .showcase-tagline {
    font-size: 1.1rem;
  }

  .trust-bar {
    gap: 16px;
    padding: 16px;
  }

  .trust-item {
    font-size: 0.8rem;
  }

  .trust-item svg {
    width: 18px;
    height: 18px;
  }
}

/* ============================================
   HERO - CLEAN MINIMAL
   ============================================ */
.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   BELOW FOLD - PREMIUM
   ============================================ */

/* Value Strip */
.value-strip {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 24px 20px;
  flex-wrap: wrap;
}

.value-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.value-item svg {
  color: #22c55e;
  flex-shrink: 0;
}

/* Testimonial Card */
.testimonial-card {
  max-width: 480px;
  margin: 0 auto 48px;
  padding: 0 20px;
}

.testimonial-content {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.04);
}

.quote-icon {
  position: absolute;
  top: 16px;
  right: 20px;
  color: var(--primary);
}

.testimonial-content .testimonial-quote {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 16px 0;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, #7c6fe0 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
}

.author-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.author-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.author-detail {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Section Headers */
.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}

/* Features Section */
.features-section {
  max-width: 800px;
  margin: 0 auto 56px;
  padding: 0 20px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

@media (max-width: 900px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 500px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.2s ease;
  position: relative;
}

.feature-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 124, 246, 0.1);
}

.feature-card.featured {
  border-color: var(--primary-light);
  background: linear-gradient(to bottom, rgba(139, 124, 246, 0.05), transparent);
}

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: 12px;
  color: var(--text-muted);
}

.feature-icon-wrap.quick {
  background: rgba(251, 191, 36, 0.1);
  color: #f59e0b;
}

.feature-icon-wrap.smart {
  background: rgba(139, 124, 246, 0.1);
  color: var(--primary);
}

.feature-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 0;
}

.feature-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.feature-tag {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 100px;
  background: var(--bg-subtle);
  color: var(--text-muted);
}

.feature-tag.smart {
  background: rgba(139, 124, 246, 0.1);
  color: var(--primary);
}

/* FAQ Section */
.faq-section {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.faq-item summary {
  padding: 16px 0;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.faq-item[open] summary {
  border-bottom-color: transparent;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary svg {
  flex-shrink: 0;
  opacity: 0.3;
  transition: transform 0.2s ease;
}

.faq-item[open] summary svg {
  transform: rotate(180deg);
}

.faq-item p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  padding-bottom: 16px;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .value-strip {
    gap: 16px;
    padding: 20px 16px;
  }

  .value-item {
    font-size: 0.85rem;
  }

  .section-title {
    font-size: 1.25rem;
  }

  .testimonial-content {
    padding: 20px;
  }

  .testimonial-content .testimonial-quote {
    font-size: 1rem;
  }
}

.faq-item-minimal p {
  margin: 12px 0 0 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   TESTIMONIALS
   ============================================ */
.testimonials-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 32px 0;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.testimonial {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 20px;
  border-left: 3px solid var(--primary);
}

.testimonial-text {
  font-size: 0.95rem;
  color: var(--text);
  margin: 0 0 12px 0;
  font-style: italic;
  line-height: 1.5;
}

.testimonial-author {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.testimonial-name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
}

.testimonial-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .testimonials-section {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   TRUST SECTION
   ============================================ */
.trust-section {
  margin: 32px 0;
  text-align: center;
}

.trust-badges {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.trust-badge svg {
  color: var(--primary);
  flex-shrink: 0;
}

/* ============================================
   USE CASES UPGRADED
   ============================================ */
.use-case-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

/* ============================================
   FINAL CTA
   ============================================ */
.final-cta {
  text-align: center;
  margin: 40px 0 20px;
}

.final-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(139, 124, 246, 0.3);
}

.final-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(139, 124, 246, 0.4);
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
  text-align: center;
  margin: 40px 0 32px;
}

.how-it-works h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

.steps-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.step-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-text {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 500;
}

.step-arrow {
  color: var(--text-muted);
  font-size: 1.5rem;
  opacity: 0.5;
}

/* ============================================
   USE CASES SECTION
   ============================================ */
.use-cases-section {
  text-align: center;
  margin: 32px 0;
}

.use-cases-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.use-case {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-subtle);
  border-radius: 10px;
  text-align: left;
}

.use-case-icon {
  font-size: 1.2rem;
}

.use-case-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.3;
}

@media (max-width: 600px) {
  .use-cases-grid {
    grid-template-columns: 1fr 1fr;
  }

  .step-arrow {
    display: none;
  }

  .steps-row {
    gap: 12px;
  }
}

/* ============================================
   SOCIAL PROOF SECTION
   ============================================ */
.social-proof-section {
  text-align: center;
  margin: 32px 0;
  padding: 20px;
}

.social-proof-text {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ============================================
   LEGACY - QUICK VS SMART COMPARISON SECTION
   (keeping for backwards compat with pSEO pages)
   ============================================ */
.standard-vs-pro {
  margin: 48px 0;
  padding: 32px;
  background: var(--bg-subtle);
  border-radius: 20px;
  text-align: center;
}

.standard-vs-pro h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 24px;
}

/* Mode showcase - side by side cards */
.comparison-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 720px;
  margin: 0 auto;
}

.mode-showcase {
  background: var(--bg);
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease, transform 0.2s ease;
  text-align: left;
}

.mode-showcase:hover {
  transform: translateY(-2px);
}

.mode-showcase.smart {
  border-color: var(--primary);
}

.mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-subtle);
}

.mode-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}

.mode-showcase.smart .mode-name {
  color: var(--primary);
}

.mode-cost {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}

.mode-showcase img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.mode-prompt {
  padding: 14px 16px;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text);
  background: var(--bg);
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

.mode-best-for {
  padding: 10px 16px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.mode-showcase.smart .mode-best-for {
  color: var(--primary);
}

/* Mobile responsive */
@media (max-width: 600px) {
  .standard-vs-pro {
    margin: 32px 0;
    padding: 20px;
  }

  .standard-vs-pro h3 {
    font-size: 1.25rem;
  }

  .comparison-modes {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .mode-prompt {
    font-size: 0.85rem;
    padding: 12px 14px;
  }
}


/* ============================================
   PRICING SECTION - Homepage pricing cards
   ============================================ */
.pricing-section {
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--bg) 0%, #f8f7ff 100%);
}

.pricing-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.pricing-header {
  text-align: center;
  margin-bottom: 48px;
}

.pricing-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 12px 0;
  letter-spacing: -0.03em;
}

.pricing-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0 0 16px 0;
}

.pricing-free-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 16px;
  background: rgba(139, 124, 246, 0.08);
  border-radius: 100px;
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.free-note-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.free-note-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--primary);
  fill: rgba(139, 124, 246, 0.2);
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.pricing-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.2s ease;
}

.pricing-card:hover {
  border-color: var(--text-dimmed);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.pricing-card-popular {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(139, 124, 246, 0.04) 0%, #fff 100%);
  box-shadow: 0 4px 20px rgba(139, 124, 246, 0.15);
}

.pricing-card-popular:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(139, 124, 246, 0.25);
}

.pricing-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.pricing-card-free {
  background: #fafafa;
  border-style: dashed;
}

.pricing-card-header {
  text-align: center;
  margin-bottom: 16px;
}

.pricing-plan-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.pricing-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
}

.pricing-amount {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pricing-period {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pricing-credits {
  text-align: center;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.credits-number {
  display: block;
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}

.credits-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 4px;
}

.pricing-per-edit {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-dimmed);
  font-weight: 500;
  margin-bottom: 16px;
}

.pricing-card-popular .pricing-per-edit {
  color: var(--primary);
  font-weight: 600;
}

.pricing-features {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  flex: 1;
}

.pricing-features li {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 4px 0;
}

.pricing-cta {
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--primary);
  color: white;
}

.pricing-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 124, 246, 0.3);
}

.pricing-cta-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.pricing-cta-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-dimmed);
  box-shadow: none;
}

.pricing-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 600px;
  margin: 0 auto;
}

/* Pay As You Go Section */
.payg-section {
  margin-top: 40px;
  margin-bottom: 24px;
  text-align: center;
}

.payg-header {
  margin-bottom: 16px;
}

.payg-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.payg-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.payg-options {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.payg-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 24px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.payg-option:hover {
  border-color: var(--text-dimmed);
  transform: translateY(-2px);
}

.payg-option-best {
  border-color: var(--primary);
  background: rgba(139, 124, 246, 0.05);
}

.payg-option-best:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(139, 124, 246, 0.2);
}

.payg-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.payg-credits {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.payg-price {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .payg-options {
    gap: 8px;
  }

  .payg-option {
    padding: 14px 16px;
    min-width: 100px;
  }

  .payg-credits {
    font-size: 0.9rem;
  }

  .payg-price {
    font-size: 0.8rem;
  }
}

/* Tablet: 2x2 grid */
@media (max-width: 1024px) {
  .pricing-cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Mobile: Stack vertically, show popular first */
@media (max-width: 768px) {
  .pricing-section {
    padding: 60px 16px;
  }

  .pricing-title {
    font-size: 1.75rem;
  }

  .pricing-subtitle {
    font-size: 1rem;
  }

  .pricing-free-note {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .pricing-cards {
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto 24px;
  }

  /* Reorder: Popular first on mobile */
  .pricing-card-popular {
    order: -1;
  }

  .pricing-card {
    padding: 20px 16px;
  }

  .credits-number {
    font-size: 2rem;
  }

  .pricing-amount {
    font-size: 1.75rem;
  }

  .pricing-features li {
    font-size: 0.85rem;
    padding: 6px 0;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .pricing-section {
    padding: 48px 12px;
  }

  .pricing-header {
    margin-bottom: 32px;
  }

  .pricing-title {
    font-size: 1.5rem;
  }
}

/* ============================================
   POST-EDIT OVERLAY - Floating action buttons
   REMOVED: Redundant with bottom action bar (result-actions)
   The bottom bar provides Save/Share/Add Photo/New functionality
   ============================================ */
.post-edit-overlay {
  display: none !important; /* Hidden - use bottom action bar instead */
}

.post-edit-actions {
  display: flex;
  flex-direction: row;
  gap: 12px;
  padding: 16px;
  align-items: flex-end;
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
}

.post-edit-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 14px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: #1f2937;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.post-edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3);
}

.post-edit-btn:active {
  transform: scale(0.95);
}

/* Primary button (Download) - prominent styling with pulse */
.post-edit-btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  padding: 14px 20px;
  box-shadow: 0 4px 20px rgba(139, 124, 246, 0.4);
  animation: post-edit-pulse 2s ease-in-out infinite;
}

.post-edit-btn-primary:hover {
  box-shadow: 0 6px 28px rgba(139, 124, 246, 0.5);
  animation: none;
}

.post-edit-btn-primary svg {
  stroke: white;
}

/* Pulse animation to draw attention */
@keyframes post-edit-pulse {
  0%, 100% {
    box-shadow: 0 4px 20px rgba(139, 124, 246, 0.4);
  }
  50% {
    box-shadow: 0 4px 30px rgba(139, 124, 246, 0.6), 0 0 0 8px rgba(139, 124, 246, 0.15);
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .post-edit-actions {
    bottom: 12px;
    gap: 10px;
    padding: 12px;
  }

  .post-edit-btn {
    padding: 10px 14px;
    font-size: 0.75rem;
    border-radius: 12px;
  }

  .post-edit-btn-primary {
    padding: 12px 18px;
  }

  .post-edit-btn span {
    display: none; /* Hide labels on mobile, show only icons */
  }

  .post-edit-btn {
    flex-direction: row;
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .post-edit-btn-primary {
    width: 56px;
    height: 56px;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .post-edit-actions {
    bottom: 8px;
    gap: 8px;
  }

  .post-edit-btn {
    width: 44px;
    height: 44px;
  }

  .post-edit-btn svg {
    width: 18px;
    height: 18px;
  }

  .post-edit-btn-primary {
    width: 52px;
    height: 52px;
  }

  .post-edit-btn-primary svg {
    width: 20px;
    height: 20px;
  }
}

/* ============================================
   CELEBRATION CONFETTI - Post-edit dopamine hit
   ============================================ */
.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10001;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(-10px) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0;
  }
}

/* Edit complete success badge */
.edit-success-badge {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  padding: 16px 28px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(139, 124, 246, 0.4);
  z-index: 10002;
  pointer-events: none;
  animation: success-badge-pop 2s ease-out forwards;
  display: flex;
  align-items: center;
  gap: 10px;
}

.edit-success-badge svg {
  width: 24px;
  height: 24px;
}

@keyframes success-badge-pop {
  0% {
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
  }
  15% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
  25% {
    transform: translate(-50%, -50%) scale(1);
  }
  80% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
  }
}
/* ============================================
   BUY SHEET V7 - Clean, High-Converting Design
   Mobile-first, vertical stack, clear hierarchy
   ============================================ */

.buy-sheet-v7 {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 95dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  padding: 12px 20px 0;
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0.3s;
  z-index: 10002; /* Above GDPR banner (9999) and sheet-overlay (10001) */
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.15);
  touch-action: pan-y;
}

/* Scrollable content area */
.buy-sheet-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}

/* Sticky footer with CTA */
.buy-sheet-footer {
  flex-shrink: 0;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.buy-sheet-v7.visible {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 0s;
}

/* Sheet handle - larger touch target */
.buy-sheet-v7 .sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
  /* Larger touch area without changing visual size */
  padding: 12px 32px;
  margin-top: -12px;
  background-clip: content-box;
  cursor: grab;
  touch-action: pan-y;
}

/* Close button */
.buy-sheet-v7 .buy-sheet-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.1s, color 0.1s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.buy-sheet-v7 .buy-sheet-close:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.buy-sheet-v7 .buy-sheet-close:active {
  transform: scale(0.9);
  background: var(--bg-secondary);
}

/* Header */
.buy-header-v7 {
  text-align: center;
  margin-bottom: 12px;
  padding-left: 44px;
  padding-right: 44px; /* Balance for close button */
}

/* Header icon - lightning bolt style */
.header-icon {
  width: 48px;
  height: 48px;
  background: rgba(139, 124, 246, 0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  color: var(--primary);
}

.header-icon svg {
  width: 24px;
  height: 24px;
}

.buy-title-v7 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.buy-subtitle-v7 {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

.buy-social-proof-v7 {
  font-size: 0.8rem;
  color: var(--text-dimmed);
  margin: 6px 0 0 0;
}

/* Image Preview - shown when user has an edit waiting */
.buy-preview-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
}

.buy-preview-img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.buy-preview-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Benefits */
.buy-benefits {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.03) 100%);
  border-radius: 10px;
}

.benefit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--text);
}

.benefit-item svg {
  flex-shrink: 0;
  stroke: #10b981;
}

/* ============================================
   INTRO OFFER COMPONENT - Centralized styles
   Variants: card, banner, inline
   ============================================ */

/* Card variant (buy sheet, standalone) */
.intro-offer-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid #f59e0b;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.intro-offer-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: shimmer 3s ease-in-out infinite;
}

.intro-offer-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.intro-offer-card.urgent {
  animation: pulse-urgent 1s ease-in-out infinite;
  border-color: #dc2626;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.intro-offer-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  z-index: 1;
}

.intro-offer-card.urgent .intro-offer-badge {
  background: #dc2626;
}

.intro-offer-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  z-index: 1;
}

.intro-offer-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.intro-offer-price-amount {
  font-size: 1.25rem;
  font-weight: 800;
  color: #92400e;
}

.intro-offer-price-period {
  font-size: 0.9rem;
  font-weight: 600;
  color: #92400e;
}

.intro-offer-renewal {
  font-size: 0.8rem;
  color: #78716c;
}

.intro-offer-meta {
  font-size: 0.8rem;
  color: #78350f;
}

.intro-offer-meta .intro-offer-credits {
  font-weight: 600;
}

.intro-offer-meta .intro-offer-cancel {
  opacity: 0.7;
}

.intro-offer-meta .intro-offer-credits::after {
  content: ' · ';
}

.intro-offer-timer {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: rgba(120, 53, 15, 0.1);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #78350f;
  flex-shrink: 0;
  z-index: 1;
}

/* Banner variant (editor, compact) */
.intro-offer-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1.5px solid #f59e0b;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}

.intro-offer-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.3) 50%, transparent 60%);
  animation: shimmer 3s ease-in-out infinite;
}

.intro-offer-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.intro-offer-banner.urgent {
  animation: pulse-urgent 1s ease-in-out infinite;
  border-color: #dc2626;
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.intro-offer-banner-icon {
  font-size: 1.1rem;
  z-index: 1;
}

.intro-offer-banner-text {
  font-size: 0.9rem;
  color: #92400e;
  font-weight: 500;
  z-index: 1;
}

.intro-offer-banner-text strong {
  font-weight: 700;
  color: #78350f;
}

.intro-offer-banner-badge {
  padding: 2px 6px;
  background: #f59e0b;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
  z-index: 1;
}

.intro-offer-banner.urgent .intro-offer-banner-badge {
  background: #dc2626;
}

.intro-offer-banner-timer {
  padding: 4px 10px;
  background: rgba(120, 53, 15, 0.1);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #78350f;
  margin-left: auto;
  z-index: 1;
}

/* Inline CTA variant (conversion modal) */
.intro-offer-inline {
  width: 100%;
}

.intro-offer-cta {
  width: 100%;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s, box-shadow 0.15s;
}

.intro-offer-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.intro-offer-cta-main {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.intro-offer-cta-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: white;
}

.intro-offer-cta-period {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
}

.intro-offer-cta-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

.intro-offer-cta-credits {
  font-weight: 600;
}

.intro-offer-cta-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.intro-offer-badge-discount {
  background: #dc2626;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.intro-offer-cta-cancel {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Dark mode for intro offer */
@media (prefers-color-scheme: dark) {
  .intro-offer-card,
  .intro-offer-banner {
    background: linear-gradient(135deg, #422006 0%, #78350f 100%);
    border-color: #f59e0b;
  }

  .intro-offer-price-amount,
  .intro-offer-price-period,
  .intro-offer-banner-text,
  .intro-offer-banner-text strong {
    color: #fcd34d;
  }

  .intro-offer-renewal {
    color: #d6d3d1;
  }

  .intro-offer-meta {
    color: #fef3c7;
  }

  .intro-offer-timer,
  .intro-offer-banner-timer {
    background: rgba(252, 211, 77, 0.15);
    color: #fcd34d;
  }

  .intro-offer-card.urgent,
  .intro-offer-banner.urgent {
    background: linear-gradient(135deg, #450a0a 0%, #7f1d1d 100%);
    border-color: #dc2626;
  }
}

/* Plan cards - vertical stack */
.buy-plans-v7,
.buy-packs-v7 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

/* Pack expiry note */
.pack-expiry-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 8px 0 0;
  opacity: 0.8;
}

/* CTA Button */
.buy-cta-v7 {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 16px 24px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  /* Direct text styling - JS may set innerHTML directly */
  color: white;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.buy-cta-v7:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.buy-cta-v7:active {
  transform: translateY(0);
}

.buy-cta-v7 .cta-text {
  font-size: 1rem;
  font-weight: 600;
  color: white;
}

.buy-cta-v7 .cta-price {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
}

/* Trust signals */
.buy-trust,
.buy-trust-v7 {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.buy-trust .trust-item {
  font-size: 0.75rem;
  gap: 4px;
}

.buy-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.buy-trust-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.buy-trust-sep {
  color: var(--text-dimmed);
}

/* Sign-in link for returning users */
.buy-signin-link {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}

.buy-signin-link:hover {
  color: var(--primary);
}

/* Hide sign-in link when logged in (populated by JS) */
.buy-signin-link.hidden {
  display: none;
}

/* Desktop: wider sheet, centered */
@media (min-width: 600px) {
  .buy-sheet-v7 {
    left: 50%;
    transform: translateX(-50%) translateY(100%);
    max-width: 420px;
    border-radius: 20px;
    bottom: 20px;
    /* visibility inherited from base rule */
  }

  .buy-sheet-v7.visible {
    transform: translateX(-50%) translateY(0);
    /* visibility inherited from base .visible rule */
  }

  .buy-header-v7 {
    padding-left: 0;
    padding-right: 0;
  }
}

/* ============================================
   New Buy Sheet: Pack Cards + Subscription Row
   ============================================ */

/* Value Anchor Header */
.buy-value-anchor {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
  line-height: 1.4;
}

.buy-social-proof {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.buy-ppp-badge {
  font-size: 0.75rem;
  color: #065f46;
  font-weight: 600;
  margin: 8px 0 0;
  padding: 6px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(52, 211, 153, 0.25));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.buy-ppp-badge::before {
  content: '🎉';
  font-size: 0.85rem;
}

/* Pack Cards Grid (2 columns) */
.buy-packs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.pack-card,
.option-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Default card - light purple tint */
.pack-card,
.option-card {
  background: rgba(139, 124, 246, 0.06);
  border-color: rgba(139, 124, 246, 0.2);
}

.pack-card:hover,
.option-card:hover {
  border-color: var(--primary);
  background: rgba(139, 124, 246, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 124, 246, 0.15);
}

.pack-card:active,
.option-card:active {
  transform: scale(0.98);
  border-color: var(--primary);
}

/* Best Value card - green tint (overrides purple) */
.pack-card-best {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}

.pack-card-best:hover {
  border-color: var(--success);
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

.pack-card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 12px;
  background: var(--success);
  color: #065f46;
  font-size: 9px;
  font-weight: 700;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.pack-card-header {
  margin-bottom: 8px;
}

.pack-card-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.pack-card-price {
  margin-bottom: 8px;
}

.pack-card-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 2px;
}

.pack-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 12px;
}

.pack-card-per-edit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.pack-card-savings {
  font-size: 0.7rem;
  font-weight: 600;
  color: #059669;
}

.pack-card-best .pack-card-savings {
  color: #059669;
  font-weight: 600;
}

.pack-card-cta,
.card-cta {
  width: 100%;
  margin-top: 14px;
  padding: 10px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.pack-card:hover .pack-card-cta,
.option-card:hover .card-cta {
  background: var(--primary-hover);
}

.pack-card-best .pack-card-cta,
.pack-card-best .card-cta {
  background: #059669;
}

.pack-card-best:hover .pack-card-cta,
.pack-card-best:hover .card-cta {
  background: #047857;
}

/* Card badge - absolute positioned pill */
.card-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #065f46;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  white-space: nowrap;
  z-index: 1;
}

/* Alias for elevated design compatibility */
.card-best {
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.3);
}

.card-best:hover {
  border-color: var(--success);
  background: rgba(52, 211, 153, 0.15);
  box-shadow: 0 4px 12px rgba(52, 211, 153, 0.2);
}

.card-best .card-cta,
.card-best .pack-card-cta {
  background: #059669;
}

.card-best:hover .card-cta,
.card-best:hover .pack-card-cta {
  background: #047857;
}

/* Subscription Divider */
.buy-sub-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.buy-sub-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.buy-sub-divider-text {
  font-size: 0.8rem;
  color: var(--text-dimmed);
  white-space: nowrap;
}

/* Subscription Card - Matches pack card style */
.sub-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 20px 16px;
  background: rgba(56, 189, 248, 0.08);
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.sub-card:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.sub-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.sub-card .sub-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #0c4a6e;
  font-size: 9px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sub-quantity {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-top: 8px;
}

.sub-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sub-price-small {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-top: 8px;
}

.sub-price-small span {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.8;
}

.sub-unit {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}

.sub-cta {
  width: 100%;
  margin-top: 14px;
  padding: 10px 16px;
  background: #0ea5e9;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  transition: all 0.15s;
}

.sub-card:hover .sub-cta {
  background: #0284c7;
}

/* Legacy sub-row styles for backward compatibility */
.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: rgba(56, 189, 248, 0.1);
  border: 2px solid rgba(56, 189, 248, 0.25);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 16px;
  text-align: left;
}

.sub-row:hover {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.15);
}

.sub-row:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.sub-row-left,
.sub-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-row-icon,
.sub-icon {
  width: 40px;
  height: 40px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.sub-row-icon svg,
.sub-icon svg {
  width: 20px;
  height: 20px;
}

.sub-row-info,
.sub-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sub-row-name,
.sub-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.sub-row-badge,
.sub-badge {
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: #0c4a6e;
  padding: 4px 12px;
  border-radius: 100px;
  letter-spacing: 0.05em;
}

.sub-row-details,
.sub-details {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sub-row-right,
.sub-right {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: right;
}

.sub-row-pricing,
.sub-pricing {
  display: flex;
  flex-direction: column;
}

.sub-row-price,
.sub-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sub-row-period,
.sub-period {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.sub-row-arrow,
.sub-arrow {
  color: var(--text-dimmed);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.sub-row-arrow svg,
.sub-arrow svg {
  width: 16px;
  height: 16px;
}

.sub-row:hover .sub-row-arrow,
.sub-card:hover .sub-arrow {
  transform: translateX(2px);
  color: var(--accent);
}

/* Legacy sub-row classes for backward compatibility */
.sub-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sub-row-edits {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.sub-row-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sub-row-per-edit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sub-row-cancel {
  font-size: 0.8rem;
  color: var(--text-dimmed);
}

/* Feature List - Horizontal pill layout */
.buy-features,
.features-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 0 24px;
}

.buy-feature-item,
.feature-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.buy-feature-item svg,
.feature-pill svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  stroke: var(--primary);
}

.buy-smart-note {
  font-size: 0.8rem;
  color: var(--text-dimmed);
  margin: 8px 0 0;
  padding-left: 24px;
}

/* Premium Perks Section - Elevated design */
.premium-perks-section {
  margin: 16px 0 8px;
  padding: 16px 18px;
  background: linear-gradient(145deg, rgba(139, 124, 246, 0.06) 0%, rgba(99, 102, 241, 0.03) 100%);
  border: 1px solid rgba(139, 124, 246, 0.12);
  border-radius: 14px;
  position: relative;
}

.perks-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.perks-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, #8B7CF6 0%, #7C3AED 100%);
  border-radius: 6px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: white;
  text-transform: uppercase;
  box-shadow: 0 2px 8px -2px rgba(139, 124, 246, 0.4);
}

.perks-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: -0.01em;
}

.perks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  justify-content: flex-start;
}

.perk-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px 6px 8px;
  background: rgba(139, 124, 246, 0.08);
  border-radius: 8px;
  transition: background 0.2s ease;
}

.perk-item:hover {
  background: rgba(139, 124, 246, 0.12);
}

.perk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.perk-icon svg {
  width: 14px;
  height: 14px;
  stroke: #A78BFA;
  stroke-width: 2.5;
}

.perk-text {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}

/* Highlight perk - "Credits never expire" */
.perk-item-highlight {
  background: linear-gradient(135deg, rgba(139, 124, 246, 0.15) 0%, rgba(167, 139, 250, 0.1) 100%);
  border: 1px solid rgba(139, 124, 246, 0.2);
}

.perk-item-highlight .perk-icon svg {
  stroke: #A78BFA;
}

.perk-item-highlight .perk-text {
  color: #C4B5FD;
  font-weight: 600;
}

/* Elevated Buysheet v4 - Header */
.buy-header-v7 .sheet-headline {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Step 2 headline - slightly smaller */
#buySheetStep2 .sheet-headline {
  font-size: 1.15rem;
  margin-bottom: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.buy-header-v7 .sheet-subline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ============================================
   UNIFIED PRICING CARD ELEMENTS
   Consistent styling across buy sheet & homepage
   ============================================ */

/* Quantity - the big number (20, 60, 80) */
.pack-card .card-quantity,
.pricing-card .pricing-card-qty {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

/* Label - "edits" or "edits/mo" */
.pack-card .card-label,
.pricing-card .pricing-card-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

/* Price row - contains original + current price */
.pack-card .card-price-row,
.pricing-card .pricing-card-price-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 4px;
}

/* Original price - strikethrough (hidden by default, shown with PPP) */
.pack-card .card-price-original,
.pricing-card .pricing-card-original {
  display: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-dimmed);
  text-decoration: line-through;
}

.pack-card .card-price-original.visible,
.pricing-card .pricing-card-original.visible {
  display: inline;
}

/* Current price */
.pack-card .card-price,
.pricing-card .pricing-card-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

/* Price suffix (/mo) */
.pack-card .card-price-suffix,
.pricing-card .pricing-card-suffix {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Per-edit unit price */
.pack-card .card-unit,
.pricing-card .pricing-card-unit {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* Best value card - green accent for unit */
.pack-card-best .card-unit,
.pricing-card--best .pricing-card-unit {
  color: #059669;
  font-weight: 600;
}

/* Subscription card styling - blue accent */
.pack-card-sub {
  background: rgba(14, 165, 233, 0.08) !important;
  border-color: rgba(14, 165, 233, 0.25) !important;
}

.pack-card-sub:hover {
  border-color: #0ea5e9 !important;
  background: rgba(14, 165, 233, 0.12) !important;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15) !important;
}

.pack-card-sub .card-cta {
  background: #0ea5e9;
}

.pack-card-sub:hover .card-cta {
  background: #0284c7;
}

/* Subscription badge - blue */
.card-badge-sub {
  background: #0ea5e9 !important;
  color: white !important;
}

/* Homepage subscription card */
.pricing-card--sub {
  background: rgba(14, 165, 233, 0.08);
  border-color: rgba(14, 165, 233, 0.25);
}

.pricing-card--sub:hover {
  border-color: #0ea5e9;
  background: rgba(14, 165, 233, 0.12);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.15);
}

.pricing-card-badge--sub {
  background: #0ea5e9 !important;
  color: white !important;
}

/* PPP discount highlight - pulse the price when discounted */
.pack-card .card-price.ppp-discounted,
.pricing-card .pricing-card-price.ppp-discounted {
  color: #059669;
  animation: ppp-pulse 0.6s ease-out;
}

@keyframes ppp-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* Elevated Buysheet v4 - Trust Row */
.buy-sheet-footer .trust-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 10px;
}

.buy-sheet-footer .trust-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
}

.buy-sheet-footer .trust-item svg {
  width: 13px;
  height: 13px;
  opacity: 0.7;
  stroke: var(--primary);
}

/* Mobile: smaller elevated buysheet */
@media (max-width: 380px) {
  .buy-header-v7 .sheet-headline {
    font-size: 1.25rem;
  }

  .pack-card .card-quantity {
    font-size: 1.85rem;
  }

  .buy-sheet-footer .trust-row {
    gap: 10px;
  }

  .buy-sheet-footer .trust-item {
    font-size: 0.62rem;
  }
}

/* Conversion Modal - Value Anchor */
.conversion-value-anchor {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  margin: 0 0 12px;
  line-height: 1.4;
}

.conversion-features-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Mobile: smaller pack card padding */
@media (max-width: 380px) {
  .buy-packs-grid {
    gap: 8px;
  }

  .pack-card {
    padding: 14px 10px;
  }

  .pack-card-amount {
    font-size: 1.85rem;
  }

  .buy-features,
  .features-row {
    gap: 4px;
    padding: 0 18px;
  }

  .buy-feature-item,
  .feature-pill {
    padding: 5px 8px;
    font-size: 0.65rem;
  }

  /* Premium perks - compact on small mobile */
  .premium-perks-section {
    margin: 0 12px 12px;
    padding: 12px 12px 14px;
  }

  .perks-grid {
    gap: 8px;
  }

  .perk-icon {
    width: 28px;
    height: 28px;
  }

  .perk-icon svg {
    width: 14px;
    height: 14px;
  }

  .perk-text {
    font-size: 0.7rem;
  }
}

/* Very small screens: stack cards vertically */
@media (max-width: 340px) {
  .buy-packs-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   FOCUSED DROPZONE HERO (Pre-upload)
   Clean, centered upload experience
   ============================================ */
.hero-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 24px 16px;
  gap: 20px;
}

.hero-dropzone-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-align: center;
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.hero-dropzone-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
  margin: -8px 0 0;
  line-height: 1.5;
}

.dropzone-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  max-width: 400px;
  padding: 48px 32px 40px;
  background: rgba(var(--primary-rgb), 0.04);
  border: 2px dashed rgba(var(--primary-rgb), 0.2);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone-box:hover {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb), 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(var(--primary-rgb), 0.15);
}

.dropzone-box:active {
  transform: translateY(0);
}

.dropzone-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glow);
  border-radius: 18px;
  color: var(--primary);
}

.dropzone-icon svg {
  width: 36px;
  height: 36px;
}

.dropzone-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}

.dropzone-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ============================================
   FREE EDIT BADGE
   Stuck to bottom of dropzone, half on/half off
   ============================================ */
.free-badge {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg);
  border: 2px solid rgba(var(--primary-rgb), 0.2);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--primary);
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.free-badge-icon {
  font-size: 0.9rem;
}

/* ============================================
   START HERE NUDGE
   Handwritten annotation that writes in + arrow draws in
   to prompt first-time visitors to click the dropzone.
   Auto-dismisses on interaction or after 18s.
   ============================================ */
.start-here {
  position: absolute;
  top: -6px;
  right: 24px;
  transform: translateY(-100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  animation: sh-fade-in 0.3s ease 0.8s forwards;
}

.start-here-label {
  font-family: 'Caveat', cursive;
  font-size: 1.45rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  transform: rotate(-3deg);
  letter-spacing: 0.02em;
  /* Write-in: clip reveals text left-to-right */
  clip-path: inset(0 100% 0 0);
  animation:
    sh-write 0.6s cubic-bezier(0.22, 0.61, 0.36, 1) 1s forwards,
    sh-bob 3.2s ease-in-out 2.2s infinite;
}

.start-here-arrow {
  width: 22px;
  height: 32px;
  color: var(--primary);
  margin-top: -3px;
  opacity: 0.8;
}

/* Arrow line draws in after text */
.start-here-arrow .sh-line {
  stroke-dasharray: 42;
  stroke-dashoffset: 42;
  animation: sh-draw 0.45s cubic-bezier(0.4, 0, 0.2, 1) 1.55s forwards;
}

/* Arrowhead pops in after line */
.start-here-arrow .sh-head {
  opacity: 0;
  animation: sh-head-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1) 1.95s forwards;
}

/* Dismiss */
.start-here.sh-out {
  animation: sh-exit 0.35s ease forwards !important;
}
.start-here.sh-out .start-here-label,
.start-here.sh-out .sh-line,
.start-here.sh-out .sh-head {
  animation: none !important;
}

/* Hide during onboarding */
body.onboarding-active .start-here { display: none !important; }

@keyframes sh-fade-in {
  to { opacity: 1; }
}

@keyframes sh-write {
  to { clip-path: inset(0 0% 0 0); }
}

@keyframes sh-bob {
  0%, 100% { transform: rotate(-3deg) translateY(0); }
  50% { transform: rotate(-1.5deg) translateY(-5px); }
}

@keyframes sh-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes sh-head-in {
  from { opacity: 0; transform: scale(0.4); }
  to { opacity: 0.8; transform: scale(1); }
}

@keyframes sh-exit {
  to {
    opacity: 0;
    transform: translateY(calc(-100% - 10px));
  }
}

/* Desktop — shift annotation further right */
@media (min-width: 900px) {
  .start-here {
    right: -8px;
    top: -2px;
  }

  .start-here-label {
    font-size: 1.6rem;
  }

  .start-here-arrow {
    width: 26px;
    height: 36px;
  }
}

/* ============================================
   ROTATING PROMPT HINT
   Fade-transitioning example prompts
   ============================================ */
.dropzone-prompt {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  opacity: 0.7;
  transition: opacity 0.4s ease;
  min-height: 1.4em;
  text-align: center;
}

.dropzone-prompt.fade-out {
  opacity: 0;
}


/* ============================================
   DROPZONE SUBTEXT
   Value prop under dropzone
   ============================================ */
.dropzone-subtext {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 340px;
  line-height: 1.5;
}

.dropzone-tasks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 4px;
  max-width: 400px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone-task {
  color: var(--text-secondary);
  font-weight: 500;
}

.dropzone-task-sep {
  color: var(--border);
}

.dropzone-free-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0;
}

/* Elevated chips */
.dropzone-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 440px;
}

.dropzone-chip {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 100px;
  transition: all 0.15s ease;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dropzone-chip:active {
  transform: scale(0.96);
  background: var(--glow);
}

.dropzone-chip:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: rgba(139, 124, 246, 0.04);
}

.dropzone-chip--more {
  color: var(--primary);
  border-color: transparent;
  background: rgba(139, 124, 246, 0.08);
}

.dropzone-chip--more:hover {
  background: rgba(139, 124, 246, 0.12);
}

/* Elevated free hint */
.dropzone-free {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.dropzone-free svg {
  color: var(--primary);
  fill: rgba(139, 124, 246, 0.15);
  flex-shrink: 0;
}

.dropzone-free-sep {
  color: var(--border);
}

@media (max-width: 400px) {
  .dropzone-chips {
    gap: 6px;
  }

  .dropzone-chip {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .dropzone-free {
    font-size: 0.8rem;
    gap: 6px;
  }
}

/* Desktop dropzone */
@media (min-width: 900px) {
  .hero-dropzone {
    padding: 48px 24px;
    gap: 28px;
  }

  .hero-dropzone-title {
    font-size: 2.5rem;
  }

  .dropzone-box {
    max-width: 480px;
    padding: 64px 48px;
  }

  .dropzone-icon {
    width: 88px;
    height: 88px;
    border-radius: 22px;
  }

  .dropzone-icon svg {
    width: 44px;
    height: 44px;
  }

  .dropzone-text {
    font-size: 1.25rem;
  }

  .dropzone-tasks {
    max-width: 500px;
    gap: 8px 6px;
    font-size: 0.9rem;
  }
}

/* ============================================
   SHOWCASE STRIP - Transformation Theater
   ============================================ */
.showcase-strip {
  width: 100%;
  overflow: hidden;
  padding: 20px 0;
  position: relative;
  mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 8%,
    black 92%,
    transparent 100%
  );
}

/* Subtle grain overlay */
.showcase-strip::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.025;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.showcase-track {
  display: flex;
  gap: 20px;
  animation: marquee 30s linear infinite;
  width: max-content;
}

.showcase-track:hover {
  animation-play-state: paused;
}

@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Individual card */
.showcase-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: relative;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Backlight glow */
.showcase-card::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: 20px;
  background: radial-gradient(
    ellipse at center,
    rgba(var(--primary-rgb), 0.12) 0%,
    transparent 70%
  );
  border-radius: 16px;
  filter: blur(8px);
  z-index: -1;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

/* Hover: spotlight effect */
.showcase-track:hover .showcase-card {
  opacity: 0.5;
}

.showcase-track:hover .showcase-card:hover {
  opacity: 1;
  transform: scale(1.05);
}

.showcase-track:hover .showcase-card:hover::before {
  opacity: 1;
}

/* Frame container */
.showcase-frame {
  position: relative;
  width: 140px;
  height: 105px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-subtle);
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.04);
}

.showcase-before,
.showcase-after {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.showcase-after {
  clip-path: inset(0 100% 0 0);
  animation: wipe-reveal 5.3s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes wipe-reveal {
  0%, 35% {
    clip-path: inset(0 100% 0 0);
  }
  45%, 85% {
    clip-path: inset(0 0 0 0);
  }
  95%, 100% {
    clip-path: inset(0 100% 0 0);
  }
}

/* Pause wipe animation on hover */
.showcase-track:hover .showcase-after {
  animation-play-state: paused;
}

/* Label */
.showcase-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

/* Reference card (equation layout) - for future use with reference images */
.showcase-card--reference .showcase-frame {
  width: auto;
  height: auto;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.showcase-card--reference .showcase-base,
.showcase-card--reference .showcase-result {
  width: 90px;
  height: 68px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.06),
    0 4px 16px rgba(0, 0, 0, 0.04);
}

.showcase-card--reference .showcase-ref {
  width: 56px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid var(--primary-light);
  box-shadow: 0 0 12px rgba(var(--primary-rgb), 0.2);
}

.showcase-op {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  text-shadow: 0 0 8px rgba(var(--primary-rgb), 0.3);
}

/* Mobile sizing */
@media (max-width: 599px) {
  .showcase-strip {
    padding: 16px 0;
    touch-action: pan-x; /* Allow horizontal swipe on mobile */
    cursor: grab;
  }

  .showcase-strip:active {
    cursor: grabbing;
  }

  .showcase-track {
    gap: 16px;
  }

  .showcase-frame {
    width: 120px;
    height: 90px;
    border-radius: 8px;
  }

  .showcase-label {
    font-size: 0.65rem;
  }

  .showcase-card--reference .showcase-base,
  .showcase-card--reference .showcase-result {
    width: 72px;
    height: 54px;
  }

  .showcase-card--reference .showcase-ref {
    width: 44px;
    height: 33px;
  }

  .showcase-op {
    font-size: 0.85rem;
  }
}

/* Desktop sizing */
@media (min-width: 900px) {
  .showcase-strip {
    padding: 28px 0;
  }

  .showcase-track {
    gap: 28px;
  }

  .showcase-frame {
    width: 180px;
    height: 135px;
    border-radius: 12px;
  }

  .showcase-label {
    font-size: 0.75rem;
  }

  .showcase-card--reference .showcase-base,
  .showcase-card--reference .showcase-result {
    width: 120px;
    height: 90px;
  }

  .showcase-card--reference .showcase-ref {
    width: 72px;
    height: 54px;
  }
}

/* ============================================
   HERO V2 - Elevated Landing Experience
   ============================================ */
.hero-v2 {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 32px 20px;
  gap: 32px;
}

.hero-v2-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  max-width: 500px;
}

.hero-v2-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0;
}

.hero-v2-accent {
  color: var(--primary);
}

.hero-v2-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.4;
}

.hero-v2-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 16px rgba(139, 124, 246, 0.35);
  margin-top: 8px;
}

.hero-v2-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 124, 246, 0.45);
}

.hero-v2-cta:active {
  transform: scale(0.98);
}

.hero-v2-free {
  font-size: 0.85rem;
  color: var(--text-dimmed);
  margin: 0;
}

/* Preview card section */
.hero-v2-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  width: 100%;
  max-width: 480px;
}

.preview-card {
  position: relative;
  flex: 1;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.preview-card img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  display: block;
}

.preview-label {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.preview-after {
  box-shadow: 0 4px 24px rgba(139, 124, 246, 0.25);
}

.preview-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.preview-prompt-icon {
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 600;
}

.preview-prompt code {
  font-family: 'SF Mono', 'Consolas', monospace;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
}

/* Mobile: stack preview vertically */
@media (max-width: 500px) {
  .hero-v2 {
    padding: 24px 16px;
    gap: 28px;
  }

  .hero-v2-title {
    font-size: 1.7rem;
  }

  .hero-v2-subtitle {
    font-size: 0.95rem;
  }

  .hero-v2-cta {
    padding: 14px 28px;
    font-size: 1rem;
  }

  .hero-v2-preview {
    flex-direction: row;
    gap: 12px;
    max-width: 320px;
  }

  .preview-prompt {
    display: none;
  }
}

/* Desktop: larger hero */
@media (min-width: 900px) {
  .hero-v2 {
    padding: 48px 32px;
    gap: 40px;
  }

  .hero-v2-title {
    font-size: 3rem;
  }

  .hero-v2-subtitle {
    font-size: 1.2rem;
  }

  .hero-v2-cta {
    padding: 18px 40px;
    font-size: 1.15rem;
    border-radius: 16px;
  }

  .hero-v2-preview {
    max-width: 560px;
    gap: 24px;
  }

  .preview-card {
    border-radius: 16px;
  }

  .preview-label {
    font-size: 0.65rem;
    padding: 4px 10px;
    bottom: 8px;
    left: 8px;
  }

  .preview-prompt code {
    font-size: 0.8rem;
    padding: 6px 12px;
  }
}

/* Credit banner removed — info shown in header + edit button text */

/* ============================================
   CUSTOM PROMPT SECTION (Editor)
   Wrapper for textarea and related UI
   ============================================ */
.custom-prompt-section {
  margin-bottom: 0;
}

/* ============================================
   MOBILE: Maximize image visibility
   Hide secondary UI, focus on image + prompt
   ============================================ */
@media (max-width: 768px) {
  /* Photo strip on mobile - keep visible so users can add second photo */
  /* Only hide when keyboard is open (handled separately) */

  /* Photo strip - compact but functional */
  .app.has-image .photo-strip {
    padding: 6px 12px;
  }

  .app.has-image .photo-strip-item {
    padding: 2px;
  }

  .app.has-image .photo-thumb-wrapper {
    width: 40px;
    height: 40px;
  }

  .app.has-image .photo-strip-add {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  /* Compact edit card */
  .app.has-image .edit-card {
    padding: 10px;
    border-radius: 12px;
  }

  /* Compact edit card footer */
  .app.has-image .edit-card-footer {
    margin-top: 8px;
    gap: 10px;
  }

  /* Hide edit cost caption on mobile to save space */
  .app.has-image .edit-cost-caption {
    display: none;
  }

  /* Smart upsell more compact */
  .app.has-image .smart-upsell {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
}

/* Buy sheet footer */
.footer-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.7rem;
  color: var(--text-dimmed);
}

.footer-trust svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-dimmed);
}

.footer-dot {
  color: var(--text-dimmed);
}

.footer-signin {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0;
}

.footer-signin:hover {
  text-decoration: underline;
}

/* ============================================
   SAVED EDITS DRAWER
   Slide-out panel for viewing saved edits
   ============================================ */

/* Overlay */
.saved-edits-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  z-index: 10001;
  pointer-events: none;
  transition: background 0.25s ease;
}
.saved-edits-drawer-overlay.visible {
  background: rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

/* Drawer panel */
.saved-edits-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 388px;
  max-width: 100vw;
  background: var(--bg);
  z-index: 10002;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.08);
}
.saved-edits-drawer.visible {
  transform: translateX(0);
  transition-duration: 0.22s;
  transition-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}

/* Drawer header */
.drawer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.drawer-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.01em;
}
.drawer-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.drawer-count strong {
  color: var(--text);
  font-weight: 600;
}
.drawer-close {
  margin-left: auto;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  line-height: 1;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.drawer-close:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

/* Drawer body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 16px 16px 32px;
}

/* Skeleton loading */
.drawer-skeleton {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.drawer-skeleton-card {
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}
.drawer-skeleton-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(var(--primary-rgb), 0.04) 50%,
    transparent 70%
  );
  animation: drawerShimmer 1.6s ease infinite;
}
@keyframes drawerShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Login prompt */
.drawer-login {
  text-align: center;
  padding: 48px 20px;
}
.drawer-login-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--bg-secondary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-login-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}
.drawer-login h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.drawer-login p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.5;
}
.drawer-login-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 10px 22px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.drawer-login-cta:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* Empty state */
.drawer-empty {
  text-align: center;
  padding: 48px 20px;
}
.drawer-empty-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  background: var(--bg-secondary);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.drawer-empty-icon svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
}
.drawer-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.drawer-empty p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Date groups */
.drawer-date-group {
  margin-bottom: 20px;
}
.drawer-date-group:last-child {
  margin-bottom: 0;
}
.drawer-date-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px 2px;
}

/* Card grid */
.drawer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Individual card */
.drawer-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  animation: drawerCardIn 0.35s ease forwards;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}
@keyframes drawerCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.drawer-card:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 12px rgba(var(--primary-rgb), 0.1);
}
.drawer-card.removing {
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Card thumbnail */
.drawer-card-thumb {
  aspect-ratio: 1;
  background: var(--bg-secondary);
  position: relative;
  overflow: hidden;
}
.drawer-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.drawer-card-thumb img.loaded {
  opacity: 1;
}
.drawer-card-thumb img.error {
  display: none;
}
@media (hover: hover) {
  .drawer-card:hover .drawer-card-thumb img.loaded {
    transform: scale(1.04);
  }
}

/* Image error fallback */
.drawer-card-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
}
.drawer-card-fallback svg {
  width: 28px;
  height: 28px;
  color: var(--text-dimmed);
  opacity: 0.5;
}

/* Hover action buttons */
.drawer-card-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
@media (hover: hover) {
  .drawer-card:hover .drawer-card-actions {
    opacity: 1;
    visibility: visible;
  }
}
.drawer-action {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.drawer-action svg {
  width: 15px;
  height: 15px;
}
.drawer-action:hover {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(1.08);
}
.drawer-action--delete:hover {
  background: rgba(239, 68, 68, 0.85);
}
.drawer-action.success {
  background: rgba(34, 197, 94, 0.85);
}

/* Card info */
.drawer-card-info {
  padding: 8px 10px;
}
.drawer-card-prompt {
  font-size: 0.72rem;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drawer-card-prompt.empty {
  color: var(--text-dimmed);
  font-style: italic;
}
.drawer-card-prompt.expired {
  color: var(--text-dimmed);
  font-size: 0.65rem;
}

/* Expired card state */
.drawer-card--expired {
  opacity: 0.6;
}
.drawer-card--expired .drawer-card-thumb {
  cursor: pointer;
}
.drawer-card--expired .drawer-card-fallback {
  opacity: 0.3;
}
.drawer-card-lock {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  color: var(--text-muted);
  z-index: 2;
}
.drawer-card-lock svg {
  width: 100%;
  height: 100%;
}
.drawer-card-actions--expired {
  opacity: 1;
  visibility: visible;
  background: transparent;
  justify-content: flex-end;
  padding: 6px;
}

/* ============================================
   SAVED EDITS TRIGGER BUTTON
   ============================================ */

.saved-edits-trigger[hidden] {
  display: none;
}
.saved-edits-trigger {
  position: relative;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}
.saved-edits-trigger svg {
  width: 18px;
  height: 18px;
}
.saved-edits-trigger:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

/* Pulse animation on save */
.saved-edits-trigger.pulse {
  animation: triggerPulse 0.6s ease;
}
@keyframes triggerPulse {
  0% { transform: scale(1); }
  30% { transform: scale(1.15); }
  60% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

/* "Saved" badge */
.save-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.save-badge.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   DRAWER RESPONSIVE - Mobile
   ============================================ */

@media (max-width: 600px) {
  .saved-edits-drawer {
    width: 100vw;
    border-left: none;
  }

  .drawer-card-actions {
    opacity: 1;
  }

  .drawer-body {
    padding: 12px 12px 40px;
  }

  .drawer-grid {
    gap: 8px;
  }
}

/* SUGGESTION CHIPS */
.suggestion-chip { flex-shrink: 0; padding: 6px 12px; border-radius: var(--radius-pill); background: var(--bg-secondary); border: 1px solid var(--border); color: var(--text); font-size: 0.78rem; font-weight: 500; white-space: nowrap; transition: all var(--transition-fast); line-height: 1.2; }
.suggestion-chip:active { transform: scale(0.95); background: var(--glow); border-color: var(--primary); }
.suggestion-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Old onboarding dim/focus + ref prompt card removed — replaced by onboarding.css V2 spotlight engine */

/* ============================================
   REVEAL ANIMATIONS
   Overlay + blur-to-sharp + merge thumbnail
   + result fade-in for edit completion.
   ============================================ */

/* Reveal overlay — an <img> absolutely positioned over #imageWrapper */
.reveal-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 5;
  pointer-events: none;
}

/* Single-photo: blur-to-sharp reveal — the money shot */
.reveal-blur {
  filter: blur(24px) saturate(0.6);
  opacity: 0;
  transform: scale(0.97);
  animation: revealBlurToSharp 1.1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealBlurToSharp {
  0% {
    filter: blur(24px) saturate(0.6);
    opacity: 0;
    transform: scale(0.97);
  }
  30% {
    opacity: 1;
  }
  100% {
    filter: blur(0) saturate(1);
    opacity: 1;
    transform: scale(1);
  }
}

/* Two-photo: merge thumbnails fly to center */
.reveal-merge-thumb {
  position: absolute;
  width: 35%;
  height: auto;
  object-fit: contain;
  z-index: 6;
  pointer-events: none;
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25),
              0 2px 8px rgba(0, 0, 0, 0.15);
  transition: all 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-merge-thumb.left {
  left: 5%;
  top: 50%;
  transform: translateY(-50%) scale(0.9) rotate(-2deg);
}

.reveal-merge-thumb.right {
  right: 5%;
  top: 50%;
  transform: translateY(-50%) scale(0.9) rotate(2deg);
}

.reveal-merge-thumb.merged {
  left: 50%;
  right: auto;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.2) rotate(0deg);
  opacity: 0;
  box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

/* Result fade-in after merge */
.reveal-result-fade {
  animation: revealResultFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes revealResultFade {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============================================
   FULLSCREEN REVEAL LIGHTBOX
   Shows edited image full-screen after each edit.
   ============================================ */

.fullscreen-reveal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.fullscreen-reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  animation: fsRevealBackdropIn 0.3s ease forwards;
}

@keyframes fsRevealBackdropIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.fullscreen-reveal img {
  position: relative;
  z-index: 1;
  max-width: calc(100% - 32px);
  max-height: calc(100% - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  animation: fsRevealImageIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

@keyframes fsRevealImageIn {
  from {
    opacity: 0;
    transform: scale(0.85);
    filter: blur(12px);
  }
  60% {
    opacity: 1;
  }
  to {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
  }
}

.fullscreen-reveal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.15s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.fullscreen-reveal-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.fullscreen-reveal-close:active {
  transform: scale(0.9);
  background: rgba(255, 255, 255, 0.35);
}

.fullscreen-reveal-save {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: white;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, transform 0.15s;
}

.fullscreen-reveal-save.visible {
  display: flex;
  animation: fsRevealSaveIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fsRevealSaveIn {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}

.fullscreen-reveal-save:hover {
  background: rgba(255, 255, 255, 0.28);
}

.fullscreen-reveal-save:active {
  transform: scale(0.9);
}

.fullscreen-reveal-save.saved {
  background: rgba(76, 175, 80, 0.45);
}

.fullscreen-reveal-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  pointer-events: none;
  animation: fsRevealHintIn 0.6s 0.4s ease both;
}

@keyframes fsRevealHintIn {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Large save bar shown after paywall dismissal */
.fullscreen-reveal-save-bar {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: rgba(124, 58, 237, 0.85);
  border: none;
  border-radius: 14px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s, transform 0.15s;
  -webkit-tap-highlight-color: transparent;
  animation: fsRevealSaveIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.fullscreen-reveal-save-bar:hover {
  background: rgba(124, 58, 237, 0.95);
}

.fullscreen-reveal-save-bar:active {
  transform: scale(0.95);
}

.fullscreen-reveal-save-bar svg {
  flex-shrink: 0;
}

/* Exit animation */
.fullscreen-reveal.closing .fullscreen-reveal-backdrop {
  animation: fsRevealBackdropOut 0.25s ease forwards;
}

.fullscreen-reveal.closing img {
  animation: fsRevealImageOut 0.25s ease forwards;
}

@keyframes fsRevealBackdropOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes fsRevealImageOut {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ============================================
   BEFORE / AFTER TOGGLE
   Premium split-pill control over image.
   Inspired by Halide / Lightroom viewfinder.
   ============================================ */

.before-after-toggle {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 18px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(10, 10, 18, 0.6);
  backdrop-filter: blur(20px) saturate(1.6);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.06);
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  opacity: 0;
  animation: toggleFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: background 0.2s ease, border-color 0.2s ease,
              box-shadow 0.2s ease;
}

@keyframes toggleFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.before-after-toggle:hover {
  background: rgba(10, 10, 18, 0.75);
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.before-after-toggle:active {
  transform: translateX(-50%) scale(0.96);
}

/* Showing original — violet tint to signal alternate state */
.before-after-toggle[data-showing="original"] {
  background: rgba(var(--primary-rgb), 0.35);
  border-color: rgba(var(--primary-rgb), 0.3);
  box-shadow: 0 2px 16px rgba(var(--primary-rgb), 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.08);
}
