@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,400..800&family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');

:root {
  --bg: #060911;
  --bg-card: rgba(13, 19, 33, 0.75);
  --bg-card-hover: rgba(22, 32, 54, 0.85);
  --bg-input: rgba(8, 12, 22, 0.9);
  --border: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(59, 130, 246, 0.4);
  --border-focus: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --brand: #1a56db;
  --brand-light: #3b82f6;
  --brand-cyan: #06b6d4;
  --brand-glow: rgba(26, 86, 219, 0.35);
  --brand-gradient: linear-gradient(135deg, #1a56db 0%, #3b82f6 50%, #06b6d4 100%);
  --ok: #10b981;
  --ok-bg: rgba(16, 185, 129, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-headline: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

html, body {
  min-height: 100%;
  min-height: -webkit-fill-available;
  background-color: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(26, 86, 219, 0.35), transparent),
    radial-gradient(circle at 85% 35%, rgba(6, 182, 212, 0.14), transparent 50%),
    radial-gradient(circle at 15% 70%, rgba(59, 130, 246, 0.12), transparent 50%),
    var(--bg);
  background-attachment: fixed;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  max-width: 1240px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 20px 80px;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .page {
    padding: 12px 14px 60px;
  }
}

/* Header Navbar */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 36px;
  padding: 12px 24px;
  background: rgba(13, 19, 33, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
  width: 100%;
}

@media (max-width: 768px) {
  .top {
    flex-direction: column;
    align-items: stretch;
    border-radius: var(--radius-lg);
    gap: 12px;
    padding: 14px 18px;
    margin-bottom: 24px;
  }
}

.brand {
  font-family: var(--font-headline);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 2px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.brand span {
  color: var(--brand-light);
}

.top nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .top nav {
    justify-content: center;
    gap: 4px;
  }
}

.top nav a {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.top nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.top nav a.nav-active {
  color: #fff;
  background: rgba(26, 86, 219, 0.28);
  border: 1px solid rgba(59, 130, 246, 0.4);
  box-shadow: 0 4px 12px rgba(26, 86, 219, 0.2);
}

/* Mobile Tabs Switcher */
.mobile-tabs {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: rgba(13, 19, 33, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  width: 100%;
}

@media (max-width: 992px) {
  .mobile-tabs {
    display: grid;
  }
}

.tab-btn {
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.tab-btn.active {
  color: #fff;
  background: var(--brand-gradient);
  box-shadow: 0 4px 14px var(--brand-glow);
}

/* Hero Section */
.hero {
  margin-bottom: 32px;
  max-width: 780px;
  width: 100%;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-light);
  background: rgba(26, 86, 219, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 16px;
  border-radius: 999px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(26, 86, 219, 0.2);
  backdrop-filter: blur(10px);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-cyan);
  box-shadow: 0 0 10px var(--brand-cyan);
  animation: pulse-dot 2s infinite ease-in-out;
}

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

h1 {
  font-family: var(--font-headline);
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  margin-bottom: 14px;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 70%, #60a5fa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede {
  color: var(--text-secondary);
  font-size: 1.12rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.hero-points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-points li {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 16px;
  backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Layout Grid - minmax(0, 1fr) fixes CSS Grid overflow bug */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 28px;
  align-items: start;
  width: 100%;
}

@media (max-width: 992px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

/* Card Styling */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 30px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: border-color 0.2s ease;
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 640px) {
  .card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }
}

.card h2 {
  font-family: var(--font-headline);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Auth Banner & User Row */
.auth-banner {
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-banner p {
  font-size: 0.95rem;
  color: #fca5a5;
}

.user-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.pill {
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.15);
}
.pill-warn {
  background: rgba(248, 113, 113, 0.15) !important;
  color: #fca5a5 !important;
  border-color: rgba(248, 113, 113, 0.45) !important;
  box-shadow: none !important;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.user-row {
  flex-wrap: wrap;
}
.user-row-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.user-row-right {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.money-hint {
  opacity: 0.7;
  font-size: 0.8rem;
}

.credits-low {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}
.credits-low p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 520px;
}

.render-paywall {
  margin: 12px 0;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.4);
  background: rgba(168, 85, 247, 0.1);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}
.btn.needs-credits {
  opacity: 0.95;
  background: linear-gradient(135deg, #7c3aed, #a855f7) !important;
}

.purchase-toast {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  font-weight: 600;
}

.credits-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  padding: 16px;
}
.credits-modal.hidden { display: none !important; }
.credits-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}
.credits-modal-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  background: #0e121c;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px 20px 18px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}
.credits-modal-card h2 {
  margin: 0 0 6px;
  font-size: 1.35rem;
}
.credits-modal-x {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #a1a1aa;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}
.credit-packs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 16px;
}
@media (max-width: 640px) {
  .credit-packs { grid-template-columns: 1fr; }
}
.credit-pack {
  position: relative;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 14px 12px;
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.15s, transform 0.15s;
}
.credit-pack:hover {
  border-color: rgba(99, 102, 241, 0.6);
  transform: translateY(-1px);
}
.credit-pack.best {
  border-color: rgba(99, 102, 241, 0.7);
  background: rgba(99, 102, 241, 0.12);
}
.cp-badge {
  position: absolute;
  top: -9px;
  right: 10px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #6366f1;
  color: #fff;
  padding: 3px 8px;
  border-radius: 999px;
}
.cp-name { display: block; font-size: 0.75rem; opacity: 0.7; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.cp-credits { display: block; font-size: 1.15rem; font-weight: 800; margin: 4px 0 2px; }
.cp-price { display: block; font-size: 1.05rem; font-weight: 700; color: #a5b4fc; }
.cp-note { display: block; font-size: 0.72rem; opacity: 0.6; margin-top: 6px; }
.checkout-status { color: #a5b4fc; margin-top: 12px; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.result-actions .btn { flex: 1 1 auto; text-align: center; min-width: 120px; }

/* keep original pill block continuation if any */
}

/* Form Fields */
.field {
  display: block;
  margin-bottom: 24px;
  width: 100%;
}

.label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-headline);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.label em {
  font-family: var(--font-body);
  font-style: normal;
  color: var(--brand-light);
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.82rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 3px 10px;
  border-radius: 999px;
}

/* Inputs - font-size 16px prevents iOS Safari auto-zoom */
input[type="url"],
input[type="text"],
select.select-input,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 15px 18px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: all 0.2s ease;
  resize: vertical;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

select.select-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  cursor: pointer;
}

input[type="url"]:focus,
input[type="text"]:focus,
select.select-input:focus,
textarea:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25), inset 0 2px 4px rgba(0,0,0,0.2);
  background: rgba(6, 9, 17, 0.95);
}

.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.linkish {
  background: none;
  border: none;
  color: var(--brand-light);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.linkish:hover {
  color: #60a5fa;
  text-decoration: underline;
}

.btn-clear-sm {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-clear-sm:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.55);
}

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

/* Scrape Box */
.scrape-box {
  margin: 16px 0 22px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: rgba(13, 19, 33, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.scrape-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.scrape-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: #000;
  border: 1px solid var(--border);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.scrape-box h3 {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.scrape-meta {
  color: var(--brand-light);
  font-size: 0.9rem;
  font-weight: 700;
}

.scrape-box ul {
  margin: 14px 0 0 22px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.scrape-box ul li {
  margin-bottom: 6px;
}

.scrape-box blockquote {
  margin-top: 14px;
  padding: 12px 16px;
  border-left: 3px solid var(--brand-light);
  color: #e2e8f0;
  font-size: 0.9rem;
  font-style: italic;
  background: rgba(26, 86, 219, 0.15);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

/* Style Chips */
.chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
  width: 100%;
}

.chip {
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.8);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.chip:hover {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-1px);
}

.chip.active {
  color: #fff;
  background: var(--brand-gradient);
  border-color: transparent;
  box-shadow: 0 6px 20px var(--brand-glow);
  transform: translateY(-1px);
}

/* Dropzones */
.drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  min-height: 160px;
  display: grid;
  place-items: center;
  text-align: center;
  cursor: pointer;
  background: rgba(8, 12, 22, 0.6);
  overflow: hidden;
  transition: all 0.2s ease;
  padding: 24px 16px;
}

.drop:hover, .drop.drag {
  border-color: var(--brand-light);
  background: rgba(26, 86, 219, 0.12);
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.2);
}

.drop strong {
  display: block;
  font-family: var(--font-headline);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.drop span {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.drop img, .drop video {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  background: #000;
  border-radius: var(--radius-md);
  display: block;
}

.drop-sm {
  min-height: 96px;
  padding: 16px;
}

.preview-audio {
  padding: 16px;
  text-align: center;
  color: var(--text-primary);
}

.preview-audio strong {
  font-family: var(--font-headline);
  color: var(--brand-light);
  margin-bottom: 4px;
}

/* Duration Range Slider */
.duration-field input[type="range"] {
  width: 100%;
  accent-color: var(--brand-light);
  cursor: pointer;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.duration-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
}

/* Toggles */
.toggles {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 14px 0 22px;
  padding: 16px 20px;
  background: rgba(8, 12, 22, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle input {
  width: 20px;
  height: 20px;
  accent-color: var(--brand-light);
  cursor: pointer;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-headline);
  font-weight: 700;
  cursor: pointer;
  padding: 16px 24px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-align: center;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn.primary {
  background: var(--brand-gradient);
  color: #fff;
  box-shadow: 0 10px 30px var(--brand-glow);
}

.btn.primary:hover:not(:disabled) {
  filter: brightness(1.15);
  box-shadow: 0 14px 36px rgba(26, 86, 219, 0.55);
  transform: translateY(-2px);
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn.secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn.big {
  width: 100%;
  padding: 20px 24px;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  border-radius: var(--radius-lg);
}

.btn.tiny {
  padding: 6px 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn.tiny:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.15);
}

.btn.full {
  width: 100%;
  margin-top: 12px;
}

.fine {
  font-size: 0.82rem;
  margin-top: 14px;
  text-align: center;
  color: var(--text-muted);
}

/* Progress & Error */
.progress {
  margin-top: 22px;
}

.bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--brand-cyan));
  transition: width 0.35s ease;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.6);
}

#progress-text {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
  font-weight: 600;
}

.error {
  margin-top: 18px;
  color: #fca5a5;
  font-size: 0.92rem;
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.35);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
}

/* Preview Studio Column & Header */
.preview-card {
  position: sticky;
  top: 24px;
}

@media (max-width: 992px) {
  .preview-card {
    position: static;
  }
}

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

.status-badge {
  font-family: var(--font-headline);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ok-bg);
  color: var(--ok);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* iPhone 16 Pro Phone Frame Mockup */
.phone {
  position: relative;
  width: min(320px, 100%);
  margin: 0 auto 24px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 44px;
  border: 5px solid #1e293b;
  overflow: hidden;
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.15),
    0 0 50px rgba(26, 86, 219, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.phone:hover {
  transform: translateY(-3px);
  box-shadow:
    0 35px 90px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.25),
    0 0 60px rgba(59, 130, 246, 0.4);
}

.phone-notch {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 36%;
  height: 24px;
  background: #090d16;
  border-radius: 999px;
  z-index: 5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.6);
}

.phone video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.phone-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  background: radial-gradient(circle at 50% 50%, rgba(26, 86, 219, 0.22), transparent 80%);
}

.placeholder-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(26, 86, 219, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: grid;
  place-items: center;
  box-shadow: 0 0 24px rgba(26, 86, 219, 0.2);
}

.placeholder-icon svg {
  width: 32px;
  height: 32px;
  color: var(--brand-light);
}

.placeholder-title {
  font-family: var(--font-headline);
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

/* Captions & Script Box */
.caption-box, .script-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.caption-box h3, .script-box h3 {
  font-family: var(--font-headline);
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.caption-block {
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.caption-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.caption-k {
  font-family: var(--font-headline);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-light);
}

.caption-v {
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-primary);
  word-break: break-word;
}

.caption-v.tags {
  color: var(--brand-cyan);
  font-weight: 600;
}

.script-box p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: rgba(8, 12, 22, 0.8);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius-lg);
}

/* History List */
.history-box {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.history-title {
  font-family: var(--font-headline);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-weight: 700;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: rgba(8, 12, 22, 0.75);
  color: var(--text-primary);
  font-family: var(--font-body);
  transition: all 0.2s ease;
}

.history-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex: 1;
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 6px 4px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.history-item-content:hover {
  color: var(--brand-light);
}

.history-item-del {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.history-item-del:hover {
  background: rgba(239, 68, 68, 0.28);
  color: #fff;
  border-color: rgba(239, 68, 68, 0.55);
  transform: scale(1.06);
}

.history-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item-meta {
  font-size: 0.78rem;
  color: var(--ok);
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  background: var(--ok-bg);
  padding: 3px 10px;
  border-radius: 6px;
}

/* Tips Section */
.how {
  margin-top: 32px;
}

.how ol {
  margin-left: 22px;
  color: var(--text-secondary);
}

.how li {
  margin-bottom: 12px;
  line-height: 1.65;
}

.how strong {
  color: var(--text-primary);
  font-family: var(--font-headline);
}

/* Footer */
footer {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.9rem;
}

footer a {
  color: var(--brand-light);
  font-weight: 600;
}

footer a:hover {
  text-decoration: underline;
}

.hidden {
  display: none !important;
}

/* ── Wizard (v5) ─────────────────────────────────────── */
.wizard-steps {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
}
.wizard-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}
.wizard-steps li span {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.06);
}
.wizard-steps li.on {
  color: var(--text-primary);
  border-color: rgba(59,130,246,0.45);
  background: rgba(26,86,219,0.15);
}
.wizard-steps li.on span {
  background: var(--brand);
  color: #fff;
}
.wizard-steps li.done {
  color: var(--ok);
  border-color: rgba(16,185,129,0.35);
}
.step-panel { display: none; }
.step-panel.on { display: block; }
.step-title {
  font-family: var(--font-headline);
  font-size: 1.25rem;
  margin-bottom: 6px;
}
.step-lede {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 18px;
  line-height: 1.5;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.btn.sm { padding: 8px 14px; font-size: 0.88rem; }
.btn.big { width: 100%; padding: 16px; font-size: 1.05rem; }
.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}
.btn.primary {
  background: var(--brand-gradient);
  color: #fff;
  border: none;
  font-weight: 700;
  border-radius: var(--radius-md);
  padding: 12px 18px;
  cursor: pointer;
}
.btn.primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
}
.drop.multi {
  min-height: 100px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
}
.drop.multi.drag { border-color: var(--brand-light); background: rgba(59,130,246,0.08); }
.image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.image-thumbs img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
}
.recent-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.recent-item {
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--text-primary);
  cursor: pointer;
}
.recent-item img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
}
.env-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
.env-col img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}
.research-box {
  margin: 14px 0;
  padding: 14px;
  border-radius: 12px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.25);
}
.research-box h3 { font-size: 0.95rem; margin-bottom: 8px; }
.research-angle { color: var(--text-primary); font-weight: 600; margin-bottom: 10px; line-height: 1.45; }
.research-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}
.research-box ul { margin: 4px 0 10px 18px; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.45; }
@media (max-width: 700px) {
  .research-grid { grid-template-columns: 1fr; }
}
#script-edit {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.55;
  resize: vertical;
}
.voice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.voice-card {
  text-align: left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,0.25);
  color: var(--text-primary);
  cursor: pointer;
}
.voice-card strong { display: block; font-size: 0.9rem; margin-bottom: 4px; }
.voice-card span { font-size: 0.8rem; color: var(--text-muted); }
.voice-card.active {
  border-color: var(--brand-light);
  background: rgba(26,86,219,0.18);
}
.voice-player { width: 100%; margin: 10px 0 14px; }
.checklist {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}
.checklist li {
  padding: 8px 0 8px 28px;
  position: relative;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.checklist li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: var(--text-muted);
}
.checklist li.ok { color: var(--ok); }
.checklist li.ok::before { content: '✓'; color: var(--ok); }
.alt-packs { margin: 12px 0; }
.alt-pack {
  padding: 10px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  margin-bottom: 8px;
  font-size: 0.88rem;
}
.cap-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 10px 0 4px;
}
@media (max-width: 700px) {
  .env-compare, .voice-grid { grid-template-columns: 1fr; }
  .wizard-steps li { font-size: 0.72rem; padding: 6px 8px; }
}

/* Deliverables Bar */
.deliverables-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  margin: 16px auto 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.deliverables-bar span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}

/* Step Header & Clear Control */
.step-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
}
.btn-clear-sm {
  background: rgba(239, 68, 68, 0.1);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-clear-sm:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fff;
}

/* Step Hints */
.step-hint {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.2s ease;
}
.step-hint.ready {
  color: var(--ok);
  font-weight: 500;
}

/* Word Count Indicators */
.wc-ok { color: var(--ok); font-weight: 500; }
.wc-warn { color: #f59e0b; font-weight: 600; }
.wc-note { color: var(--text-secondary); }

/* Copy Toast Feedback */
.copied {
  color: var(--ok) !important;
  font-weight: 700 !important;
}

/* Multi-image + B-roll thumbs */
.image-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0a0e16;
}
.thumb-wrap img,
.thumb-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.thumb-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.broll-badge {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(59, 130, 246, 0.9);
  color: #fff;
  padding: 2px 5px;
  border-radius: 4px;
}
.checklist li.ok {
  color: var(--ok);
}
