/* Vier API Enterprise V5.2 — conservative mobile recovery.
   Intentionally small: no global component rescaling. */

/* Accessibility link must stay off-screen unless keyboard-focused. */
.skip-link{
  position:fixed!important;
  left:12px!important;
  top:-100px!important;
  z-index:100000!important;
  width:auto!important;
  height:auto!important;
  overflow:visible!important;
}
.skip-link:focus,.skip-link:focus-visible{top:12px!important}

/* Prevent long brand/account text from widening the viewport. */
.vier-brand,.nav-actions,.neo-topbar>*{min-width:0}
.brand-name-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

@media(max-width:760px){
  /* Public navigation: fixed dimensions and one reliable hamburger. */
  .site-header.nav-integrity-header{
    height:64px!important;
    min-height:64px!important;
    overflow:visible!important;
  }
  .site-header.nav-integrity-header .nav-inner{
    height:64px!important;
    min-height:64px!important;
    padding:0 14px!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    gap:10px!important;
  }
  .site-header .desktop-nav,
  .site-header .desktop-session-link,
  .site-header .nav-register{display:none!important}
  .site-header .nav-actions{display:flex!important;justify-self:end!important;align-items:center!important}
  .site-header .mobile-nav-toggle{
    display:inline-grid!important;
    place-items:center!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
    flex:0 0 44px!important;
    width:44px!important;
    height:44px!important;
    padding:0!important;
    margin:0!important;
    border-radius:13px!important;
  }
  .site-header .vier-brand{max-width:calc(100vw - 82px)!important;min-width:0!important}
  .site-header .brand-name-text{max-width:160px!important}

  /* Public dropdown stays inside the phone viewport. */
  .public-mobile-menu{
    position:fixed!important;
    top:70px!important;
    left:12px!important;
    right:12px!important;
    width:auto!important;
    max-width:none!important;
    max-height:calc(100dvh - 84px)!important;
    overflow:auto!important;
    z-index:5000!important;
  }

  /* Collection: compact but keep the original component system. */
  .collection-v2{padding:24px 0 58px!important}
  .collection-v2 .enterprise-page-head{margin-bottom:20px!important;gap:14px!important}
  .collection-v2 .enterprise-page-head h1{font-size:34px!important}
  .collection-stats{gap:7px!important;margin-bottom:16px!important}
  .collection-stats article{padding:10px 8px!important;min-width:0!important}
  .collection-stats .stat-icon{width:32px!important;height:32px!important;flex:0 0 32px!important}
  .collection-stats b{font-size:18px!important}
  .collection-stats small{font-size:8px!important}
  .collection-search-wrap{margin-bottom:18px!important}
  .collection-heading-row{margin:20px 0 12px!important}
  .collection-heading-row h1{font-size:22px!important}
  .collection-folder-list{gap:9px!important}
  .collection-folder-card{padding:12px 13px!important;min-height:68px!important;gap:12px!important}
  .collection-folder-card .folder-icon{width:42px!important;height:42px!important;flex:0 0 42px!important}
  .collection-folder-card .folder-copy strong{font-size:15px!important}
  .collection-folder-card .folder-copy small{font-size:10px!important}

  /* Dashboard/header controls must never push outside viewport. */
  .neo-topbar{max-width:100vw!important;overflow:hidden!important}
  .neo-topbar .plan-mini{max-width:110px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  .neo-topbar .drawer-main-trigger{flex:0 0 auto!important}
}

@media(max-width:420px){
  .site-header .brand-name-text{max-width:135px!important}
  .collection-stats .stat-icon{display:none!important}
  .collection-stats article{justify-content:center!important;text-align:center!important}
}


/* Enterprise V5.2.1 — hamburger/touch ownership fix only. */
html.menu-overlay-open{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.menu-scroll-lock{
  position:fixed!important;
  overflow:hidden!important;
  overscroll-behavior:none!important;
  touch-action:none!important;
}

/* The opened menu is the only vertical scroll surface. */
.public-mobile-menu,
.user-drawer{
  overscroll-behavior-y:contain!important;
  -webkit-overflow-scrolling:touch!important;
  touch-action:pan-y!important;
  scrollbar-gutter:stable;
}

@media(max-width:760px){
  .public-mobile-menu{
    overflow-x:hidden!important;
    overflow-y:auto!important;
    max-height:calc(100dvh - 84px)!important;
    contain:layout paint!important;
    pointer-events:auto!important;
  }
  .public-mobile-menu[hidden]{display:none!important}

  .user-drawer{
    top:0!important;
    bottom:0!important;
    height:100dvh!important;
    max-height:100dvh!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    pointer-events:none!important;
  }
  .user-drawer.open{pointer-events:auto!important}
  .user-drawer-backdrop.open{
    pointer-events:auto!important;
    touch-action:none!important;
  }

  .mobile-nav-toggle,
  [data-user-drawer-toggle],
  [data-public-menu-toggle],
  [data-user-drawer-close]{
    touch-action:manipulation!important;
    -webkit-tap-highlight-color:transparent;
  }
}

/* Enterprise V5.2.2 — persistent hamburger integrity. */
@media(max-width:760px){
  .site-header.nav-integrity-header{
    position:sticky!important;
    top:0!important;
    z-index:4500!important;
  }
  .neo-topbar.dashboard-header-clean{
    position:sticky!important;
    top:0!important;
    z-index:4500!important;
  }
  .mobile-nav-toggle,
  .drawer-main-trigger,
  .global-hamburger-fallback{
    display:inline-grid!important;
    place-items:center!important;
    visibility:visible!important;
    opacity:1!important;
    pointer-events:auto!important;
  }
  .global-hamburger-fallback{
    position:fixed!important;
    right:14px!important;
    top:calc(env(safe-area-inset-top, 0px) + 14px)!important;
    z-index:4600!important;
    width:46px!important;
    height:46px!important;
    padding:0!important;
    margin:0!important;
    border:1px solid #263448!important;
    border-radius:14px!important;
    background:#0b121c!important;
    color:#d9e2ef!important;
    box-shadow:0 8px 30px rgba(0,0,0,.28)!important;
    touch-action:manipulation!important;
  }
  .user-drawer{
    z-index:5200!important;
  }
  .user-drawer-backdrop{
    z-index:5100!important;
  }
  .public-mobile-menu{
    z-index:5200!important;
  }
}
