:root {
	--color-bg: #0d1117;
	/* --color-panel-bg: #161b22; */
	--color-panel-bg: #0d1117;
	/* --color-panel-bg: #3D065F; */
	--color-text: #e6edf3;
	--color-text-muted: #8b949e;
	--color-border: #30363d;

	/* --color-allows-x: #3ddc97; */
	--color-allows-x: #6a3cbc;
	--color-no-x: #f78f1e;
	--color-unclear: #5da0dc;

	--first-color: #461b93;
	--second-color: #6a3cbc;
	--third-color: #8253d7;
	--fourth-color: #f78f1e;

	--space-xs: 0.25rem;
	--space-sm: 0.5rem;
	--space-md: 1rem;
	--space-lg: 1.5rem;
	--radius: 0.5rem;
}


html,
body {
	height: 100%;
}

body {
	margin: 0;
}

.app {
	height: 100vh;
	display: grid;
	grid-template-columns: 20rem 1fr;
}

#map {
	height: 100%;
	flex: 1;
}

/* add styles for h3 */
h3 {
	margin: 0.5rem 0;
	color: var(--color-panel-bg);

}

.basemap-tint {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: var(--first-color);
	mix-blend-mode: screen;
	/* opacity: 0.55; */
}

body {
	margin: 0;
	font-family: system-ui, sans-serif;
	color: var(--color-text);
	gap: var(--space-md);
}

.header-float {
	position: fixed;
	top: 0.75rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1200;
	pointer-events: none;
}

.header-pill {
	pointer-events: auto;
	display: inline-block;
	max-width: min(56rem, 92vw);
	padding: 0.5rem 0.875rem;
	/* text-align: center; */
	color: var(--color-panel-bg);

}

.header-pill h1 {
	font-family: 'Ranade', sans-serif;
	font-weight: 600;
	color: var(--first-color);
	margin: 0;
	font-size: 2rem;
	line-height: 1.2;

}

.header-pill .sub {
	/* margin-top: 0.3rem; */
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--first-color);
	font-family: 'Ranade', sans-serif;
}

.leaflet-top.leaflet-left {
	margin-top: 3.25rem;
}

.leaflet-top.leaflet-right {
	margin-top: 3.25rem;
}

@media (max-width: 48rem) {
	.header-pill {
		padding: 0.5rem 0.75rem;
	}

	.header-pill h1 {
		font-size: 1.05rem;
	}

	.leaflet-top.leaflet-left,
	.leaflet-top.leaflet-right {
		margin-top: 2.5rem;
	}
}

.app {
	display: flex;
	height: 100vh;
}

.sidebar {
	width: 20rem;
	overflow-y: auto;
	background-color: var(--color-panel-bg);
	border-right: 1px solid var(--color-border);
	display: flex;
	flex-direction: column;
	padding: var(--space-md);
	transition: width .2s ease, padding .2s ease, border-color .2s ease;
}

.panel {
	background-color: var(--color-panel-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: var(--space-md);
	margin-bottom: var(--space-md);
}

.badge {
	display: inline-block;
	background-color: var(--color-bg);
	color: var(--color-text);
	padding: var(--space-xs) var(--space-sm);
	border-radius: var(--radius);
	font-size: 0.85rem;
	border: 1px solid var(--color-border);
}

.legend {
	display: flex;
	flex-direction: column;
	gap: var(--space-sm);
}

.legend .item {
	display: flex;
	align-items: center;
	gap: var(--space-sm);
}

.swatch {
	width: 1rem;
	height: 1rem;
	border-radius: 0.2rem;
	display: inline-block;
}

.swatch-allows-x {
	background-color: var(--color-allows-x);
}

.swatch-no-x {
	background-color: var(--color-no-x);
}

.swatch-unclear {
	background-color: var(--color-unclear);
}

.controls label {
	display: block;
	margin: var(--space-sm) 0;
}

.btn {
	background-color: var(--fourth-color);
	color: var(--color-bg);
	border: none;
	padding: var(--space-sm) var(--space-md);
	border-radius: var(--radius);
	cursor: pointer;
	font-weight: bold;
	margin-top: var(--space-sm);
	width: 100%;
}

.btn:hover {
	opacity: 0.9;
}

.table-summary {
	cursor: pointer;
	color: var(--color-text);
}

.table-container {
	overflow-x: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	color: var(--color-text);
}

th,
td {
	border: 1px solid var(--color-border);
	padding: var(--space-xs);
	font-size: 0.85rem;
}

th {
	background-color: var(--color-bg);
}

.foot {
	margin-top: auto;
	font-size: 0.75rem;
	color: var(--color-text-muted);
}

.pill {
	display: inline-block;
	padding: 0.25rem 0.5rem;
	border-radius: 0.25rem;
	margin-right: 0.25rem;
	margin-bottom: 0.25rem;
}

.popup {
	line-height: 1.5;
}

/* .burger {
	display: none;
} */
.burger {
	display: none;
	align-items: center;
	justify-content: center;
	font: inherit;
	line-height: 1;
	padding: 0.25rem 0.5rem;
	border-radius: 0.5rem;
	border: 0.0625rem solid var(--color-border, #30363d);
	background: transparent;
	color: var(--color-text, #e6edf3);
	z-index: 1400;
	/* above map/tiles */
}


.header-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.header-row h1 {
	margin: 0;
}

/* === Mobile rules (< 900px) === */
@media (max-width: 56.25rem) {

	/* 900px */
	/* Mobile default: sidebar collapsed */
	.app {
		grid-template-columns: 0 1fr;
	}

	.sidebar {
		width: 0;
		padding: 0;
		border: none;
		overflow: hidden;
	}

	/* When user opens it, show a compact width (tweak as you like) */
	body.sidebar-open .app {
		grid-template-columns: 16rem 1fr;
	}

	body.sidebar-open .sidebar {
		width: auto;
		padding: var(--space-md, 1rem);
		border: 0.0625rem solid var(--color-border, #30363d);
	}

	/* Show the burger on mobile */
	.burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Nudge Leaflet controls a bit if needed when header overlaps */
	.leaflet-top.leaflet-left,
	.leaflet-top.leaflet-right {
		margin-top: 3rem;
	}
}