/**
 * Flow2 Styles
 *
 * Styles for AI presentation generation components.
 * Uses FlowVella dark theme: black background, white 2px borders, 20px radius
 */

/* Override content-wrapper from header.php */
#content-wrapper:has(.ai-creator-page),
#content-wrapper:has(.ai-loading-state) {
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  width: 100% !important;
}

/* Variables - FlowVella Dark Design System */
:root {
  --ai-primary: #426ab8;
  --ai-primary-hover: #5a82d0;
  --ai-primary-light: rgba(66, 106, 184, 0.2);
  --ai-secondary: #3b82f6;
  --ai-bg: #1a1a1a;
  --ai-bg-secondary: #222222;
  --ai-bg-tertiary: #2a2a2a;
  --ai-bg-card: #1a1a1a;
  --ai-text: #ffffff;
  --ai-text-secondary: #b0b0b0;
  --ai-text-tertiary: #808080;
  --ai-border: rgba(255, 255, 255, 0.15);
  --ai-border-subtle: rgba(255, 255, 255, 0.1);
  --ai-error: #ef4444;
  --ai-error-light: rgba(239, 68, 68, 0.2);
  --ai-success: #10b981;
  --ai-success-light: rgba(16, 185, 129, 0.2);
  --ai-radius-sm: 10px;
  --ai-radius: 15px;
  --ai-radius-lg: 20px;
  --ai-radius-xl: 20px;
  --ai-border-width: 1px;
  --ai-shadow-sm: none;
  --ai-shadow: none;
  --ai-shadow-lg: none;
  --ai-shadow-focus: 0 0 0 3px rgba(66, 106, 184, 0.3);
  --ai-font: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --ai-transition: 0.2s ease;
}

/* Modal Overlay */
.ai-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

/* Modal */
.ai-modal {
  background: var(--ai-bg);
  border-radius: var(--ai-radius);
  box-shadow: var(--ai-shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--ai-border);
}

.ai-modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--ai-text);
}

.ai-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  padding: 0;
  line-height: 1;
}

.ai-modal-content {
  padding: 24px;
}

.ai-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--ai-border);
  margin-top: 20px;
}

/* Form Elements */
.ai-form-group {
  margin-bottom: 16px;
}

.ai-form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ai-text);
}

.ai-form-row {
  display: flex;
  gap: 16px;
}

.ai-form-half {
  flex: 1;
}

.ai-form-group textarea,
.ai-form-group input,
.ai-form-group select {
  width: 100%;
  padding: 12px 16px;
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius);
  font-size: 15px;
  font-family: var(--ai-font);
  color: var(--ai-text);
  background: var(--ai-bg);
  transition: all var(--ai-transition);
  box-sizing: border-box;
}

.ai-form-group textarea::placeholder,
.ai-form-group input::placeholder {
  color: var(--ai-text-tertiary);
}

.ai-form-group textarea:focus,
.ai-form-group input:focus,
.ai-form-group select:focus {
  outline: none;
  border-color: var(--ai-primary);
  box-shadow: var(--ai-shadow-focus);
}

.ai-form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

/* Label row: "Describe your presentation  or  [Upload File]" */
.ai-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.ai-label-row label {
  margin-bottom: 0 !important;
}

.ai-upload-or-text {
  font-size: 13px;
  color: var(--ai-text-tertiary);
  flex-shrink: 0;
}

.ai-upload-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  color: var(--ai-text-secondary);
  font-size: 13px;
  padding: 8px 16px;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: var(--ai-font);
}

.ai-upload-toggle:hover {
  color: var(--ai-text);
  border-color: var(--ai-text-secondary);
  background: rgba(255, 255, 255, 0.05);
}

/* Slide-in upload zone wrapper */
.ai-upload-zone-wrapper {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: max-height 0.45s cubic-bezier(0.33, 1, 0.68, 1),
              opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              margin 0.45s cubic-bezier(0.33, 1, 0.68, 1),
              transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
  margin-bottom: 0;
  will-change: max-height, opacity, transform;
}

.ai-upload-zone-wrapper.open {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  margin-bottom: 10px;
}

/* Upload drop zone (inside wrapper) */
.ai-upload-zone {
  border: 2px dashed var(--ai-border);
  border-radius: var(--ai-radius);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.ai-upload-zone:hover,
.ai-upload-zone.dragover {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
}

.ai-upload-icon {
  opacity: 0.5;
  flex-shrink: 0;
}

.ai-upload-text {
  font-size: 13px;
  color: var(--ai-text-secondary);
}

.ai-upload-text strong {
  color: var(--ai-text);
}

.ai-upload-hint {
  font-size: 11px;
  color: var(--ai-text-tertiary);
  flex-shrink: 0;
}

/* Selected file chip */
.ai-upload-file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--ai-bg-tertiary);
  border: 1px solid var(--ai-border);
  border-radius: 8px;
  margin-bottom: 10px;
}

.ai-upload-file-info .file-details {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ai-text);
  min-width: 0;
}

.ai-upload-file-info .file-details span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-upload-file-info .file-size {
  color: var(--ai-text-tertiary);
  font-size: 11px;
  flex-shrink: 0;
}

.ai-upload-file-info .file-remove {
  background: none;
  border: none;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}

.ai-upload-file-info .file-remove:hover {
  color: #ff6b6b;
}

/* ===== Equal-weight Describe / Upload tiles =====
   Two stacked tiles with a centered "or" divider between them. Tap a tile to
   expand it inline; the other tile dims to half-opacity but stays tappable
   so users can switch modes without losing prior input. */
.ai-input-tiles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.ai-input-tile {
  position: relative;
  background: var(--ai-bg-secondary, #222);
  border: 1px solid var(--ai-border, rgba(255,255,255,0.15));
  border-radius: var(--ai-radius-lg, 12px);
  overflow: hidden;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.ai-input-tile.expanded {
  background: rgba(66, 106, 184, 0.06);
  border-color: rgba(66, 106, 184, 0.6);
}

.ai-input-tile.dimmed {
  opacity: 0.5;
}

.ai-input-tile.dimmed:hover {
  opacity: 0.85;
}

.ai-input-tile.dragover {
  border-color: #426ab8;
  background: rgba(66, 106, 184, 0.1);
}

.ai-input-tile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  background: none;
  border: none;
  padding: 16px 18px;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  color: var(--ai-text, #fff);
  transition: background 0.15s ease;
}

.ai-input-tile-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ai-input-tile-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: rgba(66, 106, 184, 0.14);
  color: #426ab8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-input-tile-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ai-input-tile-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text, #fff);
  letter-spacing: 0.005em;
}

.ai-input-tile-hint {
  font-size: 12px;
  color: var(--ai-text-tertiary, #808080);
}

.ai-input-tile-content {
  padding: 8px 16px 18px;
  animation: aiTileExpand 0.22s ease;
}

@keyframes aiTileExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ai-input-tile-content textarea {
  display: block;
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--ai-border-subtle, rgba(255,255,255,0.1));
  border-radius: var(--ai-radius-md, 8px);
  padding: 14px;
  color: var(--ai-text, #fff);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.45;
  resize: vertical;
  min-height: 104px;
  margin: 0;
  box-sizing: border-box;
}

.ai-input-tile-content textarea:focus {
  outline: none;
  border-color: rgba(66, 106, 184, 0.6);
  box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.12);
}

.ai-input-tiles-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: -2px 0;
  pointer-events: none;
}

.ai-input-tiles-divider span {
  font-size: 11px;
  font-weight: 600;
  color: var(--ai-text-tertiary, #808080);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0 12px;
  background: var(--ai-bg-card, #1a1a1a);
}

.ai-input-tiles-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 1px;
  background: var(--ai-border-subtle, rgba(255,255,255,0.08));
  z-index: -1;
}

.ai-upload-rechoose {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px dashed var(--ai-border-subtle, rgba(255,255,255,0.18));
  border-radius: var(--ai-radius-md, 8px);
  padding: 18px;
  color: var(--ai-text-secondary, #b0b0b0);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.ai-upload-rechoose:hover {
  border-color: rgba(216, 160, 111, 0.5);
  color: #d8a06f;
}

/* ===== Number-of-screens slider + Custom (Pro-gated) ===== */
/* Tighten the screens form-group so when Custom is collapsed the gap to the next
   field doesn't feel hollow. */
.ai-advanced-options > .ai-form-group {
  margin-bottom: 4px;
}
.ai-advanced-options {
  margin-bottom: 16px;
}

.ai-screens-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ai-screens-value {
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  margin: 4px 0 6px;
}

.ai-screens-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  outline: none;
  margin: 6px 0;
  cursor: pointer;
}

.ai-screens-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: #426ab8;
  border: 2px solid #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease;
}

.ai-screens-slider::-webkit-slider-thumb:active {
  transform: scale(1.1);
}

.ai-screens-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: #426ab8;
  border: 2px solid #1a1a1a;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.ai-screens-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ai-text-tertiary, #808080);
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.ai-screens-custom-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--ai-text-secondary, #b0b0b0);
  font-size: 11.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  transition: color 0.15s ease;
}

.ai-screens-custom-toggle:hover {
  color: #426ab8;
}

.ai-screens-custom-toggle.expanded {
  color: #426ab8;
}

.ai-screens-custom-hint {
  color: var(--ai-text-tertiary, #808080);
  font-weight: 400;
}

.ai-screens-custom-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(66, 106, 184, 0.06);
  border: 1px solid rgba(66, 106, 184, 0.3);
  border-radius: var(--ai-radius-md, 8px);
}

.ai-screens-custom-input {
  width: 96px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--ai-border-subtle, rgba(255,255,255,0.1));
  border-radius: var(--ai-radius-sm, 6px);
  /* Generous right padding so the native spinner arrows don't crowd the digits. */
  padding: 6px 14px 6px 10px;
  color: var(--ai-text, #fff);
  font-family: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.ai-screens-custom-input:focus {
  outline: none;
  border-color: rgba(66, 106, 184, 0.6);
  box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.12);
}

.ai-screens-custom-hint-inline {
  font-size: 12px;
  color: var(--ai-text-tertiary, #808080);
}

.ai-screens-custom-locked {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--ai-border-subtle, rgba(255,255,255,0.1));
  border-radius: var(--ai-radius-md, 8px);
  font-size: 12.5px;
  color: var(--ai-text-secondary, #b0b0b0);
}

.ai-screens-custom-locked svg {
  flex-shrink: 0;
  color: var(--ai-text-tertiary, #808080);
}

.ai-screens-custom-locked span {
  flex: 1;
}

.ai-screens-upgrade-link {
  flex-shrink: 0;
  background: rgba(66, 106, 184, 0.18);
  color: #426ab8;
  border: 1px solid rgba(66, 106, 184, 0.4);
  border-radius: 9999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background 0.15s ease;
}

.ai-screens-upgrade-link:hover {
  background: rgba(66, 106, 184, 0.28);
  text-decoration: none;
}

/* Buttons */
.ai-btn {
  padding: 12px 24px;
  border-radius: var(--ai-radius-lg);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--ai-font);
  cursor: pointer;
  transition: all var(--ai-transition);
  border: var(--ai-border-width) solid var(--ai-border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

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

.ai-btn-primary {
  background: #426ab8;
  color: #fff;
}

.ai-btn-primary:hover:not(:disabled) {
  background: #355492;
}

.ai-btn-secondary {
  background: transparent;
  color: var(--ai-text);
  border: var(--ai-border-width) solid var(--ai-border-subtle);
}

.ai-btn-secondary:hover:not(:disabled) {
  border-color: var(--ai-border);
}

/* Advanced Options */
.ai-toggle-advanced {
  background: none;
  border: none;
  color: var(--ai-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin-bottom: 16px;
}

.ai-advanced-options {
  background: var(--ai-bg-secondary);
  padding: 16px;
  border-radius: var(--ai-radius);
  margin-bottom: 16px;
}

/* Theme Grid */
.ai-theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.ai-theme-option,
.ai-theme-card {
  padding: 12px;
  border-radius: var(--ai-radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-align: center;
  font-size: 12px;
  transition: all 0.2s;
  position: relative;
}

.ai-theme-option:hover,
.ai-theme-card:hover {
  transform: translateY(-2px);
}

.ai-theme-option.selected,
.ai-theme-card.selected {
  border-color: currentColor;
}

.ai-theme-accent {
  display: block;
  width: 20px;
  height: 4px;
  border-radius: 2px;
  margin: 0 auto 8px;
}

/* Error Message — legacy inline form, kept for other AI surfaces that
 * still use it. The /create page now uses .ai-error-modal-* (below). */
.ai-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: #FEE2E2;
  color: var(--ai-error);
  border-radius: var(--ai-radius);
  font-size: 14px;
  margin-top: 16px;
}

.ai-error-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--ai-error);
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 12px;
}

/* Error modal — centered card with backdrop, replaces the inline error
 * banner that used to sit at the bottom of the /create form (easy to miss).
 * Fade-in backdrop + scale-in card, dismissed via backdrop click, X button,
 * or the OK / Maybe later actions. */
.ai-error-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: ai-error-fade-in 0.18s ease-out;
}
.ai-error-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 22px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  position: relative;
  text-align: center;
  animation: ai-error-scale-in 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}
.ai-error-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: 0;
  font-size: 24px;
  line-height: 1;
  color: #94A3B8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.ai-error-modal-close:hover { color: #0F172A; background: #F1F5F9; }
.ai-error-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--ai-error, #ef4444);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  margin: 0 auto 16px;
}
.ai-error-modal.is-gentle .ai-error-modal-icon {
  background: #F59E0B;
}
.ai-error-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #0F172A;
  margin: 0 0 8px;
  line-height: 1.2;
}
.ai-error-modal-body {
  font-size: 14px;
  color: #475569;
  line-height: 1.5;
  margin: 0 0 22px;
}
.ai-error-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.ai-error-modal-actions .ai-btn-primary { width: 100%; }
.ai-error-modal-secondary {
  background: transparent;
  color: #64748B;
  border: 0;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s ease;
}
.ai-error-modal-secondary:hover { color: #0F172A; }

@keyframes ai-error-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ai-error-scale-in {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

.ai-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--ai-border);
}

.ai-chat-header h3 {
  margin: 0;
  font-size: 16px;
  color: var(--ai-text);
}

.ai-chat-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--ai-text-secondary);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.ai-chat-empty {
  text-align: center;
  color: var(--ai-text-secondary);
  padding: 32px 16px;
}

.ai-chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.ai-chat-suggestions button {
  padding: 10px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--ai-text);
  text-align: left;
  transition: all 0.2s;
}

.ai-chat-suggestions button:hover {
  background: var(--ai-border);
}

.ai-chat-message {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.ai-chat-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.ai-chat-user .ai-chat-avatar {
  background: var(--ai-bg-secondary);
  color: var(--ai-text);
}

.ai-chat-assistant .ai-chat-avatar {
  background: var(--ai-primary);
  color: white;
}

.ai-chat-content {
  flex: 1;
  padding: 10px 14px;
  background: var(--ai-bg-secondary);
  border-radius: var(--ai-radius);
  font-size: 14px;
  line-height: 1.5;
}

.ai-chat-assistant .ai-chat-content {
  background: #EEF2FF;
}

/* Typing Indicator */
.ai-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}

.ai-typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: ai-typing 1.4s infinite;
}

.ai-typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes ai-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* Chat Input */
.ai-chat-input-form {
  padding: 16px;
  border-top: 1px solid var(--ai-border);
}

.ai-chat-focus-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ai-text-secondary);
  margin-bottom: 12px;
  cursor: pointer;
}

.ai-chat-input-row {
  display: flex;
  gap: 8px;
}

.ai-chat-input-row textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  font-size: 14px;
  resize: none;
}

.ai-chat-input-row textarea:focus {
  outline: none;
  border-color: var(--ai-primary);
}

.ai-chat-send {
  padding: 10px;
  background: var(--ai-primary);
  color: white;
  border: none;
  border-radius: var(--ai-radius);
  cursor: pointer;
  transition: background 0.2s;
}

.ai-chat-send:hover:not(:disabled) {
  background: var(--ai-primary-hover);
}

.ai-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-chat-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #FEE2E2;
  color: var(--ai-error);
  font-size: 13px;
}

.ai-chat-error button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 16px;
}

/* Preview Pane */
.ai-preview-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.ai-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--ai-text-secondary);
}

.ai-preview-placeholder {
  text-align: center;
}

.ai-preview-placeholder svg {
  opacity: 0.3;
  margin-bottom: 16px;
}

.ai-preview-thumbnails {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--ai-border);
  overflow-x: auto;
}

.ai-thumbnail {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all 0.2s;
}

.ai-thumbnail.selected {
  border-color: var(--ai-primary);
}

.ai-thumbnail-number {
  font-weight: 600;
  font-size: 14px;
}

.ai-thumbnail-type {
  opacity: 0.7;
  text-transform: capitalize;
}

.ai-preview-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
}

.ai-preview-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.ai-preview-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding-top: 16px;
}

.ai-preview-nav button {
  padding: 8px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border);
  border-radius: var(--ai-radius);
  cursor: pointer;
}

.ai-preview-nav button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Block Previews */
.ai-block-title {
  margin: 0 0 16px;
  line-height: 1.2;
}

.ai-block-subtitle {
  margin: 0 0 24px;
  font-weight: 400;
  font-size: 1.25rem;
}

.ai-block-body {
  margin: 0 0 16px;
  line-height: 1.6;
}

.ai-block-list {
  margin: 0 0 16px;
  padding-left: 24px;
}

.ai-block-list li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.ai-block-quote {
  margin: 0 0 16px;
  padding: 16px 24px;
  font-style: italic;
  text-align: center;
}

.ai-block-quote p {
  margin: 0 0 8px;
  font-size: 1.25rem;
}

.ai-block-quote cite {
  font-size: 0.875rem;
  font-style: normal;
}

.ai-block-callout {
  padding: 16px;
  border-left: 4px solid;
  background: rgba(0, 0, 0, 0.03);
  margin-bottom: 16px;
  border-radius: 0 var(--ai-radius) var(--ai-radius) 0;
}

.ai-block-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: var(--ai-bg-secondary);
  border-radius: var(--ai-radius);
  color: var(--ai-text-secondary);
  margin-bottom: 16px;
}

.ai-block-image-placeholder svg {
  opacity: 0.5;
  margin-bottom: 8px;
}

/* Entry Button */
.ai-entry-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ai-primary);
  color: white;
  border: none;
  border-radius: var(--ai-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-entry-btn-small {
  padding: 6px 12px;
  font-size: 13px;
}

.ai-entry-btn-medium {
  padding: 10px 20px;
  font-size: 14px;
}

.ai-entry-btn-large {
  padding: 14px 28px;
  font-size: 16px;
}

.ai-entry-btn-secondary {
  background: var(--ai-bg);
  color: var(--ai-primary);
  border: 1px solid var(--ai-primary);
}

.ai-entry-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--ai-shadow);
}

.ai-entry-icon {
  display: flex;
}

/* Card Button */
.ai-card-button {
  position: relative;
  padding: 24px;
  background: #000000;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(255, 255, 255, 0.15);
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ai-card-button:hover {
  background: #1a1a1a;
}

.ai-card-icon {
  margin-bottom: 12px;
}

.ai-card-content h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: #ffffff;
}

.ai-card-content p {
  margin: 0;
  font-size: 13px;
  color: #aaaaaa;
}

.ai-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 8px;
  background: transparent;
  color: #ffffff;
  font-size: 10px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Theme Picker */
.ai-theme-picker h4 {
  margin: 0 0 12px;
  font-size: 14px;
  color: var(--ai-text);
}

.ai-theme-preview {
  margin-bottom: 8px;
}

.ai-theme-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai-theme-colors {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.ai-theme-colors span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.ai-theme-name {
  font-weight: 500;
  font-size: 12px;
}

.ai-theme-category {
  font-size: 10px;
  text-transform: capitalize;
  margin-top: 2px;
}

/* ============================================
   AI Creator Page Styles
   ============================================ */

.ai-creator-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--ai-bg);
  font-family: var(--ai-font);
  color: var(--ai-text);
}

.ai-creator-header {
  padding: 0 40px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ai-bg);
  border-bottom: var(--ai-border-width) solid var(--ai-border);
}

.ai-creator-logo {
  color: white;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
}

.ai-creator-logo img {
  height: 28px;
  border-radius: 6px;
  margin-right: 8px;
}

.ai-creator-logo .brand-ai {
  background: #fff;
  color: #18181b;
  padding: 2px 5px;
  border-radius: 4px;
  margin-left: 2px;
  font-size: 0.85em;
}

.ai-creator-nav {
  display: flex;
  gap: 24px;
}

.ai-creator-nav a {
  color: rgba(255, 255, 255, 0.85);
  opacity: 0.8;
  text-decoration: none;
  transition: opacity 0.2s;
}

.ai-creator-nav a:hover {
  opacity: 1;
}

/* Inline form note */
.ai-form-note-inline {
  font-size: 12px;
  color: #71717a;
  margin: 0 0 8px;
  text-align: center;
}

/* Subtle credits hint near generate button */
.ai-credits-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ai-text-secondary);
  margin-bottom: 12px;
  opacity: 0.7;
}

/* Gentle insufficient credits message */
.ai-error.ai-error-gentle {
  background: transparent;
  border: none;
  color: var(--ai-text-secondary);
  font-size: 13px;
  padding: 8px 0;
  text-align: center;
}

.ai-upgrade-link {
  display: inline-block;
  margin-left: 8px;
  color: var(--ai-accent);
  text-decoration: none;
  font-weight: 500;
}

.ai-upgrade-link:hover {
  text-decoration: underline;
}

/* Disabled button state */
.ai-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ai-creator-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  min-height: 0;
}

/* When preview layout is shown, fill available space without overflowing */
.ai-creator-main:has(.ai-preview-layout) {
  align-items: stretch;
  justify-content: stretch;
  padding: 16px;
}

/* Prompt Container */
.ai-prompt-container {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  animation: fadeIn 0.2s ease-out;
}

.ai-prompt-card {
  width: 100%;
  padding: 48px;
  background: var(--ai-bg-card);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
}

.ai-prompt-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--ai-text);
  margin: 0 0 8px;
}

.ai-prompt-subtitle {
  font-size: 18px;
  color: var(--ai-text-secondary);
  margin: 0 0 8px;
}

.ai-prompt-subtitle-secondary {
  font-size: 14px;
  color: var(--ai-text-tertiary);
  margin: 0 0 32px;
}

.ai-powered-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--ai-bg-secondary);
  color: var(--ai-text-tertiary);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 24px;
  border: 1px solid var(--ai-border);
}

.ai-powered-badge svg {
  opacity: 0.6;
}

.ai-prompt-form {
  display: flex;
  flex-direction: column;
}

.ai-btn-full {
  width: 100%;
  margin-top: 24px;
  padding: 14px 28px;
  font-size: 16px;
}

/* Generating State */
.ai-generating-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-generating-card {
  position: relative;
  background: var(--ai-bg-card);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  padding: 60px 80px;
  text-align: center;
}

.ai-generating-spinner {
  color: var(--ai-text);
  margin-bottom: 24px;
}

.ai-generating-spinner svg {
  animation: spin 1.5s linear infinite;
}

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

.ai-generating-card h2 {
  margin: 0 0 8px;
  color: var(--ai-text);
}

.ai-generating-card p {
  margin: 0 0 32px;
  color: var(--ai-text-secondary);
}

.ai-generating-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-stage {
  padding: 8px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius-sm);
  font-size: 13px;
  color: var(--ai-text-secondary);
}

/* Exporting overlay */
.ai-exporting-overlay {
  position: fixed;
  inset: 0;
  background: var(--ai-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.ai-exporting-card {
  background: var(--ai-bg-card);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  padding: 60px 80px;
  text-align: center;
  max-width: 500px;
}

.ai-exporting-spinner {
  color: var(--ai-text);
  margin-bottom: 24px;
}

.ai-exporting-spinner svg {
  animation: spin 1.5s linear infinite;
}

.ai-exporting-card h2 {
  margin: 0 0 8px;
  color: var(--ai-text);
  font-size: 24px;
}

.ai-exporting-card p {
  margin: 0 0 32px;
  color: var(--ai-text-secondary);
}

.ai-exporting-stages {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-exporting-stages .ai-stage {
  padding: 10px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius-sm);
  font-size: 13px;
  color: var(--ai-text-secondary);
}

.ai-exporting-stages .ai-stage.active {
  border-color: var(--ai-border);
  color: var(--ai-text);
}

.ai-stage.active {
  border-color: var(--ai-primary);
  color: var(--ai-text);
  background: var(--ai-bg-secondary);
}

.ai-stage.current {
  background: var(--ai-primary);
  color: white;
  border-color: var(--ai-primary);
  animation: ai-stage-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-stage-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* Preview Layout - 3 column: sidebar | preview | chat */
.ai-preview-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  background: var(--ai-bg);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
}

.ai-preview-sidebar {
  background: var(--ai-bg);
  border-right: var(--ai-border-width) solid var(--ai-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
}

.ai-sidebar-section {
  padding: 16px;
  border-bottom: 1px solid var(--ai-border-subtle);
}

.ai-sidebar-section h4 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Current theme indicator */
.ai-current-theme-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin-bottom: 8px;
  background: rgba(0,0,0,0.03);
  border-radius: 6px;
}
.ai-current-theme-swatch {
  width: 14px; height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}
.ai-current-theme-name {
  font-size: 13px;
  font-weight: 500;
}

/* Theme Chips */
.ai-theme-grid-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ai-theme-preview-card {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  background: none;
  padding: 0;
}

.ai-theme-preview-card:hover {
  transform: scale(1.05);
}

.ai-theme-preview-card.selected .ai-theme-preview-slide {
  outline: 2px solid var(--ai-primary, #6366F1);
  outline-offset: 1px;
}

.ai-theme-preview-slide {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.ai-theme-preview-accent {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.ai-theme-preview-content {
  position: absolute;
  top: 12px;
  left: 8px;
  right: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ai-theme-preview-title-line {
  height: 4px;
  width: 60%;
  border-radius: 2px;
  opacity: 0.9;
}

.ai-theme-preview-body-line {
  height: 2px;
  width: 80%;
  border-radius: 1px;
  opacity: 0.5;
}

.ai-theme-preview-body-line.short {
  width: 50%;
}

.ai-theme-preview-name {
  font-size: 10px;
  color: #aaa;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

.ai-theme-preview-card.selected .ai-theme-preview-name {
  color: #fff;
  font-weight: 600;
}

.ai-btn-text {
  background: none;
  border: none;
  color: var(--ai-primary);
  font-size: 12px;
  cursor: pointer;
  padding: 8px 0;
}

.ai-btn-text:hover {
  text-decoration: underline;
}

/* Thumbnails */
.ai-sidebar-thumbnails {
  flex: 1;
  overflow-y: auto;
}

.ai-thumbnail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}


/* Preview Content Area */
.ai-preview-content {
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow: hidden;
  min-height: 0;
}

.ai-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ai-preview-header h2 {
  margin: 0;
  font-size: 20px;
  color: var(--ai-text);
}

.ai-preview-actions {
  display: flex;
  gap: 12px;
}


.ai-export-error {
  margin-bottom: 16px;
}

.ai-preview-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-bg-tertiary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius);
  overflow: hidden;
  min-height: 400px;
}

.ai-preview-counter {
  font-size: 14px;
  color: var(--ai-text-secondary);
}

/* ============================================
   Theme Player Styles
   ============================================ */

.theme-player {
  width: 100%;
  max-width: 900px;
  background: var(--theme-bg, #ffffff);
  color: var(--theme-text, #111827);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.theme-player-slide {
  position: relative;
  padding: 60px 80px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Hero background image for title/opening screens */
.theme-hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.theme-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* When slide has hero image, make text white and ensure z-index */
.theme-player-slide.has-hero-image .theme-block {
  position: relative;
  z-index: 2;
  color: #fff !important;
}

.theme-player-slide.has-hero-image .theme-block-title,
.theme-player-slide.has-hero-image .theme-block-subtitle,
.theme-player-slide.has-hero-image .theme-block-body {
  color: #fff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Content container for centered, constrained layout */
.theme-slide-content {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Theme Block Base */
.theme-block {
  position: relative;
  z-index: 1;
  margin-bottom: 28px;
  width: 100%;
}

.theme-block:last-child {
  margin-bottom: 0;
}

/* ============================================
   TITLE BLOCKS - Bold, impactful headers
   ============================================ */
.theme-block-title {
  font-family: var(--theme-title-font, 'HelveticaNeue-Bold', sans-serif);
  color: var(--theme-text, #111827);
  line-height: 1.15;
  margin: 0;
  max-width: 640px;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.theme-block-title-1 {
  font-size: 56px;
  font-weight: 700;
  margin-bottom: 20px;
}

.theme-block-title-2 {
  font-size: 40px;
  font-weight: 600;
}

.theme-block-title-3 {
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* ============================================
   SUBTITLE - Elegant secondary text
   ============================================ */
.theme-block-subtitle {
  font-family: var(--theme-title-font, 'HelveticaNeue', sans-serif);
  color: var(--theme-text-secondary, #6b7280);
  font-size: 22px;
  font-weight: 400;
  line-height: 1.5;
  margin: 0;
  max-width: 540px;
  letter-spacing: 0.01em;
}

/* ============================================
   BODY TEXT - Readable, comfortable
   ============================================ */
.theme-block-body {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  color: var(--theme-text, #111827);
  font-size: 19px;
  line-height: 1.7;
  margin: 0;
  max-width: 520px;
  letter-spacing: 0.01em;
}

.theme-block-strong {
  font-weight: 600;
}

.theme-block-subtle {
  opacity: 0.65;
}

/* ============================================
   LISTS - Clean, scannable bullet points
   ============================================ */
.theme-block-list {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  color: var(--theme-text, #111827);
  font-size: 19px;
  line-height: 1.6;
  margin: 0;
  padding-left: 0;
  max-width: 520px;
  list-style: none;
}

.theme-block-list li {
  margin-bottom: 16px;
  padding-left: 28px;
  position: relative;
}

.theme-block-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  background: var(--theme-accent, var(--theme-primary, #426ab8));
  border-radius: 50%;
}

.theme-block-list li:last-child {
  margin-bottom: 0;
}

/* Numbered lists */
ol.theme-block-list {
  counter-reset: list-counter;
}

ol.theme-block-list li::before {
  content: counter(list-counter);
  counter-increment: list-counter;
  width: 24px;
  height: 24px;
  background: var(--theme-accent, var(--theme-primary, #426ab8));
  border-radius: 50%;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 4px;
}

ol.theme-block-list li {
  padding-left: 36px;
}

/* ============================================
   QUOTE - Elegant, memorable quotes
   ============================================ */
.theme-block-quote {
  text-align: center;
  margin: 0;
  padding: 32px 0;
  max-width: 580px;
  position: relative;
}

.theme-block-quote::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Georgia', serif;
  font-size: 80px;
  color: var(--theme-accent, var(--theme-primary, #426ab8));
  opacity: 0.2;
  line-height: 1;
}

.theme-block-quote p {
  font-family: 'Georgia', serif;
  font-size: 26px;
  color: var(--theme-text, #111827);
  margin: 0 0 20px;
  line-height: 1.5;
  font-style: italic;
  position: relative;
  z-index: 1;
}

.theme-block-quote cite {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-style: normal;
  font-size: 15px;
  font-weight: 600;
  color: var(--theme-text, #111827);
  display: block;
  letter-spacing: 0.02em;
}

.theme-block-quote .quote-source {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-style: normal;
  font-size: 14px;
  color: var(--theme-text-secondary, #6b7280);
  display: block;
  margin-top: 4px;
}

/* ============================================
   CALLOUT - Attention-grabbing info boxes
   ============================================ */
.theme-block-callout {
  padding: 20px 24px;
  border-radius: 12px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  max-width: 520px;
}

.theme-block-callout .callout-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.theme-block-callout p {
  margin: 0;
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 17px;
  line-height: 1.6;
}

.theme-callout-info {
  background: rgba(66, 106, 184, 0.08);
  border-left: 4px solid var(--theme-primary, #426ab8);
}

.theme-callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid #10b981;
}

.theme-callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border-left: 4px solid #f59e0b;
}

.theme-callout-success {
  background: rgba(16, 185, 129, 0.08);
  border-left: 4px solid #10b981;
}

/* ============================================
   PLACEHOLDERS - Clean loading states
   ============================================ */
.theme-block-image-placeholder,
.theme-block-video-placeholder,
.theme-block-chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background: linear-gradient(135deg, rgba(0,0,0,0.03) 0%, rgba(0,0,0,0.06) 100%);
  border-radius: 16px;
  color: var(--theme-text-secondary, #6b7280);
  border: 1px dashed rgba(0,0,0,0.1);
  max-width: 520px;
}

.theme-block-image-placeholder svg,
.theme-block-video-placeholder svg,
.theme-block-chart-placeholder svg {
  opacity: 0.3;
  margin-bottom: 16px;
}

.theme-block-image-placeholder span,
.theme-block-video-placeholder span,
.theme-block-chart-placeholder span {
  font-size: 14px;
  text-align: center;
  opacity: 0.7;
}

.theme-block-image-placeholder.aspect-16-9 {
  aspect-ratio: 16/9;
}

.theme-block-image-placeholder.aspect-4-3 {
  aspect-ratio: 4/3;
}

.theme-block-image-placeholder.aspect-1-1 {
  aspect-ratio: 1;
}

/* Code Block */
.theme-block-code {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 16px 20px;
  border-radius: 8px;
  font-family: 'Fira Code', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
  position: relative;
  margin: 0;
}

.theme-block-code .code-filename {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 11px;
  color: #888;
}

/* Caption */
.theme-block-caption {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 14px;
  color: var(--theme-text-secondary, #6b7280);
  text-align: center;
  margin: 0;
}

/* Table */
.theme-block-table {
  width: 100%;
  overflow-x: auto;
}

.theme-block-table .table-title {
  font-family: var(--theme-title-font, 'HelveticaNeue-Bold', sans-serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--theme-text, #111827);
}

.theme-block-table table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 14px;
}

.theme-block-table th,
.theme-block-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-block-table th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  color: var(--theme-text, #111827);
}

.theme-block-table td {
  color: var(--theme-text, #111827);
}

/* ============================================
   STAT BLOCK - Big, bold, impressive numbers
   ============================================ */
.theme-block-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  min-height: 200px;
}

.theme-block-stat .stat-value {
  font-family: var(--theme-title-font, 'HelveticaNeue-Bold', sans-serif);
  font-size: clamp(80px, 12vw, 140px);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 20px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 12px;
  letter-spacing: -0.03em;
  color: var(--theme-accent, var(--theme-primary, #426ab8));
}

.flow-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: currentColor;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  opacity: 0.9;
  transition: opacity 0.15s;
  cursor: pointer;
}
.flow-link:hover {
  opacity: 1;
  text-decoration-thickness: 2px;
}

.theme-block-stat .stat-trend {
  font-size: 0.35em;
  opacity: 0.9;
}

.theme-block-stat .stat-trend-up {
  color: #10b981;
}

.theme-block-stat .stat-trend-down {
  color: #ef4444;
}

.theme-block-stat .stat-value.stat-value-long {
  font-size: clamp(28px, 8vw, 100px);
}

.theme-block-stat .stat-label {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: clamp(18px, 2vw, 24px);
  font-weight: 500;
  color: var(--theme-text, #111827);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.theme-block-stat .stat-context {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: clamp(14px, 1.5vw, 17px);
  color: var(--theme-text-secondary, #6b7280);
}

/* Chart Block */
.theme-block-chart {
  width: 100%;
  padding: 16px;
}

.theme-block-chart .chart-title {
  font-family: var(--theme-title-font, 'HelveticaNeue-Bold', sans-serif);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
  color: var(--theme-text, #111827);
}

/* Bar Chart */
.theme-chart-bar .chart-bars {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.theme-chart-bar .chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-chart-bar .chart-bar-label {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 13px;
  color: var(--theme-text, #111827);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-chart-bar .chart-bar-track {
  flex: 1;
  height: 24px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.theme-chart-bar .chart-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.theme-chart-bar .chart-bar-value {
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-text, #111827);
  width: 50px;
  flex-shrink: 0;
}

/* Pie / Donut Chart */
.theme-chart-pie .chart-pie-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.theme-chart-pie svg {
  flex-shrink: 0;
}

.theme-chart-pie .chart-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.theme-chart-pie .chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--theme-body-font, 'HelveticaNeue', sans-serif);
  font-size: 13px;
}

.theme-chart-pie .chart-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.theme-chart-pie .chart-legend-label {
  color: var(--theme-text, #111827);
}

.theme-chart-pie .chart-legend-value {
  color: var(--theme-text-secondary, #6b7280);
  margin-left: auto;
}

.theme-block-chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--theme-text-secondary, #6b7280);
  font-style: italic;
}

/* TOC (Table of Contents) Block */
.theme-block-toc {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* TOC Grid Layout (6+ screens) */
.theme-block-toc.toc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px 32px;
  max-width: 800px;
}

/* TOC List Layout (<6 screens) */
.theme-block-toc.toc-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 0;
}

.toc-entry {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--theme-text) 4%, transparent);
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-align: left;
  font-family: var(--theme-body-font);
  color: var(--theme-text);
}

.toc-entry:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  background: color-mix(in srgb, var(--theme-primary) 12%, transparent);
}

.toc-entry:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.toc-entry-icon {
  font-size: 28px;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--theme-primary) 15%, transparent);
  border-radius: 10px;
  line-height: 1;
}

.toc-entry-thumb {
  width: 48px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}

.toc-entry-title {
  font-size: 17px;
  font-weight: 500;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* List layout - cleaner vertical list */
.toc-list .toc-entry {
  border-radius: 12px;
  margin-bottom: 2px;
}

.toc-list .toc-entry:last-child {
  margin-bottom: 0;
}

/* TOC Mobile Responsive */
@media (max-width: 479px) {
  .theme-block-toc {
    max-width: 100%;
  }

  .theme-block-toc.toc-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 16px;
  }

  .toc-entry {
    padding: 14px 16px;
    gap: 12px;
  }

  .toc-entry-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
  }

  .toc-entry-title {
    font-size: 14px;
  }
}

/* ============================================
   TITLE/OPENING SCREEN - Bold first impression
   ============================================ */
.theme-player-slide.screen-type-title,
.theme-player-slide.screen-type-opening {
  padding: 80px 60px;
  text-align: center;
}

.screen-type-title .theme-block-title,
.screen-type-opening .theme-block-title {
  font-size: clamp(48px, 6vw, 72px);
  text-align: center;
  margin-bottom: 24px;
  max-width: 800px;
}

.screen-type-title .theme-block-subtitle,
.screen-type-opening .theme-block-subtitle {
  font-size: clamp(20px, 2.5vw, 28px);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

/* ============================================
   TOC SCREEN - Clean navigation (Desktop)
   ============================================ */
@media (min-width: 769px) {
  .theme-player-slide.screen-type-toc {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 40px 60px;
    gap: 0;
  }

  .screen-type-toc .theme-block-title {
    text-align: center;
    margin-bottom: 16px;
    max-width: 600px;
    margin-top: 15%;
  }

  .screen-type-toc .theme-block-subtitle {
    text-align: center;
    margin-bottom: 0;
    max-width: 540px;
  }

  /* TOC entries container - centered in remaining space */
  .screen-type-toc .theme-block-toc {
    margin-top: auto;
    margin-bottom: auto;
  }

  /* Smarter TOC grid based on item count */
  .screen-type-toc .theme-block-toc.toc-grid {
    display: grid;
    gap: 16px;
    padding: 24px 0;
    max-width: 900px;
  }

  /* 3 or fewer items: single row */
  .screen-type-toc .theme-block-toc.toc-count-2,
  .screen-type-toc .theme-block-toc.toc-count-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 240px));
    justify-content: center;
  }

  /* 4 items: 2x2 grid */
  .screen-type-toc .theme-block-toc.toc-count-4 {
    grid-template-columns: repeat(2, minmax(200px, 280px));
    justify-content: center;
  }

  /* 5-6 items: 3 columns */
  .screen-type-toc .theme-block-toc.toc-count-5,
  .screen-type-toc .theme-block-toc.toc-count-6 {
    grid-template-columns: repeat(3, minmax(180px, 240px));
    justify-content: center;
  }

  /* 7+ items: auto-fill grid */
  .screen-type-toc .theme-block-toc.toc-count-many {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

/* ============================================
   STATS SCREENS - Impactful data display
   ============================================ */
.theme-player-slide.screen-type-big-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.screen-type-big-stat .theme-block-title {
  text-align: center;
  margin-bottom: 20px;
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 500;
  opacity: 0.8;
}

.theme-player-slide.screen-type-stats-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
}

.screen-type-stats-grid .theme-block-title {
  text-align: center;
  margin-bottom: 40px;
}

/* Stats grid layout - 2x2 for 4 stats */
.screen-type-stats-grid .stats-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  max-width: 700px;
}

.screen-type-stats-grid .theme-block-stat {
  padding: 32px 20px;
  min-height: 140px;
}

.screen-type-stats-grid .theme-block-stat .stat-value {
  font-size: clamp(48px, 6vw, 72px);
}

.screen-type-stats-grid .theme-block-stat .stat-label {
  font-size: clamp(14px, 1.5vw, 17px);
}

/* Timeline Screen Layout */
.theme-player-slide.screen-type-timeline {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px;
}

.screen-type-timeline .theme-block-title {
  text-align: center;
  margin-bottom: 32px;
}

/* Thumbnail */
.theme-thumbnail {
  width: 100%;
  aspect-ratio: 1024/748;
  border-radius: 6px;
  border: 2px solid var(--ai-border);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: all var(--ai-transition);
  background: var(--ai-bg);
  padding: 0;
}

.theme-thumbnail:hover {
  border-color: var(--ai-text-tertiary);
}

.theme-thumbnail.selected {
  border-color: var(--ai-primary);
  box-shadow: var(--ai-shadow-focus);
}

.theme-thumbnail-canvas {
  flex: 1;
  width: 100%;
  background: var(--theme-bg, #fff);
  overflow: hidden;
}

/* Captured thumbnail image */
.theme-thumbnail-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Capturing indicator */
.ai-capturing-indicator {
  display: inline-block;
  animation: ai-pulse 1s infinite;
  color: var(--ai-text-tertiary);
  font-size: 12px;
  margin-left: 4px;
}

@keyframes ai-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

.theme-thumbnail-content {
  padding: 8px;
  transform: scale(0.25);
  transform-origin: top left;
  width: 400%;
  height: 400%;
}

.theme-thumbnail-number {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Thumbnail block styles */
.thumb-title {
  font-size: 48px;
  font-weight: 700;
  color: var(--theme-text, #111);
  margin-bottom: 16px;
  line-height: 1.2;
  font-family: var(--theme-title-font, inherit);
}

.thumb-subtitle {
  font-size: 28px;
  font-weight: 400;
  color: var(--theme-text-secondary, #666);
  margin-bottom: 16px;
  font-family: var(--theme-body-font, inherit);
}

.thumb-body {
  font-size: 24px;
  color: var(--theme-text, #111);
  line-height: 1.4;
  margin-bottom: 12px;
  font-family: var(--theme-body-font, inherit);
}

.thumb-list {
  font-size: 22px;
  color: var(--theme-text, #111);
  font-family: var(--theme-body-font, inherit);
}

.thumb-list-item {
  margin-bottom: 8px;
  line-height: 1.3;
}

.theme-thumbnail-number {
  font-weight: 600;
  font-size: 18px;
  color: var(--theme-text, #111827);
}

.theme-thumbnail-type {
  padding: 4px 8px;
  font-size: 10px;
  color: var(--theme-text-secondary, #6b7280);
  text-transform: capitalize;
}

/* Responsive */
@media (max-width: 1024px) {
  /* iPad + smaller: drop the Generate button visibly lower so it has its own
     zone at the end of the form instead of riding right under the form copy. */
  .ai-generate-cta {
    margin-top: 64px;
  }

  .ai-prompt-container {
    padding: 0 16px;
  }

  .ai-preview-layout {
    grid-template-columns: 1fr;
  }

  .ai-preview-sidebar {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--ai-border);
    overflow-x: auto;
  }

  .ai-sidebar-section {
    min-width: 200px;
    border-bottom: none;
    border-right: 1px solid var(--ai-border);
  }

  .ai-sidebar-thumbnails {
    flex-direction: row;
  }

  .ai-thumbnail-list {
    flex-direction: row;
  }

  .ai-creator-chat-panel.editor-ai-panel {
    border-left: none;
    border-top: 1px solid var(--ai-border);
    max-height: 400px;
  }
}

@media (max-width: 640px) {
  .ai-creator-header {
    padding: 16px 20px;
  }

  .ai-creator-main {
    padding: 16px;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .ai-prompt-card {
    padding: 16px;
  }

  .ai-prompt-title {
    font-size: 26px;
    margin-bottom: 8px;
  }

  .ai-prompt-subtitle {
    font-size: 15px;
    line-height: 1.45;
    margin-bottom: 24px;
  }

  .ai-form-row {
    flex-direction: column;
    gap: 0;
  }

  /* Inline Generate CTA — sits at the natural end of the form, below the
     "Flows are made of…" note. Pill-shaped, centered, content-fit width.
     48px top margin so the button has its own breathing zone, not glued to copy. */
  .ai-generate-cta {
    display: block;
    width: auto;
    min-width: 220px;
    max-width: 100%;
    margin: 48px auto 0;
    border-radius: 9999px;
    padding: 14px 40px;
    background: #426ab8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow:
      0 1px 0 rgba(255,255,255,0.18) inset,
      0 8px 22px rgba(0, 0, 0, 0.35);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.015em;
  }

  .ai-generate-cta:active:not(:disabled) {
    transform: scale(0.98);
  }

  .ai-generate-cta:disabled {
    background: rgba(66, 106, 184, 0.45);
    color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  }

  .ai-preview-content {
    padding: 16px;
  }

  .ai-preview-header {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .ai-preview-actions {
    width: 100%;
    justify-content: center;
  }

  .theme-block-title-1 {
    font-size: 32px;
  }

  .theme-block-title-2 {
    font-size: 28px;
  }

  .theme-block-title-3 {
    font-size: 24px;
  }

  /* Fix overlap between guide options and generate button on mobile */
  .ai-guide-toggle {
    margin-top: 12px;
    margin-bottom: 12px;
    padding: 14px 16px;
    font-size: 15px;
  }

  .ai-guide-toggle.expanded {
    margin-bottom: 0;
  }

  .ai-guide-toggle-hint {
    font-size: 13px;
  }

  .ai-guide-options {
    margin-bottom: 0;
  }

  .ai-guide-options.expanded {
    /* Tone + audience + model with helper text easily exceeds 600px on iPhone.
       Going generous so content never overflows beneath the Generate button. */
    max-height: 1600px;
    margin-bottom: 16px;
    padding: 16px;
  }

  .ai-guide-options .ai-form-group {
    margin-bottom: 16px;
  }

  .ai-btn-full {
    margin-top: 16px;
    padding: 16px 24px;
    font-size: 16px;
  }

  .ai-prompt-form .ai-form-group:last-of-type {
    margin-bottom: 8px;
  }

  .ai-prompt-form {
    padding-bottom: 16px;
  }
}

/* Suggestion Chips (used in prompt form refinement section) */
.ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-suggestion-chip {
  padding: 8px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: 20px;
  font-size: 13px;
  color: var(--ai-text);
  cursor: pointer;
  transition: all 0.2s;
}

.ai-suggestion-chip:hover {
  border-color: var(--ai-border);
  background: var(--ai-bg-tertiary);
}

.ai-suggestion-chip.selected {
  background: var(--ai-primary);
  border-color: var(--ai-primary);
  color: white;
}

/* =====================================================
   Aspect Ratio Selector
   ===================================================== */

.ai-aspect-ratio-options {
  display: flex;
  gap: 16px;
}

.ai-aspect-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: var(--ai-bg);
  border: 2px solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  cursor: pointer;
  transition: all var(--ai-transition);
}

.ai-aspect-option:hover {
  border-color: var(--ai-text-tertiary);
}

.ai-aspect-option.selected {
  border-color: var(--ai-primary);
  background: var(--ai-primary-light);
}

.ai-aspect-option span {
  font-weight: 600;
  color: var(--ai-text);
}

.ai-aspect-option small {
  font-size: 12px;
  color: var(--ai-text-secondary);
}

.ai-aspect-preview {
  background: var(--ai-bg-tertiary);
  border-radius: 4px;
}

.ai-aspect-widescreen {
  width: 72px;
  height: 40px;  /* 16:9 ratio */
}

.ai-aspect-standard {
  width: 64px;
  height: 48px;  /* 4:3 ratio */
}

/* =====================================================
   Editor AI Panel - Sidebar for Flow Editor
   ===================================================== */

/* Canvas wrapper for positioning AI button */
.ai-canvas-wrapper {
  position: relative;
}

.editor-ai-panel {
  position: fixed;
  right: 20px;
  top: var(--ai-panel-top, 98px);
  bottom: var(--ai-panel-bottom, 87px);
  width: 320px;
  display: flex;
  flex-direction: column;
  background: var(--ai-bg);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  font-family: var(--ai-font);
  color: var(--ai-text);
  /* High z-index to stay above canvas objects and Moveable transformers */
  z-index: 1000;
  overflow: hidden;
}

.editor-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
  gap: 8px;
}

.editor-ai-header .editor-ai-screen-indicator {
  margin-left: auto;
}

.editor-ai-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--ai-text);
}

.editor-ai-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ai-transition);
}

.editor-ai-close:hover {
  background: var(--ai-bg-secondary);
  color: var(--ai-text);
}

.editor-ai-screen-indicator {
  font-size: 11px;
  font-weight: 500;
  color: var(--ai-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-ai-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.editor-ai-welcome {
  text-align: center;
  padding: 12px 0;
}

.editor-ai-welcome p {
  margin: 0 0 20px;
  color: var(--ai-text-secondary);
  font-size: 14px;
}

.editor-ai-mode-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--ai-success-light);
  color: var(--ai-success);
  font-size: 11px;
  font-weight: 600;
  border-radius: 12px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.editor-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 6px;
}

.editor-ai-suggestions button {
  padding: 8px 12px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--ai-text);
  text-align: left;
  transition: all var(--ai-transition);
}

.editor-ai-suggestions button:hover {
  background: var(--ai-bg-tertiary);
  border-color: var(--ai-border);
}

.editor-ai-message {
  display: flex;
  margin-bottom: 8px;
}

.editor-ai-content {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ai-text);
}

.editor-ai-user .editor-ai-content {
  background: var(--ai-bg-secondary);
}

.editor-ai-assistant .editor-ai-content {
  background: transparent;
  color: var(--ai-text-secondary);
  padding-left: 0;
  padding-right: 0;
}

.editor-ai-undo-btn {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  background: none;
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius);
  color: var(--ai-text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--ai-transition);
}

.editor-ai-undo-btn:hover {
  background: var(--ai-bg-secondary);
  color: var(--ai-text);
  border-color: var(--ai-border);
}

.editor-ai-warnings {
  margin-top: 6px;
}

.editor-ai-warning {
  font-size: 12px;
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.4;
}

.editor-ai-loading .editor-ai-content {
  padding: 8px 0;
}

.editor-ai-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ai-text-tertiary);
  font-size: 12px;
  font-weight: 400;
}

.editor-ai-spinner {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--ai-text-tertiary);
  border-top-color: transparent;
  border-radius: 50%;
  animation: editor-ai-spin 0.7s linear infinite;
}

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

.editor-ai-error {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  margin: 0 20px 12px;
  background: var(--ai-error-light);
  color: var(--ai-error);
  font-size: 13px;
  border-radius: var(--ai-radius);
}

.editor-ai-error button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  line-height: 1;
}

.editor-ai-input-form {
  padding: 10px 16px;
  border-top: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
}

.editor-ai-input-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}

.editor-ai-input-row textarea {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--ai-border-subtle);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--ai-font);
  color: var(--ai-text);
  background: var(--ai-bg-secondary);
  resize: none;
  transition: border-color var(--ai-transition);
  line-height: 1.4;
}

.editor-ai-input-row textarea::placeholder {
  color: var(--ai-text-tertiary);
}

.editor-ai-input-row textarea:focus {
  outline: none;
  border-color: var(--ai-text-tertiary);
}

.editor-ai-input-row textarea:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.editor-ai-send {
  width: 30px;
  height: 30px;
  padding: 0;
  background: transparent;
  color: var(--ai-text-tertiary);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--ai-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.editor-ai-send:hover:not(:disabled) {
  color: var(--ai-text);
  background: var(--ai-bg-secondary);
}

.editor-ai-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.editor-ai-cancel {
  width: 30px;
  height: 30px;
  padding: 0;
  background: #ef4444;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--ai-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.editor-ai-cancel:hover {
  background: #dc2626;
}

/* Empty State - No Content Layer */
.editor-ai-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}

.editor-ai-empty-icon {
  color: var(--ai-text-tertiary);
  margin-bottom: 16px;
  opacity: 0.5;
}

.editor-ai-empty-state h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: var(--ai-text);
}

.editor-ai-empty-state p {
  margin: 0 0 8px;
  font-size: 14px;
  color: var(--ai-text-secondary);
  line-height: 1.5;
}

.editor-ai-hint {
  font-size: 13px;
  color: var(--ai-text-tertiary);
}

.editor-ai-hint a {
  color: var(--ai-primary);
  text-decoration: none;
}

.editor-ai-hint a:hover {
  text-decoration: underline;
}

/* Floating AI toggle — shown when chat is closed, positioned below control bar */
.editor-ai-floating-toggle {
  position: fixed;
  right: 20px;
  top: var(--ai-panel-top, 98px);
  z-index: 1000;
}

/* Control Bar Theme Button — standalone rainbow border, no container */
.control-bar-theme-btn {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 12px !important;
  margin-left: auto;
  margin-right: 12px;
  background: transparent !important;
  border: 2px solid transparent !important;
  border-radius: 12px !important;
  background-image: linear-gradient(var(--background, #fff), var(--background, #fff)),
                    conic-gradient(#6366F1, #EC4899, #F59E0B, #10B981, #3B82F6, #6366F1) !important;
  background-origin: border-box !important;
  background-clip: padding-box, border-box !important;
  cursor: pointer;
  color: var(--foreground, #333) !important;
  font-size: 10px;
  font-weight: 500;
  min-width: 52px;
  height: 46px;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.control-bar-theme-btn svg {
  width: 24px !important;
  height: 24px !important;
  min-width: 24px !important;
  min-height: 24px !important;
}

.control-bar-theme-btn span {
  font-size: 10px;
  line-height: 1;
}

.control-bar-theme-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.control-bar-theme-btn.active {
  background-image: linear-gradient(#6366F1, #6366F1),
                    conic-gradient(#6366F1, #EC4899, #F59E0B, #10B981, #3B82F6, #6366F1) !important;
  color: white !important;
}

/* Gradient Direction Picker — iOS-style 3x3 grid with arrows + center dot */
.gradient-dir-picker {
  display: grid;
  grid-template-columns: 32px 6px 32px;
  grid-template-rows: 32px 6px 32px 6px 32px;
  align-items: center;
  justify-items: center;
  width: fit-content;
}

.gradient-dir-spacer {
  display: block;
}

.gradient-dir-btn {
  width: 32px !important;
  height: 32px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 1.5px solid rgba(128, 128, 128, 0.35) !important;
  border-radius: 7px !important;
  background: transparent !important;
  color: rgba(100, 100, 100, 0.65) !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.gradient-dir-btn svg {
  width: 14px !important;
  height: 14px !important;
}

.gradient-dir-btn:hover {
  border-color: var(--foreground, rgba(100, 100, 100, 0.8)) !important;
  color: var(--foreground, #555) !important;
  background: rgba(0, 0, 0, 0.04) !important;
}

.gradient-dir-btn.active {
  border-color: var(--foreground, #333) !important;
  color: var(--foreground, #333) !important;
  background: rgba(0, 0, 0, 0.06) !important;
}

.gradient-dir-center {
  border-radius: 50% !important;
}

/* AI Toggle Button — !important needed to override global button reset in flow_edit.css */
.editor-ai-toggle {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: rgba(30, 30, 30, 0.85) !important;
  color: #e0e0e0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.editor-ai-toggle svg,
.editor-theme-toggle svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  flex-shrink: 0;
}

.editor-ai-toggle:hover {
  background: rgba(40, 40, 40, 0.95) !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}

.editor-ai-toggle.active {
  background: #6366f1 !important;
  color: white !important;
  border-color: #6366f1 !important;
}

/* =====================================================
   Editor Theme Picker
   ===================================================== */

/* Theme Picker Toggle Button */
.editor-theme-toggle {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  background: rgba(30, 30, 30, 0.85) !important;
  color: #e0e0e0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.editor-theme-toggle:hover {
  background: rgba(40, 40, 40, 0.95) !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}

.editor-theme-toggle.active {
  background: #6366f1 !important;
  color: white !important;
  border-color: #6366f1 !important;
}

/* Theme Picker Panel */
.editor-theme-picker {
  position: fixed;
  right: 40px;
  top: 160px;
  width: 340px;
  max-height: 520px;
  display: flex;
  flex-direction: column;
  background: var(--ai-bg);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  font-family: var(--ai-font);
  color: var(--ai-text);
  /* High z-index to stay above canvas objects */
  z-index: 1000;
  overflow: hidden;
}

.editor-theme-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
}

.editor-theme-picker-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--ai-text);
}

.editor-theme-picker-current {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ai-text-secondary);
}

.editor-theme-picker-current-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.editor-theme-picker-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ai-transition);
}

.editor-theme-picker-close:hover {
  background: var(--ai-bg-secondary);
  color: var(--ai-text);
}

/* Category Tabs */
.editor-theme-picker-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
  overflow-x: auto;
}

.editor-theme-picker-tab {
  padding: 4px 10px;
  background: none;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 12px;
  font-family: var(--ai-font);
  color: var(--ai-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--ai-transition);
}

.editor-theme-picker-tab:hover {
  color: var(--ai-text);
  background: var(--ai-bg-secondary);
}

.editor-theme-picker-tab.active {
  color: var(--ai-text);
  background: var(--ai-bg-tertiary);
  border-color: var(--ai-border-subtle);
}

/* Theme Grid */
.editor-theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
}

/* Theme Card */
.editor-theme-card {
  background: none;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.editor-theme-card:hover {
  transform: translateY(-2px);
}

.editor-theme-card.selected {
  border-color: var(--ai-primary);
}

.editor-theme-card-preview {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.editor-theme-card-accent {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.editor-theme-card-lines {
  position: absolute;
  top: 20%;
  left: 12%;
  right: 12%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.editor-theme-card-title-line {
  height: 4px;
  width: 55%;
  border-radius: 2px;
  opacity: 0.85;
}

.editor-theme-card-body-line {
  height: 2px;
  width: 75%;
  border-radius: 1px;
  opacity: 0.4;
}

.editor-theme-card-body-line.short {
  width: 45%;
}

.editor-theme-card-name {
  font-size: 10px;
  color: var(--ai-text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
  padding-bottom: 2px;
}

.editor-theme-card.selected .editor-theme-card-name {
  color: var(--ai-text);
  font-weight: 600;
}

/* Responsive: 2-column grid at narrow widths */
@media (max-width: 1200px) {
  .editor-theme-picker {
    width: 280px;
  }

  .editor-theme-picker-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive adjustments for editor panel */
@media (max-width: 1400px) {
  .editor-ai-panel {
    width: 300px;
    right: 15px;
  }
}

@media (max-width: 1200px) {
  .editor-ai-panel {
    width: 280px;
    right: 10px;
  }
}

@media (max-width: 900px) {
  .editor-ai-panel {
    right: 0;
    top: 0;
    bottom: 0;
    border-radius: 0;
    border-right: none;
    z-index: 200;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  }
}

/* ====================================
   Inline Refinement Section (Prompt Form)
   ==================================== */

.ai-refinement-section {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--ai-border-subtle);
}

.ai-refinement-header {
  font-size: 13px;
  color: var(--ai-text-secondary);
  margin: 0 0 16px;
}

.ai-refinement-section .ai-form-group textarea {
  min-height: auto;
}

/* ====================================
   Guide the AI - collapsible toggle
   ==================================== */

.ai-guide-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: 1px solid var(--ai-border-subtle);
  border-radius: var(--ai-radius);
  color: var(--ai-text-secondary);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              border-radius 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 0;
}

.ai-guide-toggle:hover {
  color: var(--ai-text-primary);
  border-color: var(--ai-text-secondary);
  background: var(--ai-bg-secondary);
}

.ai-guide-toggle.expanded {
  color: var(--ai-text-primary);
  border-color: var(--ai-text-secondary);
  margin-bottom: 0;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.ai-guide-toggle-icon {
  flex-shrink: 0;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-guide-toggle-hint {
  font-size: 12px;
  color: var(--ai-text-secondary);
  font-weight: 400;
}

.ai-guide-options {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-8px);
  transition: max-height 0.55s cubic-bezier(0.33, 1, 0.68, 1),
              opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1),
              padding 0.55s cubic-bezier(0.33, 1, 0.68, 1),
              border-color 0.3s ease,
              transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
  border: 1px solid transparent;
  border-top: none;
  border-radius: 0 0 var(--ai-radius) var(--ai-radius);
  padding: 0 16px;
  will-change: max-height, opacity, transform;
}

.ai-guide-options.expanded {
  /* Generous max-height so tone + audience + model with helper text never
     overflows the box and pushes content over the Generate button below. */
  max-height: 1600px;
  overflow: visible;
  opacity: 1;
  transform: translateY(0);
  border-color: var(--ai-border-subtle);
  padding: 16px;
}

.ai-guide-options .ai-advanced-options {
  border: none;
  border-radius: 0;
}

.ai-guide-options .ai-refinement-section {
  border-top: none;
  padding-top: 8px;
}

/* ====================================
   Chat Panel override for AI Creator Page
   Reuses editor-ai-* styles but overrides
   position:fixed so it fits in the grid.
   ==================================== */

.ai-creator-chat-panel.editor-ai-panel {
  position: static;
  width: auto;
  top: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  border: none;
  border-left: 1px solid var(--ai-border-subtle);
  border-radius: 0;
  min-height: 0;
}

/* Start Over - understated text button */
.ai-btn-start-over {
  font-size: 13px;
  color: var(--ai-text-tertiary);
  padding: 8px 12px;
}

.ai-btn-start-over:hover {
  color: var(--ai-text-secondary);
}

/* Next button - primary action with blue treatment */
.ai-btn-next {
  padding: 10px 20px;
  background: var(--ai-primary);
  color: #ffffff;
  border: var(--ai-border-width) solid var(--ai-primary);
  font-size: 15px;
  font-weight: 600;
  gap: 4px;
}

.ai-btn-next:hover:not(:disabled) {
  background: var(--ai-primary-hover);
  border-color: var(--ai-primary-hover);
}

.ai-btn-next:disabled {
  opacity: 0.6;
}

/* ============================================================
   Elapsed seconds counters (debug / timing)
   ============================================================ */

/* Upper-right corner counter on the generating modal */
.ai-elapsed-corner {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 13px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--ai-text-tertiary);
  opacity: 0.7;
}

/* Inline counter next to "Refining" / "Working" text */
.ai-elapsed-inline {
  font-size: 12px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  color: var(--ai-text-tertiary);
  margin-left: 8px;
  opacity: 0.6;
}

/* ============================================================
   AI Image Generation — resolved, shimmer, spinner, fallback
   ============================================================ */

/* Resolved image display */
.theme-block-image-resolved {
  margin: 0 0 24px 0;
  border-radius: 12px;
  overflow: hidden;
  max-width: 560px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}
.theme-resolved-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  animation: fadeInImage 0.5s ease-in;
}

/* Shimmer loading animation */
.theme-block-image-placeholder.shimmer {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.05) 25%,
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0.05) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes fadeInImage {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* Image generation spinner */
.image-gen-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(0,0,0,0.1);
  border-top-color: var(--theme-accent, #6366F1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 8px;
}

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

/* Error / fallback container */
.image-fallback-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}
.image-search-btn {
  background: var(--theme-accent, #6366F1);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}
.image-search-btn:hover {
  filter: brightness(1.1);
}
.image-drop-hint {
  font-size: 11px;
  opacity: 0.5;
  margin-top: 4px;
}

/* Drop zone active state */
.theme-block-image-placeholder.drag-over {
  border: 2px dashed var(--theme-accent, #6366F1);
  background: rgba(99, 102, 241, 0.1) !important;
}

/* ============================================================
   Editor AI Image Generation Progress Banner
   ============================================================ */

.editor-ai-image-progress {
  padding: 10px 16px;
  border-bottom: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
}

.editor-ai-image-progress-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ai-text-secondary);
  margin-bottom: 6px;
}

.editor-ai-image-progress-errors {
  color: var(--ai-error);
}

.editor-ai-image-progress-bar {
  width: 100%;
  height: 3px;
  background: var(--ai-bg-tertiary);
  border-radius: 2px;
  overflow: hidden;
}

.editor-ai-image-progress-fill {
  height: 100%;
  background: var(--ai-primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ============================================================
   Mobile Preview Panel - Left Slide-out
   ============================================================ */

.mobile-preview-panel {
  position: fixed;
  left: 90px;
  top: var(--ai-panel-top, 98px);
  bottom: var(--ai-panel-bottom, 87px);
  width: 280px;
  display: flex;
  flex-direction: column;
  background: var(--ai-bg);
  border: var(--ai-border-width) solid var(--ai-border);
  border-radius: var(--ai-radius-lg);
  font-family: var(--ai-font);
  color: var(--ai-text);
  z-index: 999;
  overflow: hidden;
  animation: slideInFromLeft 0.25s ease-out;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
}

.mobile-preview-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text);
}

.mobile-preview-actions {
  display: flex;
  gap: 6px;
}

.mobile-preview-refresh,
.mobile-preview-close {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--ai-text-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--ai-transition);
}

.mobile-preview-refresh:hover,
.mobile-preview-close:hover {
  background: var(--ai-bg-secondary);
  color: var(--ai-text);
}

/* Phone Frame */
.mobile-preview-phone-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  margin: 16px;
  background: #1a1a1a;
  border-radius: 32px;
  padding: 12px 8px;
  box-shadow:
    0 0 0 2px #333,
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
}

.mobile-preview-phone-notch {
  width: 80px;
  height: 24px;
  background: #1a1a1a;
  border-radius: 0 0 16px 16px;
  margin: 0 auto 8px;
  position: relative;
  z-index: 2;
}

.mobile-preview-phone-notch::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: #333;
  border-radius: 2px;
}

.mobile-preview-phone-screen {
  flex: 1;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

/* Mobile Preview iframe wrapper */
.mobile-preview-iframe-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #0a0a0a;
  overflow: hidden;
}

.mobile-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  background: #000;
}

.mobile-preview-phone-home-bar {
  width: 100px;
  height: 4px;
  background: #444;
  border-radius: 2px;
  margin: 12px auto 4px;
}

.mobile-preview-footer {
  padding: 8px 16px;
  border-top: 1px solid var(--ai-border-subtle);
  flex-shrink: 0;
}

.mobile-preview-hint {
  font-size: 11px;
  color: var(--ai-text-tertiary);
}

/* Mobile Preview Toggle Button - positioned on left edge */
.mobile-preview-toggle {
  position: fixed;
  left: 80px;
  top: var(--ai-panel-top, 98px);
  z-index: 998;
  width: 36px !important;
  height: 36px !important;
  border-radius: 8px !important;
  background: rgba(30, 30, 30, 0.85) !important;
  color: #e0e0e0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.mobile-preview-toggle svg {
  width: 18px !important;
  height: 18px !important;
}

.mobile-preview-toggle:hover {
  background: rgba(40, 40, 40, 0.95) !important;
  border-color: #6366f1 !important;
  color: #6366f1 !important;
}

.mobile-preview-toggle.active {
  background: #6366f1 !important;
  color: white !important;
  border-color: #6366f1 !important;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .mobile-preview-panel {
    width: 260px;
    left: 70px;
  }
  .mobile-preview-toggle {
    left: 70px;
  }
}

@media (max-width: 900px) {
  .mobile-preview-panel {
    left: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    height: 50vh;
    border-radius: 16px 16px 0 0;
    animation: slideInFromBottom 0.25s ease-out;
  }

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

  .mobile-preview-toggle {
    left: 10px;
    top: auto;
    bottom: 100px;
  }

  .mobile-preview-phone-frame {
    flex-direction: row;
    margin: 12px;
    border-radius: 24px;
    padding: 8px;
  }

  .mobile-preview-phone-notch {
    display: none;
  }

  .mobile-preview-phone-home-bar {
    display: none;
  }
}

/* ============================================
   MOBILE PREVIEW MODAL (centered overlay)
   ============================================ */

.mobile-preview-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.mobile-preview-modal {
  background: #1a1a1a;
  border-radius: 16px;
  border: 1px solid #333;
  width: 380px;
  height: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mobile-preview-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #222;
  border-bottom: 1px solid #333;
  flex-shrink: 0;
}

.mobile-preview-modal-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.mobile-preview-modal-actions {
  display: flex;
  gap: 8px;
}

.mobile-preview-modal-actions button {
  background: none;
  border: none;
  padding: 4px;
  border-radius: 4px;
  color: #888;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-preview-modal-actions button:hover {
  background: #333;
  color: #fff;
}

/* The MobilePreviewPanel inside the modal */
.mobile-preview-modal .mobile-preview-panel {
  position: relative;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.mobile-preview-modal .mobile-preview-header {
  display: none; /* Already have modal header */
}

.mobile-preview-modal .mobile-preview-iframe-wrapper {
  flex: 1;
  padding: 0;
}

.mobile-preview-modal .mobile-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
}

.mobile-preview-modal .mobile-preview-footer {
  padding: 8px 16px;
  border-top: 1px solid #333;
  background: #222;
}

/* ============================================
   STREAMING PROGRESS STYLES
   ============================================ */

.streaming-card {
  min-width: 480px;
  max-width: 600px;
}

.streaming-progress {
  padding: 0;
}

.streaming-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.streaming-status {
  flex: 1;
}

.streaming-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 600;
  color: var(--ai-text);
}

.streaming-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--ai-text-secondary);
}

.streaming-elapsed {
  font-size: 13px;
  color: var(--ai-text-tertiary);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  background: var(--ai-bg-secondary);
  border-radius: 6px;
  flex-shrink: 0;
}

/* Progress Bar */
.streaming-progress-bar {
  position: relative;
  height: 6px;
  background: var(--ai-bg-tertiary);
  border-radius: 3px;
  margin-bottom: 24px;
  overflow: hidden;
}

.streaming-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--ai-primary) 0%, #60a5fa 100%);
  border-radius: 3px;
  transition: width 0.4s ease-out;
}

.streaming-progress-text {
  position: absolute;
  right: 0;
  top: -20px;
  font-size: 12px;
  color: var(--ai-text-secondary);
  font-feature-settings: 'tnum';
}

/* Screen Cards Grid */
.streaming-screens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.streaming-screen-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--ai-bg-secondary);
  border: 1px solid var(--ai-border-subtle);
  border-radius: 10px;
  transition: all 0.3s ease;
}

.streaming-screen-card.complete {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}

.streaming-screen-card.generating {
  background: var(--ai-bg-tertiary);
  border-color: var(--ai-primary);
  animation: screen-generating 1.5s ease-in-out infinite;
}

.streaming-screen-card.pending {
  opacity: 0.4;
  border-style: dashed;
}

@keyframes screen-generating {
  0%, 100% {
    border-color: var(--ai-primary);
    box-shadow: 0 0 0 0 rgba(66, 106, 184, 0);
  }
  50% {
    border-color: var(--ai-primary-hover);
    box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.1);
  }
}

.streaming-screen-number {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-bg);
  border: 1px solid var(--ai-border-subtle);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-text-secondary);
  flex-shrink: 0;
}

.streaming-screen-card.complete .streaming-screen-number {
  background: var(--ai-success);
  border-color: var(--ai-success);
  color: white;
}

.streaming-screen-content {
  flex: 1;
  min-width: 0;
}

.streaming-screen-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--ai-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.streaming-screen-meta {
  font-size: 12px;
  color: var(--ai-text-tertiary);
}

.streaming-screen-blocks {
  color: var(--ai-success);
}

.streaming-screen-check {
  color: var(--ai-success);
  flex-shrink: 0;
}

/* Typing Indicator */
.streaming-typing {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.streaming-typing span {
  width: 5px;
  height: 5px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: streaming-typing-bounce 1.2s ease-in-out infinite;
}

.streaming-typing span:nth-child(1) {
  animation-delay: 0s;
}

.streaming-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.streaming-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes streaming-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Debug/Development View */
.streaming-debug {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--ai-border-subtle);
}

.streaming-debug summary {
  font-size: 12px;
  color: var(--ai-text-tertiary);
  cursor: pointer;
  padding: 8px 0;
}

.streaming-debug pre {
  font-size: 11px;
  color: var(--ai-text-tertiary);
  background: var(--ai-bg);
  padding: 12px;
  border-radius: 8px;
  max-height: 150px;
  overflow: auto;
  margin: 8px 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Responsive */
@media (max-width: 600px) {
  .streaming-card {
    min-width: unset;
    width: 100%;
  }

  .streaming-screens {
    grid-template-columns: 1fr;
  }

  .streaming-header {
    flex-direction: column;
    gap: 12px;
  }

  .streaming-elapsed {
    align-self: flex-start;
  }
}

/* ============================================
   LIVE SLIDESHOW STYLES
   ============================================ */

.slideshow-card {
  min-width: 600px;
  max-width: 800px;
  padding: 0;
  overflow: hidden;
}

.streaming-slideshow {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

/* Header */
.slideshow-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--ai-border-subtle);
}

.slideshow-title-area {
  flex: 1;
  min-width: 0;
}

.slideshow-title {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ai-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slideshow-title.generating {
  color: var(--ai-text-secondary);
}

.slideshow-status {
  margin: 0;
  font-size: 13px;
  color: var(--ai-text-tertiary);
}

.slideshow-elapsed {
  font-size: 13px;
  color: var(--ai-text-tertiary);
  font-feature-settings: 'tnum';
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  background: var(--ai-bg-secondary);
  border-radius: 6px;
  flex-shrink: 0;
}

/* Thumbnail strip */
.slideshow-thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: var(--ai-bg-secondary);
  border-bottom: 1px solid var(--ai-border-subtle);
  overflow-x: auto;
}

.slideshow-thumb {
  flex-shrink: 0;
  width: 40px;
  height: 72px;
  border-radius: 6px;
  border: 2px solid var(--ai-border-subtle);
  background: var(--ai-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  padding: 0;
  font-family: var(--ai-font);
}

.slideshow-thumb:hover {
  border-color: var(--ai-text-tertiary);
}

.slideshow-thumb.active {
  border-color: var(--ai-primary);
}

.slideshow-thumb.current {
  border-color: var(--ai-primary);
  animation: thumb-pulse 1.5s ease-in-out infinite;
}

.slideshow-thumb.pending {
  opacity: 0.4;
  border-style: dashed;
  cursor: default;
}

.slideshow-thumb.completed .slideshow-thumb-check {
  position: absolute;
  top: 3px;
  right: 3px;
}

@keyframes thumb-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(66, 106, 184, 0);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(66, 106, 184, 0.2);
  }
}

.slideshow-thumb-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.slideshow-thumb-number {
  font-size: 14px;
  font-weight: 600;
  color: var(--ai-text-secondary);
}

.slideshow-thumb-title {
  font-size: 8px;
  color: var(--ai-text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
  text-align: center;
}

.slideshow-thumb-typing {
  display: flex;
  gap: 2px;
}

.slideshow-thumb-typing span {
  width: 4px;
  height: 4px;
  background: var(--ai-primary);
  border-radius: 50%;
  animation: streaming-typing-bounce 1.2s ease-in-out infinite;
}

.slideshow-thumb-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.slideshow-thumb-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

/* Main preview area */
.slideshow-preview-area {
  flex: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ai-bg-tertiary);
  min-height: 550px; /* Enough for portrait preview + chrome */
}

/* Live slide preview - portrait orientation */
.live-slide-preview {
  width: 280px;
  min-width: 280px;
  max-width: 280px;
  height: 498px; /* 280 * 16/9 for portrait */
  min-height: 498px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.live-slide-preview.static {
  /* No animation for static preview */
}

.live-slide-accent {
  height: 4px;
  flex-shrink: 0;
}

.live-slide-content {
  flex: 1;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.live-slide-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.live-slide-subtitle {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.live-slide-body {
  margin-bottom: 10px;
}

.live-slide-body p,
.live-slide-body-text {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.live-slide-bullets {
  margin: 0;
  padding: 0 0 0 4px;
  list-style: none;
}

.live-slide-bullets li {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}

.bullet-marker {
  display: none; /* Deprecated - using text bullets now */
}

.bullet-char {
  flex-shrink: 0;
  font-weight: 500;
  min-width: 12px;
  text-align: left;
}

.bullet-text {
  flex: 1;
  text-align: left;
}

.live-slide-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 24px;
  color: var(--ai-text-tertiary);
}

.live-slide-type-badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.5;
}

/* ===== THEME CHROME STYLES ===== */

/* Base theme chrome */
.theme-chrome {
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-chrome .live-slide-preview {
  border-radius: 12px;
}

/* LAUNCH - Modern dark bezel with purple glow */
.theme-chrome-launch .launch-bezel {
  position: relative;
  background: linear-gradient(145deg, #1e1e2e, #0a0a14);
  border-radius: 24px;
  padding: 12px;
  box-shadow:
    0 0 0 1px rgba(139, 92, 246, 0.3),
    0 8px 32px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.theme-chrome-launch .launch-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: #0a0a14;
  border-radius: 2px;
}

.theme-chrome-launch .launch-glow {
  position: absolute;
  inset: -2px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), transparent 50%);
  border-radius: 26px;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.6;
  animation: launch-pulse 3s ease-in-out infinite;
}

@keyframes launch-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}

.theme-chrome-launch .live-slide-preview {
  border-radius: 16px;
}

/* PHOSPHOR - Full CRT monitor */
.theme-chrome-phosphor .crt-bezel {
  position: relative;
  background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 50%, #0f0f0f 100%);
  border-radius: 20px 20px 24px 24px;
  padding: 16px 16px 40px 16px;
  box-shadow:
    0 4px 0 #0a0a0a,
    0 8px 20px rgba(0, 0, 0, 0.6),
    inset 0 2px 4px rgba(255, 255, 255, 0.05);
}

.theme-chrome-phosphor .crt-brand {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Courier New', monospace;
  font-size: 8px;
  font-weight: bold;
  color: #666;
  letter-spacing: 2px;
}

.theme-chrome-phosphor .crt-screen {
  position: relative;
  border-radius: 12px / 16px;
  overflow: hidden;
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.8),
    0 0 2px rgba(51, 255, 51, 0.3);
}

.theme-chrome-phosphor .crt-scanlines {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.15) 2px,
    rgba(0, 0, 0, 0.15) 4px
  );
  pointer-events: none;
  z-index: 10;
}

.theme-chrome-phosphor .crt-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(51, 255, 51, 0.03) 0%, transparent 70%);
  pointer-events: none;
  z-index: 9;
}

.theme-chrome-phosphor .crt-controls {
  position: absolute;
  bottom: 10px;
  right: 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.theme-chrome-phosphor .crt-knob {
  width: 12px;
  height: 12px;
  background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
  border-radius: 50%;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.theme-chrome-phosphor .crt-led {
  width: 6px;
  height: 6px;
  background: #33ff33;
  border-radius: 50%;
  box-shadow: 0 0 6px #33ff33;
  animation: led-blink 2s ease-in-out infinite;
}

@keyframes led-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.theme-chrome-phosphor .live-slide-preview {
  border-radius: 8px / 12px;
}

/* TERMINAL - Window chrome */
.theme-chrome-terminal {
  flex-direction: column;
}

.theme-chrome-terminal .terminal-titlebar {
  width: 100%;
  max-width: 280px;
  background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
  border-radius: 8px 8px 0 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-chrome-terminal .terminal-buttons {
  display: flex;
  gap: 6px;
}

.theme-chrome-terminal .terminal-btn {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.theme-chrome-terminal .terminal-btn.red { background: #ff5f57; }
.theme-chrome-terminal .terminal-btn.yellow { background: #febc2e; }
.theme-chrome-terminal .terminal-btn.green { background: #28c840; }

.theme-chrome-terminal .terminal-title {
  flex: 1;
  text-align: center;
  font-family: 'SF Mono', 'Monaco', monospace;
  font-size: 11px;
  color: #999;
}

.theme-chrome-terminal .terminal-content {
  background: #1a1a1a;
  border-radius: 0 0 8px 8px;
  padding: 2px;
}

.theme-chrome-terminal .live-slide-preview {
  border-radius: 0 0 12px 12px;
}

/* EDITORIAL - Elegant magazine frame */
.theme-chrome-editorial .editorial-frame {
  position: relative;
  padding: 8px;
  background: #f5f5f0;
  border-radius: 16px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.06);
}

.theme-chrome-editorial .editorial-corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid #1a1a2e;
  border-radius: 2px;
}

.theme-chrome-editorial .editorial-corner.tl { top: 4px; left: 4px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.theme-chrome-editorial .editorial-corner.tr { top: 4px; right: 4px; border-left: none; border-bottom: none; border-radius: 0 4px 0 0; }
.theme-chrome-editorial .editorial-corner.bl { bottom: 4px; left: 4px; border-right: none; border-top: none; border-radius: 0 0 0 4px; }
.theme-chrome-editorial .editorial-corner.br { bottom: 4px; right: 4px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }

.theme-chrome-editorial .live-slide-preview {
  border-radius: 10px;
}

/* IMPACT - Bold frame with pulse */
.theme-chrome-impact .impact-frame {
  position: relative;
  padding: 4px;
  background: #ff3366;
  border-radius: 16px;
}

.theme-chrome-impact .impact-pulse {
  position: absolute;
  inset: -4px;
  background: #ff3366;
  border-radius: 20px;
  z-index: -1;
  animation: impact-pulse 1.5s ease-in-out infinite;
}

@keyframes impact-pulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.02); }
}

.theme-chrome-impact .live-slide-preview {
  border-radius: 12px;
}

/* REFINED - Thin brass frame */
.theme-chrome-refined .refined-frame {
  padding: 6px;
  background: linear-gradient(135deg, #c9a961 0%, #8b7355 50%, #c9a961 100%);
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.15);
}

.theme-chrome-refined .live-slide-preview {
  border-radius: 8px;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
}

/* WARM - Soft rounded frame */
.theme-chrome-warm .warm-frame {
  padding: 12px;
  background: linear-gradient(145deg, #fff5eb, #ffe4cc);
  border-radius: 28px;
  box-shadow:
    0 4px 16px rgba(225, 112, 85, 0.15),
    inset 0 2px 4px rgba(255, 255, 255, 0.8);
}

.theme-chrome-warm .live-slide-preview {
  border-radius: 20px;
}

/* SWISS - Minimal hairline */
.theme-chrome-swiss {
  padding: 1px;
  background: #000;
  border-radius: 10px;
}

.theme-chrome-swiss .live-slide-preview {
  border-radius: 8px;
}

/* CORAL-SUNSET - Gradient border */
.theme-chrome-coral .coral-gradient-frame {
  padding: 4px;
  background: linear-gradient(135deg, #d4455a 0%, #ff8c42 50%, #ffd700 100%);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(212, 69, 90, 0.3);
}

.theme-chrome-coral .live-slide-preview {
  border-radius: 12px;
}

/* MINIMAL - Subtle shadow only */
.theme-chrome-minimal {
  padding: 0;
}

.theme-chrome-minimal .live-slide-preview {
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== END THEME CHROME ===== */

/* Typing cursor */
.typing-cursor {
  display: inline-block;
  color: inherit;
  animation: cursor-blink 0.8s step-end infinite;
  margin-left: 1px;
  font-weight: 400;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Viewing badge */
.slideshow-viewing-badge {
  position: absolute;
  bottom: 8px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--ai-text-tertiary);
}

.slideshow-viewing-badge button {
  background: none;
  border: none;
  color: var(--ai-primary);
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  text-decoration: underline;
}

/* Progress bar */
.slideshow-progress-bar {
  height: 4px;
  background: var(--ai-bg-tertiary);
  overflow: hidden;
}

.slideshow-progress-fill {
  height: 100%;
  transition: width 0.5s ease-out;
}

/* Mobile dot indicators (hidden on desktop) */
.slideshow-dots {
  display: none;
}

/* Empty state spinner */
.slideshow-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  color: var(--ai-text-secondary);
}

.slideshow-empty-spinner {
  animation: spin 1.5s linear infinite;
}

.slideshow-empty p {
  margin: 0;
  font-size: 14px;
}

/* Compiling overlay when generation complete */
.slideshow-compiling-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  z-index: 10;
  animation: fadeIn 0.3s ease-out;
}

.slideshow-compiling-spinner {
  animation: spin 1.5s linear infinite;
}

/* Responsive */
@media (max-width: 700px) {
  .slideshow-card {
    min-width: unset;
    width: 100%;
  }

  .slideshow-preview-area {
    padding: 16px;
    min-height: 240px;
  }

  .live-slide-preview {
    max-width: 100%;
  }

  .live-slide-content {
    padding: 16px 20px;
  }

  .live-slide-title {
    font-size: 18px;
  }

  .live-slide-subtitle {
    font-size: 12px;
  }

  .slideshow-thumbs {
    padding: 10px 16px;
  }

  .slideshow-thumb {
    width: 32px;
    height: 56px;
  }

  .slideshow-thumb-title {
    display: none;
  }
}

/* ---- Credit Packs Modal ---- */
.credit-packs-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7); display: flex; align-items: center;
  justify-content: center; z-index: 10000; backdrop-filter: blur(4px);
}
.credit-packs-modal {
  background: #1a1a2e; border-radius: 16px; padding: 32px;
  max-width: 560px; width: 90%; position: relative; color: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.credit-packs-close {
  position: absolute; top: 12px; right: 16px; background: none;
  border: none; color: #64748b; font-size: 24px; cursor: pointer;
  padding: 4px 8px; border-radius: 4px;
}
.credit-packs-close:hover { color: #fff; background: rgba(255,255,255,0.1); }
.credit-packs-title { font-size: 22px; margin-bottom: 4px; text-align: center; }
.credit-packs-subtitle { color: #94a3b8; text-align: center; margin-bottom: 24px; font-size: 14px; }
.credit-packs-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.credit-pack-card {
  background: #16213e; border: 1px solid #2a2a4a; border-radius: 12px;
  padding: 20px 16px; text-align: center; position: relative; transition: border-color 0.2s;
}
.credit-pack-card:hover { border-color: #6366f1; }
.credit-pack-featured { border-color: #6366f1; background: #1a1a3e; }
.credit-pack-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 11px; font-weight: 600; padding: 2px 10px; border-radius: 10px;
  white-space: nowrap;
}
.credit-pack-credits { font-size: 32px; font-weight: 700; color: #fff; }
.credit-pack-label { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.credit-pack-price { font-size: 20px; font-weight: 600; color: #e2e8f0; }
.credit-pack-per { font-size: 11px; color: #64748b; margin-bottom: 12px; }
.credit-pack-buy {
  width: 100%; padding: 8px 0; border: none; border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: opacity 0.2s;
}
.credit-pack-buy:hover { opacity: 0.9; }
.credit-pack-buy:disabled { opacity: 0.5; cursor: not-allowed; }
.credit-packs-error { color: #ef4444; text-align: center; margin-top: 12px; font-size: 14px; }
.credit-packs-loading { text-align: center; color: #64748b; padding: 40px; }

/* ---- Auth Gate Modal (anonymous /create → sign in/up inline) ----
   Tokens per design-system.md:
   colors: --color-primary #426ab8 / hover #355492, dark bg #1a1a1a,
           error #ef4444; spacing on 8px scale; radius xl=16/lg=12/md=8;
           transitions fast=0.15s/base=0.2s; font Open Sans. */
.auth-gate-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7); display: flex; align-items: center;
  justify-content: center; z-index: 10000; backdrop-filter: blur(4px);
  padding: 16px;
}
.auth-gate-modal {
  background: #1a1a1a; border: 1px solid rgba(255,255,255,0.15);
  border-radius: 16px; padding: 32px; max-width: 420px; width: 100%;
  position: relative; color: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,0.15), 0 6px 12px rgba(0,0,0,0.10);
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}
.auth-gate-close {
  position: absolute; top: 12px; right: 16px; background: none;
  border: none; color: #999; font-size: 24px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; line-height: 1;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-gate-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
.auth-gate-title {
  font-size: 22px; font-weight: 700; margin: 0 0 8px;
  letter-spacing: -0.02em; line-height: 1.25;
}
.auth-gate-subtitle {
  color: #b0b0b0; font-size: 13px; margin: 0 0 24px; line-height: 1.5;
}
.auth-gate-form { display: flex; flex-direction: column; gap: 12px; }
.auth-gate-form input {
  width: 100%; padding: 12px 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #fff; font-size: 15px;
  font-family: inherit; box-sizing: border-box; outline: none;
  transition: border-color 0.15s ease;
}
.auth-gate-form input:focus { border-color: #426ab8; box-shadow: 0 0 0 3px rgba(66,106,184,0.1); }
.auth-gate-form input:disabled { opacity: 0.6; }
.auth-gate-error {
  color: #ef4444; font-size: 13px; padding: 8px 12px;
  background: rgba(239,68,68,0.1); border-radius: 8px;
}
.auth-gate-submit {
  width: 100%; padding: 12px 16px; margin-top: 4px;
  background: #426ab8; color: #fff; border: none; border-radius: 8px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.2s ease;
}
.auth-gate-submit:hover:not(:disabled) { background: #355492; }
.auth-gate-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-gate-toggle {
  text-align: center; margin-top: 16px; font-size: 13px; color: #b0b0b0;
}
.auth-gate-toggle button {
  background: none; border: none; color: #426ab8;
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 0;
  transition: color 0.15s ease;
}
.auth-gate-toggle button:hover { color: #355492; text-decoration: underline; }
.auth-gate-forgot {
  display: block; text-align: center; margin-top: 8px;
  font-size: 12px; color: #999; text-decoration: none;
  transition: color 0.15s ease;
}
.auth-gate-forgot:hover { color: #b0b0b0; }

/* Social sign-in row — matches the /login + /register page layout.
   Kept in sync with the editor's claim modal (mobile-editor.css). */
.auth-gate-divider {
  display: flex; align-items: center;
  margin: 16px 0 12px; color: #777;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
}
.auth-gate-divider::before, .auth-gate-divider::after {
  content: ""; flex: 1; height: 1px;
  background: rgba(255,255,255,0.12);
}
.auth-gate-divider span { padding: 0 10px; }
.auth-gate-socials { display: flex; flex-direction: column; gap: 8px; }
.auth-gate-social {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px; color: #fff; font-size: 14px; font-weight: 500;
  text-decoration: none; font-family: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.auth-gate-social:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.25); }
.auth-gate-social svg { flex-shrink: 0; }

/* Buy credits link in credits hint */
.ai-buy-credits-link {
  color: #8b5cf6; cursor: pointer; text-decoration: underline;
  text-decoration-style: dotted; margin-left: 4px;
}
.ai-buy-credits-link:hover { color: #a78bfa; }

@media (max-width: 520px) {
  .credit-packs-grid { grid-template-columns: 1fr; }
}

/* ============================================
   MOBILE OPTIMIZATION - AI Creation Flow
   Full-screen card design for vertical screens
   ============================================ */

@media screen and (max-width: 768px) {
  /* Page layout - full height */
  .ai-creator-page {
    min-height: 100vh;
    min-height: 100dvh;
  }

  .ai-creator-header {
    padding: 0 16px;
    height: 52px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--ai-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .ai-creator-logo {
    font-size: 16px;
  }

  .ai-creator-logo img {
    height: 24px;
  }

  .ai-creator-nav a {
    font-size: 13px;
  }

  .ai-creator-main {
    padding: 0;
    padding-top: 62px; /* Account for fixed header + 10px spacing */
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
  }

  /* Generating container - full screen */
  .ai-generating-container {
    padding: 0;
    align-items: stretch;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
  }

  .ai-generating-card {
    padding: 24px 20px;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border: none;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .ai-generating-card h2 {
    font-size: 20px;
  }

  .ai-generating-card p {
    font-size: 15px;
  }

  /* Streaming slideshow - full screen card view */
  .slideshow-card {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
    border: none !important;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
  }

  .streaming-slideshow {
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
    display: flex;
    flex-direction: column;
  }

  /* Compact header */
  .slideshow-header {
    padding: 16px 20px;
    border-bottom: none;
    background: transparent;
  }

  .slideshow-title-area {
    text-align: center;
    flex: 1;
  }

  .slideshow-title {
    font-size: 18px;
    font-weight: 700;
    white-space: normal;
    line-height: 1.3;
  }

  .slideshow-status {
    font-size: 14px;
    margin-top: 4px;
  }

  .slideshow-elapsed {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 12px;
    padding: 4px 10px;
  }

  /* Hide thumbnail strip - replace with dot indicators */
  .slideshow-thumbs {
    display: none;
  }

  /* Show dot indicators on mobile */
  .slideshow-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
  }

  .slideshow-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ai-border);
    transition: all 0.3s ease;
  }

  .slideshow-dot.completed {
    opacity: 1;
  }

  .slideshow-dot.current {
    width: 24px;
    border-radius: 4px;
    animation: dot-pulse 1.5s ease-in-out infinite;
  }

  .slideshow-dot.pending {
    opacity: 0.3;
  }

  @keyframes dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
  }

  /* Preview area - full height card view */
  .slideshow-preview-area {
    flex: 1;
    padding: 20px;
    display: flex;
    align-items: stretch;
    justify-content: center;
    background: transparent;
    min-height: 0;
  }

  /* Card preview - fills available space, not 16:9 */
  .live-slide-preview {
    width: 100%;
    max-width: 100%;
    aspect-ratio: auto; /* Remove 16:9 constraint */
    flex: 1;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
  }

  .live-slide-accent {
    height: 4px;
    border-radius: 16px 16px 0 0;
  }

  .live-slide-content {
    flex: 1;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow-y: auto;
  }

  .live-slide-title {
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.2;
    margin-bottom: 16px;
    font-weight: 700;
  }

  .live-slide-subtitle {
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.4;
    margin-bottom: 24px;
    opacity: 0.85;
  }

  .live-slide-body-text {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.6;
    margin-bottom: 16px;
  }

  .live-slide-bullets {
    gap: 10px;
  }

  .live-slide-bullets li {
    font-size: clamp(15px, 4vw, 18px);
    line-height: 1.5;
    gap: 8px;
  }

  .bullet-char {
    min-width: 16px;
  }

  /* Progress bar - at bottom */
  .slideshow-progress-bar {
    height: 4px;
    border-radius: 0;
    margin: 0 20px 20px;
    border-radius: 2px;
    overflow: hidden;
  }

  /* Viewing badge */
  .slideshow-viewing-badge {
    font-size: 13px;
    padding: 10px 16px;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 20px;
    gap: 12px;
  }

  .slideshow-viewing-badge button {
    font-size: 12px;
    padding: 4px 12px;
  }

  /* Empty/loading state */
  .slideshow-empty {
    flex: 1;
    justify-content: center;
    gap: 20px;
  }

  .slideshow-empty-spinner svg {
    width: 48px;
    height: 48px;
  }

  .slideshow-empty p {
    font-size: 16px;
  }

  /* Add dot indicators for mobile (CSS-based progress) */
  .slideshow-progress-bar::after {
    content: '';
    display: block;
    text-align: center;
    padding-top: 12px;
  }
}

/* First-flow onboarding: ambient build-view bar — frosted-glass mini-bar pinned
   to the bottom of the viewport during generation. Same visual language as the
   editor coachmarks (frosted glass, accent stripe, shimmer sweep) so the entire
   onboarding experience reads as one family. Subtle, narrow, italic copy. */
@keyframes flow2AmbientPulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.35); }
}
@keyframes flow2In {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes flow2CardShimmer {
  from { background-position: -120% 0; }
  to   { background-position: 220% 0; }
}
.flow2-build-ambient-bar {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom));
  left: 16px;
  right: 16px;
  margin: 0 auto;
  max-width: 460px;
  z-index: 5;
  background: rgba(26, 26, 26, 0.82);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px; /* --radius-lg */
  padding: 10px 14px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 12px 28px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  animation: flow2In 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
/* Fades out 8s after appearing so it doesn't linger through the whole generation. */
.flow2-build-ambient-bar.flow2-fade-out {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}
.flow2-build-ambient-bar::before {
  /* Top accent stripe — same as coachmarks. */
  content: '';
  position: absolute;
  top: 0;
  left: 14px;
  right: 14px;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, #d8a06f 30%, #d8a06f 70%, transparent);
  opacity: 0.7;
  pointer-events: none;
  z-index: 1;
}
.flow2-build-ambient-bar::after {
  /* One-time shimmer sweep on entrance, matching the coachmarks. */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(110deg, transparent 35%, rgba(255, 255, 255, 0.10) 50%, transparent 65%);
  background-size: 220% 100%;
  background-position: -120% 0;
  animation: flow2CardShimmer 1.5s ease-out 0.4s 1 forwards;
  pointer-events: none;
  z-index: 2;
}
.flow2-build-ambient-dot {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #d8a06f;
  animation: flow2AmbientPulse 1.6s ease-in-out infinite;
}
.flow2-build-ambient-text {
  position: relative;
  z-index: 3;
  flex: 1;
  font-size: 13px; /* --font-size-sm */
  font-style: italic;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.01em;
  margin: 0;
  line-height: 1.4;
}
