/* qxmd207 one-strip Previous | Check Answer | Next */
.eg-test-root #egFoot, .eg-test-root .eg-foot,
.eg-test-root .eg-foot-practice, .eg-test-root .eg-foot-marks {
  display: grid !important;
  grid-template-columns: 1fr 1.25fr 1fr !important;
  flex-direction: row !important;
  background: #ffffff !important;
  z-index: 2147483646 !important;
}
.eg-test-root[data-eg-mode="practice"] .eg-top-tools .eg-tool-btn,
.eg-test-root[data-eg-mode="practice"] .eg-top-tools .eg-ico {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  left: auto !important;
  width: 38px !important;
  height: 38px !important;
  min-width: 38px !important;
  min-height: 38px !important;
  pointer-events: auto !important;
}
.eg-test-root .eg-foot-extra, .eg-test-root #egFootExtra, .eg-test-root .eg-foot-left, .eg-test-root label.eg-show {
  display: none !important;
  height: 0 !important;
  overflow: hidden !important;
}
.eg-test-root #qxPrevBtn, .eg-test-root #egCheckBtn, .eg-test-root #qxNextBtn {
  display: inline-flex !important; visibility: visible !important; opacity: 1 !important; min-height: 48px !important;
}
.eg-test-root #qxPrevBtn,
.eg-test-root #qxNextBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 48px !important;
}

/* Readable type: no letter-spaced dumps, consistent size */
.eg-test-root #egQArea,
.eg-test-root .eg-q-stem,
.eg-test-root .mtk-opt-text,
.eg-test-root .eg-sol,
.eg-test-root .sol-body,
.eg-test-root .qx-sol-flow {
  letter-spacing: normal !important;
  word-spacing: normal !important;
  white-space: normal !important;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif !important;
  font-size: var(--nta-q, 16px) !important;
  line-height: 1.65 !important;
}
.eg-test-root #egQArea .katex,
.eg-test-root .eg-q-stem .katex,
.eg-test-root .mtk-opt-text .katex,
.eg-test-root .eg-sol .katex,
.eg-test-root .sol-body .katex,
.eg-test-root .qx-sol-flow .katex,
.eg-test-root .katex {
  font-family: KaTeX_Main, "Times New Roman", serif !important;
  font-size: 1.08em !important;
  letter-spacing: normal !important;
}
.eg-test-root .katex-error,
.eg-test-root .katex-error * {
  display: none !important;
}

/* Number strip must NOT cover options. Hidden unless All Q is on. */
.eg-test-root .eg-qbar,
.eg-test-root .eg-qbar.eg-strip,
.eg-test-root #egQBar,
.eg-test-root.eg-strip-collapsed .eg-qbar,
.eg-test-root:not(.eg-strip-open) .eg-qbar,
.eg-test-root:not(.eg-strip-open) #egQBar {
  display: none !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.eg-test-root.eg-strip-open .eg-qbar,
.eg-test-root.eg-strip-open #egQBar {
  display: flex !important;
  height: auto !important;
  max-height: 72px !important;
  overflow-x: auto !important;
  pointer-events: auto !important;
}
.eg-test-root .eg-opts,
.eg-test-root #qxOpts {
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 2 !important;
}
.eg-test-root .mtk-opt,
.eg-test-root .eg-opt {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 2 !important;
}

/* Light + dark: stem, options, icons, solution always visible. Load last. */

.eg-test-root .eg-q-stem,
.eg-test-root #egQArea,
.eg-test-root .eg-opts,
.eg-test-root #qxOpts,
.eg-test-root .mtk-opt,
.eg-test-root .eg-opt,
.eg-test-root [data-opt],
.eg-test-root .mtk-opt-text,
.eg-test-root .eg-sol,
.eg-test-root .eg-sol-panel,
.eg-test-root .eg-top-tools,
.eg-test-root .eg-top-tools .eg-tool-btn,
.eg-test-root .eg-top-tools .eg-ico {
  visibility: visible !important;
  opacity: 1 !important;
}

/* LIGHT */
.eg-test-root[data-test-theme="light"] .eg-q-card,
.eg-test-root[data-test-theme="light"] .eg-main {
  background: #ffffff !important;
}
.eg-test-root[data-test-theme="light"] .eg-q-stem,
.eg-test-root[data-test-theme="light"] #egQArea,
.eg-test-root[data-test-theme="light"] .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .eg-sol,
.eg-test-root[data-test-theme="light"] .eg-sol .qx-content,
.eg-test-root[data-test-theme="light"] .katex,
.eg-test-root[data-test-theme="light"] .katex * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt,
.eg-test-root[data-test-theme="light"] .eg-opt,
.eg-test-root[data-test-theme="light"] [data-opt] {
  display: flex !important;
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-right,
.eg-test-root[data-test-theme="light"] .mtk-opt.correct {
  background: #dcfce7 !important;
  border-color: #16a34a !important;
  color: #14532d !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-right .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .mtk-opt.correct .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-right .katex,
.eg-test-root[data-test-theme="light"] .mtk-opt.correct .katex,
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-right .katex * {
  color: #14532d !important;
  -webkit-text-fill-color: #14532d !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-wrong,
.eg-test-root[data-test-theme="light"] .mtk-opt.wrong {
  background: #fee2e2 !important;
  border-color: #dc2626 !important;
  color: #7f1d1d !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-wrong .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .mtk-opt.wrong .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .mtk-opt.eg-opt-wrong .katex,
.eg-test-root[data-test-theme="light"] .mtk-opt.wrong .katex * {
  color: #7f1d1d !important;
  -webkit-text-fill-color: #7f1d1d !important;
}

/* DARK */
.eg-test-root[data-test-theme="dark"] .eg-q-card,
.eg-test-root[data-test-theme="dark"] .eg-main,
.eg-test-root[data-test-theme="dark"] .eg-body {
  background: #0f172a !important;
}
.eg-test-root[data-test-theme="dark"] .eg-q-stem,
.eg-test-root[data-test-theme="dark"] #egQArea,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .eg-sol,
.eg-test-root[data-test-theme="dark"] .eg-sol .qx-content,
.eg-test-root[data-test-theme="dark"] .katex,
.eg-test-root[data-test-theme="dark"] .katex * {
  color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt,
.eg-test-root[data-test-theme="dark"] .eg-opt,
.eg-test-root[data-test-theme="dark"] [data-opt] {
  display: flex !important;
  background: #1e293b !important;
  border: 1px solid #475569 !important;
  color: #f1f5f9 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-right,
.eg-test-root[data-test-theme="dark"] .mtk-opt.correct {
  background: #14532d !important;
  border-color: #22c55e !important;
  color: #dcfce7 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-right .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .mtk-opt.correct .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-right .katex * {
  color: #dcfce7 !important;
  -webkit-text-fill-color: #dcfce7 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-wrong,
.eg-test-root[data-test-theme="dark"] .mtk-opt.wrong {
  background: #7f1d1d !important;
  border-color: #ef4444 !important;
  color: #fecaca !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-wrong .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .mtk-opt.wrong .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .mtk-opt.eg-opt-wrong .katex * {
  color: #fecaca !important;
  -webkit-text-fill-color: #fecaca !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot {
  background: #0f172a !important;
  border-top-color: #334155 !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot-extra,
.eg-test-root[data-test-theme="dark"] .eg-foot-left {
  background: #0f172a !important;
  color: #f1f5f9 !important;
}

/* A/B/C/D letters — white on blue in both modes */
.eg-test-root .mtk-opt-letter,
.eg-test-root .eg-opt-letter,
.eg-test-root .qx-opt-circle {
  background: #1565C0 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* qxmd214: white icons ONLY on blue bar / dark theme — not light chips */
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-tool-btn,
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-ico,
.eg-test-root[data-test-theme="dark"] .eg-top-tools svg,
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-tip,
.eg-test-root .eg-top.eg-top-blue .eg-top-tools .eg-tool-btn,
.eg-test-root .eg-top.eg-top-blue .eg-top-tools svg {
  color: #ffffff !important;
  fill: #ffffff !important;
  stroke: currentColor;
}


/* qxmd212 both-themes foot force — must beat earlier white !important */
#egFoot, .eg-foot, .eg-foot-practice, .eg-foot-marks, .mtk-controls, footer.eg-foot,
.eg-test-root #egFoot, .eg-test-root .eg-foot, .eg-test-root .eg-foot-practice, .eg-test-root .eg-foot-marks {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  min-height: 56px !important;
  pointer-events: auto !important;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot,
.eg-test-root[data-test-theme="dark"] #egFoot {
  background: #0f172a !important;
  background-color: #0f172a !important;
}
/* no left line on solution */
#egSol, .eg-sol, .qx-sol-card, .eg-sol .qx-sol-card {
  border-left: none !important;
}
#egSol::before, .eg-sol::before, .qx-sol-card::before {
  content: none !important; display: none !important; width: 0 !important;
}
.eg-test-root[data-test-theme="light"] .eg-sol,
.eg-test-root[data-test-theme="dark"] .eg-sol {
  border-left: none !important;
  margin-top: 8px !important;
}

/* ========== qxmd213: transparent foot + always-visible Prev|Check|Next + scroll pad + dark contrast + no sol left line ========== */
#egFoot, .eg-foot, .eg-foot-practice, .eg-foot-marks, .mtk-controls, footer.eg-foot,
.eg-test-root #egFoot, .eg-test-root .eg-foot, .allen-practice #egFoot, .allen-practice .eg-foot,
.qx-prac-foot.eg-foot-marks, .mtk-test-root.allen-practice #egFoot,
.eg-test-root.eg-sol-showing #egFoot, .eg-test-root.qx-sol-showing #egFoot,
html[data-theme="light"] .eg-foot, html[data-theme="dark"] .eg-foot,
.eg-test-root[data-test-theme="light"] .eg-foot, .eg-test-root[data-test-theme="dark"] .eg-foot,
.mtk-test-root[data-test-theme="light"] .eg-foot, .mtk-test-root[data-test-theme="dark"] .eg-foot {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  min-height: 56px !important;
  display: grid !important;
  grid-template-columns: 1fr 1.2fr 1fr !important;
  gap: 8px !important;
  align-items: center !important;
  position: fixed !important;
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  z-index: 2147483646 !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  transform: none !important;
}
.eg-test-root[data-test-theme="dark"] #egFoot,
.eg-test-root[data-test-theme="dark"] .eg-foot,
html[data-theme="dark"] .eg-test-root[data-test-theme="dark"] #egFoot {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-top-color: #334155 !important;
  box-shadow: 0 -8px 24px rgba(0,0,0,.4) !important;
}
#egFoot::before, .eg-foot::before, .eg-foot-marks::before { content: none !important; display: none !important; height: 0 !important; }

#egFoot #qxPrevBtn, #egFoot #egCheckBtn, #egFoot #qxNextBtn,
#egFoot #qxPracPrev, #egFoot #qxPracSubmit, #egFoot #qxPracNext,
.eg-foot #qxPrevBtn, .eg-foot #egCheckBtn, .eg-foot #qxNextBtn,
.eg-foot #qxPracPrev, .eg-foot #qxPracSubmit, .eg-foot #qxPracNext,
.allen-practice #qxPracPrev, .allen-practice #qxPracSubmit, .allen-practice #qxPracNext {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 40px !important;
  height: 40px !important;
  max-height: 40px !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
  width: 100% !important;
  z-index: 2147483647 !important;
  position: relative !important;
}

/* LIGHT pills */
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxPrevBtn,
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxNextBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracPrev,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracNext,
.allen-practice:not([data-test-theme="dark"]) #qxPracPrev,
.allen-practice:not([data-test-theme="dark"]) #qxPracNext {
  background: #ffffff !important; color: #0f172a !important; border: 1.5px solid #94a3b8 !important;
  box-shadow: 0 2px 10px rgba(15,23,42,.14) !important;
}
.eg-test-root:not([data-test-theme="dark"]) #egFoot #egCheckBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracSubmit,
.allen-practice:not([data-test-theme="dark"]) #qxPracSubmit {
  background: #2563eb !important; color: #fff !important; border: 1.5px solid #1d4ed8 !important;
  box-shadow: 0 2px 10px rgba(37,99,235,.35) !important; font-weight: 800 !important;
}

/* DARK pills — never white slab / invisible */
.eg-test-root[data-test-theme="dark"] #egFoot #qxPrevBtn,
.eg-test-root[data-test-theme="dark"] #egFoot #qxNextBtn,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracPrev,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracNext,
.allen-practice[data-test-theme="dark"] #qxPracPrev,
.allen-practice[data-test-theme="dark"] #qxPracNext,
html[data-theme="dark"] .eg-test-root[data-test-theme="dark"] #qxPrevBtn,
html[data-theme="dark"] .eg-test-root[data-test-theme="dark"] #qxNextBtn {
  background: #1e293b !important; color: #f1f5f9 !important; border: 1.5px solid #64748b !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.45) !important; -webkit-text-fill-color: #f1f5f9 !important;
}
.eg-test-root[data-test-theme="dark"] #egFoot #egCheckBtn,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracSubmit,
.allen-practice[data-test-theme="dark"] #qxPracSubmit {
  background: #3b82f6 !important; color: #ffffff !important; border: 1.5px solid #60a5fa !important;
  box-shadow: 0 2px 10px rgba(59,130,246,.4) !important; -webkit-text-fill-color: #ffffff !important; font-weight: 800 !important;
}

/* Scroll: content clears fixed pills */
.eg-main, .eg-q-card, .mtk-main, .mtk-body, #app-main,
.eg-test-root .eg-main, .eg-test-root .eg-q-card,
.mtk-test-root .mtk-main, .allen-practice .mtk-main {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}
.eg-test-root.eg-sol-showing .eg-main,
.eg-test-root.qx-sol-showing .eg-main,
.eg-test-root.eg-sol-showing .eg-q-card,
.eg-test-root.qx-sol-showing .eg-q-card,
.allen-practice.qx-sol-showing .mtk-main {
  padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)) !important;
}
#app-main {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* SOLUTION tight, no left line */
#egSol, .eg-sol, .qx-sol-card, .eg-sol-panel, #egSolPanel, .qx-sol-reveal-box {
  border-left: none !important;
  margin-top: 8px !important;
  box-shadow: none !important;
}
#egSol::before, .eg-sol::before, .qx-sol-card::before { content: none !important; display: none !important; }

/* Dark mode chips / badges / options readable */
.eg-test-root[data-test-theme="dark"] .qx-paper-chip,
.mtk-test-root[data-test-theme="dark"] .qx-paper-chip,
.eg-test-root[data-test-theme="dark"] .qx-paper-shift,
.mtk-test-root[data-test-theme="dark"] .qx-paper-shift,
html[data-theme="dark"] .qx-paper-chip,
html[data-theme="dark"] .qx-paper-shift,
.eg-test-root[data-test-theme="dark"] .eg-meta,
.eg-test-root[data-test-theme="dark"] .eg-chip,
.eg-test-root[data-test-theme="dark"] .qx-sol-diff-badge {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1px solid #64748b !important;
  -webkit-text-fill-color: #f1f5f9 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt,
.eg-test-root[data-test-theme="dark"] .eg-opt,
.mtk-test-root[data-test-theme="dark"] .mtk-opt,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text,
.mtk-test-root[data-test-theme="dark"] .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .eg-q-stem,
.eg-test-root[data-test-theme="dark"] .mtk-q-text,
.mtk-test-root[data-test-theme="dark"] .mtk-q-text {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt,
.mtk-test-root[data-test-theme="dark"] .mtk-opt,
.eg-test-root[data-test-theme="dark"] .eg-opt {
  background: #0f172a !important;
  border-color: #334155 !important;
}
.katex-error { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }

/* ========== qxmd214: light/dark contrast — footer, options, toolbar, sol no left line ========== */

/* 1) LIGHT footer Prev/Next: force dark text (kill white -webkit-text-fill on white pills) */
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxPrevBtn,
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxNextBtn,
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxNextBtn.eg-btn-next,
.eg-test-root:not([data-test-theme="dark"]) .eg-foot #qxPrevBtn,
.eg-test-root:not([data-test-theme="dark"]) .eg-foot #qxNextBtn,
.eg-test-root:not([data-test-theme="dark"]) .eg-foot #qxNextBtn.eg-btn-next,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) #egFoot #qxPrevBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) #egFoot #qxNextBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot #qxNextBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracPrev,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracNext,
.allen-practice:not([data-test-theme="dark"]) #qxPracPrev,
.allen-practice:not([data-test-theme="dark"]) #qxPracNext,
html[data-theme="light"] #egFoot #qxPrevBtn,
html[data-theme="light"] #egFoot #qxNextBtn,
html[data-theme="light"] #egFoot #qxPracPrev,
html[data-theme="light"] #egFoot #qxPracNext {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1.5px solid #94a3b8 !important;
  text-shadow: none !important;
  mix-blend-mode: normal !important;
  filter: none !important;
}
.eg-test-root:not([data-test-theme="dark"]) #egFoot #egCheckBtn,
.eg-test-root:not([data-test-theme="dark"]) .eg-foot #egCheckBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracSubmit,
.allen-practice:not([data-test-theme="dark"]) #qxPracSubmit,
html[data-theme="light"] #egFoot #egCheckBtn,
html[data-theme="light"] #egFoot #qxPracSubmit {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1.5px solid #1d4ed8 !important;
}

/* 2) DARK Examgoal options: .qx-opt-plain + KaTeX .mord light on dark */
.eg-test-root[data-test-theme="dark"] .qx-opt-plain,
.eg-test-root[data-test-theme="dark"] .mtk-opt .qx-opt-plain,
.eg-test-root[data-test-theme="dark"] .eg-opt .qx-opt-plain,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .eg-opt,
.eg-test-root[data-test-theme="dark"] .mtk-opt,
.mtk-test-root[data-test-theme="dark"] .qx-opt-plain,
.mtk-test-root[data-test-theme="dark"] .mtk-opt-text,
.allen-practice[data-test-theme="dark"] .qx-opt-plain,
html[data-theme="dark"] .eg-test-root .qx-opt-plain,
html[data-theme="dark"] .qx-opt-plain {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt .katex,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text .katex,
.eg-test-root[data-test-theme="dark"] .qx-opt-plain .katex,
.eg-test-root[data-test-theme="dark"] .mtk-opt .mord,
.eg-test-root[data-test-theme="dark"] .eg-opt .mord,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text .mord,
.eg-test-root[data-test-theme="dark"] .qx-opt-plain .mord,
.eg-test-root[data-test-theme="dark"] .mtk-opt .katex *,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex *,
.mtk-test-root[data-test-theme="dark"] .mtk-opt .mord,
.mtk-test-root[data-test-theme="dark"] .mtk-opt .katex,
.mtk-test-root[data-test-theme="dark"] .mtk-opt .katex *,
.allen-practice[data-test-theme="dark"] .mtk-opt .mord,
.allen-practice[data-test-theme="dark"] .mtk-opt .katex *,
html[data-theme="dark"] .eg-opt .mord,
html[data-theme="dark"] .mtk-opt .mord {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  fill: currentColor !important;
}

/* 3) Remove ALL border-left on sol-body / qx-sol / eg-sol */
.sol-body, .qx-sol-body, .qx-sol-flow, .qx-exam-sol, .mk-sol-body,
.qx-sol, .qx-sol-card, .eg-sol, #egSol, .eg-sol-panel, #egSolPanel,
.qx-sol-reveal-box, #qaSolReveal, .eg-sol-marks-way, .eg-sol-inline,
.eg-test-root .sol-body, .mtk-test-root .sol-body,
.eg-test-root[data-test-theme="light"] .sol-body,
.eg-test-root[data-test-theme="dark"] .sol-body,
html[data-theme="light"] .sol-body, html[data-theme="dark"] .sol-body {
  border-left: none !important;
  border-left-width: 0 !important;
  border-left-color: transparent !important;
  border-left-style: none !important;
}
.sol-body::before, .qx-sol::before, .qx-sol-card::before, .eg-sol::before, #egSol::before,
.qx-sol-reveal-box::before, .eg-sol-panel::before {
  content: none !important; display: none !important; width: 0 !important; border: none !important;
}

/* 4) LIGHT toolbar: dark icon fill/stroke on light chips (beat "always white on blue bar") */
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-ico,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-ico,
.allen-practice:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.allen-practice:not([data-test-theme="dark"]) .qx-prac-tools .eg-ico,
html[data-theme="light"] .eg-top-tools .eg-tool-btn,
html[data-theme="light"] .eg-top-tools .eg-ico {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  fill: #0f172a !important;
  stroke: #0f172a !important;
}
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn svg,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-ico svg,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools svg,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools svg *,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools svg,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools svg *,
.allen-practice:not([data-test-theme="dark"]) .eg-top-tools svg,
.allen-practice:not([data-test-theme="dark"]) .qx-prac-tools svg,
html[data-theme="light"] .eg-top-tools svg,
html[data-theme="light"] .eg-top-tools svg * {
  color: #0f172a !important;
  fill: #0f172a !important;
  stroke: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tip,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tip {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  fill: none !important;
}

/* 5) DARK NEET/Examgoal solution card: dark surface + light text */
.eg-test-root[data-test-theme="dark"] .qx-sol-card,
.eg-test-root[data-test-theme="dark"] .eg-sol,
.eg-test-root[data-test-theme="dark"] #egSol,
.eg-test-root[data-test-theme="dark"] .qx-sol-reveal-box,
.eg-test-root[data-test-theme="dark"] .eg-sol-panel,
.mtk-test-root[data-test-theme="dark"] .qx-sol-card,
.mtk-test-root[data-test-theme="dark"] .eg-sol,
.allen-practice[data-test-theme="dark"] .qx-sol-card,
.allen-practice[data-test-theme="dark"] .sol-body,
html[data-theme="dark"] .eg-test-root .qx-sol-card,
html[data-theme="dark"] .qx-sol-card {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border: 1px solid #334155 !important;
  border-left: none !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
.eg-test-root[data-test-theme="dark"] .qx-sol-card-h,
.eg-test-root[data-test-theme="dark"] .qx-sol-ans,
.eg-test-root[data-test-theme="dark"] .qx-sol-ans-lab,
.eg-test-root[data-test-theme="dark"] .eg-sol .qx-sol-card-h,
.eg-test-root[data-test-theme="dark"] .sol-body,
.eg-test-root[data-test-theme="dark"] .qx-sol-flow,
.mtk-test-root[data-test-theme="dark"] .qx-sol-card-h,
.mtk-test-root[data-test-theme="dark"] .sol-body,
.allen-practice[data-test-theme="dark"] .qx-sol-card-h,
html[data-theme="dark"] .qx-sol-card-h,
html[data-theme="dark"] .qx-sol-ans-lab {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
.eg-test-root[data-test-theme="dark"] .qx-sol-ans,
.mtk-test-root[data-test-theme="dark"] .qx-sol-ans,
html[data-theme="dark"] .qx-sol-ans {
  background: #052e1a !important;
  border: 1px solid #166534 !important;
  color: #bbf7d0 !important;
  -webkit-text-fill-color: #bbf7d0 !important;
}
.eg-test-root[data-test-theme="dark"] .qx-sol-ans-lab,
html[data-theme="dark"] .qx-sol-ans-lab {
  color: #86efac !important;
  -webkit-text-fill-color: #86efac !important;
}
.eg-test-root[data-test-theme="dark"] .sol-body .katex,
.eg-test-root[data-test-theme="dark"] .sol-body .katex *,
.eg-test-root[data-test-theme="dark"] .qx-sol-card .katex,
.eg-test-root[data-test-theme="dark"] .qx-sol-card .katex *,
.eg-test-root[data-test-theme="dark"] .sol-body .mord {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}

/* qxmd238: solid footer (Prev|Check|Next always tappable) */
#egFoot, .eg-foot, .eg-foot-practice, .eg-foot-marks, .mtk-controls, footer.eg-foot {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  min-height: 56px !important;
}

/* ========== qxmd214b: no bottom slab + toolbar/options never hide (light+dark) ========== */

/* 1) Solid Prev|Check|Next bar — never transparent, never min-height 0 */
#egFoot, .eg-foot, .eg-foot-practice, .eg-foot-marks, .mtk-controls, footer.eg-foot,
.eg-test-root #egFoot, .eg-test-root .eg-foot, .eg-test-root .eg-foot-practice, .eg-test-root .eg-foot-marks,
.mtk-test-root #egFoot, .mtk-test-root .eg-foot, .allen-practice #egFoot, .allen-practice .eg-foot,
.qx-prac-foot, .qx-prac-foot.eg-foot-marks, .qx-practice-page .eg-foot,
.eg-test-root.eg-qxtool8 #egFoot, .eg-test-root.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot,
.eg-test-root.eg-mobile .eg-foot, .eg-test-root.eg-desktop-mode .eg-foot,
html[data-theme="light"] .eg-foot, html[data-theme="dark"] .eg-foot,
html[data-theme="light"] #egFoot, html[data-theme="dark"] #egFoot {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  border-bottom: none !important;
  outline: none !important;
  min-height: 56px !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root[data-test-theme="dark"] #egFoot,
.eg-test-root[data-test-theme="dark"] .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot,
html[data-theme="dark"] #egFoot,
html[data-theme="dark"] .eg-foot {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-top: 1px solid #334155 !important;
}
#egFoot::before, #egFoot::after, .eg-foot::before, .eg-foot::after,
.eg-foot-marks::before, .eg-foot-marks::after, .eg-foot-practice::before,
.mtk-controls::before, .mtk-controls::after, .qx-prac-foot::before {
  content: none !important; display: none !important; height: 0 !important;
  background: none !important; box-shadow: none !important; border: none !important;
}
/* hide any leftover slab wrappers under foot */
.eg-foot-slab, .eg-foot-bg, .qx-foot-slab, .eg-foot-bar, #egFootBar,
.eg-test-root .eg-foot-extra, .eg-test-root #egFootExtra {
  display: none !important; height: 0 !important; background: transparent !important;
}

/* 2) Toolbar icons + labels NEVER hide — both themes, force contrast */
.eg-test-root .eg-top-tools,
.eg-test-root .eg-top-tools .eg-tool-btn,
.eg-test-root .eg-top-tools .eg-ico,
.eg-test-root .eg-top-tools .eg-tip,
.mtk-test-root .eg-top-tools,
.mtk-test-root .eg-top-tools .eg-tool-btn,
.mtk-test-root .eg-top-tools .eg-ico,
.allen-practice .eg-top-tools,
.allen-practice .qx-prac-tools,
.allen-practice .qx-prac-tools .eg-ico {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.eg-test-root .eg-top-tools { display: flex !important; flex-wrap: nowrap !important; }
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-ico,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.allen-practice:not([data-test-theme="dark"]) .eg-top-tools .eg-tool-btn,
.allen-practice:not([data-test-theme="dark"]) .qx-prac-tools .eg-ico,
html[data-theme="light"] .eg-top-tools .eg-tool-btn,
html[data-theme="light"] .eg-top-tools .eg-ico {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
  fill: #0f172a !important;
  stroke: #0f172a !important;
}
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tip,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools .eg-tip,
.allen-practice:not([data-test-theme="dark"]) .eg-top-tools .eg-tip,
html[data-theme="light"] .eg-top-tools .eg-tip {
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: transparent !important;
}
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools svg,
.eg-test-root:not([data-test-theme="dark"]) .eg-top-tools svg *,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools svg,
.mtk-test-root:not([data-test-theme="dark"]) .eg-top-tools svg *,
.allen-practice:not([data-test-theme="dark"]) .eg-top-tools svg,
.allen-practice:not([data-test-theme="dark"]) .qx-prac-tools svg,
html[data-theme="light"] .eg-top-tools svg,
html[data-theme="light"] .eg-top-tools svg * {
  color: #0f172a !important;
  fill: #0f172a !important;
  stroke: #0f172a !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-tool-btn,
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-ico,
.mtk-test-root[data-test-theme="dark"] .eg-top-tools .eg-tool-btn,
.allen-practice[data-test-theme="dark"] .eg-top-tools .eg-tool-btn,
.allen-practice[data-test-theme="dark"] .qx-prac-tools .eg-ico,
html[data-theme="dark"] .eg-top-tools .eg-tool-btn,
html[data-theme="dark"] .eg-top-tools .eg-ico {
  color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  background: #1e293b !important;
  border: 1px solid #64748b !important;
  fill: #f1f5f9 !important;
  stroke: #f1f5f9 !important;
}
.eg-test-root[data-test-theme="dark"] .eg-top-tools .eg-tip,
.mtk-test-root[data-test-theme="dark"] .eg-top-tools .eg-tip,
html[data-theme="dark"] .eg-top-tools .eg-tip {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  opacity: 1 !important;
  visibility: visible !important;
  background: transparent !important;
}
.eg-test-root[data-test-theme="dark"] .eg-top-tools svg,
.eg-test-root[data-test-theme="dark"] .eg-top-tools svg *,
.mtk-test-root[data-test-theme="dark"] .eg-top-tools svg,
.mtk-test-root[data-test-theme="dark"] .eg-top-tools svg *,
.allen-practice[data-test-theme="dark"] .eg-top-tools svg,
html[data-theme="dark"] .eg-top-tools svg,
html[data-theme="dark"] .eg-top-tools svg * {
  color: #f1f5f9 !important;
  fill: #f1f5f9 !important;
  stroke: #f1f5f9 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 3) Options NEVER hide — readable text + KaTeX both themes */
.eg-test-root .eg-opts, .eg-test-root #qxOpts, .eg-test-root .mtk-opt, .eg-test-root .eg-opt,
.eg-test-root .mtk-opt-text, .eg-test-root .qx-opt-plain, .eg-test-root [data-opt],
.mtk-test-root .mtk-opt, .mtk-test-root .mtk-opt-text, .mtk-test-root .qx-opt-plain,
.allen-practice .mtk-opt, .allen-practice .mtk-opt-text, .allen-practice .qx-opt-plain {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2 !important;
}
.eg-test-root .eg-opts, .eg-test-root #qxOpts, .mtk-test-root .mtk-opts {
  display: flex !important;
  flex-direction: column !important;
}
.eg-test-root:not([data-test-theme="dark"]) .mtk-opt,
.eg-test-root:not([data-test-theme="dark"]) .eg-opt,
.eg-test-root:not([data-test-theme="dark"]) .mtk-opt-text,
.eg-test-root:not([data-test-theme="dark"]) .qx-opt-plain,
.mtk-test-root:not([data-test-theme="dark"]) .mtk-opt-text,
.mtk-test-root:not([data-test-theme="dark"]) .qx-opt-plain,
.allen-practice:not([data-test-theme="dark"]) .qx-opt-plain,
html[data-theme="light"] .qx-opt-plain,
html[data-theme="light"] .mtk-opt-text {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.eg-test-root:not([data-test-theme="dark"]) .mtk-opt .mord,
.eg-test-root:not([data-test-theme="dark"]) .eg-opt .mord,
.eg-test-root:not([data-test-theme="dark"]) .mtk-opt .katex,
.eg-test-root:not([data-test-theme="dark"]) .eg-opt .katex,
.eg-test-root:not([data-test-theme="dark"]) .mtk-opt .katex *,
.eg-test-root:not([data-test-theme="dark"]) .eg-opt .katex *,
.eg-test-root:not([data-test-theme="dark"]) .qx-opt-plain .mord,
.eg-test-root:not([data-test-theme="dark"]) .qx-opt-plain .katex *,
.mtk-test-root:not([data-test-theme="dark"]) .mtk-opt .mord,
.mtk-test-root:not([data-test-theme="dark"]) .mtk-opt .katex *,
html[data-theme="light"] .mtk-opt .mord,
html[data-theme="light"] .mtk-opt .katex * {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  fill: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt,
.eg-test-root[data-test-theme="dark"] .eg-opt,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .qx-opt-plain,
.mtk-test-root[data-test-theme="dark"] .mtk-opt-text,
.mtk-test-root[data-test-theme="dark"] .qx-opt-plain,
.allen-practice[data-test-theme="dark"] .qx-opt-plain,
html[data-theme="dark"] .qx-opt-plain,
html[data-theme="dark"] .mtk-opt-text {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
.eg-test-root[data-test-theme="dark"] .mtk-opt .mord,
.eg-test-root[data-test-theme="dark"] .eg-opt .mord,
.eg-test-root[data-test-theme="dark"] .mtk-opt .katex,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex,
.eg-test-root[data-test-theme="dark"] .mtk-opt .katex *,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex *,
.eg-test-root[data-test-theme="dark"] .qx-opt-plain .mord,
.eg-test-root[data-test-theme="dark"] .qx-opt-plain .katex *,
.mtk-test-root[data-test-theme="dark"] .mtk-opt .mord,
.mtk-test-root[data-test-theme="dark"] .mtk-opt .katex *,
html[data-theme="dark"] .mtk-opt .mord,
html[data-theme="dark"] .mtk-opt .katex * {
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  fill: currentColor !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========== qxmd216: FIXED transparent bottom pills — max Q area; no strip; no hang ========== */
:root {
  --eg-foot-h: 52px;
  --eg-foot-pad: calc(var(--eg-foot-h) + 12px + env(safe-area-inset-bottom, 0px));
}
#egFoot, .eg-foot, .eg-foot-practice, .eg-foot-marks, .mtk-controls, footer.eg-foot,
.eg-test-root #egFoot, .eg-test-root .eg-foot, .eg-test-root .eg-foot-marks,
.mtk-test-root #egFoot, .allen-practice #egFoot, .allen-practice .eg-foot,
.qx-prac-foot, .qx-prac-foot.eg-foot-marks,
.eg-test-root.eg-qxtool8 #egFoot, .eg-test-root.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot,
.eg-test-root.eg-mobile .eg-foot, .eg-test-root.eg-desktop-mode .eg-foot,
.eg-test-root.qx-sol-showing #egFoot, .eg-test-root.eg-sol-showing #egFoot,
html[data-theme="light"] #egFoot, html[data-theme="dark"] #egFoot,
html[data-theme="light"] .eg-foot, html[data-theme="dark"] .eg-foot {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  inset: auto 0 0 0 !important;
  transform: none !important;
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  border-bottom: none !important;
  outline: none !important;
  min-height: 56px !important;
  max-height: none !important;
  height: auto !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  z-index: 2147483646 !important;
  display: grid !important;
  grid-template-columns: 1fr 1.2fr 1fr !important;
  gap: 8px !important;
  align-items: center !important;
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto !important;
}
#egFoot::before, #egFoot::after, .eg-foot::before, .eg-foot::after,
.eg-foot-marks::before, .eg-foot-marks::after, .eg-foot-practice::before,
.mtk-controls::before, .mtk-controls::after, .qx-prac-foot::before, .qx-prac-foot::after {
  content: none !important; display: none !important; width: 0 !important; height: 0 !important;
  background: none !important; box-shadow: none !important; border: none !important;
}
#egFoot #qxPrevBtn, #egFoot #egCheckBtn, #egFoot #qxNextBtn,
#egFoot #qxPracPrev, #egFoot #qxPracSubmit, #egFoot #qxPracNext,
.eg-foot #qxPrevBtn, .eg-foot #egCheckBtn, .eg-foot #qxNextBtn,
.eg-foot #qxPracPrev, .eg-foot #qxPracSubmit, .eg-foot #qxPracNext {
  pointer-events: auto !important;
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  z-index: 2147483647 !important;
  min-height: 40px !important;
  height: 40px !important;
  max-height: 40px !important;
  border-radius: 999px !important;
  width: 100% !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(15,23,42,.18) !important;
}
/* light pills */
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxPrevBtn,
.eg-test-root:not([data-test-theme="dark"]) #egFoot #qxNextBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracPrev,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracNext,
.allen-practice:not([data-test-theme="dark"]) #qxPracPrev,
.allen-practice:not([data-test-theme="dark"]) #qxPracNext {
  background: #ffffff !important; color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important; border: 1.5px solid #94a3b8 !important;
}
.eg-test-root:not([data-test-theme="dark"]) #egFoot #egCheckBtn,
.mtk-test-root:not([data-test-theme="dark"]) #egFoot #qxPracSubmit,
.allen-practice:not([data-test-theme="dark"]) #qxPracSubmit {
  background: #2563eb !important; color: #fff !important;
  -webkit-text-fill-color: #fff !important; border: 1.5px solid #1d4ed8 !important;
}
.eg-test-root[data-test-theme="dark"] #egFoot #qxPrevBtn,
.eg-test-root[data-test-theme="dark"] #egFoot #qxNextBtn,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracPrev,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracNext,
.allen-practice[data-test-theme="dark"] #qxPracPrev,
.allen-practice[data-test-theme="dark"] #qxPracNext {
  background: #1e293b !important; color: #f1f5f9 !important;
  -webkit-text-fill-color: #f1f5f9 !important; border: 1.5px solid #64748b !important;
}
.eg-test-root[data-test-theme="dark"] #egFoot #egCheckBtn,
.mtk-test-root[data-test-theme="dark"] #egFoot #qxPracSubmit,
.allen-practice[data-test-theme="dark"] #qxPracSubmit {
  background: #3b82f6 !important; color: #fff !important;
  -webkit-text-fill-color: #fff !important; border: 1.5px solid #60a5fa !important;
}
/* scroll clears fixed pills — foot height + 12px */
.eg-test-root .eg-main, .eg-test-root .eg-q-card,
.mtk-test-root .mtk-main, .allen-practice .mtk-main,
.eg-main, .eg-q-card, .mtk-main, .mtk-body, #app-main {
  padding-bottom: var(--eg-foot-pad) !important;
  scroll-padding-bottom: var(--eg-foot-pad) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}
.eg-test-root.eg-sol-showing .eg-main,
.eg-test-root.qx-sol-showing .eg-main,
.eg-test-root.eg-sol-showing .eg-q-card,
.eg-test-root.qx-sol-showing .eg-q-card,
.allen-practice.qx-sol-showing .mtk-main {
  padding-bottom: calc(var(--eg-foot-h) + 12px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(var(--eg-foot-h) + 12px + env(safe-area-inset-bottom, 0px)) !important;
}
/* compact top chrome — wrap tools, never clip Prev/Next or toolbar */
.eg-test-root .eg-top, .mtk-test-root .eg-top, .allen-practice .eg-top,
.eg-test-root.eg-qxmd182 > .eg-top, .eg-test-root.eg-qxtool8 .eg-top {
  min-height: 40px !important;
  max-height: none !important;
  overflow: visible !important;
  flex-wrap: wrap !important;
  padding: 2px 6px !important;
  flex: 0 0 auto !important;
}
.eg-test-root .eg-top-tools .eg-tool-btn,
.eg-test-root .eg-top-tools .eg-ico,
.mtk-test-root .eg-top-tools .eg-tool-btn,
.allen-practice .eg-top-tools .eg-tool-btn {
  min-height: 30px !important;
  padding: 2px 6px !important;
  font-size: 10px !important;
  gap: 2px !important;
}
.eg-test-root .eg-subs, .eg-test-root .eg-info-strip {
  min-height: 0 !important;
  padding-top: 2px !important;
  padding-bottom: 2px !important;
}
.eg-main #egFoot, .eg-q-card #egFoot, .mtk-main #egFoot, #app-main #egFoot {
  /* if somehow nested, still fixed to viewport */
  position: fixed !important;
  margin: 0 !important;
}

/* qxmd238: solid Prev|Check|Next + unclipped toolbar */
html body .eg-test-root #egFoot,
html body .eg-test-root .eg-foot,
html body .eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot,
html body .eg-test-root.eg-qxtool8[data-test-theme="dark"] #egFoot.eg-foot.eg-foot-marks,
html body #egFoot.eg-foot.eg-foot-marks {
  background: #ffffff !important;
  background-color: #ffffff !important;
  min-height: 56px !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: grid !important;
  grid-template-columns: 1fr 1.2fr 1fr !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483646 !important;
  border-top: 1px solid #e5e7eb !important;
}
html body .eg-test-root[data-test-theme="dark"] #egFoot,
html body .eg-test-root[data-test-theme="dark"] .eg-foot,
html body .eg-test-root.eg-qxtool8[data-test-theme="dark"] #egFoot,
html body .eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-top: 1px solid #334155 !important;
}
html body .eg-test-root .eg-top,
html body .eg-test-root.eg-qxtool8 .eg-top {
  max-height: none !important;
  overflow: visible !important;
  flex-wrap: wrap !important;
}
html body .eg-test-root #egFoot #qxPrevBtn,
html body .eg-test-root #egFoot #qxNextBtn,
html body .eg-test-root #egFoot #egCheckBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
