 * { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, sans-serif; }
        body { background-color: #f4f4f4; display: flex; flex-direction: column; height: 100vh; overflow: hidden; user-select: none; }
        .cbt-header { background: #1e88e5; color: white; padding: 10px 20px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 2px 5px rgba(0,0,0,0.2); z-index: 10; }
        .cbt-header h1 { font-size: 1.2rem; }
        .timer-box { font-size: 1.2rem; font-weight: bold; background: #e53935; padding: 5px 15px; border-radius: 4px; border: 2px solid white; white-space: nowrap; }
        .cbt-main { display: flex; flex: 1; overflow: hidden; }
        .cbt-left { flex: 3; background: white; display: flex; flex-direction: column; border-right: 2px solid #ccc; }
        .question-header { background: #f5f5f5; padding: 10px 20px; border-bottom: 1px solid #ddd; font-weight: bold; display: flex; justify-content: space-between; }
        .question-content { padding: 25px; flex: 1; overflow-y: auto; font-size: 1.1rem; line-height: 1.6; }
        .options-container { margin-top: 20px; }
        .option-row { margin-bottom: 12px; display: flex; align-items: center; cursor: pointer; }
        .option-row input { margin-right: 15px; transform: scale(1.3); cursor: pointer; }
        .cbt-footer { background: #f5f5f5; padding: 15px 20px; border-top: 1px solid #ddd; display: flex; justify-content: space-between; }
        .btn { padding: 10px 15px; border: 1px solid #ccc; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 0.95rem; }
        .btn-mark { background: #fff; color: #333; border: 1px solid #888; }
        .btn-clear { background: #fff; color: #333; border: 1px solid #888; margin-left: 10px; }
        .btn-save { background: #2ecc71; color: white; border: none; float: right; padding: 10px 25px; }
        .btn-save:hover { background: #27ae60; }
        .cbt-right { flex: 1; background: #e3f2fd; display: flex; flex-direction: column; min-width: 300px; }
        .candidate-profile { padding: 15px; text-align: center; border-bottom: 1px solid #bdc3c7; background: white; }
        .candidate-profile img { width: 80px; height: 80px; border-radius: 50%; border: 3px solid #ccc; }
        .palette-legend { padding: 15px; font-size: 0.85rem; background: white; border-bottom: 1px solid #ccc; }
        .legend-item { display: inline-flex; align-items: center; margin-bottom: 8px; width: 45%; }
        .legend-box { width: 25px; height: 25px; margin-right: 8px; border-radius: 4px; display: flex; justify-content: center; align-items: center; color: white; font-weight: bold; font-size: 0.8rem; }
        .status-not-visited { background: #e0e0e0; color: black; border: 1px solid #999; }
        .status-not-answered { background: #e74c3c; }
        .status-answered { background: #2ecc71; }
        .status-marked { background: #9b59b6; }
        .status-answered-marked { background: #9b59b6; position: relative; }
        .status-answered-marked::after { content: ''; position: absolute; bottom: 2px; right: 2px; width: 8px; height: 8px; background: #2ecc71; border-radius: 50%; }
        .palette-grid-container { padding: 15px; flex: 1; overflow-y: auto; }
        .palette-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
        .grid-btn { width: 100%; aspect-ratio: 1; border: none; border-radius: 4px; font-weight: bold; cursor: pointer; font-size: 1rem; color: white; }
        .grid-btn.active { border: 3px solid #1e88e5; transform: scale(1.1); }
        .submit-test-btn { width: 100%; padding: 15px; background: #34495e; color: white; border: none; font-size: 1.1rem; font-weight: bold; cursor: pointer; }
        .submit-test-btn:hover { background: #2c3e50; }

        /* =============================================
           MOBILE RESPONSIVE — palette becomes slide-up drawer
        ============================================= */
        /* Palette toggle button — hidden on desktop */
        .palette-toggle-btn {
            display: none;
            background: #1e88e5;
            color: white;
            border: none;
            border-radius: 4px;
            padding: 9px 14px;
            font-size: 0.82rem;
            font-weight: bold;
            cursor: pointer;
            align-items: center;
            gap: 6px;
        }

        /* Overlay backdrop */
        .palette-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.45);
            z-index: 150;
        }
        .palette-overlay.open { display: block; }

        @media (max-width: 768px) {
            .cbt-header h1 { font-size: 0.95rem; }
            .timer-box { font-size: 0.95rem; padding: 4px 10px; }

            .cbt-main { flex-direction: column; overflow: hidden; }

            .cbt-left {
                flex: 1;
                width: 100%;
                border-right: none;
                border-bottom: none;
                overflow: hidden;
                display: flex;
                flex-direction: column;
                min-height: 0;
            }

            /* Question area scrolls; bottom padding makes room for fixed footer */
            .question-content {
                padding: 14px 16px;
                padding-bottom: 140px;
                font-size: 0.97rem;
                flex: 1;
                min-height: 0;
                overflow-y: auto;
                -webkit-overflow-scrolling: touch;
            }

            .options-container { margin-top: 14px; }
            .option-row { margin-bottom: 14px; align-items: flex-start; }
            .option-row input { margin-right: 12px; margin-top: 3px; transform: scale(1.4); flex-shrink: 0; }

            /* ✅ THE FIX: Footer is position:fixed — guaranteed visible on all phones */
            .cbt-footer {
                position: fixed !important;
                bottom: 0 !important;
                left: 0 !important;
                right: 0 !important;
                z-index: 100 !important;
                background: #f5f5f5 !important;
                border-top: 2px solid #ddd !important;
                padding: 10px 12px !important;
                display: flex !important;
                flex-direction: column !important;
                gap: 8px !important;
                box-shadow: 0 -3px 12px rgba(0,0,0,0.15) !important;
            }

            /* Row 1: Mark for Review + Clear Response + Palette toggle */
            .cbt-footer > div {
                display: flex !important;
                gap: 8px !important;
                flex-wrap: wrap !important;
                width: 100% !important;
            }

            /* Row 2: Save & Next — full width green bar */
            .btn-save {
                display: block !important;
                width: 100% !important;
                padding: 13px !important;
                font-size: 1rem !important;
                font-weight: 800 !important;
                float: none !important;
                border-radius: 6px !important;
                background: #2ecc71 !important;
                color: white !important;
                border: none !important;
                cursor: pointer !important;
                text-align: center !important;
            }

            .btn { padding: 9px 12px; font-size: 0.82rem; }

            /* Palette sidebar — slide-up drawer */
            .cbt-right {
                position: fixed;
                bottom: 0; left: 0; right: 0;
                height: 75vh;
                z-index: 160;
                border-radius: 20px 20px 0 0;
                box-shadow: 0 -4px 24px rgba(0,0,0,0.25);
                transform: translateY(100%);
                transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
                overflow: hidden;
                min-width: unset;
            }
            .cbt-right.drawer-open { transform: translateY(0); }

            .cbt-right::before {
                content: '';
                display: block;
                width: 40px; height: 4px;
                background: #bbb;
                border-radius: 2px;
                margin: 10px auto 4px auto;
            }

            .palette-grid { grid-template-columns: repeat(5, 1fr); gap: 8px; }
            .grid-btn { font-size: 0.85rem; }
            .palette-legend { padding: 10px 14px; }
            .legend-item { width: 48%; font-size: 0.8rem; margin-bottom: 6px; }
            .palette-toggle-btn { display: flex; }
            .candidate-profile { padding: 10px; }
            .candidate-profile img { width: 48px; height: 48px; }
            .candidate-profile h3 { font-size: 0.9rem; margin-top: 6px; }
            .submit-test-btn { padding: 12px; font-size: 1rem; }
        }

        @media (max-width: 400px) {
            .cbt-header h1 { font-size: 0.82rem; }
            .timer-box { font-size: 0.82rem; }
            .question-content { font-size: 0.92rem; }
            .btn { padding: 8px 10px; font-size: 0.78rem; }
        }