@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/inter-latin-wght-normal-C2S99t-D.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/inter-latin-ext-wght-normal-CFHvXkgd.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/inter-latin-wght-italic-C02_OjKP.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  src: url("/assets/inter-latin-ext-wght-italic-Smrovaql.woff2") format("woff2-variations");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --app-font-family: "Inter Variable", "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html,
body,
#root,
.app,
button,
input,
textarea,
select {
  font-family: var(--app-font-family) !important;
  letter-spacing: 0 !important;
}

.medical-test-interface,
.medical-test-interface *,
.medical-library-drawer-overlay,
.medical-library-drawer-overlay *,
.calculator-modal,
.calculator-modal *,
.notes-modal,
.notes-modal *,
.settings-modal,
.settings-modal * {
  font-family: var(--app-font-family) !important;
  letter-spacing: 0 !important;
}

#question-stem-container,
.question-pane,
.medical-options,
.option-content,
.option-text,
.explanation-main-text,
.choices-breakdown,
.key-connects-section,
.references-section,
.answer-content-body {
  font-family: var(--app-font-family) !important;
}

:root:not([data-theme="dark"]):not([data-theme="warm"]),
html[data-theme="light"] {
  --qbank-blue: #4054a4;
  --qbank-blue-hover: #374a96;
  --qbank-blue-soft: rgba(64, 84, 164, 0.12);
  --qbank-blue-line: rgba(64, 84, 164, 0.24);
  --primary: var(--qbank-blue);
  --secondary: var(--qbank-blue);
  --primary-light: #5f77cf;
  --toggle-active: var(--qbank-blue);
  --primary-btn: var(--qbank-blue);
  --text-theme: var(--qbank-blue);
  --primary-glow: rgba(64, 84, 164, 0.16);
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .medical-test-interface,
html[data-theme="light"] .medical-test-interface {
  --med-primary: #4054a4;
  --primary: #4054a4;
  --secondary: #4054a4;
  --primary-light: #5f77cf;
  --primary-btn: #4054a4;
  --toggle-active: #4054a4;
  --text-theme: #4054a4;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) a,
html[data-theme="light"] a,
html:not([data-theme="dark"]):not([data-theme="warm"]) .theme-question-color,
html[data-theme="light"] .theme-question-color {
  color: #4054a4;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .search-bar:focus-within,
html[data-theme="light"] .search-bar:focus-within,
html:not([data-theme="dark"]):not([data-theme="warm"]) .input-control:focus,
html[data-theme="light"] .input-control:focus {
  border-color: #4054a4 !important;
  box-shadow: 0 0 0 4px rgba(64, 84, 164, 0.12) !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .icon-btn,
html[data-theme="light"] .icon-btn,
html:not([data-theme="dark"]):not([data-theme="warm"]) .challenge-btn,
html[data-theme="light"] .challenge-btn,
html:not([data-theme="dark"]):not([data-theme="warm"]) .view-plan-btn,
html[data-theme="light"] .view-plan-btn,
html:not([data-theme="dark"]):not([data-theme="warm"]) .view-plan-btn-new,
html[data-theme="light"] .view-plan-btn-new,
html:not([data-theme="dark"]):not([data-theme="warm"]) .tab-btn-new.active,
html[data-theme="light"] .tab-btn-new.active,
html:not([data-theme="dark"]):not([data-theme="warm"]) .home-filter-apply,
html[data-theme="light"] .home-filter-apply,
html:not([data-theme="dark"]):not([data-theme="warm"]) .plan-button,
html[data-theme="light"] .plan-button,
html:not([data-theme="dark"]):not([data-theme="warm"]) .qbank-subscribe-btn,
html[data-theme="light"] .qbank-subscribe-btn,
html:not([data-theme="dark"]):not([data-theme="warm"]) .promo-link-btn,
html[data-theme="light"] .promo-link-btn {
  background-color: #4054a4 !important;
  border-color: #4054a4 !important;
  color: #fff !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .challenge-btn:hover,
html[data-theme="light"] .challenge-btn:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .view-plan-btn:hover,
html[data-theme="light"] .view-plan-btn:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .view-plan-btn-new:hover,
html[data-theme="light"] .view-plan-btn-new:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .home-filter-apply:hover,
html[data-theme="light"] .home-filter-apply:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .plan-button:hover,
html[data-theme="light"] .plan-button:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .qbank-subscribe-btn:hover,
html[data-theme="light"] .qbank-subscribe-btn:hover,
html:not([data-theme="dark"]):not([data-theme="warm"]) .promo-link-btn:hover,
html[data-theme="light"] .promo-link-btn:hover {
  background-color: #374a96 !important;
  border-color: #374a96 !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .stat-icon-box.blue,
html[data-theme="light"] .stat-icon-box.blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .stat-icon-wrapper.blue,
html[data-theme="light"] .stat-icon-wrapper.blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .stat-icon-box.indigo,
html[data-theme="light"] .stat-icon-box.indigo,
html:not([data-theme="dark"]):not([data-theme="warm"]) .stat-icon-wrapper.indigo,
html[data-theme="light"] .stat-icon-wrapper.indigo,
html:not([data-theme="dark"]):not([data-theme="warm"]) .item-icon.blue,
html[data-theme="light"] .item-icon.blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .planner-icon,
html[data-theme="light"] .planner-icon {
  background-color: rgba(64, 84, 164, 0.12) !important;
  color: #4054a4 !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .badge.blue,
html[data-theme="light"] .badge.blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .task-badge.badge-blue,
html[data-theme="light"] .task-badge.badge-blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .task-tag-new.video,
html[data-theme="light"] .task-tag-new.video {
  background-color: rgba(64, 84, 164, 0.12) !important;
  color: #4054a4 !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .dot.blue,
html[data-theme="light"] .dot.blue,
html:not([data-theme="dark"]):not([data-theme="warm"]) .dot.incomplete,
html[data-theme="light"] .dot.incomplete,
html:not([data-theme="dark"]):not([data-theme="warm"]) .question-dot,
html[data-theme="light"] .question-dot,
html:not([data-theme="dark"]):not([data-theme="warm"]) .legend-dot.incomplete,
html[data-theme="light"] .legend-dot.incomplete {
  background-color: #4054a4 !important;
}

html:not([data-theme="dark"]):not([data-theme="warm"]) .progress.incomplete,
html[data-theme="light"] .progress.incomplete,
html:not([data-theme="dark"]):not([data-theme="warm"]) .radial-progress.incomplete,
html[data-theme="light"] .radial-progress.incomplete,
html:not([data-theme="dark"]):not([data-theme="warm"]) .progress-fill.blue,
html[data-theme="light"] .progress-fill.blue {
  stroke: #4054a4 !important;
  background-color: #4054a4 !important;
}

.medical-test-interface #question-stem-container a:has(img),
.medical-test-interface .question-content a:has(img),
.medical-test-interface .explanation-main-text a:has(img),
.medical-test-interface .choices-breakdown a:has(img),
.medical-test-interface .answer-content-body a:has(img),
.medical-test-interface .option-value a:has(img) {
  border: 0 !important;
  border-bottom: 0 !important;
  box-shadow: none !important;
  background-image: none !important;
  text-decoration: none !important;
}

.medical-test-interface #question-stem-container img,
.medical-test-interface .question-content img,
.medical-test-interface .explanation-main-text img,
.medical-test-interface .choices-breakdown img,
.medical-test-interface .answer-content-body img,
.medical-test-interface .option-value img {
  border-bottom: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  -webkit-user-drag: none;
  user-drag: none;
}

.medical-test-interface #question-stem-container p:has(img),
.medical-test-interface .question-content p:has(img),
.medical-test-interface .explanation-main-text p:has(img),
.medical-test-interface .choices-breakdown p:has(img),
.medical-test-interface .answer-content-body p:has(img) {
  border-bottom: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
  background-image: none !important;
}

.medical-test-interface #question-stem-container .gallery a.prev,
.medical-test-interface #question-stem-container .gallery a.next,
.medical-test-interface .question-content .gallery a.prev,
.medical-test-interface .question-content .gallery a.next,
.medical-test-interface .explanation-main-text .gallery a.prev,
.medical-test-interface .explanation-main-text .gallery a.next {
  display: none !important;
  visibility: hidden !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  border: 0 !important;
  box-shadow: none !important;
  text-decoration: none !important;
}

.medical-test-interface .selection-action-btn[title="Copy to clipboard"] {
  display: none !important;
}

/* Codex fix: Coursology-style result controls and previous score rings */
.previous-tests-page .tests-table td.score-cell {
  text-align: center;
  min-width: 82px;
}

.previous-tests-page .score-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 3px solid var(--medical-blue, #4054a4);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--medical-blue, #4054a4) 10%, transparent);
}

.previous-tests-page .score-circle.empty {
  border-style: dashed;
  color: var(--text-secondary);
  border-color: var(--border);
  box-shadow: none;
}

.quiz-mode-pill.knowledge-gap-btn {
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.quiz-mode-pill.knowledge-gap-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(0.98);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.18);
}

.quiz-mode-pill.knowledge-gap-btn:disabled {
  cursor: wait;
  opacity: 0.72;
}

.knowledge-gap-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.48);
}

.knowledge-gap-modal {
  width: min(900px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-primary);
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  overflow: hidden;
}

.knowledge-gap-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  background: var(--medical-blue, #4054a4);
  color: #fff;
}

.knowledge-gap-modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}

.knowledge-gap-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.knowledge-gap-body,
.knowledge-gap-loading,
.knowledge-gap-error {
  padding: 22px 24px;
  overflow: auto;
  line-height: 1.65;
}

.knowledge-gap-body h1,
.knowledge-gap-body h2,
.knowledge-gap-body h3 {
  color: var(--text-primary);
  margin: 1rem 0 0.5rem;
}

.knowledge-gap-body ul,
.knowledge-gap-body ol {
  padding-left: 1.35rem;
}

.knowledge-gap-error {
  color: #ef4444;
  font-weight: 700;
}

.knowledge-gap-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-lighter);
}

html[data-theme="dark"] .previous-tests-page .score-circle,
html[data-theme="warm"] .previous-tests-page .score-circle,
html[data-theme="dark"] .knowledge-gap-modal,
html[data-theme="warm"] .knowledge-gap-modal {
  background: var(--surface);
  color: var(--text-primary);
}
