.map_legend_card { box-sizing: border-box; margin: 10px 0 0; padding: 12px 14px; border: 1px solid #d8e1e8; border-radius: 6px; background: #f7fafc; color: #203d51; font-family: inherit; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.map_legend_card p { margin: 4px 0; }
.map_legend_title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.map_legend_note { font-size: 12px; color: #526273; }
.map_legend_card details { margin-top: 5px; }
.map_legend_card summary { min-height: 44px; align-content: center; cursor: pointer; }
.map_legend_card summary:focus-visible { outline: 3px solid #1769aa; outline-offset: 2px; }
.map_symbol { display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; line-height: 1; box-sizing: border-box; font-family: sans-serif; font-size: 10px; font-weight: 700; color: white; border: 1.5px solid white; box-shadow: 0 0 0 1px #203d5126; }
.map_symbol_emergency_shelters, .map_symbol_designated_shelters, .map_symbol_station { border-radius: 50%; }
.map_symbol_emergency_shelters { color: #102a43; }
.map_symbol_station { width: 14px; height: 14px; }
.map_symbol_flood_maximum { border-radius: 2px; }
.map_symbol_walking_catchment { border: 2px dashed #147b78; background: transparent; box-shadow: none; border-radius: 2px; }
.map_facility { display: grid; place-items: center; background: transparent; border: 0; }
.map_facility .shelter_symbol { width: 22px; height: 22px; font-size: 10px; text-shadow: none; }
.map_facility.shelter_designated .shelter_symbol { width: 24px; height: 24px; }
.map_facility.shelter_emergency { color: #d87532; }
.map_facility.shelter_designated { color: #2c6eaa; }
.map_facility:focus-visible { outline: 3px solid #102a43; outline-offset: -3px; border-radius: 5px; background: #ffffffd9; }
.map_facility.shelter_coincident::before { content: ""; position: absolute; top: 21px; width: 12px; height: 2px; background: currentColor; z-index: -1; }
.map_facility.shelter_emergency.shelter_coincident::before { left: 22px; }
.map_facility.shelter_designated.shelter_coincident::before { left: 10px; }
.map_facility.shelter_coincident::after { content: ""; position: absolute; top: 19px; width: 6px; height: 6px; border-radius: 50%; background: currentColor; z-index: -1; }
.map_facility.shelter_emergency.shelter_coincident::after { left: 31px; }
.map_facility.shelter_designated.shelter_coincident::after { left: 7px; }
.map_legend_card .probability_gradient { height: 12px; margin: 6px 0 2px; background: linear-gradient(90deg, #ffffcc, #bd0026); border: 1px solid #8798a8; border-radius: 2px; }
.map_legend_card .probability_labels { display: flex; justify-content: space-between; font-size: 11px; }
.map_legend_card .ground_keys { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 5px 0; }
.map_legend_card .ground_key { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; }
.map_legend_card .ground_swatch { display: inline-block; width: 14px; height: 14px; border: 1px solid #8798a8; border-radius: 2px; }
.map_legend_card .fine_print { font-size: 12px; }
.leaflet-popup-content:has(.shelter_popup) { max-height: min(154px, max(84px, calc(60svh - 306px))); }

/* HP-3 2-C2: mesh detail controls match the existing facility touch target. */
.map_canvas .leaflet-popup-content:has(.mesh_popup) { margin-top: 44px; max-height: min(154px, max(84px, calc(60svh - 306px))); overflow-y: auto; overscroll-behavior: contain; }
.map_canvas .leaflet-popup:has(.mesh_popup) a.leaflet-popup-close-button { width: 44px; height: 44px; font-size: 24px; line-height: 44px; }

/* Legible legend explanations and bounded popup content. */
.map_legend_card, .shelter_legend, .shelter_facilities { font-size: .875rem; line-height: 1.85; }
.map_legend_title { font-size: .9375rem; }
.map_legend_note, .map_legend_card .fine_print, .map_legend_card .ground_key { font-size: .875rem; }
.mesh_popup, .shelter_popup, .map_canvas .leaflet-tooltip { font-size: 14px; line-height: 1.75; }
.map_canvas .leaflet-popup-content:has(.mesh_popup), .leaflet-popup-content:has(.shelter_popup) { max-height: 240px; }
@media (max-width:767px) {
  .map_canvas .leaflet-popup-content:has(.mesh_popup), .leaflet-popup-content:has(.shelter_popup) { max-height: 160px; }
}

/* Source attribution and legend explanations remain readable. */
.map_legend_note, .map_legend_card .fine_print, .shelter_legend .fine_print { font-size: .9375rem; color: var(--muted); line-height: 1.85; }
.map_canvas .leaflet-control-attribution { font-size: 14px; line-height: 1.5; color: var(--muted); }
