:root {
	--bg: #0b0f14;
	--panel: #111827;
	--muted: #9ca3af;
	--text: #e5e7eb;
	--accent: #60a5fa;
	--accent-2: #34d399;
	--danger: #f87171;
}
* { box-sizing: border-box; }
html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}
.container {
	max-width: 860px;
	margin: 0 auto;
	padding: 24px 16px 48px;
}
.header {
	margin-bottom: 24px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
}
.title {
	font-size: 28px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	color: var(--text);
	display: block;
	transition: color 0.2s ease;
}
.title:hover {
	color: var(--accent);
	text-decoration: none;
}
.nav {
	display: flex;
	gap: 8px;
	background: var(--panel);
	padding: 6px;
	border-radius: 12px;
	border: 1px solid #1f2937;
}

.nav-link {
	padding: 8px 16px;
	color: var(--muted);
	text-decoration: none;
	border-radius: 8px;
	transition: all 0.2s ease-in-out;
	font-weight: 500;
}

.nav-link.active {
	background: var(--accent);
	color: var(--bg);
	box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-link:not(.active):hover {
	background: #ffffff10;
	color: var(--text);
}

.freshness-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: var(--muted);
}

.freshness-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--muted);
	flex-shrink: 0;
	transition: background 0.4s ease;
}

.freshness-dot--green  { background: #22c55e; }
.freshness-dot--yellow { background: #eab308; }
.freshness-dot--red    { background: var(--danger); }

.search-panels {
	display: grid;
	gap: 24px;
}
.panel {
	background: var(--panel);
	border: 1px solid #1f2937;
	border-radius: 12px;
	padding: 16px;
}
.panel-title {
	margin: 0 0 12px 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--text);
}
.search-box {
	position: relative;
}
.search-input {
	width: 100%;
	padding: 12px 14px;
	border-radius: 10px;
	border: 1px solid #273244;
	background: #0e1520;
	color: var(--text);
	font-size: 16px;
	outline: none;
}
.hint {
	margin-top: 8px;
	color: var(--muted);
	font-size: 13px;
}
.dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #070c14;
	border: 1px solid #1e2a3f;
	border-radius: 12px;
	padding: 8px;
	z-index: 20;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
	max-height: 360px;
	overflow-y: auto;
	backdrop-filter: blur(12px);
}
.dropdown > * + * {
	margin-top: 6px;
}
.dropdown::-webkit-scrollbar {
	width: 6px;
}
.dropdown::-webkit-scrollbar-track {
	background: transparent;
}
.dropdown::-webkit-scrollbar-thumb {
	background: #1e2c46;
	border-radius: 999px;
}
.item {
	display: block;
	padding: 10px 14px;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.01);
	border: 1px solid transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.item:hover,
.item:focus-visible {
	background: #111c2d;
	border-color: #243754;
}
.item:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.35);
}
.item:last-child {
	margin-bottom: 0;
}
.line-1 {
	display: flex;
	align-items: baseline;
	gap: 8px;
}
.headcode { font-weight: 700; color: var(--accent); }
.date { font-size: 12px; color: var(--muted); }
.line-2 {
	margin-top: 2px;
	font-size: 14px;
	color: #cbd5e1;
}
.pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	font-size: 12px;
	border: 1px solid #1f2937;
	color: #cbd5e1;
}
.pill-danger {
	border-color: var(--danger);
	color: var(--danger);
}
.pill-success {
	border-color: var(--accent-2);
	color: var(--accent-2);
}
.pill-muted {
	border-color: #374151;
	color: var(--muted);
}
.section {
	margin-top: 16px;
}
.section h3 {
	margin: 0 0 8px;
	font-size: 14px;
	color: var(--muted);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .06em;
}
.kv {
	display: grid;
	grid-template-columns: 160px 1fr;
	gap: 6px 12px;
	font-size: 14px;
}
.list {
	display: grid;
	gap: 8px;
}
.card {
	border: 1px solid #1f2937;
	border-radius: 10px;
	padding: 10px 12px;
	background: #0e1520;
}

service-card {
	display: block;
}

wiki-card {
	display: block;
}
.realtime-card {
	background: #0d1624;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }
.muted { color: var(--muted); }
.sp { height: 8px; }
.realtime-kv {
	grid-template-columns: 120px 1fr;
	font-size: 13px;
}

/* Link styles: improve readability and accessibility on dark background */
a, a:visited {
	color: var(--accent);
	text-decoration: none;
}
a:hover {
	color: #93c5fd; /* lighter blue for hover */
	text-decoration: underline;
	text-decoration-color: currentColor;
	text-underline-offset: 2px;
	text-decoration-thickness: 1.5px;
}
a:active {
	color: #bfdbfe; /* pressed state */
}
a:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 3px;
}

/* Station links - used for clickable station names that link to station boards */
.station-link,
.unit-link {
	transition: color 0.15s ease;
}

/* Class links - used for clickable class codes that link to class detail pages */
.class-link {
	transition: color 0.15s ease;
}

.class-link:hover,
.unit-link:hover {
	color: var(--accent);
	text-decoration: underline;
}

/* Station link container - for service detail view */
.station-link-container {
	display: inline;
}

.disclaimer {
	margin-top: 32px;
	padding-top: 16px;
	border-top: 1px solid #1f2937;
	text-align: center;
	font-size: 13px;
	color: var(--muted);
}

/* Dropdown service item wrapper */
.dropdown-service-item {
	display: block;
	padding: 6px;
	border-radius: 12px;
	border: 1px solid transparent;
	background: rgba(255, 255, 255, 0.01);
	transition: background-color 0.15s ease, border-color 0.15s ease;
}
.dropdown-service-item:hover {
	background: #111c2d;
	border-color: #243754;
}
.dropdown-service-item service-card {
	display: block;
}

/* Leaderboard item styling */
.leaderboard-item {
	display: block;
	text-decoration: none;
	transition: all 0.2s ease;
}

.leaderboard-item:hover {
	background: #0f1a2a;
	border-color: #374151;
	transform: translateX(2px);
}

.leaderboard-item:active {
	background: #0d1624;
}

/* Leaderboard show more/less button */
.leaderboard-toggle-btn {
	width: 100%;
	margin-top: 12px;
	padding: 8px;
	background: none;
	border: none;
	color: var(--accent);
	font-size: 13px;
	text-decoration: underline;
	font-family: inherit;
	transition: color 0.15s ease;
}

.leaderboard-toggle-btn:hover {
	color: #93c5fd;
}

.leaderboard-toggle-btn:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 3px;
}

/* Section separator for individual vehicles */
.section-separator {
	margin: 12px 0;
}

.section-separator h4 {
	margin: 16px 0 8px 0;
	color: var(--muted);
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 600;
}

/* Spacing for multiple vehicle sets */
#vehicles vehicle-set {
	margin-bottom: 16px;
}

#vehicles vehicle-set:last-child {
	margin-bottom: 0;
}

/* Unit summary cards for class pages */
.unit-summary {
	margin-bottom: 12px;
	padding: 12px;
	border-radius: 8px;
	background: var(--bg-secondary);
	border: 1px solid var(--border-color);
	transition: background-color 0.15s ease;
}

.unit-summary:hover {
	background: var(--bg-tertiary);
}

.unit-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
}

.unit-number {
	font-size: 1.1em;
	font-weight: 600;
}

.unit-class {
	color: var(--muted);
	font-size: 0.9em;
}

.unit-details {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	font-size: 0.9em;
	color: var(--muted);
}

.unit-details span {
	display: flex;
	align-items: center;
}

.unit-details .formation::before {
	content: "🚃";
	margin-right: 4px;
}

.unit-details .seats::before {
	content: "💺";
	margin-right: 4px;
}

.unit-details .speed::before {
	content: "⚡";
	margin-right: 4px;
}

.unit-details .livery::before {
	content: "🎨";
	margin-right: 4px;
}

.unit-location-row {
	margin-top: 6px;
	font-size: 13px;
}

