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

/* ============================================
   PRICING FLASH PREVENTION
   Hide price values until localized prices load.
   JS adds .pricing-loaded to <html> after /api/pricing returns.
   ============================================ */
html:not(.pricing-loaded) [data-sub-tier-price],
html:not(.pricing-loaded) [data-sub-tier-per-edit],
html:not(.pricing-loaded) [data-onetime-price] {
  visibility: hidden;
}

/* ============================================
   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: var(--shadow-md), var(--shadow-tonal-violet);
  font-family: var(--font-body);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.btn-primary:active {
  background: var(--primary-hover);
  transform: scale(0.96);
  box-shadow: var(--shadow-sm);
}

.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: var(--tone-violet-50);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  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 var(--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(--card);
  border: 3px dashed var(--tone-violet);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet);
  font-family: var(--font-body);
  animation: drag-content-pulse 1.5s var(--ease-in-out) infinite;
}

@keyframes drag-content-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: var(--shadow-lg), var(--shadow-tonal-violet);
  }
  50% {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg), 0 12px 36px rgba(124, 92, 252, 0.30);
  }
}

.drag-overlay-icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tone-violet-50);
  border-radius: var(--r-pill);
  color: var(--tone-violet-700);
}

.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(0, 0, 0, 0.07);
  }

  .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(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 20px;
  box-shadow: var(--shadow-md);
  transition: border-color 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
}

.edit-card:focus-within {
  border-color: color-mix(in srgb, var(--tone-violet) 22%, transparent);
  box-shadow: var(--shadow-md), 0 0 0 4px var(--tone-violet-50);
}

/* Post-upload attention animation - draws user to prompt input */
.edit-card.attention {
  animation: edit-card-attention 1.5s var(--ease-standard);
}

@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(0, 0, 0, 0.1), 0 4px 20px rgba(0, 0, 0, 0.08);
    transform: scale(1.01);
  }
  50% {
    border-color: var(--primary);
    box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.08), 0 4px 24px rgba(0, 0, 0, 0.1);
    transform: scale(1.01);
  }
  75% {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.06);
    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: 16px;
  border-bottom: 1px solid var(--border-subtle);
  animation: prompt-suggestions-appear 0.3s var(--ease-standard);
}

.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: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--primary);
  background: rgba(26, 26, 46, 0.03);
  border: 1px solid rgba(26, 26, 46, 0.05);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s var(--ease-standard);
  white-space: nowrap;
}

.prompt-chip:hover {
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.prompt-chip:active {
  transform: translateY(0);
  background: rgba(0, 0, 0, 0.08);
}

/* 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 var(--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 var(--ease-standard);
  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(0, 0, 0, 0.15);
}

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

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

.result-pill-primary.saving {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
}

.result-pill-primary.saving::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: saving-spin 0.6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

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

.result-pill-primary.saved,
.post-edit-btn-primary.saved {
  background: var(--success, #34D399);
  pointer-events: none;
}

/* Attention pulse on save button after reveal dismissal */
.result-pill-primary.save-attention {
  animation: save-attention-pulse 1.5s var(--ease-out);
}

@keyframes save-attention-pulse {
  0%   { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); transform: scale(1); }
  15%  { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.12), 0 4px 16px rgba(0, 0, 0, 0.25); transform: scale(1.08); }
  30%  { box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.15); transform: scale(1); }
  50%  { box-shadow: 0 0 0 6px rgba(0, 0, 0, 0.1), 0 4px 16px rgba(0, 0, 0, 0.2); transform: scale(1.06); }
  70%  { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); transform: scale(1); }
  100% { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); transform: scale(1); }
}

/* Immediate tap feedback — shown before paywall check resolves */
[data-action="save-image"],
[data-action="share-image"] {
  transition: transform 0.1s ease, opacity 0.1s ease;
}

[data-action="save-image"].tapped,
[data-action="share-image"].tapped {
  transform: scale(0.95);
  opacity: 0.7;
}

.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(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.15);
  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;
  }
}

.edit-card-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

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

/* ============================================
   PROMPT INPUT - Clean textarea
   ============================================ */
.prompt-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--bg-subtle);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14.5px;
  resize: none;
  min-height: 72px;
  max-height: 160px;
  line-height: 1.55;
  cursor: text;
  transition: background-color 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard), border-color 0.2s var(--ease-standard);
}

.prompt-input:hover {
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.prompt-input:focus {
  outline: none;
  background: var(--card);
  border-color: var(--tone-violet);
  box-shadow: 0 0 0 4px var(--tone-violet-50);
}

.prompt-input:focus {
  outline: none;
  background: var(--bg);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

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

.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
   ============================================ */
.reference-photo-section {
  margin-top: 12px;
  width: 100%;
}

.add-reference-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: linear-gradient(135deg, var(--tone-violet-50) 0%, var(--card) 70%);
  color: var(--text);
  border: 1.5px dashed color-mix(in srgb, var(--tone-violet) 32%, transparent);
  border-radius: var(--r-lg);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  position: relative;
  overflow: hidden;
  transition: transform 200ms var(--ease-standard),
              border-color 200ms var(--ease-standard),
              box-shadow 240ms var(--ease-standard),
              background 240ms var(--ease-standard);
}
.add-reference-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--tone-violet) 14%, transparent) 1px, transparent 1px);
  background-size: 14px 14px;
  opacity: 0.4;
  pointer-events: none;
  mask-image: linear-gradient(135deg, black, transparent 65%);
  -webkit-mask-image: linear-gradient(135deg, black, transparent 65%);
}
.add-reference-btn:hover {
  border-color: var(--tone-violet);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: var(--shadow-tonal-violet);
}
.add-reference-btn:active { transform: translateY(0); }

.add-reference-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--tone-violet) 18%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tone-violet-700);
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--tone-violet) 18%, transparent);
  transition: transform 240ms var(--ease-standard);
}
.add-reference-btn:hover .add-reference-icon { transform: rotate(-2deg); }
.add-reference-icon svg { width: 22px; height: 22px; stroke-width: 1.8; }
.add-reference-icon::after {
  content: '+';
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: var(--tone-violet);
  color: #ffffff;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--card);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.add-reference-text {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.add-reference-label {
  display: block;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: var(--text);
  line-height: 1.2;
}
.add-reference-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}
.add-reference-hint .ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px 3px 7px;
  background: color-mix(in srgb, var(--card) 85%, transparent);
  color: var(--tone-violet-700);
  border: 1px solid color-mix(in srgb, var(--tone-violet) 18%, transparent);
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 600;
  transition: background 160ms var(--ease-standard), transform 160ms var(--ease-standard);
}
.add-reference-hint .ref-chip svg { width: 11px; height: 11px; stroke-width: 2.4; }
.add-reference-btn:hover .add-reference-hint .ref-chip { background: var(--card); }
.add-reference-btn:hover .add-reference-hint .ref-chip:nth-child(1) { transform: translateY(-1px); transition-delay: 0ms; }
.add-reference-btn:hover .add-reference-hint .ref-chip:nth-child(2) { transform: translateY(-1px); transition-delay: 40ms; }
.add-reference-btn:hover .add-reference-hint .ref-chip:nth-child(3) { transform: translateY(-1px); transition-delay: 80ms; }

.add-reference-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  background: var(--tone-violet);
  color: #ffffff;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-tonal-violet);
  transition: transform 200ms var(--ease-standard), box-shadow 240ms var(--ease-standard);
}
.add-reference-plus svg { width: 18px; height: 18px; stroke-width: 2.6; }
.add-reference-btn:hover .add-reference-plus {
  transform: translateX(2px);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--tone-violet) 42%, transparent);
}

.reference-preview {
  display: none;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-top: 12px;
  box-shadow: var(--shadow-sm);
}
.reference-preview.visible { display: block; }
.reference-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 0;
}
.reference-preview-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tone-violet-700);
}
.reference-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  min-height: 32px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 160ms var(--ease-standard), color 160ms var(--ease-standard);
}
.reference-remove-btn:hover { color: var(--tone-rose-700); background: var(--tone-rose-50); }
.reference-remove-btn svg { width: 14px; height: 14px; }

.reference-preview-content {
  padding: 8px 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.reference-preview-content img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--bg-subtle);
}
.reference-preview-hint {
  flex: 1;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
  font-weight: 500;
}

.reference-preview.visible ~ .add-reference-btn,
.reference-photo-section:has(.reference-preview.visible) .add-reference-btn {
  display: none;
}
body.has-two-photos .add-reference-btn { display: none; }
body.has-two-photos .reference-preview { display: block; }

@media (max-width: 768px) {
  /* Streamline reference button on mobile — collapse the chips/decoration into
     a slim pill. The capability chips are great for first-time discovery on
     desktop but waste 2/3 of the editor card on phones. */
  .reference-photo-section { margin-top: 8px; }
  .add-reference-btn {
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--r-pill);
    border-style: solid;
    border-color: color-mix(in srgb, var(--tone-violet) 22%, transparent);
    background: var(--tone-violet-50);
  }
  .add-reference-btn::before { display: none; }
  .add-reference-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--r-pill);
    background: var(--tone-violet);
    color: #fff;
    border: none;
    box-shadow: none;
  }
  .add-reference-icon::after { display: none; }
  .add-reference-icon svg { width: 16px; height: 16px; }
  .add-reference-text { gap: 0; }
  .add-reference-label { font-size: 13.5px; font-weight: 700; }
  .add-reference-hint { display: none; }
  .add-reference-plus {
    width: 28px;
    height: 28px;
    background: transparent;
    color: var(--tone-violet-700);
    box-shadow: none;
  }
  .add-reference-plus svg { width: 16px; height: 16px; stroke-width: 2.4; }
  .add-reference-btn:hover .add-reference-plus { transform: none; box-shadow: none; }

  .reference-preview-content { padding: 8px 12px 12px; gap: 10px; }
  .reference-preview-content img { width: 48px; height: 48px; }
  .reference-preview-hint { font-size: 12.5px; }
}

/* ============================================
   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 50%, #b45309 100%);
  box-shadow:
    0 4px 14px rgba(245, 158, 11, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.edit-btn.needs-credits:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  box-shadow:
    0 8px 24px rgba(245, 158, 11, 0.4),
    0 2px 6px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Countdown waiting state - muted but still tappable */
.edit-btn.countdown-waiting {
  background: linear-gradient(135deg, #9ca3af 0%, #6b7280 50%, #4b5563 100%);
  cursor: pointer;
  box-shadow:
    0 2px 8px rgba(107, 114, 128, 0.25),
    0 1px 3px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.edit-btn.countdown-waiting:hover {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 50%, #374151 100%);
  box-shadow:
    0 4px 14px rgba(107, 114, 128, 0.35),
    0 2px 6px rgba(0, 0, 0, 0.12);
}

.edit-cost-caption {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(26, 26, 46, 0.05);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  letter-spacing: 0.005em;
  text-align: left;
  margin-top: 0;
  transition: background 200ms var(--ease-standard), color 200ms var(--ease-standard);
}
.edit-cost-caption:empty { display: none; }
.edit-cost-caption.free {
  background: var(--tone-emerald-50);
  color: var(--tone-emerald-700);
}
.edit-cost-caption.warning {
  background: var(--tone-amber-50);
  color: var(--tone-amber-700);
}
.edit-cost-caption.pro-cost {
  background: var(--tone-violet-50);
  color: var(--tone-violet-700);
  font-style: normal;
}

/* ============================================
   QUALITY TOGGLE
   ============================================ */
.quality-toggle {
  display: inline-flex;
  font-family: var(--font-body);
}
.toggle-track {
  position: relative;
  display: inline-flex;
  background: var(--bg-secondary);
  border-radius: var(--r-pill);
  padding: 4px;
  border: 1px solid var(--hairline);
}
/* JS toggles .right on this for slide animation; visual replaced by .toggle-option.active background. */
.toggle-indicator { display: none; }

.toggle-option {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 16px;
  min-height: 34px;
  border: none;
  background: transparent;
  color: var(--text-dimmed);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color 200ms var(--ease-standard),
              background 240ms var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.toggle-option > svg { width: 14px; height: 14px; stroke-width: 2.4; flex-shrink: 0; transition: transform 240ms var(--ease-standard); }
.toggle-option:hover { color: var(--text-muted); }
.toggle-option.active {
  color: var(--text);
  background: var(--card);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.10), 0 1px 1px rgba(20, 20, 40, 0.05);
}
.toggle-option#standardOption.active { color: var(--tone-sky-700); }
.toggle-option#standardOption.active > svg { color: var(--tone-sky); }
.toggle-option#proOption.active { color: var(--tone-violet-700); }
.toggle-option#proOption.active > svg { color: var(--tone-violet); transform: rotate(8deg) scale(1.08); }

.toggle-option#proOption.insufficient { opacity: 0.5; cursor: not-allowed; }

.toggle-cost {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  opacity: 0.6;
  margin-left: 2px;
  line-height: 1;
}
.toggle-option.active .toggle-cost { opacity: 0.85; }

/* ============================================
   QUALITY TOGGLE WRAPPER
   ============================================ */
.quality-toggle-wrapper {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  position: relative;
  z-index: 20;
}

/* Shown when Pro is selected but the user has < 2 credits. */
.pro-upsell {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--tone-violet-50);
  color: var(--tone-violet-700);
  border: 1px solid color-mix(in srgb, var(--tone-violet) 18%, transparent);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  transition: background 200ms var(--ease-standard),
              transform 160ms var(--ease-standard),
              box-shadow 240ms var(--ease-standard);
  margin-top: 6px;
}
.pro-upsell.visible { display: inline-flex; }
.pro-upsell:hover {
  background: var(--tone-violet-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-tonal-violet);
}
.pro-upsell-text { color: inherit; font-weight: 600; }
.pro-upsell-arrow { color: inherit; font-weight: 700; }

.quality-help-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease-standard);
  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(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet);
  z-index: 9999;
  width: 320px;
  max-width: calc(100vw - 32px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.2s var(--ease-standard), visibility 0.2s var(--ease-standard), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  font-family: var(--font-body);
}

.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: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.quality-help-option.smart {
  background: linear-gradient(135deg, rgba(26, 26, 46, 0.04) 0%, rgba(26, 26, 46, 0.02) 100%);
  border: 1px solid rgba(26, 26, 46, 0.05);
}

.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;
  }
}

/* ============================================
   EDIT BUTTON - Primary action
   ============================================ */
.edit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 28px;
  border-radius: var(--r-pill);
  border: none;
  background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 50%, #1a1a2e 100%);
  background-size: 200% 200%;
  color: white;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
  min-height: 50px;
  flex-shrink: 0;
  letter-spacing: 0.005em;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  animation:
    edit-btn-gradient 4s var(--ease-in-out) infinite,
    edit-btn-glow 3s var(--ease-in-out) infinite;
}

@keyframes edit-btn-gradient {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes edit-btn-glow {
  0%, 100% {
    box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  }
  50% {
    box-shadow: var(--shadow-lg), 0 8px 28px rgba(124, 92, 252, 0.32);
  }
}

/* Shimmer sweep on hover */
.edit-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.5s var(--ease-standard);
  pointer-events: none;
}

.edit-btn:hover::after {
  left: 100%;
}

.edit-btn:hover {
  transform: translateY(-2px);
  animation: none;
  background: linear-gradient(135deg, #3d3d58 0%, #1a1a2e 50%, #151528 100%);
  box-shadow: var(--shadow-lg), 0 10px 28px rgba(124, 92, 252, 0.36);
}

.edit-btn:active {
  /* 60ms settle: physical press should ease in, not snap — adds tactile weight */
  transition: transform 0.06s ease-out, box-shadow 0.06s ease-out;
  transform: translateY(0) scale(0.98);
  animation: none;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Keyboard focus ring — visible without being garish.
   Dark ring matches --primary (#1a1a2e) design language; offset creates air around the button.
   :focus-visible scopes to keyboard navigation only — mouse users never see this. */
.edit-btn:focus-visible {
  outline: 2.5px solid rgba(255, 255, 255, 0.7);
  outline-offset: 3px;
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.15),
    0 0 0 5px rgba(255, 255, 255, 0.12);
}

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

.edit-btn:disabled::after {
  display: none;
}

/* Submitting state — button is disabled during API call but communicates active work,
   not "broken". Slow violet pulse matches Bug B (onboarding-initializing) and Bug D-1
   (dropzone uploading) visual language: the system is alive and doing something.
   opacity stays lower than idle (0.8 vs 1.0) to signal "locked" without feeling dead. */
.edit-btn.submitting {
  opacity: 0.82;
  cursor: wait;
  animation: edit-btn-submitting-pulse 1.8s ease-in-out infinite;
}

.edit-btn.submitting::after {
  /* Travelling shimmer identical rhythm to onboarding-initializing — consistent motion language.
     display:block overrides the .edit-btn:disabled::after { display:none } rule so the shimmer
     shows even while the button is natively disabled. */
  display: block;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.18) 45%,
    rgba(255, 255, 255, 0.18) 55%,
    transparent 100%
  );
  animation: edit-btn-submitting-shimmer 1.6s ease-in-out infinite;
  transition: none;
}

@keyframes edit-btn-submitting-pulse {
  0%, 100% {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.15),
      0 1px 3px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.1);
  }
  50% {
    box-shadow:
      0 4px 22px rgba(139, 124, 246, 0.28),
      0 0 36px rgba(139, 124, 246, 0.12),
      inset 0 1px 0 rgba(255, 255, 255, 0.15);
  }
}

@keyframes edit-btn-submitting-shimmer {
  0%   { left: -110%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}

@media (prefers-reduced-motion: reduce) {
  .edit-btn,
  .edit-btn.submitting,
  .post-edit-btn-primary {
    animation: none;
  }
  .edit-btn.submitting {
    opacity: 0.7;
  }
  .edit-btn.submitting::after {
    animation: none;
  }
}

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

/* Onboarding-initializing state — shown while async onboarding setup is in flight.
   Bug B fix: PostHog session 019d61eb — rage-clicks on Edit during init window.
   Keeps the button visually alive (not broken) with a soft travelling shimmer,
   queues one click, snaps back to full state once onboarding engine is ready. */
.edit-btn.onboarding-initializing {
  cursor: wait;
  animation:
    edit-btn-gradient 4s var(--ease-in-out) infinite,
    edit-btn-glow 3s var(--ease-in-out) infinite;
  pointer-events: auto; /* keep clickable — JS queues the click */
}

/* Shimmer sweep for the initializing state (overrides default ::after transition) */
.edit-btn.onboarding-initializing::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.22) 45%,
    rgba(255, 255, 255, 0.22) 55%,
    transparent 100%
  );
  animation: edit-btn-init-shimmer 1.4s ease-in-out infinite;
  transition: none;
}

@keyframes edit-btn-init-shimmer {
  0%   { left: -110%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}


@keyframes editBtnHighlight {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  }
  20% {
    transform: scale(1.06);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.15), 0 8px 24px rgba(0, 0, 0, 0.22);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  }
}

.edit-btn-text {
  font-weight: 700;
  min-width: 0;
  text-align: center;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.edit-btn-icon {
  flex-shrink: 0;
  transition: transform 0.3s var(--ease-standard);
}

.edit-btn:hover .edit-btn-icon {
  transform: rotate(15deg) scale(1.1);
}

/* 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 var(--ease-standard);
}

.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 var(--ease-standard);
  }

  .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 var(--ease-standard), visibility 0.2s var(--ease-standard);
}

.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 var(--ease-standard);
}

.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 var(--ease-standard);
  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: var(--r-md);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  background: var(--card);
  padding: 4px;
  transition: border-color 0.18s var(--ease-standard),
              box-shadow 0.18s var(--ease-standard),
              background 0.18s var(--ease-standard);
}

.photo-strip-item:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 22%, transparent);
}

.photo-strip-item.active {
  border-color: var(--tone-violet);
  background: var(--tone-violet-50);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

/* Number badge — primary photo (sky-blue) */
.photo-strip-badge {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 20px;
  height: 20px;
  border-radius: var(--r-pill);
  background: var(--tone-sky);
  color: white;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border: 2px solid var(--card);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.32);
}

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

/* Reference badge — violet to match the reference card */
.photo-strip-badge-ref {
  font-family: var(--font-body);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0 5px;
  width: auto;
  min-width: 20px;
  background: var(--tone-violet);
  box-shadow: 0 2px 6px rgba(124, 92, 252, 0.32);
}

.photo-strip-item.active .photo-strip-badge-ref {
  background: var(--tone-violet);
}

/* 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 var(--ease-standard);
}

.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 var(--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: var(--r-md);
  border: 2px dashed color-mix(in srgb, var(--tone-violet) 32%, transparent);
  background: var(--tone-violet-50);
  color: var(--tone-violet-700);
  cursor: pointer;
  flex-shrink: 0;
  gap: 4px;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.18s var(--ease-standard);
}

.photo-strip-add:hover {
  border-color: var(--tone-violet);
  border-style: solid;
  background: var(--tone-violet-100);
  transform: translateY(-1px);
  box-shadow: var(--shadow-tonal-violet);
}

.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), 44px min touch target */
  .photo-strip-item .photo-remove-btn {
    display: flex;
    width: 44px;
    height: 44px;
    top: -14px;
    right: -14px;
    font-size: 18px;
  }

  /* 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 var(--ease-standard);
}

.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(20, 20, 40, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 10001; /* Above GDPR banner (9999) and interstitial (1000) */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-standard), visibility 0.2s var(--ease-standard);
}

.sheet-overlay.visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 0.1s var(--ease-standard), visibility 0.1s var(--ease-standard);
  touch-action: none;
  -webkit-overflow-scrolling: auto;
  overscroll-behavior: contain;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--card);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 24px;
  padding-bottom: calc(24px + var(--safe-bottom));
  z-index: 10002;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
  border-top: 1px solid var(--hairline);
  box-shadow: var(--shadow-lg);
  max-height: calc(92dvh - var(--safe-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bottom-sheet.visible {
  transform: translateY(0);
  transition: transform 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}

.sheet-handle {
  width: 38px;
  height: 4px;
  background: var(--text-dimmed);
  opacity: 0.4;
  border-radius: var(--r-pill);
  margin: 0 auto 20px;
  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: 32px;
  border: 1px solid rgba(26, 26, 46, 0.05);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.03),
    0 10px 25px -3px rgba(0, 0, 0, 0.08),
    0 20px 50px -4px rgba(0, 0, 0, 0.15);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s var(--ease-standard), visibility 0.2s var(--ease-standard), transform 0.25s var(--ease-standard);
  overflow: visible;
}

/* Violet ambient glow behind user sheet */
#userSheet::before {
  content: '';
  position: absolute;
  inset: -40px;
  border-radius: 28px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.06) 0%, transparent 70%);
  z-index: -1;
  pointer-events: none;
}

#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: 24px;
    padding-bottom: calc(24px + var(--safe-bottom));
    border: none;
    border-top: 1px solid rgba(26, 26, 46, 0.05);
    box-shadow:
      0 -4px 20px rgba(0, 0, 0, 0.1),
      0 -2px 12px rgba(26, 26, 46, 0.04);
    opacity: 1;
  }

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

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

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

.sheet-close-btn:hover {
  background: rgba(26, 26, 46, 0.05);
  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-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  text-align: center;
  margin-bottom: 10px;
}

.sheet-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
  letter-spacing: 0.01em;
}

.sheet-btn {
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.005em;
  cursor: pointer;
  margin-top: 12px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard), background 0.18s var(--ease-standard);
}

.sheet-btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.sheet-btn-primary:hover {
  transform: translateY(-1px);
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.sheet-btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--hairline);
}

.sheet-btn-secondary:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
  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(26, 26, 46, 0.05);
}

.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 var(--ease-in-out) infinite;
}

.pack-badge-best {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.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: 92dvh;
  background: var(--card);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

/* Violet ambient glow behind buy sheet */
.buy-sheet-v9::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, var(--tone-violet-50) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.buy-sheet-v9 > * {
  position: relative;
  z-index: 1;
}

.buy-sheet-v9 .sheet-handle {
  flex-shrink: 0;
  margin: 12px auto 0;
  background-color: var(--text-dimmed);
  opacity: 0.4;
}

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

.buy-sheet-v9 .buy-sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.18s var(--ease-standard), color 0.18s var(--ease-standard), transform 0.18s var(--ease-standard);
  z-index: 10;
}

.buy-sheet-v9 .buy-sheet-close:hover {
  background: var(--tone-rose-50);
  color: var(--tone-rose-700);
}

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

.sheet-headline-v9 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 8px;
  color: var(--text);
  letter-spacing: -0.02em;
}


.buy-billing-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px;
  display: flex;
  margin: 14px 0 22px;
  font-family: var(--font-body);
}

.buy-billing-option {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--text-dimmed);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s var(--ease-standard), background 0.24s var(--ease-standard);
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
}

.buy-billing-option--active {
  background: var(--card);
  color: var(--tone-violet-700);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.10), 0 1px 1px rgba(20, 20, 40, 0.05);
}

.buy-save-badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--tone-emerald-50);
  color: var(--tone-emerald-700);
  padding: 3px 7px;
  border-radius: var(--r-pill);
}

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

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

.sub-tier-v9 {
  background: var(--card);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg);
  flex: 1;
  padding: 22px 12px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.22s var(--ease-standard),
              background 0.22s var(--ease-standard),
              transform 0.22s var(--ease-standard),
              box-shadow 0.24s var(--ease-standard);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  font-family: var(--font-body);
}

.sub-tier-v9:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 28%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.sub-tier-v9--selected {
  border-color: var(--tone-violet);
  background: linear-gradient(180deg, var(--tone-violet-50) 0%, var(--card) 60%);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.sub-tier-v9--selected:hover {
  border-color: var(--tone-violet);
  transform: translateY(-3px);
}

.sub-tier-v9--popular {
  padding-top: 26px;
  border-color: var(--tone-violet);
  box-shadow: var(--shadow-tonal-violet);
}

.sub-tier-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--tone-violet);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.30);
}

/* Tier name */
.sub-tier-name {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.sub-tier-v9--selected .sub-tier-name,
.sub-tier-v9--popular .sub-tier-name {
  color: var(--tone-violet-700);
}

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

.sub-tier-credits-num {
  font-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.sub-tier-v9--selected .sub-tier-credits-num {
  color: var(--tone-violet-700);
}

.sub-tier-credits-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

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

/* Price */
.sub-tier-price {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0;
  text-align: center;
  white-space: nowrap;
}

.sub-tier-v9--selected .sub-tier-price { color: var(--tone-violet-700); }

.sub-tier-price-annual {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Subscription Benefits */
.sub-benefits-v9 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-bottom: 16px;
  padding: 12px 14px;
  background: var(--card-tonal);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
}

.sub-benefit {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.sub-benefit svg {
  width: 13px;
  height: 13px;
  stroke: var(--tone-emerald);
}

/* One-time Pack Section */
.onetime-section-v9 {
  border-top: 1px solid var(--hairline);
  padding-top: 18px;
  margin-top: 10px;
}

.onetime-divider-v9 {
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-align: center;
}

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

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

.onetime-toggle-link {
  color: var(--primary);
  font-weight: 600;
}

/* Credits Slider */
.credits-slider-container {
  display: none;
  margin-top: 14px;
  padding: 20px;
  background: var(--card-tonal);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
}

.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-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  transition: opacity 0.15s;
}

.credits-slider-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.credits-slider-bonus {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tone-amber-700);
  background: var(--tone-amber-50);
  padding: 4px 9px;
  border-radius: var(--r-pill);
  margin-top: 6px;
  transition: opacity 0.2s;
}

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

.credits-slider-price {
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tone-violet-700);
  letter-spacing: -0.015em;
  margin-top: 6px;
  transition: opacity 0.15s;
}

.credits-slider-per-edit {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
  transition: opacity 0.15s;
}

/* Range input — tonal violet track + thumb */
.credits-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--tone-violet) 0%,
    var(--tone-violet) var(--slider-fill, 33%),
    var(--bg-secondary) var(--slider-fill, 33%),
    var(--bg-secondary) 100%
  );
  border-radius: var(--r-pill);
  outline: none;
  cursor: pointer;
  margin: 0;
}

.credits-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 3px solid var(--tone-violet);
  box-shadow: var(--shadow-tonal-violet);
  cursor: grab;
  transition: transform 0.16s var(--ease-standard);
}

.credits-slider::-webkit-slider-thumb:hover {
  transform: scale(1.10);
}

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

.credits-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 3px solid var(--tone-violet);
  box-shadow: var(--shadow-tonal-violet);
  cursor: grab;
}

.credits-slider::-moz-range-track {
  height: 6px;
  border: none;
  background: transparent;
}

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

.credits-slider-notches span {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dimmed);
  font-weight: 500;
  min-width: 28px;
  text-align: center;
  padding: 3px 6px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color 0.16s, background 0.16s, font-weight 0.16s;
  -webkit-tap-highlight-color: transparent;
}

.credits-slider-notches span:hover {
  color: var(--text-muted);
  background: var(--bg-secondary);
}

.credits-slider-notches span.active {
  color: var(--tone-violet-700);
  font-weight: 700;
  background: var(--tone-violet-50);
}

/* Buy button — pill primary CTA */
.credits-slider-buy {
  width: 100%;
  margin-top: 14px;
  background: var(--primary);
  border: none;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.005em;
  padding: 14px 20px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.16s var(--ease-standard), box-shadow 0.18s var(--ease-standard), background 0.16s var(--ease-standard);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.credits-slider-buy:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.credits-slider-buy:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Paywall slider variant */
.paywall-slider {
  background: var(--card-tonal);
  border: 1px solid var(--hairline);
  margin-bottom: 16px;
}

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

/* Upgrade CTA */
.cta-primary-v9.cta-upgrade {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 50%, #101024 100%);
  box-shadow: 0 4px 14px rgba(var(--primary-rgb), 0.35);
}

/* Footer link (Upgrade plan / Manage subscription) */
.buy-sheet-footer-link {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 0 8px; /* Increased touch target */
  min-height: 44px; /* iOS accessibility guideline */
  cursor: pointer;
  text-align: center;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast), transform var(--transition-fast);
  border-radius: var(--radius-md);
  /* Ensure focus visibility */
  outline: none;
}
.buy-sheet-footer-link:hover {
  color: var(--primary-hover);
  transform: translateY(-1px);
}
.buy-sheet-footer-link:focus {
  color: var(--primary-hover);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.3);
  transform: translateY(-1px);
}
.buy-sheet-footer-link:active {
  transform: translateY(0);
  color: var(--primary-hover);
}
.buy-sheet-footer-link:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

/* Footer V9 - Sticky at bottom */
.buy-sheet-footer-v9 {
  flex-shrink: 0;
  padding: 16px 24px 24px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  background: var(--bg);
  border-top: 1px solid var(--border-subtle);
  /* Ensure footer is always visible */
  position: sticky;
  bottom: 0;
  z-index: 10;
}

.cta-primary-v9 {
  width: 100%;
  background: var(--primary);
  color: white;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 22px;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.18s ease, background 0.16s ease;
  letter-spacing: 0.005em;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.cta-primary-v9::after {
  display: none;
}

.cta-primary-v9:hover {
  transform: translateY(-1px);
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.cta-primary-v9:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

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

/* Footer Social Proof */
.footer-social-proof {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-dimmed);
  margin: 6px 0 0;
  letter-spacing: 0.01em;
}

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

.footer-trust svg {
  width: 12px;
  height: 12px;
  stroke: var(--text-dimmed);
}

.footer-dot {
  opacity: 0.6;
}

.footer-signin {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 500;
  padding: 0;
}

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

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

/* ============================================
   BUY SHEET CONVERSION OPTIMIZATIONS (v2)
   New styles for improved conversion rate
   ============================================ */

/* Urgency Header - Creates momentum */
.urgency-header {
  text-align: center;
  margin-bottom: 24px;
}

.sheet-subheadline {
  font-size: 1rem;
  color: var(--text-light);
  margin: 8px 0 16px;
  font-weight: 500;
}

.momentum-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid rgba(37, 99, 235, 0.2);
}

.momentum-badge svg {
  color: var(--primary);
}

/* Pricing tabs with clearer positioning */
.pricing-tabs-container {
  margin-bottom: 20px;
}

.buy-billing-option .tab-label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.buy-billing-option .tab-subtitle {
  font-size: 0.72rem;
  font-weight: 400;
  opacity: 0.8;
}

/* Enhanced tier cards */
.tier-description {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
  text-align: center;
}

.sub-tier-v9--popular .tier-description {
  color: var(--text);
}

/* Tier feature lists — per-card value props (desktop only) */
.tier-features {
  display: none;
  list-style: none;
  padding: 0;
  margin: 0;
}

.tier-features li {
  font-size: 0.76rem;
  color: var(--text-muted);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.tier-features li::before {
  content: '\2713';
  color: var(--success);
  font-weight: 700;
  font-size: 0.7rem;
  flex-shrink: 0;
}

.sub-tier-v9--selected .tier-features li {
  color: var(--text);
}

/* Trust signals for packs */
.pack-trust-signals {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trust-item svg {
  color: var(--success);
  stroke-width: 2.5;
}

/* Improved footer styling */
.footer-social-proof-top {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-weight: 500;
}

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

.footer-trust {
  flex-direction: column;
  gap: 8px;
  text-align: center;
}

.footer-trust span {
  font-size: 0.75rem;
}


/* Mobile optimizations */
@media (max-width: 480px) {
  .momentum-badge {
    font-size: 0.8rem;
    padding: 6px 12px;
  }

  .pack-trust-signals {
    flex-direction: column;
    gap: 12px;
    align-items: center;
  }

  .trust-item {
    font-size: 0.75rem;
  }

  .tier-description {
    font-size: 0.75rem;
  }

  .footer-social-proof-top {
    font-size: 0.75rem;
  }
}

/* ============================================
   MOBILE BUY SHEET OPTIMIZATION
   Stack tiers vertically as compact rows.
   Compress spacing to maximize CTA visibility.
   ============================================ */
@media (max-width: 600px) {
  /* Reclaim viewport — mobile buy sheet needs max visible area */
  .buy-sheet-v9 {
    max-height: 92dvh;
  }

  .buy-sheet-v9 .buy-sheet-scroll {
    padding: 12px 16px 8px;
  }

  /* Compress urgency header — less scroll before tiers */
  .urgency-header {
    margin-bottom: 10px;
  }

  .sheet-headline-v9 {
    font-size: 1.25rem;
    margin-bottom: 2px;
  }

  .sheet-subheadline {
    font-size: 0.82rem;
    margin: 2px 0 6px;
  }

  /* Hide momentum badge — takes prime real estate on mobile */
  .momentum-badge {
    display: none;
  }

  /* Billing toggle: tighter */
  .pricing-tabs-container {
    margin-bottom: 12px;
  }

  .buy-billing-toggle {
    margin: 6px 0 12px;
  }

  .buy-billing-option {
    padding: 8px 10px;
    flex-direction: column;
    gap: 1px;
  }

  .buy-billing-option .tab-label {
    font-size: 0.8rem;
  }

  .buy-billing-option .tab-subtitle {
    font-size: 0.65rem;
  }

  /* Stack tier cards vertically — full width instead of cramped 3-col */
  .sub-tiers-v9 {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }

  /* Each tier: compact horizontal row */
  .sub-tier-v9 {
    flex-direction: row;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    gap: 0;
  }

  .sub-tier-v9--popular {
    padding: 12px 16px;
  }

  .sub-tier-v9:hover {
    transform: none;
  }

  /* Badge: inline pill instead of absolute positioned */
  .sub-tier-badge {
    position: static;
    transform: none;
    top: auto;
    left: auto;
    font-size: 0.48rem;
    padding: 2px 6px;
    margin-right: 6px;
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Name: compact left label */
  .sub-tier-name {
    margin-bottom: 0;
    font-size: 0.55rem;
    min-width: 28px;
  }

  /* Credits: inline row, centered flex-grow area */
  .sub-tier-credits-hero {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
    flex: 1;
    margin-left: 8px;
  }

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

  .sub-tier-credits-label {
    font-size: 0.6rem;
    margin-bottom: 0;
  }

  /* Price: right-aligned */
  .sub-tier-price {
    margin-left: auto;
    flex-shrink: 0;
    padding-left: 8px;
  }

  /* Selected tier: stronger visual on mobile horizontal layout */
  .sub-tier-v9--selected {
    border-width: 2px;
    border-color: rgba(var(--primary-rgb), 0.6);
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), rgba(var(--primary-rgb), 0.03));
  }

  .sub-tier-v9--selected .sub-tier-credits-num {
    font-size: 1.65rem;
  }

  /* Hide verbose descriptions on mobile — tiers are self-explanatory */
  .tier-description {
    display: none;
  }

  /* Compact benefits */
  .sub-benefits-v9 {
    margin-bottom: 10px;
    padding: 8px 10px;
    gap: 4px 10px;
  }

  .sub-benefit {
    font-size: 0.7rem;
  }

  /* Compact one-time section */
  .onetime-section-v9 {
    padding-top: 10px;
    margin-top: 2px;
  }

  .onetime-divider-v9 {
    font-size: 0.7rem;
  }

  .credits-slider-container {
    padding: 12px;
  }

  .credits-slider-display {
    margin-bottom: 10px;
  }

  .credits-slider-count {
    font-size: 1.6rem;
  }

  .credits-slider-price {
    font-size: 1.1rem;
    margin-top: 2px;
  }

  /* Slider thumb: larger for mobile touch (28px visual, ~44px touch area) */
  .credits-slider {
    height: 6px;
  }

  .credits-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }

  .credits-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }

  .credits-slider-buy {
    font-size: 0.85rem;
    padding: 8px 0;
    min-height: 44px;
  }

  .pack-trust-signals {
    margin-top: 10px;
    gap: 6px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .pack-trust-signals .trust-item {
    font-size: 0.7rem;
  }

  /* Sticky footer: more prominent CTA */
  .buy-sheet-footer-v9 {
    padding: 10px 16px 14px;
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }

  .footer-social-proof-top {
    font-size: 0.7rem;
    margin-bottom: 8px;
  }

  .cta-primary-v9 {
    min-height: 52px;
    font-size: 1rem;
    padding: 14px 16px;
    border-radius: 12px;
  }

  .footer-trust-container {
    margin-top: 8px;
  }

  .footer-trust span {
    font-size: 0.68rem;
  }
}

/* Animation for shimmer effect */
@keyframes ctaShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}


/* Desktop: Full-screen overlay — no-scroll, everything visible */
@media (min-width: 900px) {
  .buy-sheet-v9 {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-standard);
    display: flex;
    flex-direction: column;
    z-index: 10002;
  }

  .buy-sheet-v9.visible {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .buy-sheet-v9 .sheet-handle { display: none; }

  /* Content: fills viewport, vertically centered when short, scrollable when tall */
  .buy-sheet-v9 .buy-sheet-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    padding: 24px 60px 12px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
  }

  /* Headline — compact for single-screen fit */
  .sheet-headline-v9 {
    font-size: 2rem;
    margin-bottom: 2px;
    letter-spacing: -0.03em;
  }

  .sheet-subheadline {
    margin-bottom: 2px;
  }

  /* Hide momentum badge — value communicated via per-card features */
  .urgency-header .momentum-badge {
    display: none;
  }

  .urgency-header {
    margin-bottom: 8px;
  }

  /* Billing toggle — compact */
  .buy-billing-toggle {
    margin: 4px auto 12px;
    max-width: 360px;
    padding: 3px;
  }

  .buy-billing-option {
    font-size: 0.88rem;
    padding: 9px 16px;
  }

  .buy-save-badge {
    font-size: 0.68rem;
  }

  /* Tier cards — compact with per-card feature bullets */
  .sub-tiers-v9 {
    gap: 14px;
    margin-bottom: 10px;
  }

  .sub-tier-v9 {
    padding: 22px 18px 18px;
    border-radius: 16px;
  }

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

  .sub-tier-badge {
    font-size: 0.62rem;
    padding: 3px 12px;
  }

  .sub-tier-name {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    margin-bottom: 2px;
  }

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

  .sub-tier-credits-label {
    font-size: 0.65rem;
    margin-bottom: 6px;
  }

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

  .sub-tier-price-annual {
    font-size: 0.78rem;
    margin-top: 2px;
  }

  /* Hide description — features replace it */
  .tier-description {
    display: none;
  }

  /* Per-card feature bullets */
  .tier-features {
    display: block;
    margin: 10px auto 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    width: fit-content;
  }

  .tier-features li {
    font-size: 0.74rem;
    padding: 1.5px 0;
  }

  .sub-tier-v9--selected .tier-features {
    border-top-color: rgba(var(--primary-rgb), 0.12);
  }

  /* Hide benefits row — features are now in each card */
  .sub-benefits-v9 {
    display: none;
  }

  /* One-time section: horizontal layout on desktop */
  .onetime-section-v9 {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
  }

  .onetime-divider-v9 {
    font-size: 0.82rem;
    margin-bottom: 4px;
  }

  .buy-sheet-v9 .credits-slider-container {
    padding: 12px 20px;
    border-radius: 14px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0 28px;
  }

  /* Slider display: left column */
  .credits-slider-display {
    grid-column: 1;
    grid-row: 1 / 3;
    margin-bottom: 0;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }

  .credits-slider-count {
    font-size: 2.25rem;
  }

  .credits-slider-label {
    font-size: 1rem;
  }

  .credits-slider-bonus {
    font-size: 0.8rem;
  }

  .credits-slider-price {
    font-size: 1.35rem;
    margin-top: 0;
  }

  .credits-slider-per-edit {
    font-size: 0.82rem;
    margin-top: 0;
    margin-left: 6px;
  }

  /* Slider track: center column, spans rows */
  .credits-slider {
    grid-column: 2;
    grid-row: 1;
    min-width: 240px;
  }

  .credits-slider-notches {
    grid-column: 2;
    grid-row: 2;
    padding-top: 4px;
  }

  .credits-slider-notches span {
    font-size: 0.78rem;
  }

  /* Buy button: right column */
  .credits-slider-buy {
    grid-column: 3;
    grid-row: 1 / 3;
    margin-top: 0;
    font-size: 0.95rem;
    padding: 12px 20px;
    border-radius: 10px;
    width: auto;
    justify-self: end;
    white-space: nowrap;
  }

  /* Hide pack trust signals — slider is self-explanatory on desktop */
  .pack-trust-signals {
    display: none;
  }

  /* Footer — compact, single-line feel */
  .buy-sheet-footer-v9 {
    padding: 10px 60px 18px;
    max-width: 960px;
    margin: 0 auto;
    width: 100%;
  }

  .cta-primary-v9 {
    padding: 14px 24px;
    font-size: 1.1rem;
    border-radius: 12px;
  }

  .footer-social-proof-top {
    font-size: 0.78rem;
    margin-bottom: 8px;
  }

  .footer-reassurance {
    font-size: 0.82rem;
    margin-top: 6px;
  }

  .footer-trust {
    margin-top: 6px;
    font-size: 0.82rem;
    gap: 8px;
  }

  .footer-trust svg {
    width: 14px;
    height: 14px;
  }

  .footer-signin {
    font-size: 0.82rem;
  }

  /* Close button */
  .buy-sheet-v9 .buy-sheet-close {
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
  }
}

/* ============================================
   BUY SHEET REDESIGN — Shared + Quick Buy + Full Plans
   taste-skill aligned: warm surfaces, fine borders,
   Instrument Serif display, spring-physics CTAs
   ============================================ */

/* ── Shared CTAs ────────────────────────────── */
.cta-fill {
  width: 100%; background: var(--primary); color: white;
  font-size: 0.95rem; font-weight: 600; padding: 16px 20px;
  border: none; border-radius: 12px; cursor: pointer;
  letter-spacing: 0.005em;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta-fill:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.3); }
.cta-fill:active { transform: scale(0.98); box-shadow: none; }
.cta-fill:disabled { opacity: 0.5; cursor: default; transform: none; box-shadow: none; }

.cta-ghost {
  width: 100%; background: transparent;
  border: 1px solid rgba(0, 0, 0, 0.06); color: var(--text);
  font-size: 0.92rem; font-weight: 600; padding: 15px 20px;
  border-radius: 12px; cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.cta-ghost:hover { border-color: rgba(var(--primary-rgb), 0.2); background: rgba(var(--primary-rgb), 0.03); }
.cta-ghost:active { transform: scale(0.98); }
.cta-ghost:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ── Shared layout primitives ───────────────── */
.bs-header { text-align: center; margin-bottom: 28px; padding-top: 4px; }
.bs-title {
  font-family: var(--font-display), serif; font-size: 1.5rem;
  font-weight: 400; color: var(--text);
  letter-spacing: -0.025em; margin: 0 0 6px;
}
.bs-sub { font-size: 0.85rem; color: var(--text-muted); margin: 0; line-height: 1.45; }

.bs-sep { text-align: center; margin: 28px 0; position: relative; }
.bs-sep::before {
  content: ''; position: absolute; left: 0; right: 0;
  top: 50%; height: 1px; background: rgba(0, 0, 0, 0.06);
}
.bs-sep span {
  position: relative; background: var(--bg); padding: 0 14px;
  font-size: 0.72rem; color: var(--text-dimmed); letter-spacing: 0.02em;
}

.bs-trust {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; font-size: 0.72rem; color: var(--text-muted);
}
.bs-trust svg { stroke: var(--text-dimmed); flex-shrink: 0; opacity: 0.7; }
.bs-trust .footer-signin { margin-left: 8px; }

/* ── Simplified footer (no sticky CTA) ──────── */
.buy-sheet-simple .buy-sheet-footer-v9 {
  border-top: none; padding-top: 8px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* ── Quick Buy: Pack card ───────────────────── */
.bs-pack {
  background: #FAFAF8; border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 16px; padding: 24px 22px;
}
.bs-pack-head {
  display: flex; align-items: baseline;
  justify-content: space-between; margin-bottom: 20px;
}
.bs-pack-left { display: flex; flex-direction: column; gap: 3px; }
.bs-pack-credits {
  font-family: var(--font-display), serif; font-size: 1.2rem;
  font-weight: 400; color: var(--text);
}
.bs-pack-note { font-size: 0.74rem; color: var(--text-dimmed); }
.bs-pack-price {
  font-family: var(--font-display), serif; font-size: 1.75rem;
  font-weight: 400; color: var(--primary);
  letter-spacing: -0.03em; font-variant-numeric: tabular-nums;
}
.bs-pack .cta-fill { margin-bottom: 20px; }

/* Inline slider zone */
.bs-slider-zone { border-top: 1px solid rgba(0, 0, 0, 0.06); padding-top: 16px; }
.bs-slider-label {
  display: block; font-size: 0.72rem; color: var(--text-dimmed);
  margin-bottom: 12px; text-align: center; letter-spacing: 0.01em;
}
.bs-slider-readout {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin-top: 10px;
  font-size: 0.82rem; color: var(--text-muted); font-weight: 500;
}
.bs-dot { color: var(--text-dimmed); }
.bs-slider-peredit { color: var(--accent, #1a1a2e); font-weight: 600; }

.bs-expand {
  display: block; width: 100%; border: none;
  background: rgba(var(--primary-rgb), 0.06);
  color: var(--primary); font-size: 0.82rem; font-weight: 600;
  padding: 12px 16px; margin-top: 16px; cursor: pointer; text-align: center;
  border-radius: 10px;
  transition: background 0.15s, color 0.15s;
}
.bs-expand:hover { background: rgba(var(--primary-rgb), 0.1); }
.bs-pack-link {
  display: block; width: 100%; background: none; border: none;
  color: var(--text-dimmed); font-size: 0.8rem; font-weight: 500;
  padding: 16px 0 0; cursor: pointer; text-align: center;
  transition: color 0.15s;
}
.bs-pack-link:hover { color: var(--primary); }

/* ── Full Plans: Back link ──────────────────── */
.bs-back {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; color: var(--text-dimmed);
  font-size: 0.8rem; font-weight: 500; padding: 0 0 20px; cursor: pointer;
}
.bs-back:hover { color: var(--primary); }

/* ── Full Plans: Billing toggle ─────────────── */
.bs-toggle { display: flex; justify-content: center; margin-bottom: 28px; }
.bs-toggle-inner {
  display: inline-flex; border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px; padding: 3px;
}
.bs-toggle-btn {
  padding: 7px 18px; border-radius: 8px; font-size: 0.76rem;
  font-weight: 600; border: none; background: none;
  color: var(--text-dimmed); cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.bs-toggle-btn--on { background: var(--text); color: white; }

/* ── Full Plans: Standard hero card ─────────── */
.bs-hero {
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  background: #FAFAF8; border-radius: 16px;
  padding: 28px 22px; margin-bottom: 12px;
}
.bs-hero-top {
  display: flex; justify-content: space-between;
  align-items: baseline; margin-bottom: 6px;
}
.bs-hero-name {
  font-family: var(--font-display), serif; font-size: 1.3rem;
  font-weight: 400; color: var(--text);
}
.bs-hero-price {
  font-family: var(--font-display), serif; font-size: 1.5rem;
  font-weight: 400; color: var(--primary);
  letter-spacing: -0.02em; font-variant-numeric: tabular-nums;
}
.bs-hero-credits { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 4px; }
.bs-hero-perks {
  font-size: 0.74rem; color: var(--text-dimmed);
  margin-bottom: 20px; line-height: 1.5;
}

/* ── Full Plans: Compact plan rows ──────────── */
.bs-plan-row {
  display: flex; align-items: center; padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, 0.06); border-radius: 14px;
  cursor: pointer; transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  margin-bottom: 8px;
}
.bs-plan-row:hover {
  background: rgba(var(--primary-rgb), 0.02);
  border-color: rgba(var(--primary-rgb), 0.1);
}
.bs-plan-row:active { transform: scale(0.98); }
.bs-row-name {
  font-family: var(--font-display), serif; font-size: 1rem;
  font-weight: 400; color: var(--text); min-width: 36px;
}
.bs-row-credits { font-size: 0.78rem; color: var(--text-muted); margin-left: 6px; flex: 1; }
.bs-row-price {
  font-family: var(--font-display), serif; font-size: 1rem;
  font-weight: 400; color: var(--text); font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.bs-row-arrow { margin-left: 10px; color: var(--text-dimmed); font-size: 0.85rem; }

/* ── Responsive: Mobile ─────────────────────── */
@media (max-width: 600px) {
  .bs-header { margin-bottom: 20px; }
  .bs-title { font-size: 1.35rem; }
  .bs-sub { font-size: 0.82rem; }
  .bs-pack { padding: 20px 18px; }
  .bs-pack-price { font-size: 1.5rem; }
  .bs-sep { margin: 20px 0; }
  .bs-hero { padding: 22px 18px; }
  .bs-hero-price { font-size: 1.3rem; }
  .bs-plan-row { padding: 14px 16px; }
  .cta-fill { padding: 14px 18px; font-size: 0.92rem; }
  .cta-ghost { padding: 14px 18px; font-size: 0.88rem; }
}

/* ── Responsive: Desktop ────────────────────── */
@media (min-width: 900px) {
  .buy-sheet-simple .buy-sheet-scroll { max-width: 520px; }
  .buy-sheet-simple .buy-sheet-footer-v9 { max-width: 520px; }
  .bs-title { font-size: 1.75rem; }
  .bs-pack { padding: 28px 24px; }
  .bs-hero { padding: 32px 28px; }
  .cta-fill { padding: 16px 24px; font-size: 0.98rem; }
  .cta-ghost { padding: 16px 24px; font-size: 0.95rem; }
}

/* ============================================
   MODAL OVERLAY
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 20, 40, 0.45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  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;
  z-index: 2147483647;
}

.modal-content {
  background: var(--card);
  border-radius: var(--r-xl);
  padding: 36px 28px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  transform: scale(0.94);
  transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--hairline);
}

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

.modal-icon {
  width: 60px;
  height: 60px;
  background: var(--tone-violet-50);
  color: var(--tone-violet-700);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 2.4rem;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.015em;
  margin-bottom: 10px;
}

.modal-text {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.5;
  margin-bottom: 22px;
}

.subscription-success-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
  padding: 14px 18px;
  background: var(--card-tonal);
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
}

/* Subscription success variant — violet accent (matches Pro tier) */
.subscription-success .modal-icon {
  background: var(--tone-violet-50);
  color: var(--tone-violet-700);
}

.subscription-success .modal-stat-value {
  color: var(--tone-violet-700);
}

.subscription-success .modal-value .value-item {
  color: var(--tone-violet-700);
}

.success-detail {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
}

.modal-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--card-tonal);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
}

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

.modal-stat-value {
  font-family: var(--font-body);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--tone-emerald-700);
  letter-spacing: -0.025em;
}

.modal-stat-label {
  font-family: var(--font-body);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.modal-value {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--card-tonal);
  border-radius: var(--r-lg);
  border: 1px solid var(--hairline);
}

.modal-value .value-item {
  font-family: var(--font-body);
  color: var(--tone-emerald-700);
  font-size: 13.5px;
  font-weight: 600;
}

.modal-btn {
  width: 100%;
  padding: 14px 22px;
  border: none;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.005em;
  cursor: pointer;
  transition: transform 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard), background 0.18s var(--ease-standard), color 0.18s var(--ease-standard);
  margin-bottom: 10px;
}

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

.modal-btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.modal-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

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

.modal-btn-secondary:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

/* ============================================
   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 var(--ease-out) forwards;
}

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

.celebration-stat {
  font-family: var(--font-display), serif;
  font-size: 3rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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, var(--tone-violet) 0%, var(--tone-violet-700) 100%);
  -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: var(--tone-emerald-100);
}
.celebration-pack .celebration-icon svg path {
  stroke: var(--tone-emerald);
}

.celebration-sub .celebration-icon svg circle {
  stroke: var(--tone-violet-100);
}
.celebration-sub .celebration-icon svg path {
  stroke: var(--tone-violet);
}

/* Violet pulse on success icon after celebration-pop completes */
.modal-overlay.visible .celebration-sub .celebration-icon {
  animation: celebration-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             violet-pulse 2s 1s var(--ease-in-out) infinite;
}

@keyframes violet-pulse {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(0, 0, 0, 0)); }
  50% { filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.15)); }
}
/* Reduced motion: skip all celebration animations, show final state immediately.
   Fixes stuck invisible content on iOS low power mode, bfcache restore, and
   when prefers-reduced-motion is active. */
@media (prefers-reduced-motion: reduce) {
  .modal-overlay.visible .celebration-icon { transform: scale(1); animation: none; }
  .modal-overlay.visible .checkmark-draw { stroke-dashoffset: 0; animation: none; }
  .modal-overlay.visible .celebration-stat,
  .modal-overlay.visible .celebration-stat-label,
  .modal-overlay.visible .celebration-modal .modal-title,
  .modal-overlay.visible .celebration-modal .modal-text,
  .modal-overlay.visible .celebration-modal .subscription-success-details,
  .modal-overlay.visible .celebration-modal .success-detail,
  .modal-overlay.visible .celebration-modal .modal-btn {
    opacity: 1; transform: translateY(0); animation: none;
  }
  .modal-overlay.visible .share-option-btn {
    opacity: 1; transform: translateY(0); animation: none;
  }
  /* Disable breathing glow on CTA buttons */
  .edit-btn,
  .cta-primary-v9,
  .header-try-free {
    animation: none !important;
  }
}

/* ============================================
   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: 14px 18px;
  background: var(--card-tonal);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.18s var(--ease-standard), border-color 0.18s var(--ease-standard), transform 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--text);
}

.share-option-btn:hover {
  background: var(--tone-violet-50);
  border-color: color-mix(in srgb, var(--tone-violet) 26%, transparent);
  color: var(--tone-violet-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-tonal-violet);
}

.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: transparent;
  border: none;
  border-radius: var(--r-pill);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: background 0.18s, color 0.18s;
}

.adblocker-dismiss:hover {
  background: var(--tone-rose-50);
  color: var(--tone-rose-700);
}

.adblocker-icon {
  width: 64px;
  height: 64px;
  background: var(--tone-rose-50);
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--tone-rose-700);
}

.adblocker-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.adblocker-message {
  font-family: var(--font-body);
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 24px;
}

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

.adblocker-option {
  width: 100%;
  padding: 14px 18px;
  background: var(--card-tonal);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.18s var(--ease-standard), border-color 0.18s var(--ease-standard), transform 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-body);
}

.adblocker-option:hover {
  background: var(--tone-violet-50);
  border-color: color-mix(in srgb, var(--tone-violet) 26%, transparent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-tonal-violet);
}

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

.adblocker-option.primary {
  background: var(--primary);
  border-color: transparent;
  color: white;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.adblocker-option.primary:hover {
  background: var(--primary-hover);
  border-color: transparent;
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.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-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}

.adblocker-option-subtitle {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  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 {
  font-family: var(--font-display);
  margin: 0 0 4px 0;
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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(0, 0, 0, 0.1);
}

.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 var(--ease-standard);
}

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

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

.conversion-modal-v2 {
  max-width: 420px;
  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);
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 24px 80px rgba(0, 0, 0, 0.14),
    0 0 0 1px rgba(26, 26, 46, 0.03);
}

/* 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 var(--ease-standard) 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 - subtle frame */
.conversion-preview-v2 {
  width: 100%;
  flex: 1;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  background: var(--bg-secondary);
  overflow: hidden;
  padding: 24px;
}

/* Ambient glow behind image */
.conversion-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 50%,
    rgba(26, 26, 46, 0.06) 0%,
    transparent 70%
  );
  pointer-events: none;
}

@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.12),
    0 0 1px rgba(0, 0, 0, 0.06);
  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 var(--ease-out) 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 var(--ease-out) 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 var(--ease-out) 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 var(--ease-out) 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 var(--ease-standard) 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 var(--ease-out) 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 var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: textReveal 0.4s var(--ease-out) 0.5s both;
  text-decoration: underline;
  text-decoration-color: rgba(0, 0, 0, 0.15);
  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 var(--ease-standard);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  animation: textReveal 0.4s var(--ease-out) 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;
}

/* ============================================
   UNIFIED PAYWALL — Single-screen conversion
   Full-screen premium takeover.
   Single centered column on ALL devices.
   ============================================ */

/* Container — full-screen takeover */
.paywall {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  -webkit-overflow-scrolling: touch;
}


/* Violet ambient glow */
.paywall::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center top, var(--tone-violet-50) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
  opacity: 0.7;
}

.paywall > * {
  position: relative;
  z-index: 1;
}
#conversionModal.visible {
  padding: 0;
}

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

@keyframes paywallReveal {
  0% {
    opacity: 0;
    transform: scale(0.97);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Screen visibility system */
.paywall-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 480px;
  padding: 0 24px 32px;
  padding-bottom: max(32px, env(safe-area-inset-bottom));
  animation: textReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

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

.paywall-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.3s var(--ease-standard) 0.5s, background 0.2s var(--ease-standard), color 0.2s, transform 0.1s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow-sm);
}

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

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

.paywall-close:hover {
  color: var(--tone-rose-700);
  background: var(--tone-rose-50);
  border-color: color-mix(in srgb, var(--tone-rose) 22%, transparent);
}

.paywall-close:active {
  transform: scale(0.92);
}

/* ---- Hero: Compact, centered ---- */
.paywall-hero {
  width: 100%;
  max-width: 520px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  padding: 24px 24px 28px;
  max-height: none;
}

/* Before/after hero — single image, tap to toggle.
   The toggle is a fixed-height stage so both images can be absolutely
   positioned and cross-fade cleanly with no layout shift. */
.paywall-hero-toggle {
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 200px;
  z-index: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  animation: imageReveal 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s both;
  border-radius: 12px;
}

.paywall-hero-toggle:active {
  transform: scale(0.985);
  transition: transform 0.08s ease-out;
}

/* Quick pulse on tap — gives users instant tactile feedback that the
   tap registered, even before the cross-fade completes. */
.paywall-hero-toggle--pressed {
  animation: paywallHeroPulse 0.32s ease-out;
}

@keyframes paywallHeroPulse {
  0%   { transform: scale(0.985); }
  40%  { transform: scale(1.012); }
  100% { transform: scale(1); }
}

/* Brief scale-down pulse when a rapid tap is debounced — confirms the touch
   registered even though the image hasn't switched yet. */
@keyframes paywall-hero-toggle-bounce {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}
.paywall-hero-toggle--bounce {
  animation: paywall-hero-toggle-bounce 150ms ease-out;
}

.paywall-hero-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--hairline);
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.paywall-hero-img--active {
  opacity: 1;
}

.paywall-hero-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  background: var(--tone-violet);
  padding: 5px 11px;
  border-radius: var(--r-pill);
  z-index: 2;
  transition: background 0.2s;
  pointer-events: none;
  box-shadow: var(--shadow-tonal-violet);
}

.paywall-hero-badge[data-state="before"] {
  background: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.paywall-hero-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
  background: rgba(255, 255, 255, 0.96);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline);
  white-space: nowrap;
  z-index: 2;
  opacity: 1;
  pointer-events: none;
  box-shadow: var(--shadow-md);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.paywall-hero-hint::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--tone-violet);
  animation: paywallHintPulse 1.8s ease-in-out infinite;
}

@keyframes paywallHintPulse {
  0%, 100% { opacity: 0.4; transform: scale(0.85); }
  50%      { opacity: 1;   transform: scale(1.15); }
}

/* ---- Screen 1: Inline Pricing ---- */


.paywall-sub-mention {
  display: block;
  width: 100%;
  padding: 12px 16px 0;
  margin-top: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s ease;
  letter-spacing: 0.005em;
}

.paywall-sub-mention:hover { color: var(--tone-violet-700); }
.paywall-sub-mention:active { color: var(--tone-violet-700); }

.paywall-see-all {
  display: block;
  width: 100%;
  padding: 10px 16px 4px;
  margin-top: 2px;
  background: none;
  border: none;
  color: var(--tone-violet-700);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
  letter-spacing: 0.005em;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tone-violet) 32%, transparent);
  text-underline-offset: 4px;
}

.paywall-see-all:hover {
  color: var(--tone-violet-700);
  text-decoration-color: var(--tone-violet);
}

.paywall-see-all:active { color: var(--tone-violet-700); }

/* One-time divider within paywall */
.paywall-onetime-divider {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-dimmed);
  margin: 16px 0 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

/* ---- Screen 1: The Hook ---- */

.paywall-headline {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.025em;
  line-height: 1.15;
  animation: textReveal 0.35s var(--ease-out) 0.15s both;
}

.paywall-value-text {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 20px;
  text-align: center;
  animation: textReveal 0.35s var(--ease-out) 0.2s both;
}

/* Paywall slider — tonal-violet track + thumb to match credits-slider.
 * Visual track is 6px but the input is 44px tall for a HIG-compliant
 * touch target; gradient centers the visible track vertically. */
.paywall-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 44px;
  background: linear-gradient(
    to right,
    var(--tone-violet) 0%,
    var(--tone-violet) var(--slider-fill, 33%),
    var(--bg-secondary) var(--slider-fill, 33%),
    var(--bg-secondary) 100%
  ) no-repeat center/100% 6px;
  border-radius: var(--r-pill);
  outline: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}
.paywall-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--card);
  cursor: grab;
  border: 3px solid var(--tone-violet);
  box-shadow: var(--shadow-tonal-violet);
  transition: transform 0.16s var(--ease-standard);
}
.paywall-slider::-webkit-slider-thumb:hover { transform: scale(1.10); }
.paywall-slider::-webkit-slider-thumb:active { cursor: grabbing; transform: scale(1.05); }
.paywall-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--r-pill);
  background: var(--card);
  cursor: grab;
  border: 3px solid var(--tone-violet);
  box-shadow: var(--shadow-tonal-violet);
}
.paywall-slider::-moz-range-track {
  height: 44px;
  border: none;
  background: transparent;
}

/* Shared CTA base — impulse + downsell */
.paywall-cta--impulse,
.paywall-cta--downsell {
  min-height: 54px;
  font-family: var(--font-body);
  font-size: 14.5px;
  border-radius: var(--r-pill);
  padding: 14px 24px;
  margin-bottom: 0;
  background: var(--primary);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.paywall-cta--impulse:hover,
.paywall-cta--downsell:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.paywall-cta--impulse:active,
.paywall-cta--downsell:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.paywall-cta--impulse .paywall-cta-label,
.paywall-cta--downsell .paywall-cta-label {
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
}

.paywall-cta--impulse .paywall-cta-price,
.paywall-cta--downsell .paywall-cta-price {
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  letter-spacing: 0.005em;
  margin-top: 2px;
}

.paywall-cta--impulse {
  animation: textReveal 0.35s var(--ease-out) 0.3s both;
}

/* Pack selector — slider with visible notch labels */
.paywall-pack-selector {
  margin-bottom: 12px;
}

/* Paywall notches — inherits from .credits-slider-notches, override weight only */
.paywall-slider-notches {
  display: flex;
  justify-content: space-between;
  padding: 8px 0 0;
}

.paywall-slider-notches span {
  font-size: 0.68rem;
  color: var(--text-dimmed, #aaa);
  font-weight: 400;
  min-width: 32px;
  text-align: center;
  padding: 8px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, font-weight 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.paywall-slider-notches span:hover {
  color: var(--text-secondary, #666);
  background: var(--bg-secondary, rgba(0,0,0,0.03));
}

.paywall-slider-notches span.active {
  color: var(--text, #1a1a2e);
  font-weight: 700;
  background: var(--bg-secondary, rgba(0,0,0,0.05));
}


/* Social proof divider — inside offer card */
.paywall-social-proof {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.7rem;
  color: var(--text-dimmed);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  margin: 0 0 16px;
}

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

/* Plan card inside offer card */
.paywall-plan-card {
  background: linear-gradient(165deg, rgba(var(--primary-rgb), 0.06), rgba(var(--primary-rgb), 0.02));
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  border-radius: 14px;
  padding: 18px 20px 16px;
  text-align: center;
  margin-bottom: 16px;
  position: relative;
}

.plan-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.plan-popular-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(var(--primary-rgb), 0.12);
  padding: 3px 8px;
  border-radius: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.paywall-plan-value-prop {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.4;
}

.paywall-plan-pricing {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: 4px;
}

.plan-price-large {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.plan-price-period {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.paywall-plan-billing {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.paywall-plan-name {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 2px;
}

.paywall-plan-credits {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.paywall-plan-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dimmed);
  letter-spacing: 0.01em;
}

.paywall-plan-price {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 4px;
}

/* Base paywall CTA — pill primary with tonal-violet shadow + shimmer sweep */
.paywall-cta {
  width: 100%;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: transform 0.18s var(--ease-standard), box-shadow 0.22s var(--ease-standard), background 0.18s var(--ease-standard);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  position: relative;
  overflow: hidden;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 14px 24px;
  margin-bottom: 16px;
  font-family: var(--font-body);
}

.paywall-cta-label {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.005em;
}

.paywall-cta-price {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.005em;
}

.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 var(--ease-standard) 1.2s infinite;
}

.paywall-cta:hover {
  transform: translateY(-2px);
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}

.paywall-cta:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

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

/* Primary CTA variant */
.paywall-cta--primary {
  background: var(--primary);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  border: none;
}

.paywall-cta--primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), var(--shadow-tonal-violet-lg);
}


/* Feature list — Grok-style circle icons */
.paywall-value-demo {
  margin: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.value-demo-item {
  display: flex;
  align-items: center;
  gap: 14px;
}

.value-demo-item:nth-child(1) { animation: textReveal 0.4s 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.value-demo-item:nth-child(2) { animation: textReveal 0.4s 0.6s cubic-bezier(0.16, 1, 0.3, 1) both; }
.value-demo-item:nth-child(3) { animation: textReveal 0.4s 0.7s cubic-bezier(0.16, 1, 0.3, 1) both; }

.demo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
}

.demo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.demo-text strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.demo-text span {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}


/* ---- Screen 2: Shrink hero so plans are above fold ---- */
.paywall[data-active-screen="2"] .paywall-hero {
  padding: 12px 24px 8px;
}

.paywall[data-active-screen="2"] .paywall-hero-toggle {
  height: 100px;
}

.paywall[data-active-screen="2"] .paywall-hero-img {
  max-height: 100px;
}

/* ---- Screen 2: Full Plan Comparison ---- */

.paywall-drawer {
  width: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  animation: textReveal 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.paywall-drawer-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 20px;
  text-align: center;
  letter-spacing: -0.025em;
}


.paywall-billing-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 4px;
  display: flex;
  margin-bottom: 20px;
  font-family: var(--font-body);
}

.paywall-billing-option {
  flex: 1;
  padding: 9px 14px;
  border-radius: var(--r-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dimmed);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease, background 0.24s ease;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  -webkit-tap-highlight-color: transparent;
}

.paywall-billing-option--active {
  background: var(--card);
  color: var(--tone-violet-700);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.10), 0 1px 1px rgba(20, 20, 40, 0.05);
}

.paywall-save-badge {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--tone-emerald-50);
  color: var(--tone-emerald-700);
  padding: 3px 7px;
  border-radius: var(--r-pill);
}

/* Tier cards (Screen 2) — always 3 columns */
.paywall-tiers {
  display: flex;
  flex-direction: row;
  gap: 10px;
  margin-bottom: 18px;
}

.paywall-tier {
  background: var(--card);
  border: 1.5px solid var(--hairline);
  border-radius: var(--r-lg);
  flex: 1;
  padding: 20px 10px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.22s var(--ease-standard),
              background 0.22s var(--ease-standard),
              transform 0.22s var(--ease-standard),
              box-shadow 0.24s var(--ease-standard);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  font-family: var(--font-body);
}

.paywall-tier:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 28%, transparent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.paywall-tier--selected {
  border-color: var(--tone-violet);
  background: linear-gradient(180deg, var(--tone-violet-50) 0%, var(--card) 60%);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.paywall-tier--selected:hover {
  border-color: var(--tone-violet);
  transform: translateY(-3px);
}

.paywall-tier-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--tone-violet);
  color: #fff;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(124, 92, 252, 0.30);
}

.paywall-tier-name {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.paywall-tier--selected .paywall-tier-name {
  color: var(--tone-violet-700);
}

.paywall-tier-credits {
  font-family: var(--font-body);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.paywall-tier--selected .paywall-tier-credits {
  color: var(--tone-violet-700);
}

.paywall-tier-unit {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.paywall-tier-price {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.paywall-tier--selected .paywall-tier-price {
  color: var(--tone-violet-700);
}

.paywall-tier-per-edit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--tone-emerald-700);
  margin-top: 4px;
  letter-spacing: 0.005em;
}

.paywall-screen2-slider {
  display: block;
  margin-top: 10px;
  padding: 18px;
  background: var(--card-tonal);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  margin-bottom: 12px;
}


.paywall-save-sd-link {
  display: block;
  margin: 12px auto 0;
  padding: 0;
  background: none;
  border: none;
  color: var(--tone-violet-700);
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--tone-violet) 32%, transparent);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.paywall-save-sd-link:hover {
  text-decoration-color: var(--tone-violet);
}


/* ---- Screen 3: Downsell ---- */

.downsell {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  animation: textReveal 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.downsell-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin-bottom: 20px;
}

.downsell-divider-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.downsell-divider-text {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.downsell-headline {
  font-family: var(--font-display), serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text);
  margin: 0 0 6px;
  text-align: center;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.downsell-subtext {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  text-align: center;
  line-height: 1.4;
}

/* Downsell-specific overrides (base shared with --impulse above) */
.paywall-cta--downsell {
  position: relative;
  overflow: hidden;
}

.paywall-cta--downsell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.downsell-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.downsell-dismiss:hover {
  color: var(--text);
}


/* ---- Stripe Recovery Modal ---- */

.recovery-modal {
  max-width: 360px;
  padding: 28px 24px 24px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  animation: textReveal 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.recovery-dismiss {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dimmed);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.recovery-dismiss:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.recovery-image-wrap {
  width: 100%;
  max-width: 200px;
  margin: 0 auto 16px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px var(--border-subtle);
}

.recovery-preview {
  width: 100%;
  display: block;
  object-fit: contain;
  max-height: 180px;
}

.recovery-headline {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  letter-spacing: -0.025em;
}

.recovery-subtext {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-muted);
  margin: 0 0 18px;
}

.recovery-modal .paywall-cta--downsell {
  width: 100%;
}

.recovery-modal .downsell-dismiss {
  margin-top: 4px;
}


/* ---- Mobile refinements ---- */
@media (max-width: 599px) {
  .paywall-screen {
    padding: 0 20px 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .paywall-hero {
    padding: 14px 20px 12px;
    max-height: none;
  }

  .paywall-hero-toggle {
    height: 110px;
    max-width: 180px;
  }

  .paywall-hero-img {
    max-height: 110px;
  }

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

  .paywall-cta--impulse,
  .paywall-cta--downsell {
    min-height: 52px;
    padding: 14px 20px;
  }

  .paywall-cta--impulse .paywall-cta-label,
  .paywall-cta--downsell .paywall-cta-label {
    font-size: 1rem;
  }

  .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 screens */
@media (max-height: 580px) {
  .paywall-hero {
    padding: 12px 16px 16px;
    max-height: none;
  }

  .paywall-hero-toggle {
    height: 120px;
  }

  .paywall-hero-img {
    max-height: 120px;
  }

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

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

  .paywall-value-text {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }

  .paywall-cta--impulse,
  .paywall-cta--downsell {
    min-height: 48px;
    padding: 12px 16px;
  }

  .paywall-onetime-divider {
    margin: 10px 0 6px;
  }

  .demo-icon {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }
}

/* Desktop — floating card with proper image sizing */
@media (min-width: 600px) {
  #conversionModal.visible {
    padding: 24px;
  }

  .paywall {
    max-width: 560px;
    height: auto;
    max-height: 92vh;
    border-radius: 24px;
    box-shadow:
      0 25px 60px rgba(0, 0, 0, 0.18),
      0 0 0 1px rgba(0, 0, 0, 0.06);
  }

  .paywall-hero {
    padding: 36px 36px 28px;
    max-height: none;
  }

  .paywall-hero-toggle {
    height: 260px;
    max-width: 360px;
  }

  .paywall-hero-img {
    max-height: 260px;
    border-radius: 14px;
  }

  .paywall-screen {
    max-width: 560px;
    padding: 0 36px 40px;
  }

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

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

  .paywall-close {
    position: absolute;
  }

  .paywall-hero-badge {
    font-size: 0.7rem;
  }

}


/* ============================================
   LOGIN FORM
   ============================================ */
.login-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  background: var(--card-tonal);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  margin-bottom: 14px;
  transition: border-color 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard), background 0.18s var(--ease-standard);
}

.login-input:focus {
  outline: none;
  border-color: var(--tone-violet);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--tone-violet-50);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
}

.user-email {
  text-align: center;
  color: var(--text);
  font-size: 1rem;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  padding: 14px;
  background: var(--bg-subtle, rgba(0, 0, 0, 0.02));
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

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

.login-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--r-pill);
  background: var(--tone-violet-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: var(--tone-violet-700);
  box-shadow: var(--shadow-tonal-violet);
}

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

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

.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: 24px 0;
}

.login-sent-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--r-pill);
  background: var(--tone-emerald-50);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: var(--tone-emerald-700);
}

.login-sent-email {
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  margin: 8px 0 16px;
  padding: 10px 14px;
  background: var(--card-tonal);
  border-radius: var(--r-md);
  display: inline-block;
}

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

.account-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--text, #1a1a2e);
  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: 14px;
  padding: 16px 18px;
  background: rgba(26, 26, 46, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s var(--ease-standard);
}

.account-action-card:hover {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(26, 26, 46, 0.04);
  transform: translateY(-2px);
  box-shadow:
    0 2px 8px rgba(26, 26, 46, 0.04),
    0 8px 24px rgba(26, 26, 46, 0.03);
}

.account-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(26, 26, 46, 0.04);
  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-subtle);
  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: 12px;
  transition: all 0.2s var(--ease-standard);
}

.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: 14px 18px;
  background: var(--bg-subtle, rgba(0, 0, 0, 0.02));
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  margin-bottom: 14px;
}

.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: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

.sheet-lang-label {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  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 var(--ease-standard);
  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 var(--ease-standard);
  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
   Streamlined progressive disclosure on phones — tighter padding,
   stacked footer, slimmer surfaces. Reference card and free-res
   notice slimmed to pills (handled in their own rule blocks).
   ============================================ */
@media (max-width: 768px) {
  .edit-card {
    padding: 14px;
    border-radius: var(--r-md);
    gap: 8px;
  }

  .edit-card-footer {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
  }

  .footer-left {
    width: 100%;
    justify-content: space-between;
  }

  .quality-toggle {
    flex: 1;
    min-width: 0;
  }

  .edit-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 20px;
    min-height: 48px;
    justify-content: center;
    white-space: normal;
    text-overflow: ellipsis;
  }
}

@media (max-width: 480px) {
  .edit-card {
    padding: 12px;
    border-radius: 14px;
  }

  .prompt-input {
    min-height: 56px;
    padding: 10px;
    font-size: 0.95rem;
  }

  .toggle-option {
    padding: 10px 14px;
    min-height: 44px;
    font-size: 0.85rem;
  }

  .reference-btn {
    padding: 8px 12px;
    min-height: 40px;
  }

  .reference-btn svg {
    width: 18px;
    height: 18px;
  }

  .reference-btn-text {
    font-size: 0.8rem;
  }
}

/* ============================================
   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 - Full-screen on desktop (overrides bottom-sheet centering) */
  .buy-sheet-v9 {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    height: 100dvh;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
    transform: none;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease-standard);
  }

  .buy-sheet-v9.visible {
    transform: none;
    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(26, 26, 46, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.07);
  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 var(--ease-standard), box-shadow 0.1s var(--ease-standard);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  margin-top: 8px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.hero-upload-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.hero-upload-btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.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 var(--ease-standard);
  position: relative;
}

.feature-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.feature-card.featured {
  border-color: var(--primary-light);
  background: linear-gradient(to bottom, rgba(26, 26, 46, 0.03), 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(0, 0, 0, 0.06);
  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(0, 0, 0, 0.06);
  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 var(--ease-standard);
}

.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 var(--ease-standard);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.final-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.2);
}

/* ============================================
   HOW IT WORKS SECTION
   ============================================ */
.how-it-works {
  text-align: center;
  margin: 40px 0 32px;
}

.how-it-works h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.02em;
  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 var(--ease-standard), transform 0.2s var(--ease-standard);
  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(26, 26, 46, 0.05);
  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(0, 0, 0, 0.1);
}

.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 var(--ease-standard);
}

.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(26, 26, 46, 0.03) 0%, #fff 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.pricing-card-popular:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.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 var(--ease-standard);
  background: var(--primary);
  color: white;
}

.pricing-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.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 var(--ease-standard);
  min-width: 120px;
}

.payg-option:hover {
  border-color: var(--text-dimmed);
  transform: translateY(-2px);
}

.payg-option-best {
  border-color: var(--primary);
  background: rgba(26, 26, 46, 0.03);
}

.payg-option-best:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.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 18px;
  border-radius: var(--r-pill);
  border: none;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s var(--ease-standard), box-shadow 0.22s var(--ease-standard), background 0.18s var(--ease-standard);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.post-edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.post-edit-btn:active {
  transform: scale(0.95);
}

.post-edit-btn-primary {
  background: var(--primary);
  color: white;
  padding: 14px 22px;
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  animation: post-edit-pulse 2s var(--ease-in-out) infinite;
}

.post-edit-btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-lg), 0 8px 24px rgba(124, 92, 252, 0.36);
  animation: none;
}

.post-edit-btn-primary svg {
  stroke: white;
}

@keyframes post-edit-pulse {
  0%, 100% {
    box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  }
  50% {
    box-shadow: var(--shadow-lg), 0 0 0 8px color-mix(in srgb, var(--tone-violet) 14%, transparent);
  }
}

/* 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 var(--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%, var(--primary-light) 100%);
  color: white;
  padding: 16px 28px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 10002;
  pointer-events: none;
  animation: success-badge-pop 2s var(--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(0, 0, 0, 0.06);
  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 var(--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 var(--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 var(--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 var(--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;
}

/* 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 var(--ease-standard);
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Default card - light purple tint */
.pack-card,
.option-card {
  background: rgba(26, 26, 46, 0.04);
  border-color: rgba(0, 0, 0, 0.1);
}

.pack-card:hover,
.option-card:hover {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.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(26, 26, 46, 0.04) 0%, rgba(99, 102, 241, 0.03) 100%);
  border: 1px solid rgba(0, 0, 0, 0.07);
  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: var(--tone-violet);
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: white;
  text-transform: uppercase;
  box-shadow: var(--shadow-tonal-violet);
}

.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(26, 26, 46, 0.05);
  border-radius: 8px;
  transition: background 0.2s var(--ease-standard);
}

.perk-item:hover {
  background: rgba(0, 0, 0, 0.07);
}

.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: #4a4a66;
  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(0, 0, 0, 0.08) 0%, rgba(167, 139, 250, 0.1) 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.perk-item-highlight .perk-icon svg {
  stroke: #4a4a66;
}

.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;
}

/* 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;
}

/* 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)
   Two-column split: copy left, dropzone right
   Stacks on mobile
   ============================================ */
.hero-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px 16px;
  gap: 24px;
}

/* Left column: copy + trust */
.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

/* Right column: dropzone */
.hero-action {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-dropzone-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  text-align: center;
  line-height: 1.1;
  letter-spacing: -0.03em;
  /* Mobile: honor the \n in home.titlePrefix so "done in seconds." stacks.
     Desktop overrides below collapse the break — single line reads better
     on wide layouts. */
  white-space: pre-line;
}

.hero-title-accent {
  font-style: italic;
  font-weight: 800;
  color: var(--tone-violet-700);
  letter-spacing: -0.025em;
}

@media (min-width: 768px) {
  .hero-dropzone-title {
    white-space: normal;
  }
}

.hero-dropzone-subtitle {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.55;
  max-width: 520px;
}

/* Trust signals row */
.hero-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 4px;
}

.hero-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.hero-trust-num {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--tone-violet-700);
  font-variant-numeric: tabular-nums;
}

.hero-trust-label {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.hero-trust-sep {
  width: 1px;
  height: 28px;
  background: var(--hairline);
  flex-shrink: 0;
}


.dropzone-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  max-width: 420px;
  padding: 44px 28px;
  background: linear-gradient(135deg, var(--tone-violet-50) 0%, var(--card) 70%);
  color: var(--text);
  border: 2px dashed color-mix(in srgb, var(--tone-violet) 32%, transparent);
  border-radius: var(--r-xl);
  cursor: pointer;
  font-family: var(--font-body);
  overflow: visible;
  transition: border-color 200ms var(--ease-standard),
              background 240ms var(--ease-standard),
              box-shadow 240ms var(--ease-standard),
              transform 200ms var(--ease-standard);
  box-shadow: var(--shadow-sm);
}

.dropzone-box::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--tone-violet) 14%, transparent) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: 0.45;
  pointer-events: none;
  mask-image: linear-gradient(135deg, black, transparent 70%);
  -webkit-mask-image: linear-gradient(135deg, black, transparent 70%);
}

.dropzone-box:hover {
  border-color: var(--tone-violet);
  border-style: solid;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
}

.dropzone-box:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

@media (hover: none) and (pointer: coarse) {
  .dropzone-box {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .dropzone-box:active {
    border-color: var(--tone-violet);
    border-style: solid;
    background: linear-gradient(135deg, var(--tone-violet-100) 0%, var(--card) 70%);
  }
}

/* Uploading: soft pulse on the dashed border + shimmer overlay — no scale changes. */
.dropzone-box.uploading {
  cursor: progress;
  pointer-events: none;
  animation: dropzone-uploading-pulse 1.6s ease-in-out infinite;
}

@keyframes dropzone-uploading-pulse {
  0%, 100% {
    border-color: color-mix(in srgb, var(--tone-violet) 32%, transparent);
    box-shadow: var(--shadow-sm);
  }
  50% {
    border-color: var(--tone-violet);
    box-shadow: var(--shadow-md), 0 0 0 6px color-mix(in srgb, var(--tone-violet) 14%, transparent);
  }
}

.dropzone-box.uploading::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    transparent 0%,
    color-mix(in srgb, var(--tone-violet) 18%, transparent) 50%,
    transparent 100%
  );
  animation: dropzone-uploading-shimmer 1.4s ease-in-out infinite;
  pointer-events: none;
  clip-path: inset(0 round var(--r-xl));
}

@keyframes dropzone-uploading-shimmer {
  0%   { left: -110%; }
  60%  { left: 110%; }
  100% { left: 110%; }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone-box.uploading {
    animation: none;
    opacity: 0.75;
  }
  .dropzone-box.uploading::after {
    animation: none;
  }
}

.dropzone-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tone-violet);
  border-radius: var(--r-pill);
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-tonal-violet);
}

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

.dropzone-text {
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  position: relative;
  z-index: 1;
}

.dropzone-hint {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  z-index: 1;
}

/* ============================================
   FREE EDIT BADGE
   Stuck to bottom of dropzone, half on/half off
   ============================================ */
.free-badge {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translate(-50%, 50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-md);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.free-badge-icon {
  font-size: 0.9rem;
}


/* ============================================
   ROTATING PROMPT HINT
   Fade-transitioning example prompts
   ============================================ */
.dropzone-prompt {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--tone-violet-700);
  opacity: 0.95;
  transition: opacity 0.4s var(--ease-standard);
  min-height: 1.4em;
  text-align: center;
  position: relative;
  z-index: 1;
  /* Reserve a tiny amount of horizontal space so the blinking cursor doesn't
     visually shift the text when characters are being typed/erased. */
  padding-right: 2px;
}

/* Blinking caret — only present when JS adds .typewriter (skip for SSR/no-JS) */
.dropzone-prompt.typewriter::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--tone-violet);
  animation: dropzone-caret-blink 1s steps(1) infinite;
}

@keyframes dropzone-caret-blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

/* Submit-pulse: brief tonal-violet ring + soft scale on the dropzone after a
   prompt finishes typing. Sells "now you'd hit submit" without being a real CTA. */
.dropzone-box.demo-tap {
  animation: dropzone-demo-tap 360ms cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes dropzone-demo-tap {
  0% {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm);
  }
  35% {
    transform: translateY(-1px) scale(1.012);
    box-shadow: var(--shadow-md), 0 0 0 8px color-mix(in srgb, var(--tone-violet) 18%, transparent);
  }
  100% {
    transform: translateY(0) scale(1);
    box-shadow: var(--shadow-sm);
  }
}

/* Confetti burst — DOM nodes spawned by initRotatingPrompts(). The wrapper
   sits dead-center over the dropzone so all pieces fly out from the same point. */
.dropzone-confetti {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 3;
}
.dropzone-confetti-piece {
  position: absolute;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--c, var(--tone-violet));
  border-radius: 1.5px;
  transform: translate(-50%, -50%);
  opacity: 0;
  animation: dropzone-confetti-fly 900ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
  animation-delay: var(--delay, 0ms);
}
@keyframes dropzone-confetti-fly {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.4) rotate(0deg);
  }
  15% { opacity: 1; }
  100% {
    opacity: 0;
    transform:
      translate(calc(-50% + var(--tx)), calc(-50% + var(--ty)))
      scale(0.6)
      rotate(var(--rot, 180deg));
  }
}

@media (prefers-reduced-motion: reduce) {
  .dropzone-prompt.typewriter::after { animation: none; opacity: 0.6; }
  .dropzone-box.demo-tap { animation: none; }
  .dropzone-confetti { display: none; }
}

.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-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--hairline);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  transition: background 0.16s var(--ease-standard), color 0.16s var(--ease-standard), border-color 0.16s var(--ease-standard), transform 0.12s var(--ease-standard);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.dropzone-chip:active {
  transform: scale(0.96);
}

.dropzone-chip:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 26%, transparent);
  color: var(--tone-violet-700);
  background: var(--tone-violet-50);
}

.dropzone-chip--more {
  color: var(--tone-violet-700);
  border-color: color-mix(in srgb, var(--tone-violet) 22%, transparent);
  background: var(--tone-violet-50);
}

.dropzone-chip--more:hover {
  background: var(--tone-violet-100);
}

/* 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(0, 0, 0, 0.08);
  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;
  }
}

/* Tablet — two column */
@media (min-width: 768px) {
  .hero-dropzone {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    padding: 40px 32px;
    gap: 24px 40px;
    max-width: 960px;
    margin: 0 auto;
  }

  .hero-copy {
    text-align: left;
    grid-column: 1;
    grid-row: 1;
  }

  .hero-action {
    grid-column: 2;
    grid-row: 1;
    justify-content: center;
  }

  .hero-dropzone-title {
    text-align: left;
    font-size: 2.2rem;
  }

  .hero-dropzone-subtitle {
    text-align: left;
    max-width: none;
  }

  .hero-trust {
    justify-content: flex-start;
  }

  /* Showcase strip spans both columns */
  .showcase-strip {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Desktop — more breathing room */
@media (min-width: 1024px) {
  .hero-dropzone {
    padding: 56px 48px;
    gap: 32px 64px;
    max-width: 1120px;
  }

  .hero-dropzone-title {
    font-size: 2.8rem;
    line-height: 1.1;
  }

  .hero-dropzone-subtitle {
    font-size: 1.1rem;
  }

  .hero-trust-num {
    font-size: 1.6rem;
  }

  .dropzone-box {
    max-width: 440px;
    padding: 52px 36px;
    gap: 16px;
  }

  .dropzone-icon {
    width: 76px;
    height: 76px;
  }

  .dropzone-icon svg {
    width: 36px;
    height: 36px;
  }

  .dropzone-text {
    font-size: 1.2rem;
  }
}

/* Large desktop */
@media (min-width: 1280px) {
  .hero-dropzone {
    padding: 64px 64px;
    gap: 32px 80px;
  }

  .hero-dropzone-title {
    font-size: 3.2rem;
  }

  .dropzone-box {
    max-width: 480px;
    padding: 60px 40px;
  }
}

/* ============================================
   SHOWCASE STRIP - Transformation Theater
   ============================================ */
.showcase-strip {
  width: 100%;
  overflow: hidden;
  padding: 12px 0;
  position: relative;
  /* CLS fix: reserve vertical space matching the rendered children
     (padding + frame height + gap + label) so lazy-loaded showcase
     images and font-swap label metrics cannot shift the layout below.
     Per-breakpoint overrides live in the mobile/desktop blocks below. */
  min-height: 180px;
  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: 24px;
  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 var(--ease-standard), opacity 0.3s var(--ease-standard);
}

/* Backlight glow */
.showcase-card::before {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: 20px;
  background: radial-gradient(
    ellipse at center,
    rgba(26, 26, 46, 0.05) 0%,
    transparent 70%
  );
  border-radius: 16px;
  filter: blur(8px);
  z-index: -1;
  opacity: 0.8;
  transition: opacity 0.3s var(--ease-standard);
}

/* 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;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0.1) 0%,
    transparent 70%
  );
}

/* Frame container */
.showcase-frame {
  position: relative;
  width: 180px;
  height: 135px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid rgba(26, 26, 46, 0.05);
  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 var(--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.01em;
  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;
    /* CLS fix: padding 32 + frame 90 + gap 10 + label ≈ 10 = 142 */
    min-height: 142px;
  }

  .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;
    /* CLS fix: padding 56 + frame 165 + gap 10 + label ≈ 11 = 242 */
    min-height: 242px;
  }

  .showcase-track {
    gap: 28px;
  }

  .showcase-frame {
    width: 220px;
    height: 165px;
    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 var(--ease-standard);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  margin-top: 8px;
}

.hero-v2-cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.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(0, 0, 0, 0.12);
}

.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 (except countdown and Pro cost notice) */
  .app.has-image .edit-cost-caption:not(.free):not(.pro-cost) {
    display: none;
  }

  /* Pro upsell more compact */
  .app.has-image .pro-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 var(--ease-standard);
}
.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(--card);
  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(--hairline);
  box-shadow: var(--shadow-lg);
}
.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: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--hairline);
  flex-shrink: 0;
}
.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text);
  margin: 0;
}
.drawer-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--tone-violet-700);
  background: var(--tone-violet-50);
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.drawer-count strong {
  color: var(--tone-violet-700);
  font-weight: 700;
}
.drawer-close {
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--r-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  transition: background 0.18s var(--ease-standard), color 0.18s var(--ease-standard);
}
.drawer-close:hover {
  background: var(--tone-rose-50);
  color: var(--tone-rose-700);
}

/* Drawer search */
.drawer-search {
  position: relative;
  padding: 14px 20px 0;
  flex-shrink: 0;
}

.drawer-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.drawer-search-input {
  width: 100%;
  padding: 11px 32px 11px 36px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card-tonal);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.18s var(--ease-standard), box-shadow 0.2s var(--ease-standard), background 0.18s var(--ease-standard);
  box-sizing: border-box;
}

.drawer-search-input:focus {
  border-color: var(--tone-violet);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--tone-violet-50);
}

.drawer-search-input::placeholder {
  color: var(--text-muted);
}

.drawer-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-search-clear:hover {
  color: var(--text);
  background: var(--bg-subtle);
}

.drawer-controls {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 12px 16px 0;
}
.drawer-controls .drawer-search {
  flex: 1;
  padding: 0;
}
.drawer-sort-btn {
  flex-shrink: 0;
  margin-top: 1px;
  padding: 9px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast), background var(--transition-fast);
}
.drawer-sort-btn:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 26%, transparent);
  color: var(--tone-violet-700);
  background: var(--tone-violet-50);
}

/* Drawer date filter chips */
.drawer-filter-chips {
  display: flex;
  gap: 6px;
  padding: 10px 20px 0;
  flex-shrink: 0;
}
.drawer-filter-chip {
  padding: 5px 12px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.drawer-filter-chip:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 26%, transparent);
  color: var(--tone-violet-700);
  background: var(--tone-violet-50);
}
.drawer-filter-chip.active {
  background: var(--tone-violet);
  border-color: var(--tone-violet);
  color: white;
  box-shadow: var(--shadow-tonal-violet);
}

.drawer-no-results {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.8125rem;
}

/* Drawer body */
.drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 18px 20px 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 var(--ease-in-out) 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(--text, #1a1a2e);
  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: 500;
  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: 12px;
}

/* Individual card */
.drawer-card {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--hairline);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  animation: drawerCardIn 0.35s var(--ease-out) forwards;
  transition: border-color 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard), transform 0.2s var(--ease-standard);
}
@keyframes drawerCardIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.drawer-card:hover {
  border-color: color-mix(in srgb, var(--tone-violet) 32%, transparent);
  box-shadow: var(--shadow-md), var(--shadow-tonal-violet);
  transform: translateY(-2px);
}
.drawer-card.removing {
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.25s var(--ease-standard), opacity 0.25s var(--ease-standard);
}
.drawer-card.kbd-focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* 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 var(--ease-standard), transform 0.3s var(--ease-standard);
}
.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 var(--ease-standard), visibility 0.18s var(--ease-standard);
}
@media (hover: hover) {
  .drawer-card:hover .drawer-card-actions {
    opacity: 1;
    visibility: visible;
  }
}
.drawer-action {
  width: 36px;
  height: 36px;
  border-radius: var(--r-pill);
  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 var(--ease-standard), transform 0.15s var(--ease-standard);
}
.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);
}

/* Favorite button on edit cards (shared by drawer + dashboard) */
.edit-card-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s var(--ease-standard), color 0.15s var(--ease-standard);
  z-index: 2;
  padding: 0;
}
.drawer-card:hover .edit-card-fav,
.dash-card:hover .edit-card-fav,
.edit-card-fav.active {
  opacity: 1;
}
.edit-card-fav.active {
  color: #fbbf24;
}
.edit-card-fav:hover {
  color: #fbbf24;
}

/* 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(--primary);
  background: rgba(26, 26, 46, 0.04);
}

/* Pulse animation on save */
.saved-edits-trigger.pulse {
  animation: triggerPulse 0.6s var(--ease-standard);
}
@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 var(--ease-standard), transform 0.2s var(--ease-standard);
  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: translate3d(0, 0, 0) scale(0.97);
  /* GPU-promote: filter+transform animation runs on its own composite layer,
     which prevents repaints from cascading into surrounding image elements. */
  will-change: filter, transform, opacity;
  backface-visibility: hidden;
  animation: revealBlurToSharp 0.6s 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 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  /* GPU-promote so the merge animation composites without retriggering paint
     of the surrounding image wrapper. backface-visibility forces a layer. */
  will-change: transform, left, right, opacity;
  backface-visibility: hidden;
}

.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 var(--ease-out) 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.01em;
  pointer-events: none;
  animation: fsRevealHintIn 0.6s 0.4s var(--ease-out) 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(26, 26, 46, 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(26, 26, 46, 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 var(--ease-out) forwards;
}

.fullscreen-reveal.closing img {
  animation: fsRevealImageOut 0.25s var(--ease-out) 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
   Segmented pill control over image.
   Clear active state shows which view is selected.
   ============================================ */

.before-after-toggle {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 3px;
  background: rgba(8, 8, 14, 0.65);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset,
    0 4px 20px rgba(0, 0, 0, 0.35),
    0 1px 3px rgba(0, 0, 0, 0.2);
  user-select: none;
  -webkit-user-select: none;
  white-space: nowrap;
  opacity: 0;
  animation: toggleFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

/* Sliding indicator pill */
.before-after-toggle::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: calc(50% - 3px);
  height: calc(100% - 6px);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  box-shadow:
    0 1px 0 0 rgba(255, 255, 255, 0.06) inset,
    0 1px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(100%);
  z-index: 0;
}

.before-after-toggle[data-showing="original"]::before {
  transform: translateX(0);
}

.ba-seg {
  all: unset;
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.ba-seg--active {
  color: rgba(255, 255, 255, 0.95);
}

.ba-seg:active {
  transform: scale(0.96);
  transition: transform 0.1s ease, color 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ba-seg:not(.ba-seg--active):hover {
  color: rgba(255, 255, 255, 0.58);
}

/* Showing original — warm tint on indicator */
.before-after-toggle[data-showing="original"]::before {
  background: rgba(255, 255, 255, 0.12);
}

@keyframes toggleFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(8px) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

/* --- Drawer Bulk Select --- */

.drawer-select-btn {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color var(--transition-fast), color var(--transition-fast);
  margin-left: auto;
  margin-right: 8px;
}
.drawer-select-btn:hover {
  border-color: var(--primary);
  color: var(--text);
}

/* Drawer card selection checkbox */
.select-mode .drawer-card { cursor: pointer; position: relative; }
.select-mode .drawer-card::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  z-index: 2;
  transition: all 0.15s var(--ease-standard);
}
.select-mode .drawer-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.12);
}
.select-mode .drawer-card.selected::before {
  background: var(--primary);
  border-color: var(--primary);
}
.select-mode .drawer-card.selected::after {
  content: '\2713';
  position: absolute;
  top: 6px;
  left: 6px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 0.7rem;
  font-weight: bold;
  z-index: 3;
}

/* Drawer floating bulk action bar */
.drawer-bulk-bar {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
  z-index: 10;
}

/* ============================================
   PAYMENT ELEMENT (Stripe Custom Checkout)
   Step 2 of the buy sheet — inline card form.
   Matches the V9 buy sheet design language:
   Instrument Serif for prices, violet glow,
   14px radius, ambient violet tint.
   ============================================ */

/* ============================================
   STEP 2: EMBEDDED CHECKOUT
   When active, the buy sheet transforms into a
   dedicated checkout screen. The Stripe iframe
   owns the space — no cramming.
   ============================================ */

/* Buy sheet expansion — give checkout room to breathe */
.buy-sheet-v9[data-pe-step="2"] {
  max-height: 96dvh;
}
.buy-sheet-v9[data-pe-step="2"] .buy-sheet-scroll {
  justify-content: flex-start;
}
.buy-sheet-v9[data-pe-step="2"] .buy-sheet-footer-v9 {
  border-top: none;
  padding: 8px 24px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

/* Step 2 container */
.pe-step-2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
}

/* Branded header: back button + wordmark */
.pe-branded-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.pe-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px 4px 4px;
  background: none;
  border: none;
  color: var(--text-dimmed, rgba(26, 26, 46, 0.38));
  font-size: 0.72rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.pe-back-btn:hover {
  color: var(--text-muted, rgba(26, 26, 46, 0.58));
}
.pe-back-btn:active {
  transform: scale(0.97);
}
.pe-back-btn svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.pe-wordmark {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #1a1a2e;
  letter-spacing: -0.02em;
  padding-right: 48px; /* offset for visual centering against back btn */
}

/* Order summary card */
.pe-order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(26, 26, 46, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  margin-bottom: 12px;
}
.pe-order-card-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text, #1a1a2e);
}
.pe-order-card-price {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1a2e;
}

/* Value reminder */
.pe-value-line {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted, rgba(26, 26, 46, 0.5));
  margin-bottom: 20px;
}

/* Stripe Embedded Checkout container */
#pe-payment-element {
  flex: 1;
  min-height: 300px;
}

/* Trust line below Stripe form */
.pe-trust-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.7rem;
  color: var(--text-dimmed, rgba(26, 26, 46, 0.32));
  letter-spacing: 0.02em;
  padding-top: 14px;
}
.pe-trust-line svg {
  stroke: var(--text-dimmed, rgba(26, 26, 46, 0.32));
  flex-shrink: 0;
}
.pe-trust-dot {
  margin: 0 1px;
}

/* Hide sheet handle + close button in checkout — back button replaces them */
.buy-sheet-v9[data-pe-step="2"] .sheet-handle { display: none; }
.buy-sheet-v9[data-pe-step="2"] .buy-sheet-close { display: none; }

/* ---- Mobile: full-screen checkout ---- */
@media (max-width: 599px) {
  .buy-sheet-v9[data-pe-step="2"] {
    max-height: 100dvh;
    border-radius: 0;
  }
  .buy-sheet-v9[data-pe-step="2"] .buy-sheet-scroll {
    padding: 12px 16px 8px;
  }
  .buy-sheet-v9[data-pe-step="2"] .buy-sheet-footer-v9 {
    padding: 6px 16px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .pe-branded-header {
    margin-bottom: 12px;
  }
  .pe-order-card {
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .pe-value-line {
    margin-bottom: 14px;
  }
  #pe-payment-element {
    font-size: 16px;
  }
}

/* ---- Desktop: focused checkout column ---- */
@media (min-width: 900px) {
  .buy-sheet-v9[data-pe-step="2"] .buy-sheet-scroll {
    max-width: 520px;
    padding-top: 40px;
  }
}

/* ============================================
   CHECKOUT RECOVERY BANNER
   Shown after a Stripe redirect was swallowed by an in-app webview / Custom
   Tab. The user bounced back to the original tab; we offer a one-tap
   second-chance "Continue checkout" handoff via target="_blank" so the
   system browser receives the link and can complete the purchase.

   Visual language: dark fill (matches app --primary), white CTA pill, soft
   shadow. Sits above rateLimitBanner z-index. On mobile it stacks vertically.
   ============================================ */
.recovery-banner {
  position: fixed;
  top: calc(60px + var(--safe-top, 0px));
  left: 16px;
  right: 16px;
  max-width: 560px;
  margin: 0 auto;
  z-index: 305;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--tone-amber-50);
  color: var(--tone-amber-700);
  border: 1px solid color-mix(in srgb, var(--tone-amber) 26%, transparent);
  border-radius: var(--r-lg);
  padding: 14px 14px 14px 18px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  font-family: var(--font-body);
  transition:
    opacity 0.25s var(--ease-standard, ease),
    transform 0.25s var(--ease-standard, ease),
    visibility 0.25s var(--ease-standard, ease);
}

.recovery-banner.visible {
  display: flex;
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.recovery-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.recovery-banner-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--tone-amber) 18%, transparent);
  color: var(--tone-amber-700);
}

.recovery-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recovery-banner-title {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--tone-amber-700);
  letter-spacing: -0.005em;
  line-height: 1.25;
}

.recovery-banner-subtitle {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  color: color-mix(in srgb, var(--tone-amber-700) 78%, transparent);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recovery-banner-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.recovery-banner-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tone-amber-700);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s var(--ease-standard, ease), box-shadow 0.15s var(--ease-standard, ease), background 0.15s var(--ease-standard, ease);
}

.recovery-banner-btn:hover,
.recovery-banner-btn:focus-visible {
  transform: translateY(-1px);
  background: #92400e;
  box-shadow: 0 6px 16px rgba(180, 83, 9, 0.24);
  outline: none;
}

.recovery-banner-btn:active {
  transform: translateY(0);
}

.recovery-banner-btn svg { flex-shrink: 0; }

.recovery-banner-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: color-mix(in srgb, var(--tone-amber-700) 60%, transparent);
  border-radius: var(--r-pill);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s var(--ease-standard, ease), color 0.15s var(--ease-standard, ease);
}

.recovery-banner-dismiss:hover,
.recovery-banner-dismiss:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  outline: none;
}

@media (max-width: 560px) {
  .recovery-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .recovery-banner-actions {
    justify-content: space-between;
  }
  .recovery-banner-btn {
    flex: 1;
    justify-content: center;
    padding: 12px 16px;
  }
  .recovery-banner-subtitle {
    white-space: normal;
  }
}

/* When the result image is shown the editor occupies the viewport — keep the
   banner visible (it's still actionable) but don't double-stack with the
   rate-limit banner if both fire. Rate-limit banner is hidden via existing rule. */
body.has-result .recovery-banner.visible {
  /* keep it; this is intentional */
}
