/* Keep navigation usable above the older theme and layout overrides. */
.shell .mobile-nav-bar,
.shell .sidebar-close,
.shell .sidebar-backdrop { display: none !important; }
.shell .side {
  display: flex !important;
  flex-direction: column !important;
  width: var(--side-width, 248px) !important;
  flex: 0 0 var(--side-width, 248px) !important;
  height: calc(100vh - 28px) !important;
  height: calc(100dvh - 28px) !important;
  max-height: none !important;
  overflow: hidden !important;
}
.shell .sidebar-heading,
.shell .side .userbox { flex-shrink: 0; }
.shell .sidebar-heading { display: flex; align-items: center; justify-content: space-between; }
.shell .side .brand { margin: 0; padding: 8px 6px 16px !important; font-size: 22px !important; display: flex !important; gap: 6px !important; }
.shell .side .brand:before,
.shell .side .brand:after { display: none !important; }
.shell .side .nav {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  gap: 4px !important;
}
.shell .side .nav button {
  flex-shrink: 0;
  width: 100% !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 46px !important;
  margin: 0 !important;
  padding: 10px 12px !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  text-align: right !important;
  white-space: normal !important;
  transform: none !important;
}
.shell .side .nav-title { flex-shrink: 0; }
.shell .side .userbox { padding: 12px 6px 0 !important; margin-top: 12px !important; }
.shell .side .userbox b { color: #f2f5fa !important; }
.shell .nav button:focus-visible,
.shell .sidebar-toggle:focus-visible,
.shell .sidebar-close:focus-visible { outline: 2px solid #f2cf73; outline-offset: -3px; }

@media (max-width: 720px) {
  body.hub-sidebar-open { overflow: hidden; }
  .shell .mobile-nav-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 120;
    min-height: 64px;
    padding: 8px 14px;
    background: #071323;
    color: #f2f5fa;
    border-bottom: 1px solid #2a3a50;
  }
  .shell .sidebar-toggle,
  .shell .sidebar-close {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #31445d;
    border-radius: 10px;
    background: #101d2e;
    color: #fff;
    font-size: 16px;
  }
  .shell .sidebar-close { font-size: 24px; padding: 4px; }
  .shell .side {
    position: fixed !important;
    inset: 0 0 0 auto !important;
    width: min(300px, calc(100vw - 48px)) !important;
    height: 100vh !important;
    height: 100dvh !important;
    margin: 0 !important;
    padding: 14px 12px max(14px, env(safe-area-inset-bottom)) !important;
    border-radius: 0 !important;
    z-index: 160 !important;
    transform: translateX(105%);
    visibility: hidden;
    pointer-events: none !important;
  }
  .shell .side.side-left { inset: 0 auto 0 0 !important; transform: translateX(-105%); }
  .shell.sidebar-open .side {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto !important;
  }
  .shell .side .brand,
  .shell .side .userbox,
  .shell .side .nav-title { display: block !important; }
  .shell .side .brand:before { display: none; }
  .shell .side .nav button { font-size: 16px !important; }
  .shell .sidebar-backdrop:not([hidden]) {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 150;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(0, 0, 0, .6);
  }
  .shell .main { width: 100% !important; margin: 0 !important; padding: 20px 14px 32px !important; }
}
