/* ExamGOAL-faithful PYQ practice/test chrome (ss 966, 971–973) */
.eg-test-root,
.eg-test-root.mtk-test-root {
  --eg-blue: #0b57d0; /* qxmd167 */
  --eg-blue-2: #3b82f6;
  --eg-header: #0b57d0;
  --eg-tab: #3b82f6;
  --eg-tab-on: #1d4ed8;
  --eg-bg: #eef2f7;
  --eg-card: #ffffff;
  --eg-text: #0f172a;
  --eg-muted: #64748b;
  --eg-line: #e2e8f0;
  --eg-side: #ffffff;
  --eg-green: #22c55e;
  --eg-red: #ef4444;
  --eg-yellow: #f59e0b;
  --eg-purple: #a855f7;
  --eg-opt-letter: #0b57d0;
  height: 100dvh;
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  background: var(--eg-bg) !important;
  color: var(--eg-text) !important;
  font-family: Inter, system-ui, sans-serif;
}
.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-bg: #070b16;
  --eg-card: #0f172a;
  --eg-text: #e5e7eb;
  --eg-muted: #94a3b8;
  --eg-line: #1e293b;
  --eg-side: #0b1220;
  --eg-opt-letter: #3b82f6;
}
.eg-test-root[data-test-theme="light"] .mtk-opt,
.eg-test-root[data-test-theme="light"] .eg-opt {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: #e2e8f0 !important;
}
.eg-test-root[data-test-theme="light"] .eg-q-card {
  background: #ffffff !important;
  color: #0f172a !important;
}
.eg-test-root[data-test-theme="light"] .eg-q-stem,
.eg-test-root[data-test-theme="light"] .mtk-q-text,
.eg-test-root[data-test-theme="light"] .mtk-opt-text,
.eg-test-root[data-test-theme="light"] .katex,
.eg-test-root[data-test-theme="light"] .katex *,
.eg-test-root[data-test-theme="light"] mjx-container,
html[data-theme="dark"] .eg-test-root[data-test-theme="light"] .katex,
html[data-theme="dark"] .eg-test-root[data-test-theme="light"] .katex *,
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 {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.eg-test-root[data-test-theme="dark"] .eg-q-stem,
.eg-test-root[data-test-theme="dark"] .mtk-q-text,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text,
.eg-test-root[data-test-theme="dark"] .katex,
.eg-test-root[data-test-theme="dark"] .katex * {
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb !important;
  opacity: 1 !important;
  visibility: visible !important;
}
.eg-test-root img.qx-pool-fig,
.eg-test-root .qx-fig img,
.eg-test-root .qx-opt-fig-img {
  background: #fff !important;
  opacity: 1 !important;
  visibility: visible !important;
  filter: none !important;
}

.eg-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 12px 0 8px;
  background: var(--eg-header);
  color: #fff;
  flex-shrink: 0;
  position: relative;
  z-index: 40 !important;
  pointer-events: auto !important;
}
.eg-back {
  width: 40px; height: 40px; border: 0; background: transparent; color: #fff;
  font-size: 22px; cursor: pointer; border-radius: 10px;
}
.eg-back:hover { background: rgba(255,255,255,.12); }
.eg-top-title {
  flex: 1; min-width: 0; font-weight: 800; font-size: 15px; line-height: 1.25;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eg-mode-pill {
  display: inline-flex; align-items: center; margin-left: 8px;
  font-size: 10px; font-weight: 800; letter-spacing: .06em;
  padding: 3px 8px; border-radius: 999px; background: rgba(255,255,255,.2);
  vertical-align: middle;
}
.eg-top-tools {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
  position: relative; z-index: 41 !important; pointer-events: auto !important;
}
.eg-top-tools .eg-ico,
.eg-top-tools button {
  pointer-events: auto !important;
  cursor: pointer !important;
}
.eg-timer {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.16); border-radius: 999px;
  padding: 6px 12px; font-weight: 800; font-variant-numeric: tabular-nums; font-size: 14px;
  margin-right: 6px;
}
.eg-top-tools .eg-ico {
  width: 40px; height: 40px; min-width: 40px; border: 0; background: transparent; color: #fff;
  border-radius: 12px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.eg-top-tools .eg-ico:hover { background: rgba(255,255,255,.16); }
.eg-top-tools .eg-ico svg { width: 22px; height: 22px; display: block; }
.eg-top-tools .eg-ico.eg-moon svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }

.eg-subs {
  display: flex; background: var(--eg-tab); flex-shrink: 0;
}
.eg-sub {
  flex: 1; border: 0; background: transparent; color: #dbeafe;
  font-weight: 800; font-size: 14px; padding: 12px 8px; cursor: pointer;
  font-family: inherit; border-bottom: 3px solid transparent;
  transition: background .18s, color .18s, transform .15s;
}
.eg-sub:hover { background: rgba(255,255,255,.08); }
.eg-sub.on {
  background: var(--eg-tab-on); color: #fb923c; border-bottom-color: #fb923c;
}
.eg-sub-n {
  font-style: normal; font-size: 11px; font-weight: 700; opacity: .8;
  margin-left: 4px;
}
.eg-qbar {
  display: flex; flex-wrap: nowrap; gap: 6px; align-items: center;
  padding: 8px 14px; background: var(--eg-card); border-bottom: 1px solid var(--eg-line);
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
}
.eg-qbar-n { flex-shrink: 0; }
.eg-qbar-n {
  width: 30px; height: 30px; border-radius: 50%; border: 0;
  background: #9ca3af; color: #fff; font-weight: 800; font-size: 12px;
  cursor: pointer; font-family: inherit;
  transition: transform .14s cubic-bezier(.2,.8,.2,1), box-shadow .14s;
}
.eg-qbar-n:hover { transform: scale(1.12); }
.eg-qbar-n.cur {
  outline: 2px solid #2563eb; outline-offset: 2px;
  transform: scale(1.1);
  animation: egQpop .28s cubic-bezier(.2,.8,.2,1);
}
.eg-qbar-n.eg-correct, .eg-qbar-n.eg-attempted { background: #22c55e; }
.eg-qbar-n.eg-wrong { background: #ef4444; }
.eg-qbar-n.eg-att { background: #3b82f6; }
.eg-qbar-n.eg-seen { background: #f59e0b; }
.eg-qbar-n.eg-seen-test { background: #ef4444; }
.eg-qbar-n.eg-unseen { background: #9ca3af; }
.eg-qbar-n.eg-marked { background: #a855f7; }
.eg-qbar-n.eg-att-mark { background: #a855f7; box-shadow: 0 0 0 2px #22c55e; }
@keyframes egQpop {
  0% { transform: scale(.85); }
  70% { transform: scale(1.16); }
  100% { transform: scale(1.1); }
}

.eg-body {
  flex: 1; display: grid; grid-template-columns: 1fr 300px; min-height: 0;
}
.eg-test-root.eg-side-collapsed .eg-body { grid-template-columns: 1fr; }
.eg-test-root.eg-side-collapsed .eg-side { display: none !important; }

.eg-ico.on { background: rgba(255,255,255,.22); }

body.marks-test-active .eg-test-root {
    display: flex !important;
    flex-direction: column !important;

  position: relative !important;
  inset: auto !important;
  width: 100%;
  height: 100%;
  min-height: 100%;
  z-index: auto;
}
body.marks-test-active .eg-test-root.mtk-test-root {
  min-height: 100% !important;
  height: 100% !important;
}
body.marks-test-active .sidebar,
body.marks-test-active .topbar,
body.marks-test-active .qx-top-exams {
  display: none !important;
}
body.marks-test-active .main { margin-left: 0 !important; }
body.marks-test-active::before { display: none !important; }

.eg-main {
  min-width: 0; display: flex; flex-direction: column; min-height: 0;
  overflow-x: auto; overflow-y: visible;
  background: var(--eg-bg);
}
.eg-q-card {
  flex: 1; min-height: 0;
  overflow-x: auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-x pan-y;
  background: var(--eg-card); border-radius: 0; padding: 16px 18px 18px;
  box-shadow: none;
  border: 0;
}
.eg-q-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px;
}
.eg-q-time { font-size: 12px; color: var(--eg-muted); font-variant-numeric: tabular-nums; }
.eg-mark { font-size: 12px; font-weight: 800; }
.eg-mark .plus { color: #16a34a; }
.eg-mark .minus { color: #dc2626; }
.eg-q-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--eg-blue); color: #fff !important; font-weight: 800; font-size: 13px;
  display: inline-flex !important; align-items: center; justify-content: center; flex-shrink: 0;
  visibility: visible !important; opacity: 1 !important;
}
.eg-type {
  font-size: 11px; font-weight: 800; color: var(--eg-blue);
  background: rgba(37,99,235,.1); padding: 3px 8px; border-radius: 6px;
}
.eg-q-tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.eg-q-tools .eg-ico {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  background: #eff6ff !important;
  border: 1px solid #bfdbfe !important;
  color: #2563eb !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
}
.eg-q-tools .eg-ico.star { color: #f59e0b !important; font-size: 24px !important; }
.eg-q-tools .eg-ico.warn { color: #ea580c !important; font-size: 22px !important; }
.eg-q-tools .eg-ico.on {
  background: #2563eb !important;
  color: #fff !important;
  border-color: #1d4ed8 !important;
}
.eg-q-tools .eg-ico.star.on { background: #f59e0b !important; color: #fff !important; border-color: #d97706 !important; }
.eg-test-root[data-test-theme="dark"] .eg-q-tools .eg-ico {
  background: #1e3a8a !important;
  color: #93c5fd !important;
  border-color: #1d4ed8 !important;
}

.eg-q-stem, .eg-q-stem .mtk-q-text, .eg-q-stem .qx-content {
  font-size: var(--nta-q, 18px); line-height: var(--eg-lh, 1.65);
  color: var(--eg-text);
}
.eg-q-stem { margin: 4px 0 16px; }

.eg-test-root #qxOpts,
.eg-test-root .eg-opts,
.eg-test-root #qxOpts.qx-opts-img,
.eg-test-root #qxOpts.qx-opts-stack,
.eg-test-root #qxOpts.mtk-options-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  flex-direction: unset !important;
}
.eg-test-root .mtk-numerical-wrap,
.eg-test-root #qxOpts.mtk-numerical-wrap {
  display: flex !important;
  grid-template-columns: none !important;
  justify-content: center;
}
.eg-test-root .mtk-opt,
.eg-test-root .qx-opts-img .mtk-opt {
  flex-direction: row !important;
  align-items: flex-start !important;
}
.eg-test-root .mtk-opt,
.eg-test-root .eg-opt {
  display: flex; align-items: flex-start; gap: 12px;
  text-align: left; width: 100%;
  background: var(--eg-card); color: var(--eg-text);
  border: 1px solid var(--eg-line); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; font-family: inherit;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.eg-test-root .mtk-opt-radio { display: none !important; }
.eg-test-root.mtk-test-root .mtk-opt .mtk-opt-letter,
.eg-test-root.mtk-test-root .mtk-opt .qx-opt-circle,
.eg-test-root .mtk-opt-letter,
.eg-test-root .eg-opt-letter,
.eg-test-root .qx-opt-circle,
.eg-test-root .qx-opts-img .mtk-opt-letter {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 800 !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border: 0 !important;
  box-shadow: none !important;
  flex-shrink: 0 !important;
  align-self: flex-start !important;
  margin: 0 !important;
  line-height: 1 !important;
}
.eg-test-root.mtk-test-root .mtk-opt.selected .mtk-opt-letter,
.eg-test-root.mtk-test-root .mtk-opt.selected .qx-opt-circle {
  background: #1d4ed8 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.28) !important;
}
/* IMG only — never apply max-height to .mtk-opt / .eg-opts cards */
.eg-test-root .mtk-opt-text img,
.eg-test-root .qx-opt-fig-img,
.eg-test-root .mtk-opt-img img {
  max-width: min(100%, 220px) !important;
  max-height: min(28vh, 160px) !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
  margin: 0 auto !important;
}
.eg-test-root #qxOpts,
.eg-test-root .eg-opts,
.eg-test-root .mtk-opt,
.eg-test-root .eg-opt,
.eg-test-root .mtk-opt-text {
  max-height: none !important;
}
.eg-test-root .mtk-opt.selected,
.eg-test-root .eg-opt.selected {
  border-color: var(--eg-blue); box-shadow: 0 0 0 2px rgba(37,99,235,.25);
}
.eg-test-root .mtk-opt.eg-opt-right { border-color: #22c55e; background: rgba(34,197,94,.08); }
.eg-test-root .mtk-opt.eg-opt-wrong { border-color: #ef4444; background: rgba(239,68,68,.08); }

.eg-action-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
}
.eg-check-wrap { display: flex; justify-content: center; margin: 0; grid-column: 2; }
.eg-check {
  border: 1px solid #16a34a; background: transparent; color: #16a34a;
  font-weight: 800; font-size: 14px; padding: 10px 22px; border-radius: 10px;
  cursor: pointer; font-family: inherit;
}
.eg-check:hover { background: rgba(22,163,74,.12); }
.eg-check:disabled { opacity: .45; cursor: not-allowed; }
.eg-note {
  grid-column: 3; justify-self: end;
  margin-left: 0; border: 1px solid var(--eg-blue); background: transparent;
  color: var(--eg-blue); border-radius: 8px; padding: 6px 12px; font-size: 12px;
  font-weight: 700; cursor: pointer; font-family: inherit;
}
.eg-note:hover { background: rgba(37,99,235,.1); }
.eg-test-root[data-test-theme="light"] .eg-check {
  background: #ecfdf5; border-color: #86efac; color: #16a34a;
}
.eg-test-root[data-test-theme="dark"] .eg-check {
  background: transparent; border-color: #16a34a; color: #4ade80;
}

.eg-sol {
  margin-top: 16px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--eg-line); background: rgba(37,99,235,.04);
}
.eg-sol .qx-sol-card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.eg-sol .sol-body, .eg-sol .qx-sol-flow { text-align: left; max-width: none; }

.eg-foot {
  position: sticky; bottom: 0; flex-shrink: 0; display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: transparent; border-top: 1px solid var(--eg-line);
  margin: 0; z-index: 30; flex-wrap: wrap;
}
.eg-btn-next {
  min-width: 108px;
  min-height: 44px;
}
.eg-foot-left, .eg-foot-right {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.eg-foot-left { margin-right: auto; }
.eg-show {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 700;
  color: var(--eg-muted); margin-right: 0; cursor: pointer; user-select: none;
}
.eg-switch {
  position: relative; width: 40px; height: 22px; flex-shrink: 0; display: inline-block;
}
.eg-switch input {
  position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 2;
  width: 100%; height: 100%;
}
.eg-switch-knob {
  display: block; width: 40px; height: 22px; border-radius: 999px;
  background: #64748b; position: relative; pointer-events: none;
}
.eg-switch-knob::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s ease;
}
.eg-switch input:checked + .eg-switch-knob { background: var(--eg-blue); }
.eg-switch input:checked + .eg-switch-knob::after { transform: translateX(18px); }
.eg-switch input:focus-visible + .eg-switch-knob { outline: 2px solid var(--eg-blue); outline-offset: 2px; }
.eg-btn {
  border: 1px solid var(--eg-line); background: var(--eg-card); color: var(--eg-text);
  padding: 10px 14px; border-radius: 10px; font-weight: 700; font-size: 13px;
  cursor: pointer; font-family: inherit;
}
.eg-btn:disabled { opacity: .4; cursor: not-allowed; }
.eg-btn-next {
  background: var(--eg-blue); color: #fff; border-color: var(--eg-blue); font-weight: 800;
}
.eg-btn-next:hover:not(:disabled) { filter: brightness(1.06); }

.eg-side {
  background: var(--eg-side); border-left: 1px solid var(--eg-line);
  overflow: auto; padding: 14px 14px 16px; min-width: 0;
  display: flex; flex-direction: column;
}
.eg-side-foot {
  margin-top: auto; position: sticky; bottom: 0;
  padding: 12px 0 4px; background: var(--eg-side);
}
.eg-leg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 8px; margin-bottom: 16px;
}
.eg-leg-i { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--eg-muted); font-weight: 600; }
.eg-dot { width: 16px; height: 16px; border-radius: 50%; display: inline-block; flex-shrink: 0; position: relative; }
.eg-dot.correct, .eg-dot.attempted { background: #22c55e; }
.eg-dot.wrong { background: #ef4444; }
.eg-dot.att { background: #3b82f6; }
.eg-dot.seen-p { background: #f59e0b; }
.eg-dot.seen-t { background: #ef4444; }
.eg-dot.unseen { background: #9ca3af; }
.eg-dot.marked { background: #a855f7; }
.eg-dot.att-mark { background: #a855f7; }
.eg-dot.att-mark::after {
  content: ""; position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%; background: #22c55e; border: 1px solid #fff;
}

.eg-sg { margin-bottom: 16px; }
.eg-sg h4 { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--eg-text); }
.eg-sg-counts { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--eg-muted); margin-bottom: 8px; }
.eg-sg-counts span { display: inline-flex; align-items: center; gap: 4px; }
.eg-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
}
.eg-pal-cell {
  width: 34px; height: 34px; border-radius: 50%; border: 0;
  background: #9ca3af; color: #fff; font-weight: 800; font-size: 12px;
  cursor: pointer; font-family: inherit;
}
.eg-pal-cell.eg-correct, .eg-pal-cell.eg-attempted { background: #22c55e; }
.eg-pal-cell.eg-wrong { background: #ef4444; }
.eg-pal-cell.eg-att { background: #3b82f6; }
.eg-pal-cell.eg-seen { background: #f59e0b; }
.eg-pal-cell.eg-seen-test { background: #ef4444; }
.eg-pal-cell.eg-unseen { background: #9ca3af; }
.eg-pal-cell.eg-marked { background: #a855f7; }
.eg-pal-cell.eg-att-mark { background: #a855f7; box-shadow: 0 0 0 2px #22c55e; }
.eg-pal-cell.cur { outline: 2px solid #ef4444; outline-offset: 2px; }
.eg-test-root[data-eg-mode="practice"] .eg-pal-cell.cur { outline-color: #f59e0b; }

.eg-submit {
  position: static; width: 100%; margin-top: 0;
  background: #2563eb; color: #fff; border: 0; border-radius: 8px;
  padding: 12px; font-weight: 800; font-size: 14px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.eg-submit:hover { background: #1d4ed8; }
.eg-submit-mobile { display: none; }

.eg-note-pop {
  position: absolute; right: 16px; bottom: 64px;
  width: min(360px, calc(100% - 32px));
  background: var(--eg-card, #0f172a); color: var(--eg-text, #e5e7eb);
  border: 1px solid var(--eg-line, #1e293b); border-radius: 12px;
  padding: 12px; z-index: 40; box-shadow: 0 12px 32px rgba(0,0,0,.28);
}
.eg-note-pop-h { font-size: 14px; font-weight: 800; margin-bottom: 8px; }
.eg-note-pop textarea {
  width: 100%; min-height: 110px; resize: vertical; box-sizing: border-box;
  border: 1px solid var(--eg-line, #1e293b); border-radius: 8px;
  background: transparent; color: inherit; padding: 8px 10px;
  font-family: inherit; font-size: 13px; line-height: 1.45;
}
.eg-note-pop-act { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

.eg-fmt-pop {
  position: absolute; top: 52px; right: 12px; z-index: 80 !important;
  width: 260px; background: var(--eg-card); color: var(--eg-text);
  border: 1px solid var(--eg-line); border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0,0,0,.18); padding: 12px;
}
.eg-fmt-pop h5 { margin: 0 0 8px; font-size: 12px; color: var(--eg-muted); }
.eg-fmt-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.eg-fmt-row button {
  flex: 1; border: 1px solid var(--eg-line); background: transparent; color: inherit;
  border-radius: 8px; padding: 8px 6px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.eg-fmt-row button.on { background: var(--eg-blue); color: #fff; border-color: var(--eg-blue); }

.eg-side-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 0 0 10px; flex-shrink: 0;
}
.eg-side-head strong { font-size: 14px; font-weight: 800; color: var(--eg-text); }
.eg-side-close {
  width: 36px; height: 36px; border-radius: 10px;
  border: 1px solid #fecaca; background: #fee2e2; color: #b91c1c;
  font-size: 18px; font-weight: 800; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: inherit; padding: 0; flex-shrink: 0;
}
.eg-side-close:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
.eg-btn-close-pal {
  border-color: #fecaca !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
  font-weight: 800 !important;
}

.eg-side-scrim {
  display: none;
  border: 0; padding: 0; margin: 0; appearance: none;
  background: rgba(15, 23, 42, 0.55);
  cursor: pointer;
}
.eg-test-root.eg-side-collapsed .eg-side-scrim,
.eg-test-root:not(.eg-side-open) .eg-side-scrim { display: none !important; }

@media (max-width: 900px) {
  .eg-body { grid-template-columns: 1fr; }
  /* Palette sheet ABOVE question but BELOW fixed Prev/Next foot — never trap */
  .eg-test-root:not(.eg-side-collapsed) .eg-side-scrim,
  .eg-test-root.eg-side-open .eg-side-scrim {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 12040 !important;
  }
  .eg-side {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    z-index: 12050 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    padding: 12px 14px 16px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .eg-test-root[data-test-theme="dark"] .eg-side {
    background: #0b1220 !important;
  }
  .eg-test-root.eg-side-collapsed .eg-side,
  .eg-test-root:not(.eg-side-open).eg-side-collapsed .eg-side { display: none !important; }
  .eg-test-root.eg-side-collapsed .eg-side-scrim { display: none !important; }
  .eg-test-root:not(.eg-side-collapsed) .eg-body { grid-template-columns: 1fr; }
  .eg-test-root:not(.eg-side-collapsed) .eg-foot,
  .eg-test-root.eg-side-open .eg-foot {
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 12100 !important;
  }
  .eg-test-root #qxOpts,
  .eg-test-root .eg-opts,
  .eg-test-root #qxOpts.qx-opts-img,
  .eg-test-root #qxOpts.qx-opts-stack,
  .eg-test-root #qxOpts.mtk-options-grid {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    gap: 10px !important;
  }
  .eg-test-root #qxOpts .mtk-opt,
  .eg-test-root .eg-opts .mtk-opt,
  .eg-test-root #qxOpts .eg-opt {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    min-height: 48px !important;
  }
  .eg-foot {
    position: fixed !important;
    left: 0; right: 0; bottom: 0;
    z-index: 12100 !important;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }
  .eg-foot-right .eg-btn,
  .eg-btn-next {
    padding: 10px 12px;
    font-size: 13px;
    min-height: 46px;
  }
}

/* Chapter practice + fallback use the same ExamGOAL footer classes */
.allen-practice,
.qx-practice-page,
.mtk-test-root {
  --eg-blue: #0b57d0; /* qxmd167 */
  --eg-card: #ffffff;
  --eg-text: #0f172a;
  --eg-muted: #64748b;
  --eg-line: #e2e8f0;
}
.mtk-test-root[data-test-theme="dark"],
html[data-theme="dark"] .qx-practice-page {
  --eg-card: #0f172a;
  --eg-text: #e5e7eb;
  --eg-muted: #94a3b8;
  --eg-line: #1e293b;
}
.allen-practice .eg-foot,
.qx-practice-page .eg-foot {
  background: transparent;
  color: var(--eg-text);
}
.allen-practice .mtk-opt.eg-opt-right,
.allen-practice .mtk-opt.correct,
.qx-practice-page .qx-prac-opt.correct {
  border-color: #22c55e !important;
  background: rgba(34,197,94,.08) !important;
}
.allen-practice .mtk-opt.eg-opt-wrong,
.allen-practice .mtk-opt.wrong,
.qx-practice-page .qx-prac-opt.wrong {
  border-color: #ef4444 !important;
  background: rgba(239,68,68,.08) !important;
}
.qx-show-ans-hint {
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 700;
  color: #16a34a;
}
.mtk-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mtk-act-left, .mtk-act-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.mtk-act-right .mtk-btn-save { margin-left: 0; }

/* Phone / small tablet — keep ExamGOAL left/right groups, thumb-sized taps */
@media (max-width: 720px) {
  body.marks-test-active .eg-test-root {
    height: 100dvh;
    min-height: 100dvh;
  }
  .eg-top {
    flex-wrap: wrap;
    min-height: auto;
    row-gap: 4px;
    padding: 6px 8px;
  }
  .eg-top-title {
    flex: 1 1 calc(100% - 52px);
    white-space: nowrap;
  }
  .eg-top-tools {
    flex: 1 1 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 2px;
  }
  .eg-top-tools .eg-ico,
  .eg-top-tools .eg-timer {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .eg-top-tools .eg-ico {
    width: 44px;
    height: 44px;
    min-width: 44px;
  }
  .eg-fmt-pop {
    position: fixed;
    top: auto;
    right: 8px;
    left: 8px;
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    width: auto;
    z-index: 80;
  }
  .eg-q-tools,
  .eg-q-meta,
  .eg-q-num,
  .eg-type {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .eg-main {
    min-height: 0;
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
  .eg-q-card { padding: 12px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
  .mtk-test-root.allen-practice .mtk-main,
  .mtk-test-root.allen-cbt .mtk-main,
  .qx-practice-page .eg-main,
  .mq-qx-best .qx-best-body,
  .egmq-root .egmq-body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-action-row {
    grid-template-columns: 1fr;
    justify-items: stretch;
    margin: 14px 0 8px;
  }
  .eg-check-wrap,
  .eg-note { grid-column: 1; }
  .eg-check-wrap { justify-content: center; }
  .eg-note { justify-self: end; min-height: 40px; }
  .eg-check {
    min-height: 44px;
    width: min(100%, 240px);
    padding: 10px 16px;
  }
  /* Fixed bottom bar — always on screen above Android nav, even with long solution */
  .eg-foot,
  .qx-prac-foot.eg-foot,
  .allen-practice .eg-foot,
  .allen-practice .mtk-controls.eg-foot,
  .allen-practice .mtk-controls,
  .qx-best-foot,
  .egmq-foot {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    z-index: 12100 !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 0 !important;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 18px rgba(0,0,0,.12);
    background: transparent;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: none !important;
  }
  .eg-test-root[data-test-theme="dark"] .eg-foot,
  .mtk-test-root[data-test-theme="dark"] .eg-foot,
  .mtk-test-root[data-test-theme="dark"] .mtk-controls,
  .mq-qx-best[data-test-theme="dark"] .qx-best-foot {
    background: transparent;
  }
  .eg-foot-left,
  .eg-foot-right {
    width: 100%;
    margin: 0;
  }
  .eg-foot-right {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 6px;
  }
  .eg-test-root[data-eg-mode="test"] .eg-foot-left,
  .mtk-test-root.allen-cbt:not(.allen-practice) .mtk-act-left {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .eg-test-root[data-eg-mode="test"] .eg-foot-right,
  .mtk-test-root.allen-cbt:not(.allen-practice) .mtk-act-right {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 6px;
    width: 100%;
  }
  .eg-test-root[data-eg-mode="test"] .eg-side-foot {
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .eg-submit { min-height: 44px; }
  .eg-submit-mobile { display: flex; width: 100%; border-radius: 8px; }
  .eg-foot .eg-btn,
  .eg-foot-right .eg-btn,
  .eg-foot-left .eg-btn {
    min-height: 44px;
    width: 100%;
    padding: 8px 6px;
    font-size: 12px;
    border-radius: 8px;
    line-height: 1.2;
    white-space: normal;
  }
  .mtk-test-root.allen-cbt:not(.allen-practice) .mtk-controls {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    flex-direction: column;
    grid-template-columns: none !important;
    gap: 8px;
    width: 100% !important;
    z-index: 90 !important;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -8px 18px rgba(0,0,0,.12);
    visibility: visible !important;
    pointer-events: auto !important;
  }
  .mtk-test-root.allen-cbt:not(.allen-practice) .mtk-btn {
    min-height: 44px;
    width: 100%;
    margin: 0 !important;
    font-size: 12px;
    padding: 8px 6px;
  }
  .qzrr-footer-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .qzrr-act-left,
  .qzrr-act-right {
    width: 100%;
    display: grid;
    gap: 6px;
  }
  .qzrr-act-left { grid-template-columns: 1.35fr 1fr; }
  .qzrr-act-right { grid-template-columns: 1fr 1.35fr; }
  .qzrr-footer-actions .qzrr-btn {
    min-width: 0;
    width: 100%;
    min-height: 44px;
    padding: 8px 8px;
    font-size: 12px;
  }
  .qzrr-side-foot .qzrr-btn { min-height: 44px; }
  .eg-note-pop {
    right: 8px;
    left: 8px;
    width: auto;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* Mobile practice: all 4 options fully visible/scrollable above Check Answer + fixed foot */
@media (max-width: 720px) {
  .eg-test-root .eg-main {
    overflow: hidden; /* keep flex child scroll */
  }
  .eg-test-root .eg-q-card {
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-test-root #qxOpts,
  .eg-test-root .eg-opts,
  .eg-test-root #qxOpts.qx-opts-img,
  .eg-test-root #qxOpts.qx-opts-stack,
  .eg-test-root #qxOpts.mtk-options-grid,
  .allen-practice #qaOpts,
  .allen-practice .mtk-options,
  .allen-practice .mtk-options-grid,
  .mq-qx-best #qaOpts,
  .qx-prac-opts {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    gap: 10px !important;
    margin-bottom: 8px !important;
  }
  .eg-test-root #qxOpts > *,
  .eg-test-root .eg-opts > *,
  .allen-practice #qaOpts > *,
  .mq-qx-best #qaOpts > *,
  .eg-test-root .mtk-opt,
  .eg-test-root .eg-opt,
  .allen-practice .mtk-opt,
  .qx-prac-opt {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    width: 100% !important;
    min-height: 48px !important;
    flex-shrink: 0 !important;
  }
  .eg-test-root .mtk-opt-text,
  .allen-practice .mtk-opt-text,
  .qx-prac-opt-text {
    max-height: none !important;
    overflow: visible !important;
    height: auto !important;
  }
  .eg-test-root .eg-action-row,
  .allen-practice .eg-action-row {
    position: relative !important;
    z-index: 1;
    margin-top: 12px !important;
    margin-bottom: 16px !important;
  }
}

@media (max-width: 480px) {
  .eg-foot-right { grid-template-columns: 1fr 1fr 1fr; }
  .eg-show { font-size: 12px; }
  .eg-btn, .mtk-btn, .qzrr-btn { letter-spacing: -0.01em; }
}

/* Practice configure (ss 966) */
.pyq-eg-overlay { z-index: 90; background: rgba(8,12,24,.72); }
.pyq-eg-modal, .eg-cfg {
  width: min(920px, 96vw); max-height: 92vh; overflow: auto;
  background: #0b1220; color: #e5e7eb; border-radius: 16px; padding: 18px 20px 16px;
  position: relative;
}
html[data-theme="light"] .eg-cfg,
html[data-theme="light"] .pyq-eg-modal {
  background: #ffffff; color: #0f172a;
}
.eg-cfg-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.eg-cfg-h h3 { flex: 1; margin: 0; font-size: 20px; line-height: 1.3; color: inherit; }
.eg-cfg-h small { display: block; color: #64748b; font-weight: 500; font-size: 12px; margin-top: 4px; }
html[data-theme="light"] .eg-cfg-h small { color: #475569; }
.eg-cfg-badge { background: #9a3412; color: #fff; font-size: 11px; font-weight: 800; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.eg-cfg-badge.test { background: #1d4ed8; }
.eg-cfg-x { flex: 0; padding: 6px 12px; color: inherit; }
.eg-dd-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.eg-dd-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #334155; background: #1e293b; color: #e2e8f0;
  border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; font-family: inherit;
  transition: transform .12s, border-color .12s, background .12s;
}
.eg-dd-btn:hover { transform: translateY(-1px); border-color: #60a5fa; }
.eg-dd-btn.open { border-color: #2563eb; background: #1d4ed8; color: #fff; }
html[data-theme="light"] .eg-dd-btn {
  background: #ffffff; border-color: #cbd5e1; color: #0f172a;
}
html[data-theme="light"] .eg-dd-btn.open { background: #2563eb; color: #fff; border-color: #2563eb; }
.eg-btn-svg, .eg-chip-svg { width: 16px; height: 16px; flex-shrink: 0; }
.eg-filter-pans { margin-bottom: 8px; }
.eg-filter-pan {
  border: 1px solid #334155; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
  background: #111827; animation: egPanIn .22s ease;
}
html[data-theme="light"] .eg-filter-pan { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.eg-filter-pan h5 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #94a3b8; }
html[data-theme="light"] .eg-filter-pan h5 { color: #64748b; }
.eg-check-row {
  display: flex; align-items: center; gap: 8px; padding: 7px 6px; border-radius: 8px;
  font-size: 13px; font-weight: 600; cursor: pointer; color: inherit;
}
.eg-check-row:hover { background: rgba(37,99,235,.12); }
.eg-check-row input { accent-color: #2563eb; width: 16px; height: 16px; }
@keyframes egPanIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.eg-cfg h4 { margin: 16px 0 8px; font-size: 13px; display: flex; align-items: center; gap: 6px; color: inherit; }
.eg-sub-count { margin-left: auto; font-weight: 700; color: #64748b; }
.eg-lang, .eg-sub-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.eg-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px;
  border: 2px solid #475569; background: #1e293b; color: #f1f5f9;
  cursor: pointer; font-weight: 800; font-size: 13px; font-family: inherit;
  transition: transform .16s cubic-bezier(.2,.8,.2,1), background .16s, border-color .16s, box-shadow .16s;
}
.eg-chip-tick { display: none; font-weight: 900; }
.eg-chip.on {
  background: #2563eb; border-color: #93c5fd; color: #fff;
  box-shadow: 0 6px 16px rgba(37,99,235,.35);
  animation: egChipPop .28s cubic-bezier(.2,.8,.2,1);
}
.eg-chip.on .eg-chip-tick { display: inline; }
.eg-chip:not(.on):hover { transform: translateY(-1px); border-color: #60a5fa; }
html[data-theme="light"] .eg-chip {
  background: #ffffff; border-color: #94a3b8; color: #0f172a;
}
html[data-theme="light"] .eg-chip.on {
  background: #2563eb; border-color: #1d4ed8; color: #fff;
}
.eg-chip input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
@keyframes egChipPop {
  0% { transform: scale(.92); }
  60% { transform: scale(1.06); }
  100% { transform: scale(1); }
}
.eg-resume-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.eg-cfg-resume {
  display: block; padding: 14px 12px; border: 1px solid #334155; border-radius: 12px; cursor: pointer;
  background: #0f172a; color: inherit; transition: border-color .15s, box-shadow .15s;
}
html[data-theme="light"] .eg-cfg-resume { background: #f8fafc; border-color: #cbd5e1; color: #0f172a; }
.eg-cfg-resume.on { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.35); }
.eg-cfg-resume strong { display: block; margin-bottom: 4px; color: inherit; }
.eg-cfg-resume small { color: #94a3b8; font-size: 12px; }
html[data-theme="light"] .eg-cfg-resume small { color: #475569; }
.eg-cfg-go {
  width: 100%; margin-top: 16px; background: #2563eb; color: #fff; border: 0;
  border-radius: 12px; padding: 14px; font-weight: 800; cursor: pointer; font-family: inherit; font-size: 15px;
  transition: transform .12s, filter .12s;
}
.eg-cfg-go:hover { filter: brightness(1.08); transform: translateY(-1px); }

.cpyqb-eg-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
}
.cpyqb-eg-actions .pyqmock-take,
.cpyqb-eg-actions .pyqmock-practice {
  flex: 1;
  min-width: 140px;
  height: 46px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

html[data-theme="light"] .pyqmock-search,
html[data-theme="light"] .pyqmock-year-select,
html[data-theme="light"] .pyqmock-filter-btn {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}
html[data-theme="light"] .pyqmock-search::placeholder { color: #64748b; }
html[data-theme="light"] .marks-modal {
  background: #ffffff; color: #0f172a; border-color: #e2e8f0;
}
html[data-theme="light"] .marks-modal-head,
html[data-theme="light"] .marks-modal-foot { border-color: #e2e8f0; }
html[data-theme="light"] .marks-modal-cancel { background: #e2e8f0; color: #0f172a; }
html[data-theme="light"] .marks-radio { color: #0f172a; }
@media (max-width: 720px) {
  .eg-resume-grid { grid-template-columns: 1fr; }
  .eg-test-root.eg-desktop-mode.eg-side-open .eg-qbar {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    gap: 5px;
    padding: 8px 10px;
    min-height: 46px;
  }
  .eg-test-root.eg-desktop-mode.eg-side-open .eg-qbar-n { display: inline-flex !important; visibility: visible !important; }
  .eg-q-num { display: inline-flex !important; }
  .eg-q-meta { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .eg-resume-grid { grid-template-columns: 1fr; }
}

/* Create-own-test folders */
.ct-wiz-folder-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px;
}
.ct-wiz-ch-card.ct-folder {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 12px 10px 10px; min-height: 148px;
  animation: ctFolderIn .45s cubic-bezier(.2,.8,.2,1) both;
  transform-origin: 50% 80%;
}
.ct-wiz-ch-card.ct-folder .ct-wiz-ch-card-ic {
  width: 72px; height: 72px;
}
.ct-wiz-ch-card.ct-folder .qx-ch-3d-img,
.ct-wiz-ch-card.ct-folder img {
  width: 72px; height: 72px; object-fit: contain; filter: drop-shadow(0 8px 12px rgba(0,0,0,.35));
}
.ct-wiz-ch-card.ct-folder .ct-wiz-ch-check { position: absolute; top: 8px; left: 8px; }
.ct-wiz-ch-card.ct-folder { position: relative; }
@keyframes ctFolderIn {
  from { opacity: 0; transform: translateY(14px) scale(.92); }
  to { opacity: 1; transform: none; }
}
.ct-share-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid #334155; background: #1e293b; color: #93c5fd;
  border-radius: 10px; padding: 8px 12px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.ct-share-row { display: flex; gap: 8px; margin: 10px 0 14px; flex-wrap: wrap; }
.ct-share-url {
  flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155;
  background: #0b1220; color: #cbd5e1; font-size: 12px;
}


/* Fix mobile 100vh bug hiding footer */
.eg-test-root {
  height: 100dvh !important;
}

@media (max-width: 900px) {
  /* removed */
}


/* ── Inline bottom solution panel (under options / Check Answer) ── */
.eg-sol-panel {
  display: block !important;
  position: relative !important;
  inset: auto !important;
  z-index: 2 !important;
  margin: 16px 0 24px !important;
  padding: 0 !important;
  background: var(--eg-card, #fff) !important;
  border: 1px solid var(--eg-line, #e2e8f0) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}
.eg-sol-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: #1a73e8;
  color: #fff;
  border-bottom: 1px solid #1557b0;
}
.eg-sol-panel-head strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .02em;
}
.eg-sol-panel-close {
  width: 34px; height: 34px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,.18);
  color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; line-height: 1;
}
.eg-sol-panel-close:hover { background: rgba(255,255,255,.3); }
.eg-sol-panel .eg-sol,
.eg-sol-panel .eg-sol-inline {
  margin: 0 !important;
  padding: 16px 16px 22px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  max-width: none;
  width: 100%;
  box-sizing: border-box;
  overflow: visible;
}
.eg-test-root[data-test-theme="dark"] .eg-sol-panel {
  background: #0f172a !important;
  border-color: #1e293b !important;
  color: #e2e8f0;
}
.eg-test-root[data-test-theme="dark"] .eg-sol-panel-head {
  background: #1e3a8a;
  border-bottom-color: #1e40af;
}
@media (max-width: 720px) {
  .eg-sol-panel .eg-sol { padding: 12px 12px 20px !important; }
}

/* Legacy overlay class → treat as bottom panel if any stale HTML */
.eg-sol-overlay {
  position: relative !important;
  inset: auto !important;
  z-index: 2 !important;
  background: transparent !important;
  display: block !important;
  padding: 0 !important;
  margin: 16px 0 24px !important;
}
.eg-sol-overlay-panel {
  width: 100%;
  max-width: none;
  height: auto;
  max-height: none;
  background: var(--eg-card, #fff);
  display: block;
  border-radius: 12px;
  border: 1px solid var(--eg-line, #e2e8f0);
  overflow: hidden;
}
.eg-sol-overlay-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #1a73e8; color: #fff; }
.eg-sol-overlay-close { width: 34px; height: 34px; border: none; border-radius: 8px; background: rgba(255,255,255,.18); color: #fff; cursor: pointer; }

/* iOS/Android immersive fullscreen polyfill */
html.qx-immersive,
body.qx-immersive {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
.eg-test-root.qx-immersive,
html.qx-immersive .eg-test-root,
body.qx-immersive .eg-test-root {
  position: fixed !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100dvh !important;
  z-index: 2147483000 !important;
  background: var(--eg-bg, #eef2f7) !important;
}
.eg-fmt-pop { z-index: 90 !important; }


/* ========== QXNAV3_EG_SIMPLE: light Q-strip + always foot + compact mobile ========== */

/* A) Q strip: show when strip-open OR (legacy) side-open — NEVER hide strip solely because side collapsed (qxeg6 kills QXFAST6 coupling) */
.eg-test-root.eg-desktop-mode.eg-side-open .eg-qbar.eg-strip,
.eg-test-root.eg-side-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-strip-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-strip-open #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* Hide strip only when explicitly collapsed / not strip-open — do NOT key off side-collapsed */
.eg-test-root.eg-strip-collapsed .eg-qbar,
.eg-test-root.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-strip-collapsed #egQBar,
.eg-test-root:not(.eg-strip-open):not(.eg-side-open):not(.eg-desktop-mode) .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}
.eg-qbar-n,
.eg-q-dot,
.eg-strip .eg-qbar-n,
.eg-strip .eg-q-dot {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 50% !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-shadow: none !important;
  box-sizing: border-box !important;
}
/* Unseen grey circles: clear border + dark numeral on light bg strip */
.eg-qbar-n.eg-unseen,
.eg-q-dot.eg-unseen,
.eg-test-root[data-test-theme="light"] .eg-qbar-n.eg-unseen,
.eg-test-root[data-test-theme="light"] .eg-q-dot.eg-unseen,
html[data-theme="light"] .eg-qbar-n.eg-unseen,
html[data-theme="light"] .eg-q-dot.eg-unseen {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 2px solid #94a3b8 !important;
}
/* Status colors keep white numerals + contrast */
.eg-qbar-n.eg-correct, .eg-q-dot.eg-correct,
.eg-qbar-n.eg-attempted, .eg-q-dot.eg-attempted { background: #22c55e !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #16a34a !important; }
.eg-qbar-n.eg-wrong, .eg-q-dot.eg-wrong { background: #ef4444 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #dc2626 !important; }
.eg-qbar-n.eg-att, .eg-q-dot.eg-att { background: #3b82f6 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #2563eb !important; }
.eg-qbar-n.eg-seen, .eg-q-dot.eg-seen { background: #f59e0b !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #d97706 !important; }
.eg-qbar-n.eg-seen-test, .eg-q-dot.eg-seen-test { background: #ef4444 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #dc2626 !important; }
.eg-qbar-n.eg-marked, .eg-q-dot.eg-marked,
.eg-qbar-n.eg-att-mark, .eg-q-dot.eg-att-mark { background: #a855f7 !important; color: #fff !important; -webkit-text-fill-color: #fff !important; border: 2px solid #7c3aed !important; }
/* Current: orange (practice) / blue (test) — keep contrast on light */
.eg-qbar-n.cur,
.eg-q-dot.cur {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
}
.eg-test-root[data-eg-mode="practice"] .eg-qbar-n.cur,
.eg-test-root[data-eg-mode="practice"] .eg-q-dot.cur {
  outline-color: #f59e0b !important;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35) !important;
}
.eg-test-root[data-test-theme="light"] .eg-qbar,
.eg-test-root[data-test-theme="light"] .eg-strip,
html[data-theme="light"] .eg-qbar,
html[data-theme="light"] .eg-strip {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
  color: #0f172a !important;
}

/* B) Prev/Next footer — always fixed, never hidden, contrast on light */
.eg-foot,
.eg-test-root > .eg-foot,
.eg-test-root.eg-side-collapsed .eg-foot,
.eg-test-root.eg-side-open .eg-foot,
.eg-test-root:not(.eg-side-collapsed) .eg-foot,
body.qx-q-fullscreen .eg-foot,
html.qx-q-fullscreen .eg-foot,
body.qx-immersive .eg-foot,
html.qx-immersive .eg-foot,
.qx-prac-foot.eg-foot,
.allen-practice .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 13000 !important;
  transform: none !important;
  clip: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.eg-test-root[data-test-theme="light"] .eg-foot,
html[data-theme="light"] .eg-foot,
html[data-theme="light"] .qx-prac-foot.eg-foot {
  background: transparent !important;
  color: #0f172a !important;
  border-top: none !important;
  box-shadow: none !important;
}
.eg-foot .eg-btn,
.eg-foot-right .eg-btn,
.eg-foot #qxPrevBtn,
.eg-foot #qxNextBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid #cbd5e1 !important;
}
.eg-foot .eg-btn-next,
.eg-foot #qxNextBtn.eg-btn-next {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #2563eb !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot .eg-btn:not(.eg-btn-next),
.eg-test-root[data-test-theme="dark"] .eg-foot #qxPrevBtn {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}

/* C) Sidebar: header above scrim so hamburger stays tappable; one-tap close */
@media (max-width: 900px) {
  .eg-test-root.eg-side-open .eg-top,
  .eg-test-root:not(.eg-side-collapsed) .eg-top {
    z-index: 12070 !important;
  }
  .eg-test-root.eg-side-open .eg-top-tools,
  .eg-test-root:not(.eg-side-collapsed) .eg-top-tools {
    z-index: 12071 !important;
  }
  .eg-test-root.eg-side-open #egMenuBtn,
  .eg-test-root:not(.eg-side-collapsed) #egMenuBtn {
    position: relative;
    z-index: 12072 !important;
  }
  /* Scrim below header, above content — foot stays highest */
  .eg-test-root.eg-side-open .eg-side-scrim,
  .eg-test-root:not(.eg-side-collapsed) .eg-side-scrim {
    z-index: 12040 !important;
  }
  .eg-test-root.eg-side-open .eg-side,
  .eg-test-root:not(.eg-side-collapsed) .eg-side {
    z-index: 12050 !important;
    bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* D) ExamGoal-simple mobile density — maximize question + options */
@media (max-width: 720px) {
  .eg-top {
    min-height: 44px !important;
    padding: 4px 6px !important;
    flex-wrap: nowrap !important;
    row-gap: 0 !important;
  }
  .eg-top-title {
    flex: 1 1 auto !important;
    font-size: 13px !important;
    white-space: nowrap !important;
  }
  .eg-mode-pill { display: none !important; }
  .eg-top-tools {
    flex: 0 0 auto !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    max-width: 58%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .eg-top-tools .eg-ico {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    border-radius: 8px !important;
  }
  .eg-top-tools .eg-ico svg { width: 18px !important; height: 18px !important; }
  .eg-subs {
    padding: 2px 6px !important;
    min-height: 0 !important;
    gap: 4px !important;
  }
  .eg-sub { padding: 4px 8px !important; font-size: 12px !important; }
  .eg-qbar,
  .eg-strip {
    padding: 4px 8px !important;
    gap: 4px !important;
    min-height: 38px !important;
  }
  .eg-qbar-n,
  .eg-q-dot {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    font-size: 11px !important;
  }
  .eg-q-meta {
    padding: 6px 8px !important;
    gap: 6px !important;
    margin-bottom: 4px !important;
  }
  .eg-q-card {
    padding: 8px 10px calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-main {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-opts,
  .eg-test-root #qxOpts {
    gap: 8px !important;
  }
  .eg-test-root #qxOpts .eg-opt,
  .eg-test-root #qxOpts .mtk-opt,
  .eg-opts .eg-opt,
  .eg-opts .mtk-opt {
    min-height: 44px !important;
    padding: 8px 10px !important;
  }
  .eg-foot {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.08) !important;
  }
  .eg-foot-left {
    flex: 0 0 auto !important;
    width: auto !important;
    margin: 0 !important;
  }
  .eg-foot-right {
    flex: 1 1 auto !important;
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)) !important;
    gap: 6px !important;
    width: auto !important;
  }
  .eg-foot-right #qxPrevBtn,
  .eg-foot-right #qxNextBtn,
  .eg-foot-right .eg-btn-next {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  /* Close-palette chip is secondary on thin foot */
  .eg-foot-right .eg-btn-close-pal {
    display: none !important;
  }
  .eg-foot .eg-btn,
  .eg-foot-right .eg-btn {
    min-height: 40px !important;
    padding: 6px 8px !important;
    font-size: 12px !important;
    border-radius: 8px !important;
  }
  .eg-show { font-size: 11px !important; gap: 6px !important; }
  .eg-switch { width: 34px; height: 18px; }
  .eg-switch-knob { width: 34px; height: 18px; }
  .eg-switch-knob::after { width: 14px; height: 14px; top: 2px; left: 2px; }
  .eg-switch input:checked + .eg-switch-knob::after { transform: translateX(16px); }
  .eg-action-row { margin: 8px 0 4px !important; }
  .eg-check { min-height: 40px !important; padding: 8px 12px !important; font-size: 13px !important; }
}

/* ========== QXTOOL1: submit always + 4-click tools + circles + tips + compact ========== */

/* Submit always visible (desktop + mobile) — side may be closed */
.eg-submit-always,
.eg-test-root[data-eg-mode="test"] .eg-submit.eg-submit-always,
.eg-foot .eg-submit-always,
#qxSubmitTop.eg-submit-always {
  display: flex !important;
  width: 100%;
  margin-top: 8px;
  position: relative;
  z-index: 13050 !important;
  pointer-events: auto !important;
  opacity: 1 !important;
  visibility: visible !important;
  min-height: 46px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 4px 14px rgba(37, 99, 235, .35);
}
.eg-side-foot .eg-submit,
#qxSubmitBtn.eg-submit {
  pointer-events: auto !important;
  z-index: 13060 !important;
  position: relative;
}

/* Extra tools row — collapsed by default */
.eg-tools-row {
  display: none;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 10px 8px;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-bottom: 1px solid #dbe3ee;
  min-height: 0;
}
.eg-tools-row.is-open,
.eg-test-root.eg-tools-open .eg-tools-row {
  display: flex !important;
}
.eg-test-root[data-test-theme="dark"] .eg-tools-row {
  background: linear-gradient(180deg, #0f1a2e 0%, #0b1220 100%);
  border-bottom-color: #1e293b;
}
.eg-tool-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid #c5d4e8;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  transition: background .12s, border-color .12s, transform .08s;
}
.eg-tool-btn svg { width: 18px; height: 18px; }
.eg-tool-btn:hover,
.eg-tool-btn:focus-visible {
  background: #eff6ff;
  border-color: #3b82f6;
  outline: none;
}
.eg-tool-btn.on {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}
.eg-tool-btn .eg-tip {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #ffffff;
  opacity: 1;
  display: block;
  pointer-events: none;
  z-index: auto;
  box-shadow: none;
}
.eg-tool-btn.tip-on .eg-tip,
.eg-tool-btn:hover .eg-tip,
.eg-tool-btn:focus-visible .eg-tip {
  opacity: 1;
  transform: none;
}
.eg-test-root[data-test-theme="dark"] .eg-tool-btn {
  background: #1e293b;
  border-color: #334155;
  color: #e2e8f0;
}
.eg-test-root[data-test-theme="dark"] .eg-tool-btn.on {
  background: #3b82f6;
  color: #fff;
}
.eg-cycle-btn.on {
  background: rgba(37,99,235,.18) !important;
  color: #1d4ed8 !important;
}

/* Beautiful question circles — strip + side */
.eg-qbar-n,
.eg-q-dot,
.eg-pal-cell,
.eg-strip .eg-qbar-n {
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  min-height: 34px !important;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  line-height: 1 !important;
  letter-spacing: -.02em;
  box-shadow: 0 1px 3px rgba(15,23,42,.12), inset 0 1px 0 rgba(255,255,255,.25);
  border: 2px solid transparent !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  transition: transform .1s, box-shadow .12s;
}
.eg-qbar-n:hover,
.eg-pal-cell:hover { transform: scale(1.1); }
.eg-qbar-n.eg-unseen,
.eg-q-dot.eg-unseen,
.eg-pal-cell.eg-unseen {
  background: #e2e8f0 !important;
  color: #334155 !important;
  -webkit-text-fill-color: #334155 !important;
  border-color: #94a3b8 !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.08);
}
.eg-test-root[data-test-theme="dark"] .eg-qbar-n.eg-unseen,
.eg-test-root[data-test-theme="dark"] .eg-pal-cell.eg-unseen {
  background: #334155 !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  border-color: #64748b !important;
}
.eg-qbar-n.cur,
.eg-q-dot.cur,
.eg-pal-cell.cur {
  outline: 3px solid #ef4444 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,.25), 0 2px 6px rgba(15,23,42,.18) !important;
}

/* Compact paper meta + difficulty */
.eg-paper-meta-compact,
.eg-q-card .qx-paper-meta.eg-paper-meta-compact {
  margin: 2px 0 6px !important;
  padding: 0 !important;
}
.eg-paper-meta-compact .qx-paper-meta-chips,
.eg-q-card .eg-paper-meta-compact .qx-paper-meta-chips {
  display: flex !important;
  flex-wrap: wrap;
  gap: 4px !important;
  align-items: center;
}
.eg-paper-meta-compact .qx-paper-chip,
.eg-q-card .eg-paper-meta-compact .qx-paper-chip {
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  line-height: 1.35 !important;
  max-width: 100%;
}
.eg-sol-diff-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px !important;
  padding: 0 !important;
}
.eg-sol-diff-row .tag,
.eg-sol-diff-row .eg-diff-compact,
.eg-diff-compact {
  display: inline-flex !important;
  align-items: center;
  font-size: 11px !important;
  font-weight: 800 !important;
  letter-spacing: .03em;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  margin: 0 !important;
  line-height: 1.3 !important;
}
.eg-diff-compact.diff-easy,
.tag-diff.diff-easy { background: #dcfce7; color: #166534; }
.eg-diff-compact.diff-medium,
.tag-diff.diff-medium { background: #fef3c7; color: #92400e; }
.eg-diff-compact.diff-hard,
.tag-diff.diff-hard { background: #fee2e2; color: #991b1b; }

/* EG-like bright numerical inside EG root */
.eg-test-root .qx-num-entry.qx-num-panel,
.eg-test-root .qx-num-cbt {
  max-width: 240px !important;
  padding: 14px 14px 12px !important;
  border: 2px solid #93c5fd !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, #ffffff 0%, #eff6ff 100%) !important;
  box-shadow: 0 8px 24px rgba(37,99,235,.12) !important;
}
.eg-test-root .qx-num-input {
  max-width: 140px !important;
  min-height: 48px !important;
  height: 48px !important;
  font-size: 22px !important;
  border-width: 2px !important;
  border-radius: 10px !important;
}
.eg-test-root .qx-num-keypad {
  max-width: 220px !important;
  gap: 8px !important;
}
.eg-test-root .qx-num-key {
  min-height: 46px !important;
  padding: 10px 6px !important;
  font-size: 18px !important;
  border-radius: 10px !important;
  border: 1px solid #60a5fa !important;
  background: #fff !important;
  box-shadow: 0 2px 0 #bfdbfe;
}
.eg-test-root .qx-num-key:active {
  transform: translateY(1px);
  box-shadow: none;
}
.eg-test-root .qx-num-key-back,
.eg-test-root .qx-num-key-clear {
  min-height: 40px !important;
  font-size: 14px !important;
}

/* Uniform practice/test header tools align */
.qx-prac-tools.mtk-header-tools,
.allen-practice .mtk-header-tools,
.qx-practice-page .qx-prac-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.allen-practice .qx-paper-meta,
.qx-practice-page .qx-paper-meta,
.egmq-root .qx-paper-meta {
  margin: 2px 0 6px !important;
}
.allen-practice .qx-paper-chip,
.qx-practice-page .qx-paper-chip {
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
}

/* ========== QXTOOL1b: mobile default + grid overlay foot above ========== */

/* qxtool4: mobile Q strip ALWAYS visible — exclude qxtool8 (All-Q toggles strip) */
@media (max-width: 900px) {
  .eg-test-root:not(.eg-qxtool8).eg-mobile.eg-side-collapsed .eg-qbar.eg-strip,
  .eg-test-root:not(.eg-qxtool8).eg-mobile .eg-qbar.eg-strip-collapsed,
  .eg-test-root:not(.eg-qxtool8).eg-mobile.eg-side-open .eg-qbar.eg-strip {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
  }

  /* Q-grid overlay must NOT cover Prev/Next footer */
  .eg-test-root.eg-side-open .eg-side,
  .eg-test-root:not(.eg-side-collapsed) .eg-side {
    top: 52px !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    max-height: none !important;
    z-index: 12050 !important;
    padding-bottom: 12px !important;
  }
  .eg-test-root.eg-side-open .eg-side-scrim,
  .eg-test-root:not(.eg-side-collapsed) .eg-side-scrim {
    top: 0 !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    height: auto !important;
    z-index: 12040 !important;
  }
  .eg-test-root.eg-side-open .eg-foot,
  .eg-test-root:not(.eg-side-collapsed) .eg-foot,
  .eg-test-root.eg-mobile .eg-foot {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 13080 !important;
    pointer-events: auto !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: flex !important;
    background: transparent !important;
    box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.14) !important;
  }
  .eg-test-root.eg-side-open .eg-foot .eg-btn,
  .eg-test-root.eg-side-open .eg-foot #qxPrevBtn,
  .eg-test-root.eg-side-open .eg-foot #qxNextBtn,
  .eg-test-root.eg-side-open .eg-foot #qxSaveBtn,
  .eg-test-root.eg-side-open .eg-foot #qxClearBtn {
    pointer-events: auto !important;
    position: relative;
    z-index: 13090 !important;
  }

  /* Header tools always visible — screenshot blue bar */
  .eg-top-tools {
    display: flex !important;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
  }
  .eg-top-tools .eg-ico,
  .eg-top-tools .eg-tool-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 0;
    background: transparent;
    color: #fff;
  }
  .eg-top-tools .eg-tip {
    background: #0f172a;
  }
}

/* Practice + allen + book question pages: same foot-above-palette rule */
@media (max-width: 900px) {
  .allen-practice .eg-foot,
  .qx-practice-page .eg-foot,
  .qx-book-mode .eg-foot,
  .qx-book-q .eg-foot,
  body.qx-book-mode .mtk-controls {
    z-index: 13080 !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    pointer-events: auto !important;
  }
  .allen-practice .mtk-palette,
  .allen-cbt.allen-practice .mtk-palette {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Compact Easy chip in paper meta row */
.eg-paper-meta-compact .tag-diff,
.qx-paper-meta-chips .eg-diff-compact,
.qx-paper-meta-chips .tag-diff {
  font-size: 11px !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-weight: 800 !important;
}

/* ========== QXTOOL2: immersive default + unified toolbar + ExamGoal meta ========== */
/* (retained; qxtool3 info-strip rules appended below) */

/* Hide second tools row forever — tools live in top header */
.eg-tools-row,
.eg-test-root.eg-tools-open .eg-tools-row,
.eg-test-root .eg-tools-row.is-open {
  display: none !important;
}

/* pre-qxtool8 strip show — excluded from qxtool8 (Menu toggles strip with side) */
.eg-test-root:not(.eg-qxtool8) .eg-qbar.eg-strip,
.eg-test-root:not(.eg-qxtool8).eg-side-collapsed .eg-qbar.eg-strip,
.eg-test-root:not(.eg-qxtool8).eg-side-open .eg-qbar.eg-strip,
.eg-test-root:not(.eg-qxtool8).eg-mobile.eg-side-collapsed .eg-qbar.eg-strip,
.eg-test-root:not(.eg-qxtool8) .eg-qbar.eg-strip-collapsed {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  pointer-events: auto !important;
}

@media (max-width: 720px) {
  .eg-test-root:not(.eg-qxtool8).eg-side-collapsed .eg-qbar,
  .eg-test-root:not(.eg-qxtool8) .eg-qbar.eg-strip-collapsed {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
  }
}

/* Compact header — maximize Q + options */
.eg-test-root.eg-compact .eg-top {
  min-height: 42px !important;
  padding: 2px 6px 2px 4px !important;
  gap: 6px !important;
}
.eg-test-root.eg-compact .eg-back {
  width: 34px !important;
  height: 34px !important;
  font-size: 20px !important;
}
.eg-test-root.eg-compact .eg-top-title {
  font-size: 13px !important;
}
.eg-test-root.eg-compact .eg-top-tools .eg-ico,
.eg-test-root.eg-compact .eg-top-tools .eg-tool-btn {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 8px !important;
}
.eg-test-root.eg-compact .eg-subs .eg-sub {
  padding: 8px 6px !important;
  font-size: 13px !important;
}
.eg-test-root.eg-compact .eg-q-meta {
  padding: 6px 10px 4px !important;
  gap: 8px !important;
  min-height: 0 !important;
}
.eg-test-root.eg-compact .eg-q-card {
  padding: 6px 10px 10px !important;
}
.eg-test-root.eg-compact .eg-q-stem {
  margin: 4px 0 8px !important;
}
.eg-test-root.eg-compact .eg-q-tools {
  display: none !important; /* moved to unified header */
}

/* Flag on state */
.eg-top-tools #egFlagBtn.on,
.eg-top-tools #egFlagBtn.eg-flag-on {
  background: rgba(168, 85, 247, 0.35) !important;
  color: #f5d0fe !important;
  box-shadow: inset 0 0 0 1px rgba(216, 180, 254, 0.6);
}

/* Foot ALWAYS above overlays */
.eg-test-root .eg-foot {
  z-index: 13080 !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: flex !important;
}

/* ExamGoal-like exam detail chips (exam / date / shift) — compact, no difficulty */
.eg-exam-meta.eg-paper-meta-compact,
.eg-q-card .qx-paper-meta.eg-exam-meta {
  margin: 2px 0 8px !important;
  padding: 6px 8px !important;
  border-radius: 10px !important;
  border: 1px solid #dbeafe !important;
  border-left: 3px solid #2563eb !important;
  background: transparent !important;
  box-shadow: none !important;
}
.eg-test-root[data-test-theme="dark"] .eg-exam-meta.eg-paper-meta-compact {
  background: linear-gradient(90deg, #0f1a2e 0%, #1a1208 100%) !important;
  border-color: #1e3a5f !important;
  border-left-color: #3b82f6 !important;
}
.eg-exam-meta .qx-paper-meta-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}
.eg-exam-meta .qx-paper-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
  max-width: 100%;
}
.eg-exam-meta .qx-paper-exam {
  border-color: #86efac !important;
  background: #f0fdf4 !important;
  color: #166534 !important;
}
.eg-exam-meta .qx-paper-date {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}
.eg-exam-meta .qx-paper-shift {
  border-color: #c4b5fd !important;
  background: #f5f3ff !important;
  color: #6d28d9 !important;
}
.eg-exam-meta .qx-paper-mode,
.eg-exam-meta .qx-paper-paper,
.eg-exam-meta .qx-paper-full {
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
  color: #334155 !important;
}
/* Never show difficulty on question meta */
.eg-q-card .qx-paper-diff,
.eg-exam-meta .qx-paper-diff,
.eg-q-card .tag-diff,
.eg-paper-meta-compact .tag-diff,
.eg-q-card .eg-diff-compact:not(.eg-sol-diff-row *) {
  display: none !important;
}
.eg-sol-diff-row .tag-diff,
.eg-sol-diff-row .eg-diff-compact {
  display: inline-flex !important;
}

/* Solution difficulty compact */
.eg-sol-diff-row {
  margin: 0 0 8px !important;
}


/* ========== QXTOOL3: single info strip under header ========== */
.eg-info-strip {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  margin: 0 !important;
  min-height: 36px !important;
  background: var(--eg-card, #fff) !important;
  border-bottom: 1px solid var(--eg-line, #e2e8f0) !important;
  flex-shrink: 0 !important;
  z-index: 20 !important;
}
.eg-test-root[data-test-theme="dark"] .eg-info-strip {
  background: var(--eg-card, #0b1220) !important;
  border-bottom-color: #1e293b !important;
}
.eg-info-strip .eg-q-num {
  width: auto !important;
  min-width: 36px !important;
  height: 28px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  background: var(--eg-blue, #2563eb) !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}
.eg-info-strip .eg-type {
  display: inline-flex !important;
  align-items: center !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  padding: 3px 10px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  margin-left: auto !important;
}
.eg-test-root[data-test-theme="dark"] .eg-info-strip .eg-type {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
.eg-info-strip .qx-paper-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #ffffff !important;
  color: #0f172a !important;
}
.eg-info-strip .qx-paper-date {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}
.eg-info-strip .qx-paper-shift {
  border-color: #c4b5fd !important;
  background: #f5f3ff !important;
  color: #6d28d9 !important;
}
.eg-test-root[data-test-theme="dark"] .eg-info-strip .qx-paper-chip {
  background: #0f172a !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
/* No second meta row inside card; no time/marks on Q chrome */
.eg-q-card > .eg-q-meta,
.eg-q-card > .qx-paper-meta,
.eg-q-card > .eg-exam-meta,
.eg-q-card > .eg-paper-meta-compact {
  display: none !important;
}
.eg-info-strip .eg-q-time,
.eg-info-strip .eg-mark,
.eg-info-strip .tag-diff,
.eg-info-strip .qx-paper-diff,
.eg-info-strip .diff-easy,
.eg-info-strip .diff-medium,
.eg-info-strip .diff-hard {
  display: none !important;
}
/* Compact: maximize stem space */
.eg-test-root.eg-compact .eg-info-strip {
  padding: 4px 10px !important;
  min-height: 32px !important;
  gap: 6px !important;
}
.eg-test-root.eg-compact .eg-subs {
  min-height: 0 !important;
}
.eg-test-root.eg-compact .eg-q-card {
  padding-top: 8px !important;
}


/* ========== QXFAST3: removed dead QXTOOL4 (eg-qxtool4 never applied; ~10KB) ========== */

/* ========== QXTOOL8: Quantrex toolbar (revert EG-screenshot clone) ========== */
/* Kill EG clone chrome leftovers */
.eg-test-root.eg-qxtool8 .eg-tools-extra,
.eg-test-root.eg-qxtool8 #egToolsExtra,
.eg-test-root.eg-qxtool8 .eg-exam-line,
.eg-test-root.eg-qxtool8 .eg-meta-row,
.eg-test-root.eg-qxtool8 .eg-type-line,
.eg-test-root.eg-qxtool8 .eg-q-card > .eg-q-meta,
.eg-test-root.eg-qxtool8 .eg-q-card > .eg-q-tools {
  display: none !important;
}

/* Quantrex header — tools live HERE (not Menu-only) */
.eg-test-root.eg-qxtool8 .eg-top {
  background: linear-gradient(90deg, #1e3a8a 0%, #2563eb 55%, #1d4ed8 100%) !important;
  min-height: 56px !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  z-index: 13000 !important;
  pointer-events: auto !important;
  padding: 4px 6px 4px 4px !important;
}
.eg-test-root.eg-qxtool8 .eg-subs {
  background: #1e40af !important;
}
.eg-test-root.eg-qxtool8 .eg-top-tools {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 2px !important;
  max-width: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  z-index: 13010 !important;
}
/* Labeled tool buttons — name text always visible under icon */
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-tool-btn,
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-ico {
  width: auto !important;
  min-width: 44px !important;
  height: auto !important;
  min-height: 40px !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  gap: 1px !important;
  padding: 3px 5px !important;
  color: #fff !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 8px !important;
  pointer-events: auto !important;
  position: relative !important;
}
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-tool-btn svg,
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-ico svg {
  width: 18px !important;
  height: 18px !important;
}
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-tip {
  position: static !important;
  transform: none !important;
  opacity: 1 !important;
  pointer-events: none !important;
  background: transparent !important;
  color: #dbeafe !important;
  box-shadow: none !important;
  padding: 0 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  letter-spacing: .01em;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-tool-btn.on,
.eg-test-root.eg-qxtool8 .eg-top-tools #egFlagBtn.on,
.eg-test-root.eg-qxtool8 .eg-top-tools #egFlagBtn.eg-flag-on,
.eg-test-root.eg-qxtool8 .eg-top-tools #egAllQBtn.on {
  background: rgba(255,255,255,.22) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.35);
}
.eg-test-root.eg-qxtool8 .eg-top-tools #egFlagBtn.on,
.eg-test-root.eg-qxtool8 .eg-top-tools #egFlagBtn.eg-flag-on {
  background: rgba(168, 85, 247, 0.45) !important;
  color: #f5d0fe !important;
}
.eg-test-root.eg-qxtool8 #egAllQBtn {
  pointer-events: auto !important;
  z-index: 13020 !important;
  cursor: pointer !important;
}

/* Top Q-strip: qxeg6 — follow strip-open/collapsed (NOT side-collapsed) */
.eg-test-root.eg-qxtool8.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8:not(.eg-strip-open) .eg-qbar.eg-strip-collapsed,
.eg-test-root.eg-qxtool8.eg-mobile.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8.eg-mobile:not(.eg-strip-open) .eg-qbar.eg-strip-collapsed {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  border: 0 !important;
}
.eg-test-root.eg-qxtool8.eg-strip-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-qxtool8.eg-side-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-qxtool8:not(.eg-side-collapsed) .eg-qbar.eg-strip:not(.eg-strip-collapsed) {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  background: #1e40af !important;
  border-bottom: 0 !important;
  padding: 6px 10px !important;
  gap: 6px !important;
  min-height: 40px !important;
  flex-shrink: 0 !important;
  overflow-x: auto !important;
}
.eg-test-root.eg-qxtool8 .eg-qbar-n,
.eg-test-root.eg-qxtool8 .eg-q-dot {
  color: #fff !important;
  background: rgba(255,255,255,.12) !important;
  border-radius: 8px !important;
  border: 0 !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  font-weight: 800 !important;
}
.eg-test-root.eg-qxtool8 .eg-qbar-n.cur,
.eg-test-root.eg-qxtool8 .eg-q-dot.cur {
  background: #fff !important;
  color: #1e3a8a !important;
  box-shadow: none !important;
}

/* Compact info strip ALWAYS visible — Q# + date/shift + type */
.eg-test-root.eg-qxtool8 .eg-info-strip,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-info-strip,
.eg-test-root.eg-qxtool8.eg-side-open .eg-info-strip {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 6px 12px !important;
  min-height: 36px !important;
  background: var(--eg-card, #fff) !important;
  border-bottom: 1px solid var(--eg-line, #e2e8f0) !important;
  flex-shrink: 0 !important;
  z-index: 20 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-info-strip {
  background: var(--eg-card, #0b1220) !important;
  border-bottom-color: #1e293b !important;
}

/* Foot ALWAYS visible — Prev/Next from first paint */
.eg-test-root.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-foot,
.eg-test-root.eg-qxtool8.eg-side-open .eg-foot,
.eg-test-root.eg-qxtool8 > .eg-foot,
#egFoot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 14000 !important;
  transform: none !important;
  background: #f1f5f9 !important;
  border-top: 1px solid #e2e8f0 !important;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  gap: 8px !important;
  flex-wrap: wrap !important;
}
.eg-test-root.eg-qxtool8 .eg-foot-right {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 1 1 100% !important;
}
.eg-test-root.eg-qxtool8 .eg-foot-left {
  width: 100% !important;
  margin: 0 !important;
}
.eg-test-root.eg-qxtool8 .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8 .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8 .eg-foot .eg-btn-next,
.eg-test-root.eg-qxtool8 .eg-foot #qxSaveBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  width: 100% !important;
  border-radius: 10px !important;
  background: #e2e8f0 !important;
  color: #15803d !important;
  border: 0 !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  text-transform: none !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot {
  background: #0f172a !important; /* qxmd238 solid foot */
  border-top-color: #1e293b !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxSaveBtn {
  background: #1e293b !important;
  color: #4ade80 !important;
}
.eg-test-root.eg-qxtool8 .eg-main,
.eg-test-root.eg-qxtool8 .eg-q-card {
  padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Side palette with All-Q */
.eg-test-root.eg-qxtool8.eg-side-open .eg-side {
  display: flex !important;
  z-index: 13500 !important;
}
.eg-test-root.eg-qxtool8.eg-side-open .eg-side-scrim {
  display: block !important;
  z-index: 13400 !important;
}
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-side,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-side-scrim {
  display: none !important;
}

/* Check Answer — Quantrex blue (not EG purple) */
.eg-test-root.eg-qxtool8 .eg-check {
  background: #2563eb !important;
  color: #fff !important;
  border: 0 !important;
  border-radius: 999px !important;
  min-height: 48px !important;
  font-weight: 800 !important;
  width: min(100%, 420px) !important;
}

@media (max-width: 900px) {
  .eg-test-root.eg-qxtool8 .eg-top,
  .eg-test-root.eg-qxtool8 .eg-top-tools,
  .eg-test-root.eg-qxtool8 #egAllQBtn,
  .eg-test-root.eg-qxtool8 #egFlagBtn {
    z-index: 13600 !important;
    pointer-events: auto !important;
  }
  .eg-test-root.eg-qxtool8 .eg-top-tools .eg-tool-btn {
    min-width: 40px !important;
    padding: 2px 4px !important;
  }
  .eg-test-root.eg-qxtool8 .eg-top-tools .eg-tip {
    font-size: 8px !important;
  }
}


/* ========== QXTOOL8: mobile-default + desktop-on-AllQ (qxeg6: strip independent of side) ========== */
.eg-test-root.eg-qxtool8.eg-mobile:not(.eg-strip-open) .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode):not(.eg-strip-open) .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode) .eg-qbar.eg-strip-collapsed {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
}
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode).eg-side-collapsed .eg-side,
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode).eg-side-collapsed .eg-side-scrim {
  display: none !important;
}
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode) .eg-body {
  grid-template-columns: 1fr !important;
}

/* All-Q open => eg-desktop-mode: top Q# strip + right palette */
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar.eg-strip:not(.eg-strip-collapsed) {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  min-height: 40px !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  padding: 6px 10px !important;
  background: #1e40af !important;
  border-bottom: 0 !important;
  flex-shrink: 0 !important;
  z-index: 50 !important;
  position: relative !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar-n,
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-q-dot {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  background: rgba(255,255,255,.12) !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 8px !important;
  font-weight: 800 !important;
  flex-shrink: 0 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar-n.cur,
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-q-dot.cur {
  background: #fff !important;
  color: #1e3a8a !important;
  -webkit-text-fill-color: #1e3a8a !important;
}

.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-body {
  display: grid !important;
  grid-template-columns: 1fr min(300px, 42vw) !important;
  min-height: 0 !important;
}

/* Desktop-mode side (tablet/desktop & mid widths): right column, not full-bleed sheet */
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side {
  display: flex !important;
  visibility: visible !important;
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  left: auto !important;
  bottom: auto !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  max-height: none !important;
  z-index: 30 !important;
  border-left: 1px solid var(--eg-line, #e2e8f0) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--eg-card, #fff) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px 16px !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side-scrim,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side-scrim {
  display: none !important;
}

@media (max-width: 900px) {
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar.eg-strip {
    display: flex !important;
    visibility: visible !important;
    height: auto !important;
    opacity: 1 !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side,
  .eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    height: auto !important;
    z-index: 30 !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side-scrim {
    display: none !important;
  }
}

/* Narrow phones: right drawer under Q-strip (numbers stay visible above) */
@media (max-width: 560px) {
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-body {
    grid-template-columns: 1fr !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side,
  .eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side {
    position: fixed !important;
    top: 96px !important;
    right: 0 !important;
    left: auto !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    width: min(320px, 88vw) !important;
    z-index: 13500 !important;
    border-left: 1px solid var(--eg-line, #e2e8f0) !important;
    box-shadow: -8px 0 24px rgba(15, 23, 42, 0.18) !important;
    border-radius: 12px 0 0 12px !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-side-scrim,
  .eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side-scrim {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 13400 !important;
    background: rgba(15, 23, 42, 0.35) !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-qbar.eg-strip {
    z-index: 13600 !important;
    position: relative !important;
  }
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-top,
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-subs,
  .eg-test-root.eg-qxtool8.eg-desktop-mode .eg-info-strip {
    z-index: 13610 !important;
    position: relative !important;
  }
}

.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-info-strip,
.eg-test-root.eg-qxtool8.eg-mobile .eg-info-strip {
  display: flex !important;
  visibility: visible !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode .eg-foot,
.eg-test-root.eg-qxtool8.eg-mobile .eg-foot {
  display: flex !important;
  visibility: visible !important;
  z-index: 14000 !important;
}


/* ========== QXTOOL8: solution-like question info pills (no difficulty) ========== */
.eg-test-root.eg-qxtool8 .eg-info-strip.eg-info-pills {
  display: flex !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 8px 12px !important;
  min-height: 44px !important;
  background: transparent !important;
  border-bottom: 1px solid var(--eg-line, #e2e8f0) !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .eg-q-num {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 999px !important;
  background: #2563eb !important;
  color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .eg-type,
.eg-test-root.eg-qxtool8 .eg-info-strip .eg-type-pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  background: #f1f5f9 !important;
  color: #334155 !important;
  border: 1px solid #cbd5e1 !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .eg-info-meta,
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-meta-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
}
/* Match solution pill language (exam / date / shift) — slightly simpler, no Easy/Hard */
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-chip {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  padding: 5px 12px !important;
  border-radius: 999px !important;
  white-space: nowrap !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-exam {
  color: #1e3a8a !important;
  background: linear-gradient(135deg, #dbeafe, #ede9fe) !important;
  border: 1px solid #93c5fd !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-date {
  color: #9a3412 !important;
  background: linear-gradient(135deg, #ffedd5, #fef3c7) !important;
  border: 1px solid #fdba74 !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-shift {
  color: #6b21a8 !important;
  background: linear-gradient(135deg, #f3e8ff, #e0e7ff) !important;
  border: 1px solid #c4b5fd !important;
}
.eg-test-root.eg-qxtool8 .eg-info-strip .qx-paper-diff,
.eg-test-root.eg-qxtool8 .eg-info-strip .tag-diff,
.eg-test-root.eg-qxtool8 .eg-info-strip .eg-diff-compact {
  display: none !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-info-strip.eg-info-pills {
  background: var(--eg-card, #0b1220) !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-info-strip .eg-type-pill {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
/* Hide tools-extra forever; one toolbar only */
.eg-test-root.eg-qxtool8 .eg-tools-extra,
.eg-test-root.eg-qxtool8 #egToolsExtra {
  display: none !important;
}


/* ========== QXTOOL8 P0: Prev/Next readable BOTH themes + solution fully visible ========== */
.eg-test-root.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot,
#egFoot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 14000 !important;
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
}
.eg-test-root.eg-qxtool8 .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8 .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8 .eg-foot #qxSaveBtn,
.eg-test-root.eg-qxtool8 .eg-foot .eg-btn,
.eg-test-root.eg-qxtool8 .eg-foot .eg-btn-next,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot #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 {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  background: #e2e8f0 !important;
  border: 1px solid #94a3b8 !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  text-shadow: none !important;
  mix-blend-mode: normal !important;
  filter: none !important;
}
.eg-test-root.eg-qxtool8 .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8 .eg-foot .eg-btn-next,
.eg-test-root.eg-qxtool8 .eg-foot #qxSaveBtn,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot #qxNextBtn {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #1d4ed8 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot {
  background: #0f172a !important; /* qxmd238 solid foot */
  border-top-color: #334155 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot .eg-btn:not(.eg-btn-next):not(#qxNextBtn):not(#qxSaveBtn) {
  background: #1e293b !important;
  color: #f8fafc !important;
  -webkit-text-fill-color: #f8fafc !important;
  border: 1px solid #475569 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot .eg-btn-next,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxSaveBtn {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

/* Toolbar always above overlays */
.eg-test-root.eg-qxtool8 .eg-top,
.eg-test-root.eg-qxtool8 .eg-top-tools,
.eg-test-root.eg-qxtool8 .eg-top-tools .eg-tool-btn {
  pointer-events: auto !important;
  z-index: 14050 !important;
}

/* Solution panel: NEVER hide / clip / invisible text in light OR dark */
.eg-test-root.eg-qxtool8 .eg-sol-panel,
.eg-test-root.eg-qxtool8 .eg-sol,
.eg-test-root.eg-qxtool8 .eg-sol-inline,
.eg-test-root.eg-qxtool8 .eg-sol .qx-sol-card,
.eg-test-root.eg-qxtool8 .eg-sol .qx-sol-flow,
.eg-test-root.eg-qxtool8 .eg-sol .sol-body,
.eg-test-root.eg-qxtool8 .eg-sol .qx-content {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
}
.eg-test-root.eg-qxtool8 .eg-sol-panel {
  overflow: visible !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-sol-panel,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-sol-panel,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-sol,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-sol {
  background: #ffffff !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-sol *,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-sol *:not(a):not(button):not(.tag-diff):not(.qx-sol-diff-badge):not(.qx-paper-chip) {
  color: inherit;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-sol-panel,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-sol,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-sol .qx-sol-card,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-sol .sol-body,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-sol .qx-sol-flow {
  background: #0f172a !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
}
.eg-test-root.eg-qxtool8 .eg-sol .qx-paper-chip,
.eg-test-root.eg-qxtool8 .eg-sol .qx-paper-meta,
.eg-test-root.eg-qxtool8 .eg-sol .eg-sol-diff-row,
.eg-test-root.eg-qxtool8 .eg-sol mjx-container,
.eg-test-root.eg-qxtool8 .eg-sol .MathJax,
.eg-test-root.eg-qxtool8 .eg-sol img {
  display: revert !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-height: none !important;
}
.eg-test-root.eg-qxtool8 .eg-sol mjx-container {
  display: inline-block !important;
  color: inherit !important;
}


/* ========== QXTOOL8 NUCLEAR FOOT — light+dark Prev/Next always ========== */
.eg-test-root.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-foot,
.eg-test-root.eg-qxtool8.eg-side-open .eg-foot,
.eg-test-root.eg-qxtool8.eg-mobile .eg-foot,
.eg-test-root.eg-qxtool8.eg-desktop-mode .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-qxtool8:not([data-test-theme="dark"]) .eg-foot,
html[data-theme="light"] .eg-test-root.eg-qxtool8 .eg-foot,
html[data-theme="dark"] .eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot,
#egFoot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 99999 !important;
  transform: none !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 56px !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  margin: 0 !important;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  background: #f8fafc !important;
  border-top: 1px solid #cbd5e1 !important;
  box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.12) !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot,
html[data-theme="dark"] .eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot {
  background: #0f172a !important; /* qxmd238 solid foot */
  border-top-color: #334155 !important;
}
.eg-test-root.eg-qxtool8 .eg-foot-right {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root.eg-qxtool8 .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8 .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8 .eg-foot #qxSaveBtn,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot #qxPrevBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot #qxPrevBtn,
html[data-theme="light"] .eg-test-root.eg-qxtool8 .eg-foot #qxPrevBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-height: 48px !important;
  width: 100% !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  border-radius: 10px !important;
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}
.eg-test-root.eg-qxtool8 .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8 .eg-foot .eg-btn-next,
.eg-test-root.eg-qxtool8 .eg-foot #qxSaveBtn,
.eg-test-root.eg-qxtool8[data-test-theme="light"] .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8:not([data-test-theme="dark"]) .eg-foot #qxNextBtn {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border-color: #1d4ed8 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxPrevBtn {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  border-color: #475569 !important;
}
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxNextBtn,
.eg-test-root.eg-qxtool8[data-test-theme="dark"] .eg-foot #qxSaveBtn {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.eg-test-root.eg-qxtool8 .eg-main,
.eg-test-root.eg-qxtool8 .eg-q-card {
  padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ========== QXFAST3: class-based strip/side (avoid JS style thrash) ========== */
.eg-test-root.eg-qxtool8.eg-desktop-mode #egQBar,
.eg-test-root.eg-qxtool8.eg-side-open #egQBar {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  overflow-x: auto !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode #egQBar .eg-qbar-n,
.eg-test-root.eg-qxtool8.eg-desktop-mode #egQBar .eg-q-dot,
.eg-test-root.eg-qxtool8.eg-side-open #egQBar .eg-qbar-n,
.eg-test-root.eg-qxtool8.eg-side-open #egQBar .eg-q-dot {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
/* qxeg6: do NOT hide #egQBar on side-collapsed — only when strip not open */
.eg-test-root.eg-qxtool8.eg-mobile:not(.eg-desktop-mode):not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxtool8:not(.eg-strip-open).eg-strip-collapsed #egQBar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode #egSide,
.eg-test-root.eg-qxtool8.eg-side-open #egSide {
  display: flex !important;
  visibility: visible !important;
}
.eg-test-root.eg-qxtool8.eg-side-collapsed #egSide {
  display: none !important;
}
.eg-test-root.eg-qxtool8 #egInfoStrip {
  display: flex !important;
  visibility: visible !important;
}


/* ========== QXFAST6 P0 (qxeg6 NEUTRALIZED): strip follows strip flags ONLY — never hide #egQBar because side-collapsed ========== */
.eg-test-root.eg-qxtool8.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxtool8.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8:not(.eg-strip-open):not(.eg-desktop-mode) #egQBar,
.eg-test-root.eg-qxtool8:not(.eg-strip-open):not(.eg-desktop-mode) .eg-qbar.eg-strip,
.eg-test-root.eg-qxtool8 .eg-qbar.eg-strip-collapsed {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}
.eg-test-root.eg-qxtool8.eg-side-collapsed #egSide,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-side,
.eg-test-root.eg-qxtool8.eg-side-collapsed .eg-side-scrim,
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode):not(.eg-side-open) #egSide,
.eg-test-root.eg-qxtool8:not(.eg-desktop-mode):not(.eg-side-open) .eg-side {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* All-Q / strip-open: top strip with CIRCLES (independent of side) */
.eg-test-root.eg-qxtool8.eg-strip-open #egQBar,
.eg-test-root.eg-qxtool8.eg-strip-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-strip-open #egQBar,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open #egQBar,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-qbar.eg-strip:not(.eg-strip-collapsed) {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 40px !important;
  padding: 6px 10px !important;
  overflow-x: auto !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 50 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open #egSide,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-side {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 13500 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-qbar-n,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-q-dot,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-pal-cell {
  display: inline-flex !important;
  visibility: visible !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  min-height: 32px !important;
  align-items: center !important;
  justify-content: center !important;
  font-weight: 800 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* Dark light-board when All-Q open */
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] #egQBar,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-qbar.eg-strip {
  background: #f1f5f9 !important;
  border-bottom: 1px solid #cbd5e1 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] #egSide,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-side {
  background: #f8fafc !important;
  color: #0f172a !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-side-head strong,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-side h4 {
  color: #0f172a !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-qbar-n.eg-unseen,
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open[data-test-theme="dark"] .eg-pal-cell.eg-unseen {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 2px solid #94a3b8 !important;
}
.eg-test-root.eg-qxtool8.eg-desktop-mode.eg-side-open:not([data-test-theme="dark"]) #egQBar {
  background: #eff6ff !important;
}

/* Foot Prev/Next/Save always above overlays */
.eg-test-root.eg-qxtool8 #egFoot,
.eg-test-root.eg-qxtool8 .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 200000 !important;
}
.eg-test-root.eg-qxtool8 #qxPrevBtn,
.eg-test-root.eg-qxtool8 #qxNextBtn,
.eg-test-root.eg-qxtool8 #qxSaveBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 200001 !important;
  min-height: 48px !important;
  cursor: pointer !important;
}

/* Submit always tappable above overlays */
.eg-test-root.eg-qxtool8 #qxSubmitTop,
.eg-test-root.eg-qxtool8 #qxSubmitBtn,
.eg-test-root.eg-qxtool8 [data-eg-submit] {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 200002 !important;
  cursor: pointer !important;
  position: relative !important;
}
.eg-test-root.eg-qxtool8 #egAllQBtn {
  pointer-events: auto !important;
  z-index: 200010 !important;
  cursor: pointer !important;
}
.eg-test-root.eg-qxtool8 #egToolsExtra { display: none !important; }
.eg-test-root.eg-qxtool8 #egMenuBtn,
.eg-test-root.eg-qxeg3 #egMenuBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 200012 !important;
  cursor: pointer !important;
}


/* ========== QXEG1: independent strip/side + ExamGoal meta + compact numerical ========== */

/* Strip close button */
.eg-strip-close {
  flex: 0 0 auto !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  border-radius: 8px !important;
  border: 1px solid #fecaca !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-right: 8px !important;
  padding: 0 !important;
  font-family: inherit !important;
  z-index: 5 !important;
}
.eg-strip-close:hover { background: #ef4444 !important; border-color: #ef4444 !important; color: #fff !important; }
.eg-qbar.eg-strip {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.eg-qbar-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  align-items: center !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex: 1 1 auto !important;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap !important;
}

/* INDEPENDENT visibility — strip follows strip flags only */
.eg-test-root.eg-qxeg1.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg1.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg1:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxeg1:not(.eg-strip-open) .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
  opacity: 0 !important;
}
.eg-test-root.eg-qxeg1.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg1.eg-strip-open .eg-qbar.eg-strip:not(.eg-strip-collapsed) {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* INDEPENDENT visibility — side follows side flags only (do NOT hide strip when side closes) */
.eg-test-root.eg-qxeg1.eg-side-collapsed #egSide,
.eg-test-root.eg-qxeg1:not(.eg-side-open) #egSide {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.eg-test-root.eg-qxeg1.eg-side-open #egSide {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
/* Break legacy coupling: side-collapsed must NOT hide #egQBar when strip is open */
.eg-test-root.eg-qxeg1.eg-side-collapsed.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg1.eg-side-collapsed.eg-strip-open .eg-qbar.eg-strip {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.eg-test-root.eg-qxeg1.eg-side-open.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg1.eg-side-open.eg-strip-collapsed .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  pointer-events: none !important;
}

/* ExamGoal compact meta: timer | +marks/−marks | paper | type */
.eg-test-root.eg-qxeg1 .eg-info-strip.eg-examgoal-meta {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px 8px !important;
  padding: 6px 12px !important;
  min-height: 34px !important;
}
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-q-time,
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-mark,
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-marks {
  display: inline-flex !important;
  visibility: visible !important;
  align-items: center !important;
  font-variant-numeric: tabular-nums !important;
  font-weight: 700 !important;
  font-size: 12px !important;
  color: inherit !important;
}
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-mark-pos { color: #16a34a !important; }
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-mark-neg { color: #dc2626 !important; }
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-meta-sep {
  color: #94a3b8 !important;
  font-weight: 600 !important;
  opacity: .85 !important;
}
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-paper-line {
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #15803d !important;
  max-width: min(52vw, 420px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-info-strip .eg-paper-line { color: #86efac !important; }
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-type {
  margin-left: 0 !important;
  background: #f3e8ff !important;
  border-color: #d8b4fe !important;
  color: #6b21a8 !important;
}
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-info-strip .eg-type {
  background: #3b0764 !important;
  border-color: #7e22ce !important;
  color: #e9d5ff !important;
}
.eg-test-root.eg-qxeg1 .eg-info-strip .eg-q-num { margin-left: auto !important; }
/* difficulty never on question meta */
.eg-test-root.eg-qxeg1 .eg-info-strip .tag-diff,
.eg-test-root.eg-qxeg1 .eg-info-strip .qx-paper-diff,
.eg-test-root.eg-qxeg1 .eg-info-strip .diff-easy,
.eg-test-root.eg-qxeg1 .eg-info-strip .diff-medium,
.eg-test-root.eg-qxeg1 .eg-info-strip .diff-hard { display: none !important; }

/* Light board for strip/side when open (dark theme) */
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-side {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: #cbd5e1 !important;
}
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-side .eg-legend,
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-side h4,
.eg-test-root.eg-qxeg1[data-test-theme="dark"] .eg-side-head strong {
  color: #0f172a !important;
}

/* qxeg1 numerical: rectangle box ONLY + small keypad — kill large panel chrome */
.eg-test-root .qx-num-entry.qx-num-panel,
.eg-test-root .qx-num-cbt,
.eg-test-root .qx-num-qxeg1,
.qx-num-entry.qx-num-qxeg1,
.qx-num-eg-compact.qx-num-qxeg1 {
  max-width: 148px !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.eg-test-root .qx-num-input,
.eg-test-root .eg-num-input,
.qx-num-qxeg1 .qx-num-input,
.qx-num-eg-compact .qx-num-input {
  max-width: 112px !important;
  width: 112px !important;
  min-height: 34px !important;
  height: 34px !important;
  font-size: 16px !important;
  border: 1.5px solid #94a3b8 !important;
  border-radius: 4px !important;
  background: #fff !important;
  color: #0f172a !important;
  text-align: left !important;
  padding: 4px 8px !important;
  box-shadow: none !important;
  letter-spacing: 0.03em !important;
}
.eg-test-root .qx-num-keypad,
.qx-num-qxeg1 .qx-num-keypad,
.qx-num-keypad-eg {
  max-width: 148px !important;
  gap: 3px !important;
}
.eg-test-root .qx-num-key,
.qx-num-qxeg1 .qx-num-key {
  min-height: 30px !important;
  height: 30px !important;
  font-size: 13px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  box-shadow: none !important;
}
.qx-num-badge, .qx-num-label, .qx-num-hint, .qx-num-eg-lab { display: none !important; }


/* ========== QXEG2: ExamGoal top strip independent + full-window when side ✕ + nuclear foot ========== */

/* A) Top horizontal Q# strip — OPEN when strip-open (even if side closed). Like ExamGoal. */
.eg-test-root.eg-qxeg2.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg2.eg-strip-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg2.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg2.eg-strip-open.eg-side-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg2.eg-desktop-mode.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-strip-open #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 42px !important;
  padding: 6px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 60 !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  gap: 6px !important;
  border: 0 !important;
}
.eg-test-root.eg-qxeg2.eg-strip-open #egQBar .eg-qbar-scroll,
.eg-test-root.eg-qxeg2.eg-strip-open .eg-qbar-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto !important;
}
.eg-test-root.eg-qxeg2.eg-strip-open #egQBar .eg-qbar-n,
.eg-test-root.eg-qxeg2.eg-strip-open #egQBar .eg-q-dot,
.eg-test-root.eg-qxeg2.eg-strip-open .eg-qbar-n {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 50% !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}
.eg-test-root.eg-qxeg2.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg2:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxeg2.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg2:not(.eg-strip-open) .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}

/* Break ALL legacy "side-collapsed hides strip" coupling for qxeg2 */
.eg-test-root.eg-qxeg2.eg-side-collapsed.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg2.eg-side-collapsed.eg-strip-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-side-collapsed.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-desktop-mode.eg-side-collapsed.eg-strip-open #egQBar {
  display: flex !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* B) Side palette ONLY when side-open — never force-show via desktop-mode */
.eg-test-root.eg-qxeg2.eg-side-collapsed #egSide,
.eg-test-root.eg-qxeg2.eg-side-collapsed .eg-side,
.eg-test-root.eg-qxeg2.eg-side-collapsed .eg-side-scrim,
.eg-test-root.eg-qxeg2:not(.eg-side-open) #egSide,
.eg-test-root.eg-qxeg2:not(.eg-side-open) .eg-side,
.eg-test-root.eg-qxeg2:not(.eg-side-open) .eg-side-scrim,
.eg-test-root.eg-qxeg2.eg-desktop-mode.eg-side-collapsed #egSide,
.eg-test-root.eg-qxeg2.eg-desktop-mode.eg-side-collapsed .eg-side,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-desktop-mode.eg-side-collapsed .eg-side {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}
.eg-test-root.eg-qxeg2.eg-side-open #egSide,
.eg-test-root.eg-qxeg2.eg-side-open .eg-side {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  width: auto !important;
  max-width: none !important;
  min-width: 0 !important;
}

/* C) FULL WINDOW when side closed — kill the 300px empty column from eg-desktop-mode */
.eg-test-root.eg-qxeg2.eg-side-collapsed .eg-body,
.eg-test-root.eg-qxeg2:not(.eg-side-open) .eg-body,
.eg-test-root.eg-qxeg2.eg-desktop-mode.eg-side-collapsed .eg-body,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-desktop-mode.eg-side-collapsed .eg-body,
.eg-test-root.eg-qxeg2.eg-strip-open.eg-side-collapsed .eg-body {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
  min-height: 0 !important;
}
.eg-test-root.eg-qxeg2.eg-side-collapsed .eg-main,
.eg-test-root.eg-qxeg2:not(.eg-side-open) .eg-main,
.eg-test-root.eg-qxeg2.eg-desktop-mode.eg-side-collapsed .eg-main,
.eg-test-root.eg-qxeg2.eg-strip-open.eg-side-collapsed .eg-main {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 auto !important;
}
.eg-test-root.eg-qxeg2.eg-side-open .eg-body,
.eg-test-root.eg-qxeg2.eg-qxtool8.eg-desktop-mode.eg-side-open .eg-body {
  display: grid !important;
  grid-template-columns: 1fr min(300px, 42vw) !important;
  min-height: 0 !important;
}
@media (max-width: 560px) {
  .eg-test-root.eg-qxeg2.eg-side-open .eg-body,
  .eg-test-root.eg-qxeg2.eg-desktop-mode.eg-side-open .eg-body {
    grid-template-columns: 1fr !important;
  }
}

/* D) Nuclear Prev/Next foot — always visible, app+website, light+dark contrast */
.eg-test-root.eg-qxeg2 #egFoot,
.eg-test-root.eg-qxeg2 .eg-foot,
.eg-test-root.eg-qxeg2.eg-side-collapsed .eg-foot,
.eg-test-root.eg-qxeg2.eg-side-open .eg-foot,
.eg-test-root.eg-qxeg2.eg-strip-open .eg-foot,
.eg-test-root.eg-qxeg2.eg-mobile .eg-foot,
.eg-test-root.eg-qxeg2.eg-desktop-mode .eg-foot,
body.marks-test-active .eg-test-root.eg-qxeg2 .eg-foot,
body.allen-practice-active .eg-test-root.eg-qxeg2 .eg-foot,
html.qx-q-fullscreen .eg-test-root.eg-qxeg2 .eg-foot,
body.qx-immersive .eg-test-root.eg-qxeg2 .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  transform: none !important;
  clip: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 64px !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.18) !important;
}
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) #egFoot,
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) .eg-foot {
  background: transparent !important;
  color: #0f172a !important;
  border-top: 2px solid #94a3b8 !important;
}
.eg-test-root.eg-qxeg2[data-test-theme="dark"] #egFoot,
.eg-test-root.eg-qxeg2[data-test-theme="dark"] .eg-foot {
  background: #0b1220 !important;
  color: #e2e8f0 !important;
  border-top: 2px solid #334155 !important;
}
.eg-test-root.eg-qxeg2 .eg-foot-right {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root.eg-qxeg2 #qxPrevBtn,
.eg-test-root.eg-qxeg2 #qxNextBtn,
.eg-test-root.eg-qxeg2 #qxSaveBtn,
.eg-test-root.eg-qxeg2 .eg-foot .eg-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  width: 100% !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  z-index: 2147483001 !important;
  cursor: pointer !important;
}
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) #qxPrevBtn {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) #qxNextBtn,
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) #qxSaveBtn,
.eg-test-root.eg-qxeg2:not([data-test-theme="dark"]) .eg-foot .eg-btn-next {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}
.eg-test-root.eg-qxeg2[data-test-theme="dark"] #qxPrevBtn {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  border: 1px solid #475569 !important;
}
.eg-test-root.eg-qxeg2[data-test-theme="dark"] #qxNextBtn,
.eg-test-root.eg-qxeg2[data-test-theme="dark"] #qxSaveBtn,
.eg-test-root.eg-qxeg2[data-test-theme="dark"] .eg-foot .eg-btn-next {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}
.eg-test-root.eg-qxeg2 .eg-main,
.eg-test-root.eg-qxeg2 .eg-q-card {
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
}

/* ExamGoal-like light strip board when open */
.eg-test-root.eg-qxeg2.eg-strip-open:not([data-test-theme="dark"]) #egQBar {
  background: #eff6ff !important;
  border-bottom: 1px solid #bfdbfe !important;
}
.eg-test-root.eg-qxeg2.eg-strip-open[data-test-theme="dark"] #egQBar {
  background: #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}


/* ========== QXEG3: card review icons + Questions Preview + menu=side only ========== */
.eg-test-root.eg-qxeg3 .eg-card-review {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
  flex: 0 0 auto !important;
}
.eg-test-root.eg-qxeg3 .eg-card-ico {
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 999px !important;
  border: none !important;
  color: #fff !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  padding: 0 !important;
  font-family: inherit !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12) !important;
  pointer-events: auto !important;
  z-index: 30 !important;
}
.eg-test-root.eg-qxeg3 .eg-card-plus {
  background: #16a34a !important;
}
.eg-test-root.eg-qxeg3 .eg-card-plus:hover { background: #15803d !important; }
.eg-test-root.eg-qxeg3 .eg-card-bang {
  background: #f97316 !important;
}
.eg-test-root.eg-qxeg3 .eg-card-bang:hover { background: #ea580c !important; }

.eg-test-root.eg-qxeg3 .eg-qpreview {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: min(420px, 92vw) !important;
  max-width: 100% !important;
  background: #f8fafc !important;
  border-left: 1px solid #e2e8f0 !important;
  box-shadow: -8px 0 28px rgba(15, 23, 42, 0.18) !important;
  z-index: 16000 !important;
  display: none;
  flex-direction: column !important;
  overflow: hidden !important;
}
.eg-test-root.eg-qxeg3.eg-preview-open .eg-qpreview,
.eg-test-root.eg-qxeg3 .eg-qpreview.open {
  display: flex !important;
}
.eg-test-root.eg-qxeg3[data-test-theme="dark"] .eg-qpreview {
  background: #0b1220 !important;
  border-left-color: #1e293b !important;
  color: #e2e8f0 !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-head {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 14px !important;
  border-bottom: 1px solid #e2e8f0 !important;
  background: #fff !important;
  flex-shrink: 0 !important;
}
.eg-test-root.eg-qxeg3[data-test-theme="dark"] .eg-qpreview-head {
  background: #111827 !important;
  border-bottom-color: #1e293b !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-head strong {
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
}
.eg-test-root.eg-qxeg3[data-test-theme="dark"] .eg-qpreview-head strong { color: #f1f5f9 !important; }
.eg-test-root.eg-qxeg3 .eg-qpreview-close {
  width: 28px !important;
  height: 28px !important;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  border-radius: 8px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  font-family: inherit !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-close:hover {
  background: #fee2e2 !important;
  color: #b91c1c !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-list {
  flex: 1 1 auto !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 8px 10px 24px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-row {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  width: 100% !important;
  text-align: left !important;
  background: #fff !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  padding: 10px 12px !important;
  cursor: pointer !important;
  font-family: inherit !important;
  color: #0f172a !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-row:hover {
  border-color: #93c5fd !important;
  background: #eff6ff !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-row.cur {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18) !important;
}
.eg-test-root.eg-qxeg3[data-test-theme="dark"] .eg-qpreview-row {
  background: #111827 !important;
  border-color: #1e293b !important;
  color: #e2e8f0 !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-num {
  flex: 0 0 auto !important;
  width: 28px !important;
  height: 28px !important;
  border-radius: 999px !important;
  background: #2563eb !important;
  color: #fff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin-top: 1px !important;
}
.eg-test-root.eg-qxeg3 .eg-qpreview-stem {
  flex: 1 1 auto !important;
  font-size: 13.5px !important;
  line-height: 1.45 !important;
  color: inherit !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
}
@media (max-width: 720px) {
  .eg-test-root.eg-qxeg3 .eg-qpreview {
    width: min(100vw, 100%) !important;
    left: 8% !important;
    right: 0 !important;
    width: 92% !important;
  }
  .eg-test-root.eg-qxeg3 .eg-card-ico {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    font-size: 15px !important;
  }
}
.eg-test-root.eg-qxeg3 #egMenuBtn.on {
  background: rgba(37, 99, 235, 0.16) !important;
  color: #1d4ed8 !important;
}
.eg-test-root.eg-qxeg3 .eg-info-strip.eg-info-pills {
  flex-wrap: nowrap !important;
  overflow-x: auto !important;
}


/* ========== QXEG4 P0: nuclear foot ALWAYS visible + strip on All Q + Q# right ========== */

/* A) FOOT — never hide (beats side/strip/preview/mobile/desktop/theme) */
.eg-test-root.eg-qxeg4 #egFoot,
.eg-test-root.eg-qxeg4 .eg-foot,
.eg-test-root.eg-qxeg4.eg-side-collapsed #egFoot,
.eg-test-root.eg-qxeg4.eg-side-collapsed .eg-foot,
.eg-test-root.eg-qxeg4.eg-side-open #egFoot,
.eg-test-root.eg-qxeg4.eg-side-open .eg-foot,
.eg-test-root.eg-qxeg4.eg-strip-open #egFoot,
.eg-test-root.eg-qxeg4.eg-strip-open .eg-foot,
.eg-test-root.eg-qxeg4.eg-preview-open #egFoot,
.eg-test-root.eg-qxeg4.eg-preview-open .eg-foot,
.eg-test-root.eg-qxeg4.eg-mobile #egFoot,
.eg-test-root.eg-qxeg4.eg-desktop-mode #egFoot,
.eg-test-root.eg-qxeg4.eg-qxtool8 #egFoot,
.eg-test-root.eg-qxeg4.eg-qxtool8 .eg-foot,
.eg-test-root.eg-qxeg4.eg-qxeg2 #egFoot,
body.marks-test-active .eg-test-root.eg-qxeg4 .eg-foot,
body.allen-practice-active .eg-test-root.eg-qxeg4 .eg-foot,
html.qx-q-fullscreen .eg-test-root.eg-qxeg4 .eg-foot,
body.qx-immersive .eg-test-root.eg-qxeg4 .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  transform: none !important;
  clip: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 64px !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.18) !important;
  margin: 0 !important;
  height: auto !important;
}
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) #egFoot,
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) .eg-foot {
  background: transparent !important;
  color: #0f172a !important;
  border-top: 2px solid #94a3b8 !important;
}
.eg-test-root.eg-qxeg4[data-test-theme="dark"] #egFoot,
.eg-test-root.eg-qxeg4[data-test-theme="dark"] .eg-foot {
  background: #0b1220 !important;
  color: #e2e8f0 !important;
  border-top: 2px solid #334155 !important;
}
.eg-test-root.eg-qxeg4 .eg-foot-right {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  width: 100% !important;
  flex: 1 1 100% !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.eg-test-root.eg-qxeg4 #qxPrevBtn,
.eg-test-root.eg-qxeg4 #qxNextBtn,
.eg-test-root.eg-qxeg4 #qxSaveBtn,
.eg-test-root.eg-qxeg4 .eg-foot .eg-btn,
.eg-test-root.eg-qxeg4.eg-preview-open #qxPrevBtn,
.eg-test-root.eg-qxeg4.eg-preview-open #qxNextBtn,
.eg-test-root.eg-qxeg4.eg-strip-open #qxPrevBtn,
.eg-test-root.eg-qxeg4.eg-strip-open #qxNextBtn,
.eg-test-root.eg-qxeg4.eg-side-collapsed #qxPrevBtn,
.eg-test-root.eg-qxeg4.eg-side-collapsed #qxNextBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 48px !important;
  width: 100% !important;
  border-radius: 10px !important;
  font-weight: 800 !important;
  font-size: 15px !important;
  z-index: 2147483001 !important;
  cursor: pointer !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
}
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) #qxPrevBtn {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
  border: 1px solid #94a3b8 !important;
}
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) #qxNextBtn,
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) #qxSaveBtn,
.eg-test-root.eg-qxeg4:not([data-test-theme="dark"]) .eg-foot .eg-btn-next {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}
.eg-test-root.eg-qxeg4[data-test-theme="dark"] #qxPrevBtn {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  -webkit-text-fill-color: #e2e8f0 !important;
  border: 1px solid #475569 !important;
}
.eg-test-root.eg-qxeg4[data-test-theme="dark"] #qxNextBtn,
.eg-test-root.eg-qxeg4[data-test-theme="dark"] #qxSaveBtn,
.eg-test-root.eg-qxeg4[data-test-theme="dark"] .eg-foot .eg-btn-next {
  background: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  border: 1px solid #1d4ed8 !important;
}
.eg-test-root.eg-qxeg4 .eg-main,
.eg-test-root.eg-qxeg4 .eg-q-card {
  padding-bottom: calc(140px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Preview must NOT cover foot */
.eg-test-root.eg-qxeg4 .eg-qpreview,
.eg-test-root.eg-qxeg4.eg-preview-open .eg-qpreview,
.eg-test-root.eg-qxeg4 .eg-qpreview.open {
  bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 16000 !important;
}

/* B) TOP Q STRIP — show on eg-strip-open even when side collapsed / preview only */
.eg-test-root.eg-qxeg4.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg4.eg-strip-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg4.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg4.eg-strip-open.eg-side-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg4.eg-qxtool8.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg4.eg-qxtool8.eg-desktop-mode.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg4.eg-qxeg2.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg4.eg-preview-open.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg4.eg-mobile.eg-strip-open #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 42px !important;
  padding: 6px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 60 !important;
  flex-shrink: 0 !important;
  align-items: center !important;
  gap: 6px !important;
  border: 0 !important;
}
.eg-test-root.eg-qxeg4.eg-strip-open #egQBar .eg-qbar-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  gap: 6px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto !important;
}
.eg-test-root.eg-qxeg4.eg-strip-open #egQBar .eg-qbar-n,
.eg-test-root.eg-qxeg4.eg-strip-open #egQBar .eg-q-dot {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 30px !important;
  height: 30px !important;
  min-width: 30px !important;
  border-radius: 50% !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}
.eg-test-root.eg-qxeg4.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg4:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxeg4.eg-strip-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg4:not(.eg-strip-open) .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}
.eg-test-root.eg-qxeg4.eg-strip-open:not([data-test-theme="dark"]) #egQBar {
  background: #eff6ff !important;
  border-bottom: 1px solid #bfdbfe !important;
}
.eg-test-root.eg-qxeg4.eg-strip-open[data-test-theme="dark"] #egQBar {
  background: #e2e8f0 !important;
  border-bottom: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

/* C) Q# chip RIGHT-aligned in meta row */
.eg-test-root.eg-qxeg4 .eg-info-strip.eg-examgoal-meta,
.eg-test-root.eg-qxeg4 .eg-info-strip.eg-info-pills {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px 8px !important;
}
.eg-test-root.eg-qxeg4 .eg-info-strip .eg-type,
.eg-test-root.eg-qxeg4 .eg-info-strip .eg-type-pill {
  margin-left: 0 !important;
}
.eg-test-root.eg-qxeg4 .eg-info-strip .eg-card-review {
  margin-left: 0 !important;
  order: 99 !important;
}
.eg-test-root.eg-qxeg4 .eg-info-strip .eg-q-num {
  margin-left: auto !important;
  order: 98 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}


/* ========== QXEG5: Q# LEFT · no card +/! · palette-twin strip · raised nuclear foot ========== */

/* A) Hide duplicate green + / orange ! in question info row (tools live in top header) */
.eg-test-root.eg-qxeg5 .eg-card-review,
.eg-test-root.eg-qxeg5 .eg-card-plus,
.eg-test-root.eg-qxeg5 .eg-card-bang,
.eg-test-root.eg-qxeg5 #egPlusBtnQ,
.eg-test-root.eg-qxeg5 #egQReportBtn {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

/* B) Q# badge FIRST / LEFT — undo qxeg4 margin-left:auto */
.eg-test-root.eg-qxeg5 .eg-info-strip.eg-examgoal-meta,
.eg-test-root.eg-qxeg5 .eg-info-strip.eg-info-pills {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px 8px !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
}
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-q-num {
  order: -20 !important;
  margin-left: 0 !important;
  margin-right: 4px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: #2563eb !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-weight: 800 !important;
  font-size: 13px !important;
  flex-shrink: 0 !important;
}
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-q-time { order: -10 !important; }
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-marks { order: -9 !important; }
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-type,
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-type-pill {
  margin-left: 0 !important;
  order: 10 !important;
}
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-paper-line,
.eg-test-root.eg-qxeg5 .eg-info-strip .eg-info-meta,
.eg-test-root.eg-qxeg5 .eg-info-strip .qx-paper-meta-chips {
  order: 5 !important;
}

/* C) TOP Q STRIP = same circle language as right palette (All Q open) */
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg5.eg-strip-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg5.eg-strip-open.eg-side-collapsed #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 48px !important;
  max-height: 56px !important;
  height: auto !important;
  padding: 8px 10px !important;
  overflow: hidden !important;
  flex-shrink: 0 !important;
  position: relative !important;
  z-index: 70 !important;
  pointer-events: auto !important;
  box-sizing: border-box !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-scroll {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 8px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  flex: 1 1 auto !important;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 4px !important;
}
/* Palette-twin circles */
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot,
.eg-test-root.eg-qxeg5.eg-strip-open .eg-qbar-n.eg-q-dot {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  align-items: center !important;
  justify-content: center !important;
  width: 34px !important;
  height: 34px !important;
  min-width: 34px !important;
  border-radius: 50% !important;
  border: 0 !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  line-height: 1 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  font-family: inherit !important;
  box-sizing: border-box !important;
  padding: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-unseen,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-unseen {
  background: #9ca3af !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-correct,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-attempted,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-correct,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-attempted {
  background: #22c55e !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-wrong,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-wrong {
  background: #ef4444 !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-att,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-att {
  background: #3b82f6 !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-seen,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-seen {
  background: #f59e0b !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-seen-test,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-seen-test {
  background: #ef4444 !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-marked,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-marked {
  background: #a855f7 !important; border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.eg-att-mark,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.eg-att-mark {
  background: #a855f7 !important;
  box-shadow: 0 0 0 2px #22c55e !important;
  border: 0 !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n.cur,
.eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot.cur {
  outline: 2px solid #ef4444 !important;
  outline-offset: 2px !important;
}
.eg-test-root.eg-qxeg5[data-eg-mode="practice"].eg-strip-open #egQBar .eg-qbar-n.cur,
.eg-test-root.eg-qxeg5[data-eg-mode="practice"].eg-strip-open #egQBar .eg-q-dot.cur {
  outline-color: #f59e0b !important;
}

/* Independent ✕ on strip + side */
.eg-test-root.eg-qxeg5.eg-strip-open #egStripClose,
.eg-test-root.eg-qxeg5.eg-strip-open .eg-strip-close {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  flex: 0 0 auto !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 10px !important;
  border: 1px solid #fecaca !important;
  background: #fee2e2 !important;
  color: #b91c1c !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  z-index: 80 !important;
  margin-right: 4px !important;
}
.eg-test-root.eg-qxeg5.eg-side-open #egSideClose,
.eg-test-root.eg-qxeg5.eg-side-open .eg-side-close {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 80 !important;
}

/* D) Raised nuclear foot — never hide; sit above OS chrome */
.eg-test-root.eg-qxeg5 #egFoot,
.eg-test-root.eg-qxeg5 .eg-foot,
.eg-test-root.eg-qxeg5.eg-side-collapsed #egFoot,
.eg-test-root.eg-qxeg5.eg-side-collapsed .eg-foot,
.eg-test-root.eg-qxeg5.eg-side-open #egFoot,
.eg-test-root.eg-qxeg5.eg-side-open .eg-foot,
.eg-test-root.eg-qxeg5.eg-strip-open #egFoot,
.eg-test-root.eg-qxeg5.eg-strip-open .eg-foot,
.eg-test-root.eg-qxeg5.eg-preview-open #egFoot,
.eg-test-root.eg-qxeg5.eg-preview-open .eg-foot,
.eg-test-root.eg-qxeg5.eg-mobile #egFoot,
.eg-test-root.eg-qxeg5.eg-desktop-mode #egFoot,
.eg-test-root.eg-qxeg5.eg-qxeg4 #egFoot,
.eg-test-root.eg-qxeg5.eg-qxeg4 .eg-foot,
body.marks-test-active .eg-test-root.eg-qxeg5 .eg-foot,
body.allen-practice-active .eg-test-root.eg-qxeg5 .eg-foot,
html.qx-q-fullscreen .eg-test-root.eg-qxeg5 .eg-foot,
body.qx-immersive .eg-test-root.eg-qxeg5 .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2147483000 !important;
  transform: none !important;
  clip: auto !important;
  max-height: none !important;
  overflow: visible !important;
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 64px !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 12px 12px 14px !important;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.18) !important;
  margin: 0 !important;
  height: auto !important;
}
.eg-test-root.eg-qxeg5 #qxPrevBtn,
.eg-test-root.eg-qxeg5 #qxNextBtn,
.eg-test-root.eg-qxeg5 #qxSaveBtn,
.eg-test-root.eg-qxeg5 .eg-foot .eg-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 2147483001 !important;
  min-height: 48px !important;
}
.eg-test-root.eg-qxeg5 .eg-main,
.eg-test-root.eg-qxeg5 .eg-q-card {
  padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)) !important;
}
.eg-test-root.eg-qxeg5 .eg-qpreview,
.eg-test-root.eg-qxeg5.eg-preview-open .eg-qpreview,
.eg-test-root.eg-qxeg5 .eg-qpreview.open {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 16000 !important;
}

/* E) Full-window question when side closed; strip stays a single compact row (no stem cover) */
.eg-test-root.eg-qxeg5.eg-side-collapsed .eg-body,
.eg-test-root.eg-qxeg5:not(.eg-side-open) .eg-body {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
}
.eg-test-root.eg-qxeg5.eg-side-collapsed .eg-main,
.eg-test-root.eg-qxeg5:not(.eg-side-open) .eg-main {
  width: 100% !important;
  max-width: 100% !important;
}
.eg-test-root.eg-qxeg5.eg-strip-open .eg-main,
.eg-test-root.eg-qxeg5.eg-strip-open .eg-q-stem {
  /* strip is in-flow (not overlay) — keep stem readable */
  position: relative !important;
  z-index: 1 !important;
}
@media (max-width: 720px) {
  .eg-test-root.eg-qxeg5.eg-strip-open #egQBar {
    max-height: 52px !important;
    min-height: 46px !important;
    padding: 6px 8px !important;
  }
  .eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-qbar-n,
  .eg-test-root.eg-qxeg5.eg-strip-open #egQBar .eg-q-dot {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
  }
  .eg-test-root.eg-qxeg5 .eg-main,
  .eg-test-root.eg-qxeg5 .eg-q-card {
    padding-bottom: calc(176px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ========== QXEG6 P0: force strip on All-Q · kill side-collapsed hide · subject name only · nuclear Prev/Next ========== */

/* Kill ANY leftover rule that hides #egQBar when side is collapsed but strip is open */
.eg-test-root.eg-qxeg6.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg6.eg-strip-open .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg6.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg6.eg-strip-open.eg-side-collapsed .eg-qbar.eg-strip,
.eg-test-root.eg-qxeg6.eg-qxtool8.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg6.eg-qxtool8.eg-side-collapsed.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg5.eg-strip-open.eg-side-collapsed #egQBar,
.eg-test-root.eg-qxeg1.eg-strip-open.eg-side-collapsed #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 46px !important;
  padding: 6px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 60 !important;
  border: 0 !important;
}

.eg-test-root.eg-qxeg6.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg6:not(.eg-strip-open) #egQBar {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  pointer-events: none !important;
}

/* Palette / side independent */
.eg-test-root.eg-qxeg6.eg-side-open #egSide,
.eg-test-root.eg-qxeg6.eg-side-open .eg-side {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 13500 !important;
}
.eg-test-root.eg-qxeg6.eg-side-collapsed #egSide,
.eg-test-root.eg-qxeg6:not(.eg-side-open) #egSide {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Circle Q numbers like palette */
.eg-test-root.eg-qxeg6.eg-strip-open #egQBar .eg-qbar-n,
.eg-test-root.eg-qxeg6.eg-strip-open #egQBar .eg-q-dot,
.eg-test-root.eg-qxeg6 .eg-pal-cell {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  border-radius: 50% !important;
  font-weight: 800 !important;
  visibility: visible !important;
}

/* Subject tabs: name only — hide any leftover count */
.eg-test-root.eg-qxeg6 .eg-sub-n,
.eg-test-root .eg-sub .eg-sub-n {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  font-size: 0 !important;
  overflow: hidden !important;
}

/* Nuclear visible foot + Prev/Next */
.eg-test-root.eg-qxeg6 #egFoot,
.eg-test-root.eg-qxeg6 .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2147483000 !important;
  transform: none !important;
  min-height: 64px !important;
  width: 100% !important;
}
.eg-test-root.eg-qxeg6 #qxPrevBtn,
.eg-test-root.eg-qxeg6 #qxNextBtn,
.eg-test-root.eg-qxeg6 #qxSaveBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-height: 48px !important;
  z-index: 2147483001 !important;
}


/* ========== QXEG6: exam/date/shift/type ALWAYS visible (never hide when strip/side/preview open) ========== */
.eg-test-root.eg-qxeg6 #egInfoStrip,
.eg-test-root.eg-qxeg6 .eg-info-strip,
.eg-test-root.eg-qxeg6.eg-strip-open #egInfoStrip,
.eg-test-root.eg-qxeg6.eg-side-open #egInfoStrip,
.eg-test-root.eg-qxeg6.eg-preview-open #egInfoStrip,
.eg-test-root.eg-qxeg6.eg-desktop-mode #egInfoStrip,
.eg-test-root.eg-qxeg6.eg-mobile #egInfoStrip,
.eg-test-root.eg-qxeg5 #egInfoStrip,
.eg-test-root.eg-qxtool8 #egInfoStrip {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 36px !important;
  overflow: visible !important;
  flex-wrap: wrap !important;
  pointer-events: auto !important;
  z-index: 80 !important;
  position: relative !important;
}
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-paper-line,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-type,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-type-pill,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-info-meta,
.eg-test-root.eg-qxeg6 .eg-info-strip .qx-paper-meta-chips,
.eg-test-root.eg-qxeg6 .eg-info-strip .qx-paper-chip,
.eg-test-root.eg-qxeg6 .eg-info-strip .qx-paper-exam,
.eg-test-root.eg-qxeg6 .eg-info-strip .qx-paper-date,
.eg-test-root.eg-qxeg6 .eg-info-strip .qx-paper-shift,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-marks,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-q-time,
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-q-num {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  flex-shrink: 1 !important;
}
.eg-test-root.eg-qxeg6 .eg-info-strip .eg-paper-line {
  white-space: nowrap !important;
  max-width: min(70vw, 560px) !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #15803d !important;
  font-weight: 700 !important;
}
.eg-test-root.eg-qxeg6[data-test-theme="dark"] .eg-info-strip .eg-paper-line { color: #86efac !important; }


/* ========== QXEG7: instant chrome · smooth 160ms · CSS-first foot · no layout thrash ========== */

.eg-test-root.eg-qxeg7 {
  --eg-chrome-ms: 160ms;
  --eg-chrome-ease: cubic-bezier(.2,.8,.2,1);
}

/* Smooth strip open/close (opacity + transform; height via max-height) */
.eg-test-root.eg-qxeg7 #egQBar,
.eg-test-root.eg-qxeg7 .eg-qbar.eg-strip {
  transition:
    opacity var(--eg-chrome-ms) var(--eg-chrome-ease),
    transform var(--eg-chrome-ms) var(--eg-chrome-ease),
    max-height var(--eg-chrome-ms) var(--eg-chrome-ease),
    padding var(--eg-chrome-ms) var(--eg-chrome-ease),
    border-color var(--eg-chrome-ms) ease,
    visibility 0s linear var(--eg-chrome-ms);
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.eg-test-root.eg-qxeg7.eg-strip-open #egQBar,
.eg-test-root.eg-qxeg7.eg-strip-open .eg-qbar.eg-strip:not(.eg-strip-collapsed),
.eg-test-root.eg-qxeg7.eg-strip-open.eg-side-collapsed #egQBar {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateY(0) translateZ(0) !important;
  max-height: 64px !important;
  min-height: 46px !important;
  height: auto !important;
  padding: 6px 10px !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  pointer-events: auto !important;
  position: relative !important;
  z-index: 70 !important;
  transition:
    opacity var(--eg-chrome-ms) var(--eg-chrome-ease),
    transform var(--eg-chrome-ms) var(--eg-chrome-ease),
    max-height var(--eg-chrome-ms) var(--eg-chrome-ease),
    padding var(--eg-chrome-ms) var(--eg-chrome-ease),
    visibility 0s linear 0s;
}
.eg-test-root.eg-qxeg7:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxeg7.eg-strip-collapsed #egQBar,
.eg-test-root.eg-qxeg7:not(.eg-strip-open) .eg-qbar.eg-strip {
  display: flex !important; /* keep in flow for transition; collapse visually */
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateY(-6px) translateZ(0) !important;
  max-height: 0 !important;
  min-height: 0 !important;
  height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Smooth side palette */
.eg-test-root.eg-qxeg7 #egSide,
.eg-test-root.eg-qxeg7 .eg-side {
  transition:
    opacity var(--eg-chrome-ms) var(--eg-chrome-ease),
    transform var(--eg-chrome-ms) var(--eg-chrome-ease),
    visibility 0s linear var(--eg-chrome-ms);
  will-change: opacity, transform;
  transform: translateZ(0);
  backface-visibility: hidden;
}
.eg-test-root.eg-qxeg7.eg-side-open #egSide,
.eg-test-root.eg-qxeg7.eg-side-open .eg-side {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: translateX(0) translateZ(0) !important;
  pointer-events: auto !important;
  z-index: 13500 !important;
  transition:
    opacity var(--eg-chrome-ms) var(--eg-chrome-ease),
    transform var(--eg-chrome-ms) var(--eg-chrome-ease),
    visibility 0s linear 0s;
}
.eg-test-root.eg-qxeg7:not(.eg-side-open) #egSide,
.eg-test-root.eg-qxeg7.eg-side-collapsed #egSide,
.eg-test-root.eg-qxeg7:not(.eg-side-open) .eg-side {
  display: flex !important;
  visibility: hidden !important;
  opacity: 0 !important;
  transform: translateX(12px) translateZ(0) !important;
  pointer-events: none !important;
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}

/* Full-window question when side closed (CSS grid — no JS style writes) */
.eg-test-root.eg-qxeg7:not(.eg-side-open) .eg-body,
.eg-test-root.eg-qxeg7.eg-side-collapsed .eg-body {
  display: grid !important;
  grid-template-columns: 1fr !important;
  width: 100% !important;
}
.eg-test-root.eg-qxeg7.eg-side-open .eg-body {
  display: grid !important;
  grid-template-columns: 1fr min(300px, 42vw) !important;
  width: 100% !important;
}
.eg-test-root.eg-qxeg7:not(.eg-side-open) .eg-main,
.eg-test-root.eg-qxeg7.eg-side-collapsed .eg-main {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}
@media (max-width: 720px) {
  .eg-test-root.eg-qxeg7.eg-side-open #egSide,
  .eg-test-root.eg-qxeg7.eg-side-open .eg-side {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: min(300px, 86vw) !important;
    max-width: min(300px, 86vw) !important;
    min-width: min(300px, 86vw) !important;
  }
  .eg-test-root.eg-qxeg7.eg-side-open .eg-body {
    grid-template-columns: 1fr !important;
  }
}

/* Nuclear foot — CSS-first, always on first paint (no JS thrash needed) */
.eg-test-root.eg-qxeg7 #egFoot,
.eg-test-root.eg-qxeg7 .eg-foot,
.eg-test-root.eg-qxeg7.eg-foot-ready #egFoot,
.eg-test-root.eg-qxeg7.eg-foot-ready .eg-foot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: max(8px, env(safe-area-inset-bottom, 0px)) !important;
  z-index: 2147483000 !important;
  transform: none !important;
  min-height: 64px !important;
  width: 100% !important;
  max-width: 100vw !important;
}
.eg-test-root.eg-qxeg7 #qxPrevBtn,
.eg-test-root.eg-qxeg7 #qxNextBtn,
.eg-test-root.eg-qxeg7 #qxSaveBtn,
.eg-test-root.eg-qxeg7 .eg-foot .eg-btn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  min-height: 48px !important;
  z-index: 2147483001 !important;
  cursor: pointer !important;
  touch-action: manipulation;
}

/* Toolbar always tappable */
.eg-test-root.eg-qxeg7 .eg-top,
.eg-test-root.eg-qxeg7 .eg-top-tools,
.eg-test-root.eg-qxeg7 .eg-tool-btn,
.eg-test-root.eg-qxeg7 #egAllQBtn,
.eg-test-root.eg-qxeg7 #egMenuBtn,
.eg-test-root.eg-qxeg7 #egFullBtn,
.eg-test-root.eg-qxeg7 #mtkThemeBtn,
.eg-test-root.eg-qxeg7 #egFmtBtn,
.eg-test-root.eg-qxeg7 #mtkReportBtn,
.eg-test-root.eg-qxeg7 #egStarBtn,
.eg-test-root.eg-qxeg7 #egPlusBtn {
  pointer-events: auto !important;
  touch-action: manipulation;
}
.eg-test-root.eg-qxeg7 .eg-top-tools { z-index: 14040 !important; }
.eg-test-root.eg-qxeg7 .eg-tool-btn { z-index: 14050 !important; cursor: pointer !important; }

/* Keep exam meta visible (inherit qxeg6) */
.eg-test-root.eg-qxeg7 #egInfoStrip {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Independent ✕ */
.eg-test-root.eg-qxeg7.eg-strip-open #egStripClose { pointer-events: auto !important; }
.eg-test-root.eg-qxeg7.eg-side-open #egSideClose { pointer-events: auto !important; }

/* Prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .eg-test-root.eg-qxeg7 #egQBar,
  .eg-test-root.eg-qxeg7 .eg-qbar.eg-strip,
  .eg-test-root.eg-qxeg7 #egSide,
  .eg-test-root.eg-qxeg7 .eg-side {
    transition: none !important;
  }
}


/* qxmd160/qxmd163/qxmd164 — Practice Show/Check Answer: hide question stem while Solution open.
   Must beat theme rules that set visibility:visible !important on .eg-q-stem.
   qxmd164: also cover .eg-q-stem without requiring both classes; keep #egQArea fully gone. */
.eg-test-root.eg-sol-showing .eg-q-stem.eg-stem-sol-hidden,
.eg-test-root.eg-sol-showing #egQArea.eg-stem-sol-hidden,
.eg-test-root.eg-sol-showing #egQArea[hidden],
.eg-test-root.eg-sol-showing .eg-q-stem[hidden],
.eg-q-stem.eg-stem-sol-hidden[hidden],
#egQArea.eg-stem-sol-hidden[hidden],
#egQArea.eg-stem-sol-hidden {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  position: static !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
}
.eg-test-root.eg-sol-showing .eg-sol-panel {
  margin-top: 12px;
}

/* qxmd184 — NEVER hide stem/options when Solution is open (parent + children) */
html .eg-test-root.eg-sol-showing .eg-q-stem,
html .eg-test-root.eg-sol-showing .eg-q-stem.eg-stem-sol-hidden,
html .eg-test-root.eg-sol-showing #egQArea,
html[data-theme="dark"] .eg-test-root.eg-sol-showing .eg-q-stem,
html[data-theme="dark"] .eg-test-root.eg-sol-showing .eg-q-stem .qx-content,
html[data-theme="light"] .eg-test-root.eg-sol-showing .eg-q-stem,
html[data-theme="dark"] .eg-test-root[data-test-theme="dark"].eg-sol-showing .eg-q-stem,
html[data-theme="dark"] .eg-test-root[data-test-theme="light"].eg-sol-showing .eg-q-stem,
html[data-theme="light"] .eg-test-root[data-test-theme="dark"].eg-sol-showing .eg-q-stem,
html[data-theme="light"] .eg-test-root[data-test-theme="light"].eg-sol-showing .eg-q-stem {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}


/* qxmd165: Practice Aa pop — palette preference (Right / Top / Both) */
.eg-fmt-pop .eg-fmt-pal-h {
  margin: 10px 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #64748b;
}
.eg-fmt-pop .eg-fmt-pal button {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
}


/* qxmd184: keep stem visible sitewide when solution is open */
html .eg-test-root.eg-sol-showing .eg-q-stem,
html .eg-test-root.eg-sol-showing #egQArea,
html .eg-test-root.eg-sol-showing .mtk-q-text.eg-stem-sol-hidden,
html .mtk-test-root.eg-sol-showing .mtk-q-text,
html .mtk-test-root.eg-sol-showing .mq-stem,
html .mtk-test-root.eg-sol-showing .qx-prac-q,
html .mtk-test-root.qx-sol-showing .mtk-q-text,
html .allen-practice.eg-sol-showing .mtk-q-text,
html .allen-practice.qx-sol-showing .mtk-q-text,
html .qx-practice-page.eg-sol-showing .qx-prac-q,
html .qx-practice-page.qx-sol-showing .qx-prac-q,
html .eg-stem-sol-hidden,
html .qx-stem-sol-hidden,
html[data-theme="dark"] .eg-test-root.eg-sol-showing .eg-q-stem,
html[data-theme="dark"] .eg-test-root.eg-sol-showing #egQArea,
html[data-theme="dark"] .mtk-test-root.eg-sol-showing .mtk-q-text,
html[data-theme="dark"] .allen-practice.eg-sol-showing .mtk-q-text,
html[data-theme="light"] .eg-test-root.eg-sol-showing .eg-q-stem,
html[data-theme="light"] .eg-test-root.eg-sol-showing #egQArea,
html[data-theme="light"] .mtk-test-root.eg-sol-showing .mtk-q-text,
html[data-theme="light"] .allen-practice.eg-sol-showing .mtk-q-text,
html .eg-test-root[data-test-theme="dark"].eg-sol-showing .eg-q-stem,
html .eg-test-root[data-test-theme="light"].eg-sol-showing .eg-q-stem,
html .mtk-test-root[data-test-theme="dark"].eg-sol-showing .mtk-q-text,
html .mtk-test-root[data-test-theme="light"].eg-sol-showing .mtk-q-text {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: revert !important;
  padding: revert !important;
  border: revert !important;
  clip: auto !important;
  clip-path: none !important;
  position: static !important;
  left: auto !important;
  top: auto !important;
  pointer-events: auto !important;
  color: inherit !important;
  font-size: inherit !important;
  line-height: inherit !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;
}


/* ========== qxmd167: simple Practice chrome · instant Palette · mobile toolbar ========== */

.eg-test-root.eg-qxmd167,
.eg-test-root.eg-qxeg7.eg-qxmd167 {
  --eg-chrome-ms: 140ms;
  --eg-chrome-ease: cubic-bezier(.2,.8,.2,1);
}

/* Palette open: beat [hidden] so first paint is immediate (no wait for attr sync) */
.eg-test-root.eg-side-open #egSide,
.eg-test-root.eg-side-open #egSide[hidden],
.eg-test-root.eg-qxmd167.eg-side-open #egSide,
.eg-test-root.eg-qxmd167.eg-side-open #egSide[hidden] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Side slide ≤150ms */
.eg-test-root.eg-qxmd167 #egSide,
.eg-test-root.eg-qxmd167 .eg-side {
  transition:
    opacity var(--eg-chrome-ms, 140ms) var(--eg-chrome-ease, cubic-bezier(.2,.8,.2,1)),
    transform var(--eg-chrome-ms, 140ms) var(--eg-chrome-ease, cubic-bezier(.2,.8,.2,1)),
    visibility 0s linear var(--eg-chrome-ms, 140ms) !important;
  will-change: opacity, transform;
}
.eg-test-root.eg-qxmd167.eg-side-open #egSide,
.eg-test-root.eg-qxmd167.eg-side-open .eg-side {
  transform: translateX(0) translateZ(0) !important;
  transition:
    opacity var(--eg-chrome-ms, 140ms) var(--eg-chrome-ease, cubic-bezier(.2,.8,.2,1)),
    transform var(--eg-chrome-ms, 140ms) var(--eg-chrome-ease, cubic-bezier(.2,.8,.2,1)),
    visibility 0s linear 0s !important;
}
.eg-test-root.eg-qxmd167:not(.eg-side-open) #egSide:not([hidden]),
.eg-test-root.eg-qxmd167.eg-side-collapsed #egSide:not([hidden]) {
  transform: translateX(16px) translateZ(0) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Closed + [hidden]: hard hide (no thrash) */
.eg-test-root.eg-qxmd167:not(.eg-side-open) #egSide[hidden],
.eg-test-root.eg-qxmd167.eg-side-collapsed #egSide[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* CRITICAL: strip follows strip-open ONLY — Palette(side) must NOT open top strip */
.eg-test-root.eg-qxmd167.eg-side-open:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxmd167.eg-side-open:not(.eg-strip-open) .eg-qbar.eg-strip,
.eg-test-root.eg-qxmd167.eg-desktop-mode.eg-side-open:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxmd167.eg-desktop-mode.eg-side-open:not(.eg-strip-open) .eg-qbar.eg-strip,
.eg-test-root.eg-qxmd167.eg-qxtool8.eg-side-open:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxmd167.eg-qxtool8.eg-desktop-mode.eg-side-open:not(.eg-strip-open) #egQBar,
.eg-test-root.eg-qxmd167.eg-qxtool8.eg-desktop-mode.eg-side-open:not(.eg-strip-open) .eg-qbar.eg-strip {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border: 0 !important;
}

/* Toolbar: never hide behind overflow / 58% cap */
.eg-test-root.eg-qxmd167 .eg-top {
  flex-wrap: wrap !important;
  align-items: center !important;
  row-gap: 2px !important;
  overflow: visible !important;
}
.eg-test-root.eg-qxmd167 .eg-top-title {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.eg-test-root.eg-qxmd167 .eg-top-tools,
.eg-test-root.eg-qxmd167.eg-qxtool8 .eg-top-tools,
.eg-test-root.eg-qxmd167 .eg-top-tools.qx-prac-tools {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 1px !important;
  max-width: none !important;
  width: auto !important;
  overflow: visible !important;
  overflow-x: visible !important;
  -webkit-overflow-scrolling: auto;
}
.eg-test-root.eg-qxmd167 .eg-top-tools .eg-tool-pri,
.eg-test-root.eg-qxmd167 .eg-top-tools #mtkThemeBtn,
.eg-test-root.eg-qxmd167 .eg-top-tools #egFmtBtn,
.eg-test-root.eg-qxmd167 .eg-top-tools #egAllQBtn,
.eg-test-root.eg-qxmd167 .eg-top-tools #egMenuBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto !important;
}

@media (max-width: 720px) {
  /* Kill legacy 58% overflow-hide */
  .eg-test-root.eg-qxmd167 .eg-top-tools,
  .eg-test-root .eg-top-tools {
    max-width: none !important;
    overflow-x: visible !important;
    flex-wrap: wrap !important;
  }
  .eg-test-root.eg-qxmd167 .eg-top {
    flex-wrap: wrap !important;
    min-height: 44px !important;
  }
  /* Shrink icons so primary row fits; title truncates */
  .eg-test-root.eg-qxmd167.eg-qxtool8 .eg-top-tools .eg-tool-btn,
  .eg-test-root.eg-qxmd167.eg-qxtool8 .eg-top-tools .eg-ico,
  .eg-test-root.eg-qxmd167 .eg-top-tools .eg-tool-btn,
  .eg-test-root.eg-qxmd167 .eg-top-tools .eg-ico {
    min-width: 36px !important;
    width: auto !important;
    min-height: 36px !important;
    padding: 2px 3px !important;
  }
  .eg-test-root.eg-qxmd167.eg-qxtool8 .eg-top-tools .eg-tip {
    font-size: 8px !important;
  }
  /* Practice: keep Bookmark/Full/Report/Group on the blue bar */
  .eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-top-tools .eg-tool-sec:not(.eg-tool-reach) {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  .eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-top-tools .eg-tool-reach,
  .eg-test-root.eg-qxmd170[data-eg-mode="practice"] .eg-top-tools #egPlusBtn,
  .eg-test-root.eg-qxmd170[data-eg-mode="practice"] .eg-top-tools #mtkReportBtn {
    display: inline-flex !important;
    visibility: visible !important;
  }
  .eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-fmt-more,
  .eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-fmt-more-h {
    display: flex !important;
  }
}

/* Desktop / wide: secondary stay in toolbar; Aa More optional */
@media (min-width: 721px) {
  .eg-test-root.eg-qxmd167 .eg-top-tools .eg-tool-sec {
    display: inline-flex !important;
  }
  .eg-test-root.eg-qxmd167 .eg-fmt-more,
  .eg-test-root.eg-qxmd167 .eg-fmt-more-h {
    display: none !important;
  }
}

.eg-fmt-pop .eg-fmt-more {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.eg-fmt-pop .eg-fmt-more button {
  flex: 1 1 40%;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
}

@media (prefers-reduced-motion: reduce) {
  .eg-test-root.eg-qxmd167 #egSide,
  .eg-test-root.eg-qxmd167 .eg-side,
  .eg-test-root.eg-qxmd167 #egQBar {
    transition: none !important;
  }
}


/* ========== qxmd167-practice-foot: ExamGoal actions tidy on Practice ========== */
.eg-test-root.eg-qxmd167 .eg-foot-practice {
  flex-wrap: wrap !important;
  gap: 6px !important;
  align-items: center !important;
}
.eg-test-root.eg-qxmd167 .eg-foot-practice .eg-foot-left {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px !important;
  width: auto !important;
  flex: 1 1 auto !important;
}
.eg-test-root.eg-qxmd167 .eg-foot-practice .eg-foot-right {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  width: auto !important;
  grid-template-columns: none !important;
}
.eg-test-root.eg-qxmd167 .eg-foot-practice .eg-btn {
  min-height: 42px !important;
  font-size: 12px !important;
  padding: 8px 10px !important;
  white-space: nowrap !important;
}
.eg-test-root.eg-qxmd167 .eg-foot-practice .eg-show {
  margin-right: 4px;
}
@media (max-width: 720px) {
  /* qxmd170: Previous | Next only — no stacked Mark/Clear/Save */
  .eg-test-root.eg-qxmd167 .eg-foot-practice,
  .eg-test-root.eg-qxmd170 .eg-foot-practice {
    flex-direction: column-reverse !important;
    flex-wrap: nowrap !important;
    gap: 0 !important;
    padding: 8px 10px max(10px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-foot-nav,
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-foot-right {
    display: grid !important;
    grid-template-columns: 48px 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    flex: 0 0 auto !important;
    order: 2 !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-btn-close-pal {
    display: none !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice #egFootMore {
    display: inline-flex !important;
    min-width: 48px !important;
    width: 48px !important;
    font-size: 22px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd170 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    min-height: 52px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    width: 100% !important;
  }
  /* Hide Mark / Clear / Show in the foot bar — live in More sheet */
  .eg-test-root.eg-qxmd170:not(.eg-foot-more-open) .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd170:not(.eg-foot-more-open) .eg-foot-practice .eg-foot-left {
    display: none !important;
  }
  .eg-test-root.eg-qxmd170.eg-foot-more-open .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd170.eg-foot-more-open .eg-foot-practice .eg-foot-left {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    width: 100% !important;
    order: 1 !important;
    padding: 10px 4px 8px !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    margin-bottom: 6px;
  }
  .eg-test-root.eg-qxmd170.eg-foot-more-open .eg-foot-practice .eg-btn-review,
  .eg-test-root.eg-qxmd170.eg-foot-more-open .eg-foot-practice .eg-btn-clear {
    flex: 0 0 auto !important;
    width: 100% !important;
    min-height: 44px !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-sheet-scrim {
    display: none !important;
  }
  .eg-test-root.eg-qxmd170.eg-foot-more-open .eg-foot-sheet-scrim {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    bottom: 120px !important;
    background: rgba(15, 23, 42, 0.35) !important;
    z-index: 2147482990 !important;
    pointer-events: auto !important;
  }
}

/* Desktop / wide: full ExamGoal foot; hide More */
@media (min-width: 721px) {
  .eg-test-root.eg-qxmd170 .eg-foot-practice #egFootMore,
  .eg-test-root.eg-qxmd170 .eg-foot-sheet-scrim {
    display: none !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice {
    flex-direction: row !important;
    flex-wrap: wrap !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-foot-left {
    display: flex !important;
  }
  .eg-test-root.eg-qxmd170 .eg-foot-practice .eg-foot-nav {
    display: flex !important;
    grid-template-columns: none !important;
    margin-left: auto;
  }
}


/* qxmd170: Report + Group always reachable on mobile Practice */
@media (max-width: 720px) {
  .eg-test-root.eg-qxmd170[data-eg-mode="practice"] .eg-top-tools .eg-tool-reach,
  .eg-test-root.eg-qxmd170[data-eg-mode="practice"] .eg-top-tools #egPlusBtn,
  .eg-test-root.eg-qxmd170[data-eg-mode="practice"] .eg-top-tools #mtkReportBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* qxmd170: palette chrome ≤120ms */
.eg-test-root.eg-qxmd170 {
  --eg-chrome-ms: 120ms;
}
.eg-test-root.eg-qxmd170 #egSide,
.eg-test-root.eg-qxmd170 .eg-side,
.eg-test-root.eg-qxmd170.eg-side-open #egSide,
.eg-test-root.eg-qxmd170.eg-side-open .eg-side {
  transition: transform var(--eg-chrome-ms, 120ms) cubic-bezier(.2,.8,.2,1),
              opacity var(--eg-chrome-ms, 120ms) ease !important;
}

/* Radio never overlaps letter circle — letter IS the control (sitewide) */
.eg-test-root .mtk-opt-radio,
.mtk-test-root .mtk-opt-radio,
.qx-practice-page .mtk-opt-radio,
.allen-practice .mtk-opt-radio,
.eg-test-root .mtk-opt:not(.mtk-opt-multi) .mtk-opt-radio,
.mtk-test-root .mtk-opt:not(.mtk-opt-multi) .mtk-opt-radio {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  overflow: hidden !important;
}
.eg-test-root .mtk-opt.selected .mtk-opt-letter,
.eg-test-root .mtk-opt.selected .qx-opt-circle,
.mtk-test-root .mtk-opt.selected .mtk-opt-letter,
.mtk-test-root .mtk-opt.selected .qx-opt-circle,
.eg-test-root .qx-prac-opt.selected .mtk-opt-letter,
.eg-test-root .qx-prac-opt.selected .qx-opt-circle {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45);
}

/* Practice legend marked colors */
.eg-legend .eg-dot.marked { background: #a855f7; }
.eg-legend .eg-dot.att-mark { background: #a855f7; box-shadow: 0 0 0 2px #22c55e; }

/* qxmd170: option KaTeX clear in dark + light (letter circle is control; radio hidden) */
.eg-test-root[data-test-theme="dark"] .mtk-opt-text .katex,
.eg-test-root[data-test-theme="dark"] .mtk-opt-text .katex *,
.eg-test-root[data-test-theme="dark"] .qx-prac-opt-text .katex,
.eg-test-root[data-test-theme="dark"] .qx-prac-opt-text .katex *,
.mtk-test-root[data-test-theme="dark"] .mtk-opt-text .katex,
.mtk-test-root[data-test-theme="dark"] .mtk-opt-text .katex *,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex,
.eg-test-root[data-test-theme="dark"] .eg-opt .katex * {
  color: #e8eef7 !important;
}
.eg-test-root[data-test-theme="light"] .mtk-opt-text .katex,
.eg-test-root[data-test-theme="light"] .mtk-opt-text .katex *,
.eg-test-root[data-test-theme="light"] .qx-prac-opt-text .katex,
.eg-test-root[data-test-theme="light"] .qx-prac-opt-text .katex *,
.mtk-test-root[data-test-theme="light"] .mtk-opt-text .katex,
.mtk-test-root[data-test-theme="light"] .mtk-opt-text .katex *,
.eg-test-root[data-test-theme="light"] .eg-opt .katex,
.eg-test-root[data-test-theme="light"] .eg-opt .katex * {
  color: #0f172a !important;
}
.eg-test-root .mtk-opt-letter,
.eg-test-root .qx-opt-circle,
.mtk-test-root .mtk-opt-letter,
.mtk-test-root .qx-opt-circle {
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}


/* ========== qxmd171: Marks-like mobile Practice foot ========== */
/* Mark | Clear on top row; Previous | Save & Next on bottom — clean, not stacked clutter */
@media (max-width: 720px) {
  .eg-test-root.eg-qxmd171 .eg-foot-practice.eg-marks-foot,
  .eg-test-root.eg-qxmd171 .eg-foot-practice {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: stretch !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-left {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    order: 1 !important;
    padding: 0 !important;
    border: 0 !important;
    margin: 0 !important;
  }
  /* Show Answer spans full width above Mark/Clear when present */
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-extra .eg-show,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-left .eg-show {
    grid-column: 1 / -1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
    min-height: 36px !important;
    padding: 4px 2px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: inherit !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-btn-review,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-btn-clear {
    display: inline-flex !important;
    width: 100% !important;
    min-height: 44px !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    border-radius: 10px !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-nav,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
    order: 2 !important;
    flex: 0 0 auto !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice #egFootMore,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-btn-close-pal,
  .eg-test-root.eg-qxmd171 .eg-foot-sheet-scrim {
    display: none !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd171 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    min-height: 48px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    width: 100% !important;
    border-radius: 10px !important;
  }
  /* Short labels on phone; full labels desktop */
  .eg-test-root.eg-qxmd171 .eg-btn-full { display: none !important; }
  .eg-test-root.eg-qxmd171 .eg-btn-short { display: inline !important; }
  /* Override qxmd170 hide-until-more rules when qxmd171 present */
  .eg-test-root.eg-qxmd171.eg-qxmd170:not(.eg-foot-more-open) .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd171.eg-qxmd170:not(.eg-foot-more-open) .eg-foot-practice .eg-foot-left {
    display: grid !important;
  }
  /* Compact meta strip — Marks clean */
  .eg-test-root.eg-qxmd171 .eg-info-strip {
    padding: 6px 10px !important;
    gap: 6px !important;
    font-size: 12px !important;
  }
  .eg-test-root.eg-qxmd171 .eg-info-strip .eg-q-num {
    font-weight: 800 !important;
    font-size: 13px !important;
  }
  /* Options spacing clean */
  .eg-test-root.eg-qxmd171 .mtk-opts,
  .eg-test-root.eg-qxmd171 .eg-opts,
  .eg-test-root.eg-qxmd171 .qx-prac-opts {
    gap: 8px !important;
  }
  .eg-test-root.eg-qxmd171 .mtk-opt,
  .eg-test-root.eg-qxmd171 .qx-prac-opt {
    min-height: 48px !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }
  /* Report + Group reachable */
  .eg-test-root.eg-qxmd171[data-eg-mode="practice"] .eg-top-tools .eg-tool-reach,
  .eg-test-root.eg-qxmd171[data-eg-mode="practice"] .eg-top-tools #egPlusBtn,
  .eg-test-root.eg-qxmd171[data-eg-mode="practice"] .eg-top-tools #mtkReportBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
  /* Test mode mobile: same Marks 2×2 feel */
  .eg-test-root.eg-qxmd171[data-eg-mode="test"] .eg-foot:not(.eg-foot-practice) {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 10px 12px max(12px, env(safe-area-inset-bottom, 0px)) !important;
  }
  .eg-test-root.eg-qxmd171[data-eg-mode="test"] .eg-foot .eg-foot-left,
  .eg-test-root.eg-qxmd171[data-eg-mode="test"] .eg-foot .eg-foot-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    width: 100% !important;
  }
  .eg-test-root.eg-qxmd171[data-eg-mode="test"] .eg-foot .eg-submit-always {
    width: 100% !important;
    order: 3 !important;
  }
}

@media (min-width: 721px) {
  .eg-test-root.eg-qxmd171 .eg-btn-full { display: inline !important; }
  .eg-test-root.eg-qxmd171 .eg-btn-short { display: none !important; }
  .eg-test-root.eg-qxmd171 .eg-foot-practice #egFootMore,
  .eg-test-root.eg-qxmd171 .eg-foot-sheet-scrim {
    display: none !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-left {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: auto !important;
    grid-template-columns: none !important;
  }
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-nav,
  .eg-test-root.eg-qxmd171 .eg-foot-practice .eg-foot-right {
    display: flex !important;
    grid-template-columns: none !important;
    margin-left: auto;
    gap: 8px !important;
    width: auto !important;
  }
}

/* Palette still CSS-instant */
.eg-test-root.eg-qxmd171 {
  --eg-chrome-ms: 120ms;
}
.eg-test-root.eg-qxmd171 #egSide,
.eg-test-root.eg-qxmd171 .eg-side,
.eg-test-root.eg-qxmd171.eg-side-open #egSide,
.eg-test-root.eg-qxmd171.eg-side-open .eg-side {
  transition: transform var(--eg-chrome-ms, 120ms) cubic-bezier(.2,.8,.2,1),
              opacity var(--eg-chrome-ms, 120ms) ease !important;
}


/* ========== qxmd173: mobile Practice — hide Clear; Prev|Next primary + safe-area ========== */
/* Show Answer toggle left EXACTLY as-is (no hide/restyle/relocate). Desktop Clear unchanged. */
@media (max-width: 768px) {
  /* Foot: fully visible, bottom:0, padding includes safe-area (not bottom:safe-area which clips tall feet) */
  .eg-test-root.eg-qxmd173 .eg-foot-practice.eg-marks-foot,
  .eg-test-root.eg-qxmd173 .eg-foot-practice,
  .eg-test-root.eg-qxmd173 #egFoot.eg-foot-practice {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 8px !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
    overflow: visible !important;
    clip: auto !important;
    max-height: none !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100vw !important;
    padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Hide Clear on mobile Practice only */
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxClearBtn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    min-width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  /* Hide Mark-for-review in foot so Prev|Next is the primary row (Mark remains in header tools) */
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-review,
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxReviewNextBtn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    overflow: hidden !important;
  }

  /* Extra row: Show Answer only — do not restyle .eg-show (leave as existing) */
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-left {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    width: 100% !important;
    order: 1 !important;
    padding: 0 !important;
    border: 0 !important;
    margin: 0 !important;
    grid-template-columns: none !important;
  }

  /* Prev | Next — primary full-width foot row: large, high contrast, clear labels */
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-nav,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-right {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
    width: 100% !important;
    order: 2 !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice #egFootMore,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-close-pal,
  .eg-test-root.eg-qxmd173 .eg-foot-sheet-scrim {
    display: none !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 52px !important;
    height: auto !important;
    padding: 12px 14px !important;
    font-size: 16px !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em !important;
    border-radius: 12px !important;
    line-height: 1.2 !important;
    box-sizing: border-box !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxPrevBtn {
    background: #e2e8f0 !important;
    color: #0f172a !important;
    -webkit-text-fill-color: #0f172a !important;
    border: 1px solid #94a3b8 !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxNextBtn,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-next {
    background: #2563eb !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid #1d4ed8 !important;
  }
  .eg-test-root.eg-qxmd173[data-test-theme="dark"] .eg-foot-practice #qxPrevBtn {
    background: #1e293b !important;
    color: #f1f5f9 !important;
    -webkit-text-fill-color: #f1f5f9 !important;
    border: 1px solid #475569 !important;
  }
  /* Short labels on phone for Next; Previous is single word */
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-full { display: none !important; }
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-short { display: inline !important; }

  /* Content scroll room for Show Answer + Prev|Next + safe-area (shorter than Mark|Clear era) */
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-main,
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-q-card,
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-scroll,
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .mtk-body,
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-body {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.allen-practice-active .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-main,
  body.marks-test-active .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-main {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Override qxmd171 Mark|Clear display:inline-flex when qxmd173 present */
  .eg-test-root.eg-qxmd173.eg-qxmd171 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd173.eg-qxmd171 .eg-foot-practice #qxClearBtn,
  .eg-test-root.eg-qxmd173.eg-qxmd171 .eg-foot-practice .eg-btn-review,
  .eg-test-root.eg-qxmd173.eg-qxmd171 .eg-foot-practice #qxReviewNextBtn {
    display: none !important;
  }
}

/* Desktop / website: keep ExamGoal Clear (+ Mark) toolbar as before */
@media (min-width: 769px) {
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxClearBtn,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-btn-review,
  .eg-test-root.eg-qxmd173 .eg-foot-practice #qxReviewNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    width: auto !important;
    height: auto !important;
    min-height: 40px !important;
    overflow: visible !important;
  }
  .eg-test-root.eg-qxmd173 .eg-btn-full { display: inline !important; }
  .eg-test-root.eg-qxmd173 .eg-btn-short { display: none !important; }
  .eg-test-root.eg-qxmd173 .eg-foot-practice {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    bottom: 0 !important;
    padding: 10px 16px !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-extra,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-left {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: auto !important;
  }
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-nav,
  .eg-test-root.eg-qxmd173 .eg-foot-practice .eg-foot-right {
    display: flex !important;
    margin-left: auto;
    gap: 8px !important;
    width: auto !important;
    grid-template-columns: none !important;
  }
}


/* ========== qxmd173b: Aa Text size — top toolbar; popover opens downward ========== */
/* Do NOT put Aa in bottom foot. Popover must not cover Prev/Next/Show Answer. */
@media (max-width: 768px) {
  /* Keep Aa (egFmtBtn) in top tools — visible primary */
  .eg-test-root.eg-qxmd173[data-eg-mode="practice"] .eg-top-tools #egFmtBtn,
  .eg-test-root.eg-qxmd173 .eg-top-tools #egFmtBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    order: 0;
  }
  /* Override legacy bottom-anchored .eg-fmt-pop (was bottom: calc(88px+safe-area)) */
  .eg-test-root.eg-qxmd173 .eg-fmt-pop,
  .eg-test-root.eg-qxmd173 #egFmtPop {
    position: fixed !important;
    top: calc(52px + env(safe-area-inset-top, 0px)) !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
    width: min(280px, calc(100vw - 16px)) !important;
    max-width: calc(100vw - 16px) !important;
    max-height: min(42vh, 320px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    z-index: 2147482500 !important;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22) !important;
    border-radius: 12px !important;
    /* compact — never full-screen sheet */
    height: auto !important;
  }
  /* Ensure root/top establish stacking; pop stays under header tools visually */
  .eg-test-root.eg-qxmd173 .eg-top {
    position: relative !important;
    z-index: 2147482600 !important;
  }
  /* Foot stays above content but below should not fight Aa pop — foot z already high;
     Aa pop sits under top bar, above question, clear of foot */
  .eg-test-root.eg-qxmd173 .eg-foot-practice {
    z-index: 2147483000 !important;
  }
}

/* ========== qxmd175: Marks-way Check Answer + mobile Prev/Next never clipped ========== */

/* ========== qxmd185: Check Answer NEVER hides the live question ========== */
html .eg-test-root.eg-sol-showing.eg-qxmd175 .eg-q-stem,
html .eg-test-root.eg-sol-showing.eg-qxmd175 #egQArea,
html .eg-test-root.eg-sol-showing .eg-q-stem.eg-stem-sol-hidden,
html .eg-test-root.eg-sol-showing #egQArea.eg-stem-sol-hidden,
html .mtk-test-root.eg-sol-showing .mtk-q-text,
html .allen-practice.eg-sol-showing .mtk-q-text,
html .eg-test-root.eg-sol-showing #egQArea,
html .eg-test-root.eg-sol-showing .eg-q-stem {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  margin: revert !important;
  padding: revert !important;
  border: revert !important;
  position: static !important;
  pointer-events: auto !important;
  font-size: 17px !important;
  line-height: 1.65 !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}
html .eg-stem-sol-hidden:not(.eg-sol *):not(.qx-sol-card *):not(#egSol *),
html .qx-stem-sol-hidden:not(.eg-sol *):not(.qx-sol-card *) {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  font-size: inherit !important;
  line-height: inherit !important;
}
/* Solution must not reprint the question stem */
.eg-sol .eg-q-stem,
.eg-sol .mtk-q-text,
.qx-sol-card .eg-q-stem,
.qx-sol-flow > .eg-q-stem,
#egSol .eg-q-stem,
#qaSolReveal .mtk-q-text,
#qaSolReveal .eg-q-stem {
  display: none !important;
}

/* Marks-way panel sits where the stem was — full width, not a side-by-side split */
.eg-test-root.eg-sol-showing .eg-sol-panel.eg-sol-marks-way,
.eg-test-root.eg-qxmd175 .eg-sol-panel.eg-sol-marks-way,
.eg-sol-panel.eg-sol-marks-way {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 12px !important;
  float: none !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  grid-column: 1 / -1 !important;
}

/* Never lay out stem+sol as two columns */
.eg-test-root.eg-sol-showing .eg-q-card,
.eg-test-root.eg-sol-showing .eg-main {
  display: block !important;
  grid-template-columns: none !important;
}

@media (max-width: 768px) {
  /* Foot always above solution / keyboard / overflow */
  .eg-test-root.eg-qxmd175 .eg-foot,
  .eg-test-root.eg-qxmd175 .eg-foot-practice,
  .eg-test-root.eg-qxmd175 #egFoot,
  .eg-test-root.eg-sol-showing.eg-qxmd175 .eg-foot,
  .eg-test-root.eg-sol-showing.eg-qxmd175 #egFoot {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
    overflow: visible !important;
    clip: auto !important;
    max-height: none !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 64px !important;
  }

  .eg-test-root.eg-qxmd175 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd175 .eg-foot-practice #qxNextBtn,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-foot #qxPrevBtn,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-foot #qxNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    min-height: 52px !important;
    width: 100% !important;
  }

  /* Clear stays hidden on mobile (qxmd173) */
  .eg-test-root.eg-qxmd175 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd175 .eg-foot-practice #qxClearBtn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
  }

  /* Solution must not cover the foot */
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-sol-panel,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-main,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-q-card,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-scroll,
  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-body {
    padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
    margin-bottom: 0 !important;
  }

  .eg-test-root.eg-qxmd175.eg-sol-showing .eg-sol-panel {
    max-height: none !important;
    z-index: 2 !important;
    overflow: visible !important;
  }
}


/* ========== qxmd176: kill off-canvas ghost stem; Marks-like sol; opts hide while sol ========== */
/* Root cause of stem fragments ABOVE header: position:absolute + left:-9999px (+ scrollIntoView).
   Override ALL prior stem-hide absolute/clip rules — in-flow collapse only. */
html .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-q-stem,
html .eg-test-root.eg-sol-showing.eg-qxmd176 #egQArea,
html .eg-test-root.eg-qxmd176.eg-sol-showing .eg-q-stem,
html .eg-test-root.eg-qxmd176.eg-sol-showing #egQArea,
html .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-q-stem.eg-stem-sol-hidden,
html .eg-test-root.eg-sol-showing.eg-qxmd176 #egQArea.eg-stem-sol-hidden,
html .eg-test-root.eg-qxmd176 .eg-stem-sol-hidden,
html .eg-test-root.eg-qxmd176 .qx-stem-sol-hidden,
html .mtk-test-root.eg-sol-showing.eg-qxmd176 .mtk-q-text,
html .allen-practice.eg-sol-showing .mtk-q-text,
html[data-theme="light"] .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-q-stem,
html[data-theme="dark"] .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-q-stem,
html .eg-test-root[data-test-theme="light"].eg-sol-showing.eg-qxmd176 .eg-q-stem,
html .eg-test-root[data-test-theme="dark"].eg-sol-showing.eg-qxmd176 .eg-q-stem {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  font-size: inherit !important;
  line-height: inherit !important;
  pointer-events: auto !important;
  position: static !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
}

/* Keep options visible while Solution is open */
html .eg-test-root.eg-sol-showing.eg-qxmd176 #qxOpts,
html .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-opts,
html .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-action-row,
html .eg-test-root.eg-sol-showing.eg-qxmd176 #egCheckRow,
html .eg-test-root.eg-sol-showing .eg-opts-sol-hidden {
  display: revert !important;
  visibility: visible !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* Solution panel fills main content cleanly under metadata strip */
.eg-test-root.eg-qxmd176.eg-sol-showing .eg-sol-panel.eg-sol-marks-way,
.eg-test-root.eg-qxmd176 .eg-sol-panel.eg-sol-marks-way {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 12px !important;
  float: none !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  grid-column: 1 / -1 !important;
  z-index: 1 !important;
}

/* Keep info strip (Q# / type / source) visible — Marks metadata */
.eg-test-root.eg-qxmd176.eg-sol-showing .eg-info-strip,
.eg-test-root.eg-qxmd176.eg-sol-showing #egInfoStrip,
.eg-test-root.eg-qxmd176.eg-sol-showing .eg-top {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  left: auto !important;
  clip: auto !important;
}

/* Contain any leftover paint inside body — never leak above header */
.eg-test-root.eg-qxmd176 .eg-body,
.eg-test-root.eg-qxmd176.eg-sol-showing .eg-body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  position: relative !important;
  contain: paint !important;
}
.eg-test-root.eg-qxmd176 .eg-q-card,
.eg-test-root.eg-qxmd176.eg-sol-showing .eg-q-card {
  overflow: hidden !important;
  position: relative !important;
}

/* Retain mobile foot / Clear-hide from qxmd175 under qxmd176 class */
@media (max-width: 768px) {
  .eg-test-root.eg-qxmd176 .eg-foot,
  .eg-test-root.eg-qxmd176 .eg-foot-practice,
  .eg-test-root.eg-qxmd176 #egFoot,
  .eg-test-root.eg-sol-showing.eg-qxmd176 .eg-foot,
  .eg-test-root.eg-sol-showing.eg-qxmd176 #egFoot {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
    overflow: visible !important;
    clip: auto !important;
    max-height: none !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 64px !important;
  }
  .eg-test-root.eg-qxmd176 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd176 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    min-height: 52px !important;
  }
  .eg-test-root.eg-qxmd176 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd176 .eg-foot-practice #qxClearBtn {
    display: none !important;
  }
  .eg-test-root.eg-qxmd176.eg-sol-showing .eg-sol-panel,
  .eg-test-root.eg-qxmd176.eg-sol-showing .eg-main,
  .eg-test-root.eg-qxmd176.eg-sol-showing .eg-q-card,
  .eg-test-root.eg-qxmd176.eg-sol-showing .eg-body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ========== qxmd177: Marks-like Check Answer — NO top jump; stable in-flow sol ========== */
/* Root cause of "pura question top mein": reveal/bind set scrollTop=0 after sol open.
   Keep metadata + content column stable; sol replaces stem in-flow; opts hide after paint. */
.eg-test-root.eg-qxmd177,
.eg-test-root.eg-qxmd177.eg-sol-showing,
.eg-test-root.eg-qxmd177-scroll-lock {
  overflow-anchor: none !important;
}
.eg-test-root.eg-qxmd177 .eg-body,
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-body,
.eg-test-root.eg-qxmd177-scroll-lock .eg-body,
.eg-test-root.eg-qxmd177 .eg-main,
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-main {
  overflow-anchor: none !important;
  scroll-behavior: auto !important;
  overscroll-behavior: contain !important;
}

/* Marks-like: metadata strip stays put (never absolute / never reordered above chrome) */
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-info-strip,
.eg-test-root.eg-qxmd177.eg-sol-showing #egInfoStrip,
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-top {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  transform: none !important;
  order: unset !important;
}

/* Stem collapses in-flow (inherit qxmd176 static hide; gate on qxmd177 too) */
html .eg-test-root.eg-sol-showing.eg-qxmd177 .eg-q-stem,
html .eg-test-root.eg-sol-showing.eg-qxmd177 #egQArea,
html .eg-test-root.eg-qxmd177 .eg-stem-sol-hidden,
html .eg-test-root.eg-qxmd177 .qx-stem-sol-hidden {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  position: static !important;
  left: auto !important;
  clip: auto !important;
  clip-path: none !important;
  pointer-events: none !important;
}

/* Options + check row hide while sol open — no broken stack under Solution */
html .eg-test-root.eg-sol-showing.eg-qxmd177 #qxOpts,
html .eg-test-root.eg-sol-showing.eg-qxmd177 .eg-opts,
html .eg-test-root.eg-sol-showing.eg-qxmd177 .eg-opts-sol-hidden,
html .eg-test-root.eg-sol-showing.eg-qxmd177 .eg-action-row,
html .eg-test-root.eg-sol-showing.eg-qxmd177 #egCheckRow {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
  order: unset !important;
}

/* Solution panel in question body under metadata — relative in-flow, not viewport-top */
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-sol-panel.eg-sol-marks-way,
.eg-test-root.eg-qxmd177 .eg-sol-panel.eg-sol-marks-way {
  display: block !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 0 12px !important;
  z-index: 1 !important;
  order: unset !important;
}

.eg-test-root.eg-qxmd177 .eg-q-card,
.eg-test-root.eg-qxmd177.eg-sol-showing .eg-q-card {
  display: block !important;
  position: relative !important;
  overflow: hidden !important;
}

/* Retain mobile Clear-hide + Prev/Next under qxmd177 */
@media (max-width: 768px) {
  .eg-test-root.eg-qxmd177 .eg-foot,
  .eg-test-root.eg-qxmd177 .eg-foot-practice,
  .eg-test-root.eg-qxmd177 #egFoot,
  .eg-test-root.eg-sol-showing.eg-qxmd177 .eg-foot,
  .eg-test-root.eg-sol-showing.eg-qxmd177 #egFoot {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 64px !important;
  }
  .eg-test-root.eg-qxmd177 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd177 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    min-height: 52px !important;
  }
  .eg-test-root.eg-qxmd177 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd177 .eg-foot-practice #qxClearBtn {
    display: none !important;
  }
  .eg-test-root.eg-qxmd177.eg-sol-showing .eg-sol-panel,
  .eg-test-root.eg-qxmd177.eg-sol-showing .eg-main,
  .eg-test-root.eg-qxmd177.eg-sol-showing .eg-q-card,
  .eg-test-root.eg-qxmd177.eg-sol-showing .eg-body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}


/* ========== qxmd179: stem ABOVE header — root cause + Marks shell ==========
   ROOT CAUSE (high confidence):
   1) Legacy stem-hide used position:absolute; top:0; left:-9999. When display:none
      raced/lost to theme visibility, WebKit painted the orphan stem at the TOP of
      the fixed #app-main / .eg-test-root containing block — visually ABOVE .eg-top.
   2) body.marks-test-active made .eg-test-root position:relative and scrolled
      #app-main as a whole, so chrome was not locked; host chapter .q-card/.q-text
      could also peek above a non-covering practice layer.
   FIX: static display:none stem-hide (patched above); lock practice chrome fixed
   fullscreen with overflow ONLY on .eg-body; hide host question strips while active.
*/
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-sol-showing.eg-qxmd179 .eg-q-stem.eg-stem-sol-hidden,
html .eg-test-root.eg-sol-showing.eg-qxmd179 #egQArea.eg-stem-sol-hidden,
html .eg-test-root.eg-qxmd179 .eg-stem-sol-hidden,
html .eg-test-root.eg-qxmd179 .qx-stem-sol-hidden,
html .eg-test-root.eg-sol-showing.eg-qxmd179 .mtk-q-text.eg-stem-sol-hidden,
html[data-theme="dark"] .eg-test-root.eg-sol-showing.eg-qxmd179 #egQArea,
html[data-theme="light"] .eg-test-root.eg-sol-showing.eg-qxmd179 #egQArea,
html[data-theme="dark"] .eg-test-root.eg-sol-showing.eg-qxmd179 .eg-q-stem,
html[data-theme="light"] .eg-test-root.eg-sol-showing.eg-qxmd179 .eg-q-stem,
html .eg-test-root[data-test-theme="dark"].eg-sol-showing.eg-qxmd179 .eg-q-stem,
html .eg-test-root[data-test-theme="light"].eg-sol-showing.eg-qxmd179 .eg-q-stem {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  font-size: inherit !important;
  line-height: inherit !important;
  pointer-events: auto !important;
  color: inherit !important;
}

/* Hide stray practice stems / clones outside the blue header when Solution open */
html body:has(.eg-test-root.eg-sol-showing.eg-qxmd179) .q-card .q-text,
html body:has(.eg-test-root.eg-sol-showing.eg-qxmd179) .q-text.qx-content,
html body:has(.eg-test-root.eg-sol-showing.eg-qxmd179) .cpyqb-q-stem,
html body:has(.eg-test-root.eg-sol-showing.eg-qxmd179) .qx-list-q-stem,
html .eg-test-root.eg-sol-showing.eg-qxmd179 ~ .eg-q-stem,
html .eg-test-root.eg-sol-showing.eg-qxmd179 ~ .mtk-q-text,
body.marks-test-active .eg-q-stem:not(.eg-test-root .eg-q-stem):not(.eg-sol-panel *),
body.allen-practice-active .eg-q-stem:not(.eg-test-root .eg-q-stem):not(.eg-sol-panel *),
body.marks-test-active.eg-qxmd179-host .q-card,
body.allen-practice-active.eg-qxmd179-host .q-card {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
}

/* Host chapter/list siblings inside #app-main — only practice root may show */
body.marks-test-active #app-main > :not(.eg-test-root):not(.mtk-test-root):not(script):not(style):not(link),
body.allen-practice-active #app-main > :not(.eg-test-root):not(.mtk-test-root):not(script):not(style):not(link) {
  display: none !important;
  visibility: hidden !important;
  height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Fullscreen practice chrome: header locked at top; scroll content pane ONLY */
body.marks-test-active.eg-qxmd179-host #app-main,
body.marks-test-active:has(.eg-test-root.eg-qxmd179) #app-main,
body.allen-practice-active:has(.eg-test-root.eg-qxmd179) #app-main {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}
/* qxmd211: Allen practice host must NOT trap #app-main (no eg-body scroll child) */
body.allen-practice-active.eg-qxmd179-host #app-main {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: contain !important;
}

.eg-test-root.eg-qxmd179,
.eg-test-root.eg-qxmd179.mtk-test-root,
body.marks-test-active .eg-test-root.eg-qxmd179,
body.marks-test-active .eg-test-root.eg-qxmd179.mtk-test-root,
body.allen-practice-active .eg-test-root.eg-qxmd179 {
  position: fixed !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  min-height: 100dvh !important;
  z-index: 9600 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  background: var(--eg-bg, #eef2f7) !important;
}

.eg-test-root.eg-qxmd179 > .eg-top {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  flex-shrink: 0 !important;
  z-index: 50 !important;
  order: 0 !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  transform: none !important;
}

.eg-test-root.eg-qxmd179 > .eg-subs,
.eg-test-root.eg-qxmd179 > .eg-qbar,
.eg-test-root.eg-qxmd179 > .eg-info-strip,
.eg-test-root.eg-qxmd179 > #egInfoStrip {
  flex-shrink: 0 !important;
  position: relative !important;
  order: unset !important;
}

.eg-test-root.eg-qxmd179 > .eg-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain !important;
  position: relative !important;
  contain: layout paint !important;
}

.eg-test-root.eg-qxmd179 .eg-main {
  min-height: 0 !important;
  overflow: visible !important;
}

.eg-test-root.eg-qxmd179 .eg-q-card {
  overflow: visible !important;
  position: relative !important;
}

/* Sol open: keep Marks-like in-flow panel under metadata; zero stem paint */
.eg-test-root.eg-qxmd179.eg-sol-showing .eg-sol-panel.eg-sol-marks-way {
  display: block !important;
  position: relative !important;
  left: auto !important;
  top: auto !important;
  float: none !important;
  width: 100% !important;
  margin: 0 0 12px !important;
  z-index: 1 !important;
}

.eg-test-root.eg-qxmd179.eg-sol-showing > .eg-top,
.eg-test-root.eg-qxmd179.eg-sol-showing > .eg-subs,
.eg-test-root.eg-qxmd179.eg-sol-showing > .eg-info-strip {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

@media (max-width: 768px) {
  .eg-test-root.eg-qxmd179 .eg-foot,
  .eg-test-root.eg-qxmd179 .eg-foot-practice,
  .eg-test-root.eg-qxmd179 #egFoot,
  .eg-test-root.eg-sol-showing.eg-qxmd179 .eg-foot,
  .eg-test-root.eg-sol-showing.eg-qxmd179 #egFoot {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 2147483000 !important;
    transform: none !important;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 64px !important;
  }
  .eg-test-root.eg-qxmd179 .eg-foot-practice #qxPrevBtn,
  .eg-test-root.eg-qxmd179 .eg-foot-practice #qxNextBtn {
    display: inline-flex !important;
    visibility: visible !important;
    min-height: 52px !important;
  }
  .eg-test-root.eg-qxmd179 .eg-foot-practice .eg-btn-clear,
  .eg-test-root.eg-qxmd179 .eg-foot-practice #qxClearBtn {
    display: none !important;
  }
  .eg-test-root.eg-qxmd179.eg-sol-showing .eg-sol-panel,
  .eg-test-root.eg-qxmd179.eg-sol-showing .eg-main,
  .eg-test-root.eg-qxmd179.eg-sol-showing .eg-q-card,
  .eg-test-root.eg-qxmd179.eg-sol-showing .eg-body {
    padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}



/* qxmd180 — Check Answer: keep question + options */
html .eg-test-root.eg-qxmd180.eg-sol-showing #egQArea,
html .eg-test-root.eg-qxmd180.eg-sol-showing .eg-q-stem,
html .eg-test-root.eg-qxmd180 #egQArea,
html .eg-test-root.eg-qxmd180 .eg-q-stem {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  position: static !important;
  pointer-events: auto !important;
  color: inherit !important;
}
html .eg-test-root.eg-qxmd180.eg-sol-showing #qxOpts,
html .eg-test-root.eg-qxmd180.eg-sol-showing .eg-opts,
html .eg-test-root.eg-qxmd180 .eg-opts,
html .eg-test-root.eg-qxmd180 #qxOpts {
  display: grid !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
html .eg-test-root.eg-qxmd180 .eg-sol-panel { display: block !important; margin: 14px 0 8px !important; }
.eg-test-root.eg-qxmd180 .eg-qbar-n,
.eg-test-root.eg-qxmd180 .eg-pal-cell {
  min-width: 36px; min-height: 36px; pointer-events: auto !important; touch-action: manipulation; cursor: pointer;
}
html .eg-test-root.eg-qxmd180 .eg-q-card {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
  overscroll-behavior: contain;
  min-height: 0 !important;
  height: auto !important;
  max-height: none !important;
  flex: 1 1 auto !important;
}
html .eg-test-root.eg-qxmd180 .eg-main,
html .eg-test-root.eg-qxmd180 .eg-body {
  min-height: 0 !important;
  overflow: hidden !important;
}
html .eg-test-root.eg-qxmd180 .eg-q-stem,
html .eg-test-root.eg-qxmd180 .eg-sol,
html .eg-test-root.eg-qxmd180 .eg-sol .qx-content,
html .eg-test-root.eg-qxmd180 .qx-sol-flow,
html .eg-test-root.eg-qxmd180 .mtk-opt,
html .eg-test-root.eg-qxmd180 .eg-opts {
  font-size: var(--nta-q, 16px) !important;
  line-height: var(--nta-lh, 1.55) !important;
}
html .eg-test-root.eg-qxmd180 .eg-q-stem {
  min-height: 0 !important;
  height: auto !important;
  margin-bottom: 12px !important;
}
html .eg-test-root.eg-qxmd180 .eg-sol .eg-q-stem,
html .eg-test-root.eg-qxmd180 .qx-sol-card .eg-q-stem,
html .eg-test-root.eg-qxmd180 .qx-sol-flow > .eg-q-stem {
  display: none !important;
}
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd177 #egQArea,
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd179 #egQArea,
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd177 .eg-q-stem,
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd179 .eg-q-stem,
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd177 #qxOpts,
html .eg-test-root.eg-qxmd180.eg-sol-showing.eg-qxmd179 #qxOpts {
  display: block !important;
  visibility: visible !important;
  height: auto !important;
  overflow: visible !important;
  pointer-events: auto !important;
}

/* qxmd184 — stem children stay visible; numerical keypad not a 2-col grid */
html body .eg-test-root.eg-sol-showing #egQArea,
html body .eg-test-root.eg-sol-showing .eg-q-stem {
  visibility: visible !important;
  opacity: 1 !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  pointer-events: auto !important;
}
html body .eg-test-root.eg-sol-showing #egQArea,
html body .eg-test-root.eg-sol-showing .eg-q-stem {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  font-size: 16px !important;
  line-height: 1.55 !important;
}
html body .eg-test-root #qxOpts.mtk-numerical-wrap,
html body .eg-test-root #qxOpts.qx-num-eg {
  display: flex !important;
  grid-template-columns: none !important;
  flex-direction: column !important;
  align-items: center !important;
}
html body .eg-test-root .qx-num-keypad,
html body .eg-test-root .qx-num-key,
html body .eg-test-root #qxNumInput {
  pointer-events: auto !important;
  touch-action: manipulation !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root .qx-num-input {
  font-size: 22px !important;
  min-height: 48px !important;
  text-align: center !important;
}

/* qxmd191 — tools + Previous/Next always on screen */
.eg-test-root .eg-top-tools,
.eg-test-root.eg-qxmd167 .eg-top-tools {
  display: flex !important;
  visibility: visible !important;
  overflow: visible !important;
  max-width: none !important;
}
.eg-test-root .eg-top-tools .eg-tool-btn,
.eg-test-root .eg-top-tools .eg-ico,
.eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-top-tools .eg-tool-sec:not(.eg-tool-reach) {
  display: inline-flex !important;
  visibility: visible !important;
}
.eg-test-root .eg-foot,
.eg-test-root #egFoot {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root .eg-foot #qxPrevBtn,
.eg-test-root .eg-foot #qxNextBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}


/* qxmd209-allen-marks: override legacy mobile Show/Clear column foot for practice */
@media (max-width: 720px) {
  .allen-practice .eg-foot.eg-foot-marks,
  .allen-practice .mtk-controls.eg-foot-marks,
  .allen-practice .mtk-controls.eg-foot-practice {
    display: grid !important;
    flex-direction: row !important;
    grid-template-columns: 1fr 1.25fr 1fr !important;
    align-items: stretch !important;
    gap: 8px !important;
  }
  .allen-practice .eg-foot.eg-foot-marks .eg-foot-left,
  .allen-practice .eg-foot.eg-foot-marks .eg-foot-right {
    display: none !important;
  }
}


/* ========== qxmd211: Allen/NEET unlock — do NOT trap #app-main when allen-practice ========== */
html body.allen-practice-active.eg-qxmd179-host #app-main,
html body.allen-practice-active.eg-qxmd179-host #app-main.content,
html body.allen-practice-active #app-main,
html body.marks-test-active.allen-practice-active #app-main,
html body.marks-test-active:has(.mtk-test-root.allen-practice) #app-main {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  touch-action: pan-x pan-y !important;
  padding-bottom: var(--eg-foot-pad, calc(72px + env(safe-area-inset-bottom, 0px))) !important;
  scroll-padding-bottom: var(--eg-foot-pad, 72px) !important;
}
html body.allen-practice-active .mtk-test-root.allen-practice {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 100% !important;
  overflow: visible !important;
}
html body.allen-practice-active .mtk-test-root.allen-practice .mtk-body,
html body.allen-practice-active .mtk-test-root.allen-practice .mtk-main {
  overflow: visible !important;
  height: auto !important;
  max-height: none !important;
}
/* qxmd238: solid tappable Prev|Check|Next bar on all practice paths */
.eg-foot.eg-foot-marks,
.eg-foot.eg-foot-practice,
.qx-prac-foot.eg-foot-marks,
.allen-practice .eg-foot.eg-foot-marks {
  background: #ffffff !important;
  background-color: #ffffff !important;
  border-top: 1px solid #e5e7eb !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot.eg-foot-marks,
.eg-test-root[data-test-theme="dark"] .eg-foot.eg-foot-practice,
.allen-practice[data-test-theme="dark"] .eg-foot.eg-foot-marks {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-top: 1px solid #334155 !important;
}


/* qxmd213: examgoal foot + dark chips */
.eg-foot, .qx-prac-foot.eg-foot, .allen-practice .eg-foot, .allen-practice .mtk-controls {
  background: #ffffff !important;
  background-color: #ffffff !important;
  box-shadow: 0 -8px 24px rgba(15,23,42,.12) !important;
  border: none !important;
  border-top: 1px solid #e5e7eb !important;
  pointer-events: auto !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eg-test-root[data-test-theme="dark"] .eg-foot,
.eg-test-root[data-test-theme="dark"] .qx-prac-foot.eg-foot,
.allen-practice[data-test-theme="dark"] .eg-foot,
.allen-practice[data-test-theme="dark"] .mtk-controls {
  background: #0f172a !important;
  background-color: #0f172a !important;
  border-top: 1px solid #334155 !important;
}
.eg-foot #qxPrevBtn, .eg-foot #egCheckBtn, .eg-foot #qxNextBtn,
.eg-foot #qxPracPrev, .eg-foot #qxPracSubmit, .eg-foot #qxPracNext {
  display: inline-flex !important; visibility: visible !important; opacity: 1 !important; pointer-events: auto !important;
}
.eg-main, .eg-q-card, .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; }


/* qxmd237: practice tools stay visible (qxmd217 used to hide all but Settings) */
.eg-test-root.eg-qxmd217 .eg-top-tools .eg-tool-btn:not(#egFmtBtn),
.eg-test-root.eg-qxmd217 .eg-top-tools .eg-tool-pri:not(#egFmtBtn),
.eg-test-root.eg-qxmd217 .eg-top-tools .eg-tool-sec,
.eg-test-root.eg-qxmd217 .eg-top-tools #mtkThemeBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #egAllQBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #egMenuBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #egStarBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #egPlusBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #egFullBtn,
.eg-test-root.eg-qxmd217 .eg-top-tools #mtkReportBtn {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}
.eg-test-root.eg-qxmd217 .eg-action-row.eg-action-note-only { display: none !important; }
.eg-test-root.eg-qxmd217 .eg-top { min-height: 36px !important; padding: 2px 8px !important; }
.eg-test-root.eg-qxmd217 .eg-top-tools { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; overflow: visible !important; max-width: none !important; }
.eg-test-root.eg-qxmd217 #egFmtBtn.eg-settings-gear { display: inline-flex !important; min-width: 36px !important; font-size: 16px !important; }
.eg-fmt-pop.eg-view-settings { max-width: min(360px, 92vw); max-height: min(70vh, 520px); overflow: auto; z-index: 2147483000; padding: 12px 14px 14px; border-radius: 14px; box-shadow: 0 12px 40px rgba(15,23,42,.22); background: #fff; }
.eg-fmt-pop.eg-view-settings .eg-fmt-title { margin: 0 0 10px; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #0f172a; }
html[data-theme="dark"] .eg-fmt-pop.eg-view-settings .eg-fmt-title,
.eg-test-root[data-test-theme="dark"] .eg-fmt-pop.eg-view-settings .eg-fmt-title { color: #f8fafc; }
.eg-fmt-pop.eg-view-settings .eg-fmt-row button { color: #0f172a; background: #f1f5f9; border: 1px solid #cbd5e1; }
.eg-fmt-pop.eg-view-settings .eg-fmt-row button.on { background: #2563eb; color: #fff; border-color: #2563eb; }
html[data-theme="dark"] .eg-fmt-pop.eg-view-settings,
.eg-test-root[data-test-theme="dark"] .eg-fmt-pop.eg-view-settings { background: #0f172a; border: 1px solid #334155; color: #e2e8f0; }
html[data-theme="dark"] .eg-fmt-pop.eg-view-settings .eg-fmt-row button,
.eg-test-root[data-test-theme="dark"] .eg-fmt-pop.eg-view-settings .eg-fmt-row button { background: #1e293b; color: #f1f5f9; border-color: #475569; }
.eg-test-root.eg-qxmd217 .eg-q-area,
.eg-test-root.eg-qxmd217 #egQArea,
.eg-test-root.eg-qxmd217 .eg-main { padding-bottom: calc(var(--eg-foot-pad, 72px)) !important; }
.eg-test-root.eg-qxmd217 .eg-sol .qx-sol-card { margin-top: 8px !important; border-left: none !important; }
.katex-error, .katex-error-color, [class*="katex-error"] { display: none !important; visibility: hidden !important; height: 0 !important; overflow: hidden !important; }


/* qxmd220: sol + stem track --nta-q (override legacy 16px locks) */
html .eg-test-root.eg-qxmd180 .eg-sol,
html .eg-test-root.eg-qxmd180 .eg-sol .qx-content,
html .eg-test-root.eg-qxmd180 .qx-sol-flow,
html .eg-test-root.eg-qxmd180 .sol-body,
html .eg-test-root.eg-qxmd180 .qx-sol-card,
html .eg-test-root.eg-qxmd182 .eg-sol,
html .eg-test-root.eg-qxmd182 .qx-sol-flow,
html .eg-test-root.eg-qxmd182 .sol-body,
html .eg-test-root.eg-qxmd182 .qx-sol-card,
html .eg-test-root .eg-sol,
html .eg-test-root .eg-sol *:not(.katex):not(.katex *):not(svg):not(svg *):not(img):not(button):not(input),
html .eg-test-root #egSol,
html .eg-test-root .qx-sol-flow,
html .eg-test-root .sol-body,
html .eg-test-root .qx-sol-card {
  font-size: var(--nta-q, 16px) !important;
  line-height: var(--nta-lh, 1.55) !important;
}
html .eg-test-root .eg-q-stem,
html .eg-test-root #egQArea,
html .eg-test-root .mtk-q-text,
html .eg-test-root .mtk-opt-text,
html .eg-test-root .eg-opts {
  font-size: var(--nta-q, 16px) !important;
  line-height: var(--nta-lh, 1.55) !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 {
  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 #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;
  min-height: 48px !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[data-eg-mode="practice"] .eg-top-tools .eg-tool-btn,
html body .eg-test-root.eg-qxmd167[data-eg-mode="practice"] .eg-top-tools .eg-tool-sec:not(.eg-tool-reach) {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* qxmd306: paper pans; practice 3-col; test 2×2 */
html body .eg-test-root.eg-qxmd182 .eg-body,
html body .eg-test-root.eg-qxmd182 .eg-main {
  overflow-x: auto !important;
  overflow-y: auto !important;
  min-width: 0 !important;
}
html body .eg-test-root.eg-qxmd182[data-eg-mode="practice"] > #egFoot,
html body .eg-test-root.eg-qxmd182[data-eg-mode="practice"] > .eg-foot {
  display: grid !important;
  grid-template-columns: 1fr 1.2fr 1fr !important;
  position: fixed !important;
  bottom: 0 !important;
  min-height: 56px !important;
  background: #ffffff !important;
  visibility: visible !important;
  pointer-events: auto !important;
}
html body .eg-test-root.eg-qxmd182[data-eg-mode="test"] > #egFoot,
html body .eg-test-root.eg-qxmd182[data-eg-mode="test"] > .eg-foot {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  grid-template-rows: 46px 46px !important;
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  height: auto !important;
  max-height: none !important;
  min-height: calc(120px + max(36px, env(safe-area-inset-bottom, 0px))) !important;
  padding: 10px 12px calc(10px + max(36px, env(safe-area-inset-bottom, 0px))) !important;
  background: #ffffff !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 2147483000 !important;
}
