/* Pixel3DLab v34 — reliable sticky footer on short pages, natural flow on long pages. */
html,
body {
  min-height: 100%;
}

body.pxh-home-page:not(.pxh-mini-chat-mode) {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  min-height: 100vh !important;
  min-height: 100dvh !important;
  height: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

body.pxh-home-page:not(.pxh-mini-chat-mode) > #pxh-main-content {
  display: flex !important;
  flex: 1 0 auto !important;
  flex-direction: column !important;
  width: 100% !important;
  min-height: 0 !important;
  height: auto !important;
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

/* Landing page: the home wrapper owns its own footer. */
body.pxh-home-page:not(.pxh-inner-page):not(.pxh-mini-chat-mode) #pxh-main-content > #pxh-home {
  display: flex !important;
  flex: 1 0 auto !important;
  flex-direction: column !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
}

body.pxh-home-page:not(.pxh-inner-page):not(.pxh-mini-chat-mode) #pxh-main-content > #pxh-home > .pxh-footer {
  flex: 0 0 auto !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
}

/* Inner pages: allow the main area to consume the remaining viewport height. */
body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content > .pxh-inner-main {
  display: block !important;
  flex: 1 0 auto !important;
  min-height: 0 !important;
  height: auto !important;
  box-sizing: border-box !important;
  padding-bottom: 22px !important;
  margin-bottom: 0 !important;
}

body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content > .pxh-inner-footer {
  display: block !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

/* Keep the footer's own background flush with the page edge. */
body.pxh-home-page:not(.pxh-mini-chat-mode) .pxh-footer {
  margin-bottom: 0 !important;
}

@media (max-width: 800px) {
  body.pxh-inner-page:not(.pxh-mini-chat-mode) #pxh-main-content > .pxh-inner-main {
    padding-bottom: 18px !important;
  }
}

/* The mini-chat route intentionally owns the viewport and must not inherit page flex. */
body.pxh-mini-chat-mode {
  display: block !important;
  min-height: 0 !important;
  height: 100vh !important;
  height: 100dvh !important;
}
