/* GarageForge 8.14 mobile shell cleanup */
.gf814-menu{display:none}
@media(max-width:900px){
 body.gf814-mobile-open{overflow:hidden}
 .gf814-menu{display:inline-flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;font-size:22px}
 .shell>aside{position:fixed!important;inset:0 auto 0 0;z-index:1000;width:min(86vw,340px)!important;max-width:340px;transform:translateX(-105%);transition:transform .18s ease;overflow-y:auto;box-shadow:0 0 30px rgba(0,0,0,.45)}
 body.gf814-mobile-open .shell>aside{transform:translateX(0)}
 .shell>main{width:100%!important;min-width:0;margin-left:0!important}
 main>header{position:sticky;top:0;z-index:900;gap:8px;padding:10px 12px}
 .head-actions{min-width:0;flex-wrap:wrap;justify-content:flex-end}
 .head-actions select{max-width:44vw}
 #content{min-width:0;padding:12px!important}
 .grid2,.grid3,.cards{grid-template-columns:1fr!important}
 .tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch}
 dialog{max-width:96vw!important}
}

/* GarageForge 8.14 — retire legacy 8.13.2 mobile navigation shell.
   Mobile Capture/offline functionality remains available; 8.14 owns navigation. */
@media(max-width:900px){
  .gf-mobile-menu-toggle,
  .gf-mobile-drawer,
  .gf-mobile-backdrop{
    display:none!important;
  }

  /* 8.13.2 reserved 62–72px for its fixed hamburger.
     8.14's menu button now lives inside the application header. */
  .shell main>header{
    padding-left:12px!important;
  }
}

/* GarageForge 8.14 — restore canonical application sidebar on mobile.
   8.13.2 hid this sidebar because it used a separate generated drawer. */
@media(max-width:900px){
  .shell>aside:not(.gf-mobile-drawer){
    display:block!important;
  }
}

/* GarageForge 8.14 — canonical mobile drawer layout */
@media(max-width:900px){

  /* Drawer itself */
  .shell>aside:not(.gf-mobile-drawer){
    display:grid!important;
    grid-template-rows:auto auto minmax(0,1fr) auto!important;
    width:min(86vw,340px)!important;
    min-width:0!important;
    max-width:340px!important;
    height:100dvh!important;
    padding:12px!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }

  /* Restore branding inside the real drawer. */
  .shell>aside:not(.gf-mobile-drawer)>.brand{
    display:flex!important;
    width:100%!important;
    min-width:0!important;
  }

  /* Workspace/category selector */
  .shell>aside:not(.gf-mobile-drawer) .gf813-navgroups{
    display:flex!important;
    flex-wrap:wrap!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    overflow:visible!important;
    gap:6px!important;
  }

  .shell>aside:not(.gf-mobile-drawer) .gf813-navgroups>.gf813-navgroup{
    flex:0 0 auto!important;
    width:auto!important;
    min-width:0!important;
    max-width:100%!important;
  }

  /* Main navigation is one vertical scrolling column. */
  .shell>aside:not(.gf-mobile-drawer)>nav,
  .shell>aside:not(.gf-mobile-drawer)>nav.gf8133-scroll-menu{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    height:auto!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    padding:6px 4px 18px!important;
    box-sizing:border-box!important;
    scrollbar-gutter:stable;
  }

  .shell>aside:not(.gf-mobile-drawer) .gf813-nav-group,
  .shell>aside:not(.gf-mobile-drawer) .gf813-group-items{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }

  .shell>aside:not(.gf-mobile-drawer) .gf813-nav-group .nav,
  .shell>aside:not(.gf-mobile-drawer)>nav .nav{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:4px 0!important;
    box-sizing:border-box!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
  }

  /* Sidebar action controls stay inside drawer width. */
  .shell>aside:not(.gf-mobile-drawer) .gf8133-nav-actions{
    position:static!important;
    display:flex!important;
    flex-wrap:wrap!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    padding:4px 0!important;
  }

  /* Restore normal footer as a vertical stack. */
  .shell>aside:not(.gf-mobile-drawer)>.aside-foot{
    display:grid!important;
    grid-template-columns:1fr!important;
    position:static!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    gap:6px!important;
    padding-top:8px!important;
    box-sizing:border-box!important;
  }

  .shell>aside:not(.gf-mobile-drawer)>.aside-foot>a,
  .shell>aside:not(.gf-mobile-drawer)>.aside-foot>button{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}

/* GarageForge 8.14 mobile drawer close control */
@media(max-width:900px){
  .gf814-menu-close{
    display:flex!important;
    align-items:center;
    justify-content:center;
    position:absolute!important;
    top:10px;
    right:10px;
    z-index:2;
    width:40px!important;
    min-width:40px!important;
    height:40px!important;
    padding:0!important;
    font-size:28px!important;
    line-height:1!important;
  }

  .shell>aside:not(.gf-mobile-drawer){
    position:fixed!important;
  }

  .shell>aside:not(.gf-mobile-drawer)>.brand{
    padding-right:48px!important;
  }
}

@media(min-width:901px){
  .gf814-menu-close{
    display:none!important;
  }
}
