/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #050a10;
  --bg2:       #0d1117;
  --card:      #1f2024;
  --card2:     #18181b;
  --card3:     #25262b;
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.10);
  --text:      #f7f7f8;
  --muted:     rgba(255,255,255,0.55);
  --muted2:    rgba(255,255,255,0.35);
  --red:       #ef4444;
  --red-light: #fca5a5;
  --red-dark:  #dc2626;
  --red-glow:  rgba(239,68,68,0.15);
  --red-border:rgba(239,68,68,0.25);
  --sidebar-w: 380px;
  --navbar-h:  64px;
  --radius-sm: 12px;
  --radius:    16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

html { height: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
  overflow-x: hidden;
}

/* RTL support */
[dir="rtl"] { text-align: right; }

/* Navbar RTL — DOM swapped by JS; flip grid so navbar__left keeps the wide column */
[dir="rtl"] .navbar__inner { grid-template-columns: auto 1fr; }
[dir="rtl"] .navbar__left  { flex-direction: row-reverse; }
[dir="rtl"] .navbar__right { flex-direction: row-reverse; }
[dir="rtl"] .nav__links { flex-direction: row-reverse; }
[dir="rtl"] .credits-pill { flex-direction: row-reverse; }
[dir="rtl"] .credits-pill__left { flex-direction: row-reverse; }

/* Dropdown opens on the correct side in RTL */
[dir="rtl"] .user-dropdown { right: auto; left: 0; }

/* Mobile menu RTL */
[dir="rtl"] .mobile-menu__credits { flex-direction: row-reverse; }

[dir="rtl"] .sidebar { border-right: none; border-left: 1px solid var(--border); }
[dir="rtl"] .plan__feature--on::before,
[dir="rtl"] .plan__feature--off::before { margin-right: 0; margin-left: 8px; }

/* ── UTILITY ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hide-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }

/* ── NAVBAR ── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--navbar-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  width: 100%;
}
.navbar__inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 100%;
  padding: 0 12px;
  gap: 8px;
}
@media (min-width: 768px) { .navbar__inner { padding: 0 32px; gap: 16px; } }

.navbar__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.navbar__left::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .navbar__left { gap: 12px; } }

.navbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text);
  transition: color .2s;
}
.brand:hover { color: #fca5a5; }
.brand__logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(239,68,68,0.3);
}
.brand__name {
  font-size: 15px;
  font-weight: 700;
  display: none;
}
@media (min-width: 400px) { .brand__name { display: inline; } }

/* Nav links */
.nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  flex-shrink: 0;
}
#nav-pricing { display: none; }
@media (min-width: 768px) { #nav-pricing { display: inline-flex; } }
.nav__link {
  display: inline-flex;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  color: rgba(255,255,255,0.7);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.nav__link:hover { background: rgba(255,255,255,0.05); color: #fca5a5; }
.nav__link--active { color: var(--text); }
@media (min-width: 768px) { .nav__link { padding: 6px 16px; font-size: 15px; } }

/* Credits pill */
.credits-pill {
  display: none;
  align-items: stretch;
  overflow: hidden;
  border-radius: 999px;
  background: var(--card2);
}
@media (min-width: 768px) { .credits-pill { display: flex; } }
.credits-pill__left {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: linear-gradient(95deg, rgba(185,28,28,0.4), rgba(239,68,68,0.28));
  box-shadow: inset 0 0 8px rgba(255,255,255,0.08);
  color: #fecaca;
  font-size: 13px;
  font-weight: 600;
  min-width: 80px;
  justify-content: center;
}
.credits-pill__upgrade {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fca5a5;
  text-decoration: none;
  transition: opacity .15s;
}
.credits-pill__upgrade:hover { opacity: .8; }

/* Hide lang + login on mobile — they move into the mobile menu */
.btn-lang { display: none; }
@media (min-width: 768px) { .btn-lang { display: flex; } }
.user-menu-wrap { display: block; }

/* Lang / menu buttons */
.btn-lang {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--card2);
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-lang:hover { background: var(--card3); color: var(--text); }

.btn-login {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  text-decoration: none;
  flex-shrink: 0;
  transition: background .15s, opacity .1s;
  box-shadow: 0 2px 8px rgba(239,68,68,0.35), inset 0 2px 3px rgba(255,255,255,0.15);
}
.btn-login:hover { background: #dc2626; }
.btn-login:active { opacity: .8; }
@media (max-width: 767px) { .btn-login { display: none !important; } }

.btn-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border2);
  background: var(--card2);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  transition: background .15s;
}
.btn-menu:hover { background: var(--card3); }
@media (min-width: 768px) { .btn-menu { display: none; } }

/* Mobile menu */
.mobile-menu {
  display: none;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: absolute;
  top: var(--navbar-h);
  left: 0; right: 0;
  z-index: 50;
}
.mobile-menu.open { display: flex; }
.mobile-menu__credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-sm);
  background: var(--card2);
  padding: 10px 14px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
}
.mobile-menu__credits strong { color: #fca5a5; font-size: 14px; }
.mobile-menu__upgrade {
  display: block;
  text-align: center;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.15);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fca5a5;
  text-decoration: none;
  transition: background .15s;
}
.mobile-menu__upgrade:hover { background: rgba(239,68,68,0.25); }
.mobile-menu__link { display: block; padding: 11px 16px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.8); text-decoration: none; border-radius: var(--radius-sm); background: none; border: none; width: 100%; text-align: left; cursor: pointer; transition: background .12s, color .12s; }
.mobile-menu__link:hover { background: rgba(255,255,255,0.06); color: #fff; }
.mobile-menu__link--danger { color: #fca5a5; }
.mobile-menu__link--danger:hover { background: rgba(239,68,68,0.1); }
.mobile-menu__divider { height: 1px; background: rgba(255,255,255,0.07); margin: 6px 0; }

/* ── WORKSPACE ── */
.workspace {
  display: flex;
  height: calc(100dvh - var(--navbar-h));
  max-height: calc(100dvh - var(--navbar-h));
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--bg);
  overflow: hidden;
}

/* Mobile: sidebar is scrollable top, output below */
@media (max-width: 767px) {
  .workspace {
    flex-direction: column;
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .sidebar {
    max-height: 70dvh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .output {
    min-height: 50vh;
    flex: none;
  }
}

@media (min-width: 768px) {
  .sidebar {
    width: var(--sidebar-w);
    min-width: 320px;
    max-width: var(--sidebar-w);
    flex-shrink: 0;
  }
}

.sidebar__scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: none;
}
.sidebar__scroll::-webkit-scrollbar { display: none; }

.sidebar__footer {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}

.video-generating-message {
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--red-border);
  border-radius: var(--radius-sm);
  text-align: center;
}

.video-generating-message p {
  font-size: 13px;
  color: var(--red-light);
  margin: 0;
  font-weight: 500;
}

/* ── BANNER CARD ── */
.banner-card {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  aspect-ratio: 2.3 / 1;
  padding: 12px;
}
.banner-card__bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(185,28,28,0.35) 0%, rgba(13,5,5,0.9) 60%, var(--bg) 100%);
}
.banner-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.banner-card__caption {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
}
.banner-card__title {
  font-size: clamp(14px, 3vw, 20px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: rgba(252,165,165,0.92);
}
.banner-card__sub {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
}

/* ── STEP TABS ── */
.step-tabs {
  display: flex;
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 4px;
  gap: 4px;
}
.step-tab {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  transition: background .15s, color .15s;
}
.step-tab:hover { color: rgba(255,255,255,0.75); }
.step-tab--active {
  background: rgba(239,68,68,0.2);
  color: #fca5a5;
}

/* ── MODEL CHIP ── */
.model-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 12px;
}
.model-chip__icon {
  width: 36px; height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.2);
  display: flex; align-items: center; justify-content: center;
  color: #ef4444;
}
.model-chip__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.model-chip__name {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.model-chip__desc {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}

/* ── UPLOAD GROUP & ZONES ── */
.upload-group { display: flex; flex-direction: column; gap: 6px; }

#panel-1, #panel-2 {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#panel-1[hidden], #panel-2[hidden] { display: none; }

/* Hide sidebar and show only output when generating */
.page.generating .sidebar { display: none !important; }
.page.generating .main { max-width: 100%; }
.page.generating #output-grid { display: flex !important; min-height: 100vh; }

.field-label {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}
.field-hint {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  margin-top: -2px;
}

.upload-zone {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 2px dashed var(--red-border);
  background: var(--card);
  cursor: pointer;
  outline: none;
  transition: border-color .2s, background .2s;
  overflow: hidden;
}
.upload-zone:hover, .upload-zone:focus-visible {
  border-color: rgba(239,68,68,0.55);
  background: rgba(239,68,68,0.04);
}
.upload-zone.dragover {
  border-color: var(--red);
  background: rgba(239,68,68,0.08);
}
.upload-zone__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 16px;
}
.upload-zone__icon { color: rgba(255,255,255,0.3); }
.upload-zone__title {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.upload-zone__sub {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  text-align: center;
}
.upload-zone__paste {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  text-align: center;
}
.upload-zone__actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

/* Preview state */
.upload-zone .preview-wrap {
  position: relative;
  width: 100%;
}
.upload-zone .preview-wrap img,
.upload-zone .preview-wrap video {
  width: 100%;
  display: block;
  border-radius: calc(var(--radius-lg) - 2px);
  aspect-ratio: 4/3;
  object-fit: cover;
}
.preview-change {
  position: absolute;
  top: 8px;
  right: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  border: none;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.preview-change:hover { background: rgba(0,0,0,0.85); }

/* ── PROMPT BLOCK ── */
.prompt-block {
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px;
}
.prompt-block__inner {
  position: relative;
}
.prompt-block textarea {
  width: 100%;
  min-height: 90px;
  max-height: 400px;
  resize: vertical;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  padding: 8px 8px 28px;
  caret-color: #fff;
}
.prompt-block textarea::placeholder { color: rgba(255,255,255,0.3); }
.prompt-block__count {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  pointer-events: none;
  text-align: right;
}
.prompt-block__tip {
  margin-top: 6px;
  padding: 0 8px 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.5;
  color: rgba(255,255,255,0.38);
}

/* ── INSERT EXAMPLE BUTTON ── */
.insert-example-btn {
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 9px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background .15s, color .15s;
}
[dir="rtl"] .insert-example-btn { text-align: right; }
.insert-example-btn:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.88); }

/* ── REFERENCE IMAGE COUNT ── */
.ref-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
  font-variant-numeric: tabular-nums;
}
[dir="rtl"] .ref-count { margin-left: 0; margin-right: auto; }

/* Paste hint inside upload zone */
.upload-zone__paste-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.28);
  text-align: center;
  margin-top: -4px;
}

/* ── VISUAL RATIO GRID ── */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.ratio-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 68px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.ratio-btn:hover {
  background: rgba(255,255,255,0.04);
}
.ratio-btn--active {
  border-color: rgba(255,255,255,0.3);
  color: var(--text);
}
/* Platform preset buttons */
.platform-btn {
  height: auto;
  padding: 10px 6px;
  background: rgba(255,255,255,0.03);
  border: 1.5px solid rgba(255,255,255,0.07);
  gap: 5px;
}
.platform-btn:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
  color: white;
}
.platform-btn.ratio-btn--active {
  background: rgba(239,68,68,0.12);
  border-color: #ef4444;
  color: white;
}
.platform-btn__name {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
}
.platform-btn__ratio {
  font-size: 9px;
  opacity: 0.5;
  line-height: 1;
}

/* ── SETTINGS BLOCK ADDITIONS ── */
.settings-block__sep {
  height: 1px;
  background: rgba(255,255,255,0.06);
  margin: 10px 0;
}
.settings-block__hint {
  margin-top: 8px;
  padding: 0 2px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.4);
}

/* ── REFERENCE ITEMS (numbered, alias, reorder) ── */
.ref-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 2px;
}
.ref-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 8px;
}
.ref-item__thumb-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
}
.ref-item__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ref-item__num {
  position: absolute;
  bottom: 3px;
  left: 3px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  border-radius: 4px;
  padding: 2px 5px;
}
.ref-item__remove {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: none;
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ref-item__controls {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  justify-content: center;
}
.ref-item__alias-row {
  display: flex;
  gap: 5px;
  align-items: center;
}
.ref-item__alias-input {
  flex: 1;
  min-width: 0;
  height: 30px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 0 8px;
  outline: none;
}
.ref-item__alias-input::placeholder { color: rgba(255,255,255,0.3); }
.ref-item__alias-input:focus { border-color: rgba(255,255,255,0.3); }
.ref-item__at-btn {
  flex-shrink: 0;
  height: 30px;
  padding: 0 10px;
  background: rgba(239,68,68,0.15);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 7px;
  color: #ef4444;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.ref-item__at-btn:hover { background: rgba(239,68,68,0.28); }
.ref-item__order-row {
  display: flex;
  gap: 5px;
}
.ref-item__order-btn {
  height: 24px;
  padding: 0 8px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
  color: rgba(255,255,255,0.7);
  font-size: 11px;
  cursor: pointer;
  transition: background .15s;
}
.ref-item__order-btn:hover { background: rgba(255,255,255,0.12); color: #fff; }
.ref-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  color: rgba(255,255,255,0.45);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 2px;
  transition: border-color .15s, color .15s;
}
.ref-add-btn:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.8); }

/* ── old thumbnail classes kept for safety ── */
.ref-thumbs-row { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 2px; }
.ref-thumb { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(255,255,255,0.1); }
.ref-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-thumb__remove { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.7); border: none; color: #fff; font-size: 14px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
[dir="rtl"] .ref-thumb__remove { right: auto; left: 3px; }
.ref-thumb--add { display: flex; align-items: center; justify-content: center; font-size: 24px; color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.04); border: 1px dashed rgba(255,255,255,0.2); cursor: pointer; border-radius: 8px; }
.ref-thumb--add:hover { border-color: rgba(255,255,255,0.4); color: rgba(255,255,255,0.7); }

/* ── PROMO VIDEO CARD ── */
.promo-card {
  position: relative;
  width: 100%;
  aspect-ratio: 2.3 / 1;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.10);
  padding: 0;
  margin: 0 0 8px;
  display: block;
  background: #000;
}
.promo-card__media {
  position: absolute;
  inset: 0;
}
.promo-card__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.promo-card__overlay {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.55) 100%);
}
.promo-card__caption {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  max-width: min(100%, 18rem);
  padding-right: 8px;
}
[dir="rtl"] .promo-card__caption { left: auto; right: 12px; padding-right: 0; padding-left: 8px; }
.promo-card__title {
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.1;
  color: rgba(239,68,68,0.9);
}
.promo-card__sub {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255,255,255,0.55);
  text-shadow: 0 1px 8px rgba(0,0,0,0.9);
  max-width: 15rem;
}

/* ── COMPACT UPLOAD ZONE (Video page) ── */
.upload-zone--compact {
  border: none;
  background: var(--card);
}
.upload-zone--compact:hover,
.upload-zone--compact:focus-visible {
  background: #25262b;
  border: none;
}
.upload-zone--compact .upload-zone__inner {
  padding: 28px 16px 24px;
}
.upload-zone__heading {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-top: 4px;
}

/* Pill upload button */
.btn-upload-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #2e2f35;
  border: none;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
  margin-top: 4px;
}
.btn-upload-pill:hover { background: #3d3e43; }

/* Field label row (label + tooltip icon) */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.field-label-row .field-label { margin-bottom: 0; }
.field-tooltip {
  display: inline-flex;
  align-items: center;
  color: rgba(255,255,255,0.3);
  cursor: help;
  flex-shrink: 0;
}
.field-tooltip:hover { color: rgba(255,255,255,0.55); }

/* Settings block */
.settings-block {
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 10px;
}
.settings-block--gap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-block__label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  margin-bottom: 8px;
  padding-left: 2px;
}

/* Toggle row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 10px;
  background: #18181b;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
}
.toggle-row span {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
}
.toggle-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #ef4444;
  cursor: pointer;
  flex-shrink: 0;
}

/* Upload button */
.btn-upload {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #2e2f35;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.btn-upload:hover { background: #3d3e43; }

/* Record button */
.btn-record {
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #2e2f35;
  border: none;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: background .15s;
}
.btn-record:hover { background: rgba(239,68,68,0.18); color: #fca5a5; }
.btn-record.recording {
  background: #ef4444;
  animation: pulse-glow 2s ease-in-out infinite;
}
.record-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #ef4444;
  transition: background .15s;
  flex-shrink: 0;
}
.btn-record.recording .record-dot {
  background: white;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
@keyframes pulse-glow {
  0%,100%{ box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
  50%{ box-shadow: 0 0 16px 4px rgba(239,68,68,0.18); }
}

/* ── TEXTAREA ── */
.textarea-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.07);
}
.textarea-wrap textarea {
  width: 100%;
  min-height: 80px;
  max-height: 200px;
  resize: vertical;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 8px 24px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  font-family: inherit;
  scrollbar-width: none;
}
.textarea-wrap textarea::placeholder { color: rgba(255,255,255,0.3); }
.char-count {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

/* ── CARD BLOCK ── */
.card-block {
  border-radius: var(--radius-lg);
  background: var(--card);
  padding: 8px;
  border: 1px solid rgba(255,255,255,0.07);
}

/* ── ASPECT RATIO GRID ── */
.aspect-grid {
  display: grid;
  grid-template-columns: repeat(5,1fr);
  gap: 6px;
}
.aspect-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 74px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-size: 11px;
  font-weight: 600;
}
.aspect-btn:hover { background: rgba(255,255,255,0.04); }
.aspect-btn--active {
  border-color: rgba(239,68,68,0.5);
  background: rgba(239,68,68,0.08);
  color: var(--text);
}
.aspect-preview {
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--card);
}
.aspect-btn--active .aspect-preview { border-color: rgba(252,165,165,0.5); }

/* ── OUTPUTS / PILL GROUP ── */
.outputs-row {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.setting-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  margin-bottom: 8px;
  padding: 0 4px;
}
.hint-text {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  padding: 0 4px;
  margin-top: 8px;
}
.pill-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  border-radius: 999px;
  background: var(--card2);
  padding: 4px;
}
.pill-group--full { flex-wrap: nowrap; }
.pill-btn {
  width: 46px;
  border-radius: 999px;
  padding: 8px 4px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #a0a1a3;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.pill-btn:hover { background: #3a3b3f; color: var(--text); }
.pill-btn--active { background: rgba(255,255,255,0.07); color: var(--text); }
.pill-btn--flex { flex: 1; width: auto; }

/* ── GENERATE BUTTON ── */
.btn-generate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 56px;
  border-radius: var(--radius-sm);
  border: none;
  background: rgba(239,68,68,0.88);
  font-size: 15px;
  font-weight: 700;
  color: white;
  cursor: pointer;
  box-shadow: inset 0 -3px rgba(0,0,0,0.25), 0 2px 8px rgba(239,68,68,0.3);
  transition: background .15s, transform .1s, opacity .15s;
}
.btn-generate:hover { background: #ef4444; }
.btn-generate:active { transform: scale(0.98); }
.btn-generate:disabled { opacity: .5; cursor: not-allowed; }
.btn-generate__star { flex-shrink: 0; }
.btn-generate__spinner {
  width: 20px; height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.gen-status {
  font-size: .75rem;
  color: rgba(255,255,255,0.6);
  margin-top: 6px;
  text-align: center;
}

/* ── OUTPUT AREA ── */
.output {
  position: relative;
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}
.output__glow {
  pointer-events: none;
  position: absolute;
  inset: 0;
  opacity: 0.28;
  background: radial-gradient(circle at 50% 40%, rgba(220,38,38,0.12), transparent 55%);
}
.output__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow: hidden;
}
.output__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  flex-shrink: 0;
}
.output__title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.btn-clear {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  background: none;
  border: none;
  cursor: pointer;
  transition: color .15s;
}
.btn-clear:hover { color: rgba(255,255,255,0.65); }

.output__grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.output__grid::-webkit-scrollbar { display: none; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 24px;
  gap: 12px;
}
.empty-state__icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--card);
  display: flex; align-items: center; justify-content: center;
  color: rgba(239,68,68,0.4);
}
.empty-state__icon--generating {
  color: #ef4444;
  background: rgba(239,68,68,0.08);
  animation: pulse-glow 2s ease-in-out infinite;
}
.empty-state__icon--generating svg {
  animation: spin-logo 3s linear infinite;
}
@keyframes spin-logo {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0.12); }
}
.empty-state__title {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
}
.empty-state__sub {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  max-width: 260px;
}

/* ── HISTORY GRID ── */
.history-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  padding-bottom: 8px;
}

.history-item {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 9/16;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s;
  background: var(--card);
  flex: 0 0 calc(50% - 5px);
}
@media (min-width: 500px) { .history-item { flex: 0 0 calc(33.333% - 7px); } }
@media (min-width: 900px) { .history-item { flex: 0 0 calc(25% - 8px); } }
.history-item:hover, .history-item--selected { border-color: rgba(239,68,68,0.6); }
.history-item img,
.history-item video {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.history-item__badge {
  position: absolute;
  bottom: 6px; right: 6px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
}

/* ── PAGE SWITCHING ── */
body.page--generate .hero,
body.page--generate #pricing,
body.page--generate #faq,
body.page--generate .footer { display: none !important; }

body.page--generate {
  overflow: hidden;
  height: 100dvh;
}

body.page--home #generate { display: none !important; }

#nav-home.nav__link--active,
#nav-image.nav__link--active,
#nav-video.nav__link--active { color: var(--text); }

/* ── STEP SECTION HEADERS ── */
.step-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border-left: 3px solid #ef4444;
}
[dir="rtl"] .step-section-header { border-left: none; border-right: 3px solid #ef4444; }
.step-section-header__badge {
  font-size: 22px;
  font-weight: 900;
  color: #ef4444;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  min-width: 28px;
  letter-spacing: -0.03em;
}
.step-section-header__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.step-section-header__info strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.step-section-header__info span {
  font-size: 11px;
  color: rgba(255,255,255,0.45);
}

/* ── FAQ ── */
.faq {
  background: var(--bg);
  padding: 0 16px 64px;
}
@media (min-width: 768px) { .faq { padding: 0 32px 64px; } }
.faq__container { max-width: 900px; margin: 0 auto; }
.faq__header { text-align: center; margin-bottom: 32px; }
.faq__title {
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
  color: var(--text);
}
.faq__sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
}
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq__item {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
.faq__q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: background .15s;
}
[dir="rtl"] .faq__q { text-align: right; }
.faq__q:hover { background: rgba(255,255,255,0.03); }
.faq__q[aria-expanded="true"] { color: #fca5a5; }
.faq__chevron {
  flex-shrink: 0;
  color: rgba(255,255,255,0.4);
  transition: transform .2s;
}
.faq__q[aria-expanded="true"] .faq__chevron {
  transform: rotate(180deg);
  color: #ef4444;
}
.faq__a {
  padding: 0 18px 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  border-top: 1px solid rgba(255,255,255,0.05);
  padding-top: 12px;
}
.faq__a[hidden] { display: none; }

/* ── HERO ── */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  padding: 56px 16px 32px;
}
@media (min-width: 768px) { .hero { padding: 72px 32px 40px; } }

.hero__inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.hero__headline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.hero__brand {
  font-size: clamp(36px, 8vw, 72px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #ef4444;
  text-transform: uppercase;
}

.hero__title-line {
  font-size: clamp(18px, 4vw, 32px);
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero__sub {
  font-size: clamp(13px, 2vw, 16px);
  color: rgba(255,255,255,0.5);
  max-width: 520px;
  line-height: 1.6;
}

/* Model badges row */
.hero__models {
  width: 100%;
  max-width: 600px;
}
.hero__models-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border2);
  background: var(--card2);
  padding: 12px 16px;
}
.hero__model-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  padding: 2px 4px;
}
.hero__model-badge svg { flex-shrink: 0; }

/* Feature cards */
.hero__cards-wrap {
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 24px 16px 8px;
  cursor: grab;
  display: flex;
  justify-content: center;
}
.hero__cards-wrap::-webkit-scrollbar { display: none; }
.hero__cards-wrap:active { cursor: grabbing; }

.hero__cards {
  list-style: none;
  display: flex;
  gap: 16px;
  width: max-content;
  padding: 0;
}
@media (max-width: 768px) { .hero__cards { padding: 0 0 0 0; } }

.hero__card {
  width: 360px;
  flex-shrink: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
  transition: border-color .2s, transform .2s;
}
.hero__card:hover {
  border-color: rgba(239,68,68,0.35);
  transform: translateY(-2px);
}
.hero__card-link {
  display: block;
  text-decoration: none;
  color: var(--text);
}
.hero__card-media {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.hero__card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__card-info {
  padding: 14px 16px 16px;
}
.hero__card-info h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text);
  margin-bottom: 4px;
}
.hero__card-info p {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
  line-height: 1.4;
}

/* CTA button */
.hero__cta {
  padding: 8px 0 0;
  text-align: center;
}
.hero__cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: #ef4444;
  color: white;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 32px;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(239,68,68,0.3);
  transition: background .15s, transform .1s;
}
.hero__cta-btn:hover { background: #dc2626; transform: translateY(-1px); }
.hero__cta-btn:active { transform: scale(0.98); }

/* ── PRICING ── */
.pricing {
  background: var(--bg);
  padding: 40px 16px 64px;
}
@media (min-width: 768px) { .pricing { padding: 40px 32px 64px; } }

.section-divider {
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.1), transparent);
  margin-bottom: 40px;
}

.pricing__inner { max-width: 1152px; margin: 0 auto; }

/* Header */
.pricing__header {
  text-align: center;
  margin-bottom: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.pricing__title {
  font-size: clamp(2rem, 4.6vw, 3.15rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}
.pricing__title em {
  color: #ef4444;
  font-style: italic;
}
.pricing__sub {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
  max-width: 42ch;
}
@media (min-width: 768px) { .pricing__sub { font-size: 16px; } }

/* Toggles row */
.pricing__toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding-top: 8px;
}

/* Billing toggle */
.billing-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 20px;
}
.billing-label {
  min-width: 4.5rem;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: color .15s;
}
.billing-label--dim { color: rgba(255,255,255,0.45); }
.billing-switch {
  position: relative;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  border: none;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: background .2s;
}
.billing-switch[aria-checked="true"] { background: rgba(239,68,68,0.3); }
.billing-switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.35);
  transition: transform .2s;
}
.billing-switch[aria-checked="true"] .billing-switch__knob { transform: translateX(20px); }
.billing-save-badge {
  border-radius: 8px;
  background: #ef4444;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: white;
}

/* Currency toggle */
.currency-toggle {
  display: flex;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  padding: 4px;
  gap: 4px;
}
.currency-btn {
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.45);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.currency-btn:hover { color: rgba(255,255,255,0.75); }
.currency-btn--active {
  background: rgba(255,255,255,0.12);
  color: var(--text);
}

/* Plans grid */
.plans-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (min-width: 640px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .plans-grid { grid-template-columns: repeat(4, 1fr); } }

/* Plan card */
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  overflow: visible;
}
.plan-card--featured { background: rgba(255,255,255,0.05); }

/* Badges */
.plan-badge {
  position: absolute;
  top: 0;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.plan-badge--popular {
  right: 14px;
  background: #ef4444;
  color: white;
}
.plan-badge--save {
  left: 14px;
  background: rgba(52,211,153,0.15);
  color: #a7f3d0;
  font-weight: 700;
}

.plan-card__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  padding-top: 28px;
  height: 100%;
}
@media (min-width: 768px) { .plan-card__content { padding: 24px; padding-top: 28px; } }

.plan-card__head { display: flex; flex-direction: column; gap: 8px; }

.plan-card__name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.plan-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 6px;
}
.plan-card__amount {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.plan-card__price-meta {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  padding-bottom: 4px;
}
.plan-card__currency {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
}
.plan-card__period {
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
}
.plan-card__billing-note {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
}
.plan-card__for {
  display: inline-flex;
  border-radius: 6px;
  background: rgba(255,255,255,0.07);
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.55);
  width: fit-content;
}

/* Plan CTA */
.plan-card__cta {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
.plan-card__cta:hover:not(:disabled) { background: rgba(255,255,255,0.11); }
.plan-card__cta--popular {
  background: #ef4444;
  color: white;
  box-shadow: inset 0px -3px rgba(0,0,0,0.25);
}
.plan-card__cta--popular:hover:not(:disabled) { background: #dc2626; }
.plan-card__cta:disabled { cursor: not-allowed; opacity: .45; }

/* Features list */
.plan-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-card__features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.plan-check {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(239,68,68,0.9);
}
.plan-card__features li strong {
  font-size: 14px;
  line-height: 1.35;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}
.plan-card__features li span {
  font-size: 14px;
  line-height: 1.35;
  color: rgba(255,255,255,0.65);
}

/* Top-ups */
.topups {
  margin-top: 56px;
}
.topups__head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.topups__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
@media (min-width: 768px) { .topups__title { font-size: 24px; } }
.topups__sub {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  max-width: 56ch;
}
.topups__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 768px) { .topups__grid { grid-template-columns: repeat(3, 1fr); } }

.topup-card {
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  padding: 20px;
}
.topup-card__label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255,255,255,0.45);
}
.topup-card__price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 4px 6px;
  margin-top: 12px;
}
.topup-card__amount {
  font-size: 30px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.topup-card__unit {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  padding-bottom: 4px;
}
.topup-card__currency { font-weight: 500; }
.topup-card__credits {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.topup-card__btn {
  display: block;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: not-allowed;
  opacity: .45;
  margin-top: auto;
  padding: 0;
}

/* ── FOOTER ── */
.footer {
  width: 100%;
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 24px 16px;
}
.footer__inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
}
@media (min-width: 640px) { .footer__inner { flex-direction: row; } }
.footer__links { display: flex; gap: 16px; }
.footer__links a {
  color: rgba(255,255,255,0.35);
  text-decoration: none;
  transition: color .15s;
}
.footer__links a:hover { color: rgba(255,255,255,0.65); }

/* ── LIGHTBOX ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none; }
.lightbox__content {
  position: relative;
  max-width: 480px;
  width: 100%;
}
.lightbox__content img,
.lightbox__content video {
  width: 100%;
  border-radius: var(--radius-xl);
  display: block;
}
.lightbox__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.lightbox__close:hover { background: var(--card3); color: var(--text); }
.lightbox__download {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: var(--radius-sm);
  background: rgba(239,68,68,0.18);
  padding: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fca5a5;
  text-decoration: none;
  transition: background .15s;
}
.lightbox__download:hover { background: rgba(239,68,68,0.3); }

/* ── CURRENCY TOGGLE layout fix ── */
.currency-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 24px;
}


/* ── AUTH MODAL ── */
.modal-backdrop[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-modal {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}
.auth-modal__close {
  position: absolute;
  top: 14px; right: 14px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: none;
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.auth-modal__close:hover { background: rgba(255,255,255,0.15); }
.auth-tabs {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.auth-tab {
  flex: 1;
  border: none;
  border-radius: 8px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  background: transparent;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab--active {
  background: var(--card3);
  color: var(--text);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.auth-field label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.auth-field input {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
  width: 100%;
}
.auth-field input:focus { border-color: rgba(239,68,68,0.5); }
.auth-error {
  font-size: 13px;
  color: #fca5a5;
  background: rgba(239,68,68,0.1);
  border-radius: 8px;
  padding: 8px 12px;
}
.auth-submit {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  width: 100%;
}
.auth-submit:hover { background: #dc2626; }
.auth-submit:disabled { opacity: .5; cursor: not-allowed; }
#google-signin-btn { border: 1px solid rgba(255,255,255,0.12); border-radius: 999px; overflow: hidden; }
.pay-method-btn { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.03); color: #f7f7f8; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .12s, border-color .12s; text-align: left; margin-bottom: 6px; }
.pay-method-btn:last-child { margin-bottom: 0; }
.pay-method-btn:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.18); }
.pay-method-btn__icon { width: 40px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 18px; background: rgba(255,255,255,0.06); }
.auth-user-menu { display: flex; flex-direction: column; gap: 12px; }
.auth-user-info { border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.auth-user-name { font-weight: 700; font-size: 15px; }
.auth-user-email { font-size: 12px; color: var(--muted); margin-top: 2px; }
.auth-user-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
}
.auth-user-credits strong { font-size: 18px; }
.auth-buy-btn {
  background: #ef4444;
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
  width: 100%;
}
.auth-buy-btn:hover { background: #dc2626; }
.auth-logout-btn {
  background: transparent;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .15s, color .15s;
  width: 100%;
}
.auth-logout-btn:hover { border-color: rgba(239,68,68,0.4); color: #fca5a5; }
.auth-admin-link {
  text-align: center;
  font-size: 12px;
  color: #fca5a5;
  text-decoration: none;
  padding: 6px;
}
.auth-admin-link:hover { text-decoration: underline; }

/* ── CREDIT PACKS ── */
.packs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-bottom: 32px;
}
@media (min-width: 640px) { .packs-grid { grid-template-columns: repeat(3, 1fr); } }

.pack-card {
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  transition: border-color .2s;
}
.pack-card:hover { border-color: rgba(239,68,68,0.3); }
.pack-card--featured {
  border-color: rgba(239,68,68,0.5);
  background: linear-gradient(160deg, var(--card), rgba(239,68,68,0.06));
}
.pack-badge {
  position: absolute;
  top: -12px; left: 50%;
  transform: translateX(-50%);
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.pack-card__name {
  font-size: 18px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -.02em;
}
.pack-card__for { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pack-card__price-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.pack-card__amount {
  font-size: 40px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}
.pack-card__currency {
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  padding-bottom: 6px;
}
.pack-card__credits { font-size: 14px; color: var(--muted); }
.pack-card__save {
  display: inline-block;
  background: rgba(34,197,94,0.15);
  color: #4ade80;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
}
.pack-card__features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}
.pack-card__features em { font-style: normal; color: rgba(255,255,255,0.4); }
.pack-card__cta {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.25);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, color .15s;
  width: 100%;
}
.pack-card__cta:hover { background: rgba(239,68,68,0.25); color: white; }
.pack-card__cta--featured {
  background: #ef4444;
  color: white;
  border-color: transparent;
}
.pack-card__cta--featured:hover { background: #dc2626; }

/* Credit breakdown */
.credit-breakdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: var(--card2);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.credit-breakdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
}
.credit-breakdown__icon { font-size: 20px; }
.credit-breakdown__sep {
  width: 1px; height: 28px;
  background: var(--border2);
}

/* Payment methods */
.payment-methods {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.payment-methods__label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.payment-methods__icons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.payment-method-badge {
  background: var(--card2);
  border: 1px solid var(--border2);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.6);
}

/* btn-login label */
.btn-login {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  width: auto;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  height: 36px;
}

/* ── USER DROPDOWN ── */
.user-menu-wrap { position: relative; }
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: #1a1d23;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 100;
}
.user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.user-dropdown__item:hover { background: rgba(255,255,255,0.07); color: #fff; }
.user-dropdown__item--danger { color: #fca5a5; }
.user-dropdown__item--danger:hover { background: rgba(239,68,68,0.12); color: #ef4444; }
.user-dropdown__divider { height: 1px; background: rgba(255,255,255,0.07); margin: 4px 0; }

/* ── VIDEO COST PREVIEW ── */
.video-cost-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #fca5a5;
  margin: 0 16px;
}
.video-cost-preview[hidden] { display: none; }
.video-cost-preview__icon { font-size: 16px; }
