/* Theme-owned MAP mobile interaction layer; LOCK v56 desktop styles remain untouched. */
.mta-map-mobile-menu-backdrop[hidden],
.mta-map-mock-rail[hidden] {
	display: none !important;
}

@media (max-width: 700px) {
	body.hub-surface-map .mta-map-mobile-canon-nav {
		display: flex !important;
		visibility: visible !important;
		position: fixed !important;
		right: max(14px, env(safe-area-inset-right)) !important;
		top: max(18px, env(safe-area-inset-top)) !important;
		z-index: 2147483640 !important;
		align-items: center !important;
		gap: 12px !important;
	}
	body.hub-surface-map .mta-map-mobile-canon-nav button {
		display: grid !important;
		width: 44px !important;
		min-width: 44px !important;
		height: 44px !important;
		place-items: center !important;
		border: 1px solid rgba(255,245,230,.30) !important;
		border-radius: 50% !important;
		background: rgba(3,10,28,.72) !important;
		color: #fff5e6 !important;
		font: 400 24px/1 sans-serif !important;
		cursor: pointer !important;
		-webkit-tap-highlight-color: transparent;
	}
	body.hub-surface-map .mta-map-mobile-canon-nav button:focus-visible {
		outline: 2px solid #ffac86 !important;
		outline-offset: 3px !important;
	}
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open {
		display: grid !important;
		visibility: visible !important;
		opacity: 1 !important;
		position: fixed !important;
		top: calc(max(18px, env(safe-area-inset-top)) + 54px) !important;
		right: max(14px, env(safe-area-inset-right)) !important;
		left: auto !important;
		z-index: 2147483639 !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 2px !important;
		width: min(286px, calc(100vw - 36px)) !important;
		max-height: min(70svh, 520px) !important;
		overflow-y: auto !important;
		padding: 10px !important;
		border: 1px solid rgba(255,245,230,.24) !important;
		border-radius: 16px !important;
		background: rgba(3,10,28,.97) !important;
		box-shadow: 0 18px 52px rgba(0,0,0,.42) !important;
		backdrop-filter: blur(18px);
		-webkit-overflow-scrolling: touch;
		opacity: 0 !important;
		transform: translateY(-6px) !important;
		transition: opacity .18s ease, transform .18s ease !important;
	}
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open.is-mobile-visible {
		opacity: 1 !important;
		transform: translateY(0) !important;
	}
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open a {
		display: flex !important;
		visibility: visible !important;
		align-items: center !important;
		min-width: 0 !important;
		min-height: 48px !important;
		padding: 0 14px !important;
		border-radius: 10px !important;
		color: #fff5e6 !important;
		font: 600 12px/1.3 sans-serif !important;
		letter-spacing: .10em !important;
		text-decoration: none !important;
	}
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open a:hover,
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open a:focus-visible {
		background: rgba(255,245,230,.12) !important;
		outline: 2px solid #ffac86 !important;
		outline-offset: -2px !important;
	}
	.mta-map-mobile-menu-backdrop {
		position: fixed;
		inset: 0;
		z-index: 2147483638;
		background: rgba(1,5,18,.42);
		opacity: 0;
		transition: opacity .18s ease;
		-webkit-tap-highlight-color: transparent;
	}
	.mta-map-mobile-menu-backdrop.is-visible { opacity: 1; }
	.mta-map-mobile-menu-open { overscroll-behavior: none; }

	/* Without JS, keep a real, horizontally scrollable route list and hide the inert toggle. */
	html:not(.mta-map-mobile-ready) body.hub-surface-map .mta-map-mobile-canon-nav button {
		display: none !important;
	}
	html:not(.mta-map-mobile-ready) body.hub-surface-map .mta-map-mock-rail {
		display: flex !important;
		visibility: visible !important;
		position: fixed !important;
		top: calc(max(18px, env(safe-area-inset-top)) + 52px) !important;
		right: 14px !important;
		left: 14px !important;
		z-index: 2147483639 !important;
		gap: 6px !important;
		overflow-x: auto !important;
		padding: 6px !important;
		border: 1px solid rgba(255,245,230,.2) !important;
		border-radius: 12px !important;
		background: rgba(3,10,28,.88) !important;
		-webkit-overflow-scrolling: touch;
	}
	html:not(.mta-map-mobile-ready) body.hub-surface-map .mta-map-mock-rail a {
		display: flex !important;
		visibility: visible !important;
		flex: 0 0 auto !important;
		align-items: center !important;
		min-height: 40px !important;
		padding: 0 10px !important;
		color: #fff5e6 !important;
		font: 600 10px/1 sans-serif !important;
		text-decoration: none !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mta-map-mobile-menu-backdrop,
	body.hub-surface-map .mta-map-mock-rail.is-mobile-open {
		transition: none !important;
	}
}

/* 3.2.13: keep the mobile hero clear of the right-hand 人・縁・出来事 axis labels at 360-430px. */
@media (max-width: 700px) {
	body.hub-surface-map .mta-map-mock-intro h1 {
		width: fit-content !important;
		max-width: calc(100vw - 76px) !important;
		/* 3.2.13-rc.2: the longest line (13 characters) stays on one line beside the axis at 360-430px. */
		font-size: min(clamp(23px, 6.6vw, 29px), calc((100vw - 94px) / 12.4)) !important;
	}
}

/* 3.2.13-rc.6: the LOCK stylesheet hides the selection panel (#selection); show it only while a person is selected. */
body.hub-surface-map .selection.on {
	display: block !important;
}
body.hub-surface-map .selection a[hidden] {
	display: none !important;
}
/* PC: right column above the CITY link, the same width as A RECORD IN THE WORLD, clear of the globe and the left stats. */
@media (min-width: 701px) {
	body.hub-surface-map .selection {
		top: auto !important;
		bottom: 100px !important;
		left: auto !important;
		right: 42px !important;
		width: 250px !important;
		padding: 18px !important;
	}
	body.hub-surface-map .selection h2 { font-size: 22px !important; }
	body.hub-surface-map .selection .seye { margin-right: 36px !important; }
}
/* Mobile: below the brand/menu row, over the heading only, so the globe, stats, search, timeline and ▶ stay uncovered. */
@media (max-width: 700px) {
	body.hub-surface-map .selection {
		top: calc(max(18px, env(safe-area-inset-top)) + 48px) !important;
		bottom: auto !important;
		left: 16px !important;
		right: 16px !important;
		width: auto !important;
		padding: 8px 12px !important;
		z-index: 2147483636 !important;
	}
	body.hub-surface-map .selection .seye { display: none !important; }
	body.hub-surface-map .selection h2 { font-size: 16px !important; margin: 0 44px 0 0 !important; }
	body.hub-surface-map .selection .smeta { font-size: 11px !important; }
	body.hub-surface-map .selection .sactions { margin-top: 6px !important; }
	body.hub-surface-map .selection a { min-height: 36px !important; }
}

/* 3.2.15-rc.2: relation deep link (/map/?edge=<id>, map-interaction.js) — a × on the LOCK context panel clears the relation. */
body.hub-surface-map .mta-canon-context .mta-edge-close {
	position: absolute;
	top: 4px;
	right: 4px;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #fff5e6;
	font: 300 22px/1 sans-serif;
	cursor: pointer;
}
body.hub-surface-map .mta-canon-context .mta-edge-close:focus-visible { outline: 1px solid #ff9c78; }
body.hub-surface-map .mta-canon-context .mta-edge-close ~ .mta-canon-context-kicker,
body.hub-surface-map .mta-canon-context .mta-edge-close ~ h2 { margin-right: 40px; }
@media (max-width: 700px) {
	html[data-map-visual-state="edge"] body.hub-surface-map .mta-canon-context nav a { min-height: 44px !important; }
}
