/**
 * The National Atlas — /atlas
 *
 * Every colour, radius and shadow here is an ElectIndex token. Nothing is
 * hardcoded, so the Atlas follows the site into dark mode with the rest of the
 * page and a change to the design system reaches it for free. The namespace is
 * .ei-at-*; the Supporter gate deliberately reuses .ei-brief-gate so the wall
 * looks identical to the one on The Brief and the Map tab.
 *
 * Layout is the site's app-workspace pattern (Simulator, Shuffler, Map Tool):
 * full-bleed below the header, no page scroll on desktop, the map taking every
 * pixel that the chrome does not need.
 */

/* Full-bleed app chrome. templates/page-atlas.html wraps the content in
   .ei-atlas-page and omits the post title, the same way the Map Tool and the
   Simulator do; without this the theme's content width boxes the map in and the
   flex chain collapses its height to zero. */
.ei-atlas-page { margin: 0; padding: 0; background: var(--ei-bg); }
.ei-atlas-page .wp-block-post-content,
.ei-atlas-page .entry-content { max-width: none; margin: 0; padding: 0; }
.ei-page-atlas .ei-at-root { max-width: none; padding: 0; }

/* border-box for the whole namespace: the theme does not set it universally,
   so a width:100% row with .5rem side padding measured 342px in a 330px rail
   and dragged a horizontal scrollbar under the entire list. */
.ei-at-root *, .ei-at-root *::before, .ei-at-root *::after { box-sizing: border-box; }

/* Basemap tokens — on :root so the map module's cssVar() helper resolves them.
   Water sits a step BELOW the land tone in both themes, so the coastline reads
   as land-against-sea; roads are a translucent neutral that stays legible over
   any choropleth fill without competing with it. */
:root {
	--ei-at-water: #dfe7f0;
	--ei-at-road: rgba(71, 90, 120, 0.34);
}
[data-theme="dark"] {
	/* Three visible steps against the page (#0d1117): water lifts a shade
	   above it, land two — the coastline has to survive the dark theme. */
	--ei-at-water: #141f31;
	--ei-at-road: rgba(172, 196, 228, 0.34);
}
/* The SEO prose sits below the app and keeps normal reading measure. */
.ei-page-atlas .ei-seo__inner { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.25rem; }

.ei-at-app {
	display: flex;
	height: calc(100vh - var(--ei-header-h));
	background: var(--ei-bg);
	color: var(--ei-text);
	overflow: hidden;
}

/* The map region: everything that floats (legend, readout, gate, cities)
   floats over THIS, never over the rail. */
.ei-at-mapwrap { position: relative; flex: 1 1 auto; min-width: 0; }
.ei-at-app .ei-at-canvas { position: absolute; inset: 0; height: auto; }
.ei-at-canvas canvas { outline: none; }

/* ---------- the side rail ---------- */

.ei-at-side {
	display: flex;
	flex-direction: column;
	flex: 0 0 330px;
	width: 330px;
	min-height: 0;
	background: var(--ei-surface);
	border-right: 1px solid var(--ei-border);
	transition: width .22s ease, flex-basis .22s ease;
	overflow: hidden;
}
/* Collapsed: a slim spine holding only the expand control; the map takes the
   rest of the width the moment the transition ends. */
.ei-at-app.is-collapsed .ei-at-side { flex-basis: 46px; width: 46px; }
.ei-at-app.is-collapsed .ei-at-side .ei-at-brand,
.ei-at-app.is-collapsed .ei-at-side .ei-at-panel__body { display: none; }
.ei-at-app.is-collapsed .ei-at-panel__head {
	justify-content: center;
	padding: .6rem .35rem;
	border-bottom: 0;
}
.ei-at-app.is-collapsed .ei-at-collapse span {
	transform: rotate(-135deg) translate(-1px, 1px);
}

.ei-at-panel__head {
	display: flex;
	align-items: flex-start;
	gap: .5rem;
	padding: .85rem .95rem .7rem;
	border-bottom: 1px solid var(--ei-border);
}
.ei-at-brand { flex: 1 1 auto; min-width: 0; }
.ei-at-brand__title {
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.15;
	font-weight: 700;
	color: var(--ei-heading);
}

.ei-at-collapse {
	flex: 0 0 auto;
	display: grid;
	place-items: center;
	width: 26px; height: 26px;
	background: none;
	border: 1px solid var(--ei-border);
	border-radius: var(--ei-radius);
	cursor: pointer;
}
.ei-at-collapse:hover { background: var(--ei-surface-2); }
.ei-at-collapse span {
	width: 8px; height: 8px;
	border-left: 1.6px solid var(--ei-muted);
	border-bottom: 1.6px solid var(--ei-muted);
	transform: rotate(45deg) translate(1px, -1px);
	transition: transform .18s ease;
}
.ei-at-panel__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	overflow: hidden;
}

/* The active layer, stated where the eye already is. */
.ei-at-now { padding: .6rem .95rem; border-bottom: 1px solid var(--ei-border); }
.ei-at-now__lab {
	margin: 0;
	font-size: .62rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ei-muted);
}
.ei-at-now__val {
	margin: .1rem 0 0;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--ei-heading);
}
.ei-at-now__floor {
	display: inline-block;
	margin-top: .3rem;
	padding: .08rem .42rem;
	font-size: .62rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ei-gold-ink);
	background: var(--ei-gold-bg);
	border: 1px solid var(--ei-gold-border);
	border-radius: 999px;
}

.ei-at-picker { display: flex; flex-direction: column; min-height: 0; }

.ei-at-search { padding: .7rem .95rem .55rem; }
.ei-at-search__input {
	width: 100%;
	padding: .45rem .7rem;
	font: inherit;
	font-size: .84rem;
	color: var(--ei-text);
	background: var(--ei-field);
	border: 1px solid var(--ei-field-border);
	border-radius: var(--ei-radius);
	outline: none;
}
.ei-at-search__input:focus {
	border-color: var(--ei-navy);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ei-navy) 18%, transparent);
}
.ei-at-search__input::placeholder { color: var(--ei-muted); }

.ei-at-list {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	/* Never sideways: overflow-y:auto makes the x-axis compute to auto too, so
	   one long row put a horizontal scrollbar under the whole rail. Rows
	   truncate instead (see .ei-at-layer__label). */
	overflow-x: hidden;
	overscroll-behavior: contain;   /* don't scroll the page when the list ends */
	padding: 0 .45rem .9rem;
}

.ei-at-group {
	display: flex;
	align-items: center;
	gap: .5rem;
	width: 100%;
	padding: .5rem .5rem;
	margin-top: .25rem;
	font: inherit;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--ei-heading);
	background: none;
	border: 0;
	border-radius: var(--ei-radius);
	cursor: pointer;
	text-align: left;
}
.ei-at-group:hover { background: var(--ei-surface-2); }
.ei-at-group__name { flex: 1 1 auto; }
.ei-at-group__chev {
	flex: 0 0 auto;
	width: 7px; height: 7px;
	border-right: 1.6px solid var(--ei-muted);
	border-bottom: 1.6px solid var(--ei-muted);
	transform: rotate(-45deg);
	transition: transform .16s ease;
}
.ei-at-group.is-open .ei-at-group__chev { transform: rotate(45deg); }

.ei-at-groupbody { padding-bottom: .35rem; }

.ei-at-sub {
	margin: .5rem 0 .12rem;
	padding: 0 .5rem;
	font-size: .65rem;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
	color: var(--ei-muted);
}

.ei-at-layer {
	display: flex;
	align-items: center;
	gap: .45rem;
	width: 100%;
	padding: .34rem .5rem;
	font: inherit;
	font-size: .82rem;
	line-height: 1.3;
	color: var(--ei-text);
	background: none;
	border: 0;
	border-left: 2px solid transparent;
	border-radius: 0 var(--ei-radius) var(--ei-radius) 0;
	cursor: pointer;
	text-align: left;
}
.ei-at-layer:hover { background: var(--ei-surface-2); }
.ei-at-layer.is-active {
	background: color-mix(in srgb, var(--ei-navy) 14%, transparent);
	border-left-color: var(--ei-navy);
	color: var(--ei-heading);
	font-weight: 600;
}
.ei-at-layer__label {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
/* Gold is the site's premium signal (The Brief, Forecast+). A locked layer
   carries it so the wall reads as "Supporter", not "broken". */
.ei-at-layer__lock { flex: 0 0 auto; display: inline-flex; color: var(--ei-gold-ink); }
.ei-at-layer__cov {
	flex: 0 0 auto;
	padding: .04rem .32rem;
	font-size: .6rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ei-muted);
	border: 1px dashed var(--ei-field-border);
	border-radius: 999px;
}

/* The kind tag: "margin" / "votes cast", split off the row name so 184
   election rows stop all ending in the same em-dash suffix. */
.ei-at-layer__kind {
	flex: 0 0 auto;
	padding: .04rem .3rem;
	font-size: .58rem;
	font-weight: 600;
	color: var(--ei-muted);
	background: var(--ei-surface-2);
	border-radius: 999px;
}
.ei-at-layer.is-active .ei-at-layer__kind {
	background: color-mix(in srgb, var(--ei-navy) 18%, transparent);
	color: var(--ei-heading);
}
.ei-at-empty { padding: .9rem .5rem; font-size: .83rem; color: var(--ei-muted); }

.ei-at-list {
	scrollbar-width: thin;
	scrollbar-color: color-mix(in srgb, var(--ei-muted) 40%, transparent) transparent;
}

/* ---------- the Display disclosure ---------- */

.ei-at-display { border-bottom: 1px solid var(--ei-border); }
.ei-at-display__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: .5rem .95rem;
	font: inherit;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--ei-heading);
	background: none;
	border: 0;
	cursor: pointer;
	text-align: left;
}
.ei-at-display__head:hover { background: var(--ei-surface-2); }
.ei-at-display.is-open .ei-at-display__head .ei-at-group__chev { transform: rotate(45deg); }
.ei-at-display__body { display: none; padding: .1rem .95rem .65rem; }
.ei-at-display.is-open .ei-at-display__body { display: block; }

.ei-at-disprow {
	display: flex;
	align-items: center;
	gap: .55rem;
	margin: .45rem 0 0;
	font-size: .76rem;
	color: var(--ei-text);
}
/* One label column for every row in the rail — wide enough that "Break down"
   and "Base map" never wrap, so the controls line up on a grid. */
.ei-at-disprow__lab {
	flex: 0 0 auto;
	width: 6.4em;
	white-space: nowrap;
	color: var(--ei-muted);
}
.ei-at-disprow__range { flex: 1 1 auto; min-width: 0; accent-color: var(--ei-navy); }
.ei-at-disprow__val {
	flex: 0 0 auto;
	width: 2.6em;
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: var(--ei-muted);
}
.ei-at-check {
	display: inline-flex;
	align-items: center;
	gap: .28rem;
	cursor: pointer;
}
.ei-at-check input {
	accent-color: var(--ei-navy);
	margin: 0;
	width: 13px;
	height: 13px;
}

/* Selects inside rows: sized to the row's type scale, not the page's. */
.ei-at-disprow .ei-at-vintage,
.ei-at-disprow .ei-at-infsel,
.ei-at-disprow .ei-at-scheme {
	margin-top: 0;
	padding: .3rem .5rem;
	font-size: .76rem;
}
.ei-at-disprow__range { height: 14px; }
.ei-at-inf .ei-at-ei__years { margin: .5rem 0 .1rem; }

/* ---------- MapLibre controls, in ElectIndex clothes ---------- */

.ei-at-app .maplibregl-ctrl-group {
	background: color-mix(in srgb, var(--ei-bg) 88%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid var(--ei-border);
	border-radius: var(--ei-radius);
	box-shadow: var(--ei-shadow);
	overflow: hidden;
}
.ei-at-app .maplibregl-ctrl-group button {
	width: 30px;
	height: 30px;
	display: grid;
	place-items: center;
	background: transparent;
	color: var(--ei-text);
}
.ei-at-app .maplibregl-ctrl-group button + button { border-top: 1px solid var(--ei-border); }
.ei-at-app .maplibregl-ctrl-group button:hover { background: var(--ei-surface-2); }
/* MapLibre's zoom glyphs are dark background-image SVGs; invert them in dark
   mode. The fit button draws with currentColor and needs nothing. */
[data-theme="dark"] .ei-at-app .maplibregl-ctrl button .maplibregl-ctrl-icon {
	filter: invert(1);
}

/* ---------- legend ---------- */

.ei-at-legend {
	position: absolute;
	/* Bottom-RIGHT: the panel owns the left edge and may run the full height,
	   so a bottom-left legend sat on top of the layer list. Zoom controls
	   moved to top-right to clear this corner. */
	right: 1rem;
	bottom: 1rem;
	z-index: 3;
	width: 248px;
	padding: .8rem .9rem;
	background: var(--ei-bg);
	border: 1px solid var(--ei-border);
	border-radius: var(--ei-radius-lg);
	box-shadow: var(--ei-shadow-lg);
	pointer-events: none;
}
.ei-at-legend.is-loading { opacity: .55; }
.ei-at-legend.is-hidden { display: none; }

.ei-at-legend__trow {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: .5rem;
}
/* The container stays pointer-events:none so the map works around the card;
   only the button itself accepts the click. */
.ei-at-legend__i {
	pointer-events: auto;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
	display: grid;
	place-items: center;
	/* line-height 0 collapses the glyph's line box so grid centering centres
	   the GLYPH, not a taller text box — the i sat visibly low without it. */
	font: italic 700 .66rem/0 Georgia, serif;
	color: var(--ei-muted);
	background: none;
	border: 1px solid var(--ei-border);
	border-radius: 50%;
	cursor: pointer;
}
.ei-at-legend__i:hover { color: var(--ei-heading); border-color: var(--ei-muted); }
.ei-at-legend.is-info .ei-at-legend__i {
	background: color-mix(in srgb, var(--ei-navy) 16%, transparent);
	color: var(--ei-heading);
}
/* The fold button is a minus sign, not prose: no italic serif. */
.ei-at-legend__fold {
	font-family: inherit;
	font-style: normal;
	font-size: .8rem;
}

.ei-at-legend__info {
	display: none;
	margin-top: .55rem;
	padding-top: .5rem;
	border-top: 1px solid var(--ei-border);
}
.ei-at-legend.is-info .ei-at-legend__info { display: block; }
.ei-at-legend__info p {
	margin: 0 0 .4rem;
	font-size: .7rem;
	line-height: 1.45;
	color: var(--ei-muted);
}
.ei-at-legend__info p:last-child { margin-bottom: 0; }
.ei-at-legend__title {
	margin: 0 0 .3rem;
	flex: 1 1 auto;
	font-size: .88rem;
	font-weight: 700;
	color: var(--ei-heading);
}
.ei-at-legend__desc {
	margin: .55rem 0 0;
	font-size: .7rem;
	line-height: 1.4;
	color: var(--ei-muted);
}
.ei-at-scale { display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.ei-at-scale__sw { flex: 1 1 0; }
.ei-at-scale__ends {
	display: flex;
	justify-content: space-between;
	margin-top: .3rem;
	font-size: .7rem;
	font-variant-numeric: tabular-nums;
	color: var(--ei-muted);
}
.ei-at-legend__meta {
	margin: .5rem 0 0;
	font-size: .7rem;
	line-height: 1.45;
	color: var(--ei-muted);
}
.ei-at-nodata { display: inline-flex; align-items: center; gap: .25rem; }
.ei-at-nodata i {
	width: 9px; height: 9px;
	background: var(--ei-map-nodata);
	border: 1px solid var(--ei-border);
	border-radius: 2px;
}

/* ---------- hover readout ---------- */

/* The hover readout wears the forecast viewer's own map-tooltip anatomy
   (.ei-fc-tip in style.css): fixed navy card in BOTH themes, an uppercase
   eyebrow naming the unit, the place as the title, party/category-toned
   data rows and muted foot rows — so a tooltip on the Atlas reads like a
   tooltip on a race page. */
.ei-at-read {
	position: absolute;
	top: 0; left: 0;
	z-index: 4;
	min-width: 175px;
	max-width: 250px;
	padding: .6rem .75rem;
	background: var(--ei-navy-deep, #122a4f);
	color: #fff;
	border-radius: 10px;
	box-shadow: 0 12px 30px rgba(0, 0, 0, .3);
	font-size: .82rem;
	line-height: 1.45;
	pointer-events: none;
	will-change: transform;
}
.ei-at-read[hidden] { display: none; }
.ei-at-read__eyebrow {
	font-size: .62rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	opacity: .55;
}
.ei-at-read__title { display: block; color: #fff; margin: 0 0 .1rem; }
.ei-at-read__row {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: baseline;
}
.ei-at-read__row b {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}
.ei-at-read__row--foot span { opacity: .6; font-weight: 400; }
.ei-at-read__row--foot b { font-weight: 600; opacity: .92; }
.ei-at-read__muted { opacity: .6; }

/* ---------- the Supporter gate ---------- */

.ei-at-gatewrap {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	padding: 1.5rem;
	background: color-mix(in srgb, var(--ei-bg) 82%, transparent);
	backdrop-filter: blur(3px);
	overflow-y: auto;
}
.ei-at-gatewrap[hidden] { display: none; }
.ei-at-gate { max-width: 520px; }

.ei-at-fail { padding: 3rem 1.5rem; text-align: center; color: var(--ei-muted); }
.ei-at-fail__why { font-size: .8rem; }

/* ---------- mobile: the map is the page ---------- */

@media (max-width: 760px) {
	.ei-at-app { flex-direction: column; height: calc(100vh - var(--ei-header-h)); }
	.ei-at-side {
		flex: 0 0 auto;
		width: 100%;
		max-height: 46vh;
		border-right: 0;
		border-bottom: 1px solid var(--ei-border);
	}
	.ei-at-app.is-collapsed .ei-at-side { width: 100%; flex-basis: auto; max-height: 44px; }
	.ei-at-mapwrap { flex: 1 1 auto; }
	.ei-at-legend {
		left: .6rem; right: .6rem; bottom: .6rem;
		width: auto;
	}
	/* A tooltip chasing a finger it cannot see is noise. */
	.ei-at-read { display: none; }
	/* Pinch zooms; corner buttons only cover the map on a phone. */
	.ei-at-app .maplibregl-ctrl-top-right { display: none; }
}

/* ---------- data credits (below the app) ----------
   The Simulator's credit idiom, verbatim: the subset of simulator.css's
   .ei-sim-cr* rules this page needs, since simulator.css does not load here.
   Scoped under .ei-sim-crs for the same reason the original documents:
   `.ei-seo p` beats a bare single-class selector. */

.ei-sim-crs { margin: .9rem 0 1.4rem; }
.ei-sim-crs .ei-sim-cr { border-top: 1px solid var(--ei-border); position: relative; }
.ei-sim-crs .ei-sim-cr:last-of-type { border-bottom: 1px solid var(--ei-border); }
.ei-sim-crs .ei-sim-cr__head {
	display: flex; align-items: baseline; gap: .55rem;
	padding: .85rem 0; cursor: pointer; list-style: none;
}
.ei-sim-crs .ei-sim-cr__head::-webkit-details-marker { display: none; }
.ei-sim-crs .ei-sim-cr__head:focus-visible { outline: 2px solid var(--ei-navy); outline-offset: 3px; }
.ei-sim-crs .ei-sim-cr__label {
	font-weight: 800; font-size: 1.02rem; letter-spacing: -.01em; color: var(--ei-heading);
}
.ei-sim-crs .ei-sim-cr__count {
	margin-left: auto; font-size: .78rem; font-weight: 600;
	color: var(--ei-muted); font-variant-numeric: tabular-nums;
}
.ei-sim-crs .ei-sim-cr__head::after {
	content: "+"; margin-left: .7rem; color: var(--ei-muted);
	font-size: 1rem; font-weight: 700; line-height: 1;
}
.ei-sim-crs .ei-sim-cr[open] .ei-sim-cr__head::after { content: "\2212"; }
.ei-sim-crs .ei-sim-cr__body { padding: 0 0 .95rem; }
.ei-sim-crs .ei-sim-cr__src {
	margin: 0 0 .75rem; padding-left: .9rem;
	border-left: 2px solid var(--ei-border);
}
.ei-sim-crs .ei-sim-cr__src:last-child { margin-bottom: 0; }
.ei-sim-crs .ei-sim-cr__name { margin: 0; font-size: .96rem; line-height: 1.4; font-weight: 600; }
.ei-sim-crs .ei-sim-cr__link {
	color: var(--ei-text); text-decoration: underline;
	text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.ei-sim-crs .ei-sim-cr__link:hover,
.ei-sim-crs .ei-sim-cr__link:focus-visible { color: var(--ei-navy); }
.ei-sim-crs .ei-sim-cr__link--none { text-decoration: none; color: var(--ei-heading); }
.ei-sim-crs .ei-sim-cr__ext { margin-left: .3em; font-size: .8em; opacity: .7; font-variant-emoji: text; }
.ei-sim-crs .ei-sim-cr__meta {
	margin: .1rem 0 0; font-size: .74rem; letter-spacing: .02em;
	color: var(--ei-muted); font-variant-numeric: tabular-nums;
}
.ei-sim-crs .ei-sim-cr__what { margin: .2rem 0 0; font-size: .84rem; line-height: 1.5; color: var(--ei-text); }
.ei-sim-credits__note { margin-top: 1rem; font-size: .78rem; line-height: 1.55; color: var(--ei-muted); }


/* ---------- the level switcher ---------- */

.ei-at-level {
	padding: .55rem .95rem .6rem;
	border-bottom: 1px solid var(--ei-border);
}
.ei-at-level__row {
	display: flex;
	gap: 2px;
	padding: 2px;
	background: var(--ei-surface-2);
	border-radius: var(--ei-radius);
}
.ei-at-level__btn {
	flex: 1 1 0;
	padding: .32rem 0;
	font: inherit;
	font-size: .72rem;
	font-weight: 600;
	color: var(--ei-muted);
	background: none;
	border: 0;
	border-radius: calc(var(--ei-radius) - 2px);
	cursor: pointer;
}
.ei-at-level__btn:hover { color: var(--ei-text); }
.ei-at-level__btn.is-active {
	background: var(--ei-bg);
	color: var(--ei-heading);
	box-shadow: var(--ei-shadow);
}
.ei-at-vintage {
	width: 100%;
	margin-top: .45rem;
	padding: .3rem .5rem;
	font: inherit;
	font-size: .76rem;
	color: var(--ei-text);
	background: var(--ei-field);
	border: 1px solid var(--ei-field-border);
	border-radius: var(--ei-radius);
}
.ei-at-vintage[hidden] { display: none; }

/* ---------- ecological inference's own section ---------- */

.ei-at-ei { padding: 0 .5rem .4rem; }
.ei-at-ei__lede {
	margin: .2rem 0 .4rem;
	padding: 0 .05rem;
	font-size: .72rem;
	line-height: 1.4;
	color: var(--ei-muted);
}
.ei-at-ei__years { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .45rem; }
.ei-at-ei__year {
	padding: .18rem .55rem;
	font: inherit;
	font-size: .72rem;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ei-muted);
	background: var(--ei-surface-2);
	border: 1px solid transparent;
	border-radius: 999px;
	cursor: pointer;
}
.ei-at-ei__year:hover { color: var(--ei-text); }
.ei-at-ei__year.is-active {
	background: color-mix(in srgb, var(--ei-navy) 14%, transparent);
	border-color: color-mix(in srgb, var(--ei-navy) 40%, transparent);
	color: var(--ei-heading);
}

/* ---------- categorical legend ---------- */

.ei-at-legend__cats {
	display: grid;
	gap: .22rem;
	margin-top: .1rem;
	max-height: 260px;
	overflow-y: auto;
	overscroll-behavior: contain;
	pointer-events: auto;
	scrollbar-width: thin;
}
.ei-at-legend__cat {
	display: flex;
	align-items: center;
	gap: .4rem;
	font-size: .74rem;
	color: var(--ei-text);
}
.ei-at-legend__cat i {
	flex: 0 0 auto;
	width: 10px; height: 10px;
	border-radius: 3px;
}
.ei-at-legend__cat span { flex: 1 1 auto; }
.ei-at-legend__cat b {
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	color: var(--ei-muted);
}

/* ---------- city labels ---------- */

.ei-at-cities {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	overflow: hidden;
}
.ei-at-city {
	position: absolute;
	top: 0; left: 0;
	display: flex;
	align-items: center;
	gap: .22rem;
	will-change: transform;
}
/* Reference labels, not content: muted and small — they orient the eye
   without competing with the choropleth. Full opacity by request; the muted
   colour and small size do the receding. */
.ei-at-city { opacity: 1; }
.ei-at-city i {
	width: 4px; height: 4px;
	background: var(--ei-muted);
	border-radius: 50%;
}
.ei-at-city span {
	font-size: .5rem;
	font-weight: 600;
	letter-spacing: .01em;
	color: var(--ei-muted);
	/* Halo: readable over any choropleth fill, in either theme. */
	text-shadow: 0 0 3px var(--ei-bg), 0 0 3px var(--ei-bg);
	white-space: nowrap;
}
.ei-at-city.is-major { opacity: 1; }
.ei-at-city.is-major span { font-size: .58rem; color: var(--ei-text); }
.ei-at-city.is-major i { width: 5px; height: 5px; }

/* Readout's small share suffix on categorical values. */


.ei-at-inf__hint {
	margin: .35rem 0 .1rem;
	font-size: .7rem;
	line-height: 1.45;
	color: var(--ei-muted);
}
.ei-at-scheme { margin-top: 0; flex: 1 1 auto; width: auto; min-width: 0; }
.ei-at-layer--pair { cursor: default; gap: .3rem; }
.ei-at-layer--pair .ei-at-layer__label {
	font: inherit;
	color: inherit;
	background: none;
	border: 0;
	padding: 0;
	text-align: left;
	cursor: pointer;
}
/* Ghost until chosen: with a switch pair on all 89 rows, filled pills read as
   noise. Rest state is bare muted text; hover hints; the active one is a pill. */
.ei-at-layer__kind--btn {
	cursor: pointer;
	border: 1px solid transparent;
	background: none;
	color: var(--ei-muted);
}
.ei-at-layer__kind--btn:hover { color: var(--ei-text); background: var(--ei-surface-2); }
.ei-at-layer__kind--btn.is-on {
	background: color-mix(in srgb, var(--ei-navy) 20%, transparent);
	border-color: color-mix(in srgb, var(--ei-navy) 45%, transparent);
	color: var(--ei-heading);
}


/* ---------- the folded scale, its pill, and the loaders ---------- */

.ei-at-legendpill {
	position: absolute;
	right: 1rem;
	bottom: 1rem;
	z-index: 3;
	padding: .3rem .7rem;
	font: inherit;
	font-size: .72rem;
	font-weight: 600;
	color: var(--ei-muted);
	background: color-mix(in srgb, var(--ei-bg) 88%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid var(--ei-border);
	border-radius: 999px;
	cursor: pointer;
}
.ei-at-legendpill:hover { color: var(--ei-heading); border-color: var(--ei-muted); }
.ei-at-legendpill[hidden] { display: none; }

/* Boot: opaque over the map region until the first successful paint.
   NOT .ei-at-boot — that class belongs to the PHP boot card this overlay
   replaces, and sharing it restyled the card in the pre-JS moment. */
.ei-at-mapboot {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: grid;
	place-items: center;
	background: var(--ei-bg);
	transition: opacity .4s ease;
}
.ei-at-mapboot.is-done { opacity: 0; pointer-events: none; }
.ei-at-mapboot__card { text-align: center; }
.ei-at-mapboot__eyebrow {
	margin: 0 0 .3rem;
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .13em;
	text-transform: uppercase;
	color: var(--ei-muted);
}
.ei-at-mapboot__title {
	margin: 0 0 1rem;
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--ei-heading);
}
.ei-at-mapboot__bar {
	width: 180px;
	height: 4px;
	margin: 0 auto .8rem;
	background: var(--ei-surface-2);
	border-radius: 999px;
	overflow: hidden;
}
.ei-at-mapboot__bar i {
	display: block;
	width: 40%;
	height: 100%;
	background: var(--ei-navy);
	border-radius: 999px;
	animation: ei-at-slide 1.1s ease-in-out infinite;
}
@keyframes ei-at-slide {
	0% { transform: translateX(-100%); }
	100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
	.ei-at-mapboot__bar i { animation: none; width: 100%; opacity: .5; }
}
.ei-at-mapboot__note { margin: 0; font-size: .76rem; color: var(--ei-muted); }

/* The in-flight chip: quiet, top-centre, never intercepts the mouse. */
.ei-at-loadchip {
	position: absolute;
	top: .8rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 4;
	padding: .28rem .75rem;
	font-size: .72rem;
	font-weight: 600;
	color: var(--ei-muted);
	background: color-mix(in srgb, var(--ei-bg) 90%, transparent);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
	border: 1px solid var(--ei-border);
	border-radius: 999px;
	pointer-events: none;
}
.ei-at-loadchip[hidden] { display: none; }

/* The non-member page gate: in the page flow, not an overlay. */
.ei-at-pagegate {
	display: grid;
	place-items: center;
	padding: 4rem 1.25rem;
	background: var(--ei-bg);
}
.ei-at-pagegate .ei-at-gate { max-width: 560px; }
