/* Focused mobile forms use the visual viewport, including a keyboard overlay.
   The real controls, validation and submit handlers keep ownership of all data. */
@media(max-width:700px), (max-width:1000px) and (max-height:600px){
 body.mobile-shell form label>input:not([type=checkbox]):not([type=radio]):not([type=file]),
 body.mobile-shell form label>textarea,body.mobile-shell form label>select{width:100%}
 body.mobile-shell .two-columns>.stack{align-items:stretch}
 body.mobile-shell .stack>.panel{width:100%;max-width:100%}
 body.mobile-shell #main .button{min-height:44px}
 body.mobile-shell .question-editor .choice-edit-row{grid-template-columns:24px minmax(0,1fr) 84px}
 body.mobile-shell .choice-edit-row>.inline-check{min-width:0;gap:5px;font-size:13px;white-space:normal}
 body.mobile-shell .sidebar{display:none}
 body.mobile-shell .shell{margin-left:0}
 body.mobile-shell .mobile-brand{display:block}
 body.mobile-shell .breadcrumb{display:none}
 body.mobile-shell .topbar{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 body.mobile-shell #main{padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
 body.mobile-shell .mobile-tabbar{padding-left:max(6px,env(safe-area-inset-left));padding-right:max(6px,env(safe-area-inset-right))}
 body.mobile-shell dialog{max-height:calc(var(--form-visible-height,100dvh) - 20px);overflow-y:auto;overscroll-behavior-y:contain}
 body.mobile-shell dialog:not(.mobile-sheet){max-width:calc(100vw - 24px)}
 body.mobile-shell .mobile-sheet{max-height:calc(var(--form-visible-height,100dvh) - 12px)}
 body.mobile-shell .mobile-sheet-head{padding-block:8px}
 body.mobile-shell .mobile-sheet-body{scrollbar-gutter:stable}
 body.mobile-shell .dialog-actions{padding-bottom:env(safe-area-inset-bottom,0px)}
 html:has(body.mobile-shell.question-workspace){--question-read-top:0px!important}
 html:has(body.mobile-shell.theory-reader){--reader-header-height:0px!important}
 body.mobile-shell.question-workspace .topbar,body.mobile-shell.theory-reader .topbar{position:static}
 /* Browsers can resize the layout, just its visual viewport, or pan it above the keyboard. */
 html:has(body.mobile-form-editing){scroll-padding-top:12px;scroll-padding-bottom:calc(var(--form-tools-height,64px) + var(--form-keyboard-inset,0px) + 24px)}
 body.mobile-form-editing .topbar{position:static!important}
 body.mobile-form-editing .mobile-tabbar,body.mobile-form-editing .layout-back-top,
 body.mobile-form-editing .question-dock,body.mobile-form-editing .mobile-tech-bar{display:none!important}
 body.mobile-form-editing #main{padding-bottom:calc(var(--form-tools-height,64px) + var(--form-keyboard-inset,0px) + 40px)!important}
 body.mobile-form-editing .shell{padding-bottom:0}
 body.mobile-form-editing input,body.mobile-form-editing textarea{scroll-margin-block:16px}
 body.mobile-form-editing textarea{min-height:84px;max-height:max(96px,calc(var(--form-visible-height,100dvh) - 120px))}
 body.mobile-form-editing .mobile-editing-dialog{
  position:fixed;inset:calc(var(--form-visible-top,0px) + 8px) 0 auto;margin:0 auto;
  max-height:calc(var(--form-visible-height,100dvh) - 16px);
  padding-bottom:calc(var(--form-tools-height,64px) + 24px);
  scroll-padding-block:16px calc(var(--form-tools-height,64px) + 20px);
 }
 .mobile-form-tools{
  box-sizing:border-box;position:fixed;z-index:110;transform:translateY(-100%);
  display:grid;grid-template-columns:44px 44px minmax(0,1fr);gap:6px;padding:6px;
  border:1px solid var(--line);border-radius:8px;background:var(--white,#fff);
  box-shadow:0 -3px 14px #142b261a;
 }
 .mobile-form-tools.has-submit{grid-template-columns:44px 44px minmax(84px,1fr) minmax(70px,1.3fr)}
 body.mobile-shell .mobile-form-tools .button{min-width:0;min-height:44px;margin:0;padding:7px 5px;font-size:13px;line-height:1.35;overflow-wrap:break-word}
 .mobile-form-tools .form-previous,.mobile-form-tools .form-next{font-size:20px!important}
 .mobile-form-tools [hidden]{display:none!important}
}
@media(min-width:701px) and (max-width:1000px) and (max-height:600px){
 body.mobile-shell #main{padding-top:12px}
 body.mobile-shell .page-heading{margin-bottom:12px}
 body.mobile-shell .topbar{min-height:50px}
 body.mobile-shell .subject-options{grid-template-columns:repeat(4,minmax(0,1fr))}
 body.mobile-shell .author-filter,body.mobile-shell .setup-form>.field-grid,
 body.mobile-shell .technical-form,body.mobile-shell .series-form,
 body.mobile-shell .revision-form{grid-template-columns:repeat(2,minmax(0,1fr))}
 body.mobile-shell .mobile-sheet-body section nav{grid-template-columns:repeat(3,minmax(0,1fr))}
 body.mobile-shell .mobile-tabbar>a,body.mobile-shell .mobile-tabbar>button{min-height:48px;flex-direction:row;gap:7px;font-size:12px}
 body.mobile-shell .two-columns{grid-template-columns:minmax(0,1fr)}
 body.mobile-shell .source-edit-row{grid-template-columns:minmax(0,1fr)}
}
@media(orientation:landscape) and (max-width:1000px) and (max-height:600px){
 body.mobile-shell.question-workspace .question-dock{
  left:max(8px,env(safe-area-inset-left));right:max(8px,env(safe-area-inset-right));
  bottom:calc(var(--question-nav-height,58px) + 6px);display:flex;flex-wrap:nowrap;gap:6px;padding:7px;
 }
 body.mobile-shell.question-workspace .question-dock>.button{flex:0 1 auto;min-height:44px;min-width:70px}
 body.mobile-shell .question-dock-tools{flex:1;order:0;gap:6px}
 body.mobile-shell .question-dock-tools>.button{flex:1;min-width:0;min-height:44px;padding:7px 4px}
 body.mobile-shell.question-workspace .session-top,body.mobile-shell.question-workspace .series-progress{top:0}
 body.mobile-shell.theory-reader .theory-reader-bar{top:0}
}
@media print{.mobile-form-tools{display:none!important}}
