@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=IBM+Plex+Sans:wght@300;400;600&display=swap');

:root {
	--topbar-h: 58px;
	--sidebar-w: 272px;
	--bg: #080b0e;
	--surface: #0f1318;
	--surface2: #161b22;
	--surface3: #1e242d;
	--border: #222831;
	--border2: #2d3748;
	--accent: #34d399;
	--danger: #f87171;
	--route: #60a5fa;
	--text: #e2e8f0;
	--text-dim: #94a3b8;
	/* Topbar: fixed header with centered controls */
	.topbar {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		height: var(--topbar-h);
		background: var(--surface);
		border-bottom: 1px solid var(--border);
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 20px;
		z-index: 1000;
	}

	.topbar-brand {
		/* .topbar-brand: brand area (logo + name) — positioned left */
		position: absolute;
		left: 20px;
		display: flex;
		align-items: center;
		gap: 10px;
		flex-shrink: 0;
	}

	/* #basemap-toggle: allow a wider labelled button (keeps other toggles compact) */
	#basemap-toggle {
		width: auto;
		min-width: 80px;
		height: 36px;
		padding: 0 12px;
		box-sizing: border-box;
		border-radius: 6px;
		font-family: var(--font-mono);
		font-size: 12px;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		white-space: nowrap;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		flex-shrink: 0;
	}

	.brand-icon {
		/* .brand-icon: small colored icon next to brand name */
		color: var(--accent);
		font-size: 18px;
		line-height: 1;
	}

	.brand-name {
		/* .brand-name: app name text in topbar */
		font-family: var(--font-mono);
		font-size: 13px;
		font-weight: 600;
		letter-spacing: 0.14em;
		color: var(--text);
	}

	.topbar-right {
		/* .topbar-right: centered controls container */
		display: flex;
		align-items: center;
		gap: 12px;
		position: relative;
	}

	/* Topbar controls: green borders and green text */
	.topbar button,
	.topbar .upload-btn {
		color: var(--accent);
		border: 1px solid var(--accent);
		background: transparent;
	}

	/* Speed label and displayed speed should have green text but no border */
	.topbar .playback-speed-label,
	.topbar .speed-value {
		color: var(--accent);
		border: none;
		background: transparent;
	}

	.topbar button:hover,
	.topbar .upload-btn:hover {
		background: rgba(52, 211, 153, 0.08);
	}
	color: var(--text);
}

.topbar-right {
	/* .topbar-right: container for right-side topbar controls */
	display: flex;
	align-items: center;
	gap: 12px;
}

.upload-btn {
	/* .upload-btn: styled button for uploading files */
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border: 1px solid var(--accent);
	background: transparent;
	color: var(--accent);
	font-family: var(--font-mono);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.08em;
	border-radius: var(--radius);
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
	white-space: nowrap;
}

.upload-btn:hover {
	/* .upload-btn:hover: hover state for upload button */
	background: var(--accent);
	color: var(--bg);
}

.toggle-btn {
	/* .toggle-btn: small square toggle button */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 6px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--text-dim);
	cursor: pointer;
	transition: background .12s ease, color .12s ease;
}

.toggle-btn:hover {
	/* .toggle-btn:hover: hover state for toggle button */
	background: var(--surface3);
	color: var(--text);
}

.toggle-icon {
	/* .toggle-icon: icon inside toggle button */
	font-size: 13px;
	line-height: 1;
}

.upload-icon {
	/* .upload-icon: icon inside upload button */
	font-size: 12px;
}

.main-layout {
	/* .main-layout: main container below topbar */
	position: fixed;
	top: var(--topbar-h);
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	overflow: hidden;
}

.sidebar {
	/* .sidebar: left control panel */
	width: var(--sidebar-w);
	flex-shrink: 0;
	height: 100%;
	background: var(--surface);
	border-right: 1px solid var(--border);
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	transition: width 260ms cubic-bezier(.2, .9, .2, 1);
}

.sidebar::-webkit-scrollbar {
	/* .sidebar::-webkit-scrollbar: custom scrollbar for sidebar */
	width: 5px;
}

.sidebar::-webkit-scrollbar-track {
	/* .sidebar::-webkit-scrollbar-track: scrollbar track */
	background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
	/* .sidebar::-webkit-scrollbar-thumb: scrollbar thumb styling */
	background: var(--border2);
	border-radius: 3px;
}

.sidebar-section {
	/* .sidebar-section: grouped sections inside sidebar */
	padding: 14px 16px;
	border-bottom: 1px solid var(--border);
	flex-shrink: 0;
}

.section-label {
	/* .section-label: small uppercase label for sidebar sections */
	font-family: var(--font-mono);
	font-size: 9px;
	font-weight: 600;
	letter-spacing: 0.18em;
	color: var(--text-muted);
	margin-bottom: 10px;
	text-transform: uppercase;
}

.select-wrapper {
	/* .select-wrapper: container for selects to position arrow */
	position: relative;
	width: 100%;
}

#date-select {
	/* #date-select: date selection dropdown */
	width: 100%;
	appearance: none;
	background: var(--surface2);
	border: 1px solid var(--border2);
	color: var(--text);
	font-family: var(--font-mono);
	font-size: 11px;
	padding: 8px 32px 8px 10px;
	border-radius: var(--radius);
	cursor: pointer;
	outline: none;
}

#date-select:focus {
	/* #date-select:focus: focused state for date dropdown */
	border-color: var(--accent);
}

#date-select:disabled {
	/* #date-select:disabled: disabled state styling for date dropdown */
	opacity: .35;
	cursor: not-allowed;
}

.select-arrow {
	/* .select-arrow: chevron positioned inside select */
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--text-muted);
	font-size: 11px;
	pointer-events: none;
}

.metrics-grid {
	/* .metrics-grid: grid layout for metric cards */
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 7px;
}

.metric-card {
	/* .metric-card: small info card for metrics */
	background: var(--surface2);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 10px 11px 9px;
}

.metric-card.wide {
	/* .metric-card.wide: wide variant spanning columns */
	grid-column: 1 / -1;
}

.metric-label {
	/* .metric-label: small uppercase label above metric value */
	font-size: 9px;
	font-family: var(--font-mono);
	color: var(--text-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 5px;
}

.metric-row {
	display: flex;
	align-items: baseline;
	gap: 5px;
		/* .metric-row: horizontal layout for value + unit */
}

.metric-value {
	font-family: var(--font-mono);
	font-size: 20px;
	font-weight: 600;
		/* .metric-value: prominent numeric metric display */
	color: var(--accent);
	line-height: 1;
}

.metric-card.wide .metric-value {
	font-size: 18px;
}

		/* .metric-card.wide .metric-value: value styling inside wide metric */
.metric-unit {
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--text-muted);
		/* .metric-unit: unit label next to metric value */
}

.legend {
	display: flex;
	flex-direction: column;
	gap: 8px;
		/* .legend: vertical list of legend items */
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 9px;
		/* .legend-item: single legend row with dot + label */
	font-size: 11px;
	color: var(--text-dim);
	font-family: var(--font-mono);
}

.legend-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
		/* .legend-dot: circular colored dot for legend */
	border: 2px solid rgba(255, 255, 255, .25);
	flex-shrink: 0;
}

.start-dot {
	background: var(--accent);
}

		/* .start-dot: marker for trip start */
.end-dot {
	background: var(--danger);
}

		/* .end-dot: marker for trip end */
.legend-line-swatch {
	width: 22px;
	height: 3px;
	background: var(--route);
		/* .legend-line-swatch: small route color swatch */
	border-radius: 2px;
	flex-shrink: 0;
}

.status-msg {
	font-family: var(--font-mono);
	font-size: 10px;
	color: var(--text-muted);
		/* .status-msg: small status text area */
	line-height: 1.6;
	word-break: break-word;
}

#map {
	flex: 1;
	height: 100%;
	min-width: 0;
		/* #map: main map container */
}

.sidebar-collapsed .sidebar {
	width: 0 !important;
	border-right: none;
	overflow: hidden;
		/* .sidebar-collapsed .sidebar: collapsed state hides sidebar */
}

.sidebar-collapsed .sidebar-section {
	opacity: 0;
	transform: translateX(-6px);
		/* .sidebar-collapsed .sidebar-section: hide sections when collapsed */
	pointer-events: none;
}

.sidebar-collapsed .sidebar::-webkit-scrollbar {
	display: none;
}
		/* .sidebar-collapsed .sidebar::-webkit-scrollbar: hide scrollbar when collapsed */

.leaflet-popup-content-wrapper {
	background: var(--surface2);
	color: var(--text);
		/* .leaflet-popup-content-wrapper: popup styling on the map */
	border: 1px solid var(--border2);
	border-radius: var(--radius);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
	font-family: var(--font-mono);
	font-size: 11px;
}

.leaflet-popup-tip {
	background: var(--surface2);
}
		/* .leaflet-popup-tip: small triangle pointer for popups */

.leaflet-popup-close-button {
	color: var(--text-dim) !important;
}
		/* .leaflet-popup-close-button: close button color for popups */

.leaflet-control-attribution a {
	color: var(--text-dim) !important;
}
		/* .leaflet-control-attribution a: attribution link styling */

@keyframes blink {
	0% {
		opacity: 1;
		stroke-width: 2.5;
	}
	50% {
		opacity: 0.25;
		stroke-width: 1.2;
	}
	100% {
		opacity: 1;
		stroke-width: 2.5;
	}
}

.leaflet-interactive.start-blink,
.leaflet-interactive.end-blink {
	animation: none;
}
	/* .leaflet-interactive.*-blink: blinking effect for start/end markers */

.leaflet-interactive.playback-marker.start-blink {
	animation: blink 1.2s ease-in-out infinite;
}
		/* .leaflet-interactive.playback-marker.start-blink: fast blink for playback marker */

.play-btn,
.reset-btn {
	padding: 6px 10px;
	border-radius: 6px;
		/* .play-btn, .reset-btn: playback control buttons */
	border: 1px solid var(--border2);
	background: var(--surface2);
	color: var(--text);
	cursor: pointer;
	font-family: var(--font-mono);
	font-size: 12px;
	text-transform: uppercase;
}

.play-btn:hover,
.reset-btn:hover {
	background: var(--surface3);
}
		/* .play-btn:hover, .reset-btn:hover: hover for playback controls */

.playback-header {
	display: flex;
	align-items: center;
		/* .playback-header: container for playback controls */
	gap: 8px;
	margin-right: 8px;
}

/* Keep play-controls and speed-controls layout stable when button text changes */
#play-controls, #speed-controls {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Prevent children from shrinking or expanding when labels change */
#play-controls > *, #speed-controls > * {
	flex: 0 0 auto;
}

/* Fix width for play/pause/reset so label changes don't reflow layout */
#playback-toggle, #playback-reset {
	min-width: 72px;
	text-align: center;
	box-sizing: border-box;
}

/* Ensure SWITCH VIEW sits visually between sidebar toggle and Play controls */
#switch-container {
	position: absolute;
	left: calc((50vw + var(--sidebar-w) + 18px) / 2);
	top: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 1003;
}

/* Center container to hold the play and speed controls */
#controls-center {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 24px;
	width: 560px;
	max-width: calc(100% - 320px);
	margin: 0 auto;
}

/* Reserve full width for the Play+Reset group so showing Reset doesn't push others */
#play-controls {
	min-width: 160px; /* reserve space for two buttons + gap */
	justify-content: center;
}

/* Keep Reset in flow but hidden (so space is always reserved) */
#playback-reset {
	display: inline-block;
}
#playback-reset[hidden] {
	display: inline-block !important;
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* Make play/reset border same as other topbar controls */
.topbar .play-btn,
.topbar .reset-btn,
.topbar .toggle-btn,
.topbar label.upload-btn {
	border: 1px solid var(--accent) !important;
	color: var(--accent) !important;
	background: transparent !important;
}

/* Ensure the slider doesn't push other controls — limit its max width */
#speed-controls input[type="range"] {
	width: 260px;
	max-width: 40vw;
}

.playback-speed-label {
	font-family: var(--font-mono);
	font-size: 11px;
		/* .playback-speed-label: label for playback speed control */
	color: var(--text-dim);
}

#playback-speed {
	width: 180px;
}
		/* #playback-speed: range input for playback speed */

.speed-value {
	font-family: var(--font-mono);
	font-size: 11px;
		/* .speed-value: numeric display of selected playback speed */
	color: var(--text-dim);
	min-width: 70px;
	text-align: right;
}

.car-marker {
	width: 96px;
	height: 96px;
		/* .car-marker: custom SVG marker for vehicle on map */
	display: flex;
	align-items: center;
	justify-content: center;
	transform: translate(-50%, -50%);
}

.car-marker svg {
	width: 96px;
	height: 96px;
		/* .car-marker svg: size and display for car marker SVG */
	display: block;
}

.car-marker svg .arrow {
	fill: #4285F4;
}
		/* .car-marker svg .arrow: arrow shape fill color inside car SVG */

.car-marker svg .shadow {
	fill: rgba(0, 0, 0, 0.12);
}
		/* .car-marker svg .shadow: subtle shadow under car SVG */


@media (max-width: 900px) {
	:root { --sidebar-w: 280px; --topbar-h: 56px; }
	.topbar { padding: 0 12px; }
	.brand-name { font-size: 12px; }
	#playback-speed { width: 140px; }
}

/* ── Mobile: 2-row topbar ──────────────────────────────────────────────────
   Row 1 (52px): Brand (left)  |  Sidebar-toggle + Upload (right)
   Row 2 (52px): SWITCH VIEW   |  PLAY  RESET  |  Speed slider
   ───────────────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
	:root { --topbar-h: 104px; --sidebar-w: 100%; }

	html, body { height: 100%; }

	/* Topbar: column so row 1 and row 2 stack cleanly */
	.topbar {
		height: var(--topbar-h);
		flex-direction: column;
		justify-content: flex-start;
		align-items: stretch;
		padding: 0;
		gap: 0;
	}

	/* Brand: absolute so it overlays the left of row 1 */
	.topbar-brand {
		position: absolute;
		left: 12px;
		top: 0;
		height: 52px;
		display: flex;
		align-items: center;
		z-index: 1;
	}

	/* topbar-right: wraps into 2 internal rows */
	.topbar-right {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		align-content: flex-start;
		padding: 0 10px;
		gap: 6px;
		width: 100%;
		height: 100%;
		position: static;
	}

	/* Row 1 — sidebar-toggle: pushed right with auto margin */
	#sidebar-toggle {
		position: static;
		transform: none;
		order: 1;
		margin-left: auto;
		margin-top: 8px;
		flex-shrink: 0;
		height: 34px;
		width: 34px;
	}

	/* Row 1 — upload button */
	label.upload-btn {
		position: static;
		transform: none;
		order: 2;
		flex-shrink: 0;
		height: 34px !important;
		padding: 0 10px !important;
		font-size: 10px !important;
		margin-top: 8px;
	}

	/* Hide upload text on very narrow screens, keep icon */
	#upload-label { display: none; }

	/* Row 2 — all playback controls: full width, centered */
	#controls-center {
		order: 3;
		width: 100%;
		max-width: 100%;
		height: 52px;
		justify-content: center;
		gap: 8px;
		border-top: 1px solid var(--border);
		padding: 0 6px;
	}

	/* SWITCH VIEW: static in row 2 */
	#switch-container {
		position: static;
		transform: none;
		order: 1;
		display: flex;
		align-items: center;
	}
	#basemap-toggle {
		padding: 0 8px !important;
		font-size: 10px !important;
		min-width: 54px !important;
		height: 32px !important;
	}

	/* Play / Reset: compact */
	#play-controls { min-width: auto; gap: 6px; }
	#playback-toggle, #playback-reset {
		min-width: 50px;
		height: 32px;
		font-size: 11px;
		padding: 0 8px;
	}

	/* Speed: hide text label, shorten slider */
	.playback-speed-label { display: none; }
	#playback-speed, #speed-controls input[type="range"] {
		width: 80px !important;
		max-width: 80px !important;
	}
	.speed-value { min-width: 38px; font-size: 10px; }

	/* ── Sidebar: full-width overlay ── */
	.sidebar {
		position: fixed;
		top: var(--topbar-h);
		left: 0;
		height: calc(100% - var(--topbar-h));
		width: 100%;
		max-width: 100%;
		z-index: 1200;
		box-shadow: 0 8px 30px rgba(0,0,0,0.6);
		transform: translateX(0);
		transition: transform .22s ease;
	}
	body.sidebar-collapsed .sidebar { transform: translateX(-100%); }

	/* ── Layout ── */
	.main-layout { top: var(--topbar-h); }
	.metric-card { padding: 12px; }
	.metrics-grid { grid-template-columns: 1fr; gap: 10px; }
	.metric-value { font-size: 18px; }
	#map { position: absolute; top: 0; bottom: 0; left: 0; right: 0; }
}

/* ── Very small phones (≤420px) ── */
@media (max-width: 420px) {
	:root { --topbar-h: 104px; }
	.brand-name { font-size: 11px; }
	.metric-value { font-size: 16px; }
	#playback-speed, #speed-controls input[type="range"] {
		width: 64px !important;
		max-width: 64px !important;
	}
}

/* Basemap toggle styling: keep compact icon and visible state */
#basemap-toggle {
	width: auto;
	min-width: 80px;
	height: 36px;
	padding: 0 12px;
	box-sizing: border-box;
	border-radius: 6px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--text);
	margin-right: 6px;
	cursor: pointer;
	font-family: var(--font-mono);
	font-size: 12px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

#basemap-toggle.active {
	background: var(--surface3);
	color: var(--accent);
	border-color: var(--accent);
}

/* ============================================================
   Topbar layout overrides — DESKTOP ONLY (> 700px)
   - Brand stays pinned left
   - #sidebar-toggle pinned at left edge of map
   - .upload-btn pinned at extreme right
   These rules must stay inside a min-width query so they
   don't override the mobile 2-row layout.
   ============================================================ */
@media (min-width: 701px) {
	/* Let .topbar be the positioning parent for absolutely placed buttons */
	:root .topbar-right {
		position: static;
	}

	/* Sidebar toggle: sits exactly where the map starts */
	#sidebar-toggle {
		position: absolute;
		left: var(--sidebar-w);
		top: 50%;
		transform: translateY(-50%);
		z-index: 1002;
		color: var(--accent);
		border: 1px solid var(--accent);
		background: transparent;
	}

	/* Upload button: pinned to the right edge of the topbar */
	label.upload-btn {
		position: absolute;
		right: 0;
		top: 50%;
		transform: translateY(-50%);
		z-index: 1002;
	}

	/* Unify dimensions and box model for primary topbar controls */
	.topbar .play-btn,
	.topbar .reset-btn,
	.topbar label.upload-btn,
	#basemap-toggle,
	.toggle-btn {
		height: 36px;
		padding: 0 12px;
		box-sizing: border-box;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		font-size: 12px;
	}

	/* Ensure upload button border radius and sizing */
	.topbar label.upload-btn,
	.upload-btn {
		border-radius: 6px;
		padding-left: 12px;
		padding-right: 12px;
		height: 36px;
		box-sizing: border-box;
	}
}

/* SWITCH VIEW: always green text + green border (all screen sizes) */
#basemap-toggle {
	color: var(--accent) !important;
	border: 1px solid var(--accent) !important;
	background: transparent !important;
}

/* All topbar buttons: green text + green border */
.topbar button,
.topbar label.upload-btn {
	color: var(--accent);
	border: 1px solid var(--accent);
	background: transparent;
}

/* Speed label and speed value: green text only, no border */
.topbar .playback-speed-label,
.topbar .speed-value {
	color: var(--accent);
	border: none;
	background: transparent;
}

/* Subtle hover for all topbar buttons */
.topbar button:hover,
.topbar label.upload-btn:hover {
	background: rgba(52, 211, 153, 0.06);
}

/* ── Mobile Landscape ──────────────────────────────────────────────────────
   Targets phones rotated sideways: wide but short (height ≤ 500px).
   Uses a single compact row — no room to stack two rows vertically.
   Width is typically 700–900px so desktop rules would otherwise apply.
   ───────────────────────────────────────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
	:root {
		--topbar-h: 48px;
		--sidebar-w: 240px;
	}

	/* Single tight row, no wrapping */
	.topbar {
		display: flex !important;
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: center !important;
		padding: 0 8px !important;
		height: var(--topbar-h) !important;
		gap: 6px !important;
		position: relative !important;
	}

	/* Brand: shrink text, keep inline, absolutely positioned */
	.topbar-brand {
		position: absolute !important;
		left: 8px !important;
		flex-shrink: 0;
		gap: 6px;
	}
	.brand-name { font-size: 10px; letter-spacing: 0.08em; }
	.brand-icon { font-size: 14px; }

	/* topbar-right: centered over the map area */
	.topbar-right {
		position: absolute !important;
		left: calc((100% + var(--sidebar-w)) / 2) !important;
		transform: translateX(-50%) !important;
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		gap: 5px;
		justify-content: center !important;
	}

	/* controls-center: inline, auto width */
	#controls-center {
		position: static !important;
		width: auto !important;
		max-width: none !important;
		display: flex !important;
		align-items: center !important;
		gap: 5px;
		flex: 0 1 auto !important;
		justify-content: center !important;
		margin: 0 !important;
		left: auto !important;
		transform: none !important;
	}

	/* SWITCH VIEW: inline, compact */
	#switch-container {
		position: static !important;
		transform: none !important;
		left: auto !important;
		top: auto !important;
		display: flex;
		align-items: center;
		flex-shrink: 0;
	}
	#basemap-toggle {
		min-width: 44px !important;
		height: 30px !important;
		padding: 0 6px !important;
		font-size: 9px !important;
	}

	/* Play / Reset: compact */
	#play-controls { min-width: auto; gap: 4px; }
	#playback-toggle, #playback-reset {
		min-width: 44px;
		height: 30px;
		font-size: 10px;
		padding: 0 6px;
	}

	/* Speed: hide label, short slider */
	.playback-speed-label { display: none; }
	#playback-speed,
	#speed-controls input[type="range"] {
		width: 70px !important;
		max-width: 70px !important;
	}
	.speed-value { font-size: 9px; min-width: 30px; }

	/* Sidebar toggle: inline, no absolute */
	#sidebar-toggle {
		position: static !important;
		transform: none !important;
		width: 30px;
		height: 30px;
		flex-shrink: 0;
	}

	/* Upload: icon only to save space */
	label.upload-btn {
		position: static !important;
		transform: none !important;
		height: 30px !important;
		padding: 0 8px !important;
		font-size: 9px !important;
		flex-shrink: 0;
	}
	#upload-label { display: none; }

	/* Sidebar: narrow overlay */
	.sidebar {
		position: fixed;
		top: var(--topbar-h);
		left: 0;
		height: calc(100% - var(--topbar-h));
		width: var(--sidebar-w);
		z-index: 1200;
		box-shadow: 4px 0 20px rgba(0,0,0,0.6);
		transform: translateX(0);
		transition: transform .22s ease;
	}
	body.sidebar-collapsed .sidebar { transform: translateX(-100%); }

	.main-layout { top: var(--topbar-h); }
	#map { flex: 1; height: 100%; position: static; }
}