.hsv-kaart {
	--hsv-bg: #ffffff;
	--hsv-tekst: #26303a;
	--hsv-zacht: #5b6570;
	--hsv-lijn: #d8d3ca;
	--hsv-schaduw: 0 1px 5px rgba(0, 0, 0, .25);
	position: relative;
	width: 100%;
	min-height: 360px;
	border-radius: 8px;
	overflow: hidden;
	background: #eef0ee;
	font-family: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
	color: var(--hsv-tekst);
	isolation: isolate;
	/* zo kan de legenda zich aanpassen aan de hoogte van de kaart */
	container: hsvkaart / size;
}

/* donkere modus volgt de knop licht/donker van de website (klasse hsv-dark op <html>), niet de telefoon */
html.hsv-dark .hsv-kaart {
	--hsv-bg: #1d242b;
	--hsv-tekst: #e6e9ec;
	--hsv-zacht: #a9b1b9;
	--hsv-lijn: #38424c;
	--hsv-schaduw: 0 1px 6px rgba(0, 0, 0, .6);
}

.hsv-kaart.is-volledig {
	position: fixed !important;
	inset: 0;
	height: 100% !important;
	border-radius: 0;
	z-index: 99999;
}

/* paneel met lagen (legenda)
   - past altijd binnen de kaart: de rechterbovenhoek loopt tot de onderkant van de kaart
   - de kop met de knop blijft staan, alleen de inhoud scrolt
   - met de knop klap je de legenda open en dicht (telefoon en computer) */
.hsv-kaart .leaflet-top.leaflet-right {
	bottom: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

.hsv-paneel {
	display: flex;
	flex-direction: column;
	min-height: 0;
	max-height: calc(100% - 38px); /* 10px boven, ruimte voor de bronvermelding onder */
	max-width: 280px;
	overflow: hidden;
	background: var(--hsv-bg);
	color: var(--hsv-tekst);
	border-radius: 8px;
	box-shadow: var(--hsv-schaduw);
	font-size: 14px;
	line-height: 1.3;
}

.hsv-paneel-inhoud {
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 0 12px 10px;
}

.hsv-paneel.is-dicht .hsv-paneel-inhoud { display: none; }

/* schuifbalk van de legenda altijd zichtbaar (Chrome, Edge, Safari) */
.hsv-paneel-inhoud::-webkit-scrollbar { width: 8px; }
.hsv-paneel-inhoud::-webkit-scrollbar-track { background: transparent; }
.hsv-paneel-inhoud::-webkit-scrollbar-thumb { background: rgba(127, 127, 127, .55); border-radius: 4px; }

/* Firefox */
@supports not selector(::-webkit-scrollbar) {
	.hsv-paneel-inhoud { scrollbar-width: thin; scrollbar-color: rgba(127, 127, 127, .55) transparent; }
}

.hsv-knop-paneel {
	flex: none;
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	min-height: 38px;
	padding: 0 8px 0 12px;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	background: none;
	border: 0;
	border-radius: 8px;
	color: var(--hsv-tekst);
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.hsv-knop-paneel:hover { background: rgba(127, 127, 127, .08); }
.hsv-knop-paneel:focus-visible { outline: 3px solid #1c64c8; outline-offset: 2px; }

.hsv-knop-sluit {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
}

.hsv-knop-sluit b {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: rgba(127, 127, 127, .15);
	font-size: 13px;
}

/* knopstijl van het thema (Kadence) niet laten doorwerken op de kaartknoppen;
   op de telefoon blijft de "aangetikte" stand hangen en werd "Legenda" onleesbaar */
.hsv-kaart button:hover,
.hsv-kaart button:focus,
.hsv-kaart button:active { box-shadow: none; }

.hsv-knop-paneel,
.hsv-knop-paneel:hover,
.hsv-knop-paneel:focus,
.hsv-knop-paneel:active { color: var(--hsv-tekst); }

.hsv-knop-paneel:focus:not(:focus-visible) { background: none; }

.hsv-paneel .hsv-knop-open { display: none; }
.hsv-paneel.is-dicht .hsv-knop-open { display: inline; }
.hsv-paneel.is-dicht .hsv-knop-sluit { display: none; }

/* lage kaart: legenda wat compacter */
@container hsvkaart (max-height: 560px) {
	.hsv-paneel { font-size: 13px; }
	.hsv-paneel label { padding: 1px 0; }
	.hsv-paneel h3 { margin: 6px 0 2px; }
	.hsv-noot, .hsv-vispas small { font-size: 11.5px; }
}

.hsv-paneel h3 {
	font-size: 11px;
	letter-spacing: .06em;
	text-transform: uppercase;
	margin: 8px 0 4px;
	color: var(--hsv-zacht);
	font-weight: 700;
}

.hsv-paneel h3:first-of-type { margin-top: 0; }

.hsv-paneel label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 3px 0;
	cursor: pointer;
}

.hsv-paneel input { margin: 0; accent-color: #1c64c8; flex: none; }

.hsv-lijnstaal {
	display: inline-block;
	width: 22px;
	height: 5px;
	border-radius: 3px;
	flex: none;
}

.hsv-nr {
	display: inline-grid;
	place-items: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	flex: none;
}

.hsv-vispas {
	margin: 2px 0 4px;
	padding: 4px 6px;
	border-radius: 6px;
	background: rgba(232, 89, 12, .12);
	border: 1px solid rgba(232, 89, 12, .35);
}

.hsv-vispas small {
	display: block;
	color: #b8440a;
	font-weight: 700;
	font-size: 12px;
	margin: 2px 0 0;
}

html.hsv-dark .hsv-vispas small { color: #ff9a5c; }

.hsv-noot {
	display: block;
	color: var(--hsv-zacht);
	font-size: 12px;
	margin: 0 0 2px 26px;
}

.hsv-paneel select {
	width: 100%;
	font: inherit;
	padding: 3px 4px;
	border-radius: 5px;
	border: 1px solid var(--hsv-lijn);
	background: var(--hsv-bg);
	color: var(--hsv-tekst);
}

.hsv-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
}

@media (max-width: 640px) {
	.hsv-paneel {
		max-width: min(300px, calc(100vw - 90px));
		font-size: 15px;
	}
	.hsv-paneel-inhoud { padding: 0 14px 12px; }
	.hsv-paneel label { padding: 7px 0; }
	.hsv-paneel input { width: 20px; height: 20px; }
	.hsv-knop-paneel {
		min-height: 46px;
		padding: 0 10px 0 16px;
		font-size: 16px;
	}
	.hsv-knop-sluit b { width: 34px; height: 34px; font-size: 16px; }
}

/* knoppen rechtsboven */
.hsv-knoppen a {
	font-size: 16px;
	line-height: 30px;
	width: 30px;
	height: 30px;
	text-align: center;
}

/* nummers en GRO-codes op de kaart */
.hsv-nummer {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 2px solid #fff;
	color: #fff;
	font: 700 14px/1 "Source Sans 3", "Segoe UI", Arial, sans-serif;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .35);
}

.hsv-gro {
	white-space: nowrap;
	line-height: 14px !important;
	overflow: visible;
}

.hsv-gro i {
	position: absolute;
	left: -3px;
	top: -3px;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #1c64c8;
	border: 1px solid #fff;
}

.hsv-gro span {
	position: absolute;
	top: -7px;
}

.hsv-gro.is-oost span { left: 6px; }
.hsv-gro.is-west span { right: 6px; }

.hsv-gro,
.leaflet-tooltip.hsv-gro {
	background: none;
	border: 0;
	box-shadow: none;
	padding: 0;
	color: #1c64c8;
	font: 600 12px/1 "Source Sans 3", "Segoe UI", Arial, sans-serif;
	text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff;
}

.leaflet-tooltip.hsv-gro::before { display: none; }

.hsv-kaart .leaflet-popup-content-wrapper,
.hsv-kaart .leaflet-popup-tip {
	background: var(--hsv-bg);
	color: var(--hsv-tekst);
}

.hsv-popup strong { display: block; font-size: 15px; margin-bottom: 2px; }
.hsv-popup .hsv-soort { color: var(--hsv-zacht); font-size: 12px; }
.hsv-popup .hsv-regel { color: #b8440a; font-weight: 700; margin-top: 4px; }
.hsv-popup .hsv-pas { margin-top: 4px; font-size: 13px; font-weight: 600; color: #174a8c; }
.hsv-popup .hsv-bijz { margin-top: 5px; padding-top: 5px; border-top: 1px solid #e3e7ee; font-size: 12.5px; line-height: 1.35; }
.hsv-popup .hsv-codes { margin-top: 4px; font-size: 12px; color: #1c64c8; }

.hsv-hint {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, .35);
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	z-index: 1000;
	pointer-events: none;
	opacity: 0;
	transition: opacity .25s;
}

.hsv-hint.is-zichtbaar { opacity: 1; }

.hsv-kaart .leaflet-control-attribution { font-size: 10px; }

/* GRB Vlaanderen onder PDOK: alleen zichtbaar buiten Nederland, gedempt */
.hsv-buitenland { opacity: .6; }
