#hurricanesOverlay {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 14;
  overflow: hidden;
  pointer-events: none;
}

#hurricanesSvg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hurricane-track-label {
  font: 700 13px/1.25 system-ui, sans-serif;
  paint-order: stroke;
  stroke-linejoin: round;
  /* width set per-label in SVG for color-family contrast */
  stroke-width: 2.2px;
}

.hurricanes-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #eee;
  font: 13px system-ui, sans-serif;
}

.hurricanes-loading[hidden] {
  display: none;
}

/* ── Storm ruler (sky-photos DragScroller layout) ── */

:root {
  --hurricane-scroll-select-border: 3px;
  --hurricane-scroll-inset-top: 8px;
}

/* ── Filter bar: always on the menu row ── */

#hurricanesFilter {
  position: fixed;
  z-index: 25;
  top: var(--hurricane-scroll-inset-top);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  box-sizing: border-box;
  /* Match the hamburger row — not the taller landscape corner stack */
  height: 40px;
  min-height: 0;
  background: rgba(0, 0, 0, 0.62);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  pointer-events: auto;
  -webkit-user-select: none;
  user-select: none;
  overflow: hidden;
}

#hurricanesFilter[hidden] {
  display: none !important;
}

#hurricanesFilter.scroll-menu-right {
  left: auto;
  right: calc(var(--menu-corner-size, 56px) + 4px);
  max-width: min(560px, calc(100vw - var(--menu-corner-size, 56px) - 16px));
  width: max-content;
  justify-content: flex-end;
}

#hurricanesFilter.scroll-menu-left {
  left: calc(var(--menu-corner-size, 56px) + 4px);
  right: auto;
  max-width: min(560px, calc(100vw - var(--menu-corner-size, 56px) - 16px));
  width: max-content;
  justify-content: flex-start;
}

.hurricanes-filter-search {
  all: unset;
  box-sizing: border-box;
  min-width: 96px;
  flex: 1 0 96px;
  max-width: 160px;
  height: 26px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #eee;
  font: 12px/26px system-ui, sans-serif;
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-user-select: text;
  user-select: text;
}

.hurricanes-filter-search::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.hurricanes-filter-year {
  flex: 0 0 auto;
  height: 26px;
  max-width: 88px;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(30, 30, 30, 0.95);
  color: #eee;
  font: 12px system-ui, sans-serif;
  cursor: pointer;
  color-scheme: dark;
}

.hurricanes-filter-types {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}

.hurricanes-filter-type {
  all: unset;
  box-sizing: border-box;
  flex: 0 0 auto;
  min-width: 26px;
  height: 24px;
  padding: 0 5px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--intensity-color, #aaa) 55%, transparent);
  color: var(--intensity-color, #eee);
  font: 600 11px/22px system-ui, sans-serif;
  text-align: center;
  cursor: pointer;
  background: color-mix(in srgb, var(--intensity-color, #aaa) 14%, transparent);
}

.hurricanes-filter-type.is-on {
  color: #111;
  border-color: var(--intensity-color, #fff);
  background: var(--intensity-color, #fff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--intensity-color, #fff) 40%, transparent);
}

/* Portrait: scroller under the menu/filter row, full width */
#hurricanesScrollGallery.horizontal {
  top: calc(
    var(--hurricane-scroll-inset-top) +
    var(--menu-corner-height, 56px) + 2px
  );
  left: 0;
  right: 0;
  height: var(--sky-scroll-cross-size, 90px);
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
}

/* Landscape: same side as the menu, inward of the corner, full height */
#hurricanesScrollGallery.vertical {
  width: min(102px, 31vw);
  top: var(--hurricane-scroll-inset-top);
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
}

#hurricanesScrollGallery.vertical.scroll-menu-right {
  right: var(--menu-corner-size, 56px);
  left: auto;
}

#hurricanesScrollGallery.vertical.scroll-menu-left {
  left: var(--menu-corner-size, 56px);
  right: auto;
}

#hurricanesScrollGallery {
  padding: var(--hurricane-scroll-select-border);
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
  position: fixed;
  z-index: 20;
}

#hurricanesScrollGallery::-webkit-scrollbar {
  display: none;
}

#hurricanesScrollGallery.dragging {
  cursor: grabbing;
}

#hurricanesScrollBox {
  display: flex;
  gap: var(--sky-scroll-gap, 5px);
}

#hurricanesScrollGallery.horizontal #hurricanesScrollBox {
  flex-direction: row;
  height: 100%;
  align-items: stretch;
}

#hurricanesScrollGallery.vertical #hurricanesScrollBox {
  flex-direction: column;
  width: 100%;
}

.hurricane-scroll-card {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  border: var(--hurricane-scroll-select-border) solid transparent;
  box-sizing: border-box;
  cursor: pointer;
  backdrop-filter: blur(4px);
  -webkit-user-select: none;
  user-select: none;
  scroll-snap-align: center;
}

#hurricanesScrollGallery.horizontal .hurricane-scroll-card {
  height: 100%;
  min-width: 97px;
  max-width: 126px;
}

#hurricanesScrollGallery.vertical .hurricane-scroll-card {
  width: 100%;
  min-height: 64px;
}

.hurricane-scroll-card.is-selected {
  border-color: #fff;
  background: rgba(0, 0, 0, 0.78);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--storm-color, #5dade2) 60%, transparent);
}

.hurricane-scroll-card.is-disabled {
  opacity: 0.42;
  filter: grayscale(1);
  cursor: grab;
  background: rgba(40, 40, 40, 0.55);
}

.hurricane-scroll-card.is-disabled.is-selected {
  border-color: rgba(255, 255, 255, 0.35);
  box-shadow: none;
}

.hurricane-scroll-name {
  font: 700 13px/1.2 system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hurricane-scroll-type,
.hurricane-scroll-date {
  font: 11px/1.25 system-ui, sans-serif;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hurricane-scroll-type {
  color: rgba(255, 255, 255, 0.88);
}

.hurricane-scroll-date {
  font-size: 8.25px;
  line-height: 1.25;
}
