/* sidebar2.css — rebuilt unified sidebar for headcraft.cloud (v2).
   Same mechanics on every page: docked on app pages (pushes .main-content via
   the existing layout.css rules), floating drawer on public pages.
   Namespaced .hc-sb2 with high specificity so it wins over legacy sidebar.css
   when both stylesheets are loaded. Glass surfaces inherit the page theme. */

:root {
  --hc-sb-width: 280px;
  --hc-sb-width-collapsed: 70px;
  --hc-sb-bg: var(--bg-surface, rgba(13, 16, 28, 0.94));
  --hc-sb-border: var(--border-color, rgba(255, 255, 255, 0.08));
  --hc-sb-text: var(--text-primary, #eef0f7);
  --hc-sb-dim: var(--text-secondary, #a4abc0);
  --hc-sb-mute: var(--text-muted, #6e768f);
  --hc-sb-accent: var(--brand-primary, #5865f2);
  --hc-sb-accent-2: var(--brand-secondary, #8b5cf6);
  --hc-sb-radius: 10px;
}

/* ── Shell ─────────────────────────────────────────────────────────────── */
aside.sidebar.hc-sb2 {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--hc-sb-width);
  display: flex;
  flex-direction: column;
  background: var(--hc-sb-bg);
  border-right: 1px solid var(--hc-sb-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: var(--z-sidebar, 1300);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--hc-sb-text);
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: visible;
}
aside.sidebar.hc-sb2 * { box-sizing: border-box; }
aside.sidebar.hc-sb2.collapsed { width: var(--hc-sb-width-collapsed); }

/* Drawer mode (public pages / mobile): off-canvas until opened */
aside.sidebar.hc-sb2.hc-sb2-drawer {
  transform: translateX(calc(-100% - 2px));
  box-shadow: none;
  width: min(296px, 85vw);
}
aside.sidebar.hc-sb2.hc-sb2-drawer.open {
  transform: translateX(0);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.52);
}

/* Backdrop for drawer mode */
#hc-sb2-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 14, 0.6);
  backdrop-filter: blur(3px);
  z-index: var(--z-drawer-backdrop, 1290);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s;
}
#hc-sb2-backdrop.show { opacity: 1; visibility: visible; }

/* A stale browser transition must never leave an invisible full-screen overlay
   able to block the page. Only the explicit drawer-open state is interactive. */
#hc-sb2-backdrop:not(.show) {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
#hc-sb2-backdrop.show { pointer-events: auto; }

/* Floating open button (drawer mode) */
#hc-sb2-fab {
  position: fixed;
  left: 16px;
  bottom: calc(16px + var(--hc-banner-offset, 0px));
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--hc-sb-accent), var(--hc-sb-accent-2));
  color: var(--text-on-brand, #ffffff);
  border: 1px solid var(--hc-sb-border);
  cursor: pointer;
  z-index: var(--z-floating, 1100);
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, bottom 0.2s ease;
}
#hc-sb2-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(88, 101, 242, 0.42); }
#hc-sb2-fab:active { transform: scale(0.96); }
body.hc-sb-open #hc-sb2-fab,
body.hc-modal-open #hc-sb2-fab {
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Mobile App Topbar (for pages without their own .nav bar) */
#hc-sb2-mobilebar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  background: var(--hc-sb-bg);
  border-bottom: 1px solid var(--hc-sb-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 1200;
  color: var(--hc-sb-text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
#hc-sb2-mobilebar .hc-sb2-mbtn {
  width: 38px; height: 38px;
  border-radius: 10px;
  border: 1px solid var(--hc-sb-border);
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  color: var(--hc-sb-text);
  display: grid; place-items: center;
  cursor: pointer; font-size: 0.95rem;
  padding: 0; box-shadow: none; flex-shrink: 0;
}
#hc-sb2-mobilebar .hc-sb2-mbrand {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--hc-sb-text); text-decoration: none;
  font-weight: 800; font-size: 0.98rem;
  margin-right: auto; min-height: 38px;
}
#hc-sb2-mobilebar .hc-sb2-mlogo {
  width: 28px; height: 28px; border-radius: 8px;
  display: block;
  flex-shrink: 0;
}
body.hc-has-mobile-bar > .container,
body.hc-has-mobile-bar .main-content,
body.hc-has-mobile-bar .admin-app,
body.hc-has-mobile-bar .support-app,
body.hc-has-mobile-bar .hosting-shell,
body.hc-has-mobile-bar .hosting,
body.hc-has-mobile-bar .login-container {
  padding-top: 66px !important;
}
body.hc-has-mobile-bar .chat-app {
  margin-top: 52px;
  height: calc(100dvh - 52px) !important;
}

/* ── Header / brand ────────────────────────────────────────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-header {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--hc-sb-border);
  flex-shrink: 0;
  min-height: 64px;
}
aside.sidebar.hc-sb2 .hc-sb2-logo {
  width: 34px; height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-decoration: none;
}
aside.sidebar.hc-sb2 .hc-sb2-logo img { display: block; width: 100%; height: 100%; }
aside.sidebar.hc-sb2 .hc-sb2-brandname {
  font-weight: 800;
  font-size: 1.02rem;
  color: var(--hc-sb-text);
  white-space: nowrap;
  text-decoration: none;
}
aside.sidebar.hc-sb2 .hc-sb2-collapse {
  margin-left: auto;
  width: 28px; height: 28px;
  display: grid;
  place-items: center;
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--hc-sb-border);
  border-radius: 8px;
  color: var(--hc-sb-dim);
  cursor: pointer;
  font-size: 0.7rem;
  transition: color 0.15s, border-color 0.15s, transform 0.25s ease;
  flex-shrink: 0;
}
aside.sidebar.hc-sb2 .hc-sb2-collapse:hover { color: var(--hc-sb-text); border-color: var(--hc-sb-accent); }
aside.sidebar.hc-sb2 .hc-sb2-beta-badge {
  color: var(--text-on-brand, #ffffff) !important;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-collapse { transform: rotate(180deg); }
aside.sidebar.hc-sb2.collapsed .hc-sb2-brandname,
aside.sidebar.hc-sb2.collapsed .hc-sb2-beta-badge { display: none; }

/* ── Install App CTA (directly under Headcraft header) ─────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-install {
  margin: 10px 12px 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  width: calc(100% - 24px);
  border-radius: 10px;
  border: 1px solid var(--hc-sb-border);
  border-color: color-mix(in srgb, var(--hc-sb-accent) 42%, transparent);
  background: var(--bg-elevated, rgba(255, 255, 255, 0.06));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--hc-sb-accent) 20%, transparent),
    color-mix(in srgb, var(--hc-sb-accent-2) 12%, transparent)
  );
  color: var(--hc-sb-text);
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-sm, 0 4px 16px rgba(0, 0, 0, 0.18));
  transition: transform 0.14s ease, border-color 0.15s ease, background 0.15s ease;
}
aside.sidebar.hc-sb2 .hc-sb2-install:hover {
  border-color: var(--hc-sb-accent);
  background: var(--bg-hover, rgba(255, 255, 255, 0.1));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--hc-sb-accent) 30%, transparent),
    color-mix(in srgb, var(--hc-sb-accent-2) 20%, transparent)
  );
  transform: translateY(-1px);
}
aside.sidebar.hc-sb2 .hc-sb2-install:active {
  transform: scale(0.98);
}
aside.sidebar.hc-sb2 .hc-sb2-install-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--hc-sb-accent), var(--hc-sb-accent-2));
  color: var(--text-on-brand, #ffffff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  flex-shrink: 0;
}
aside.sidebar.hc-sb2 .hc-sb2-install-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
aside.sidebar.hc-sb2 .hc-sb2-install-copy strong {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--hc-sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
aside.sidebar.hc-sb2 .hc-sb2-install-copy small {
  font-size: 0.67rem;
  color: var(--hc-sb-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-install {
  justify-content: center;
  padding: 8px 0;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-install-copy {
  display: none;
}

/* ── Palette hint button ───────────────────────────────────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-search {
  margin: 12px 12px 4px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 11px;
  background: var(--bg-hover, rgba(255, 255, 255, 0.045));
  border: 1px solid var(--hc-sb-border);
  border-radius: 9px;
  color: var(--hc-sb-mute);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
  width: calc(100% - 24px);
  box-shadow: none;
}
aside.sidebar.hc-sb2 .hc-sb2-search:hover {
  border-color: var(--hc-sb-accent);
  color: var(--hc-sb-text);
  background: var(--bg-active, rgba(255, 255, 255, 0.07));
}
aside.sidebar.hc-sb2 .hc-sb2-search kbd {
  margin-left: auto;
  background: var(--bg-elevated, rgba(255, 255, 255, 0.07));
  border: 1px solid var(--hc-sb-border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.68rem;
  font-family: inherit;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-search span,
aside.sidebar.hc-sb2.collapsed .hc-sb2-search kbd { display: none; }
aside.sidebar.hc-sb2.collapsed .hc-sb2-search { justify-content: center; padding: 9px 0; }

/* ── Nav ───────────────────────────────────────────────────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 12px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border-hover, rgba(124, 106, 255, 0.35)) transparent;
  color: var(--hc-sb-text);
  gap: 0;
  align-items: stretch;
}
aside.sidebar.hc-sb2 .hc-sb2-nav::-webkit-scrollbar { width: 6px; }
aside.sidebar.hc-sb2 .hc-sb2-nav::-webkit-scrollbar-thumb { background: var(--glass-border-hover, rgba(124, 106, 255, 0.3)); border-radius: 6px; }

aside.sidebar.hc-sb2 .hc-sb2-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--hc-sb-mute);
  padding: 14px 10px 6px;
  white-space: nowrap;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-label {
  padding: 10px 0 4px;
  text-align: center;
  overflow: hidden;
  height: 20px;
}
aside.sidebar.hc-sb2.collapsed .hc-sb2-label::first-letter { font-size: 0.66rem; }

aside.sidebar.hc-sb2 a.hc-sb2-item {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 38px;
  padding: 8px 10px;
  margin: 1px 0;
  border-radius: 9px;
  color: var(--hc-sb-dim);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.13s, color 0.13s;
  position: relative;
}
aside.sidebar.hc-sb2 a.hc-sb2-item:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
  color: var(--hc-sb-text);
}
aside.sidebar.hc-sb2 a.hc-sb2-item.active {
  background: var(--bg-active, rgba(255, 255, 255, 0.11));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--hc-sb-accent) 18%, transparent),
    color-mix(in srgb, var(--hc-sb-accent-2) 8%, transparent)
  );
  color: var(--hc-sb-text);
  font-weight: 600;
}
aside.sidebar.hc-sb2 a.hc-sb2-item.active .hc-sb2-icon {
  color: var(--hc-sb-accent);
}
aside.sidebar.hc-sb2 a.hc-sb2-item.active::before {
  content: '';
  position: absolute;
  left: -12px; top: 20%;
  height: 60%; width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--hc-sb-accent), var(--hc-sb-accent-2));
}
aside.sidebar.hc-sb2 .hc-sb2-icon {
  width: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  color: var(--hc-sb-mute);
  flex-shrink: 0;
  transition: color 0.13s;
}
aside.sidebar.hc-sb2 a.hc-sb2-item:hover .hc-sb2-icon {
  color: var(--hc-sb-text);
}
aside.sidebar.hc-sb2.collapsed a.hc-sb2-item { justify-content: center; padding: 10px 0; }
aside.sidebar.hc-sb2.collapsed a.hc-sb2-item .hc-sb2-text { display: none; }
aside.sidebar.hc-sb2.hc-sb2-drawer.collapsed { width: min(300px, 86vw); } /* no collapse in drawer */
aside.sidebar.hc-sb2.hc-sb2-drawer.collapsed a.hc-sb2-item .hc-sb2-text { display: inline; }
aside.sidebar.hc-sb2.hc-sb2-drawer .hc-sb2-collapse { display: none; }

/* Collapsed tooltips */
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) a.hc-sb2-item:hover::after {
  content: attr(data-label);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-floating, rgba(14, 14, 26, 0.97));
  border: 1px solid var(--hc-sb-border);
  color: var(--hc-sb-text);
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 0.78rem;
  white-space: nowrap;
  z-index: 1400;
  box-shadow: var(--shadow-lg, 0 10px 30px rgba(0, 0, 0, 0.5));
}

/* ── Settings block (theme + eco) ──────────────────────────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-settings {
  padding: 10px 12px;
  border-top: 1px solid var(--hc-sb-border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-settings { display: none; }
aside.sidebar.hc-sb2 .hc-sb2-setting {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--hc-sb-dim);
}
aside.sidebar.hc-sb2 .hc-sb2-setting label {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 74px;
  font-weight: 700;
}
aside.sidebar.hc-sb2 .hc-sb2-setting select {
  flex: 1;
  min-width: 0;
  background: var(--bg-hover, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--hc-sb-border);
  border-radius: 8px;
  color: var(--hc-sb-text);
  font-size: 0.78rem;
  font-family: inherit;
  padding: 6px 8px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
aside.sidebar.hc-sb2 .hc-sb2-setting select:hover,
aside.sidebar.hc-sb2 .hc-sb2-setting select:focus { border-color: var(--hc-sb-accent); }
aside.sidebar.hc-sb2 .hc-sb2-setting select option,
aside.sidebar.hc-sb2 .hc-sb2-setting select optgroup {
  background: var(--bg-space, #14142a);
  color: var(--hc-sb-text);
}

/* ── User card ─────────────────────────────────────────────────────────── */
aside.sidebar.hc-sb2 .hc-sb2-user {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-top: 1px solid var(--hc-sb-border);
  flex-shrink: 0;
  min-height: 66px;
}
aside.sidebar.hc-sb2 .hc-sb2-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bg-elevated, rgba(124, 106, 255, 0.18));
  border: 1px solid var(--hc-sb-border);
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
aside.sidebar.hc-sb2 .hc-sb2-userinfo { min-width: 0; }
aside.sidebar.hc-sb2 .hc-sb2-username {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--hc-sb-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
aside.sidebar.hc-sb2 .hc-sb2-role {
  font-size: 0.72rem;
  color: var(--hc-sb-mute);
  text-transform: capitalize;
}
aside.sidebar.hc-sb2 .hc-sb2-logout {
  margin-left: auto;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--hc-sb-mute);
  cursor: pointer;
  font-size: 0.85rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
aside.sidebar.hc-sb2 .hc-sb2-logout:hover {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.08);
}
aside.sidebar.hc-sb2 a.hc-sb2-loginbtn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--hc-sb-accent), var(--hc-sb-accent-2));
  color: var(--text-on-brand, #ffffff);
  font-weight: 700;
  font-size: 0.87rem;
  text-decoration: none;
  box-shadow: 0 6px 18px var(--brand-glow, rgba(124, 106, 255, 0.35));
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
aside.sidebar.hc-sb2 a.hc-sb2-loginbtn:hover { transform: translateY(-1px); box-shadow: 0 10px 24px var(--brand-glow, rgba(124, 106, 255, 0.5)); }
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-userinfo,
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-logout { display: none; }
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-user { justify-content: center; padding: 13px 4px; }

/* ── Mobile: always drawer ─────────────────────────────────────────────── */
/* ── Eingeklappte Leiste: alle Kinder müssen in die 70px passen ────────────
   Der Einklapp-Button hing per `margin-left:auto` am rechten Rand eines
   Headers, der beim Einklappen nicht mitschrumpft. Er rutschte dadurch aus
   der Leiste heraus über den Seiteninhalt und war nicht mehr klickbar:
   Einklappen ging, Ausklappen nicht mehr. Bewusst KEIN overflow:hidden auf
   der Leiste — die Hover-Tooltips der Items ragen absichtlich nach rechts. */
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-header {
  flex-direction: column;
  gap: 8px;
  padding: 14px 6px 12px;
}
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-collapse { margin-left: 0; }
/* Sektions-Labels: nur der Anfangsbuchstabe (::first-letter behält 0.66rem) */
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-label { font-size: 0; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  aside.sidebar.hc-sb2,
  #hc-sb2-backdrop,
  #hc-sb2-fab,
  aside.sidebar.hc-sb2 .hc-sb2-collapse {
    transition: none !important;
  }
}
/* Login-Button wie die Nav-Items: Text weg, Icon bleibt */
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) a.hc-sb2-loginbtn { padding: 10px 0; gap: 0; }
aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) a.hc-sb2-loginbtn .hc-sb2-text { display: none; }

@media (max-width: 768px) {
  aside.sidebar.hc-sb2 {
    transform: translateX(calc(-100% - 2px));
    width: min(300px, 86vw);
    box-shadow: none;
  }
  aside.sidebar.hc-sb2.open {
    transform: translateX(0);
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.55);
  }
  aside.sidebar.hc-sb2 .hc-sb2-collapse { display: none; }
  aside.sidebar.hc-sb2.collapsed { width: min(300px, 86vw); }
  aside.sidebar.hc-sb2.collapsed a.hc-sb2-item .hc-sb2-text { display: inline; }
  aside.sidebar.hc-sb2.collapsed .hc-sb2-settings { display: flex; }
  aside.sidebar.hc-sb2.collapsed .hc-sb2-brandname { display: inline; }
  /* Mobil ist "collapsed" neutralisiert — die Rail-Regeln oben zurücknehmen. */
  aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-header { flex-direction: row; gap: 11px; padding: 18px 16px 14px; }
  aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) .hc-sb2-label { font-size: 0.66rem; }
  aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) a.hc-sb2-loginbtn { padding: 10px; gap: 8px; }
  aside.sidebar.hc-sb2.collapsed:not(.hc-sb2-drawer) a.hc-sb2-loginbtn .hc-sb2-text { display: inline; }
}

/* Body scroll lock while drawer open */
body.hc-sb2-locked { overflow: hidden; }

/* Stacking safety: several pages set a z-index on ALL direct body children
   (e.g. `body > *:not(#galaxy-bg) { z-index: 1 }`), which traps the sidebar
   below page navs. Force the shell layers above page chrome. */
body > #sidebar-container { position: relative; z-index: 1300 !important; }
aside.sidebar.hc-sb2 { z-index: 1300 !important; }
#hc-sb2-backdrop { z-index: 1290 !important; }
#hc-sb2-fab { z-index: 1280 !important; }

@media print {
  aside.sidebar.hc-sb2, #hc-sb2-fab, #hc-sb2-backdrop { display: none !important; }
}

/* Skip full-screen page loading screens when switching pages via the sidebar */
html.hc-sidebar-nav #loading-overlay,
html.hc-sidebar-nav .loading-overlay,
html.hc-sidebar-nav #boot.screen,
html.hc-sidebar-nav #skeleton.skeleton-screen {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
