/* Mobile navigation only: keep the desktop sidebar and all original destinations. */
.student-menu-heading, .student-menu-hint, .student-nav-group-title { display: none; }
.student-nav-group { display: contents; }
.student-menu-backdrop[hidden] { display: none !important; }
.student-menu-backdrop { display: none; }
/* Also suppress an older cached homepage component's bottom bar. */
.student-shell .sh-mobile-nav { display: none !important; }
@media (max-width: 1120px) {
  .student-shell .student-topbar { position: sticky; top: 0; z-index: 60; }
  /* One compact header across all student views, including modules that load
     their own header styles later. */
  .student-shell .student-topbar {
    flex-wrap: nowrap !important; align-items: center !important;
    gap: 10px !important; min-height: 66px !important; padding: 10px 14px !important;
  }
  .student-shell .student-topbar > div:not(.topbar-actions) {
    display: block !important; flex: 1; min-width: 0;
  }
  .student-shell .student-topbar [data-page-title] {
    display: block; font-size: 16px !important; line-height: 1.4;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .student-shell .student-topbar [data-page-subtitle],
  .student-shell .topbar-actions > .search,
  .student-shell .topbar-actions > .ghost-button,
  .student-shell .topbar-actions > .api-status,
  .student-shell .student-topbar > .sh-topbar-brand,
  .student-shell .student-topbar > .student-home-header-action { display: none !important; }
  .student-shell .topbar-actions {
    flex: 0 0 auto !important; width: auto !important; margin-left: auto !important;
    flex-wrap: nowrap; gap: 0;
  }
  .student-shell .topbar-actions > .avatar { width: 36px !important; height: 36px !important; flex: none; }
  .student-shell .menu-button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    flex: 0 0 auto; width: auto; min-width: 78px; min-height: 44px; height: 44px;
    padding: 0 12px; color: #fff; background: #176bf0;
    border: 1px solid #176bf0; border-radius: 12px;
    box-shadow: 0 4px 12px #176bf024; font-size: 14px; font-weight: 700;
  }
  .student-shell .menu-button svg { width: 21px; height: 21px; flex: none; }
  .student-shell .menu-button:hover, .student-shell .menu-button[aria-expanded=true] { background: #1056ca; border-color: #1056ca; }
  .student-shell .menu-button:focus-visible, .student-shell .student-sidebar :is(button,a):focus-visible { outline: 3px solid #83b8ff; outline-offset: 2px; }
  .student-shell .student-sidebar {
    position: fixed; z-index: 50; inset: var(--student-menu-top, 68px) auto 0 0;
    width: min(84vw, 330px); height: calc(100vh - var(--student-menu-top, 68px));
    height: calc(100dvh - var(--student-menu-top, 68px));
    padding: 0; display: flex; flex-direction: column; min-height: 0;
    color: #193452; background: #fff; box-shadow: 12px 0 30px #102a4314;
    overflow: hidden; visibility: hidden; transform: translateX(-102%);
    transition: transform .2s ease;
  }
  body.menu-open .student-shell .student-sidebar { transform: translateX(0); visibility: visible; }
  .student-shell .student-sidebar .sidebar-brand { display: none; }
  .student-shell .student-menu-heading { display: flex; align-items: center; justify-content: space-between; flex: none; min-height: 65px; padding: 10px 14px 10px 22px; border-bottom: 1px solid #edf1f7; }
  .student-menu-heading h2 { margin: 0; color: #142d4f; font-size: 19px; }
  .student-menu-heading button { display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; color: #536a87; border: 0; border-radius: 10px; background: #f4f7fc; cursor: pointer; }
  .student-menu-heading button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
  .student-shell .student-nav { display: block; min-height: 0; flex: 1; margin: 0; padding: 9px 14px 14px; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #becddd #fff; }
  .student-shell .student-nav-group { display: grid; gap: 4px; padding: 6px 0 14px; }
  .student-shell .student-nav-group + .student-nav-group { border-top: 1px solid #e7edf5; padding-top: 14px; }
  .student-shell .student-nav-group-title { display: block; margin: 4px 10px 6px; color: #8190a5; font-size: 12px; font-weight: 500; }
  .student-shell .student-nav :is(button,a) { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; margin: 0; padding: 10px 12px !important; color: #203b5a !important; background: transparent; border: 0; border-radius: 10px; font-size: 14px; font-weight: 500; line-height: 1.5; text-align: left; text-decoration: none; }
  .student-shell .student-nav :is(button,a)[hidden] { display: none !important; }
  .student-shell .student-nav :is(button,a):hover { background: #f2f6fc; }
  .student-shell .student-nav button.active { color: #1265e2 !important; background: #eaf2ff; font-weight: 700; }
  .student-shell .student-nav :is(button,a)::after { content: ''; flex: 0 0 5px; width: 5px; height: 5px; margin-left: auto; border-top: 1.5px solid #8fa2b8; border-right: 1.5px solid #8fa2b8; transform: rotate(45deg); }
  .student-shell .student-nav svg { width: 21px; height: 21px; flex: 0 0 21px; }
  .student-shell .student-menu-hint { display: block; flex: none; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); color: #8392a6; text-align: center; font-size: 12px; background: #fff; border-top: 1px solid #edf1f7; }
  .student-shell .student-menu-backdrop { position: fixed; z-index: 40; inset: var(--student-menu-top, 68px) 0 0; display: block; width: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: #13294380; cursor: pointer; }
}
@media (max-width: 720px) {
  .student-home-active .student-topbar { padding: 10px; gap: 6px; }
  .student-home-active .sh-topbar-brand { gap: 5px; }
  .student-home-active .sh-topbar-brand img { width: 28px; height: 28px; flex: none; }
  .student-home-active .student-topbar .sh-topbar-brand strong { font-size: 12px; }
  .student-home-active .student-home-header-action { width: 32px; height: 44px; flex: none; }
  .student-home-active .student-content { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) {
  .student-home-active .student-topbar { padding-left: 6px; padding-right: 6px; gap: 3px; }
  .student-shell .menu-button { min-width: 70px; padding: 0 8px; gap: 5px; }
  .student-home-active .student-topbar .sh-topbar-brand strong { font-size: 11px; }
  .student-home-active .sh-topbar-brand img { width: 24px; height: 24px; }
  .student-home-active .student-home-header-action { width: 29px; }
  .student-home-active .student-topbar .avatar { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .student-shell .student-sidebar { transition: none; }
}
