* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: #01020a; }
canvas { display: block; }
/* Visually hidden but present in the DOM for search engines and screen readers. */
.sr-only {
	position: absolute; width: 1px; height: 1px;
	padding: 0; margin: -1px; overflow: hidden;
	clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
#ui {
	position: fixed;
	top: 16px;
	left: 16px;
	width: 340px;
	padding: 14px 16px 12px;
	background: rgba(4, 8, 18, 0.86);
	border: 1px solid rgba(138, 172, 255, 0.18);
	border-radius: 14px;
	font: 13px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif;
	color: #edf2ff;
	backdrop-filter: blur(12px);
	user-select: none;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
#ui { transition: width .18s ease; }
#uiHeader { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
#ui h1 { font-size: 16px; font-weight: 700; }
#collapse { padding: 3px 9px; line-height: 1; font-size: 14px; }
#ui.collapsed { width: auto; }
#ui.collapsed #uiBody { display: none; }
#ui.collapsed #collapse { transform: rotate(-90deg); }
#ui p { margin: 8px 0 10px; opacity: .8; }
#dateRow {
	display: flex; align-items: center; justify-content: space-between;
	gap: 8px; margin: 6px 0;
	padding: 9px 11px; border-radius: 9px;
	background: rgba(120, 160, 255, 0.10);
	border: 1px solid rgba(138, 172, 255, 0.18);
}
#dateValue { font-weight: 600; font-size: 14px; font-variant-numeric: tabular-nums; }
#gotoRow { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
#gotoRow input[type=date] {
	flex: 1 1 84px; min-width: 0; font: inherit; color: inherit; padding: 6px 6px;
	background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
	border-radius: 8px; color-scheme: dark;
}
.btn:disabled { opacity: .4; cursor: not-allowed; }
#eventsRow { margin-bottom: 8px; }
#eventsRow select {
	width: 100%; font: inherit; color: inherit; padding: 6px 8px;
	background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18);
	border-radius: 8px; color-scheme: dark; cursor: pointer;
}
#eventsRow select:focus { outline: 2px solid rgba(120,180,255,0.55); }
#eventsRow select option { background: #0b1020; color: #edf2ff; }
.btn {
	border: 1px solid rgba(255,255,255,0.18);
	background: rgba(255,255,255,0.06);
	color: inherit; padding: 7px 11px; border-radius: 8px; cursor: pointer; font: inherit;
}
.btn.accent { border-color: rgba(160,200,255,0.4); background: rgba(120,170,255,0.18); }
.btn:focus { outline: 2px solid rgba(120,180,255,0.55); }
#controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 4px; }
#controls label { display: flex; align-items: center; gap: 8px; white-space: nowrap; flex: 1 1 100%; margin-top: 4px; }
#controls label input[type=range] { flex: 1; }
#timeControl { flex: 1 1 100%; }
#timeControl .slider-wrap { position: relative; }
#timeControl input[type=range] { width: 100%; display: block; }
#timeControl .center-mark {
	position: absolute; left: 50%; top: 50%; width: 2px; height: 16px;
	transform: translate(-50%, -50%); background: rgba(168, 197, 255, 0.55);
	border-radius: 1px; pointer-events: none;
}
#timeTicks { display: flex; justify-content: space-between; font-size: 10.5px; opacity: .5; margin-top: 2px; }
#speedValue { text-align: center; margin-top: 4px; font-weight: 600; font-variant-numeric: tabular-nums; opacity: .92; }
#aboutToggle { margin-top: 12px; width: 100%; text-align: left; font-size: 12px; opacity: .85; }
#aboutToggle[aria-expanded="true"] { opacity: 1; }
#legend { margin-top: 10px; font-size: 11.5px; opacity: .7; }
#legend strong { color: #a8c5ff; }
#credits { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(138,172,255,0.14); font-size: 10.5px; line-height: 1.5; opacity: .6; }
#credits a { color: #9fb8ee; text-decoration: none; }
#credits a:hover { text-decoration: underline; }
#about-footer { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(138,172,255,0.14); font-size: 10.5px; line-height: 1.6; opacity: .65; }
#about-footer a { color: #9fb8ee; text-decoration: none; }
#about-footer a:hover { text-decoration: underline; }
#tooltip {
	position: fixed; pointer-events: none; z-index: 10;
	padding: 8px 11px; max-width: 240px;
	background: rgba(6, 10, 22, 0.94);
	border: 1px solid rgba(150, 180, 255, 0.35);
	border-radius: 10px;
	font: 12px/1.45 -apple-system, "Segoe UI", system-ui, sans-serif;
	color: #eef3ff; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
	opacity: 0; transition: opacity .12s ease;
}
#tooltip.show { opacity: 1; }
#tooltip h2 { font-size: 13px; margin-bottom: 3px; }
#tooltip .sub { opacity: .65; }
#tooltip dl { display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; margin-top: 5px; }
#tooltip dt { opacity: .6; }
#tooltip dd { text-align: right; font-variant-numeric: tabular-nums; }
#tooltip .fact { margin-top: 6px; opacity: .85; }
#loading {
	position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
	color: #9fb6ee; font: 14px system-ui; background: #01020a; z-index: 20;
}
#rangeWarn {
	position: fixed; top: 14px; left: 50%; z-index: 15; pointer-events: none;
	transform: translateX(-50%) translateY(-8px);
	padding: 9px 18px; border-radius: 10px; text-align: center;
	background: rgba(176, 28, 28, 0.94); border: 1px solid rgba(255, 130, 130, 0.7);
	color: #fff; font: 600 13px/1.4 -apple-system, "Segoe UI", system-ui, sans-serif;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
	opacity: 0; transition: opacity .18s ease, transform .18s ease;
}
#rangeWarn.show { opacity: 1; transform: translateX(-50%) translateY(0); }
