.wmg-app {
	--wmg-ink: var(--text-primary);
	--wmg-muted: var(--text-muted);
	--wmg-line: var(--border-muted);
	--wmg-pin: var(--main_orange);
	--wmg-on-primary: var(--surface-bg);
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-left: 0;
	margin-right: 0;
	background: transparent;
	color: var(--wmg-ink);
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
	padding: 0 0 42px;
}

.wmg-app *,
.wmg-app *::before,
.wmg-app *::after {
	box-sizing: border-box;
}

.wmg-app [hidden] {
	display: none !important;
}

.wmg-shell {
	width: 100%;
	min-width: 0;
	margin: 0 auto;
}

.wmg-crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	margin: 0 0 12px;
	color: var(--wmg-muted);
	font-size: 0.8125em;
}

.wmg-crumb a {
	color: var(--wmg-muted);
	text-decoration: none;
}

.wmg-crumb a:hover {
	color: var(--wmg-ink);
	text-decoration: underline;
}

.wmg-crumb-sep {
	margin: 0 8px;
}

.wmg-title {
	margin: 0;
	font-size: 1.875em;
	line-height: 1.25;
		color: var(--wmg-ink);
}

.wmg-lead {
	margin: 6px 0 0;
	max-width: 720px;
	color: var(--wmg-muted);
	font-size: 0.875em;
}

.wmg-board {
	display: grid;
	grid-template-columns: 360px minmax(0, 1fr);
	gap: 16px;
	margin-top: 0;
	height: min(760px, calc(100vh - 200px));
	min-height: 560px;
}

.wmg-panel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	background: var(--surface-bg);
	border: 1px solid var(--wmg-line);
	border-radius: 12px;
	overflow: hidden;
}

.wmg-panel-top {
	padding: 16px 16px 0;
}

.wmg-search label {
	display: block;
	margin-bottom: 8px;
	font-size: 0.875em;
	font-weight: 700;
}

.wmg-search-field {
	position: relative;
}

.wmg-search-field svg {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-faint);
	pointer-events: none;
}

.wmg-search-field input {
	width: 100%;
	height: 42px;
	padding: 0 12px 0 40px;
	border: 1px solid var(--wmg-line);
	border-radius: 8px;
	background: var(--surface-bg);
	color: inherit;
	font: inherit;
	font-size: 0.875em;
}

.wmg-search-field input:focus {
	border-color: var(--text-faint);
	outline: 2px solid transparent;
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--wmg-pin) 20%, transparent);
}

.wmg-locate {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 44px;
	margin-top: 10px;
	padding: 8px 12px;
	border: 0;
	border-radius: 8px;
	background: var(--wmg-pin);
	color: var(--surface-bg);
	font: inherit;
	font-size: 0.875em;
	font-weight: 700;
	cursor: pointer;
}

.wmg-locate:hover {
	background: color-mix(in srgb, var(--wmg-pin) 85%, var(--main_navy));
}

.wmg-locate:disabled {
	cursor: wait;
}

.wmg-locate-icon,
.wmg-spin {
	display: flex;
	flex: none;
}

.wmg-spin {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid color-mix(in srgb, var(--wmg-on-primary) 35%, transparent);
	border-top-color: var(--surface-bg);
	border-radius: 50%;
}

.wmg-locate.is-loading .wmg-locate-icon {
	display: none;
}

.wmg-locate.is-loading .wmg-spin {
	display: block;
	animation: wmg-spin 0.7s linear infinite;
}

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

.wmg-status {
	margin: 8px 0 0;
	color: var(--wmg-muted);
	font-size: 0.8125em;
}

.wmg-status:empty {
	display: none;
}

.wmg-status.is-error {
	color: var(--main_red);
}

.wmg-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 14px 0 10px;
	color: var(--wmg-muted);
	font-size: inherit;
}

.wmg-count,
.wmg-sort {
	margin: 0;
}

.wmg-sort {
	padding: 0;
	border: 0;
	background: none;
	color: var(--wmg-muted);
	font: inherit;
	font-size: 0.8125em;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.wmg-sort:hover {
	color: var(--wmg-ink);
}

.wmg-list {
	flex: 1;
	min-height: 0;
	overflow: auto;
	padding: 0 16px 12px;
}

.wmg-empty {
	margin: 8px 0 12px;
	color: var(--wmg-muted);
	font-size: 0.875em;
}

.wmg-empty a {
	color: var(--wmg-ink);
}

.wmg-card {
	display: flex;
	gap: 12px;
	width: 100%;
	margin: 0 0 10px;
	padding: 12px;
	border: 1px solid var(--wmg-line);
	border-radius: 10px;
	background: var(--surface-bg);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.wmg-card:hover {
	background: var(--surface-hover);
}

.wmg-card.is-active {
	border-color: var(--wmg-pin);
	box-shadow: 0 0 0 1px var(--wmg-pin);
}

.wmg-card:focus-visible,
.wmg-locate:focus-visible,
.wmg-sort:focus-visible,
.wmg-see-all:focus-visible,
.wmg-tools button:focus-visible {
	outline: 2px solid var(--wmg-ink);
	outline-offset: 2px;
}

.wmg-num {
	display: inline-flex;
	flex: 0 0 28px;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--wmg-pin);
	color: var(--surface-bg);
	font-size: 0.8125em;
	font-weight: 700;
}

.wmg-card-main {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wmg-card-title {
	font-size: 0.9375em;
	font-weight: 700;
	line-height: 1.35;
}

.wmg-card-line,
.wmg-card-phone,
.wmg-card-distance {
	color: var(--wmg-muted);
	font-size: 0.8125em;
	line-height: 1.45;
}

.wmg-card-line {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.wmg-card-phone {
	display: flex;
	align-items: center;
	gap: 6px;
}

.wmg-card-phone .wmg-icon {
	flex: none;
	color: var(--wmg-muted);
}

.wmg-card-distance {
	color: var(--main_blue);
	font-weight: 700;
}

.wmg-stage {
	position: relative;
	min-height: 0;
	overflow: hidden;
	border: 1px solid var(--wmg-line);
	border-radius: 12px;
	background: var(--wmg-line);
}

.wmg-map {
	position: absolute;
	inset: 0;
}

.wmg-map-fallback {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 24px;
	background: var(--surface-alt-bg);
	color: var(--wmg-ink);
	text-align: center;
}

.wmg-map-fallback a {
	color: var(--wmg-ink);
}

.wmg-hint {
	position: absolute;
	left: 50%;
	bottom: 16px;
	z-index: 2;
	max-width: calc(100% - 150px);
	margin: 0;
	padding: 8px 14px;
	transform: translateX(-50%);
	border-radius: 999px;
	background: color-mix(in srgb, var(--surface-bg) 94%, transparent);
	box-shadow: var(--shadow-sm);
	color: var(--wmg-muted);
	font-size: 0.75em;
	line-height: 1.4;
	text-align: center;
	pointer-events: none;
}

.wmg-tools {
	position: absolute;
	right: 12px;
	bottom: 18px;
	z-index: 2;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.wmg-see-all {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	height: 36px;
	padding: 0 14px;
	border: 0;
	border-radius: 8px;
	background: var(--surface-bg);
	box-shadow: var(--shadow-sm);
	color: var(--wmg-ink);
	font: inherit;
	font-size: 0.8125em;
	font-weight: 700;
	cursor: pointer;
}

.wmg-see-all:hover {
	background: var(--surface-hover);
}

.wmg-stage.is-broken .wmg-tools,
.wmg-stage.is-broken .wmg-hint,
.wmg-stage.is-broken .wmg-see-all {
	display: none;
}

.wmg-tools button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 8px;
	background: var(--surface-bg);
	box-shadow: var(--shadow-sm);
	color: var(--wmg-ink);
	font: inherit;
	font-size: 1.25em;
	line-height: 1;
	cursor: pointer;
}

.wmg-tools button:hover {
	background: var(--surface-hover);
}

.wmg-stage:fullscreen,
.wmg-stage:-webkit-full-screen {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: 0;
}

.wmg-pin {
	display: block;
	width: 36px;
	height: 46px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wmg-pin);
	cursor: pointer;
}

.wmg-pin svg {
	display: block;
	filter: drop-shadow(0 1px 1px var(--overlay-backdrop));
}

.wmg-pin span {
	position: absolute;
	left: 0;
	right: 0;
	top: 6px;
	height: 20px;
	color: var(--surface-bg);
	font-family: inherit;
	font-size: 0.8125em;
	font-weight: 700;
	line-height: 20px;
	text-align: center;
	pointer-events: none;
}

.wmg-pin.is-active {
	color: var(--main_navy);
}

.wmg-pin:focus-visible {
	outline: 2px solid var(--wmg-ink);
	outline-offset: 2px;
}

.wmg-user {
	width: 16px;
	height: 16px;
	border: 2px solid var(--surface-bg);
	border-radius: 50%;
	background: var(--main_blue);
	box-shadow: 0 0 0 6px color-mix(in srgb, var(--main_blue) 25%, transparent);
}

.wmg-popup .mapboxgl-popup-content {
	padding: 12px 14px 14px;
	border-radius: 12px;
	box-shadow: var(--shadow-md);
	font-family: inherit;
}

.wmg-popup .mapboxgl-popup-close-button {
	font-size: 1.125em;
	color: var(--wmg-muted);
}

.wmg-pop-title {
	margin: 0 22px 4px 0;
	font-size: 0.9375em;
	font-weight: 700;
	line-height: 1.35;
}

.wmg-pop-line {
	margin: 0;
	color: var(--wmg-muted);
	font-size: 0.8125em;
	line-height: 1.45;
}

.wmg-pop-line a {
	color: var(--main_blue);
}

.wmg-pop-nav {
	display: inline-block;
	margin-top: 8px;
	padding: 6px 10px;
	border-radius: 6px;
	background: var(--wmg-pin);
	color: var(--surface-bg) !important;
	font-size: 0.8125em;
	font-weight: 700;
	text-decoration: none;
}

.wmg-pop-nav:hover {
	background: color-mix(in srgb, var(--wmg-pin) 85%, var(--main_navy));
}

.wmg-app .mapboxgl-ctrl-attrib {
	font-size: 0.6875em;
}

body.wow-map-page .wp-block-post-title,
body.wow-map-page .entry-title {
	display: none;
}

body.wow-map-page .wp-block-post-content.is-layout-constrained > .wmg-app,
body.wow-map-page .is-layout-constrained > .wmg-app {
	max-width: 100% !important;
	width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

@media (max-width: 860px) {
	.wmg-title {
		font-size: 1.625em;
	}

	.wmg-board {
		grid-template-columns: 1fr;
		height: auto;
		min-height: 0;
	}

	.wmg-stage {
		height: 420px;
	}

	.wmg-list {
		max-height: 520px;
	}

	.wmg-hint {
		font-size: 0.6875em;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wmg-app * {
		scroll-behavior: auto;
	}
}

/* Keep Mapbox UI in the same global typography and surface system. */
.wmg-app .mapboxgl-map,
.wmg-app .mapboxgl-popup-content {
	font-family: inherit;
	font-size: inherit;
	line-height: inherit;
}
.wmg-popup .mapboxgl-popup-content {
	background: var(--surface-bg);
	color: var(--wmg-ink);
}
.wmg-app .mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip { border-top-color: var(--surface-bg); }
.wmg-app .mapboxgl-popup-anchor-top .mapboxgl-popup-tip { border-bottom-color: var(--surface-bg); }
.wmg-app .mapboxgl-popup-anchor-left .mapboxgl-popup-tip { border-right-color: var(--surface-bg); }
.wmg-app .mapboxgl-popup-anchor-right .mapboxgl-popup-tip { border-left-color: var(--surface-bg); }
