.benefits-page {
	color-scheme: light;
	--bg: #eef2ef;
	--surface: #fffdfa;
	--surface-quiet: #e4ebe6;
	--ink: #1f2522;
	--muted: #66726b;
	--line: #cbd7cf;
	--accent: #1f6f66;
	--accent-2: #c4512d;
	--select: #f2a51a;
	--shadow: 0 18px 42px rgba(31, 41, 35, 0.11);
	box-sizing: border-box;
	min-height: calc(100vh - 10rem);
	padding: 28px clamp(14px, 4vw, 46px) 44px;
	background: var(--bg);
	color: var(--ink);
	font-family:
		Inter,
		ui-sans-serif,
		system-ui,
		-apple-system,
		BlinkMacSystemFont,
		"Segoe UI",
		sans-serif;
}

body:has(.benefits-page) {
	overflow-x: hidden;
}

.benefits-page * {
	box-sizing: border-box;
}

.benefits-page p {
	text-align: left;
}

.benefits-header {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 520px);
	gap: 24px;
	align-items: end;
	max-width: 1540px;
	margin: 0 auto 22px;
}

.benefits-header h1 {
	max-width: 980px;
	margin: 0;
	color: var(--ink);
	font: inherit;
	font-size: clamp(38px, 6.2vw, 78px);
	font-weight: 850;
	letter-spacing: 0;
	line-height: 0.96;
	text-transform: none;
}

.benefits-header p:last-child {
	max-width: 56ch;
	margin: 0;
	color: #46524a;
	font-size: 17px;
	line-height: 1.5;
}

.eyebrow {
	margin: 0;
	color: var(--muted);
	font-size: 12px;
	font-weight: 780;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.benefits-dashboard {
	display: grid;
	grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
	gap: 18px;
	max-width: 1540px;
	margin: 0 auto;
}

.panel,
.notes {
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--surface);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.chart-panel,
.scatter-panel,
.map-panel {
	min-width: 0;
}

.map-panel {
	grid-column: 1 / -1;
}

.toolbar {
	display: grid;
	grid-template-columns: repeat(5, minmax(130px, 1fr));
	gap: 12px;
	padding: 16px;
	border-bottom: 1px solid var(--line);
	background: var(--surface-quiet);
}

.toolbar label,
.period-control {
	display: grid;
	gap: 6px;
	color: var(--muted);
	font-size: 12px;
	font-weight: 780;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.period-head {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	align-items: baseline;
}

.period-head strong {
	overflow: hidden;
	color: var(--ink);
	font-size: 13px;
	font-weight: 820;
	letter-spacing: 0;
	text-overflow: ellipsis;
	text-transform: none;
	white-space: nowrap;
}

.period-control input[type="range"] {
	width: 100%;
	min-height: 42px;
	accent-color: var(--accent);
}

.toolbar select {
	width: 100%;
	min-height: 42px;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 0 10px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0;
}

.chart-head,
.section-head {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: end;
	padding: 18px 18px 8px;
}

.chart-head h2,
.section-head h2,
.side-panel h2,
.notes h2 {
	margin: 4px 0 0;
	color: var(--ink);
	font: inherit;
	font-size: 23px;
	font-weight: 820;
	letter-spacing: 0;
	line-height: 1.12;
	text-transform: none;
}

.summary-strip {
	display: grid;
	grid-template-columns: repeat(5, minmax(92px, 1fr));
	gap: 8px;
	min-width: min(660px, 100%);
}

.summary-strip div {
	min-height: 58px;
	border: 1px solid var(--line);
	border-radius: 6px;
	padding: 8px 10px;
	background: #fff;
}

.summary-strip span,
.stat-list span,
.ranking-list small {
	display: block;
	color: var(--muted);
	font-size: 12px;
	font-weight: 720;
}

.summary-strip strong {
	display: block;
	margin-top: 4px;
	overflow: hidden;
	color: var(--ink);
	font-size: 15px;
	font-weight: 840;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.chart-wrap {
	position: relative;
	padding: 0 14px 14px;
}

.chart-wrap.compact {
	padding-top: 8px;
}

#trendChart,
#scatterChart,
#regionMap {
	display: block;
	width: 100%;
}

.axis path,
.axis line {
	stroke: #8a968f;
}

.axis text,
.axis-label,
.chart-legend text,
.dot-label {
	fill: #536059;
	font-size: 12px;
	font-weight: 680;
}

.grid line {
	stroke: #dfe7e2;
}

.grid path {
	display: none;
}

.series {
	opacity: 0.8;
}

.series.is-selected {
	opacity: 1;
}

.point,
.scatter-dot {
	cursor: pointer;
	stroke: #fffdfa;
	stroke-width: 1.5;
}

.scatter-dot {
	fill: var(--accent);
	opacity: 0.76;
}

.scatter-dot.is-selected {
	fill: var(--accent-2);
	opacity: 1;
	stroke: #1f2522;
	stroke-width: 2;
}

.tooltip {
	position: absolute;
	z-index: 4;
	display: grid;
	gap: 4px;
	max-width: 290px;
	border: 1px solid rgba(31, 37, 34, 0.18);
	border-radius: 8px;
	padding: 10px 12px;
	background: rgba(255, 253, 250, 0.97);
	box-shadow: 0 16px 36px rgba(31, 41, 35, 0.18);
	color: var(--ink);
	font-size: 13px;
	pointer-events: none;
}

.tooltip strong {
	font-size: 14px;
}

.tooltip span,
.tooltip small {
	display: block;
	color: #4d5952;
}

.side-panel {
	display: grid;
	align-content: start;
	gap: 0;
}

.side-panel section {
	padding: 18px;
	border-bottom: 1px solid var(--line);
}

.side-panel section:last-child {
	border-bottom: 0;
}

.stat-list {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}

.stat-list div {
	display: grid;
	grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1fr);
	gap: 12px;
	align-items: baseline;
	border-bottom: 1px solid #edf1ee;
	padding-bottom: 7px;
}

.stat-list strong {
	overflow-wrap: anywhere;
	font-size: 14px;
	text-align: right;
}

.ranking-list {
	display: grid;
	gap: 8px;
	margin-top: 14px;
}

.ranking-list button,
#exportCsv {
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	cursor: pointer;
}

.ranking-list button {
	display: block;
	width: 100%;
	padding: 10px;
	text-align: left;
}

.ranking-list button:hover,
.ranking-list button.active {
	border-color: var(--accent);
	background: #eef8f5;
}

.ranking-list strong {
	display: block;
	margin-top: 3px;
	font-size: 14px;
}

#exportCsv {
	min-height: 38px;
	padding: 0 14px;
	font-weight: 760;
}

#exportCsv:hover {
	border-color: var(--accent);
}

.selection-label {
	margin: 0;
	color: var(--muted);
	font-size: 13px;
	white-space: nowrap;
}

.map-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
	gap: 14px;
	padding: 0 14px 14px;
}

.map-wrap {
	position: relative;
	min-width: 0;
}

.municipality {
	stroke: rgba(255, 253, 250, 0.86);
	stroke-width: 0.55;
	cursor: pointer;
	transition:
		fill 140ms ease,
		stroke 140ms ease,
		stroke-width 140ms ease;
}

.municipality:hover {
	stroke: #005f73;
	stroke-width: 1.35;
}

.municipality.is-selected {
	stroke: var(--select);
	stroke-width: 2.4;
	filter: drop-shadow(0 0 5px rgba(242, 165, 26, 0.6));
}

.table-wrap {
	max-height: 620px;
	overflow: auto;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

th,
td {
	border-bottom: 1px solid #edf1ee;
	padding: 9px 10px;
	text-align: left;
}

th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: #f7faf8;
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
}

td:last-child,
th:last-child {
	text-align: right;
}

tr {
	cursor: pointer;
}

tr:hover,
tr.active {
	background: #eef8f5;
}

.notes {
	max-width: 1540px;
	margin: 18px auto 0;
	padding: 20px;
}

.notes article {
	max-width: 980px;
}

.notes p {
	margin: 10px 0 0;
	color: #4f5b54;
	font-size: 15px;
	line-height: 1.58;
}

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

@media (max-width: 1120px) {
	.benefits-dashboard,
	.benefits-header,
	.map-grid {
		grid-template-columns: 1fr;
	}

	.toolbar {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.chart-head {
		display: grid;
	}

	.summary-strip {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		min-width: 0;
	}
}

@media (max-width: 640px) {
	.benefits-page {
		padding: 18px 10px 32px;
	}

	.toolbar,
	.summary-strip {
		grid-template-columns: 1fr;
	}

	.section-head {
		display: grid;
		align-items: start;
	}

	.selection-label {
		white-space: normal;
	}
}
