/* LA2.WORLD x Sphere — the entire app is a single grid. 2026-10-31.
   Replaces old, incompatible fixed-header and margin-offset workarounds.
   No JS-driven offsets; the header and content each occupy their own grid row. */
body.phoenix-cabinet.la2w-reference .page {
  display: grid !important;
  grid-template-columns: calc(17rem + 65px) minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  align-items: start !important;
  justify-content: stretch !important;
  align-content: start !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  overflow: visible !important;
}
/* Position: sticky keeps header in-flow, not a viewport overlay. */
body.phoenix-cabinet.la2w-reference .page > header.app-header {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  position: sticky !important;
  inset: auto !important;
  inset-block-start: auto !important;
  inset-inline: auto !important;
  top: 0 !important;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 83px !important;
  margin: 0 !important;
  padding-inline-start: 0 !important;
  transform: none !important;
  flex: none !important;
  align-self: start !important;
  z-index: 950 !important;
}
body.phoenix-cabinet.la2w-reference .page > header.app-header .main-header-container {
  min-height: 83px !important;
  height: auto !important;
}
/* Desktop sidebar is in the left grid column, *below* the header.
   Sticky scrolls beneath the header, never through it. */
body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar {
  grid-column: 1 !important;
  grid-row: 2 !important;
  position: sticky !important;
  top: 83px !important;
  inset-block-start: 83px !important;
  inset-inline-start: auto !important;
  transform: none !important;
  align-self: start !important;
  width: 100% !important;
  min-width: 0 !important;
  height: calc(100vh - 83px) !important;
  height: calc(100dvh - 83px) !important;
  z-index: 400 !important;
  transition: none !important;
}
body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar .main-sidebar-header,
body.phoenix-cabinet.la2w-reference .phoenix-sidebar-mobile-logo {
  display: none !important;
}
body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar #sidebar-scroll.main-sidebar {
  margin: 0 !important;
  padding-top: 12px !important;
  height: calc(100vh - 83px) !important;
  height: calc(100dvh - 83px) !important;
  max-height: calc(100dvh - 83px) !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  box-sizing: border-box !important;
}
/* Content is a real grid cell, not compensated by offset margins. */
body.phoenix-cabinet.la2w-reference .page > .main-content.app-content {
  grid-column: 2 !important;
  grid-row: 2 !important;
  position: relative !important;
  margin: 0 !important;
  margin-block-start: 0 !important;
  margin-inline-start: 0 !important;
  inset: auto !important;
  transform: none !important;
  padding: 24px 20px 40px !important;
  min-width: 0 !important;
  width: 100% !important;
  align-self: stretch !important;
  z-index: 1 !important;
}
html { scroll-padding-top: 100px; }
body.la2w-reference .page :is(.page-header, .la2w-dashboard-heading, [id^="la2w-"]) {
  scroll-margin-top: 100px;
}
@media (max-width: 991.98px) {
  body.phoenix-cabinet.la2w-reference .page {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }
  body.phoenix-cabinet.la2w-reference .page > header.app-header,
  body.phoenix-cabinet.la2w-reference .page > header.app-header .main-header-container {
    min-height: 69px !important;
  }
  body.phoenix-cabinet.la2w-reference .page > .main-content.app-content {
    grid-column: 1 !important;
    grid-row: 2 !important;
    padding: 18px 12px 32px !important;
    margin: 0 !important;
  }
  /* Sphere's existing hamburger toggles html[data-toggled].
     Mobile sidebar remains offcanvas; it must be ABOVE the header when opened. */
  body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar {
    display: block !important;
    grid-column: auto !important;
    grid-row: auto !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    inset-block-start: 0 !important;
    inset-inline-start: calc(-1 * (17rem + 75px)) !important;
    transform: none !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: calc(17rem + 75px) !important;
    max-width: 92vw !important;
    z-index: 1500 !important;
    transition: inset-inline-start .24s ease !important;
  }
  html[data-toggled="open"] body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar {
    inset-inline-start: 0 !important;
  }
  body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar #sidebar-scroll.main-sidebar {
    margin: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    overflow-y: auto !important;
    padding: 18px 5px 65px !important;
  }
  html { scroll-padding-top: 80px; }
  body.la2w-reference .page :is(.page-header, .la2w-dashboard-heading, [id^="la2w-"]) {
    scroll-margin-top: 80px;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.phoenix-cabinet.la2w-reference .page > aside#sidebar.app-sidebar { transition: none !important; }
}
