/* Mobile / Chrome touch fixes */
html{
  -webkit-text-size-adjust:100%;
  text-size-adjust:100%;
}
body{
  max-width:100%;
  overflow-x:hidden;
  -webkit-tap-highlight-color:rgba(45,98,232,.15);
}
.main,
.auth-body{
  min-height:100vh;
  min-height:100dvh;
}
input,
select,
textarea{
  max-width:100%;
}
img,svg,video,canvas{
  max-width:100%;
  height:auto;
}
.table-wrap{
  -webkit-overflow-scrolling:touch;
  overscroll-behavior-x:contain;
  max-width:100%;
}

/* Backdrop must NEVER block clicks when closed */
.sidebar-backdrop,
.sidebar-backdrop[hidden]{
  display:none !important;
  pointer-events:none !important;
  visibility:hidden !important;
  opacity:0 !important;
}

@media (max-width:1050px){
  .topbar{
    position:sticky;
    top:0;
    z-index:60;
    background:var(--bg,#f4f6fc);
  }
  .menu{
    position:relative;
    z-index:61;
    min-width:44px;
    min-height:44px;
    place-items:center;
    cursor:pointer;
    -webkit-user-select:none;
    user-select:none;
    touch-action:manipulation;
  }
  .sidebar{
    z-index:70;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior:contain;
    pointer-events:none; /* closed: ignore taps through off-canvas drawer */
  }
  .sidebar.mobile-open{
    pointer-events:auto;
    box-shadow:12px 0 28px rgba(15,23,42,.22);
  }
  body.sidebar-open{
    overflow:hidden;
  }
  body.sidebar-open .sidebar-backdrop{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
    pointer-events:auto !important;
    position:fixed;
    inset:0;
    z-index:65;
    background:rgba(15,23,42,.45);
    border:0;
    padding:0;
    margin:0;
    -webkit-tap-highlight-color:transparent;
    touch-action:manipulation;
  }
  .sidebar .nav-group summary,
  .sidebar .nav-subgroup summary,
  .sidebar a,
  .sidebar button{
    touch-action:manipulation;
    cursor:pointer;
  }
  .main,.container{
    max-width:100%;
    position:relative;
    z-index:1;
  }
}

@media (max-width:650px){
  input,
  select,
  textarea{
    font-size:16px !important;
  }
  .form-grid,
  .contact-columns,
  .customer-form,
  .toolbar,
  .heading,
  .card,
  .table-card,
  .form-section,
  .rs-detail,
  .rs-progress-steps{
    max-width:100%;
  }
}
