.enigma-station-map {
	scroll-margin-top: 92px;
}

.enigma-station-map__container {
	display: grid;
	gap: clamp(28px, 3.6vw, 48px);
}

/* Map left, stations right. The map is sticky so choosing a station anywhere in the
   list updates it in place — the list scrolls, the map does not leave the viewport. */
.enigma-station-map__grid {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: clamp(20px, 2.6vw, 36px);
	align-items: start;
}

/* ------------------------------------------------------------------- stage */

.enigma-station-map__stage {
	position: sticky;
	top: 92px;
	background: var(--e-bg2);
	border: 1px solid var(--e-l2);
	border-radius: 20px;
	overflow: hidden;
	height: min(72vh, 620px);
}

.enigma-station-map__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
}

.enigma-station-map__note {
	position: absolute;
	left: 20px;
	top: 20px;
	pointer-events: none;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 1;
}

.enigma-station-map__note img {
	width: 13px;
	height: auto;
	display: block;
	opacity: .8;
}

.enigma-station-map__note span {
	font-size: 9.5px;
	font-weight: 800;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--e-m4);
}

/* -------------------------------------------------------------- station list */

.enigma-station-map__list {
	min-width: 0;
	padding: clamp(20px, 2.2vw, 28px);
	background: var(--e-bg2);
	border: 1px solid var(--e-l2);
	border-radius: 20px;
}

.enigma-station-map__list-label {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--e-m4);
	margin-bottom: 14px;
}

.enigma-station-map__region + .enigma-station-map__region {
	margin-top: 26px;
}

.enigma-station-map__region-head {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--e-l2);
	margin-bottom: 6px;
}

.enigma-station-map__region-no {
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .2em;
	color: var(--e-accent);
	font-variant-numeric: tabular-nums;
}

.enigma-station-map__region-title {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--e-ink);
	text-wrap: pretty;
}

.enigma-station-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	padding: 13px 12px;
	border: 0;
	border-bottom: 1px solid var(--e-l1);
	border-radius: 10px;
	background: transparent;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
	transition: background 200ms ease;
}

.enigma-station-row:hover {
	background: rgba(38, 169, 224, .09);
}

.enigma-station-row.is-selected {
	background: rgba(38, 169, 224, .16);
}

.enigma-station-row:focus-visible {
	outline: 2px solid var(--e-accent);
	outline-offset: -2px;
}

.enigma-station-row__text {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.enigma-station-row__name {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .01em;
	line-height: 1.3;
	color: var(--e-text);
	text-wrap: pretty;
}

.enigma-station-row.is-selected .enigma-station-row__name {
	color: var(--e-ink);
}

.enigma-station-row__region {
	font-size: 11px;
	font-weight: 500;
	line-height: 1.45;
	color: var(--e-m4);
	text-wrap: pretty;
}

.enigma-station-row__coords {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--e-m5);
	font-variant-numeric: tabular-nums;
}

.enigma-station-row__codes {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 3px;
}

.enigma-station-row__code {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .13em;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--e-m2);
}

.enigma-station-row.is-selected .enigma-station-row__code {
	color: var(--e-accent);
}

.enigma-station-row__icao {
	font-size: 9.5px;
	font-weight: 700;
	letter-spacing: .14em;
	white-space: nowrap;
	color: var(--e-m5);
	font-variant-numeric: tabular-nums;
}

/* -------------------------------------------------------------- responsive */

@media (max-width: 980px) {
	.enigma-station-map__grid {
		grid-template-columns: 1fr;
	}

	/* Single column: the map pins to the top of the viewport and the list scrolls
	   underneath it, so a selection is still visible without scrolling back up. */
	.enigma-station-map__stage {
		top: 72px;
		height: 46vh;
		min-height: 280px;
		z-index: 2;
	}
}

@media (max-width: 600px) {
	.enigma-station-map__stage {
		height: 40vh;
		min-height: 240px;
	}

	.enigma-station-map__list {
		padding: 16px;
	}
}

/* A sticky pane that cannot scroll with the page is worse than none at all when the
   viewport is short. */
@media (max-height: 560px) {
	.enigma-station-map__stage {
		position: static;
		height: 320px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.enigma-station-row {
		transition: none;
	}
}
