/* Popup backdrops always cover navigation; retain each popup's own layout. */
[data-site-popup]:not(dialog){z-index:5000!important}
dialog::backdrop{background:#131a13bf!important}
html.site-popup-open,html.site-popup-open body{background-color:#4d524c!important}
html.site-popup-open body::before{background:#4d524c!important}
/* Safari samples several pixels inside the viewport and ignores thin borders.
   Keep this opaque edge taller than 10px, within the sheet's existing top gap.
   Do not paint a separate edge on ordinary pages or over the launch animation. */
#sitePopupStatusArea{display:none;position:fixed;inset:0 0 auto;height:calc(env(safe-area-inset-top,0px) + 12px);background:#4d524c;pointer-events:none;z-index:2147483647}
html.site-popup-open #sitePopupStatusArea{display:block}
html:not([data-launch-seen]):has(#portalLaunch) #sitePopupStatusArea{display:none}
[data-popup-dismiss-icon]{display:none!important}
.site-popup-handle{display:flex!important;align-items:center;justify-content:center;flex:0 0 36px;width:100%!important;height:36px;min-height:36px;padding:4px!important;margin:0 0 12px;border:0!important;outline-offset:-2px;border-radius:0!important;background:transparent!important;box-shadow:none!important;color:#8a9285;cursor:grab;touch-action:none}
.site-popup-handle svg{width:38px;height:16px;pointer-events:none}
@media(max-width:640px){
 [data-site-popup]:is(.modal-cover,.chooser-cover){align-items:end;place-items:end center;padding:0!important}
 [data-popup-panel]:not(.pc-create-options){max-height:calc(100dvh - env(safe-area-inset-top,0px) - 12px)!important;box-sizing:border-box;border-radius:24px 24px 0 0;overflow-y:auto;overscroll-behavior-y:contain}
 dialog[data-popup-panel]{position:fixed;inset:auto 0 0;margin:0 auto!important;width:100%!important;max-width:none!important;padding-bottom:max(24px,env(safe-area-inset-bottom,0px))}
}

/* Audit guidance uses the same tall sheet as the audit editor. */
dialog.audit-help-dialog{height:calc(100dvh - env(safe-area-inset-top,0px) - 12px);max-height:calc(100dvh - env(safe-area-inset-top,0px) - 12px);box-sizing:border-box;border:0;background:#fffef9;outline:none}
dialog.audit-help-dialog[open]{display:flex;flex-direction:column}
dialog.audit-help-dialog .audit-help-header{flex:0 0 auto;border:0;box-shadow:none;background:transparent}
dialog.audit-help-dialog .audit-help-body{flex:1;min-height:0;max-height:none;overflow-y:auto;overscroll-behavior:contain}
dialog.audit-help-dialog>.site-popup-handle{flex-shrink:0}
/* Keep typing fields neutral when selected, including native mobile focus. */
html body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=button]):not([type=submit]),textarea,select,[contenteditable=true]):is(:focus,:focus-visible){outline:none!important;box-shadow:none!important;border-color:#dce1d7!important;-webkit-tap-highlight-color:transparent}

/* The handle receives dialog autofocus: never paint a full-width focus frame. */
.site-popup-handle:is(:focus,:focus-visible,:active){outline:none!important;border:0!important;box-shadow:none!important}
dialog.audit-help-dialog{overflow:hidden!important;will-change:transform}
dialog.audit-help-dialog .audit-help-header{user-select:none;touch-action:pan-x}
dialog.audit-help-dialog .audit-help-body{overscroll-behavior-y:contain}
