@media (max-width: 600px) {
	.grid {
		display: flex;
		flex-direction: column;
		gap: 16px;
		width: 100%;
	}
	.grid > div {
		width: 100%;
		margin: 0;
		padding: 0;
	}
	.station-input-wrapper {
		width: 100%;
		margin: 0;
		padding: 0;
	}
	.station-input-wrapper input {
		width: 100%;
		box-sizing: border-box;
		margin: 0;
		padding-left: 0;
	}
	.swap-col {
		display: flex;
		justify-content: center;
		width: 100%;
		margin: 0;
		padding: 0;
	}
	.swap-btn {
		width: 44px;
		min-width: 44px;
		max-width: 44px;
	}
}
:root {
			--bg-1: #f4f7ff;
			--bg-2: #e6fff5;
			--card: #ffffff;
			--text: #1e2a44;
			--muted: #52607a;
			--primary: #0057ff;
			--primary-2: #00a884;
			--danger: #b42318;
			--ring: rgba(0, 87, 255, 0.25);
			--shadow: 0 12px 30px rgba(16, 35, 72, 0.12);
			--radius: 16px;
		}

		* {
			box-sizing: border-box;
		}

		body {
			margin: 0;
			font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
			color: var(--text);
			background:
				radial-gradient(circle at 10% 10%, var(--bg-2), transparent 45%),
				radial-gradient(circle at 90% 20%, #dff0ff, transparent 40%),
				linear-gradient(135deg, var(--bg-1), #f6f9ff 50%, #eefeff 100%);
			min-height: 100vh;
			transition: background 0.25s ease, color 0.25s ease;
		}

		.container {
			width: min(1050px, 92vw);
			margin: 40px auto;
		}

		.hero {
			background: linear-gradient(120deg, #0057ff, #00a884);
			color: #fff;
			padding: 28px;
			border-radius: var(--radius);
			box-shadow: var(--shadow);
		}

		.hero h1 {
			margin: 0 0 10px;
			font-size: clamp(1.6rem, 4vw, 2.4rem);
			letter-spacing: 0.2px;
		}

		.hero p {
			margin: 0;
			opacity: 0.95;
			line-height: 1.5;
		}

		.hero-actions {
			margin-top: 14px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 12px;
		}

		.hero-tools {
			display: flex;
			align-items: center;
			gap: 10px;
			flex-wrap: wrap;
			justify-content: flex-end;
		}

		.theme-toggle {
			width: auto;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			padding: 0;
			width: 42px;
			height: 42px;
			border-radius: 999px;
			background: rgba(255, 255, 255, 0.16);
			border: 1px solid rgba(255, 255, 255, 0.28);
			color: #fff;
			box-shadow: none;
		}

		.theme-toggle:hover {
			transform: translateY(-1px);
			filter: brightness(1.06);
		}

		.theme-toggle-icon {
			font-size: 1.15rem;
			line-height: 1;
		}

		.lang-switch {
			display: flex;
			align-items: center;
			gap: 8px;
			background: rgba(255, 255, 255, 0.16);
			padding: 8px 10px;
			border-radius: 10px;
		}

		.lang-switch label {
			margin: 0;
			font-size: 0.84rem;
			font-weight: 700;
			color: #fff;
		}

		.lang-switch select {
			border-radius: 8px;
			border: 1px solid rgba(255, 255, 255, 0.45);
			padding: 6px 8px;
			font-size: 0.86rem;
			font-weight: 600;
			background: #fff;
			color: #1e2a44;
		}

		.search-panel {
			margin-top: 22px;
			background: var(--card);
			border-radius: var(--radius);
			box-shadow: var(--shadow);
			padding: 22px;
		}

		.grid {
			display: grid;
			grid-template-columns: minmax(0, 1fr) 58px minmax(0, 1fr) minmax(0, 0.9fr);
			gap: 14px;
			align-items: end;
		}

		.swap-col {
			display: flex;
			align-items: end;
		}

		.swap-btn {
			width: 58px;
			height: 48px;
			padding: 0;
			border-radius: 12px;
			background: linear-gradient(120deg, #f3f6ff, #eaf8ff);
			color: #2f4d91;
			border: 1px solid #d4def2;
			font-size: 1.25rem;
			font-weight: 700;
		}

		.swap-icon {
			display: inline-block;
			transform: rotate(90deg);
		}

		.swap-btn:hover {
			filter: brightness(0.98);
		}

		label {
			display: block;
			margin-bottom: 7px;
			font-weight: 600;
			color: var(--muted);
			font-size: 0.94rem;
		}

		input,
		button {
			width: 100%;
			border-radius: 12px;
			border: 1px solid #d4def2;
			padding: 12px 13px;
			font-size: 1rem;
			background: #fff;
			color: var(--text);
		}

		input:focus,
		button:focus {
			outline: none;
			box-shadow: 0 0 0 4px var(--ring);
			border-color: var(--primary);
		}

		button {
			border: none;
			background: linear-gradient(120deg, var(--primary), #3279ff);
			color: #fff;
			font-weight: 700;
			cursor: pointer;
			transition: transform 0.15s ease, filter 0.15s ease;
		}

		button:hover {
			transform: translateY(-1px);
			filter: brightness(1.05);
		}

		.time-toggle {
			width: auto;
			padding: 0;
			border: none;
			background: none;
			color: #1f57c7;
			font-size: inherit;
			font-weight: 700;
			text-decoration: underline;
			text-underline-offset: 2px;
			border-radius: 4px;
			box-shadow: none;
		}

		.time-toggle:hover {
			transform: none;
			filter: none;
			color: #003ea8;
		}

		.time-toggle:focus {
			box-shadow: 0 0 0 3px var(--ring);
		}

		.meta {
			margin-top: 14px;
			color: var(--muted);
			font-size: 0.95rem;
		}

		.error {
			margin-top: 14px;
			color: var(--danger);
			font-weight: 600;
		}

		.error.info-hint {
			color: #2272c3;
			font-weight: 500;
			font-size: 0.85rem;
		}

		body[data-theme="dark"] .error.info-hint {
			color: #7ab8f5;
		}

		.results {
			margin-top: 20px;
			display: grid;
			gap: 10px;
		}

		.results-screen-head {
			background: linear-gradient(135deg, #1a2336, #222f48);
			border: 1px solid #2f4061;
			border-radius: 14px;
			padding: 12px 14px;
			color: #dce8ff;
			box-shadow: 0 8px 24px rgba(8, 18, 35, 0.35);
		}

		.results-screen-title {
			font-size: 0.92rem;
			font-weight: 700;
			text-transform: uppercase;
			letter-spacing: 0.5px;
			opacity: 0.88;
		}

		.results-screen-route {
			margin-top: 6px;
			display: flex;
			align-items: center;
			gap: 10px;
			font-size: 1.08rem;
			font-weight: 700;
			color: #ffffff;
			overflow-wrap: anywhere;
		}

		.results-screen-arrow {
			color: #9bb4dd;
		}

		.bus-card {
			background: #fff;
			border: 1px solid #dce5f6;
			border-radius: 14px;
			padding: 16px;
			box-shadow: 0 6px 18px rgba(15, 36, 79, 0.08);
		}

		.rail-result-card {
			background: linear-gradient(135deg, #171d29, #111722);
			border: 1px solid #2a354c;
			box-shadow: 0 10px 24px rgba(7, 12, 20, 0.42);
			padding: 14px;
			color: #e8eefc;
		}

		.rail-card-top {
			display: flex;
			gap: 10px;
			align-items: center;
			justify-content: space-between;
			flex-wrap: wrap;
		}

		.rail-code {
			display: inline-flex;
			align-items: center;
			background: #9fcbff;
			color: #0c1b33;
			font-size: 1rem;
			line-height: 1;
			font-weight: 800;
			padding: 6px 10px;
			border-radius: 7px;
		}

		.rail-times {
			display: flex;
			align-items: baseline;
			gap: 8px;
			margin-left: auto;
		}

		.rail-time {
			font-size: 1.15rem;
			font-weight: 800;
			color: #f5f9ff;
		}

		.rail-time.end {
			text-align: right;
		}

		.rail-duration {
			font-size: 0.94rem;
			font-weight: 700;
			color: #9ab0d1;
		}

		.rail-duration span {
			opacity: 0.78;
			margin-right: 4px;
		}

		.rail-name-row {
			margin-top: 10px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 10px;
		}

		.rail-bus-name {
			font-size: 1.1rem;
			font-weight: 700;
			color: #ffffff;
			overflow-wrap: anywhere;
		}

		.rail-result-card .badge {
			background: #2d3d5d;
			color: #cee0ff;
		}

		.rail-route-line {
			margin-top: 6px;
		.rail-alt-badge {
			display: inline-flex;
			align-items: center;
			padding: 4px 8px;
			border-radius: 999px;
			font-size: 0.72rem;
			font-weight: 700;
			letter-spacing: 0.2px;
			background: #fff3d9;
			color: #8a5a00;
			border: 1px solid #f5d49a;
		}
			font-size: 1rem;
			color: #b9c9e3;
			font-weight: 600;
		}

		body[data-theme="light"] .rail-alt-badge {
			background: #fff3d9;
			border-color: #f5d49a;
			color: #8a5a00;
		}
		.rail-meta-row {
			margin-top: 10px;
			display: flex;
			align-items: center;
		body[data-theme="dark"] .rail-alt-badge {
			background: #3d2c12;
			border-color: #6b4a1e;
			color: #ffd9a1;
		}
			justify-content: space-between;
			gap: 10px;
			flex-wrap: wrap;
		}

		.rail-status {
			display: inline-flex;
			align-items: center;
			padding: 5px 10px;
			border-radius: 999px;
			font-size: 0.84rem;
			font-weight: 800;
			letter-spacing: 0.2px;
		}

		.rail-status.daily,
		.rail-status.today {
			background: rgba(58, 182, 116, 0.18);
			color: #8df5b9;
			border: 1px solid rgba(90, 210, 140, 0.4);
		}

		.rail-status.off {
			background: rgba(255, 90, 90, 0.12);
			color: #ffb2b2;
			border: 1px solid rgba(255, 120, 120, 0.4);
		}

		.rail-result-card .fare-badge {
			margin-top: 0;
			background: rgba(245, 182, 56, 0.2);
			border-color: rgba(245, 182, 56, 0.48);
			color: #ffdfa1;
		}

		.rail-days-wrap {
			margin-top: 10px;
		}

		.rail-result-card .days-row {
			color: #9fb0cc;
		}

		.rail-result-card .day-chip {
			border-color: #3b4c6e;
			background: #222d42;
			color: #8ea1c5;
		}

		.rail-result-card .day-chip.active {
			background: linear-gradient(120deg, #2a70ff, #22b783);
			color: #fff;
			border-color: transparent;
		}

		.rail-result-card .time-toggle {
			color: #f5f9ff;
			text-decoration: none;
			font-size: inherit;
			font-weight: 800;
		}

		.rail-result-card .time-toggle:hover {
			color: #dce6ff;
		}

		.rail-result-card .btn-group {
			margin-top: 12px;
		}

		.search-history-panel {
			background: linear-gradient(135deg, #151c2a, #101725);
			border: 1px solid #293753;
			border-radius: 14px;
			padding: 12px;
			box-shadow: 0 8px 20px rgba(7, 12, 20, 0.34);
		}

		.search-history-head {
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 10px;
		}

		.search-history-title {
			font-size: 0.9rem;
			font-weight: 800;
			letter-spacing: 0.3px;
			text-transform: uppercase;
			color: #d8e6ff;
		}

		.search-history-clear {
			width: auto;
			padding: 6px 10px;
			border-radius: 9px;
			background: #27344e;
			color: #d2e2ff;
			font-size: 0.82rem;
			font-weight: 700;
			border: 1px solid #3a4a6d;
		}

		.search-history-clear:hover {
			filter: brightness(1.08);
		}

		.search-history-list {
			margin-top: 10px;
			display: grid;
			gap: 8px;
		}

		.search-history-item {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			gap: 8px;
			text-align: left;
			padding: 9px 11px;
			border-radius: 10px;
			border: 1px solid #344666;
			background: #1d273b;
			color: #d3e2ff;
			font-size: 0.92rem;
			font-weight: 700;
		}

		.search-history-item:hover {
			filter: brightness(1.08);
			transform: none;
		}

		.search-history-item.active {
			border-color: #4a7bd3;
			background: #21314b;
			color: #ffffff;
		}

		.search-history-item-arrow {
			opacity: 0.75;
		}

		.search-history-empty {
			margin-top: 10px;
			font-size: 0.9rem;
			color: #9db0d3;
		}

		.recent-viewed-item {
			align-items: flex-start;
		}

		.recent-viewed-code {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			min-width: 72px;
			padding: 5px 8px;
			border-radius: 8px;
			background: #9fcbff;
			color: #0c1b33;
			font-size: 0.82rem;
			font-weight: 800;
		}

		.recent-viewed-main {
			display: flex;
			flex-direction: column;
			gap: 3px;
			min-width: 0;
			flex: 1;
		}

		.recent-viewed-name {
			font-size: 0.92rem;
			font-weight: 800;
			color: inherit;
			overflow-wrap: anywhere;
		}

		.recent-viewed-route {
			font-size: 0.84rem;
			font-weight: 600;
			color: #9db0d3;
			overflow-wrap: anywhere;
		}

		.bus-top {
			display: flex;
			justify-content: space-between;
			gap: 12px;
			flex-wrap: wrap;
		}

		.bus-title {
			font-size: 1.05rem;
			font-weight: 700;
		}

		.badge {
			background: #ecf3ff;
			color: #0f4ecf;
			border-radius: 999px;
			padding: 4px 10px;
			font-size: 0.83rem;
			font-weight: 700;
		}

		.bus-route {
			margin-top: 10px;
			color: var(--muted);
			line-height: 1.5;
			font-size: 0.95rem;
		}

		.bus-time {
			margin-top: 10px;
			display: block;
			font-size: 0.95rem;
		}

		.bus-time-item {
			background: #f7faff;
			border: 1px solid #dce5f6;
			border-radius: 10px;
			padding: 12px 14px;
		}

		.bus-time-top {
			display: flex;
			justify-content: space-between;
			align-items: center;
			gap: 10px;
		}

		.bus-time-label {
			font-size: 0.82rem;
			font-weight: 700;
			color: #5b6b89;
			letter-spacing: 0.2px;
		}

		.bus-time-route {
			margin-top: 6px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 8px;
		}

		.bus-time-city {
			font-weight: 700;
			color: #1f2f4a;
			overflow-wrap: anywhere;
			flex: 1;
		}

		.bus-time-city.end {
			text-align: right;
		}

		.bus-time-arrow {
			flex-shrink: 0;
			color: #4a6db8;
			font-weight: 700;
		}

		.bus-time-value-row {
			margin-top: 4px;
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 8px;
 		}

		.bus-time-value {
			font-size: 0.92rem;
			color: #3d4f73;
			flex: 1;
		}

		.bus-time-value.end {
			text-align: right;
		}

		.fare-badge {
			display: inline-flex;
			align-items: center;
			gap: 6px;
			margin-top: 10px;
			background: linear-gradient(120deg, #fff7e6, #fff0cc);
			border: 1.5px solid #f0c040;
			border-radius: 999px;
			padding: 5px 14px;
			font-size: 0.97rem;
			font-weight: 700;
			color: #7a4800;
		}

		.fare-badge .fare-icon {
			font-size: 1.1rem;
		}

		.days-row {
			margin-top: 10px;
			display: flex;
			align-items: center;
			gap: 8px;
			color: #3d4f73;
			font-size: 0.92rem;
			flex-wrap: wrap;
		}

		.days-chips {
			display: inline-flex;
			gap: 5px;
			flex-wrap: wrap;
		}

		.day-chip {
			width: 22px;
			height: 22px;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			border-radius: 999px;
			border: 1px solid #d5deef;
			background: #f4f7ff;
			color: #8a97b4;
			font-size: 0.74rem;
			font-weight: 800;
		}

		.day-chip.active {
			background: linear-gradient(120deg, #0057ff, #00a884);
			border-color: transparent;
			color: #fff;
		}

		.full-route-wrap {
			line-height: 2;
			word-break: break-word;
		}

		.stop-depart {
			display: inline-block;
			background: #0057ff;
			color: #fff;
			border-radius: 8px;
			padding: 2px 9px;
			font-weight: 700;
			font-size: 0.9rem;
		}

		.stop-arrive {
			display: inline-block;
			background: #00a884;
			color: #fff;
			border-radius: 8px;
			padding: 2px 9px;
			font-weight: 700;
			font-size: 0.9rem;
		}

		.stop-via {
			display: inline-block;
			background: #eef2ff;
			color: #52607a;
			border-radius: 8px;
			padding: 2px 9px;
			font-size: 0.88rem;
		}

		.stop-time {
			opacity: 0.85;
			font-weight: 400;
		}

		.stop-arrow {
			color: #a4b0c8;
			font-size: 0.85rem;
		}

		.btn-group {
			display: flex;
			flex-wrap: wrap;
			gap: 10px;
			margin-top: 12px;
		}

		.btn-group button {
			flex: 1 1 calc(33.333% - 7px);
			min-width: 100px;
		}

		.bus-list-btn-wrap {
			margin-top: 10px;
		}

		.bus-list-btn {
			width: auto;
			background: linear-gradient(120deg, #1d6f42, #2f9d57);
			font-size: 0.94rem;
			padding: 10px 12px;
		}

		.track-btn {
			flex: 1;
			background: linear-gradient(120deg, #008a66, #00a884);
		}

		.view-route-btn {
			flex: 1;
			background: linear-gradient(120deg, #0057ff, #3279ff);
		}

		.share-btn {
			flex: 1;
			background: linear-gradient(120deg, #7c3aed, #a855f7);
		}

		.share-btn:hover {
			filter: brightness(1.05);
		}

		.share-success-toast {
			position: fixed;
			bottom: 20px;
			left: 50%;
			transform: translateX(-50%);
			background: #10b981;
			color: #fff;
			padding: 12px 20px;
			border-radius: 12px;
			font-weight: 700;
			font-size: 0.95rem;
			box-shadow: 0 8px 24px rgba(16, 139, 102, 0.3);
			animation: slideUp 0.4s ease;
			z-index: 3000;
		}

		@keyframes slideUp {
			from {
				opacity: 0;
				transform: translateX(-50%) translateY(20px);
			}
			to {
				opacity: 1;
				transform: translateX(-50%) translateY(0);
			}
		}

		.route-share-section {
			display: flex;
			gap: 10px;
			margin-top: 16px;
		}

		.route-share-btn {
			flex: 1;
			padding: 10px 16px;
			background: linear-gradient(120deg, #7c3aed, #a855f7);
			color: #fff;
			border: none;
			border-radius: 12px;
			font-weight: 700;
			cursor: pointer;
			transition: transform 0.15s ease, filter 0.15s ease;
		}

		.route-share-btn:hover {
			transform: translateY(-1px);
			filter: brightness(1.05);
		}

		.admin-content {
			display: grid;
			gap: 12px;
		}

		.admin-note {
			background: #fff8e1;
			border: 1px solid #f6c90e;
			border-radius: 10px;
			padding: 10px 12px;
			font-size: 0.88rem;
			color: #5a4200;
			line-height: 1.45;
		}

		.admin-bus-card {
			background: #fff;
			border: 1px solid #dce5f6;
			border-radius: 12px;
			padding: 12px;
			box-shadow: 0 4px 14px rgba(16, 35, 72, 0.08);
		}

		.admin-bus-title {
			font-size: 1rem;
			font-weight: 700;
			margin-bottom: 8px;
			color: #1f2f4a;
		}

		.admin-bus-grid {
			display: grid;
			grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
			gap: 10px;
		}

		.admin-field {
			background: #f7faff;
			border: 1px solid #dce5f6;
			border-radius: 10px;
			padding: 9px 10px;
		}

		.admin-label {
			display: block;
			margin: 0 0 4px;
			font-size: 0.78rem;
			font-weight: 700;
			letter-spacing: 0.2px;
			color: #5b6b89;
			text-transform: uppercase;
		}

		.admin-value {
			font-size: 0.92rem;
			line-height: 1.4;
			word-break: break-word;
			color: #1e2a44;
		}

		/* ── Tracker overlay ── */
		.tracker-overlay {
			position: fixed;
			inset: 0;
			z-index: 1000;
			background:
				radial-gradient(circle at 10% 10%, var(--bg-2), transparent 45%),
				radial-gradient(circle at 90% 20%, #dff0ff, transparent 40%),
				linear-gradient(135deg, var(--bg-1), #f6f9ff 50%, #eefeff 100%);
			overflow-y: auto;
			transform: translateX(100%);
			transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
		}

		.tracker-overlay.open {
			transform: translateX(0);
		}

		.tracker-overlay-inner {
			width: min(680px, 92vw);
			margin: 32px auto;
			padding-bottom: 40px;
		}

		.tracker-back-btn {
			display: inline-flex;
			align-items: center;
			gap: 8px;
			margin-bottom: 18px;
			background: #fff;
			color: var(--text);
			border: 1.5px solid #d4def2;
			border-radius: 12px;
			padding: 9px 18px;
			width: auto;
			font-size: 0.95rem;
			font-weight: 700;
			cursor: pointer;
			box-shadow: 0 2px 8px rgba(16,35,72,0.07);
			transition: transform 0.15s ease, filter 0.15s ease;
		}

		.tracker-back-btn:hover {
			transform: translateY(-1px);
			filter: brightness(0.97);
		}

		.tracker-overlay-header {
			background: linear-gradient(120deg, #0057ff, #00a884);
			color: #fff;
			border-radius: var(--radius);
			padding: 22px 24px;
			margin-bottom: 16px;
			box-shadow: var(--shadow);
		}

		.tracker-overlay-header h2 {
			margin: 0 0 6px;
			font-size: clamp(1.2rem, 4vw, 1.6rem);
		}

		.tracker-overlay-header p {
			margin: 0;
			opacity: .9;
			font-size: .95rem;
		}

		.tracker-header-actions {
			margin-top: 12px;
			display: grid;
			grid-template-columns: repeat(2, minmax(0, 1fr));
			gap: 10px;
		}

		.tracker-head-btn {
			width: 100%;
			display: inline-flex;
			align-items: center;
			justify-content: center;
			gap: 7px;
			padding: 9px 12px;
			min-height: 40px;
			border-radius: 999px;
			font-size: 0.84rem;
			font-weight: 700;
			letter-spacing: 0.2px;
			border: 1px solid rgba(255, 255, 255, 0.32);
			background: rgba(9, 24, 51, 0.28);
			color: #edf4ff;
			box-shadow: 0 6px 14px rgba(5, 14, 29, 0.22);
			-webkit-backdrop-filter: blur(4px);
			backdrop-filter: blur(4px);
		}

		.tracker-head-btn:hover {
			transform: translateY(-1px) scale(1.01);
			filter: brightness(1.07);
		}

		.tracker-head-btn-alarm {
			background: linear-gradient(120deg, rgba(255, 193, 66, 0.34), rgba(255, 162, 0, 0.24));
			border-color: rgba(255, 224, 153, 0.58);
			color: #fff4d8;
		}

		.tracker-head-btn-share {
			background: linear-gradient(120deg, rgba(127, 111, 255, 0.34), rgba(92, 176, 255, 0.24));
			border-color: rgba(186, 201, 255, 0.55);
			color: #f3edff;
		}

		.tracker-simulated-warning {
			display: flex;
			align-items: flex-start;
			gap: 10px;
			background: #fff8e1;
			border: 1px solid #f6c90e;
			border-radius: 10px;
			padding: 12px 16px;
			margin-bottom: 16px;
			font-size: .875rem;
			color: #5a4200;
			line-height: 1.5;
		}

		.tracker-status-box {
			background: #fff;
			border-radius: 12px;
			padding: 13px 18px;
			margin-bottom: 18px;
			border-left: 4px solid #ff8a00;
			box-shadow: 0 4px 14px rgba(0,0,0,.07);
			font-size: .95rem;
			color: var(--text);
			font-weight: 600;
		}

		.tracker-alarm-summary {
			background: #fff;
			border-radius: 12px;
			padding: 12px 14px;
			margin-bottom: 14px;
			border: 1px solid #dce5f6;
			box-shadow: 0 3px 12px rgba(16,35,72,0.08);
			transition: box-shadow 0.2s ease, border-color 0.2s ease;
		}

		/* Alarm UI stays hidden by default; appears after pressing top Set Alarm button */
		.tracker-overlay .tracker-alarm-summary,
		.tracker-overlay .v-alarm-mini-btn {
			display: none;
		}

		.tracker-overlay.show-alarms .tracker-alarm-summary {
			display: block;
		}

		.tracker-overlay.show-alarms .v-alarm-mini-btn {
			display: inline-flex;
		}

		.tracker-alarm-summary.is-highlighted {
			border-color: #ffbf52;
			box-shadow: 0 0 0 3px rgba(255, 191, 82, 0.28);
		}

		.tracker-alarm-title {
			font-size: 0.88rem;
			font-weight: 700;
			color: #415071;
			margin-bottom: 8px;
		}

		.tracker-alarm-chips {
			display: flex;
			flex-wrap: wrap;
			gap: 8px;
		}

		.tracker-alarm-chip {
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 10px;
			background: #fff4e6;
			color: #8b4700;
			border: 1px solid #ffd6aa;
			border-radius: 14px;
			padding: 8px 10px;
			font-size: 0.82rem;
			font-weight: 700;
			min-width: 220px;
			flex: 1 1 240px;
		}

		.tracker-alarm-chip-main {
			display: flex;
			align-items: center;
			gap: 9px;
			min-width: 0;
			flex: 1;
		}

		.tracker-alarm-icon {
			flex-shrink: 0;
			font-size: 1rem;
		}

		.tracker-alarm-details {
			display: flex;
			flex-direction: column;
			gap: 2px;
			min-width: 0;
		}

		.tracker-alarm-station {
			color: #8b4700;
			font-weight: 700;
			overflow-wrap: anywhere;
		}

		.tracker-alarm-time {
			font-size: 0.78rem;
			color: #9a5b10;
		}

		.tracker-alarm-remove {
			width: auto;
			border: none;
			background: transparent;
			color: #8b4700;
			font-size: 0.88rem;
			line-height: 1;
			cursor: pointer;
			padding: 4px;
			flex-shrink: 0;
		}

		.tracker-alarm-remove:hover {
			color: #b42318;
		}

		.tracker-alarm-empty {
			font-size: 0.85rem;
			color: #617190;
		}

		.v-timeline {
			background: #fff;
			border-radius: var(--radius);
			padding: 24px 20px;
			box-shadow: 0 8px 24px rgba(16,35,72,0.10);
		}

		.v-timeline-header {
			display: grid;
			grid-template-columns: 120px 38px 1fr 120px;
			gap: 12px;
			min-height: 40px;
			align-items: center;
			padding: 0 0 12px;
			margin-bottom: 12px;
			border-bottom: 2px solid #e0e8f5;
			font-weight: 700;
			font-size: 0.86rem;
			color: #3d5073;
			text-transform: uppercase;
			letter-spacing: 0.5px;
		}

		.v-timeline-station-col {
			text-align: center;
		}

		.v-timing-cols {
			display: contents;
		}

		.v-timing-col {
			text-align: center;
			padding: 0 8px;
		}

		.v-stop {
			display: grid;
			grid-template-columns: 120px 38px 1fr 120px;
			gap: 12px;
			min-height: 60px;
			align-items: start;
		}

		.v-dot-col {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 38px;
			flex-shrink: 0;
			position: relative;
		}

		.v-dot-col::before,
		.v-dot-col::after {
			content: "";
			position: absolute;
			left: 50%;
			width: 3px;
			transform: translateX(-50%);
			background: #d0daf0;
			z-index: 0;
		}

		.v-dot-col::before {
			top: 0;
			height: 13px;
		}

		.v-dot-col::after {
			top: 13px;
			bottom: 0;
		}

		.v-stop.v-start .v-dot-col::before {
			display: none;
		}

		.v-stop.v-end .v-dot-col::after {
			display: none;
		}

		.v-time-col-left {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: center;
			min-height: 40px;
			padding-top: 4px;
		}

		.v-station-center {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: flex-start;
			text-align: left;
			padding: 4px 8px 2px;
		}

		.v-time-col-right {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: center;
			min-height: 40px;
			padding-top: 4px;
		}

		.v-info-substations {
			grid-column: 1 / -1;
			margin-top: 8px;
		}

		.v-dot {
			width: 18px;
			height: 18px;
			border-radius: 50%;
			border: 3px solid #fff;
			box-shadow: 0 0 0 2px #d0daf0;
			flex-shrink: 0;
			margin-top: 4px;
			z-index: 2;
			position: relative;
		}

		.v-seg {
			width: 3px;
			flex: 1;
			background: #d0daf0;
			margin: 0;
			min-height: 24px;
			position: relative;
			z-index: 1;
		}

		.v-seg-btn {
			cursor: pointer;
			border: none;
			padding: 0;
			min-width: 3px;
		}

		.v-seg-btn:hover {
			filter: brightness(0.92);
		}

		.v-substations {
			margin-top: 10px;
			border: 1px dashed #c8d4ee;
			border-radius: 10px;
			background: #f8fbff;
			padding: 9px 10px;
		}

		.v-substations-title {
			font-size: 0.82rem;
			font-weight: 700;
			color: #44506a;
			margin-bottom: 5px;
		}

		.v-substations-list {
			margin: 0;
			padding-left: 18px;
			display: grid;
			gap: 4px;
			font-size: 0.84rem;
			color: #4b5874;
		}

		.v-substations-list strong {
			color: #243654;
		}

		.v-seg-done { background: #2c78ff; }

		.v-bus-icon {
			font-size: 1.3rem;
			margin: 2px 0;
			filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
			position: relative;
			z-index: 3;
		}

		.v-info { padding: 2px 0 18px 16px; flex: 1; }
		.v-station { font-size: 1rem; font-weight: 600; color: var(--text); }
		.v-station-row {
			display: inline-flex;
			align-items: center;
			gap: 7px;
		}
		.v-alarm-mini {
			display: inline-flex;
			align-items: center;
			justify-content: center;
			width: 16px;
			height: 16px;
			border-radius: 999px;
			font-size: 0.7rem;
			line-height: 1;
			background: #edf2ff;
			color: #6b7da3;
			border: 1px solid #d4def2;
		}
		.v-alarm-mini-btn {
			cursor: pointer;
			padding: 0;
		}
		.v-alarm-mini-btn:hover {
			filter: brightness(0.95);
		}
		.v-alarm-mini.is-active {
			background: #fff4e6;
			color: #c86100;
			border-color: #ffd7a8;
		}
		.v-time { font-size: .85rem; color: var(--muted); margin-top: 2px; }
		.v-time-group {
			margin-top: 4px;
			display: grid;
			gap: 2px;
		}

		.v-time-only {
			font-size: 0.92rem;
			color: #1f2f4a;
			font-weight: 700;
			text-align: center;
		}

		.v-time-row {
			display: grid;
			grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
			gap: 8px;
		}
		.v-time-line {
			font-size: 0.83rem;
			color: var(--muted);
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 8px;
			padding: 4px 8px;
			border-radius: 8px;
			background: #f4f8ff;
			border: 1px solid #dbe6fb;
		}
		.v-time-line span {
			font-weight: 700;
			color: #4d5f86;
			white-space: nowrap;
		}
		.v-halt {
			font-size: 0.78rem;
			font-weight: 700;
			color: #1f5bcc;
		}
		.v-station-passed .v-station { color: #2c78ff; }
		.v-station-current .v-dot { box-shadow: 0 0 0 4px rgba(255,138,0,.25); }
		.v-station-current .v-station { color: #ff8a00; font-size: 1.05rem; }
		.v-station-passed .v-time-col-left,
		.v-station-passed .v-time-col-right,
		.v-station-current .v-time-col-left,
		.v-station-current .v-time-col-right { color: #b86000; }

		/* ── Alarm Modal ── */
		.alarm-modal {
			position: fixed;
			inset: 0;
			z-index: 2000;
			display: flex;
			align-items: center;
			justify-content: center;
			background: rgba(0, 0, 0, 0.4);
			-webkit-backdrop-filter: blur(4px);
			backdrop-filter: blur(4px);
			opacity: 0;
			pointer-events: none;
			transition: opacity 0.3s ease;
		}

		.alarm-modal.show {
			opacity: 1;
			pointer-events: auto;
		}

		.alarm-content {
			background: #fff;
			border-radius: 20px;
			padding: 32px 28px;
			max-width: 420px;
			width: 90vw;
			box-shadow: 0 20px 60px rgba(16, 35, 72, 0.25);
			text-align: center;
			animation: slideInScale 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
		}

		@keyframes slideInScale {
			from {
				opacity: 0;
				transform: scale(0.7);
			}
			to {
				opacity: 1;
				transform: scale(1);
			}
		}

		.alarm-icon {
			font-size: 4rem;
			margin-bottom: 16px;
			display: inline-block;
			animation: alarmBounce 0.6s infinite;
		}

		@keyframes alarmBounce {
			0%, 100% { transform: scale(1); }
			50% { transform: scale(1.1); }
		}

		.alarm-title {
			font-size: 1.4rem;
			font-weight: 700;
			color: #ff6b35;
			margin-bottom: 10px;
		}

		.alarm-station {
			font-size: 1.2rem;
			font-weight: 600;
			color: var(--text);
			margin: 12px 0;
		}

		.alarm-details {
			font-size: 1rem;
			color: var(--muted);
			line-height: 1.6;
			margin-bottom: 20px;
		}

		.alarm-bus-info {
			background: #f0f4ff;
			border-left: 4px solid var(--primary);
			border-radius: 8px;
			padding: 12px 14px;
			margin-bottom: 20px;
			font-size: 0.95rem;
			text-align: left;
		}

		.alarm-btn-group {
			display: flex;
			gap: 12px;
		}

		.alarm-btn {
			flex: 1;
			padding: 11px 18px;
			border: none;
			border-radius: 10px;
			font-size: 0.95rem;
			font-weight: 700;
			cursor: pointer;
			transition: all 0.2s ease;
		}

		.alarm-btn-dismiss {
			background: #f0f0f0;
			color: var(--text);
		}

		.alarm-btn-dismiss:hover {
			background: #e0e0e0;
		}

		.alarm-btn-track {
			background: linear-gradient(120deg, #0057ff, #3279ff);
			color: #fff;
		}

		.alarm-btn-track:hover {
			filter: brightness(1.05);
		}


		.tracker-panel {
			margin-top: 14px;
			padding: 14px;
			border: 1px solid #dce5f6;
			border-radius: 12px;
			background: #f8fbff;
		}

		.tracker-panel[hidden] {
			display: none;
		}

		.track-status {
			font-size: 0.92rem;
			font-weight: 600;
			color: #1b4d9e;
			margin-bottom: 8px;
		}

		.track-wrap {
			position: relative;
			height: 170px;
			overflow-x: auto;
			padding: 4px 0;
		}

		.track-map {
			position: relative;
			width: 920px;
			height: 100%;
			margin: 0 auto;
		}

		.track-line {
			position: absolute;
			top: 50%;
			left: 20px;
			right: 20px;
			height: 4px;
			border-radius: 999px;
			background: linear-gradient(90deg, #b8c7e8, #93aad6);
			transform: translateY(-50%);
		}

		.track-bus {
			position: absolute;
			top: calc(50% - 14px);
			width: 28px;
			height: 28px;
			background: #ff8a00;
			border: 3px solid #fff;
			border-radius: 50%;
			box-shadow: 0 0 0 2px rgba(255, 138, 0, 0.3);
			transform: translateX(-50%);
			z-index: 4;
		}

		.track-stop {
			position: absolute;
			top: 50%;
			transform: translate(-50%, -50%);
			text-align: center;
			z-index: 2;
		}

		.track-point {
			width: 16px;
			height: 16px;
			border-radius: 50%;
			background: #a4b7dc;
			border: 2px solid #fff;
			margin: 0 auto;
		}

		.track-stop.passed .track-point {
			background: #2c78ff;
		}

		.track-stop.current .track-point {
			background: #ff8a00;
			box-shadow: 0 0 0 3px rgba(255, 138, 0, 0.25);
		}

		.track-label {
			position: absolute;
			width: 120px;
			left: 50%;
			transform: translateX(-50%);
			font-size: 0.78rem;
			line-height: 1.3;
			color: #30405f;
		}

		.track-label strong {
			display: block;
			font-size: 0.8rem;
		}

		.track-stop.top .track-label {
			bottom: 24px;
		}

		.track-stop.bottom .track-label {
			top: 24px;
		}

		.route-line-panel {
			background: #fff;
			border-radius: var(--radius);
			padding: 22px 18px;
			box-shadow: 0 8px 24px rgba(16,35,72,0.10);
		}

		.route-v-timeline-header {
			display: grid;
			grid-template-columns: 120px 38px 1fr 120px;
			gap: 12px;
			min-height: 40px;
			align-items: center;
			padding: 0 0 12px;
			margin-bottom: 12px;
			border-bottom: 2px solid #e0e8f5;
			font-weight: 700;
			font-size: 0.86rem;
			color: #3d5073;
			text-transform: uppercase;
			letter-spacing: 0.5px;
		}

		.route-v-timing-cols {
			display: contents;
		}

		.route-v-stop {
			display: grid;
			grid-template-columns: 120px 38px 1fr 120px;
			gap: 12px;
			min-height: 64px;
			align-items: start;
		}

		.route-v-time-col-left {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: center;
			min-height: 40px;
			padding-top: 4px;
		}

		.route-v-station-center {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: flex-start;
			text-align: left;
			padding: 4px 8px 2px;
		}

		.route-v-time-col-right {
			display: flex;
			flex-direction: column;
			justify-content: flex-start;
			align-items: center;
			min-height: 40px;
			padding-top: 4px;
		}

		.route-v-info-substations {
			grid-column: 1 / -1;
			margin-top: 8px;
		}

		.route-v-dot-col {
			display: flex;
			flex-direction: column;
			align-items: center;
			width: 38px;
			flex-shrink: 0;
			position: relative;
		}

		.route-v-dot-col::before,
		.route-v-dot-col::after {
			content: "";
			position: absolute;
			left: 50%;
			width: 3px;
			transform: translateX(-50%);
			background: #cdd9f2;
			z-index: 0;
		}

		.route-v-dot-col::before {
			top: 0;
			height: 13px;
		}

		.route-v-dot-col::after {
			top: 13px;
			bottom: 0;
		}

		.route-v-stop.is-start .route-v-dot-col::before {
			display: none;
		}

		.route-v-stop.is-end .route-v-dot-col::after {
			display: none;
		}

		.route-v-dot {
			width: 18px;
			height: 18px;
			border-radius: 50%;
			border: 3px solid #fff;
			box-shadow: 0 0 0 2px #cdd9f2;
			background: #98afd9;
			margin-top: 4px;
		}

		.route-v-seg {
			width: 3px;
			flex: 1;
			background: #cdd9f2;
			margin: 0;
			min-height: 26px;
			position: relative;
			z-index: 1;
		}

		.route-v-seg-btn {
			cursor: pointer;
			border: none;
			padding: 0;
			min-width: 3px;
		}

		.route-v-seg-btn:hover {
			filter: brightness(0.92);
		}

		.route-v-info {
			padding: 2px 0 18px 14px;
			flex: 1;
		}

		.route-v-station {
			font-size: 1rem;
			font-weight: 700;
			color: var(--text);
		}

		.route-v-time {
			font-size: 0.86rem;
			color: var(--muted);
			margin-top: 2px;
		}
		.route-v-time-group {
			margin-top: 4px;
			display: grid;
			gap: 2px;
		}
		.route-v-time-row {
			display: grid;
			grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
			gap: 8px;
		}
		.route-v-time-line {
			font-size: 0.83rem;
			color: var(--muted);
			display: flex;
			align-items: center;
			justify-content: space-between;
			gap: 8px;
			padding: 4px 8px;
			border-radius: 8px;
			background: #f4f8ff;
			border: 1px solid #dbe6fb;
		}
		.route-v-time-line span {
			font-weight: 700;
			color: #4d5f86;
			white-space: nowrap;
		}
		.route-v-halt {
			font-size: 0.78rem;
			font-weight: 700;
			color: #1f5bcc;
		}

		.route-substations {
			margin-top: 10px;
			border: 1px dashed #c8d4ee;
			border-radius: 10px;
			background: #f8fbff;
			padding: 9px 10px;
		}

		.route-substations-title {
			font-size: 0.82rem;
			font-weight: 700;
			color: #44506a;
			margin-bottom: 5px;
		}

		.route-substations-list {
			margin: 0;
			padding-left: 18px;
			display: grid;
			gap: 4px;
			font-size: 0.84rem;
			color: #4b5874;
		}

		.route-substations-list strong {
			color: #243654;
		}

		.route-substation-time {
			color: #5d6d8f;
		}

		.route-v-stop.is-start .route-v-dot,
		.route-v-stop.is-end .route-v-dot {
			width: 19px;
			height: 19px;
			box-shadow: 0 0 0 2px rgba(0,87,255,0.25);
		}

		.route-v-stop.is-start .route-v-dot {
			background: #0057ff;
		}

		.route-v-stop.is-start .route-v-station {
			color: #0057ff;
		}

		.route-v-stop.is-end .route-v-dot {
			background: #00a884;
		}

		.route-v-stop.is-end .route-v-station {
			color: #008061;
		}

		body[data-theme="light"] {
			color: #1e2a44;
			background:
				radial-gradient(circle at 10% 10%, #e6fff5, transparent 45%),
				radial-gradient(circle at 90% 20%, #dff0ff, transparent 40%),
				linear-gradient(135deg, #f4f7ff, #f6f9ff 50%, #eefeff 100%);
		}

		body[data-theme="light"] .hero {
			background: linear-gradient(120deg, #0057ff, #00a884);
			color: #fff;
		}

		body[data-theme="light"] .results-screen-head,
		body[data-theme="light"] .rail-result-card,
		body[data-theme="light"] .search-history-panel {
			color: #1e2a44;
		}

		body[data-theme="light"] .results-screen-head {
			background: linear-gradient(135deg, #eef5ff, #f8fbff);
			border-color: #d7e3f8;
			box-shadow: 0 8px 22px rgba(16, 35, 72, 0.08);
		}

		body[data-theme="light"] .results-screen-title,
		body[data-theme="light"] .results-screen-route {
			color: #243654;
		}

		body[data-theme="light"] .results-screen-arrow {
			color: #5372a4;
		}

		body[data-theme="light"] .rail-result-card {
			background: #fff;
			border-color: #dce5f6;
			box-shadow: 0 6px 18px rgba(15, 36, 79, 0.08);
		}

		body[data-theme="light"] .rail-code {
			background: #d9ebff;
			color: #0d2a57;
		}

		body[data-theme="light"] .rail-time,
		body[data-theme="light"] .rail-bus-name {
			color: #1f2f4a;
		}

		body[data-theme="light"] .rail-duration,
		body[data-theme="light"] .rail-route-line,
		body[data-theme="light"] .rail-result-card .days-row,
		body[data-theme="light"] .search-history-empty,
		body[data-theme="light"] .search-history-item-arrow {
			color: #5b6b89;
		}

		body[data-theme="light"] .rail-result-card .badge {
			background: #ecf3ff;
			color: #0f4ecf;
		}

		body[data-theme="light"] .rail-result-card .fare-badge {
			background: linear-gradient(120deg, #fff7e6, #fff0cc);
			border-color: #f0c040;
			color: #7a4800;
		}

		body[data-theme="light"] .rail-result-card .day-chip {
			background: #f4f7ff;
			border-color: #d5deef;
			color: #8a97b4;
		}

		body[data-theme="light"] .rail-result-card .day-chip.active {
			background: linear-gradient(120deg, #0057ff, #00a884);
			color: #fff;
		}

		body[data-theme="light"] .rail-result-card .time-toggle {
			color: #1f2f4a;
		}

		body[data-theme="light"] .rail-status.daily,
		body[data-theme="light"] .rail-status.today {
			background: #e9f9ef;
			color: #0f6b3b;
			border: 1px solid #8fd7ad;
		}

		body[data-theme="light"] .rail-status.off {
			background: #fff0f0;
			color: #9f1b1b;
			border: 1px solid #efb3b3;
		}

		body[data-theme="light"] .search-history-panel {
			background: #fff;
			border-color: #dce5f6;
			box-shadow: 0 6px 18px rgba(15, 36, 79, 0.08);
		}

		body[data-theme="light"] .search-history-title {
			color: #243654;
		}

		body[data-theme="light"] .search-history-clear {
			background: #ecf3ff;
			border-color: #d6e3fb;
			color: #184da6;
		}

		body[data-theme="light"] .search-history-item {
			background: #f8fbff;
			border-color: #dce5f6;
			color: #243654;
		}

		body[data-theme="light"] .search-history-item.active {
			background: #edf4ff;
			border-color: #83a9ea;
		}

		body[data-theme="light"] .recent-viewed-code {
			background: #d9ebff;
			color: #0d2a57;
		}

		body[data-theme="light"] .recent-viewed-route {
			color: #5b6b89;
		}

		body[data-theme="light"] .v-timeline-header,
		body[data-theme="light"] .route-v-timeline-header {
			border-bottom-color: #d7e3f8;
			color: #3d5073;
		}

		body[data-theme="light"] .v-time-only,
		body[data-theme="light"] .route-v-time-only {
			color: #1f2f4a;
		}

		body[data-theme="dark"] {
			color: #e6eefc;
			background:
				radial-gradient(circle at 10% 10%, rgba(24, 53, 74, 0.9), transparent 45%),
				radial-gradient(circle at 90% 20%, rgba(27, 37, 69, 0.75), transparent 40%),
				linear-gradient(135deg, #07111d, #0a1626 48%, #0d1a2b 100%);
		}

		body[data-theme="dark"] .search-panel,
		body[data-theme="dark"] .bus-card,
		body[data-theme="dark"] .admin-bus-card,
		body[data-theme="dark"] .admin-field,
		body[data-theme="dark"] .tracker-status-box,
		body[data-theme="dark"] .tracker-alarm-summary,
		body[data-theme="dark"] .v-timeline,
		body[data-theme="dark"] .route-line-panel,
		body[data-theme="dark"] .alarm-content,
		body[data-theme="dark"] .tracker-panel {
			background: #0f1a2b;
			border-color: #253753;
			color: #e6eefc;
			box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
		}

		body[data-theme="dark"] .hero {
			background: linear-gradient(120deg, #111c33, #17314f);
			box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
		}

		body[data-theme="dark"] .lang-switch,
		body[data-theme="dark"] .theme-toggle {
			background: rgba(12, 21, 37, 0.75);
			border: 1px solid rgba(127, 159, 214, 0.28);
			color: #edf4ff;
		}

		body[data-theme="dark"] .lang-switch select {
			background: #0d1726;
			color: #e6eefc;
			border-color: #334a70;
		}

		body[data-theme="dark"] label,
		body[data-theme="dark"] .meta,
		body[data-theme="dark"] .bus-route,
		body[data-theme="dark"] .admin-label,
		body[data-theme="dark"] .admin-note,
		body[data-theme="dark"] .v-time,
		body[data-theme="dark"] .route-v-time,
		body[data-theme="dark"] .tracker-alarm-title,
		body[data-theme="dark"] .tracker-alarm-empty {
			color: #9db0d3;
		}

		body[data-theme="dark"] input,
		body[data-theme="dark"] select,
		body[data-theme="dark"] .tracker-back-btn {
			background: #0b1523;
			border-color: #2d4263;
			color: #e6eefc;
		}

		body[data-theme="dark"] .swap-btn {
			background: linear-gradient(120deg, #0f1e33, #132742);
			color: #cae0ff;
			border-color: #304668;
		}

		body[data-theme="dark"] .results-screen-head {
			background: linear-gradient(135deg, #111b2d, #18263d);
			border-color: #304564;
			color: #edf4ff;
		}

		body[data-theme="dark"] .results-screen-title,
		body[data-theme="dark"] .results-screen-route,
		body[data-theme="dark"] .rail-time,
		body[data-theme="dark"] .rail-bus-name,
		body[data-theme="dark"] .admin-value,
		body[data-theme="dark"] .bus-title,
		body[data-theme="dark"] .bus-time-city,
		body[data-theme="dark"] .v-substations-list strong,
		body[data-theme="dark"] .route-substations-list strong,
		body[data-theme="dark"] .route-v-station,
		body[data-theme="dark"] .v-station,
		body[data-theme="dark"] .alarm-station {
			color: #edf4ff;
		}

		body[data-theme="dark"] .results-screen-arrow,
		body[data-theme="dark"] .rail-duration,
		body[data-theme="dark"] .rail-route-line,
		body[data-theme="dark"] .bus-time-label,
		body[data-theme="dark"] .bus-time-value,
		body[data-theme="dark"] .bus-time-arrow,
		body[data-theme="dark"] .v-time-line,
		body[data-theme="dark"] .route-v-time-line,
		body[data-theme="dark"] .route-substation-time,
		body[data-theme="dark"] .v-substations-list,
		body[data-theme="dark"] .route-substations-list,
		body[data-theme="dark"] .alarm-details {
			color: #9db0d3;
		}

		body[data-theme="dark"] .v-time-line,
		body[data-theme="dark"] .route-v-time-line {
			background: #111f33;
			border-color: #2d4366;
		}

		body[data-theme="dark"] .v-timeline-header,
		body[data-theme="dark"] .route-v-timeline-header {
			border-bottom-color: #2d4366;
			color: #9db0d3;
		}

		body[data-theme="dark"] .v-time-only,
		body[data-theme="dark"] .route-v-time-only {
			color: #e6eefc;
		}

		body[data-theme="dark"] .rail-result-card {
			background: linear-gradient(135deg, #0f1a2b, #0b1523);
			border-color: #2a3d5d;
			color: #e6eefc;
		}

		body[data-theme="dark"] .rail-code {
			background: #b3d6ff;
			color: #092042;
		}

		body[data-theme="dark"] .rail-result-card .badge {
			background: #20314d;
			color: #d8e8ff;
		}

		body[data-theme="dark"] .search-history-panel {
			background: linear-gradient(135deg, #111b2d, #0d1625);
			border-color: #2a3c5a;
		}

		body[data-theme="dark"] .search-history-title,
		body[data-theme="dark"] .search-history-item.active {
			color: #edf4ff;
		}

		body[data-theme="dark"] .search-history-clear {
			background: #1a2940;
			border-color: #344a6e;
			color: #d7e6ff;
		}

		body[data-theme="dark"] .search-history-item {
			background: #132138;
			border-color: #2f4466;
			color: #d9e7ff;
		}

		body[data-theme="dark"] .search-history-item.active {
			background: #193150;
			border-color: #4d74b0;
		}

		body[data-theme="dark"] .recent-viewed-code {
			background: #b3d6ff;
			color: #092042;
		}

		body[data-theme="dark"] .recent-viewed-route {
			color: #9db0d3;
		}

		body[data-theme="dark"] .fare-badge {
			background: linear-gradient(120deg, rgba(125, 87, 14, 0.35), rgba(91, 66, 14, 0.35));
			border-color: rgba(240, 192, 64, 0.45);
			color: #ffd98f;
		}

		body[data-theme="dark"] .day-chip {
			background: #172538;
			border-color: #304563;
			color: #8ea1c5;
		}

		body[data-theme="dark"] .day-chip.active {
			background: linear-gradient(120deg, #2367f2, #149d74);
			color: #fff;
		}

		body[data-theme="dark"] .tracker-overlay {
			background:
				radial-gradient(circle at 10% 10%, rgba(24, 53, 74, 0.9), transparent 45%),
				radial-gradient(circle at 90% 20%, rgba(27, 37, 69, 0.75), transparent 40%),
				linear-gradient(135deg, #07111d, #0a1626 48%, #0d1a2b 100%);
		}

		body[data-theme="dark"] .tracker-overlay-header {
			background: linear-gradient(120deg, #111c33, #17314f);
		}

		body[data-theme="dark"] .tracker-simulated-warning,
		body[data-theme="dark"] .admin-note {
			background: rgba(111, 84, 20, 0.22);
			border-color: rgba(246, 201, 14, 0.35);
			color: #f5d98a;
		}

		body[data-theme="dark"] .tracker-alarm-chip,
		body[data-theme="dark"] .v-alarm-mini.is-active {
			background: rgba(133, 73, 13, 0.24);
			border-color: rgba(255, 214, 170, 0.28);
			color: #ffd8a8;
		}

		body[data-theme="dark"] .tracker-alarm-station,
		body[data-theme="dark"] .tracker-alarm-time,
		body[data-theme="dark"] .tracker-alarm-remove,
		body[data-theme="dark"] .v-info-current .v-time,
		body[data-theme="dark"] .v-info-current .v-station {
			color: #ffd8a8;
		}

		body[data-theme="dark"] .v-substations,
		body[data-theme="dark"] .route-substations,
		body[data-theme="dark"] .bus-time-item,
		body[data-theme="dark"] .alarm-bus-info {
			background: #132138;
			border-color: #2e4466;
		}

		body[data-theme="dark"] .v-dot,
		body[data-theme="dark"] .route-v-dot {
			box-shadow: 0 0 0 2px #35517b;
		}

		body[data-theme="dark"] .v-seg,
		body[data-theme="dark"] .route-v-seg {
			background: #2f4364;
		}

		body[data-theme="dark"] .v-time-line span,
		body[data-theme="dark"] .route-v-time-line span {
			color: #ceddff;
		}

		body[data-theme="dark"] .alarm-btn-dismiss {
			background: #1b2b42;
			color: #edf4ff;
		}

		body[data-theme="dark"] .alarm-btn-dismiss:hover {
			background: #223450;
		}

		@media (max-width: 820px) {
			.grid {
				grid-template-columns: 1fr;
			}

			.container {
				margin: 20px auto;
			}

			.hero,
			.search-panel {
				padding: 16px;
			}

			.tracker-alarm-chip {
				min-width: 100%;
				border-radius: 12px;
			}

			.tracker-alarm-details {
				gap: 1px;
			}

			.route-share-section {
				flex-direction: column;
			}

			.route-share-btn {
				width: 100%;
			}

			.btn-group {
				flex-wrap: wrap;
			}

			/* Swap button full-width in single-column grid */
			.swap-col {
				justify-content: stretch;
			}

			.swap-btn {
				width: 100%;
				height: 44px;
			}

			.swap-icon {
				transform: none; /* show ⇅ upright on mobile */
			}

			.v-timeline-header,
			.v-stop,
			.route-v-timeline-header,
			.route-v-stop {
				grid-template-columns: 92px 34px minmax(0, 1fr) 92px;
				gap: 8px;
			}

			.v-time-col-left,
			.v-time-col-right,
			.route-v-time-col-left,
			.route-v-time-col-right {
				font-size: 0.88rem;
			}
		}

		/* ── Small mobile (≤ 480px) ── */
		@media (max-width: 480px) {
			.container {
				width: 96vw;
				margin: 12px auto;
			}

			.hero {
				padding: 14px 12px;
			}

			.search-panel {
				padding: 14px 12px;
				margin-top: 14px;
			}

			/* Hero title/subtitle tighter */
			.hero h1 {
				font-size: 1.35rem;
				margin-bottom: 8px;
			}

			.hero p {
				font-size: 0.9rem;
			}

			/* Hero actions: stack Bus List on top, tools below */
			.hero-actions {
				flex-direction: column;
				align-items: stretch;
				gap: 10px;
				margin-top: 12px;
			}

			.bus-list-btn {
				width: 100%;
				font-size: 0.9rem;
				padding: 10px;
				text-align: center;
			}

			.hero-tools {
				justify-content: space-between;
				flex-wrap: nowrap;
				width: 100%;
				gap: 8px;
			}

			/* Hide language label text to save space */
			.lang-switch label {
				display: none;
			}

			.lang-switch {
				flex: 1;
				padding: 6px 8px;
			}

			.lang-switch select {
				width: 100%;
				font-size: 0.9rem;
			}

			/* Rail result card: stack code + times vertically */
			.rail-card-top {
				flex-direction: column;
				align-items: flex-start;
				gap: 8px;
			}

			.rail-times {
				margin-left: 0;
				width: 100%;
				justify-content: space-between;
			}

			.rail-code {
				font-size: 0.88rem;
			}

			.rail-time {
				font-size: 1rem;
			}

			.rail-bus-name {
				font-size: 0.98rem;
			}

			/* Name row: allow badge to wrap below long names */
			.rail-name-row {
				flex-wrap: wrap;
				gap: 6px;
			}

			/* Buttons: 2 per row (track + route), share full-width */
			.btn-group {
				flex-wrap: wrap;
				gap: 8px;
			}

			.btn-group button {
				flex: 1 1 calc(50% - 4px);
				min-width: 0;
				font-size: 0.88rem;
				padding: 10px 8px;
			}

			.share-btn {
				flex: 1 1 100%;
			}

			/* Result screen header wrapping */
			.results-screen-route {
				flex-wrap: wrap;
				gap: 4px;
				font-size: 0.95rem;
			}

			/* Search history items: allow station names to wrap */
			.search-history-item {
				flex-wrap: wrap;
				gap: 3px;
				font-size: 0.86rem;
			}

			/* Recent viewed code badge smaller */
			.recent-viewed-code {
				min-width: 56px;
				font-size: 0.76rem;
				padding: 4px 6px;
			}

			/* Tracker overlay inner padding */
			.tracker-overlay-inner {
				width: 96vw;
				margin: 16px auto;
			}

			.tracker-overlay-header {
				padding: 16px 14px;
			}

			.tracker-header-actions {
				grid-template-columns: 1fr;
				gap: 8px;
			}

			.tracker-head-btn {
				padding: 10px 8px;
				font-size: 0.8rem;
			}

			.v-timeline {
				padding: 16px 12px;
			}

			.v-timeline-header,
			.v-stop,
			.route-v-timeline-header,
			.route-v-stop {
				grid-template-columns: 70px 28px minmax(0, 1fr) 70px;
				gap: 6px;
			}

			.v-timing-col,
			.route-v-timing-col {
				font-size: 0.72rem;
				padding: 0 2px;
			}

			.v-station,
			.route-v-station {
				font-size: 0.92rem;
			}

			.v-time-col-left,
			.v-time-col-right,
			.route-v-time-col-left,
			.route-v-time-col-right {
				font-size: 0.8rem;
				min-height: 34px;
			}

			.v-dot-col,
			.route-v-dot-col {
				width: 28px;
			}

			.v-dot,
			.route-v-dot {
				width: 16px;
				height: 16px;
				border-width: 2px;
			}

			.v-dot-col::before,
			.v-dot-col::after,
			.route-v-dot-col::before,
			.route-v-dot-col::after {
				width: 2px;
			}

			.v-bus-icon {
				font-size: 1.05rem;
			}

			/* Meta text */
			.meta {
				font-size: 0.88rem;
			}
		}
		/* Mobile Search Overlay */
.search-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.input-container {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 100;
  padding: 16px;
}
.suggestion-box {
  position: relative;
  width: 100%;
  max-height: 40vh;
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  z-index: 1000;
}
.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0f0f0;
}
.suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item:hover {
  background: #f4f7ff;
}
@media (min-width: 700px) {
  .search-overlay { display: none !important; }
}
/* ===== MOBILE SEARCH IMPROVEMENTS - ADD THIS AT THE BOTTOM ===== */
@media (max-width: 700px) {
    /* Make search panel sticky at top */
    .search-panel {
        position: sticky;
        top: 0;
        background: var(--card, #ffffff);
        z-index: 100;
        padding: 15px;
        margin-top: 0;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* Input wrapper for suggestions positioning */
    .station-input-wrapper {
        position: relative;
        width: 100%;
        margin-bottom: 12px;
    }
    
    /* Input fields - prevent zoom on iOS */
    #startStation, #endStation {
        font-size: 16px !important;
        padding: 14px 15px !important;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Suggestions dropdown */
    .mobile-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--card, #ffffff);
        border: 1px solid #d4def2;
        border-top: none;
        border-radius: 0 0 12px 12px;
        max-height: 200px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    /* Suggestion items - touch friendly */
    .mobile-suggestion-item {
        padding: 12px 16px;
        font-size: 15px;
        cursor: pointer;
        border-bottom: 1px solid #eef2f7;
    }
    
    .mobile-suggestion-item:active {
        background: #f0f4ff;
    }
    
    /* Mobile grid layout */
    .grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .swap-col {
        order: 3;
    }
    
    .swap-btn {
        width: 100%;
        height: 44px;
    }
    
    /* Results spacing for keyboard */
    .results {
        margin-bottom: 100px;
        padding-bottom: 20px;
    }
    
    /* Hide any old search overlay if exists */
    .search-overlay {
        display: none !important;
    }
}
/* Fix for mobile input box being cut off */
@media (max-width: 700px) {
    /* Ensure container doesn't cut off content */
    .container {
        width: 100%;
        margin: 0;
        padding: 0 12px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Fix search panel width */
    .search-panel {
        position: sticky;
        top: 0;
        background: var(--card, #ffffff);
        z-index: 100;
        padding: 15px;
        margin-top: 0;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        width: 100%;
        box-sizing: border-box;
        left: 0;
        right: 0;
    }
    
    /* Fix input wrapper */
    .station-input-wrapper {
        position: relative;
        width: 100%;
        margin-bottom: 12px;
        box-sizing: border-box;
    }
    
    /* Fix input fields */
    #startStation, #endStation {
        font-size: 16px;
        padding: 14px 15px;
        width: 100%;
        box-sizing: border-box;
        border: 1px solid #d4def2;
        border-radius: 12px;
        background: var(--card, #fff);
        margin: 0;
    }
    
    /* Fix grid layout on mobile */
    .grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        align-items: stretch;
    }
    
    /* Fix swap button */
    .swap-col {
        order: 3;
        width: 100%;
    }
    
    .swap-btn {
        width: 100%;
        height: 44px;
    }
    
    /* Fix body overflow */
    body {
        overflow-x: hidden;
        width: 100%;
    }
    
    /* Ensure all elements respect box-sizing */
    * {
        box-sizing: border-box;
    }
    
    /* Fix hero section on mobile */
    .hero {
        width: 100%;
        box-sizing: border-box;
        margin: 0;
        border-radius: 0 0 16px 16px;
    }
}
/* Force fix for left cut-off */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    overflow-x: hidden;
}

.search-panel {
    overflow-x: hidden;
}

input, .station-input-wrapper {
    max-width: 100%;
}
/* Mobile Fix - Input Box Visible */
@media (max-width: 700px) {
    /* Reset body margins */
    body {
        margin: 0;
        padding: 0;
        overflow-x: hidden;
    }
    
    /* Fix container */
    .container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 10px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Fix hero section */
    .hero {
        width: 100%;
        margin: 0;
        border-radius: 0;
        padding: 15px;
        box-sizing: border-box;
    }
    
    /* Fix search panel - remove sticky if causing issues */
    .search-panel {
        width: 100%;
        margin: 10px 0;
        padding: 15px;
        box-sizing: border-box;
        overflow-x: hidden;
    }
    
    /* Fix grid layout */
    .grid {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        align-items: stretch;
    }
    
    /* Fix input wrapper */
    .station-input-wrapper {
        position: relative;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix input fields - THIS IS THE KEY FIX */
    #startStation, #endStation {
        width: 100%;
        font-size: 16px;
        padding: 12px 15px;
        margin: 0;
        box-sizing: border-box;
        border: 1px solid #d4def2;
        border-radius: 12px;
        background: var(--card, #fff);
    }
    
    /* Fix labels */
    label {
        display: block;
        margin-bottom: 5px;
        font-size: 14px;
    }
    
    /* Fix swap button */
    .swap-col {
        width: 100%;
        order: 3;
    }
    
    .swap-btn {
        width: 100%;
        height: 44px;
    }
    
    /* Fix suggestions dropdown */
    .mobile-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--card, #ffffff);
        border: 1px solid #d4def2;
        border-top: none;
        border-radius: 0 0 12px 12px;
        max-height: 200px;
        overflow-y: auto;
        z-index: 1000;
        box-sizing: border-box;
    }
    
    /* Fix results section */
    .results {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Fix bus cards */
    .bus-card, .rail-result-card {
        width: 100%;
        box-sizing: border-box;
        margin: 0 0 10px 0;
    }
    
    /* Fix all elements to use border-box */
    * {
        box-sizing: border-box;
    }
}
/* ===== FINAL MOBILE KEYBOARD + SUGGESTION FIX ===== */
@media (max-width: 700px) {
    /* Remove sticky - it causes input to hide behind keyboard */
    .search-panel {
        position: relative !important;
        top: auto !important;
    }

    /* Wrapper must be relative for suggestions to position correctly */
    .station-input-wrapper {
        position: relative !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Suggestions appear BELOW input, inside scroll not fixed */
    .mobile-suggestions {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        background: #ffffff !important;
        border: 1px solid #d4def2 !important;
        border-top: none !important;
        border-radius: 0 0 12px 12px !important;
        max-height: 180px !important;
        overflow-y: auto !important;
        z-index: 9999 !important;
        box-shadow: 0 6px 16px rgba(0,0,0,0.15) !important;
        box-sizing: border-box !important;
        /* Do NOT use fixed position - that overlaps keyboard */
    }

    /* Touch-friendly suggestion items */
    .mobile-suggestion-item {
        padding: 13px 16px !important;
        font-size: 15px !important;
        cursor: pointer !important;
        border-bottom: 1px solid #eef2f7 !important;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-suggestion-item:active {
        background: #e8f0ff !important;
    }

    /* Inputs - font-size 16px prevents iOS auto-zoom */
    #startStation, #endStation {
        font-size: 16px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}
