/* Mobile dashboard drawers: keep Logout above the fixed five-tab bar (z-index 1400). */
@media (max-width: 767px) {
  html[data-dashboard-chrome] #client-sidebar {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1500 !important;
  }

  html[data-dashboard-chrome][data-client-shell='authenticated-client'] #client-sidebar .client-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  html[data-dashboard-chrome] #agencySidebar {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1500 !important;
  }

  html[data-dashboard-chrome] #agencySidebar .agency-nav {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  html[data-dashboard-chrome] #brothel-sidebar.is-open,
  html[data-dashboard-chrome] #brothel-sidebar {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1500 !important;
    max-height: calc(100dvh - var(--dash-tab-h, 68px) - env(safe-area-inset-bottom, 0px));
  }

  html[data-dashboard-chrome] #brothel-sidebar {
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  html[data-dashboard-chrome] #massage-dashboard-root aside.fixed.translate-x-0,
  html[data-dashboard-chrome] #massage-dashboard-root aside.fixed {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1500 !important;
    max-height: calc(100dvh - var(--dash-tab-h, 68px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }

  html[data-dashboard-chrome] .blk-more-panel {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    max-height: calc(100dvh - var(--dash-tab-h, 68px) - env(safe-area-inset-bottom, 0px));
  }

  html[data-dashboard-chrome] .blk-more-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Legacy EJS dashboards */
  html[data-dashboard-chrome] #saasSidebar,
  html[data-dashboard-chrome] .massage-sidebar.mobile-open {
    bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px)) !important;
    z-index: 1500 !important;
    max-height: calc(100dvh - var(--dash-tab-h, 68px) - env(safe-area-inset-bottom, 0px));
  }

  html[data-dashboard-chrome] #saasSidebar .saas-sidebar-nav,
  html[data-dashboard-chrome] .agency-sidebar .agency-sidebar-inner,
  html[data-dashboard-chrome] .massage-sidebar nav,
  html[data-dashboard-chrome] .admin-sidebar nav {
    padding-bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px) + 1rem) !important;
    scroll-padding-bottom: calc(var(--dash-tab-h, 68px) + env(safe-area-inset-bottom, 0px) + 1rem);
  }
}