/* V21: persistent compact desktop rail. No changes to academic sections.
   Full-width mobile drawer remains controlled by updates-v16.js. */
@media screen and (min-width:881px){
 #sidebar{scrollbar-width:thin;scrollbar-color:#7195b5 transparent;overscroll-behavior-y:contain}
 body.sidebar-closed #sidebar{
   display:block!important;position:sticky!important;top:0!important;
   width:70px!important;min-width:70px!important;max-width:70px!important;
   flex:0 0 70px!important;height:100vh!important;
   padding:14px 0 22px!important;box-sizing:border-box;
   overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;
 }
 body.sidebar-closed #sidebar .sidebar-tools{
   height:42px;margin:0 auto 7px;padding:0;
   display:flex;justify-content:center;align-items:center;
 }
 body.sidebar-closed #sidebar .sidebar-toggle{width:42px;min-width:42px;height:42px;max-width:42px;flex:0 0 42px;}
 body.sidebar-closed #sidebar .brand{
   margin:0 0 5px;padding:0 5px 12px!important;
   display:flex;justify-content:center;align-items:center;
   min-height:58px;box-sizing:border-box;
 }
 body.sidebar-closed #sidebar .sidebar-logo{
   display:block!important;flex:none;width:48px!important;height:48px!important;
   max-width:48px!important;object-fit:contain;margin:0!important;
 }
 body.sidebar-closed #sidebar .brand h1,
 body.sidebar-closed #sidebar .sidebar-affiliation{display:none!important;}
 body.sidebar-closed #sidebar #navlinks{
   display:flex!important;flex-direction:column;align-items:stretch;
   padding:4px 7px 30px!important;min-width:0;
 }
 body.sidebar-closed #sidebar #navlinks .v18-navhead,
 body.sidebar-closed #sidebar #navlinks .v20-navhead{
   margin:9px 5px 6px!important;padding:0!important;
   height:0!important;line-height:0!important;overflow:hidden;
   font-size:0!important;border-top:1px solid #ffffff29;
 }
 body.sidebar-closed #sidebar #navlinks a{
   box-sizing:border-box!important;display:flex!important;align-items:center!important;
   justify-content:center!important;position:relative;
   width:54px!important;min-width:0!important;max-width:54px!important;
   min-height:43px!important;height:43px!important;
   margin:2px 0!important;padding:0!important;border:0!important;border-radius:9px!important;
   font-size:0!important;line-height:0!important;white-space:nowrap!important;
 }
 body.sidebar-closed #sidebar #navlinks a>*{display:none!important;}
 body.sidebar-closed #sidebar #navlinks a::before{
   content:attr(data-v21-rail);display:flex;align-items:center;justify-content:center;
   width:37px;height:33px;margin:0;line-height:1!important;
   font:700 12px/1 'Segoe UI',Arial,sans-serif!important;
   letter-spacing:0;color:#e8f3ff;background:#ffffff16;
   border-radius:7px;box-sizing:border-box;
 }
 body.sidebar-closed #sidebar #navlinks a.active::before{background:#ffffff20;color:#fff;}
 body.sidebar-closed #sidebar #navlinks a:hover::before{background:#ffffff36;}
 body.sidebar-closed #topbar{padding-left:34px!important;}
}
@media print{body.sidebar-closed #sidebar{display:none!important}}

/* V22: the persistent nav owns its scroll position; prevent scroll anchoring. */
#sidebar,#navlinks{overflow-anchor:none}
