/* Reserve the browser scrollbar before account overlays lock page scrolling. */
html:has(#ssh-header){scrollbar-gutter:stable}
@supports(scrollbar-gutter:stable){html body:has(.cl-modalBackdrop){padding-right:0!important}}

/* Clerk's loading shell and loaded profile use one stable, scrollable frame. */
html:root:root body .cl-modalBackdrop:has(.ssh-profile){align-items:flex-start!important}
html:root:root body .cl-modalContent:has(.ssh-profile){height:auto!important;margin:24px auto!important;animation:none!important;transform:none!important}
html:root:root body .ssh-profile{height:min(600px,calc(100dvh - 48px))!important;min-height:0!important;animation:none!important;transform:none!important}
html:root:root body .ssh-profile-card{height:100%!important;min-height:0!important;max-height:none!important;animation:none!important}
html:root:root body .ssh-profile-card>.cl-main{min-height:0!important;overflow:hidden!important}
html:root:root body .ssh-profile-scroll{height:100%!important;min-height:0!important;max-height:100%!important;box-sizing:border-box!important;scrollbar-gutter:stable;overflow-y:auto!important}

/* Loading messages occupy the content area instead of pushing the collection. */
html:root:root:root:root body.ssh-library-route .ssm-main{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto minmax(240px,auto);align-content:start;min-height:640px}
html:root:root:root:root body.ssh-library-route .ssm-hero{grid-row:1;grid-column:1;min-height:228px}
html:root:root:root:root body.ssh-library-route .ssm-stats{grid-row:2;grid-column:1}
html:root:root:root:root body.ssh-library-route .ssm-stats strong{font-variant-numeric:tabular-nums;min-height:34px;line-height:34px}
html:root:root:root:root body.ssh-library-route :is(.ssh-library-body,.ssm-membership,.ssh-library-status){grid-row:3;grid-column:1;align-self:start}
html:root:root:root:root body.ssh-library-route .ssh-library-status{margin:0;padding:16px 0;z-index:1}
html:root:root:root:root body.ssh-library-route .ssm-sidebar nav button:not(:has(svg))::before{content:'';width:18px;height:18px;flex:0 0 18px}
@media(max-width:640px){
 html:root:root body .cl-modalContent:has(.ssh-profile){margin:12px auto!important}
 html:root:root body .ssh-profile{height:calc(100dvh - 24px)!important}
 html:root:root:root:root body.ssh-library-route .ssm-hero{min-height:244px}
}
