/**
 * SIA Member Map — public stylesheet (v1.0.23, Google-Maps layout)
 *
 * CHA Brand: Sora; CHA Dark Blue #0A1B29; CHA Light Blue #159AC2.
 *
 * Layout (matches Google Maps web + app):
 *   Desktop ≥ 769px — left panel (~420px): search + chips + state pills +
 *     radius + results list. Map fills the remaining space.
 *   Mobile ≤ 768px — full-viewport map. Floating top bar with search +
 *     category chips + "More filters". Bottom sheet with results,
 *     draggable (peek/half/full). Slide-in drawer from the right for
 *     state/radius/location.
 *
 * Modifier classes on .sia-mm-wrap:
 *   .is-full-width    break out of theme content container
 *   .is-full-takeover position:fixed inset:0 — covers the whole viewport
 */

/* ==================== ROOT WRAP ==================== */
.sia-mm-wrap {
	/* CHA brand palette */
	--sia-mm-dark-blue:   #0A1B29;
	--sia-mm-light-blue:  #159AC2;
	--sia-mm-yellow:      #F2BE4B;
	--sia-mm-green:       #92B943;
	--sia-mm-grey:        #A7A9AC;
	--sia-mm-light-grey:  #D3D4D5;

	/* Surface / text tokens */
	--sia-mm-bg:          #FFFFFF;
	--sia-mm-bg-soft:     #F4F8FC;
	--sia-mm-surface:     #FFFFFF;
	--sia-mm-ink:         #0A1B29;
	--sia-mm-ink-soft:    #5A6B8C;
	--sia-mm-ink-mute:    #8A94A8;
	--sia-mm-line:        #E4E8EF;
	--sia-mm-line-soft:   #F0F3F8;

	--sia-mm-focus:       #159AC2;
	--sia-mm-radius:      4px;
	--sia-mm-radius-lg:   8px;
	--sia-mm-shadow:      0 2px 6px rgba(37,58,113,.06), 0 8px 24px rgba(37,58,113,.08);
	--sia-mm-shadow-lg:   0 4px 10px rgba(37,58,113,.08), 0 16px 40px rgba(37,58,113,.12);
	--sia-mm-panel-w:     420px;

	font-family: var( --sia-mm-font, 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif );
	color: var(--sia-mm-ink);
	background: var(--sia-mm-bg);
	border: 1px solid var(--sia-mm-line);
	border-radius: var(--sia-mm-radius-lg);
	overflow: hidden;
	position: relative;
	height: var(--sia-mm-height, 720px);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.sia-mm-wrap *,
.sia-mm-wrap *::before,
.sia-mm-wrap *::after { box-sizing: border-box; }

.sia-mm-wrap button { font-family: inherit; }

/* Full-width breakout (current-container edge-to-edge) */
.sia-mm-wrap.is-full-width {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
	border-left: 0;
	border-right: 0;
}

/* Full takeover — overlays the entire viewport, including site header/footer.
   Admin bar (if logged in) is accounted for. */
.sia-mm-wrap.is-full-takeover {
	position: fixed;
	inset: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	max-height: 100dvh;
	margin: 0;
	border: 0;
	border-radius: 0;
	z-index: 99998;
}
body.admin-bar .sia-mm-wrap.is-full-takeover {
	top: 32px;
	height: calc(100vh - 32px);
	height: calc(100dvh - 32px);
	max-height: calc(100dvh - 32px);
}
@media screen and ( max-width: 782px ) {
	body.admin-bar .sia-mm-wrap.is-full-takeover {
		top: 46px;
		height: calc(100vh - 46px);
		height: calc(100dvh - 46px);
		max-height: calc(100dvh - 46px);
	}
}

/* Prevent background scrolling when takeover is active (JS toggles this class) */
body.sia-mm-body-lock { overflow: hidden; }

/* Back-to-site button (takeover only) — floats over the map area.
   Uses history.back() via JS with home URL fallback. */
.sia-mm-back-link {
	position: absolute;
	top: 12px;
	left: calc( var(--sia-mm-panel-w) + 12px );
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: var(--sia-mm-surface);
	border: 1px solid var(--sia-mm-line);
	border-radius: 999px;
	color: var(--sia-mm-ink);
	font-size: 12px;
	font-weight: 700;
	font-family: inherit;
	text-decoration: none;
	cursor: pointer;
	box-shadow: var(--sia-mm-shadow);
	z-index: 600;
	transition: all .15s ease;
}
.sia-mm-back-link:hover { border-color: var(--sia-mm-light-blue); color: var(--sia-mm-light-blue); }
.sia-mm-back-link svg { flex-shrink: 0; }

/* ==================== LEFT PANEL (desktop) ==================== */
.sia-mm-panel {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--sia-mm-panel-w);
	background: var(--sia-mm-surface);
	border-right: 1px solid var(--sia-mm-line);
	display: flex;
	flex-direction: column;
	min-height: 0;
	z-index: 500;
}

.sia-mm-panel-top {
	padding: 16px 18px 4px;
	border-bottom: 1px solid var(--sia-mm-line-soft);
}

/* Search input — ONE single rounded pill with icon on the left inside it.
   Critical: the inner <input> must NEVER paint a border, background, outline,
   shadow, or focus ring. All of those visual states belong to the outer
   .sia-mm-search-wrap. The wrap is the visible pill; the input is just text. */
.sia-mm-search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--sia-mm-surface) !important;
	border: 1.5px solid var(--sia-mm-line);
	border-radius: 999px;
	padding: 0 16px 0 42px;
	margin-bottom: 12px;
	height: 44px;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	overflow: hidden; /* Stop any descendant from poking outside the pill. */
}
.sia-mm-search-wrap:focus-within {
	border-color: var(--sia-mm-light-blue);
	box-shadow: 0 0 0 3px rgba(0,174,239,.15);
}
.sia-mm-search-wrap > svg.sia-mm-icon,
.sia-mm-search-wrap .sia-mm-icon {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: var(--sia-mm-ink-soft);
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	pointer-events: none;
	flex-shrink: 0;
}
.sia-mm-search-wrap .sia-mm-search-input,
.sia-mm-search-wrap input.sia-mm-search-input,
.sia-mm-search-wrap input[type="search"].sia-mm-search-input {
	flex: 1;
	min-width: 0;
	width: 100%;
	height: 100%;
	padding: 0 !important;
	margin: 0 !important;
	font-size: 14px;
	line-height: 41px; /* matches wrap height (44) - border (2 * 1.5) ≈ 41 */
	font-family: inherit;
	color: var(--sia-mm-ink);
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	outline: 0 !important;
	box-shadow: none !important;
	-webkit-appearance: none !important;
	appearance: none !important;
	-webkit-box-shadow: none !important;
	vertical-align: middle;
}
.sia-mm-search-wrap .sia-mm-search-input:focus,
.sia-mm-search-wrap .sia-mm-search-input:focus-visible,
.sia-mm-search-wrap .sia-mm-search-input:active,
.sia-mm-search-wrap .sia-mm-search-input:hover {
	outline: 0 !important;
	box-shadow: none !important;
	border: 0 !important;
	background: transparent !important;
	background-color: transparent !important;
}
.sia-mm-search-input::placeholder { color: var(--sia-mm-ink-mute); opacity: 1; }
.sia-mm-search-input::-webkit-search-decoration,
.sia-mm-search-input::-webkit-search-cancel-button,
.sia-mm-search-input::-webkit-search-results-button,
.sia-mm-search-input::-webkit-search-results-decoration { -webkit-appearance: none; display: none; }

.sia-mm-search-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid var(--sia-mm-line);
	border-top-color: var(--sia-mm-light-blue);
	border-radius: 50%;
	opacity: 0;
	flex-shrink: 0;
	transition: opacity .15s ease;
}
.sia-mm-search-wrap.is-loading .sia-mm-search-spinner {
	opacity: 1;
	animation: sia-mm-spin 0.7s linear infinite;
}
@keyframes sia-mm-spin { to { transform: rotate(360deg); } }

/* Category chips row */
.sia-mm-cat-toggles {
	display: flex;
	gap: 6px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}
.sia-mm-cat-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--sia-mm-ink-soft);
	background: var(--sia-mm-surface);
	border: 1.5px solid var(--sia-mm-line);
	border-radius: 999px;
	cursor: pointer;
	transition: all .12s ease;
}
.sia-mm-cat-btn:hover { border-color: var(--sia-mm-light-blue); color: var(--sia-mm-ink); }
.sia-mm-cat-btn.is-active {
	background: var(--sia-mm-dark-blue);
	color: #fff;
	border-color: var(--sia-mm-dark-blue);
}
.sia-mm-cat-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

/* Panel filter groups (state pills + actions + radius) */
.sia-mm-panel-filters {
	padding: 12px 18px;
	border-bottom: 1px solid var(--sia-mm-line-soft);
}
.sia-mm-filter-group { margin-bottom: 14px; }
.sia-mm-filter-group:last-child { margin-bottom: 0; }
.sia-mm-filter-label {
	font-size: 10.5px;
	font-weight: 700;
	color: var(--sia-mm-ink-mute);
	text-transform: uppercase;
	letter-spacing: .08em;
	margin-bottom: 8px;
}

.sia-mm-state-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}
.sia-mm-state-pill {
	padding: 6px 12px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .04em;
	color: var(--sia-mm-ink-soft);
	background: transparent;
	border: 1.5px solid var(--sia-mm-line);
	border-radius: var(--sia-mm-radius);
	cursor: pointer;
	transition: all .12s ease;
	text-transform: uppercase;
}
.sia-mm-state-pill:hover {
	background: var(--sia-mm-bg-soft);
	color: var(--sia-mm-dark-blue);
	border-color: var(--sia-mm-light-blue);
}
.sia-mm-state-pill.is-active {
	background: var(--sia-mm-light-blue);
	color: #fff;
	border-color: var(--sia-mm-light-blue);
}

/* Action row */
.sia-mm-action-row {
	display: flex;
	gap: 6px;
	align-items: center;
	flex-wrap: wrap;
}
.sia-mm-geo-btn,
.sia-mm-reset-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 700;
	color: var(--sia-mm-dark-blue);
	background: var(--sia-mm-surface);
	border: 1.5px solid var(--sia-mm-line);
	border-radius: var(--sia-mm-radius);
	cursor: pointer;
	transition: all .15s ease;
}
.sia-mm-geo-btn:hover,
.sia-mm-reset-btn:hover { border-color: var(--sia-mm-light-blue); color: var(--sia-mm-light-blue); }
.sia-mm-geo-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.sia-mm-geo-btn.sia-mm-geo-active {
	background: var(--sia-mm-light-blue);
	color: #fff;
	border-color: var(--sia-mm-light-blue);
}
.sia-mm-geo-btn.sia-mm-geo-active::after {
	content: '✕';
	margin-left: 4px;
	font-size: 11px;
	opacity: .85;
}
.sia-mm-reset-btn {
	color: var(--sia-mm-ink-soft);
	background: transparent;
	border-color: transparent;
	margin-left: auto;
}
.sia-mm-reset-btn:hover { color: var(--sia-mm-light-blue); background: var(--sia-mm-bg-soft); border-color: transparent; }
.sia-mm-reset-btn:disabled,
.sia-mm-reset-btn[disabled] { opacity: .35; cursor: not-allowed; pointer-events: none; }

/* Radius slider */
.sia-mm-radius-row {
	margin-top: 10px;
	padding: 10px 12px;
	background: var(--sia-mm-bg-soft);
	border-radius: var(--sia-mm-radius);
}
.sia-mm-radius-row label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	font-weight: 700;
	color: var(--sia-mm-ink-soft);
}
.sia-mm-radius-slider { flex: 1; accent-color: var(--sia-mm-light-blue); }
.sia-mm-radius-value { font-weight: 700; color: var(--sia-mm-dark-blue); min-width: 3ch; text-align: right; }

/* Results header */
.sia-mm-results-header {
	padding: 14px 18px 10px;
	font-size: 11px;
	font-weight: 700;
	color: var(--sia-mm-ink-soft);
	text-transform: uppercase;
	letter-spacing: .1em;
	border-bottom: 1px solid var(--sia-mm-line-soft);
	flex-shrink: 0;
}

.sia-mm-results-list {
	flex: 1;
	overflow-y: auto;
	list-style: none;
	margin: 0;
	padding: 0;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
}

.sia-mm-result {
	padding: 16px 18px;
	border-bottom: 1px solid var(--sia-mm-line-soft);
	cursor: pointer;
	transition: background-color .12s ease, padding-left .15s ease;
	position: relative;
}
.sia-mm-result:hover,
.sia-mm-result:focus-visible { background: var(--sia-mm-bg-soft); outline: none; }
.sia-mm-result.is-active { background: var(--sia-mm-bg-soft); padding-left: 22px; }
.sia-mm-result.is-active::before {
	content: '';
	position: absolute;
	left: 0; top: 0; bottom: 0;
	width: 4px;
	background: var(--sia-mm-light-blue);
}
.sia-mm-result h3 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; color: var(--sia-mm-dark-blue); line-height: 1.35; }
.sia-mm-result .sia-mm-org { font-size: 10px; color: var(--sia-mm-light-blue); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 5px; }
.sia-mm-result .sia-mm-addr { font-size: 12.5px; color: var(--sia-mm-ink-soft); line-height: 1.5; }
.sia-mm-result .sia-mm-meta-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--sia-mm-ink-soft); }
.sia-mm-pill {
	display: inline-block;
	padding: 3px 9px;
	background: var(--sia-mm-bg-soft);
	border: 1px solid var(--sia-mm-line);
	border-radius: 999px;
	font-size: 10px;
	font-weight: 700;
	color: var(--sia-mm-ink-soft);
}
.sia-mm-pill.is-aged-care { background: rgba(0,174,239,.08); border-color: rgba(0,174,239,.3); color: var(--sia-mm-light-blue); }
.sia-mm-pill.is-hospital  { background: rgba(37,58,113,.06); border-color: rgba(37,58,113,.2);  color: var(--sia-mm-dark-blue); }
.sia-mm-distance { color: var(--sia-mm-light-blue); font-weight: 700; margin-left: auto; font-size: 12px; }

/* Empty state — centred vertically */
.sia-mm-empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	text-align: center;
	color: var(--sia-mm-ink-soft);
	font-size: 13.5px;
	line-height: 1.55;
	list-style: none;
}
.sia-mm-empty-icon { width: 44px; height: 44px; margin-bottom: 12px; color: var(--sia-mm-ink-mute); opacity: .7; }
.sia-mm-empty-title { margin: 0 0 6px; font-size: 14.5px; font-weight: 700; color: var(--sia-mm-dark-blue); }
.sia-mm-empty-msg { margin: 0 0 14px; max-width: 280px; }
.sia-mm-empty-actions { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.sia-mm-empty-actions .sia-mm-empty-btn {
	display: inline-block;
	padding: 9px 16px;
	font-size: 12.5px;
	font-weight: 700;
	color: #fff;
	background: var(--sia-mm-light-blue);
	border: 1.5px solid var(--sia-mm-light-blue);
	border-radius: var(--sia-mm-radius);
	cursor: pointer;
	text-decoration: none;
	transition: all .15s ease;
}
.sia-mm-empty-actions .sia-mm-empty-btn:hover,
.sia-mm-empty-actions .sia-mm-empty-btn:focus-visible {
	background: var(--sia-mm-dark-blue);
	border-color: var(--sia-mm-dark-blue);
}
.sia-mm-empty-actions .sia-mm-empty-btn.is-secondary {
	color: var(--sia-mm-dark-blue);
	background: transparent;
	border-color: var(--sia-mm-line);
}
.sia-mm-empty-actions .sia-mm-empty-btn.is-secondary:hover {
	border-color: var(--sia-mm-light-blue);
	color: var(--sia-mm-light-blue);
}

/* Skeleton loading rows */
.sia-mm-skeleton {
	padding: 16px 18px;
	border-bottom: 1px solid var(--sia-mm-line-soft);
	list-style: none;
}
.sia-mm-skeleton-line {
	height: 10px;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--sia-mm-bg-soft) 0%, #edf1f7 50%, var(--sia-mm-bg-soft) 100%);
	background-size: 200% 100%;
	animation: sia-mm-shimmer 1.2s ease-in-out infinite;
	margin-bottom: 8px;
}
.sia-mm-skeleton-line.is-short { width: 40%; }
.sia-mm-skeleton-line.is-mid   { width: 75%; height: 14px; }
.sia-mm-skeleton-line.is-wide  { width: 95%; }
@keyframes sia-mm-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}

/* Mobile bottom-sheet drag handle (hidden on desktop) */
.sia-mm-sheet-handle {
	display: none;
	width: 100%;
	padding: 10px 18px 6px;
	background: var(--sia-mm-surface);
	border: none;
	cursor: grab;
	align-items: center;
	justify-content: center;
	touch-action: none;
}
.sia-mm-sheet-grip {
	width: 44px;
	height: 4px;
	border-radius: 2px;
	background: var(--sia-mm-line);
	display: inline-block;
}

/* ==================== MAP ==================== */
.sia-mm-map-wrap {
	position: absolute;
	inset: 0 0 0 var(--sia-mm-panel-w);
	background: #E4E8EF;
	min-height: 0;
}
.sia-mm-map { width: 100%; height: 100%; }

/* Leaflet overrides */
.sia-mm-wrap .leaflet-container { font-family: inherit; background: #E4E8EF; }
.sia-mm-wrap .leaflet-popup-content-wrapper {
	border-radius: var(--sia-mm-radius-lg);
	box-shadow: var(--sia-mm-shadow-lg);
	padding: 0;
	border: 1px solid var(--sia-mm-line);
}
.sia-mm-wrap .leaflet-popup-content {
	margin: 0;
	padding: 18px 20px;
	min-width: 240px;
	max-width: 320px;
	line-height: 1.5;
}
.sia-mm-wrap .leaflet-popup-tip { box-shadow: var(--sia-mm-shadow); }

.sia-mm-popup h3 { margin: 0 0 4px; font-size: 16px; font-weight: 700; color: var(--sia-mm-dark-blue); line-height: 1.3; }
.sia-mm-popup .sia-mm-org { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--sia-mm-light-blue); font-weight: 700; margin-bottom: 6px; }
.sia-mm-popup .sia-mm-addr { font-size: 13px; color: var(--sia-mm-ink-soft); margin-bottom: 10px; }
.sia-mm-popup .sia-mm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.sia-mm-popup .sia-mm-actions a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 12px;
	font-size: 12px;
	font-weight: 700;
	border-radius: var(--sia-mm-radius);
	text-decoration: none;
	background: var(--sia-mm-bg-soft);
	border: 1.5px solid var(--sia-mm-line);
	color: var(--sia-mm-dark-blue);
	font-family: inherit;
	transition: all .15s ease;
}
.sia-mm-popup .sia-mm-actions a:hover { background: var(--sia-mm-dark-blue); color: #fff; border-color: var(--sia-mm-dark-blue); }
.sia-mm-popup .sia-mm-actions a.is-primary { background: var(--sia-mm-light-blue); color: #fff; border-color: var(--sia-mm-light-blue); }
.sia-mm-popup .sia-mm-actions a.is-primary:hover { background: var(--sia-mm-dark-blue); border-color: var(--sia-mm-dark-blue); }

/* Markers */
.sia-mm-marker {
	width: 30px;
	height: 38px;
	background: var(--sia-mm-aged-care, var(--sia-mm-light-blue));
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	border: 2.5px solid #fff;
	box-shadow: 0 3px 8px rgba(37,58,113,.3);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease;
}
.sia-mm-marker::after { content: ''; width: 10px; height: 10px; background: #fff; border-radius: 50%; }
.sia-mm-marker.is-hospital { background: var(--sia-mm-hospital, var(--sia-mm-dark-blue)); }

/* Soften the marker pop-in. When markers/clusters first appear, fade
   them in over 200ms instead of snapping to full opacity. NOTE: we
   animate ONLY opacity, never transform — Leaflet positions every
   marker via inline transform: translate3d(...) and overriding it
   would teleport markers to the wrong coordinates. */
.sia-mm-wrap .leaflet-marker-icon {
	animation: sia-mm-marker-in .25s ease-out backwards;
}
@keyframes sia-mm-marker-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.sia-mm-wrap .marker-cluster { background: transparent; }
.sia-mm-wrap .marker-cluster div {
	background: var(--sia-mm-dark-blue);
	color: #fff;
	font-weight: 700;
	font-size: 13px;
	font-family: inherit;
	border: 3px solid #fff;
	box-shadow: 0 3px 10px rgba(37,58,113,.3);
}

/* ==================== LEGEND (floating overlay on map) ==================== */
.sia-mm-legend {
	position: absolute;
	bottom: 12px;
	right: 12px;
	background: var(--sia-mm-surface);
	border: 1px solid var(--sia-mm-line);
	border-radius: var(--sia-mm-radius-lg);
	box-shadow: var(--sia-mm-shadow);
	z-index: 400;
	max-width: 240px;
}
.sia-mm-legend-toggle {
	display: none;
	height: 36px;
	padding: 0 14px;
	background: transparent;
	border: 0;
	cursor: pointer;
	color: var(--sia-mm-ink);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .1em;
	align-items: center;
	justify-content: center;
	white-space: nowrap;
}
.sia-mm-legend-toggle:hover { color: var(--sia-mm-light-blue); }
.sia-mm-legend-body {
	display: flex;
	flex-direction: column;
	gap: 7px;
	padding: 10px 14px;
	font-size: 11.5px;
	font-weight: 500;
	color: var(--sia-mm-ink-soft);
}
.sia-mm-legend-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sia-mm-legend-pin {
	width: 10px; height: 13px;
	border-radius: 50% 50% 50% 0;
	transform: rotate(-45deg);
	border: 1.5px solid #fff;
	box-shadow: 0 1px 2px rgba(37,58,113,.25);
	display: inline-block;
	flex-shrink: 0;
}
.sia-mm-legend-cluster {
	width: 18px; height: 18px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(37,58,113,.25);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 9px;
	font-weight: 700;
	flex-shrink: 0;
}
.sia-mm-legend-you {
	width: 10px; height: 10px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(37,58,113,.25);
	display: inline-block;
	flex-shrink: 0;
}

/* ==================== FLOATING FILTERS PILL (mobile only) ==================== */
/* Hangs above the bottom sheet's top edge. Opens the filters drawer when
   tapped. Hidden on desktop — the panel already shows filters inline. */
.sia-mm-filter-pill {
	display: none;
	position: absolute;
	top: -52px;
	left: 50%;
	transform: translateX(-50%);
	padding: 9px 18px;
	font-size: 12.5px;
	font-weight: 700;
	font-family: inherit;
	color: var(--sia-mm-dark-blue);
	background: var(--sia-mm-surface);
	border: 1px solid var(--sia-mm-line);
	border-radius: 999px;
	box-shadow: 0 4px 14px rgba(37,58,113,.18);
	cursor: pointer;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
	z-index: 555;
	transition: transform .2s ease, opacity .2s ease;
}
.sia-mm-filter-pill:hover { color: var(--sia-mm-light-blue); border-color: var(--sia-mm-light-blue); }
.sia-mm-filter-pill svg { flex-shrink: 0; }
.sia-mm-filter-pill-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	background: var(--sia-mm-light-blue);
	border-radius: 999px;
	margin-left: -2px;
}
.sia-mm-filter-pill-badge[hidden] { display: none; }

/* ==================== MOBILE DRAWER (slide in from right) ==================== */
.sia-mm-drawer-backdrop {
	display: none;
	position: absolute;
	inset: 0;
	background: rgba(37,58,113,.45);
	z-index: 700;
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s ease;
}
.sia-mm-drawer-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sia-mm-drawer {
	display: none;
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: min(360px, 88%);
	background: var(--sia-mm-surface);
	box-shadow: -8px 0 24px rgba(37,58,113,.2);
	z-index: 800;
	transform: translateX(100%);
	pointer-events: none;
	transition: transform .25s ease;
	flex-direction: column;
}
.sia-mm-drawer.is-open { transform: translateX(0); pointer-events: auto; }

/* CRITICAL: the [hidden] attribute must always win over the mobile
   display:flex rule below — otherwise the invisible backdrop sits on top
   of the entire mobile UI at z-index 700 and swallows every tap. */
.sia-mm-drawer-backdrop[hidden],
.sia-mm-drawer[hidden] {
	display: none !important;
}
.sia-mm-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--sia-mm-line);
}
.sia-mm-drawer-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--sia-mm-dark-blue); }
.sia-mm-drawer-close {
	width: 36px;
	height: 36px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	color: var(--sia-mm-ink-soft);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.sia-mm-drawer-close:hover { background: var(--sia-mm-bg-soft); color: var(--sia-mm-ink); }
.sia-mm-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 12px 16px;
	-webkit-overflow-scrolling: touch;
	min-height: 0;
}
.sia-mm-drawer-foot { padding: 12px 16px; border-top: 1px solid var(--sia-mm-line); }
.sia-mm-drawer-apply {
	width: 100%;
	padding: 12px 16px;
	font-size: 13px;
	font-weight: 700;
	color: #fff;
	background: var(--sia-mm-light-blue);
	border: 0;
	border-radius: var(--sia-mm-radius);
	cursor: pointer;
	transition: background .15s ease;
}
.sia-mm-drawer-apply:hover { background: var(--sia-mm-dark-blue); }

/* ==================== LEAFLET ZOOM CONTROLS ==================== */
/* JS sets zoomControl:false and manually adds the control at top-right.
   On mobile it's hidden entirely — pinch-to-zoom is standard and the
   map area is at a premium. */
.sia-mm-wrap .leaflet-top.leaflet-right .leaflet-control-zoom {
	margin-top: 12px;
	margin-right: 12px;
	border: 1px solid var(--sia-mm-line);
	border-radius: var(--sia-mm-radius);
	box-shadow: var(--sia-mm-shadow);
}
.sia-mm-wrap .leaflet-control-zoom a {
	width: 32px;
	height: 32px;
	line-height: 32px;
	font-size: 18px;
	color: var(--sia-mm-dark-blue);
	border-radius: 0;
	background: var(--sia-mm-surface);
	font-weight: 700;
}
.sia-mm-wrap .leaflet-control-zoom a:hover {
	background: var(--sia-mm-bg-soft);
	color: var(--sia-mm-light-blue);
}

/* ==================== MOBILE LAYOUT (≤768px) ==================== */
@media (max-width: 768px) {

	.sia-mm-wrap {
		--sia-mm-panel-w: 0;
		height: var(--sia-mm-height, 92vh);
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}
	.sia-mm-wrap.is-full-takeover { height: 100dvh; max-height: 100dvh; }

	/* Map fills the entire viewport behind the sheet */
	.sia-mm-map-wrap { inset: 0; }

	/* =========== THREE-STATE BOTTOM SHEET =========== */
	/* Default: half the screen (good balance of map + results).
	   is-collapsed: peek — just the handle + search input visible.
	   is-expanded: near-fullscreen — full results list. */
	.sia-mm-panel {
		top: auto;
		inset: auto 0 0 0;
		width: 100%;
		height: 50%;
		min-height: 120px;
		max-height: 92%;
		border-right: 0;
		border-top: 1px solid var(--sia-mm-line);
		border-radius: 16px 16px 0 0;
		box-shadow: 0 -8px 24px rgba(37,58,113,.12);
		z-index: 550;
		overflow: visible;           /* let filter pill hang above top edge */
		transition: height .25s cubic-bezier(.2,.8,.3,1);
	}

	/* Peek — drag handle + search input only, chips and results tucked away. */
	.sia-mm-panel.is-collapsed { height: 88px; }
	.sia-mm-panel.is-collapsed .sia-mm-cat-toggles,
	.sia-mm-panel.is-collapsed .sia-mm-results-header,
	.sia-mm-panel.is-collapsed .sia-mm-results-list { display: none; }
	/* Remove panel-top's bottom border when it's the only visible content */
	.sia-mm-panel.is-collapsed > .sia-mm-panel-top { border-bottom: 0; }

	/* Expanded — dominate the screen. */
	.sia-mm-panel.is-expanded { height: 88%; }

	/* Drag handle at the very top of the sheet */
	.sia-mm-sheet-handle {
		display: flex;
		order: -2;                   /* top of panel (above filter pill slot) */
		padding: 8px 14px 2px;
	}

	/* Search + chips visible on mobile (inside the sheet) */
	.sia-mm-panel > .sia-mm-panel-top {
		display: block;
		order: -1;                   /* immediately below drag handle */
		flex-shrink: 0;
		padding: 6px 16px 10px;
		border-bottom: 1px solid var(--sia-mm-line-soft);
	}

	/* Trim the chips a bit on mobile so they don't wrap too often */
	.sia-mm-panel > .sia-mm-panel-top .sia-mm-cat-btn {
		padding: 7px 12px;
		font-size: 11.5px;
	}

	/* Hide deep filters inline — they move to the drawer on mobile */
	.sia-mm-panel > .sia-mm-panel-filters { display: none; }

	/* Show the floating filter pill (always visible on mobile so users can
	   reach state/location filters from any sheet state) */
	.sia-mm-filter-pill { display: inline-flex; }

	/* Drawer + backdrop available */
	.sia-mm-drawer-backdrop,
	.sia-mm-drawer { display: flex; }

	/* Legend collapses to a "?" toggle, positioned above the bottom sheet */
	.sia-mm-legend {
		top: 12px;
		bottom: auto;
		right: 10px;
		max-width: unset;
	}
	.sia-mm-legend-toggle { display: inline-flex; }
	.sia-mm-legend .sia-mm-legend-body { display: none; padding: 8px 12px; }
	.sia-mm-legend.is-expanded .sia-mm-legend-body { display: flex; }
	.sia-mm-legend.is-expanded .sia-mm-legend-toggle {
		border-bottom: 1px solid var(--sia-mm-line);
		border-radius: var(--sia-mm-radius-lg) var(--sia-mm-radius-lg) 0 0;
	}

	/* Hide Leaflet zoom controls on mobile — pinch works, and the map area
	   is too small to afford them without crowding the other UI. */
	.sia-mm-wrap .leaflet-control-zoom { display: none; }

	/* Back link sits top-left, small */
	.sia-mm-back-link {
		top: 10px;
		left: 10px;
		font-size: 11px;
		padding: 6px 10px;
	}

	/* Popup tightens */
	.sia-mm-wrap .leaflet-popup-content { min-width: 200px; max-width: 260px; padding: 16px 18px; }

	/* Drawer interior — state pills + actions restyle for touch */
	.sia-mm-drawer-body .sia-mm-filter-group { margin-bottom: 20px; }
	.sia-mm-drawer-body .sia-mm-filter-group:last-child { margin-bottom: 0; }
	.sia-mm-drawer-body .sia-mm-state-pills { gap: 6px; }
	.sia-mm-drawer-body .sia-mm-state-pill { padding: 8px 14px; font-size: 12px; }
	.sia-mm-drawer-body .sia-mm-action-row { gap: 8px; }
	.sia-mm-drawer-body .sia-mm-geo-btn,
	.sia-mm-drawer-body .sia-mm-reset-btn { padding: 10px 14px; font-size: 13px; }
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
	.sia-mm-wrap *, .sia-mm-wrap *::before, .sia-mm-wrap *::after {
		transition: none !important;
		animation: none !important;
	}
	.sia-mm-drawer { transition: none !important; }
}

/* ==================== FOCUS VISIBILITY ==================== */
.sia-mm-wrap :focus-visible {
	outline: 2px solid var(--sia-mm-light-blue);
	outline-offset: 2px;
	border-radius: var(--sia-mm-radius);
}

/* ── Minimap (homepage teaser): map only + CTA to the full map ── */
.sia-mm-wrap.is-mini .sia-mm-panel{display:none!important}
.sia-mm-wrap.is-mini .sia-mm-map{width:100%!important;height:100%!important}
.sia-mm-wrap.is-mini{border-radius:16px;overflow:hidden;border:1px solid #dceaf1}
.sia-mm-mini-cta{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);z-index:1000;display:inline-flex;align-items:center;gap:8px;background:var(--sia-mm-accent,#159AC2);color:#fff;font-weight:600;font-size:14px;font-family:var(--sia-mm-font,inherit);padding:11px 22px;border-radius:100px;text-decoration:none;box-shadow:0 12px 28px -10px rgba(10,27,41,.65)}
.sia-mm-mini-cta:hover{transform:translateX(-50%) translateY(-2px);color:#fff}
.sia-mm-mini-cta svg{transition:transform .15s}
.sia-mm-mini-cta:hover svg{transform:translateX(3px)}

/* ── Members-only gate (shown in place of the map to non-members) ── */
.sia-mm-gate{display:flex;align-items:center;justify-content:center;min-height:320px;padding:2.5rem 1.5rem;border-radius:16px;background:linear-gradient(160deg,#12283b,#0a1b29);border:1px solid rgba(255,255,255,.10);color:#eaf4f8;font-family:var(--sia-mm-font,"Sora",system-ui,sans-serif);text-align:center}
.sia-mm-gate-inner{max-width:34ch}
.sia-mm-gate svg{color:#8fd3e8;margin-bottom:.6rem}
.sia-mm-gate h3{font-size:1.4rem;font-weight:700;margin:0 0 .5rem;color:#fff}
.sia-mm-gate p{font-size:.98rem;line-height:1.55;color:#cfe0e9;margin:0 0 1.4rem}
.sia-mm-gate-cta{display:flex;gap:.6rem;justify-content:center;flex-wrap:wrap}
.sia-mm-gate-btn{display:inline-block;padding:.7rem 1.5rem;border-radius:100px;font-weight:600;font-size:.95rem;text-decoration:none;border:1px solid rgba(255,255,255,.45);color:#fff;transition:transform .15s,background .2s}
.sia-mm-gate-btn:hover{transform:translateY(-2px);color:#fff}
.sia-mm-gate-btn.is-primary{background:#159AC2;border-color:#159AC2}
.sia-mm-gate-btn.is-primary:hover{background:#0E7A9B}

/* ── Member logo + brands in popups ── */
.sia-mm-popup .sia-mm-logo{max-width:130px;max-height:56px;object-fit:contain;display:block;margin:0 0 10px}
.sia-mm-popup .sia-mm-brands{font-size:12px;color:#5b7381;margin-top:8px;line-height:1.45}
.sia-mm-popup .sia-mm-brands::before{content:"Brands: ";font-weight:700;color:#0A1B29}
