:root {
    --time-scrubber-track-height: 4px;
    --time-scrubber-thumb-size: 16px;
    --time-scrubber-tooltip-background: rgba(0, 0, 0, 0.82);
}

input[type="range"].video-progressbar {
    -webkit-appearance: none;
    display: block;
    width: 100%;
    height: var(--time-scrubber-track-height);
    background: var(--bs-secondary);
    border-radius: 2px;
    outline: none;
    opacity: 0.9;
    transition: opacity 0.15s ease-in-out;
}

input[type="range"].video-progressbar::-webkit-slider-runnable-track {
    width: 100%;
    height: var(--time-scrubber-track-height);
    background: var(--bs-secondary);
    border-radius: 2px;
    cursor: pointer;
}

input[type="range"].video-progressbar::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--time-scrubber-thumb-size);
    height: var(--time-scrubber-thumb-size);
    margin-top: -6px;
    background: var(--bs-primary);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

input[type="range"].video-progressbar::-moz-range-track {
    width: 100%;
    height: var(--time-scrubber-track-height);
    background: var(--bs-secondary);
    border-radius: 2px;
    cursor: pointer;
}

input[type="range"].video-progressbar::-moz-range-thumb {
    width: var(--time-scrubber-thumb-size);
    height: var(--time-scrubber-thumb-size);
    background: var(--bs-primary);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s ease-in-out;
}

.slider-timestamp-tooltip,
.chart-scrub-tooltip {
    position: absolute;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--time-scrubber-tooltip-background);
    color: #fff;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    pointer-events: none;
    /* Keep above other UI; large z-index to survive stacking contexts */
    z-index: 2000;
}

.slider-timestamp-tooltip {
    bottom: calc(100% + 4px);
}

.chart-time-axis-strip {
    position: relative;
    flex-shrink: 0;
    height: var(--time-scrubber-track-height);
    margin: 2px 0 4px;
    border-radius: 2px;
    background: var(--bs-secondary);
    opacity: 0.9;
    cursor: pointer;
}

.chart-time-axis-strip:hover {
    opacity: 1;
}

.chart-time-axis-strip.chart-scrubbing {
    cursor: grabbing;
    user-select: none;
}

.chart-time-cursor,
.chart-scrub-indicator {
    position: absolute;
    top: 50%;
    width: var(--time-scrubber-thumb-size);
    height: var(--time-scrubber-thumb-size);
    background: var(--bs-primary);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9;
}

.chart-scrub-tooltip {
    top: -6px;
    transform: translate(-50%, -100%);
}
