/*
 * Regions of India map: masthead, stage, sidebar, article, footer.
 *
 * Light editorial look in the 33travels palette: Mulish, accent #f43e11,
 * secondary #945eed, text #38393d, page #f2f2f2, header #fff. The map sits on a
 * warm off-white "sea"; the 8 regions are soft blue / olive / terracotta / ochre /
 * clay / lavender / mint / rose tones, with white strokes and faint state borders inside.
 *
 * Layout contract: main.idm-stage is exactly one viewport minus the masthead
 * (100svh - --idm-mast-h). Desktop (>=1101px): map left, 400px sidebar right.
 * Below that the sidebar is a bottom sheet (a fixed-height row for now; the UI
 * track adds snap points). Every box that moves is sized from a CSS variable so
 * nothing reflows when the font, JS or an ad arrives.
 *
 * UI track: add rules to the end of this file (or add css/idm-ui.css and link it
 * in templates/standalone.php). Everything is scoped under .idm-* classes.
 */

:root {
	--idm-accent: #f43e11;
	--idm-accent2: #945eed;
	--idm-ink: #38393d;
	--idm-dim: #5d5f66;
	--idm-accent-ink: #c42a07;
	--idm-accent2-ink: #7a42d4;
	--idm-serif: Fraunces, Georgia, 'Times New Roman', serif;
	--idm-faint: #9a9ca3;
	--idm-page: #f2f2f2;
	--idm-white: #fff;
	--idm-line: #e4e1db;
	--idm-sea: #f6f1e7;
	--idm-mast-h: 56px;
	--idm-topbar-h: 112px;
	--idm-sidebar-w: 400px;
		--idm-sans: Mulish, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

	/* Region fills: soft, earthy, readable under dark labels (kept in step with REGION_COLOR in src/shade.js). */
	--idm-m-northern: #8fb3c7;
	--idm-m-central: #e8c981;
	--idm-m-eastern: #a6cba8;
	--idm-m-western: #e2a58d;
	--idm-m-southern: #b7a3cf;
	--idm-m-north-eastern: #dd8fb0;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	background: var(--idm-page);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

body.idm-body {
	margin: 0;
	background: var(--idm-page);
	color: var(--idm-ink);
	font-family: var(--idm-sans);
	font-size: 16px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

.idm-body a {
	color: inherit;
}

/* ---------------------------------------------------------------- masthead */

.idm-mast {
	position: relative;
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 28px;
	height: var(--idm-mast-h);
	padding: 0 20px;
	background: var(--idm-white);
	border-bottom: 1px solid var(--idm-line);
}

.idm-logo {
	display: block;
	flex: none;
	line-height: 0;
}

.idm-logo img {
	display: block;
	width: 151px;
	height: 25px;
}

.idm-nav {
	margin-left: auto;
}

.idm-nav ul,
.idm-burger-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.idm-nav > ul {
	display: flex;
	align-items: center;
	gap: 4px;
}

.idm-nav a,
.idm-nav summary {
	display: block;
	padding: 8px 12px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	list-style: none;
	border-radius: 6px;
}

.idm-nav summary::-webkit-details-marker,
.idm-burger summary::-webkit-details-marker {
	display: none;
}

.idm-nav a:hover,
.idm-nav summary:hover,
.idm-nav details[open] > summary {
	color: var(--idm-accent);
}

.idm-nav summary::after {
	content: '';
	display: inline-block;
	margin-left: 6px;
	width: 5px;
	height: 5px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
}

.idm-sub {
	position: relative;
}

.idm-sub-list {
	position: absolute;
	top: calc(100% + 6px);
	right: 0;
	min-width: 220px;
	padding: 6px;
	background: var(--idm-white);
	border: 1px solid var(--idm-line);
	border-radius: 10px;
	box-shadow: 0 12px 32px rgba(40, 30, 20, 0.14);
}

.idm-sub-list a {
	text-transform: none;
	letter-spacing: 0;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
}

.idm-sub-list a:hover {
	background: var(--idm-page);
}

.idm-burger {
	display: none;
	margin-left: auto;
}

.idm-burger summary {
	display: block;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	cursor: pointer;
	list-style: none;
	position: relative;
}

.idm-burger-icon,
.idm-burger-icon::before,
.idm-burger-icon::after {
	position: absolute;
	left: 12px;
	width: 20px;
	height: 2px;
	background: var(--idm-ink);
	border-radius: 2px;
	content: '';
}

.idm-burger-icon {
	top: 21px;
}

.idm-burger-icon::before {
	left: 0;
	top: -6px;
}

.idm-burger-icon::after {
	left: 0;
	top: 6px;
}

.idm-burger-panel {
	position: absolute;
	top: var(--idm-mast-h);
	left: 0;
	right: 0;
	max-height: calc(100svh - var(--idm-mast-h));
	overflow: auto;
	padding: 8px 20px 20px;
	background: var(--idm-white);
	border-bottom: 1px solid var(--idm-line);
	box-shadow: 0 16px 32px rgba(40, 30, 20, 0.14);
}

.idm-burger-panel a {
	display: block;
	padding: 10px 0;
	font-weight: 600;
	text-decoration: none;
}

.idm-m-head {
	display: block;
	margin-top: 10px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--idm-accent);
}

.idm-m-group ul {
	padding-left: 12px;
}

@media (max-width: 860px) {
	:root {
		--idm-mast-h: 52px;
	}
	.idm-mast {
		padding: 0 16px;
	}
	.idm-nav {
		display: none;
	}
	.idm-burger {
		display: block;
	}
}

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

.idm-stage {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--idm-sidebar-w);
	grid-template-rows: var(--idm-topbar-h) minmax(0, 1fr);
	height: calc(100vh - var(--idm-mast-h));
	height: calc(100svh - var(--idm-mast-h));
	min-height: 520px;
	overflow: hidden;
	background:
		radial-gradient(900px 700px at 22% 28%, #fcfaf5 0%, rgba(252, 250, 245, 0) 70%),
		radial-gradient(700px 600px at 70% 90%, #efe9db 0%, rgba(239, 233, 219, 0) 70%),
		var(--idm-sea);
}

.idm-topbar {
	grid-column: 1;
	grid-row: 1;
	position: relative;
	z-index: 20;
	display: flex;
	flex-wrap: wrap;
	align-content: flex-start;
	gap: 10px 16px;
	padding: 12px 24px 0;
	min-width: 0;
}

.idm-heading {
	min-width: 0;
	flex: 1 1 100%;
	display: flex;
	align-items: baseline;
	gap: 16px;
}

.idm-title {
	margin: 0;
	font-family: var(--idm-serif);
	font-size: 32px;
	line-height: 1.1;
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var(--idm-ink);
}

.idm-tagline {
	margin: 4px 0 0;
	font-size: 13px;
	line-height: 1.35;
	color: var(--idm-dim);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}

.idm-controls {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
	min-width: 0;
	min-height: 42px;
}

.idm-chiprow {
	display: flex;
	align-items: center;
	gap: 8px;
}

.idm-map-wrap {
	grid-column: 1;
	grid-row: 2;
	position: relative;
	min-height: 0;
	min-width: 0;
	padding: 0 12px calc(12px + var(--idm-pad, 0px));
}

.idm-map {
	display: block;
	width: 100%;
	height: 100%;
}

/* ----------------------------------------------------------------- regions */

.idm-region {
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
	--idm-fill: var(--idm-m-central);
	transition: opacity 0.35s ease;
}

.idm-region path {
	fill: var(--idm-fill);
	stroke: #fff;
	stroke-width: 1.5;
	stroke-linejoin: round;
	vector-effect: non-scaling-stroke;
	transition: fill 0.6s ease;
}

.idm-m-northern { --idm-fill: var(--idm-m-northern); }
.idm-m-central { --idm-fill: var(--idm-m-central); }
.idm-m-eastern { --idm-fill: var(--idm-m-eastern); }
.idm-m-western { --idm-fill: var(--idm-m-western); }
.idm-m-southern { --idm-fill: var(--idm-m-southern); }
.idm-m-north-eastern { --idm-fill: var(--idm-m-north-eastern); }

.idm-svg.hov-r .idm-region:not(.is-h) { opacity: 0.5; }
.idm-svg.hov-r.is-shaded .idm-region { opacity: 1; }
.idm-svg.hov-r.is-shaded .idm-unit.dim { opacity: 0.4; }
.idm-svg.has-sel .idm-region:not(.is-sel) { opacity: 0.14; }
.idm-svg.is-units .idm-region { opacity: 1; pointer-events: none; }
.idm-stage.has-macro .idm-region:not(.in-macro) { opacity: 0.22; }
.idm-stage.has-macro .idm-region.in-macro path { stroke-width: 2.4; }
.idm-stage.has-macro .idm-unit:not(.in-macro) { opacity: 0.25; }

/* shaded ("View by"): the 36 units carry the colour, the regions stay as hit-targets and outlines */
.idm-svg.is-shaded .idm-region path { fill: transparent; }

.idm-region:focus-visible path {
	stroke: var(--idm-accent);
	stroke-width: 3.2;
}

.idm-label {
	fill: var(--idm-ink);
	font-family: var(--idm-sans);
	font-weight: 700;
	text-anchor: middle;
	dominant-baseline: central;
	paint-order: stroke;
	stroke: rgba(255, 255, 255, 0.72);
	stroke-width: calc(var(--idm-k, 1) * 3px);
	stroke-linejoin: round;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

.idm-label.is-hide,
.idm-labels.is-off,
.idm-leaders.is-off,
.idm-plabels.is-off {
	opacity: 0;
}

.idm-labels,
.idm-plabels,
.idm-leaders {
	transition: opacity 0.3s ease;
}

.idm-leaders { pointer-events: none; }

.idm-leaders line {
	stroke: var(--idm-ink);
	stroke-opacity: 0.55;
	stroke-linecap: round;
}

.idm-leaders circle {
	fill: var(--idm-ink);
	fill-opacity: 0.7;
}

.idm-plabel {
	font-family: var(--idm-sans);
	font-size: 10.5px;
	font-weight: 700;
	fill: var(--idm-ink);
	text-anchor: middle;
	dominant-baseline: central;
	paint-order: stroke;
	stroke: rgba(255, 255, 255, 0.8);
	stroke-width: 3px;
	stroke-linejoin: round;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.idm-plabel.is-hide {
	opacity: 0;
}

/* state layer: faint borders inside the regions; filled and clickable in the States view or inside a zoomed region */

.idm-unit {
	fill: none;
	stroke: #fff;
	stroke-opacity: 0.6;
	stroke-width: calc(var(--idm-k, 1) * 0.9px);
	stroke-linejoin: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 0;
	pointer-events: none;
	cursor: pointer;
	transition: fill 0.5s ease, opacity 0.25s ease;
}

.idm-svg.is-shaded .idm-unit { fill: var(--pf); }

.idm-svg.is-units .idm-unit,
.idm-svg.has-sel .idm-unit.in-sel {
	fill: var(--pf, color-mix(in srgb, var(--idm-fill) 72%, #fff));
	stroke-opacity: 1;
	stroke-width: calc(var(--idm-k, 1) * 1.1px);
	pointer-events: all;
}

.idm-svg.has-sel .idm-unit:not(.in-sel) { opacity: 0.14; pointer-events: none; }
.idm-svg.is-units.has-sel .idm-unit:not(.in-sel) { opacity: 0.55; pointer-events: all; }
.idm-unit.is-selp { stroke: var(--idm-accent); stroke-opacity: 1; stroke-width: calc(var(--idm-k, 1) * 2.2px); }

.idm-unit.draw {
	animation: idm-draw 0.9s ease-out both;
	animation-delay: var(--d, 0ms);
}

.idm-svg.hov-p .idm-unit.in-sel:not(.is-h):not(.is-rm),
.idm-svg.hov-p.is-units .idm-unit:not(.is-h):not(.is-rm) { opacity: 0.55; }
.idm-svg.hov-p .idm-unit.is-rm { opacity: 0.92; }

.idm-outlines { display: none; pointer-events: none; }
.idm-outlines.is-on { display: block; }

.idm-outline {
	fill: none;
	stroke: #3b2a20;
	stroke-opacity: 0.45;
	stroke-width: calc(var(--idm-k, 1) * 1.6px);
	stroke-linejoin: round;
}

.idm-lift { pointer-events: none; }

.idm-lift-p path {
	stroke: #fff;
	stroke-width: calc(var(--idm-k, 1) * 1.6px);
	stroke-linejoin: round;
}

.idm-lift-p {
	transform-box: fill-box;
	transform-origin: 50% 55%;
	transform: translateY(calc(var(--idm-k, 1) * -6px)) scale(1.03);
	filter: drop-shadow(0 calc(var(--idm-k, 1) * 9px) calc(var(--idm-k, 1) * 8px) rgba(70, 45, 25, 0.32));
	animation: idm-lift 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes idm-lift {
	from { transform: none; filter: drop-shadow(0 0 0 rgba(70, 45, 25, 0)); }
}

@keyframes idm-draw {
	from { stroke-dashoffset: 1; }
	to { stroke-dashoffset: 0; }
}

/* pins */

.idm-pins { pointer-events: none; }

.idm-pin-ring,
.idm-pin-dot,
.idm-pin-t {
	animation-duration: 0.5s;
	animation-timing-function: cubic-bezier(0.3, 1.6, 0.5, 1);
	animation-fill-mode: both;
	animation-delay: inherit;
	animation-name: idm-pop;
	transform-box: fill-box;
	transform-origin: center;
}

.idm-pin-t {
	animation-name: idm-fade;
	animation-timing-function: ease;
	font-family: var(--idm-sans);
	font-size: 12.5px;
	font-weight: 700;
	fill: var(--idm-ink);
	dominant-baseline: central;
	paint-order: stroke;
	stroke: #fff;
	stroke-width: 4px;
	stroke-linejoin: round;
}

.idm-pin-ring { fill: rgba(244, 62, 17, 0.18); }
.idm-pin-dot { fill: #fff; stroke: var(--idm-accent); stroke-width: 2.6; }
.idm-pin.is-cap .idm-pin-dot { fill: var(--idm-accent); stroke: #fff; }
.idm-pin.is-cap .idm-pin-t { font-size: 14px; font-weight: 800; }
.idm-pin.is-hit .idm-pin-ring { animation: idm-pulse 1.5s ease-out 4 both; fill: rgba(148, 94, 237, 0.28); }
.idm-pin.is-hit .idm-pin-dot { fill: var(--idm-accent2); stroke: #fff; }

@keyframes idm-pop {
	from { opacity: 0; transform: scale(0); }
	to { opacity: 1; transform: scale(1); }
}

@keyframes idm-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes idm-pulse {
	0% { transform: scale(0.5); opacity: 0.9; }
	100% { transform: scale(2.8); opacity: 0; }
}

/* quiz feedback on a region */
.idm-svg.is-shaded .idm-region path { stroke: rgba(96, 62, 40, 0.5); stroke-width: 1.3; }
.idm-unit.q-ok { animation: idm-ok 1s ease-out; }
.idm-unit.q-bad { animation: idm-bad 1.2s ease-out; }
.idm-unit.q-reveal { animation: idm-reveal 1.3s ease-in-out; }
.idm-region.q-ok path { animation: idm-ok 1s ease-out; }
.idm-region.q-bad { animation: idm-shake 0.45s ease; }
.idm-region.q-bad path { animation: idm-bad 1.2s ease-out; }
.idm-region.q-reveal path { animation: idm-reveal 1.3s ease-in-out; }
.idm-region.q-ok { animation: idm-pulse-r 0.7s ease; }

@keyframes idm-ok { 0%, 40% { fill: #3fa66a; } }
@keyframes idm-bad { 0%, 40% { fill: #d6443a; } }
@keyframes idm-reveal { 25%, 75% { fill: #3fa66a; } }
@keyframes idm-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes idm-pulse-r { 0% { transform: scale(1); } 40% { transform: scale(1.015); } 100% { transform: scale(1); } }
.idm-region { transform-box: fill-box; transform-origin: center; }

/* tooltip */

.idm-tip {
	position: absolute;
	left: 0;
	top: 0;
	z-index: 8;
	display: flex;
	flex-direction: column;
	gap: 1px;
	max-width: 250px;
	padding: 9px 13px;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 12px;
	box-shadow: 0 10px 28px rgba(60, 40, 20, 0.16);
	font-size: 13px;
	line-height: 1.35;
	color: var(--idm-dim);
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.14s ease;
	will-change: transform;
}

.idm-tip.is-on { opacity: 1; }
.idm-tip strong { font-size: 15px; font-weight: 800; color: var(--idm-ink); }
.idm-tip-tag { margin-top: 3px; font-size: 11px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--idm-accent-ink); }
.idm-tip-val { margin-top: 3px; }
.idm-tip-val b { color: var(--idm-ink); }

/* legend */

.idm-legend {
	position: absolute;
	left: 16px;
	bottom: calc(14px + var(--idm-pad, 0px));
	z-index: 4;
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 10px 14px 11px;
	background: rgba(255, 255, 255, 0.96);
	box-shadow: 0 6px 20px rgba(60, 40, 20, 0.1);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border: 1px solid var(--idm-line);
	border-radius: 14px;
	font-size: 12px;
	color: var(--idm-dim);
	animation: idm-rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.idm-legend b { font-size: 12px; font-weight: 800; color: var(--idm-ink); }
.idm-lg-cats { display: flex; flex-wrap: wrap; gap: 2px 4px; max-width: 330px; }
.idm-lg-cats span { display: inline-flex; align-items: center; gap: 6px; color: var(--idm-ink); }
.idm-lg-b { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 6px; border: 1px solid transparent; border-radius: 12px; background: transparent; font: 600 12px/1.2 var(--idm-sans); color: var(--idm-ink); cursor: pointer; }
.idm-lg-b:hover { background: #f6efe6; }
.idm-lg-b[aria-pressed='true'] { background: var(--idm-ink); color: #fff; }
.idm-lg-b:focus-visible { outline: 3px solid var(--idm-accent2); outline-offset: 1px; }
.idm-lg-cats i { width: 12px; height: 12px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.idm-lg-ramp { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 0; width: 200px; font-weight: 700; color: var(--idm-ink); }
.idm-lg-ramp i { grid-column: 1 / -1; height: 10px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06); transform-origin: left; animation: idm-grow 0.8s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.idm-lg-ramp span:last-child { text-align: right; }

@keyframes idm-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes idm-grow { from { transform: scaleX(0); } }

.idm-stage.is-zoomed .idm-legend.is-macro { display: none; }

.idm-reset {
	position: absolute;
	left: 16px;
	top: 4px;
	z-index: 4;
	display: none;
}

.idm-btn.idm-reset { display: none; }
.idm-stage.is-zoomed .idm-btn.idm-reset { display: inline-flex; animation: idm-rise 0.4s both; }

/* --------------------------------------------------------------- controls */

.idm-search {
	position: relative;
	display: flex;
	align-items: center;
	width: 236px;
	height: 42px;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 21px;
	box-shadow: 0 2px 8px rgba(60, 40, 20, 0.05);
	transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.idm-search:focus-within {
	border-color: var(--idm-accent2);
	box-shadow: 0 0 0 3px rgba(148, 94, 237, 0.2);
}

.idm-search-i {
	display: flex;
	padding-left: 14px;
	color: var(--idm-dim);
}

.idm-q {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 12px 0 8px;
	border: 0;
	background: transparent;
	font: 600 15px/1 var(--idm-sans);
	color: var(--idm-ink);
	outline: none;
}

.idm-q::placeholder { color: var(--idm-dim); font-weight: 600; }

.idm-qx {
	flex: none;
	width: 34px;
	height: 34px;
	margin-right: 4px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--idm-dim);
	cursor: pointer;
}

.idm-qx:hover { background: var(--idm-page); }

.idm-lb {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 6px);
	z-index: 50;
	min-width: 300px;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 14px;
	box-shadow: 0 16px 40px rgba(60, 40, 20, 0.18);
	max-height: 60vh;
	overflow: auto;
}

.idm-opt {
	display: flex;
	flex-direction: column;
	padding: 8px 10px;
	border-radius: 9px;
	cursor: pointer;
}

.idm-opt[aria-selected='true'],
.idm-opt:hover { background: #f6efe6; }
.idm-opt-t { font-size: 15px; font-weight: 700; color: var(--idm-ink); }
.idm-opt-s { font-size: 12px; color: var(--idm-dim); }
.idm-lb-msg { padding: 10px; font-size: 14px; color: var(--idm-dim); }

.idm-seg {
	position: relative;
	display: inline-flex;
	height: 42px;
	padding: 3px;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 21px;
	box-shadow: 0 2px 8px rgba(60, 40, 20, 0.05);
}

.idm-seg button {
	position: relative;
	z-index: 1;
	min-width: 84px;
	padding: 0 14px;
	border: 0;
	border-radius: 18px;
	background: transparent;
	font: 700 14px/1 var(--idm-sans);
	color: var(--idm-dim);
	cursor: pointer;
	transition: color 0.25s ease;
}

.idm-seg button[aria-pressed='true'] { color: #fff; }
.idm-seg-thumb {
	position: absolute;
	z-index: 0;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc(50% - 3px);
	border-radius: 18px;
	background: var(--idm-ink);
	transition: transform 0.35s cubic-bezier(0.3, 1.2, 0.4, 1);
}

.idm-seg[data-mode='states'] .idm-seg-thumb { transform: translateX(100%); }

.idm-btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 42px;
	padding: 0 15px;
	border: 1px solid var(--idm-line);
	border-radius: 21px;
	background: #fff;
	box-shadow: 0 2px 8px rgba(60, 40, 20, 0.05);
	font: 700 14px/1 var(--idm-sans);
	color: var(--idm-ink);
	cursor: pointer;
	white-space: nowrap;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.idm-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(60, 40, 20, 0.12); }
.idm-btn .idm-btn-k { color: var(--idm-dim); font-weight: 600; margin-right: -3px; }
.idm-btn-quiz { background: #fde8de; border-color: #f6bfa9; color: var(--idm-accent-ink); }
.idm-btn-quiz:hover { background: #fcdccd; }
.idm-btn-quiz[aria-pressed='true'] { background: var(--idm-accent-ink); border-color: var(--idm-accent-ink); color: #fff; }
.idm-btn svg { flex: none; }

.idm-q:focus-visible,
.idm-seg button:focus-visible,
.idm-btn:focus-visible,
.idm-btn-s:focus-visible,
.idm-btn-p:focus-visible,
.idm-chip:focus-visible,
.idm-link:focus-visible,
.idm-x:focus-visible,
.idm-pn:focus-visible,
.idm-grip:focus-visible,
.idm-pnrow button:focus-visible,
.idm-back:focus-visible,
.idm-region-list a:focus-visible,
.idm-opt:focus-visible,
.idm-pop button:focus-visible {
	outline: 3px solid var(--idm-accent2);
	outline-offset: 2px;
}

.idm-q:focus-visible { outline: none; }

/* popovers (fixed, placed by JS) */

.idm-pop {
	position: fixed;
	z-index: 60;
	width: min(340px, calc(100vw - 16px));
	overflow: auto;
	padding: 14px;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 16px;
	box-shadow: 0 18px 48px rgba(60, 40, 20, 0.2);
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.18s ease, transform 0.18s ease;
}

.idm-pop.is-in { opacity: 1; transform: none; }
.idm-pop[hidden] { display: none; }
.idm-pop-menu { width: min(240px, calc(100vw - 16px)); padding: 8px; }
.idm-pop-h { margin: 4px 8px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--idm-dim); }

.idm-pop-menu button {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 9px 10px 9px 30px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	font: 600 15px/1.2 var(--idm-sans);
	color: var(--idm-ink);
	text-align: left;
	cursor: pointer;
	position: relative;
}

.idm-pop-menu button:hover { background: #f6efe6; }
.idm-pop-menu button[aria-checked='true'] { font-weight: 800; }
.idm-pop-menu button[aria-checked='true']::before {
	content: '';
	position: absolute;
	left: 12px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -4px;
	border-radius: 50%;
	background: var(--idm-accent);
}

.idm-pop-tools section { padding: 2px 0 14px; margin-bottom: 12px; border-bottom: 1px solid var(--idm-line); border-radius: 10px; }
.idm-pop-tools section:last-of-type { border-bottom: 0; margin-bottom: 0; }
.idm-pop-tools h3 { margin: 0 0 6px; font-size: 15px; font-weight: 800; }
.idm-pop-tools p { margin: 0 0 8px; font-size: 13px; color: var(--idm-dim); line-height: 1.45; }
.idm-pop-tools .is-flash { animation: idm-flash 1.2s ease; }
.idm-pop-s { min-height: 1.2em; margin: 8px 0 0 !important; font-size: 12px !important; }

@keyframes idm-flash { 0% { background: #fdeee8; } 100% { background: transparent; } }

.idm-btn-p,
.idm-btn-s {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 16px;
	border-radius: 19px;
	font: 700 14px/1 var(--idm-sans);
	cursor: pointer;
	transition: transform 0.15s ease, background 0.2s ease;
}

.idm-btn-p { border: 1px solid var(--idm-ink); background: var(--idm-ink); color: #fff; }
.idm-btn-s { border: 1px solid var(--idm-line); background: #fff; color: var(--idm-ink); }
.idm-btn-p:hover,
.idm-btn-s:hover { transform: translateY(-1px); }
.idm-btn-s:hover { background: #f6efe6; }

.idm-cite-row { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: start; margin-bottom: 8px; }
.idm-cite-row b { font-size: 12px; padding-top: 2px; }
.idm-cite { margin: 0 !important; font-size: 12px !important; word-break: break-word; user-select: all; }
.idm-cite-row .idm-btn-s { height: 30px; padding: 0 12px; font-size: 12px; }
.idm-pr { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.idm-pr .idm-btn-s { height: 32px; padding: 0 14px; font-size: 13px; }
.idm-print { margin-top: 4px; }

/* ---------------------------------------------------------------- quiz HUD */

.idm-stage.is-quiz .idm-map-wrap { padding-top: 156px; }
.idm-stage.is-quiz .idm-legend { display: none; }

.idm-hud {
	position: absolute;
	left: 50%;
	top: 6px;
	z-index: 12;
	width: min(560px, calc(100% - 24px));
	padding: 12px 18px 14px;
	background: #fff;
	border: 1px solid var(--idm-line);
	border-radius: 18px;
	box-shadow: 0 12px 34px rgba(60, 40, 20, 0.16);
	transform: translateX(-50%);
	animation: idm-hud-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes idm-hud-in { from { opacity: 0; transform: translate(-50%, -14px); } }

.idm-hud.is-bad { animation: idm-hud-bad 0.45s ease; }
@keyframes idm-hud-bad { 0%, 100% { transform: translateX(-50%); } 25% { transform: translateX(calc(-50% - 7px)); } 50% { transform: translateX(calc(-50% + 6px)); } 75% { transform: translateX(calc(-50% - 3px)); } }

.idm-hud-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.idm-hud-seg { display: inline-flex; padding: 2px; background: var(--idm-page); border-radius: 16px; }
.idm-hud-seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 14px; background: transparent; font: 700 12px/1 var(--idm-sans); color: var(--idm-dim); cursor: pointer; }
.idm-hud-seg button[aria-pressed='true'] { background: var(--idm-ink); color: #fff; }
.idm-hud-x { border: 0; background: transparent; font: 700 13px/1 var(--idm-sans); color: var(--idm-dim); cursor: pointer; padding: 6px 4px; text-decoration: underline; text-underline-offset: 3px; }
.idm-hud-note { margin: 6px 0 0; font-size: 13px; font-weight: 700; color: var(--idm-accent2-ink); }
.idm-hud-main { display: flex; flex-direction: column; margin: 8px 0 4px; min-height: 66px; }
.idm-hud-p { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--idm-dim); }
.idm-hud-q { font-family: var(--idm-serif); font-size: 32px; line-height: 1.1; font-weight: 700; color: var(--idm-ink); }
.idm-hud-q.is-in { animation: idm-hud-q 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes idm-hud-q { from { opacity: 0; transform: translateY(8px); } }
.idm-hud-stats { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; font-weight: 700; color: var(--idm-dim); font-variant-numeric: tabular-nums; }
.idm-hud-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.idm-streak { display: none; padding: 2px 10px; border-radius: 12px; background: #fdeee8; color: var(--idm-accent-ink); }
.idm-streak.is-on { display: inline-block; }
.idm-streak.is-bump { animation: idm-bump 0.5s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes idm-bump { 0% { transform: scale(0.7); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.idm-hud-bar { height: 4px; margin-top: 10px; background: var(--idm-line); border-radius: 2px; overflow: hidden; }
.idm-hud-bar i { display: block; height: 100%; width: 0; background: var(--idm-accent); border-radius: 2px; transition: width 0.4s ease; }

.idm-end {
	position: absolute;
	left: 50%;
	top: 50%;
	z-index: 14;
	width: min(400px, calc(100% - 28px));
	padding: 26px 26px 22px;
	background: #fff;
	border-radius: 22px;
	box-shadow: 0 24px 70px rgba(60, 40, 20, 0.28);
	text-align: center;
	transform: translate(-50%, -50%);
	animation: idm-end-in 0.5s cubic-bezier(0.2, 1.2, 0.4, 1) both;
}

@keyframes idm-end-in { from { opacity: 0; transform: translate(-50%, -46%) scale(0.92); } }
.idm-end .idm-kicker { margin: 0; }
.idm-end-score { margin: 4px 0 0; font-family: var(--idm-serif); font-size: 26px; color: var(--idm-dim); }
.idm-end-score b { font-size: 76px; line-height: 1; color: var(--idm-ink); }
.idm-end-msg { margin: 6px 0 12px; font-size: 16px; font-weight: 700; }
.idm-end-stats { display: flex; justify-content: center; gap: 22px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; color: var(--idm-dim); }
.idm-end-stats b { display: block; font-size: 19px; color: var(--idm-ink); }
.idm-end-miss { margin: 0 0 14px; font-size: 13px; color: var(--idm-dim); }
.idm-end-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.idm-confetti { position: absolute; inset: 0; z-index: 15; width: 100%; height: 100%; pointer-events: none; }

.idm-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ----------------------------------------------------------------- sidebar */

.idm-sidebar {
	grid-column: 2;
	grid-row: 1 / -1;
	position: relative;
	z-index: 10;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 0 26px 28px;
	background: rgba(255, 255, 255, 0.84);
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	border-left: 1px solid var(--idm-line);
	box-shadow: -12px 0 40px rgba(60, 40, 20, 0.05);
	scrollbar-width: thin;
}

.idm-grip { display: none; }
.idm-card { padding-top: 24px; }

.idm-kicker {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--idm-accent-ink);
}

.idm-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	margin: 0 0 14px;
	padding: 0;
	list-style: none;
	font-size: 14px;
	color: var(--idm-dim);
}

.idm-stats li { white-space: nowrap; }
.idm-stats b { display: inline-block; min-width: 2.2ch; font-size: 22px; font-weight: 800; color: var(--idm-ink); font-variant-numeric: tabular-nums; }

.idm-h2 { margin: 6px 0 8px; font-family: var(--idm-serif); font-size: 26px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.idm-h3 { margin: 22px 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--idm-dim); }
.idm-lede { margin: 0; font-size: 15px; line-height: 1.6; color: #4a4b50; }

.idm-region-list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 14px;
	font-weight: 600;
}

.idm-region-list li { transition: opacity 0.25s ease; }
.idm-region-list li.is-off { opacity: 0.3; }
.idm-region-list a { display: flex; align-items: center; gap: 9px; padding: 6px 0; text-decoration: none; border-radius: 6px; }
.idm-dot { display: inline-block; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--idm-fill, #ccc); }
.idm-region-list a:hover { color: var(--idm-accent-ink); }

.idm-ov-tools { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--idm-line); font-size: 13px; color: var(--idm-dim); }
.idm-link { padding: 0; border: 0; background: none; font: 700 13px/1.4 var(--idm-sans); color: var(--idm-accent-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* region and province card */

.idm-card-head { display: flex; align-items: flex-start; gap: 12px; }
.idm-coa,
.idm-mono { flex: none; width: 56px; height: 56px; object-fit: contain; }
.idm-mono { padding: 5px; border-radius: 14px; background: #fff; border: 1px solid var(--idm-line); box-sizing: border-box; }
.idm-card-title { flex: 1; min-width: 0; }
.idm-name { margin: 0; font-family: var(--idm-serif); font-size: 32px; line-height: 1.08; font-weight: 700; letter-spacing: -0.015em; overflow-wrap: anywhere; }
.idm-it { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; margin: 4px 0 0; font-size: 14px; color: var(--idm-dim); }
.idm-ipa { font-family: 'Segoe UI', 'Noto Sans', 'DejaVu Sans', 'Lucida Sans Unicode', sans-serif; }
.idm-abbr { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--idm-ink); color: #fff; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; }
.idm-card-btns { display: flex; gap: 4px; flex: none; margin-top: -2px; }
.idm-x,
.idm-pn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--idm-line); border-radius: 50%; background: #fff; color: var(--idm-ink); cursor: pointer; transition: background 0.2s ease, transform 0.15s ease; }
.idm-x:hover,
.idm-pn:hover { background: var(--idm-page); transform: scale(1.06); }
.idm-back { margin: 0 0 8px; padding: 0; border: 0; background: none; font: 700 13px/1 var(--idm-sans); color: var(--idm-accent-ink); cursor: pointer; }

.idm-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 14px; }
.idm-badge { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 11px; border-radius: 14px; background: #f1ece2; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; color: #4a4b50; }
.idm-badge i { width: 10px; height: 10px; border-radius: 50%; }
.idm-badge.is-special { background: #ece3fb; color: #5b30b0; }
.idm-found { margin: 0 0 14px; padding: 10px 14px; border-left: 4px solid var(--idm-accent2); border-radius: 0 10px 10px 0; background: #f4eefd; font-size: 14px; font-weight: 700; animation: idm-rise 0.5s both; }
.idm-explain { margin: 14px 0; font-size: 14px; line-height: 1.55; color: #4a4b50; }

.idm-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.idm-stat { display: flex; flex-direction: column; gap: 2px; padding: 11px 13px 10px; border: 1px solid var(--idm-line); border-radius: 14px; background: #fff; min-width: 0; }
.idm-stat.is-wide { grid-column: 1 / -1; }
.idm-stat-l { font-size: 11px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--idm-dim); }
.idm-stat-v { font-size: 22px; line-height: 1.2; font-weight: 800; color: var(--idm-ink); font-variant-numeric: tabular-nums; }
.idm-stat-t { font-size: 17px; font-weight: 800; color: var(--idm-ink); }
.idm-rank { margin-top: 4px; }
.idm-rank-t { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 700; color: var(--idm-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.idm-rank-bar { flex: 1; height: 5px; border-radius: 3px; background: #efe9de; overflow: hidden; }
.idm-rank-bar i { display: block; width: 0; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--idm-accent2), var(--idm-accent)); transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }

.idm-summary { margin: 0 0 6px; font-size: 15px; line-height: 1.6; color: #44454a; }
.idm-sec { margin-top: 22px; }
.idm-sec > h3,
.idm-known h3 { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--idm-dim); }
.idm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.idm-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid var(--idm-line); border-radius: 17px; background: #fff; font: 700 13px/1 var(--idm-sans); color: var(--idm-ink); cursor: pointer; transition: background 0.18s ease, transform 0.15s ease, border-color 0.18s ease; }
.idm-chip em { font-style: normal; font-size: 11px; font-weight: 800; color: var(--idm-dim); }
.idm-chip:hover { background: #fdeee8; border-color: #f4b19f; transform: translateY(-1px); }
.idm-muted { font-size: 13px; color: var(--idm-dim); }
.idm-note { width: 100%; margin: 0 0 6px; font-size: 13px; color: #4a4b50; }
.idm-cities { margin: 0; padding: 0; list-style: none; counter-reset: c; }
.idm-cities li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eee8dd; font-size: 14px; font-weight: 600; counter-increment: c; }
.idm-cities li::before { content: counter(c); flex: none; width: 22px; color: var(--idm-dim); font-weight: 700; }
.idm-cities li > span { flex: 1; }
.idm-cities em { margin-left: 8px; padding: 1px 7px; border-radius: 8px; background: #fdeee8; font-size: 11px; font-style: normal; font-weight: 800; color: var(--idm-accent-ink); }
.idm-cities b { font-variant-numeric: tabular-nums; color: var(--idm-dim); font-weight: 700; }
.idm-known { margin-bottom: 12px; }
.idm-known h3 { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--idm-ink); margin-bottom: 6px; }
.idm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.idm-tags li { padding: 5px 11px; border-radius: 14px; background: #f1ece2; font-size: 13px; font-weight: 600; color: #3f4045; }
.idm-det > summary { cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; color: var(--idm-ink); }
.idm-ul { margin: 8px 0; padding-left: 18px; font-size: 14px; line-height: 1.55; }
.idm-more { margin: 0; padding: 0; list-style: none; }
.idm-more a { display: block; padding: 8px 0; border-bottom: 1px solid #eee8dd; font-size: 14px; font-weight: 700; color: var(--idm-accent-ink); text-decoration: none; }
.idm-more a::after { content: ' \203A'; }
.idm-more a:hover { text-decoration: underline; text-underline-offset: 3px; }
.idm-pnrow { display: flex; justify-content: space-between; gap: 10px; margin-top: 24px; }
.idm-pnrow button { flex: 1; height: 42px; border: 1px solid var(--idm-line); border-radius: 21px; background: #fff; font: 700 14px/1 var(--idm-sans); color: var(--idm-ink); cursor: pointer; transition: background 0.2s ease; }
.idm-pnrow button:hover { background: #f6efe6; }

/* ---------------------------------------------------------- tablet / phone */

@media (max-width: 1100px) {
	:root { --idm-topbar-h: 104px; }
	.idm-stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--idm-topbar-h) minmax(0, 1fr); }
	.idm-topbar { flex-wrap: wrap; align-content: flex-start; gap: 8px 12px; padding: 10px 18px 0; }
	.idm-title { font-size: 26px; }
	.idm-tagline { display: none; }
	.idm-controls { width: 100%; flex-wrap: nowrap; gap: 8px; }
	.idm-search { flex: 1 1 auto; width: auto; min-width: 140px; }
	.idm-chiprow { flex: none; }
	.idm-map-wrap { padding-bottom: calc(6px + var(--idm-pad, 0px)); }
	.idm-sidebar {
		grid-column: 1;
		grid-row: 1 / -1;
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: calc(100% - 8px);
		padding: 0 18px 24px;
		background: rgba(255, 255, 255, 0.97);
		border-left: 0;
		border-radius: 22px 22px 0 0;
		box-shadow: 0 -10px 40px rgba(60, 40, 20, 0.16);
		transform: translateY(calc(100% - var(--idm-vis, 128px)));
		transition: transform 0.38s cubic-bezier(0.2, 0.85, 0.25, 1);
		overscroll-behavior: contain;
	}
	.idm-sidebar.is-drag { transition: none; }
	.idm-sidebar[data-snap='peek'] { touch-action: none; overflow-y: hidden; }
	.idm-sidebar.is-quiz { transform: translateY(105%); }
	.idm-grip {
		display: block;
		position: sticky;
		top: 0;
		z-index: 2;
		height: 28px;
		margin: 0 -18px;
		cursor: grab;
		touch-action: none;
		background: transparent;
	}
	.idm-grip::after { content: ''; position: absolute; left: 50%; top: 10px; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: #d6d0c4; }
	.idm-card { padding-top: 4px; }
	.idm-name { font-size: 28px; }
	.idm-stage.is-quiz .idm-map-wrap { padding-bottom: 6px; }
	.idm-stats b { font-size: 21px; }
}

@media (max-width: 560px) {
	:root { --idm-topbar-h: 130px; }
	.idm-topbar { padding: 6px 14px 0; gap: 8px; }
	.idm-controls { min-height: 88px; }
	.idm-title { font-size: 24px; flex: 0 0 auto; }
	.idm-heading { flex: 1 1 100%; }
	.idm-controls { flex-direction: column; align-items: stretch; gap: 8px; }
	.idm-search { flex: none; width: 100%; height: 40px; }
	.idm-chiprow { overflow-x: auto; scrollbar-width: none; gap: 6px; padding-bottom: 2px; margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
	.idm-chiprow::-webkit-scrollbar { display: none; }
	.idm-seg { height: 38px; flex: none; }
	.idm-seg button { min-width: 72px; padding: 0 10px; font-size: 13px; }
	.idm-btn { height: 38px; padding: 0 12px; font-size: 13px; flex: none; }
	.idm-btn-k { display: none; }
	.idm-more-t { display: none; }
	.idm-btn-more { width: 38px; padding: 0; justify-content: center; }
	.idm-map-wrap { padding-left: 4px; padding-right: 4px; }
	.idm-legend { left: 10px; padding: 8px 10px; }
	.idm-legend.is-macro { display: none; }
	.idm-lg-ramp { width: 150px; }
		.idm-stage.is-quiz .idm-map-wrap { padding-top: 140px; }
	.idm-hud { padding: 10px 14px 12px; }
	.idm-hud-q { font-size: 26px; }
	.idm-stats-grid { gap: 8px; }
}

/* ------------------------------------------------------------ reduced motion */

@media (prefers-reduced-motion: reduce) {
	.idm-region,
	.idm-region path,
	.idm-unit,
	.idm-sidebar,
	.idm-seg-thumb,
	.idm-btn,
	.idm-pop,
	.idm-tip { transition: none !important; }
	.idm-lift-p,
	.idm-legend,
	.idm-lg-ramp i,
	.idm-hud,
	.idm-hud-q,
	.idm-end,
	.idm-found,
	.idm-streak,
	.idm-pin-ring,
	.idm-pin-dot,
	.idm-pin-t { animation: idm-fade 0.2s both !important; }
	.idm-unit.draw { animation: idm-fade 0.25s backwards !important; }
	.idm-region.q-ok,
	.idm-region.q-bad,
	.idm-hud.is-bad { animation: none !important; }
	.idm-region.q-ok path { animation: idm-ok 0.6s !important; }
	.idm-region.q-bad path { animation: idm-bad 0.8s !important; }
	.idm-rank-bar i { transition: none; }
	.idm-lift-p { transform: none; }
}

/* -------------------------------------------------------------------- print */

@media print {
	html,
	body.idm-body { background: #fff !important; }
	.idm-mast,
	.idm-controls,
	.idm-tagline,
	.idm-sidebar,
	.idm-article,
	.idm-foot,
	.idm-legend,
	.idm-tip,
	.idm-hud,
	.idm-end,
	.idm-reset,
	.idm-pop,
	.idm-lift,
	.idm-sr { display: none !important; }
	.idm-stage { display: block; height: auto; min-height: 0; overflow: visible; background: #fff; }
	.idm-topbar { padding: 0 0 6mm; }
	.idm-map-wrap { height: 160mm; padding: 0; }
	.idm-map { width: 100%; height: 100%; }
	.idm-region path { filter: none; }
	.idm-region,
	.idm-labels,
	.idm-label { opacity: 1 !important; }
	* { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	@page { size: A4 landscape; margin: 12mm; }
}

/* ------------------------------------------------------------------ article */

.idm-article {
	max-width: 820px;
	margin: 0 auto;
	padding: 56px 24px 40px;
	font-size: 17px;
	line-height: 1.7;
}

.idm-article h2 {
	font-family: var(--idm-serif);
	margin: 2.2em 0 0.6em;
	font-size: 28px;
	line-height: 1.2;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.idm-article > h2:first-child,
.idm-article > h2:first-of-type {
	margin-top: 0;
}

.idm-article h3 {
	margin: 1.6em 0 0.4em;
	font-size: 20px;
	line-height: 1.3;
	font-weight: 700;
}

.idm-article p,
.idm-article ul,
.idm-article ol {
	margin: 0 0 1.1em;
}

.idm-article a {
	color: var(--idm-accent-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.idm-table-wrap {
	overflow-x: auto;
	margin: 1.4em 0;
	background: var(--idm-white);
	border: 1px solid var(--idm-line);
	border-radius: 12px;
}

.idm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15px;
	line-height: 1.4;
}

.idm-table caption {
	padding: 12px 14px 4px;
	text-align: left;
	font-weight: 800;
}

.idm-table th,
.idm-table td {
	padding: 9px 14px;
	text-align: left;
	border-bottom: 1px solid var(--idm-line);
	white-space: nowrap;
}

.idm-table thead th {
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--idm-dim);
}

.idm-table td[data-v],
.idm-table th[data-sort] {
	text-align: right;
}

.idm-table tbody tr:last-child > * {
	border-bottom: 0;
}

.idm-states > summary {
	cursor: pointer;
	font-weight: 700;
}

/* Reserved so a late ad fill cannot shift the text below it. */
.idm-ad {
	min-height: 280px;
	margin: 2em 0;
	text-align: center;
}

/* ------------------------------------------------------------------ footer */

.idm-foot {
	background: var(--idm-white);
	border-top: 1px solid var(--idm-line);
}

.idm-foot-in {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 28px;
	max-width: 1100px;
	margin: 0 auto;
	padding: 28px 24px;
	font-size: 14px;
}

.idm-foot-logo {
	font-size: 20px;
	font-weight: 800;
	text-decoration: none;
	color: var(--idm-accent);
}

.idm-foot-nav {
	display: flex;
	gap: 22px;
	font-weight: 600;
}

.idm-foot-nav a {
	text-decoration: none;
}

.idm-foot-nav a:hover {
	color: var(--idm-accent);
}

.idm-foot-c {
	flex-basis: 100%;
	margin: 0;
	font-size: 13px;
	color: var(--idm-dim);
}

/* --------------------------------------------------------------- embed mode */

.idm-embed .idm-stage {
	height: 100vh;
	height: 100svh;
}

/* ---------------------------------------------------------- Brazil additions */

.idm-region-list em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; color: var(--idm-dim); }
.idm-stat-sub { font-size: 11.5px; line-height: 1.35; color: var(--idm-dim); }
.idm-uf { display: inline-block; padding: 1px 7px; border-radius: 6px; background: #efe8da; font-weight: 800; font-size: 12px; letter-spacing: 0.06em; color: var(--idm-ink); }
.idm-hit { fill: transparent; stroke: transparent; stroke-linejoin: round; pointer-events: none; }
.idm-svg.is-units .idm-unit-hit,
.idm-svg.has-sel .idm-unit-hit.in-sel { pointer-events: all; cursor: pointer; }
.idm-svg.has-sel .idm-unit-hit:not(.in-sel) { pointer-events: none; }
.idm-svg.is-units.has-sel .idm-unit-hit:not(.in-sel) { pointer-events: all; }
.idm-svg:not(.is-units) .idm-region-hit { pointer-events: all; cursor: pointer; }
.idm-svg.has-sel .idm-region:not(.is-sel) .idm-region-hit { pointer-events: none; }

/* leader-line labels of the small units */
.idm-dflead { pointer-events: none; }
.idm-lead-l { stroke: var(--idm-ink); stroke-opacity: 0.6; stroke-width: 1; }
.idm-lead-d { fill: var(--idm-ink); fill-opacity: 0.75; }
.idm-lead-t { font-family: var(--idm-sans); font-size: 10.5px; font-weight: 700; fill: var(--idm-ink); dominant-baseline: central; paint-order: stroke; stroke: rgba(255, 255, 255, 0.85); stroke-width: 3px; stroke-linejoin: round; }
@media (max-width: 560px) {
	.idm-lead-t { font-size: 9.5px; }
}

/* no-data hatch in the legend and the invitee chips */
.idm-lg-nd { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--idm-dim); white-space: nowrap; }
.idm-nodata-sw { display: inline-block; width: 18px; height: 11px; border-radius: 3px; border: 1px solid #b3ab9b; background: repeating-linear-gradient(45deg, #ece7dc 0 3px, #b3ab9b 3px 4.5px); }
.idm-chip.is-invitee { border-style: dashed; }
.idm-local { font-weight: 700; }
.idm-foot-note { margin: -4px 0 14px; font-size: 12px; line-height: 1.5; color: var(--idm-dim); }
.idm-subs { margin: 0; padding: 0; list-style: none; font-size: 14px; line-height: 1.5; color: #4a4b50; }
.idm-subs li { padding: 5px 0; border-bottom: 1px solid #eee8dd; }
.idm-badge em { font-style: normal; font-weight: 700; color: var(--idm-dim); }
.idm-badge.is-special em { color: #7a52c4; }
.idm-badge-b { border: 0; font-family: var(--idm-sans); cursor: pointer; }
.idm-badge-b:hover { background: #e9e1d2; }
.idm-srcs { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.4; }
.idm-srcs li { padding: 5px 0; border-bottom: 1px solid #eee8dd; }
.idm-srcs a { color: var(--idm-accent2-ink); }
.idm-srcs span { display: block; color: var(--idm-dim); }
.idm-svg.has-unit .idm-unit.in-sel:not(.is-selp) { opacity: 0.6; }
.idm-svg.has-unit.hov-p .idm-unit.in-sel:not(.is-h):not(.is-rm) { opacity: 0.45; }
.idm-stats li:last-child b { min-width: 5.4ch; text-align: right; }

/* laptop widths: keep the top bar on one row beside the 400px sidebar */
.idm-title { white-space: nowrap; }
@media (min-width: 1101px) and (max-width: 1400px) {
	.idm-search { width: 210px; }
	.idm-btn-k,
	.idm-more-t { display: none; }
}

/* selected state: lifted, full colour, accent outline */
.idm-sel { pointer-events: none; }
.idm-sel-p {
	transform-box: fill-box;
	transform-origin: 50% 55%;
	transform: translateY(calc(var(--idm-k, 1) * -5px)) scale(1.02);
	filter: drop-shadow(0 calc(var(--idm-k, 1) * 7px) calc(var(--idm-k, 1) * 6px) rgba(70, 45, 25, 0.34));
	animation: idm-lift 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.idm-sel-p path { stroke: var(--idm-accent); stroke-width: calc(var(--idm-k, 1) * 1.5px); stroke-linejoin: round; }
.idm-svg.has-unit .idm-unit.in-sel:not(.is-selp) { opacity: 0.5; }
.idm-unit.is-selp { stroke-width: calc(var(--idm-k, 1) * 1.1px); stroke: #fff; }
.idm-svg.has-unit .idm-region:not(.is-sel) { opacity: 0.1; }

/* pins that would pile up or collide */
.idm-pin.is-drop { display: none; }
.idm-pin.is-nolabel .idm-pin-t { display: none; }

/* the region legend repeats the sidebar list; it is hidden so it never covers land */
.idm-legend.is-macro { display: none; }


/* hit targets are invisible: beat the generic region path styling */
.idm-region path.idm-hit,
.idm-svg path.idm-hit { fill: transparent !important; stroke: transparent !important; vector-effect: none !important; transition: none; }
