/* UnitDime v25.13n3 — mobile route stability + adaptive review polish.
   This file is shell-only: no scoring, database or CBT logic. */

:root{--ud-route-vh:100vh}
@supports(height:100svh){:root{--ud-route-vh:100svh}}

html,body{scroll-behavior:auto!important}
html.ud-route-prepaint body{visibility:visible!important}
html.ud-route-prepaint :is(
  .student-sidebar,.student-main,.student-topbar,.student-mobile-bottom-nav,.student-page-content,
  .teacher-sidebar,.teacher-main,.teacher-topbar,.teacher-content,
  .site-header,.public-body>main,.auth-section
){transition:none!important;animation:none!important}

body{overflow-anchor:none}
.student-main,.student-page-content,.teacher-main,.teacher-content,.public-body>main{overflow-anchor:none}

@media(max-width:900px){
  html,body{min-height:var(--ud-route-vh)!important}
  .student-body,.student-layout,.student-main{min-height:var(--ud-route-vh)!important}
  .teacher-body,.teacher-layout,.teacher-main{min-height:var(--ud-route-vh)!important}
  .public-body{min-height:var(--ud-route-vh)!important}
  .public-body .auth-section{min-height:calc(var(--ud-route-vh) - 70px)!important}
  .student-body,.teacher-body,.public-body{overscroll-behavior-y:contain}
  .student-mobile-bottom-nav{
    transform:translateZ(0);
    -webkit-transform:translateZ(0);
    will-change:auto;
  }
}

/* Deterministic desktop scrollbar geometry between short and long routes. */
html{overflow-x:hidden}
body{overflow-x:hidden}
@supports(scrollbar-gutter:stable){@media(min-width:901px){html{scrollbar-gutter:stable}}}

/* Adaptive analysis/review: preserve authored newlines only in review, not in
   the live question surface. MathJax remains free to lay itself out normally. */
.uad-review-question-text.uad-preserve-lines{
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  line-height:1.68!important;
}
.uad-review-question-text mjx-container,
.uad-review-question-text .MathJax{white-space:normal!important}

.uad-question-level{
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 9px;
  border:1px solid var(--ud-accent-border);
  border-radius:999px;
  background:var(--ud-accent-soft);
  color:var(--ud-accent);
  font-size:9px;
  font-weight:900;
  letter-spacing:.025em;
  white-space:nowrap;
}
@media(max-width:680px){
  .uad-review-question header{align-items:flex-start!important;gap:8px!important}
  .uad-question-review-tools{gap:6px!important}
  .uad-question-level{min-height:24px;padding:3px 8px;font-size:8px}
}

/* ==========================================================================
   UnitDime v25.16f10c — GLOBAL MOBILE ROOT-SCROLL CORRECTION

   Keep normal mobile document scrolling owned by the viewport. Horizontal
   clipping must not turn body into a competing scroll container, and normal
   pages must permit vertical scroll chaining. Intentional open-drawer locks
   remain excluded.
   ========================================================================== */
@media (max-width:900px){
  html:not(.student-drawer-lock){
    overflow-x:clip!important;
    overflow-y:auto!important;
    overscroll-behavior-y:auto!important;
  }

  body.public-body,
  body.student-body:not(.student-drawer-lock):not(.student-drawer-open),
  body.teacher-body:not(.teacher-drawer-open){
    overflow-x:clip!important;
    overflow-y:visible!important;
    overscroll-behavior-y:auto!important;
    touch-action:pan-y pinch-zoom!important;
  }
}

