/* SOLONOW VIDEO — Apple HIG Design System Tokens & Components
   Version 2.0 • Palette, Typography, Glass Surfaces, Composer, Drawers, Modals */

:root {
  --sn-bg: #F5F5F7;
  --sn-surface: #FFFFFF;
  --sn-surface-translucent: rgba(255, 255, 255, 0.78);
  --sn-surface-bar: rgba(255, 255, 255, 0.85);
  --sn-surface-subtle: #ECECF0;
  --sn-surface-pill: #F5F5F7;
  --sn-surface-pill-hover: #E8E8ED;
  --sn-surface-opt-selected: #FFF1E8;
  
  --sn-ink: #1D1D1F;
  --sn-ink-secondary: #6E6E73;
  --sn-ink-tertiary: #8E8E93;
  --sn-border: rgba(0, 0, 0, 0.08);
  --sn-border-subtle: #E5E5EA;
  --sn-border-focus: #0A84FF;
  
  /* Primary Action */
  --sn-accent: #D9480F;
  --sn-accent-hover: #C2410C;
  --sn-accent-shadow: rgba(217, 72, 15, 0.32);
  --sn-accent-tint: rgba(217, 72, 15, 0.16);
  
  /* Category Colors */
  --sn-cat-blue: #0A84FF;
  --sn-cat-orange: #FF9F0A;
  --sn-cat-purple: #BF5AF2;
  --sn-cat-pink: #FF375F;
  --sn-cat-green: #30D158;
  --sn-cat-green-dark: #248A3D;
  --sn-cat-red: #D70015;
  --sn-cat-yellow: #FFB800;
  --sn-cat-teal: #64D2FF;
  --sn-cat-indigo: #5E5CE6;
  
  /* Radii */
  --sn-radius-sm: 8px;
  --sn-radius-md: 14px;
  --sn-radius-lg: 20px;
  --sn-radius-xl: 24px;
  --sn-radius-2xl: 28px;
  --sn-radius-3xl: 32px;
  --sn-radius-full: 999px;
  
  /* Shadows */
  --sn-shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
  --sn-shadow-composer: 0 1px 2px rgba(0, 0, 0, 0.04), 0 20px 48px rgba(0, 0, 0, 0.07);
  --sn-shadow-floating: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.12);
  --sn-shadow-sheet: -20px 0 48px rgba(0, 0, 0, 0.15);
  --sn-shadow-modal: 0 1px 2px rgba(0, 0, 0, 0.04), 0 30px 60px rgba(0, 0, 0, 0.14);
  
  /* Font Stack */
  --sn-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, system-ui, sans-serif;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--sn-bg);
  color: var(--sn-ink);
  font-family: var(--sn-font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--sn-accent);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: var(--sn-accent-hover);
}

button {
  font-family: inherit;
  font-size: inherit;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

textarea, input {
  font-family: inherit;
  font-size: inherit;
}

textarea:focus, input:focus {
  outline: none;
}

:focus-visible {
  outline: 3px solid var(--sn-border-focus);
  outline-offset: 2px;
}

/* Buttons */
.sn-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 26px;
  border-radius: var(--sn-radius-full);
  background: var(--sn-accent);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 8px 20px var(--sn-accent-shadow);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.sn-btn-primary:hover:not(:disabled) {
  background: var(--sn-accent-hover);
  transform: translateY(-1px);
}
.sn-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}
.sn-btn-primary:disabled {
  background: var(--sn-border-subtle) !important;
  color: var(--sn-ink-secondary) !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.sn-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px 0 10px;
  border-radius: var(--sn-radius-full);
  background: var(--sn-surface-pill);
  color: var(--sn-ink);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  border: 0;
}
.sn-pill:hover {
  background: var(--sn-surface-pill-hover);
}
.sn-pill.sn-pill-active {
  background: #E8E8ED;
  box-shadow: inset 0 0 0 1.5px var(--sn-ink);
}
.sn-pill.sn-pill-white {
  background: var(--sn-surface);
  box-shadow: 0 0 0 1px var(--sn-border);
}
.sn-pill.sn-pill-white:hover {
  background: #FAFAFC;
}

.sn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--sn-radius-full);
  color: var(--sn-ink);
  font-size: 15px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
}
.sn-ghost:hover {
  background: rgba(0, 0, 0, 0.05);
}

.sn-tile-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  min-height: 92px;
  padding: 16px;
  border-radius: var(--sn-radius-lg);
  background: var(--sn-surface);
  font-size: 15px;
  font-weight: 600;
  color: var(--sn-ink);
  cursor: pointer;
  box-shadow: var(--sn-shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sn-tile-btn:hover {
  background: #F9F9FB;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

/* Category Color Tile Icon */
.sn-icon-tile {
  flex: 0 0 auto;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}
.sn-icon-tile svg {
  stroke: #FFFFFF;
}

/* Header & Glass Top Bar */
.sn-os-bar {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 0 0 14px;
  background: #ECECF0;
  border-bottom: 1px solid var(--sn-border);
  font-size: 13px;
  font-weight: 500;
  color: var(--sn-ink);
  user-select: none;
}
.sn-os-bar-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--sn-accent);
  margin-right: 10px;
}
.sn-os-bar-title {
  flex-grow: 1;
}
.sn-os-controls {
  display: flex;
}
.sn-os-btn {
  width: 46px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.sn-os-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}

.sn-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  min-height: 64px;
  padding: 8px 28px;
  box-sizing: border-box;
  background: var(--sn-surface-translucent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--sn-border);
}
.sn-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 160px;
  cursor: pointer;
  text-decoration: none;
  color: var(--sn-ink);
}
.sn-brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--sn-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px var(--sn-accent-shadow);
}
.sn-brand-text {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.sn-nav-capsule {
  display: flex;
  padding: 3px;
  border-radius: var(--sn-radius-full);
  background: rgba(118, 118, 128, 0.12);
}
.sn-nav-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--sn-radius-full);
  font-size: 15px;
  font-weight: 500;
  color: var(--sn-ink);
  cursor: pointer;
  text-decoration: none;
  border: 0;
  background: transparent;
  transition: all 0.15s ease;
}
.sn-nav-tab.active {
  background: var(--sn-surface);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.sn-nav-tab:hover:not(.active) {
  background: rgba(0, 0, 0, 0.04);
}

.sn-header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 1 1 160px;
}
.sn-engine-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border-radius: var(--sn-radius-full);
  color: var(--sn-ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border: 0;
  background: transparent;
}
.sn-engine-status:hover {
  background: rgba(0,0,0,0.05);
}
.sn-status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sn-cat-green);
  box-shadow: 0 0 0 3px rgba(48, 209, 88, 0.25);
  transition: background 0.2s ease;
}
.sn-status-dot.warning {
  background: var(--sn-cat-orange);
  box-shadow: 0 0 0 3px rgba(255, 159, 10, 0.25);
}
.sn-status-dot.error {
  background: var(--sn-cat-red);
  box-shadow: 0 0 0 3px rgba(215, 0, 21, 0.25);
}

/* Multi-Product Tab Bar (Up to 10 Tabs) */
.sn-tabs-container {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: var(--sn-radius-full);
  background: rgba(118, 118, 128, 0.10);
  overflow-x: auto;
  scrollbar-width: thin;
}
.sn-tab-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 10px 0 14px;
  border-radius: var(--sn-radius-full);
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--sn-ink);
  flex: 0 0 auto;
  background: transparent;
  transition: all 0.15s ease;
}
.sn-tab-item.active {
  background: var(--sn-surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.sn-tab-item:hover:not(.active) {
  background: rgba(255, 255, 255, 0.5);
}
.sn-tab-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--sn-cat-blue);
}
.sn-tab-badge {
  padding: 2px 8px;
  border-radius: var(--sn-radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--sn-ink-secondary);
  background: rgba(0, 0, 0, 0.05);
  white-space: nowrap;
}
.sn-tab-close {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--sn-ink-tertiary);
  margin-left: -2px;
  border: 0;
  background: transparent;
}
.sn-tab-close:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--sn-ink);
}

/* Step Bar Indicator (1/3 Ý tưởng, 2/3 Duyệt cảnh, 3/3 Xuất video) */
.sn-step-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--sn-ink-secondary);
}
.sn-step-bars {
  display: flex;
  gap: 4px;
}
.sn-step-dot {
  width: 6px;
  height: 6px;
  border-radius: 3px;
  background: #D2D2D7;
  transition: all 0.2s ease;
}
.sn-step-dot.active {
  width: 20px;
  background: var(--sn-accent);
}
.sn-step-dot.done {
  width: 6px;
  background: var(--sn-cat-green-dark);
}

/* Composer Card */
.sn-composer {
  width: 100%;
  background: var(--sn-surface);
  border-radius: var(--sn-radius-2xl);
  box-shadow: var(--sn-shadow-composer);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}
.sn-composer:focus-within {
  box-shadow: 0 0 0 4px var(--sn-accent-tint), 0 20px 48px rgba(0, 0, 0, 0.08);
}
.sn-composer-textarea {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  border: 0;
  background: transparent;
  font-family: inherit;
  font-size: 20px;
  line-height: 1.5;
  color: var(--sn-ink);
  padding: 28px 30px 14px;
}
.sn-composer-textarea::placeholder {
  color: #A1A1A6;
}

/* Reference Images Panel (Ảnh sản phẩm / nhân vật tuỳ chọn) */
.sn-ref-disclosure {
  border-top: 1px solid #F0F0F3;
  padding: 10px 24px;
  display: flex;
  flex-direction: column;
  background: #FAFAFC;
  border-bottom-left-radius: var(--sn-radius-2xl);
  border-bottom-right-radius: var(--sn-radius-2xl);
}
.sn-ref-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 8px;
  border-radius: var(--sn-radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--sn-ink);
  cursor: pointer;
  background: transparent;
  border: 0;
}
.sn-ref-toggle:hover {
  background: rgba(0,0,0,0.04);
}
.sn-ref-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px 8px 18px;
}
.sn-ref-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sn-ink-secondary);
}
.sn-ref-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.sn-ref-card {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: var(--sn-radius-md);
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  border: 1px solid var(--sn-border);
  background: #000;
}
.sn-ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sn-ref-card-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}
.sn-ref-card-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border: 0;
  cursor: pointer;
}
.sn-ref-card-del:hover {
  background: var(--sn-cat-red);
}
.sn-ref-upload-btn {
  width: 96px;
  height: 96px;
  border-radius: var(--sn-radius-md);
  border: 2px dashed #C7C7CC;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  color: var(--sn-ink-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s ease;
}
.sn-ref-upload-btn:hover {
  border-color: var(--sn-accent);
  color: var(--sn-accent);
  background: #FFF9F5;
}

/* Option Drawer (Format, Length, Style, Voice) */
.sn-drawer {
  border-top: 1px solid var(--sn-border-subtle);
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: snDrawerFade 0.18s ease-out;
}
@keyframes snDrawerFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.sn-drawer-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.sn-drawer-title {
  font-size: 17px;
  font-weight: 600;
}
.sn-drawer-hint {
  font-size: 15px;
  color: var(--sn-ink-secondary);
}

.sn-opt-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: var(--sn-radius-md);
  cursor: pointer;
  color: var(--sn-ink);
  text-align: left;
  border: 0;
  background: var(--sn-surface-pill);
  transition: all 0.15s ease;
}
.sn-opt-card:hover {
  background: #ECECF0;
}
.sn-opt-card.selected {
  background: var(--sn-surface-opt-selected);
  box-shadow: inset 0 0 0 2px var(--sn-accent);
}

/* Suggestion Cards */
.sn-sug-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 20px;
  border-radius: var(--sn-radius-lg);
  border: 0;
  background: var(--sn-surface);
  color: var(--sn-ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--sn-shadow-card);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.sn-sug-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* Step 2 Duyệt cảnh: Scene Grid & Thumbs */
.sn-scene-thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  background: #2C2C2E;
  transition: transform 0.15s ease;
}
.sn-scene-thumb:hover {
  transform: scale(1.01);
}
.sn-scene-thumb video, .sn-scene-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sn-chip-status {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--sn-radius-full);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  font-size: 14px;
  font-weight: 600;
}
.sn-chip-hook {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: var(--sn-radius-full);
  background: rgba(255, 255, 255, 0.9);
  color: var(--sn-ink);
  font-size: 14px;
  font-weight: 600;
}
.sn-chip-dur {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
}
.sn-play-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease, background 0.15s ease;
}
.sn-play-circle:hover {
  transform: scale(1.06);
  background: #FFFFFF;
}

/* Floating Bottom Bar */
.sn-floating-bar-wrapper {
  position: sticky;
  bottom: 20px;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 24px;
  pointer-events: none;
}
.sn-floating-bar {
  pointer-events: auto;
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  padding: 14px 14px 14px 28px;
  box-sizing: border-box;
  border-radius: var(--sn-radius-2xl);
  background: var(--sn-surface-bar);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sn-shadow-floating);
}

/* Slide-over Drawer (Sửa cảnh) */
.sn-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  animation: snFadeIn 0.2s ease;
}
.sn-sheet-panel {
  width: 460px;
  max-width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: #FFFFFF;
  padding: 28px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--sn-shadow-sheet);
  overflow-y: auto;
  animation: snSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes snFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes snSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Step 3: Phone Mockup */
.sn-phone-mockup {
  flex: 0 0 auto;
  width: 340px;
  aspect-ratio: 9 / 16;
  border-radius: 36px;
  background: #000000;
  box-shadow: 0 30px 60px rgba(0,0,0,0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border: 4px solid #2C2C2E;
}
.sn-phone-mockup video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Modal Dialog */
.sn-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  animation: snFadeIn 0.2s ease;
  padding: 20px;
}
.sn-modal-card {
  width: 100%;
  max-width: 820px;
  background: #FFFFFF;
  border-radius: var(--sn-radius-2xl);
  box-shadow: var(--sn-shadow-modal);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  overflow: hidden;
  animation: snScaleIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes snScaleIn {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Utility Animations */
.sn-spin {
  animation: snSpinAnim 1s linear infinite;
}
@keyframes snSpinAnim {
  to { transform: rotate(360deg); }
}

.sn-shimmer {
  animation: snPulseAnim 1.6s ease-in-out infinite;
}
@keyframes snPulseAnim {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
  .sn-spin, .sn-shimmer {
    animation: none;
  }
}


/* Advanced options drawer */
.sn-adv-select{appearance:none;-webkit-appearance:none;width:100%;min-height:48px;border:0;border-radius:14px;background:#F5F5F7 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236E6E73' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 14px center;padding:0 42px 0 14px;font-family:inherit;font-size:16px;color:#1D1D1F;cursor:pointer;transition:background-color .15s,box-shadow .15s}
.sn-adv-select:hover{background-color:#ECECF0}
.sn-adv-select:focus-visible{outline:3px solid #0A84FF;outline-offset:2px}

/* Ghép phim panel (Step 2) */
.sn-asm { display: flex; flex-direction: column; gap: 22px; padding: 26px 28px 28px; border-radius: var(--sn-radius-2xl); background: #FFFFFF; box-shadow: 0 8px 30px rgba(0,0,0,0.06); border: 1px solid #ECECF0; }
.sn-asm-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 340px); gap: 16px 28px; align-items: end; }
.sn-asm-head-text { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sn-asm-title { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.sn-asm-sub { margin: 0; font-size: 15px; color: #5C5C61; line-height: 1.5; }
.sn-asm-name { display: flex; flex-direction: column; gap: 6px; }
.sn-progress { height: 6px; border-radius: 9999px; background: #ECECF0; overflow: hidden; }
.sn-progress span { display: block; height: 100%; border-radius: 9999px; transition: width .3s ease; }

.sn-asm-body { display: grid; gap: 24px; align-items: start; }
.sn-asm--v .sn-asm-body { grid-template-columns: minmax(0, 1fr) 280px; }
.sn-asm--s .sn-asm-body { grid-template-columns: minmax(0, 1fr) 360px; }
.sn-asm--h .sn-asm-body { grid-template-columns: minmax(0, 1fr); }
.sn-asm--h .sn-asm-preview { order: -1; width: 100%; max-width: 760px; margin: 0 auto; position: static; }

.sn-asm-settings { columns: 2 280px; column-gap: 14px; min-width: 0; }
.sn-asm--h .sn-asm-settings { columns: 3 260px; }
.sn-asm-settings > .sn-asm-card { break-inside: avoid; margin-bottom: 14px; }
.sn-asm-card { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 18px; background: #FAFAFC; border: 1px solid #EFEFF3; min-width: 0; }
.sn-asm-row { display: flex; flex-direction: column; gap: 8px; }
.sn-asm-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #6E6E73; }
.sn-asm-hint { font-size: 13px; color: #8E8E93; }
.sn-asm-grid { display: grid; grid-template-columns: 1fr; gap: 8px; }
.sn-asm-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sn-asm-inline .sn-seg { flex: 1 1 100%; }
.sn-asm-inline .sn-asm-input { flex: 1 1 100%; width: 100%; }

.sn-seg { display: flex; gap: 3px; padding: 3px; border-radius: 12px; background: #ECECF1; }
.sn-seg-btn { flex: 1 1 0; min-height: 36px; padding: 0 8px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: #48484A; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.sn-seg-btn:hover { background: rgba(255,255,255,.75); }
.sn-seg-btn.on { background: var(--sn-accent); color: #FFFFFF; box-shadow: 0 2px 8px var(--sn-accent-shadow); }
.sn-seg-btn:focus-visible { outline: 2px solid var(--sn-accent); outline-offset: 2px; }

.sn-asm-input { width: 100%; box-sizing: border-box; min-height: 42px; padding: 0 12px; border: 1px solid #D2D2D7; border-radius: 12px; background: #FFFFFF; font: inherit; font-size: 15px; color: #1D1D1F; }
.sn-asm-input:focus { outline: none; border-color: var(--sn-accent); box-shadow: 0 0 0 3px var(--sn-accent-tint); }
.sn-asm-file { min-height: 38px; padding: 0 14px; border: 1.5px dashed #C7C7CC; border-radius: 12px; background: #FFFFFF; font: inherit; font-size: 13.5px; font-weight: 600; color: #1D1D1F; cursor: pointer; }
.sn-asm-file:hover { border-color: var(--sn-accent); color: var(--sn-accent); }
.sn-asm-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background: #FFFFFF; border: 1px solid #E5E5EA; }

.sn-asm-preview { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 84px; align-self: start; min-width: 0; }
.sn-asm-screen { width: 100%; border-radius: 18px; overflow: hidden; background: #1C1C1E; display: flex; align-items: center; justify-content: center; box-shadow: 0 12px 32px rgba(0,0,0,0.16); }
.sn-asm-screen video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.sn-asm-wait { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 20px; text-align: center; color: #FFFFFF; font-size: 16px; font-weight: 600; }
.sn-asm-wait small { font-size: 13px; font-weight: 400; color: #AEAEB2; line-height: 1.45; }
.sn-asm-actions { display: flex; gap: 10px; }
.sn-asm-actions > * { flex: 1 1 0; justify-content: center; }
.sn-asm-download { display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 9999px; background: #248A3D; color: #FFFFFF; font-weight: 700; text-decoration: none; }
.sn-asm-download:hover { background: #1E7434; }

@media (max-width: 900px) {
  .sn-asm { padding: 20px 16px; }
  .sn-asm-head { grid-template-columns: 1fr; }
  .sn-asm--v .sn-asm-body, .sn-asm--s .sn-asm-body { grid-template-columns: 1fr; }
  .sn-asm-preview { order: -1; position: static; margin: 0 auto; width: 100%; }
  .sn-asm--v .sn-asm-preview { max-width: 260px; }
  .sn-asm--s .sn-asm-preview { max-width: 340px; }
}

/* Ghép phim: tabs + detailed editor */
.sn-asm-titlebar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.sn-asm-tabs { display: inline-flex; gap: 3px; padding: 3px; border-radius: 12px; background: #ECECF1; }
.sn-asm-tabs button { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: #48484A; cursor: pointer; }
.sn-asm-tabs button.on { background: #FFFFFF; color: #1D1D1F; box-shadow: 0 1px 4px rgba(0,0,0,0.12); }
.sn-asm-tabs button:focus-visible { outline: 2px solid var(--sn-accent); outline-offset: 2px; }
.sn-asm-pro { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sn-asm-pro .sn-seg { flex-wrap: wrap; }
.sn-asm-pro .sn-seg-btn { flex: 1 0 auto; }
.sn-asm-scenes { display: flex; flex-direction: column; gap: 8px; }
.sn-asm-scene { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: #FFFFFF; border: 1px solid #E5E5EA; }
.sn-asm-scene.off { opacity: .55; }
.sn-asm-scene.off .sn-asm-input { text-decoration: line-through; }
.sn-asm-scene-n { flex: 0 0 30px; height: 30px; border-radius: 9px; display: flex; align-items: center; justify-content: center; background: #1D1D1F; color: #FFFFFF; font-weight: 700; font-size: 14px; }
.sn-asm-scene-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.sn-asm-scene-top { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.sn-asm-scene-top span { color: #8E8E93; font-size: 13px; }
.sn-asm-scene .sn-asm-input { min-height: 36px; font-size: 14px; }
.sn-asm-scene-act { display: flex; gap: 6px; flex: 0 0 auto; }
.sn-asm-scene-act button { min-width: 36px; min-height: 36px; padding: 0 10px; border: 1px solid #D2D2D7; border-radius: 10px; background: #FFFFFF; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.sn-asm-scene-act button:disabled { opacity: .35; cursor: default; }
.sn-asm-scene-act .sn-asm-scene-use[aria-pressed="false"] { border-color: var(--sn-accent); color: var(--sn-accent); }
.sn-range { display: flex; align-items: center; gap: 12px; }
.sn-range input { flex: 1 1 auto; accent-color: var(--sn-accent); }
.sn-range output { flex: 0 0 72px; text-align: right; font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .sn-asm-scene { flex-wrap: wrap; }
  .sn-asm-scene-act { width: 100%; justify-content: flex-end; }
}

/* Ghép phim: live preview mock */
.sn-asm-screen { container-type: size; position: relative; }
.sn-asm-ptabs { align-self: center; }
.sn-mock { position: absolute; inset: 0; overflow: hidden; background: #111; }
.sn-mock-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sn-mock-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #AEAEB2; font-size: 14px; padding: 20px; text-align: center; }
.sn-mock-chip { position: absolute; left: 50%; transform: translateX(-50%); top: 10px; white-space: nowrap; padding: 3px 9px; border-radius: 8px; background: rgba(0,0,0,.55); color: #FFFFFF; font-size: 11px; font-weight: 600; pointer-events: none; }
.sn-mock-logo { position: absolute; height: auto; object-fit: contain; pointer-events: none; }
.sn-mock-logo--empty { pointer-events: auto; aspect-ratio: 2 / 1; border: 2px dashed rgba(255,255,255,.85); border-radius: 8px; background: rgba(0,0,0,.25); color: #FFFFFF; font: 700 clamp(9px, 3cqw, 14px)/1 Inter, sans-serif; letter-spacing: .1em; cursor: pointer; }
.sn-mock-sub { position: absolute; left: 7.5%; right: 7.5%; text-align: center; line-height: 1.2; font-weight: 800; color: #FFFFFF; word-wrap: break-word; }
.sn-mock-sub--tiktok_yellow { color: #FFD60A; -webkit-text-stroke: .08em #000; paint-order: stroke fill; text-shadow: 0 .04em .08em rgba(0,0,0,.6); }
.sn-mock-sub--tiktok_white { color: #FFFFFF; -webkit-text-stroke: .08em #000; paint-order: stroke fill; text-shadow: 0 .04em .08em rgba(0,0,0,.6); }
.sn-mock-sub--karaoke_pop { color: #FFFFFF; -webkit-text-stroke: .08em #000; paint-order: stroke fill; }
.sn-mock-sub--karaoke_pop .hl, .sn-mock-sub .hl { color: #FFD60A; }
.sn-mock-sub--box_dark .sn-mock-sub-t { padding: .12em .4em; border-radius: .2em; background: rgba(0,0,0,.68); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sn-mock-sub--box_brand .sn-mock-sub-t { padding: .12em .4em; border-radius: .2em; background: var(--sn-accent); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sn-mock-sub--cinema_gold { color: #FFE8A8; font-weight: 500; text-shadow: 0 .05em .12em rgba(0,0,0,.85); }
.sn-mock-sub--neon_cyan { color: #64D2FF; -webkit-text-stroke: .06em #001018; paint-order: stroke fill; text-shadow: 0 0 .3em rgba(100,210,255,.8); }
.sn-mock-bar { position: absolute; left: 0; right: 0; height: max(4px, .65cqh); background: rgba(255,255,255,.25); }
.sn-mock-bar span { display: block; width: 35%; height: 100%; background: var(--sn-accent); }
.sn-asm-screen .sn-mock-bg { object-fit: cover; }
.sn-mock-sub-t { line-height: 1.35; }

/* Ghép phim: embedded timeline editor */
.sn-asm--pro { gap: 16px; }
.sn-asm-editor { min-width: 0; }
.sn-asm-editor > div > div[style*="grid-template-columns: 280px"] { grid-template-columns: 240px minmax(0, 1fr) 300px !important; }
@media (max-width: 1100px) {
  .sn-asm-editor > div > div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

/* ===== Timeline editor ===== */
.sn-tle { background: #FFFFFF; border-radius: 20px; padding: 12px 14px 14px; box-shadow: var(--sn-shadow-card); display: flex; flex-direction: column; gap: 10px; user-select: none; }
.sn-tle kbd { display: inline-flex; align-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 5px; background: rgba(118,118,128,.14); border: 1px solid rgba(0,0,0,.06); font: 600 11px/1 Inter, sans-serif; color: #5C5C61; justify-content: center; }
.sn-tle-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sn-tle-tools { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: #ECECF1; margin-right: 4px; }
.sn-tle-tools button, .sn-tle-btn, .sn-tle-zoom button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 0; border-radius: 9px; background: transparent; font: inherit; font-size: 13.5px; font-weight: 600; color: #1D1D1F; cursor: pointer; }
.sn-tle-tools button.on { background: #1D1D1F; color: #FFFFFF; }
.sn-tle-tools button.on kbd { background: rgba(255,255,255,.18); color: #FFFFFF; border-color: transparent; }
.sn-tle-btn { background: #F5F5F7; }
.sn-tle-btn:hover:not(:disabled), .sn-tle-zoom button:hover { background: #E8E8ED; }
.sn-tle-btn:disabled { opacity: .4; cursor: default; }
.sn-tle-spacer { flex: 1 1 auto; }
.sn-tle-time { font: 700 15px/1 Inter, sans-serif; font-variant-numeric: tabular-nums; padding: 0 6px; }
.sn-tle-time small { font-weight: 500; color: #8E8E93; }
.sn-tle-zoom { display: inline-flex; gap: 2px; padding: 3px; border-radius: 12px; background: #F5F5F7; }
.sn-tle-zoom button { min-width: 34px; justify-content: center; }

.sn-tle-body { display: grid; grid-template-columns: 172px minmax(0, 1fr); border: 1px solid #ECECF0; border-radius: 14px; overflow: hidden; background: #FBFBFD; }
.sn-tle-labels { display: flex; flex-direction: column; border-right: 1px solid #ECECF0; background: #FFFFFF; }
.sn-tle-lab { display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 13px; font-weight: 600; color: #3A3A3C; }
.sn-tle-lab i { width: 9px; height: 9px; border-radius: 3px; }
.sn-tle-lab.ruler, .sn-tle-ruler { height: 26px; }
.sn-tle-lab.v, .sn-tle-track.v { height: 64px; }
.sn-tle-lab.t, .sn-tle-track.t { height: 36px; }
.sn-tle-lab.a, .sn-tle-track.a { height: 44px; }
.sn-tle-scroll { overflow-x: auto; overflow-y: hidden; position: relative; scrollbar-width: thin; }
.sn-tle-canvas { position: relative; min-width: 100%; padding-right: 40px; box-sizing: content-box; cursor: default; }
.sn-tle-canvas.tool-razor, .sn-tle-canvas.tool-razor .sn-tle-clip { cursor: crosshair; }

.sn-tle-ruler { position: relative; border-bottom: 1px solid #ECECF0; background: #FFFFFF; cursor: ew-resize; }
.sn-tle-ruler span { position: absolute; bottom: 0; width: 1px; background: #C7C7CC; }
.sn-tle-ruler .mi { height: 5px; }
.sn-tle-ruler .mj { height: 10px; background: #8E8E93; }
.sn-tle-ruler .mj b { position: absolute; left: 4px; bottom: 8px; font: 500 11px/1 Inter, sans-serif; color: #8E8E93; font-variant-numeric: tabular-nums; white-space: nowrap; }

.sn-tle-track { position: relative; border-bottom: 1px solid #F0F0F3; }
.sn-tle-track > div { position: absolute; top: 6px; bottom: 6px; border-radius: 8px; box-sizing: border-box; }
.sn-tle-clip { background: #2B2622; overflow: hidden; cursor: grab; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); transition: box-shadow .12s; }
.sn-tle-clip .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; pointer-events: none; }
.sn-tle-clip .name { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #FFFFFF; font: 700 12.5px/1 Inter, sans-serif; text-shadow: 0 1px 3px rgba(0,0,0,.7); white-space: nowrap; pointer-events: none; }
.sn-tle-clip.sel { box-shadow: inset 0 0 0 2.5px #FF9F0A, 0 0 0 1px #FF9F0A; z-index: 2; }
.sn-tle-clip.missing { background: repeating-linear-gradient(135deg, #8E8E93 0 8px, #9C9CA1 8px 16px); }
.sn-tle-clip.dragging { z-index: 5; opacity: .9; cursor: grabbing; box-shadow: 0 8px 20px rgba(0,0,0,.3), inset 0 0 0 2.5px #FF9F0A; }
.sn-tle-clip.drop { box-shadow: inset 3px 0 0 #0A84FF; }
.sn-tle-clip .h { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 3; }
.sn-tle-clip .h.l { left: 0; }
.sn-tle-clip .h.r { right: 0; }
.sn-tle-clip.sel .h { background: rgba(255,159,10,.95); }
.sn-tle-clip.sel .h.l { border-radius: 8px 0 0 8px; }
.sn-tle-clip.sel .h.r { border-radius: 0 8px 8px 0; }
.sn-tle-clip:hover .h:not(:hover) { background: rgba(255,255,255,.18); }
.sn-tle-clip.sel:hover .h { background: rgba(255,159,10,.95); }
.tool-razor .sn-tle-clip .h { pointer-events: none; background: none !important; }

.sn-tle-sub { background: #EFE5FA; border: 1px solid #D9C4F2; color: #5B2C83; font-size: 11.5px; line-height: 22px; padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-tle-sub.off { background: #F5F5F7; border-color: #E5E5EA; color: transparent; }
.sn-tle-sub.sel { border-color: #BF5AF2; }
.sn-tle-voice { top: 6px !important; bottom: 18px !important; border: 1px solid #F5C2D0; background: #FFE8EE repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,55,95,.35) 3px 4px, transparent 4px 6px, rgba(255,55,95,.2) 6px 7px); }
.sn-tle-voice.off { background: #F5F5F7; border-color: #E5E5EA; }
.sn-tle-music { position: absolute; left: 0; bottom: 3px; height: 12px; border-radius: 6px; background: #E6F4EA; border: 1px solid #B7DFC3; color: #1E7434; font: 600 9.5px/11px Inter, sans-serif; padding-left: 6px; white-space: nowrap; overflow: hidden; box-sizing: border-box; }

.sn-tle-playhead { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #FF3B30; z-index: 6; pointer-events: none; }
.sn-tle-playhead .knob { position: absolute; top: 0; left: 50%; width: 14px; height: 14px; transform: translateX(-50%); background: #FF3B30; clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%); }
.sn-tle-razor { display: none; position: absolute; top: 26px; bottom: 0; width: 0; border-left: 1.5px dashed #0A84FF; z-index: 7; pointer-events: none; }
.sn-tle-hint { font-size: 12.5px; color: #8E8E93; line-height: 1.9; }
.sn-tle-hint kbd { margin: 0 1px; }

/* Timeline: selectable lower tracks + extra layers */
.sn-tle-sub, .sn-tle-voice { cursor: pointer; }
.sn-tle-voice.sel { box-shadow: 0 0 0 2px #FF375F; }
.sn-tle-sub.sel { box-shadow: 0 0 0 2px #BF5AF2; border-color: #BF5AF2; }
.sn-tle-lab { position: relative; }
.sn-tle-add { margin-left: auto; width: 22px; height: 22px; border-radius: 7px; border: 1px solid #D2D2D7; background: #FFFFFF; font: 700 14px/1 Inter, sans-serif; color: #3A3A3C; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }
.sn-tle-add + .sn-tle-add { margin-left: 4px; }
.sn-tle-add:hover { border-color: var(--sn-accent); color: var(--sn-accent); }
.sn-tle-add.del:hover { border-color: #C9341C; color: #C9341C; }
.sn-tle-lab.lane, .sn-tle-track.lane { height: 38px; }
.sn-tle-lab.lane { font-weight: 600; font-size: 12.5px; padding-right: 8px; }
.sn-tle-lab.more, .sn-tle-track.more { height: 40px; }
.sn-tle-lab.more { gap: 4px; padding: 0 6px; }
.sn-tle-lab.more button { flex: 1 1 0; min-height: 28px; border: 1px dashed #C7C7CC; border-radius: 8px; background: #FFFFFF; font: 600 11px/1.1 Inter, sans-serif; color: #5C5C61; cursor: pointer; padding: 0 4px; }
.sn-tle-lab.more button:hover { border-color: var(--sn-accent); color: var(--sn-accent); }
.sn-tle-track.lane { background: repeating-linear-gradient(90deg, transparent 0 39px, rgba(0,0,0,.025) 39px 40px); }
.sn-tle-track.more { border-bottom: 0; }
.sn-tle-item { position: absolute; top: 5px; bottom: 5px; border-radius: 8px; box-sizing: border-box; cursor: grab; overflow: hidden; display: flex; align-items: center; }
.sn-tle-item > span { padding: 0 12px; font: 600 12px/1 Inter, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.sn-tle-item.text { background: #F3E8FF; border: 1px solid #C9A2F0; color: #6B2FA0; }
.sn-tle-item.audio { background: #DFF5F9 repeating-linear-gradient(90deg, transparent 0 3px, rgba(48,176,199,.35) 3px 4px, transparent 4px 7px); border: 1px solid #8ED3E0; color: #145E6C; }
.sn-tle-item.sel { box-shadow: 0 0 0 2px #FF9F0A; z-index: 3; }
.sn-tle-item .h { position: absolute; top: 0; bottom: 0; width: 8px; cursor: ew-resize; }
.sn-tle-item .h.l { left: 0; } .sn-tle-item .h.r { right: 0; }
.sn-tle-item.sel .h { background: rgba(255,159,10,.9); }
.sn-tle-insp { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; border-radius: 12px; background: #F7F7FA; border: 1px solid #ECECF0; }
.sn-tle-insp-k { font-size: 13px; white-space: nowrap; }
.sn-tle-insp-name { font-size: 13px; color: #3A3A3C; max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sn-tle-insp-meta { font-size: 12.5px; color: #8E8E93; font-variant-numeric: tabular-nums; }
.sn-tle-seg { padding: 2px; }
.sn-tle-seg .sn-seg-btn { min-height: 30px; font-size: 12.5px; padding: 0 10px; }
.sn-tl-layers { position: absolute; inset: 0; pointer-events: none; }
.sn-tl-lay { position: absolute; left: 6%; right: 6%; text-align: center; color: #FFFFFF; font-weight: 800; line-height: 1.2; -webkit-text-stroke: .07em #000; paint-order: stroke fill; text-shadow: 0 .05em .1em rgba(0,0,0,.6); transform: translateY(-50%); }
.sn-tl-lay.pos-top { top: 14%; } .sn-tl-lay.pos-center { top: 50%; } .sn-tl-lay.pos-bottom { top: 80%; }
.sn-tl-lay.size-s { font-size: 14px; } .sn-tl-lay.size-m { font-size: 19px; } .sn-tl-lay.size-l { font-size: 26px; }

.sn-tle-lab { white-space: nowrap; overflow: hidden; }
.sn-tle-lab.more button { white-space: nowrap; font-size: 11.5px; }

/* Ghép phim: mock playback controls */
.sn-mock-bg { cursor: pointer; }
.sn-mock-ctl { display: flex; align-items: center; gap: 10px; padding: 6px 10px 6px 6px; border-radius: 9999px; background: #F2F2F5; }
.sn-mock-play { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--sn-accent); color: #FFFFFF; font: 700 12px/1 Inter, sans-serif; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px var(--sn-accent-shadow); }
.sn-mock-play:focus-visible { outline: 2px solid var(--sn-accent); outline-offset: 2px; }
.sn-mock-seek { flex: 1 1 auto; min-width: 0; accent-color: var(--sn-accent); cursor: pointer; }
.sn-mock-time { flex: 0 0 auto; font: 600 12.5px/1 Inter, sans-serif; color: #5C5C61; font-variant-numeric: tabular-nums; }
.sn-qc-warn { display: block; font-size: 12.5px; line-height: 1.4; color: #A15C00; background: #FFF6E5; border: 1px solid #FFD9A0; border-radius: 8px; padding: 4px 8px; }

/* Voice drawer: clear on/off switch */
.sn-voice-seg { display: inline-flex; align-self: flex-start; gap: 3px; padding: 3px; border-radius: 9999px; background: #ECECF1; }
.sn-voice-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 18px; border: 0; border-radius: 9999px; background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: #5C5C61; cursor: pointer; }
.sn-voice-seg button.on { background: var(--sn-accent); color: #FFFFFF; box-shadow: 0 2px 8px var(--sn-accent-shadow); }
.sn-voice-seg button:focus-visible { outline: 2px solid var(--sn-accent); outline-offset: 2px; }
.sn-voice-note { font-size: 13.5px; color: #6E6E73; }
.sn-opt-card.muted { opacity: .45; }
.sn-opt-card.muted:hover { opacity: .8; }

/* Generating screen: keep-running note + stop */
.sn-gen-actions { width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 18px; box-sizing: border-box; border-radius: 18px; background: #F2F8F3; border: 1px solid #CDEBD4; }
.sn-gen-actions > span { display: flex; align-items: flex-start; gap: 8px; flex: 1 1 320px; font-size: 14px; line-height: 1.5; color: #2D5A36; }
.sn-gen-actions > span svg { flex: 0 0 auto; margin-top: 2px; }
.sn-gen-stop { flex: 0 0 auto; min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #E5B8AE; background: #FFFFFF; color: #C9341C; font: 600 14px/1 inherit; cursor: pointer; }
.sn-gen-stop:hover { background: #FFF1EE; border-color: #C9341C; }
.sn-gen-stop:focus-visible { outline: 2px solid #C9341C; outline-offset: 2px; }
.sn-char-tag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #FCE7EF; color: #A3214F; font-size: 12.5px; font-weight: 600; vertical-align: middle; }

/* Voice gender check */
.sn-voice-warn { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #FFF1EE; border: 1px solid #F5C2B8; color: #9A2A14; font-size: 12.5px; line-height: 1.45; }
.sn-voice-warn-act { display: flex; gap: 6px; flex-wrap: wrap; }
.sn-voice-warn-act button { min-height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: #C9341C; color: #FFFFFF; font: 600 12.5px/1 inherit; cursor: pointer; }
.sn-voice-warn-act button.ghost { background: #FFFFFF; color: #9A2A14; border: 1px solid #F5C2B8; }
.sn-voice-ok { display: inline-block; font-size: 12px; color: #248A3D; }
.sn-tle-clip.voicewarn { box-shadow: inset 0 0 0 2.5px #FF3B30; }
.sn-tle-clip.voicewarn .name::before { content: '⚠ '; }
.sn-tle-clip.voicewarn.sel { box-shadow: inset 0 0 0 2.5px #FF9F0A, 0 0 0 2px #FF3B30; }
.sn-tle-voice.voicewarn { border-color: #FF3B30; background: #FFE0DC repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,59,48,.45) 3px 4px, transparent 4px 6px); }
.sn-tle-insp-warn { font-size: 13px; color: #C9341C; font-weight: 600; }

/* Script score panel */
.sn-audit { border-radius: 18px; background: #FFFFFF; border: 1px solid #ECECF0; box-shadow: var(--sn-shadow-card); overflow: hidden; }
.sn-audit > summary { list-style: none; display: flex; align-items: center; gap: 16px; padding: 14px 18px; cursor: pointer; }
.sn-audit > summary::-webkit-details-marker { display: none; }
.sn-audit-score { flex: 0 0 auto; min-width: 74px; text-align: center; font: 800 28px/1 Inter, sans-serif; color: #248A3D; }
.sn-audit.fail .sn-audit-score { color: #C9341C; }
.sn-audit-score small { font-size: 13px; font-weight: 600; color: #8E8E93; }
.sn-audit-head { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; color: #6E6E73; }
.sn-audit-head b { font-size: 15px; color: #1D1D1F; }
.sn-audit-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 0 18px 18px; }
.sn-audit-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sn-audit-items > li { padding: 8px 10px; border-radius: 10px; background: #F2F8F3; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 13.5px; }
.sn-audit-items > li.bad { background: #FFF4F1; }
.sn-audit-items .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.sn-audit-items > li.good .pts { color: #248A3D; } .sn-audit-items > li.bad .pts { color: #C9341C; }
.sn-audit-items ul { grid-column: 1 / -1; margin: 2px 0 0; padding-left: 18px; color: #9A2A14; font-size: 12.5px; }
.sn-audit-cmds { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sn-audit-cmds details { border: 1px solid #ECECF0; border-radius: 10px; background: #FAFAFC; }
.sn-audit-cmds summary { padding: 8px 10px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sn-audit-pre { margin: 0; padding: 10px; max-height: 320px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, Consolas, monospace; color: #3A3A3C; border-top: 1px solid #ECECF0; }
@media (max-width: 900px) { .sn-audit-body { grid-template-columns: 1fr; } }
.sn-gen-decide { width: 100%; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 18px; background: #FFF6E5; border: 1px solid #FFD9A0; color: #6B4300; font-size: 14px; line-height: 1.5; }
.sn-gen-decide b { font-size: 16px; color: #8A4B00; }
.sn-gen-decide-act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.sn-gen-decide-act button { min-height: 42px; padding: 0 18px; border-radius: 999px; border: 1.5px solid #E0B97A; background: #FFFFFF; color: #6B4300; font: 600 14px/1 inherit; cursor: pointer; }
.sn-gen-decide-act button.pri { background: var(--sn-accent); border-color: var(--sn-accent); color: #FFFFFF; }
