        * { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, sans-serif; }
        body { height: 100vh; overflow: hidden; font-size: 16px; }

        /* Custom login heading style */
        .login-box h1 { text-align: center; margin-bottom: 1rem; color: #f00; font-size: 2rem; font-weight: bold; }

        /* Login Screen */
        #loginScreen {
            position: fixed; inset: 0;
            background: linear-gradient(135deg, #2c3e50, #3498db);
            display: flex; align-items: center; justify-content: center;
            z-index: 9999;
            padding: 1rem;
        }
        .login-box {
            background: white; padding: 2rem; border-radius: 8px;
            box-shadow: 0 8px 24px rgba(0,0,0,0.2); width: 100%; max-width: 400px;
        }
        .login-box h2 { text-align: center; margin-bottom: 1.5rem; color: #2c3e50; font-size: 1.5rem; }
        .login-box input {
            width: 100%; padding: 0.8rem; margin: 0.8rem 0;
            border: 1px solid #ddd; border-radius: 4px; font-size: 1rem;
        }
        .login-box button {
            width: 100%; padding: 0.9rem; background: #2980b9; color: white;
            border: none; border-radius: 4px; font-size: 1rem; font-weight: bold; cursor: pointer;
            min-height: 44px;
        }
        .login-box button:hover { background: #2471a3; }
        #loginError { margin-top: 1rem; color: #c0392b; text-align: center; min-height: 1.5em; }

        /* Main App */
        #mainApp { display: none; height: 100vh; flex-direction: column; }
        #dialogHeader1 {
            padding: 0.7rem 1rem; font-size: 1.1rem; font-weight: bold;
            background: #fff; border-bottom: 1px solid #eee;
            color: #2c3e50;
        }
        .top-bar {
            padding: 0.6rem 0.8rem; background: #f5f5f5; border-bottom: 1px solid #ddd;
            display: flex; flex-wrap: wrap; gap: 0.7rem; align-items: center;
            font-size: 0.9rem;
        }
        #logoutBtn {
            background: #e74c3c; color: white; border: none; padding: 0.4rem 0.8rem;
            border-radius: 4px; cursor: pointer; font-size: 0.9rem; min-height: 36px;
        }
        select, input[type="file"], input[type="datetime-local"] {
            font-size: 0.9rem; padding: 0.4rem; border: 1px solid #ccc; border-radius: 4px;
        }
        button.small { padding: 0.4rem 0.7rem; font-size: 0.85rem; }
		button:disabled { opacity: 0.5; cursor: not-allowed; }
        .history-controls {
            background: #eef4f8; padding: 0.5rem 0.8rem; border-radius: 4px;
            margin: 0.5rem 0; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
        }
        .history-info { font-size: 0.85rem; color: #333; margin-left: 0.5rem; }
        #fileStatus { font-weight: bold; margin-left: 0.5rem; }

        /* Collapsible User List */
        .list-toggle-bar {
            background: #f0f0f0; padding: 0.5rem 0.8rem;
            border-bottom: 1px solid #ddd;
            display: flex; justify-content: space-between; align-items: center;
            cursor: pointer;
        }
        .list-toggle-bar h3 { margin: 0; font-size: 1rem; color: #333; }
        .list-toggle-bar span { font-size: 1.1rem; font-weight: bold; transition: transform 0.2s; }
        .tracker-list {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease;
            background: #f9f9f9;
            border-bottom: 1px solid #ddd;
        }
        .tracker-list.open {
            max-height: 40vh;
            overflow-y: auto;
        }
        .cyclist-item {
            padding: 0.7rem 0.8rem;
            margin: 0.4rem;
            background: #fff;
            border-radius: 4px;
            border-left: 4px solid #2196F3;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .cyclist-item:hover { background: #f0f8ff; }
        .cyclist-item.selected { background: #e3f2fd; border-left-color: #1976D2; }
        .cyclist-name { font-weight: bold; font-size: 0.95rem; }
        .cyclist-details {
            margin-top: 0.4rem;
            font-size: 0.85rem;
            color: #555;
            line-height: 1.4;
            display: none;
        }
        .cyclist-item.selected .cyclist-details { display: block; }
        .no-data { color: #888; font-style: italic; padding: 1rem; text-align: center; }

        /* Main Content */
        .main-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        .right-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
        
		#mapid {
			height: 70vh; /* default starting height */
			min-height: 120px;
			border-bottom: 1px solid #ddd;
			position: relative;
			overflow: hidden;
		}
		#profile-container {
			height: calc(30vh - 6px); /* default height minus resizer */
			min-height: 120px;
			padding: 0.5rem 0.8rem;
			background: #fafafa;
			position: relative;
			overflow: hidden;
		}


        #profileChart { width: 100%; height: 100%; }

        /* ✅ Independent highlight line (no plugin recursion) */
        .highlight-line {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 2px;
            background: #ff3333;
            opacity: 0.8;
            pointer-events: none;
            display: none;
            z-index: 10;
        }
		
#profileHighlightCurve {
    position: absolute;
    pointer-events: none;
    width: 2px;
    height: 20px;
    background: red;
    border-radius: 1px; /*50%;*/
    display: none;
}
        .segment-legend {
            position: absolute; bottom: 10px; left: 10px;
            background: #fff; padding: 0.5rem; border-radius: 4px;
            box-shadow: 0 1px 4px rgba(0,0,0,0.2);
            font-size: 0.8rem; z-index: 400;
            max-width: 150px;
        }
        .legend-item { display: flex; align-items: center; gap: 5px; margin: 2px 0; }
        .legend-colour { width: 11px; height: 11px; border-radius: 2px; }

        /* Highlight marker style */
        .highlight-marker {
            width: 14px;
            height: 14px;
            border-radius: 50%;
            /*background: #ff3333;
			/* 'red', 'orange', 'yellow', 'lime', 'cyan', 'blue', */
            border: 2px solid white;
            box-shadow: 0 0 6px rgba(0,0,0,0.6);
            margin-left: -7px;
            margin-top: -7px;
            z-index: 1000;
        }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            body { font-size: 15px; }
            .top-bar, .history-controls { flex-direction: column; align-items: stretch; gap: 0.5rem; }
            #mapid, .profile-container { min-height: 200px; }
            .right-panel { flex-direction: column; }
            .login-box { padding: 1.5rem; }
            .login-box h1 { font-size: 1.6rem; }
        }
        @media (max-width: 480px) {
            .cyclist-name { font-size: 0.9rem; }
            .cyclist-details { font-size: 0.8rem; }
            .segment-legend { font-size: 0.75rem; padding: 0.4rem; }
        }
