#timelineContainer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;

    height: var(--timeline-h);
    background: var(--panel-bg);
    border-top: 2px solid var(--panel-border);

    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 16px;

    z-index: 9999;
}

#timeRangeSelector {
    background: var(--btn-bg);
    color: var(--text-light);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 12px;
}

#timeRangeSelector:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

#timelineTransport {
    display: flex;
    align-items: center;
    gap: 6px;
}

.timeline-btn {
    background: var(--btn-bg);
    color: var(--mint);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.timeline-btn:hover {
    background: var(--btn-hover);
}

#timelineScrubber {
    flex: 1;
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

/* The slider is drawn here, not by the browser (2026-10-07): a native thumb is ~16 px with a 2 px margin in
   Chrome and different elsewhere, so the frame marks (placed for a 14 px thumb) drifted up to ~5 px from the
   thumb -- several stops on a 48 h range. With appearance:none and no margin the thumb's centre travels exactly
   from --tl-thumb/2 to width - --tl-thumb/2 in every browser, and #timelineFrameStates uses the same inset.
   Since 2026-10-11 the track itself is drawn by #timelineFrameStates (one segment per stop, coloured by the
   frames there -- ui/timeline.js renderFrameStates), so the browser's track is transparent and the thumb is
   white with a dark ring, to stand out on green. */
#timelineScrubber {
    --tl-thumb: 14px;
    --tl-track: 6px;
}

#timelineSlider {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

#timelineSlider::-webkit-slider-runnable-track {
    height: var(--tl-track);
    background: transparent;
}

#timelineSlider::-moz-range-track {
    height: var(--tl-track);
    background: transparent;
}

#timelineSlider:focus {
    outline: none;
}

#timelineSlider:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px #0b0f14, 0 0 0 4px var(--mint);
}

#timelineSlider:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 2px #0b0f14, 0 0 0 4px var(--mint);
}

/* The track: as wide as the slider, as tall as --tl-track, centred on it. Segment and NOW positions are
   worked out in px across this width (ui/timeline.js stopSegment). */
#timelineFrameStates {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: var(--tl-track);
    transform: translateY(-50%);
    pointer-events: none;
}

.timeline-coverage {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 3px;
}

.timeline-now-mark {
    position: absolute;
    top: -4px;
    width: 2px;
    height: calc(var(--tl-track) + 8px);
    background: #ffffff;
    box-shadow: 0 0 3px #000;
    transform: translateX(-1px);
}

#timelineSlider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--tl-thumb);
    height: var(--tl-thumb);
    margin-top: calc((var(--tl-track) - var(--tl-thumb)) / 2);
    background: #ffffff;
    border: none;
    box-shadow: 0 0 0 2px #0b0f14;
    border-radius: 50%;
    cursor: pointer;
}

#timelineSlider::-moz-range-thumb {
    width: var(--tl-thumb);
    height: var(--tl-thumb);
    background: #ffffff;
    border: none;
    box-shadow: 0 0 0 2px #0b0f14;
    border-radius: 50%;
    cursor: pointer;
}

/* A fixed width with even-width digits (2026-10-11): it no longer grows and shrinks with the time or the zone,
   which moved the slider. Fits "Sep 30, 23:59 AKDT"; a longer zone name is cut with an ellipsis. */
#timeLabel {
    color: var(--text-light);
    font-size: 14px;
    flex: 0 0 auto;
    width: 10.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    text-align: right;
    cursor: pointer;
    user-select: none;
}

#timeLabel:hover {
    color: var(--mint, #fff);
}

@media (max-width: 760px) {
    #timelineContainer {
        align-items: stretch;
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-rows: auto auto;
        gap: 8px 10px;
        height: var(--timeline-h);
        padding: 8px;
    }

    #timeRangeSelector {
        min-height: 34px;
        padding: 6px 8px;
    }

    #timelineTransport {
        justify-content: flex-end;
        min-width: 0;
    }

    .timeline-btn {
        align-items: center;
        display: inline-flex;
        height: 34px;
        justify-content: center;
        min-width: 34px;
        padding: 0 8px;
    }

    #timelineScrubber {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 24px;
        min-width: 0;
    }

    #timelineScrubber {
        --tl-track: 8px;
    }

    #timeLabel {
        align-self: center;
        font-size: 12px;
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
        min-width: 0;
        overflow: hidden;
        padding: 0 112px 0 64px;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
        width: 100%;
    }
}

@media (max-width: 420px) {
    :root {
        --timeline-h: 104px;
    }

    #timelineContainer {
        gap: 5px 8px;
        grid-template-columns: auto 1fr;
        grid-template-rows: 18px 20px 34px;
        height: var(--timeline-h);
        padding: 6px 10px 7px;
    }

    #timeRangeSelector {
        grid-column: 1;
        grid-row: 3;
        min-height: 32px;
        padding: 4px 8px;
    }

    #timelineTransport {
        grid-column: 2;
        grid-row: 3;
        justify-content: space-between;
    }

    .timeline-btn {
        height: 32px;
        min-width: 32px;
        flex: 1 1 0;
    }

    #timelineScrubber {
        grid-column: 1 / -1;
        grid-row: 2;
        height: 20px;
    }

    #timeLabel {
        grid-column: 1 / -1;
        grid-row: 1;
        padding: 0;
    }
}

/* Away from now (2026-10-07): the bar's top edge takes the offset pill's color (css/layout.css #timeOffset),
   so a scrubbed map is obvious at a glance. Set by ui/timeline.js renderOffset(). */
#bottombar[data-offset="past"] #timelineContainer { border-top-color: #eab308; }
#bottombar[data-offset="future"] #timelineContainer { border-top-color: #6fb7ff; }

/* Playback speed: ½×, 1×, 2×, 4×. */
.timeline-btn.timeline-speed {
    min-width: 38px;
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* The time under the pointer, above the scrubber. */
.timeline-hover-time {
    position: absolute;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    padding: 3px 7px;
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    background: var(--panel-bg);
    color: var(--text-light);
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 2;
}
