/* Timeline engine — Eagle-aligned scrollbar & track */
:root {
  --timeline-track-h: 228px;
  --timeline-ruler-h: 42px;
  --timeline-ruler-head-h: 10px;
}

#timelineTrack {
  position: relative;
  height: 100%;
  min-width: 100%;
  cursor: default;
  --timeline-wave-pad: 0px;
  --timeline-wave-band-h: auto;
}

#multiRangeContainer {
  display: none;
  position: absolute;
  top: calc(var(--timeline-ruler-h) + var(--timeline-wave-pad, 0px));
  left: 0;
  width: 100%;
  height: var(--timeline-wave-band-h, auto);
  bottom: auto;
  z-index: 18;
  pointer-events: none;
}

#multiRangeContainer .saved-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(10, 132, 255, 0.25);
  border-left: 1px solid #0a84ff;
  border-right: 1px solid #0a84ff;
  pointer-events: none;
  box-sizing: border-box;
}

#ioRange {
  z-index: 22;
}

.scrollbar-track {
  height: 15px;
  background: var(--program-chrome-bg, #18191b);
  border-radius: 0;
  position: relative;
  border: 0;
  border-top: 0;
  overflow: hidden;
}

.scrollbar-track::before {
  content: none;
  display: none;
}

#scrollbarThumb {
  position: absolute;
  top: 3px;
  height: 9px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: grab;
  box-sizing: border-box;
  min-width: 20px;
  box-shadow: none;
  border: 0;
}

#scrollbarThumb:active {
  cursor: grabbing;
  background: rgba(255, 255, 255, 0.28);
}

.pr-handle {
  position: absolute;
  top: 1px;
  width: 5px;
  height: 5px;
  background: rgba(18, 18, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  z-index: 10;
  cursor: ew-resize;
}

.pr-handle.handle-left {
  left: 2px;
}

.pr-handle.handle-right {
  right: 2px;
}

#rulerCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--timeline-ruler-h);
  z-index: 4;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--program-chrome-bg, #18191b);
  pointer-events: none;
}

#waveformCanvas {
  position: absolute;
  top: calc(var(--timeline-ruler-h) + var(--timeline-wave-pad, 0px));
  left: 0;
  width: 100%;
  height: var(--timeline-wave-band-h, auto);
  bottom: auto;
  pointer-events: none;
  opacity: 0.88;
  z-index: 1;
}

/* Short strip at bottom of wave viewport — height/top set by drawScoutMarkers. */
#scoutCanvas {
  position: absolute;
  left: 0;
  width: 100%;
  height: 72px;
  top: auto;
  bottom: 0;
  pointer-events: none;
  z-index: 6;
}

/* Waveform track status — shown while cache / decode is in progress */
.waveform-placeholder-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 3;
  margin: 0;
  padding: 0 12px;
  background: none;
  border: none;
  color: rgba(235, 235, 245, 0.42);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  pointer-events: none;
  white-space: normal;
  max-width: min(92%, 480px);
  user-select: none;
}

.waveform-placeholder-hint__sub {
  display: block;
  margin-top: 6px;
  color: var(--cg-brand, #a3e635);
  font-size: 11px;
  font-weight: 500;
}

#ioRange {
  top: calc(var(--timeline-ruler-h) + var(--timeline-wave-pad, 0px));
  height: var(--timeline-wave-band-h, auto);
  bottom: auto;
  background: transparent;
  border: none;
}

.timeline-container {
  position: relative;
  height: var(--timeline-track-h);
  background: var(--program-chrome-bg, #18191b);
  border-radius: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 0;
  scrollbar-width: none;
}

.timeline-container::-webkit-scrollbar {
  display: none;
}

#timelineTrack {
  position: relative;
  height: 100%;
  min-width: 100%;
}

.timeline-wrapper > .scrollbar-track {
  border-radius: 0;
  border-top: none;
}

/* In/out duration badge — inside waveform, below ruler */
.timeline-wrapper .io-duration-float {
  top: calc(var(--timeline-ruler-h, 20px) + 12px);
  bottom: auto;
  z-index: 40;
}

.timeline-wrapper .io-duration-float.is-subtle {
  opacity: 0.72;
  font-size: 10px;
  font-weight: 500;
  color: #aeaeb2;
  background: rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.08);
}

.timeline-wrapper .io-duration-float.is-shot-range {
  top: calc(var(--timeline-ruler-h, 20px) + 22px);
  transform: translateX(-50%);
}
