/* Shared phone tokens and behavior. Tablet / desktop remain Variant D. */
.mobile-settings-page{display:contents}
.mobile-drawer-close,.mobile-panel-launch,.mobile-work-launch,.mobile-note-tools,.mobile-secondary-actions{display:none}
.mobile-user-menu{display:contents}.mobile-user-menu>summary{display:contents;border:0;padding:0;min-height:0;cursor:default}.mobile-user-menu>.project-module-options{display:contents}.mobile-user-menu .connection-status{position:absolute;right:300px;top:23px}
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){
 :root{--mobile-gap:8px;--mobile-edge:8px;--mobile-hit:44px;--mobile-heading:19px;--mobile-radius:8px;--mobile-header-height:calc(72px + max(4px,env(safe-area-inset-top)))!important}
 html,body{max-width:100%;overscroll-behavior-x:none}body{font-size:14px}*,*::before,*::after{box-sizing:border-box}button,a,input,select,textarea,summary{touch-action:manipulation}button,.button,summary{min-height:44px}button{white-space:nowrap}input,select,textarea{font-size:16px!important;max-width:100%;min-width:0}input[type=number]{appearance:textfield}input[type=number]::-webkit-inner-spin-button{appearance:none}button:focus-visible,summary:focus-visible,a:focus-visible{outline:3px solid #2985dc;outline-offset:2px}
 /* The persistent shared header owns one grid. Labels never size its tracks. */
 .top{--phone-module-width:128px;--phone-avatar-width:44px;display:grid!important;grid-template-columns:var(--phone-module-width) minmax(0,1fr) var(--phone-avatar-width)!important;grid-template-rows:22px 44px!important;align-items:center;align-content:start;gap:2px 6px!important;height:var(--mobile-header-height)!important;min-height:var(--mobile-header-height)!important;max-height:var(--mobile-header-height)!important;padding:max(4px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left));position:sticky;top:0;z-index:30;box-sizing:border-box;flex:none!important;overflow-anchor:none}
 .top .top-project{display:contents!important}
 .top .brand{grid-column:1/-1;grid-row:1;font-size:15px!important;line-height:22px!important;letter-spacing:.5px;width:max-content;height:22px;min-height:0;margin:0!important;padding:0!important;white-space:nowrap}.top .brand span{margin-left:4px}
 .top #project-modules{grid-column:1;grid-row:2;width:var(--phone-module-width)!important}
 .top .project-selector-wrap{grid-column:2;grid-row:2;width:100%!important;min-width:0!important;height:44px}
 .top .project-module-menu{min-width:0!important;max-width:100%;margin:0;box-sizing:border-box}
 .top .header-project-menu{width:100%!important}
 .top #project-modules>summary,.top #project-menu>summary{display:grid!important;grid-template-columns:24px minmax(0,1fr) 10px;align-items:center;gap:5px!important;width:100%!important;min-width:0;max-width:100%;height:44px!important;min-height:44px!important;max-height:44px;padding:6px!important;margin:0!important;border:1px solid #496881!important;border-radius:7px;font-size:12px!important;font-weight:600;line-height:16px!important;white-space:nowrap;box-sizing:border-box;list-style:none;transition:none}
 .top #project-modules>summary::-webkit-details-marker,.top #project-menu>summary::-webkit-details-marker{display:none}
 .top #active-module,.top #active-project{display:block;min-width:0!important;max-width:100%!important;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;line-height:16px;align-self:center}
 .top #project-modules>summary>span:last-child,.top #project-menu>summary>span:last-child{width:10px;min-width:10px;height:16px;line-height:16px;text-align:center}
 .top .header-selector-icon,.top #active-module-icon>.nav-icon{display:grid!important;place-items:center;width:24px!important;min-width:24px!important;max-width:24px!important;height:24px!important;min-height:24px;max-height:24px;margin:0!important;padding:0!important;line-height:24px!important;font-size:20px!important;flex:none;box-sizing:border-box}
 .top .header-selector-icon svg{display:block;width:24px!important;height:24px!important;max-width:24px;max-height:24px;margin:0;flex:none}
 .top .identity{position:static!important;grid-column:3;grid-row:2;display:block!important;width:var(--phone-avatar-width)!important;min-width:var(--phone-avatar-width);max-width:var(--phone-avatar-width);height:44px;margin:0!important;padding:0!important;box-sizing:border-box}
 .top .mobile-user-menu{display:block;width:44px!important;height:44px}
 .top .mobile-user-menu>summary{display:grid!important;place-items:center;width:44px!important;min-width:44px;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;border:0!important;border-radius:50%;background:transparent;box-shadow:none;cursor:pointer;box-sizing:border-box;list-style:none}
 .top .mobile-user-menu>summary::-webkit-details-marker{display:none}
 .top .avatar{width:44px!important;min-width:44px;height:44px!important;min-height:44px;border-radius:50%;font-size:12px;line-height:16px;box-sizing:border-box}
 .top #project-modules>summary:focus-visible,.top #project-menu>summary:focus-visible,.top #user-menu>summary:focus-visible{outline:2px solid #91bce6;outline-offset:-3px;box-shadow:none}
 .mobile-user-menu:not([open])>.project-module-options{display:none!important}.mobile-user-menu .connection-status{position:static;display:flex}.top>.connection-status{display:none!important}
 .shell{display:block!important;margin:0!important;min-width:0}main,.shell>main,main:has(.field-workspace){padding:8px!important;min-width:0;max-width:100%;margin:0!important}#screen{min-width:0}.page-head{margin:4px 0 10px!important;gap:8px;flex-wrap:wrap}.page-head h1,.task-detail-head h1{font-size:19px!important;line-height:1.25;margin:4px 0!important}.page-head p{margin:4px 0;font-size:12px}.eyebrow{display:none}.card{padding:12px!important;border-radius:8px;box-shadow:none!important}.actions,.form-footer{gap:8px}.section-label{font-size:14px}.form-grid,.notebook-fields,.ppk-field-group,.reg-field-group{grid-template-columns:minmax(0,1fr)!important}.stats,.work-sections{grid-template-columns:minmax(0,1fr)!important;gap:8px}.intro,.settings-content,.user-row,.project-card{min-width:0}.project-card h2{font-size:16px}.project-tools{padding:8px}.card-head{gap:8px;flex-wrap:wrap}.card-head h2,h2{font-size:17px}.field{margin-bottom:10px}.field label,label.field{font-size:13px}.settings-tabs{display:flex;flex-wrap:nowrap;overflow-x:auto;min-width:0}.settings-tabs button{flex:none}
 /* A drawer occupies zero document width while closed. It never resizes the PDF. */
 .field-workspace,.field-workspace.field-sidebar-collapsed,.field-workspace:not(.field-sidebar-collapsed){display:block!important;grid-template-columns:none!important;transition:none;gap:0}.field-workspace>.ppk-viewer{padding:0!important;border:0;background:transparent;min-width:0}.field-workspace .ppk-drawing{height:var(--field-drawing-height,calc(100dvh - 84px))!important;min-height:120px!important;border-radius:0}.field-content-surface{overflow:visible;max-height:none!important}.field-content-surface .mobile-panel-launch{display:inline-flex;margin-bottom:8px}
 .mobile-drawer{display:none!important;position:fixed!important;left:env(safe-area-inset-left,0px);right:env(safe-area-inset-right,0px);top:var(--mobile-panel-top,0px);width:auto!important;height:var(--mobile-panel-height,100dvh)!important;max-height:var(--mobile-panel-height,100dvh)!important;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;padding:max(8px,env(safe-area-inset-top)) 12px max(16px,env(safe-area-inset-bottom))!important;margin:0!important;z-index:410;border:0!important;border-radius:12px 12px 0 0;background:white;box-shadow:0 -8px 30px #102c4840}
 .mobile-drawer.mobile-drawer-open{display:block!important;animation:mobile-enter .12s ease-out}.mobile-drawer-backdrop{position:fixed;inset:0;z-index:400;background:#102c4866;border:0;padding:0}.mobile-drawer-close{display:block;position:sticky;top:0;z-index:4;margin-left:auto;width:44px;height:44px;font-size:25px;background:#fff}.mobile-drawer .field-sidebar-toggle{display:none!important}.mobile-drawer .field-section-nav{flex-direction:row;flex-wrap:wrap;gap:4px;margin:4px 0 12px}.mobile-drawer .field-section-nav button{width:auto;flex:1 1 40%;justify-content:flex-start;padding:8px}.mobile-drawer .field-section-label,.mobile-drawer .field-sidebar-context,.mobile-drawer .ppk-side{display:initial!important}.mobile-drawer .field-section-label{display:inline!important;font-size:12px}.mobile-drawer .field-sidebar-context,.mobile-drawer .ppk-side{display:block!important}.mobile-drawer .ppk-side{max-height:none!important;overflow:visible!important}.mobile-drawer .ppk-toolbar{display:grid;grid-template-columns:1fr;gap:8px}.mobile-drawer .page-head{display:none}.mobile-drawer .field-accordion-heading{min-height:48px;font-size:14px}.mobile-drawer .field-accordion-body{padding:0 0 12px}.mobile-drawer .reg-distribution,.mobile-drawer .ppk-detail{border:0;padding:0}.mobile-drawer .ppk-photos{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.mobile-drawer .reg-element-heading{grid-template-columns:1fr}.mobile-drawer .reg-room-table{width:100%;table-layout:fixed}.mobile-drawer .reg-room-table td,.mobile-drawer .reg-room-table th{overflow-wrap:anywhere;font-size:11px;padding:6px 3px}.mobile-drawer .field-accordion-body .ppk-actions{display:flex!important;flex-wrap:wrap}
 /* One independently scrolling toolbar, shared by tiles and original PDF. */
 .mobile-panel-launch,.mobile-work-launch{display:inline-flex;align-items:center;justify-content:center;min-width:44px;width:44px;height:44px;padding:0;font-size:20px;flex:none}
 .mobile-drawing-toolbar,.document-focused .mobile-drawing-toolbar{display:flex!important;position:relative!important;inset:auto!important;flex-direction:row!important;flex-wrap:nowrap!important;align-items:center;gap:4px;padding:2px 4px!important;height:48px!important;min-height:48px!important;max-width:100%;width:100%;overflow-x:auto!important;overflow-y:hidden!important;overscroll-behavior-x:contain;scrollbar-width:none;background:white;z-index:5;flex:none;touch-action:pan-x;white-space:nowrap}
 .mobile-drawing-toolbar::-webkit-scrollbar{display:none}.mobile-drawing-toolbar .pdf-page-controls,.mobile-drawing-toolbar .pdf-zoom-controls,.document-focused .mobile-drawing-toolbar .pdf-page-controls,.document-focused .mobile-drawing-toolbar .pdf-zoom-controls{display:contents!important;position:static!important}.mobile-drawing-toolbar button{min-height:44px!important;height:44px;min-width:44px;padding:6px 9px!important;font-size:12px!important;flex:none!important;width:auto!important;margin:0!important}.mobile-drawing-toolbar button.primary{background:#0965b7;color:white;font-weight:700}.mobile-drawing-toolbar input{width:46px!important;min-width:46px!important;height:44px;flex:none}.mobile-drawing-toolbar span{flex:none;white-space:nowrap}.mobile-short-label{font-size:0!important}.mobile-drawing-toolbar button.mobile-short-label{font-size:0!important}.mobile-short-label::after{content:attr(data-mobile-label);font-size:12px}.field-workspace-tools:has(>button:only-child){margin:0}.field-workspace .ppk-actions{display:none!important}.field-workspace>.ppk-viewer>.field-workspace-tools{display:none!important}.field-workspace .field-selected-context{display:none}.field-workspace .drawing-tile-stage{min-height:120px!important}.drawing-tile-viewer{min-height:0!important;height:100%!important}.drawing-tile-status,.pdf-status{position:absolute;bottom:4px;right:6px;padding:3px 6px!important;background:#ffffffcc;font-size:10px;pointer-events:none;max-width:65%;border-radius:4px}
 [data-mobile-module=ppk] .pdf-measure-toggle,[data-mobile-module=ppk] .pdf-measure-tools{display:none!important}.field-workspace .field-pick-banner{bottom:max(12px,env(safe-area-inset-bottom));top:auto;left:6px;right:6px;padding:6px;font-size:12px;flex-wrap:nowrap}.field-pick-banner button{font-size:0!important;min-width:44px}.field-pick-banner button::after{content:'×';font-size:22px}.pdf-measure-tools{max-width:calc(100vw - 16px);font-size:12px;padding:8px}.pdf-pins{touch-action:none}
 .workspace,.task-workspace,.optional-workspace.drawing-open{display:block!important;min-width:0}.workspace .viewer{padding:0!important;border:0}.workspace:not(:has(.mobile-drawer)) .viewer:has(.empty){display:none}.workspace:not(:has(.mobile-drawer)) .library{padding:8px!important}.library-tools{padding:0;gap:8px}.tree-row{min-height:52px;border-bottom:1px solid var(--line)}.tree-select{min-width:0;min-height:48px}.tree-select .name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}.tree-select .file-icon{min-width:28px}.tree-row .more{width:44px;min-width:44px;height:44px}.tree-footer{padding:8px;font-size:11px}.document-focused>.page-head{display:none!important}.document-focused .viewer-head{position:static!important;inset:auto!important;display:flex!important;padding:4px 0!important;background:white!important;height:44px;min-height:44px;align-items:center;gap:6px}.viewer-head h2{font-size:13px!important;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:220px;margin:0}.viewer-head small{display:none}.viewer-head>a{margin-left:auto;font-size:12px;min-width:44px;min-height:44px;display:flex;align-items:center}.document-focused .viewer .preview{position:relative!important;inset:auto!important;top:auto!important;height:calc(100dvh - 128px)!important;min-height:120px!important}.document-focused .drawing-tile-viewer{position:relative!important;inset:auto!important;display:flex!important}.document-focused .drawing-tile-viewer .drawing-tile-stage{position:relative!important;inset:auto!important;flex:1;min-height:0!important}.document-focused .pdf-host{position:relative!important;inset:auto!important;display:flex;flex-direction:column;height:100%}.document-focused .pdf-viewport{flex:1;min-height:0!important}.task-detail-head{display:flex;align-items:center;gap:6px;padding:0;min-height:44px}.task-detail-head h1{font-size:14px!important;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.task-detail-head .task-state{display:none}.task-workspace .task-form.mobile-drawer{padding:12px!important}.task-workspace .task-viewer{padding:0!important}.task-workspace .viewer-head{display:none!important}
 .work-detail-workspace{display:block!important}.work-master-list{display:none!important}.work-items{gap:8px}.work-item{padding:12px!important;min-height:82px;gap:8px}.work-list-thumbnail{width:64px;height:64px;object-fit:cover}.description-preview{-webkit-line-clamp:2;font-size:13px}.work-section{min-height:76px!important;display:flex;align-items:center;gap:8px}.section-count{font-size:22px!important}.work-section-meta{font-size:12px}.work-detail{padding:10px!important}.work-detail-main{padding:0!important}.work-detail-meta{display:flex;flex-wrap:wrap;gap:6px}.work-description{margin:6px 0}.work-point-card,.work-review-point{padding:10px!important}.work-points-list{gap:8px}.work-point-actions{gap:4px;flex-wrap:wrap}.task-photo-grid,.work-photo-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}.task-photo-grid img,.work-photo-grid img{max-width:100%;object-fit:contain}
 .mobile-secondary-actions{display:block;position:relative;margin-left:auto}.mobile-secondary-actions>summary{display:flex;align-items:center;justify-content:center;width:44px;height:44px;border:1px solid var(--line);border-radius:7px;cursor:pointer;list-style:none;font-size:22px}.mobile-secondary-actions>summary::-webkit-details-marker{display:none}.mobile-action-options{position:absolute;right:0;bottom:calc(100% + 4px);width:240px;max-width:calc(100vw - 24px);z-index:10;background:white;border:1px solid var(--line);padding:6px;border-radius:8px;box-shadow:0 4px 18px #102c4833}.mobile-action-options button{display:block;width:100%;text-align:left;min-height:44px;white-space:normal}.mobile-secondary-actions:not([open])>.mobile-action-options{display:none}
 .notebook{display:block!important;gap:0}.notebook-paper{padding:10px!important}.mobile-note-tools{display:flex;gap:8px;margin-bottom:8px;justify-content:space-between}.mobile-note-tools button{min-height:44px;padding:6px 10px}.notebook-pages.mobile-drawer{border:0}.notebook-page-row{gap:4px;min-height:56px}.notebook-page{padding:8px;min-width:0}.notebook-page strong{font-size:14px;overflow-wrap:anywhere}.note-order{display:flex;gap:2px}.note-order button{width:44px;height:44px;padding:4px}.notebook-fields{gap:6px}.note-toolbar,.apple-note-toolbar{display:flex!important;flex-wrap:nowrap!important;overflow-x:auto;position:sticky;top:var(--mobile-header-height,76px);gap:4px;padding:4px!important;z-index:3;background:white;white-space:nowrap}.note-toolbar>*{flex:none;min-width:44px;height:44px}.note-toolbar select{width:66px!important;min-width:66px}.note-surface{padding:8px!important;min-height:260px!important;overflow-wrap:anywhere}.note-row{max-width:100%;min-height:30px}.note-row .note-mark{width:44px;min-width:44px;height:44px;align-self:center}.note-row .note-text{min-width:0;overflow-wrap:anywhere}.notebook-form .form-footer{flex-wrap:nowrap;position:sticky;bottom:0;background:white;padding:8px 0}.mobile-save-status:not(.error){font-size:11px;margin:4px 0;line-height:1.3}.notebook-rich{min-width:0;max-width:100%}
 /* Native dialog sheets: a single body scrolls, with fixed header/footer in the visual viewport. */
 .mobile-sheet{position:fixed!important;inset:auto!important;margin:0!important;padding:0!important;width:100%;max-width:none!important;border:0!important;color:var(--navy);border-radius:12px 12px 0 0;overflow:hidden!important;background:white;box-shadow:0 -4px 24px #102c4840}.mobile-sheet::backdrop{background:#102c4870}.mobile-sheet[open]{display:flex;flex-direction:column}.mobile-sheet-heading,.mobile-sheet-footer{flex:none;display:flex;align-items:center;gap:8px;padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left));background:white}.mobile-sheet-heading{border-bottom:1px solid var(--line)}.mobile-sheet-heading h2{font-size:17px;line-height:1.3;margin:0;flex:1;min-width:0;overflow-wrap:anywhere}.mobile-sheet-heading>button{width:44px;height:44px;padding:0;flex:none;font-size:24px}.mobile-sheet-body{min-height:0;flex:1;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;scroll-padding:12px;padding:12px;-webkit-overflow-scrolling:touch}.mobile-sheet-footer{border-top:1px solid var(--line);padding-bottom:max(10px,env(safe-area-inset-bottom));flex-wrap:wrap}.mobile-sheet-footer button{min-height:44px;flex:1;padding:8px}.mobile-sheet-footer .actions,.mobile-sheet-footer .form-footer{display:flex;flex:1;gap:8px;flex-wrap:wrap;position:static;margin:0;padding:0;width:100%}.mobile-full-sheet{border-radius:0}.mobile-full-sheet>form{display:flex;flex-direction:column;min-height:0;height:100%;margin:0;padding:0!important;border:0;max-width:none}.mobile-legacy-sheet{height:100dvh;border-radius:0}.mobile-menu-sheet{left:max(0px,env(safe-area-inset-left))!important;right:max(0px,env(safe-area-inset-right))!important;bottom:0!important;width:auto!important;max-height:80dvh;min-height:0!important;overflow:hidden!important}.mobile-menu-sheet .project-module-options{position:static!important;display:flex!important;flex-direction:column!important;flex:1;min-height:0;overflow-y:auto!important;max-height:none!important;box-shadow:none;border:0;padding:6px 8px max(12px,env(safe-area-inset-bottom));border-radius:0;gap:2px}.mobile-menu-sheet #nav{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;width:100%!important;overflow:visible!important;padding:0!important;gap:2px}.mobile-menu-sheet .nav-item{display:flex!important;flex-direction:row!important;align-items:center;gap:12px;min-height:48px;height:auto;width:100%;padding:10px!important;font-size:15px;text-align:left;white-space:normal;overflow-wrap:anywhere;flex:none}.mobile-menu-sheet .nav-icon,.mobile-menu-sheet .header-selector-icon{width:26px!important;min-width:26px;height:26px;flex:none}.mobile-menu-sheet .nav-item>span:last-child{flex:1;min-width:0}.mobile-menu-sheet .nav-item.active{background:#e7f1ff;color:#0757a3;font-weight:700}.mobile-menu-sheet #current-user{font-weight:700;padding:12px}.mobile-menu-sheet .connection-status{position:static!important;display:flex!important;margin:0;padding:8px 12px;font-size:13px}.mobile-menu-sheet #logout{display:block;min-height:48px;text-align:left;margin:8px;color:#a02b2b}.mobile-menu-sheet [hidden]{display:none!important}
 .form-popup{border-radius:0!important}.form-popup.mobile-short-sheet{border-radius:12px 12px 0 0!important}.form-popup .ppk-editor{padding-top:0!important}.form-popup .ppk-field-group{grid-template-columns:minmax(0,1fr)!important;padding:10px;gap:10px;margin:12px 0}.form-popup-heading{padding:8px 12px}.form-popup-heading h2{font-size:17px}.form-popup-body{padding:0 12px 12px;scrollbar-gutter:auto}.form-popup-footer{padding:8px 12px max(10px,env(safe-area-inset-bottom))!important}.reg-measure-editor input[type=number]{font-size:28px!important;font-weight:700;height:60px}.form-popup .ppk-entry-hint{font-size:12px}.form-popup .ppk-field-group legend{font-size:14px}
 #editor:not([hidden]){position:fixed!important;inset:auto 0 auto 0!important;top:var(--mobile-panel-top,0px)!important;width:100%!important;max-width:none!important;height:var(--mobile-panel-height,100dvh)!important;max-height:none!important;z-index:500;background:white;padding:12px;overflow-y:auto;overscroll-behavior:contain}#editor h2{margin:0 0 8px;font-size:18px}#editor button{min-height:44px}
 .document-action-menu{position:fixed!important;left:8px!important;right:8px!important;bottom:max(8px,env(safe-area-inset-bottom))!important;top:auto!important;width:auto!important;max-height:75dvh;overflow-y:auto;z-index:500}.document-action-menu>*{min-height:48px!important;font-size:15px!important}
 .field-toast,#notice.field-toast{left:8px;right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:auto;padding:8px!important;font-size:13px;max-height:35dvh;overflow-y:auto}.field-toast button{min-width:44px;height:44px}.reg-save-line{display:none}.mobile-overlay-open{overflow:hidden;overscroll-behavior:none}.ppk-inspections,.ppk-inspection,.ppk-common,.ppk-export-accordion{padding:10px!important}.ppk-actions{flex-wrap:wrap}.ppk-inspection-actions{display:flex;flex-wrap:wrap;gap:4px}.ppk-export-accordion>summary{min-height:48px}.reg-table-wrap{max-width:100%;overflow-x:auto}.user-options{flex-wrap:wrap}.user-profile,.user-fields{grid-template-columns:1fr!important}
 @keyframes mobile-enter{from{transform:translateY(12px);opacity:.8}to{transform:translateY(0);opacity:1}}
 @media(orientation:landscape){.document-focused .viewer .preview{height:calc(100dvh - 104px)!important}.mobile-drawer{left:auto;width:min(430px,100vw)!important;right:env(safe-area-inset-right,0px);border-radius:0}.mobile-sheet-heading,.mobile-sheet-footer{padding-block:4px}.mobile-menu-sheet{max-height:94dvh}}
 @media(prefers-reduced-motion:reduce){.mobile-drawer-open{animation:none}}
}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.top .header-project-menu{width:100%!important}.mobile-user-menu>summary{display:flex!important}.identity .avatar{display:grid!important}.mobile-menu-sheet #current-user{display:block!important;color:var(--navy)}.mobile-menu-sheet .connection-status{color:#426179}}

.mobile-user-menu[hidden]{display:none!important}

/* Phone selectors use the same light, compact dropdown language as the tablet header. */
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){
 .mobile-sheet.mobile-header-dropdown{position:fixed!important;inset:auto!important;margin:0!important;height:auto!important;min-height:0!important;border:1px solid var(--line)!important;border-radius:10px!important;padding:0!important;box-shadow:0 8px 28px #102c4840;overflow:hidden!important;background:white}
 .mobile-header-dropdown::backdrop{background:transparent}
 .mobile-header-dropdown>.project-module-options{position:static!important;inset:auto!important;display:block!important;width:100%!important;max-height:var(--selector-available-height)!important;min-height:0;flex:1;overflow-y:auto!important;overflow-x:hidden!important;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scroll-padding:6px;border:0;border-radius:0;box-shadow:none;margin:0;padding:6px 6px max(6px,env(safe-area-inset-bottom))}
 .mobile-header-dropdown #nav{display:flex!important;flex-direction:column!important;flex-wrap:nowrap!important;gap:2px;width:100%!important;overflow:visible!important;padding:0!important}
 .mobile-header-dropdown .nav-item{display:flex!important;flex-direction:row!important;align-items:center;gap:12px;width:100%;min-height:48px;flex:none;padding:10px 12px;font-size:14px;white-space:normal;overflow-wrap:anywhere;text-align:left}
 .mobile-header-dropdown .nav-icon,.mobile-header-dropdown .header-selector-icon{display:flex;width:26px;min-width:26px;height:26px;align-items:center;justify-content:center;flex:none}
 .mobile-header-dropdown .nav-item>span:last-child{min-width:0}.mobile-header-dropdown .nav-item.active{background:#e7f1ff;color:#1769c2;font-weight:650}
}



@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.top .project-module-menu[open]>.project-module-options{display:none!important}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.mobile-drawer .tree,.mobile-drawer .notebook-page-list{overflow:visible!important;max-height:none!important}.mobile-drawer .library-tools{flex:none}.library:not(.mobile-drawer){max-height:none!important}.library:not(.mobile-drawer) .tree{overflow:visible}.workspace:not(:has(.drawing-tile-viewer)){height:auto!important;min-height:0}.mobile-drawer .tree-footer{position:static}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.mobile-note-body{display:contents}.notebook-paper.mobile-editor-keyboard{position:fixed;inset:auto 0 auto 0;top:var(--note-visible-top,0px);height:var(--note-visible-height,100dvh);width:100%;z-index:300;padding:0!important;border:0;border-radius:0;background:white}.mobile-editor-keyboard>.notebook-form{display:flex;flex-direction:column;height:100%;min-height:0}.mobile-editor-keyboard .mobile-note-body{display:block;flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:8px}.mobile-editor-keyboard .note-toolbar{top:0}.mobile-editor-keyboard .notebook-form>.form-footer{position:static;flex:none;margin:0;padding:6px 8px max(6px,env(safe-area-inset-bottom));min-height:56px}.mobile-editor-keyboard .note-surface{min-height:180px!important}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.mobile-file-info{min-width:0;flex:1;display:flex;flex-direction:column;gap:3px}.mobile-file-info .name{display:block}.mobile-file-info small{font-size:11px}.tree-select .file-icon{font-size:10px;font-weight:700;width:30px}.mobile-file-action-sheet .document-action-menu{position:static!important;inset:auto!important;width:100%!important;max-height:none;overflow-y:auto;box-shadow:none;border:0;margin:0;padding:6px 12px max(12px,env(safe-area-inset-bottom))}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.document-focused .workspace{height:auto!important;min-height:0!important}.document-focused .workspace>.viewer{height:100%!important;min-height:0!important}.document-focused .viewer .preview{flex:none!important;height:auto!important;min-height:0!important;width:100%}.document-focused .drawing-tile-viewer{flex:1 1 auto!important;height:100%!important;width:100%}.document-focused .viewer-head{width:100%!important;height:44px!important;min-height:44px!important;flex-wrap:nowrap!important;max-width:none!important;transform:none!important}.document-focused .task-workspace.drawing-open{height:calc(100dvh - var(--mobile-header-height,76px) - 68px)!important}.document-focused .task-workspace.drawing-open>.task-viewer{height:100%!important}.document-focused .drawing-tile-viewer .pdf-measure-toggle{position:static!important;inset:auto!important}.document-focused .mobile-drawing-toolbar .library-toggle{position:static!important;inset:auto!important;transform:none!important}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.shell>main:has(.document-focused){height:auto!important;flex:none!important}.document-focused .task-workspace.drawing-open{flex:1 1 auto!important;min-height:0!important}.document-focused .task-workspace>.task-viewer{margin:0!important;min-height:0!important}.task-detail-head{flex-wrap:nowrap!important}.task-detail-head h1{min-width:0!important}.task-workspace .viewer-head{display:none!important}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){#editor:not([hidden]):has(.mobile-editor-body){display:flex!important;flex-direction:column;padding:0!important;overflow:hidden!important}#editor .mobile-sheet-heading button{font-size:12px}#editor .mobile-sheet-footer{flex:none}#editor .mobile-editor-body{min-height:0;flex:1;overflow-y:auto;overflow-x:hidden}#editor .mobile-editor-body .field{margin:10px 0}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.mobile-menu-sheet #current-user{order:0}.mobile-menu-sheet .connection-status{order:1}.mobile-menu-sheet #logout{order:2;background:white;border:1px solid #e3c7c7;color:#a02b2b}.mobile-menu-sheet #logout:hover{background:#fff3f3}}

@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.work-detail-meta>button:first-of-type{background:#0965b7;color:white;border-color:#0965b7}.ppk-photo .mobile-secondary-actions{margin:4px 0 0 auto;width:44px}.ppk-photo .mobile-action-options{width:210px}.ppk-photos input[hidden]{display:none!important}}
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){
 .mobile-settings-page{position:fixed;display:flex;flex-direction:column;min-height:0;overflow:hidden;z-index:310;background:white;box-sizing:border-box;overscroll-behavior:contain}
 .mobile-settings-page>.mobile-sheet-heading{flex:none;min-height:52px}.mobile-settings-page>.mobile-sheet-body{flex:1 1 0;min-height:0;touch-action:pan-y;padding-bottom:max(16px,env(safe-area-inset-bottom))}
 .mobile-settings-page .settings-panel{height:auto;max-height:none;overflow:visible}.mobile-settings-page .settings-section{min-height:0}
 .mobile-header-dropdown #current-user{display:block;font-weight:700;padding:10px}.mobile-header-dropdown .connection-status{position:static!important;display:flex!important;padding:8px 10px}.mobile-header-dropdown #logout{min-height:44px;width:100%;margin:4px 0;text-align:left;color:#a02b2b}
 .mobile-header-dropdown [hidden]{display:none!important}
}
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){.mobile-header-dropdown #current-user{color:var(--navy)}.mobile-header-dropdown .connection-status{color:#426179}}

/* The shared lease owns the body lock; removing its class restores CSS flow. */
html.mobile-overlay-open>body{position:fixed;top:var(--mobile-lock-top,0px);left:var(--mobile-lock-left,0px);width:100%;overflow:hidden}

/* Header selectors are top-layer overlays; their open state never changes page flow. */
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 html.mobile-header-menu-open{overflow:hidden;overscroll-behavior:none}
 /* Before the toggle handler portals the panel, even the user menu has zero flow size. */
 .top .project-module-menu>.project-module-options{display:none!important}
}

/* Phone-only notebook density; preserve the desktop/iPad controls and metrics. */
@media(max-width:600px),(pointer:coarse) and (max-width:960px) and (max-height:600px){
 .note-row.check{position:relative;display:flex;align-items:flex-start;gap:4px;min-height:36px;padding-left:0}
 .note-row.check input.note-mark{appearance:none;-webkit-appearance:none;box-sizing:border-box;width:44px;min-width:44px;height:44px;margin:0;background:linear-gradient(white,white) center/18px 18px no-repeat;border:0;border-radius:0;cursor:pointer;position:relative;align-self:flex-start}
 .note-row.check input.note-mark::before{content:'';position:absolute;left:13px;top:13px;width:18px;height:18px;box-sizing:border-box;border:1.5px solid #8194a6;border-radius:4px;background:white}
 .note-row.check input.note-mark:checked::before{background:#1769ba;border-color:#1769ba}
 .note-row.check input.note-mark:checked::after{content:'';position:absolute;left:18px;top:15px;width:6px;height:11px;border:solid white;border-width:0 2px 2px 0;transform:rotate(45deg)}
 .note-row .note-text{padding-top:9px;flex:1;line-height:1.4;white-space:pre-wrap;word-break:normal;overflow-wrap:anywhere}
 .note-row.paragraph .note-text{padding-top:0}.note-row.bullet .note-mark{width:28px;min-width:28px;font-size:18px}
 .note-toolbar,.apple-note-toolbar{overflow:visible;gap:4px;padding:3px!important;min-height:44px}.note-toolbar>.mobile-secondary-actions{margin-left:auto;flex:none}
 .note-toolbar .mobile-action-options{bottom:auto;top:calc(100% + 4px);max-height:50dvh;overflow:auto}.note-toolbar .mobile-action-options select{width:100%!important;height:44px}
 .notebook-fields label:has(input[type=date]){font-size:11px;color:#62768a}.notebook-fields input[type=date]{font-size:16px;min-height:36px;padding:4px 8px}
 .notebook-paper .mobile-save-status{font-size:11px;line-height:1.3;margin:3px 0}.notebook-paper .form-footer{padding:4px 0!important;min-height:44px}.notebook-paper .note-editor-status:empty{display:none}
}
