/* ── CapCut Pro + Vrew Hybrid Video Editor CSS ── */
:root {
  --qp-bg-dark: #08080d;
  --qp-bg-panel: #0f0f18;
  --qp-bg-card: #151522;
  --qp-bg-hover: #1e1e30;
  --qp-border: rgba(255, 255, 255, 0.08);
  --qp-border-active: #06b6d4;
  --qp-cyan: #06b6d4;
  --qp-pink: #ec4899;
  --qp-purple: #8b5cf6;
  --qp-emerald: #10b981;
  --qp-amber: #f59e0b;
  --qp-rose: #f43f5e;
  --qp-text-main: #f8fafc;
  --qp-text-muted: #94a3b8;
  --qp-text-dim: #64748b;
  --qp-radius: 10px;
}

/* ── 메인 에디터 컨테이너 ── */
#page-editor {
  background: var(--qp-bg-dark);
  color: var(--qp-text-main);
  padding: 0;
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#page-editor input,
#page-editor textarea,
#page-editor [contenteditable="true"] {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* ── 1. 상단 CapCut 프로 리본 툴바 (Top Ribbon) ── */
.qp-capcut-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  background: rgba(15, 15, 24, 0.95);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--qp-border);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(236, 72, 153, 0.45) transparent;
}

.qp-capcut-topbar::-webkit-scrollbar {
  height: 4px;
}
.qp-capcut-topbar::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.25);
}
.qp-capcut-topbar::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #ec4899, #8b5cf6);
  border-radius: 4px;
}
.qp-capcut-topbar::-webkit-scrollbar-thumb:hover {
  background: #ec4899;
}

.qp-capcut-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.qp-capcut-logo-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.qp-capcut-logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--qp-cyan), var(--qp-emerald));
  box-shadow: 0 0 10px var(--qp-cyan);
}

.qp-capcut-ratio-select {
  background: #141420;
  color: #fff;
  border: 1px solid var(--qp-border);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 750;
  padding: 5px 8px;
  cursor: pointer;
  outline: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.qp-capcut-topbar-center {
  display: flex;
  align-items: center;
  gap: 2px;
  background: transparent;
  padding: 0 4px;
  border-radius: 0;
  border: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.tl-tool-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #cbd5e1;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.12s ease, color 0.12s ease;
}
.tl-tool-icon:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.tl-tool-icon.snap-active {
  color: var(--qp-cyan);
  background: rgba(6, 182, 212, 0.12);
}
.tl-tool-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 6px;
  flex-shrink: 0;
}

.qp-capcut-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-left: auto;
  white-space: nowrap;
}

.qp-capcut-topbar-right button,
.qp-capcut-topbar-right a,
.qp-capcut-topbar-center button {
  flex-shrink: 0;
  white-space: nowrap;
}

.qp-btn-export-primary {
  background: linear-gradient(135deg, #10b981, #06b6d4) !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  font-size: 13px !important;
  padding: 8px 18px !important;
  border-radius: 8px !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.5) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}
.qp-btn-export-primary:hover {
  transform: translateY(-1px) scale(1.02);
  filter: brightness(1.15);
  box-shadow: 0 4px 22px rgba(6, 182, 212, 0.75) !important;
}

/* ── 2. CapCut 3단 스튜디오 레이아웃 ── */
.qp-capcut-studio-grid {
  display: grid;
  grid-template-columns: 290px 1fr 310px;
  gap: 12px;
  padding: 14px 18px 8px;
  min-height: min(380px, 42vh);
  box-sizing: border-box;
}

@media (max-width: 1280px) {
  .qp-capcut-studio-grid {
    grid-template-columns: 260px 1fr 280px;
    gap: 10px;
    padding: 10px;
  }
}

@media (max-width: 960px) {
  .qp-capcut-studio-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 좌측 도구 독 (Left Dock) ── */
.qp-dock-panel {
  background: var(--qp-bg-panel);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.qp-dock-tabs {
  display: flex;
  border-bottom: 1px solid var(--qp-border);
  background: #12121e;
  overflow-x: auto;
}

.qp-dock-tab-btn {
  flex: 1;
  padding: 10px 6px;
  background: none;
  border: none;
  color: var(--qp-text-muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.qp-dock-tab-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.03);
}

.qp-dock-tab-btn.active {
  color: var(--qp-cyan);
  border-bottom-color: var(--qp-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.qp-dock-content {
  padding: 12px;
  flex: 1;
  overflow-y: auto;
  max-height: 520px;
}

/* ── 중앙 캔버스 스테이지 (Center Canvas) ── */
.qp-stage-panel {
  background: var(--qp-bg-panel);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.qp-canvas-phone-frame {
  position: relative;
  background: #000;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.15);
  box-shadow: 0 12px 40px rgba(0,0,0,0.8), 0 0 0 1px rgba(6, 182, 212, 0.2);
  overflow: hidden;
  aspect-ratio: 9 / 16;
  width: auto;
  min-width: 200px;
  min-height: 320px;
  max-width: 340px;
  max-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qp-canvas-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.qp-canvas-subtitle-overlay {
  position: absolute;
  bottom: 12%;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  max-width: 88%;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
  color: #fbbf24;
  text-shadow: 0 2px 8px rgba(0,0,0,0.9), 0 0 4px #000;
  pointer-events: none;
  z-index: 10;
  line-height: 1.35;
  box-sizing: border-box;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: normal;
}

.qp-canvas-top-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 12;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: rgba(0, 0, 0, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: -0.2px;
  transition: all 0.2s ease;
}

.qp-stage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 520px;
  margin-top: 12px;
  padding: 6px 12px;
  background: #141420;
  border: 1px solid var(--qp-border);
  border-radius: 10px;
}

.qp-stage-timecode {
  font-size: 12px;
  font-weight: 850;
  font-family: monospace;
  color: var(--qp-cyan);
}

/* ── 우측 인스펙터 패널 (Right Inspector) ── */
.qp-inspector-panel {
  background: var(--qp-bg-panel);
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  padding: 14px;
  overflow-y: auto;
  max-height: calc(100vh - 360px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}

.qp-inspector-section {
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--qp-border);
}

.qp-inspector-title {
  font-size: 11.5px;
  font-weight: 850;
  color: #fff;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── ⚡ 배속 조절 (Speed) 버튼 스타일 ── */
.tl-speed-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 750;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  user-select: none;
}
.tl-speed-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}
.tl-speed-btn:active {
  transform: translateY(0);
}
.tl-speed-btn.active {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── 🎨 시네마틱 필터 (Color) 버튼 스타일 ── */
.tl-filter-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 750;
  padding: 7px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: center;
  user-select: none;
}
.tl-filter-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
  transform: translateY(-1px);
}
.tl-filter-btn:active {
  transform: translateY(0);
}
.tl-filter-btn.active {
  background: linear-gradient(135deg, #06b6d4, #8b5cf6) !important;
  border-color: #a855f7 !important;
  color: #ffffff !important;
  font-weight: 900 !important;
  box-shadow: 0 0 12px rgba(139, 92, 246, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── 3. 하단 멀티트랙 타임라인 & Vrew 듀얼 뷰 ── */
.qp-timeline-container {
  padding: 0 18px 18px;
  min-height: min(46vh, 520px);
}

.qp-view-switch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.qp-view-toggle-group {
  display: flex;
  background: #12121c;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--qp-border);
  gap: 2px;
}

.qp-view-toggle-btn {
  background: none;
  border: none;
  color: var(--qp-text-muted);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.qp-view-toggle-btn.active {
  background: linear-gradient(135deg, var(--qp-cyan), var(--qp-purple));
  color: #fff;
}

/* ── Vrew 스타일 대사 카드 뷰 (Vrew Cards) ── */
.qp-vrew-cards-wrap {
  background: #0d0d16;
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(139,92,246,0.12);
}

.qp-vrew-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}

.qp-vrew-card {
  background: #151524;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.qp-vrew-card:hover {
  border-color: rgba(139,92,246,0.5);
  background: #1c1c30;
}

.qp-vrew-card.active {
  border-color: var(--qp-cyan);
  background: rgba(6,182,212,0.12);
  box-shadow: 0 0 12px rgba(6,182,212,0.25);
}

.qp-vrew-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--qp-text-dim);
}

.qp-vrew-card-time {
  font-weight: 800;
  color: var(--qp-cyan);
  font-family: monospace;
}

.qp-vrew-card-del-btn {
  background: none;
  border: none;
  color: var(--qp-rose);
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
}
.qp-vrew-card-del-btn:hover {
  text-decoration: underline;
}

.qp-vrew-card-textarea {
  width: 100%;
  background: #0a0a10;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  padding: 6px 8px;
  resize: vertical;
  min-height: 42px;
  box-sizing: border-box;
  font-family: inherit;
}
.qp-vrew-card-textarea:focus {
  border-color: var(--qp-purple);
  outline: none;
}

/* ── CapCut 멀티트랙 타임라인 (Timeline Panel) ── */
.tl-panel {
  background: #0a0a12;
  border: 1px solid var(--qp-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,0.6);
  min-height: min(46vh, 500px);
}

.tl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
  padding: 4px 12px;
  border-bottom: 1px solid var(--qp-border);
  background: #0d0d14;
  min-height: 40px;
}

.tl-header h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tl-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tl-duration-label {
  font-size: 11px;
  color: #64748b;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.tl-autosave-badge {
  font-size: 10px;
  color: #475569;
  font-weight: 650;
}

.tl-header-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
}

.tl-chip {
  border: 1px solid rgba(255,255,255,.14);
  background: #181826;
  color: #e2e8f0;
  border-radius: 7px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
}

.tl-chip:hover {
  border-color: var(--qp-cyan);
  color: #fff;
  background: #202035;
}

.tl-chip.primary {
  background: linear-gradient(135deg, var(--qp-cyan), var(--qp-emerald));
  border: none;
  color: #000;
  font-weight: 850;
  box-shadow: 0 2px 10px rgba(6,182,212,0.3);
}

.tl-chip.split {
  background: linear-gradient(135deg, var(--qp-pink), var(--qp-rose));
  border: none;
  color: #fff;
  font-weight: 800;
}

.tl-chip.danger {
  background: rgba(239, 68, 68, .18);
  border-color: rgba(248, 113, 113, .55);
  color: #fca5a5;
}
.tl-chip.danger:hover {
  background: rgba(239, 68, 68, .35);
  color: #fff;
}

.tl-body {
  display: grid;
  grid-template-columns: 132px 1fr;
  min-height: min(44vh, 460px);
}

.tl-labels {
  background: #0b0b12;
  border-right: 1px solid var(--qp-border);
  padding: 28px 0 0;
}

.tl-label {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px 0 14px;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  border-bottom: 1px solid rgba(255,255,255,.04);
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
}
.tl-label-name {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
  color: #cbd5e1;
  letter-spacing: -0.2px;
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  white-space: nowrap;
}
.tl-label[data-label-track="video"] {
  height: 96px;
}

.tl-track-controls {
  display: flex;
  align-items: center;
  gap: 2px;
}

.tl-track-btn {
  background: none;
  border: 1px solid transparent;
  color: rgba(255,255,255,0.35);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  line-height: 1;
  transition: all 0.15s ease;
}
.tl-track-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
}
.tl-track-btn.active-lock {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.4);
}
.tl-track-btn.active-mute {
  color: #f87171;
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.4);
}

.tl-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: #08080e;
  min-height: min(42vh, 430px);
}

.tl-ruler {
  height: 28px;
  position: relative;
  border-bottom: 1px solid var(--qp-border);
  background: #0c0c16;
  min-width: 100%;
  cursor: ew-resize;
  user-select: none;
  touch-action: none;
  z-index: 5;
}

.tl-ruler-mark {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(148,163,184,.3);
  font-size: 9.5px;
  color: #94a3b8;
  padding: 3px 0 0 3px;
  pointer-events: none;
  font-family: monospace;
}

.tl-tracks {
  position: relative;
  min-width: 100%;
  min-height: min(40vh, 400px);
  z-index: 20;
}

.tl-track {
  position: relative;
  height: 64px;
  border-bottom: 1px solid rgba(255,255,255,.04);
  background-image: none;
}

.tl-track[data-track="video"] {
  height: 96px;
}

.tl-track.locked {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.4) 10px,
    rgba(255, 255, 255, 0.03) 10px,
    rgba(255, 255, 255, 0.03) 20px
  );
}

.tl-track.locked .tl-clip {
  opacity: 0.65;
  filter: grayscale(0.4);
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.tl-clip {
  position: absolute;
  top: 8px;
  height: 48px;
  border-radius: 0px;
  border: 1px solid rgba(255,255,255,.15);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  padding: 0 8px;
  display: flex;
  align-items: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: grab;
  user-select: none;
  box-shadow: none;
  box-sizing: border-box;
}

.tl-clip:active { cursor: grabbing; }
.tl-clip.video {
  height: 80px;
  padding: 0;
  background: #0b1120;
  border: none;
  border-right: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 0;
  box-sizing: border-box;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.16);
}
.tl-clip.image { background: linear-gradient(135deg, #065f46, #059669); border-radius: 0px; border: 1px solid rgba(16,185,129,0.4); }
.tl-clip.subtitle { background: linear-gradient(135deg, #581c87, #7c3aed); border-radius: 0px; border: 1px solid rgba(139,92,246,0.4); }
.tl-clip.music { background: linear-gradient(135deg, #9a3412, #d97706); border-radius: 0px; border: 1px solid rgba(245,158,11,0.4); }

.tl-clip-thumb-strip {
  position: absolute;
  inset: 0;
  display: flex;
  overflow: hidden;
  pointer-events: none;
  opacity: 0.92;
  z-index: 1;
  background: #0f172a;
  border-radius: 0px;
}

.tl-clip-thumb-img {
  height: 100%;
  width: 58px;
  object-fit: cover;
  border-right: 1px solid rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
  border-radius: 0;
}

.tl-clip-header-badge {
  position: absolute;
  top: 3px;
  left: 6px;
  font-size: 10px;
  font-weight: 850;
  color: #fff;
  background: rgba(0,0,0,0.85);
  padding: 1px 5px;
  border-radius: 3px;
  z-index: 3;
  text-shadow: 0 1px 2px #000;
  border: 1px solid rgba(255,255,255,0.2);
  pointer-events: none;
  max-width: calc(100% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-clip.selected {
  outline: 1px solid #67e8f9;
  outline-offset: -1px;
  box-shadow: none;
  z-index: 5;
}

.tl-clip .tl-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
  cursor: ew-resize;
  z-index: 6;
  border-radius: 0;
}
.tl-clip:hover .tl-handle,
.tl-clip.selected .tl-handle {
  background: rgba(255, 255, 255, 0.55);
}
.tl-clip .tl-handle.left { left: 0; }
.tl-clip .tl-handle.right { right: 0; }

/* ✂️ CapCut 스타일 컷 분할(자르기) 및 🗑️ 삭제 퀵 액션 버튼 */
.tl-clip-quick-split,
.tl-clip-quick-del {
  position: absolute;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  padding: 0;
  font-size: 11px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

.tl-clip-quick-split {
  right: 26px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(56, 189, 248, 0.55);
  color: #38bdf8;
}

.tl-clip-quick-del {
  right: 4px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #ef4444;
}

.tl-clip:hover .tl-clip-quick-split,
.tl-clip:hover .tl-clip-quick-del,
.tl-clip.selected .tl-clip-quick-split,
.tl-clip.selected .tl-clip-quick-del {
  display: flex !important;
}

.tl-clip-quick-split:hover {
  background: #0284c7;
  border-color: #38bdf8;
  color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.85);
}

.tl-clip-quick-del:hover {
  background: #dc2626;
  border-color: #f87171;
  color: #ffffff;
  transform: scale(1.2);
  box-shadow: 0 0 8px rgba(220, 38, 38, 0.85);
}

/* 툴바 강조 자르기 버튼 스타일 */
.tl-split-highlight-btn {
  min-width: 74px !important;
  gap: 4px !important;
  padding: 0 8px !important;
  font-weight: 800 !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.12) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  transition: all 0.15s ease !important;
}
.tl-split-highlight-btn:hover {
  background: rgba(56, 189, 248, 0.25) !important;
  border-color: #38bdf8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.4) !important;
  transform: translateY(-1px);
}

.tl-transition-mark {
  position: absolute;
  top: 8px;
  height: 80px;
  background: rgba(139, 92, 246, 0.35);
  border: 1px dashed rgba(192, 132, 252, 0.8);
  border-radius: 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  z-index: 4;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.tl-playhead {
  position: absolute;
  top: -28px;
  bottom: 0;
  width: 2px;
  margin-left: 0;
  background: #ffffff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8), 0 0 10px rgba(56, 189, 248, 0.6);
  z-index: 50;
  pointer-events: auto;
  cursor: ew-resize;
  transform: translateX(-1px);
  user-select: none;
  touch-action: none;
}
.tl-playhead::before {
  content: '';
  position: absolute;
  top: 0px;
  left: -7px;
  width: 16px;
  height: 18px;
  background: #ffffff;
  clip-path: polygon(0 0, 100% 0, 100% 65%, 50% 100%, 0 65%);
  cursor: ew-resize;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
  transition: transform 0.1s ease, background 0.1s ease;
  z-index: 52;
}
.tl-playhead:hover::before,
.tl-playhead:active::before {
  transform: scale(1.18);
  background: #38bdf8;
}
.tl-playhead::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -12px;
  width: 26px;
  cursor: ew-resize;
  z-index: 51;
}

.tl-range-sel {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(244, 63, 94, 0.25);
  border: 1.5px solid rgba(251, 113, 133, 0.85);
  pointer-events: none;
  z-index: 8;
  border-radius: 4px;
}

/* ══════════════════════════════════════════════════════════════
   🎬 CapCut 스타일 온캔버스 자막 자유 드래그 & 마우스 크기 조절
══════════════════════════════════════════════════════════════ */
.tl-subtitle-overlay {
  position: absolute;
  left: 0;
  right: 0;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
  max-width: 88%;
  bottom: 12%;
  z-index: 20;
  text-align: center;
  cursor: grab;
  user-select: none;
  touch-action: none;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1.5px dashed transparent;
  box-sizing: border-box;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: normal;
  line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.tl-subtitle-overlay:hover,
.tl-subtitle-overlay.tl-sub-active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
  cursor: grabbing;
}

.tl-sub-content {
  pointer-events: none;
  width: 100%;
}

.tl-sub-resizer {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #38bdf8;
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
  display: none;
  z-index: 25;
  pointer-events: auto;
  transition: transform 0.15s ease, background 0.15s ease;
}
.tl-subtitle-overlay:hover .tl-sub-resizer,
.tl-subtitle-overlay.tl-sub-active .tl-sub-resizer {
  display: block;
}
.tl-sub-resizer:hover {
  transform: scale(1.35);
  background: #0284c7;
}

.tl-sub-resizer.tl-sub-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.tl-sub-resizer.tl-sub-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.tl-sub-resizer.tl-sub-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.tl-sub-resizer.tl-sub-se { bottom: -6px; right: -6px; cursor: nwse-resize; }

.tl-sub-tooltip {
  position: absolute;
  top: -34px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(13, 13, 20, 0.95);
  color: #38bdf8;
  font-size: 11px;
  font-weight: 900;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #38bdf8;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7);
  display: none;
  z-index: 30;
}

.tl-status {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--qp-text-muted);
  background: #0d0d16;
  border-top: 1px solid var(--qp-border);
}

/* 📦 템플릿 자료실 & BGM 카드 UI */
.qp-stock-card:hover {
  border-color: var(--qp-cyan) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.tl-chip {
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--qp-text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tl-chip:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}
.tl-chip.active {
  background: var(--qp-cyan);
  border-color: var(--qp-cyan);
  color: #000;
  font-weight: 800;
}

/* 🎬 영상 / 🖼️ 이미지 구분 세그먼트 컨트롤러 (Pill Bar) */
.qp-stock-type-pill-bar {
  display: flex !important;
  background: #090912 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 8px !important;
  padding: 3px !important;
  gap: 3px !important;
  margin-bottom: 10px !important;
}
.qp-stock-type-btn {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  border-radius: 6px !important;
  color: #94a3b8 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 6px 0 !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-align: center !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}
.qp-stock-type-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.06) !important;
}
.qp-stock-type-btn.active {
  background: linear-gradient(135deg, #0284c7, #2563eb) !important;
  color: #ffffff !important;
  font-weight: 850 !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.4) !important;
}

/* 📦 템플릿 자료실 & 독 탭 가로/세로 스크롤바 초슬림 정돈 */
#editorStockCatFilters {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding: 4px 2px 8px 2px;
  margin-bottom: 12px;
  margin-top: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(56, 189, 248, 0.4) transparent;
}
#editorStockCatFilters::-webkit-scrollbar {
  height: 4px;
}
#editorStockCatFilters::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}
#editorStockCatFilters::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.4);
  border-radius: 4px;
}
#editorStockCatFilters::-webkit-scrollbar-thumb:hover {
  background: var(--qp-cyan);
}

.qp-dock-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
  padding-bottom: 4px;
}
.qp-dock-tabs::-webkit-scrollbar {
  height: 3px;
}
.qp-dock-tabs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

#editorStockGrid {
  max-height: 420px;
  overflow-y: auto;
  padding-top: 6px;
  padding-right: 4px;
}
#editorStockGrid::-webkit-scrollbar {
  width: 4px;
}
#editorStockGrid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* 🎭 드라마 배우 보이스 카드 & 감정 배정 스타일 */
.qp-actor-card:hover {
  border-color: rgba(192, 132, 252, 0.5) !important;
  background: #101024 !important;
}
.qp-actor-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  background: rgba(192, 132, 252, 0.15);
  color: #c084fc;
}

/* ── 🎤 Vrew 대사 카드 스마트 확장/축소 (기본 자막 편집 최우선 UI) ── */
.qp-vrew-card .qp-vrew-card-voice-settings,
.qp-vrew-card .qp-vrew-card-translation-settings {
  display: none !important;
}

.qp-vrew-card:hover .qp-vrew-card-voice-settings,
.qp-vrew-card.active .qp-vrew-card-voice-settings,
.qp-vrew-card:hover .qp-vrew-card-translation-settings,
.qp-vrew-card.active .qp-vrew-card-translation-settings {
  display: flex !important;
}

/* ── CapCut-style right-click context menu ── */
.tl-ctx-menu {
  position: fixed;
  z-index: 40000;
  min-width: 248px;
  max-width: 320px;
  padding: 6px 0;
  background: rgba(32, 32, 36, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.2;
  user-select: none;
}
.tl-ctx-menu[hidden] {
  display: none !important;
}
.tl-ctx-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 8px;
  font-weight: 750;
  font-size: 12.5px;
  color: #e2e8f0;
}
.tl-ctx-head-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #0b1220;
  flex-shrink: 0;
}
.tl-ctx-sep {
  height: 1px;
  margin: 5px 0;
  background: rgba(255, 255, 255, 0.08);
}
.tl-ctx-item,
.tl-ctx-parent {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  padding: 0 14px;
  border: none;
  background: transparent;
  color: #f8fafc;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-sizing: border-box;
}
.tl-ctx-item:hover,
.tl-ctx-parent:hover {
  background: rgba(56, 189, 248, 0.14);
}
.tl-ctx-item.disabled,
.tl-ctx-parent.disabled {
  color: #64748b;
  pointer-events: none;
  cursor: default;
}
.tl-ctx-ico {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: 12px;
  opacity: 0.9;
}
.tl-ctx-label {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
}
.tl-ctx-kbd {
  margin-left: auto;
  padding-left: 16px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.tl-ctx-arrow {
  margin-left: auto;
  color: #94a3b8;
  font-size: 11px;
}
.tl-ctx-sub {
  display: none;
  position: absolute;
  left: calc(100% - 6px);
  top: -6px;
  min-width: 200px;
  padding: 6px 0;
  background: rgba(32, 32, 36, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
  z-index: 2;
}
.tl-ctx-parent:hover > .tl-ctx-sub,
.tl-ctx-parent:focus-within > .tl-ctx-sub {
  display: block;
}
.tl-ctx-parent.open-left > .tl-ctx-sub {
  left: auto;
  right: calc(100% - 6px);
}

.tl-clip.muted,
.tl-clip.disabled-clip {
  opacity: 0.42;
}

/* ══════════════════════════════════════════════════════════════════════════
   🎬 CapCut Pro 1:1 Enhanced Video Editor Styles (User Requested)
   ══════════════════════════════════════════════════════════════════════════ */

/* ── 1. 최상단 10대 카테고리 메뉴 탭바 (Top Navigation Tabs) ── */
.qp-capcut-nav-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #11111a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 14px 2px 14px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
}
.qp-capcut-nav-bar::-webkit-scrollbar {
  display: none;
}
.qp-capcut-nav-tab {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 14px 4px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  border-radius: 4px 4px 0 0;
}
.qp-capcut-nav-tab:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}
.qp-capcut-nav-tab.active {
  color: #06b6d4;
  border-bottom-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}
.qp-capcut-nav-tab .tab-icon {
  font-size: 14px;
  line-height: 1;
}

/* ── 2. 타임라인 상단 전용 툴바 스트립 (Timeline Dedicated Toolbar) ── */
.tl-capcut-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #14141e;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 10px;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.tl-capcut-strip-left,
.tl-capcut-strip-right {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}
.tl-capcut-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  min-width: 28px;
  padding: 0 6px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s ease;
  gap: 3px;
}
.tl-capcut-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.12);
}
.tl-capcut-btn:active {
  background: rgba(255, 255, 255, 0.14);
}
.tl-capcut-btn.active,
.tl-capcut-btn.snap-active {
  background: rgba(6, 182, 212, 0.18);
  color: #06b6d4;
  border-color: rgba(6, 182, 212, 0.45);
}
.tl-capcut-btn.danger:hover {
  background: rgba(244, 63, 94, 0.2);
  color: #f43f5e;
  border-color: rgba(244, 63, 94, 0.4);
}
.tl-strip-sep {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.12);
  margin: 0 4px;
}
.tl-zoom-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 6px;
}
.tl-zoom-slider {
  width: 80px;
  height: 4px;
  accent-color: #06b6d4;
  cursor: pointer;
}

/* ── 3. 우측 인스펙터 영상 변형(Transform) 컨트롤 ── */
.qp-inspector-transform {
  background: #0f0f18;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 12px;
}
.qp-insp-subtabs {
  display: flex;
  gap: 4px;
  background: #08080d;
  padding: 2px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.qp-insp-subtab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}
.qp-insp-subtab-btn.active {
  background: #1c1c2b;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.qp-transform-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 11px;
}
.qp-transform-label {
  color: #94a3b8;
  font-weight: 700;
  min-width: 65px;
}
.qp-transform-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}
.qp-transform-slider-wrap input[type="range"] {
  flex: 1;
  accent-color: #06b6d4;
  cursor: pointer;
}
.qp-transform-val-badge {
  min-width: 42px;
  font-family: monospace;
  font-weight: 800;
  font-size: 10.5px;
  color: #fff;
  background: #151522;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: right;
}
.qp-transform-num-input {
  width: 54px;
  background: #151522;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  padding: 2px 4px;
  text-align: center;
}
.qp-align-btn-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  margin-top: 6px;
  margin-bottom: 8px;
}
.qp-align-btn {
  background: #141420;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 2px;
  cursor: pointer;
  text-align: center;
  transition: all 0.12s;
}
.qp-align-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #06b6d4;
}

/* ── 4. 캡컷 스타일 프로젝트 세부 정보 모달 (Image 4 1:1) ── */
.qp-project-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qp-project-modal-card {
  width: 520px;
  max-width: 95vw;
  background: #161622;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  color: #f1f5f9;
  font-family: inherit;
}
.qp-project-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.qp-project-modal-title {
  font-size: 14px;
  font-weight: 850;
  color: #06b6d4;
  letter-spacing: -0.2px;
}
.qp-project-modal-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 12px;
}
.qp-proj-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 10px;
}
.qp-proj-label {
  color: #94a3b8;
  font-weight: 700;
}
.qp-proj-val {
  color: #fff;
}
.qp-proj-input {
  background: #0d0d15;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 6px 10px;
  color: #fff;
  font-size: 12px;
  width: 100%;
  box-sizing: border-box;
}
.qp-project-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px;
  background: #11111a;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
