/* Attendance Management System 1.0.42
 * Mobile HOME ONLY: keep the five staff shortcuts above the bottom navigation.
 * Other screens (reports, documents, alerts and profile) retain vertical scrolling.
 * The accompanying fit script releases scroll lock if content cannot fit safely.
 */
@media (max-width: 899px) {
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home {
    box-sizing: border-box !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-brandbar {
    min-height: 76px !important;
    height: 76px !important;
    padding: 6px 12px !important;
    flex: 0 0 76px !important;
    box-sizing: border-box !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-brandbar > a.att-mobile-logo,
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-brandbar > .att-mobile-logo {
    max-height: 68px !important;
    max-width: min(290px, calc(100vw - 24px)) !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-brandbar img {
    max-height: 68px !important;
    max-width: min(290px, calc(100vw - 24px)) !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-body {
    padding: 6px 10px calc(77px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-body .ams-home-greeting {
    padding: 4px 4px 8px !important;
    margin: 0 0 5px !important;
    gap: 2px !important;
    min-height: 0 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .ams-home-greeting-line {
    font-size: 13px !important;
    line-height: 1.25 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .ams-home-greeting-name {
    font-size: clamp(16px, 4.5vw, 19px) !important;
    line-height: 1.22 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-body .att-home-card {
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-home-card .ams-home-actions {
    gap: 7px !important;
    margin: 0 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-home-card .ams-home-actions a.ams-home-main-button {
    min-height: 56px !important;
    height: 56px !important;
    padding: 6px 11px !important;
    grid-template-columns: 36px minmax(0, 1fr) 18px !important;
    gap: 10px !important;
    border-radius: 13px !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-home-card .ams-home-actions a.ams-home-main-button .ams-home-link-icon {
    width: 36px !important;
    height: 36px !important;
    flex-basis: 36px !important;
    border-radius: 10px !important;
    font-size: 19px !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-home-card .ams-home-actions a.ams-home-main-button .att-desktop-action-title {
    font-size: 15px !important;
    line-height: 1.3 !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-home-card .ams-home-actions a.ams-home-main-button .ams-home-link-arrow {
    width: 18px !important;
    font-size: 17px !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-nav {
    padding-top: 5px !important;
    padding-bottom: calc(5px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.att-mobile-mode.att-mobile-home-compact .att-mobile-app.att-mobile-screen-home .att-mobile-nav a {
    min-height: 54px !important;
    padding-top: 5px !important;
    padding-bottom: 5px !important;
  }

  /* Apply the scroll lock only when JS confirms the whole menu is visible. */
  html.att-mobile-home-fit,
  body.att-mobile-mode.att-mobile-home-fit {
    height: 100% !important;
    max-height: 100% !important;
    overflow-y: hidden !important;
    overscroll-behavior-y: none !important;
  }
  body.att-mobile-mode.att-mobile-home-fit .att-mobile-app.att-mobile-screen-home,
  body.att-mobile-mode.att-mobile-home-fit .att-mobile-app.att-mobile-screen-home .att-mobile-shell {
    height: 100dvh !important;
    min-height: 0 !important;
    max-height: 100dvh !important;
    overflow: hidden !important;
  }
  body.att-mobile-mode.att-mobile-home-fit .att-mobile-app.att-mobile-screen-home .att-mobile-shell {
    display: flex !important;
    flex-direction: column !important;
  }
  body.att-mobile-mode.att-mobile-home-fit .att-mobile-app.att-mobile-screen-home .att-mobile-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
  }
  /* Keep navigation fixed and within viewport in normal browsers and installed PWA. */
  body.att-mobile-mode.att-mobile-home-fit .att-mobile-app.att-mobile-screen-home .att-mobile-nav {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
  }
}
