/* ----------------- Base ----------------- */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600&family=Source+Code+Pro:wght@400;500&display=swap');

html,
body {
	height: 100%;
	margin: 0;
	font-family: 'Source Sans 3', sans-serif;
	overflow: hidden;
}

#loadFailBanner {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	z-index: 3000;
	max-width: 420px;
	background: #fff;
	border: 2px solid #c0392b;
	border-radius: 6px;
	padding: 20px 24px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: #1a2332;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	text-align: center;
}

#loadFailBanner strong {
	display: block;
	margin-bottom: 8px;
	font-size: 16px;
}

/* Skip link */
.skip-link {
	position: absolute;
	left: -999px;
	top: 0;
	background: #000;
	color: #fff;
	padding: 8px;
	z-index: 1000;
}

.skip-link:focus {
	left: 10px;
}

/* Screen-reader-only */
.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}

/* Focus */
:focus-visible {
	outline: 2px solid #0077cc;
	outline-offset: 2px;
}



/* ----------------- Top Bar ----------------- */
.top-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
	display: flex;
	align-items: center;
	gap: 0;
	height: 80px;
	padding-top: 5px;
	background: #ffffff;
	border-bottom: 3px solid #0077cc;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

.top-left {
	display: flex;
	align-items: center;
	padding: 0 16px;
	height: 100%;
	background: #ffffff;
	flex-shrink: 1;
	min-width: 0;
}

.top-left .logo {
	height: 50px;
	width: auto;
	display: block;
	max-width: 160px;
	object-fit: contain;
	flex-shrink: 1;
	min-width: 24px;
}

@media (max-width: 1100px) {
	.top-left {
		padding: 0 10px;
	}

	.top-left .logo {
		height: 36px;
		max-width: 100px;
	}

	.top-bar {
		overflow-x: auto;
	}
}

.top-right {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	padding: 0 16px;
	height: 100%;
	flex-shrink: 0;
}

.awesomplete {
	width: 100%;
}

.awesomplete ul {
	position: fixed !important;
	/* escapes overflow clipping */
	z-index: 9999;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	margin: 0;
	padding: 0;
	list-style: none;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 13px;
	max-height: 200px;
	overflow-y: auto;
}

.awesomplete li {
	padding: 8px 12px;
	cursor: pointer;
	color: #1a2332;
}

.awesomplete li:hover,
.awesomplete li[aria-selected="true"] {
	background: #e8f4ff;
	color: #0077cc;
}

.awesomplete mark {
	background: transparent;
	color: #0077cc;
	font-weight: 600;
}

body>ul[role="listbox"] {
	list-style: none;
	margin: 0;
	padding: 4px 0;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	font-family: 'Source Sans 3', sans-serif;
	font-size: 13px;
	max-height: 200px;
	overflow-y: auto;
}

body>ul[role="listbox"] li {
	list-style: none;
	padding: 7px 12px;
	cursor: pointer;
	color: #1a2332;
}

body>ul[role="listbox"] li:hover,
body>ul[role="listbox"] [aria-selected="true"] {
	background: #e8f4ff;
	color: #0077cc;
}

body>ul[role="listbox"] mark {
	background: transparent;
	color: #0077cc;
	font-weight: 600;
}

#helpBtn,
#feedbackBtn {
	background: transparent;
	border: 1px solid #2d3f52;
	color: #7a9bb5;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 14px;
	border-radius: 3px;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: all 0.15s;
	white-space: nowrap;
}



#helpBtn:hover,
#feedbackBtn:hover {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}


/* Help Modal */
.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2000;
}

.modal[hidden] {
	display: none;
}


.modal-content {
	background: #fff;
	width: 500px;
	max-width: 90vw;
	border-radius: 4px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
	overflow: hidden;
}

#helpModal .modal-content {
	width: 600px;
}

#regModal {
	z-index: 2100;
}

.registration-section h3 {
	margin-bottom: 8px;
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 20px;
	background: #1a2332;
	border-bottom: 2px solid #0077cc;
}

.modal-header h2 {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #e8f0f7;
	letter-spacing: 0.03em;
}

.modal-body img {
	display: block;
	margin: 0 auto 20px;
	max-width: 350px;
	height: auto;
}

#helpClose,
#exportClose,
#regClose {
	background: none;
	border: none;
	font-size: 20px;
	color: #ffffff;
	cursor: pointer;
	padding: 4px 8px;
	line-height: 1;
	transition: color 0.2s;
}

#helpClose:hover,
#exportClose:hover,
#regClose:hover {
	background-color: red;
	color: #ffffff;
}


.help-btn-wrapper {
	display: flex;
	align-items: center;
	padding: 0 12px;
	height: 100%;
	margin-left: auto;
	flex-shrink: 0;
	border-left: 1px solid #2d3f52;
}

.modal-body {
	padding: 20px;
	font-size: 14px;
	line-height: 1.6;
	color: #333;
}

.modal-body p {
	margin: 0 0 12px;
}

.modal-body ul {
	margin: 0 0 12px;
	padding-left: 18px;
}

.modal-body li {
	margin-bottom: 6px;
}

/* ----------------- Filters ----------------- */
.filters {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 0 12px;
	height: 100%;
	overflow-x: auto;
	scrollbar-width: none;
	margin-bottom: 15px;
}

.filters::-webkit-scrollbar {
	display: none;
}

.filter-group {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 0 12px;

	height: 100%;
	border-right: 1px solid #2d3f52;
	flex: 1;
	min-width: 100px;
	position: relative;
}

.filter-group:first-child {
	border-left: 1px solid #2d3f52;
}

.filter-group label,
.filter-group .filter-label {
	display: block;
	font-size: 0.8vw;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #5d7f99;
	margin-bottom: 3px;
	white-space: nowrap;
}

.filter-label {
	font-size: 1.1vw !important;
}

.filter-group input[type="text"],
.filter-group select {
	width: 100%;
	background: transparent;
	border: none;
	border-bottom: 1px solid #2d3f52;
	color: #929292;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.95vw;
	font-weight: 500;
	padding: 0;
	outline: none;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: border-color 0.15s;
}

.filter-group input[type="text"]::placeholder {
	color: #929292;
	font-style: italic;
}

.filter-group input[type="text"]:focus,
.filter-group select:focus {
	border-bottom-color: #0077cc;
}

/* Custom dropdown arrow */
.filter-group select {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a9bb5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 2px center;
	padding-right: 16px;
}

/* Multi-select height */
.filter-group select[multiple] {
	size: 1;
	height: 24px;
	overflow-y: auto;
	max-height: 100px;
}

/* Disabled state */
.filter-group select:disabled {
	color: #929292 !important;
	border-bottom-color: #1e2f3f;
	cursor: not-allowed;
	background-image: none;
}

/* Option styling (limited browser support but helps where it works) */
.filter-group select option {
	background: rgb(255, 255, 255);
	color: #000000;
}

/* Lake name typed text — darker than placeholder */
.filter-group input[type="text"] {
	color: #929292;
	/* default/placeholder color */
}

.filter-group input[type="text"]:not(:placeholder-shown) {
	color: #141414;
	/* darker when something is typed */
}

#filter-name {
	height: 23px;
	cursor: text;
}

body>ul[role="listbox"] li.no-results-item,
body>ul[role="listbox"] li.no-results-item:hover {
	color: #888;
	font-style: italic;
	cursor: default;
	background: transparent;
	pointer-events: none;
}

/* Select — darker text when something is selected */
.filter-group select:has(option:checked:not([value=""])) {
	color: #000000;
}

/* Clear buttons */
.clear-btn {
	background: none;
	border: none;
	cursor: pointer;
	color: #455b70;
	font-size: 18px;
	padding: 0;
	position: absolute;
	top: 8px;
	right: 12px;
	line-height: 1;
	transition: color 0.15s;
}

.clear-btn:hover {
	color: #e05c5c;
}

.top-right {
	display: flex;
	align-items: center;
	padding: 0 16px;
	height: 100%;
	flex-shrink: 0;
}

#exportMapBtn {
	background: #ffffff;
	color: #000000;
	border: 1px solid #c7c7c7;
	border-radius: 4px;
	font-family: 'Source Sans 3', sans-serif;
	padding: 6px 12px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: all 0.15s;
}

#exportMapBtn:hover {
	background: #0077cc;
	color: #ffffff;
	border-color: #0077cc;
}

/* ----------------- Layout ----------------- */
.app-container {
	display: flex;
	height: calc(100vh - 88px);
	max-height: calc(100vh - 88px);
	margin-top: 60px;
	overflow: hidden;
	position: relative;
}

/* ----------------- Side Panel ----------------- */
.side-panel {
	position: relative;
	width: 600px;
	min-width: 375px;
	max-width: 1600px;
	background: #c7e2fd;
	border-right: 3px solid #0077cc;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	height: 100%;
	min-height: 0;
	padding-left: 10px;
}

.panel-content {
	flex: 1;
	overflow-y: auto;
	overflow-x: visible;
	min-height: 0;
}

.panel-handle {
	position: absolute;
	left: 600px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	width: 36px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #d0d8e0;
	border-left: none;
	border-radius: 0 4px 4px 0;
	cursor: pointer;
	box-shadow: 2px 0 6px rgba(0, 0, 0, 0.08);
}

.panel-handle:focus {
	outline: 2px solid #0077cc;
}

.panel-handle:hover {
	outline: 2px solid #0077cc;
}

.toggle-btn {
	position: absolute;
	top: 10px;
	right: -30px;
	width: 30px;
	height: 30px;
	cursor: pointer;
	background: #fff;
	border: 1px solid #d0d8e0;
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.resize-handle {
	position: absolute;
	top: 0;
	right: 0;
	width: 4px;
	height: 100%;
	cursor: ew-resize;
	background: transparent;
	transition: background 0.15s;
}

.resize-handle:hover {
	background: #0077cc44;
}

#panelTitle {
	margin: 16px 0px 8px 0px;
	font-size: 32px;
	font-family: 'Source Sans 3', sans-serif;

}

#lake-counter {
	font-size: 30px;
	margin: 4px;
	text-align: center;
	border: 1px solid #6b6b6b;
	border-radius: 4px;
}

.panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.panel-header h2 {
	margin: 16px 0px 8px 0px;
	font-size: 32px;
	font-family: 'Source Sans 3', sans-serif;
}

.header-actions {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-shrink: 0;
}

.share-wrapper {
	position: relative;
}

#exportCsvBtn {
	margin-right: 5px;
}

.export-option {
	padding: 8px 0;
}

.export-option h3 {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 600;
	color: #1a2332;
}

.export-option p {
	margin: 0 0 12px;
	font-size: 13px;
	color: #4a6278;
	line-height: 1.5;
}

.export-action-btn {
	background: #0077cc;
	border: 1px solid #0077cc;
	color: #fff;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 15px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 3px;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: all 0.15s;
}

.export-action-btn:hover {
	background: #005fa3;
	border-color: #005fa3;
}

.export-action-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.export-divider {
	border: none;
	border-top: 1px solid #e0e6ec;
	margin: 12px 0;
}

#shareBtn,
#exportCsvBtn {
	background: transparent;
	border: 1px solid #2d3f52;
	color: #4a6b85;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 3px;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: all 0.15s;
	white-space: nowrap;
	height: 35px;
}

#shareBtn:hover,
#exportCsvBtn:hover {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}

#exportCsvBtn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

#shareToast {
	position: absolute;
	top: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	background: #1a2332;
	color: #fff;
	padding: 8px 16px;
	border-radius: 4px;
	font-size: 13px;
	font-family: 'Source Sans 3', sans-serif;
	opacity: 0;
	transition: opacity 0.3s;
	pointer-events: none;
	white-space: nowrap;
}

#shareToast.visible {
	opacity: 1;
}


/* --- Accordion --- */
.filter-accordion {
	display: flex;
	flex-direction: column;
	padding: 8px 0;
	overflow: visible;
}

.accordion-group {
	border-bottom: 1px solid #ffffff;
}

.accordion-header {
	width: 100%;
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 10px 16px;
	background: #002d5a;
	border: none;
	cursor: pointer;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #ffffff;
	text-align: left;
	transition: background 0.15s;
	border-bottom: 1px solid #6b6b6b;
	box-sizing: border-box;
	/* add this */
	gap: 8px;
	overflow: hidden;
	/* add this */
}

.accordion-header span:nth-child(2) {
	flex: 1;
	/* title takes remaining space */
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.accordion-header-right {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
	/* never shrink */
}

.accordion-clear-btn {
	background: none;
	border: none;
	color: #ccdce9;
	font-size: 12px;
	cursor: pointer;
	padding: 2px 6px;
	border-radius: 3px;
	line-height: 1;
	transition: all 0.15s;
}

.accordion-clear-btn:hover {
	background: #ff4444;
	color: #fff;
}

.accordion-header:hover {
	background: #75baff;
}

.accordion-header[aria-expanded="true"] {
	background: #ececec;
	color: #0077cc;
}

.accordion-header[aria-expanded="true"] .accordion-clear-btn {
	color: #00111d;
}

.accordion-arrow {
	font-size: 20px;
	transition: transform 0.2s;
	color: #7a9bb5;
}

.accordion-header[aria-expanded="true"] .accordion-arrow {
	transform: rotate(90deg);
}

.sub-accordion-title {
	margin: 0 0 8px;
}

.accordion-body {
	display: none;
	flex-direction: column;
	padding: 10px 16px 16px;
	background: #f9fafb;
	overflow: visible;
}

.accordion-body.open {
	display: flex;
	overflow: visible;
}

/* --- Side filters --- */
.side-filter {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding-bottom: 10px;
	border-bottom: 1px solid #b4b4b4;
	overflow: visible;
}

.side-filter-label {
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7a9bb5;
}

.side-filter-header {
	display: flex;
	align-items: center;
	gap: 6px;
}

.side-filter-header .accordion-clear-btn {
	margin-left: auto;
}

.info-icon-wrapper {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.info-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1.5px solid #7a9bb5;
	color: #7a9bb5;
	font-size: 11px;
	font-weight: 700;
	cursor: pointer;
	line-height: 1;
	transition: all 0.15s;
	user-select: none;
	flex-shrink: 0;
}

.info-icon:hover {
	border-color: #0077cc;
	color: #0077cc;
	background: #e8f4ff;
}

.info-tooltip {
	display: none;
	position: fixed;
	z-index: 9999;
	background: #1a2332;
	color: #e8f0f7;
	font-size: 13px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	padding: 8px 10px;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
	pointer-events: none;
	line-height: 1.35;
	white-space: normal;
	max-width: 280px;
	width: max-content;
}

/* --- Multi-select buttons --- */
.multi-btn-group {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.filter-btn {
	padding: 3px 10px;
	font-size: 15px;
	font-family: 'Source Sans 3', sans-serif;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 12px;
	cursor: pointer;
	color: #3a5268;
	transition: all 0.15s;
	white-space: nowrap;
}

.filter-btn:hover {
	border-color: #0077cc;
	color: #0077cc;
}

.filter-btn.active {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}

.huc12-search {
	width: 100%;
	padding: 4px 8px;
	font-size: 14px;
	font-family: 'Source Sans 3', sans-serif;
	border: 1px solid #c0cdd8;
	border-radius: 3px;
	outline: none;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

.huc12-search:focus {
	border-color: #0077cc;
}

.huc-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 6px;
	margin-top: 6px;
	font-size: 12px;
	line-height: 1.4;
	color: #3a5268;
}

.huc-crumb {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
}

.huc-crumb-level {
	font-weight: 600;
	color: #7a9bb5;
	letter-spacing: 0.03em;
}

.huc-crumb-sep {
	color: #a8b8c8;
	font-weight: 700;
}

/* --- Species search --- */
.species-name-toggle {
	display: flex;
	gap: 4px;
	margin-bottom: 6px;
}

.name-toggle-btn {
	padding: 3px 10px;
	font-size: 12px;
	font-family: 'Source Sans 3', sans-serif;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 12px;
	cursor: pointer;
	color: #3a5268;
	transition: all 0.15s;
}

.name-toggle-btn.active {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}

.selected-species-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 6px;
}

.species-tag {
	display: flex;
	align-items: center;
	gap: 4px;
	background: #e8f4ff;
	border: 1px solid #0077cc;
	border-radius: 12px;
	padding: 2px 8px;
	font-size: 12px;
	color: #0077cc;
	font-family: 'Source Sans 3', sans-serif;
}

.species-tag-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #0077cc;
	font-size: 12px;
	padding: 0;
	line-height: 1;
}

.species-tag-remove:hover {
	color: #e05c5c;
}

#ais-species-search {
	width: 100%;
	padding: 4px 8px;
	font-size: 12px;
	font-family: 'Source Sans 3', sans-serif;
	border: 1px solid #c0cdd8;
	border-radius: 3px;
	outline: none;
	transition: border-color 0.15s;
	box-sizing: border-box;
}

#ais-species-search:focus {
	border-color: #0077cc;
}

#clearAISSpecies {
	color: #6b6b6b;
}

.species-logic-toggle {
	display: flex;
	gap: 4px;
	margin-left: auto;
}

.logic-toggle-btn {
	padding: 3px 10px;
	font-size: 12px;
	font-family: 'Source Sans 3', sans-serif;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 12px;
	cursor: pointer;
	color: #3a5268;
	transition: all 0.15s;
}

.logic-toggle-btn.active {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}

/* --- Range slider --- */
.range-slider {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.range-slider-track {
	position: relative;
	height: 4px;
	background: #d0d8e0;
	border-radius: 2px;
	margin: 8px 0;
}

.range-slider-fill {
	position: absolute;
	height: 100%;
	background: #0077cc;
	border-radius: 2px;
}

.range-slider input[type="range"] {
	position: absolute;
	width: 100%;
	height: 4px;
	appearance: none;
	background: transparent;
	pointer-events: none;
	top: 0;
	left: 0;
	margin: 0;
	padding: 0;
}

.range-slider input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #0077cc;
	border: 2px solid #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
	pointer-events: all;
	cursor: pointer;
}

.range-slider-values {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: #7a9bb5;
}

.range-slider-ticks {
	position: relative;
	height: 14px;
	margin-top: 0pxx;
	font-size: 12px;
	color: #4a6278;
}

.range-tick {
	position: absolute;
	transform: translateX(-50%);
	white-space: nowrap;
	user-select: none;
	line-height: 1;
}

.range-tick::before {
	content: "";
	display: block;
	width: 1px;
	height: 4px;
	background: #4a6278;
	margin: 0 auto 2px;
}

/* ----------------- Map ----------------- */
.map-container {
	flex: 1;
	height: 100%;
	min-height: 0;
	position: relative;
	overflow: hidden;
}

#viewDiv {
	width: 100%;
	height: 100%;
}

#loadingWheel {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	display: none;
	align-items: center;
	justify-content: center;
	pointer-events: none;
	z-index: 10;
}

.spinner {
	width: 50px;
	height: 50px;
	border: 10px solid #2d3f52;
	border-top-color: #ffe600;
	border-radius: 50%;
	animation: spin 0.7s linear infinite;
	box-shadow: 0 0 15px 4px rgb(255, 255, 255),
		0 0 30px 8px rgb(255, 255, 255);
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

#symbologyPanel {
	background: #ffffff;
	border: 1px solid #2d3f52;
	border-radius: 4px;
	padding: 8px 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.sym-label {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #7a9bb5;
}

.sym-options {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sym-btn {
	background: transparent;
	border: 1px solid #2d3f52;
	color: #7a9bb5;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 14px;
	padding: 4px 10px;
	border-radius: 3px;
	cursor: pointer;
	text-align: left;
	transition: all 0.15s;
}

.sym-btn:hover {
	background: #0077cc22;
	border-color: #0077cc;
	color: #0056a1;
}

.sym-btn.active {
	background: #0077cc;
	border-color: #0077cc;
	color: #fff;
}

.esri-legend__layer-caption {
	font-size: 18px;
	font-weight: bold;
	font-family: 'Source Sans 3', sans-serif;
}

.esri-legend__layer-cell {
	font-family: 'Source Sans 3', sans-serif;
	font-size: 16px;
}

#masterClearBtn {
	display: block;
	width: calc(100% - 200px);
	box-sizing: border-box;
	margin: 2px 100px;
	background: #c0392b;
	color: #ffffff;
	border: none;
	border-radius: 4px;
	padding: 5px 16px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	letter-spacing: 0.03em;
	transition: background 0.15s;
}

#masterClearBtn:hover {
	background: #ff8679;
}

#masterClearBtn:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: -3px;
}

#basemapControl {
	position: relative;
	font-family: 'Source Sans 3', sans-serif;
}

#basemapMainBtn {
	width: 100px;
	padding: 6px 10px;
	background: white;
	border: 1px solid #ccc;
	cursor: pointer;
	font-size: 14px;
}

#basemapMainBtn:hover {
	background: #f3f3f3;
}

#basemapMenu {
	position: absolute;
	top: 100%;
	left: 0;
	width: 100px;
	background: white;
	border: 1px solid #aaaaaa;
	border-top: none;
	display: none;
	flex-direction: column;
	z-index: 10;
}

#basemapMenu.show {
	display: flex;
}

#basemapMenu button {
	padding: 6px 10px;
	background: white;
	border: none;
	border-top: 1px solid #cfcfcf;
	text-align: left;
	cursor: pointer;
	font-size: 14px;
}

#basemapMenu button:hover {
	background: #f0f0f0;
}

.hidden {
	display: none;
}

#padusLegend {
	position: absolute;
	bottom: 20px;
	left: 20px;
	z-index: 10;
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid #2d3f52;
	border-radius: 4px;
	padding: 10px 12px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 14px;
	max-width: fit-content;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

#padusLegend[hidden] {
	display: none;
}

.padus-legend-title {
	display: block;
	font-size: 16px;
	font-weight: 600;
	color: #1a2332;
	margin-bottom: 6px;
	letter-spacing: 0.02em;
}

.padus-legend-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.padus-legend-list li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	padding: 3px 0;
	color: #3a5268;
	line-height: 1.35;
}

.padus-swatch {
	display: inline-block;
	width: 18px;
	height: 14px;
	border: 1px solid rgba(0, 0, 0, 0.25);
	flex-shrink: 0;
	margin-top: 2px;
}

.esri-popup__main-container {
	width: 325px !important;
	max-height: 800px !important;
}

.esri-popup__content {
	max-height: 400px !important;
	overflow-y: auto !important;
}

.esri-popup--is-docked-bottom-left .esri-popup__main-container {
	margin-bottom: 120px;
	margin-left: 35px;
}


.custom-legend {
	background: #fff;
	border: 1px solid #d0d8e0;
	border-radius: 4px;
	padding: 10px 12px;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 18px;
	color: #1a2332;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
	max-width: 300px;
}

.legend-section+.legend-section {
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid #e0e6ec;
}

.legend-title {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	letter-spacing: 0.02em;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 4px 0;
	padding-left: 12px;
}

.legend-symbol {
	flex-shrink: 0;
	display: inline-block;
}

/* circle */
.legend-symbol.circle {
	border-radius: 50%;
	background: var(--sym-color, rgba(0, 150, 220, 0.6));
	border: 1px solid #9b9b9b;
}

/* square */
.legend-symbol.square {
	background: var(--sym-color);
	border: 1px solid #9b9b9b;
}

/* triangle */
.legend-symbol.triangle {
	width: 0 !important;
	height: 0 !important;
	background: transparent !important;
	border-left: 10px solid transparent;
	border-right: 10px solid transparent;
	border-bottom: 16px solid var(--sym-color);
}

/* --- Multi-select dropdown styling --- */
select.ms-native {
	display: none !important;
}

.ms-dropdown {
	width: 100%;
}

.ms-toggle {
	width: 100%;
	height: 24px;
	text-align: left;
	background: transparent;
	border: none;
	border-bottom: 1px solid #2d3f52;
	color: #929292;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 0.95vw;
	font-weight: 500;
	padding: 0 16px 0 0;
	cursor: pointer;
	outline: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%237a9bb5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 2px center;
	transition: border-color 0.15s;
}

.ms-toggle:hover,
.ms-toggle:focus-visible {
	border-bottom-color: #0077cc;
}

.ms-toggle.has-value {
	color: #141414;
}

.ms-toggle:disabled {
	color: #929292;
	cursor: not-allowed;
	background-image: none;
	border-bottom-color: #1e2f3f;
}

.ms-panel {
	position: fixed;
	z-index: 9999;
	max-height: 450px;
	overflow-y: auto;
	background: #fff;
	border: 1px solid #c0cdd8;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	padding: 4px 0;
	font-family: 'Source Sans 3', sans-serif;
	font-size: 10px;
}

.ms-panel[hidden] {
	display: none;
}

.ms-option {
	display: flex;
	align-items: center;
	gap: 0;
	padding: 0px 12px;
	cursor: pointer;
	color: #1a2332;
	white-space: nowrap;
	font-size: 16px;
}

.ms-option:hover {
	background: #e8f4ff;
}

.ms-option input {
	margin: 0 12px 0 0;
	cursor: pointer;
	flex-shrink: 0;
}

/* Mobile overlay — bigger tap targets, matches the existing mobile input styling */
@media (max-width: 768px) {
	.mobile-filter-host .ms-toggle {
		font-size: 16px;
		height: auto;
		padding: 8px 24px 8px 8px;
		border: 1px solid #2d3f52;
		border-radius: 4px;
		background-color: #fff;
	}

	.mobile-filter-host .ms-option {
		padding: 10px 12px;
		font-size: 15px;
	}
}

s
/* ===================================================================
   MOBILE  (≤768px)
   Map fills screen; filters live behind a floating "Filters" button
   that opens a full-screen overlay containing the top-bar filters
   AND the side-panel accordion.
   =================================================================== */

/* Floating buttons hidden on desktop */
#mobileFilterBtn,
#mobileFilterClose,
#mobileSymBtn,
#mobileLegendBtn {
	display: none;
}

/* base: hidden on desktop */
.mobile-accordion {
	display: none;
}

@media (max-width: 768px) {

	#shareBtn,
	#exportCsvBtn,
	.share-wrapper {
		display: none !important;
	}
}

@media (max-width: 768px) {

	html,
	body {
		overflow: hidden;
		-webkit-text-size-adjust: 100%;
	}

	/* --- Top bar: single row, logo hidden, title + export --- */
	.top-bar {
		height: 56px;
		padding: 0 8px;
		gap: 8px;
		flex-direction: row;
		align-items: center;
		overflow: hidden;
	}

	/* show the logo, left of the title */
	.top-left {
		display: flex;
		align-items: center;
		padding: 0;
		flex-shrink: 0;
	}

	.top-left .logo {
		height: 60px;
		max-width: 100px;
	}

	/* moved header: title (left) + help/clear buttons (right) */
	.top-bar .panel-header {
		display: flex;
		flex-direction: row;
		align-items: center;
		flex: 1;
		min-width: 0;
		padding: 0;
		height: 56px;
	}

	.top-bar #panelTitle {
		font-size: 16px;
		margin: 0;
		flex: 1 1 auto;
		min-width: 0;
		white-space: normal;
		line-height: 1.1;
		overflow: hidden;
		text-align: center;
	}

	/* hide share + export + toast on mobile */
	.top-bar .share-wrapper,
	.top-bar #exportCsvBtn {
		display: none !important;
	}

	/* the action group sits at the far right */
	.top-bar .header-actions {
		display: flex;
		flex-direction: row;
		align-items: center;
		gap: 4px;
		flex-shrink: 0;
		margin-left: auto;
	}

	/* show the two mobile buttons */
	.top-bar #mobileHelpBtn,
	.top-bar #mobileClearBtn {
		display: inline-flex;
		align-items: center;
		background: transparent;
		border: 1px solid #2d3f52;
		color: #2d3f52;
		font-family: 'Source Sans 3', sans-serif;
		font-size: 10px;
		font-weight: 600;
		padding: 4px 7px;
		border-radius: 3px;
		cursor: pointer;
		white-space: nowrap;
		line-height: 1.2;
	}

	.top-bar #mobileClearBtn {
		border-color: #522d2d;
	}

	.top-bar #mobileClearBtn:hover {
		background: #ff0000;
		border-color: #000;
		color: #fff;
	}

	.top-bar #mobileHelpBtn:hover {
		background: #0077cc;
		border-color: #0077cc;
		color: #fff;
	}

	/* --- Map fills the area under the top bar --- */
	.app-container {
		height: calc(100vh - 56px);
		max-height: calc(100vh - 56px);
		margin-top: 56px;
		display: block;
	}

	.map-container {
		width: 100%;
		height: 100%;
	}

	/* --- Side panel becomes a full-screen overlay --- */
	.side-panel {
		position: fixed;
		top: 56px;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100% !important;
		min-width: 0 !important;
		max-width: none !important;
		height: auto;
		z-index: 1500;
		border-right: none;
		padding-left: 0;
		padding-top: 8px;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
	}

	body.mobile-filters-open .side-panel {
		transform: translateX(0);
	}

	.panel-handle,
	.resize-handle,
	.toggle-btn {
		display: none !important;
	}

	#lake-counter {
		font-size: 22px;
	}

	/* --- Cloned top-bar filters inside the overlay --- */
	.mobile-filter-host {
		display: flex;
		flex-direction: column;
		gap: 14px;
		padding: 8px 16px 16px;
	}

	.mobile-filter-host .filter-group {
		flex-direction: column;
		border: none;
		padding: 0;
		min-width: 0;
		height: auto;
	}

	.mobile-filter-host .filter-group:first-child {
		border-left: none;
	}

	.mobile-filter-host .filter-group label,
	.mobile-filter-host .filter-label {
		font-size: 13px !important;
		margin-bottom: 4px;
	}

	.mobile-filter-host .filter-group input[type="text"],
	.mobile-filter-host .filter-group select {
		font-size: 16px;
		/* 16px stops iOS zoom-on-focus */
		border: 1px solid #2d3f52;
		border-radius: 4px;
		padding: 8px;
		background: #fff;
		width: 100%;
		box-sizing: border-box;
	}

	.mobile-filter-host .filter-group select[multiple] {
		height: auto;
		max-height: 140px;
	}

	.mobile-filter-host .clear-btn {
		top: auto;
		bottom: 8px;
		right: 8px;
	}

	.mobile-filter-host .awesomplete {
		width: 100%;
		box-sizing: border-box;
	}

	.mobile-filter-host .ms-toggle {
		padding: 8px 34px 8px 8px;
		background-position: left 300px center;
	}

	/* bigger tap targets for filter chips */
	.filter-btn {
		padding: 8px 14px;
		font-size: 15px;
	}


	/* --- Floating "Filters" button (opens overlay) --- */
	#mobileFilterBtn {
		display: flex;
		align-items: center;
		gap: 6px;
		position: fixed;
		top: 66px;
		left: 80px;
		z-index: 1200;
		background: #0077cc;
		color: #fff;
		border: none;
		border-radius: 24px;
		padding: 10px 18px;
		font-size: 15px;
		font-weight: 600;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
		cursor: pointer;
	}

	body.mobile-filters-open #mobileFilterBtn {
		display: none;
	}

	.filters .top-right {
		display: none !important;
	}

	.filters {
		display: none !important;
	}

	/* --- Close button inside overlay --- */
	#mobileFilterClose {
		display: flex;
		align-items: center;
		justify-content: center;
		position: static;
		/* was absolute */
		width: 36px;
		height: 36px;
		background: #002d5a;
		color: #fff;
		border: none;
		font-size: 18px;
		cursor: pointer;
		flex-shrink: 0;
	}

	#mobileFilterClose:hover {
		background: #ff0000;
		color: #fff;
	}

	/* put the counter + close button on one row */
	#lake-counter {
		display: flex;
		align-items: center;
		gap: 10px;
	}

	#lake-counter-value {
		flex: 1;
		text-align: center;
	}

	/* --- Symbology & Legend toggle buttons (bottom-right, stacked) --- */
	#mobileSymBtn,
	#mobileLegendBtn {
		display: inline-flex;
		align-items: center;
		gap: 4px;
		position: fixed;
		right: 12px;
		z-index: 1200;
		background: #fff;
		color: #0077cc;
		border: 1px solid #0077cc;
		border-radius: 20px;
		padding: 8px 14px;
		font-size: 13px;
		font-weight: 600;
		box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
		cursor: pointer;
	}

	#mobileSymBtn {
		bottom: 14px;
	}

	#mobileLegendBtn {
		bottom: 58px;
	}

	/* panels hidden until their button is tapped */
	#symbologyPanel {
		display: none;
	}

	body.mobile-sym-open #symbologyPanel {
		display: flex;
		position: fixed;
		top: 120px;
		right: 12px;
		z-index: 1300;
		max-width: 70vw;
	}

	.custom-legend {
		display: none !important;
	}

	body.mobile-legend-open .custom-legend {
		display: block !important;
		position: fixed !important;
		bottom: 100px;
		left: 12px;
		right: 12px;
		max-width: none;
		max-height: 45vh;
		overflow: auto;
		z-index: 1300;
	}

	/* --- Docked popup near full-width --- */
	.esri-popup__main-container {
		width: 92vw !important;
		max-width: 92vw !important;
	}

	.esri-popup--is-docked-bottom-left .esri-popup__main-container {
		margin-bottom: 12px;
		margin-left: 8px;
	}

	/* inside @media (max-width: 768px) */
	.mobile-accordion {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		box-sizing: border-box;
		padding: 12px 16px;
		background: #002d5a;
		color: #fff;
		border: none;
		border-bottom: 1px solid #6b6b6b;
		font-family: 'Source Sans 3', sans-serif;
		font-size: 15px;
		font-weight: 600;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		cursor: pointer;
	}

	.mobile-accordion .mob-arrow {
		transition: transform 0.2s;
	}

	.mobile-accordion[aria-expanded="false"] .mob-arrow {
		transform: rotate(-90deg);
	}

	/* collapse the section that follows a closed header */
	.mobile-accordion[aria-expanded="false"]+* {
		display: none !important;
	}

	.modal-content {
		background: #fff;
		width: 420px;
		max-width: 90vw;
		max-height: 90vh;
		border-radius: 4px;
		box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
		overflow: hidden;
		display: flex;
		flex-direction: column;
	}

	.modal-body {
		padding: 20px;
		font-size: 14px;
		line-height: 1.6;
		color: #333;
		overflow-y: auto;
	}

	.modal-body img {
		max-width: 100%;
		height: auto;
	}

	#exportMapBtn {
		display: none !important;
	}
}

#mobileHelpBtn,
#mobileClearBtn {
	display: none;
}