:root {
  --bg: #0e1014;
  --bg-elev: #151920;
  --panel: #1a1f29;
  --panel-2: #222936;
  --text: #eef1f6;
  --muted: #8b95a8;
  --faint: #5c6678;
  --accent: #6ec8c0;
  --accent-dim: rgba(110, 200, 192, 0.14);
  --accent-strong: #4db8ae;
  --warn: #d4a017;
  --danger: #e06b6b;
  --ok: #5ecf8e;
  --border: #2a3344;
  --radius: 14px;
  --font: "DM Sans", system-ui, sans-serif;
  --font-fa: "Vazirmatn", "DM Sans", system-ui, sans-serif;
  --display: "Syne", "DM Sans", sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.atmosphere {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 12% -8%, rgba(110, 200, 192, 0.12), transparent 55%),
    radial-gradient(700px 400px at 90% 10%, rgba(80, 120, 180, 0.1), transparent 50%),
    linear-gradient(180deg, #12151c 0%, var(--bg) 40%);
}
.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
}

.hidden { display: none !important; }

.brand-mark {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.65rem;
  margin: 0;
  background: linear-gradient(120deg, #fff 20%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-mark.sm { font-size: 1.15rem; }

/* ── Auth ── */
.auth-view {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem 1.25rem;
  animation: fadeIn 0.5s ease;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: var(--shadow);
}

.auth-title {
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0.6rem 0 0.35rem;
}
.auth-sub { margin: 0 0 1.5rem; color: var(--muted); font-size: 0.95rem; line-height: 1.45; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  background: var(--bg-elev);
  padding: 0.3rem;
  border-radius: 999px;
  margin-bottom: 1.25rem;
}
.auth-tab {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.auth-tab.active {
  background: var(--panel-2);
  color: var(--text);
}

.auth-form label,
.composer-form label,
.advanced label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.auth-form label + label { margin-top: 0.85rem; }

input, textarea, select {
  font: inherit;
  color: var(--text);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 0.85rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { resize: vertical; min-height: 2.5rem; }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.btn {
  font: inherit;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 10px;
  padding: 0.7rem 1.1rem;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s, border-color 0.15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-strong), #3a9e96);
  border-color: transparent;
  color: #061312;
}
.btn.ghost { background: transparent; }
.btn.sm { padding: 0.4rem 0.7rem; font-size: 0.8rem; }
.btn.block { width: 100%; }
.auth-form .btn { width: 100%; margin-top: 1.15rem; }

.auth-foot {
  margin: 1.25rem 0 0;
  font-size: 0.8rem;
  color: var(--faint);
  text-align: center;
}
.auth-foot a { color: var(--accent); }

.status { margin: 0.75rem 0 0; font-size: 0.88rem; color: var(--muted); min-height: 1.2em; }
.status.err { color: var(--danger); }
.status.busy { color: var(--accent); }
.status.ok { color: var(--ok); }

/* ── App shell ── */
.app-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
  animation: fadeIn 0.4s ease;
}

.sidebar {
  display: flex;
  flex-direction: column;
  background: rgba(21, 25, 32, 0.92);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(12px);
  padding: 1.1rem 0.9rem;
  gap: 0.85rem;
  max-height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-top { display: flex; flex-direction: column; gap: 0.85rem; }
.sidebar-brand { padding: 0.25rem 0.35rem; }

.session-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding-right: 0.15rem;
}

.session-item {
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.88rem;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.session-item:hover { background: var(--panel); color: var(--text); }
.session-item.active {
  background: var(--accent-dim);
  border-color: rgba(110, 200, 192, 0.35);
  color: var(--text);
}
.session-item .meta {
  display: block;
  font-size: 0.72rem;
  color: var(--faint);
  margin-top: 0.2rem;
}

.sidebar-bottom {
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.queue-pill {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  text-align: center;
}
.queue-pill.busy { color: var(--accent); border-color: rgba(110, 200, 192, 0.4); animation: pulse 1.6s ease infinite; }

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.user-email {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.health-row { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.dot-badge {
  font-size: 0.68rem;
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
}
.dot-badge.ok { color: var(--ok); border-color: rgba(94, 207, 142, 0.35); }

.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-height: 100vh;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(14, 16, 20, 0.65);
  backdrop-filter: blur(8px);
}
.title-edit {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}
.session-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.session-title-input {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.6rem;
}
.locked-video {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(110, 200, 192, 0.35);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(110, 200, 192, 0.08), rgba(26, 31, 41, 0.9));
}
.locked-video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.75rem;
}
.locked-badge {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #061312;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.locked-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.locked-dur { font-size: 0.8rem; color: var(--muted); }
.locked-video-player {
  width: 100%;
  max-height: 200px;
  border-radius: 8px;
  background: #000;
}

.mobile-only { display: none; }

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.empty-state {
  margin: auto;
  text-align: center;
  max-width: 380px;
  padding: 2rem 1rem;
  animation: fadeUp 0.55s ease;
}
.empty-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.empty-state h3 {
  font-family: var(--display);
  font-size: 1.45rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.empty-state p { color: var(--muted); margin: 0; line-height: 1.5; }

.turn-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.1rem 1.35rem;
  animation: fadeUp 0.35s ease;
}
.turn-card::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 1.4rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  box-shadow: 0 0 0 3px var(--panel);
}
.turn-card.gen-odd {
  border-left-color: var(--accent-strong);
}
.turn-card.gen-odd::before { background: var(--accent); }
.turn-card.gen-even {
  border-left-color: #7aa2e3;
}
.turn-card.gen-even::before { background: #7aa2e3; }
.turn-card.queued, .turn-card.running {
  border-color: rgba(110, 200, 192, 0.35);
  border-left-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent-dim);
}
.gen-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.35rem;
}
.turn-card.gen-even .gen-badge { color: #9bb8ea; }
.turn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.75rem;
}
.chip {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}
.turn-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.85rem;
}
.turn-meta { font-size: 0.78rem; color: var(--faint); }
.turn-status {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.turn-status.queued, .turn-status.running {
  color: var(--accent);
  border-color: rgba(110, 200, 192, 0.4);
  animation: pulse 1.6s ease infinite;
}
.turn-status.completed { color: var(--ok); border-color: rgba(94, 207, 142, 0.4); }
.turn-status.failed { color: var(--danger); border-color: rgba(224, 107, 107, 0.4); }

.prompt-preview {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}
.prompt-preview .field {
  background: var(--bg-elev);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
  line-height: 1.4;
}
.prompt-preview .field strong {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.prompt-preview .field.empty { color: var(--faint); font-style: italic; }

.eta-line {
  font-size: 0.9rem;
  color: var(--accent);
  margin: 0.4rem 0 0.8rem;
  font-weight: 600;
}

.gen-progress {
  margin: 0.5rem 0 0.85rem;
}
.gen-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.gen-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #7ec8ff);
  transition: width 0.6s ease;
}
.gen-progress .eta-line {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}
.gen-duration {
  margin: 0.55rem 0 0;
  font-size: 0.88rem;
  color: var(--muted, #9aa3ad);
  font-weight: 500;
}

.turn-media video, .turn-media audio {
  width: 100%;
  max-height: 320px;
  border-radius: 10px;
  background: #000;
  margin-top: 0.5rem;
}
.downloads {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}
.downloads a {
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.downloads a:hover { text-decoration: underline; }

.err-box {
  color: var(--danger);
  background: rgba(224, 107, 107, 0.08);
  border: 1px solid rgba(224, 107, 107, 0.25);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  font-size: 0.88rem;
}

/* ── Composer ── */
.composer {
  border-top: 1px solid var(--border);
  background: rgba(21, 25, 32, 0.95);
  padding: 1rem 1.5rem 1.25rem;
  backdrop-filter: blur(10px);
}

.composer-grid { display: flex; flex-direction: column; gap: 0.85rem; }

.prompt-fields {
  display: grid;
  gap: 0.65rem;
}
.prompt-fields label span em {
  font-style: normal;
  font-weight: 500;
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0;
  margin-left: 0.35rem;
}
.prompt-fields label span {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.chunk-editor {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  background: var(--bg-elev);
  display: grid;
  grid-template-columns: minmax(160px, 240px) 1fr;
  gap: 0.85rem 1rem;
  align-items: start;
}
.chunk-editor-head {
  grid-column: 1 / -1;
}
.chunk-editor h4 {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text);
  font-weight: 700;
}
.chunk-preview {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}
.chunk-preview-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: #000;
  border-radius: 8px;
  border: 1px solid var(--border);
}
.chunk-preview-caption {
  margin: 0;
  font-size: 0.72rem;
  color: var(--faint);
  font-weight: 500;
}
.chunk-replay { align-self: start; }
.chunk-fields {
  display: grid;
  gap: 0.55rem;
  min-width: 0;
}
#singlePreview {
  margin-bottom: 0.75rem;
}
#singlePreview .chunk-preview {
  max-width: 360px;
}
@media (max-width: 720px) {
  .chunk-editor {
    grid-template-columns: 1fr;
  }
  #singlePreview .chunk-preview {
    max-width: none;
  }
}

.hint { margin: 0.35rem 0 0; font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.warn-text { color: var(--warn); }

.advanced {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--bg-elev);
}
.advanced summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
}
.advanced .row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.composer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.9rem;
}
.composer-actions .status { margin: 0; flex: 1; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* Admin invites */
.admin-pane {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 2rem;
}
.admin-card {
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  animation: fadeUp 0.35s ease;
}
.admin-heading {
  font-family: var(--display);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.invite-create {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0 0.5rem;
}
.invite-create .btn { justify-self: start; margin-top: 0.25rem; }
.invite-list { display: flex; flex-direction: column; gap: 0.65rem; margin-top: 1rem; }
.invite-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
}
.invite-row .code {
  font-family: ui-monospace, monospace;
  font-weight: 700;
  color: var(--accent);
  word-break: break-all;
}
.invite-row .meta { font-size: 0.78rem; color: var(--faint); margin-top: 0.25rem; }
.invite-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: flex-end; }
.invite-row.disabled .code { color: var(--faint); text-decoration: line-through; }

/* Licenses page (standalone) */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.header h1 {
  font-family: var(--display);
  margin: 0 0 0.35rem;
  letter-spacing: -0.02em;
}
.sub { margin: 0 0 1rem; color: var(--muted); }
.sub a { color: var(--accent); }
.badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--muted);
}
.badge.warn { color: var(--warn); border-color: #5a4a1a; }
.form, .result {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.form h2 { font-family: var(--display); font-size: 1.1rem; }
.form ul { color: var(--muted); line-height: 1.55; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(300px, 86vw);
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .advanced .row { grid-template-columns: 1fr; }
  .composer-actions { flex-direction: column; align-items: stretch; }
}

/* ── Landing page ── */
html { scroll-behavior: smooth; }
[dir="rtl"] body { font-family: var(--font-fa); }
[dir="rtl"] .hero-headline,
[dir="rtl"] .section-title,
[dir="rtl"] .example-head h3,
[dir="rtl"] .guide-step h3 {
  font-family: var(--font-fa);
  letter-spacing: 0;
}

.landing {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1.5rem;
  background: rgba(14, 16, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(42, 51, 68, 0.85);
  animation: fadeIn 0.45s ease;
}
.landing-nav .nav-brand {
  text-decoration: none;
  flex-shrink: 0;
}
.nav-links {
  display: flex;
  gap: 1.25rem;
  margin-inline-start: 1.5rem;
  flex: 1;
}
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-inline-start: auto;
}
.lang-toggle {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem;
  gap: 0.1rem;
}
.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.lang-btn.active {
  background: var(--panel-2);
  color: var(--text);
}
.nav-cta { text-decoration: none; }

.hero {
  position: relative;
  min-height: calc(100vh - 64px);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 3rem 1.5rem 4rem;
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.60;
  filter: saturate(0.9) contrast(1.05);
}
.hero-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(14, 16, 20, 0.42) 0%, rgba(14, 16, 20, 0.82) 70%, var(--bg) 100%),
    radial-gradient(ellipse at 30% 40%, rgba(110, 200, 192, 0.12), transparent 55%);
}
.hero-content {
  position: relative;
  z-index: 1;
  max-width: 720px;
  text-align: center;
  animation: fadeUp 0.7s ease;
}
.hero-brand {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  margin: 0 0 0.75rem;
}
.hero-headline {
  font-family: var(--display);
  font-size: clamp(1.55rem, 3.5vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  color: var(--text);
}
.hero-sub {
  margin: 0 auto 1.75rem;
  max-width: 34rem;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.hero-ctas .btn { text-decoration: none; min-width: 9rem; }

.landing-section {
  padding: 4.5rem 1.5rem;
}
.section-inner {
  max-width: 1080px;
  margin: 0 auto;
}
.section-kicker {
  margin: 0 0 0.4rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
}
.section-sub {
  margin: 0 0 2.5rem;
  max-width: 40rem;
  color: var(--muted);
  line-height: 1.5;
}

.guide-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  counter-reset: none;
}
.guide-step {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: start;
  padding: 1.15rem 1.25rem;
  border-inline-start: 2px solid var(--accent-dim);
  background: linear-gradient(90deg, rgba(110, 200, 192, 0.04), transparent 60%);
  animation: fadeUp 0.55s ease both;
}
.guide-step:nth-child(1) { animation-delay: 0.02s; }
.guide-step:nth-child(2) { animation-delay: 0.05s; }
.guide-step:nth-child(3) { animation-delay: 0.08s; }
.guide-step:nth-child(4) { animation-delay: 0.11s; }
.guide-step:nth-child(5) { animation-delay: 0.14s; }
.guide-step:nth-child(6) { animation-delay: 0.17s; }
.guide-step:nth-child(7) { animation-delay: 0.2s; }
.guide-step:nth-child(8) { animation-delay: 0.23s; }
.step-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.guide-step h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.guide-step p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.95rem;
}
[dir="rtl"] .guide-step {
  border-inline-start: none;
  border-inline-end: 2px solid var(--accent-dim);
  background: linear-gradient(270deg, rgba(110, 200, 192, 0.04), transparent 60%);
}

.examples-section { background: rgba(0, 0, 0, 0.18); }
.example-case {
  margin-bottom: 3.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid var(--border);
}
.example-case:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.example-head {
  margin-bottom: 1.25rem;
}
.example-head h3 {
  font-family: var(--display);
  font-size: 1.35rem;
  margin: 0 0 0.4rem;
  letter-spacing: -0.02em;
}
.example-head > p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  max-width: 42rem;
  line-height: 1.5;
}
.example-note {
  font-size: 0.85rem !important;
  color: var(--accent) !important;
  margin-bottom: 0.85rem !important;
}

.ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ab-pane {
  margin: 0;
}
.ab-pane figcaption {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.45rem;
}
.ab-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}

.prompt-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1.15rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.prompt-panel.multi {
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.prompt-window h4 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--accent);
}
.prompt-field .prompt-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 0.3rem;
}
.prompt-field p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  /* Prompt bodies are English technical text — keep LTR even on FA pages */
  direction: ltr;
  text-align: start;
  unicode-bidi: isolate;
}

.demo-gallery {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  gap: 1.1rem;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.demo-card {
  margin: 0;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.demo-card video {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
  aspect-ratio: 16 / 9;
  object-fit: contain;
}
.demo-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.demo-card strong {
  font-size: 0.95rem;
}
.demo-card span {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.access-section {
  padding-bottom: 5rem;
}
.access-inner {
  max-width: 480px;
  text-align: center;
}
.access-inner .section-sub {
  margin-left: auto;
  margin-right: auto;
}
.access-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  text-align: start;
  box-shadow: var(--shadow);
}

.landing-footer {
  padding: 2rem 1.5rem 3rem;
  text-align: center;
  border-top: 1px solid var(--border);
}
.landing-footer p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--faint);
}
.landing-footer a {
  color: var(--accent);
  margin-inline-start: 0.35rem;
}

@media (max-width: 840px) {
  .nav-links { display: none; }
  .ab-grid { grid-template-columns: 1fr; }
  .prompt-panel.multi { grid-template-columns: 1fr; }
  .hero { min-height: calc(100vh - 58px); padding-top: 2rem; }
  .landing-section { padding: 3rem 1.15rem; }
}

@media (max-width: 520px) {
  .landing-nav { padding: 0.7rem 1rem; gap: 0.5rem; }
  .nav-cta { display: none; }
  .hero-ctas { flex-direction: column; align-items: stretch; }
  .hero-ctas .btn { text-align: center; }
}
