/* Keep the shared menu out of the exam header's third grid column. */
html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation {
  grid-column: 1 / -1;
  grid-row: auto;
  justify-self: end;
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  width: min(360px,100%);
  min-width: 0;
  max-width: 100%;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  margin: 0;
  padding: 12px;
  box-sizing: border-box;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  transform-origin: top right;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .nav-action {
  min-width: 0;
  width: 100%;
  height: 64px;
  min-height: 64px;
  padding: 10px;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .nav-action-icon {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open > .nav-account {
  height: auto;
  min-height: 64px;
  padding: 10px 12px;
  gap: 12px;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .nav-student-avatar {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .nav-profile-copy {
  min-width: 0;
  max-width: none;
  flex: 1 1 0;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .nav-profile-copy bdi {
  font-size: 16px;
  line-height: 1.5;
}

html[data-theme] body.app-viewport-shell > header.topbar.container:is(.student-mobile-topbar,.admin-mobile-topbar) > nav.icon-navigation.open .appearance-options button {
  min-height: 48px;
}
/* v160: the unread badge is the last child, not the third hamburger line.
   Address the three strokes explicitly so desktop and mobile form the same X. */
html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu] > span{transform:none;opacity:1}
html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu].open > span:nth-of-type(1){transform:translateY(7px) rotate(45deg)}
html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu].open > span:nth-of-type(2){opacity:0}
html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu].open > span:nth-of-type(3){transform:translateY(-7px) rotate(-45deg)}
html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu] > [data-message-unread]{pointer-events:none;transform:none}
@media(prefers-reduced-motion:reduce){html[data-theme] body.app-viewport-shell > header.topbar.container [data-message-menu] > span{transition:none}}
