.ke-sewer-map-page {
	max-width: 1180px;
	margin: 0 auto;
	color: #1d2830;
	font-size: 17px;
	line-height: 1.65;
}

.ke-map-intro {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 24px;
	margin: 0 0 22px;
}

.ke-map-lead {
	max-width: 820px;
	margin: 0;
	color: #172f41;
	font-size: 21px;
	font-weight: bold;
	line-height: 1.5;
}

.ke-map-frame {
	position: relative;
	box-sizing: border-box;
	border: 1px solid #cfdde4;
	background: #e9eef1;
}

.ke-map-canvas {
	width: 100%;
	height: 650px;
	background: #e9eef1;
}

.ke-map-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 900;
	transform: translate(-50%, -50%);
	padding: 11px 16px;
	border: 1px solid #b9d4dc;
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.96);
	color: #0b436d;
	font-weight: bold;
	box-shadow: 0 2px 10px rgba(8, 54, 76, 0.12);
}

.ke-map-loading[hidden] {
	display: none;
}

.ke-map-legend {
	position: absolute;
	right: 12px;
	bottom: 24px;
	z-index: 700;
	display: grid;
	grid-template-columns: 1fr;
	gap: 4px;
	min-width: 128px;
	box-sizing: border-box;
	padding: 10px 12px;
	border: 1px solid rgba(36, 57, 67, 0.25);
	border-radius: 5px;
	background: rgba(255, 255, 255, 0.94);
	color: #243943;
	font-size: 12px;
	line-height: 1.25;
	box-shadow: 0 1px 6px rgba(8, 54, 76, 0.12);
	pointer-events: auto;
}

.ke-map-legend strong {
	margin-bottom: 2px;
	color: #0b436d;
	font-size: 13px;
}

.ke-map-legend > span {
	display: flex;
	align-items: center;
	gap: 7px;
}

.ke-map-legend i {
	display: inline-block;
	flex: 0 0 auto;
	width: 18px;
	height: 10px;
	background: var(--legend-color);
}

.ke-map-legend .ke-map-legend-no-data {
	border: 1px solid #7d878e;
	background: repeating-linear-gradient(135deg, #aeb5ba 0 3px, #eef0f2 3px 6px);
}

.ke-map-legend-toggle {
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	cursor: pointer;
}

.ke-map-legend-toggle:first-of-type {
	margin-top: 3px;
	padding-top: 6px;
	border-top: 1px solid #d5dde1;
}

.ke-map-legend-toggle input {
	width: 14px;
	height: 14px;
	margin: 0;
	accent-color: #0b7f8b;
}

.ke-map-legend .ke-map-legend-layer {
	box-sizing: border-box;
	width: 18px;
	height: 10px;
	background: transparent;
}

.ke-map-legend .ke-map-legend-layer--completed {
	border: 2px solid #6d28d9;
	background: rgba(109, 40, 217, 0.12);
}

.ke-map-legend .ke-map-legend-layer--active {
	height: 0;
	border-top: 2px dashed #d81b60;
}

.ke-map-selection {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	margin: 14px 0 0;
	padding: 14px 16px;
	border: 1px solid #d4dee3;
	border-radius: 6px;
	background: transparent;
	color: #26343c;
	font-size: 15px;
	line-height: 1.45;
}

.ke-map-selection strong {
	color: #0b436d;
}

.ke-map-selection a {
	font-weight: bold;
}

.ke-map-guide,
.ke-map-methodology {
	max-width: 980px;
	margin: 42px auto 0;
}

.ke-map-guide h2,
.ke-map-methodology h2 {
	margin: 0 0 16px;
	color: #0b436d;
	font-size: 30px;
	line-height: 1.25;
}

.ke-map-guide p,
.ke-map-methodology p {
	margin: 0 0 16px;
}

.ke-map-sources {
	margin: 18px 0 0;
	padding-left: 22px;
}

.ke-map-sources li {
	margin: 0 0 8px;
}

.ke-sewer-map-page .leaflet-container {
	font-family: Helvetica, Arial, sans-serif;
	font-size: 14px;
}

.ke-sewer-map-page .leaflet-popup-content {
	min-width: 225px;
	margin: 14px 18px;
	color: #243943;
	line-height: 1.45;
}

.ke-map-popup-title {
	display: block;
	margin-bottom: 7px;
	color: #0b436d;
	font-size: 16px;
	line-height: 1.25;
}

.ke-map-popup-status {
	display: inline-block;
	margin: 0 0 8px;
	padding: 2px 7px;
	border-radius: 3px;
	background: #eaf4f7;
	color: #0b6570;
	font-size: 12px;
	font-weight: bold;
}

.ke-map-popup-status--completed {
	background: #f0e9ff;
	color: #5b21b6;
}

.ke-map-popup-status--active {
	background: #fce4ec;
	color: #ad1457;
}

.ke-map-popup-row {
	display: block;
	margin-top: 5px;
}

.ke-map-popup-note {
	display: block;
	margin-top: 8px;
	color: #52646e;
	font-size: 12px;
}

.ke-map-popup-source {
	display: inline-block;
	margin-top: 9px;
	font-weight: bold;
}

.ke-sewer-map-page .leaflet-control-attribution {
	font-size: 10px;
}

@media (max-width: 760px) {
	.ke-sewer-map-page {
		font-size: 16px;
	}

	.ke-map-intro {
		display: block;
	}

	.ke-map-lead {
		font-size: 19px;
	}

	.ke-map-canvas {
		height: 500px;
	}

	.ke-map-legend {
		right: 8px;
		bottom: 22px;
		min-width: 116px;
		padding: 8px 9px;
	}

	.ke-map-guide,
	.ke-map-methodology {
		margin-top: 34px;
	}

	.ke-map-guide h2,
	.ke-map-methodology h2 {
		font-size: 25px;
	}
}

@media (max-width: 420px) {
	.ke-map-canvas {
		height: 430px;
	}

	.ke-map-legend {
		position: static;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 6px 10px;
		width: 100%;
		border: 0;
		border-top: 1px solid #cfdde4;
		border-radius: 0;
		box-shadow: none;
		pointer-events: auto;
	}

	.ke-map-legend strong {
		grid-column: 1 / -1;
	}

	.ke-map-legend-toggle {
		grid-column: 1 / -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ke-sewer-map-page *,
	.ke-sewer-map-page *::before,
	.ke-sewer-map-page *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}
