@layer maps {
.weather-alert-polygon {
  animation: weather-alert-pulse 1.0s ease-in-out infinite alternate;
}

@keyframes weather-alert-pulse {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .weather-alert-polygon {
    animation: none;
  }
}

.weather-map__wheel-hint {
  position: absolute;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-family: var(--font-primary);
  font-size: clamp(1.125rem, 2.2vw, 2rem);
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 0s linear 180ms;
}

.weather-map__wheel-hint.is-visible {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
  .weather-map__wheel-hint {
    transition: none;
  }
}

.leaflet-container .leaflet-layer.core-basemap-dark-tiles img.leaflet-tile {
    filter: brightness(0.6) contrast(1.05) sepia(0.35) saturate(1.5) hue-rotate(165deg);
}
.weather-map-card {
  --weather-map-min-block-size: 24rem;
  --weather-map-max-block-size: 32rem;
  --weather-map-block-size: clamp(
    var(--weather-map-min-block-size),
    50svh,
    var(--weather-map-max-block-size)
  );
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(164, 190, 211, 0.52);
  border-radius: 12px;
  background: #071b2e;
  box-shadow: 0 10px 26px rgba(3, 9, 15, 0.34);
}

.weather-map-card__panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.weather-map-card__toggle,
.weather-map-card__source-title {
  display: none;
}

.weather-map-card__body {
  margin: 0;
}

.map-toolbar {
  display: flex;
  /* min-height: 2.75rem; */
  box-sizing: border-box;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem 1.125rem;
  padding: 0.5rem 1.125rem;
  border-bottom: 1px solid rgba(177, 201, 220, 0.24);
  background: #0b2238;
  color: #e8f0f6;
  font-family: var(--font-heading);
}

.map-toolbar__label,
.map-toolbar__status {
  display: inline-flex;
  align-items: center;
  gap: 0.5625rem;
  font-family: var(--font-mono, 'Fira Code', monospace);
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  font-weight: 400;
}

.map-toolbar__label {
  padding-right: 1.125rem;
  border-right: 1px solid rgba(177, 201, 220, 0.32);
}

.map-toolbar__status-indicator {
  width: 0.625rem;
  height: 0.625rem;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7fe0aa;
  box-shadow: 0 0 0 3px rgba(127, 224, 170, 0.12);
}

.map-toolbar__status-indicator.is-empty {
  background: #9cabb6;
  box-shadow: 0 0 0 3px rgba(156, 171, 182, 0.12);
}

.field--map-product {
  position: relative;
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
}

.field--map-product .field__control {
  min-width: 6.25rem;
  min-height: var(--control-target-min, 24px);
  box-sizing: border-box;
  padding: 0.4375rem 2.5rem 0.4375rem 0.75rem;
  border: 1px solid var(--component-menu-border-color);
  border-radius: 8px;
  appearance: none;
  background-color: var(--component-menu-background);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='8' viewBox='0 0 14 8'%3E%3Cpath d='m1 1 6 6 6-6' fill='none' stroke='%23dce7ef' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 0.875rem 0.5rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 6px rgba(2, 10, 17, 0.2);
  color: var(--component-menu-color);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--component-menu-font-size);
  font-weight: var(--component-menu-font-weight);
  line-height: var(--component-menu-line-height);
  text-transform: none;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.field--map-station .field__control {
  min-width: 13.75rem;
}

.field--map-product .field__control:hover {
  border-color: rgba(220, 234, 243, 0.82);
  background-color: var(--component-menu-hover-background);
}

.field--map-product .field__control:focus-visible {
  border-color: var(--focus-ring-color, #fff200);
  outline: 2px solid var(--focus-ring-color, #fff200);
  outline-offset: 2px;
  box-shadow: 0 0 0 3px rgba(255, 242, 0, 0.12);
}

.field--map-product .field__control option {
  background: var(--component-menu-option-background);
  color: var(--component-menu-color);
  font: inherit;
}

.weather-map {
  position: relative;
  z-index: 0;
  isolation: isolate;
  width: 100%;
  min-height: var(--weather-map-block-size, 26.875rem);
  overflow: hidden;
  background: #07111b;
  border-radius: 4px;
}

.weather-map__canvas {
  width: 100%;
  height: var(--weather-map-block-size, 26.875rem);
  background: #07111b;
}

.weather-map__fallback {
  width: 100%;
  min-height: var(--weather-map-block-size, 26.875rem);
  background: #000;
  text-align: center;
}

.weather-map__fallback img {
  display: block;
  width: 100%;
  max-height: 540px;
  margin: 0 auto;
  object-fit: contain;
}

.satellite-tile-fallback-message {
  position: absolute;
  z-index: 900;
  top: 12px;
  left: 50%;
  display: flex;
  box-sizing: border-box;
  width: min(620px, calc(100% - 110px));
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 12px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 5px;
  background: rgba(3, 24, 39, 0.94);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.34);
  color: #fff;
  font-family: var(--font-mono), monospace;
  font-size: 0.74rem;
  line-height: 1.35;
  text-align: center;
}

.satellite-tile-fallback-message[hidden] {
  display: none;
}

.satellite-tile-fallback-link {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid var(--color-accent, #fff200);
  border-radius: 4px;
  background: transparent;
  color: var(--color-accent, #fff200);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.satellite-tile-fallback-link:hover,
.satellite-tile-fallback-link:focus-visible {
  background: var(--color-accent, #fff200);
  color: #07111b;
}

.satellite-tile-fallback-link:focus-visible,
.satellite-imagery-dialog-close:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

html.satellite-imagery-modal-open,
html.satellite-imagery-modal-open body {
  overflow: hidden;
}

.satellite-imagery-dialog {
  position: fixed;
  box-sizing: border-box;
  width: min(95%, 1040px);
  max-width: none;
  max-height: 88svh;
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  background: #07111b;
  color: #fff;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.65);
}

.satellite-imagery-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(3px);
}

.satellite-imagery-dialog[open] {
  animation:
    weather-map-dialog-rise-in 0.22s ease,
    weather-map-popup-fade-in 0.18s ease;
}

@keyframes weather-map-dialog-rise-in {
  from { transform: translateY(12px); }
  to { transform: translateY(0); }
}

.satellite-imagery-dialog-shell {
  display: grid;
  max-height: 88svh;
  grid-template-rows: auto minmax(0, 1fr);
}

.satellite-imagery-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
  background: #031827;
}

.satellite-imagery-dialog-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.3;
}

.satellite-imagery-dialog-close {
  display: inline-grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font: 700 1.5rem/1 sans-serif;
  cursor: pointer;
}

.satellite-imagery-dialog-close:hover {
  border-color: var(--color-accent, #fff200);
  color: var(--color-accent, #fff200);
}

.satellite-imagery-dialog-scroll {
  min-height: 140px;
  padding: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: center;
}

.satellite-imagery-dialog-status {
  margin: 2rem auto;
  font-family: var(--font-mono), monospace;
  font-size: 0.85rem;
}

.satellite-imagery-dialog-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(88svh - 88px);
  margin: 0 auto;
  object-fit: contain;
}

.satellite-imagery-dialog-image[hidden] {
  display: none;
}

.weather-map__timestamp {
  position: absolute;
  z-index: 700;
  left: 10px;
  bottom: 20px;
  max-width: calc(100% - 20px);
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-family: var(--font-mono), monospace;
  font-size: clamp(0.5rem, 2vw, 0.7rem);
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}

.map-timeline {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(3, 24, 39, 0.96);
  color: var(--color-text-light);
  font-family: var(--font-mono), monospace;
  font-size: 0.72rem;
}

.map-timeline[hidden] {
  display: none;
}

.map-timeline__frame-label {
  font-weight: 700;
  text-transform: uppercase;
}

.map-timeline__play {
  display: inline-grid;
  width: var(--control-target-min, 24px);
  height: var(--control-target-min, 24px);
  min-width: var(--control-target-min, 24px);
  place-items: center;
  padding: 0;
  border: 1px solid rgba(151, 180, 202, 0.58);
  border-radius: 8px;
  background: #173750;
  color: var(--color-text-light);
  cursor: pointer;
  flex: 0 0 auto;
}

.map-timeline__play:hover {
  border-color: rgba(220, 234, 243, 0.82);
  background: var(--color-accent, #fff200);
  color: #07111b;
}

.map-timeline__play:focus-visible {
  outline: 2px solid var(--focus-ring-color, #fff200);
  outline-offset: 2px;
}

.map-timeline__play:disabled {
  border-color: #888;
  background: #666;
  color: #ddd;
  cursor: not-allowed;
  opacity: 0.7;
}

.map-timeline input[type="range"] {
  width: 100%;
  min-height: var(--control-target-min, 24px);
  margin: 0;
  accent-color: var(--color-accent, #fff200);
  cursor: pointer;
}

.map-timeline input[type="range"]:focus-visible {
  outline: 2px solid var(--color-accent, #fff200);
  outline-offset: 3px;
}

.map-timeline__frame {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  white-space: nowrap;
}

.map-timeline__frame output {
  min-width: 3.8rem;
  text-align: right;
  white-space: nowrap;
}

.map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 24, 39, 0.96);
  color: var(--color-text-light);
  font-family: var(--font-mono), monospace;
}

.map-legend[hidden] {
  display: none;
}

.map-legend__title {
  flex: 0 0 auto;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
}

.map-legend__content {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 12px;
}

.map-legend__image {
  display: block;
  max-width: min(100%, 500px);
  max-height: 86px;
  padding: 3px;
  border-radius: 3px;
  background: #fff;
  object-fit: contain;
}

.map-legend__image[hidden] {
  display: none;
}

.map-legend__scale {
  flex: 1 1 280px;
  max-width: 500px;
  min-width: 180px;
}

.map-legend__scale[hidden] {
  display: none;
}

.map-legend__scale-bar {
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 2px;
}

.map-legend__scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
  font-size: 0.62rem;
  line-height: 1;
}

.map-legend__description {
  margin: 0;
  font-size: 0.68rem;
  line-height: 1.35;
}

.weather-map-card__note {
  margin: 0;
  padding: 8px 12px;
  background: rgba(3, 24, 39, 0.92);
  color: var(--color-text-light);
  font-family: var(--font-mono), monospace;
  font-size: clamp(0.5rem, 1.2vw, 0.65rem);
  line-height: 1.4;
  text-align: center;
}

.weather-map-card .map-timeline,
.weather-map-card .map-legend,
.weather-map-card__note {
  background: #081d31;
}

.weather-map-card__note {
  border-top: 1px solid rgba(177, 201, 220, 0.22);
  color: #d7e2ea;
}

.weather-map__content {
  position: relative;
  /* Keep loading/error overlays above the map but below site navigation. */
  isolation: isolate;
  min-height: var(--weather-map-block-size, 26.875rem);
  overflow: hidden;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #07111b;
}

.weather-map__content > .status-message {
  position: absolute;
  inset: 0;
  z-index: 1001;
  width: 100%;
  height: 100%;
  background: rgba(7, 17, 27, 0.86);
}

.status-message i {
  color: var(--color-accent, #fff200);
  font-size: 2rem;
}

.status-message span {
  font-size: 1.05rem;
  font-weight: 700;
}

.status-message small {
  max-width: 22rem;
  font-size: 0.85rem;
  opacity: 0.84;
}

.weather-map > .status-message--floating {
  position: absolute;
  z-index: 1250;
  top: 0.875rem;
  left: 50%;
  width: min(90%, 28rem);
  min-height: var(--control-target-min, 24px);
  flex-direction: row;
  padding: 0.65rem 0.9rem;
  transform: translateX(-50%);
  border: 1px solid rgba(177, 201, 220, 0.4);
  border-radius: 8px;
  background: rgba(7, 27, 46, 0.96);
  box-shadow: 0 6px 18px rgba(2, 8, 14, 0.38);
}

.weather-map > .status-message--floating i,
.weather-map > .status-message--floating span {
  font-size: 0.8rem;
}

.map-menu {
  position: relative;
}

.map-menu > summary {
  display: inline-flex;
  min-height: var(--control-target-min, 24px);
  box-sizing: border-box;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid rgba(151, 180, 202, 0.58);
  border-radius: 8px;
  background: #102a43;
  color: #f5f9fc;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.74rem;
  font-weight: 650;
  list-style: none;
}

.map-menu > summary::-webkit-details-marker {
  display: none;
}

.map-menu > summary:focus-visible {
  outline: 2px solid var(--focus-ring-color, #fff200);
  outline-offset: 2px;
}

.map-menu__options {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 7px);
  left: 0;
  display: grid;
  width: min(17.5rem, calc(100vw - 2.25rem));
  box-sizing: border-box;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--component-menu-border-color);
  border-radius: 9px;
  background: var(--component-menu-background);
  box-shadow: 0 10px 24px rgba(2, 8, 14, 0.46);
}

.map-menu--align-end .map-menu__options {
  right: 0;
  left: auto;
}

/* Only anchored options move here; Active mobile sheets animate their container. */
.map-menu[open] > .map-menu__options {
  animation:
    weather-map-menu-drop-in 0.22s ease,
    weather-map-popup-fade-in 0.18s ease;
}

@keyframes weather-map-menu-drop-in {
  from { transform: translateY(-6px); }
  to { transform: translateY(0); }
}

.map-menu__options label {
  display: flex;
  min-width: 0;
  min-height: var(--control-target-min, 24px);
  box-sizing: border-box;
  align-items: center;
  gap: 0.4rem;
  padding: 0.375rem;
  border-radius: 6px;
  color: var(--component-menu-color);
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: var(--component-menu-font-size);
  font-weight: var(--component-menu-font-weight);
  line-height: var(--component-menu-line-height);
}

.map-menu__options label:hover {
  background: rgba(255, 255, 255, 0.07);
}

.map-menu__options input {
  flex: 0 0 auto;
  accent-color: var(--component-tab-indicator-color);
}

.map-menu:not([open]) .map-menu__options {
  display: none;
}

.map-basemap-control {
  position: relative;
  z-index: 1200;
}

.map-basemap-control .map-menu > summary {
  width: var(--control-target-min, 24px);
  min-height: var(--control-target-min, 24px);
  justify-content: center;
  padding: 0;
  border-color: rgba(31, 52, 67, 0.45);
  border-radius: 10px;
  background: #fff;
  color: #74787b;
  box-shadow: 0 3px 12px rgba(4, 13, 20, 0.25);
}

.map-basemap-control .map-menu > summary i {
  font-size: 1.2rem;
  line-height: 1;
}

.map-place-label {
  border: 0;
  background: transparent;
  pointer-events: none;
}

.map-place-label span {
  display: block;
  overflow: visible;
  color: #f4f8fb;
  font-family: var(--font-heading);
  font-size: clamp(0.7rem, 0.6rem + 0.25vw, 0.9rem);
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-align: center;
  text-shadow:
    -1px -1px 0 rgba(2, 12, 22, 0.96),
    1px -1px 0 rgba(2, 12, 22, 0.96),
    -1px 1px 0 rgba(2, 12, 22, 0.96),
    1px 1px 0 rgba(2, 12, 22, 0.96),
    0 2px 4px rgba(2, 12, 22, 0.92);
  white-space: nowrap;
}

.map-place-label.is-major span {
  color: #fff;
  font-weight: 800;
}

.temperature-marker-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
}

.temperature-marker-value {
  display: inline-block;
  padding: 0.625rem;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 12px;
  background: rgba(7, 27, 45, 0.7);
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.38);
  color: var(--color-accent);
  font-family: var(--font-heading);
  font-size: clamp(1rem, 3vw, 1.4rem);
  font-weight: 800;
  line-height: 0.8;
  text-align: center;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
}

.temperature-marker-value.is-stale {
  border-color: rgba(214, 224, 231, 0.6);
}

.temperature-marker-value.is-compact {
  min-width: 0;
  padding: 0.3125rem 0.4375rem;
  font-size: clamp(1.1rem, 1.2vw, 1.7rem);
}

.temperature-marker-reading {
  display: block;
}

.temperature-marker-unit {
  display: inline;
  margin-left: 0.25rem;
  font-size: 0.62em;
  font-weight: 800;
  letter-spacing: 0.025em;
  line-height: 1;
  text-transform: uppercase;
}

.temperature-marker-direction {
  margin-right: 0.25rem;
  font-size: clamp(0.6rem, 2vw, 0.8rem);
  font-weight: 800;
}

.temperature-marker-speed {
  font-size: clamp(0.8rem, 2.3vw, 1rem);
  font-weight: 800;
}

.temperature-marker-percent {
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 800;
}

.temperature-marker-value.is-selected {
  border-color: #fff200;
  box-shadow:
    0 0 0 2px rgba(7, 27, 46, 0.9),
    0 0 0 4px rgba(255, 242, 0, 0.82),
    0 5px 14px rgba(4, 12, 19, 0.4);
}

.leaflet-popup.weather-map-popup {
  --weather-map-popup-inline-size: 17.5rem;
  max-inline-size: calc(100vw - 1rem);
}

.weather-map-popup .leaflet-popup-content-wrapper,
.weather-map-popup .leaflet-popup-tip {
  background: #071b2e;
  color: #edf6fb;
}

.weather-map-popup .leaflet-popup-content-wrapper {
  overflow: hidden;
  border: 1px solid rgba(180, 205, 223, 0.54);
  border-radius: 0.75rem;
  box-shadow: 0 0.65rem 1.75rem rgba(0, 0, 0, 0.42);
}

.weather-map-popup .leaflet-popup-content-wrapper:focus-within {
  border-color: var(--focus-ring-color, #fff200);
  box-shadow:
    0 0 0 2px rgba(7, 27, 46, 0.92),
    0 0 0 4px rgba(255, 242, 0, 0.72),
    0 0.65rem 1.75rem rgba(0, 0, 0, 0.42);
}

.weather-map-popup .leaflet-popup-content {
  inline-size: min(var(--weather-map-popup-inline-size), calc(100vw - 4.5rem)) !important;
  max-inline-size: min(17.5rem, calc(100vw - 4.5rem));
  max-block-size: min(70svh, 32rem);
  box-sizing: border-box;
  margin: 0;
  padding: 1rem 1.125rem 1.125rem;
  overflow: auto;
  overflow-wrap: anywhere;
  overscroll-behavior: contain;
  font-family: var(--font-heading, "Montserrat", sans-serif);
  scrollbar-gutter: stable;
  /* Animate only the content; Leaflet owns the outer popup's map transform. */
  animation:
    weather-map-popup-slide-in 0.22s ease,
    weather-map-popup-fade-in 0.18s ease;
}

@keyframes weather-map-popup-slide-in {
  from { transform: translateX(calc(100% + 1rem)); }
  to { transform: translateX(0); }
}

@keyframes weather-map-popup-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .weather-map-popup .leaflet-popup-content {
    animation: none;
  }
}

.leaflet-container .weather-map-popup .leaflet-popup-close-button {
  top: 0.25rem;
  right: 0.25rem;
  display: grid;
  inline-size: var(--control-target-min, 24px);
  block-size: var(--control-target-min, 24px);
  box-sizing: border-box;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.45rem;
  color: #c7d7e3;
  font: 700 1.5rem/1 var(--font-heading, "Montserrat", sans-serif);
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.leaflet-container .weather-map-popup .leaflet-popup-close-button:hover {
  border-color: rgba(180, 205, 223, 0.42);
  background: rgba(255, 255, 255, 0.08);
  color: var(--focus-ring-color, #fff200);
}

.leaflet-container .weather-map-popup .leaflet-popup-close-button:focus-visible {
  outline: 0.18rem solid var(--focus-ring-color, #fff200);
  outline-offset: 0.12rem;
}

.weather-map-popup .leaflet-popup-tip-container {
  overflow: visible;
}

.weather-map-popup__content {
  min-inline-size: 0;
  color: #edf6fb;
}

.weather-map-popup__content p {
  margin-block: 0.45rem;
}

.weather-map-popup__content > :first-child {
  margin-block-start: 0;
}

.weather-map-popup__content > :last-child {
  margin-block-end: 0;
}

.weather-map-popup__content a {
  display: inline-flex;
  min-block-size: var(--control-target-min, 24px);
  align-items: center;
}

.weather-map-popup__content a:focus-visible {
  outline: 0.18rem solid var(--focus-ring-color, #fff200);
  outline-offset: 0.14rem;
}

.leaflet-container
  :is([data-weather-map-popup-trigger], [data-observation-popup-trigger]):focus-visible {
  outline: 3px solid var(--focus-ring-color, #fff200);
  outline-offset: 3px;
}

.observation-popup {
  position: relative;
  min-width: 0;
  color: #eef5fb;
  font-family: var(--font-heading), sans-serif;
}

.observation-popup__title {
  margin: 0 3rem 3px 0;
  color: #fff;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: 0.92rem;
  line-height: 1.2;
}

.observation-popup p {
  margin: 0 0 7px;
}

.observation-popup__location,
.observation-popup__status,
.observation-popup__time {
  color: #b9c9d6;
  font-size: 0.7rem;
}

.observation-popup__status {
  display: inline-flex;
  padding: 3px 7px;
  border: 1px solid rgba(122, 213, 167, 0.34);
  border-radius: 999px;
  background: rgba(74, 151, 112, 0.18);
  color: #dff7e9;
  font-weight: 700;
}

.observation-popup__status.is-stale {
  border-color: rgba(255, 185, 123, 0.42);
  background: rgba(154, 75, 19, 0.2);
  color: #ffd2aa;
}

.observation-popup__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  margin: 8px 0;
  padding: 8px 9px;
  border: 1px solid rgba(177, 201, 220, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.76rem;
}

.observation-popup__grid dt {
  color: #d5e1ea;
  font-weight: 700;
}

.observation-popup__grid dd {
  margin: 0;
  color: #fff;
  text-align: right;
}

.observation-popup__link {
  display: inline-block;
  margin-top: 2px;
  color: #fff200;
  font-size: 0.72rem;
  font-weight: 700;
}

.observation-popup__link:hover,
.observation-popup__link:focus-visible {
  color: #fff;
}

.observation-popup__close {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  width: var(--control-target-min, 24px);
  height: var(--control-target-min, 24px);
  box-sizing: border-box;
  padding: 0;
  border: 1px solid rgba(177, 201, 220, 0.34);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: #d5e1ea;
  font: 1.3rem/1 var(--font-heading), sans-serif;
  cursor: pointer;
  place-items: center;
}

.observation-popup__close:hover,
.observation-popup__close:focus-visible {
  border-color: #fff200;
  color: #fff200;
}

.observation-popup__close:focus-visible {
  outline: 2px solid var(--focus-ring-color, #fff200);
  outline-offset: 2px;
}

.temperature-station-details {
  border-top: 1px solid rgba(177, 201, 220, 0.28);
  background: #0b2238;
}

.temperature-station-details[hidden] {
  display: none;
}

.temperature-station-details:not([hidden]) {
  animation: weather-map-popup-fade-in 0.18s ease;
}

.temperature-station-details .observation-popup {
  padding: 13px 14px 14px;
}

@media (max-width: 600px) {
  .temperature-station-details:not([hidden]) + .weather-map-card__note {
    display: none;
  }
}

@media (pointer: coarse) {
  .site-page .leaflet-container.leaflet-touch-drag,
  .site-page .leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
    touch-action: pan-y;
  }
}

@media (min-width: 601px) {
  .temperature-station-details {
    position: absolute;
    z-index: 900;
    inset: 0 0 0 auto;
    box-sizing: border-box;
    width: min(300px, 100%);
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    border: 1px solid rgba(164, 190, 211, 0.58);
    border-top: 4px solid #fff200;
    border-radius: 10px 0 0 10px;
    background: rgba(8, 29, 49, 0.97);
    box-shadow: -14px 0 36px rgba(3, 9, 15, 0.5);
    scrollbar-color: rgba(177, 201, 220, 0.58) transparent;
    scrollbar-width: thin;
  }

  .temperature-station-details:not([hidden]) {
    animation:
      weather-map-popup-slide-in 0.22s ease,
      weather-map-popup-fade-in 0.18s ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .satellite-imagery-dialog[open],
  .map-menu[open] > .map-menu__options,
  .temperature-station-details:not([hidden]) {
    animation: none;
  }
}

.weather-map__canvas .leaflet-control-attribution {
  font-size: clamp(6px, 1vw, 10px);
  font-weight: 600;
}

.weather-map__canvas .leaflet-control-zoom a {
  width: var(--control-target-min, 24px);
  height: var(--control-target-min, 24px);
  color: #111;
  font-size: 1.375rem;
  line-height: var(--control-target-min, 24px);
}

.weather-map__canvas
  .leaflet-control-zoom.weather-map-zoom-indicator-enabled
  .leaflet-control-zoom-out {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.weather-map__canvas .leaflet-control-zoom .weather-map-zoom-indicator {
  box-sizing: border-box;
  width: 100%;
  height: 22px;
  border-top: 1px solid #ccc;
  border-bottom-right-radius: 4px;
  border-bottom-left-radius: 4px;
  background: #f8fafc;
  color: #1f2937;
  font: 700 0.68rem/22px system-ui, sans-serif;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

@media (max-width: 768px) {
  .weather-map__timestamp {
    text-overflow: clip;
    white-space: normal;
  }

  .satellite-tile-fallback-message {
    top: 56px;
    width: calc(100% - 20px);
    flex-direction: column;
    gap: 7px;
    padding: 8px 10px;
    font-size: 0.66rem;
  }

  .satellite-imagery-dialog-header {
    padding: 10px 12px;
  }

  .satellite-imagery-dialog-scroll {
    padding: 8px;
  }

  .map-timeline {
    gap: 7px;
    padding: 0 9px;
    /* font-size: 0.64rem; */
  }

  .map-legend {
    align-items: flex-start;
    gap: 7px;
    padding: 7px 9px;
  }

  .map-legend__content {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .map-legend__scale {
    width: 100%;
    flex: 0 0 auto;
  }

  .map-legend__title,
  .map-legend__description {
    font-size: 0.62rem;
  }
}

@media (max-width: 480px) {
  .weather-map-card {
    border-radius: 9px;
  }

  .temperature-marker-value {
    min-width: 42px;
    padding: 5px 7px;
  }

  .temperature-marker-value.is-compact {
    min-width: 0;
    padding: 4px 6px;
    font-size: 0.88rem;
  }
}

@container (max-width: 48rem) {
  .weather-map-card .map-toolbar {
    gap: 0.5rem 0.75rem;
    padding: 0.5rem;
  }

  .weather-map-card .map-toolbar--radar {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
    align-items: end;
  }

  .weather-map-card .map-toolbar--satellite {
    align-items: stretch;
  }

  .weather-map-card .field--map-product {
    display: block;
    width: 100%;
  }

  .weather-map-card .field--map-product .field__control {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .weather-map-card .map-toolbar__label {
    padding-right: 0.75rem;
  }
}

/* Mobile maps keep useful geographic space instead of fitting the entire card
   into the remaining viewport. Match MOBILE_MAP_QUERY in mobileMapLayout.js. */
@media (max-width: 768px), (pointer: coarse) and (max-width: 1024px) and (max-height: 500px) {
  .weather-map,
  .weather-map__content {
    --weather-map-block-size: clamp(22.5rem, calc(100vw - 2rem), 27.5rem);
  }

  .weather-map-card,
  .weather-map__content {
    /* Clip rounded edges without creating a scroll container above sticky UI. */
    overflow: clip;
  }

  .weather-map-playback {
    min-width: 0;
  }

  .weather-map-playback > .map-timeline {
    position: sticky;
    top: var(--weather-map-sticky-top, 0px);
    z-index: 1;
    grid-template-columns: auto minmax(0, 1fr);
    border-bottom: 1px solid rgba(177, 201, 220, 0.24);
    background: #081d31;
  }

  .weather-map-playback .map-timeline__play {
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
  }

  :is(.map-menu > summary, .map-menu__options label, .satellite-imagery-dialog-close),
  .weather-map__canvas .leaflet-control-zoom a {
    position: relative;
  }

  :is(.map-timeline__play, .map-menu > summary, .map-menu__options label,
      .satellite-imagery-dialog-close, .observation-popup__close,
      .leaflet-popup-close-button)::before,
  .weather-map__canvas .leaflet-control-zoom a::before {
    position: absolute;
    inset-block: min(0px, calc(50% - 22px));
    inset-inline: min(0px, calc(50% - 22px));
    content: "";
  }

  /* Stacked zoom buttons share an edge; expand only sideways. Menu choices
     have a 6px gap, so each can use at most 3px above and below itself. */
  .weather-map__canvas .leaflet-control-zoom a::before {
    inset-block: 0;
  }

  .map-menu__options label::before {
    inset-block: max(-3px, min(0px, calc(50% - 22px)));
    inset-inline: 0;
  }

  .weather-map-playback input[type="range"] {
    min-width: 0;
    min-height: 44px;
  }

  .weather-map-playback > .map-timeline > .map-timeline__frame,
  .weather-map-playback:has(> .map-timeline[hidden]) > .weather-map > .map-timeline__frame {
    display: none;
  }
}

@media (max-width: 768px) and (orientation: landscape), (pointer: coarse) and (max-width: 1024px) and (max-height: 500px) {
  .weather-map,
  .weather-map__content {
    --weather-map-block-size: clamp(15rem, 65svh, 22.5rem);
  }
}

@container (max-width: 30rem) {
  .weather-map-card .map-toolbar--conditions {
    min-height: 1.5rem;
    flex-flow: row nowrap;
    justify-content: space-between;
    gap: 0.3125rem;
    padding: 0.25rem 0.4375rem;
  }

  .weather-map-card .map-toolbar__label {
    padding-right: 0.4375rem;
  }

  .weather-map-card :is(.map-toolbar__label, .map-toolbar__status) {
    gap: 0.375rem;
    white-space: nowrap;
  }
}
}
