.wanmxd-map-viewer {
	--map-viewer-header-height: 0px;
	--wanmxd-card-side-padding: 18px;
	--wanmxd-card-preview-top: 14px;
	--wanmxd-card-section-bottom: 14px;
	--wanmxd-card-section-title-top: 14px;
	--wanmxd-card-section-title-bottom: 10px;
	position: fixed;
	z-index: 0;
	left: 0;
	top: 0;
	width: 100vw;
	min-width: 960px;
	height: 100vh;
	height: 100dvh;
	margin: 0;
	touch-action: manipulation;
}

body.wanmxd-map-viewer-page {
	overflow: hidden;
}

body.wanmxd-map-viewer-page > .container-md:first-child {
	position: relative;
	z-index: 1030;
}

.wanmxd-map-viewer__floating {
	position: absolute;
	z-index: 70;
}

.wanmxd-map-viewer__floating--top-left { top: calc(var(--map-viewer-header-height) + 22px); left: 24px; width: 900px; max-width: calc(100vw - 48px); }
.wanmxd-map-viewer__floating--bottom-left { bottom: 14px; left: 20px; margin: 0; padding: 6px 10px; border-radius: 4px; background: rgba(255, 255, 255, .78); color: #526d80; font-size: 13px; pointer-events: none; }
.wanmxd-map-viewer__floating--bottom-right { right: 22px; bottom: 18px; }
.wanmxd-map-viewer__hint-mobile { display: none; }

.wanmxd-map-viewer__heading-row { display: flex; align-items: center; gap: 12px; }
.wanmxd-map-viewer__title { margin: 0; color: #123b59; font-size: 30px; font-weight: 700; line-height: 1.2; text-shadow: 0 1px 2px rgba(255, 255, 255, .9); white-space: nowrap; }
.wanmxd-map-viewer__search-wrap { position: relative; min-width: 300px; flex: 1 1 360px; }
.wanmxd-map-viewer__search { width: 100%; }
.wanmxd-map-viewer__search:disabled { background: rgba(255, 255, 255, .92); color: #7890a1; cursor: default; opacity: 1; }
.wanmxd-map-viewer__suggestions { position: absolute; z-index: 90; top: calc(100% + 5px); left: 0; width: 100%; max-height: 380px; overflow-y: auto; background: #fff; }
.wanmxd-map-viewer__suggestion { display: flex; align-items: center; justify-content: space-between; gap: 20px; text-align: left; }
.wanmxd-map-viewer__suggestion small { display: block; margin-top: 2px; color: #6c757d; }
.wanmxd-map-viewer__suggestion-layout { flex: 0 0 auto; color: #607d91; font-size: 13px; }
.wanmxd-map-viewer__scale { min-width: 64px; }

.wanmxd-map-viewer__toast { position: absolute; z-index: 100; top: calc(var(--map-viewer-header-height) + 18px); left: 50%; min-width: 320px; transform: translateX(-50%); background: rgba(20, 54, 78, .94); color: #fff; }
.wanmxd-map-viewer__empty { position: absolute; z-index: 40; top: 50%; left: 50%; width: min(620px, calc(100% - 60px)); margin: 0; transform: translate(-50%, -50%); text-align: center; font-size: 18px; }

.wanmxd-map-viewer__viewport {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	border: 0;
	border-radius: 0;
	background-color: #dce8f1;
	box-shadow: inset 0 1px 4px rgba(24, 62, 88, .08);
	cursor: grab;
	user-select: none;
	touch-action: none;
}

.wanmxd-map-viewer__viewport.is-panning {
	cursor: grabbing;
}

.wanmxd-map-viewer__world {
	position: absolute;
	z-index: 2;
	left: 0;
	top: 0;
	width: 1px;
	height: 1px;
	transform-origin: 0 0;
}

.wanmxd-map-viewer__world::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: -50000px;
	left: -50000px;
	width: 100000px;
	height: 100000px;
	background-image: radial-gradient(#abc4d6 1.5px, transparent 1.5px);
	background-size: 48px 48px;
	pointer-events: none;
}

.wanmxd-map-viewer__lines {
	position: absolute;
	z-index: 20;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: visible;
	pointer-events: none;
}

.wanmxd-map-viewer__loading {
	position: absolute;
	z-index: 30;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: rgba(241, 247, 251, .9);
}

.wanmxd-map-viewer__loading p {
	margin: 12px 0 0;
	color: #45657a;
}

.wanmxd-map-viewer__loading.is-hidden {
	display: none;
}

.wanmxd-map-viewer__error {
	position: absolute;
	z-index: 40;
	top: 20px;
	left: 50%;
	width: min(680px, calc(100% - 40px));
	transform: translateX(-50%);
}

.wanmxd-map-viewer__card {
	position: absolute;
	box-sizing: border-box;
	min-height: 300px;
	overflow: visible;
	border-radius: 18px;
}

.wanmxd-map-viewer__card.is-search-highlight {
	animation: wanmxd-map-viewer-highlight .55s ease-in-out 4;
}

@keyframes wanmxd-map-viewer-highlight {
	0%, 100% { border-color: #adc2d1; box-shadow: 0 3px 10px rgba(35, 68, 91, .15); }
	50% { border-color: #ff9f1c; box-shadow: 0 0 0 5px rgba(255, 159, 28, .36), 0 4px 16px rgba(35, 68, 91, .22); }
}

.wanmxd-map-viewer__card-header {
	gap: 20px;
	padding: 18px var(--wanmxd-card-side-padding);
	border-bottom: 0;
	border-radius: 17px 17px 0 0;
}

.wanmxd-map-viewer__card-name {
	color: #113b5a;
	font-size: 23px;
	font-weight: 700;
	line-height: 1.25;
}

.wanmxd-map-viewer__card-name:hover {
	color: #007bff;
	text-decoration: none;
}

.wanmxd-map-viewer__card-meta {
	flex: 0 0 auto;
	color: #607d91;
	font-size: 17px;
	line-height: 1.55;
	text-align: right;
}

.wanmxd-map-viewer__preview-wrap {
	position: relative;
	margin: var(--wanmxd-card-preview-top) var(--wanmxd-card-side-padding) 0;
	overflow: hidden;
	object-fit: contain;
	border: 1px solid #d5e2eb;
	border-radius: 12px;
	background: #f7fafc;
}

.wanmxd-map-viewer__preview-wrap > a {
	display: block;
}

.wanmxd-map-viewer__preview {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
}

.wanmxd-map-viewer__section {
	padding: 0 var(--wanmxd-card-side-padding) var(--wanmxd-card-section-bottom);
}

.wanmxd-map-viewer__section-title {
	margin: var(--wanmxd-card-section-title-top) 0 var(--wanmxd-card-section-title-bottom);
	color: #607d91;
	font-size: 21px;
	font-weight: 500;
}

.wanmxd-map-viewer__entities {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.wanmxd-map-viewer__entity {
	position: relative;
	display: flex;
	width: 74px;
	flex-direction: column;
	align-items: center;
	color: #526d80;
	font-size: 14px;
	text-align: center;
}

.wanmxd-map-viewer__entity:hover {
	color: #007bff;
	text-decoration: none;
}

.wanmxd-map-viewer__entity-image {
	display: flex;
	box-sizing: border-box;
	width: 74px;
	height: 74px;
	align-items: center;
	justify-content: center;
	border: 2px solid #d4e3ed;
	border-radius: 12px;
	background: #fff;
}

.wanmxd-map-viewer__entity-image img {
	max-width: 66px;
	max-height: 66px;
	object-fit: contain;
}

.wanmxd-map-viewer__entity-name {
	width: 100%;
	margin-top: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wanmxd-map-viewer__entity-count {
	position: absolute;
	top: 54px;
	right: -6px;
	min-width: 24px;
	border: 2px solid #fff;
	font-size: 14px;
}

.wanmxd-map-viewer__section.is-npc .wanmxd-map-viewer__entities {
	gap: 10px;
}

.wanmxd-map-viewer__section.is-npc .wanmxd-map-viewer__entity {
	width: 58px;
	font-size: 13px;
}

.wanmxd-map-viewer__section.is-npc .wanmxd-map-viewer__entity-image {
	width: 58px;
	height: 58px;
	border-radius: 10px;
}

.wanmxd-map-viewer__section.is-npc .wanmxd-map-viewer__entity-image img {
	max-width: 50px;
	max-height: 50px;
}

.wanmxd-map-viewer__annotation {
	position: absolute;
	box-sizing: border-box;
	width: max-content;
	max-width: 420px;
	padding: 12px 16px;
	border: 1px solid #d6b656;
	border-radius: 8px;
	background: #fff8cf;
	box-shadow: 0 2px 8px rgba(25, 61, 89, .16);
	color: #493d18;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.4;
	white-space: pre-wrap;
	word-break: break-word;
}

a.wanmxd-map-viewer__annotation:hover {
	color: #4f390d;
	text-decoration: underline;
}

a.wanmxd-map-viewer__annotation:focus-visible {
	outline: 3px solid rgba(0, 123, 255, .45);
	outline-offset: 3px;
}

.wanmxd-map-viewer__route-shadow {
	stroke: #fff;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
}

.wanmxd-map-viewer__route-line {
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
	transition: stroke-width .15s, filter .15s;
}

.wanmxd-map-viewer__route-hit-area {
	fill: none;
	stroke: transparent;
	pointer-events: stroke;
	cursor: pointer;
}

.wanmxd-map-viewer__route.is-bidirectional .wanmxd-map-viewer__route-line,
.wanmxd-map-viewer__portal-dot.is-bidirectional {
	stroke: #3b82b8;
	fill: #3b82b8;
}

.wanmxd-map-viewer__route.is-one-way .wanmxd-map-viewer__route-line {
	stroke: #e07a2d;
}

.wanmxd-map-viewer__portal-dot.is-one-way {
	fill: #e07a2d;
}

.wanmxd-map-viewer__route.is-active .wanmxd-map-viewer__route-line {
	filter: drop-shadow(0 0 4px rgba(30, 94, 138, .55));
}

.wanmxd-map-viewer__portal-dot {
	stroke: #fff !important;
	pointer-events: none;
	cursor: pointer;
}

.wanmxd-map-viewer__portal-hit-area {
	fill: transparent;
	stroke: none;
	pointer-events: all;
	cursor: pointer;
}

.wanmxd-map-viewer__arrow {
	fill: #e07a2d;
	stroke: #fff;
	stroke-linejoin: round;
	pointer-events: none;
}

.wanmxd-map-viewer__arrow.is-bidirectional {
	fill: #3b82b8;
}

.wanmxd-map-viewer__tooltip {
	position: absolute;
	z-index: 50;
	margin: 0;
	pointer-events: none;
}

.wanmxd-map-viewer__tooltip .tooltip-inner {
	max-width: 260px;
}

.wanmxd-map-viewer__tooltip-content {
	text-align: left;
}

.wanmxd-map-viewer__tooltip-status {
	font-weight: 600;
}

.wanmxd-map-viewer__tooltip-map + .wanmxd-map-viewer__tooltip-map {
	margin-top: .15rem;
}

.map-visualization-tooltip .tooltip-inner {
	padding: .45rem .65rem;
	text-align: center;
}

.map-visualization-tooltip small {
	opacity: .82;
}

@media (max-width: 767.98px), (hover: none) and (pointer: coarse) {
	.wanmxd-map-viewer {
		width: 100%;
		min-width: 0;
		height: 100vh;
		height: 100dvh;
	}

	.wanmxd-map-viewer__floating--top-left {
		top: calc(var(--map-viewer-header-height) + 10px);
		left: 10px;
		width: calc(100% - 20px);
		max-width: none;
	}

	.wanmxd-map-viewer__heading-row {
		flex-wrap: wrap;
		gap: 8px;
	}

	.wanmxd-map-viewer__title {
		font-size: 22px;
	}

	.wanmxd-map-viewer__heading-row .dropdown {
		flex: 0 0 auto;
	}

	.wanmxd-map-viewer__heading-row .dropdown-toggle {
		max-width: 120px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.wanmxd-map-viewer__search-wrap {
		width: 100%;
		min-width: 0;
		flex: 1 0 100%;
	}

	.wanmxd-map-viewer__suggestions {
		max-height: min(42dvh, 320px);
	}

	.wanmxd-map-viewer__suggestion {
		gap: 10px;
		padding-right: .75rem;
		padding-left: .75rem;
	}

	.wanmxd-map-viewer__suggestion-layout {
		max-width: 34%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.wanmxd-map-viewer__floating--bottom-left {
		bottom: max(6px, env(safe-area-inset-bottom));
		left: 10px;
		width: max-content;
		max-width: calc(100% - 16px);
		padding: 4px 7px;
		transform: none;
		font-size: 11px;
		line-height: 1.25;
		white-space: nowrap;
	}

	.wanmxd-map-viewer__hint-desktop { display: none; }
	.wanmxd-map-viewer__hint-mobile { display: inline; }

	.wanmxd-map-viewer__floating--bottom-right {
		right: 10px;
		bottom: max(6px, env(safe-area-inset-bottom));
	}

	.wanmxd-map-viewer__floating--bottom-right .btn {
		min-width: 42px;
		min-height: 42px;
	}

	.wanmxd-map-viewer__scale {
		min-width: 62px !important;
	}

	.wanmxd-map-viewer__toast {
		top: calc(var(--map-viewer-header-height) + 8px);
		width: calc(100% - 24px);
		min-width: 0;
	}

	.wanmxd-map-viewer__tooltip .tooltip-inner {
		max-width: min(260px, calc(100vw - 24px));
	}
}

@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
	.wanmxd-map-viewer__heading-row {
		flex-wrap: nowrap;
	}

	.wanmxd-map-viewer__search-wrap {
		width: auto;
		min-width: 0;
		flex: 1 1 auto;
	}
}
