html,
body,
#app,
.radar-shell,
.map {
	width: 100%;
	height: 100%;
	margin: 0;
}

body {
	font-family: sans-serif;
	font-weight: normal;
}

.app-body {
	overflow: hidden;
}

.radar-shell {
	position: relative;
	isolation: isolate;
}

.map {
	position: absolute;
	inset: 0;
}

.map-loading-overlay {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: grid;
	place-items: center;
	background: rgba(0, 0, 0, 0.35);
	touch-action: none;
}

.map-reload-button {
	display: grid;
	place-items: center;
	width: 80px;
	height: 80px;
	border: none;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	transition: transform 0.15s;
}

.map-reload-button:hover {
	transform: scale(1.08);
}

.map-reload-button:active {
	transform: scale(0.96);
}

.menu-shell {
	position: absolute;
	top: 28px;
	left: 28px;
	z-index: 6;
}

.menu-button,
.menu-item-button,
.legal-close-button {
	border: 0;
	cursor: pointer;
}

.menu-button {
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	border-radius: 18px;
	background: var(--overlay-surface);
	border: 1px solid var(--overlay-border);
	box-shadow: var(--overlay-shadow);
	color: var(--control-icon);
	font-size: 22px;
	backdrop-filter: blur(14px);
}

.menu-button:hover,
.menu-item-button:hover {
	transform: translateY(-1px);
}

.menu-panel {
	position: absolute;
	top: 58px;
	left: 0;
	min-width: 220px;
	padding: 8px;
	border-radius: 20px;
	box-shadow: 0 22px 50px rgba(0, 0, 0, 0.24);
	backdrop-filter: blur(18px);
}

.menu-item-button {
	display: block;
	width: 100%;
	padding: 12px 14px;
	border-radius: 14px;
	background: transparent;
	
	font-size: 14px;
	font-weight: 600;
	text-align: left;
}

.menu-item-link {
	display: block;
	width: 100%;
	padding: 12px 14px;
	border-radius: 14px;
	
	font-size: 14px;
	font-weight: 600;
	text-align: left;
	text-decoration: none;
}

.menu-item-button:hover,
.menu-item-link:hover {
	background: var(--overlay-hover);
}

.menu-item-divider {
	height: 1px;
	margin: 6px 14px;
}

.location-button {
	position: absolute;
    left: 28px;
    bottom: calc(var(--timeline-clearance) + 24px);
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 18px;
    font-size: 25px;
    font-weight: 900;
    cursor: pointer;
    backdrop-filter: blur(14px);
}

.location-button:hover {
	color: var(--accent-dark);
	transform: translateY(-1px);
}

.timeline-panel {
	position: absolute;
	left: 50%;
	bottom: 24px;
	width: min(760px, calc(100vw - 28px));
	transform: translateX(-50%);
	padding: 18px 20px 16px;
	border-radius: .5rem;
	background: rgba(255, 255, 255, 0.5);
	backdrop-filter: blur(22px);
	z-index: 10;

	@media (prefers-color-scheme: dark) {
		background: rgba(0, 0, 0, 0.5);
	}
}

.timeline-controls {
	display: block;
}

.time-scrubber-shell {
	position: relative;
	padding-top: 32px;
}

.time-selected-bubble {
	position: absolute;
	left: 50%;
	top: 0;
	transform: translateX(-50%);
	padding: 6px 10px;
	border-radius: 12px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
	
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	pointer-events: none;
}

.time-scrubber-overlay {
	position: relative;
}

.time-scrubber-viewport {
	overflow-x: auto;
	overflow-y: visible;
	padding: 10px 0 8px;
	scrollbar-width: none;
	touch-action: pan-x;
	overscroll-behavior-x: contain;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.time-scrubber-viewport::-webkit-scrollbar {
	display: none;
}

.time-scrubber {
	position: relative;
	height: 42px;
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}

.time-scrubber-track,
.time-scrubber-progress {
	position: absolute;
	left: var(--scrubber-offset, 0px);
	top: 12px;
	height: 6px;
	border-radius: 999px;
}

.time-scrubber-track {
	right: var(--scrubber-offset, 0px);
	background: var(--scrubber-track);
}

.time-scrubber-progress {
	background: #999;
	box-shadow: 0 6px 16px rgba(143, 53, 31, 0.24);
}

.time-markers {
	position: absolute;
	left: var(--scrubber-offset, 0px);
	right: var(--scrubber-offset, 0px);
	top: 23px;
	height: 19px;
	pointer-events: none;
}

.time-marker {
	position: absolute;
	top: 0;
	transform: translateX(-50%);
	display: grid;
	justify-items: center;
	gap: 2px;
}

.time-marker-tick {
	width: 1px;
	height: 9px;
	background: #333;
}

.time-marker.minute .time-marker-tick {
	height: 6px;
	background: #999;
}

.time-marker.minute .time-marker-label {
	display: none;
}

.time-marker-label {
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	color: var(--overlay-text-muted);
	white-space: nowrap;
	-webkit-user-select: none;
	user-select: none;
}

.time-scrubber-centerline {
	position: absolute;
	z-index: 2;
	left: 50%;
	top: 12px;
	transform: translateX(-50%);
	width: 24px;
	height: 24px;
	border: 2px solid rgba(255, 255, 255, 0.92);
	border-radius: 50%;
	background: linear-gradient(135deg, #446fef, #3550b2);
	box-shadow: 0 10px 22px rgba(31, 56, 130, 0.24);
	pointer-events: none;
}

.time-scrubber-centerline::before {
	content: "";
	position: absolute;
	left: 50%;
	top: 14px;
	transform: translateX(-50%);
	width: 2px;
	height: 12px;
	border-radius: 999px;
	background: var(--centerline-stem);
}

.time-scrubber-centerline::after {
	content: "";
	position: absolute;
	inset: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
}

.time-scrubber-viewport.is-dragging,
.time-scrubber-viewport.is-dragging .time-scrubber {
	cursor: grabbing;
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
	margin-bottom: var(--timeline-clearance);
}

.timeline-terms {
	display: flex;
	flex-direction: column;

	gap: .2rem;
	font-size: .76rem;
	text-decoration: underline;
}

@media (max-width: 720px) {
	.menu-shell {
		top: 14px;
		left: 14px;
	}

	.menu-panel {
		top: 54px;
		min-width: 200px;
	}

	.time-scrubber-viewport {
		padding-top: 8px;
	}

	.time-scrubber-shell {
		padding-top: 28px;
	}

	.location-button {
		left: 14px;
	}
}

.legal {
	font-family: sans-serif;
	padding: 1rem;

	height: 100%;

	/* Required for webview */
	background: #fff;
	color: #333;

	@media (prefers-color-scheme: dark) {
		background: #333;
		color: white;
	}

	a {
		text-decoration: underline;
	}

	p {
		padding: .5rem 0;
	}

	h1 { font-size: 2rem; }
	h2 { font-size: 1.5rem; }
}