:root {
  --bg: #0b0e14;
  --bg-elev: #121722;
  --bg-card: #161d2b;
  --bg-hover: #1e2738;
  --border: #263147;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --red: #ef4444;
  --red-dark: #dc2626;
  --green: #22c55e;
  --green-dark: #16a34a;
  --gold: #f59e0b;
  --accent: #38bdf8;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', 'Noto Sans Myanmar', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 15% 0%, rgba(239, 68, 68, 0.08), transparent 38%),
              radial-gradient(circle at 85% 100%, rgba(34, 197, 94, 0.08), transparent 40%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.hidden {
  display: none !important;
}

/* ==================== HEADER ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.brand-emblem {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  background: linear-gradient(180deg, #ef4444 0%, #ef4444 50%, #16a34a 50%, #16a34a 100%);
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.5px;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Up-stair RED and Down-stair GREEN application name */
.brand-title {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
  background: linear-gradient(180deg, #ff3b30 0%, #ef4444 49%, #22c55e 51%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 6px rgba(0, 0, 0, 0.45));
}

.brand-sub {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.free-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.18s ease;
}

.icon-btn:hover {
  background: var(--bg-hover);
  border-color: #3b4b6b;
}

/* ==================== VIEWS ==================== */
.view {
  display: none;
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.view.active {
  display: block;
}

/* ==================== HOME PAGE ==================== */
.hero {
  text-align: center;
  max-width: 780px;
  margin: 22px auto 38px;
}

.hero-pill {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fde047;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  margin-bottom: 14px;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 14px;
}

/* Large Hero Up-stair RED and Down-stair GREEN Application Name */
.split-title-lg {
  display: inline-block;
  background: linear-gradient(180deg, #ff3b30 0%, #ef4444 49%, #22c55e 51%, #16a34a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.55));
}

.hero-desc {
  color: var(--text-muted);
  font-size: 0.98rem;
}

.home-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.home-card {
  background: linear-gradient(160deg, var(--bg-card) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.home-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card-story:hover { border-color: rgba(239, 68, 68, 0.65); }
.card-dub:hover { border-color: rgba(34, 197, 94, 0.65); }
.card-cut:hover { border-color: rgba(245, 158, 11, 0.65); }
.card-dl:hover { border-color: rgba(56, 189, 248, 0.7); }
.card-thumb:hover { border-color: rgba(192, 132, 252, 0.7); }

.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.icon-red { background: rgba(239, 68, 68, 0.16); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.35); }
.icon-green { background: rgba(34, 197, 94, 0.16); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.35); }
.icon-gold { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.35); }
.icon-blue { background: rgba(56, 189, 248, 0.16); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.35); }
.icon-purple { background: rgba(192, 132, 252, 0.16); color: #c084fc; border: 1px solid rgba(192, 132, 252, 0.35); }

.card-badge.free {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.home-card h3 {
  font-size: 1.28rem;
  font-weight: 800;
}

.home-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  flex: 1;
}

.card-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.83rem;
  color: #cbd5e1;
}

.card-features li::before {
  content: "✓ ";
  color: var(--green);
  font-weight: 800;
}

.card-cta {
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.9rem;
  color: #fff;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

/* ==================== RECAP STUDIO ==================== */
.studio-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.mode-pills {
  display: inline-flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.mode-pill {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 8px 16px;
  border-radius: 9px;
  cursor: pointer;
  transition: 0.18s ease;
}

.mode-pill.active[data-mode="story"] {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
}

.mode-pill.active[data-mode="dub"] {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: #fff;
}

.video-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: #cbd5e1;
}

/* 8-Step Horizontal Stepper */
.stepper {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-bottom: 18px;
  background: var(--bg-elev);
  padding: 8px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.step-tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: 0.18s ease;
}

.step-tab:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.step-tab.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(34, 197, 94, 0.2));
  border-color: rgba(34, 197, 94, 0.55);
  color: #fff;
}

.step-tab.completed .step-num {
  background: var(--green);
  color: #052e16;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  flex-shrink: 0;
}

.step-tab.active .step-num {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* Split Studio Layout: Live Video Preview Left + Step Controls Right */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.preview-panel, .controls-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

.preview-panel {
  position: sticky;
  top: 78px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.preview-badge {
  font-size: 0.74rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

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

.stage-outer {
  width: 100%;
  background: #05070b;
  border-radius: 12px;
  border: 1px solid #1e293b;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: hidden;
}

.stage-frame {
  position: relative;
  background: #000;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-height: 460px;
}

.stage-frame.ratio-16-9 { aspect-ratio: 16 / 9; }
.stage-frame.ratio-9-16 { aspect-ratio: 9 / 16; width: auto; height: 440px; }
.stage-frame.ratio-1-1  { aspect-ratio: 1 / 1;  width: auto; height: 420px; }
.stage-frame.ratio-4-5  { aspect-ratio: 4 / 5;  width: auto; height: 430px; }

.stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
}

.stage-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.stage-video.fit-contain {
  object-fit: contain;
}

.stage-video.mirrored {
  transform: scaleX(-1);
}

/* Draggable & Resizable Origin Subtitle Blur Box */
.blur-box {
  position: absolute;
  left: 10%;
  top: 78%;
  width: 80%;
  height: 14%;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(15, 23, 42, 0.28);
  border: 2px dashed rgba(56, 189, 248, 0.9);
  border-radius: 6px;
  cursor: move;
  z-index: 10;
  user-select: none;
  touch-action: none;
}

.blur-tag {
  position: absolute;
  top: -19px;
  left: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  background: #0284c7;
  color: #fff;
  padding: 1px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.blur-handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #38bdf8;
  border: 2px solid #fff;
  cursor: nwse-resize;
}

/* Draggable Logo Overlay */
.logo-overlay {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 64px;
  height: 64px;
  cursor: move;
  z-index: 12;
  user-select: none;
  touch-action: none;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.logo-overlay.shape-circle { border-radius: 50%; }
.logo-overlay.shape-rounded { border-radius: 12px; }
.logo-overlay.shape-square { border-radius: 0; }

.logo-overlay img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

/* Burmese Subtitle Overlay */
.subtitle-overlay {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: 12%;
  text-align: center;
  z-index: 15;
  pointer-events: none;
}

.subtitle-text {
  display: inline-block;
  font-family: 'Noto Sans Myanmar', 'Inter', sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.38;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
}

/* Solid Subtitle Colors */
.subtitle-text.color-white  { color: #ffffff; }
.subtitle-text.color-yellow { color: #fde047; }
.subtitle-text.color-cyan   { color: #22d3ee; }
.subtitle-text.color-green  { color: #4ade80; }
.subtitle-text.color-red    { color: #f87171; }
.subtitle-text.color-orange { color: #fb923c; }
.subtitle-text.color-pink   { color: #f472b6; }

/* Mixed Subtitle Colors (word/gradient styles) */
.subtitle-text.color-mix-kachin {
  background: rgba(0, 0, 0, 0.65);
}
.subtitle-text.color-mix-kachin .mix-a { color: #ff4d4f; }
.subtitle-text.color-mix-kachin .mix-b { color: #4ade80; }

.subtitle-text.color-mix-gold .mix-a { color: #fde047; }
.subtitle-text.color-mix-gold .mix-b { color: #ffffff; }

.subtitle-text.color-mix-neon .mix-a { color: #22d3ee; }
.subtitle-text.color-mix-neon .mix-b { color: #f472b6; }

.subtitle-text.color-mix-fire .mix-a { color: #fb923c; }
.subtitle-text.color-mix-fire .mix-b { color: #fde047; }

.subtitle-text.color-mix-rainbow .mix-0 { color: #f87171; }
.subtitle-text.color-mix-rainbow .mix-1 { color: #fbbf24; }
.subtitle-text.color-mix-rainbow .mix-2 { color: #4ade80; }
.subtitle-text.color-mix-rainbow .mix-3 { color: #38bdf8; }
.subtitle-text.color-mix-rainbow .mix-4 { color: #e879f9; }

.fair-use-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 16;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.85);
  color: #052e16;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.ctrl-btn {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
}

.ctrl-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.seek-bar {
  flex: 1;
  accent-color: var(--green);
}

.time-display {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* ==================== STEP PANES ==================== */
.step-pane {
  display: none;
  flex-direction: column;
  gap: 16px;
}

.step-pane.active {
  display: flex;
}

.pane-head {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.pane-step-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #4ade80;
  margin-bottom: 4px;
}

.pane-head h3 {
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pane-head p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed #334155;
  border-radius: 14px;
  padding: 26px 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.55);
  transition: 0.2s ease;
}

.upload-dropzone:hover {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.06);
}

.upload-dropzone strong {
  font-size: 0.95rem;
}

.upload-dropzone span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.file-info-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-info-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.84rem;
}

.fi-label { color: var(--text-muted); }
.fi-val { font-weight: 700; text-align: right; word-break: break-all; }
.highlight-green { color: #4ade80; }
.highlight-red { color: #f87171; }

/* Form Elements */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #cbd5e1;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="number"] {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.88rem;
  outline: none;
}

.form-group select:focus,
.form-group input:focus {
  border-color: var(--green);
}

/* Frame Grid */
.frame-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.frame-option {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: 0.18s ease;
}

.frame-option.active {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.1);
}

.frame-option span {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.frame-box {
  border: 2px solid #94a3b8;
  border-radius: 4px;
  background: rgba(148, 163, 184, 0.15);
}

.frame-option.active .frame-box { border-color: var(--green); background: rgba(34, 197, 94, 0.25); }
.r-16-9 { width: 48px; height: 27px; }
.r-9-16 { width: 22px; height: 38px; }
.r-1-1  { width: 32px; height: 32px; }
.r-4-5  { width: 28px; height: 35px; }

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.sub-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}

.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  inset: 0;
  background: #334155;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider { background: var(--green); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* Sliders */
.slider-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider-row label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--green);
}

/* Swatches */
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch::before {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sw, #fff);
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.swatch.active {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.3);
}

.swatch.mixed-kachin::before { background: linear-gradient(90deg, #ef4444 50%, #22c55e 50%); }
.swatch.mixed-gold::before   { background: linear-gradient(90deg, #fde047 50%, #ffffff 50%); }
.swatch.mixed-neon::before   { background: linear-gradient(90deg, #22d3ee 50%, #f472b6 50%); }
.swatch.mixed-fire::before   { background: linear-gradient(90deg, #fb923c 50%, #fde047 50%); }
.swatch.mixed-rainbow::before { background: linear-gradient(90deg, #f87171, #fbbf24, #4ade80, #38bdf8, #e879f9); }

/* Chips & Pills */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: #cbd5e1;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.chip.active {
  background: rgba(34, 197, 94, 0.16);
  border-color: var(--green);
  color: #fff;
}

.logo-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mirror Cards */
.mirror-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.mirror-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 14px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mirror-card.active {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}

.mirror-preview-icon {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #38bdf8;
}

.mirror-card span {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Voice Cards & Speed Pills */
.voice-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.voice-card.active {
  border-color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}

.voice-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.voice-avatar.male { background: linear-gradient(135deg, #2563eb, #0ea5e9); color: #fff; }
.voice-avatar.female { background: linear-gradient(135deg, #db2777, #f43f5e); color: #fff; }

.voice-info { flex: 1; }
.voice-info strong { display: block; font-size: 0.95rem; }
.voice-info span { font-size: 0.76rem; color: var(--text-muted); }

.voice-check {
  opacity: 0;
  color: var(--green);
  font-weight: 900;
  font-size: 1.1rem;
}

.voice-card.active .voice-check { opacity: 1; }

.speed-pills {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.speed-pill {
  padding: 9px 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: #cbd5e1;
  font-weight: 800;
  font-size: 0.8rem;
  cursor: pointer;
}

.speed-pill.active {
  background: linear-gradient(135deg, var(--red), var(--green));
  border-color: transparent;
  color: #fff;
}

.tiny-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Summary Box */
.summary-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.82rem;
}

.summary-box ul {
  margin-top: 6px;
  padding-left: 18px;
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-ghost, .btn-generate {
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 11px 18px;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: 0.18s ease;
}

.btn-primary {
  background: var(--green);
  color: #052e16;
}

.btn-primary:hover { background: #4ade80; }

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover { border-color: #475569; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.btn-ghost:hover { color: var(--text); background: var(--bg-hover); }

.btn-ghost:disabled, .btn-generate:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-generate {
  width: 100%;
  padding: 14px 20px;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #16a34a 100%);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.25);
}

.btn-generate:hover:not(:disabled) {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-sm { padding: 7px 12px; font-size: 0.78rem; }
.full-width { width: 100%; }

.step-nav-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.step-counter {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* ==================== AUTO CUT VIDEO ==================== */
.autocut-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.autocut-header h2 {
  font-size: 1.5rem;
  font-weight: 900;
}

.autocut-header p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.autocut-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.autocut-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cut-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.cut-pill {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: #cbd5e1;
  font-weight: 800;
  font-size: 0.84rem;
  cursor: pointer;
}

.cut-pill.active {
  background: linear-gradient(135deg, #ef4444, #16a34a);
  border-color: transparent;
  color: #fff;
}

.autocut-preview {
  width: 100%;
  max-height: 220px;
  border-radius: 10px;
  background: #000;
}

.segments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.empty-segments {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  font-size: 0.88rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
}

.segment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.seg-info strong { display: block; font-size: 0.9rem; }
.seg-info span { font-size: 0.78rem; color: var(--text-muted); }

.seg-actions {
  display: flex;
  gap: 8px;
}

/* ==================== YOUTUBE & FACEBOOK DOWNLOADER ==================== */
.dl-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dl-input-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dl-platform-pill {
  padding: 9px 13px;
  border-radius: 10px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 800;
  color: #38bdf8;
  white-space: nowrap;
}

.dl-platform-pill.yt { color: #f87171; border-color: rgba(239, 68, 68, 0.45); background: rgba(239, 68, 68, 0.12); }
.dl-platform-pill.fb { color: #60a5fa; border-color: rgba(59, 130, 246, 0.45); background: rgba(59, 130, 246, 0.12); }

.dl-url-input {
  flex: 1;
  min-width: 240px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}

.dl-url-input:focus { border-color: var(--green); }

.dl-preview-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.dl-thumb {
  width: 168px;
  height: 95px;
  object-fit: cover;
  border-radius: 8px;
  background: #000;
  flex-shrink: 0;
}

.dl-meta h3 {
  font-size: 1rem;
  font-weight: 800;
  margin: 6px 0 4px;
}

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

.quality-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.quality-pill {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 10px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: 0.18s ease;
}

.quality-pill span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.quality-pill.active {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(34, 197, 94, 0.2));
  border-color: var(--green);
}

.dl-result-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

@media (max-width: 780px) {
  .quality-pills { grid-template-columns: repeat(2, 1fr); }
  .dl-preview-card { flex-direction: column; align-items: flex-start; }
  .dl-thumb { width: 100%; height: auto; aspect-ratio: 16/9; }
}

/* ==================== VOICE ENGINE & GEMINI API BLOCK ==================== */
.engine-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.engine-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: 0.18s ease;
}

.engine-card strong { font-size: 0.88rem; }
.engine-card span { font-size: 0.74rem; color: var(--text-muted); }

.engine-card.active {
  border-color: var(--green);
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.14), rgba(34, 197, 94, 0.14));
}

.gemini-api-block {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gemini-block-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.gemini-block-head strong {
  font-size: 0.84rem;
  color: #7dd3fc;
}

.api-inline-row {
  display: flex;
  gap: 8px;
}

.api-inline-row input {
  flex: 1;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 0.84rem;
  outline: none;
}

.api-inline-row input:focus { border-color: var(--green); }

/* ==================== AI THUMBNAIL GENERATOR ==================== */
.thumb-textarea {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 13px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  outline: none;
}

.thumb-textarea:focus { border-color: var(--green); }

.thumb-stage {
  width: 100%;
  background: #05070b;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
  margin: 0 auto;
}

.thumb-stage.ratio-16-9 { aspect-ratio: 16 / 9; }
.thumb-stage.ratio-9-16 { aspect-ratio: 9 / 16; max-height: 460px; width: auto; }

.generated-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.thumb-video-drop {
  padding: 16px 14px;
}

.thumb-title-display {
  font-family: 'Noto Sans Myanmar', 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 800;
  color: #fde047;
  line-height: 1.4;
}

/* ==================== COMPACT STUDIO & HOME UI (NO WASTED SPACE) ==================== */
.app-header { padding: 8px 18px; }
.brand-emblem { width: 34px; height: 34px; font-size: 13px; border-radius: 9px; }
.brand-title { font-size: 1.15rem; }
.brand-sub { font-size: 0.66rem; }
.view { padding: 14px 16px 32px; }

.hero { margin: 8px auto 18px; }
.hero-pill { padding: 4px 11px; font-size: 0.72rem; margin-bottom: 8px; }
.hero-title { font-size: clamp(1.7rem, 3.6vw, 2.3rem); margin-bottom: 6px; }
.hero-desc { font-size: 0.84rem; }

.home-cards { gap: 12px; max-width: 960px; margin: 0 auto; }
.home-card { padding: 14px 16px; gap: 8px; border-radius: 14px; }
.card-icon { width: 38px; height: 38px; border-radius: 10px; }
.home-card h3 { font-size: 1.02rem; }
.home-card p { font-size: 0.8rem; line-height: 1.4; }
.card-cta { padding-top: 8px; margin-top: 2px; font-size: 0.82rem; }

.studio-topbar { margin-bottom: 8px; gap: 8px; }
.mode-pill { padding: 5px 12px; font-size: 0.8rem; }
.meta-chip { padding: 4px 10px; font-size: 0.72rem; }

.stepper { padding: 5px; gap: 4px; margin-bottom: 10px; }
.step-tab { padding: 5px 4px; font-size: 0.72rem; gap: 4px; border-radius: 8px; }
.step-num { width: 19px; height: 19px; font-size: 0.68rem; }

.studio-grid { grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); gap: 12px; }
.preview-panel, .controls-panel { padding: 12px; border-radius: 13px; }
.stage-outer { min-height: 290px; padding: 8px; }
.stage-frame { max-height: 390px; }
.player-controls { margin-top: 8px; }

.step-pane { gap: 10px; }
.pane-head { padding-bottom: 7px; }
.pane-head h3 { font-size: 1rem; margin-bottom: 2px; }
.pane-head p { font-size: 0.76rem; }
.upload-dropzone { padding: 14px 12px; gap: 4px; }
.toggle-row { padding: 8px 10px; border-radius: 10px; font-size: 0.82rem; }
.toggle-row.compact { padding: 7px 9px; gap: 8px; }
.toggle-row.compact strong { font-size: 0.78rem; }
.compact-toggle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.slider-group { gap: 8px; }
.slider-row label { font-size: 0.76rem; margin-bottom: 2px; }
.chip { padding: 5px 10px; font-size: 0.74rem; border-radius: 8px; }
.voice-card { padding: 8px 10px; gap: 10px; }
.voice-avatar { width: 34px; height: 34px; font-size: 0.8rem; }
.voice-info strong { font-size: 0.86rem; }
.voice-info span { font-size: 0.7rem; }
.engine-card { padding: 8px 10px; }
.speed-pill { padding: 6px 3px; font-size: 0.74rem; }
.step-nav-footer { margin-top: 10px; padding-top: 10px; }
.compact-summary { padding: 8px 10px; font-size: 0.74rem; }
.compact-summary ul { margin-top: 0; gap: 2px; }
.btn-generate { padding: 11px 16px; font-size: 0.9rem; }

/* ==================== 5-PAGE STEP-BY-STEP GENERATION WORKFLOW ==================== */
.gen-stepper { grid-template-columns: repeat(5, 1fr); }

.gen-page-shell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.gen-pane { display: none; flex-direction: column; gap: 12px; }
.gen-pane.active { display: flex; }

.gen-pane-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.gen-pane-head h3 { font-size: 1.05rem; font-weight: 800; }
.gen-pane-head p { font-size: 0.8rem; color: var(--text-muted); }

.splits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

.split-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.split-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.split-card-info {
  padding: 6px 8px;
  font-size: 0.74rem;
}

.split-card-info strong { display: block; color: #fff; }
.split-card-info span { color: var(--text-muted); }

.gen-editor {
  width: 100%;
  background: #090c12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: #e2e8f0;
  font-family: 'Noto Sans Myanmar', ui-monospace, monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  resize: vertical;
  outline: none;
}

.gen-editor:focus { border-color: var(--green); }

@media (max-width: 720px) {
  .compact-toggle-grid { grid-template-columns: 1fr; }
  .gen-stepper { grid-template-columns: repeat(5, 1fr); }
  .gen-stepper .step-label { display: none; }
}

/* ==================== PROGRESS & MODALS ==================== */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.progress-bar {
  height: 10px;
  background: var(--bg-elev);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--green));
  transition: width 0.25s ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(5, 7, 11, 0.78);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.modal-card.modal-lg {
  max-width: 780px;
}

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

.modal-body {
  padding: 18px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.pipe-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.pipe-step.running { border-color: #38bdf8; }
.pipe-step.done { border-color: var(--green); }

.pipe-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  flex-shrink: 0;
}

.pipe-step.running .pipe-dot { background: #0284c7; color: #fff; }
.pipe-step.done .pipe-dot { background: var(--green); color: #052e16; }

.pipe-step strong { display: block; font-size: 0.86rem; }
.pipe-step small { font-size: 0.76rem; color: var(--text-muted); }

.script-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.script-tab {
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.script-tab.active {
  background: rgba(34, 197, 94, 0.16);
  border-color: var(--green);
  color: #fff;
}

.script-box {
  background: #090c12;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-family: 'Noto Sans Myanmar', ui-monospace, monospace;
  font-size: 0.82rem;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
  color: #e2e8f0;
}

.render-result video {
  width: 100%;
  max-height: 300px;
  border-radius: 12px;
  background: #000;
  margin-bottom: 12px;
}

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

.render-actions .btn-generate { flex: 1; }

.settings-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 100;
  background: #1e293b;
  color: #fff;
  border: 1px solid var(--green);
  padding: 11px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1040px) {
  .home-cards { grid-template-columns: 1fr; }
  .studio-grid { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .autocut-grid { grid-template-columns: 1fr; }
  .stepper { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 600px) {
  .app-header { padding: 10px 14px; }
  .free-badge { display: none; }
  .speed-pills { grid-template-columns: repeat(4, 1fr); }
  .cut-pills { grid-template-columns: repeat(3, 1fr); }
  .form-grid-2 { grid-template-columns: 1fr; }
}
