/* ==========================================================================
   STRICT FULL BROWSER VIEWPORT ISOLATION
   ========================================================================== */
html.te-exam-html:not(.te-result-html),
body.te-test-page.te-exam-mode:not(.te-result-page) {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    
    overflow: hidden !important;
    background: #ffffff !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif !important;
    box-sizing: border-box !important;
    overscroll-behavior: none !important;
}

/* Suppress WordPress chrome */
body.te-test-page.te-exam-mode:not(.te-result-page) header:not(.te-header),
body.te-test-page.te-exam-mode:not(.te-result-page) footer:not(.te-controls),
body.te-test-page.te-exam-mode:not(.te-result-page) #masthead,
body.te-test-page.te-exam-mode:not(.te-result-page) #colophon,
body.te-test-page.te-exam-mode:not(.te-result-page) .site-header,
body.te-test-page.te-exam-mode:not(.te-result-page) .site-footer {
    display: none !important;
}

#te-app-root, .te-test-fullscreen-root {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
}

/* ==========================================================================
   GLOBAL RESET
   ========================================================================== */
#te-app-root .te-layout * {
    box-sizing: border-box;
}

/* ==========================================================================
   DESKTOP LAYOUT (Default)
   ========================================================================== */
#te-app-root .te-layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #ffffff;
    color: #333333;
}

/* HEADER */
#te-app-root .te-header {
    flex: 0 0 54px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 100;
}

#te-app-root .te-header-left {
    display: flex;
    align-items: center;
    gap: 12px;

        display: none !important;
    }

#te-app-root .te-logo-icon {
    width: 24px;
    height: 24px;
    background: #4caf50;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    display: inline-block;
}

#te-app-root .te-header-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #00acc1;
    margin: 0;
    padding: 0;
    line-height: 1;
}

#te-app-root .te-timer-wrap {
    display: flex;
    align-items: center;
    background: #444444;
    color: #ffffff;
    border-radius: 4px;
    overflow: hidden;
}

#te-app-root .te-timer-label {
    background: #f5f5f5;
    color: #333333;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

#te-app-root .te-timer-value {
    padding: 6px 12px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 1px;
}

#te-app-root .te-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

#te-app-root .te-btn {
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    outline: none;
    transition: background-color 0.2s;
    line-height: 1.4;
}

#te-app-root .te-btn-outline {
    background: transparent;
    border: 1px solid #00acc1;
    color: #00acc1;
}
#te-app-root .te-btn-outline:hover {
    background: #e0f7fa;
}

#te-app-root .te-btn-primary {
    background: #4caf50;
    color: #ffffff;
}
#te-app-root .te-btn-primary:hover {
    background: #0097a7;
}

#te-app-root .te-btn-secondary {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}
#te-app-root .te-btn-secondary:hover {
    background: #bbdefb;
}

/* SUBHEADER (SECTIONS) */
#te-app-root .te-subheader {
    flex: 0 0 40px;
    background: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 20px;
}

#te-app-root .te-subheader-label {
    font-size: 0.8rem;
    color: #666666;
    margin-right: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

#te-app-root .te-subheader-divider {
    color: #cccccc;
    margin-right: 16px;
}

#te-app-root .te-subheader-tab {
    background: #10667a;
    color: #ffffff;
    font-size: 0.9rem;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    border-radius: 4px 4px 0 0;
    font-weight: 600;
}

/* WORKSPACE */
#te-app-root .te-workspace {
    flex: 1 1 0;
    display: flex;
    width: 100%;
    min-height: 0;
    overflow: hidden;
}

#te-app-root .te-main {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border-right: 1px solid #e0e0e0;
    background: #ffffff;
}

/* QUESTION TOPBAR */
#te-app-root .te-q-topbar {
    flex: 0 0 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #fdfdfd;
}

#te-app-root .te-q-topbar-left {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1rem;
    color: #333333;
}

#te-app-root .te-q-topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 0.85rem;
}

#te-app-root .te-marks-wrap, #te-app-root .te-time-wrap, #te-app-root .te-lang-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

#te-app-root .te-marks-label, #te-app-root .te-time-label, #te-app-root .te-lang-label {
    color: #666666;
}

#te-app-root .te-marks-pos {
    background: #4caf50;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
}

#te-app-root .te-marks-neg, #te-app-root .te-marks-warning {
    background: #f44336;
    color: #ffffff;
    padding: 2px 6px;
    border-radius: 12px;
    font-weight: 600;
}

#te-app-root .te-marks-warning {
    background: #ff9800;
}

#te-app-root .te-info-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 1px solid #ffffff;
    border-radius: 50%;
    text-align: center;
    line-height: 12px;
    font-size: 10px;
}

#te-app-root .te-time-val {
    font-weight: 600;
}

#te-app-root .te-lang-select {
    padding: 2px 4px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

#te-app-root .te-report-btn {
    background: transparent;
    border: none;
    color: #666666;
    cursor: pointer;
    font-size: 0.85rem;
}

/* QUESTION CONTENT */
#te-app-root .te-question-container {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px;
    background: #ffffff;
}

#te-app-root .te-q-text {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 24px;
    word-break: break-word;
    overflow-wrap: break-word;
}
#te-app-root .te-q-text img {
    max-width: 100%;
    height: auto;
}

#te-app-root .te-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

#te-app-root .te-option-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
}

#te-app-root .te-opt-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #999999;
    border-radius: 50%;
    margin-right: 16px;
    flex-shrink: 0;
    position: relative;
}

#te-app-root .te-option-label input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

#te-app-root .te-option-label.te-selected {
    background: #e8f5e9;
    border-radius: 4px;
    padding-left: 12px;
    margin-left: -12px;
}
#te-app-root .te-option-label.te-selected .te-opt-radio {
    border-color: #4caf50;
}

#te-app-root .te-option-label.te-selected .te-opt-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #4caf50;
    border-radius: 50%;
}

#te-app-root .te-opt-text {
    font-size: 1.05rem;
    color: #333333;
}

/* BOTTOM ACTION BAR */
#te-app-root .te-controls {
        flex: 0 0 auto !important;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 12px !important;
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-height: auto !important;
    }

#te-app-root .te-controls-left, #te-app-root .te-controls-right {
        display: flex !important;
        flex: 1.2 1 auto !important;
        min-width: 0 !important;
        gap: 6px !important;
    }

/* SIDEBAR PALETTE */
#te-app-root .te-sidebar {
    flex: 0 0 240px;
    display: flex;
    flex-direction: column;
    background: #e8f4f8;
}

#te-app-root .te-sidebar-header {
    background: #ffffff;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

#te-app-root .te-candidate-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #e1f5fe;
    padding: 8px 12px;
    border-radius: 4px;
    margin-bottom: 12px;
}

#te-app-root .te-candidate-avatar {
    background: #0288d1;
    color: #ffffff;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 0.8rem;
}

#te-app-root .te-candidate-name {
    font-weight: 600;
    font-size: 0.9rem;
}

#te-app-root .te-pal-legend {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.8rem;
}

#te-app-root .te-legend-row {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}

#te-app-root .te-legend-item {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #444444;
}

#te-app-root .te-legend-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: bold;
}

#te-app-root .te-pal-answered {
    background: #4caf50;
    border-radius: 50% 50% 50% 0; /* Example shape */
}
#te-app-root .te-pal-not-answered {
    background: #f44336;
    border-radius: 50% 50% 50% 0;
}
#te-app-root .te-pal-unvisited {
    background: #ffffff;
    color: #333333;
    border: 1px solid #cccccc;
    border-radius: 2px;
}
#te-app-root .te-pal-review {
    background: #9c27b0;
    border-radius: 50%;
}
#te-app-root .te-pal-review-answered {
    background: #9c27b0;
    border-radius: 50%;
    position: relative;
}
#te-app-root .te-pal-review-answered::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 6px;
    height: 6px;
    background: #4caf50;
    border-radius: 50%;
}

#te-app-root .te-palette-section-header {
    background: #b3e5fc;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #01579b;
}

#te-app-root .te-palette-scroll {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
}

#te-app-root .te-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

#te-app-root .te-pal-item {
    width: 36px;
    height: 36px;
    border: none;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

#te-app-root .te-pal-active {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

#te-app-root .te-sidebar-footer {
    padding: 16px;
    background: #e8f4f8;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#te-app-root .te-sidebar-footer-buttons {
    display: flex;
    gap: 8px;
}
#te-app-root .te-sidebar-footer-buttons .te-btn {
    flex: 1;
    padding: 8px;
    font-size: 0.85rem;
}

#te-app-root .te-submit-btn {
    width: 100%;
    padding: 12px;
}



/* ==========================================================================
   MOBILE RESPONSIVENESS
   ========================================================================== */

/* DISPLAY HELPERS */

#te-app-root .te-desktop-only { display: block !important; }
#te-app-root div.te-header-left.te-desktop-only { display: flex !important; }
#te-app-root span.te-desktop-only { display: inline !important; }



/* ==========================================================================
   5. BUTTON STYLES
   ========================================================================== */
.te-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-sizing: border-box;
    user-select: none;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
}

.te-btn:disabled,
.te-btn-disabled {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

.te-btn-primary {
    background: #16a34a;
    color: #ffffff;
    border-color: #16a34a;
}
.te-btn-primary:hover {
    background: #15803d;
    border-color: #15803d;
}

.te-btn-outline {
    background: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
}

.te-btn-outline:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

.te-btn-secondary {
    background: #f8fafc;
    color: #334155;
    border: 1px solid #cbd5e1;
}
.te-btn-secondary:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.te-btn-warning {
    background: #7c3aed;
    color: #ffffff;
    border-color: #7c3aed;
}
.te-btn-warning:hover {
    background: #6d28d9;
    border-color: #6d28d9;
}

.te-btn-danger {
    background: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}

.te-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.te-btn-outline-warning {
    background: #ffffff;
    color: #b45309;
    border: 1px solid #fcd34d;
    font-size: 0.82rem;
    padding: 8px 12px;
}

.te-btn-outline-warning:hover {
    background: #fffbeb;
}

.te-btn-lg {
    padding: 12px 28px;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 8px;
}


/* ==========================================================================
   7. MODALS (Instructions & Question Paper)
   ========================================================================== */
.te-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.te-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
}

.te-modal-dialog {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 680px;
    width: 90%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    z-index: 1001;
    overflow: hidden;
}

.te-modal-dialog.te-modal-lg {
    max-width: 900px;
}

.te-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.te-modal-header h3 {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.te-modal-close {
    background: transparent;
    border: none;
    font-size: 1.6rem;
    color: #64748b;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.te-modal-close:hover {
    color: #0f172a;
}

.te-modal-body {
    padding: 24px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #334155;
}

.te-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    justify-content: flex-end;
}

.te-qpaper-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.te-qp-item {
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #ffffff;
}

.te-qp-item-head {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #0f172a;
}

.te-qp-marks {
    font-size: 0.8rem;
    color: #64748b;
}

.te-qp-item-text {
    font-size: 1rem;
    color: #1e293b;
    margin-bottom: 12px;
}

.te-qp-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 12px;
}

.te-qp-opt {
    font-size: 0.9rem;
    color: #475569;
}


/* ==========================================================================
   8. START SCREEN & INSTRUCTIONS (Screen 1 General & Screen 2 Exam Instructions)
   ========================================================================== */
.te-start-wrapper {
    width: 100%;
    height: auto;
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    background: #f1f5f9;
    padding: 32px 16px;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
}

.te-start-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    max-width: 920px;
    width: 100%;
    padding: 36px;
    border: 1px solid #e2e8f0;
    box-sizing: border-box;
    margin-bottom: 30px;
}

.te-start-header {
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 18px;
    margin-bottom: 24px;
}

.te-start-badge {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.te-start-card h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
    line-height: 1.3;
}

.te-start-card h3.te-screen-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.te-instructions-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #334155;
}

.te-instr-section {
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}

.te-instr-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.te-instr-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 10px 0;
}

.te-instr-list {
    margin: 0 0 12px 0;
    padding-left: 20px;
}

.te-instr-list li {
    margin-bottom: 8px;
    color: #475569;
}

.te-legend-demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
    margin: 14px 0 18px 0;
}

.te-legend-demo-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.te-legend-demo-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
    color: #ffffff;
}

.te-demo-unvisited {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

.te-demo-not-answered {
    background: #dc2626;
    color: #ffffff;
}

.te-demo-answered {
    background: #16a34a;
    color: #ffffff;
}

.te-demo-review {
    background: #9333ea;
    color: #ffffff;
}

.te-demo-ans-review {
    background: #9333ea;
    color: #ffffff;
    position: relative;
}

.te-demo-ans-review::after {
    content: '';
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: #16a34a;
    border-radius: 50%;
    border: 1px solid #ffffff;
}

.te-legend-demo-desc {
    font-size: 0.85rem;
    line-height: 1.4;
    color: #334155;
}

.te-legend-demo-desc strong {
    color: #0f172a;
    display: block;
    margin-bottom: 2px;
}

.te-exam-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.te-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
}

.te-stat-box-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 4px;
}

.te-stat-box-val {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
}

.te-declaration-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 16px;
    margin: 24px 0 20px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    cursor: pointer;
}

.te-declaration-box input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
    accent-color: #2563eb;
}

.te-declaration-box label {
    font-size: 0.92rem;
    color: #78350f;
    line-height: 1.55;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.te-start-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 28px;
    gap: 12px;
}

.te-start-actions.te-two-actions {
    justify-content: space-between;
}


/* ==========================================================================
   9. ALERTS, LOADERS, & SPINNERS
   ========================================================================== */
.te-alert {
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
}

.te-alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.te-alert-warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.te-alert-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.te-loading-box,
.te-init-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 60vh;
    text-align: center;
    color: #475569;
    padding: 24px;
}

.te-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: te-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes te-spin {
    to { transform: rotate(360deg); }
}


/* ==========================================================================
   10. RESULTS & TEST SERIES PUBLIC COMPONENTS (Normal Mode & Result Page)
   ========================================================================== */
html.te-result-html,
body.te-result-page,
body:has(.te-result-card),
body:has(.te-result-wrap) {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 100vh !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    /* overflow visible removed */
    background: #f8fafc !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
}

body.te-result-page #page,
body.te-result-page .site,
body.te-result-page .site-content,
body.te-result-page .content-area,
body.te-result-page .entry-content,
body.te-result-page .ast-container,
body.te-result-page #primary,
body.te-result-page #main,
.te-result-page-wrap,
.te-result-wrap-container {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}

.te-public-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    box-sizing: border-box;
}

.te-result-wrap,
.te-result-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.te-answer-review-section {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box;
}

.te-review-q-card {
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.te-review-q-card:hover {
    border-color: #cbd5e1;
}

.te-series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.te-series-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, box-shadow 0.2s;
}

.te-series-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
}

.te-test-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.te-test-list-table th,
.te-test-list-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
}

.te-test-list-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #334155;
}


@media (max-width: 900px) {


    
    


    /* Start Screen Mobile */
    .te-start-wrapper {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 100vh !important;
        max-height: none !important;
        overflow-y: auto !important;
        padding: 16px 12px !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: center !important;
        box-sizing: border-box !important;
    }
    .te-start-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 22px 16px !important;
        margin: 10px auto !important;
        height: auto !important;
        max-height: none !important;
        box-sizing: border-box !important;
    }
    .te-start-card h2 {
        font-size: 1.25rem !important;
    }
    /* Modals on Mobile */
    .te-modal-dialog {
        width: 94% !important;
        max-width: 94% !important;
        max-height: 88vh !important;
        margin: 20px auto !important;
    }
}

/* ==========================================================================
   PHASE 2 - MOBILE EXAM UI REBUILD
   ========================================================================== */
@media (max-width: 900px) {
    /* 1. VIEWPORT & SHELL ISOLATION */
    html.te-exam-html,
    html.te-exam-html body.te-test-page.te-exam-mode:not(.te-result-page) {
        width: 100% !important;
        height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important; 
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: #f8fafc !important;
    }

    #te-app-root .te-layout {
        height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    /* Hide desktop chrome elements */
    #te-app-root .te-candidate-pill,
    #te-app-root #te-fullscreen-btn,
    #te-app-root .te-subheader,
    #te-app-root .te-sidebar {
        display: none !important;
    }

    /* 2. TOP EXAM HEADER */
    #te-app-root .te-header {
        background: #1e293b !important;
        color: #ffffff !important;
        height: 56px !important;
        min-height: 56px !important;
        padding: 0 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
        flex: 0 0 auto !important;
        border-bottom: none !important;
    }

    #te-app-root .te-header-left {
        flex: 1 !important;
        min-width: 0 !important;
        margin-right: 12px !important;
    
        display: none !important;
    }

    #te-app-root .te-header-title {
        color: #ffffff !important;
        font-size: 1rem !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        margin: 0 !important;
    }


    #te-app-root .te-mobile-header-actions {
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
        justify-content: flex-end !important;
        width: 100% !important;
    }
    #te-app-root .te-mobile-header-actions #te-submit-test-btn {
        display: inline-block !important;
        margin-bottom: 0 !important;
        height: auto !important;
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    /* Timer Pill */
    #te-app-root .te-header-right {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex: 0 0 auto !important;
    }

    #te-app-root .te-timer-wrap {
        display: flex !important;
        align-items: center !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    #te-app-root .te-timer-icon {
        display: none !important;
    }
    
    #te-app-root .te-timer {
        background: #0f172a !important; 
        color: #38bdf8 !important;     
        border: 1px solid #334155 !important;
        border-radius: 6px !important;
        padding: 5px 8px !important;
        font-size: 0.8rem !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    #te-app-root .te-timer::before {
        content: "Time Left: " !important;
        color: #94a3b8 !important;
        font-weight: 400 !important;
        margin-right: 4px !important;
    }

    /* Submit Button */
    #te-app-root #te-submit-test-btn {
        background: #ef4444 !important; 
        color: #ffffff !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
        border: none !important;
        padding: 7px 12px !important;
        font-size: 0.85rem !important;
    }

    /* 3. WORKSPACE SHELL */
    #te-app-root .te-workspace {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        padding: 0 !important;
        background: #ffffff !important;
    }
    #te-app-root .te-main-area {
        flex: 1 1 auto !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        width: 100% !important;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    /* 4. QUESTION HEADER */
    #te-app-root .te-q-topbar {
        flex: 0 0 auto !important;
        padding: 0 16px !important;
        height: 54px !important;
        min-height: 54px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        background: #fdfdfd !important;
        border-bottom: 1px solid #e2e8f0 !important;
        border-radius: 0 !important;
    }
    
    #te-app-root .te-q-topbar-left {
        color: #1e293b !important;
        font-size: 1rem !important;
        font-weight: 600 !important;
        display: flex !important;
        align-items: center !important;
    }
    
    /* Modify "Question" text to "Question No. " */
    #te-app-root .te-q-num-label {
        font-weight: 600 !important;
    }
    #te-app-root .te-q-num-label::after {
        content: " No. " !important;
    }

    /* Marks Pills */
    #te-app-root .te-marks-warning, 
    #te-app-root .te-marks-label {
        display: none !important;
    }
    #te-app-root .te-q-marks-box {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    #te-app-root .te-marks-pos {
        background: #dcfce7 !important;
        color: #166534 !important;
        border-radius: 4px !important;
        padding: 4px 8px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }
    #te-app-root .te-marks-neg {
        background: #fee2e2 !important;
        color: #991b1b !important;
        border-radius: 4px !important;
        padding: 4px 8px !important;
        font-size: 0.85rem !important;
        font-weight: 600 !important;
    }

    /* 5. QUESTION SCROLLABLE CONTENT */
    #te-app-root .te-question-container {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 20px 16px 24px 16px !important;
        background: #ffffff !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    #te-app-root .te-q-card {
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        background: transparent !important;
        min-width: 0 !important;
    }
    
    #te-app-root .te-q-text {
        font-size: 1.1rem !important;
        color: #0f172a !important;
        margin-bottom: 24px !important;
        line-height: 1.6 !important;
        word-wrap: break-word !important;
    }
    
    /* Ensure math and tables do not break layout */
    #te-app-root .te-q-text img,
    #te-app-root .te-q-text table,
    #te-app-root .te-q-text .MathJax,
    #te-app-root .te-q-text .katex-display {
        max-width: 100% !important;
        height: auto !important;
    }

    /* 6. OPTIONS */
    #te-app-root .te-options {
        counter-reset: opt-counter !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    #te-app-root .te-option-label {
        background: #ffffff !important;
        border: 1.5px solid #cbd5e1 !important;
        border-radius: 12px !important;
        padding: 16px !important;
        margin-bottom: 0 !important;
        display: flex !important;
        align-items: flex-start !important;
        gap: 16px !important;
        transition: all 0.2s ease !important;
    }
    
    #te-app-root .te-option-label.te-selected {
        border-color: #2563eb !important;
        background: #eff6ff !important;
    }
    
    /* Hide desktop radio */
    #te-app-root .te-option-label input[type="radio"] {
        display: none !important;
    }
    
    /* Mobile option letter circle (A, B, C, D) */
    #te-app-root .te-opt-radio {
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        border: 1px solid #94a3b8 !important;
        background: #f8fafc !important;
        color: #475569 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-weight: 700 !important;
        font-size: 0.95rem !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        position: relative !important;
    }
    
    #te-app-root .te-opt-radio::before {
        counter-increment: opt-counter !important;
        content: counter(opt-counter, upper-alpha) !important;
    }
    
    #te-app-root .te-option-label.te-selected .te-opt-radio {
        background: #2563eb !important;
        border-color: #2563eb !important;
        color: #ffffff !important;
    }
    
    #te-app-root .te-option-label.te-selected .te-opt-radio::after {
        display: none !important; /* Hide the active dot from desktop */
    }
    
    #te-app-root .te-opt-text {
        font-size: 1rem !important;
        line-height: 1.5 !important;
        color: #334155 !important;
        flex: 1 !important;
    }

    #te-app-root .te-option-label.te-selected .te-opt-text {
        color: #0f172a !important;
        font-weight: 500 !important;
    }

    /* 7. BOTTOM NAVIGATION */
    #te-app-root .te-controls {
        flex: 0 0 auto !important;
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 12px !important;
        background: #ffffff !important;
        border-top: 1px solid #e2e8f0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: nowrap !important;
        gap: 8px !important;
        min-height: auto !important;
    }
    
    #te-app-root .te-controls-left {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }
    #te-app-root .te-controls-right {
        display: flex !important;
        flex: 1.2 1 auto !important;
        min-width: 0 !important;
        gap: 6px !important;
    }

    #te-app-root #te-clear-btn {
        display: none !important; /* Hide clear response as per reference */
    }

    #te-app-root #te-review-btn {
        background: #fef9c3 !important;
        color: #a16207 !important;
        border: 1px solid #fef08a !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        padding: 10px 8px !important;
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
        width: 100% !important;
        text-align: center !important;
        height: 100% !important;
        white-space: normal !important;
    }
    
    #te-app-root #te-prev-btn {
        background: #ffffff !important;
        color: #334155 !important;
        border: 1px solid #cbd5e1 !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        padding: 10px 10px !important;
        font-size: 0.8rem !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    #te-app-root #te-next-btn {
        background: #2563eb !important;
        color: #ffffff !important;
        font-weight: 600 !important;
        border-radius: 8px !important;
        border: none !important;
        padding: 10px 10px !important;
        font-size: 0.8rem !important;
        flex: 1.5 !important;
        min-width: 0 !important;
    }
}

