* { box-sizing: border-box; }

:root {
  --bg:           #0b1020;
  --bg-panel:     rgba(15, 23, 42, 0.55);
  --border:       rgba(255, 255, 255, 0.06);
  --border-soft:  rgba(255, 255, 255, 0.04);
  --text:         #e2e8f0;
  --text-soft:    #94a3b8;
  --text-strong:  #f8fafc;
  --accent:       #818cf8;
  --accent-2:     #f472b6;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans Devanagari", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding: 28px 18px 60px;
  letter-spacing: -0.005em;
  position: relative;
  overflow-x: hidden;
}

/* Soft ambient gradient — same family as login, but more restrained
 * (one big blob, less animation) so the working UI stays calm. */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(800px 500px at 15% -10%, rgba(99,102,241,0.18), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(244,114,182,0.10), transparent 60%);
}

.container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.user-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 16px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.user-email { color: var(--text-strong); font-weight: 500; }
.user-role {
  padding: 3px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(99,102,241,0.18), rgba(244,114,182,0.18));
  border: 1px solid rgba(129,140,248,0.25);
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.78rem;
}
.user-usage {
  color: var(--text-soft);
  font-size: 0.78rem;
}
.user-logout {
  margin-left: 6px;
  padding: 4px 10px;
  background: rgba(255,255,255,0.08);
  color: #cbd5e1;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.8rem;
}
.user-logout:hover { background: rgba(255,255,255,0.14); }

.user-upgrade {
  margin-left: 6px;
  padding: 4px 12px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(239,68,68,0.25);
}
.user-upgrade:hover:not(:disabled) { filter: brightness(1.1); }
.user-upgrade:disabled { opacity: 0.6; cursor: default; box-shadow: none; }

.admin-panel { margin-bottom: 16px; }
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.upgrade-list { display: flex; flex-direction: column; gap: 8px; }
.upgrade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  gap: 12px;
}
.upgrade-meta { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.upgrade-note { font-style: italic; color: #cbd5e1; }
.upgrade-actions { display: flex; gap: 6px; flex-shrink: 0; }
.upgrade-actions button { padding: 6px 12px; font-size: 0.82rem; border-radius: 6px; cursor: pointer; }
.muted { color: #94a3b8; font-size: 0.78rem; }

.upgrade-picker { margin-bottom: 16px; }
.upgrade-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.upgrade-picker-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.1rem;
  cursor: pointer;
}
.upgrade-picker-close:hover { color: #fff; }

.upgrade-picker-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.upgrade-tier {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 10px;
}
.upgrade-tier-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.upgrade-tier-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #f59e0b;
}
.upgrade-tier-features { font-size: 0.85rem; color: #cbd5e1; }
.upgrade-tier-audio {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fbbf24;
  letter-spacing: 0.01em;
}
.upgrade-tier-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e293b;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.upgrade-tier-topup {
  border-color: rgba(251,191,36,0.35);
  background: linear-gradient(180deg, rgba(251,191,36,0.08), rgba(0,0,0,0.25));
}
.upgrade-tier-notes { margin: 0; font-size: 0.8rem; }
.upgrade-tier button {
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: none;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
}
.upgrade-tier button:hover { filter: brightness(1.1); }

.auth-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #c7d2fe;
  font-size: 0.95rem;
  padding: 24px;
}

.auth-heading {
  margin: 0 0 18px;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  color: #e0e7ff;
}
.auth-input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
}
.auth-input:focus { outline: 2px solid #818cf8; }
.auth-submit { width: 100%; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: #64748b;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

.auth-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 16px;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s;
}
.auth-google:hover:not(:disabled) { filter: brightness(0.97); }
.auth-google:disabled { opacity: 0.7; cursor: default; }
.auth-google svg { flex-shrink: 0; }
.auth-status {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  color: #86efac;
  font-size: 0.9rem;
}
.hero h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  background: linear-gradient(135deg, #c7d2fe, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  color: var(--text-soft);
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.card {
  background: var(--bg-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px 22px;
  margin-bottom: 18px;
  box-shadow:
    0 20px 50px -20px rgba(0,0,0,0.45),
    0 0 0 1px var(--border-soft) inset;
}

.provider-toggle {
  display: flex;
  align-items: center;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
  gap: 4px;
}
.toggle-label {
  padding: 0 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.prov-btn,
.llm-btn {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  background: transparent;
  color: #c7d2fe;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.prov-btn:hover,
.llm-btn:hover { background: rgba(255,255,255,0.05); }
.prov-btn.active,
.llm-btn.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}
.provider-note {
  font-size: 0.85rem;
  color: #fbbf24;
  margin: 0 0 12px;
  padding: 8px 12px;
  background: rgba(251,191,36,0.08);
  border-radius: 6px;
  border: 1px solid rgba(251,191,36,0.2);
}

.label {
  display: block;
  font-weight: 600;
  font-size: 0.82rem;
  margin-bottom: 8px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

textarea,
input[type="text"],
input[type="email"],
input[type="password"],
select {
  width: 100%;
  padding: 13px 14px;
  font-size: 0.98rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.28);
  color: var(--text-strong);
  font-family: inherit;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; }
textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: rgba(129,140,248,0.5);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.18);
}

button.primary, a.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 13px 22px;
  font-size: 0.98rem;
  font-weight: 600;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  letter-spacing: -0.005em;
  box-shadow: 0 8px 24px -8px rgba(99,102,241,0.55);
  transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
}
button.primary:hover:not(:disabled),
a.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 28px -8px rgba(99,102,241,0.65); filter: brightness(1.03); }
button.primary:active:not(:disabled) { transform: translateY(0); }
button.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

button.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 0.92rem;
  font-weight: 600;
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
button.secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: #c7d2fe;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #a5b4fc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.error {
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.4);
  color: #fecaca;
}

.hidden { display: none !important; }

.normalized-edit {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.7;
  resize: vertical;
}
.normalized-edit:focus { outline: 2px solid #818cf8; }

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #c7d2fe;
  font-size: 0.92rem;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #8b5cf6;
  cursor: pointer;
}

button.secondary {
  margin-top: 10px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  color: #e0e7ff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 10px;
  cursor: pointer;
}
button.secondary:hover { background: rgba(255,255,255,0.14); }
button.secondary:disabled { opacity: 0.5; cursor: not-allowed; }

details summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 8px;
  color: #e0e7ff;
}

.voice-controls {
  margin-top: 16px;
  padding: 14px 16px;
  background: rgba(0,0,0,0.18);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.voice-controls summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.voice-controls summary::-webkit-details-marker { display: none; }
.voice-controls summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--text-soft);
  transition: transform 0.15s;
}
.voice-controls[open] summary::before { transform: rotate(90deg); }

.controls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.control { display: flex; flex-direction: column; gap: 6px; }
.control.full { margin-top: 14px; }
.control label {
  font-size: 0.78rem;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.control select, .control textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.3);
  color: var(--text-strong);
  font-family: inherit;
  font-size: 0.95rem;
}
.control select:focus, .control textarea:focus {
  outline: none;
  border-color: rgba(129,140,248,0.5);
  box-shadow: 0 0 0 3px rgba(129,140,248,0.18);
}

.karaoke {
  margin-top: 16px;
  padding: 16px;
  background: rgba(0,0,0,0.25);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1.15rem;
  line-height: 2;
  max-height: 240px;
  overflow-y: auto;
}
.karaoke .kw {
  display: inline-block;
  padding: 2px 4px;
  border-radius: 6px;
  cursor: pointer;
  color: #c7d2fe;
  transition: background 0.1s, color 0.1s;
}
.karaoke .kw:hover { background: rgba(255,255,255,0.05); }
.karaoke .kw.active {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  font-weight: 600;
}

.anchor-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: rgba(139,92,246,0.10);
  border: 1px solid rgba(139,92,246,0.3);
  border-radius: 10px;
  margin-bottom: 12px;
}
.anchor-banner img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.anchor-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
}
.anchor-info strong { color: #c4b5fd; }
.anchor-info span { color: #cbd5e1; font-size: 0.82rem; }

.image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.image-card .image-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: #c7d2fe;
}
.comfy-status {
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
}
.comfy-status.ok { color: #86efac; }
.comfy-status.bad { color: #fca5a5; }

.image-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.image-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c7d2fe;
  font-size: 0.9rem;
}
.image-result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.image-result img {
  width: 100%;
  max-height: 600px;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(0,0,0,0.3);
}
.image-result .secondary {
  align-self: flex-start;
  text-decoration: none;
}

.divider {
  margin: 20px 0;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.scenes-result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.characters-box {
  background: rgba(99,102,241,0.08);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 10px;
  padding: 12px;
}
.characters-label {
  font-weight: 600;
  color: #c7d2fe;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.character-chip {
  font-size: 0.88rem;
  color: #e0e7ff;
  padding: 4px 0;
  line-height: 1.5;
}
.character-chip strong { color: #a5b4fc; }

.scene-card {
  background: rgba(0,0,0,0.2);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.scene-header {
  font-weight: 700;
  color: #a5b4fc;
  font-size: 0.95rem;
}
.scene-hindi {
  font-size: 0.95rem;
  color: #cbd5e1;
  font-style: italic;
}
.scene-prompt {
  font-size: 0.9rem;
  color: #e0e7ff;
  line-height: 1.5;
  background: rgba(0,0,0,0.2);
  padding: 8px 10px;
  border-radius: 6px;
}
.scene-card .secondary {
  align-self: flex-start;
  font-size: 0.85rem;
}

.player-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}
audio {
  flex: 1;
  min-width: 240px;
  border-radius: 999px;
  height: 42px;
}
audio::-webkit-media-controls-panel {
  background: rgba(255,255,255,0.04);
}
.download { margin-top: 0; }

/* ──────────────────────────────────────────────────────────────────────
 * Premium login page — only applied when <body class="login-body">.
 * Two-column on desktop, single column on mobile. Glass card + animated
 * gradient blobs for a "we charge real money" feel without being heavy.
 * ────────────────────────────────────────────────────────────────────── */
.login-body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Noto Sans Devanagari", sans-serif;
  background: #0b1020;
  color: #e2e8f0;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

.login-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(1100px 600px at 20% -10%, rgba(99,102,241,0.22), transparent 60%),
    radial-gradient(900px  600px at 90% 110%, rgba(244,114,182,0.18), transparent 60%),
    linear-gradient(180deg, #0b1020 0%, #0f172a 100%);
}
.login-bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.55;
  animation: blob-drift 22s ease-in-out infinite;
}
.blob-a { width: 420px; height: 420px; top: -120px; left: -80px;  background: #6366f1; }
.blob-b { width: 380px; height: 380px; bottom: -100px; right: -80px; background: #ec4899; animation-delay: -8s; }
.blob-c { width: 320px; height: 320px; top: 40%; left: 50%; transform: translate(-50%, -50%); background: #14b8a6; opacity: 0.25; animation-delay: -14s; }

@keyframes blob-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(40px, -30px) scale(1.08); }
}

.login-shell {
  position: relative;
  z-index: 1;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 64px;
  align-items: center;
  min-height: 100vh;
  box-sizing: border-box;
}

@media (max-width: 900px) {
  .login-shell {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px 20px;
  }
}

/* ─── Left column: brand + pitch ─── */
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
}
.login-brand-mark {
  font-size: 1.6rem;
  filter: drop-shadow(0 2px 8px rgba(99,102,241,0.4));
}
.login-brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  background: linear-gradient(135deg, #c7d2fe, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-brand-mobile { display: none; margin-bottom: 20px; }

@media (max-width: 900px) {
  .login-pitch .login-brand { display: none; }
  .login-brand-mobile { display: inline-flex; }
}

.login-headline {
  font-size: clamp(2rem, 4.2vw, 3.1rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #f8fafc;
  margin: 0 0 18px;
}
.login-headline .accent {
  background: linear-gradient(135deg, #818cf8, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.login-sub {
  font-size: 1.05rem;
  line-height: 1.55;
  color: #cbd5e1;
  margin: 0 0 32px;
  max-width: 520px;
}

.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
  max-width: 520px;
}
.login-features li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.login-features .feature-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 1.1rem;
}
.login-features strong {
  display: block;
  color: #e2e8f0;
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 2px;
}
.login-features small {
  color: #94a3b8;
  font-size: 0.85rem;
  line-height: 1.4;
}

/* ─── Right column: auth card ─── */
.login-auth { display: flex; justify-content: center; }

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04) inset;
}

.auth-card.auth-checking {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #cbd5e1;
  padding: 28px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #f8fafc;
}
.auth-subtitle {
  margin: 0 0 26px;
  color: #94a3b8;
  font-size: 0.92rem;
  line-height: 1.5;
}

.login-body .auth-google {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 18px;
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 22px -6px rgba(99,102,241,0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}
.login-body .auth-google:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(99,102,241,0.45);
  filter: brightness(1.02);
}
.login-body .auth-google:active:not(:disabled) { transform: translateY(0); }
.login-body .auth-google:disabled { opacity: 0.7; cursor: default; }

.auth-error {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.25);
  color: #fca5a5;
  font-size: 0.86rem;
  line-height: 1.4;
}

.auth-fine {
  margin: 22px 0 0;
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.55;
  text-align: center;
}

/* Login-page footer with links to legal/business pages. */
.login-footer {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 22px;
  padding: 24px 20px 36px;
  font-size: 0.82rem;
  color: #64748b;
}
.login-footer a {
  color: #94a3b8;
  text-decoration: none;
}
.login-footer a:hover { color: #c7d2fe; text-decoration: underline; }

/* "Your recent audios" card */
.my-audios-card details > summary { cursor: pointer; list-style: none; }
.my-audios-card details > summary::-webkit-details-marker { display: none; }
.my-audios-summary {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font-weight: 600; color: var(--text);
}
.my-audios-summary::before {
  content: '▸'; color: var(--text-soft); transition: transform 0.15s;
}
.my-audios-card details[open] .my-audios-summary::before { transform: rotate(90deg); }
.my-audios-hint { font-size: 0.78rem; }

.my-audios-list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.my-audio-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "meta     download"
    "player   player";
  gap: 8px 12px;
  align-items: center;
  padding: 12px 14px;
  background: rgba(0,0,0,0.22);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.my-audio-meta { grid-area: meta; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; min-width: 0; }
.my-audio-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.my-audio-row audio { grid-area: player; width: 100%; }
.my-audio-download { grid-area: download; text-decoration: none; font-size: 0.85rem; padding: 6px 12px; }

/* ──────────────────────────────────────────────────────────────────────
 * Public landing page — reuses .login-body background + blobs + brand,
 * adds nav, hero, features, pricing, FAQ, footer.
 * ──────────────────────────────────────────────────────────────────── */
.landing-nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px 0;
}
.landing-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}
.landing-nav-links a {
  color: var(--text-soft, #94a3b8);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
}
.landing-nav-links a:hover { color: #e2e8f0; }
.landing-nav-cta {
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #e2e8f0 !important;
  font-weight: 600 !important;
}
.landing-nav-cta:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 640px) {
  .landing-nav-links { gap: 16px; }
  .landing-nav-links a:not(.landing-nav-cta) { display: none; }
}

main { position: relative; z-index: 1; }

.landing-hero {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 28px 60px;
  text-align: center;
}
.landing-eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  padding: 5px 14px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c4b5fd;
  background: rgba(139,92,246,0.12);
  border: 1px solid rgba(139,92,246,0.25);
  border-radius: 999px;
}
.landing-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: #f8fafc;
}
.landing-hero .accent {
  background: linear-gradient(135deg, #818cf8, #f472b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.landing-sub {
  margin: 0 auto 32px;
  max-width: 620px;
  font-size: 1.08rem;
  line-height: 1.6;
  color: #cbd5e1;
}
.landing-cta-row {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.landing-cta-primary,
.landing-cta-secondary {
  display: inline-flex;
  align-items: center;
  padding: 13px 26px;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.1s, filter 0.15s, box-shadow 0.15s;
}
.landing-cta-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  box-shadow: 0 10px 24px -8px rgba(99,102,241,0.55);
}
.landing-cta-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.landing-cta-secondary {
  background: rgba(255,255,255,0.05);
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.1);
}
.landing-cta-secondary:hover { background: rgba(255,255,255,0.08); }
.landing-cta-fine { font-size: 0.85rem; color: #94a3b8; margin: 0; }

.landing-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 70px 28px;
}
.landing-section > h2 {
  font-size: clamp(1.7rem, 3.5vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: #f8fafc;
  margin: 0 0 8px;
  text-align: center;
}
.landing-section-sub {
  margin: 0 auto 36px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.98rem;
  max-width: 620px;
}

/* Features grid */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-top: 28px;
}
.landing-feature {
  padding: 24px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.landing-feature .feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  margin-bottom: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  font-size: 1.25rem;
}
.landing-feature h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f1f5f9;
}
.landing-feature p {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Pricing grid */
.landing-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 8px;
}
.pricing-card {
  position: relative;
  padding: 28px 22px;
  background: rgba(15,23,42,0.6);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pricing-card-featured {
  background: linear-gradient(180deg, rgba(99,102,241,0.18), rgba(15,23,42,0.6));
  border-color: rgba(139,92,246,0.45);
  box-shadow: 0 20px 50px -20px rgba(99,102,241,0.4);
}
.pricing-card-topup {
  background: linear-gradient(180deg, rgba(251,191,36,0.12), rgba(15,23,42,0.6));
  border-color: rgba(251,191,36,0.4);
}
.pricing-badge {
  position: absolute;
  top: 14px; right: 14px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #1e293b;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-radius: 999px;
}
.pricing-card h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
}
.pricing-price {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  color: #f8fafc;
  letter-spacing: -0.02em;
}
.pricing-price .muted { font-size: 0.95rem; font-weight: 500; color: #94a3b8; }
.pricing-tag {
  margin: 0 0 6px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 600;
}
.pricing-card ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pricing-card li {
  font-size: 0.92rem;
  color: #cbd5e1;
  padding-left: 22px;
  position: relative;
}
.pricing-card li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #818cf8;
  font-weight: 700;
}
.pricing-cta {
  margin-top: auto;
  display: inline-flex;
  justify-content: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white !important;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
}
.pricing-cta:hover { filter: brightness(1.05); }

/* How it works */
.landing-steps {
  list-style: none;
  padding: 0;
  margin: 32px auto 0;
  max-width: 720px;
  display: grid;
  gap: 18px;
  counter-reset: step;
}
.landing-steps li {
  position: relative;
  padding: 18px 18px 18px 64px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  counter-increment: step;
}
.landing-steps li::before {
  content: counter(step);
  position: absolute;
  left: 18px; top: 18px;
  width: 30px; height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.landing-steps strong { color: #f1f5f9; font-size: 1.02rem; }
.landing-steps p { margin: 4px 0 0; color: #94a3b8; font-size: 0.9rem; }

/* FAQ */
.landing-faq {
  max-width: 760px;
  margin: 28px auto 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.landing-faq details {
  padding: 16px 20px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
}
.landing-faq summary {
  cursor: pointer;
  font-weight: 600;
  color: #f1f5f9;
  list-style: none;
}
.landing-faq summary::-webkit-details-marker { display: none; }
.landing-faq summary::before {
  content: '+';
  display: inline-block;
  width: 22px;
  margin-right: 6px;
  color: #818cf8;
  font-weight: 700;
}
.landing-faq details[open] summary::before { content: '−'; }
.landing-faq p {
  margin: 12px 0 0;
  color: #cbd5e1;
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Final CTA */
.landing-final-cta {
  text-align: center;
  max-width: 720px;
}
.landing-final-cta p {
  color: #cbd5e1;
  font-size: 1.02rem;
  margin: 0 0 24px;
}

/* Footer */
.landing-footer {
  position: relative;
  z-index: 1;
  padding: 32px 28px 48px;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: #64748b;
  font-size: 0.85rem;
}
.landing-footer nav { display: flex; gap: 18px; }
.landing-footer a { color: #94a3b8; text-decoration: none; }
.landing-footer a:hover { color: #cbd5e1; }


/* ══════════════════════════════════════════════════════════════════════
 * Phase 3 — motion layer: entrance, micro-interactions, toasts, skeletons.
 * Everything here degrades to "no animation" under prefers-reduced-motion
 * (see the guard at the bottom). Purely additive — no existing rule moved.
 * ════════════════════════════════════════════════════════════════════ */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(8px) scale(0.96); }
}

/* Card entrance — plays when #appRoot un-hides after boot. Staggered so
 * the form, audios and result cards cascade in instead of popping. */
#appRoot:not(.hidden) > .card,
#appRoot:not(.hidden) > section {
  animation: fadeUp 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#appRoot:not(.hidden) > *:nth-child(2) { animation-delay: 0.04s; }
#appRoot:not(.hidden) > *:nth-child(3) { animation-delay: 0.10s; }
#appRoot:not(.hidden) > *:nth-child(4) { animation-delay: 0.16s; }
#appRoot:not(.hidden) > *:nth-child(5) { animation-delay: 0.22s; }

/* Upgrade picker slides in when shown. */
.upgrade-picker:not(.hidden) { animation: fadeUp 0.35s cubic-bezier(0.22,1,0.36,1) both; }

/* Micro-interactions — tactile press + smoother state changes. */
button.primary, button.secondary, .provider-btn, .user-upgrade {
  transition: transform 0.12s ease, filter 0.15s ease,
              box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
button.primary:active:not(:disabled),
button.secondary:active:not(:disabled),
.provider-btn:active { transform: scale(0.97); }
button.primary:not(:disabled):hover { box-shadow: 0 8px 24px -8px rgba(129,140,248,0.55); }

/* Result section reveal (audio player appears after generate). */
#resultSection:not(.hidden) { animation: fadeUp 0.45s cubic-bezier(0.22,1,0.36,1) both; }

/* ── Toasts ──────────────────────────────────────────────────────────── */
.toast-wrap {
  position: fixed;
  z-index: 9999;
  bottom: 22px; right: 22px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 13px 15px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 18px 40px -16px rgba(0,0,0,0.7);
  color: var(--text);
  font-size: 0.9rem; line-height: 1.45;
  animation: toastIn 0.32s cubic-bezier(0.22,1,0.36,1) both;
}
.toast.toast-hide { animation: toastOut 0.25s ease forwards; }
.toast::before { content: 'ℹ️'; font-size: 1.05rem; line-height: 1.3; }
.toast.toast-success { border-color: rgba(34,197,94,0.45); }
.toast.toast-success::before { content: '✅'; }
.toast.toast-error { border-color: rgba(239,68,68,0.5); }
.toast.toast-error::before { content: '⚠️'; }
.toast-msg { flex: 1; }
@media (max-width: 520px) {
  .toast-wrap { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ── Skeleton loaders ────────────────────────────────────────────────── */
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.09) 37%,
    rgba(255,255,255,0.04) 63%);
  background-size: 200% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.skeleton-row { height: 46px; margin-bottom: 10px; }

/* ── Scroll-reveal (landing) ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22,1,0.36,1),
              transform 0.6s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
.reveal.reveal-visible { opacity: 1; transform: translateY(0); }

/* ── Accessibility: honour reduced-motion ────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}


/* ══════════════════════════════════════════════════════════════════════
 * Premium visual theme (glow-up) — appended so it overrides base rules.
 * Tasteful, within the indigo/pink tokens. All infinite animations are
 * neutralised by the prefers-reduced-motion guard above.
 * ════════════════════════════════════════════════════════════════════ */

/* Brand title — flowing animated gradient + soft glow. */
.hero h1 {
  background: linear-gradient(110deg, #c7d2fe, #f9a8d4, #a5b4fc, #c7d2fe);
  background-size: 280% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandFlow 9s ease-in-out infinite;
  filter: drop-shadow(0 3px 22px rgba(129,140,248,0.22));
}
@keyframes brandFlow {
  0%, 100% { background-position: 0% center; }
  50%      { background-position: 100% center; }
}

/* Ambient background drifts slowly so the page feels alive, not static. */
body::before { animation: ambientDrift 30s ease-in-out infinite alternate; }
@keyframes ambientDrift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(-2%, 2%, 0) scale(1.08); }
}

/* Cards — indigo-tinted hairline + the active card lights up on focus. */
.card {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.card:focus-within {
  border-color: rgba(129,140,248,0.28);
  box-shadow:
    0 24px 56px -22px rgba(0,0,0,0.5),
    0 0 0 1px rgba(129,140,248,0.12) inset,
    0 0 36px -10px rgba(129,140,248,0.18);
}

/* The hero CTA — sheen sweep on hover, deeper gradient + glow. */
#generateBtn {
  width: 100%;
  margin-top: 18px;
  padding: 16px 24px;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #6366f1, #8b5cf6 55%, #d946ef);
  background-size: 180% auto;
  box-shadow: 0 12px 32px -10px rgba(124,58,237,0.6);
  position: relative;
  overflow: hidden;
  transition: background-position 0.5s ease, transform 0.12s, box-shadow 0.25s;
}
#generateBtn:hover:not(:disabled) {
  background-position: right center;
  box-shadow: 0 16px 40px -10px rgba(217,70,239,0.6);
}
#generateBtn::after {
  content: '';
  position: absolute; top: 0; left: -150%;
  width: 80%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.28), transparent);
  transform: skewX(-20deg);
  transition: left 0.65s ease;
  pointer-events: none;
}
#generateBtn:hover:not(:disabled)::after { left: 160%; }

/* Provider toggle — premium segmented control with a glowing active pill. */
.prov-btn, .llm-btn {
  transition: background 0.25s cubic-bezier(0.22,1,0.36,1),
              color 0.25s, box-shadow 0.25s, transform 0.12s;
}
.prov-btn.active, .llm-btn.active {
  box-shadow: 0 4px 16px -2px rgba(99,102,241,0.55);
}
.prov-btn:active, .llm-btn:active { transform: scale(0.96); }

/* Upgrade CTA gently pulses to draw the eye (paid conversion). */
.user-upgrade:not(:disabled) { animation: upgradePulse 2.6s ease-in-out infinite; }
@keyframes upgradePulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(239,68,68,0.25); }
  50%      { box-shadow: 0 3px 20px rgba(239,68,68,0.55); }
}

/* Audio player + result row — cleaner, full-width, themed. */
#audioPlayer {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(0,0,0,0.3);
}
.player-row {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.player-row #audioPlayer { flex: 1; min-width: 220px; }

/* Inputs — smoother all-round transition for the focus glow. */
textarea, input[type="text"], input[type="email"],
input[type="password"], select {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
textarea:focus, input:focus, select:focus {
  background: rgba(0,0,0,0.34);
}

/* Live character counter under the script box (plan-aware limit). */
.char-counter {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin: 7px 4px 0;
  text-align: right;
  transition: color 0.2s ease;
}
.char-counter.at-limit { color: #fbbf24; font-weight: 600; }
.char-counter .cc-upgrade {
  color: var(--accent);
  cursor: pointer;
  text-decoration: underline;
  margin-left: 8px;
}
