html, body {
	margin: 0;
	padding: 0;
	height: 100%;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1a1a1a;
}

:root {
	--app-header-height: 96px;
}

#app-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1200;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: clamp(10px, 2vw, 24px);
	background: #ffffff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
	padding: clamp(8px, 1.3vw, 16px) clamp(12px, 2vw, 28px);
}

#app-title {
	margin: 0;
	font-weight: 700;
	font-size: clamp(14px, 2vw, 27px);
	line-height: 1.25;
	color: #1a1a1a;
}

#app-logo {
	height: clamp(28px, 5vw, 56px);
	width: auto;
	display: block;
}

#map-stage {
	position: absolute;
	top: var(--app-header-height);
	bottom: 0;
	left: 0;
	width: 100%;
	z-index: 0;
	background: #e8e8e8;
	overflow: hidden;
}

.map-instance {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
}

#map-historical {
	z-index: 0;
}

#map-future {
	z-index: 1;
	pointer-events: none;
}

#map-attribution {
	position: absolute;
	right: 0;
	bottom: 0;
	z-index: 700;
	background: rgba(255, 255, 255, 0.75);
	padding: 0 6px;
	font-size: 11px;
	line-height: 1.6;
	max-width: 92%;
	text-align: right;
}

#map-attribution a {
	color: #0078A8;
}

#swipe-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0;
	border-left: 2px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
	z-index: 850;
	pointer-events: none;
}

#swipe-handle {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: clamp(26px, 2.2vw, 34px);
	height: clamp(26px, 2.2vw, 34px);
	border-radius: 50%;
	background: #fff;
	border: 2px solid #2563eb;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.4);
	cursor: ew-resize;
	pointer-events: all;
}

/* if no mouse controls */
#swipe-handle:focus-visible {
	outline: 3px solid #1d4ed8;
	outline-offset: 3px;
}

#swipe-handle::before {
	content: "\2194";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -58%);
	line-height: 1;
	font-size: clamp(13px, 1.2vw, 18px);
	font-weight: 900;
	color: #2563eb;
	-webkit-text-stroke: 0.6px #2563eb;
}

.period-label {
	position: absolute;
	top: calc(var(--app-header-height) + 12px);
	z-index: 900;
	background: rgba(255, 255, 255, 0.85);
	padding: clamp(5px, 0.6vw, 8px) clamp(10px, 1.6vw, 20px);
	border-radius: 6px;
	font-size: clamp(14px, 2vw, 26px);
	font-weight: 600;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
	pointer-events: none;
	max-width: 44vw;
	overflow-wrap: break-word;
}

#period-label-left { left: 12px; }
#period-label-right {
	right: 12px;
	pointer-events: auto;
}

#rcp85-link {
	color: inherit;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 2px;
	cursor: pointer;
}

#rcp85-link:hover,
#rcp85-link:focus-visible {
	color: #2563eb;
}

/* move zoom in and out buttons below the title header */
.leaflet-control-zoom {
	margin-top: var(--zoom-control-top-offset, 70px) !important;
}

/* add shp or kml */
.leaflet-control-add-layer a {
	font-size: 18px;
	font-weight: bold;
	line-height: 26px;
	text-align: center;
}

/* reopen terms of use */
.leaflet-control-info a {
	font-size: 16px;
	font-weight: bold;
	line-height: 26px;
	text-align: center;
}

/* layer control */
.control-panel {
	position: absolute;
	z-index: 900;
	background: rgba(255, 255, 255, 0.95);
	border-radius: 0.6em;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35);
	padding: 0.77em 0.92em;
	max-width: min(420px, 90vw);
	font-size: clamp(13px, 1.35vw, 19.5px);
	max-height: calc(100vh - var(--app-header-height) - 100px);
	overflow-y: auto;
}

.bottom-left {
	left: 12px;
	bottom: 24px;
}

.bottom-right {
	right: 12px;
	bottom: 24px;
}

.panel-title {
	font-weight: 700;
	margin-bottom: 0.46em;
	font-size: 0.92em;
	letter-spacing: 0.02em;
	color: #444;
}

/* collapsible panel headers (legend/layer panel & temporal mean panel) */
.panel-header-row {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.panel-header-row-left {
	justify-content: flex-start;
}

.panel-header-row-spread {
	justify-content: space-between;
}

.panel-title-inline {
	margin-bottom: 0;
}

.panel-minimize-control {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

.panel-minimize-label {
	font-weight: 700;
	font-size: 0.92em;
	letter-spacing: 0.02em;
	color: #444;
	white-space: nowrap;
}

.panel-collapse-btn {
	flex-shrink: 0;
	width: 1.7em;
	height: 1.7em;
	line-height: 1;
	border: 1px solid #bbb;
	background: #f4f4f4;
	border-radius: 0.4em;
	cursor: pointer;
	font-size: 0.95em;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #333;
	transition: transform 0.15s ease;
}

.panel-collapse-btn:hover {
	background: #e6e6e6;
}

#layer-panel-body,
#season-panel-body {
	margin-top: 0.77em;
	overflow: hidden;
}

.control-panel.collapsed .panel-collapse-btn {
	transform: rotate(-90deg);
}

#layer-panel.collapsed #layer-panel-body,
#season-panel.collapsed #season-panel-body {
	display: none;
}

.control-panel.collapsed {
	max-width: none;
	width: auto;
}

#season-panel.collapsed .panel-title-inline {
	display: none;
}

.panel-note:not(:empty) {
	margin-top: 0.46em;
	min-height: 1.08em;
}

.detail-note {
	color: #555;
}

.panel-row {
	margin-bottom: 0.77em;
}

.panel-row:last-child {
	margin-bottom: 0;
}

.field-label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.3em;
	font-size: 0.92em;
}

.threshold-heading {
	font-size: 1em;
	font-weight: 600;
	margin-bottom: 0.3em;
}

.button-row {
	display: flex;
	gap: 0.3em;
	flex-wrap: wrap;
}

.season-btn {
	flex: 1 1 auto;
	padding: 0.46em 0.6em;
	font-size: 0.92em;
	border: 1px solid #bbb;
	background: #f4f4f4;
	border-radius: 0.4em;
	cursor: pointer;
	white-space: nowrap;
}

.season-btn:hover {
	background: #e6e6e6;
}

.season-btn.active {
	background: #2563eb;
	border-color: #1d4ed8;
	color: #fff;
}

.season-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

#layer-select {
	width: 100%;
	padding: 0.38em;
	font-size: 1em;
	border-radius: 0.4em;
	border: 1px solid #bbb;
}

#speed-height-select {
	width: 100%;
	padding: 0.38em;
	font-size: 1em;
	border-radius: 0.4em;
	border: 1px solid #bbb;
}

#threshold-slider,
#shear-threshold-slider {
	width: 100%;
	height: 1.2em;
}

.legend-content {
	display: flex;
	flex-direction: column;
	gap: 0.3em;
}

.legend-row {
	display: flex;
	align-items: center;
	gap: 0.46em;
	font-size: 0.85em;
}

.legend-swatch {
	width: 1.08em;
	height: 1.08em;
	border-radius: 0.2em;
	flex-shrink: 0;
	border: 1px solid rgba(0, 0, 0, 0.2);
}

.switch-label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	font-weight: 600;
}

.switch {
	position: relative;
	display: inline-block;
	width: 2.9em;
	height: 1.5em;
	flex-shrink: 0;
	cursor: pointer;
}

.switch input {
	opacity: 0;
	width: 0;
	height: 0;
}

.slider-toggle {
	position: absolute;
	cursor: pointer;
	top: 0; left: 0; right: 0; bottom: 0;
	background-color: #ccc;
	transition: 0.15s;
	border-radius: 1.5em;
}

.slider-toggle::before {
	position: absolute;
	content: "";
	height: 1.08em;
	width: 1.08em;
	left: 0.2em;
	bottom: 0.23em;
	background-color: white;
	transition: 0.15s;
	border-radius: 50%;
}

.switch input:checked + .slider-toggle {
	background-color: #2563eb;
}

.switch input:checked + .slider-toggle::before {
	transform: translateX(1.38em);
}

#loading-indicator {
	position: absolute;
	top: calc(var(--app-header-height) + 20px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 1000;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	padding: 5px 14px;
	border-radius: 14px;
	font-size: 12px;
}

.hidden {
	display: none !important;
}

/* terms of use to scroll within one column */
.modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.modal-box {
	background: #fff;
	border-radius: 10px;
	max-width: 520px;
	width: 100%;
	max-height: 90vh;
	padding: clamp(16px, 3vw, 24px) clamp(18px, 3.5vw, 28px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
	font-size: clamp(13px, 1.6vw, 15px);
	line-height: 1.5;
	overflow-y: auto;
}

.modal-box h2 {
	margin-top: 0;
	font-size: clamp(17px, 2.2vw, 20px);
}

.modal-checkbox-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 16px 0;
	font-size: clamp(12px, 1.5vw, 14px);
	cursor: pointer;
}

#disclaimer-dismiss-btn {
	display: block;
	width: 100%;
	padding: 10px;
	font-size: clamp(13px, 1.6vw, 15px);
	font-weight: 600;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
}

#disclaimer-dismiss-btn:hover {
	background: #1d4ed8;
}

/* info icons for speed, shear */
.info-icon {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #e5e7eb;
	color: #444;
	font-size: 14px;
	font-style: normal;
	cursor: help;
	vertical-align: middle;
	margin-left: 4px;
}

.info-icon:hover,
.info-icon:focus {
	background: #d1d5db;
}

.info-icon::after {
	content: attr(data-tooltip);
	position: absolute;
	bottom: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	width: max-content;
	max-width: 210px;
	background: #1a1a1a;
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	font-weight: 400;
	padding: 0.55em 0.7em;
	border-radius: 0.4em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.12s ease;
	z-index: 1300;
	white-space: normal;
}

.info-icon:hover::after,
.info-icon:focus::after,
.info-icon:focus-visible::after {
	opacity: 1;
	visibility: visible;
}

.turbine-cluster-icon {
	background: transparent !important;
}

/* ---- begin phone layout option - begin phone layout option ---- */

@media (max-width: 640px) {
	#app-header {
		padding: 6px 10px;
		gap: 8px;
	}

	#app-title {
		font-size: clamp(11px, 3.6vw, 16px);
	}

	#app-logo-placeholder {
		min-width: 64px;
		height: 28px;
		font-size: 9px;
	}

	.control-panel {
		max-width: none;
		font-size: clamp(12px, 3.2vw, 15px);
	}

	.bottom-left {
		left: 8px;
		right: auto;
		bottom: 8px;
		width: 34vw;
		padding: 0.6em 0.7em;
	}

	.bottom-right {
		left: calc(34vw + 16px);
		right: 8px;
		bottom: 8px;
		max-height: 55vh;
		overflow-y: auto;
		padding: 0.6em 0.7em;
	}

	.control-panel.collapsed {
		left: auto;
		max-height: none;
		overflow: visible;
	}

	.button-row {
		flex-direction: column;
	}

	.period-label {
		font-size: clamp(11px, 3vw, 15px);
		padding: 4px 8px;
		max-width: 46vw;
		top: calc(var(--app-header-height) + 8px);
	}

	#period-label-left { left: 8px; }
	#period-label-right { right: 8px; }

	.info-icon::after {
		max-width: 150px;
	}
}