.timeline-root {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: var(--panel-2);
}
.timeline-viewport { position: absolute; inset: 0; overflow: auto; background: #f8fdff; }
.timeline-content { position: relative; min-height: 420px; }
.timeline-ruler {
  position: sticky;
  top: 0;
  height: 34px;
  z-index: 10;
  background: #e7f5fb;
  border-bottom: 1px solid var(--line);
}
.timeline-track { position: absolute; left: 0; right: 0; height: 64px; border-bottom: 1px solid var(--line); }
.timeline-track.source { top: 44px; }
.timeline-track.subtitle { top: 108px; height: 38px; }
.timeline-track.vad { top: 146px; height: 50px; }
.timeline-track.dub1 { top: 210px; }
.timeline-track.dub2 { top: 274px; }
.timeline-track.dub3 { top: 338px; }
.track-label {
  position: sticky;
  left: 8px;
  width: 58px;
  z-index: 20;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel);
  color: #087a9d;
  text-align: center;
}
.track-controls { display: flex; justify-content: center; gap: 2px; margin-top: 3px; }
.track-toggle {
  width: 22px;
  min-width: 22px;
  height: 20px;
  padding: 0;
  border-color: #b8dce5;
  background: #f8fdff;
  color: #52717a;
  font-size: 10px;
}
.track-toggle.active { border-color: var(--pink); background: #ffe5f1; color: #b51862; }
.audio-block {
  position: absolute;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 4px;
  background: var(--blue);
  color: #ffffff;
  cursor: grab;
  user-select: none;
}
.audio-block.source { background: #8fd8c4; border-color: #6ec5ad; color: #164f43; cursor: default; }
.audio-block.subtitle { height: 30px; background: #a5dfed; border-color: #8bcfdf; color: var(--text); cursor: pointer; }
.audio-block.vad { height: 38px; background: #f8d486; border-color: #d9aa45; color: #5b4215; cursor: grab; }
.audio-block.vad .left-resize-handle { position: absolute; left: 0; top: 0; bottom: 0; width: 7px; cursor: ew-resize; z-index: 4; }
.audio-block.smoke-audio {
  background: repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 2px, rgba(255,255,255,0) 2px 9px), linear-gradient(90deg, #00aeea, #37cae9);
}
.audio-block.selected { outline: 2px solid var(--pink); box-shadow: 0 0 0 2px rgba(255, 79, 163, .22); }
.audio-block.resizing { outline: 2px solid var(--pink); box-shadow: 0 0 0 2px rgba(255, 79, 163, .22); }
.audio-block.overlap { border-top: 3px solid var(--pink); box-shadow: inset 0 3px 0 rgba(255, 79, 163, .35); }
.audio-block .label {
  position: absolute;
  top: 3px;
  right: 14px;
  left: 8px;
  z-index: 3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 11px;
  text-shadow: 0 1px 2px rgba(19, 33, 58, .55);
}
.audio-block canvas, .audio-block .block-waveform { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .9; pointer-events: none; }
.audio-block .block-speed-badge { position:absolute; left:4px; top:3px; z-index:6; min-width:28px; padding:1px 6px; border-radius:10px; background:#07883f; color:#fff; font-size:11px; font-weight:800; line-height:16px; box-shadow:0 1px 2px rgba(0,0,0,.18); }
.audio-block .block-speed-badge.warning { background:#f59f00; }
.audio-block.has-speed-badge .label { left:8px; top:19px; }
.audio-block.source .block-waveform { background: #8fd8c4; }
.right-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(12px, 35%);
  z-index: 5;
  cursor: ew-resize;
  background: linear-gradient(90deg, rgba(255,79,163,0), rgba(255,79,163,.28));
}
.right-resize-handle::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 2px;
  width: 3px;
  height: 22px;
  border-right: 2px solid rgba(255,255,255,.85);
  border-left: 2px solid rgba(255,255,255,.85);
}
.playhead { position: absolute; top: 0; bottom: 0; width: 2px; z-index: 30; background: var(--pink); pointer-events: none; }
