/* Arcana Studio NLE — Center Stage & Multi-Track Timeline */
/* ── Center Column (Stage + Timeline) ────────────────────────────────────── */
.st-center-col {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, #141722 0%, #090a0d 75%);
}

.st-stage-wrap {
  flex: 1;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.st-stage-viewport {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 20px 10px;
  overflow: hidden;
  position: relative;
  container-type: size;
}

.st-canvas-frame {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--st-border-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100cqw - 36px);
  max-height: calc(100cqh - 24px);
  transition: transform 0.15s ease;
}
.st-canvas-frame[data-ratio="16:9"] {
  width: min(calc(100cqw - 36px), calc((100cqh - 24px) * 16 / 9));
  height: min(calc(100cqh - 24px), calc((100cqw - 36px) * 9 / 16));
}
.st-canvas-frame[data-ratio="9:16"] {
  width: min(calc(100cqw - 36px), calc((100cqh - 24px) * 9 / 16));
  height: min(calc(100cqh - 24px), calc((100cqw - 36px) * 16 / 9));
}
.st-canvas-frame[data-ratio="1:1"] {
  width: min(calc(100cqw - 36px), calc(100cqh - 24px));
  height: min(calc(100cqw - 36px), calc(100cqh - 24px));
}

.st-canvas-frame video,
.st-canvas-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}
.st-canvas-frame .st-blur-bg {
  position: absolute;
  inset: -14px;
  z-index: 1;
  width: calc(100% + 28px);
  height: calc(100% + 28px);
  object-fit: cover;
  filter: blur(20px) brightness(0.72) saturate(1.15);
  pointer-events: none;
  background: #000;
}

.st-stage-empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  color: var(--st-muted);
  background: linear-gradient(145deg, rgba(22, 24, 34, 0.9), rgba(10, 11, 16, 0.95));
}
.st-stage-empty h3 { color: var(--st-text); font-size: 15px; font-weight: 600; }
.st-stage-empty p { font-size: 12.5px; max-width: 280px; line-height: 1.5; }

.st-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.st-overlay-text {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  font-weight: 700;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.85);
  text-align: center;
  max-width: 88%;
}
.st-draggable-text {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: move;
  white-space: pre-wrap;
  border: 1.5px solid transparent;
  transition: border-color 0.12s;
}
.st-draggable-text:hover { border-color: rgba(255, 255, 255, 0.5); }
.st-draggable-text.selected { border-color: var(--st-accent-2); box-shadow: 0 0 0 2px rgba(0, 212, 255, 0.25); }
.st-draggable-text.editing {
  cursor: text;
  user-select: text !important;
  -webkit-user-select: text !important;
  border-color: var(--st-accent-2);
  box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.32);
  outline: none;
  min-width: 48px;
}

/* ── Transport Controls Bar ──────────────────────────────────────────────── */
.st-transport {
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  gap: 12px;
  border-top: 1px solid var(--st-border);
  background: rgba(17, 19, 24, 0.85);
}
.st-transport-group { display: flex; align-items: center; gap: 8px; }
.st-play-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: #090a0d;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s;
}
.st-play-btn:hover { transform: scale(1.06); }
.st-timecode {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--st-text);
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, 0.05);
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--st-border);
}
.st-range {
  accent-color: var(--st-accent-2);
  width: 82px;
  cursor: pointer;
}

/* ── Bottom Multi-Track Timeline ─────────────────────────────────────────── */
.st-timeline {
  height: 244px;
  flex-shrink: 0;
  background: var(--st-surface);
  border-top: 1px solid var(--st-border-strong);
  display: flex;
  flex-direction: column;
  min-height: 210px;
}

.st-tl-toolbar {
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--st-border);
  font-size: 12px;
  color: var(--st-muted);
}

.st-tl-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.st-tl-headers {
  width: 146px;
  flex-shrink: 0;
  background: var(--st-panel);
  border-right: 1px solid var(--st-border);
  display: flex;
  flex-direction: column;
}
.st-tl-ruler-corner {
  height: 24px;
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--st-dim);
  letter-spacing: 0.6px;
}
.st-track-head {
  height: 44px;
  padding: 0 8px;
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--st-muted);
}
.st-track-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--st-text);
  margin-right: 5px;
}

.st-tl-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  background: #0d0f14;
}

.st-tl-canvas {
  position: relative;
  min-width: 100%;
  height: 100%;
}

.st-ruler {
  height: 24px;
  border-bottom: 1px solid var(--st-border);
  position: relative;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
}
.st-ruler-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 10px;
  color: var(--st-dim);
  padding: 2px 0 0 4px;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}

.st-track-lane {
  height: 44px;
  border-bottom: 1px solid var(--st-border);
  position: relative;
  display: flex;
  align-items: center;
  transition: background var(--st-dur-fast, 120ms) var(--st-ease-out, ease-out), box-shadow var(--st-dur-fast, 120ms) var(--st-ease-out, ease-out);
}
.st-tl-dragging-asset.st-drag-kind-video #stLaneVideo,
.st-tl-dragging-asset.st-drag-kind-image #stLaneVideo {
  background: rgba(124, 92, 255, 0.07);
}
.st-tl-dragging-asset.st-drag-kind-audio #stLaneVoice {
  background: rgba(139, 92, 246, 0.12);
}
.st-tl-dragging-asset.st-drag-kind-audio #stLaneAudio {
  background: rgba(16, 185, 129, 0.08);
}
.st-track-lane.drop-valid {
  background: rgba(0, 212, 255, 0.11) !important;
  box-shadow: inset 0 0 0 1.5px rgba(0, 212, 255, 0.65);
}
.st-track-lane.drop-invalid {
  background: rgba(248, 113, 113, 0.09) !important;
  box-shadow: inset 0 0 0 1.5px rgba(248, 113, 113, 0.5);
}

.st-drop-indicator {
  position: absolute;
  top: 26px;
  left: 0;
  width: 2px;
  height: 50px;
  background: var(--st-accent-2);
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.75);
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transform: scaleY(0.85);
  transition: opacity var(--st-dur-fast, 120ms) var(--st-ease-out, ease-out), transform var(--st-dur-fast, 120ms) var(--st-ease-out, ease-out);
}
.st-drop-indicator::before,
.st-drop-indicator::after {
  content: "";
  position: absolute;
  left: -3px;
  width: 8px;
  height: 4px;
  border-radius: 2px;
  background: var(--st-accent-2);
}
.st-drop-indicator::before { top: 0; }
.st-drop-indicator::after { bottom: 0; }
.st-drop-indicator.visible {
  opacity: 1;
  transform: scaleY(1);
}

@keyframes stClipSettle {
  from { opacity: 0.72; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}
.st-clip-block.just-dropped {
  animation: stClipSettle 180ms var(--st-ease-out, cubic-bezier(0.22, 1, 0.36, 1)) both;
}

.st-clip-block {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 8px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.st-clip-block.video {
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.42), rgba(59, 130, 246, 0.38));
  border-color: rgba(124, 92, 255, 0.75);
}
.st-clip-block.text {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(234, 88, 12, 0.32));
  border-color: rgba(245, 158, 11, 0.7);
}
.st-clip-block.voice {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.42), rgba(0, 212, 255, 0.34));
  border-color: rgba(167, 139, 250, 0.78);
}
.st-clip-block.audio {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.32), rgba(0, 212, 255, 0.28));
  border-color: rgba(52, 211, 153, 0.7);
}
.st-clip-block.muted { opacity: 0.4; }
.st-clip-block.selected {
  box-shadow: 0 0 0 2px #fff, 0 4px 14px rgba(0, 0, 0, 0.45);
  z-index: 6;
}
.st-clip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  padding: 0 4px;
}
.st-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  cursor: ew-resize;
  background: rgba(255, 255, 255, 0.14);
  transition: background 0.15s;
}
.st-trim-handle:hover { background: rgba(255, 255, 255, 0.55); }
.st-trim-handle.left { left: 0; border-radius: 7px 0 0 7px; z-index: 3; }
.st-trim-handle.right { right: 0; border-radius: 0 7px 7px 0; z-index: 3; }
.st-clip-block.dragging { opacity: 0.45; }
.st-clip-block.drop-target { box-shadow: 0 0 0 2px var(--st-accent-2); }
.st-clip-strip {
  position: absolute;
  inset: 0;
  background-repeat: repeat-x;
  background-size: auto 100%;
  opacity: 0.34;
  pointer-events: none;
}
.st-clip-label { position: relative; z-index: 2; }
.st-fx-pill {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  color: #e0e7ff;
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.st-wave-svg {
  position: absolute;
  inset: 4px 8px;
  width: calc(100% - 16px);
  height: calc(100% - 8px);
  pointer-events: none;
  opacity: 0.8;
}
.st-linked-audio-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 12px;
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(16, 185, 129, 0.28));
  border-top: 1px solid rgba(52, 211, 153, 0.35);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.st-linked-audio-strip .st-wave-svg {
  inset: 0 4px;
  width: calc(100% - 8px);
  height: 100%;
  color: rgba(110, 231, 183, 0.72);
}
.st-linked-audio-strip.muted {
  opacity: 0.28;
  filter: grayscale(1);
}
.st-clip-audio-btn {
  position: relative;
  z-index: 3;
  height: 18px;
  min-width: 20px;
  padding: 0 4px;
  border-radius: 999px;
  border: 1px solid rgba(110, 231, 183, 0.45);
  background: rgba(6, 78, 59, 0.55);
  color: #d1fae5;
  font-size: 9.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.st-clip-audio-btn:hover { background: rgba(16, 185, 129, 0.45); }
.st-clip-audio-btn.muted {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(127, 29, 29, 0.55);
  color: #fecaca;
}
.st-cut-trans-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: #161820;
  color: var(--st-muted);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9;
  padding: 0;
}
.st-cut-trans-btn:hover, .st-cut-trans-btn.active {
  background: var(--st-accent);
  border-color: var(--st-accent-2);
  color: #fff;
}

.st-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--st-playhead);
  z-index: 20;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.7);
}
.st-playhead-handle {
  position: absolute;
  top: 0;
  left: -6px;
  width: 14px;
  height: 14px;
  background: var(--st-playhead);
  clip-path: polygon(0 0, 100% 0, 100% 55%, 50% 100%, 0 55%);
  pointer-events: auto;
  cursor: ew-resize;
}

.st-safe-guides {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.st-safe-top, .st-safe-right, .st-safe-bottom {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(248, 113, 113, 0.16);
  color: rgba(254, 202, 202, 0.9);
  border-color: rgba(248, 113, 113, 0.45);
  border-style: dashed;
  border-width: 0;
}
.st-safe-top { top: 0; left: 0; right: 0; height: 11%; border-bottom-width: 1px; }
.st-safe-right { top: 11%; right: 0; bottom: 22%; width: 16%; border-left-width: 1px; writing-mode: vertical-rl; }
.st-safe-bottom { bottom: 0; left: 0; right: 0; height: 22%; border-top-width: 1px; }
.st-safe-inner {
  position: absolute;
  top: 11%;
  left: 4%;
  right: 16%;
  bottom: 22%;
  border: 1.5px dashed rgba(0, 212, 255, 0.7);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
  color: rgba(0, 212, 255, 0.85);
}

