/* Loaded last: keep touch actions reachable without changing desktop layouts. */
@media (max-width:1023px) {
  button, a.btn, .rowActions a, .mapBtn, .gpsBtn, .photoPicker {
    min-height:44px; touch-action:manipulation;
  }
  input:not([type=checkbox]):not([type=radio]), select, textarea {font-size:16px!important}
  button:focus-visible, a:focus-visible {outline:3px solid #1688e6;outline-offset:2px}
  .mobile-navigation-open {overflow:hidden!important}
  #appView #sidebar, body.sidebar-collapsed #appView #sidebar,
  .shared-sidebar, body.sidebar-collapsed .shared-sidebar {
    position:fixed!important;left:0!important;top:0!important;bottom:auto!important;
    width:min(320px,85vw)!important;height:100vh!important;
    height:var(--mobile-height,100dvh)!important;min-height:0!important;
    display:flex;flex-direction:column;box-sizing:border-box;
    transform:translateX(-105%);visibility:hidden;pointer-events:none;
    padding-bottom:max(12px,env(safe-area-inset-bottom))!important;
    transition:transform .18s ease,visibility .18s;z-index:100!important;
  }
  #appView #sidebar.open, body.sidebar-collapsed #appView #sidebar.open, body.shared-menu-open .shared-sidebar {
    transform:translateX(0);visibility:visible;pointer-events:auto;
  }
  #sidebar nav, .shared-sidebar nav {flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain}
  #sidebar nav button, .shared-sidebar nav a {min-height:44px;white-space:normal!important;text-align:left!important;font-size:13px!important}
  body.sidebar-collapsed #sidebar .brand>div:last-child,
  body.sidebar-collapsed #sidebar .sidebar-foot {font-size:14px!important}
  body.sidebar-collapsed #sidebar .nav-group {font-size:11px!important}
  body.sidebar-collapsed .shared-sidebar .shared-brand-copy,
  body.sidebar-collapsed .shared-sidebar .nav-label,
  body.sidebar-collapsed .shared-sidebar .shared-group,
  body.sidebar-collapsed .shared-sidebar .shared-foot {display:block!important}
  body.sidebar-collapsed .shared-sidebar nav a {justify-content:flex-start!important}
  .shared-menu-shade {display:none;position:fixed;inset:0;background:#06192f70;z-index:99!important}
  body.mobile-navigation-open .shared-menu-shade {display:block}
  .shared-mobile-toggle {left:auto!important;right:max(10px,env(safe-area-inset-right));top:max(10px,env(safe-area-inset-top))}
  body.shared-admin-page>header {padding-right:64px!important;min-height:64px;flex-wrap:wrap;gap:8px}
  #appView main>header {height:auto;min-height:64px;flex-wrap:wrap;gap:8px;padding:10px!important}
  #appView main>header .global-back-btn {font-size:11px}
  #appView main {min-width:0}
  .table-wrap,.tableWrap,.clientTableWrap {overflow:auto;overscroll-behavior-x:contain}
  #tabs {display:flex;overflow-x:auto;flex-wrap:nowrap;gap:6px}
  #tabs button {flex:0 0 auto}
  .profileCard, html.clients-embed .profileCard {
    height:var(--mobile-height,100dvh)!important;max-height:var(--mobile-height,100dvh)!important;
  }
  .drawer.employeeFull,.drawer.employeeFull.open {
    height:var(--mobile-height,100dvh)!important;max-height:var(--mobile-height,100dvh)!important;
  }
  .profileBody {min-height:0;overscroll-behavior:contain}
  .modal,.drawer {z-index:1000!important}
  .shade {z-index:999!important}
  .modal {max-height:var(--mobile-height,100dvh);box-sizing:border-box;overflow-y:auto}
  .modal-card,.modalCard {max-width:calc(100vw - 24px);max-height:calc(var(--mobile-height,100dvh) - 24px);overflow-y:auto}
  .profileFooter,.drawer.employeeFull .drawerFoot {padding-bottom:max(10px,env(safe-area-inset-bottom))!important}
  .footerActions {flex-wrap:wrap}
  .footerActions button {min-width:0;white-space:normal}
  .photoItem button,.closeBtn {min-width:44px;min-height:44px}
  .clientTable {min-width:0}
  .clientTable thead {display:none}
  .clientTable tbody,.clientTable tr {display:block}
  .clientTable tr {padding:12px;border-bottom:1px solid var(--line)}
  .clientTable td {display:block;border:0;padding:5px 0;overflow-wrap:anywhere}
  .clientTable .rowActions {justify-content:flex-start;flex-wrap:wrap;margin-top:8px}
  .clientTable .rowActions a {display:inline-flex;align-items:center}
}
@media (prefers-reduced-motion:reduce) {
  #sidebar,.shared-sidebar,#appView,body.shared-admin-page {transition:none!important}
}

/* One touch drawer for the shell and standalone administrative modules. */
.mobile-menu-close{display:none}
@media(max-width:1023px){
 body.admin-responsive.shared-admin-page{padding-left:0!important}
 body.admin-responsive #appView.app>main{margin-left:0!important;width:100%!important;min-width:0}
 body.admin-responsive #menuBtn,body.admin-responsive .shared-mobile-toggle{position:fixed!important;left:max(10px,env(safe-area-inset-left))!important;right:auto!important;top:max(10px,env(safe-area-inset-top))!important;width:44px!important;min-width:44px!important;height:44px!important;padding:8px!important;display:grid!important;place-items:center;z-index:141!important;background:#29323d;color:#fff;border:1px solid #ffffff26;border-radius:8px;font-size:24px}
 body.admin-responsive #menuBtn:after,body.admin-responsive .shared-mobile-toggle:after{content:none!important}
 body.admin-responsive #appView main>header,body.admin-responsive.shared-admin-page>header{padding-left:calc(64px + env(safe-area-inset-left))!important;padding-top:max(10px,env(safe-area-inset-top))!important;min-height:64px;box-sizing:border-box}
 body.admin-responsive.shared-admin-page #menuBtn,body.admin-responsive.shared-admin-page>header>button.icon{display:none!important}
 body.admin-responsive #appView #sidebar.pc-sidebar,body.admin-responsive.sidebar-collapsed #appView #sidebar.pc-sidebar,body.admin-responsive #sharedSidebar.pc-sidebar{width:min(80vw,300px)!important;max-width:300px!important;height:var(--mobile-height,100dvh)!important;padding-top:env(safe-area-inset-top)!important;padding-left:env(safe-area-inset-left)!important;z-index:160!important}
 body.admin-responsive .shared-menu-shade{z-index:150!important;touch-action:none}
 body.admin-responsive .mobile-menu-close{display:grid;place-items:center;align-self:flex-end;flex:0 0 44px;width:44px;height:44px;margin:4px 8px 0;border:1px solid #ffffff26;background:transparent;color:#fff;border-radius:8px;font-size:28px}
 body.admin-responsive .pc-sidebar .pc-nav-item,body.admin-responsive .pc-sidebar .pc-group-toggle,body.admin-responsive .pc-sidebar .pc-portal{min-height:44px!important}
 body.admin-responsive .pc-sidebar .brand,body.admin-responsive .pc-sidebar .shared-brand{min-height:64px;padding:8px 20px}
 body.admin-responsive .pc-sidebar .shared-brand-logo,body.admin-responsive .pc-sidebar #mainBrandImg{height:56px}
}
