:root {
            --bg-deep: #0a0a0b;
            --bg-card: #141417;
            --bg-card-hover: #1c1c21;
            --accent-green: #00f5a0;
            --accent-red: #ff4d4d;
            --accent-purple: #9d50bb;
            --accent-cyan: #00d2ff;
            --text-main: #ffffff;
            --text-dim: #94a3b8;
            --border: rgba(255, 255, 255, 0.08);
            --glass: rgba(255, 255, 255, 0.03);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Plus Jakarta Sans', sans-serif;
            -webkit-tap-highlight-color: transparent;
        }

body {
            background-color: var(--bg-deep);
            color: var(--text-main);
            min-height: 100vh;
            overflow-x: hidden;
        }

        .sync-progress {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 3px;
            z-index: 4000;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        .sync-progress.active {
            opacity: 1;
        }

        .sync-progress-bar {
            width: 35%;
            height: 100%;
            background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
            border-radius: 999px;
            animation: sync-slide 1.15s ease-in-out infinite;
        }

        @keyframes sync-slide {
            0% {
                transform: translateX(-120%);
            }

            100% {
                transform: translateX(420%);
            }
        }

        .glass-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 24px;
            padding: 24px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            transition: all 0.3s ease;
        }

        .btn {
            padding: 12px 24px;
            border-radius: 12px;
            border: none;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 0.95rem;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan));
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(0, 210, 255, 0.3);
        }

        .btn-outline {
            background: transparent;
            border: 1px solid var(--border);
            color: var(--text-main);
        }

        .btn-outline:hover {
            background: var(--glass);
            border-color: var(--text-dim);
        }

        .input-group {
            margin-bottom: 20px;
        }

        .input-group label {
            display: block;
            margin-bottom: 8px;
            color: var(--text-dim);
            font-size: 0.85rem;
            font-weight: 500;
        }

        input,
        textarea {
            width: 100%;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid var(--border);
            border-radius: 12px;
            padding: 14px;
            color: white;
            font-size: 1rem;
        }

#onboarding-screen {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100vh;
            padding: 20px;
        }

        #login-screen {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 100vh;
            padding: 24px;
        }

        .login-card {
            width: 100%;
            max-width: 430px;
            text-align: center;
            display: flex;
            flex-direction: column;
            gap: 16px;
            align-items: center;
        }

        .login-subtitle {
            color: var(--text-dim);
            margin-bottom: 4px;
            line-height: 1.5;
        }

        .auth-error {
            width: 100%;
            background: rgba(255, 77, 77, 0.12);
            border: 1px solid rgba(255, 77, 77, 0.4);
            color: #ffd4d4;
            padding: 10px 12px;
            border-radius: 12px;
            font-size: 0.85rem;
            text-align: left;
            word-break: break-word;
        }

        .spinner {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-top-color: var(--accent-cyan);
            border-right-color: var(--accent-green);
            animation: spin 0.8s linear infinite;
            flex-shrink: 0;
        }

        @keyframes spin {
            from {
                transform: rotate(0deg);
            }
            to {
                transform: rotate(360deg);
            }
        }

        .login-loading {
            display: flex;
            align-items: center;
            gap: 10px;
            width: 100%;
            padding: 10px 12px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.04);
            border: 1px dashed rgba(255, 255, 255, 0.15);
            font-size: 0.9rem;
            color: var(--text-dim);
        }

        .loading-dots {
            display: inline-block;
            overflow: hidden;
            vertical-align: bottom;
            width: 3ch;
        }

        .loading-dots::after {
            content: "...";
            display: inline-block;
            width: 0ch;
            animation: dots 1.1s steps(4, end) infinite;
        }

        @keyframes dots {
            to {
                width: 3ch;
            }
        }

        .sync-card {
            position: fixed;
            right: 24px;
            bottom: 24px;
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 14px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
            z-index: 2500;
            font-size: 0.85rem;
            color: var(--text-dim);
        }

        .skeleton {
            position: relative;
            color: transparent !important;
            background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
            background-size: 200% 100%;
            border-radius: 8px;
            animation: shimmer 1.2s linear infinite;
        }

        .skeleton::selection {
            color: transparent;
        }

        @keyframes shimmer {
            0% {
                background-position: 200% 0;
            }
            100% {
                background-position: -200% 0;
            }
        }

        .logo-mark {
            width: 64px;
            height: 64px;
            background: linear-gradient(45deg, var(--accent-purple), var(--accent-cyan));
            border-radius: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 24px;
            box-shadow: 0 0 30px rgba(157, 80, 187, 0.4);
        }

        #app-shell {
            display: none;
            padding: 24px;
            max-width: 1400px;
            margin: 0 auto;
        }

        .nav-bar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 32px;
        }

        .nav-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            font-size: 1.5rem;
            font-weight: 700;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 24px;
            margin-bottom: 32px;
        }

        .secondary-val {
            font-size: 0.9rem;
            color: var(--text-dim);
            margin-top: 4px;
        }

        .up {
            color: var(--accent-green);
        }

        .down {
            color: var(--accent-red);
        }

        .change-row {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1.5rem;
            font-weight: 700;
            margin-top: 4px;
        }

        .change-label-white {
            color: white;
            font-size: 0.9rem;
            font-weight: 500;
        }

        .percent-row {
            font-size: 0.95rem;
            font-weight: 600;
            margin-top: 4px;
        }

        .history-table {
            width: 100%;
            border-collapse: collapse;
        }

        .history-table th,
        .history-table td {
            text-align: left;
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }

        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(10px);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            padding: 20px;
        }

        .modal-content {
            width: 100%;
            max-width: 480px;
        }

        .toast {
            position: fixed;
            bottom: 30px;
            right: 30px;
            background: var(--bg-card);
            border: 1px solid var(--accent-cyan);
            padding: 16px 24px;
            border-radius: 12px;
            display: none;
            z-index: 2000;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
        }

        .live-tag {
            font-size: 0.65rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 2px 6px;
            border-radius: 4px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-left: 8px;
        }

        .mode-picker {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 10px;
            margin-bottom: 16px;
        }

        .mode-option {
            border: 1px solid var(--border);
            border-radius: 12px;
            background: transparent;
            color: var(--text-main);
            padding: 12px;
            text-align: left;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .mode-option small {
            display: block;
            color: var(--text-dim);
            margin-top: 4px;
            font-size: 0.75rem;
        }

        .mode-option.active {
            border-color: var(--accent-cyan);
            box-shadow: inset 0 0 0 1px rgba(0, 210, 255, 0.4);
            background: rgba(0, 210, 255, 0.08);
        }

