/* ---- Spotify-style timeline (UTC day) ---- */
.spotify-timeline {
  background: linear-gradient(180deg, #1c1c26 0%, #18181f 100%);
  border-top: 1px solid var(--border);
  padding: 6px 14px 4px;
  user-select: none;
}

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

.timeline-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 7px;
  border-radius: 9999px;
  background: linear-gradient(180deg, rgba(40, 44, 58, 0.9) 0%, rgba(22, 24, 34, 0.95) 100%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

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

.timeline-segment {
  position: absolute;
  top: 0;
  height: 100%;
  min-width: 6px;
  border-radius: 9999px;
  background: linear-gradient(180deg, #1ed760 0%, #169c46 100%);
  box-shadow:
    0 0 10px rgba(30, 215, 96, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  transition: filter 0.12s, transform 0.12s;
}

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

.timeline-segment:active {
  cursor: grabbing;
}

.timeline-experiments-layer {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% + 8px);
  height: 8px;
  z-index: 2;
  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;
}

.timeline-range-bracket {
  position: absolute;
  top: -2px;
  bottom: -2px;
  border-radius: 9999px;
  border: 2px solid rgba(30, 215, 96, 0.85);
  background: rgba(30, 215, 96, 0.12);
  pointer-events: none;
  z-index: 3;
  display: none;
}

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

.timeline-playhead {
  position: absolute;
  top: -2px;
  width: 2px;
  height: calc(100% + 4px);
  margin-left: -1px;
  border-radius: 1px;
  background: #2dd4bf;
  box-shadow: 0 0 8px rgba(45, 212, 191, 0.65);
  pointer-events: none;
  z-index: 4;
  transition: left 0.08s ease-out;
}

.timeline-progress-marker {
  position: absolute;
  top: -4px;
  width: 3px;
  height: calc(100% + 8px);
  margin-left: -1.5px;
  border-radius: 2px;
  background: #f59e0b;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
  z-index: 5;
  display: none;
  cursor: help;
}

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

.timeline-progress-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 10px;
  border-radius: 9999px;
  background: rgba(30, 215, 96, 0.28);
  box-shadow: 0 0 6px rgba(30, 215, 96, 0.24);
  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: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(200, 255, 245, 0.2);
  background: rgba(12, 18, 24, 0.55);
  color: #d4f5f0;
  font-size: 18px;
  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 0.16s, border-color 0.16s, transform 0.1s, color 0.16s, box-shadow 0.16s;
}

.pb-pill-day-arrow:hover:not(:disabled) {
  background: rgba(20, 200, 170, 0.12);
  border-color: rgba(100, 240, 210, 0.45);
  color: #f0fffd;
  box-shadow: 0 0 12px rgba(20, 180, 150, 0.15);
}

.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: 2px solid rgba(240, 255, 252, 0.7);
  outline-offset: 2px;
}

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