.timelapse-panel {
    position: absolute;
    z-index: 2650;
    box-sizing: border-box;
    bottom: max(24px, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    display: grid;
    grid-template-columns: 44px minmax(80px, 1fr) 112px 48px auto 44px;
    align-items: center;
    gap: 10px;
    width: min(960px, calc(100% - 176px));
    padding: 10px 12px;
    border: 1px solid var(--popup-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    color: var(--text-color);
    box-shadow: var(--ui-shadow);
    font: 500 13px/1.4 Montserrat, sans-serif;
}
.timelapse-panel[hidden] { display: none; }
.timeline-main, .timeline-toolbar { display: contents; }
.timelapse-panel button { box-sizing: border-box; flex-shrink: 0; min-height: 44px; border: 1px solid transparent; color: var(--text-color); cursor: pointer; font: 600 13px/1 Montserrat, sans-serif; transition: background-color .15s, border-color .15s; -webkit-tap-highlight-color: transparent; }
.timelapse-panel button:disabled { opacity: .4; cursor: default; }
.timelapse-panel button:focus-visible, #timelineSlider:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.timeline-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border-radius: var(--ui-radius-sm); background: transparent; }
.timeline-icon svg { width: 20px; height: 20px; }
.timeline-play { grid-column: 1; grid-row: 1; background: var(--ui-control); border-color: var(--legend-border) !important; }
.timeline-play[aria-pressed="true"] { color: var(--ui-accent); border-color: var(--ui-accent) !important; }
.timeline-speed { grid-column: 4; grid-row: 1; min-width: 44px; padding: 0 10px; background: var(--ui-control); border-color: var(--legend-border) !important; border-radius: var(--ui-radius-sm); font-variant-numeric: tabular-nums; }
.timeline-close { grid-column: 6; grid-row: 1; color: var(--text-muted) !important; }
.timeline-track { grid-column: 2; grid-row: 1; flex: 1 1 0; min-width: 0; padding: 0 6px; }
#timelineSlider { display: block; box-sizing: border-box; appearance: none; -webkit-appearance: none; width: 100%; height: 44px; margin: 0; border: none; padding: 0; background: transparent; cursor: pointer; touch-action: pan-y; border-radius: 8px; }
#timelineSlider::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(to right, var(--ui-accent) 0% var(--timeline-progress, 100%), var(--legend-border) var(--timeline-progress, 100%) 100%); }
#timelineSlider::-moz-range-track { height: 5px; border-radius: 5px; background: var(--legend-border); }
#timelineSlider::-moz-range-progress { height: 5px; border-radius: 5px; background: var(--ui-accent); }
#timelineSlider::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7.5px; border: 3px solid var(--ui-surface); border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent); }
#timelineSlider::-moz-range-thumb { box-sizing: border-box; width: 20px; height: 20px; border: 3px solid var(--ui-surface); border-radius: 50%; background: var(--ui-accent); box-shadow: 0 0 0 1px var(--ui-accent); }
#timelineSlider:disabled { opacity: .4; cursor: default; }
.timeline-time { grid-column: 3; grid-row: 1; flex: 1; min-width: 0; text-align: center; white-space: nowrap; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.timeline-live { grid-column: 5; grid-row: 1; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 12px; border-radius: var(--ui-radius-sm); background: var(--ui-control); border-color: var(--legend-border) !important; white-space: nowrap; }
.timeline-live > span { width: 7px; height: 7px; border-radius: 50%; background: #1ccb65; }
.is-history .timeline-live { border-color: var(--ui-accent) !important; }
.timeline-note { grid-column: 1 / -1; min-height: 0; margin: 0; color: var(--text-muted); font-size: 12px; text-align: center; }
.timeline-note:empty { display: none; }
.is-gap .timeline-note { color: var(--ui-link); }
#map.is-timelapse-gap .leaflet-overlay-pane, #map.is-timelapse-gap .leaflet-ukraine-pane { opacity: .4; }
@media (hover: hover) {
    .timelapse-panel button:not(:disabled):hover { background: var(--fab-about-bg); }
}
@media (max-width: 900px) {
    .timelapse-panel { display: block; width: min(680px, calc(100% - 24px)); bottom: calc(max(12px, env(safe-area-inset-bottom)) + 24px); padding: 8px 12px; }
    .timeline-main, .timeline-toolbar { display: flex; align-items: center; gap: 8px; }
    .timeline-main { padding-right: 52px; }
    .timeline-close { position: absolute; top: 8px; right: 12px; }
    .timeline-toolbar { margin-top: 4px; }
    .timeline-time { text-align: left; }
    .timeline-speed { padding: 0 8px; }
    .timeline-live { padding: 0 10px; }
    .timeline-note:not(:empty) { margin-top: 6px; }
    #map.has-timelapse .fab-stack-bottom { bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--timelapse-height, 105px) + 36px); }
    #map.has-timelapse .history-journal { bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--timelapse-height, 105px) + 36px); max-height: calc(100dvh - var(--timelapse-height, 105px) - 150px); }
    #map.has-timelapse .ruler-panel, #map.has-timelapse .weapon-panel { bottom: calc(max(12px, env(safe-area-inset-bottom)) + var(--timelapse-height, 105px) + 36px); max-height: calc(100dvh - var(--timelapse-height, 105px) - 150px); overflow-y: auto; }
}
@media (max-height: 500px) and (min-width: 601px) {
    .timelapse-panel { bottom: 20px; padding-bottom: 8px; }
    .timeline-note { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .timelapse-panel button { transition: none; }
    .has-timelapse .district-fix-marker .halo, .has-timelapse .district-safety-marker .halo { animation: none; }
}
