/**
 * Injected late into Folium iframes from /maps (inline <style> + link).
 * Must beat baked rules like body.temp-map-ui #temp-legend { bottom: 88px }.
 * Bump map-controls WXMAP_MOBILE_EMBED_V when this file changes.
 *
 * Legend / control chrome uses elevated dark surfaces (shared design tokens).
 * Basemap tiles may remain light.
 *
 * v8: shell is column-flex so Hide stacks above the scale; expanded legends
 *     force position:relative (beats baked #id { position:fixed }) — fixes
 *     Hide overlapping rainfall ticks after #512.
 * v10: storm /maps — badge above Legend chip (layout, not z-only) so desktop
 *     and phone closed-state taps hit the chip; matches standalone #600 stack.
 * v11: storm iframe — Layers ≥8px from bottom (border-radius clip); hide
 *     standalone bottom-nav inside embeds (parent page owns footer chrome).
 * v13: day-map Legend chip vs @WxMatt2 (same stack as storm); zoom clears
 *     left Top Reports / Live Leaderboard strip on narrow phones.
 * v14: credit z-index below Legend chip (no tap steal); open legend hides credit.
 * v15: stack @WxMatt2 ABOVE Legend chip at left edge (not right of chip).
 * v16: credit lifts above left-docked Layers when near the chip (#737).
 * v17: snow-live Layers collapse + Also-on-map chip; bottom chrome flush.
 * v24: cache bump with snow phone zoom/Also/#748 label anchor fixes.
 */
html.wxmap-embedded,
html.wxmap-embedded body {
  padding: 0 !important;
  margin: 0 !important;
  height: 100% !important;
  width: 100% !important;
  overflow: hidden !important;
}
html.wxmap-embedded .folium-map,
html.wxmap-embedded .leaflet-container {
  height: 100% !important;
  width: 100% !important;
}

/* Elevated dark legend / layers chrome (token hex; theme not loaded in iframe) */
/* Folium body titles sit under parent #mapStatusStrip — type/date live in Controls + strip. */
html.wxmap-embedded > body > h3,
html.wxmap-embedded body > h3[align],
html.wxmap-embedded body > h3[align="center"] {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/*
 * Storm-style collapsible legend shell (Hide / Legend chip).
 * Shared with wxmap-legend-collapse.js — site-wide on-map legends.
 * Chip stacks ABOVE the scale (column flex) — never over the gradient/ticks.
 */
html.wxmap-embedded .wxmap-legend-shell,
.wxmap-legend-shell {
  position: fixed !important;
  /* Above snow GH#285 @WxMatt2 badge (baked z-index 100000) so Legend taps hit the chip. */
  z-index: 100110 !important;
  max-width: min(280px, calc(100vw - 16px)) !important;
  pointer-events: none !important;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  bottom: var(--wxmap-map-bottom-clearance, var(--wxmap-pwa-nav-clearance, calc(72px + env(safe-area-inset-bottom, 0px)))) !important;
  left: 12px !important;
  right: auto !important;
  top: auto !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 8px !important;
}
/* Beat corner-bottom-right on phones so Legend never sits under Layers */
@media (max-width: 768px) {
  html body #storm-legend-shell.wxmap-legend-corner-bottom-right,
  html body #storm-legend-shell.wxmap-legend-corner-top-right,
  html body .wxmap-legend-shell.wxmap-legend-corner-bottom-right,
  html body .wxmap-legend-shell.wxmap-legend-corner-top-right {
    left: 8px !important;
    right: auto !important;
    bottom: calc(
      var(--wxmap-map-bottom-clearance, calc(96px + env(safe-area-inset-bottom, 0px)))
      + var(--wxmap-storm-info-stack, 0px)
    ) !important;
    top: auto !important;
  }
  html body #mapLegendFloat.map-legend-float,
  html body .map-legend-float {
    top: auto !important;
    bottom: calc(
      var(--wxmap-map-bottom-clearance, calc(96px + env(safe-area-inset-bottom, 0px)))
      + var(--wxmap-storm-info-stack, 48px)
      + 12px
    ) !important;
    right: calc(3px + env(safe-area-inset-right, 0px)) !important;
    left: auto !important;
  }
}
html.wxmap-embedded .wxmap-legend-shell > *,
.wxmap-legend-shell > * {
  pointer-events: auto !important;
}
.wxmap-legend-shell.wxmap-legend-corner-bottom-left {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  bottom: var(--wxmap-map-bottom-clearance, var(--wxmap-pwa-nav-clearance, calc(72px + env(safe-area-inset-bottom, 0px)))) !important;
  left: 12px !important;
  right: auto !important;
  top: auto !important;
}

/*
 * Storm maps in /maps: match standalone #600 stack — chip flush low, @WxMatt2
 * ABOVE it. Do not only raise z-index (chip would paint over the badge).
 * Beats wxmapForceMobileLegendLayout's catalog bottom:4 on the badge.
 */
html.wxmap-embedded.wxmap-storm-map #storm-legend-shell.is-collapsed,
html.wxmap-embedded.wxmap-storm-map .wxmap-legend-shell.is-collapsed,
html.wxmap-embedded.wxmap-storm-map #storm-legend-shell.wxmap-legend-corner-bottom-left.is-collapsed {
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  left: 8px !important;
  /* Keep shell below badge in paint order; layout clears the overlap. */
  z-index: 100110 !important;
}
html.wxmap-embedded.wxmap-storm-map #storm-legend-shell:not(.is-collapsed),
html.wxmap-embedded.wxmap-storm-map .wxmap-legend-shell:not(.is-collapsed) {
  /* Open: stay above badge so Hide/scale remain tappable (JS may refine). */
  z-index: 100130 !important;
}
/* Storm Layers: never flush to y=0 — iframe border-radius clips "Layers" text. */
html.wxmap-embedded.wxmap-storm-map #mapLegendFloat,
html.wxmap-embedded.wxmap-storm-map .map-legend-float,
html.wxmap-embedded.wxmap-storm-map body.reports-on-left #mapLegendFloat {
  bottom: max(12px, env(safe-area-inset-bottom, 0px)) !important;
  right: 0 !important;
  left: auto !important;
  top: auto !important;
}
html.wxmap-embedded #wxmap-storm-bottom-nav {
  display: none !important;
}
html.wxmap-embedded.wxmap-storm-map #wx-attribution-link.wx-attribution,
html.wxmap-embedded.wxmap-storm-map a.wx-attribution {
  left: 8px !important;
  bottom: max(48px, calc(44px + env(safe-area-inset-bottom, 0px))) !important;
  /* Below legend shell 100110 / chip 100120 — never steal Legend taps. */
  z-index: 100100 !important;
  font-size: 12px !important;
  padding: 4px 8px !important;
  max-width: calc(100vw - 24px) !important;
}

.wxmap-legend-chip {
  display: inline-flex !important;
  align-items: center !important;
  align-self: flex-start !important;
  flex: 0 0 auto !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 7px 12px !important;
  border-radius: 999px !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  background: rgba(18, 22, 28, 0.94) !important;
  color: #e8eef2 !important;
  font: 600 12px/1.2 system-ui, -apple-system, Segoe UI, sans-serif !important;
  letter-spacing: 0.02em !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  touch-action: manipulation !important;
  z-index: 100120 !important;
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  transform: none !important;
}
.wxmap-legend-chip-dot {
  width: 8px !important;
  height: 8px !important;
  border-radius: 50% !important;
  background: #ff8a3d !important;
  box-shadow: 0 0 0 2px rgba(255, 138, 61, 0.25) !important;
  flex-shrink: 0 !important;
}
html body .wxmap-legend-shell.is-collapsed > [id$="-legend"],
html body .wxmap-legend-shell.is-collapsed > [id$="-legend-onmap"],
html body .wxmap-legend-shell.is-collapsed > #legend,
html body .wxmap-legend-shell.is-collapsed > .legend,
/* ID selectors needed to beat baked #rain-legend-onmap { display:block !important } */
html body .wxmap-legend-shell.is-collapsed #storm-legend,
html body .wxmap-legend-shell.is-collapsed #rain-legend,
html body .wxmap-legend-shell.is-collapsed #rain-legend-onmap,
html body .wxmap-legend-shell.is-collapsed #snow-legend,
html body .wxmap-legend-shell.is-collapsed #snow-legend-onmap,
html body .wxmap-legend-shell.is-collapsed #temp-legend,
html body .wxmap-legend-shell.is-collapsed #wind-legend,
html body .wxmap-legend-shell.is-collapsed #wind-chill-legend,
html body .wxmap-legend-shell.is-collapsed #heat-index-legend,
html body .wxmap-legend-shell.is-collapsed #hail-legend {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
}
/* Expanded: beat baked #id { position:fixed !important } so scale flows under chip */
html body .wxmap-legend-shell:not(.is-collapsed) > [id$="-legend"],
html body .wxmap-legend-shell:not(.is-collapsed) > [id$="-legend-onmap"],
html body .wxmap-legend-shell:not(.is-collapsed) > #legend,
html body .wxmap-legend-shell:not(.is-collapsed) > .legend,
html body .wxmap-legend-shell:not(.is-collapsed) #storm-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #rain-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #rain-legend-onmap,
html body .wxmap-legend-shell:not(.is-collapsed) #snow-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #snow-legend-onmap,
html body .wxmap-legend-shell:not(.is-collapsed) #temp-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #wind-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #wind-chill-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #heat-index-legend,
html body .wxmap-legend-shell:not(.is-collapsed) #hail-legend {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  float: none !important;
  width: min(260px, calc(100vw - 24px)) !important;
  min-width: 0 !important;
  max-width: min(260px, calc(100vw - 24px)) !important;
  max-height: min(52vh, 280px) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box !important;
  background: rgba(18, 22, 28, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 10px !important;
  padding: 6px 8px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  color: #e8eef2 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45) !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  z-index: auto !important;
  margin: 0 !important;
  flex: 0 1 auto !important;
  align-self: stretch !important;
}
@media (max-width: 900px) {
  .wxmap-legend-shell {
    max-width: min(240px, calc(100vw - 16px)) !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    bottom: var(--wxmap-map-bottom-clearance, var(--wxmap-pwa-nav-clearance, calc(64px + env(safe-area-inset-bottom, 0px)))) !important;
    left: 8px !important;
  }
  html body .wxmap-legend-shell:not(.is-collapsed) > [id$="-legend"],
  html body .wxmap-legend-shell:not(.is-collapsed) > [id$="-legend-onmap"],
  html body .wxmap-legend-shell:not(.is-collapsed) > #legend,
  html body .wxmap-legend-shell:not(.is-collapsed) > .legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #storm-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #rain-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #rain-legend-onmap,
  html body .wxmap-legend-shell:not(.is-collapsed) #snow-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #snow-legend-onmap,
  html body .wxmap-legend-shell:not(.is-collapsed) #temp-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #wind-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #wind-chill-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #heat-index-legend,
  html body .wxmap-legend-shell:not(.is-collapsed) #hail-legend {
    width: min(220px, calc(100vw - 20px)) !important;
    max-width: min(220px, calc(100vw - 20px)) !important;
    max-height: min(52vh, 260px) !important;
    padding: 5px 7px !important;
    font-size: 9px !important;
  }
}

html.wxmap-embedded .legend,
html.wxmap-embedded .legend.temp-legend,
html.wxmap-embedded .folium-legend,
html.wxmap-embedded div[id$="-legend"],
html.wxmap-embedded #temp-legend,
html.wxmap-embedded #wind-legend,
html.wxmap-embedded #rain-legend,
html.wxmap-embedded #rain-legend-onmap,
html.wxmap-embedded #snow-legend,
html.wxmap-embedded #snow-legend-onmap {
  background: #111916 !important;
  color: #f0f3f1 !important;
  border: 1px solid #2a4034 !important;
  border-radius: 10px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
html.wxmap-embedded .legend .caption,
html.wxmap-embedded .legend text,
html.wxmap-embedded #temp-legend .caption,
html.wxmap-embedded #temp-legend text {
  fill: #b8c4bc !important;
  color: #b8c4bc !important;
}
html.wxmap-embedded .leaflet-control-layers {
  background: #111916 !important;
  color: #f0f3f1 !important;
  border: 1px solid #2a4034 !important;
  border-radius: 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}
html.wxmap-embedded .leaflet-control-layers-expanded {
  background: #111916 !important;
  color: #f0f3f1 !important;
}
html.wxmap-embedded .leaflet-control-layers label {
  color: #f0f3f1 !important;
}
html.wxmap-embedded .leaflet-bar a {
  background: #111916 !important;
  color: #f0f3f1 !important;
  border-bottom-color: #2a4034 !important;
}
html.wxmap-embedded .leaflet-bar a:hover {
  background: #152019 !important;
}

@media only screen and (max-width: 768px) {
  .leaflet-control { font-size: inherit !important; }
  .legend,
  .legend.temp-legend,
  .folium-legend,
  div[id$="-legend"] {
    font-size: 10px !important;
    line-height: 1.2 !important;
  }

  .leaflet-popup { max-width: min(180px, 68vw) !important; }
  .leaflet-popup-content-wrapper {
    font-size: 12px !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
  }
  .leaflet-popup-content,
  .leaflet-popup-content *,
  .leaflet-popup-content div,
  .leaflet-popup-content span,
  .leaflet-popup-content b,
  .leaflet-popup-content strong {
    font-size: 12px !important;
    line-height: 1.25 !important;
  }
  .leaflet-popup-content b,
  .leaflet-popup-content strong { font-size: 13px !important; }
  /* Hover tooltips only on embedded /maps — do not hide /snow value labels. */
  html.wxmap-embedded .leaflet-tooltip { display: none !important; }

  /* Compact on-map temp/wind fallback (before Hide-shell wrap). Shell rules win after. */
  html.wxmap-embedded body #temp-legend,
  html.wxmap-embedded body.temp-map-ui #temp-legend,
  html.wxmap-embedded body #wind-legend,
  html.wxmap-embedded body .legend.temp-legend,
  html.wxmap-embedded body .legend[data-keep-on-map="true"] {
    position: fixed !important;
    left: 8px !important;
    right: auto !important;
    top: auto !important;
    bottom: 28px !important;
    max-width: min(132px, 42vw) !important;
    width: auto !important;
    padding: 4px 6px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    z-index: 1100 !important;
    box-sizing: border-box !important;
    transform: none !important;
  }
  html.wxmap-embedded body .wxmap-legend-shell #temp-legend,
  html.wxmap-embedded body .wxmap-legend-shell #wind-legend,
  html.wxmap-embedded body .wxmap-legend-shell .legend,
  html.wxmap-embedded body .wxmap-legend-shell [id$="-legend"],
  html.wxmap-embedded body .wxmap-legend-shell [id$="-legend-onmap"] {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    max-width: min(220px, calc(100vw - 20px)) !important;
    width: min(220px, calc(100vw - 20px)) !important;
    z-index: auto !important;
  }
  html.wxmap-embedded body #temp-legend .temp-gradient-bar,
  html.wxmap-embedded body #temp-legend .caption,
  html.wxmap-embedded body #temp-legend text {
    font-size: 9px !important;
  }
  html.wxmap-embedded body #temp-legend::after {
    font-size: 8px !important;
    margin-top: 2px !important;
  }


  /* Top Reports: parent Top Weather covers the list — hide the iframe tab.
     Live Leaderboard stays visible; wxmap-left-edge-tabs stacks it vs Layers. */
  html.wxmap-embedded #mapTopReportsFloat,
  html.wxmap-embedded .map-topreports-float {
    display: none !important;
  }
  html.wxmap-embedded #mapLiveLeaderboardFloat,
  html.wxmap-embedded .map-liveleaderboard-float,
  html.wxmap-embedded body.temp-map-ui #mapLiveLeaderboardFloat {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }


  html.wxmap-embedded #wx-attribution-link.wx-attribution,
  html.wxmap-embedded a.wx-attribution {
    left: 8px !important;
    bottom: 4px !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    z-index: 1100 !important;
  }
  /* Day + storm /maps: stack @WxMatt2 ABOVE Legend chip at left edge
     (not bottom:4 under it, not parked to the right of the chip).
     z-index below shell/chip so credit cannot steal Legend taps.
     JS hides credit only when an open/crowded legend would still collide. */
  html.wxmap-embedded:has(.wxmap-legend-shell) #wx-attribution-link.wx-attribution,
  html.wxmap-embedded:has(.wxmap-legend-shell) a.wx-attribution,
  html.wxmap-embedded.wxmap-storm-map #wx-attribution-link.wx-attribution,
  html.wxmap-embedded.wxmap-storm-map a.wx-attribution {
    left: max(8px, calc(8px + env(safe-area-inset-left, 0px))) !important;
    right: auto !important;
    bottom: calc(
      var(--wxmap-map-bottom-clearance, calc(72px + env(safe-area-inset-bottom, 0px)))
      + 52px
    ) !important;
    z-index: 100100 !important;
    font-size: 10px !important;
    padding: 2px 6px !important;
    max-width: min(160px, calc(100vw - 24px - env(safe-area-inset-right, 0px))) !important;
  }

  /* Scope to embedded /maps iframe only — do not pin zoom/attribution on /snow. */
  html.wxmap-embedded .leaflet-control-zoom,
  html.wxmap-embedded body .leaflet-control-zoom {
    position: fixed !important;
    /* Clear parent #mapStatusStrip (+ gap). Beats baked top:60px/right:5px. */
    top: calc(var(--wxmap-map-chrome-top, 56px) + 8px) !important;
    left: max(8px, env(safe-area-inset-left, 0px)) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 1200 !important;
  }
  /* Live Leaderboard (and standalone Top Reports) own the left strip — nudge zoom. */
  html.wxmap-embedded:has(#mapLiveLeaderboardFloat) .leaflet-control-zoom,
  html.wxmap-embedded body.reports-on-left .leaflet-control-zoom {
    left: calc(52px + env(safe-area-inset-left, 0px)) !important;
  }
  html.wxmap-embedded .leaflet-control-zoom a {
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    font-size: 16px !important;
  }

  /* Non-snow /maps embeds: keep main attribution chrome (narrow, bottom-right). */
  html.wxmap-embedded .leaflet-bottom.leaflet-right {
    right: max(8px, env(safe-area-inset-right, 0px)) !important;
    bottom: calc(
      var(--wxmap-map-bottom-clearance, calc(72px + env(safe-area-inset-bottom, 0px)))
    ) !important;
    max-width: 34vw !important;
  }
  html.wxmap-embedded .leaflet-control-attribution {
    font-size: 8px !important;
    padding: 1px 4px !important;
    max-width: 34vw !important;
    background: rgba(17, 25, 22, 0.88) !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /*
    Matt #748 — SNOW PHONE ONLY (body.snow-map-ui / .wxmap-snow-live)
    AND max-width:700px. Legend|Layers pill row; Leaflet credit below;
    light text on dark bar. Does not apply to storm/rain/wind/temp/hail
    or desktop (including wide tablets).
  */
  @media (max-width: 700px) {
    html.wxmap-embedded body.snow-map-ui,
    html.wxmap-embedded body.wxmap-snow-live {
      --wxmap-pwa-clear: var(
        --wxmap-map-bottom-clearance,
        calc(72px + env(safe-area-inset-bottom, 0px))
      );
      --wxmap-attr-slot: 30px;
      --wxmap-pill-bottom: calc(var(--wxmap-pwa-clear) + var(--wxmap-attr-slot) + 6px);
      --wxmap-attr-bottom: calc(var(--wxmap-pwa-clear) + 2px);
      --wxmap-pill-height: 34px;
    }
    html.wxmap-embedded body.snow-map-ui .wxmap-legend-shell,
    html.wxmap-embedded body.snow-map-ui .wxmap-legend-shell.wxmap-legend-corner-bottom-left,
    html.wxmap-embedded body.wxmap-snow-live .wxmap-legend-shell,
    html.wxmap-embedded body.wxmap-snow-live .wxmap-legend-shell.wxmap-legend-corner-bottom-left {
      bottom: var(--wxmap-pill-bottom) !important;
      left: max(8px, env(safe-area-inset-left, 0px)) !important;
      right: auto !important;
      top: auto !important;
      flex-direction: column-reverse !important;
    }
    html.wxmap-embedded body.snow-map-ui .wxmap-legend-chip,
    html.wxmap-embedded body.wxmap-snow-live .wxmap-legend-chip {
      height: var(--wxmap-pill-height) !important;
      box-sizing: border-box !important;
      padding: 0 12px !important;
    }
    html.wxmap-embedded body.snow-map-ui #mapLegendFloat.map-legend-float,
    html.wxmap-embedded body.snow-map-ui .map-legend-float#mapLegendFloat,
    html.wxmap-embedded body.snow-map-ui.wxmap-layers-dock-left #mapLegendFloat.map-legend-float {
      left: auto !important;
      right: max(8px, env(safe-area-inset-right, 0px)) !important;
      top: auto !important;
      bottom: var(--wxmap-pill-bottom) !important;
      writing-mode: horizontal-tb !important;
      text-orientation: mixed !important;
      transform: none !important;
      border-radius: 999px !important;
      height: var(--wxmap-pill-height) !important;
      min-height: var(--wxmap-pill-height) !important;
      min-width: 0 !important;
      padding: 0 12px !important;
      box-sizing: border-box !important;
      font: 600 12px/1.2 system-ui, -apple-system, sans-serif !important;
      background: rgba(8, 16, 14, 0.92) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      z-index: 100120 !important;
    }
    html.wxmap-embedded body.snow-map-ui .map-legend-panel,
    html.wxmap-embedded body.snow-map-ui.wxmap-layers-dock-left .map-legend-panel,
    html.wxmap-embedded body.snow-map-ui.wxmap-layers-dock-left.wxmap-layers-tab-right .map-legend-panel,
    html.wxmap-embedded body.snow-map-ui.wxmap-snow-pill-row .map-legend-panel {
      left: auto !important;
      right: -110% !important;
      top: auto !important;
      bottom: calc(var(--wxmap-pill-bottom) + var(--wxmap-pill-height) + 8px) !important;
      width: min(260px, calc(100vw - 20px)) !important;
      max-height: min(36vh, 220px) !important;
      height: auto !important;
      overflow: auto !important;
      -webkit-overflow-scrolling: touch !important;
      transform: none !important;
      border-radius: 10px !important;
    }
    html.wxmap-embedded body.snow-map-ui .map-legend-panel.open,
    html.wxmap-embedded body.snow-map-ui.wxmap-layers-dock-left .map-legend-panel.open,
    html.wxmap-embedded body.snow-map-ui.wxmap-layers-dock-left.wxmap-layers-tab-right .map-legend-panel.open,
    html.wxmap-embedded body.snow-map-ui.wxmap-snow-pill-row .map-legend-panel.open {
      left: auto !important;
      right: max(8px, env(safe-area-inset-right, 0px)) !important;
      display: flex !important;
      flex-direction: column !important;
    }
    html.wxmap-embedded body.snow-map-ui .map-legend-panel .panel-content,
    html.wxmap-embedded body.snow-map-ui .map-legend-panel #mapLegendPanelContent,
    html.wxmap-embedded body.snow-map-ui.wxmap-snow-pill-row .map-legend-panel .panel-content,
    html.wxmap-embedded body.snow-map-ui.wxmap-snow-pill-row .map-legend-panel #mapLegendPanelContent {
      flex: 1 1 auto !important;
      min-height: 0 !important;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
    }
    /* Met #748 M1: position credit via .leaflet-bottom only (match /snow). */
    html.wxmap-embedded body.snow-map-ui .leaflet-bottom.leaflet-right,
    html.wxmap-embedded body.snow-map-ui .leaflet-bottom.leaflet-left,
    html.wxmap-embedded body.wxmap-snow-live .leaflet-bottom.leaflet-right,
    html.wxmap-embedded body.wxmap-snow-live .leaflet-bottom.leaflet-left {
      position: fixed !important;
      left: max(8px, env(safe-area-inset-left, 0px)) !important;
      right: max(8px, env(safe-area-inset-right, 0px)) !important;
      bottom: var(--wxmap-attr-bottom) !important;
      max-width: none !important;
      width: auto !important;
      pointer-events: none;
      z-index: 10020 !important;
    }
    html.wxmap-embedded body.snow-map-ui .leaflet-control-attribution,
    html.wxmap-embedded body.wxmap-snow-live .leaflet-control-attribution {
      bottom: auto !important;
      left: auto !important;
      right: auto !important;
      font-size: 9px !important;
      padding: 3px 8px !important;
      max-width: min(92vw, 340px) !important;
      margin: 0 auto !important;
      background: rgba(17, 25, 22, 0.92) !important;
      color: #e5e7eb !important;
      white-space: normal !important;
      overflow: visible !important;
      text-overflow: unset !important;
      line-height: 1.25 !important;
      text-align: center !important;
      pointer-events: auto;
    }
    html.wxmap-embedded body.snow-map-ui .leaflet-control-attribution a,
    html.wxmap-embedded body.wxmap-snow-live .leaflet-control-attribution a {
      color: #93c5fd !important;
    }
  }
}
