/* Welcome mirrors Overall's canonical statistics; navigation lives in the sidebar. */
html body #app #adminNav[hidden]{display:none!important}
html body.home-view #app #view .hero-actions,
html body.home-view #app #view .chapter-grid,
html body.home-view #app #view .section-heading,
html body.home-view #app #view .home-results {display:none!important}
/* Preserve the NBME shell, split panes, tools, and resize controls. */
html body.study-mode #app .shell main {width:100%!important;max-width:none!important;padding:4px 6px 12px!important}
html body.study-mode #app #view .uq-exam-frame,
html body.study-mode #app #view .srex-workspace,
html body.study-mode #app #view .srex-header,
html body.study-mode #app #view .srex-footer,
html body.study-mode #app #view .srex-panel,
html body.study-mode #app #view .question-card {border-radius:0!important}
html body.study-mode #app #view .uq-exam-frame,
html body.study-mode #app #view .srex-workspace {width:100%!important;max-width:none!important;margin-inline:0!important}
html body.study-mode #app #view .srex-middle {min-width:0;padding-inline:8px!important}
html body.study-mode #app #view .question-card {padding:14px 16px!important}
@media(max-width:680px){html body.study-mode #app .shell main{padding-inline:0!important}html body.study-mode #app #view .srex-middle{padding-inline:3px!important}html body.study-mode #app #view .question-card{padding:12px 9px!important}}

/* 2026-10-28: Make the exam frame itself stretch with the study viewport.
   Previously #view was flex but its direct .uq-exam-frame child was not,
   leaving an empty band beneath the Tutor footer on wide/short questions.
   Only the exam shell is affected; no answer, timer or review logic changes. */
html body.study-mode #app .shell > main:has(#view .uq-exam-frame) {
  display:flex!important;
  flex-direction:column!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  padding:0!important;
}
html body.study-mode #app #view:has(> .uq-exam-frame) {
  display:flex!important;
  flex-direction:column!important;
  flex:1 1 auto!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  width:100%!important;
  min-width:0!important;
}
html body.study-mode #app #view > .uq-exam-frame {
  display:flex!important;
  flex-direction:column!important;
  flex:1 1 auto!important;
  width:100%!important;
  min-width:0!important;
  min-height:100vh!important;
  min-height:100dvh!important;
  margin:0!important;
  border-radius:0!important;
  box-sizing:border-box!important;
  overflow:visible!important;
}
html body.study-mode #app #view .uq-exam-frame > .srex-header,
html body.study-mode #app #view .uq-exam-frame > .srex-footer {
  width:100%!important;
  flex:0 0 auto!important;
  margin-inline:0!important;
  box-sizing:border-box!important;
  border-radius:0!important;
}
html body.study-mode #app #view .uq-exam-frame > .srex-workspace {
  flex:1 1 auto!important;
  min-height:0!important;
  min-width:0!important;
  margin:0!important;
  border-radius:0!important;
  box-sizing:border-box!important;
}
html body.study-mode #app #view .uq-exam-frame > .srex-footer {
  margin-top:auto!important;
  bottom:0!important;
}

/* sr:stable-exam-bars:v1 — fixed toolbars, scrolling exam content. */
html body.study-mode #app #view > .uq-exam-frame {
  --sr-fixed-header-height: 55px;
  --sr-fixed-footer-height: 100px;
  height:100dvh!important;
  min-height:0!important;
  max-height:100dvh!important;
  overflow:hidden!important;
  position:relative!important;
  padding-top:var(--sr-fixed-header-height)!important;
  padding-bottom:var(--sr-fixed-footer-height)!important;
}
html body.study-mode #app #view .uq-exam-frame > .srex-header {
  position:absolute!important;
  inset:0 0 auto 0!important;
  top:0!important;
  bottom:auto!important;
  z-index:45!important;
  flex:none!important;
}
html body.study-mode #app #view .uq-exam-frame > .srex-workspace {
  flex:1 1 auto!important;
  height:100%!important;
  min-height:0!important;
  max-height:100%!important;
  overflow:auto!important;
  overscroll-behavior:contain!important;
  scrollbar-gutter:stable;
}
html body.study-mode #app #view .uq-exam-frame > .srex-footer {
  position:absolute!important;
  inset:auto 0 0 0!important;
  bottom:0!important;
  top:auto!important;
  z-index:45!important;
  flex:none!important;
}
html body.study-mode #app #view .uq-exam-frame .srex-rail,
html body.study-mode #app #view .uq-exam-frame .srex-panel {
  position:sticky!important;
  top:0!important;
  max-height:100%!important;
}
html body.study-mode #app #view .uq-exam-frame .uq-review-left {
  min-height:calc(100dvh - var(--sr-fixed-header-height) - var(--sr-fixed-footer-height) - 36px)!important;
}
/* 2026-11-23: an unanswered question card fills the space left in the question column instead of a
   fixed 100dvh height, so a short question no longer shows a scrollbar with nothing to scroll. */
@media(min-width:851px){
html body.study-mode #app #view .uq-exam-frame .srex-middle:has(>.question-card.uq-question-left) {
  display:flex!important;
  flex-direction:column!important;
}
html body.study-mode #app #view .uq-exam-frame .srex-middle>.question-card.uq-question-left {
  flex:1 0 auto!important;
  min-height:0!important;
}
}
html body.study-mode #app #view .uq-exam-frame .uq-report-dock {
  position:sticky!important;
  bottom:0!important;
  left:0!important;
  align-self:flex-start!important;
  margin:auto 0 0 0!important;
  padding:8px 0 4px!important;
  z-index:8!important;
}
html body.study-mode #app #view .uq-exam-frame .srr-inline-meta {
  display:flex!important;
  align-items:flex-start!important;
  flex-direction:column!important;
  gap:1px!important;
  min-width:0!important;
}
html body.study-mode #app #view .uq-exam-frame .srr-inline-meta .uq-footer-timer {
  position:static!important;
  display:block!important;
  width:auto!important;
  font-size:11px!important;
  font-weight:500!important;
  line-height:1.3!important;
  color:inherit!important;
  padding:0!important;
  white-space:normal!important;
}
html body.study-mode #app #view .uq-bottom-bar:empty,
html body.study-mode #app #view .uq-bottom-bar[hidden] {display:none!important}
@media(max-width:850px){
 html body.study-mode #app #view .uq-exam-frame .uq-review-left,
 html body.study-mode #app #view .uq-exam-frame .question-card.uq-question-left {min-height:0!important}
 html body.study-mode #app #view .uq-exam-frame .uq-report-dock {margin:24px 0 0!important}
}


/* Study review polish: one answer status; context follows explanation. */
html body.study-mode #app #view .uq-review-right > #answerState{
  font-size:12px!important;line-height:1.45!important;font-weight:650!important;
  margin:4px 0 6px!important;order:1!important;white-space:normal!important;
}
html body.study-mode #app #view .uq-review-right > .uq-review-heading{order:2!important}
html body.study-mode #app #view .uq-review-right > .explanation{order:3!important}
html body.study-mode #app #view .uq-review-right > #explanationFigures{order:4!important}
html body.study-mode #app #view .uq-review-right > .sr-tutor-knowledge{order:5!important}
html body.study-mode #app #view .uq-review-right > .uq-ai-tutor{order:0!important}
html body.study-mode #app #view .uq-review-left #answerState{display:none!important}
html body.study-mode #app #view .sr-tutor-knowledge{
  width:100%!important;min-width:0!important;position:static!important;
  margin:20px 0 8px!important;padding:0!important;
}
html body.study-mode #app #view .sr-tutor-knowledge-section{
  display:block!important;width:100%!important;padding:14px!important;
  margin:0 0 14px!important;border:1px solid rgba(91,145,181,.25)!important;
  border-radius:9px!important;background:rgba(104,168,205,.045)!important;
}
html body.study-mode #app #view .sr-tutor-knowledge-section h3{
  font:700 14px/1.4 Arial,sans-serif!important;margin:0 0 12px!important;
}
html body.study-mode #app #view .sr-tutor-knowledge-fields{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;
}
html body.study-mode #app #view .sr-tutor-knowledge-field{padding:10px!important}
html body.study-mode #app #view .sr-tutor-source-section{margin-top:12px!important}
html body.study-mode #app #view .sr-tutor-knowledge-tags,
html body.study-mode #app #view .sr-tutor-knowledge-chip,
html body.study-mode #app #view .sr-tutor-knowledge-group:has(.sr-tutor-knowledge-tags){display:none!important}
html body.study-mode #app #view .uq-ai-expanded #mrTutorText{
  position:static!important;left:auto!important;width:100%!important;
  height:auto!important;opacity:1!important;overflow:visible!important;
  pointer-events:auto!important;white-space:pre-wrap!important;
}
html body.study-mode #app #view .uq-ai-expanded #mrTutorText[hidden]{display:none!important}
@media(max-width:580px){html body.study-mode #app #view .sr-tutor-knowledge-fields{grid-template-columns:1fr!important}}

/* Compact AI Tutor approved 2026-11-06: text flows in the existing explanation
   column, with NO nested scroll, NO inner card, and minimum vertical spacing.
   The existing Tutor data, navigation and answer logic are unchanged. */
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right .uq-ai-tutor[data-uq-open="true"]{width:100%!important;max-width:100%!important;align-self:stretch!important;margin:0 0 4px!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right .uq-ai-tutor .uq-ai-expanded{
  display:block!important;width:100%!important;max-width:100%!important;
  height:auto!important;max-height:none!important;overflow:visible!important;
  overscroll-behavior:auto!important;position:relative!important;
  padding:3px 0 0!important;margin:3px 0 0!important;
  background:transparent!important;border:0!important;border-radius:0!important;box-shadow:none!important
}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right .uq-ai-tutor .uq-ai-expanded[hidden]{display:none!important}
html body.study-mode #app #view .uq-ai-expanded #mrTutorText.uq-ai-source-hidden{position:absolute!important;left:-10000px!important;width:1px!important;height:1px!important;overflow:hidden!important;opacity:0!important;pointer-events:none!important}
html body.study-mode #app #view .uq-ai-expanded .uq-ai-typed-copy{display:none!important}
html body.study-mode #app #view .sr-tutor-formatted{font-family:Arial,sans-serif!important;font-size:var(--reading-font,16px)!important;line-height:1.4!important;font-weight:400!important;letter-spacing:0!important;color:inherit!important;white-space:normal!important;overflow-wrap:anywhere!important}
html body.study-mode #app #view .sr-tutor-part{padding:0 0 5px!important;margin:0 0 6px!important;border-bottom:0!important}
html body.study-mode #app #view .sr-tutor-part:last-child{margin-bottom:0!important;padding-bottom:0!important;border-bottom:0!important}
html body.study-mode #app #view .sr-tutor-part-heading{margin:0 0 2px!important;padding:0!important;font:700 15px/1.25 Arial,sans-serif!important;color:#116080!important;text-transform:none!important;letter-spacing:0!important}
html body.study-mode #app #view .sr-tutor-paragraph{margin:0 0 3px!important;padding:0!important;font:400 14px/1.4 Arial,sans-serif!important;white-space:normal!important;overflow-wrap:anywhere!important}
html body.study-mode #app #view .sr-tutor-paragraph:last-child{margin-bottom:0!important}
html body.study-mode #app #view .sr-tutor-options{display:grid!important;gap:2px!important}
html body.study-mode #app #view .sr-tutor-option{display:grid!important;grid-template-columns:29px minmax(0,1fr)!important;align-items:start!important;gap:6px!important;padding:1px 0!important;margin:0!important;background:transparent!important;border:0!important;border-radius:0!important}
html body.study-mode #app #view .sr-tutor-option-letter{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-height:22px!important;min-width:27px!important;margin:0!important;padding:0 3px!important;border:1px solid rgba(20,171,142,.2)!important;border-radius:5px!important;background:rgba(28,190,158,.15)!important;color:#12695f!important;font:700 14px/1.15 Arial,sans-serif!important}
html body.study-mode #app #view .sr-tutor-option .sr-tutor-paragraph{padding-top:1px!important;margin:0!important}
html body.study-mode #app #view .sr-tutor-pearl .sr-tutor-part-heading{color:#0a6b67!important}
html body.study-mode #app #view .sr-tutor-pearl .sr-tutor-part-heading::before{content:'💡';display:inline-block;margin-right:7px;vertical-align:-2px;font-size:19px;line-height:1}
html body.study-mode #app #view .sr-tutor-sources{margin:0!important;padding-left:19px!important;display:grid!important;gap:3px!important}
html body.study-mode #app #view .sr-tutor-sources a{font-size:12px!important;overflow-wrap:anywhere!important}
html body.study-mode #app #view .sr-tutor-editorial{opacity:.75!important;font-size:12px!important}
html body.study-mode #app #view .sr-tutor-loading{font-size:12px!important;color:inherit!important;opacity:.75!important}
body[data-theme="dark"].study-mode #view .sr-tutor-part-heading{color:#96d8e8!important}
body[data-theme="dark"].study-mode #view .sr-tutor-option-letter{color:#bbf8e9!important;background:rgba(31,174,145,.24)!important}
@media(max-width:850px){html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right .uq-ai-tutor .uq-ai-expanded{max-height:none!important;padding:3px 0 0!important;margin:3px 0 0!important}}

/* Final single source of truth: result -> original explanation -> Tutor -> context. */
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > #answerState{order:0!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .uq-review-heading{order:1!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .explanation{order:2!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > #explanationFigures{order:3!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .uq-ai-tutor{order:4!important;align-self:stretch!important;width:100%!important;align-items:flex-end!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .sr-tutor-knowledge{order:5!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .uq-ai-tutor[data-uq-open="true"]{align-items:stretch!important}

/* Correct visual order: AI Tutor on top, ordinary explanation next, metadata last. */
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .uq-ai-tutor{order:0!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > #answerState{order:1!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .uq-review-heading{order:2!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .explanation{order:3!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > #explanationFigures{order:4!important}
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .sr-tutor-knowledge{order:99!important}

/* Keep the original explanation visible when the supplemental Tutor finishes loading. */
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .explanation:not([hidden]){display:block!important}

/* Match the original explanation to the Tutor reading typography. */
html body.study-mode #app #view .question-card.uq-review-grid .uq-review-right > .explanation:not([hidden]){font:400 14px/1.4 Arial,sans-serif!important}

/* Shared Tutor: source excerpts and preserved full text use normal page scrolling. */
.sr-saved-tutor{margin:3px 0;font:400 14px/1.4 Arial,sans-serif}.sr-saved-tutor p{white-space:pre-line;margin:2px 0}.sr-tutor-part>summary{cursor:pointer}

.sr-source-literal{white-space:pre-wrap;overflow-wrap:anywhere;font:400 12px/1.4 monospace;margin:3px 0;max-width:100%}
