.is-wmd-filter-hidden { display: none !important; }

.wmd-map-user-accuracy,
.wmd-map-user-marker {
	position: absolute;
	left: var(--user-x);
	top: var(--user-y);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.wmd-survey-track {
	position: absolute;
	inset: 0;
	z-index: 4;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.wmd-survey-track polyline {
	fill: none;
	stroke: #e33b32;
	stroke-width: .7;
	stroke-linecap: round;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
	filter: drop-shadow(0 1px 1px rgba(255,255,255,.9));
}

.wmd-survey-route { position: absolute; inset: 0; z-index: 6; }
.wmd-survey-route[hidden] { display: none !important; }
.wmd-survey-route svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wmd-survey-route polyline { fill: none; stroke: #174f39; stroke-width: .55; stroke-dasharray: 1.15 .7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 1px 2px #fff); }
.wmd-survey-waypoint {
	position: absolute; width: 30px; height: 30px; padding: 0 !important;
	transform: translate(-50%, -50%); border: 2px solid #fff !important;
	border-radius: 50% !important; background: #174f39 !important; color: #fff !important;
	box-shadow: 0 2px 7px rgba(0,0,0,.6); font: 700 12px/1 Arial,sans-serif !important;
	cursor: pointer; touch-action: manipulation;
}
.wmd-survey-waypoint.is-next { background: #a64d12 !important; outline: 3px solid #fff; outline-offset: 2px; }
.wmd-survey-waypoint.is-completed { background: #756e61 !important; opacity: .72; }
.wmd-map.is-wmd-route-visible .wmd-map-marker { opacity: .18; pointer-events: none; }
.wmd-survey-route-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 14px; }
.wmd-survey-route-controls p { flex-basis: 100%; margin: 0 !important; color: #635b50; font-size: 12px; }
.wmd-survey-route-next { flex: 1 1 180px; color: #174f39; }
.wmd-survey-route-controls .wmd-survey-route-measure { background: #174f39 !important; color: #fff !important; }
.wmd-survey-route-controls [hidden] { display: none !important; }

.wmd-map-user-accuracy {
	z-index: 4;
	width: var(--accuracy-diameter);
	aspect-ratio: 1;
	border: 2px solid rgba(28, 101, 170, .72);
	border-radius: 50%;
	background: rgba(65, 142, 214, .2);
}

.wmd-map-user-marker {
	z-index: 5;
	width: 18px;
	height: 18px;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #146dc1;
	box-shadow: 0 2px 9px rgba(0, 39, 77, .55);
}

.wmd-map-attribution {
	position: absolute;
	right: 6px;
	bottom: 5px;
	z-index: 6;
	margin: 0 !important;
	padding: 3px 6px;
	border-radius: 2px;
	background: rgba(255, 255, 255, .84);
	color: #403b34 !important;
	font: 9px/1.3 Arial, sans-serif !important;
}

.wmd-location-panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 11px 16px;
}

.wmd-location-status {
	margin: 0 !important;
	color: #5d574f !important;
	font: 13px/1.45 Arial, sans-serif !important;
}

.wmd-location-debug {
	flex-basis: 100%;
	padding: 10px 12px;
	border: 1px solid #d8c598;
	border-radius: 6px;
	background: #fffdf8;
	color: #403b34;
	font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.wmd-location-debug summary { cursor: pointer; font-family: Arial, sans-serif; font-weight: 700; }
.wmd-location-debug pre { overflow: auto; margin: 9px 0; white-space: pre-wrap; }
.wmd-location-debug button { margin-right: 10px; }
.wmd-location-debug small { display: block; margin-top: 8px; font-family: Arial, sans-serif; }

.wmd-survey-panel {
	margin-top: 18px;
	padding: 18px;
	border: 1px solid #d8c598;
	border-radius: 9px;
	background: #fffdf8;
	color: #403b34;
	font: 14px/1.45 Arial, sans-serif;
}

.wmd-survey-heading {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 14px;
}

.wmd-survey-heading h3 { margin: 0 0 3px; font: 700 19px/1.2 Arial, sans-serif; }
.wmd-survey-heading p { margin: 0 !important; color: #5d574f; }
.wmd-survey-dot { flex: 0 0 auto; width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; background: #9d9588; }
.wmd-survey-panel.is-recording .wmd-survey-dot { background: #d92f28; box-shadow: 0 0 0 5px rgba(217,47,40,.13); animation: wmd-survey-pulse 1.8s infinite; }

@keyframes wmd-survey-pulse { 50% { opacity: .45; } }

.wmd-survey-idle,
.wmd-survey-anchor-form {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	flex-wrap: wrap;
}

.wmd-survey-panel label { display: grid; flex: 1 1 260px; gap: 5px; font-weight: 700; }
.wmd-survey-panel input { min-height: 42px; padding: 8px 11px; border: 1px solid #b7aa8b; border-radius: 5px; background: #fff; color: #2d2a25; font: inherit; }
.wmd-survey-panel button { min-height: 42px; }
.wmd-survey-start,
.wmd-survey-anchor { background: #174f39 !important; color: #fff !important; }
.wmd-survey-stop { margin-top: 14px; border-color: #9f2f2a !important; color: #852720 !important; }

.wmd-survey-metrics {
	display: grid;
	grid-template-columns: repeat(5, minmax(70px, 1fr));
	gap: 7px;
	margin-bottom: 12px;
}

.wmd-survey-metrics span { padding: 8px 7px; border-radius: 5px; background: #f2ead8; color: #685f51; text-align: center; font-size: 11px; }
.wmd-survey-metrics strong { display: block; color: #2f2b25; font-size: 15px; }
.wmd-survey-status { margin: 10px 0 !important; padding: 9px 11px; border-left: 3px solid #b49345; background: #f8f2e5; }
.wmd-survey-anchor-list { margin: 10px 0 0 18px !important; }
.wmd-survey-anchor-list li { margin: 3px 0; }

.wmd-mobile-map-open,
.wmd-mobile-map-toolbar,
.wmd-mobile-anchor-sheet,
.wmd-mobile-detail-sheet { display: none; }
.wmd-mobile-detail-card { display: grid; gap: 8px; }

@media (min-width: 701px) {
	.wmd-map.has-wmd-detail-overlay .wmd-map-layout > .wmd-map-detail { display: none; }
	.wmd-map-stage-shell { position: relative; }

	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-sheet {
		position: absolute;
		right: 18px;
		bottom: 18px;
		z-index: 18;
		display: block;
		width: min(390px, calc(100% - 36px));
		max-height: min(72%, 520px);
		padding: 22px 58px 22px 22px;
		overflow: auto;
		border: 1px solid #d8c598;
		border-radius: 10px;
		background: rgba(255,253,248,.98);
		color: #2f291f;
		box-shadow: 0 18px 48px rgba(34,28,19,.3);
	}

	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-sheet[hidden] { display: none; }
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-close {
		position: absolute;
		top: 10px;
		right: 10px;
		width: 38px;
		height: 38px;
		padding: 0;
		border: 1px solid #bca97e;
		border-radius: 50%;
		background: #fff;
		color: #2f291f;
		font: 700 24px/1 Arial, sans-serif;
		cursor: pointer;
	}
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-content img { width: 100%; max-height: 190px; object-fit: cover; border-radius: 7px; }
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-content .wmd-map-kicker { margin: 0 !important; color: #7d642b !important; font: 700 12px/1.3 Arial, sans-serif !important; letter-spacing: .08em; text-transform: uppercase; }
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-content h3 { margin: 0 !important; color: #174f39 !important; font: 700 24px/1.2 Arial, sans-serif; }
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-content p { margin: 0 !important; color: #3b352c !important; font: 15px/1.5 Arial, sans-serif; }
	.wmd-map-stage-shell:not(.is-wmd-fullscreen) .wmd-mobile-detail-content a { display: inline-flex; width: fit-content; margin-top: 5px; color: #174f39; font-weight: 700; }
}

@media (max-width: 700px) {
	.wmd-map-attribution { max-width: 70%; font-size: 8px !important; }
	.wmd-location-panel { align-items: flex-start; flex-direction: column; }
	.wmd-survey-panel { padding: 14px; }
	.wmd-survey-idle,
	.wmd-survey-anchor-form { align-items: stretch; flex-direction: column; }
	.wmd-survey-panel label { flex-basis: auto; width: 100%; }
	.wmd-survey-panel button { width: 100%; }
	.wmd-survey-metrics { grid-template-columns: repeat(3, 1fr); }

	.wmd-mobile-map-open {
		display: flex;
		width: 100%;
		min-height: 48px;
		align-items: center;
		justify-content: center;
		gap: 8px;
		margin-top: 10px;
		border: 1px solid rgba(255,255,255,.8);
		border-radius: 999px;
		background: rgba(255,255,255,.96);
		color: #2f291f;
		font: 700 14px/1 Arial, sans-serif;
	}

	.wmd-mobile-map-open span { font-size: 19px; }

	body.wmd-map-fullscreen-open {
		position: fixed;
		inset: 0;
		width: 100%;
		height: 100%;
		overflow: hidden;
		overscroll-behavior: none;
	}

	body.wmd-map-fullscreen-open #wpadminbar {
		visibility: hidden !important;
		pointer-events: none !important;
	}

	body > .wmd-map.is-wmd-mobile-portal {
		position: relative !important;
		z-index: 2147483000 !important;
		transform: none !important;
		filter: none !important;
		perspective: none !important;
		contain: none !important;
		isolation: auto !important;
	}

	.wmd-map-stage-shell.is-wmd-fullscreen {
		position: fixed;
		inset: 0;
		z-index: 2147483000;
		display: flex;
		width: 100vw;
		max-width: none;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		padding: 0;
		flex-direction: column;
		border: 0;
		border-radius: 0;
		background: #17140f;
		box-shadow: none;
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-stage-head,
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-scope-empty,
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-map-open { display: none !important; }

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-map-viewport {
		position: relative;
		display: block;
		width: 100%;
		height: auto;
		min-height: 0;
		flex: 1 1 auto;
		overflow: hidden;
		border: 0;
		border-radius: 0;
		background: #17140f;
		box-shadow: none;
		touch-action: none;
		overscroll-behavior: none;
		user-select: none;
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-canvas {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		max-width: none;
		height: auto;
		min-height: 0;
		margin: 0;
		transform-origin: 0 0;
		will-change: transform;
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-marker {
		width: 34px;
		height: 34px;
		font-size: 11px;
		transform: translate(-50%, -50%) scale(var(--wmd-mobile-inverse-scale, 1));
	}
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-survey-waypoint {
		width: 38px; height: 38px; font-size: 13px !important;
		transform: translate(-50%, -50%) scale(var(--wmd-mobile-inverse-scale, 1));
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-place-marker { width: 32px; height: 32px; }
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-place-marker.is-stage { width: 38px; height: 38px; }
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-user-marker { width: 20px; height: 20px; transform: translate(-50%, -50%) scale(var(--wmd-mobile-inverse-scale, 1)); }
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-map-attribution { display: none; }

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-map-toolbar {
		position: relative;
		z-index: 20;
		display: grid;
		grid-template-columns: auto 1fr auto auto;
		gap: 7px;
		padding: max(8px, env(safe-area-inset-top)) 8px 8px;
		border-bottom: 1px solid rgba(255,255,255,.18);
		background: rgba(27,22,15,.96);
		order: -1;
	}

	.wmd-mobile-map-toolbar button {
		min-width: 44px;
		min-height: 44px;
		padding: 7px 10px;
		border: 1px solid rgba(255,255,255,.28);
		border-radius: 7px;
		background: #fdf9ef;
		color: #2d281f;
		font: 700 12px/1.1 Arial, sans-serif;
	}

	.wmd-mobile-map-toolbar [data-mobile-map="close"] { display: flex; align-items: center; gap: 5px; font-size: 20px; }
	.wmd-mobile-map-toolbar [data-mobile-map="close"] span { font-size: 12px; }
	.wmd-mobile-map-toolbar [data-mobile-map="location"] { border-color: #75a38e; }
	.wmd-mobile-map-toolbar [data-mobile-map="anchor"] { border-color: #c18b82; }
	.wmd-mobile-map-toolbar [data-mobile-map="anchor"]:disabled { opacity: .78; }
	.wmd-mobile-map-route { grid-column: 1 / -1; display: flex; align-items: center; gap: 7px; color: #fff; font: 700 12px/1.3 Arial,sans-serif; }
	.wmd-mobile-map-route[hidden] { display: none !important; }
	.wmd-mobile-map-route span { flex: 1; min-width: 0; }
	.wmd-mobile-map-route button { flex: 0 0 auto; background: #174f39; color: #fff; }

	.wmd-mobile-map-zoom {
		display: grid;
		grid-template-columns: 44px minmax(68px, 1fr) 44px;
		gap: 4px;
	}

	.wmd-mobile-map-zoom button { padding-inline: 6px; font-size: 18px; }
	.wmd-mobile-map-zoom [data-mobile-map="reset"] { font-size: 11px; }

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-anchor-sheet {
		position: absolute;
		inset: auto 10px max(12px, env(safe-area-inset-bottom));
		z-index: 30;
		display: block;
		padding: 16px;
		border: 1px solid #d8c598;
		border-radius: 10px;
		background: #fffdf8;
		box-shadow: 0 15px 50px rgba(0,0,0,.48);
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-anchor-sheet[hidden] { display: none; }
	.wmd-mobile-anchor-sheet label { display: grid; gap: 6px; color: #332e26; font: 700 14px/1.3 Arial, sans-serif; }
	.wmd-mobile-anchor-sheet input { width: 100%; min-height: 48px; padding: 9px 11px; border: 1px solid #9e8c6b; border-radius: 5px; font: 16px/1.3 Arial, sans-serif; }
	.wmd-mobile-anchor-sheet div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
	.wmd-mobile-anchor-sheet button { min-height: 44px; border: 1px solid #9a7c45; border-radius: 6px; background: #fff; font-weight: 700; }
	.wmd-mobile-anchor-sheet button[type="submit"] { background: #174f39; color: #fff; }

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-detail-sheet {
		position: absolute;
		inset: auto 10px max(12px, env(safe-area-inset-bottom));
		z-index: 28;
		display: block;
		max-height: min(46vh, 390px);
		padding: 18px 52px 18px 18px;
		overflow: auto;
		border: 1px solid #d8c598;
		border-radius: 12px;
		background: rgba(255,253,248,.98);
		color: #2f291f;
		box-shadow: 0 15px 50px rgba(0,0,0,.48);
		-webkit-overflow-scrolling: touch;
	}

	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-detail-sheet[hidden] { display: none; }
	.wmd-mobile-detail-close {
		position: absolute;
		top: 8px;
		right: 8px;
		width: 38px;
		height: 38px;
		padding: 0;
		border: 1px solid #bca97e;
		border-radius: 50%;
		background: #fff;
		color: #2f291f;
		font: 700 24px/1 Arial, sans-serif;
	}
	.wmd-mobile-detail-content img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 7px; }
	.wmd-mobile-detail-content .wmd-map-kicker { margin: 0 !important; color: #7d642b; font: 700 12px/1.3 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
	.wmd-mobile-detail-content h3 { margin: 0 !important; color: #174f39; font: 700 22px/1.15 Arial, sans-serif; }
	.wmd-mobile-detail-content p { margin: 0 !important; color: #3b352c; font: 15px/1.45 Arial, sans-serif; }
	.wmd-mobile-detail-content a { display: inline-flex; width: fit-content; margin-top: 4px; color: #174f39; font-weight: 700; }
}

@media (max-width: 430px) {
	.wmd-map-stage-shell.is-wmd-fullscreen .wmd-mobile-map-toolbar { grid-template-columns: auto 1fr auto; }
	.wmd-mobile-map-toolbar [data-mobile-map="close"] span { display: none; }
	.wmd-mobile-map-toolbar [data-mobile-map="anchor"] { grid-column: 1 / -1; }
}
