/* Shared handheld layout: a single viewport and modal contract for every module. */
@media screen and (max-width:767px),screen and (max-width:980px) and (max-height:500px) and (pointer:coarse){
 :root{--mobile-left:max(8px,env(safe-area-inset-left,0px));--mobile-right:max(8px,env(safe-area-inset-right,0px));--mobile-top:max(8px,env(safe-area-inset-top,0px));--mobile-bottom:max(8px,env(safe-area-inset-bottom,0px))}
 .workspace,.topbar>.actions,.top-actions,main,.panel-body,.form-grid>*,.document-grid>*,.line-card>*{min-width:0}
 .topbar>.actions{flex:1 1 100px;min-width:100px}.topbar .crumb{overflow-wrap:anywhere}.top-actions{flex-wrap:wrap;flex-shrink:0}
 .topbar .language-picker select{width:110px;inline-size:110px}
 main{padding-left:max(var(--space-4),env(safe-area-inset-left,0px));padding-right:max(var(--space-4),env(safe-area-inset-right,0px));padding-bottom:calc(var(--mobile-nav-height,110px) + 84px);scroll-margin-top:100px}
 .bottom-nav{padding-left:max(var(--space-1),env(safe-area-inset-left,0px));padding-right:max(var(--space-1),env(safe-area-inset-right,0px))}
 .bottom-nav button span{overflow-wrap:anywhere;min-width:0}
 .mobile-quick{bottom:calc(var(--mobile-nav-height,84px) + 12px)}
 .appearance-footer{bottom:calc(var(--mobile-nav-height,84px) + 84px)}
 #toast{bottom:calc(var(--mobile-nav-height,84px) + 12px);max-width:calc(100vw - 24px);overflow-wrap:anywhere}
 :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){font-size:max(16px,1rem);min-width:0;max-width:100%;min-height:44px}
 input[type=date],input[type=month],input[type=datetime-local]{min-inline-size:0;max-inline-size:100%;inline-size:100%;appearance:none;-webkit-appearance:none}
 input::-webkit-date-and-time-value{min-width:0;text-align:left}
 select{inline-size:100%;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis}
 button,.button{min-height:44px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .actions,.toolbar,.panel-head,.step{min-width:0;flex-wrap:wrap}
 .actions>*,.toolbar>*,.step>*{min-width:0;max-width:100%}
 .table-wrap{max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain}
 fieldset{min-inline-size:0;max-width:100%}
 details:not([open])>:not(summary){display:none}
 .auth{padding-top:env(safe-area-inset-top,0px);padding-left:env(safe-area-inset-left,0px);padding-right:env(safe-area-inset-right,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
 .offline-page main{padding-top:calc(var(--space-6) + env(safe-area-inset-top,0px))}
 h1,h2,h3,dd,.hash,.document-top,.workbench-head{overflow-wrap:anywhere}
 :is(#modal,#pwa-install-help)[open]{position:fixed;inset:auto;top:calc(var(--mobile-viewport-top,0px) + var(--mobile-top));left:var(--mobile-left);right:var(--mobile-right);margin:0;width:calc(var(--mobile-viewport-width,100vw) - var(--mobile-left) - var(--mobile-right));max-width:calc(var(--mobile-viewport-width,100vw) - var(--mobile-left) - var(--mobile-right));height:auto;max-height:calc(var(--mobile-viewport-height,100dvh) - var(--mobile-top) - var(--mobile-bottom));display:flex;flex-direction:column;overflow:hidden}
 :is(#modal,#pwa-install-help):is(.document-preview-dialog,.document-workbench-dialog)[open]{height:calc(var(--mobile-viewport-height,100dvh) - var(--mobile-top) - var(--mobile-bottom))}
 :is(#modal,#pwa-install-help) .dialog-head{flex:0 0 auto;min-width:0;gap:var(--space-2);padding:var(--space-3);background:var(--paper)}
 :is(#modal,#pwa-install-help) .dialog-head h2{min-width:0;font-size:clamp(1.15rem,5vw,1.5rem);line-height:1.25;overflow-wrap:anywhere}
 :is(#modal,#pwa-install-help) .dialog-head :is([data-close],#pwa-help-close){flex:0 0 44px;width:44px;min-height:44px}
 :is(#modal,#pwa-install-help) .dialog-body{flex:1 1 auto;min-width:0;min-height:0;width:100%;max-width:100%;height:auto;overflow:auto;overflow-wrap:anywhere;overscroll-behavior:contain;padding:var(--space-3)}
 :is(#modal,#pwa-install-help) .dialog-body>*,:is(#modal,#pwa-install-help) form{min-width:0;max-width:100%}
 :is(#modal,#pwa-install-help) .form-grid{min-width:0;max-width:100%;grid-template-columns:minmax(0,1fr)}
 :is(#modal,#pwa-install-help) .form-grid>*{min-width:0;max-width:100%}
 :is(#modal,#pwa-install-help) .form-grid>label:has(>select){overflow:hidden}
 :is(#modal,#pwa-install-help) .form-grid>label>select:focus-visible{outline-offset:-3px}
 :is(#modal,#pwa-install-help).document-workbench-dialog .dialog-body{padding:0}
 :is(#modal,#pwa-install-help) .document-review-workbench,:is(#modal,#pwa-install-help) .workbench-split{display:block;height:auto;min-height:0}
 :is(#modal,#pwa-install-help) .document-workbench-review{overflow:visible}
 :is(#modal,#pwa-install-help) .document-file-viewer{height:auto;display:block}
 :is(#modal,#pwa-install-help) .document-viewer-stage{min-height:0;overflow:visible}
 :is(#modal,#pwa-install-help) .dialog-body :is(input,select,textarea,button,a){scroll-margin-block:16px}
 body:has(:is(#modal,#pwa-install-help)[open]){overflow:hidden}
 .security-lock-screen[open]{top:var(--mobile-viewport-top,0px);height:var(--mobile-viewport-height,100dvh);max-height:var(--mobile-viewport-height,100dvh);padding:var(--mobile-top) var(--mobile-right) var(--mobile-bottom) var(--mobile-left);overflow:auto;place-items:start center}
}

