/* qxvis4 — Sitewide light/dark text visibility (final authority for shells)
   Covers: homepage, track switchers, course/folder lists, digital books,
   flashcards, settings, login hooks, Jovi, bookmark drawer, medical cards,
   examgoal-parity shells, RFC/summary, muted labels.
   CBT detail lives in qx-cbt-contrast.css (loaded after this when both present).
   Keep QuantrexQFormat · normalizeSessionSets · qxeg7 chrome intact.
   Hooks: [data-qx-contrast], .qx-ink-force — for browser teammate follow-ups. */

/* ========== Tokens ========== */
html[data-theme="light"],
html:not([data-theme="dark"]) {
  --qx-ink: #0f172a;
  --qx-ink-muted: #334155;
  --qx-ink-soft: #475569;
  --qx-surface: #ffffff;
  --qx-surface-2: #f8fafc;
  --qx-line: #e2e8f0;
}
html[data-theme="dark"] {
  --qx-ink: #f8fafc;
  --qx-ink-muted: #cbd5e1;
  --qx-ink-soft: #94a3b8;
  --qx-surface: #0f172a;
  --qx-surface-2: #1e293b;
  --qx-line: #334155;
}

/* Never invisible text */
.qx-ink-force,
[data-qx-contrast="ink"] {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========== Homepage / dashboard ========== */
html[data-theme="light"] .qx-home,
html[data-theme="light"] .dash-greet-left h1,
html[data-theme="light"] .dash-greet-left p,
html[data-theme="light"] .dash-board-tab,
html[data-theme="light"] .dash-util-card,
html[data-theme="light"] .dash-util-card strong,
html[data-theme="light"] .dash-ncert-head h2,
html[data-theme="light"] .dash-ncert-head p,
html[data-theme="light"] .sec-title,
html[data-theme="light"] .sec-desc,
html[data-theme="light"] .qx-course-row,
html[data-theme="light"] .qx-module-card,
html[data-theme="light"] .qx-module-card strong,
html[data-theme="light"] .logo-text,
html[data-theme="light"] .logo-tagline,
html[data-theme="light"] .topbar,
html[data-theme="light"] .sidebar,
html[data-theme="light"] .nav-item:not(.active),
html[data-theme="light"] .content h1,
html[data-theme="light"] .content h2,
html[data-theme="light"] .content h3 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
html[data-theme="light"] .dash-greet-left p,
html[data-theme="light"] .sec-desc,
html[data-theme="light"] .logo-tagline,
html[data-theme="light"] .dash-ncert-head p,
html[data-theme="light"] .dash-util-card small {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}

html[data-theme="dark"] .qx-home,
html[data-theme="dark"] .dash-greet-left h1,
html[data-theme="dark"] .dash-board-tab,
html[data-theme="dark"] .dash-util-card,
html[data-theme="dark"] .dash-util-card strong,
html[data-theme="dark"] .dash-ncert-head h2,
html[data-theme="dark"] .sec-title,
html[data-theme="dark"] .qx-course-row,
html[data-theme="dark"] .qx-module-card,
html[data-theme="dark"] .qx-module-card strong,
html[data-theme="dark"] .logo-text,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .nav-item:not(.active),
html[data-theme="dark"] .content h1,
html[data-theme="dark"] .content h2,
html[data-theme="dark"] .content h3,
html[data-theme="dark"] #app-main,
html[data-theme="dark"] .content {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .dash-greet-left p,
html[data-theme="dark"] .sec-desc,
html[data-theme="dark"] .logo-tagline,
html[data-theme="dark"] .dash-ncert-head p,
html[data-theme="dark"] .dash-util-card small,
html[data-theme="dark"] .qx-course-row small {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}

/* Greet bar on gradient stays white */
.qx-home .dash-greet-bar,
.qx-home .dash-greet-bar h1,
.qx-home .dash-greet-bar p,
.dash-assign-box,
.dash-assign-box * {
  /* only when on colored gradient — parity sets white; reinforce */
}
.qx-home .dash-greet-bar[style*="gradient"] h1,
.qx-home .dash-greet-bar.qx-grad h1 {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}

/* ========== Track switchers (Eng / Med / NDA / Academic) ========== */
html[data-theme="light"] .qx-top-exam:not(.on),
html[data-theme="light"] .qx-marks-track-switch .qx-top-exam:not(.on),
html[data-theme="light"] .qx-home-exams .qx-top-exam:not(.on),
html[data-theme="light"] .qx-side-exams .qx-top-exam:not(.on),
html[data-theme="light"] #qxTopExams .qx-top-exam:not(.on),
html[data-theme="light"] #qxSideExams .qx-top-exam:not(.on),
html[data-theme="light"] .marks-exam-switch .qx-top-exam:not(.on),
html[data-theme="light"] .qx-class-chip:not(.on) {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html[data-theme="dark"] .qx-top-exam:not(.on),
html[data-theme="dark"] .qx-marks-track-switch .qx-top-exam:not(.on),
html[data-theme="dark"] .qx-home-exams .qx-top-exam:not(.on),
html[data-theme="dark"] .qx-side-exams .qx-top-exam:not(.on),
html[data-theme="dark"] #qxTopExams .qx-top-exam:not(.on),
html[data-theme="dark"] #qxSideExams .qx-top-exam:not(.on),
html[data-theme="dark"] .marks-exam-switch .qx-top-exam:not(.on),
html[data-theme="dark"] .qx-class-chip:not(.on) {
  color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Solid filled chips → white ink OK */
.qx-top-exam.on,
.qx-class-chip.on {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}
/* Home / active nav sits on pale primary-light — NEVER white-on-pale */
html[data-theme="light"] .nav-item.active,
html:not([data-theme="dark"]) .nav-item.active {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html[data-theme="dark"] .nav-item.active {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  opacity: 1 !important;
  visibility: visible !important;
}
/* Sidebar chrome links (Home / Get the app) + soft Home buttons */
html[data-theme="light"] .back-link,
html:not([data-theme="dark"]) .back-link,
html[data-theme="light"] .btn-soft,
html:not([data-theme="dark"]) .btn-soft,
html[data-theme="light"] .empty .btn-soft,
html[data-theme="light"] .qx-nav-back {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
html[data-theme="light"] .back-link { color: #0f766e !important; -webkit-text-fill-color: #0f766e !important; }
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .btn-soft,
html[data-theme="dark"] .empty .btn-soft,
html[data-theme="dark"] .qx-nav-back {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .back-link { color: #5eead4 !important; -webkit-text-fill-color: #5eead4 !important; }

/* ========== Course / folder / chapter lists ========== */
html[data-theme="light"] .qx-folder-card,
html[data-theme="light"] .qx-folder-title,
html[data-theme="light"] .qx-folder-sub,
html[data-theme="light"] .qx-topic-card,
html[data-theme="light"] .qx-topic-name,
html[data-theme="light"] .qx-topic-body strong,
html[data-theme="light"] .qx-topic-body small,
html[data-theme="light"] .ch-card,
html[data-theme="light"] .ch-card strong,
html[data-theme="light"] .ch-card small,
html[data-theme="light"] .subj-card:not(.qx-fc-folder) strong,
html[data-theme="light"] .subj-mini,
html[data-theme="light"] .subj-mini strong,
html[data-theme="light"] .exam-pill-card,
html[data-theme="light"] .exam-pill-card strong,
html[data-theme="light"] .exam-pill-card small,
html[data-theme="light"] .cpyqb-exam-tile,
html[data-theme="light"] .cpyqb-exam-tile strong,
html[data-theme="light"] .mth-card,
html[data-theme="light"] .mth-body,
html[data-theme="light"] .mth-body strong,
html[data-theme="light"] .mth-body small,
html[data-theme="light"] .qx-adv-folder .qx-ch-body strong,
html[data-theme="light"] .qx-ncert-tool strong,
html[data-theme="light"] .marks-ts-section,
html[data-theme="light"] .marks-ts-section h3,
html[data-theme="light"] .marks-ts-sub,
html[data-theme="light"] .marks-tests-head h1,
html[data-theme="light"] .marks-sec-head h3 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
html[data-theme="light"] .qx-folder-sub,
html[data-theme="light"] .qx-topic-body small,
html[data-theme="light"] .ch-card small,
html[data-theme="light"] .exam-pill-card small,
html[data-theme="light"] .mth-body small,
html[data-theme="light"] .marks-ts-sub {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
}

html[data-theme="dark"] .qx-folder-card,
html[data-theme="dark"] .qx-folder-title,
html[data-theme="dark"] .qx-topic-card,
html[data-theme="dark"] .qx-topic-name,
html[data-theme="dark"] .qx-topic-body strong,
html[data-theme="dark"] .ch-card,
html[data-theme="dark"] .ch-card strong,
html[data-theme="dark"] .ch-card .qx-ch-body strong,
html[data-theme="dark"] .subj-card:not(.qx-fc-folder) strong,
html[data-theme="dark"] .subj-mini,
html[data-theme="dark"] .subj-mini strong,
html[data-theme="dark"] .exam-pill-card,
html[data-theme="dark"] .exam-pill-card strong,
html[data-theme="dark"] .cpyqb-exam-tile,
html[data-theme="dark"] .cpyqb-exam-tile strong,
html[data-theme="dark"] .mth-card,
html[data-theme="dark"] .mth-body,
html[data-theme="dark"] .mth-body strong,
html[data-theme="dark"] .qx-adv-folder .qx-ch-body strong,
html[data-theme="dark"] .qx-ncert-tool strong,
html[data-theme="dark"] .marks-ts-section,
html[data-theme="dark"] .marks-ts-section h3,
html[data-theme="dark"] .marks-tests-head h1,
html[data-theme="dark"] .marks-sec-head h3,
html[data-theme="dark"] .qx-ch-pill,
html[data-theme="dark"] .qx-topic-details {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-folder-sub,
html[data-theme="dark"] .qx-topic-body small,
html[data-theme="dark"] .ch-card small,
html[data-theme="dark"] .exam-pill-card small,
html[data-theme="dark"] .mth-body small,
html[data-theme="dark"] .marks-ts-sub,
html[data-theme="dark"] .qx-adv-levels-hint {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}

/* FC subject folders: light ink on tinted cards in light; light ink on dark cards */
html[data-theme="light"] .qx-fc-folder,
html[data-theme="light"] .qx-fc-folder strong,
html[data-theme="light"] .qx-fc-folder small,
html[data-theme="light"] .qx-fc-folder em {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-fc-folder,
html[data-theme="dark"] .qx-fc-folder strong,
html[data-theme="dark"] .qx-fc-folder small,
html[data-theme="dark"] .qx-fc-folder em,
html[data-theme="dark"] .subj-card.qx-fc-folder,
html[data-theme="dark"] .subj-card.qx-fc-folder strong {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  opacity: 1 !important;
}

/* ========== Digital books ========== */
html[data-theme="light"] .book-card,
html[data-theme="light"] .book-card strong,
html[data-theme="light"] .book-info strong,
html[data-theme="light"] .qx-book-card .book-info strong,
html[data-theme="light"] .qx-book-badge {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="light"] .book-card small,
html[data-theme="light"] .book-info small,
html[data-theme="light"] .qx-book-card .book-info small {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .book-card,
html[data-theme="dark"] .book-card strong,
html[data-theme="dark"] .book-info strong,
html[data-theme="dark"] .qx-book-card .book-info strong,
html[data-theme="dark"] .qx-book-badge {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="dark"] .book-card small,
html[data-theme="dark"] .book-info small,
html[data-theme="dark"] .qx-book-card .book-info small {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}
/* Cover overlays stay white on artwork */
.qx-cover-inner,
.qx-cover-inner *,
.qx-dash-fc-cover,
.qx-dash-fc-cover strong,
.qx-dash-fc-cover small,
.qx-dash-fc-cover em {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ========== Flashcards / RFC / formula cards ========== */
html[data-theme="light"] .qx-fc-designed .fc-meaning,
html[data-theme="light"] .qx-rfc-ch strong,
html[data-theme="light"] .qx-rfc-ch small,
html[data-theme="light"] .fc-card,
html[data-theme="light"] .qx-fc-page {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="light"] .qx-rfc-ch small {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-fc-designed .fc-meaning,
html[data-theme="dark"] .qx-rfc-ch strong,
html[data-theme="dark"] .fc-card,
html[data-theme="dark"] .qx-fc-page,
html[data-theme="dark"] .qx-fc-designed.fc-card {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
html[data-theme="dark"] .qx-rfc-ch small,
html[data-theme="dark"] .qx-fc-designed .fc-meaning {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}
/* Gradient FC tiles keep white labels */
.qx-fc-tile strong,
.qx-fc-nav-btn,
.qx-fc-nav-next {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ========== Summary notes dark ink fixes ========== */
html[data-theme="dark"] .qx-sum-compare-eq {
  color: #e2e8f0 !important; /* was incorrectly #0f172a in dark */
  -webkit-text-fill-color: #e2e8f0 !important;
}
html[data-theme="light"] .qx-sum-compare-eq {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="dark"] .qx-sum-section,
html[data-theme="dark"] .qx-sum-points li,
html[data-theme="dark"] .qx-sum-para,
html[data-theme="dark"] .qx-sum-bullets,
html[data-theme="dark"] .qx-sum-def p,
html[data-theme="dark"] .qx-sum-method-body p,
html[data-theme="dark"] .qx-mu-card-h h3 {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  opacity: 1 !important;
}

/* ========== Medical / NDA / Academic shells ========== */
html[data-theme="dark"] .qx-med-test-card strong,
html[data-theme="dark"] .qx-med-nb-card strong,
html[data-theme="dark"] .qx-med-subj-card strong,
html[data-theme="dark"] .qx-med-rev-card strong,
html[data-theme="dark"] .qx-med-goal,
html[data-theme="dark"] .qx-med-goal strong,
html[data-theme="dark"] .qx-med-util {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="dark"] .qx-med-rev-card small,
html[data-theme="dark"] .qx-med-test-card small,
html[data-theme="dark"] .qx-med-nb-card small,
html[data-theme="dark"] .qx-med-subj-card small {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .qx-med-test-card strong,
html[data-theme="light"] .qx-med-nb-card strong,
html[data-theme="light"] .qx-med-subj-card strong {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="dark"] .qx-med-util {
  background: #1e293b !important;
  border-color: #475569 !important;
}

/* ========== Bookmark drawer ========== */
html[data-theme="dark"] .qx-bm-drawer {
  background: #0f172a !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .qx-bm-drawer-head,
html[data-theme="dark"] .qx-bm-drawer-foot {
  border-color: #334155 !important;
}
html[data-theme="dark"] .qx-bm-drawer-head h3,
html[data-theme="dark"] .qx-bm-quick-title,
html[data-theme="dark"] .qx-bm-groups-title,
html[data-theme="dark"] .qx-bm-drawer-row-title,
html[data-theme="dark"] .qx-bm-name-input {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="dark"] .qx-bm-drawer-head p,
html[data-theme="dark"] .qx-bm-quick-desc,
html[data-theme="dark"] .qx-bm-quick-path-label {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
}
html[data-theme="dark"] .qx-bm-drawer-close {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
html[data-theme="dark"] .qx-bm-drawer-close:hover {
  background: #334155 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .qx-bm-quick {
  background: linear-gradient(180deg, #1e3a8a 0%, #0f172a 100%) !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .qx-bm-quick-path,
html[data-theme="dark"] .qx-bm-drawer-row,
html[data-theme="dark"] .qx-bm-name-input {
  background: #1e293b !important;
  border-color: #475569 !important;
  color: #f8fafc !important;
}
html[data-theme="dark"] .qx-bm-drawer-row:hover {
  background: #243044 !important;
  border-color: #60a5fa !important;
}
html[data-theme="light"] .qx-bm-drawer,
html[data-theme="light"] .qx-bm-drawer-head h3,
html[data-theme="light"] .qx-bm-quick-title,
html[data-theme="light"] .qx-bm-groups-title {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

/* ========== Settings (reinforce qx-settings.js inline) ========== */
html[data-theme="light"] .qx-settings-page .qx-set-head h1,
html[data-theme="light"] .qx-settings-page .qx-set-lab,
html[data-theme="light"] .qx-set-profile-panel h2,
html[data-theme="light"] .qx-set-exam-sec h2,
html[data-theme="light"] .qx-set-exam-card strong {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="light"] .qx-set-seg button.on,
html[data-theme="dark"] .qx-set-seg button.on {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  background: #2563eb !important;
}
html[data-theme="dark"] .qx-settings-page,
html[data-theme="dark"] .qx-settings-page .qx-set-head h1,
html[data-theme="dark"] .qx-settings-page .qx-set-lab,
html[data-theme="dark"] .qx-set-profile-panel h2,
html[data-theme="dark"] .qx-set-exam-sec h2,
html[data-theme="dark"] .qx-set-exam-card strong {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="dark"] .qx-set-exam-sec .qx-set-exam-sub,
html[data-theme="dark"] .qx-set-form label,
html[data-theme="light"] .qx-set-exam-sec .qx-set-exam-sub {
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-set-exam-sec .qx-set-exam-sub,
html[data-theme="dark"] .qx-set-form label {
  color: #cbd5e1 !important;
}

/* ========== Login shell (when linked) ========== */
html[data-theme="light"] .auth-shell,
html[data-theme="light"] .cat .lab,
html[data-theme="light"] .brand,
html[data-theme="light"] .auth-tab,
html[data-theme="light"] .lead {
  /* vars already theme-aware; force opacity */
  opacity: 1 !important;
  visibility: visible !important;
}
html[data-theme="dark"] .auth-shell,
html[data-theme="dark"] .cat .lab,
html[data-theme="dark"] .brand {
  color: #eef3fb !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .lead,
html[data-theme="dark"] .hint,
html[data-theme="dark"] .cat .sub,
html[data-theme="dark"] .auth-hint {
  color: #8fa3c0 !important;
  opacity: 1 !important;
}

/* ========== Jovi ========== */
html[data-theme="light"] .jovi-panel,
html[data-theme="light"] .jovi-bubble.bot,
html[data-theme="light"] .jovi-compose textarea,
html[data-theme="light"] .jovi-inline-head,
html[data-theme="light"] .jovi-bubble .jovi-hit {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="light"] .jovi-bubble .jovi-hit small,
html[data-theme="light"] .jovi-inline-head small {
  color: #475569 !important;
  -webkit-text-fill-color: #475569 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .jovi-panel,
html[data-theme="dark"] .jovi-bubble.bot,
html[data-theme="dark"] .jovi-compose,
html[data-theme="dark"] .jovi-tools,
html[data-theme="dark"] .jovi-compose textarea,
html[data-theme="dark"] .jovi-chip,
html[data-theme="dark"] .jovi-bubble .jovi-hit,
html[data-theme="dark"] .jovi-lang-row select,
html[data-theme="dark"] .jovi-inline-head {
  color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .jovi-bubble .jovi-hit small,
html[data-theme="dark"] .jovi-inline-head small {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}
.jovi-bubble.user,
.jovi-send,
.jovi-fab,
.jovi-agent-bar {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* ========== Examgoal-parity shells (had ZERO dark rules) ========== */
html[data-theme="dark"] .egmq-card,
html[data-theme="dark"] .egmq-panel,
html[data-theme="dark"] .qx-best-panel,
html[data-theme="dark"] .qx-best-scroll,
html[data-theme="dark"] .qx-best-foot,
html[data-theme="dark"] .qx-best-tools,
html[data-theme="dark"] .eg-home-card,
html[data-theme="dark"] .eg-dash-card {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .egmq-card,
html[data-theme="dark"] .egmq-card strong,
html[data-theme="dark"] .egmq-title,
html[data-theme="dark"] .qx-best-q,
html[data-theme="dark"] .qx-best-opt,
html[data-theme="dark"] .qx-best-opt .qx-content,
html[data-theme="dark"] .qx-best-scroll,
html[data-theme="dark"] .qx-best-scroll *:not(img):not(svg):not(path):not(.qx-opt-circle):not(.mtk-opt-letter) {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
html[data-theme="dark"] .qx-best-opt {
  background: #1e293b !important;
  border-color: #475569 !important;
}
html[data-theme="dark"] .qx-best-btn:not(.primary):not(.qx-best-next) {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
html[data-theme="light"] .qx-best-q,
html[data-theme="light"] .qx-best-opt,
html[data-theme="light"] .egmq-card,
html[data-theme="light"] .egmq-card strong {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="dark"] .qx-best-tab,
html[data-theme="dark"] .qx-best-more {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .qx-best-tab {
  color: #475569 !important;
  opacity: 1 !important;
}

/* ========== Live purchases / notifs / profile ========== */
html[data-theme="dark"] .qx-live-where,
html[data-theme="dark"] .qx-notif-item span,
html[data-theme="dark"] .qx-notif-item em,
html[data-theme="dark"] .qx-notif-empty,
html[data-theme="dark"] .qx-prof-card p {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .qx-live-where,
html[data-theme="light"] .qx-notif-item span,
html[data-theme="light"] .qx-prof-card p {
  color: #475569 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-prof-card,
html[data-theme="dark"] .qx-prof-card h3 {
  color: #f8fafc !important;
}

/* ========== Modals / chips / muted labels (generic) ========== */
html[data-theme="light"] .marks-modal,
html[data-theme="light"] .marks-modal h3,
html[data-theme="light"] .marks-modal-cancel,
html[data-theme="light"] .marks-modal-apply,
html[data-theme="light"] .pyqmock-year-select,
html[data-theme="light"] .chip:not(.active),
html[data-theme="light"] .tag-chapter {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="dark"] .marks-modal,
html[data-theme="dark"] .marks-modal h3,
html[data-theme="dark"] .pyqmock-year-select,
html[data-theme="dark"] .chip:not(.active),
html[data-theme="dark"] .tag-chapter,
html[data-theme="dark"] .ct-wiz-next-btn {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="dark"] .marks-modal {
  background: #0f172a !important;
  border-color: #334155 !important;
}
html[data-theme="dark"] .marks-modal-cancel,
html[data-theme="dark"] .marks-modal-apply,
html[data-theme="dark"] .ct-wiz-next-btn {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
.chip.active,
.ei-cat-tab.on,
.eg-chip.on {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Muted labels: never opacity < 0.5 on text */
html[data-theme="light"] .muted,
html[data-theme="light"] .text-muted,
html[data-theme="light"] .qx-muted,
html[data-theme="light"] small.muted,
html[data-theme="light"] .meta-label {
  color: #475569 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .muted,
html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .qx-muted,
html[data-theme="dark"] small.muted,
html[data-theme="dark"] .meta-label {
  color: #cbd5e1 !important;
  opacity: 1 !important;
}

/* ========== Theme mismatch: site dark + test light (and reverse) ========== */
html[data-theme="dark"] .eg-test-root[data-test-theme="light"] .eg-q-stem,
html[data-theme="dark"] .eg-test-root[data-test-theme="light"] .mtk-q-text,
html[data-theme="dark"] .eg-test-root[data-test-theme="light"] .mtk-opt-text,
html[data-theme="dark"] .mtk-test-root[data-test-theme="light"] .mtk-q-text,
html[data-theme="dark"] .mtk-test-root[data-test-theme="light"] .mtk-opt-text {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="light"] .eg-test-root[data-test-theme="dark"] .eg-q-stem,
html[data-theme="light"] .eg-test-root[data-test-theme="dark"] .mtk-q-text,
html[data-theme="light"] .eg-test-root[data-test-theme="dark"] .mtk-opt-text,
html[data-theme="light"] .mtk-test-root[data-test-theme="dark"] .mtk-q-text,
html[data-theme="light"] .mtk-test-root[data-test-theme="dark"] .mtk-opt-text {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/* ========== Disabled controls may dim; text content never < 0.55 ========== */
button:disabled,
.eg-btn:disabled,
.qx-best-btn:disabled {
  opacity: 0.55 !important;
}
p, span, strong, small, label, h1, h2, h3, h4, li, td, th,
.qx-content, .mtk-opt-text, .eg-q-stem, .katex {
  /* do not globally force — only catch pathological low opacity on ink */
}


/* === qxvis4 shell chrome === */
html[data-theme="light"] .eg-test-root,
html[data-theme="light"] .mtk-test-root,
html:not([data-theme="dark"]) .eg-test-root,
html:not([data-theme="dark"]) .mtk-test-root {
  color: #0f172a;
}
html[data-theme="dark"] .eg-test-root,
html[data-theme="dark"] .mtk-test-root {
  color: #f8fafc;
}
html[data-theme="light"] .eg-test-root .mtk-q-text,
html[data-theme="light"] .eg-test-root .mtk-opt,
html[data-theme="light"] .mtk-test-root .mtk-q-text,
html[data-theme="light"] .mtk-test-root .mtk-opt,
html[data-theme="light"] .eg-opt,
html[data-theme="light"] .eg-stem {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .eg-test-root .mtk-q-text,
html[data-theme="dark"] .eg-test-root .mtk-opt,
html[data-theme="dark"] .mtk-test-root .mtk-q-text,
html[data-theme="dark"] .mtk-test-root .mtk-opt,
html[data-theme="dark"] .eg-opt,
html[data-theme="dark"] .eg-stem {
  color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  opacity: 1 !important;
}

/* qxmd293 — MARKS keeps stem visible. Do not smash #egQArea * / .katex. */
html .eg-test-root .eg-stem-sol-hidden,
html .eg-test-root .qx-stem-sol-hidden,
html .eg-stem-sol-hidden,
html .qx-stem-sol-hidden {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}

/* Solution math readable in both themes */
html[data-theme="dark"] .eg-sol-panel,
html[data-theme="dark"] .qx-sol-card,
html[data-theme="dark"] .qx-sol-reveal-box,
html[data-theme="dark"] .mk-sol-row .qx-sol-card,
html .eg-test-root[data-test-theme="dark"] .eg-sol-panel,
html .eg-test-root[data-test-theme="dark"] .qx-sol-card,
html .mtk-test-root[data-test-theme="dark"] .qx-sol-card {
  color: #e2e8f0;
}
html[data-theme="dark"] .eg-sol-panel .katex,
html[data-theme="dark"] .qx-sol-card .katex,
html[data-theme="dark"] .qx-sol-reveal-box .katex,
html .eg-test-root[data-test-theme="dark"] .eg-sol .katex,
html .mtk-test-root[data-test-theme="dark"] .qx-sol-card .katex {
  color: #f1f5f9 !important;
}
html[data-theme="light"] .eg-sol-panel,
html[data-theme="light"] .qx-sol-card,
html[data-theme="light"] .qx-sol-reveal-box,
html .eg-test-root[data-test-theme="light"] .eg-sol-panel,
html .mtk-test-root[data-test-theme="light"] .qx-sol-card {
  color: #0f172a;
}
html[data-theme="light"] .eg-sol-panel .katex,
html[data-theme="light"] .qx-sol-card .katex,
html .eg-test-root[data-test-theme="light"] .eg-sol .katex {
  color: #0f172a !important;
}


/* qxmd165-home-polish: dashboard / home attractive in dark + light */
html[data-theme="dark"] .qx-guest-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a5f) !important;
  border-color: rgba(96,165,250,.35) !important;
  color: #e2e8f0 !important;
}
html[data-theme="dark"] .qx-guest-banner.urgent {
  background: linear-gradient(135deg, #1c1917, #422006) !important;
  border-color: rgba(251,191,36,.4) !important;
}
html[data-theme="dark"] .qx-guest-banner-btn { color: #93c5fd !important; }
html[data-theme="light"] .qx-guest-banner {
  background: linear-gradient(135deg, #ecfdf5, #e0f2fe);
  border-color: #99f6e4;
  color: #0f172a;
}
html[data-theme="dark"] .dash-board-hero-text p { color: #94a3b8 !important; }
html[data-theme="dark"] .dash-board-hero-top:hover { background: rgba(148,163,184,.12) !important; }
html[data-theme="dark"] .dash-board-go { color: #93c5fd !important; }
html[data-theme="dark"] .dash-greet-left h1 { color: #f8fafc !important; }
html[data-theme="dark"] .dash-greet-left p { color: #94a3b8 !important; }
html[data-theme="light"] .dash-board-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%);
  border-color: rgba(30,58,138,.15);
}
html[data-theme="light"] .dash-board-hero-text h3 { color: #1e3a8a; }
html[data-theme="light"] .dash-board-hero-text p { color: #475569; }
html[data-theme="dark"] .dash-tool-card {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}
html[data-theme="dark"] .dash-tool-card small { color: #94a3b8; }
html[data-theme="dark"] .dash-tool-card:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 22px rgba(37,99,235,.25);
}
html[data-theme="light"] .dash-tool-card {
  background: var(--card, #fff);
  border-color: var(--border, #e2e8f0);
}
/* Soft section breathing room on home */
.dash-marks-wrap .dash-greet-bar { margin-bottom: 18px; }
.dash-marks-wrap .dash-board-block { margin-bottom: 20px; }


/* ========== qxmd167: uniform Quantrex colour tokens (final authority) ========== */
html[data-theme="light"],
html:not([data-theme="dark"]) {
  --primary: #0b57d0;
  --primary-dark: #0842a0;
  --primary-light: #d3e3fd;
  --accent: #0b57d0;
  --accent-light: #d3e3fd;
  --qx-primary: #0b57d0;
  --qx-accent: #1565c0;
  --qx-ink: #0f172a;
  --qx-ink-muted: #334155;
  --qx-surface: #ffffff;
  --qx-surface-2: #f0f4f9;
  --qx-line: #e2e8f0;
  --qx-radius-card: 12px;
  --qx-radius-btn: 10px;
  --qx-radius-pill: 999px;
  --qx-gradient: linear-gradient(135deg, #0b57d0 0%, #8ab4f8 100%);
  --bg: #f0f4f9;
  --card: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --dark: #0f172a;
  --gray: #475569;
}
html[data-theme="dark"] {
  --primary: #8ab4f8;
  --primary-dark: #a8c7fa;
  --primary-light: #3d4f66;
  --accent: #8ab4f8;
  --accent-light: #3d4f66;
  --qx-primary: #8ab4f8;
  --qx-accent: #a8c7fa;
  --qx-ink: #f8fafc;
  --qx-ink-muted: #cbd5e1;
  --qx-surface: #0f172a;
  --qx-surface-2: #1e293b;
  --qx-line: #334155;
  --qx-radius-card: 12px;
  --qx-radius-btn: 10px;
  --qx-radius-pill: 999px;
  --qx-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  --bg: #0b1120;
  --card: #0f172a;
  --border: #334155;
  --text: #f8fafc;
  --dark: #f8fafc;
  --gray: #94a3b8;
}

/* Shared button / card chrome — home + shell (Med + Eng share) */
.btn-primary, .btn-primary.big, .mtk-btn-save, .qx-prac-next,
.eg-btn-next, .eg-check, .marks-modal-apply {
  border-radius: var(--qx-radius-btn, 10px) !important;
}
.dash-card, .book-card, .qx-book-card, .subj-card, .ch-card, .exam-card,
.exam-pill-card, .cpyqb-exam-tile, .dash-tool-card, .dpp-set-card,
.qx-module-card, .qx-folder-card, .qx-topic-card, .dash-util-card,
.qx-med-test-card, .qx-med-nb-card {
  border-radius: var(--qx-radius-card, 12px) !important;
  border-color: var(--qx-line, var(--border)) !important;
}
html[data-theme="light"] .dash-card,
html[data-theme="light"] .dash-tool-card,
html[data-theme="light"] .exam-pill-card,
html[data-theme="light"] .qx-folder-card,
html[data-theme="light"] .ch-card,
html[data-theme="light"] .qx-module-card {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="dark"] .dash-card,
html[data-theme="dark"] .dash-tool-card,
html[data-theme="dark"] .exam-pill-card,
html[data-theme="dark"] .qx-folder-card,
html[data-theme="dark"] .ch-card,
html[data-theme="dark"] .qx-module-card,
html[data-theme="dark"] .qx-med-test-card,
html[data-theme="dark"] .qx-med-nb-card {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}

/* Pro homepage / guest shell */
html[data-theme="light"] .qx-guest-banner {
  background: linear-gradient(135deg, #eff6ff, #e0f2fe) !important;
  border: 1px solid #bfdbfe !important;
  color: #0f172a !important;
  border-radius: 14px !important;
}
html[data-theme="dark"] .qx-guest-banner {
  background: linear-gradient(135deg, #0f172a, #1e3a5f) !important;
  border: 1px solid rgba(96,165,250,.35) !important;
  color: #e2e8f0 !important;
  border-radius: 14px !important;
}
html[data-theme="light"] .dash-board-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 55%, #e0f2fe 100%) !important;
  border: 1px solid rgba(11,87,208,.18) !important;
  border-radius: 16px !important;
}
html[data-theme="dark"] .dash-board-hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%) !important;
  border: 1px solid rgba(96,165,250,.25) !important;
  border-radius: 16px !important;
}
html[data-theme="light"] .dash-board-hero-text h3 { color: #0842a0 !important; }
html[data-theme="dark"] .dash-board-hero-text h3 { color: #93c5fd !important; }
html[data-theme="light"] .dash-greet-left h1 { color: #0f172a !important; }
html[data-theme="dark"] .dash-greet-left h1 { color: #f8fafc !important; }

/* Nav / chips: kill leftover teal/violet clash */
.nav-item.active,
html[data-theme="light"] .nav-item.active {
  background: #d3e3fd !important;
  color: #0842a0 !important;
  box-shadow: inset 3px 0 0 #0b57d0 !important;
}
html[data-theme="dark"] .nav-item.active {
  background: #1e3a5f !important;
  color: #8ab4f8 !important;
  box-shadow: inset 3px 0 0 #8ab4f8 !important;
}
.qx-top-exam.on,
.qx-class-chip.on {
  background: #0b57d0 !important;
  color: #fff !important;
  border-color: #0b57d0 !important;
}
html[data-theme="dark"] .qx-top-exam.on,
html[data-theme="dark"] .qx-class-chip.on {
  background: #1d4ed8 !important;
  color: #fff !important;
}

/* Practice Answer badge / Check — Quantrex blue family */
.eg-test-root .eg-check,
.eg-test-root.eg-qxtool8 .eg-check {
  border-radius: 10px !important;
}
.qx-ans-badge, .eg-sol-ans, .qx-sol-ans-pill {
  border-radius: 999px !important;
}

/* Toolbar icons: consistent hit + contrast */
.eg-test-root .eg-top-tools .eg-tool-btn {
  border-radius: 10px !important;
}
html .eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-tool-btn {
  color: #e2e8f0;
}
html .eg-test-root[data-test-theme="light"] .eg-top-tools .eg-tool-btn {
  color: #0f172a;
}

/* Align Examgoal chrome primary with Quantrex blue (Med + Eng share) */
.eg-test-root,
.eg-test-root.mtk-test-root {
  --eg-blue: #0b57d0;
  --eg-blue-2: #2563eb;
  --eg-header: #0b57d0;
  --eg-tab: #2563eb;
  --eg-tab-on: #0842a0;
  --eg-opt-letter: #0b57d0;
}
.eg-test-root[data-test-theme="dark"],
.eg-test-root.mtk-test-root[data-test-theme="dark"] {
  --eg-header: #1e3a8a;
  --eg-tab: #1e40af;
  --eg-tab-on: #172554;
  --eg-opt-letter: #8ab4f8;
}

/* Speed: palette / theme / All-Q stay CSS-instant (no heavy transition thrash) */
.eg-test-root .eg-side,
.eg-test-root .eg-qbar,
.eg-test-root .eg-preview {
  transition: transform 0.14s ease, opacity 0.12s ease !important;
}
.eg-test-root.eg-side-collapsed .eg-side,
.eg-test-root:not(.eg-side-open) .eg-side {
  /* class toggles only — no JS rebuild */
}

/* Soft section breathing on home */
.dash-marks-wrap .dash-greet-bar { margin-bottom: 18px; }
.dash-marks-wrap .dash-board-block { margin-bottom: 20px; }
.qx-home .content, #app-main .qx-home { max-width: 1100px; }


/* qxmd167-orbit-logos: homepage track badges always visible */
.cat img, .stage-hub img.qx-ui-brand-logo, .brand-mark img.qx-ui-brand-logo {
  background: #ffffff !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
  -webkit-filter: none !important;
}


/* qxmd167-home-uniform: kill leftover multi-hue clash on dash hero/greet */
html[data-theme="dark"] .dash-greet-bar,
html[data-theme="dark"] .qx-home .dash-greet-bar {
  background: linear-gradient(135deg, #0b57d0 0%, #1e3a8a 55%, #0f172a 100%) !important;
}
html[data-theme="light"] .dash-greet-bar,
html[data-theme="light"] .qx-home .dash-greet-bar {
  background: linear-gradient(135deg, #0b57d0 0%, #2563eb 60%, #1d4ed8 100%) !important;
  color: #fff !important;
}
html .dash-greet-bar h1,
html .dash-greet-bar p,
html .dash-greet-left h1,
html .dash-greet-bar .dash-greet-left h1 {
  /* greet sits on blue gradient — keep white ink */
}
.qx-home .dash-greet-bar h1,
.qx-home .dash-greet-bar p,
.dash-greet-bar h1,
.dash-greet-bar p {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.qx-premium-pill, .dash-premium-btn, .dash-greet-bar .qx-premium-pill {
  background: linear-gradient(135deg, #0b57d0, #2563eb) !important;
  color: #fff !important;
  border: none !important;
}
/* Update toast buttons — Quantrex blue, not yellow clash */
#updateBanner .btn-primary,
.pwa-update-toast button.primary,
.qx-update-bar .btn-primary {
  background: #0b57d0 !important;
  color: #fff !important;
}


/* ========== qxmd171 Settings sections (desktop + mobile) ========== */
html[data-theme="light"] .qx-settings-page .qx-set-sec-h,
html[data-theme="light"] .qx-settings-page .qx-set-brand {
  color: #2563eb !important;
  -webkit-text-fill-color: #2563eb !important;
}
html[data-theme="dark"] .qx-settings-page .qx-set-sec-h,
html[data-theme="dark"] .qx-settings-page .qx-set-brand {
  color: #60a5fa !important;
  -webkit-text-fill-color: #60a5fa !important;
}
html[data-theme="light"] .qx-settings-page .qx-set-hint,
html[data-theme="light"] .qx-settings-page .qx-set-sec-sub {
  color: #64748b !important;
}
html[data-theme="dark"] .qx-settings-page .qx-set-hint,
html[data-theme="dark"] .qx-settings-page .qx-set-sec-sub {
  color: #94a3b8 !important;
}
html[data-theme="light"] .qx-set-seg button.on,
html[data-theme="dark"] .qx-set-seg button.on {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
html[data-theme="light"] .qx-set-exam-card.on {
  border-color: #2563eb !important;
}
html[data-theme="dark"] .qx-settings-page .qx-set-sec {
  background: #111827 !important;
  border-color: #1e293b !important;
}
html[data-theme="light"] .qx-settings-page .qx-set-sec {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}



/* qxmd293: leftover qxmd179 hide class must not blank stem/options. */
html .eg-test-root.eg-sol-showing.eg-qxmd179 #egQArea,
html .eg-test-root.eg-sol-showing.eg-qxmd179 .eg-q-stem,
html .eg-test-root.eg-qxmd179 .eg-stem-sol-hidden {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* qxmd259: course labels stay readable, not the same ink as the card fill */
html[data-theme="light"] .qx-desk-grid span,
html[data-theme="light"] .qx-course-row span,
html[data-theme="light"] .qx-course-box p {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  opacity: 1 !important;
}
html[data-theme="light"] .qx-course-row b,
html[data-theme="light"] .qx-desk-grid b,
html[data-theme="light"] .qx-course-box h3 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
html[data-theme="dark"] .qx-desk-grid span,
html[data-theme="dark"] .qx-course-row span,
html[data-theme="dark"] .qx-course-box p {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1 !important;
  opacity: 1 !important;
}
html[data-theme="dark"] .qx-course-row b,
html[data-theme="dark"] .qx-desk-grid b,
html[data-theme="dark"] .qx-course-box h3 {
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
}
html[data-theme="light"] .qx-course-box,
html[data-theme="light"] .qx-course-row {
  background: #ffffff !important;
  color: #0f172a !important;
}
html[data-theme="dark"] .qx-course-box,
html[data-theme="dark"] .qx-course-row {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #475569 !important;
}
.qx-course-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; }
.qx-course-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; }
.qx-course-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; background: #fff; border-radius: 10px; }

/* qxmd309: login header (brand + JEE/Maths/NEET chips + theme) overflowed to the right on phones -> wrap */
@media (max-width: 480px) {
  html body > header.top:has(#themeToggle) { flex-wrap: wrap !important; row-gap: 8px !important; }
  html body > header.top:has(#themeToggle) > div { flex-wrap: wrap !important; justify-content: flex-end !important; gap: 6px !important; min-width: 0 !important; max-width: 100% !important; margin-left: auto !important; }
  html body > header.top:has(#themeToggle) > div > a { padding: 5px 10px !important; font-size: 11.5px !important; }
  /* orbit nodes (Defence / Engineering) and their captions were cut by clip-path at the stage edge */
  html body .qx-login-shell .hero .stage { clip-path: none !important; }
  html body .qx-login-shell .hero .stage { margin-top: 18px !important; margin-bottom: 18px !important; }
  html body .qx-login-shell .hero .stage .cat .sub { display: none !important; }
}
