/* ---- Timeline (playback chrome) ---- */
.spotify-timeline {
  background: linear-gradient(180deg, #141a28 0%, #10141e 100%);
  border-top: 1px solid var(--border-subtle);
  padding: 6px 12px 4px;
  user-select: none;
}

.timeline-track-area {
  position: relative;
  height: 34px;
  margin-bottom: 0;
  cursor: grab;
}

.timeline-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(38, 42, 54, 0.85) 0%, rgba(20, 22, 30, 0.95) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 5px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  user-select: none;
}

.timeline-legend-item {
  display: inline-flex;
  align-items: center;
  padding: 3px 5px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
}

.timeline-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 5px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.timeline-legend-swatch--recording {
  background: linear-gradient(180deg, var(--recording-green) 0%, var(--recording-green-dim) 100%);
  box-shadow: none;
}

.timeline-legend-swatch--range {
  border: 1px solid rgba(46, 184, 92, 0.55);
  background: rgba(46, 184, 92, 0.08);
  height: 7px;
  width: 14px;
}

.timeline-legend-swatch--playhead {
  width: 1px;
  height: 8px;
  border-radius: 0;
  background: var(--playhead-teal);
  box-shadow: none;
}

.timeline-hint {
  margin-top: 3px;
  text-align: center;
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  user-select: none;
}

.timeline-segments-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 9px;
  z-index: 2;
}

.timeline-segment {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 9px;
  min-width: 4px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, #3dd06a 0%, var(--recording-green) 45%, var(--recording-green-dim) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 0 6px rgba(46, 184, 92, 0.22);
  cursor: ew-resize;
  pointer-events: auto;
  touch-action: none;
  transition: filter var(--transition-fast);
}

.timeline-segment:hover {
  filter: brightness(1.08);
}

.timeline-segment:active {
  cursor: col-resize;
}

.timeline-experiments-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 12px);
  height: 8px;
  z-index: 6;
  pointer-events: none;
}

.timeline-experiment-bar {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 4px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow:
    0 0 8px rgba(59, 130, 246, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
  transition: filter 0.12s, transform 0.12s;
}

.timeline-experiment-bar:hover {
  filter: brightness(1.12);
}

.timeline-experiment-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(10, 14, 22, 0.96);
  color: var(--text);
  font-size: 10px;
  white-space: pre-line;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  z-index: 7;
  display: none;
  pointer-events: none;
  max-width: min(320px, 90vw);
  text-align: left;
  line-height: 1.35;
}

.timeline-experiment-tooltip.visible {
  display: block;
}

/* Range selection overlay — spans full track height over recording + experiment bars */
.timeline-range-bracket {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(120, 255, 160, 1);
  background: rgba(70, 220, 115, 0.38);
  box-shadow:
    0 0 0 1px rgba(100, 240, 140, 0.6),
    0 0 18px rgba(80, 230, 120, 0.65);
  pointer-events: none;
  z-index: 8;
  display: none;
  box-sizing: border-box;
}

.timeline-range-bracket.visible {
  display: block;
}

.timeline-playhead {
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 40.5px;
  margin-left: -1.5px;
  transform: translateY(-50%);
  border-radius: 1.5px;
  background: #3ee8dc;
  box-shadow:
    0 0 8px rgba(62, 232, 220, 0.9),
    0 0 18px rgba(62, 232, 220, 0.5);
  pointer-events: none;
  z-index: 9;
  transition: left 0.08s ease-out;
}

.timeline-progress-marker {
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 40.5px;
  margin-left: -1.5px;
  transform: translateY(-50%);
  border-radius: 1.5px;
  background: var(--progress-amber);
  box-shadow: 0 0 6px rgba(212, 160, 74, 0.5);
  z-index: 10;
  display: none;
  cursor: help;
}

.timeline-progress-marker.visible {
  display: block;
}

.timeline-progress-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 8px;
  border-radius: var(--radius-sm);
  background: rgba(46, 184, 92, 0.18);
  z-index: 2;
  display: none;
  pointer-events: none;
}

.timeline-progress-fill.visible {
  display: block;
}

.timeline-progress-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 22, 0.96);
  color: var(--text);
  font-size: 10px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  z-index: 6;
  display: none;
  pointer-events: none;
}

.timeline-progress-tooltip.visible {
  display: block;
}

.timeline-axis {
  position: relative;
  min-height: 32px;
  height: auto;
  margin-top: 0;
  padding: 0 0 4px;
  box-sizing: border-box;
  cursor: grab;
  touch-action: none;
}

.timeline-axis.timeline-panning {
  cursor: grabbing;
  background: rgba(10, 16, 28, 0.25);
}

.timeline-tick {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  min-width: 1px;
}

.timeline-tick--major {
  z-index: 1;
}

.timeline-tick--major::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: 50%;
  width: 1px;
  height: 10px;
  border-radius: 1px;
  background: var(--timeline-tick-major);
  box-shadow: 0 0 4px rgba(200, 205, 240, 0.12);
  transform: translateX(-50%);
}

.timeline-tick--major span {
  font-size: 10px;
  font-weight: 500;
  color: #b8b8d0;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.timeline-tick--minor {
  z-index: 0;
}

.timeline-tick--minor::before {
  content: '';
  position: absolute;
  bottom: 15px;
  left: 50%;
  width: 1px;
  height: 6px;
  border-radius: 1px;
  background: var(--timeline-tick-minor);
  transform: translateX(-50%);
}

.playback-pill-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pb-pill-day-arrow {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-dim);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-ui), border-color var(--transition-ui), transform 0.1s, color var(--transition-ui);
}

.pb-pill-day-arrow:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-strong);
  color: var(--text);
}

.pb-pill-day-arrow:active:not(:disabled) {
  transform: scale(0.96);
}

.pb-pill-day-arrow:disabled {
  opacity: 0.32;
  cursor: not-allowed;
}

.pb-pill-day-arrow:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.timeline-track-area.timeline-panning {
  cursor: grabbing !important;
}

.timeline-track-area.timeline-panning .timeline-segment {
  cursor: grabbing;
}
