/* One set of device insets for browser tabs and installed standalone windows. */
:root{--app-safe-top:env(safe-area-inset-top,0px);--app-safe-right:env(safe-area-inset-right,0px);--app-safe-bottom:env(safe-area-inset-bottom,0px);--app-safe-left:env(safe-area-inset-left,0px)}
html{scroll-padding-top:calc(var(--app-safe-top) + 12px)}
html body.workbench-design{padding-top:var(--app-safe-top)}
html body.workbench-design .app-layout{min-width:0}
/* Full-screen sheets do not inherit the body's top padding. */
@media(max-width:600px){
 html body.workbench-design{padding-left:max(12px,var(--app-safe-left));padding-right:max(12px,var(--app-safe-right));padding-bottom:calc(var(--mobile-nav-height,76px) + 16px)}
 html body.workbench-design .app-layout>header{min-height:76px;padding:12px 0!important}
 html body.workbench-design .app-layout>header{grid-template-columns:minmax(0,1fr) 48px!important}
 html body.workbench-design .app-layout>header .header-brand{gap:10px!important}
 html body.workbench-design .app-layout>header .header-brand .logo-box{width:38px!important;height:38px!important;min-width:38px!important;flex-basis:38px!important}
 html body.workbench-design .app-layout>header #brand-typewriter-text{font-size:20px!important;line-height:27px!important}
 html body.workbench-design .app-layout>header #brand-typewriter-wrap{min-height:28px!important}
 html body.workbench-design .app-layout>header .verified-tick-badge{width:17px;height:17px;flex-shrink:0}
 html body.workbench-design .app-layout>header #btn-open-noti{width:48px;min-width:48px;height:48px;min-height:48px;padding:10px}
 html body.workbench-design .app-layout>header #noti-bell-icon{font-size:22px;line-height:1}
 html body.workbench-design #analytics-modal.analytics-page{padding-bottom:0;min-height:calc(100dvh - var(--app-safe-top) - var(--mobile-nav-height,76px))}
 #analytics-modal.analytics-page .analytics-header{align-items:center;column-gap:10px}
 #analytics-modal.analytics-page .analytics-title-group{flex:1 1 150px;min-width:0}
 #analytics-modal.analytics-page .analytics-title-main{font-size:clamp(20px,5.8vw,24px);line-height:1.3;overflow-wrap:anywhere}
 #analytics-modal.analytics-page .analytics-title-sub{overflow-wrap:anywhere}
 #analytics-modal.analytics-page .analytics-tab-bar>div{min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-inline:contain}
 #option-menu-dropdown .option-menu-header{padding:calc(var(--app-safe-top) + 14px) max(16px,var(--app-safe-right)) 12px max(16px,var(--app-safe-left));min-height:0;flex-shrink:0}
 body .members-dialog.members-workspace>header{padding:calc(var(--app-safe-top) + 12px) max(16px,var(--app-safe-right)) 12px max(16px,var(--app-safe-left))}
 body .copy-history-dialog.copy-history-screen>header{padding-top:calc(var(--app-safe-top) + 12px)}
 #analytics-detail-dialog .analytics-section-header{padding-top:calc(var(--app-safe-top) + 12px)}
 body .mobile-bottom-nav{box-sizing:border-box;padding:6px max(12px,var(--app-safe-right)) calc(7px + var(--app-safe-bottom)) max(12px,var(--app-safe-left))}
 body .mobile-bottom-nav nav button{min-width:0;min-height:48px}
 #internal-auth-gate{padding-top:calc(var(--app-safe-top) + 12px)!important;padding-bottom:calc(var(--app-safe-bottom) + 16px)!important}
 #wb-detail{padding-top:var(--app-safe-top)}
 .wb-detail-body{padding-bottom:calc(var(--app-safe-bottom) + 24px)}
 body .modal-overlay:not(.analytics-page){padding-top:calc(var(--app-safe-top) + 12px);padding-bottom:calc(var(--app-safe-bottom) + 12px);box-sizing:border-box}
 body .modal-overlay .modal-card:not(.modal-card-analytics){max-height:calc(var(--mobile-viewport-height,100dvh) - var(--app-safe-top) - var(--app-safe-bottom) - 24px);box-sizing:border-box}
 body .modal-overlay:has(>.wb-add-card){padding:0}
 body .modal-overlay>.wb-add-card{height:var(--mobile-viewport-height,100dvh);max-height:var(--mobile-viewport-height,100dvh);padding-top:calc(var(--app-safe-top) + 16px);padding-bottom:calc(var(--app-safe-bottom) + 20px);box-sizing:border-box}
 .members-delete-dialog{max-height:calc(var(--delete-viewport-height,100dvh) - var(--app-safe-top) - var(--app-safe-bottom) - 24px)}
}
/* Landscape phones/tablets can expose a notch on the left or right. */
@media(min-width:601px) and (max-width:1100px){
 html body.workbench-design{padding-left:max(18px,var(--app-safe-left));padding-right:max(18px,var(--app-safe-right))}
 .dashboard-sidebar{padding-top:calc(var(--app-safe-top) + 22px)}
}

/* Lock only the document; the active panel retains native momentum scrolling. */
html.mobile-overlay-scroll-locked{overflow:hidden!important;overscroll-behavior:none}
@media(max-width:600px){
 #option-menu-dropdown.show{overscroll-behavior:none}
 #option-menu-dropdown.show>.option-menu-header,#option-menu-dropdown.show>.settings-page-intro{flex-shrink:0}
 #option-menu-dropdown.settings-workspace .option-menu-list{flex:1 1 0%;min-height:0;max-height:none;overflow-y:auto!important;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-padding-block:14px;grid-auto-rows:max-content}
}
@media(max-width:850px){
 .members-dialog>.members-body,.wb-detail-body,.copy-history-dialog,.account-reports-dialog,.rank-lock-dialog,.members-delete-dialog{overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch}
 .members-workspace>.members-body,.wb-detail-body{min-height:0}
}