/* Global fixed footer shell — loaded last so legacy/static footer rules cannot win. */
:root {
  --simh-fixed-footer-height: 50px;
}

body.simh-app:not(.auth-page) .site-footer {
  position: fixed !important;
  left: var(--simh-sidebar-width, var(--sidebar-width, 240px)) !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 70 !important;
  width: auto !important;
  height: var(--simh-fixed-footer-height) !important;
  min-height: var(--simh-fixed-footer-height) !important;
  max-height: var(--simh-fixed-footer-height) !important;
  margin: 0 !important;
  padding: 8px 22px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 14px !important;
  overflow: hidden !important;
  color: rgba(255, 255, 255, .88) !important;
  background: var(--simh-stage9-footer, var(--simh-sidebar, #123d58)) !important;
  border: 0 !important;
  border-top: 1px solid rgba(255, 255, 255, .15) !important;
  box-shadow: 0 -8px 22px rgba(7, 17, 31, .14) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  transform: none !important;
  flex: 0 0 var(--simh-fixed-footer-height) !important;
}
body.simh-app:not(.auth-page) .site-footer span {
  min-width: 0 !important;
  overflow: hidden !important;
  color: inherit !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
body.simh-app:not(.auth-page) .content-area {
  padding-bottom: calc(var(--simh-fixed-footer-height) + 34px) !important;
}
body.simh-app:not(.auth-page) .app-main {
  padding-bottom: 0 !important;
}
body.simh-app:not(.auth-page) {
  padding-bottom: 0 !important;
}

/* Keep the floating assistant above the fixed footer instead of covering it. */
body.simh-app:not(.auth-page) .simh-ai-widget-launcher {
  bottom: calc(var(--simh-fixed-footer-height) + 16px + env(safe-area-inset-bottom)) !important;
}
body.simh-app:not(.auth-page) .simh-ai-widget {
  bottom: calc(var(--simh-fixed-footer-height) + 78px) !important;
}

@media (max-width: 1380px) {
  body.simh-app:not(.auth-page) .site-footer {
    left: 0 !important;
  }
}

@media (max-width: 620px) {
  :root { --simh-fixed-footer-height: 44px; }
  body.simh-app:not(.auth-page) .site-footer {
    padding: 7px 10px !important;
    justify-content: center !important;
    text-align: center !important;
    font-size: 10.5px !important;
  }
  body.simh-app:not(.auth-page) .site-footer span + span {
    display: none !important;
  }
  body.simh-app:not(.auth-page) .content-area {
    padding-bottom: calc(var(--simh-fixed-footer-height) + 24px) !important;
  }
  body.simh-app:not(.auth-page) .simh-ai-widget-launcher {
    bottom: calc(var(--simh-fixed-footer-height) + 12px + env(safe-area-inset-bottom)) !important;
  }
  body.simh-app:not(.auth-page) .simh-ai-widget {
    bottom: calc(var(--simh-fixed-footer-height) + 68px) !important;
    max-height: calc(100dvh - var(--simh-fixed-footer-height) - 92px) !important;
  }
}

/* Stable mobile footer: fixed height, GPU compositing and exact content clearance. */
:root {
  --simh-footer-safe-area: env(safe-area-inset-bottom, 0px);
}

body.simh-app:not(.auth-page) .site-footer {
  bottom: 0 !important;
  height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area)) !important;
  min-height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area)) !important;
  max-height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area)) !important;
  padding-bottom: calc(8px + var(--simh-footer-safe-area)) !important;
  transform: translate3d(0, 0, 0) !important;
  backface-visibility: hidden !important;
  -webkit-backface-visibility: hidden !important;
  will-change: transform;
  contain: layout paint;
}

body.simh-app:not(.auth-page) .content-area {
  padding-bottom: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area) + 38px) !important;
}

@supports (height: 100dvh) {
  body.simh-app:not(.auth-page),
  body.simh-app:not(.auth-page) .app-shell,
  body.simh-app:not(.auth-page) .app-main {
    min-height: 100dvh !important;
  }
}

@media (max-width: 620px) {
  :root { --simh-fixed-footer-height: 46px; }

  body.simh-app:not(.auth-page) .site-footer {
    padding-top: 7px !important;
    padding-bottom: calc(7px + var(--simh-footer-safe-area)) !important;
  }

  body.simh-app:not(.auth-page) .content-area {
    padding-bottom: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area) + 30px) !important;
  }
}


/* MTN Data Share: explicit final shell guard.
   Keep footer visible while page tables own their horizontal scrolling. */
body.simh-app.page-cloud_mtn_data_share:not(.auth-page) .site-footer {
  position: fixed !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  left: var(--simh-sidebar-width, var(--sidebar-width, 240px)) !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 100 !important;
  width: auto !important;
  margin: 0 !important;
  transform: translate3d(0,0,0) !important;
}
body.simh-app.page-cloud_mtn_data_share:not(.auth-page) .content-area {
  padding-bottom: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area, 0px) + 32px) !important;
}
@media (max-width: 1380px) {
  body.simh-app.page-cloud_mtn_data_share:not(.auth-page) .site-footer {
    left: 0 !important;
  }
}


/* MTN Data Share footer is detached from app-shell/app-main because the global
   responsive containment intentionally clips application shells horizontally. */
body.simh-app.page-cloud_mtn_data_share:not(.auth-page) > .site-footer-detached {
  position: fixed !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  left: var(--simh-sidebar-width, var(--sidebar-width, 248px)) !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 200 !important;
  width: auto !important;
  height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area, 0px)) !important;
  min-height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area, 0px)) !important;
  max-height: calc(var(--simh-fixed-footer-height) + var(--simh-footer-safe-area, 0px)) !important;
  margin: 0 !important;
  padding: 8px 22px calc(8px + var(--simh-footer-safe-area, 0px)) !important;
  align-items: center !important;
  justify-content: space-between !important;
  color: rgba(255,255,255,.90) !important;
  background: var(--simh-stage9-footer, var(--simh-sidebar, #123d58)) !important;
  border-top: 1px solid rgba(255,255,255,.15) !important;
  box-shadow: 0 -8px 22px rgba(7,17,31,.14) !important;
  transform: translate3d(0,0,0) !important;
}
body.simh-app.page-cloud_mtn_data_share:not(.auth-page) .simh-horizontal-scrollbar {
  z-index: 220 !important;
}
body.simh-app.page-cloud_mtn_data_share:not(.auth-page) .content-area {
  padding-bottom: calc(
    var(--simh-fixed-footer-height)
    + var(--simh-footer-safe-area, 0px)
    + 44px
  ) !important;
}
@media (max-width: 1380px) {
  body.simh-app.page-cloud_mtn_data_share:not(.auth-page) > .site-footer-detached {
    left: 0 !important;
  }
}
@media (max-width: 620px) {
  body.simh-app.page-cloud_mtn_data_share:not(.auth-page) > .site-footer-detached {
    left: 0 !important;
    justify-content: center !important;
    text-align: center !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body.simh-app.page-cloud_mtn_data_share:not(.auth-page) > .site-footer-detached span + span {
    display: none !important;
  }
}
