/* Time bar at the bottom of the Explore map, centred in the map area between the left pane and the Details pane.
   The map area starts after the left pane (--explore-sidebar-width) and the right edge follows --updates-width, so
   the bar re-centres without script. */
.explore-page .timeline {
  position: absolute;
  z-index: 1001; /* above the Leaflet controls, which overlap it on phones */
  left: 16px;
  right: calc(var(--updates-width, 0px) + 16px);
  bottom: 24px;
  display: grid;
  gap: 6px;
  max-width: 860px;
  margin: 0 auto;
  padding: 12px 20px 10px;
  border: 1px solid #d5dde4;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 12px rgba(16, 41, 66, .16);
  color: #12345a;
  font-size: 14px;
}
.explore-page .timeline[hidden] { display: none; }
.explore-page .timeline :focus-visible { outline: 2px solid #1b6fc2; outline-offset: 2px; }

.explore-page .timeline-top { display: flex; align-items: center; gap: 10px 22px; min-width: 0; }
.explore-page .timeline-title { display: grid; min-width: 0; line-height: 1.25; }
.explore-page .timeline-title strong { font-size: 16px; color: #0f2c4d; }
.explore-page .timeline-title span { color: #3d5876; }
.explore-page .timeline-buttons { display: flex; align-items: center; gap: 8px; }
.explore-page .timeline button {
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.explore-page .timeline .timeline-load {
  min-width: 112px;
  min-height: 40px;
  padding: 0 18px;
  border-radius: 8px;
  background: #1b6fc2;
  color: #fff;
  font-weight: 600;
}
.explore-page .timeline .timeline-load:hover { background: #155a9f; }
.explore-page .timeline.is-loading .timeline-load { background: #fff; color: #1b5e9a; box-shadow: inset 0 0 0 1.5px #1b5e9a; }
.explore-page .timeline .timeline-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; color: #0f2c4d; }
.explore-page .timeline .timeline-icon[hidden] { display: none; }
.explore-page .timeline .timeline-icon:hover:not(:disabled) { background: #eef3f8; }
.explore-page .timeline .timeline-icon:disabled { color: #a9b5c2; cursor: not-allowed; }
.explore-page .timeline-icon svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.explore-page .timeline .timeline-play { width: 46px; height: 46px; border-radius: 50%; background: #1b6fc2; color: #fff; box-shadow: 0 2px 6px rgba(27, 111, 194, .35); }
.explore-page .timeline .timeline-play:hover:not(:disabled) { background: #155a9f; }
.explore-page .timeline-month { min-width: 170px; font-size: 22px; font-weight: 700; color: #0f2c4d; font-variant-numeric: tabular-nums; white-space: nowrap; }
.explore-page .timeline.is-loading .timeline-month { font-size: 18px; font-weight: 600; color: #1b5e9a; }
.explore-page .timeline-options { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.explore-page .timeline-options label { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.explore-page .timeline-options select { min-height: 34px; padding: 0 8px; border: 1px solid #c8d3de; border-radius: 6px; background: #fff; color: inherit; font: inherit; }
.explore-page .timeline-loop input { appearance: none; position: relative; width: 40px; height: 22px; margin: 0; border-radius: 999px; background: #c8d3de; cursor: pointer; transition: background .15s; }
.explore-page .timeline-loop input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.explore-page .timeline-loop input:checked { background: #1b6fc2; }
.explore-page .timeline-loop input:checked::after { transform: translateX(18px); }
.explore-page .timeline-options :disabled { opacity: .55; cursor: not-allowed; }
.explore-page .timeline-more { display: none; position: relative; margin-left: auto; }
.explore-page .timeline-more summary { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; list-style: none; cursor: pointer; color: #0f2c4d; }
.explore-page .timeline-more summary::-webkit-details-marker { display: none; }
.explore-page .timeline-more summary svg { width: 22px; height: 22px; fill: currentColor; }

.explore-page .timeline-scrub { position: relative; padding-bottom: 20px; }
.explore-page .timeline-slider { width: 100%; margin: 6px 0 0; accent-color: #1b6fc2; }
.explore-page .timeline-slider:disabled { opacity: .5; }
.explore-page .timeline-ticks { position: absolute; inset: auto 8px 0; height: 20px; color: #3d5876; font-size: 12px; }
.explore-page .timeline-ticks span { position: absolute; top: 4px; transform: translateX(-50%); white-space: nowrap; }
.explore-page .timeline-ticks span::before { content: ""; position: absolute; top: -6px; left: 50%; height: 5px; border-left: 1px solid #93a6ba; }
.explore-page .timeline-ticks .is-first { transform: none; }
.explore-page .timeline-ticks .is-first::before { left: 0; }
.explore-page .timeline-ticks .is-last { transform: translateX(-100%); }
.explore-page .timeline-ticks .is-last::before { left: auto; right: 0; }
.explore-page .timeline-ticks .is-crowded { display: none; }
.explore-page .timeline-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; color: #3d5876; font-size: 13px; }
.explore-page .timeline-note:empty { display: none; }

.explore-page .timeline-frame { transition-property: opacity; transition-timing-function: linear; }

/* Narrow map area: the options go below the month. */
/* Phones and tablets (below 1100 px): Kieran's compact card. Play (or Load) and the month on one line; the ⋮ menu
   holds the rest. explore-mobile.css places the card. */
@media (max-width: 1099px) {
  /* Clear of the scale and attribution below and of the Details tab at the right edge. */
  .explore-page .timeline {
    left: 8px;
    right: 16px;
    bottom: calc(var(--explore-sheet-height, 0px) + 34px);
    padding: 10px 14px 8px;
    border-radius: 14px;
  }
  .explore-page .timeline-title { display: none; }
  .explore-page .timeline-top { gap: 12px; }
  .explore-page .timeline .timeline-play { width: 52px; height: 52px; }
  .explore-page .timeline .timeline-load { min-width: 88px; }
  .explore-page .timeline-month { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 18px; }
  .explore-page .timeline-more { display: block; }
  .explore-page .timeline-more-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 6px);
    z-index: 2;
    display: grid;
    grid-template-columns: auto auto;
    gap: 10px;
    padding: 12px;
    border: 1px solid #d5dde4;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(16, 41, 66, .2);
  }
  .explore-page .timeline-more-menu .timeline-options { grid-column: 1 / -1; display: grid; gap: 10px; margin: 0; }
  .explore-page .timeline-ticks span:not(.is-first):not(.is-last) { display: none; }
  .explore-page .timeline-foot > span:first-child { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .explore-page .timeline-frame { transition-duration: 0s !important; }
}
