/* Loaded last. Touch layouts keep each task in one usable pane. */
.mobile-mode-nav,.mobile-tabs{display:none}
[hidden]{display:none!important}
.touch-pages{display:none}
.touch-page-actions{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0}
.touch-pages img{display:block;width:100%;height:auto;background:white}
.reader-search{margin:0}.reader-search>summary{display:none}
.reader-options>summary{padding-block:10px}
@media(max-width:900px){
  html{height:100%;overflow-x:hidden}
  body{min-width:0!important;max-width:100%;font-size:15px;overflow-x:hidden}
  body>header{height:auto;min-height:0;padding:12px 16px;gap:10px;flex-wrap:wrap;flex-shrink:0}
  header h1{font-size:18px;margin-bottom:3px}
  header .brand{gap:9px}header .mark{width:36px;height:36px;font-size:28px;border-radius:9px}
  header .brand p{font-size:9px;letter-spacing:.8px}
  .header-actions{width:100%;display:flex;gap:8px;overflow-x:auto;white-space:nowrap;padding-bottom:2px;min-width:0}
  .header-actions>a,header>nav.actions>a{display:none}
  .header-actions button{flex:none}
  button,.button,.page-link,input,select,summary{min-height:44px}
  input,select,textarea{font-size:16px!important}label{font-size:13px}
  input[type=checkbox],input[type=radio]{min-height:0;min-width:0}
  button{touch-action:manipulation}
  .small{min-width:44px;min-height:44px}
  .mobile-mode-nav{display:flex;flex-shrink:0;gap:6px;overflow-x:auto;padding:8px 12px;background:#fff;border-bottom:1px solid #dce6e0;white-space:nowrap;scrollbar-width:none}
  .mobile-mode-nav a{flex:none;text-decoration:none;color:#537267;border-radius:8px;padding:11px 13px;min-height:44px;font-size:14px}
  .mobile-mode-nav a[aria-current=page]{background:#176b5c;color:white}
  .mobile-tabs{display:flex;gap:5px;flex-shrink:0;padding:8px 12px 0;background:#f3f5f7}
  .mobile-tabs button{flex:1;background:transparent;border-color:transparent;color:#73837c;border-radius:8px 8px 0 0}
  .mobile-tabs button[aria-selected=true]{background:#fff;border-color:#dce5df;border-bottom-color:#fff;color:#176b5c;font-weight:600}
  body.mobile-workspace{height:100dvh;overflow:hidden;display:flex;flex-direction:column}
  body.mobile-workspace>main{display:block;flex:1 1 0;height:auto;min-height:0;max-width:none;padding:8px 10px;overflow:hidden}
  body.mobile-workspace>main>.panel{height:100%;width:100%;margin:0;min-width:0;display:flex;flex-direction:column}
  body.mobile-workspace>main>.mobile-pane-inactive{display:none!important}
  body.mobile-workspace>footer{flex-shrink:0;display:block;padding:5px 12px max(7px,env(safe-area-inset-bottom));font-size:11px;max-height:60px;overflow:auto}
  body.mobile-workspace>footer>span:last-child:not(:first-child){display:none}
  .panel-heading{padding:12px 14px;align-items:center;flex-wrap:wrap}
  .panel-heading h2{font-size:16px}
  .pill{display:inline-block;font-size:11px}
  .library #files{flex:1;max-height:none;overflow:auto;scrollbar-gutter:auto}
  .library-note{display:none}
  .file{font-size:14px;min-height:52px;padding-block:14px}
  #categories{padding:8px}#categories button{font-size:14px;min-height:44px}
  .editor #source{min-height:100px;padding:14px;font:16px/1.6 Consolas,monospace;resize:none}
  .editor .image-editor{padding:8px 14px}.editor #image-list{max-height:90px}
  .image-actions{flex-wrap:wrap}
  .editor .toolbar{padding:8px;gap:6px;flex-wrap:wrap}
  .editor #status{padding:9px 12px;font-size:12px;max-height:90px}
  .editor-footer{max-height:70px}
  #delete-document,#rename-document{min-width:44px;min-height:44px}
  .preview .preview-controls{padding:10px 14px;gap:8px}
  .preview details{margin-bottom:8px;max-height:18%}
  .preview details>summary{padding:12px 0}
  .preview #drawing{margin:0 8px 8px;min-height:100px;scrollbar-gutter:auto;touch-action:pan-x pan-y pinch-zoom}
  .preview-note{display:none}
  #library-resizer{display:none}
  .review-loading{inset:0;padding:24px}
  .review-main .compact-review-header{height:auto;min-height:0;display:flex!important;flex-direction:column;align-items:stretch;gap:10px;padding:12px}
  .review-main .review-selection{display:flex!important;flex-direction:column!important;align-items:stretch;gap:8px}
  .review-main .review-selection>label{flex:auto!important;min-width:0!important;font-size:12px}
  .review-main .compact-review-header .panel-heading{padding:0;align-items:center;min-width:0}
  .review-main .compact-review-header .panel-heading>div{display:block;min-width:0}
  .review-main .compact-review-header #product-name{white-space:normal;font-size:13px;line-height:1.4}
  .review-main .compact-review-header .review-controls{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px;padding:0;align-self:auto}
  .review-main .table-toggles{flex-direction:row;gap:8px}
  .review-main .table-toggles .logo-toggle,.review-main .compact-review-header .logo-toggle{min-height:44px;height:auto;font-size:13px}
  .review-main .approval-actions{justify-content:space-between;gap:8px;align-self:auto}
  .review-main .approval-actions #approve{flex:1}
  .review-main .compact-review-header select{font-size:16px;min-height:44px}
  .review-main .pdf-pages{padding:0 0 54px;min-height:100px;overflow:auto;touch-action:pan-x pan-y pinch-zoom}
  .review-main .pdf-pages img{height:auto;object-fit:contain;min-height:0}
  .review-main .page-navigation{position:sticky;bottom:0;top:auto;right:auto;transform:none;width:100%;flex-direction:row;gap:18px;background:#f5f8f6ee;padding:6px;border-top:1px solid #dce5df;font-size:13px}
  .review-main .page-navigation button{width:64px;height:44px}
  .review-product>span:first-child{font-size:14px;white-space:normal;overflow-wrap:anywhere}
  .review-product{min-height:54px}
  .shell{margin:14px auto;padding:0 12px;width:100%;min-width:0}
  .shell .grid{grid-template-columns:minmax(0,1fr);gap:0}
  .shell .panel{min-width:0;padding:16px;margin-bottom:12px}
  .reader-search>summary{display:flex;align-items:center;min-height:44px;font-weight:600;color:#245640}
  .reader-search>h2{display:none}
  .form-grid{grid-template-columns:minmax(0,1fr)}
  .shell input,.shell select,.shell textarea{max-width:100%;width:100%}
  .table-wrap{max-width:100%;overscroll-behavior-x:contain}
  .account-actions button{min-height:44px}
  .photos img{max-width:100%;height:auto}
  .photos figure{max-width:100%}
  .touch-pages:not([hidden]){display:block}
  #pdf{display:none!important}
  .login{margin:6vh 14px;padding:24px;max-width:440px}
  .login .primary{width:100%}
  dialog{max-width:calc(100vw - 24px);max-height:85dvh;padding:18px!important}
  pre{max-width:100%;overflow-wrap:anywhere}
  .mobile-zoom-trigger{display:block;flex:none;margin:0 12px 8px;font-size:13px;padding:8px}
  .mobile-zoom-dialog{width:calc(100vw - 12px);height:calc(100dvh - 12px);max-height:none;padding:10px!important;border:1px solid #cadbd1;border-radius:10px;overflow:hidden}
  .mobile-zoom-dialog[open]{display:flex;flex-direction:column;gap:8px}
  .mobile-zoom-controls{display:flex;align-items:center;gap:8px;flex:none}.mobile-zoom-controls button{min-width:44px}
  .mobile-zoom-controls label{display:flex;align-items:center;gap:8px;flex:1}
  .mobile-zoom-controls input{width:100%;min-width:0}
  .mobile-zoom-content{flex:1;min-height:0;overflow:auto;touch-action:pan-x pan-y pinch-zoom;background:#fff}
  .mobile-zoom-sheet{width:100%;transform-origin:top left}
  .mobile-zoom-sheet img,.mobile-zoom-sheet svg{display:block;width:100%;height:auto;max-width:none}
  body.mobile-workspace.touch-typing>header,body.mobile-workspace.touch-typing>.mobile-mode-nav{display:none}
}
@media(min-width:901px){.mobile-zoom-trigger{display:none}}
