/* Toolisco — Tools menu reachability (header mega-menu + mobile drawer accordion).
   Layered on top of app.bundle.css; only affects the Tools menu and the drawer's Tools group. */

/* Desktop: anchor the Tools mega-menu to the header (not the narrow "Tools" item) so it is
   always centred on screen, and cap its height to the viewport with an internal scroll area. */
.nav-primary>li[data-mega="tools"]{position:static}
.nav-primary>li[data-mega="tools"]>.mega{
  top:calc(100% + 4px);
  display:flex;flex-direction:column;
  max-height:calc(100vh - var(--header-h,64px) - 20px);
  max-height:calc(100dvh - var(--header-h,64px) - 20px);
  overflow:hidden;
}
.nav-primary>li[data-mega="tools"]>.mega::before{top:-16px;height:16px}
.mega-scroll{
  position:relative;flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;
  overscroll-behavior:contain;padding-right:6px;margin-right:-6px;
  scrollbar-width:thin;scrollbar-color:var(--border-strong) transparent;
}
.mega-scroll::-webkit-scrollbar{width:10px}
.mega-scroll::-webkit-scrollbar-track{background:transparent}
.mega-scroll::-webkit-scrollbar-thumb{background:var(--border-strong);border-radius:10px;border:2px solid var(--bg-elev)}
.mega-scroll::-webkit-scrollbar-thumb:hover{background:var(--text-mute)}
.mega-scroll:focus-visible{outline:2.5px solid var(--signal);outline-offset:2px;border-radius:var(--r-md)}
.nav-primary>li[data-mega="tools"] .mega-foot{flex:none;margin-top:var(--s-3);padding-top:var(--s-3)}
/* "More below" cue: sticks to the bottom of the scroll area while there is more to see. */
.mega-scroll-cue{
  position:sticky;bottom:0;display:none;justify-content:center;align-items:flex-end;
  height:44px;margin-top:-44px;pointer-events:none;
  background:linear-gradient(to bottom,transparent,var(--bg-elev) 78%);
}
.mega-scroll.has-more .mega-scroll-cue{display:flex}
.mega-scroll-cue span{
  display:inline-flex;align-items:center;gap:.35rem;font-size:var(--fs-xs);font-weight:600;
  color:var(--text-soft);background:var(--bg-sunken);border:1px solid var(--border);
  border-radius:var(--r-pill);padding:.15rem .6rem;margin-bottom:2px;
}
.mega-scroll-cue svg{width:14px;height:14px}
.nav-primary>li[data-mega="tools"] .mega-cat:focus-visible,
.nav-primary>li[data-mega="tools"] .mega-quick-item:focus-visible{outline:2.5px solid var(--signal);outline-offset:1px}

/* Mobile drawer: Tools row with an accordion of every category. */
.drawer-group{display:flex;flex-direction:column}
.drawer-row{display:flex;align-items:stretch;border-bottom:1px solid var(--border)}
.drawer-row .drawer-link{flex:1 1 auto;border-bottom:0;min-width:0}
.drawer-toggle{
  flex:none;display:inline-flex;align-items:center;gap:.35rem;background:none;border:0;
  color:var(--text-soft);font:inherit;font-size:var(--fs-sm);font-weight:600;padding:.5rem .6rem;
  border-radius:var(--r-md);cursor:pointer;min-height:44px
}
.drawer-toggle:hover{background:var(--bg-sunken);color:var(--text)}
.drawer-toggle:focus-visible{outline:2.5px solid var(--signal);outline-offset:-2px}
.drawer-toggle svg{width:16px;height:16px;transition:transform var(--t-fast) var(--ease)}
.drawer-toggle[aria-expanded="true"] svg{transform:rotate(180deg)}
.drawer-group .drawer-sub[hidden]{display:none}
.drawer-group .drawer-sub a{display:flex;align-items:center;justify-content:space-between;gap:.5rem;min-height:40px;overflow-wrap:anywhere}
.drawer-group .drawer-sub a:focus-visible{outline:2.5px solid var(--signal);outline-offset:-2px}
.drawer-sub .drawer-all{font-weight:600;color:var(--text)}
