/* =====================================================
   EDIVIC ABSOLUTE SIDEBAR LOCK + CONTENT SCROLL PANE
   Request: when user scrolls page content, sidebar must not move at all.
   Desktop: sidebar and topbar are fixed; only .edv-mtb-scroll-pane scrolls.
   Mobile: drawer sidebar stays fixed; only content pane scrolls. Bottom bar removed.
===================================================== */
:root{
  --edv-mtb-sidebar-w:286px;
  --edv-mtb-topbar-h:80px;
}

html{ overflow-x:hidden!important; }

/* No-sidebar pages keep normal page behavior */
body.edivic-no-sidebar-page,
body.edivic-mtb-home-no-sidebar{
  padding-left:0!important;
  padding-bottom:0!important;
  overflow-x:hidden!important;
  overflow-y:auto!important;
  height:auto!important;
  max-height:none!important;
}
body.edivic-no-sidebar-page .edv-mtb-sidebar,
body.edivic-no-sidebar-page .edv-mtb-sidebar-backdrop,
body.edivic-no-sidebar-page .edv-mtb-main-topbar,
body.edivic-mtb-home-no-sidebar .edv-mtb-sidebar,
body.edivic-mtb-home-no-sidebar .edv-mtb-sidebar-backdrop,
body.edivic-mtb-home-no-sidebar .edv-mtb-main-topbar{
  display:none!important;
  visibility:hidden!important;
  pointer-events:none!important;
}

/* Hide mobile/down bars permanently */
.edv-mtb-bottom-nav,
.edv-mobile-bottom-nav,
.edivic-chat-bottom-nav,
.bottom-nav,
.edv-chat-bottom-nav{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}

/* Shared fixed sidebar rules */
body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar,
body.edivic-mtb-nav-ready.edv-mtb-sidebar-open:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar{
  position:fixed!important;
  top:0!important;
  left:0!important;
  right:auto!important;
  bottom:auto!important;
  width:var(--edv-mtb-sidebar-w)!important;
  min-width:var(--edv-mtb-sidebar-w)!important;
  max-width:var(--edv-mtb-sidebar-w)!important;
  height:100vh!important;
  min-height:100vh!important;
  max-height:100vh!important;
  height:100svh!important;
  min-height:100svh!important;
  max-height:100svh!important;
  overflow:hidden!important;
  overflow-y:hidden!important;
  overflow-x:hidden!important;
  overscroll-behavior:none!important;
  -webkit-overflow-scrolling:auto!important;
  transform:translate3d(0,0,0)!important;
  translate:none!important;
  will-change:auto!important;
  contain:layout paint style!important;
  z-index:2147483000!important;
}
@supports (height: 100dvh){
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar,
  body.edivic-mtb-nav-ready.edv-mtb-sidebar-open:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar{
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
  }
}

body.edivic-mtb-nav-ready .edv-mtb-nav-list{
  flex:1 1 auto!important;
  min-height:0!important;
  overflow:hidden!important;
  overflow-y:hidden!important;
  overflow-x:hidden!important;
  overscroll-behavior:none!important;
  -webkit-overflow-scrolling:auto!important;
}
body.edivic-mtb-nav-ready .edv-mtb-sidebar-bottom{
  flex:0 0 auto!important;
  margin-top:auto!important;
}
body.edivic-mtb-nav-ready .edv-mtb-sidebar *{
  overscroll-behavior:none!important;
}

@media (min-width:901px){
  html:has(body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar)){
    height:100%!important;
    overflow:hidden!important;
  }
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar){
    width:100%!important;
    height:100vh!important;
    max-height:100vh!important;
    margin:0!important;
    padding-left:0!important;
    padding-bottom:0!important;
    overflow:hidden!important;
    background:#f6f8fb!important;
  }

  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar{
    transform:translate3d(0,0,0)!important;
    padding-top:14px!important;
    padding-bottom:12px!important;
  }

  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-main-topbar{
    position:fixed!important;
    top:0!important;
    left:var(--edv-mtb-sidebar-w)!important;
    right:0!important;
    width:auto!important;
    min-height:var(--edv-mtb-topbar-h)!important;
    height:var(--edv-mtb-topbar-h)!important;
    margin:0!important;
    z-index:2147482000!important;
  }

  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-scroll-pane{
    position:fixed!important;
    left:var(--edv-mtb-sidebar-w)!important;
    right:0!important;
    top:var(--edv-mtb-topbar-h)!important;
    bottom:0!important;
    width:auto!important;
    height:auto!important;
    min-height:0!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    scroll-behavior:auto!important;
    background:inherit!important;
    z-index:1!important;
  }

  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-scroll-pane > *:first-child{
    margin-top:0!important;
  }

  body.edivic-mtb-nav-ready .edv-mtb-sidebar-brand{
    flex:0 0 auto!important;
    padding-bottom:10px!important;
    margin-bottom:4px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-nav-title{
    padding:7px 10px 4px!important;
    font-size:10px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-nav-link{
    min-height:34px!important;
    padding:7px 10px!important;
    margin:1px 0!important;
    border-radius:12px!important;
    font-size:13px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-side-chip{
    padding:6px 8px!important;
  }
}

@media (max-width:900px){
  html:has(body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar)){
    height:100%!important;
    overflow:hidden!important;
  }
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar){
    height:100vh!important;
    max-height:100vh!important;
    padding-left:0!important;
    padding-bottom:0!important;
    overflow:hidden!important;
    background:#f6f8fb!important;
  }
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-main-topbar{
    position:fixed!important;
    top:0!important;
    left:0!important;
    right:0!important;
    width:auto!important;
    min-height:var(--edv-mtb-topbar-h)!important;
    height:var(--edv-mtb-topbar-h)!important;
    margin:0!important;
    z-index:6500!important;
  }
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-scroll-pane{
    position:fixed!important;
    left:0!important;
    right:0!important;
    top:var(--edv-mtb-topbar-h)!important;
    bottom:0!important;
    width:auto!important;
    height:auto!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior:contain!important;
    background:inherit!important;
    z-index:1!important;
  }
  body.edivic-mtb-nav-ready:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar{
    width:286px!important;
    min-width:286px!important;
    max-width:calc(100vw - 42px)!important;
    transform:translate3d(-110%,0,0)!important;
    transition:transform .24s ease!important;
    padding:14px 12px 14px!important;
    z-index:2147483000!important;
  }
  body.edivic-mtb-nav-ready.edv-mtb-sidebar-open:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar,
  body.edv-mtb-sidebar-open:not(.edivic-no-sidebar-page):not(.edivic-mtb-home-no-sidebar) .edv-mtb-sidebar{
    transform:translate3d(0,0,0)!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-backdrop{
    position:fixed!important;
    inset:0!important;
    z-index:2147482500!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-brand{
    flex:0 0 auto!important;
    padding:6px 6px 12px!important;
    margin-bottom:4px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-nav-title{
    padding:7px 8px 4px!important;
    font-size:10px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-nav-link{
    min-height:34px!important;
    padding:7px 9px!important;
    margin:1px 0!important;
    border-radius:12px!important;
    font-size:13px!important;
  }
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-bottom{
    margin-top:6px!important;
  }
}

@media (max-height:680px){
  body.edivic-mtb-nav-ready .edv-mtb-logo-mark{width:36px!important;height:36px!important;border-radius:12px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-logo-mark img{width:24px!important;height:24px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-brand h3{font-size:14px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-brand small{font-size:9px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-nav-title{padding:5px 8px 3px!important;font-size:9px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-nav-link{min-height:30px!important;padding:5px 8px!important;font-size:12px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-avatar{width:27px!important;height:27px!important;font-size:11px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-side-chip strong{font-size:11px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-side-chip small{font-size:8px!important;}
}

@media (max-height:590px){
  body.edivic-mtb-nav-ready .edv-mtb-nav-title{display:none!important;}
  body.edivic-mtb-nav-ready .edv-mtb-nav-link{min-height:28px!important;padding:4px 8px!important;font-size:11px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-brand{padding-bottom:7px!important;}
  body.edivic-mtb-nav-ready .edv-mtb-sidebar-bottom{display:none!important;}
}
