/* Menu refresh: an isolated presentation layer shared by authenticated screens. */
body.hub-shell {
  --sidebar-width: 256px;
  --menu-bg: #111518;
  --menu-line: #ffffff0e;
  --menu-muted: #a2aba8;
  --menu-text: #ecf1ef;
  --menu-hover: #ffffff06;
  --menu-active: #80d4b514;
  --menu-accent: #9de3c7;
}
body.hub-shell[data-hub-theme=light] {
  --menu-bg: #fafcfb;
  --menu-line: #142a1f14;
  --menu-muted: #53675e;
  --menu-text: #20362b;
  --menu-hover: #153d2706;
  --menu-active: #246f540e;
  --menu-accent: #246f54;
}
.hub-shell .workspace-sidebar {
  padding: 22px 16px 16px;
  gap: 0;
  background: var(--menu-bg);
  border-inline-end: 1px solid var(--menu-line);
  scrollbar-width: thin;
  scrollbar-color: var(--menu-line) transparent;
  overscroll-behavior: contain;
}
.hub-shell .hub-sidebar-head {
  min-height: 42px;
  gap: 8px;
  margin: 0 2px 30px;
}
.hub-shell .workspace-sidebar .brand { gap: 9px; color: var(--menu-text); }
.hub-shell .workspace-sidebar .brand-symbol { width: 31px; height: 31px; flex-basis: 31px; }
.hub-shell .workspace-sidebar .brand-name { font-size: 20px; font-weight: 600; letter-spacing: -.8px; }
.hub-shell .workspace-sidebar .brand-name > span { color: var(--menu-accent); font-weight: 450; }
.hub-shell .hub-sidebar-head .hub-collapse {
  width: 28px; min-height: 32px; padding: 0;
  border: 1px solid var(--menu-line); border-radius: 8px;
  color: var(--menu-muted); background: transparent;
}
.hub-shell .hub-sidebar-head .hub-collapse::after { font-size: 23px; font-weight: 400; }
.hub-shell .workspace-sidebar .workspace-search-button {
  min-height: 44px; margin: 0 0 25px; padding: 10px 12px; gap: 10px;
  color: var(--menu-muted); background: var(--menu-hover);
  border: 1px solid var(--menu-line); border-radius: 10px; font-size: 12px;
}
.hub-shell .workspace-search-button > svg { width: 16px; height: 16px; stroke-width: 1.6; }
.hub-shell .workspace-search-button kbd {
  padding: 2px 5px; font-size: 11px; color: var(--menu-muted);
  background: transparent; border-color: var(--menu-line); border-radius: 4px;
}
.hub-shell .workspace-sidebar .main-nav { gap: 5px; margin-bottom: 24px; }
.hub-shell .workspace-sidebar .main-nav::before {
  content: ""; width: 24px; height: 1px; background: var(--menu-line); margin: 0 12px 12px;
}
.hub-shell .workspace-sidebar .nav-item {
  min-height: 48px; height: auto; flex: none; padding: 12px 13px; gap: 13px;
  color: var(--menu-muted); border: 1px solid transparent; border-radius: 10px;
  background: transparent; box-shadow: none;
}
.hub-shell .workspace-sidebar .nav-item[hidden] { display: none; }
.hub-shell .workspace-nav-copy { flex: 1; width: auto; min-width: 0; text-align: start; }
.hub-shell .workspace-nav-copy > strong { font-size: 13px; font-weight: 500; letter-spacing: .05px; }
.hub-shell .workspace-sidebar .nav-item > svg {
  width: 19px; height: 19px; stroke-width: 1.55; color: currentColor;
}
.hub-shell .workspace-sidebar .nav-item::before {
  content: ""; position: absolute; inset-inline-start: -1px; inset-block: 15px;
  width: 3px; border-radius: 4px; background: var(--menu-accent); opacity: 0;
}
.hub-shell .workspace-sidebar .nav-item::after {
  content: ""; width: 5px; height: 5px; margin-inline-start: auto; flex: none;
  border-block-start: 1.5px solid currentColor; border-inline-end: 1.5px solid currentColor;
  transform: rotate(45deg); opacity: 0;
}
.hub-shell .workspace-sidebar .nav-item:hover {
  color: var(--menu-text); background: var(--menu-hover); border-color: transparent;
}
.hub-shell .workspace-sidebar .nav-item.active {
  color: var(--menu-accent); background: var(--menu-active); border-color: transparent; box-shadow: none;
}
.hub-shell .workspace-sidebar .nav-item.active::before,
.hub-shell .workspace-sidebar .nav-item.active::after,
.hub-shell .workspace-sidebar .nav-item:hover::after { opacity: 1; }
.hub-shell .workspace-sidebar .nav-item.active .workspace-nav-copy > strong { font-weight: 600; }
.hub-shell .workspace-sidebar .nav-item[data-area=config] { margin-top: auto; }
.hub-shell .workspace-sidebar .nav-count {
  padding: 1px 6px; font-size: 11px; color: var(--menu-muted);
  background: var(--menu-hover); border-color: var(--menu-line); border-radius: 5px;
}
.hub-shell .workspace-sidebar .sidebar-footer {
  margin-top: 0; padding: 16px 5px 0; gap: 10px;
  color: var(--menu-muted); border-top: 1px solid var(--menu-line);
}
.hub-shell .workspace-sidebar .sidebar-status { font-size: 11px; gap: 8px; }
.hub-shell .workspace-sidebar #version-label { font-size: 11px; color: var(--menu-muted); }
.hub-shell .workspace-sidebar .status-pill { font-size: 11px; font-weight: 500; border-radius: 6px; }
.hub-shell .workspace-sidebar :is(a, button):focus-visible {
  outline: 2px solid var(--hub-focus); outline-offset: 2px;
}

/* Context navigation: one quiet line of tabs, with an unmistakable active page. */
.hub-shell .workspace-context { padding-bottom: 0; border-bottom: 1px solid var(--border); }
.hub-shell #workspace-area-title { font-size: 16px; letter-spacing: -.2px; font-weight: 600; }
.hub-shell #workspace-area-description { display: none; }
.hub-shell .workspace-help { color: var(--muted); background: transparent; border-color: transparent; }
.hub-shell .workspace-subnav { gap: 20px; margin-top: 10px; padding: 0 2px; scroll-padding-inline: 6px; }
.hub-shell .workspace-subnav-link {
  position: relative; min-height: 44px; padding: 11px 2px 12px;
  color: var(--muted); background: transparent; border: 0; border-radius: 0;
  font-size: 12px; font-weight: 500;
}
.hub-shell .workspace-subnav-link::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--mint); transform: scaleX(0);
}
.hub-shell .workspace-subnav-link:hover { color: var(--text); background: transparent; }
.hub-shell .workspace-subnav-link[aria-current=page] { color: var(--mint); background: transparent; border-color: transparent; }
.hub-shell .workspace-subnav-link[aria-current=page]::after { transform: scaleX(1); }
.hub-shell .hub-related { margin: 8px 0 10px; }
.hub-shell .hub-related > summary { font-size: 11px; color: var(--muted); }

/* Command palette reuses the real route search and native modal behavior. */
.hub-shell .workspace-search-dialog {
  width: min(620px, calc(100% - 32px)); border: 1px solid var(--menu-line);
  border-radius: 18px; background: var(--menu-bg); color: var(--menu-text);
  box-shadow: 0 30px 100px #0005;
}
.hub-shell .workspace-search-dialog::backdrop { background: #05090ccc; backdrop-filter: blur(8px); }
.hub-shell .workspace-search-head { padding: 22px 24px 16px; }
.hub-shell .workspace-search-head h2 { font-size: 18px; font-weight: 550; letter-spacing: -.4px; }
.hub-shell #workspace-search-input {
  min-height: 48px; border-color: var(--menu-line); border-radius: 10px;
  background: var(--menu-hover); color: var(--menu-text);
}
.hub-shell .workspace-search-result { color: var(--menu-text); background: transparent; border-color: transparent; }
.hub-shell .workspace-search-result:hover, .hub-shell .workspace-search-result:focus-visible {
  color: var(--menu-accent); background: var(--menu-active); border-color: transparent;
}
.hub-shell .workspace-search-result > strong { font-size: 13px; font-weight: 500; }
.hub-shell .workspace-search-result > small { color: var(--menu-muted); font-size: 11px; }
.hub-shell .workspace-search-footer { background: transparent; border-color: var(--menu-line); color: var(--menu-muted); }
.hub-menu-backdrop { display: none; }
body.hub-shell[data-hub-reduced-motion=true] .workspace-sidebar,
body.hub-shell[data-hub-reduced-motion=true] .main,
body.hub-shell[data-hub-reduced-motion=true] .workspace-external-main,
body.hub-shell[data-hub-reduced-motion=true] .workspace-sidebar :is(.nav-item, .workspace-search-button),
body.hub-shell[data-hub-reduced-motion=true] .workspace-subnav-link::after,
body.hub-shell[data-hub-reduced-motion=true] .workspace-search-dialog {
  transition: none; animation: none;
}

@media (min-width: 761px) {
  .hub-shell[data-hub-collapsed=true] { --sidebar-width: 80px; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar { padding-inline: 12px; }
  .hub-shell[data-hub-collapsed=true] .hub-sidebar-head { gap: 14px; margin: 0 0 22px; }
  .hub-shell[data-hub-collapsed=true] .hub-sidebar-head .hub-collapse { width: 32px; min-height: 32px; }
  .hub-shell[data-hub-collapsed=true] .workspace-search-button { padding: 12px; margin-bottom: 20px; }
  .hub-shell[data-hub-collapsed=true] .workspace-search-button::after { content: none; }
  .hub-shell[data-hub-collapsed=true] .workspace-sidebar .nav-item { justify-content: center; padding: 12px; gap: 0; }
  .hub-shell[data-hub-collapsed=true] .nav-item::after { display: none; }
  .hub-shell[data-hub-collapsed=true] .main-nav::before { margin-inline: auto; }
}
@media (max-width: 760px) {
  body.hub-shell { --sidebar-width: 0px; }
  .hub-shell.hub-menu-open { overflow: hidden; }
  .hub-shell .workspace-sidebar {
    display: flex; visibility: hidden; pointer-events: none;
    inset-block: 12px; inset-inline-start: 12px; inset-inline-end: auto;
    width: min(296px, calc(100% - 32px)); height: calc(100dvh - 24px); max-height: calc(100dvh - 24px);
    padding: 22px 18px 18px; border: 1px solid var(--menu-line); border-radius: 18px;
    transform: translateX(calc(-100% - 24px)); box-shadow: none; z-index: 31;
  }
  .hub-shell.hub-menu-open .workspace-sidebar {
    visibility: visible; pointer-events: auto; transform: translateX(0); box-shadow: 0 24px 80px #0005;
  }
  .hub-shell.hub-menu-open .hub-menu-backdrop {
    display: block; position: fixed; inset: 0; z-index: 30; border: 0;
    background: #05090cad; backdrop-filter: blur(6px); padding: 0; color: transparent;
  }
  .hub-shell .hub-sidebar-head { margin-inline-end: 32px; margin-bottom: 26px; }
  .hub-shell .hub-menu-close {
    position: absolute; inset-block-start: 25px; inset-inline-end: 17px;
    width: 32px; min-height: 32px; padding: 0; font-size: 0;
    border-color: var(--menu-line); background: transparent; color: var(--menu-muted);
  }
  .hub-shell .hub-menu-close::after { content: "×"; font-size: 23px; line-height: 1; }
  .hub-shell .workspace-sidebar .main-nav { flex: 1 0 auto; }
  .hub-shell .workspace-sidebar .nav-item { min-height: 48px; }
  .hub-shell .workspace-sidebar .workspace-search-button { margin-bottom: 20px; }
  .hub-shell .workspace-sidebar .brand-name { font-size: 20px; }
  .hub-shell .workspace-subnav { gap: 18px; }
  .hub-shell .workspace-search-dialog { width: calc(100% - 24px); margin-top: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hub-shell .workspace-sidebar, .hub-shell .main, .hub-shell .workspace-external-main {
    transition: width 220ms ease, margin-inline-start 220ms ease, transform 240ms cubic-bezier(.2,.8,.2,1), visibility 240ms;
  }
  .hub-shell .workspace-sidebar :is(.nav-item, .workspace-search-button) { transition: color 150ms, background 150ms; }
  .hub-shell .nav-item::after { transition: opacity 150ms; }
  .hub-shell .workspace-subnav-link::after { transition: transform 180ms ease; }
  .hub-shell .workspace-search-dialog[open] { animation: menu-palette-in 180ms ease both; }
  @keyframes menu-palette-in { from { opacity: 0; transform: translateY(-8px) scale(.985); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  .hub-shell .workspace-sidebar, .hub-shell .main, .hub-shell .workspace-external-main,
  .hub-shell .workspace-sidebar :is(.nav-item, .workspace-search-button),
  .hub-shell .workspace-subnav-link, .hub-shell .workspace-subnav-link::after { transition: none; }
  .hub-shell .workspace-search-dialog, .hub-menu-backdrop { animation: none; }
}
@media (forced-colors: active) {
  .hub-shell .workspace-sidebar .nav-item.active { outline: 2px solid Highlight; outline-offset: -2px; }
  .hub-shell .workspace-subnav-link[aria-current=page] { border-bottom: 2px solid Highlight; }
}
