#qb-portal {
    max-width: 480px;
    margin: 20px auto;
    font-family: 'IBM Plex Sans Arabic', -apple-system, "Segoe UI", Tahoma, Arial, sans-serif !important;
    direction: rtl;
    text-align: right;
}

#qb-portal *,
#qb-portal *::before,
#qb-portal *::after {
    font-family: inherit;
}

#qb-portal .qb-hidden {
    display: none !important;
}

/* لما عنصر معيّن يتحدد اتجاهه LTR (سؤال إنجليزي مثلاً)، المحاذاة تتبع نفس الاتجاه */
#qb-portal [dir="ltr"] {
    text-align: left;
}

/* شاشة الدخول: خلفية رصاصي فاتح مع فقاعتين زخرفيتين */
#qb-portal .qb-entry-hero {
    position: relative;
    background-color: #f2f2f2;
    border-radius: 20px;
    padding: 44px 24px 30px;
    text-align: center;
    overflow: hidden;
}

#qb-portal .qb-entry-circle {
    position: absolute;
    border-radius: 50%;
}

#qb-portal .qb-entry-circle-1 {
    top: -30px;
    left: -30px;
    width: 100px;
    height: 100px;
    background: #e2e2e2;
}

#qb-portal .qb-entry-circle-2 {
    bottom: -40px;
    right: -20px;
    width: 120px;
    height: 120px;
    background: #e8e8e8;
}

#qb-portal .qb-entry-hero-content {
    position: relative;
}

#qb-portal .qb-entry-hero-content h3 {
    color: #1a1a1a;
    margin: 0 0 4px;
    font-size: 20px;
}

#qb-portal .qb-entry-hero-content .qb-sub {
    color: #8a8a8a;
    margin-bottom: 28px;
}

#qb-portal .qb-entry-card {
    border-radius: 16px;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 24px;
    text-align: right;
}

#qb-portal .qb-version-label {
    font-size: 11px;
    color: #999;
    text-align: left;
    margin: 0 0 8px;
}

#qb-portal .qb-free-period-banner {
    background: #1a1a1a;
    color: #fff;
    border-radius: 10px;
    padding: 14px 16px;
    text-align: center;
    margin-bottom: 16px;
}

#qb-portal .qb-free-period-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 4px;
}

#qb-portal .qb-free-period-sub {
    font-size: 12px;
    color: #ddd;
    margin: 0;
}

#qb-portal .qb-platform-stats-row {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    margin-top: 16px;
}

#qb-portal .qb-stat-inline {
    font-size: 12px;
    color: #888;
}

#qb-portal .qb-stat-inline b {
    font-size: 14px;
    color: #1a1a1a;
    font-weight: 800;
}

#qb-portal .qb-entry-card .qb-sub {
    color: #444;
    margin-bottom: 20px;
}

#qb-portal .qb-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#qb-portal .qb-btn-icon span {
    font-size: 16px;
    line-height: 1;
}

#qb-portal .qb-card {
    background: #ffffff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

#qb-portal h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

#qb-portal .qb-sub {
    font-size: 13px;
    color: #6b6b6b;
    margin: 0 0 16px;
}

#qb-portal .qb-step-label {
    font-size: 12px;
    color: #999;
    margin: 0 0 4px;
}

#qb-portal label {
    display: block;
    font-size: 13px;
    color: #6b6b6b;
    margin: 12px 0 4px;
}

#qb-portal input[type="text"],
#qb-portal input[type="email"],
#qb-portal input[type="tel"],
#qb-portal input[type="password"],
#qb-portal select,
#qb-portal textarea,
#qb-portal button {
    font-family: inherit;
}

#qb-portal input[type="text"],
#qb-portal input[type="email"],
#qb-portal input[type="tel"],
#qb-portal input[type="password"],
#qb-portal select {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
}

#qb-portal .qb-btn {
    background: #ffffff;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 14px;
    cursor: pointer;
}

#qb-portal .qb-btn:hover {
    background: #f5f5f5;
}

#qb-portal .qb-btn-primary {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}

#qb-portal .qb-btn-primary:hover {
    background: #333;
}

#qb-portal .qb-btn-block {
    width: 100%;
    margin-top: 20px;
}

#qb-portal .qb-btn-small {
    font-size: 12px;
    padding: 5px 10px;
}

#qb-portal .qb-error {
    display: none;
    background: #fdecea;
    color: #a32d2d;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

#qb-portal .qb-error.qb-show {
    display: block;
}

#qb-portal .qb-field-error {
    font-size: 11px;
    color: #a32d2d;
    margin: 4px 0 0;
}

#qb-portal input.qb-field-invalid {
    border-color: #c0392b !important;
}

#qb-portal .qb-btn-primary:disabled {
    background: #ccc;
    border-color: #ccc;
    color: #888;
    cursor: not-allowed;
}

#qb-portal .qb-nav-row {
    display: flex;
    justify-content: space-between;
    margin-top: 22px;
}

/* شريط الخطوات */
#qb-portal .qb-steps {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

#qb-portal .qb-step-bar {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e2e2e2;
}

#qb-portal .qb-step-bar.active {
    background: #1a1a1a;
}

/* زرار الشعبة toggle */
#qb-portal .qb-track-toggle {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

#qb-portal .qb-track-btn {
    flex: 1;
    padding: 9px 12px;
    border: 1px solid #333;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
}

#qb-portal .qb-track-btn.active {
    background: #1a1a1a;
    color: #fff;
}

/* مراجعة البيانات */
#qb-portal .qb-review-summary {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
}

#qb-portal .qb-review-summary p {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
}

#qb-portal .qb-review-summary span.qb-label {
    color: #6b6b6b;
}

/* بيانات ثابتة (خطوة 2) */
#qb-portal .qb-fixed-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#qb-portal .qb-fixed-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7f7f5;
    border-radius: 8px;
    padding: 14px 16px;
}

#qb-portal .qb-fixed-label {
    font-size: 14px;
    color: #6b6b6b;
}

#qb-portal .qb-fixed-value {
    font-size: 14px;
    font-weight: 600;
}

/* صندوق ملحوظة الاشتراك (خطوة 4) */
#qb-portal .qb-note-box {
    background: #fdf6e3;
    border: 1px solid #f0dfa0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 14px;
    font-size: 12px;
    color: #6b6b6b;
    line-height: 1.6;
}

/* الداشبورد */
#qb-portal .qb-dash-header {
    background: #f5f5f5;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

#qb-portal .qb-dash-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

#qb-portal .qb-dash-info-line {
    font-size: 11px;
    color: #999;
    margin: 0 0 2px;
}

/* بانر الاشتراك / التنبيه */
#qb-portal .qb-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdf6e3;
    border: 1px solid #f0dfa0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

#qb-portal .qb-banner-icon {
    font-size: 20px;
    flex-shrink: 0;
}

#qb-portal .qb-banner-text {
    flex: 1;
}

#qb-portal .qb-banner-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
}

#qb-portal .qb-banner-sub {
    font-size: 12px;
    color: #6b6b6b;
    margin: 0;
}

#qb-portal .qb-banner.qb-banner-urgent {
    background: #fdecea;
    border-color: #f0b8b0;
}

#qb-portal .qb-banner.qb-banner-active {
    background: #eaf3de;
    border-color: #c8dab0;
}

/* بانر اقتراح "إضافة للشاشة الرئيسية" (PWA) */
#qb-portal .qb-pwa-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    position: relative;
}

#qb-portal .qb-pwa-banner img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    flex-shrink: 0;
}

#qb-portal .qb-pwa-banner-text {
    flex: 1;
    min-width: 0;
}

#qb-portal .qb-pwa-banner-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
}

#qb-portal .qb-pwa-banner-sub {
    font-size: 11px;
    color: #6b6b6b;
    margin: 2px 0 0;
}

#qb-portal .qb-pwa-close {
    position: absolute;
    top: 6px;
    left: 6px;
    background: none;
    border: none;
    color: #999;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}

/* بانر بنك الأخطاء */
#qb-portal .qb-mistake-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fdecea;
    border: 1px solid #f0b8b0;
    border-radius: 12px;
    padding: 12px 14px;
    margin-top: 16px;
}

#qb-portal .qb-mistake-icon {
    font-size: 20px;
    flex-shrink: 0;
    font-style: normal;
}

#qb-portal .qb-mistake-text {
    flex: 1;
}

#qb-portal .qb-mistake-title {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 2px;
    color: #791f1f;
}

#qb-portal .qb-mistake-sub {
    font-size: 12px;
    color: #6b6b6b;
    margin: 0;
}

#qb-portal .qb-mistake-batch-item {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

#qb-portal .qb-mistake-batch-item:hover {
    background: #efefec;
}

/* تبويبات الداشبورد: المواد / كل الامتحانات */
#qb-portal .qb-dash-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

#qb-portal .qb-dash-tab-btn {
    flex: 1;
    padding: 9px;
    border-radius: 8px;
    border: 1px solid #d5d5d5;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

#qb-portal .qb-dash-tab-btn.active {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

#qb-portal .qb-dash-tab-btn {
    position: relative;
}

#qb-portal .qb-teacherreq-badge {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #a32d2d;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
}

#qb-portal .qb-teacherreq-total {
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
}

#qb-portal .qb-teacherreq-card {
    background: #fdf6e3;
    border-right: 4px solid #d4a017;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 10px;
}

#qb-portal .qb-teacherreq-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #7a5c0a;
    margin: 0 0 4px;
}

#qb-portal .qb-teacherreq-card-sub {
    font-size: 12px;
    color: #000;
    margin: 0 0 10px;
}

#qb-portal .qb-teacherreq-photos {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

#qb-portal .qb-teacherreq-photos img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
}

#qb-portal .qb-lightbox-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    cursor: pointer;
    padding: 20px;
}

#qb-portal .qb-lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
}

#qb-portal .qb-teacherreq-grade {
    font-size: 13px;
    font-weight: 700;
    color: #2e7d32;
    margin: 0;
}

#qb-portal .qb-teacherreq-photo-previews {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    flex-wrap: wrap;
}

#qb-portal .qb-teacherreq-thumb {
    position: relative;
    width: 80px;
    height: 80px;
}

#qb-portal .qb-teacherreq-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

#qb-portal .qb-teacherreq-thumb-remove {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #a32d2d;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
}

#qb-portal .qb-teacherreq-upload-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 4px;
}

#qb-portal .qb-teacherreq-upload-buttons button {
    flex: 1;
    padding: 16px;
    border-radius: 10px;
    border: 1px dashed #ddd;
    background: #fff;
    font-size: 13px;
    cursor: pointer;
}

#qb-portal .qb-all-exam-card {
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    cursor: pointer;
}

#qb-portal .qb-all-exam-card:hover {
    background: #efefec;
}

#qb-portal .qb-all-exam-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 4px;
}

#qb-portal .qb-all-exam-lesson {
    font-size: 12px;
    color: #6b6b6b;
    margin: 0 0 2px;
}

#qb-portal .qb-all-exam-stage {
    font-size: 11px;
    color: #999;
    margin: 0 0 8px;
}

#qb-portal .qb-all-exam-qcount {
    display: inline-block;
    font-size: 11px;
    background: #e8e4f7;
    color: #4a3d8f;
    padding: 2px 9px;
    border-radius: 20px;
}

#qb-portal .qb-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

#qb-portal .qb-stat-card {
    background: #f7f7f5;
    border-radius: 12px;
    padding: 14px 8px;
    text-align: center;
}

#qb-portal .qb-stat-num {
    font-size: 19px;
    font-weight: 700;
    margin: 0;
}

#qb-portal .qb-stat-label {
    font-size: 11px;
    color: #6b6b6b;
    margin: 4px 0 0;
}

#qb-portal .qb-stat-card-mistakes {
    background: #f7f7f5;
}

#qb-portal .qb-stat-card-mistakes .qb-stat-num {
    color: #1a1a1a;
}

#qb-portal .qb-stat-card-mistakes.qb-has-mistakes {
    background: #fdecea;
}

#qb-portal .qb-stat-card-mistakes.qb-has-mistakes .qb-stat-num {
    color: #a32d2d;
}

#qb-portal .qb-mistake-card-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px;
    margin-top: 10px;
    font-size: 12px;
    cursor: pointer;
}

#qb-portal .qb-mistake-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 1.5px solid #fff;
    border-radius: 4px;
    flex-shrink: 0;
    font-size: 10px;
}

#qb-portal .qb-mistake-subject-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f7f7f5;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    cursor: pointer;
}

#qb-portal .qb-mistake-subject-row.qb-mistake-subject-empty {
    opacity: 0.5;
    cursor: default;
}

#qb-portal .qb-stat-card-highlight {
    background: #e8e4f7;
}

#qb-portal .qb-stat-card-highlight .qb-stat-num,
#qb-portal .qb-stat-card-highlight .qb-stat-label {
    color: #4a3d8f;
}

/* أكورديون المواد */
#qb-portal .qb-subject-card {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
}

#qb-portal .qb-subject-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
}

#qb-portal .qb-subject-name {
    font-size: 15px;
    font-weight: 600;
}

#qb-portal .qb-subject-lessons {
    border-top: 1px solid #eee;
    display: none;
}

#qb-portal .qb-subject-card.open .qb-subject-lessons {
    display: block;
}

#qb-portal .qb-lesson-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px 10px 32px;
    border-top: 1px solid #eee;
    font-size: 13px;
    cursor: pointer;
}

#qb-portal .qb-subject-mistake-btn {
    display: block;
    width: 100%;
    font-size: 11px;
    padding: 8px 16px;
    background: #fdecea;
    color: #a32d2d;
    border: none;
    border-top: 1px solid #eee;
    cursor: pointer;
}

#qb-portal .qb-subject-lessons .qb-lesson-row:first-child {
    border-top: none;
}

#qb-portal .qb-lesson-row:hover {
    background: #f7f7f5;
}

#qb-portal .qb-exam-count-badge {
    font-size: 12px;
    color: #6b6b6b;
    background: #f0f0ee;
    padding: 3px 10px;
    border-radius: 20px;
}

#qb-portal .qb-question-count-badge {
    background: #e8e4f7;
    color: #4a3d8f;
}

#qb-portal .qb-empty-note {
    padding: 10px 16px 14px 32px;
    font-size: 12px;
    color: #999;
    border-top: 1px solid #eee;
}

/* قايمة اختبارات الدرس */
#qb-portal .qb-exam-item {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    font-size: 13.5px;
}

#qb-portal .qb-exam-item-solved {
    background: #f2f9ec;
}

#qb-portal .qb-exam-item-wrap {
    margin-bottom: 4px;
}

#qb-portal .qb-solved-tag {
    position: absolute;
    top: -8px;
    right: -6px;
    background: #2e7d32;
    color: #fff;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

#qb-portal .qb-solved-subtitle {
    font-size: 10px;
    color: #888;
    margin: 0 0 10px;
    padding: 0 4px;
}

#qb-portal .qb-exam-item:hover {
    background: #efefec;
}

#qb-portal .qb-trial-badge {
    font-size: 11px;
    background: #eaf3de;
    color: #27500a;
    padding: 2px 8px;
    border-radius: 20px;
}

#qb-portal .qb-question-count-badge {
    font-size: 11px;
    background: #f0f0f0;
    color: #666;
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 4px;
}

#qb-portal .qb-ai-badge {
    font-size: 10px;
    font-weight: 700;
    background: #1a1a1a;
    color: #fff;
    padding: 2px 7px;
    border-radius: 4px;
    margin-right: 4px;
}

/* بادجات نوع الاختبار (نفس ألوان لوحة التحكم بالظبط) */
#qb-portal .qb-type-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 6px;
    display: inline-block;
}

#qb-portal .qb-type-badge-mcq {
    background: #e8e4f7;
    color: #4a3d8f;
}

#qb-portal .qb-type-badge-true_false {
    background: #e0eef4;
    color: #2a6b8f;
}

#qb-portal .qb-type-badge-fill_blank {
    background: #eaf3de;
    color: #27500a;
}

#qb-portal .qb-type-badge-essay {
    background: #eee;
    color: #6b6b6b;
}

#qb-portal .qb-type-badge-math {
    background: #f4ebe0;
    color: #8f5a2a;
}

#qb-portal .qb-type-badge-listening {
    background: #e0f4f0;
    color: #2a8f6b;
}

#qb-portal .qb-type-badge-image {
    background: #fde8f0;
    color: #8f2a6b;
}

#qb-portal .qb-type-badge-passage {
    background: #e8e4f7;
    color: #4a3d8f;
}

#qb-portal .qb-type-badge-rewrite {
    background: #fdf0d5;
    color: #8a6d1a;
}

/* الاختبار */
#qb-portal .qb-exam-source {
    font-size: 11px;
    color: #999;
    margin: 0 0 6px;
}

#qb-portal .qb-exam-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#qb-portal .qb-btn-exit {
    color: #a32d2d;
    border-color: #f0b8b0;
    background: #fdecea;
}

#qb-portal .qb-btn-exit:hover {
    background: #fbdcd7;
}

#qb-portal .qb-instapay-details-box {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    margin: 14px 0;
}

#qb-portal .qb-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #eee;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    margin: 0 auto 14px;
    animation: qb-spin 1s linear infinite;
}

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

#qb-portal .qb-success-check {
    width: 48px;
    height: 48px;
    background: #eaf3de;
    color: #27500a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
    font-size: 26px;
    font-weight: 700;
}

#qb-portal .qb-question-block {
    border-top: 1px solid #eee;
    padding-top: 16px;
    margin-top: 16px;
}

#qb-portal .qb-question-block:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

#qb-portal .qb-question-text {
    font-size: 14px;
    font-weight: 600;
    margin: 6px 0 10px;
}

#qb-portal .qb-question-block .qb-type-badge,
#qb-portal .qb-review-item .qb-type-badge {
    display: inline-block;
}

#qb-portal .qb-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    margin-bottom: 6px;
    cursor: pointer;
}

#qb-portal .qb-option-hint {
    border: 2px solid #2e7d32;
    background: #eaf3de;
}

#qb-portal .qb-option-label:hover {
    background: #f7f7f5;
}

#qb-portal .qb-essay-input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

#qb-portal .qb-fillblank-input {
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

#qb-portal .qb-media-audio {
    width: 100%;
    margin-bottom: 12px;
}

#qb-portal .qb-media-image {
    width: 100%;
    max-height: 260px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #eee;
    margin-bottom: 12px;
    display: block;
}

#qb-portal .qb-media-wrap {
    margin-bottom: 12px;
}

#qb-portal .qb-announcement-banner {
    background: #fdf6e3;
    border-right: 4px solid #d4a017;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    position: relative;
}

#qb-portal .qb-announcement-text {
    flex: 1;
}

#qb-portal .qb-announcement-close {
    font-size: 15px;
    color: #999;
    cursor: pointer;
    flex-shrink: 0;
    line-height: 1;
    padding: 2px;
}

#qb-portal .qb-announcement-icon {
    font-size: 20px;
    flex-shrink: 0;
}

#qb-portal .qb-announcement-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #7a5c0a;
}

#qb-portal .qb-announcement-body {
    font-size: 12.5px;
    color: #000;
    margin: 0;
}

#qb-portal .qb-ai-credit-pill {
    background: #e8e8e8;
    border-radius: 14px;
    padding: 12px 18px;
    text-align: center;
    cursor: pointer;
    min-width: 90px;
}

#qb-portal .qb-ai-credit-pill-num {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    color: #1a1a1a;
}

#qb-portal .qb-ai-credit-pill-label {
    font-size: 10px;
    color: #888;
    margin: 1px 0 6px;
}

#qb-portal .qb-ai-credit-pill-add {
    font-size: 11px;
    color: #1a1a1a;
    font-weight: 600;
    margin: 0;
    text-decoration: underline;
}

#qb-portal .qb-recharge-cost-box {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

#qb-portal #qb-recharge-cost {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
}

#qb-portal .qb-teacher-view-banner {
    background: #f0f0f0;
    color: #333;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}

#qb-portal .qb-review-status-banner {
    border-radius: 10px;
    padding: 9px 14px;
    margin-bottom: 16px;
    font-size: 12.5px;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#qb-portal .qb-review-status-banner.qb-review-pending {
    background: #fdf0e0;
    color: #7a4a12;
}

#qb-portal .qb-review-status-banner.qb-review-done {
    background: #eaf3de;
    color: #27500a;
}

#qb-portal .qb-review-status-banner button {
    font-size: 11px;
    padding: 6px 12px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

#qb-portal .qb-note-toggle-btn {
    border: 1px dashed #ccc;
    background: #fff;
    color: #666;
    font-size: 12px;
    padding: 8px;
}

#qb-portal #qb-exam-note-input {
    width: 100%;
    height: 60px;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #ddd;
    box-sizing: border-box;
    font-size: 12px;
    margin-top: 8px;
    font-family: inherit;
}

#qb-portal .qb-submit-ai-sub {
    display: block;
    font-size: 10px;
    color: #ccc;
    margin-top: 2px;
    font-weight: 400;
}

#qb-portal .qb-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}

#qb-portal .qb-modal-box {
    background: #fff;
    border-radius: 14px;
    padding: 1.25rem;
    max-width: 400px;
    width: 100%;
}

#qb-portal .qb-avatar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px dashed #999;
}

#qb-portal .qb-avatar-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

#qb-portal .qb-avatar-option {
    aspect-ratio: 1;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    border: 2px solid transparent;
}

#qb-portal .qb-avatar-option.active {
    border-color: #1a1a1a;
}

#qb-portal #qb-btn-submit-ai.qb-btn-disabled-look {
    opacity: 0.4;
    cursor: not-allowed;
}

#qb-portal .qb-skipped-divider {
    border-top: 1px dashed #ddd;
    margin: 16px 0 10px;
}

#qb-portal .qb-skipped-heading {
    font-size: 12px;
    font-weight: 600;
    color: #666;
    margin: 0 0 10px;
}

#qb-portal .qb-passage-wrap {
    margin-bottom: 16px;
}

#qb-portal .qb-passage-label {
    font-size: 12px;
    font-weight: 600;
    color: #6b6b6b;
    margin: 0 0 6px;
}

#qb-portal .qb-passage-box {
    background: #f7f7f5;
    border-right: 3px solid #1a1a1a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 0;
    font-size: 13px;
    line-height: 1.8;
    color: #333;
}

#qb-portal .qb-preview-banner {
    background: #fdf6e3;
    color: #8a6d1a;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 13px;
    text-align: center;
    font-weight: 500;
}

#qb-portal .qb-media-loading {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 14px;
    text-align: center;
    font-size: 13px;
    color: #6b6b6b;
}

#qb-portal .qb-media-loading .qb-btn {
    margin-right: 8px;
}

#qb-portal .qb-essay-feedback-box {
    background: #f7f7f5;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    color: #555;
    margin: 6px 0;
}

/* النتيجة */
#qb-portal .qb-result-card {
    text-align: center;
}

#qb-portal .qb-score {
    font-size: 32px;
    font-weight: 700;
    margin: 8px 0;
}

#qb-portal .qb-review-item {
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
}

#qb-portal .qb-review-item.correct {
    background: #eaf3de;
}

#qb-portal .qb-review-item.wrong {
    background: #fcebeb;
}

#qb-portal .qb-review-q {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 6px;
}

#qb-portal .qb-review-answer {
    font-size: 13px;
    margin: 2px 0;
}

#qb-portal .qb-review-item.correct .qb-review-answer {
    color: #27500a;
}

#qb-portal .qb-review-item.wrong .qb-review-answer.wrong-text {
    color: #791f1f;
}

#qb-portal .qb-review-item.wrong .qb-review-answer.correct-text {
    color: #444;
}

/* الطباعة */
#qb-print-area {
    display: none;
}

/* جدول أكمل الفراغ (الطالب) */
#qb-portal .qb-fill-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 13px;
}

#qb-portal .qb-fill-table th,
#qb-portal .qb-fill-table td {
    border: 1px solid #ddd;
    padding: 6px;
    text-align: center;
}

#qb-portal .qb-fill-table th {
    background: #f7f7f5;
}

#qb-portal .qb-fill-table .qb-row-label {
    font-weight: 600;
    background: #fafaf8;
}

#qb-portal .qb-fill-table input {
    width: 100%;
    box-sizing: border-box;
    padding: 5px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

#qb-portal .qb-fill-table .qb-cell-correct {
    background: #eaf3de;
    color: #27500a;
}

#qb-portal .qb-fill-table .qb-cell-wrong {
    background: #fcebeb;
    color: #791f1f;
}

#qb-portal .qb-fill-table .qb-cell-wrong small {
    display: block;
    color: #444;
    font-weight: 600;
    margin-top: 2px;
}

/* صورة السؤال (لو الاختبار جاي من رفع صورة) */
#qb-portal .qb-question-image {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

#qb-portal .qb-question-image img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

@media print {
    body * {
        visibility: hidden;
    }
    #qb-print-area, #qb-print-area * {
        visibility: visible;
    }
    #qb-print-area {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        direction: rtl;
        text-align: right;
    }
    #qb-print-area .qb-print-question {
        margin-bottom: 18px;
        font-size: 14px;
    }
    #qb-print-area .qb-print-options {
        margin-top: 6px;
        font-size: 13px;
    }
    #qb-print-area .qb-print-option {
        margin: 4px 0;
    }
    #qb-print-area .qb-print-circle {
        display: inline-block;
        width: 10px;
        height: 10px;
        border: 1px solid #000;
        border-radius: 50%;
        margin-left: 6px;
    }
    #qb-print-watermark {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-25deg);
        width: 55%;
        max-width: 320px;
        opacity: 0.07;
        z-index: -1;
    }
    #qb-print-footer {
        margin-top: 24px;
        padding-top: 8px;
        border-top: 1px solid #ccc;
        text-align: center;
        font-size: 10px;
        color: #888;
    }
    #qb-print-area .qb-fill-table {
        width: 100%;
        border-collapse: collapse;
        margin-top: 8px;
    }
    #qb-print-area .qb-fill-table th,
    #qb-print-area .qb-fill-table td {
        border: 1px solid #000;
        padding: 6px;
        font-size: 12px;
    }
    #qb-print-area .qb-fill-table input {
        border: none;
        width: 100%;
    }
}
