/* UnitDime v25.14b — cross-site interaction/performance closure.
   Presentation only: no scoring, attempt, test lifecycle or importer logic. */

/* Route prepaint still suppresses layout animations, but never hides a fully
   parsed page while waiting for DOMContentLoaded/page-specific scripts. */
html.ud-route-prepaint body{visibility:visible!important}

/* Fast, predictable taps/clicks across shells. */
:is(a,button,[role="button"]){-webkit-tap-highlight-color:transparent}
:is(.student-nav-link,.student-menu-button,.student-sidebar-toggle,.student-mobile-bottom-nav a,.student-mobile-bottom-nav button,
.teacher-nav-item,.teacher-menu,.phase11-role-collapse,
.school-admin-nav-item,.school-admin-menu,
.admin-nav-item,.admin-menu-button){touch-action:manipulation}

/* Small progress cue appears only when a navigation has taken >120ms. */
html.ud-route-waiting::before{
  content:"";
  position:fixed;
  z-index:2147483647;
  top:0;left:0;
  height:2px;
  width:38%;
  pointer-events:none;
  background:linear-gradient(90deg,var(--ud-accent,#635bff),#8b83ff);
  transform-origin:left center;
  animation:ud-route-progress 1.2s cubic-bezier(.2,.7,.2,1) infinite;
}
@keyframes ud-route-progress{
  0%{transform:translateX(-105%) scaleX(.5);opacity:.7}
  55%{transform:translateX(135%) scaleX(1.25);opacity:1}
  100%{transform:translateX(310%) scaleX(.65);opacity:.35}
}

/* Native cross-document transitions are progressive enhancement. Unsupported
   browsers simply keep normal navigation. Keep it short so it never feels slow. */
@view-transition{navigation:auto}
::view-transition-old(root){animation:ud-route-old .085s ease-out both}
::view-transition-new(root){animation:ud-route-new .12s ease-out both}
@keyframes ud-route-old{to{opacity:.985}}
@keyframes ud-route-new{from{opacity:.985}}

/* Mobile GPU path: drawer movement should transform only; expensive backdrop
   blur during the gesture was a measurable jank risk on mid-range phones. */
@media(max-width:820px){
  .student-sidebar,.teacher-sidebar,.school-admin-sidebar,.admin-sidebar{
    transform:translate3d(-105%,0,0);
    backface-visibility:hidden;
    -webkit-backface-visibility:hidden;
  }
  .student-drawer-open .student-sidebar,
  .teacher-drawer-open .teacher-sidebar,
  .school-admin-sidebar.open,
  body.admin-sidebar-open .admin-sidebar{transform:translate3d(0,0,0)}

  .student-drawer-overlay,.teacher-backdrop,.school-admin-backdrop,.admin-sidebar-backdrop{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
  }
  .student-topbar,.student-mobile-bottom-nav{
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
    background:color-mix(in srgb,var(--ud-surface,#fff) 97%,transparent)!important;
  }
  .student-sidebar{transition-duration:165ms!important}
  .student-drawer-overlay{transition-duration:145ms!important}
}


@media(max-width:900px){
  .teacher-sidebar{transform:translate3d(-105%,0,0);backface-visibility:hidden;-webkit-backface-visibility:hidden;transition-duration:165ms!important}
  .teacher-drawer-open .teacher-sidebar{transform:translate3d(0,0,0)}
  .teacher-backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
}
@media(max-width:850px){
  .school-admin-sidebar{transform:translate3d(-105%,0,0);backface-visibility:hidden;-webkit-backface-visibility:hidden;transition-duration:165ms!important}
  .school-admin-sidebar.open{transform:translate3d(0,0,0)}
  .school-admin-backdrop{backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
}

/* Phase 14 discoverability: compact jump links, not another navigation system. */
.udp-phase14-jump{
  display:inline-flex;align-items:center;gap:7px;
  min-height:38px;padding:8px 12px;border:1px solid var(--ud-border,#e5e7eb);
  border-radius:11px;background:var(--ud-surface,#fff);color:var(--ud-text,#111827);
  text-decoration:none;font-weight:800;font-size:.82rem;line-height:1;
}
.udp-phase14-jump:hover{border-color:var(--ud-accent,#635bff);color:var(--ud-accent,#635bff);transform:translateY(-1px)}
.udp-phase14-jump svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Rendering containment for the very large analytics sections. It lets the
   browser skip paint/layout work for offscreen Phase-14 history without hiding
   content or changing server output. */
.p14-exam-intelligence{
  content-visibility:auto;
  contain-intrinsic-size:auto 760px;
}

@media(prefers-reduced-motion:reduce){
  html.ud-route-waiting::before{animation:none;width:100%;opacity:.55}
  ::view-transition-old(root),::view-transition-new(root){animation:none}
  .udp-phase14-jump{transition:none!important}
}
