@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Vibrant Solid Colors */
    --primary: #293681;       /* Dark Navy Blue */
    --primary-hover: #1e285d;
    --secondary: #10b981;     /* Emerald Green */
    --accent: #f59e0b;        /* Amber */
    --danger: #ef4444;        /* Rose Red */
    
    /* Backgrounds */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --sidebar-bg: #ffffff;
    
    /* Text */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-light: #94a3b8;
    
    /* Borders & Shadows */
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Keep scientific notation left-to-right inside the Arabic interface.
 * KaTeX must retain its bundled fonts because overriding child glyph fonts
 * breaks the alignment of charges, exponents, fractions and reaction arrows. */
.iep-exam-container .math-tex .katex {
    direction: ltr;
    unicode-bidi: isolate;
}

.iep-exam-container .math-tex .katex-display {
    direction: ltr;
    overflow-x: auto;
    overflow-y: hidden;
    padding-block: 2px;
}

/* Teacher profile: free samples selector. */
.iep-free-samples-profile {
    padding: 20px;
    border: 1px solid #bfdbfe;
    border-radius: 18px;
    background: linear-gradient(145deg, #eff6ff 0%, #ffffff 70%);
    box-shadow: 0 10px 28px rgba(37, 99, 235, .08);
}

.iep-free-samples-profile__heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.iep-free-samples-profile__eyebrow {
    display: inline-block;
    margin-bottom: 5px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}

.iep-free-samples-profile h4 {
    margin: 0 0 5px;
    color: #172554;
    font-size: 19px;
}

.iep-free-samples-profile__heading p {
    margin: 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.7;
}

.iep-free-samples-profile__count {
    flex: 0 0 auto;
    padding: 7px 11px;
    color: #1d4ed8;
    background: #dbeafe;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.iep-free-samples-profile .iep-free-samples-tabs {
    display: flex !important;
    flex-flow: row nowrap !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    gap: 4px !important;
    width: min(100%, 340px) !important;
    height: 50px !important;
    min-height: 50px !important;
    max-height: 50px !important;
    padding: 5px !important;
    margin: 0 auto 18px !important;
    overflow: hidden !important;
    direction: rtl !important;
    background: #123f5f !important;
    border: 1px solid rgba(255, 255, 255, .09) !important;
    border-radius: 14px !important;
    box-shadow: 0 5px 14px rgba(15, 62, 91, .13) !important;
    box-sizing: border-box !important;
}

.iep-free-samples-profile .iep-free-samples-tabs > button {
    position: static !important;
    inset: auto !important;
    float: none !important;
    display: inline-flex !important;
    flex: 1 1 0 !important;
    width: 50% !important;
    min-width: 0 !important;
    max-width: 50% !important;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    margin: 0 !important;
    color: #f8fafc !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    font-family: inherit !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-align: center !important;
    white-space: nowrap !important;
    transform: none !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    box-sizing: border-box !important;
    transition: background-color .18s ease, box-shadow .18s ease, transform .18s ease !important;
}

.iep-free-samples-profile .iep-free-samples-tabs > button:hover { background: rgba(255, 255, 255, .08) !important; }
.iep-free-samples-profile .iep-free-samples-tabs > button:focus-visible { outline: 3px solid rgba(96, 165, 250, .42) !important; outline-offset: -1px !important; }
.iep-free-samples-profile .iep-free-samples-tabs > button.is-active {
    color: #fff !important;
    background: #3f82f4 !important;
    box-shadow: 0 4px 10px rgba(18, 62, 95, .42) !important;
}
.iep-free-samples-profile .iep-free-samples-tabs > button.is-active:active { transform: translateY(1px) !important; }
.iep-free-samples-profile .iep-free-samples-tab__icon { display: inline !important; flex: 0 0 auto !important; font-size: 12px !important; line-height: 1 !important; }
.iep-free-samples-profile .iep-free-samples-tab__full { display: inline !important; }
.iep-free-samples-profile .iep-free-samples-tab__short { display: none !important; }

.iep-free-samples-panel { display: none; }
.iep-free-samples-panel[hidden] { display: none !important; }
.iep-free-samples-panel.is-active:not([hidden]) { display: block; }

.iep-free-samples-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.iep-free-samples-fields label {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.iep-free-samples-fields select {
    width: 100%;
    min-height: 42px;
    margin-top: 6px;
    padding: 8px 10px;
    color: #0f172a;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font: inherit;
}

.iep-free-samples-fields select:disabled { opacity: .55; }

.iep-free-samples-panel__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.iep-free-samples-panel__footer span {
    color: #64748b;
    font-size: 12px;
}

.iep-free-samples-claim {
    padding: 10px 15px;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
}

.iep-free-samples-claim:disabled { opacity: .45; cursor: not-allowed; }
.iep-free-samples-profile__status { min-height: 20px; margin: 12px 0 0; font-size: 12px; font-weight: 800; }
.iep-free-samples-profile__status.is-loading { color: #1d4ed8; }
.iep-free-samples-profile__status.is-success { color: #047857; }
.iep-free-samples-profile__status.is-error { color: #b91c1c; }

@media (max-width: 640px) {
    .iep-free-samples-profile { padding: 16px; }
    .iep-free-samples-profile__heading,
    .iep-free-samples-panel__footer { align-items: stretch; flex-direction: column; }
    .iep-free-samples-profile__count { align-self: flex-start; }
    .iep-free-samples-fields { grid-template-columns: 1fr; }
    .iep-free-samples-claim { width: 100%; }
    .iep-free-samples-profile .iep-free-samples-tabs { width: min(100%, 250px) !important; }
    .iep-free-samples-profile .iep-free-samples-tabs > button { padding-inline: 7px !important; font-size: 12px !important; }
    .iep-free-samples-profile .iep-free-samples-tab__full { display: none !important; }
    .iep-free-samples-profile .iep-free-samples-tab__short { display: inline !important; }
}

/* Base Styles */
body {
    background-color: var(--bg-color);
}

/* Plugin pages use their own complete navigation and page shell. */
body.iep-frontend-page-active > header,
body.iep-frontend-page-active #masthead,
body.iep-frontend-page-active #header,
body.iep-frontend-page-active .site-header,
body.iep-frontend-page-active .main-header,
body.iep-frontend-page-active .main-header-bar,
body.iep-frontend-page-active .elementor-location-header,
body.iep-frontend-page-active .header-area,
body.iep-frontend-page-active .mobile-header,
body.iep-frontend-page-active .mobile_header,
body.iep-frontend-page-active .header_mobile,
body.iep-frontend-page-active .stm_header,
body.iep-frontend-page-active .stm-header,
body.iep-frontend-page-active .stm_header_wrapper,
body.iep-frontend-page-active .stm_lms_header,
body.iep-frontend-page-active .stm_lms_header_wrapper,
body.iep-frontend-page-active .masterstudy-header,
body.iep-frontend-page-active .masterstudy-header-mobile,
body.iep-frontend-page-active .iep-external-site-header {
    display: none !important;
}

body.iep-frontend-page-active #content,
body.iep-frontend-page-active .site-content,
body.iep-frontend-page-active .main-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* The real student exam must use the same clean, full-page shell as the
 * teacher's student-mode preview. Theme and page-builder wrappers are reset
 * only on the dedicated exam page; dashboards and normal site pages keep
 * their own layout. */
body.iep-student-exam-page-active {
    min-height: 100vh !important;
    margin: 0 !important;
    background: #31587f !important;
}

body.iep-student-exam-page-active > footer,
body.iep-student-exam-page-active #colophon,
body.iep-student-exam-page-active .site-footer,
body.iep-student-exam-page-active .main-footer,
body.iep-student-exam-page-active .elementor-location-footer,
body.iep-student-exam-page-active #secondary,
body.iep-student-exam-page-active .widget-area,
body.iep-student-exam-page-active .entry-header,
body.iep-student-exam-page-active .page-header {
    display: none !important;
}

body.iep-student-exam-page-active #page,
body.iep-student-exam-page-active .site,
body.iep-student-exam-page-active #content,
body.iep-student-exam-page-active .site-content,
body.iep-student-exam-page-active .main-content,
body.iep-student-exam-page-active #primary,
body.iep-student-exam-page-active .content-area,
body.iep-student-exam-page-active .site-main,
body.iep-student-exam-page-active article.page,
body.iep-student-exam-page-active .entry-content,
body.iep-student-exam-page-active .wp-block-post-content,
body.iep-student-exam-page-active .elementor,
body.iep-student-exam-page-active .elementor-section-wrap,
body.iep-student-exam-page-active .elementor-section,
body.iep-student-exam-page-active .elementor-container,
body.iep-student-exam-page-active .elementor-column,
body.iep-student-exam-page-active .elementor-widget-wrap,
body.iep-student-exam-page-active .elementor-widget,
body.iep-student-exam-page-active .elementor-widget-container {
    float: none !important;
    width: 100% !important;
    max-width: none !important;
    min-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

body.iep-student-exam-page-active .iep-student-exam-v2 {
    width: min(100% - 24px, 980px) !important;
    max-width: 980px !important;
    margin: 24px auto !important;
}

@media (max-width: 760px) {
    body.iep-student-exam-page-active .iep-student-exam-v2 {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }
}

.iep-dashboard-container, .iep-exam-container {
    font-family: 'Tajawal', sans-serif !important;
    direction: rtl;
    color: var(--text-main);
    box-sizing: border-box;
    line-height: 1.6;
}
.iep-dashboard-container *, .iep-exam-container * {
    font-family: 'Tajawal', sans-serif !important;
}

/* ---------------- TEACHER DASHBOARD ---------------- */
.iep-dashboard-container {
    padding: 40px;
    background-color: #427AB5; /* Steel Blue Background */
    background-size: 20px 20px;
    min-height: calc(100vh - 40px);
    border-radius: 32px;
    margin: 20px auto;
    max-width: 1400px;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.15);
    border: 4px solid rgba(255, 255, 255, 0.3);
}

.iep-dashboard-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    text-align: center;
    gap: 15px;
}

.iep-dashboard-header h2 {
    font-size: 36px !important;
    font-weight: 900 !important;
    color: var(--text-main) !important;
    margin: 0 0 5px 0 !important;
    letter-spacing: -0.5px;
}

.iep-dashboard-header p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

.iep-teacher-avatar-shell {
    position: relative;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    width: 88px;
    height: 88px;
    padding: 4px;
    border-radius: 50%;
    background: linear-gradient(145deg, #ffffff, #dbeafe);
    box-shadow: 0 10px 24px rgba(41, 54, 129, 0.2), 0 0 0 1px rgba(41, 54, 129, 0.1);
    box-sizing: border-box;
}

.iep-teacher-avatar-shell::after {
    content: '';
    position: absolute;
    inset: 1px;
    border: 2px solid rgba(255, 255, 255, 0.82);
    border-radius: inherit;
    pointer-events: none;
}

.iep-teacher-avatar-image {
    display: block;
    width: 80px;
    height: 80px;
    border: 0;
    border-radius: 50%;
    object-fit: cover;
}

.iep-teacher-profile-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--card-bg);
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.iep-teacher-profile-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.iep-dashboard-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: stretch;
}

/* Sidebar (Now Horizontal Header) */
.iep-sidebar {
    width: 100%;
    background: var(--sidebar-bg);
    padding: 16px 24px;
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    margin-bottom: 30px;
}

.iep-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
    overflow-x: auto;
}
.iep-sidebar ul::-webkit-scrollbar {
    height: 4px;
}
.iep-sidebar ul::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.iep-sidebar ul li {
    flex-shrink: 0;
}

.iep-sidebar ul li a,
.iep-sidebar ul li button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
    font-family: inherit;
    white-space: nowrap;
}

.iep-sidebar ul li a svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.iep-sidebar .iep-nav-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin: 0;
    fill: currentColor;
}

.iep-sidebar .iep-nav-icon-emoji {
    display: inline-grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
}

.iep-nav-label,
.iep-subnav-label {
    white-space: nowrap;
}

.iep-exam-subnav-icon {
    flex: 0 0 auto;
    font-size: 20px;
    line-height: 1;
}

.iep-sidebar ul li a:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.iep-sidebar ul li a:hover svg {
    transform: scale(1.1);
}

.iep-sidebar ul li a.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 10px 15px -3px rgba(41, 54, 129, 0.3);
}

.iep-sidebar ul li a.iep-home-return-link {
    color: #0f766e;
    background: linear-gradient(145deg, #f0fdfa, #ecfeff);
    border: 1px solid #99f6e4 !important;
    box-shadow: 0 5px 13px rgba(13, 148, 136, 0.12);
}

.iep-sidebar ul li a.iep-home-return-link:hover {
    color: #ffffff;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    box-shadow: 0 9px 18px rgba(13, 148, 136, 0.24);
}

.iep-table-modern .iep-selection-cell {
    width: 46px;
    min-width: 46px;
    padding-inline: 10px;
    text-align: center !important;
}

.iep-table-modern [data-iep-select-all],
.iep-table-modern [data-iep-row-select] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--primary);
    cursor: pointer;
    vertical-align: middle;
}

.iep-table-modern [data-iep-select-all]:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.iep-table-modern tbody tr {
    transition: background-color 0.18s ease, box-shadow 0.18s ease;
}

.iep-table-modern tbody tr.is-selected > td {
    background: #eff6ff;
}

.iep-table-modern tbody tr.is-selected > td:first-child {
    box-shadow: inset -3px 0 0 #2563eb;
}

.iep-selection-summary {
    width: fit-content;
    margin: 0 0 10px;
    padding: 7px 13px;
    color: #1e3a8a;
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
}

.iep-selection-summary[hidden] {
    display: none !important;
}

.iep-selection-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    flex-wrap: wrap;
}

.iep-selection-toolbar[hidden] {
    display: none !important;
}

.iep-selection-toolbar .iep-selection-summary {
    margin: 0;
}

.iep-selection-actions {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.iep-selection-actions select {
    min-width: 175px;
    height: 38px;
    padding: 7px 11px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
}

.iep-selection-actions select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.iep-selection-actions button {
    height: 38px;
    padding: 7px 15px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 7px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.iep-selection-actions button:hover {
    color: #1d4ed8;
    border-color: #93c5fd;
    background: #eff6ff;
}

.iep-selection-actions button:disabled {
    cursor: wait;
    opacity: 0.68;
}

@media (max-width: 620px) {
    .iep-selection-toolbar,
    .iep-selection-actions {
        width: 100%;
    }

    .iep-selection-actions select {
        flex: 1 1 auto;
        min-width: 0;
    }

    .iep-selection-summary {
        margin-inline: auto !important;
    }
}

@media (max-width: 768px) {
    .iep-sidebar ul {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    .iep-sidebar ul li {
        flex: 0 0 auto;
    }
}

@media (max-width: 620px) {
    .iep-dashboard-container .iep-sidebar {
        padding: 10px;
        margin-bottom: 20px;
    }

    .iep-dashboard-container .iep-sidebar ul {
        justify-content: center;
        gap: 8px;
        padding-bottom: 0;
        overflow: visible;
    }

    .iep-dashboard-container .iep-sidebar ul li {
        flex: 1 1 0;
        min-width: 0;
    }

    .iep-dashboard-container .iep-sidebar .iep-tab-link {
        width: 100%;
        min-width: 48px;
        min-height: 48px;
        padding: 10px;
        gap: 0;
        box-sizing: border-box;
    }

    .iep-dashboard-container .iep-nav-label,
    .iep-dashboard-container .iep-subnav-label {
        display: none;
    }

    .iep-dashboard-container .iep-exam-subnav {
        flex-wrap: nowrap;
        gap: 8px;
        padding: 8px;
    }

    .iep-dashboard-container .iep-exam-subnav button,
    .iep-dashboard-container .iep-exam-subnav a {
        flex: 1 1 0;
        min-width: 0;
        min-height: 46px;
        padding: 10px;
        gap: 0;
    }
}

/* Main Area */
.iep-main-area {
    flex: 1;
    min-width: 0;
    container-type: inline-size;
    container-name: iep-main;
}

/* Dashboard isolation: one primary panel and one exam panel at a time. */
.iep-dashboard-container .iep-tab-content {
    display: none !important;
}

.iep-dashboard-container .iep-tab-content.active {
    display: block !important;
}

.iep-dashboard-container .iep-exam-sub-content {
    display: none !important;
}

.iep-dashboard-container .iep-exam-sub-content.is-active {
    display: block !important;
}

.iep-section-title {
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    margin: 0 auto 10px auto;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    padding: 12px 35px;
    border-radius: 16px;
    display: block;
    width: fit-content;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-align: center;
}
.iep-section-desc {
    color: #f1f5f9; /* Light color for dark background */
    font-size: 17px;
    margin: 0 auto 30px auto;
    text-align: center;
    font-weight: 600;
}

/* Stats Cards */
.iep-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.iep-stats-grid.iep-overview-stats {
    grid-template-columns: repeat(3, minmax(0, 220px));
    justify-content: center;
    align-items: stretch;
    gap: 20px;
    width: 100%;
    margin: 0 auto 40px;
}

.iep-overview-stats .iep-stat-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    justify-content: center;
    text-align: center;
}

@media (max-width: 760px) {
    .iep-stats-grid.iep-overview-stats {
        grid-template-columns: minmax(0, 320px);
    }
}

.iep-stat-card {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.iep-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.iep-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.2);
}
.iep-stat-icon svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
}

.bg-blue { background-color: var(--primary); color: #fff; }
.bg-blue h4 { color: #e0e7ff; }
.bg-blue span { color: #ffffff; }

.iep-stat-content h4 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 700;
}
.iep-stat-content span {
    font-size: 32px;
    font-weight: 900;
    display: block;
    line-height: 1;
}

/* Table */
.iep-table-wrapper {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

.iep-dashboard-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin: 16px 0 6px;
}

.iep-dashboard-pagination > span {
    color: #64748b;
    margin-left: 6px;
}

.iep-dashboard-pagination a,
.iep-dashboard-pagination strong {
    display: inline-flex;
    min-width: 36px;
    min-height: 36px;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #1e3a8a;
    text-decoration: none;
    box-sizing: border-box;
}

.iep-dashboard-pagination strong {
    border-color: #2563eb;
    background: #2563eb;
    color: #fff;
}

.iep-table-modern {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.iep-table-modern th {
    color: var(--text-muted);
    font-weight: 700;
    padding: 16px;
    text-align: right;
    border-bottom: 2px solid var(--border-light);
    font-size: 14px;
}

.iep-table-modern td {
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}
.iep-table-modern tr:last-child td {
    border-bottom: none;
}

.iep-table-modern tr {
    transition: background-color 0.2s ease;
}
.iep-table-modern tr:hover {
    background-color: #f8fafc;
}

/* Keep the exam controls contained even inside narrow page-builder columns. */
#iep-exams-section .iep-exams-toolbar,
#iep-exams-section .iep-exams-bulk-actions,
#iep-exams-section .iep-exams-filters {
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

#iep-exams-section .iep-exams-toolbar,
#iep-exams-section .iep-exams-filters {
    flex-wrap: wrap !important;
}

@container iep-main (max-width: 700px) {
    #iep-exams-section .iep-exams-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 9px !important;
    }

    #iep-exams-section .iep-exams-bulk-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        gap: 7px !important;
    }

    #iep-exams-section .iep-exams-filters {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 7px !important;
    }

    #iep-exams-section #iep-exam-search {
        grid-column: 1 / -1;
    }

    #iep-exams-section .iep-exams-bulk-actions select,
    #iep-exams-section .iep-exams-filters select,
    #iep-exams-section #iep-exam-search,
    #iep-exams-section .iep-exams-bulk-actions button {
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    #iep-exams-section .iep-exams-bulk-actions button {
        width: auto;
        min-width: 58px !important;
    }
}

/* Compact, contained layout for phones and portrait tablets. */
@media (max-width: 900px) {
    .iep-dashboard-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin: 0 auto;
        padding: 16px 10px;
        overflow: hidden;
        border-width: 2px;
        border-radius: 20px;
        box-sizing: border-box;
    }

    .iep-dashboard-content,
    .iep-main-area,
    .iep-dashboard-container .iep-tab-content,
    .iep-dashboard-container .iep-exam-sub-content,
    #iep-exams-section {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .iep-dashboard-header {
        margin-bottom: 22px;
    }

    .iep-dashboard-header > div {
        gap: 12px !important;
        padding: 14px !important;
        border-radius: 16px !important;
    }

    .iep-teacher-avatar-shell {
        width: 66px;
        height: 66px;
    }

    .iep-teacher-avatar-image {
        width: 58px;
        height: 58px;
    }

    .iep-dashboard-header p {
        font-size: 13px !important;
        line-height: 1.5;
    }

    .iep-dashboard-header p:first-child {
        font-size: 17px !important;
    }

    #iep-exams-section .iep-section-title {
        padding: 8px 22px;
        border-radius: 13px;
        font-size: 19px;
        line-height: 1.35;
    }

    #iep-exams-section .iep-section-desc {
        max-width: 100%;
        margin-bottom: 18px;
        padding-inline: 5px;
        font-size: 14px;
        line-height: 1.65;
    }

    #iep-exams-section .iep-exams-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 9px !important;
        margin-bottom: 11px !important;
    }

    #iep-exams-section .iep-exams-bulk-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
        width: 100%;
        min-width: 0;
        gap: 7px !important;
    }

    #iep-exams-section .iep-exams-filters {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        gap: 7px !important;
    }

    #iep-exams-section .iep-exams-bulk-actions select,
    #iep-exams-section .iep-exams-filters select,
    #iep-exams-section #iep-exam-search,
    #iep-exams-section .iep-exams-bulk-actions button {
        width: 100%;
        max-width: 100%;
        min-width: 0 !important;
        height: 36px;
        padding: 6px 8px !important;
        border-radius: 7px !important;
        font-size: 11px !important;
        line-height: 1.2;
        box-sizing: border-box;
    }

    #iep-exams-section .iep-exams-bulk-actions button {
        width: auto;
        min-width: 58px !important;
    }

    #iep-exams-section #iep-exam-search {
        grid-column: 1 / -1;
        font-size: 12px !important;
    }

    #iep-exams-section .iep-selection-summary {
        padding: 6px 11px;
        font-size: 11px;
    }

    #iep-exams-section .iep-table-wrapper {
        width: 100%;
        max-width: 100%;
        padding: 5px;
        overflow-x: auto;
        border-radius: 14px;
        box-sizing: border-box;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
    }

    #iep-exams-table {
        min-width: 680px;
    }

    #iep-exams-table th {
        padding: 9px 7px;
        font-size: 11px;
        white-space: nowrap;
    }

    #iep-exams-table td {
        padding: 10px 7px;
        font-size: 11px;
    }

    #iep-exams-table .iep-badge {
        margin: 2px;
        padding: 3px 6px;
        font-size: 9px;
    }

    #iep-exams-table .iep-student-share-box {
        min-width: 190px;
    }
}

@media (max-width: 380px) {
    #iep-exams-section .iep-exams-filters {
        gap: 5px !important;
    }

    #iep-exams-section .iep-exams-filters select {
        padding-inline: 4px !important;
        font-size: 10px !important;
    }
}

.iep-student-share-box {
    display: grid;
    gap: 7px;
    min-width: 260px;
}

.iep-student-share-box > span {
    color: #475569;
    font-size: 12px;
    font-weight: 700;
}

.iep-student-share-box > div {
    display: flex;
    gap: 5px;
}

.iep-student-share-box input {
    min-width: 0;
    flex: 1;
    width: 180px;
    padding: 7px 8px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    direction: ltr;
    font-size: 11px;
}

.iep-student-share-box > div button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    color: #fff;
    background: #0d9488;
    border: 0;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.iep-student-share-box .iep-inline-game-code {
    display: inline-block;
    width: auto;
    min-height: 0;
    margin-right: 4px;
    padding: 2px 7px;
    color: #0f172a;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    user-select: all;
}

#iep-games-table .iep-game-name-cell {
    min-width: 200px;
}

.iep-game-name-cell {
    vertical-align: middle;
}

#iep-exams-table .iep-exam-title,
#iep-games-table .iep-exam-title {
    overflow: visible;
    font-size: 15px;
    line-height: 1.6;
    text-overflow: clip;
    white-space: normal;
}

@media (max-width: 900px) {
    #iep-exams-table .iep-exam-title,
    #iep-games-table .iep-exam-title {
        margin-bottom: 4px;
        font-size: 13px;
        line-height: 1.55;
    }
}

.iep-game-name-cell .iep-game-kind,
.iep-game-name-cell small {
    display: block;
    margin-top: 6px;
}

.iep-game-name-cell .iep-game-kind {
    color: #0f766e;
    font-size: 12px;
    font-weight: 700;
}

.iep-game-name-cell small {
    color: #94a3b8;
    font-size: 11px;
}

#iep-games-table .iep-game-meta {
    min-width: 190px;
}

.iep-teacher-decision-wrap {
    display: inline-block;
    position: relative;
}

.iep-teacher-status-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 108px;
    padding: 7px 10px;
    color: var(--iep-status-color, #475569);
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

.iep-teacher-status-button:hover,
.iep-teacher-status-button[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .14);
}

.iep-teacher-decision-menu {
    position: fixed;
    z-index: 1000000;
    display: grid;
    min-width: 190px;
    padding: 5px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.24);
}

.iep-teacher-decision-menu[hidden] {
    display: none !important;
}

.iep-teacher-decision-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    color: var(--iep-decision-color, #334155);
    background: #fff;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    border-radius: 7px;
    font: inherit;
    font-size: 13px;
    text-align: right;
    cursor: pointer;
}

.iep-teacher-decision-menu button span {
    margin-right: auto;
}

.iep-teacher-decision-menu button:hover,
.iep-teacher-decision-menu button.is-current {
    background: #f8fafc;
    font-weight: 800;
}

.iep-teacher-decision-menu button.iep-decision-delete {
    color: #dc2626;
    background: #fff7f7;
    border-bottom: 0;
}

.iep-teacher-decision-menu button:disabled {
    opacity: .55;
    cursor: wait;
}

.iep-game-status-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    width: 128px;
    min-width: 128px;
    max-width: 128px;
    margin: 0 auto;
}

#iep-games-table .iep-game-status-actions > .iep-teacher-decision-wrap,
#iep-games-table .iep-game-status-actions > .iep-game-preview-button,
#iep-games-table .iep-game-status-actions > .iep-game-settings-button,
#iep-games-table .iep-game-status-actions .iep-teacher-status-button {
    display: flex !important;
    width: 128px !important;
    min-width: 128px !important;
    max-width: 128px !important;
    height: 36px !important;
    min-height: 36px !important;
    margin: 0 !important;
    padding: 0 10px !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
}

#iep-games-table .iep-game-status-actions > .iep-teacher-decision-wrap {
    padding: 0 !important;
}

#iep-games-table .iep-game-status-actions .iep-teacher-status-button.iep-status-publish {
    color: #15803d !important;
    background: #f0fdf4 !important;
    border-color: #86efac !important;
}

#iep-games-table .iep-game-status-actions .iep-teacher-status-button.iep-status-active {
    color: #1d4ed8 !important;
    background: #eff6ff !important;
    border-color: #93c5fd !important;
}

#iep-games-table .iep-game-status-actions .iep-teacher-status-button.iep-status-review {
    color: #92400e !important;
    background: #fffbeb !important;
    border-color: #fcd34d !important;
}

#iep-games-table .iep-game-status-actions .iep-teacher-status-button.iep-status-draft {
    color: #6d28d9 !important;
    background: #f5f3ff !important;
    border-color: #c4b5fd !important;
}

#iep-games-table .iep-game-status-actions .iep-teacher-status-button.iep-status-archive {
    color: #475569 !important;
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

.iep-game-preview-button,
.iep-game-settings-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 7px 10px;
    border-radius: 7px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.iep-game-preview-button {
    color: #fff !important;
    background: #0ea5e9 !important;
    border: 1px solid #0284c7 !important;
}

.iep-game-settings-button {
    color: #fff !important;
    background: #4f46e5 !important;
    border: 1px solid #4338ca !important;
}

.iep-game-settings-modal {
    position: fixed;
    inset: 0;
    z-index: 1000010;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .75);
    backdrop-filter: blur(6px);
    direction: rtl;
}

.iep-game-settings-dialog {
    display: flex;
    flex-direction: column;
    width: min(95vw, 620px);
    max-height: 90vh;
    overflow: hidden;
    color: #1e293b;
    background: #f8fafc;
    border-radius: 22px;
    box-shadow: 0 25px 55px rgba(15, 23, 42, .42);
}

.iep-game-settings-dialog > header,
.iep-game-settings-dialog > footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.iep-game-settings-dialog > header h3 {
    margin: 0;
    font-size: 20px;
}

.iep-game-settings-dialog > header button {
    width: 36px;
    height: 36px;
    color: #64748b;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    font-size: 23px;
    cursor: pointer;
}

.iep-game-settings-body {
    display: grid;
    gap: 22px;
    padding: 28px 24px;
    overflow-y: auto;
}

.iep-game-settings-body fieldset {
    display: grid;
    gap: 16px;
    margin: 0;
    padding: 22px 18px 18px;
    background: #fff;
    border: 2px solid #3b82f6;
    border-radius: 15px;
}

.iep-game-settings-body fieldset + fieldset {
    border-color: #2563eb;
}

.iep-game-settings-body legend {
    padding: 0 12px;
    color: #2563eb;
    background: #fff;
    font-weight: 900;
}

.iep-game-settings-body label {
    display: grid;
    gap: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
}

.iep-game-settings-body input[type="datetime-local"],
.iep-game-settings-body textarea {
    width: 100%;
    padding: 11px 12px;
    color: #1e293b;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    box-sizing: border-box;
    font: inherit;
}

.iep-game-settings-body .iep-game-settings-check {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
}

.iep-game-settings-body .iep-game-settings-check input {
    width: 18px;
    height: 18px;
}

.iep-game-settings-body fieldset.iep-game-link-card {
    display: block;
    padding: 20px 16px 16px;
    background: #faf5ff;
    border: 1px solid #c4b5fd;
    border-radius: 12px;
}

.iep-game-settings-body .iep-game-link-card legend {
    color: #7c3aed;
    background: #faf5ff;
}

.iep-game-link-state {
    display: block;
    margin: 0 0 12px;
    color: #6d28d9;
    font-size: 14px;
    font-weight: 900;
}

.iep-game-link-state[data-status="active"] {
    color: #6d28d9;
}

.iep-game-link-state[data-status="scheduled"] {
    color: #1d4ed8;
}

.iep-game-link-state[data-status="expired"],
.iep-game-link-state[data-status="invalid"] {
    color: #b91c1c;
}

.iep-game-link-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.iep-game-settings-body #iep-current-game-link {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 10px 12px;
    color: #475569;
    background: #fff;
    border: 1px solid #ddd6fe;
    border-radius: 8px;
    box-sizing: border-box;
    font: inherit;
    text-align: left;
}

.iep-game-settings-body .iep-game-link-button {
    min-height: 42px;
    padding: 10px 15px;
    color: #fff !important;
    background: #7c3aed !important;
    border: 0 !important;
    border-radius: 9px !important;
    box-shadow: none !important;
    box-sizing: border-box;
    font: inherit;
    font-weight: 900;
    line-height: 1.35;
    white-space: nowrap;
    cursor: pointer;
}

.iep-game-settings-body .iep-game-link-button:hover,
.iep-game-settings-body .iep-game-link-button:focus-visible {
    background: #6d28d9 !important;
}

.iep-game-settings-body .iep-game-link-button:focus-visible,
.iep-game-settings-body #iep-current-game-link:focus-visible {
    outline: 3px solid rgba(124, 58, 237, .2);
    outline-offset: 2px;
}

.iep-game-settings-body .iep-game-link-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.iep-game-link-copy {
    flex: 0 0 auto;
}

.iep-game-settings-body .iep-game-link-issue {
    display: block;
    width: max-content;
    max-width: 100%;
    margin-top: 10px;
}

.iep-game-link-card .iep-settings-help {
    margin: 12px 0 0;
    line-height: 1.6;
    text-align: center;
}

@media (max-width: 420px) {
    .iep-game-link-row {
        flex-direction: column;
    }

    .iep-game-settings-body .iep-game-link-copy,
    .iep-game-settings-body .iep-game-link-issue {
        width: 100%;
    }
}

#iep-game-settings-message {
    min-height: 20px;
    margin: 0;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 800;
}

.iep-game-settings-dialog > footer {
    justify-content: flex-start;
    border-top: 1px solid #e2e8f0;
    border-bottom: 0;
}

.iep-game-settings-dialog > footer button {
    padding: 11px 20px;
    color: #fff;
    background: #4f46e5;
    border: 1px solid #4338ca;
    border-radius: 9px;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.iep-game-settings-dialog > footer button.iep-game-settings-cancel {
    color: #475569;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.iep-game-settings-dialog > footer button:disabled {
    opacity: .6;
    cursor: wait;
}

.iep-results-filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.iep-results-actions {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(220px, 0.7fr) auto auto;
    gap: 14px;
    align-items: center;
    margin: 0 0 18px;
    padding: 14px 16px;
    color: #0f172a;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.09);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.iep-results-actions [hidden] {
    display: none !important;
}

.iep-results-actions.is-disabled {
    opacity: 1;
    filter: none;
    background: #eff6ff;
    border-color: #cbd5e1;
    border-style: dashed;
}

.iep-results-actions.is-disabled .iep-results-selected-exam strong {
    color: #334155;
}

.iep-results-actions.is-disabled .iep-results-selected-exam small {
    color: #64748b;
}

.iep-results-actions.is-disabled {
    grid-template-columns: 1fr;
}

.iep-results-actions.is-disabled .iep-results-selected-exam {
    justify-content: center;
    padding: 4px 0;
}

.iep-results-actions.is-disabled .iep-results-sort-label,
.iep-results-actions.is-disabled .iep-print-results-button {
    display: none;
}

.iep-results-sort-label select:disabled {
    color: #64748b;
    background: #f8fafc;
    border-color: #cbd5e1;
    opacity: 1;
}

.iep-results-selected-exam {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.iep-results-selected-icon {
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    font-size: 21px;
}

.iep-results-selected-exam strong,
.iep-results-selected-exam small {
    display: block;
}

.iep-results-selected-exam strong {
    margin-bottom: 3px;
    overflow: hidden;
    color: #1e3a8a;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iep-results-selected-exam small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.5;
}

.iep-results-sort-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #334155;
    font-size: 11px;
    font-weight: 800;
}

.iep-results-sort-label select {
    width: 100%;
    min-height: 42px;
    padding: 8px 11px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    font-family: inherit;
    font-weight: 700;
}

.iep-print-results-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 44px;
    padding: 10px 16px;
    color: #fff;
    background: linear-gradient(135deg, #dc2626, #ef4444);
    border: 0;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.22);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 900;
}

.iep-print-student-results-button {
    background: linear-gradient(135deg, #0369a1, #0ea5e9);
    box-shadow: 0 6px 16px rgba(2, 132, 199, 0.22);
}

.iep-advanced-settings-card {
    position: relative;
    padding: 36px 24px 24px;
    color: #1e293b;
    background: #fff;
    border: 2px solid var(--iep-section-color, #2563eb);
    border-radius: 16px;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--iep-section-color, #2563eb) 12%, transparent);
}

.iep-advanced-settings-card > h4 {
    position: absolute;
    top: 0;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 0 18px;
    color: var(--iep-section-color, #2563eb);
    background: #fff;
    border-radius: 999px;
    font-size: 17px;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.iep-advanced-settings-card > h4 span {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: #fff;
    background: var(--iep-section-color, #2563eb);
    border-radius: 50%;
}

.iep-advanced-settings-grid,
.iep-question-quota-grid,
.iep-advanced-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.iep-question-quota-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.iep-anti-cheat-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px 18px;
    background: #fff7f7;
    border: 1px solid #fecaca;
    border-radius: 12px;
}
.iep-anti-cheat-options label { display: flex; flex-direction: column; gap: 7px; color: #7f1d1d; font-size: 13px; font-weight: 800; }
.iep-anti-cheat-options input,
.iep-anti-cheat-options select { width: 100%; padding: 11px 13px; color: #1e293b; background: #fff; border: 1px solid #fca5a5; border-radius: 9px; font: inherit; box-sizing: border-box; }
.iep-anti-cheat-options label.iep-setting-disabled { opacity: .52; cursor: not-allowed; }
.iep-anti-cheat-options label.iep-setting-disabled input,
.iep-anti-cheat-options label.iep-setting-disabled select { cursor: not-allowed; }
.iep-link-days-picker {
    grid-column: 1 / -1;
    padding: 16px 18px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
}
.iep-game-link-days-picker { margin: 2px 0 4px; }
.iep-link-days-picker > label { display: block; margin-bottom: 9px; color: #1e40af; font-size: 14px; font-weight: 800; }
.iep-link-days-controls { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 8px; align-items: stretch; width: min(100%, 360px); }
.iep-link-days-controls > br { display: none !important; }
.iep-link-days-controls input { width: 100%; min-width: 0; padding: 10px 12px; color: #1e293b; background: #fff; border: 1px solid #93c5fd; border-radius: 9px; box-sizing: border-box; font: inherit; text-align: center; }
.iep-link-days-controls button { min-height: 42px; padding: 0; color: #fff; background: #2563eb; border: 0; border-radius: 9px; cursor: pointer; font-family: inherit; font-size: 22px; font-weight: 900; line-height: 1; }
.iep-link-days-controls button:hover { background: #1d4ed8; }
.iep-link-days-controls button:focus-visible,
.iep-link-days-controls input:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 2px; }
.iep-link-days-preview { margin: 10px 0 0; color: #1e40af; font-size: 13px; font-weight: 800; line-height: 1.8; }
.iep-link-days-preview.is-error { color: #b91c1c; }
.iep-advanced-settings-card label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 800; }
.iep-advanced-settings-card input:not([type="checkbox"]),
.iep-advanced-settings-card select,
.iep-advanced-settings-card textarea { width: 100%; padding: 11px 13px; color: #1e293b; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 9px; font: inherit; box-sizing: border-box; }
.iep-advanced-settings-card textarea { margin-bottom: 14px; resize: vertical; }
.iep-advanced-settings-card .iep-advanced-check { flex-direction: row; align-items: center; margin-top: 13px; padding: 11px 13px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 9px; cursor: pointer; }
.iep-advanced-settings-card label.iep-setting-disabled { opacity: .52; cursor: not-allowed; }
.iep-advanced-settings-card label.iep-setting-disabled input,
.iep-advanced-settings-card label.iep-setting-disabled select { cursor: not-allowed; }
.iep-advanced-check input { width: 19px; height: 19px; accent-color: var(--iep-section-color, #2563eb); }
.iep-settings-help { margin: 14px 0 10px; color: #64748b; font-size: 12px; font-weight: 700; }
.iep-settings-secondary-button { padding: 10px 15px; color: #fff; background: var(--iep-section-color, #2563eb); border: 0; border-radius: 9px; cursor: pointer; font-family: inherit; font-weight: 800; }
.iep-development-placeholder { display: grid; place-items: center; gap: 9px; min-height: 110px; padding: 20px; color: #5b21b6; background: linear-gradient(135deg, #faf5ff, #f5f3ff); border: 1px dashed #a78bfa; border-radius: 12px; text-align: center; box-sizing: border-box; }
.iep-development-placeholder span { display: inline-flex; align-items: center; min-height: 34px; padding: 0 16px; color: #fff; background: #7c3aed; border-radius: 999px; font-size: 15px; font-weight: 900; }
.iep-development-placeholder p { margin: 0; color: #6d28d9; font-size: 13px; font-weight: 700; line-height: 1.8; }
.iep-student-exception-row { display: grid; grid-template-columns: 1.2fr .7fr .7fr 1fr auto; gap: 8px; align-items: end; margin-bottom: 10px; padding: 12px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; }
.iep-student-exception-row button { min-height: 40px; color: #b91c1c; background: #fee2e2; border: 0; border-radius: 8px; cursor: pointer; font-weight: 900; }
.iep-readiness-result { margin-top: 12px; padding: 12px; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 9px; font-size: 13px; line-height: 1.8; }
.iep-readiness-result.is-ready { color: #166534; background: #f0fdf4; border-color: #86efac; }
.iep-readiness-result.has-issues { color: #991b1b; background: #fef2f2; border-color: #fca5a5; }
.iep-exam-inline-instructions { margin: 14px 0; padding: 12px 16px; color: #334155; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 12px; }
.iep-exam-inline-instructions summary { color: var(--primary, #2563eb); cursor: pointer; font-weight: 900; }
.iep-exam-inline-instructions div { margin-top: 10px; line-height: 1.9; }

@media (max-width: 620px) {
    .iep-advanced-settings-grid,
    .iep-anti-cheat-options,
    .iep-question-quota-grid,
    .iep-advanced-check-grid,
    .iep-student-exception-row { grid-template-columns: 1fr; }
    .iep-link-days-controls { grid-template-columns: 42px minmax(0, 1fr) 42px; width: 100%; }
    .iep-advanced-settings-card > h4 { font-size: 14px; }
}

.iep-print-results-button:disabled {
    box-shadow: none;
    cursor: not-allowed;
    color: #64748b;
    background: #e2e8f0;
    opacity: 1;
}

.iep-result-rank-badge:not(:empty) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    font-size: 19px;
    vertical-align: middle;
}

.iep-result-row.iep-rank-1 { background: linear-gradient(90deg, rgba(254, 249, 195, 0.82), rgba(255, 255, 255, 0)); }
.iep-result-row.iep-rank-2 { background: linear-gradient(90deg, rgba(241, 245, 249, 0.9), rgba(255, 255, 255, 0)); }
.iep-result-row.iep-rank-3 { background: linear-gradient(90deg, rgba(255, 237, 213, 0.82), rgba(255, 255, 255, 0)); }

@media (max-width: 900px) {
    .iep-results-actions {
        grid-template-columns: 1fr 1fr;
    }

    .iep-results-selected-exam {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .iep-results-actions {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .iep-results-selected-exam {
        grid-column: auto;
    }

    .iep-print-results-button {
        width: 100%;
    }
}

.iep-exam-title {
    display: block;
    color: var(--text-main);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
}

.iep-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    margin-left: 6px;
}
.bg-grade { background-color: #e0e7ff; color: #3730a3; }
.bg-term { background-color: #fef3c7; color: #92400e; }
.bg-unit { background-color: #dcfce7; color: #166534; }

.iep-date-cell {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    direction: ltr;
    text-align: center;
    unicode-bidi: embed;
}

.iep-result-score {
    display: inline-block;
    direction: ltr;
    unicode-bidi: embed;
}

.iep-shortcode-box input {
    width: 100%;
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-muted);
    font-family: monospace;
    font-size: 13px;
    background: #f8fafc;
    transition: all 0.2s;
    cursor: pointer;
}
.iep-shortcode-box input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    color: var(--text-main);
}

/* ---------------- STUDENT EXAM VIEW ---------------- */
.iep-exam-container {
    background: var(--card-bg);
    padding: 40px;
    max-width: 900px;
    margin: 40px auto;
    border-radius: 24px;
    box-shadow: var(--shadow-float);
    border: 1px solid var(--border-light);
}

.iep-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 30px;
}

.iep-exam-header h2 {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-main);
    margin: 0;
}

.iep-timer {
    background: var(--danger);
    color: #fff;
    padding: 10px 24px;
    border-radius: 12px;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.39);
}

.iep-empty-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 18px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed var(--border);
}

/* Question Cards */
.iep-question-card {
    background: #f8fafc;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}
.iep-question-card:hover {
    box-shadow: var(--shadow-md);
    border-color: #cbd5e1;
    background: #ffffff;
}

.iep-question-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.iep-question-number {
    background: var(--primary);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(37,99,235,0.2);
}

.iep-question-text {
    font-size: 22px;
    color: var(--text-main);
    margin: 0;
    font-weight: 800;
    line-height: 1.6;
    padding-top: 2px;
}

.iep-question-image {
    margin-bottom: 20px;
    text-align: center;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.iep-question-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Form Inputs */
.iep-text-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    color: var(--text-main);
    transition: all 0.2s;
    background: #ffffff;
}
.iep-text-input:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Choices */
.iep-choice-label {
    display: flex;
    align-items: flex-start;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
    background: #ffffff;
}
.iep-choice-label:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.iep-choice-label input[type="radio"] {
    display: none;
}

.iep-choice-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #cbd5e1;
    border-radius: 50%;
    margin-left: 15px;
    margin-top: 2px;
    display: inline-block;
    position: relative;
    transition: all 0.2s;
    flex-shrink: 0;
}

.iep-choice-label input[type="radio"]:checked + .iep-choice-custom {
    border-color: var(--primary);
    background: var(--primary);
}
.iep-choice-label input[type="radio"]:checked + .iep-choice-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
}

.iep-choice-label input[type="radio"]:checked ~ .iep-choice-text {
    color: var(--primary);
    font-weight: 800;
}

.iep-choice-text {
    font-size: 18px;
    color: var(--text-main);
    font-weight: 700;
}

/* Matching Grid */
.iep-matching-grid {
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
}
.iep-matching-row {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
}
.iep-matching-row:last-child {
    border-bottom: none;
}
.iep-matching-row:nth-child(even) {
    background: #f8fafc;
}
.iep-match-left {
    flex: 1;
    font-weight: 800;
    color: var(--text-main);
    font-size: 18px;
}
.iep-match-right {
    flex: 1;
}
.iep-select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #cbd5e1;
    border-radius: 12px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s;
    background-color: #fff;
}
.iep-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Math-aware replacement for native select menus. Native option elements cannot
 * contain KaTeX markup, so the real select stays as the submitted form control
 * while these buttons provide the visible, fully rendered interface. */
.iep-math-select {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    font-family: inherit;
    font-size: 16px;
}
.iep-math-select-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.iep-math-select-button {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 9px 12px;
    color: var(--text-main) !important;
    background: #fff !important;
    border: 2px solid #cbd5e1 !important;
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    text-align: right;
    cursor: pointer;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.iep-math-select-button:hover,
.iep-math-select-button[aria-expanded="true"] {
    color: var(--text-main) !important;
    background: #fff !important;
    border-color: var(--exam-primary, var(--primary)) !important;
}
.iep-math-select-button:focus-visible {
    outline: none;
    border-color: var(--exam-primary, var(--primary)) !important;
    box-shadow: 0 0 0 4px rgba(49, 87, 213, .13);
}
.iep-math-select-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}
.iep-math-select-value {
    min-width: 0;
    overflow-wrap: anywhere;
}
.iep-math-select-chevron {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin: 0 3px;
    color: var(--exam-muted, #64748b);
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .18s ease;
}
.iep-math-select-button[aria-expanded="true"] .iep-math-select-chevron {
    transform: rotate(225deg);
}
.iep-math-select-menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 6px);
    z-index: 120;
    max-height: 260px;
    padding: 6px;
    overflow-y: auto;
    color: var(--text-main);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, .18);
}
.iep-math-select.opens-up .iep-math-select-menu {
    top: auto;
    bottom: calc(100% + 6px);
}
.iep-math-select-menu[hidden] {
    display: none !important;
}
.iep-math-select-option {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    padding: 11px 12px;
    color: var(--text-main) !important;
    background: transparent !important;
    border: 0;
    border-radius: 8px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.7;
    text-align: right;
    cursor: pointer;
}
.iep-math-select-option:hover,
.iep-math-select-option:focus-visible,
.iep-math-select-option.is-selected {
    color: var(--exam-primary-dark, #1d4ed8) !important;
    background: var(--exam-primary-soft, #eff6ff) !important;
    outline: none;
}
.iep-math-select--inline {
    display: inline-block;
    width: auto;
    min-width: 170px;
    max-width: 100%;
    margin: 4px 5px;
    vertical-align: middle;
}
.iep-math-select--inline .iep-math-select-button {
    min-height: 42px;
    padding: 5px 11px;
    color: var(--exam-primary-dark, var(--primary)) !important;
    background: var(--exam-primary-soft, #eff6ff) !important;
    border-color: var(--exam-primary, var(--primary)) !important;
    font-size: 16px;
    font-weight: 800;
}

/* Inline Select (Blanks) */
.iep-inline-select {
    padding: 6px 14px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 900;
    color: var(--primary);
    background: #eff6ff;
    margin: 0 6px;
    display: inline-block;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 18px;
}
.iep-inline-select:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}

/* Submit Button */
.iep-exam-footer {
    text-align: left;
    margin-top: 40px;
}

.iep-btn-primary {
    background: var(--primary);
    color: #fff;
    padding: 18px 40px;
    border: none;
    border-radius: 16px;
    font-size: 20px;
    font-weight: 900;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 12px;
}
.iep-btn-primary svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}
.iep-btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-3px);
    box-shadow: 0 15px 25px -3px rgba(37, 99, 235, 0.4);
}
.iep-btn-primary:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Card */
.iep-result-card {
    margin-top: 40px;
    background: #f0fdf4;
    border: 2px solid #86efac;
    border-radius: 24px;
    padding: 50px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.iep-result-header h3 {
    color: #166534;
    font-size: 32px;
    font-weight: 900;
    margin: 0 0 10px 0;
}
.iep-result-header p {
    color: #15803d;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px 0;
}
.iep-success-icon {
    width: 90px;
    height: 90px;
    fill: #22c55e;
    margin-bottom: 24px;
}
.iep-score-badge {
    display: inline-block;
    background: #16a34a;
    color: #fff;
    font-size: 56px;
    font-weight: 900;
    padding: 10px 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px -5px rgba(22, 163, 74, 0.4);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.iep-correct-answer {
    color: #059669;
    font-weight: 900;
    background: #d1fae5;
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 18px;
}
.iep-explanation-text {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    padding: 16px;
    border-radius: 12px;
    color: #334155;
    font-size: 16px;
    font-weight: 600;
}

/* ---------------- STUDENT EXAM V2 ---------------- */
.iep-student-exam-v2 {
    --exam-primary: #3157d5;
    --exam-primary-dark: #213d9b;
    --exam-primary-soft: #eef3ff;
    --exam-success: #078467;
    --exam-success-soft: #e8f8f2;
    --exam-warning: #b85c00;
    --exam-warning-soft: #fff5df;
    --exam-danger: #c7353b;
    --exam-danger-soft: #fff0f1;
    --exam-ink: #172033;
    --exam-muted: #667085;
    --exam-line: #dfe5ef;
    --exam-surface: #ffffff;
    --exam-page: #f3f6fb;
    position: relative;
    width: min(100% - 24px, 980px);
    max-width: 980px;
    margin: 24px auto;
    padding: 24px;
    overflow: visible;
    color: var(--exam-ink);
    background:
        radial-gradient(circle at 100% 0, rgba(49, 87, 213, 0.1), transparent 34%),
        var(--exam-page);
    border: 1px solid #e5eaf2;
    border-radius: 28px;
    box-shadow: 0 24px 65px rgba(23, 32, 51, 0.12);
}

.iep-student-exam-v2,
.iep-student-exam-v2 * {
    box-sizing: border-box;
}

.iep-student-exam-v2 [hidden] {
    display: none !important;
}

.iep-student-exam-v2 button,
.iep-student-exam-v2 input,
.iep-student-exam-v2 select,
.iep-student-exam-v2 textarea {
    font: inherit;
}

.iep-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.iep-student-watermark {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    pointer-events: none;
    opacity: 0.022;
}

.iep-student-watermark > div {
    margin: 40px;
    color: var(--exam-ink);
    font-size: 32px;
    font-weight: 900;
    white-space: nowrap;
    user-select: none;
    transform: rotate(-28deg);
}

.iep-exam-topbar {
    position: sticky;
    top: 12px;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 88px;
    padding: 14px 16px;
    margin-bottom: 18px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(215, 222, 235, 0.92);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(23, 32, 51, 0.1);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.iep-exam-identity,
.iep-exam-topbar-actions,
.iep-question-counter,
.iep-timer-container,
.iep-progress-labels,
.iep-question-type-row,
.iep-question-header,
.iep-exam-navigation,
.iep-review-heading,
.iep-review-actions {
    display: flex;
    align-items: center;
}

.iep-exam-identity {
    min-width: 0;
    gap: 12px;
}

.iep-exam-teacher-avatar {
    flex: 0 0 50px;
    width: 50px;
    height: 50px;
    overflow: hidden;
    background: #fff;
    border: 2px solid #dce4f5;
    border-radius: 50%;
}

.iep-exam-teacher-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border: 0 !important;
}

.iep-exam-institution-logo {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dce4f5;
    border-radius: 9px;
}

.iep-exam-institution-logo img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.iep-exam-identity-text {
    min-width: 0;
}

.iep-student-exam-v2 .iep-exam-eyebrow,
.iep-student-exam-v2 .iep-exam-title,
.iep-student-exam-v2 .iep-question-save-state,
.iep-student-exam-v2 .iep-result-eyebrow,
.iep-student-exam-v2 .iep-result-message {
    margin: 0;
}

.iep-exam-inline-instructions {
    margin: 18px 0;
    padding: 14px 18px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
}

.iep-exam-inline-instructions summary {
    cursor: pointer;
    font-weight: 800;
}

.iep-exam-inline-instructions > div {
    margin-top: 12px;
    line-height: 1.9;
    color: #334155;
}

.iep-exam-eyebrow {
    overflow: hidden;
    color: var(--exam-muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iep-student-exam-v2 .iep-exam-title {
    overflow: hidden;
    color: var(--exam-ink);
    font-size: clamp(18px, 2.4vw, 24px);
    font-weight: 900;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iep-exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.iep-exam-meta-chip {
    padding: 2px 8px;
    color: #4d5b73;
    background: #f1f4f9;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.iep-exam-topbar-actions {
    flex: 0 0 auto;
    gap: 9px;
}

.iep-question-counter {
    gap: 5px;
    min-height: 44px;
    padding: 8px 13px;
    color: #46526a;
    background: #f3f6fb;
    border: 1px solid var(--exam-line);
    border-radius: 13px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.iep-question-counter strong {
    color: var(--exam-primary-dark);
    font-size: 18px;
}

.iep-sound-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #526079;
    background: #fff;
    border: 1px solid var(--exam-line);
    border-radius: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.iep-fullscreen-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #526079;
    background: #fff;
    border: 1px solid var(--exam-line);
    border-radius: 13px;
    cursor: pointer;
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.iep-fullscreen-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.iep-fullscreen-toggle:hover,
.iep-fullscreen-toggle:focus-visible,
.iep-fullscreen-toggle[aria-pressed="true"] {
    color: var(--exam-primary);
    background: var(--exam-primary-soft);
    border-color: #aebeed;
}

.iep-sound-toggle:hover,
.iep-sound-toggle:focus-visible {
    color: var(--exam-primary);
    background: var(--exam-primary-soft);
    border-color: #aebeed;
}

.iep-timer-container {
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    min-height: 44px;
    padding: 8px 13px;
    color: #fff;
    background: var(--exam-success);
    border-radius: 13px;
    box-shadow: 0 8px 20px rgba(7, 132, 103, 0.18);
    font-variant-numeric: tabular-nums;
    font-size: 18px;
    font-weight: 900;
    direction: ltr;
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.iep-timer-container.warning {
    background: var(--exam-warning);
    box-shadow: 0 8px 20px rgba(184, 92, 0, 0.2);
}

.iep-timer-container.danger {
    background: var(--exam-danger);
    box-shadow: 0 8px 20px rgba(199, 53, 59, 0.22);
    animation: iepTimerPulse 1s ease-in-out infinite;
}

.iep-progress-section {
    margin: 0 4px 18px;
}

.iep-progress-labels {
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin-bottom: 7px;
    color: var(--exam-muted);
    font-size: 12px;
    font-weight: 800;
}

.iep-autosave-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-inline: auto;
    color: #047857;
    font-size: 11px;
    font-weight: 800;
}

.iep-autosave-indicator::before {
    content: '';
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13);
}

.iep-autosave-indicator.is-warning { color: #b45309; }
.iep-autosave-indicator.is-warning::before { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14); }
.iep-autosave-indicator.is-restored { color: #1d4ed8; }
.iep-autosave-indicator.is-restored::before { background: #3b82f6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14); }

.iep-progress-labels strong {
    color: var(--exam-primary-dark);
    font-variant-numeric: tabular-nums;
}

.iep-progress-labels .iep-remaining-count {
    padding: 3px 9px;
    color: #334155;
    background: rgba(255, 255, 255, .72);
    border: 1px solid #d8e0ec;
    border-radius: 999px;
}

.iep-released-result,
.iep-released-result-disclosure {
    direction: rtl;
    width: min(100% - 28px, 760px);
    margin: 24px auto;
    color: #1e293b;
    background: #fff;
    border: 1px solid #dbe4ef;
    border-top: 6px solid #2563eb;
    border-radius: 20px;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .12);
    box-sizing: border-box;
}

.iep-released-result { padding: 28px; text-align: center; }
.iep-released-result.is-passed { border-top-color: #10b981; }
.iep-released-result.is-not-passed { border-top-color: #f59e0b; }
.iep-released-result-kicker { color: #64748b; font-size: 13px; font-weight: 800; }
.iep-released-result h2 { margin: 8px 0 14px; color: #172554; font-size: 24px; }
.iep-released-result-score { display: flex; align-items: center; justify-content: center; gap: 12px; font-variant-numeric: tabular-nums; }
.iep-released-result-score strong,
.iep-released-result-score span { padding: 8px 14px; color: #1d4ed8; background: #eff6ff; border-radius: 999px; font-size: 18px; font-weight: 900; }
.iep-released-result-answers { display: grid; gap: 10px; margin-top: 22px; text-align: right; }
.iep-released-result-answers article { padding: 14px; background: #f8fafc; border: 1px solid #dbe4ef; border-radius: 12px; }
.iep-released-result-answers article.is-correct { border-inline-start: 5px solid #10b981; }
.iep-released-result-answers article.is-incorrect { border-inline-start: 5px solid #ef4444; }
.iep-released-result-answers article > div { display: flex; justify-content: space-between; gap: 12px; }
.iep-released-result-answers article > div span { color: #64748b; font-size: 12px; font-weight: 800; }
.iep-released-result-answers article p { margin: 10px 0; line-height: 1.8; }
.iep-released-result-answers article small { display: block; margin-top: 7px; line-height: 1.7; }
.iep-released-result-disclosure { padding: 0; overflow: hidden; }
.iep-released-result-disclosure > summary { padding: 15px 18px; color: #1d4ed8; cursor: pointer; font-weight: 900; }
.iep-released-result-disclosure > .iep-released-result { width: 100%; margin: 0; border: 0; border-top: 1px solid #dbe4ef; border-radius: 0; box-shadow: none; }

.iep-student-exam-v2 .iep-progress-wrapper {
    width: 100%;
    height: 9px;
    margin: 0;
    overflow: hidden;
    background: #dce3ef;
    border-radius: 999px;
    box-shadow: inset 0 1px 2px rgba(23, 32, 51, 0.08);
}

.iep-student-exam-v2 .iep-progress-fill {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--exam-primary), #7457d9);
    border-radius: inherit;
    transition: width 0.3s ease;
}

.iep-exam-notice {
    position: sticky;
    top: 112px;
    z-index: 85;
    padding: 12px 16px;
    margin: 0 0 16px;
    color: #344054;
    background: #fff;
    border: 1px solid var(--exam-line);
    border-inline-start: 4px solid var(--exam-primary);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(23, 32, 51, 0.08);
    font-size: 14px;
    font-weight: 800;
}

.iep-exam-notice.is-warning {
    color: #7c3f00;
    background: var(--exam-warning-soft);
    border-inline-start-color: var(--exam-warning);
}

.iep-exam-notice.is-error {
    color: #922b31;
    background: var(--exam-danger-soft);
    border-inline-start-color: var(--exam-danger);
}

.iep-question-map {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px 12px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

.iep-question-map-button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    color: #5a657a;
    background: #fff;
    border: 1px solid #cfd7e5;
    border-radius: 11px;
    scroll-snap-align: center;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.iep-question-map-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    line-height: 1;
    text-align: center;
}

.iep-question-map-button:hover {
    border-color: #98a8d9;
    transform: translateY(-1px);
}

.iep-question-map-button.is-answered {
    color: #05664f;
    background: var(--exam-success-soft);
    border-color: #76cbb5;
}

.iep-question-map-button.is-current {
    color: #fff;
    background: var(--exam-primary);
    border-color: var(--exam-primary);
    box-shadow: 0 5px 14px rgba(49, 87, 213, 0.25);
}

.iep-question-map-button.is-marked::after {
    position: absolute;
    top: -4px;
    inset-inline-start: -4px;
    width: 10px;
    height: 10px;
    content: '';
    background: #f59e0b;
    border: 2px solid #fff;
    border-radius: 50%;
}

.iep-question-map-button.is-expired:not(.is-current) {
    border-style: dashed;
}

.iep-question-stage {
    min-height: 410px;
}

.iep-student-exam-v2 .iep-question-card {
    scroll-margin-top: 128px;
    display: none;
    padding: clamp(22px, 4vw, 40px);
    margin: 0;
    color: var(--exam-ink);
    background: var(--exam-surface);
    border: 1px solid var(--exam-line);
    border-top: 5px solid var(--exam-primary);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(23, 32, 51, 0.09);
    opacity: 1;
    outline: none;
    animation: iepQuestionIn 0.3s ease both;
}

.iep-student-exam-v2 .iep-question-card.active-q {
    display: block;
}

.iep-student-exam-v2 .iep-question-card.has-open-math-select {
    position: relative;
    z-index: 90;
}

.iep-student-exam-v2 .iep-question-card:focus-visible {
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.16), 0 14px 36px rgba(23, 32, 51, 0.09);
}

.iep-question-card.is-expired {
    border-top-color: var(--exam-warning);
}

.iep-question-type-row {
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 18px;
}

.iep-question-type-badge,
.iep-question-score {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.iep-question-type-badge {
    color: var(--exam-primary-dark);
    background: var(--exam-primary-soft);
}

.iep-question-score {
    color: #536078;
    background: #f2f4f7;
}

.iep-student-exam-v2 .iep-question-header {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.iep-student-exam-v2 .iep-question-number {
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff;
    background: var(--exam-primary);
    border-radius: 13px;
    box-shadow: 0 7px 16px rgba(49, 87, 213, 0.22);
    font-size: 19px;
    font-weight: 900;
}

.iep-student-exam-v2 .iep-question-text {
    flex: 1;
    min-width: 0;
    padding: 3px 0 0;
    margin: 0;
    color: var(--iep-question-color, var(--exam-ink));
    font-size: clamp(20px, 3vw, 27px);
    font-weight: 800;
    line-height: 1.75;
}

.iep-student-exam-v2 .iep-question-image {
    position: relative;
    display: block;
    width: min(100%, 680px);
    padding: 0;
    margin: 0 auto 25px;
    overflow: hidden;
    background: #f6f8fb;
    border: 1px solid var(--exam-line);
    border-radius: 16px;
    cursor: zoom-in;
    box-shadow: 0 8px 22px rgba(23, 32, 51, 0.08);
}

.iep-student-exam-v2 .iep-question-image img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: contain;
}

.iep-image-zoom-hint {
    position: absolute;
    bottom: 10px;
    inset-inline-end: 10px;
    padding: 6px 10px;
    color: #fff;
    background: rgba(23, 32, 51, 0.78);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
}

.iep-student-exam-v2 .iep-choices {
    margin-top: 22px;
}

/* Elementor may run automatic paragraph formatting over shortcode output and
   insert <br> elements between controls. Those breaks become grid/flex items
   and create false rows and large empty spaces. Rich question/instruction text
   is intentionally excluded so author-supplied line breaks remain visible. */
.iep-student-exam-v2 button > br,
.iep-student-exam-v2 label > br,
.iep-student-exam-v2 .iep-exam-topbar-actions > br,
.iep-student-exam-v2 .iep-progress-labels > br,
.iep-student-exam-v2 .iep-question-map > br,
.iep-student-exam-v2 .iep-question-type-row > br,
.iep-student-exam-v2 .iep-choices > br,
.iep-student-exam-v2 .iep-matching-grid > br,
.iep-student-exam-v2 .iep-matching-row > br,
.iep-student-exam-v2 .iep-math-select > br,
.iep-student-exam-v2 .iep-math-select-menu > br,
.iep-student-exam-v2 .iep-exam-navigation > br,
.iep-student-exam-v2 .iep-review-actions > br,
.iep-student-exam-v2 .iep-score-container > br,
.iep-student-exam-v2 .iep-timer-container > br,
.iep-student-exam-v2 .iep-image-dialog > br {
    display: none !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    align-content: start !important;
    gap: 11px !important;
    width: 100% !important;
    min-width: 0 !important;
    container-type: inline-size;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="1"] {
    grid-template-columns: minmax(0, 1fr) !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice > .iep-choice-label {
    align-self: start !important;
    justify-self: stretch !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    height: auto !important;
    min-height: 62px !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="2"] > .iep-choice-label {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 12px !important;
    gap: 9px !important;
    text-align: start !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] > .iep-choice-label {
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 76px !important;
    padding: 9px 5px !important;
    text-align: center !important;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-custom {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
}

.iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-text {
    flex: 0 1 auto !important;
    width: 100% !important;
    font-size: clamp(13px, 2vw, 17px);
    line-height: 1.45;
    text-align: center !important;
}

.iep-student-exam-v2 .iep-choice-label {
    position: relative;
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 62px;
    padding: 14px 17px;
    margin-bottom: 11px;
    color: var(--iep-choice-color, #35415a);
    background: #fff;
    border: 2px solid #d7dfeb;
    border-radius: 14px;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.iep-student-exam-v2 .iep-choice-label:hover {
    background: #f7f9ff;
    border-color: #aebeed;
    transform: translateY(-1px);
}

.iep-student-exam-v2 .iep-choice-label:focus-within {
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.13);
}

.iep-student-exam-v2 .iep-choice-label input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.iep-student-exam-v2 .iep-choice-custom {
    position: relative;
    flex: 0 0 24px;
    display: inline-block;
    width: 24px;
    height: 24px;
    margin: 0;
    background: #fff;
    border: 2px solid #aeb8c8;
    border-radius: 50%;
    box-shadow: none;
}

.iep-student-exam-v2 .iep-choice-label input[type="radio"]:checked + .iep-choice-custom {
    background: var(--exam-primary);
    border-color: var(--exam-primary);
    box-shadow: inset 0 0 0 5px #fff;
}

.iep-student-exam-v2 .iep-choice-label:has(input:checked) {
    color: var(--exam-primary-dark);
    background: var(--exam-primary-soft);
    border-color: var(--exam-primary);
    box-shadow: 0 7px 18px rgba(49, 87, 213, 0.11);
}

.iep-student-exam-v2 .iep-choice-text {
    display: block !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    color: inherit;
    font-size: clamp(16px, 2.3vw, 19px);
    font-weight: 700;
    line-height: 1.65;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

.iep-choices-true_false {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.iep-choices-true_false .iep-choice-label {
    justify-content: center;
    min-height: 82px;
    margin: 0;
    font-size: 20px;
}

.iep-student-exam-v2 .iep-text-input,
.iep-student-exam-v2 .iep-select,
.iep-student-exam-v2 .iep-inline-select {
    color: var(--exam-ink);
    background: #fff;
    border: 2px solid #cfd8e6;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.iep-student-exam-v2 .iep-text-input {
    width: 100%;
    min-height: 62px;
    padding: 15px 17px;
    font-size: 17px;
}

.iep-student-exam-v2 .iep-text-input:focus,
.iep-student-exam-v2 .iep-select:focus,
.iep-student-exam-v2 .iep-inline-select:focus {
    background: #fff;
    border-color: var(--exam-primary);
    box-shadow: 0 0 0 4px rgba(49, 87, 213, 0.13);
}

.iep-student-exam-v2 .iep-matching-grid {
    overflow: visible;
    border: 0;
    border-radius: 0;
}

.iep-student-exam-v2 .iep-matching-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #f7f9fc;
    border: 1px solid var(--exam-line);
    border-radius: 14px;
}

.iep-student-exam-v2 .iep-match-left {
    padding: 11px 13px;
    color: #344054;
    background: #fff;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 800;
}

.iep-match-arrow {
    color: var(--exam-primary);
    text-align: center;
    font-size: 20px;
    font-weight: 900;
}

.iep-student-exam-v2 .iep-select {
    width: 100%;
    min-height: 48px;
    padding: 9px 12px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.iep-student-exam-v2 .iep-inline-select {
    display: inline-block;
    width: auto;
    min-width: 150px;
    max-width: 100%;
    min-height: 42px;
    padding: 5px 11px;
    margin: 4px 5px;
    color: var(--exam-primary-dark);
    background: var(--exam-primary-soft);
    font-size: 16px;
    font-weight: 800;
    direction: rtl;
    text-align: right;
    cursor: pointer;
}

.iep-student-exam-v2 .iep-inline-select option {
    direction: rtl;
    text-align: right;
}

.iep-question-save-state {
    min-height: 22px;
    margin-top: 18px;
    color: var(--exam-muted);
    font-size: 12px;
    font-weight: 700;
}

.iep-question-card.is-expired .iep-question-save-state {
    color: var(--exam-warning);
}

.iep-student-exam-v2 :disabled {
    cursor: not-allowed;
}

.iep-question-card.is-expired .iep-choices {
    opacity: 0.72;
}

.iep-exam-navigation {
    position: sticky;
    bottom: 10px;
    z-index: 80;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--exam-line);
    border-radius: 17px;
    box-shadow: 0 10px 28px rgba(23, 32, 51, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.iep-nav-button,
.iep-student-exam-v2 .iep-btn-primary,
.iep-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.iep-nav-arrow {
    display: none;
    flex: 0 0 25px;
    width: 25px;
    height: 25px;
    margin: 0;
    fill: currentColor;
    vertical-align: middle;
}

.iep-nav-button:hover:not(:disabled),
.iep-student-exam-v2 .iep-btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
}

.iep-nav-button:focus-visible,
.iep-student-exam-v2 .iep-btn-primary:focus-visible,
.iep-icon-button:focus-visible,
.iep-question-map-button:focus-visible,
.iep-question-image:focus-visible {
    outline: 3px solid rgba(49, 87, 213, 0.25);
    outline-offset: 2px;
}

.iep-nav-button-primary,
.iep-student-exam-v2 .iep-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 155px;
    margin: 0;
    color: #fff;
    background: var(--exam-primary);
    border: 1px solid var(--exam-primary);
    box-shadow: 0 7px 18px rgba(49, 87, 213, 0.2);
}

.iep-nav-button-primary:hover,
.iep-student-exam-v2 .iep-btn-primary:hover {
    background: var(--exam-primary-dark);
}

.iep-nav-button-secondary {
    color: #46526a;
    background: #fff;
    border: 1px solid #cfd8e6;
}

.iep-nav-button-secondary:hover:not(:disabled) {
    background: #f4f6fa;
    border-color: #adb9ca;
}

.iep-nav-button-secondary:disabled {
    color: #a4acb9;
    background: #f2f4f7;
    border-color: #e4e7ec;
}

.iep-nav-button-review {
    color: #875200;
    background: #fff9ec;
    border: 1px solid #edcf8c;
}

.iep-nav-button-review.is-active {
    color: #fff;
    background: #a96600;
    border-color: #a96600;
}

.iep-review-panel {
    padding: clamp(22px, 4vw, 38px);
    background: #fff;
    border: 1px solid var(--exam-line);
    border-radius: 22px;
    box-shadow: 0 14px 36px rgba(23, 32, 51, 0.09);
}

.iep-review-heading {
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.iep-review-eyebrow {
    color: var(--exam-primary);
    font-size: 12px;
    font-weight: 900;
}

.iep-review-heading h2,
.iep-result-details h3 {
    margin: 3px 0 0;
    color: var(--exam-ink);
    font-size: clamp(21px, 3vw, 28px);
    font-weight: 900;
}

.iep-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    min-width: 42px;
    padding: 0;
    color: #536078;
    background: #f4f6fa;
    border: 1px solid var(--exam-line);
    font-size: 25px;
}

.iep-review-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 22px;
}

.iep-review-summary > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    padding: 12px;
    background: #f6f8fb;
    border: 1px solid var(--exam-line);
    border-radius: 14px;
}

.iep-review-summary strong {
    color: var(--exam-primary-dark);
    font-size: 28px;
    font-weight: 900;
}

.iep-review-summary span {
    color: var(--exam-muted);
    font-size: 12px;
    font-weight: 800;
}

.iep-review-question-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 9px;
}

.iep-review-question-button {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-height: 66px;
    padding: 11px 13px;
    color: #4c5870;
    text-align: start;
    background: #fff;
    border: 1px solid #d5dce8;
    border-radius: 12px;
    cursor: pointer;
}

.iep-review-question-button.is-answered {
    color: #05664f;
    background: var(--exam-success-soft);
    border-color: #8bd2c0;
}

.iep-review-question-button.is-marked {
    box-shadow: inset -4px 0 0 #e09a17;
}

.iep-review-question-button span {
    margin-top: 3px;
    font-size: 11px;
    font-weight: 700;
}

.iep-review-actions {
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
}

.iep-student-exam-v2 .iep-btn-primary.is-loading {
    opacity: 0.72;
    cursor: wait;
}

.iep-exam-result {
    padding: clamp(28px, 5vw, 52px);
    text-align: center;
    background: #fff;
    border: 1px solid var(--exam-line);
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(23, 32, 51, 0.1);
    animation: iepQuestionIn 0.35s ease both;
}

.iep-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    margin: 0 auto 16px;
    color: #fff;
    background: var(--exam-success);
    border-radius: 50%;
    box-shadow: 0 12px 28px rgba(7, 132, 103, 0.22);
    font-size: 38px;
    font-weight: 900;
}

.iep-exam-result.is-not-passed .iep-result-icon {
    background: var(--exam-warning);
    box-shadow: 0 12px 28px rgba(184, 92, 0, 0.2);
}

.iep-result-eyebrow {
    color: var(--exam-success);
    font-size: 12px;
    font-weight: 900;
}

.iep-exam-result h2 {
    margin: 5px 0 8px;
    color: var(--exam-ink);
    font-size: clamp(23px, 4vw, 32px);
    font-weight: 900;
}

.iep-result-message {
    color: var(--exam-muted);
    font-size: 16px;
    font-weight: 600;
}

.iep-score-container {
    display: grid;
    place-items: center;
    width: min(100%, 310px);
    padding: 18px;
    margin: 24px auto;
    background: var(--exam-primary-soft);
    border: 1px solid #cbd7fa;
    border-radius: 18px;
}

.iep-score-container > span,
.iep-score-container > small {
    color: #56637b;
    font-weight: 800;
}

.iep-score-container strong {
    margin: 3px 0;
    color: var(--exam-primary-dark);
    font-size: 32px;
    font-weight: 900;
}

.iep-result-details {
    margin-top: 28px;
    text-align: start;
}

.iep-result-details h3 {
    margin-bottom: 13px;
    font-size: 20px;
}

.iep-result-answer {
    margin-bottom: 9px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--exam-line);
    border-inline-start: 4px solid var(--exam-danger);
    border-radius: 12px;
}

.iep-result-answer.is-correct {
    border-inline-start-color: var(--exam-success);
}

.iep-result-answer summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 15px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
}

.iep-result-answer.is-correct summary strong {
    color: var(--exam-success);
}

.iep-result-answer.is-incorrect summary strong {
    color: var(--exam-danger);
}

.iep-result-answer-body {
    padding: 0 15px 15px;
    color: #475467;
}

.iep-result-answer-body .iep-correct-answer {
    color: var(--iep-answer-color, var(--exam-success));
    font-size: inherit;
}

.iep-result-answer-body .iep-explanation-text {
    padding: 12px;
    margin-top: 10px;
    border: 1px solid var(--exam-line);
    color: var(--iep-explanation-color, #475467);
    font-size: 14px;
}

.iep-result-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.iep-whatsapp-result-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 20px;
    color: #fff !important;
    background: #128c5e;
    border: 1px solid #0b714a;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(18, 140, 94, 0.22);
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.iep-whatsapp-result-button::before {
    content: "↗";
    margin-inline-end: 8px;
    font-size: 17px;
}

.iep-whatsapp-result-button:hover,
.iep-whatsapp-result-button:focus-visible {
    color: #fff !important;
    background: #087a4e;
    box-shadow: 0 10px 24px rgba(18, 140, 94, 0.3);
    transform: translateY(-1px);
}

.iep-whatsapp-result-button[hidden] {
    display: none !important;
}

.iep-released-result > .iep-whatsapp-result-button {
    margin-top: 18px;
}

.iep-result-card-share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 22px;
    color: #fff;
    background: linear-gradient(135deg, #0f766e, #059669);
    border: 1px solid #047857;
    border-radius: 12px;
    box-shadow: 0 9px 22px rgba(5, 150, 105, 0.24);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.iep-result-card-share-button::before {
    content: "▣";
    margin-inline-end: 8px;
    font-size: 18px;
}

.iep-result-card-share-button:hover,
.iep-result-card-share-button:focus-visible {
    color: #fff;
    box-shadow: 0 12px 27px rgba(5, 150, 105, 0.32);
    transform: translateY(-1px);
}

.iep-result-card-share-button:disabled {
    cursor: wait;
    opacity: 0.7;
    transform: none;
}

.iep-result-card-share-button[hidden] {
    display: none !important;
}

.iep-result-link-security {
    display: grid;
    min-width: 180px;
    margin-top: 8px;
    gap: 5px;
}

.iep-result-link-security > small {
    display: block;
    color: #475569;
    font-size: 11px;
    line-height: 1.55;
}

.iep-result-link-security > small:first-child {
    color: #1e3a8a;
    font-weight: 800;
}

.iep-result-link-security > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.iep-result-link-security button {
    padding: 5px 8px;
    color: #1d4ed8;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 6px;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
}

.iep-result-link-security button.is-danger {
    color: #b91c1c;
    background: #fff1f2;
    border-color: #fecaca;
}

.iep-result-link-security button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.iep-released-result > .iep-result-card-share-button {
    margin-top: 18px;
}

.iep-result-card-status {
    flex-basis: 100%;
    min-height: 20px;
    margin: 10px 0 0;
    color: #64748b;
    text-align: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.7;
}

.iep-result-card-status.is-working { color: #1d4ed8; }
.iep-result-card-status.is-success { color: #047857; }
.iep-result-card-status.is-error { color: #b91c1c; }

.iep-sticker {
    position: fixed;
    top: 110px;
    left: 50%;
    z-index: 1000;
    padding: 11px 20px;
    color: #fff;
    background: #80570b;
    border-radius: 999px;
    box-shadow: 0 10px 25px rgba(23, 32, 51, 0.2);
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-10px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    font-size: 14px;
    font-weight: 900;
}

.iep-sticker.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#iep-confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9999;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.iep-image-dialog {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(14, 20, 33, 0.86);
    backdrop-filter: blur(5px);
}

.iep-image-dialog img {
    max-width: min(1100px, 94vw);
    max-height: 88vh;
    object-fit: contain;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.iep-image-dialog-close {
    position: fixed;
    top: 20px;
    inset-inline-end: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    cursor: pointer;
    font-size: 29px;
}

@keyframes iepQuestionIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@media (max-width: 1024px) {
    .iep-exam-identity {
        display: none;
    }

    .iep-exam-topbar {
        justify-content: center;
        min-height: 68px;
        padding: 11px;
    }

    .iep-exam-topbar-actions {
        width: 100%;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .iep-fullscreen-toggle {
        display: inline-flex;
    }

    .iep-student-exam-v2 .iep-question-map-button {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        padding: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
        vertical-align: middle !important;
    }

    .iep-student-exam-v2 .iep-question-map-number {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
        text-align: center !important;
        transform: none !important;
    }

    .iep-exam-navigation {
        position: static;
        bottom: auto;
        z-index: auto;
        margin-top: 14px;
        padding: 0;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    /* Keep answer controls compact and immune to broad theme rules such as
       label { width: 50%; height: 100% }. These overrides are deliberately
       scoped to the student exam only. */
    .iep-student-exam-v2 .iep-choices {
        margin-top: 16px;
    }

    .iep-student-exam-v2 .iep-choices > .iep-choice-label {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        min-height: 54px !important;
        padding: 11px 13px !important;
        margin: 0 !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice {
        gap: 9px !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] > .iep-choice-label {
        flex-direction: row !important;
        justify-content: flex-start !important;
        min-height: 54px !important;
        padding: 11px 13px !important;
        text-align: start !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-text {
        flex: 1 1 0 !important;
        width: auto !important;
        font-size: 16px;
        line-height: 1.5;
        text-align: start !important;
    }

    .iep-student-exam-v2 .iep-choice-custom,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-custom {
        flex: 0 0 22px;
        width: 22px;
        height: 22px;
    }

    .iep-student-exam-v2 .iep-choice-text {
        font-size: clamp(15px, 1.9vw, 17px);
        line-height: 1.5;
    }

    .iep-student-exam-v2 .iep-choices-true_false {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 9px !important;
    }

    .iep-student-exam-v2 .iep-choices-true_false > .iep-choice-label {
        justify-content: center !important;
    }

    /* On phones and tablets the answer list stays in normal document flow.
       This prevents a long matching/fill list from covering subsequent rows
       or the previous/next navigation controls. */
    .iep-student-exam-v2 .iep-math-select.is-open {
        z-index: 4;
    }

    .iep-student-exam-v2 .iep-math-select.is-open .iep-math-select-menu,
    .iep-student-exam-v2 .iep-math-select.opens-up .iep-math-select-menu {
        position: relative !important;
        display: block;
        inset: auto !important;
        top: auto !important;
        bottom: auto !important;
        width: 100% !important;
        margin-top: 6px;
        max-height: min(260px, 42vh) !important;
    }

    .iep-student-exam-v2 .iep-math-select--inline.is-open {
        display: inline-flex;
        flex-direction: column;
        width: min(100%, 420px);
        margin-block: 8px;
        vertical-align: top;
    }
}

@media (max-width: 760px) {
    .iep-student-exam-v2 {
        width: 100%;
        margin: 0;
        padding: 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .iep-exam-topbar {
        top: 6px;
        align-items: center;
        padding: 11px;
        border-radius: 16px;
    }

    .iep-exam-teacher-avatar {
        display: none;
    }

    .iep-exam-topbar-actions {
        gap: 6px;
    }

    .iep-timer-container {
        min-width: 92px;
        font-size: 16px;
    }

    .iep-timer-container svg {
        width: 19px !important;
        height: 19px !important;
    }

    .iep-question-stage {
        min-height: 360px;
    }

    .iep-student-exam-v2 .iep-question-card {
        padding: 16px 13px;
        border-radius: 18px;
    }

    .iep-question-type-row {
        margin-bottom: 12px;
    }

    .iep-question-type-badge,
    .iep-question-score {
        min-height: 26px;
        padding: 4px 9px;
        font-size: 11px;
    }

    .iep-student-exam-v2 .iep-question-header {
        gap: 10px;
        margin-bottom: 15px;
    }

    .iep-student-exam-v2 .iep-question-number {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 16px;
    }

    .iep-student-exam-v2 .iep-question-text {
        padding-top: 1px;
        font-size: 18px;
        line-height: 1.58;
    }

    .iep-student-exam-v2 .iep-question-image {
        margin-bottom: 14px;
        border-radius: 12px;
    }

    .iep-student-exam-v2 .iep-choices {
        margin-top: 12px;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="1"],
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="2"],
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice > .iep-choice-label,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="2"] > .iep-choice-label,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] > .iep-choice-label {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-height: 50px !important;
        padding: 9px 11px !important;
        gap: 9px !important;
        text-align: start !important;
    }

    .iep-student-exam-v2 .iep-choices-multiple_choice .iep-choice-text,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-text {
        flex: 1 1 0 !important;
        width: auto !important;
        font-size: 15px;
        line-height: 1.45;
        text-align: start !important;
    }

    .iep-student-exam-v2 .iep-choice-custom,
    .iep-student-exam-v2 .iep-choices-multiple_choice[data-columns="4"] .iep-choice-custom {
        flex-basis: 20px;
        width: 20px;
        height: 20px;
    }

    .iep-student-exam-v2 .iep-choices-true_false {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    .iep-student-exam-v2 .iep-choices-true_false > .iep-choice-label {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100% !important;
        height: auto !important;
        min-height: 52px !important;
        padding: 9px !important;
        margin: 0 !important;
        gap: 8px !important;
        text-align: center !important;
    }

    .iep-exam-navigation {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 2px;
    }

    .iep-nav-button {
        flex: 0 0 52px;
        width: 52px;
        min-width: 52px;
        height: 52px;
        min-height: 52px;
        padding: 0;
        border-radius: 50%;
    }

    .iep-nav-label {
        display: none;
    }

    .iep-nav-arrow {
        display: block;
    }

    .iep-student-exam-v2 .iep-matching-row {
        grid-template-columns: 1fr;
        gap: 5px;
        padding: 8px;
        margin-bottom: 8px;
        border-radius: 12px;
    }

    .iep-student-exam-v2 .iep-match-left {
        min-height: 0;
        padding: 8px 10px;
        margin: 0;
        font-size: 15px;
        line-height: 1.45;
    }

    .iep-match-arrow {
        transform: rotate(-90deg);
        font-size: 17px;
        line-height: 1;
    }

    .iep-student-exam-v2 .iep-math-select-button {
        min-height: 44px;
        padding: 8px 10px;
        font-size: 14px;
        line-height: 1.4;
    }

    .iep-question-save-state {
        min-height: 18px;
        margin-top: 10px;
        font-size: 11px;
        line-height: 1.45;
    }

    .iep-review-summary {
        gap: 6px;
    }

    .iep-review-summary > div {
        min-height: 78px;
        padding: 8px 4px;
    }

    .iep-review-summary strong {
        font-size: 23px;
    }

    .iep-review-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .iep-student-exam-v2 .iep-btn-primary {
        width: 100%;
    }
}

@media (max-width: 470px) {
    .iep-exam-topbar {
        flex-direction: column;
    }

    .iep-exam-identity,
    .iep-exam-topbar-actions {
        width: 100%;
    }

    .iep-exam-topbar-actions {
        justify-content: center !important;
    }

    .iep-student-exam-v2 .iep-exam-title {
        white-space: normal;
    }

    .iep-choices-true_false {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .iep-review-question-list {
        grid-template-columns: 1fr 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .iep-student-exam-v2 *,
    .iep-student-exam-v2 *::before,
    .iep-student-exam-v2 *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    @page {
        size: A4;
        margin: 0;
    }

    html,
    body {
        margin: 0 !important;
    }

    th,
    td {
        text-align: center !important;
        vertical-align: middle !important;
    }

    .iep-exam-topbar,
    .iep-progress-section,
    .iep-question-map,
    .iep-exam-navigation,
    .iep-sticker,
    #iep-confetti-canvas {
        display: none !important;
    }

    .iep-manual-grade-control {
        display: none !important;
    }

    .iep-student-exam-v2 {
        width: 100%;
        margin: 0;
        padding: 0;
        background: #fff;
        border: 0;
        box-shadow: none;
    }
}
