.leaflet-container {
  isolation: isolate;
}

.forecast-map-page {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  container: map / inline-size;
}

.forecast-map-fit {
  position: relative;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
}

.forecast-map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.forecast-map-chrome {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.forecast-map-footer {
  grid-row: 2;
  padding: 0.15rem var(--page-gutter);
  background: var(--color-page);
  color: var(--color-muted);
  font-size: 0.75rem;
  line-height: 1.3;
}

.forecast-map-footer .map-credit {
  margin: 0;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

.forecast-map-keep {
  white-space: nowrap;
}

.forecast-map-legends {
  grid-area: legend;
  align-self: end;
  min-width: 0;
  margin: 0;
  color: var(--map-label);
  font-size: 0.75rem;
  pointer-events: auto;
  container: credit / inline-size;
}

/* Play's corner stays reserved while the filter icon is standing in for it.
   The legend only takes that corner when both controls are gone. */
.forecast-map-page .map-dock:has([data-forecast-radar-play][hidden]):not(:has([data-map-filters-toggle]:not([hidden]))) .forecast-map-legends {
  grid-column: play / legend;
}

/* A legend box shows while any legend in it does. Each legend that shows and
   hides as one piece carries map-legend-unit: lightning, wind, clouds, vapor,
   each storm total, and the radar rows' box. */
.forecast-map-legends:not(:has(.map-legend-unit:not([hidden]))) {
  display: none;
}

body:has(.forecast-map-page) .forecast-map-page {
  bottom: 0;
}

body:has(.forecast-map-page) .site-footer {
  display: none;
}

.forecast-radar-stage {
  container: map / inline-size;
}

.forecast-map-page .leaflet-container {
  background: var(--map-ocean);
  font-family: inherit;
}

.forecast-map-panel {
  position: absolute;
  z-index: 4;
  top: 0.75rem;
  left: 0.75rem;
  width: min(26rem, calc(100% - 0.75rem - var(--app-bar-clearance)));
  max-height: calc(100% - 3rem);
  overflow: visible;
  pointer-events: auto;
}

.forecast-map-panel.tile {
  background: var(--frost-panel);
  border-color: var(--frost-panel-border);
  -webkit-backdrop-filter: var(--frost-blur);
  backdrop-filter: var(--frost-blur);
}

.forecast-map-panel .kicker {
  margin-bottom: 0.35rem;
}

.forecast-map-panel h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.forecast-map-panel .forecast-place-tools {
  margin-top: 0.75rem;
}

.leaflet-div-icon.forecast-map-place {
  background: transparent;
  border: 0;
}

.forecast-map-place a,
.forecast-map-place-dot {
  display: block;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--color-accent);
}

.forecast-place-dot {
  fill: var(--color-accent);
}

.forecast-map-error {
  margin-top: 0.75rem;
}

.forecast-map-panel .location-matches {
  margin-top: 0.75rem;
}

.forecast-map-panel .location-matches ul {
  max-height: min(24rem, calc(100vh - 16rem));
  overflow: auto;
}

.forecast-map-panel .location-matches h2 {
  font-size: 1rem;
}

.forecast-map-credit a,
.forecast-radar-credit a {
  color: inherit;
}

.forecast-map-credit a:hover,
.forecast-radar-credit a:hover {
  text-decoration: none;
}

.map-credit a.map-disclaimer {
  color: var(--color-accent-strong);
}

.map-guarantee {
  white-space: nowrap;
}

.forecast-map-state-label {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--map-name, var(--map-label));
  font-size: var(--state-label-size, 0.8125rem);
  font-weight: var(--state-label-weight, 700);
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.forecast-map-state-label span,
.forecast-map-city-label span {
  display: block;
  width: max-content;
  text-shadow: 0 0 3px var(--map-name-halo, var(--map-land)), 1px 0 0 var(--map-name-halo, var(--map-land)), -1px 0 0 var(--map-name-halo, var(--map-land)), 0 1px 0 var(--map-name-halo, var(--map-land)), 0 -1px 0 var(--map-name-halo, var(--map-land));
}

.forecast-map-state-label span {
  transform: translate(-50%, -50%);
}

.forecast-map-city-label {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--map-name, var(--map-label));
  font-size: var(--city-label-size, 0.6875rem);
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
}

.forecast-map-city-label.is-major {
  font-weight: 700;
}

.forecast-map-city-label::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: currentColor;
}

.forecast-map-city-label.is-minor {
  font-weight: 300;
}

.forecast-map-city-label.is-small {
  font-weight: 200;
}

.forecast-map-city-label.is-right span {
  transform: translate(12px, -50%);
}

.forecast-map-city-label.is-left span {
  transform: translate(calc(-100% - 12px), -50%);
}

.forecast-map-city-label.is-below span {
  transform: translate(-50%, 12px);
}

.forecast-map-city-label.is-above span {
  transform: translate(-50%, calc(-100% - 12px));
}

.forecast-map-swatch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  min-width: 7rem;
  font-size: 0.75rem;
}

.forecast-map-swatch input[type="color"] {
  box-sizing: border-box;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.forecast-map-swatch input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.forecast-map-swatch input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 50%;
}

.forecast-map-swatch input[type="color"]::-moz-color-swatch {
  border: 0;
  border-radius: 50%;
}

/* Zoom */

.map-zoom {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  gap: 0.35rem;
}

/* A rounded square the same height as a layer button. --map-control-size
   is that height. The plus and minus are centered strokes. */
.map-zoom-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: var(--map-control-size, 1.5rem);
  height: var(--map-control-size, 1.5rem);
  min-width: var(--map-control-size, 1.5rem);
  min-height: var(--map-control-size, 1.5rem);
  padding: 0;
  border-radius: 0.5rem;
  line-height: 0;
}

.map-zoom-button svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.map-rail .map-zoom-button {
  flex: 0 0 auto;
}

.map-zoom-button:hover {
  background: var(--color-surface-hover);
}

.map-zoom-button:disabled {
  color: var(--color-muted);
  cursor: default;
}


/* Map chrome. Layers and zoom share the right rail. On the map page the
   filter icon sits on Play at the bottom left, and zoom matches that stack
   at the bottom right. The legend is the band between them. The forecast
   tile has no credit row. */

.map-dock {
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr) auto auto;
  grid-template-areas:
    "body rail"
    "foot rail"
    "credit credit";
  column-gap: 0.5rem;
  pointer-events: none;
}

:is(.forecast-map-page, .forecast-radar-stage) {
  --map-control-size: 1.5rem;
}

.forecast-map-page {
  --map-control-size: calc(2.7rem + 2px);
}

/* Zoom has its own cell in the bottom row, so that row is always at least
   as tall as zoom. Play and the filter icon fill the same height, so
   turning Radar on does not grow the row or squeeze the layer stack. Only
   a legend taller than zoom, which would reach under the layer buttons,
   takes room from the stack. The legend runs under the layer column up to
   zoom. */
.forecast-map-page .map-dock {
  --map-legend-tuck: 0.1rem;
  --map-zoom-size: var(--map-control-size);
  top: var(--app-bar-clearance);
  right: 0.75rem;
  bottom: 0.15rem;
  left: 0.75rem;
  grid-template-columns: auto minmax(0, 1fr) auto var(--map-zoom-size);
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "body body rail rail"
    "play legend legend zoom";
}

.forecast-map-page .map-rail {
  display: contents;
}

/* The bottom padding is the stack's own gap above zoom, less the 4px the
   negative margin lends to focus rings. */
.forecast-map-page .map-layers {
  grid-area: rail;
  padding-bottom: calc(0.35rem + 4px);
}

.forecast-map-page .map-rail .map-zoom,
.forecast-map-page .map-zoom {
  grid-area: zoom;
  z-index: 3;
  flex-direction: column;
  align-items: flex-end;
  align-self: end;
  justify-self: end;
  width: var(--map-zoom-size);
  margin: 0;
}

/* Filter over Play, the same square and the same gap as the zoom pair. */
.forecast-map-page .map-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 0.35rem;
  grid-area: play;
  align-self: end;
  justify-self: start;
  z-index: 5;
  pointer-events: none;
}

.forecast-map-page .map-foot .button.map-radar-play-icon-only,
.forecast-map-page .map-foot .button.map-photo-filters-toggle {
  width: var(--map-control-size);
  min-width: var(--map-control-size);
  height: var(--map-control-size);
  min-height: var(--map-control-size);
  padding: 0;
  gap: 0;
}

.forecast-radar-stage .map-dock {
  /* How far the freezing rain row may drop into the bottom inset. */
  --map-legend-tuck: 0.3rem;
  inset: 0.4rem 0.5rem 0.35rem;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas:
    "body rail"
    "foot rail";
}

/* Play and zoom share the bottom edge of the map. Play stays put on the
   layers that show it. When it is hidden, the legend shifts into its place. */
.forecast-radar-stage .map-foot {
  align-self: end;
  align-items: flex-end;
  z-index: 2;
  min-width: var(--map-control-size);
  min-height: var(--map-control-size);
}

.forecast-radar-stage .map-foot:has([data-forecast-radar-play][hidden]):not(:has([data-map-filters-toggle]:not([hidden]))) {
  min-width: 0;
}

.forecast-radar-stage .forecast-radar-legends {
  grid-area: foot;
  align-self: end;
  min-width: 0;
  max-width: calc(100% - var(--map-control-size) - 0.35rem);
  margin-left: calc(var(--map-control-size) + 0.35rem);
  pointer-events: none;
}

/* With neither Play nor the filter up, the legend takes the corner. While
   the filter shows (Forecast hides Play but keeps it), the legend keeps
   its place beside the filter, as it does on Radar. */
.forecast-radar-stage .map-dock:has([data-forecast-radar-play][hidden]):not(:has([data-map-filters-toggle]:not([hidden]))) .forecast-radar-legends {
  max-width: 100%;
  margin-left: 0;
}

.forecast-radar-stage .forecast-radar-legends:not(:has(.map-legend-unit:not([hidden]):not([data-unpainted]))) {
  display: none;
}

/* A forecast kind with nothing painted in the view, or whose tiles are still
   coming in, keeps its legend row out of the stack (maps/accumulation). */
.forecast-radar-stage .forecast-radar-legends .map-accumulation-legend[data-unpainted] {
  display: none;
}

.forecast-radar-stage .forecast-radar-legends-stack {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  color: var(--map-label);
  pointer-events: auto;
}

.map-rail {
  grid-area: rail;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.5rem;
  min-height: 0;
  pointer-events: none;
}

.map-rail > * {
  pointer-events: auto;
}

/* A short rail shrinks these buttons until the bottom of the last one, the
   experiments control, still sits above zoom. See maps/layer_fit.js. */
.map-layers [data-map-standard],
.map-layers [data-map-experiments],
.map-foot [data-map-standard] {
  display: contents;
}

.map-layers [data-map-standard][hidden],
.map-layers [data-map-experiments][hidden],
.map-foot [data-map-standard][hidden] {
  display: none;
}

.map-layers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1 1 auto;
  gap: 0.35rem;
  min-height: 0;
  margin: -4px;
  padding: 4px;
  overflow: hidden;
}

/* The refresh arrow and the flask share one row under the layers, so the
   stack stays one row shorter. The flask keeps the right edge, over zoom
   out. The arrow is that same square, just to its left. With no flask, the
   arrow keeps the right edge. The cog sits above Radar, right-aligned. */
.map-layer-tail {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  width: 100%;
}

.map-preferences-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  align-self: flex-end;
  width: 1.75rem;
  height: 1.75rem;
  color: var(--color-muted);
  text-decoration: none;
}

.map-preferences-link:hover {
  color: var(--color-ink);
}

.map-preferences-link:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.map-preferences-cog {
  width: 1.15rem;
  height: 1.15rem;
}

/* Compact layer buttons, tighter than .button-small. A phone and a short
   window on the full map, and a short window on the forecast tile. A phone
   forecast tile sizes that column to the longest name further down. A wide
   tall map replaces this below. */
.forecast-map-layers,
.forecast-radar-layers {
  --map-layer-width: 5.25rem;
}

.forecast-map-layers .button,
.forecast-radar-layers .button {
  flex: 0 0 auto;
  min-width: var(--map-layer-width);
  min-height: 1.5rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  line-height: 1.15;
}

/* Rounded squares the size of the minus button. The flask sits over it.
   The refresh arrow is the same square, on the flask's left. */
.forecast-map-layers :is([data-map-experiments-open], .map-reports-refresh) {
  width: var(--map-control-size);
  height: var(--map-control-size);
  min-width: var(--map-control-size);
  min-height: var(--map-control-size);
  padding: 0;
}

.forecast-map-layers :is([data-map-experiments-open], .map-reports-refresh) svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* A short window keeps Play and zoom at the compact layer-button height. */

.forecast-map-page .map-foot .map-radar-play svg,
.forecast-map-page .map-photo-filters-toggle svg {
  width: 1rem;
  height: 1rem;
}

/* Shared .button size. Same 40rem and 32rem cutoffs as the rest of the map.
   Play and zoom use that same height. Zoom stays a rounded square. */
@media (min-width: 40rem) and (min-height: 32rem) {
  .forecast-map-page .forecast-map-layers {
    --map-layer-width: 9rem;
  }

  .forecast-map-page .forecast-map-layers {
    gap: 0.5rem;
  }

  .forecast-map-page .map-group-toggle {
    min-width: var(--map-layer-width);
    min-height: 2.35rem;
    padding: 0.4rem 0.75rem 0.4rem 0.85rem;
    font-size: 0.8rem;
  }

  .forecast-map-page :is(.forecast-map-layers, .map-foot) .button {
    min-height: 0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.2;
  }

  .forecast-map-page .forecast-map-layers .button {
    white-space: nowrap;
  }

  .forecast-map-page .forecast-map-layers :is([data-map-experiments-open], .map-reports-refresh) {
    padding: 0;
  }

  .forecast-map-page :is(.map-foot .button, .button-experiment) {
    gap: 0.625rem;
  }

  .forecast-map-page :is(.map-foot .button, .button-experiment) svg,
  .forecast-map-page .map-foot .map-radar-play svg,
  .forecast-map-page .map-photo-filters-toggle svg {
    width: 1.15rem;
    height: 1.15rem;
  }

}

/* Play, the forecast kinds, and zoom share the layer buttons' height.
   This follows the wide-map padding so the vertical padding does not win. */
:is(.forecast-map-page, .forecast-radar-stage) .map-foot .button {
  height: var(--map-control-size);
  min-height: var(--map-control-size);
  padding-block: 0;
}

/* Frosted glass on every button over the map, on the map page and the
   forecast tile, so more of the weather shows through. Same colors as the
   shared variants, see-through and blurred. Hover firms them up a little.
   Specific enough to beat the shared :hover:not(:disabled) rules. The
   colors are the --frost-* tokens in application.css. */
.map-dock .button {
  -webkit-backdrop-filter: var(--frost-blur);
  backdrop-filter: var(--frost-blur);
}

.map-dock .button-secondary {
  background: var(--frost-surface);
  border-color: var(--frost-border);
}

.map-dock .button-secondary:hover:not(:disabled) {
  background: var(--frost-surface-hover);
}

.map-dock .button-primary {
  background: var(--frost-accent);
  border-color: var(--frost-accent-border);
}

.map-dock .button-primary:hover:not(:disabled) {
  background: var(--frost-accent-hover);
}

.map-dock .button-experiment {
  background: color-mix(in srgb, var(--color-experiment) 60%, transparent);
}

.map-dock .button-experiment:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-experiment-hover) 72%, transparent);
}

.map-dock .button-experiment.is-running {
  background: color-mix(in srgb, var(--color-experiment-running) 72%, transparent);
}

/* While the map moves or plays, the picture under every button changes each
   frame, and each blur would be redone each frame. maps/view sets
   is-map-busy on the stage for that time: the blur goes, and the buttons
   go more solid so they still read. */
.is-map-busy :is(.map-dock .button, .forecast-map-panel.tile) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.is-map-busy .map-dock .button-secondary {
  background: var(--frost-surface-busy);
}

.is-map-busy .map-dock .button-primary {
  background: var(--frost-accent-busy);
}

/* Bases and Overlays. An accordion of two pills, Bases above Overlays, each
   only as wide as its name and caret. Dark pills with small capitals, so
   they read as labels over the list rather than one more white or blue
   layer button. Ink, not blue, so a pill never reads as a layer that is on.
   Ink and surface swap in dark mode, so they stay the odd ones out. Both
   pills are opaque, never frosted, so the map never shows through a label.
   Open and closed pills are the same solid ink. Only the caret tells them
   apart: down when open, right when closed. A faint blue dot on a closed Overlays pill means
   something in it is on. A closed Bases pill shows the base that is on as a
   small round badge in the same corner, and nothing for Map only. The panels add no box of their own, so the stack gap
   and maps/layer_fit.js still apply. */
.map-group-toggle {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.4em;
  min-width: var(--map-layer-width);
  /* A little taller than the compact layer buttons. */
  min-height: 1.75rem;
  /* Room above and to the left for the dot and the Bases badge, which the
     layer stack would otherwise clip. */
  margin: 0.4rem 0 0.4rem 0.35rem;
  padding: 0.3rem 0.5rem 0.3rem 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-surface);
  font: inherit;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.map-group-toggle:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* Both pills are the same width: each name sits over a hidden copy of the
   longest one, Overlays, so the carets line up too. */
.map-group-name {
  display: grid;
  text-align: left;
}

.map-group-label,
.map-group-sizer {
  grid-area: 1 / 1;
}

.map-group-sizer {
  visibility: hidden;
}

/* Capitals have no descenders, so the line box leaves them riding high.
   Trim the box to cap height where the browser can; elsewhere nudge the
   text down by the usual gap. */
.map-group-label,
.map-group-sizer {
  padding-top: 0.1em;
}

@supports (text-box: trim-both cap alphabetic) {
  .map-group-label,
  .map-group-sizer {
    padding-top: 0;
    text-box: trim-both cap alphabetic;
  }
}

/* The shared filled caret, as on the location switch. */
.map-group-caret {
  flex: none;
  margin-left: auto;
  width: 0.95em;
  height: 0.64em;
  transition: transform 150ms ease;
}

.map-group-toggle[aria-expanded="false"] .map-group-caret {
  transform: rotate(-90deg);
}

/* A faint hint, not a marker: small, ringless, and mostly see-through, so
   it never reads as a location dot. */
.map-group-dot {
  position: absolute;
  top: -0.1rem;
  left: -0.1rem;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-accent) 45%, transparent);
}

/* The base that is on, in a small round face like a storm report mark. */
.map-group-badge {
  position: absolute;
  top: -0.4rem;
  left: -0.35rem;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
  /* maps/view.js sets the ring to the shown icon's report color. */
  border: 1px solid #334155;
  border-radius: 50%;
  background: var(--map-report-face);
  box-shadow: 0 1px 3px rgb(var(--overlay-rgb) / 35%);
  --hail-fill: var(--map-report-hail-fill);
  --hail-stroke: var(--map-report-hail-stroke);
  --hail-streak: var(--map-report-hail-streak);
  --ice-cloud: var(--map-report-ice-cloud);
  --ice-rain: var(--map-report-ice-rain);
  --ice-ice: var(--map-report-ice-ice);
  --rain-stroke: var(--map-report-rain-stroke);
  --rain-shine: var(--map-report-rain-shine);
}

.map-group-badge .report-icon {
  width: 0.72rem;
  height: 0.72rem;
  color: var(--map-report-icon, var(--report-color, #334155));
}

.map-group-dot[hidden],
.map-group-badge[hidden],
.map-group-badge [hidden] {
  display: none;
}

.map-layers .map-group {
  display: contents;
}

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

/* The opened set drops in from under its pill. */
.map-group-arriving > * {
  animation: map-group-arrive 200ms ease-out;
}

@keyframes map-group-arrive {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-group-toggle,
  .map-group-caret {
    transition: none;
  }

  .map-group-arriving > * {
    animation: none;
  }
}

.map-rail .map-zoom {
  flex: none;
  align-self: stretch;
  margin-top: auto;
}

/* The forecast tile uses the same stacked zoom as the map page. */
.forecast-radar-stage .map-rail .map-zoom {
  flex-direction: column;
  align-items: flex-end;
  align-self: flex-end;
  width: var(--map-control-size);
}

.map-credit {
  grid-area: credit;
  margin: 0.35rem 0 0;
  font-size: 0.625rem;
  line-height: 1.25;
  color: var(--map-label);
  pointer-events: auto;
  container: credit / inline-size;
}

.map-photo-pause {
  display: inline-flex;
  margin-left: 0.28rem;
  color: var(--scale-yellow);
  vertical-align: -0.15em;
}

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

.map-photo-pause svg {
  width: 0.9em;
  height: 0.9em;
}

.map-photo-pause-note[hidden] {
  display: none;
}

.map-photo-pause-note {
  margin-right: 0.35rem;
  padding: 0;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

/* A high or low pressure center from the WPC analysis. The letter takes the
   pressure scale's ends (low blue, high orange), and the reading sits under
   it in inHg. Both keep the place-name halo so they read over radar. */
/* Two classes, so Leaflet's .leaflet-marker-icon display, which the forecast
   tile loads after this sheet, cannot set the reading beside the letter. */
.leaflet-marker-icon.map-pressure-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  line-height: 1;
  --pressure-halo: var(--map-name-halo, var(--map-land));
}

/* The forecast tile's letters: nothing to tap. */
.map-pressure-mark.is-plain {
  cursor: default;
  pointer-events: none;
}

.map-pressure-mark .map-pressure-letter,
.map-pressure-mark .map-pressure-reading {
  text-shadow: 0 0 3px var(--pressure-halo), 1px 0 0 var(--pressure-halo), -1px 0 0 var(--pressure-halo), 0 1px 0 var(--pressure-halo), 0 -1px 0 var(--pressure-halo);
}

.map-pressure-mark .map-pressure-letter {
  font-size: 1.75rem;
  font-weight: 800;
}

.map-pressure-mark.is-high .map-pressure-letter {
  color: var(--scale-high);
}

.map-pressure-mark.is-low .map-pressure-letter {
  color: var(--scale-low);
}

.map-pressure-mark .map-pressure-letter,
.map-pressure-mark .map-pressure-reading {
  display: block;
  white-space: nowrap;
}

.map-pressure-mark .map-pressure-reading {
  margin-top: 0.05rem;
  color: var(--map-name, var(--map-label));
  font-size: 0.6875rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* One surface for a hazard's name: the hover tip, the popup on maps that
   move, and the note docked on the forecast tile. */
.map-hazard-popup .leaflet-popup-content-wrapper,
.map-report-popup .leaflet-popup-content-wrapper,
.leaflet-tooltip.map-hazard-tip,
.map-hazard-note {
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  background: var(--color-surface);
  color: var(--color-ink);
  box-shadow: none;
}

.leaflet-tooltip.map-hazard-tip {
  border-radius: 0.35rem;
}

.leaflet-tooltip.map-hazard-tip.leaflet-tooltip-top::before {
  border-top-color: var(--color-border);
}

.map-hazard-popup .leaflet-popup-tip,
.map-report-popup .leaflet-popup-tip {
  background: var(--color-surface);
  box-shadow: none;
}

.map-hazard-popup .leaflet-popup-content,
.map-report-popup .leaflet-popup-content {
  margin: 0.55rem 0.7rem;
  line-height: 1.35;
}

.map-hazard-popup .leaflet-popup-close-button,
.map-report-popup .leaflet-popup-close-button {
  color: var(--color-muted);
  padding: 0.3rem 0.35rem 0 0;
}

/* Two classes, so Leaflet's 1.3em popup paragraph margin loses.
   Hazard and storm-report dock cards share the same type size. */
.map-hazard-card .map-hazard-name,
.map-hazard-card .map-hazard-detail,
.map-report-card-title,
.map-report-card-place,
.map-report-card-when,
.map-report-card-remarks,
.map-report-card-more {
  margin: 0;
  font-size: 0.8125rem;
}

.map-hazard-card .map-hazard-name {
  font-weight: 700;
  padding-right: 0.75rem;
}

.map-hazard-card .map-hazard-detail {
  margin-top: 0.2rem;
}

.map-hazard-card .button,
.map-report-card .button {
  margin-top: 0.5rem;
}

.map-report-card {
  line-height: 1.2;
}

.map-report-card-title {
  font-weight: 700;
}

.map-report-card-when,
.map-report-card-place {
  display: block;
}

.map-report-card-when {
  color: var(--color-muted);
}

.map-report-card-remarks {
  margin-top: 0.2rem;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* Space only between reports, not between lines of one report. */
.map-report-card-more {
  margin-top: 0.45rem;
  color: var(--color-muted);
}

/* Above Play in the corner, clear of the place in the middle and the time
   at the top. */
.map-hazard-note,
.map-report-note {
  grid-area: body;
  justify-self: start;
  align-self: end;
  position: relative;
  box-sizing: border-box;
  max-width: min(16rem, 100%);
  margin-bottom: 0.35rem;
  padding: 0.5rem 2rem 0.5rem 0.7rem;
  line-height: 1.35;
  pointer-events: auto;
}

.map-dock:has(.map-photo-filters-sheet:not([hidden])) .map-hazard-note {
  display: none;
}

.map-hazard-close {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
}

.map-hazard-close::before {
  content: "";
  position: absolute;
  inset: -0.625rem;
}

.map-hazard-close:hover {
  color: var(--color-ink);
}

.map-hazard-close svg {
  display: block;
  width: 0.875rem;
  height: 0.875rem;
}

/* Legends: .map-legend is a name (.map-legend-key) and a row of chips
   (.map-legend-chips, each a .map-legend-chip with a .map-legend-swatch).
   Wind, clouds, vapor, the storm totals, and the radar rows are all one.
   Every name takes --legend-key-w and every chip --legend-chip-w, with
   --legend-gap between, so the first chips of stacked legends line up. */
:root {
  --legend-key-w: 3.25rem;
  --legend-chip-w: 2.25rem;
  --legend-gap: 0.3rem;
}

/* Age bolts and the chip legends sit on their own lines above the
   attribution. Hidden until their layer draws. */
.map-lightning-legend:not([hidden]),
.map-legend:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.35rem;
  width: 100%;
  font-size: 0.75rem;
  font-weight: 700;
}

/* The name sits left of the chips, centered on the chip and its value.
   A phone shrinks the chips instead of wrapping them. */
.map-legend:not([hidden]) {
  flex-wrap: nowrap;
  align-items: center;
  column-gap: 0.15rem;
  min-width: 0;
}

.map-legend-key {
  flex: none;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

/* Snow, ice, rain, clouds, vapor, and wind keep one word. Any other name
   stacks and centers in the same type, on the chip and its value. */
.map-legend:not(.map-accumulation-legend, .map-chip-legend, .map-wind-legend) .map-legend-key {
  width: min-content;
  max-width: var(--legend-key-w);
  text-align: center;
  white-space: normal;
}

.map-legend-chips {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  gap: 0.08rem;
  align-items: flex-end;
  width: auto;
  min-width: 0;
}

.map-legend-chip {
  position: relative;
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  gap: 0.06rem;
  width: auto;
  max-width: 1.7rem;
  min-width: 0;
  padding: 0.15rem 0;
  white-space: nowrap;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.6rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  line-height: 1;
  color: inherit;
  cursor: pointer;
}

.map-legend-chip:focus-visible,
.map-legend-chip.is-open,
.map-legend-chip.is-picked {
  z-index: 6;
  outline: var(--focus-ring);
  outline-offset: 2px;
}

/* The shared hover tip is off on a phone. A tap sets is-open, and the same
   bubble is used there. Long category sentences wrap, and a chip near
   either edge keeps the bubble on screen. */
.map-legend-chip.is-open::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: calc(100% + 0.2rem);
  width: max-content;
  max-width: 12.5rem;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: var(--color-tooltip);
  color: var(--color-on-tooltip);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  white-space: pre-line;
  text-align: left;
  pointer-events: none;
  transform: translateX(-50%);
}

.map-legend-chip.tooltip-end.is-open::after {
  right: 0;
  left: auto;
  transform: none;
}

.map-legend-chip.tooltip-start.is-open::after {
  right: auto;
  left: 0;
  transform: none;
}

@media (hover: hover) {
  .map-legend-chip[data-tooltip]:is(:hover, :focus-visible)::after {
    width: max-content;
    max-width: 12.5rem;
    letter-spacing: 0;
    white-space: pre-line;
    text-align: left;
  }

  .map-legend-chip.tooltip-end[data-tooltip]:is(:hover, :focus-visible)::after {
    right: 0;
    left: auto;
    transform: none;
  }

  .map-legend-chip.tooltip-start[data-tooltip]:is(:hover, :focus-visible)::after {
    right: auto;
    left: 0;
    transform: none;
  }
}

.map-legend-swatch {
  width: 100%;
  height: 0.55rem;
  border-radius: 0.15rem;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

/* Snow, ice, and rain each have a row. On a wide credit the three share one
   line when every chip can keep its full width. Otherwise each stays stacked.
   The credit line is already a container, so this row does not make another. */
.map-accumulation-legends {
  display: block;
  width: 100%;
}

.map-accumulation-legends:not(:has(.map-legend-unit:not([hidden]))) {
  display: none;
}

.map-accumulation-legends-row {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

/* Clouds and vapor (map-chip-legend) take the storm totals' layout: the
   name, then chips with the word over them. Their chips do not pick a band
   on the map, so they leave out map-accumulation-legend. Wind takes the
   same layout, but keeps its own flexible chip width for its twelve bands. */
:is(.map-accumulation-legend, .map-chip-legend, .map-wind-legend):not([hidden]) {
  align-items: flex-end;
  gap: 0.15rem var(--legend-gap);
}

/* The name lines up with the chips, not the chips and amounts together, as
   on radar. The chip's middle is 0.425rem up (0.15rem padding plus half of
   0.55rem), and the name's is 0.375rem (half its 0.75rem line). The column
   is --legend-key-w and the gap after it --legend-gap, as on radar, so
   every legend's first chip starts at the same spot. */
:is(.map-accumulation-legend, .map-chip-legend, .map-wind-legend) .map-legend-key {
  width: var(--legend-key-w);
  min-width: min-content;
  margin-bottom: 0.05rem;
}

/* The amount sits above its chip, as the radar's strength words do. */
:is(.map-accumulation-legend, .map-chip-legend, .map-wind-legend) .map-legend-chip {
  flex-direction: column-reverse;
  max-width: var(--legend-chip-w);
}

/* Radar by precipitation type: a row per kind on screen, the strength
   words over the chips, and the same five columns in every row. */
.map-radar-legends:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

.map-radar-type-legend:not([hidden]) {
  gap: 0.15rem var(--legend-gap);
}

/* Wide enough for "Freezing", which wraps "rain" under it, so the chips sit
   close to the names. */
.map-radar-legends .map-radar-type-legend .map-legend-key {
  width: var(--legend-key-w);
  min-width: min-content;
  max-width: none;
  text-align: left;
  white-space: nowrap;
}

/* The storm forecast's chip width at every size. Five chips never need to
   stretch across a phone. Clouds and vapor have five too, and take the same
   chips and gaps so their columns sit right over radar's. A word wider than
   its chip spills over the chips beside it. */
:is(.map-radar-type-legend, .map-chip-legend) .map-legend-chip {
  flex: 0 1 var(--legend-chip-w);
  min-width: 0;
  max-width: var(--legend-chip-w);
}

/* Freezing rain is always the last row. Its name wraps, and the chips stay
   level with "Freezing". */
.map-radar-legends [data-radar-kind="freezing_rain"] {
  order: 1;
  align-items: flex-start;
}

.map-radar-legends [data-radar-kind="freezing_rain"] .map-legend-key {
  white-space: normal;
}

/* When the radar rows are the last legend, "rain" drops into the dock's
   bottom gap, down at the bottom edge of the map. */
.map-radar-legends:not(:has(~ .map-legend-unit:not([hidden]), ~ .map-accumulation-legends .map-legend-unit:not([hidden]))) [data-radar-kind="freezing_rain"] {
  margin-bottom: calc(-1 * var(--map-legend-tuck, 0rem));
}

/* The strength words, once, over the chip columns. */
.map-radar-words .map-legend-chip {
  cursor: default;
  padding-bottom: 0;
}

/* The range label replaces the small chip tip. */
.map-accumulation-legend .map-legend-chip[data-tooltip]::after {
  content: none;
}

/* The range label and the amount label share one panel. The range sits just
   above the pointer or the chip, and eases when it moves. */
.map-band-range,
.map-accumulation-amount-panel {
  padding: 0.2rem 0.5rem;
  border-radius: 0.3rem;
  background: var(--map-panel);
  color: var(--color-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.map-band-range {
  position: fixed;
  z-index: 6;
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, calc(-100% - 0.4rem));
  transition: left 200ms ease, top 200ms ease, opacity 180ms ease;
}

.map-band-kind,
.map-accumulation-amount-panel span {
  display: block;
}

.map-accumulation-amount-panel {
  display: block;
  width: max-content;
  background: color-mix(in srgb, var(--map-panel) 78%, transparent);
  transform: translate(-50%, -50%);
}

.map-band-range.is-below {
  transform: translate(-50%, 0.45rem);
}

.map-band-range.is-shown {
  opacity: 1;
}

.map-band-range.is-quiet {
  transition: opacity 180ms ease;
}

/* One screen pixel of a lighter shade of the same color. It sits above the
   wash and under the amount labels, and fades when the color changes. */
.map-band-hit {
  position: absolute;
  z-index: 1;
  margin: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms ease;
}

.map-band-hit.is-shown {
  opacity: 1;
}

/* One summary for the place forecast. It sits above the map, so a city
   name cannot cover it, and the panel is light enough that the wash
   still reads through it. */
.forecast-view-summary {
  position: absolute;
  z-index: 4;
  top: 0.45rem;
  left: 50%;
  max-width: calc(100% - 4.5rem);
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--map-panel) 78%, transparent);
  color: var(--color-ink);
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  pointer-events: none;
  transform: translateX(-50%);
}

/* Trial amount labels. Leaflet's icon box is zero wide, so the size is forced. */
.map-accumulation-amount {
  width: max-content !important;
  height: auto !important;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: none;
}

.map-chip-label-narrow {
  display: none;
}

@container map (max-width: 40rem) {
  .map-chip-label {
    display: none;
  }

  .map-chip-label-narrow {
    display: inline;
  }

  .map-legend-chip {
    max-width: none;
  }

  .map-accumulation-legend .map-legend-chip {
    flex: 1 0 auto;
    width: auto;
    min-width: min-content;
  }

  .map-accumulation-legend .map-legend-chips {
    gap: 0.04rem;
  }
}

/* Once the credit is wide enough for every accumulation chip to keep its
   width, the three rows share one line. Each name keeps the --legend-key-w
   column and the --legend-gap, so the first kind's chips still line up with
   clouds, vapor, and radar. */
@container credit (min-width: 76rem) {
  .map-accumulation-legends-row {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    column-gap: 1.5rem;
  }

  .map-accumulation-legends-row .map-accumulation-legend:not([hidden]) {
    width: auto;
    flex: 0 0 auto;
  }

  .map-accumulation-legends-row .map-legend-chips {
    flex: 0 0 auto;
  }

  .map-accumulation-legends-row .map-legend-chip {
    flex: 0 0 var(--legend-chip-w);
    width: var(--legend-chip-w);
    max-width: var(--legend-chip-w);
  }
}

.map-lightning-swatch {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  white-space: nowrap;
}

/* A wide view sends only the newest bands. */
.map-lightning-swatch[hidden] {
  display: none;
}

.map-lightning-swatch svg {
  width: 0.75rem;
  height: 0.875rem;
  overflow: visible;
  fill: var(--bolt);
  stroke: rgb(17 24 39 / 0.9);
  stroke-width: 1;
  stroke-linejoin: round;
}

.map-lightning-swatch:last-of-type svg {
  opacity: 0.65;
}

.leaflet-container.map-lightning-hit:not(.leaflet-dragging) {
  cursor: pointer;
}

@container map (max-width: 40rem) {
  /* Three rows: the search card, the open map, and the bottom row of Play,
     legend, and zoom. The dock spans all three as a subgrid, so the layer
     column can rise beside the card, up to the app bar, while the legend and
     the notes stay below the card. A tall legend then takes room from the
     map instead of pushing refresh and the flask out of the stack. The
     columns are the dock's, so the card ends one gap left of the layer
     column however wide its buttons are, which also clears the app bar.
     The card row caps at what the old max-height allowed. min-height: 0 on
     the card lets that cap win over its contents. */
  .forecast-map-chrome {
    --map-zoom-size: 2.5rem;
    position: absolute;
    z-index: 2;
    inset: 0.75rem 0.75rem 0.15rem;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto var(--map-zoom-size);
    grid-template-rows: fit-content(min(50vh, calc(100% - 8rem))) minmax(0, 1fr) auto;
    column-gap: 0.5rem;
    pointer-events: none;
  }

  .forecast-map-chrome > .forecast-map-panel {
    position: static;
    grid-row: 1;
    grid-column: 1 / 3;
    width: auto;
    min-height: 0;
    max-height: none;
    margin: 0 0 0.5rem;
    padding: 0.7rem 0.75rem;
    pointer-events: auto;
  }

  .forecast-map-chrome > .forecast-map-panel h1 {
    overflow: hidden;
    font-size: 1.15rem;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .forecast-map-chrome > .forecast-map-panel .forecast-place-tools {
    margin-top: 0.45rem;
  }

  /* The card does not make a stacking context here, so the menu can sit
     above the dock and the layer buttons beside the search. */
  .forecast-map-chrome .place-suggestions {
    z-index: 4;
  }

  /* Zoom is bigger than the compact 1.75rem squares, still under the
     finger-sized control, so the legend and the layer stack keep their room. */
  .forecast-map-chrome > .map-dock {
    --map-legend-tuck: 0rem;
    --map-zoom-size: 2.5rem;
    position: relative;
    inset: auto;
    grid-row: 1 / -1;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    grid-template-rows: subgrid;
    grid-template-areas:
      ". . rail rail"
      "body body rail rail"
      "play legend legend zoom";
  }

  /* The stack starts under the app bar, as on a wide map. The -4px is the
     focus-ring margin every .map-layers already has. */
  .forecast-map-chrome .map-layers {
    margin-top: calc(var(--app-bar-clearance) - 0.75rem - 4px);
  }

  .forecast-map-footer {
    padding: 0.05rem 0.35rem;
    font-size: 0.75rem;
    line-height: 1.15;
  }

  .forecast-map-chrome .map-foot .button {
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0 0.65rem;
    font-size: 0.8125rem;
    line-height: 1.15;
  }

  .forecast-map-chrome .map-foot .button.map-radar-play,
  .forecast-map-chrome .map-foot .button.map-photo-filters-toggle,
  .forecast-map-chrome .map-zoom-button,
  .forecast-map-chrome .forecast-map-layers :is([data-map-experiments-open], .map-reports-refresh) {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    gap: 0;
  }

  .forecast-map-chrome .map-foot .map-radar-play svg,
  .forecast-map-chrome .map-photo-filters-toggle svg,
  .forecast-map-chrome .map-zoom-button svg {
    width: 1.15rem;
    height: 1.15rem;
  }
}

.admin-map-preview {
  position: relative;
  height: 20rem;
  margin-top: 0.75rem;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: 0.5rem;
  background: var(--map-ocean);
}

.admin-map-canvas {
  position: absolute;
  inset: 0;
}

.admin-map-preview .leaflet-container {
  background: var(--map-ocean);
  font-family: inherit;
}

.admin-map-preview .map-zoom {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
}

.admin-map-preview .map-radar-stamp {
  position: absolute;
  z-index: 3;
  left: 10px;
  bottom: 10px;
  margin: 0;
}

/* Storm report pins. Small rounded mark like a photo pin. Full opacity
   above other map layers. Light and dark faces keep every type readable.
   A click opens the note; nothing opens on hover. */

.leaflet-div-icon.map-report-pin {
  background: transparent;
  border: 0;
  overflow: visible;
  cursor: pointer;
}

.map-report-mark {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 26px;
  line-height: 1;
  opacity: 1;
  pointer-events: none;
}

.map-report-pin-face {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--report-color, #334155);
  border-radius: 999px;
  background: var(--map-report-face);
  box-shadow: 0 1px 4px rgb(var(--overlay-rgb) / 40%);
  overflow: visible;
  --hail-fill: var(--map-report-hail-fill);
  --hail-stroke: var(--map-report-hail-stroke);
  --hail-streak: var(--map-report-hail-streak);
  --ice-cloud: var(--map-report-ice-cloud);
  --ice-rain: var(--map-report-ice-rain);
  --ice-ice: var(--map-report-ice-ice);
  --rain-stroke: var(--map-report-rain-stroke);
  --rain-shine: var(--map-report-rain-shine);
}

:is(.map-report-pin, .map-report-mark).is-fresh .map-report-pin-face {
  border-width: 3px;
}

.map-report-pin-face .report-icon {
  width: 16px;
  height: 16px;
  color: var(--map-report-icon, var(--report-color, #334155));
}

.map-report-value {
  position: absolute;
  z-index: 2;
  top: -0.55rem;
  left: 50%;
  min-width: 1rem;
  height: 0.9rem;
  padding: 0 0.2rem;
  border: 1px solid var(--map-report-badge-ink);
  border-radius: 999px;
  background: var(--map-report-badge);
  color: var(--map-report-badge-ink);
  font-size: 0.5625rem;
  font-weight: 700;
  line-height: 0.9rem;
  text-align: center;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

/* Peak amount pulses twice, then rests on the base badge. */
.map-report-pin.is-peak-flash .map-report-value,
.map-report-mark.is-peak-flash .map-report-value {
  animation: map-report-value-flash 1.6s ease-in-out 2 forwards;
}

@media (prefers-reduced-motion: reduce) {
  .map-report-pin.is-peak-flash .map-report-value,
  .map-report-mark.is-peak-flash .map-report-value {
    animation: none;
  }
}

@keyframes map-report-value-flash {
  0%, 100% {
    background: var(--map-report-badge);
    color: var(--map-report-badge-ink);
    border-color: var(--map-report-badge-ink);
  }

  50% {
    background: #7dd3fc;
    color: #0f172a;
    border-color: #0f172a;
  }
}

/* Tip sits over the face; top corners meet the circle rim. */
.map-report-pin-tip {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: -4px;
}

.map-report-pin-point {
  display: block;
  width: 0;
  height: 0;
  /* Base a touch under the face so corners meet the rim; taller for a soft taper. */
  border-right: 9px solid transparent;
  border-left: 9px solid transparent;
  border-top: 13px solid var(--report-color, #334155);
  filter: drop-shadow(0 1px 1px rgb(var(--overlay-rgb) / 45%));
}

.map-report-pin-stack {
  position: absolute;
  z-index: 3;
  top: 1px;
  left: 50%;
  color: #fff;
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  transform: translateX(-50%);
  text-shadow: 0 0 1px rgb(0 0 0 / 45%);
}

.map-reports-refresh svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.map-reports-refresh[aria-busy="true"] svg {
  animation: map-radar-spin 0.7s linear infinite;
}

.map-spin {
  display: block;
  box-sizing: border-box;
  flex: none;
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: map-radar-spin 0.7s linear infinite;
}

.button-experiment > .map-spin {
  display: none;
}

.button-experiment[aria-busy="true"] > svg {
  display: none;
}

.button-experiment[aria-busy="true"] > .map-spin {
  display: block;
}

.leaflet-div-icon.map-photo-pin {
  background: transparent;
  border: 0;
  overflow: visible;
  pointer-events: auto;
}

.map-photo-pin-face {
  position: relative;
  display: block;
  overflow: visible;
}

.map-photo-pin-count {
  position: absolute;
  z-index: 2;
  top: -0.35rem;
  left: 50%;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border: 1px solid var(--map-badge-ink);
  border-radius: 999px;
  background: var(--map-badge);
  color: var(--map-badge-ink);
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  /* A merged pin can count to 100; left: 50% alone caps the width at half the pin. */
  width: max-content;
  white-space: nowrap;
  transform: translateX(-50%);
  pointer-events: none;
}

.map-photo-pin-photo {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 2px solid #fff;
  border-radius: 0.45rem;
  background: var(--color-surface);
  box-shadow: 0 0 0 1px rgb(var(--overlay-rgb) / 35%), 0 1px 3px rgb(var(--overlay-rgb) / 28%);
  overflow: hidden;
}

.map-photo-pin-photo img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.map-photo-pin-point {
  display: block;
  width: 0;
  height: 0;
  margin: -1px auto 0;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
  border-top: 8px solid #fff;
  filter: drop-shadow(0 1px 1px rgb(var(--overlay-rgb) / 45%));
}

.map-photo-pin-point.is-fresh {
  border-top-color: var(--photo-fresh);
}

.map-photo-pin-tag {
  position: absolute;
  z-index: 1;
  left: 1px;
  bottom: 1px;
  display: flex;
  width: 14px;
  height: 14px;
  border: 0;
  background: none;
  pointer-events: none;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px rgb(var(--overlay-rgb) / 80%));
}

.map-photo-pin-tag .tag-icon {
  width: 14px;
  height: 14px;
}

.map-photo-pin-photo.is-fresh {
  border-color: var(--photo-fresh);
  box-shadow: 0 0 0 3px var(--photo-fresh);
}

.map-photo-pin-photo.is-arriving {
  animation: map-photo-arrive 0.55s ease-out;
}

@media (prefers-reduced-motion: reduce) {
  .map-photo-pin-photo.is-arriving {
    animation: none;
  }
}

@keyframes map-photo-arrive {
  from { transform: scale(0.4); }
  to { transform: scale(1); }
}

.forecast-radar-stage .map-photo-pin-photo,
.forecast-radar-stage .map-photo-pin-photo img,
.map-photo-pin.is-current .map-photo-pin-photo,
.map-photo-pin.is-current .map-photo-pin-photo img {
  width: 64px;
  height: 64px;
}

.forecast-radar-stage .map-photo-pin-tag,
.forecast-radar-stage .map-photo-pin-tag .tag-icon,
.map-photo-pin.is-current .map-photo-pin-tag,
.map-photo-pin.is-current .map-photo-pin-tag .tag-icon {
  width: 22px;
  height: 22px;
}

.forecast-radar-stage .map-photo-pin-point,
.map-photo-pin.is-current .map-photo-pin-point {
  border-right-width: 11px;
  border-left-width: 11px;
  border-top-width: 12px;
}

/* Photo tags */

/* Play sits bottom left. The filter icon is the square above it. The sheet
   opens flush with that icon and covers the page above it. */

.map-foot {
  grid-area: foot;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 0.35rem;
  pointer-events: none;
}

.map-foot .button {
  gap: 0.35rem;
  line-height: 1.15;
  pointer-events: auto;
}

.map-foot .button svg,
.map-photo-filters-toggle svg {
  display: block;
  width: 0.875rem;
  height: 0.875rem;
}

/* Forecast tile: filter over Play. Lightning and clouds stack over the radar
   rows in .forecast-radar-legends, so the two never share the corner. The
   wind scale is the one legend here, and it takes the bottom band. */
.forecast-radar-stage .map-foot {
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 0.35rem;
}

.forecast-radar-stage .map-foot > [data-map-standard] {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  pointer-events: none;
}

.forecast-radar-stage .map-foot .button.map-radar-play-icon-only,
.forecast-radar-stage .map-foot .button.map-photo-filters-toggle {
  width: var(--map-control-size);
  min-width: var(--map-control-size);
  height: var(--map-control-size);
  min-height: var(--map-control-size);
  padding: 0;
  gap: 0;
  pointer-events: auto;
}

/* Filter sheet labels stay compact. Do not follow the tall Radar layer
   pills or the coarse 44px floor. */
.forecast-radar-stage .map-photo-filters-sheet .button {
  box-sizing: border-box;
  min-width: 0;
  min-height: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  font-size: 0.75rem;
  line-height: 1;
}

.forecast-radar-stage .map-play-legends {
  display: flex;
  flex: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.12rem;
  min-width: 0;
  color: var(--map-label);
  pointer-events: none;
}

.forecast-radar-stage .map-play-legends:not(:has(.map-legend-unit:not([hidden]))) {
  display: none;
}

.forecast-radar-stage .map-play-legends .map-legend {
  flex: none;
  width: auto;
  max-width: none;
  pointer-events: auto;
}

/* The tile's buttons stay at the finger size in both widths. */
.forecast-radar-stage .map-dock {
  --map-control-size: calc(2.7rem + 2px);
}

/* The tile follows its own width. A wide window with a narrow forecast
   column keeps the stacked legends and the phone controls. */
@container map (width >= 40rem) {
  .forecast-radar-stage .forecast-radar-layers {
    --map-layer-width: 9rem;
  }

  .forecast-radar-stage .forecast-radar-layers {
    gap: 0.5rem;
  }

  .forecast-radar-stage :is(.forecast-radar-layers, .map-foot) .button {
    min-height: 0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.2;
  }

  .forecast-radar-stage .forecast-radar-layers .button {
    white-space: nowrap;
  }

  .forecast-radar-stage :is(.map-foot .button, .button-experiment) {
    gap: 0.625rem;
  }

  .forecast-radar-stage :is(.map-foot .button, .button-experiment) svg {
    width: 1.15rem;
    height: 1.15rem;
  }
}

.map-radar-play {
  min-width: 5.75rem;
  white-space: nowrap;
}

.map-radar-play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.map-radar-play-icon[hidden] {
  display: none;
}

/* The forecast tile's play control is the arrow, the spinner, or the pause lines,
   at the same height as the layer buttons. */
.map-radar-play.map-radar-play-icon-only,
.forecast-radar-stage .map-foot .button.map-radar-play-icon-only {
  width: var(--map-control-size, 1.5rem);
  min-width: var(--map-control-size, 1.5rem);
  height: var(--map-control-size, 1.5rem);
  min-height: var(--map-control-size, 1.5rem);
  padding: 0;
  gap: 0;
  line-height: 0;
}

.map-radar-play.map-radar-play-icon-only svg,
.forecast-radar-stage .map-foot .button.map-radar-play-icon-only svg {
  width: 1.15rem;
  height: 1.15rem;
}

.map-radar-play-icon .map-spin {
  width: 1rem;
  height: 1rem;
}

/* Five choices fit a narrow tile. The names keep the shared button height, and the
   column is only as wide as the longest word. Play and zoom stay square. The
   names sit closer together than plus and minus, so they read as one group. */
@container map (width < 40rem) {
  .forecast-radar-stage .forecast-radar-layers {
    align-items: stretch;
    width: max-content;
    gap: 0.2rem;
  }

  .forecast-radar-stage :is(.forecast-radar-layers, .map-foot) .button {
    min-height: 0;
    font-size: 1rem;
    line-height: 1.2;
  }

  .forecast-radar-stage .forecast-radar-layers .button {
    min-width: 0;
    padding: 0.75rem 0.35rem;
    white-space: nowrap;
  }

  .forecast-radar-stage .map-foot .button {
    padding: 0.75rem 1rem;
  }
}

/* The tile's refresh arrow matches the layer buttons' height and sits on
   their right edge. This follows the container padding so that padding
   does not stretch it into a wide button. */
.forecast-radar-stage .forecast-radar-layers .map-reports-refresh {
  align-self: flex-end;
  width: var(--map-control-size);
  height: var(--map-control-size);
  min-width: var(--map-control-size);
  min-height: var(--map-control-size);
  padding: 0;
}

/* The speed scale needs the whole bottom band, on a phone and on a desktop
   tile. The chips run from Play to the zoom buttons. Each label keeps its
   own width. */
.forecast-radar-stage .map-play-legends:has(.map-legend-unit:not([hidden])) {
  position: absolute;
  right: calc(var(--map-control-size) + 0.35rem);
  bottom: 0;
  left: calc(var(--map-control-size) + 0.35rem);
  flex-direction: column;
  align-items: stretch;
  width: auto;
  max-width: none;
}

.forecast-radar-stage .map-dock:has([data-forecast-radar-play][hidden]) .map-play-legends:has(.map-legend-unit:not([hidden])) {
  left: 0;
}

/* Speed sits left of the chips, centered on the swatches, like every other
   legend. Wind is the one legend in this band, so Speed takes its own width
   instead of the shared --legend-key-w column. The chips need about 170px
   and Speed about 40px, and Play and zoom take about 100px, so a map 20rem
   wide fits them on one line. That covers a 360px phone. Only a narrower
   map puts Speed above the chips. */
.forecast-radar-stage .map-play-legends .map-legend:not([hidden]) {
  width: 100%;
}

.forecast-radar-stage .map-play-legends .map-wind-legend .map-legend-key {
  width: auto;
}

@container map (max-width: 20rem) {
  .forecast-radar-stage .map-play-legends .map-legend:not([hidden]) {
    flex-direction: column;
    align-items: stretch;
    row-gap: 0.15rem;
  }

  .forecast-radar-stage .map-play-legends .map-legend .map-legend-key {
    width: auto;
    max-width: none;
    text-align: left;
    white-space: nowrap;
  }
}

.forecast-radar-stage .map-play-legends .map-legend .map-legend-chips {
  width: 100%;
}

.forecast-radar-stage .map-play-legends .map-legend .map-legend-chip {
  flex: 1 0 auto;
  max-width: none;
  min-width: min-content;
}

@keyframes map-radar-spin {
  to { transform: rotate(360deg); }
}

/* Same chip as the time on a trending photo. On the full map it sits above
   Play, clear of the search panel. */
.map-radar-stamp {
  grid-area: body;
  justify-self: start;
  align-self: start;
  z-index: 1;
  width: max-content;
  margin: 0.15rem 0 0;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgb(var(--overlay-rgb) / 72%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.map-radar-stamp:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}

/* The full map's time line: one pill holding the radar time, which the
   radar code shows and hides, and "No precipitation forecasted", which
   maps/accumulation shows and hides while the snow, ice, and rain pictures
   paint nothing in view. Each part has one owner. The pill shows while
   either part does, and a dot sits between them when both do. */
.map-stamp-line {
  display: none;
  align-items: center;
  gap: 0.28rem;
  z-index: 1;
  width: max-content;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgb(var(--overlay-rgb) / 72%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}

.map-stamp-line:has(> :not([hidden])) {
  display: inline-flex;
}

.map-stamp-line .map-radar-stamp {
  margin: 0;
  padding: 0;
  background: none;
}

.map-stamp-line .map-radar-stamp:not([hidden]) + .map-forecast-none:not([hidden])::before {
  content: "\00b7\00a0";
}

.map-radar-stamp-caution {
  color: var(--scale-yellow);
  pointer-events: auto;
}

.map-radar-stamp-caution:not([hidden]) {
  display: inline-flex;
  align-items: center;
}

.map-radar-stamp .map-radar-stamp-caution svg,
.national-map-credit .map-radar-stamp-caution svg {
  display: block;
  width: 0.8rem;
  height: 0.8rem;
}

/* The full map's time rides just above the foot's top edge: above the
   filter icon, above Play when Play stands alone, and at the bottom corner
   when the foot is empty. It sits out of flow so it never widens Play's
   column. The bottom row is as tall as zoom, so a time placed in the body
   area floated well above a lone Play. */
.map-foot {
  position: relative;
}

.map-foot > .map-stamp-line {
  position: absolute;
  bottom: calc(100% + 0.35rem);
  left: 0;
  margin: 0;
}

.map-foot:not(:has([data-map-standard]:not([hidden]) > .button:not([hidden]))) > .map-stamp-line {
  bottom: 0;
}

/* With Play and the filter icon gone (Experiments), the legend takes their
   corner, so the time rides on top of the legend the way it rides on top
   of Play. The foot steps aside as the time's containing block so the
   time can anchor to the legend. Without anchor support the time keeps
   the bottom corner. */
@supports (anchor-name: --map-legends) {
  .forecast-map-page .forecast-map-legends {
    anchor-name: --map-legends;
  }

  .forecast-map-page .map-dock:has(.forecast-map-legends .map-legend-unit:not([hidden])) .map-foot:not(:has([data-map-standard]:not([hidden]) > .button:not([hidden]))) {
    position: static;
  }

  .forecast-map-page .map-dock:has(.forecast-map-legends .map-legend-unit:not([hidden])) .map-foot:not(:has([data-map-standard]:not([hidden]) > .button:not([hidden]))) > .map-stamp-line {
    position-anchor: --map-legends;
    bottom: calc(anchor(top) + 0.35rem);
    left: anchor(left);
  }
}

.forecast-map-page .map-stamp-line .map-radar-stamp {
  margin: 0;
}

/* Forecast tile: the top corner holds lightning's own line and the map
   time, each its own pill, so the two never read as one report. While the
   forecast sentence is up across the top, they drop below it. */
.forecast-radar-stage .map-stamp-chip {
  display: none;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  grid-area: body;
  justify-self: start;
  align-self: start;
  z-index: 1;
  box-sizing: border-box;
  width: max-content;
  max-width: 100%;
  min-width: 0;
  margin: 0.15rem 0 0;
  pointer-events: none;
}

.forecast-radar-stage .map-stamp-chip:has(> :not([hidden])) {
  display: flex;
}

.forecast-radar-stage:has(> .forecast-view-summary:not([hidden])) .map-stamp-chip {
  margin-top: 1.9rem;
}

.forecast-radar-stage .map-stamp-chip .map-radar-stamp {
  margin: 0;
}

/* Lightning's pill, the same on the tile and the maps page. */
.map-lightning-nearest:not([hidden]) {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  background: rgb(var(--overlay-rgb) / 72%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
}

/* Maps page: the pill hangs on the map just under the search panel, so it
   follows the panel's height (a match list, an error) and never covers it. */
.forecast-map-panel .map-lightning-hang {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  width: max-content;
  max-width: 100%;
  pointer-events: none;
}

.map-photo-filters {
  display: contents;
}

.map-photo-filters[hidden],
.map-photo-filters-sheet[hidden],
.map-photo-filters-count[hidden],
.forecast-map-page:has(.map-photo-scrim) .map-photo-filters,
.forecast-map-page:has(.map-photo-scrim) .map-photo-filters-toggle,
.forecast-radar-stage:has(.map-photo-scrim) .map-photo-filters,
.forecast-radar-stage:has(.map-photo-scrim) .map-photo-filters-toggle {
  display: none;
}

.map-photo-filters-toggle {
  position: relative;
}

.map-photo-filters-count {
  position: absolute;
  top: 0.12rem;
  right: 0.12rem;
  min-width: 0.9rem;
  height: 0.9rem;
  padding: 0 0.2rem;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--color-on-accent);
  color: var(--color-accent);
  font-size: 0.625rem;
  line-height: 0.9rem;
  text-align: center;
}

.map-photo-filters-sheet {
  grid-row: 1;
  grid-column: 1 / -1;
  z-index: 1;
  align-self: end;
  justify-self: start;
  box-sizing: border-box;
  width: min(100%, 34rem);
  max-height: 100%;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: 0 8px 24px rgb(var(--overlay-rgb) / 18%);
  pointer-events: auto;
}

/* The sheet sits on the filter icon. Its bottom and left edges are set in
   photos.js. The box is only as tall as its contents, and only as wide as
   those contents need, up to the room beside the icon. */
.forecast-map-page:has(.map-photo-filters-sheet:not([hidden])) .map-dock,
.forecast-radar-tile:has(.map-photo-filters-sheet:not([hidden])) .map-dock {
  z-index: 6;
}

.forecast-map-page .map-photo-filters-sheet {
  position: fixed;
  z-index: 4;
  top: auto;
  right: auto;
  grid-row: auto;
  grid-column: auto;
  align-self: auto;
  justify-self: auto;
  width: max-content;
  max-width: min(36rem, calc(100vw - 1rem));
  height: auto;
  max-height: none;
  margin: 0;
  overflow: auto;
}

.forecast-radar-stage .map-photo-filters-sheet {
  position: absolute;
  z-index: 4;
  top: auto;
  right: auto;
  grid-row: auto;
  grid-column: auto;
  align-self: auto;
  justify-self: auto;
  width: max-content;
  max-width: min(22rem, calc(100% - 1rem));
  height: fit-content;
  max-height: none;
  margin: 0;
  padding: 0.55rem;
  overflow: auto;
}

.forecast-radar-stage .map-photo-filters-sheet .map-radar-filters:not([hidden]) {
  margin-bottom: 0;
}

/* "Show with radar", then "Play radar into". */
.forecast-radar-stage .map-photo-filters-sheet .map-radar-filters:not([hidden]) ~ .map-radar-filters:not([hidden]) {
  margin-top: 0.75rem;
}

.forecast-map-page:has([data-forecast-map-layer="photos"][aria-pressed="true"]) .map-photo-filters-sheet {
  width: min(36rem, calc(100vw - 1rem));
}

/* Each study's section in the sheet: the forecast kinds, Play, the tile's radar overlays. */
/* No wrap: a wrapping column makes the sheet sized to fit grow much
   larger than its choices and leaves them stuck at the top. */
.map-photo-filters-sheet .map-radar-filters:not([hidden]) {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.map-radar-filters {
  flex-direction: column;
  align-items: stretch;
}

.map-radar-filters > .kicker {
  margin: 0 0 0.45rem;
}

.forecast-map-page:not(:has([data-forecast-map-layer="photos"][aria-pressed="true"])) .map-photo-filters-photos {
  display: none;
}

.map-photo-filters-photos > .kicker {
  margin: 0 0 0.45rem;
}

.map-photo-filters-quick,
.map-photo-filters-grid {
  display: grid;
  gap: 0.4rem;
}

.map-photo-filters-quick {
  grid-template-columns: 1fr 1fr;
  margin-bottom: 0.4rem;
}

/* Short choice rows (Forecast kinds, Play radar's Past and Future). The
   tile sizes its own sheet above, with pills sized to their label. */
.map-radar-filters .map-radar-filters-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0;
}

/* The stretch the pressed forecast days cover, under Day 1, Day 2, and
   Day 3: "Now through tonight". */
.map-forecast-window {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--color-muted);
}

/* On the map page they match the photo choices under them: the same
   button size, one equal column per choice, each at least as wide as a
   scene button. */
.forecast-map-page .map-photo-filters-sheet .map-radar-filters .map-radar-filters-quick {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: none;
  grid-auto-columns: minmax(6.5rem, 1fr);
  gap: 0.4rem;
}

.map-photo-filters-grid {
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
}

.map-photo-filters-grid .button {
  justify-content: flex-start;
  gap: 0.4rem;
  text-align: left;
}

.map-photo-filters-grid .map-photo-filters-all {
  justify-content: center;
}

.map-photo-filters-grid .tag-icon {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
}

/* Photo card */

.map-photo-scrim {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgb(var(--overlay-rgb) / 35%);
  pointer-events: auto;
  container-type: size;
}

.map-photo-card {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: min(50%, calc(100% - 1rem));
  max-height: min(86cqh, calc(100% - 1rem));
  overflow: hidden;
  padding: 0;
  border-radius: 0.75rem;
  background: rgb(var(--overlay-rgb));
  box-shadow: 0 8px 24px rgb(var(--overlay-rgb) / 28%);
  transform: translate(-50%, -50%);
}

.map-photo-dismiss {
  position: absolute;
  z-index: 2;
  top: 0.35rem;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--glass);
  color: var(--glass-ink);
  cursor: pointer;
}

/* The circle stays small over the photo. The tap area is 44px. */
.map-photo-dismiss::before {
  content: "";
  position: absolute;
  inset: -0.5rem;
}

.map-photo-dismiss svg {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}

.map-photo-frame {
  position: relative;
}

.map-photo-frame img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86cqh;
  object-fit: contain;
  object-position: center;
  background: rgb(var(--overlay-rgb));
}

.map-photo-nav {
  position: absolute;
  z-index: 1;
  top: 0;
  width: 33.333%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--glass-ink);
  cursor: pointer;
}

.map-photo-nav:focus-visible {
  outline: none;
}

.map-photo-nav-glyph {
  position: absolute;
  top: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--glass);
  color: var(--glass-ink);
  transform: translateY(-50%);
  pointer-events: none;
}

.map-photo-nav-glyph svg {
  display: block;
  width: 0.95rem;
  height: 0.95rem;
}

.map-photo-nav:focus-visible .map-photo-nav-glyph {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.map-photo-prev {
  left: 0;
}

.map-photo-next {
  right: 0;
}

.map-photo-prev .map-photo-nav-glyph {
  left: 0.35rem;
}

.map-photo-next .map-photo-nav-glyph {
  right: 0.35rem;
}

.map-photo-overlay {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 2.75rem 0.65rem 0.65rem;
  background: linear-gradient(to top, rgb(var(--overlay-rgb) / 88%) 35%, rgb(var(--overlay-rgb) / 0%));
  pointer-events: none;
}

.map-photo-overlay > * {
  pointer-events: auto;
}

.map-photo-label,
.map-photo-caption,
.map-photo-author {
  margin: 0;
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
}

.map-photo-caption {
  max-height: 2.6em;
  overflow: auto;
  overscroll-behavior: contain;
  color: rgb(255 255 255 / 82%);
}

.map-photo-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.map-photo-overlay .picture-marks,
.map-photo-overlay .picture-reactions {
  justify-content: center;
}

.map-photo-overlay .picture-marks {
  margin-top: 0;
}

.map-photo-card .picture-mark {
  width: 2rem;
  padding: 0;
}

.map-photo-card .picture-mark,
.map-photo-card .picture-mark.is-pressed,
.map-photo-card .picture-mark[aria-pressed="true"],
.map-photo-visit {
  border-color: rgb(var(--overlay-rgb) / 18%);
  background: var(--glass);
  color: var(--glass-ink);
}

.map-photo-card .picture-mark.is-pressed,
.map-photo-card .picture-mark[aria-pressed="true"] {
  border-color: var(--glass-ink);
  background: var(--glass-strong);
}

.map-photo-overlay .picture-flag {
  margin-left: 0.15rem;
}

.map-photo-visit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgb(var(--overlay-rgb) / 18%);
  border-radius: 0.4rem;
  text-decoration: none;
}

.map-photo-visit svg {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
}

.map-photo-card .picture-mark-note {
  position: absolute;
  z-index: 3;
  top: 2.5rem;
  right: 0.65rem;
  left: 0.65rem;
  margin: 0;
}

/* A finger needs about 44px. Play, zoom, and the layer buttons share that
   height. A mouse keeps the compact controls. The narrow card below owns
   its own size, so this does not stretch a phone row. */
@media (pointer: coarse) {
  :is(.forecast-map-page, .forecast-radar-stage) {
    --map-control-size: calc(2.7rem + 2px);
  }

  .map-zoom-button {
    min-width: var(--map-control-size, 2.75rem);
    min-height: var(--map-control-size, 2.75rem);
  }

  .forecast-map-layers .button,
  .forecast-radar-layers .button,
  .map-foot .button,
  .map-photo-filters .button {
    min-height: var(--map-control-size, 2.75rem);
  }

  /* Sheet labels stay compact on a phone; the icon squares keep 44px. */
  .forecast-radar-stage .map-photo-filters-sheet .button {
    min-height: 1.5rem;
    height: 1.5rem;
  }

  .map-photo-card .picture-mark,
  .map-photo-visit {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
  }

  .map-photo-actions,
  .map-photo-overlay .picture-marks,
  .map-photo-overlay .picture-reactions {
    gap: 0.15rem;
  }
}

/* A phone-width map makes a half-width card too small: the caption covers
   the picture and the reactions wrap. This comes after the coarse-pointer
   sizes so a phone keeps one row. A wide touch screen stays at 44px. */
@container (max-width: 40rem) {
  .map-photo-card {
    width: calc(100% - 0.75rem);
    max-height: min(78cqh, calc(100% - 0.75rem));
  }

  .map-photo-frame img {
    max-height: 78cqh;
  }

  .forecast-radar-stage .map-photo-card {
    width: calc(100% - 0.35rem);
    max-height: calc(100% - 0.35rem);
  }

  .forecast-radar-stage .map-photo-frame img {
    max-height: calc(100cqh - 0.35rem);
  }

  .map-photo-overlay {
    gap: 0.15rem;
    padding: 0.7rem 0.35rem 0.3rem;
    background: linear-gradient(to top, rgb(var(--overlay-rgb) / 90%) 12%, rgb(var(--overlay-rgb) / 0%));
  }

  .map-photo-label,
  .map-photo-caption,
  .map-photo-author {
    font-size: 0.75rem;
    line-height: 1.15;
  }

  .map-photo-caption {
    max-height: 2.3em;
  }

  .map-photo-actions,
  .map-photo-overlay .picture-marks,
  .map-photo-overlay .picture-reactions {
    flex-wrap: nowrap;
    gap: 0.15rem;
  }

  .map-photo-card .picture-mark {
    width: 2rem;
    min-width: 2rem;
    height: 1.65rem;
    padding: 0;
  }

  .map-photo-card .picture-mark-face,
  .map-photo-visit {
    width: 1.65rem;
    min-width: 1.65rem;
    height: 1.65rem;
    padding: 0;
  }

  .map-photo-card .picture-mark-outline,
  .map-photo-visit svg {
    width: 1rem;
    height: 1rem;
  }

  /* The chosen emoji sizes by its font, not a box. A 1rem box is narrower
     than the glyph, which then spills right and sits off center. The map
     card has no count, so the face is the whole button. */
  .map-photo-card .picture-mark-emoji {
    font-size: 0.95rem;
    text-align: center;
  }
}

/* The national outlook map, and the fixed map beside the photos carousel.
   The national credit sits under its map, so it never covers the weather. */
.national-map,
.trending-map {
  margin-top: 1rem;
}

.national-map-stage,
.trending-map {
  position: relative;
  overflow: hidden;
  border-radius: 0.75rem;
  background: var(--map-ocean);
}

.national-map-stage {
  height: 28rem;
}

@media (max-width: 40rem) {
  .national-map-stage {
    height: 14rem;
    border-radius: 0;
  }

  .national-map .forecast-map-state-label {
    font-size: calc(var(--state-label-size, 13px) * 0.58);
    font-weight: 200;
    letter-spacing: 0.01em;
  }

  .national-map .forecast-map-state-label span {
    text-shadow: 0 0 2px var(--map-name-halo, var(--map-land));
  }
}

.national-map-canvas,
.national-map .leaflet-container,
.trending-map-canvas,
.trending-map .leaflet-container {
  position: absolute;
  inset: 0;
  background: var(--map-ocean);
  font-family: inherit;
}

.national-map .map-zoom {
  position: absolute;
  z-index: 3;
  right: 0.6rem;
  bottom: 0.6rem;
}

/* The root map is short. The finger-sized zoom used on the full map covers it. */
.national-map .map-zoom-button {
  width: 30px;
  height: 30px;
}

.national-map-credit {
  margin: 0.45rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--color-muted);
}

@media (max-width: 40rem) {
  .national-map-credit {
    margin-inline: var(--page-gutter);
  }
}
