/* 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-phase9-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;
  }
}
