/* Hub2 chrome: sticky header + right-side page menu */

[class*="hub-module"][class*="topbar"],
[class*="__topbar"] {
  transition: background-color 0.2s ease, backdrop-filter 0.2s ease;
  border-bottom: none !important;
  box-shadow: none !important;
}

body.hub2-scrolled [class*="hub-module"][class*="topbar"],
body.hub2-scrolled [class*="__topbar"] {
  background: color-mix(in srgb, var(--bg, #071018) 92%, transparent) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: none !important;
  box-shadow: none !important;
}

/* Hide Presentation mode button */
[class*="actionPresent"],
button[class*="actionPresent"] {
  display: none !important;
}

/* Hide original bottom/center section pill — replaced by #hub2-side-nav */
[class*="section-nav-module"][class*="__wrap"] {
  display: none !important;
}

/* Right-center page menu */
#hub2-side-nav {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 170;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  max-height: min(70vh, calc(100vh - 120px));
  font-family: var(--font-sans, "Sora", sans-serif);
}

#hub2-side-nav .hub2-side-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--b2, #2cc3ff33);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg2, #0d1620) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--t, #e8eef5);
  cursor: pointer;
  box-shadow: 0 8px 24px #00000066;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

#hub2-side-nav .hub2-side-toggle:hover {
  border-color: var(--accent, #2cc3ff);
  color: var(--accent, #2cc3ff);
}

#hub2-side-nav.is-open .hub2-side-toggle {
  border-color: var(--accent, #2cc3ff);
  color: var(--accent, #2cc3ff);
}

#hub2-side-nav .hub2-side-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#hub2-side-nav .hub2-side-toggle-icon svg {
  display: block;
}

#hub2-side-nav .hub2-side-panel {
  display: none;
  margin-top: 8px;
  min-width: min(240px, 72vw);
  max-width: min(280px, 82vw);
  max-height: min(60vh, calc(100vh - 160px));
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid var(--b2, #2cc3ff33);
  border-radius: 2px;
  background: color-mix(in srgb, var(--bg2, #0d1620) 96%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 12px 32px #00000080;
  padding: 6px;
}

#hub2-side-nav.is-open .hub2-side-panel {
  display: block;
}

#hub2-side-nav .hub2-side-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: var(--t2, #93a4b8);
  cursor: pointer;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.35;
  padding: 9px 10px;
  transition: background 0.12s ease, color 0.12s ease;
}

#hub2-side-nav .hub2-side-item:hover {
  background: var(--dim, #ffffff0a);
  color: var(--t, #e8eef5);
}

#hub2-side-nav .hub2-side-item.is-active {
  color: var(--accent, #2cc3ff);
  background: var(--accent-dim, #2cc3ff1f);
}

#hub2-side-nav .hub2-side-item-num {
  flex-shrink: 0;
  min-width: 1.4em;
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 11px;
  opacity: 0.75;
}

@media (max-width: 720px) {
  #hub2-side-nav {
    right: 10px;
    max-height: min(78vh, calc(100vh - 96px));
  }

  #hub2-side-nav .hub2-side-panel {
    max-height: min(55vh, calc(100vh - 140px));
    min-width: min(220px, 78vw);
  }

}

@media (max-width: 420px) {
  #hub2-side-nav {
    right: 8px;
  }

  #hub2-side-nav .hub2-side-toggle {
    width: 40px;
    height: 40px;
  }
}
