/* NeighbourHub • mobile-first shell enhancement. Desktop unchanged above 820px.
   UI only; permissions and secure upload pipeline stay server-controlled. */
.nh-doc-mobile-list{display:none}
.nh-mobile-menu-btn,.nh-mobile-search-btn,.nh-mobile-brand,.nh-mobile-dock,.nh-mobile-fab,.nh-mobile-backdrop,.nh-mobile-menu-close{display:none}
@media(max-width:960px){
 :root{--nh-m-navy:#071a37;--nh-m-gold:#caa356}
 html{scroll-padding-top:106px;-webkit-text-size-adjust:100%}
 body{overflow-x:hidden}
 body.nh-mobile-menu-open{overflow:hidden}
 #workspace.nh-shell{display:block;min-height:100dvh;width:100%;max-width:100vw}
 #workspace.nh-shell[hidden]{display:none!important}
 .nh-work{width:100%;min-width:0}
 .nh-sidebar{position:fixed!important;inset:0 auto 0 0;width:min(86vw,338px);max-width:338px;height:100dvh!important;min-height:0!important;z-index:105;padding:18px 15px max(22px,env(safe-area-inset-bottom))!important;background:var(--nh-m-navy);transform:translateX(-105%);visibility:hidden;transition:transform .22s ease,visibility .22s;overflow-y:auto;overscroll-behavior:contain;box-shadow:18px 0 40px #071a3745;display:flex!important;flex-direction:column}
 body.nh-mobile-menu-open .nh-sidebar{transform:translateX(0);visibility:visible}
 .nh-sidebar-top{display:block!important}
 .nh-sidebar .nh-official{min-height:54px;padding-right:48px}
 .nh-sidebar .nh-side-rule{display:block!important;margin:14px 6px 18px}
 .nh-sidebar .nh-side-caption{display:block!important;margin:0 12px 12px}
 .nh-sidebar .side{display:flex!important;flex-direction:column!important;gap:3px!important;overflow:visible!important;white-space:normal!important;margin:0!important;padding:0!important;position:static!important}
 .nh-sidebar .side button{display:flex!important;min-height:46px;width:100%;font-size:13px!important;white-space:normal!important;flex:none!important;align-items:center;text-align:left;padding:11px 13px!important;line-height:1.3}
 .nh-sidebar .nh-side-icon{display:inline-block!important;flex:0 0 23px;font-size:19px}
 .nh-sidebar-bottom{display:block!important;flex:none;margin-top:auto;padding-top:22px}
 .nh-mobile-menu-close{display:grid;place-items:center;position:absolute;right:17px;top:24px;width:40px;height:40px;background:#1d3455;border:1px solid #3b516b;color:white;border-radius:12px;font-size:24px;cursor:pointer}
 .nh-mobile-backdrop{position:fixed;inset:0;z-index:104;background:#081629b3;backdrop-filter:blur(3px)}
 body.nh-mobile-menu-open .nh-mobile-backdrop{display:block}
 .nh-topbar{position:sticky;top:0;z-index:32;display:flex;align-items:center;min-height:64px;height:auto;gap:10px;flex-wrap:wrap;padding:9px 14px 9px 12px!important;background:#fff;border-bottom:1px solid #e3e9ef;box-shadow:0 1px 9px #1023380a}
 .nh-mobile-menu-btn,.nh-mobile-search-btn{display:grid;place-items:center;min-width:44px;width:44px;height:44px;padding:0;border:1px solid #e4eaf0;border-radius:12px;background:#f7f9fb;color:#152d48;cursor:pointer;font-size:21px}
 .nh-mobile-menu-btn:active,.nh-mobile-search-btn:active{background:#f4ead8}
 .nh-mobile-brand{display:block;font:700 16px Georgia,serif;letter-spacing:.045em;color:#b3873d;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .nh-topbar .nh-breadcrumb{display:none}
 .nh-topbar .nh-top-actions{display:none!important;width:100%;order:5;min-width:0;gap:9px;align-items:stretch;flex-wrap:wrap;padding:10px 0 5px}
 body.nh-mobile-search-open .nh-topbar .nh-top-actions{display:flex!important}
 .nh-top-actions .nh-search{height:47px;width:100%;min-width:0;flex:1 0 100%}
 .nh-top-actions .nh-search input{width:100%;font-size:16px!important;height:100%}
 .nh-top-actions .nh-search-results{width:100%;max-width:100%;top:48px;max-height:min(54dvh,500px);overflow:auto}
 .nh-top-actions .nh-company-label{min-width:0;max-width:none;flex:1 1 120px}
 .nh-top-actions .nh-company-label select{height:44px;width:100%;max-width:none;min-width:0;font-size:13px}
 .nh-top-actions #invite-staff-btn,.nh-top-actions #logout-button-top{min-height:44px}
 .nh-top-actions .nh-avatar-top{display:none}
 .nh-content{padding:17px 13px calc(125px + env(safe-area-inset-bottom))!important;min-width:0;width:100%;max-width:100vw}
 .nh-content .nh-safety{margin-bottom:15px;padding:10px 12px;font-size:11px;line-height:1.5;gap:5px}
 .nh-content .nh-safety span{min-width:0;flex-basis:100%;overflow-wrap:anywhere}
 .nh-intro h1{font-size:27px}
 .nh-content .module-head{flex-direction:column;align-items:stretch;gap:11px;margin-bottom:14px}
 .nh-content .module-head .module-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
 .nh-content .module-actions>.btn{min-height:44px}
 #main-content{min-width:0}
 #main-content>.panel{padding:16px 14px;border-radius:13px;min-width:0}
 #main-content .toolbar{display:flex;flex-direction:column;align-items:stretch;gap:10px}
 #main-content .toolbar label{max-width:none;width:100%}
 #main-content .toolbar input[type="search"],#main-content .toolbar button{min-height:46px}
 #main-content .record{display:flex;align-items:stretch;flex-direction:column;gap:10px;padding:15px 13px;margin-bottom:10px;border:1px solid #e0e7ee!important;border-radius:13px;background:#fff;box-shadow:0 3px 12px #142e4a08;min-width:0}
 #main-content .record:first-child{border-top:1px solid #e0e7ee}
 #main-content .record>div:first-child{min-width:0;width:100%}
 #main-content .record-open{font-size:15px;line-height:1.35;overflow-wrap:anywhere}
 #main-content .record small{font-size:12px;line-height:1.45;overflow-wrap:anywhere;margin-top:4px}
 #main-content .record .buttons{width:100%;display:flex;gap:7px;justify-content:flex-start;flex-wrap:wrap}
 #main-content .record .buttons>.btn{flex:1 1 auto;min-height:43px;font-size:12px}
 .nh-content .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .nh-content .stats>.stat{min-width:0;padding:14px}
 .nh-quick-actions{grid-template-columns:1fr!important}
 .nh-quick{min-height:64px}
 .grid2,.view-sections{grid-template-columns:1fr!important}
 .view-facts{grid-template-columns:repeat(2,minmax(0,1fr))}
 #viewer,#editor,.nh-key-dialog,#document-preview-dialog{width:100vw!important;max-width:100vw!important;max-height:96dvh!important;margin:auto 0 0!important;border-radius:18px 18px 0 0!important;overflow:auto;overscroll-behavior:contain;padding-bottom:env(safe-area-inset-bottom)}
 #viewer[open],#editor[open],.nh-key-dialog[open],#document-preview-dialog[open]{position:fixed;inset:auto 0 0}
 #viewer .viewer-controls{padding:12px 13px;gap:7px;flex-wrap:wrap}
 #viewer .viewer-controls .btn{min-height:43px}
 #viewer .viewer-controls .viewer-mode{display:none}
 #viewer .viewer-body{padding:0 14px 24px}
 #viewer .view-heading{padding:19px 0 16px}
 #viewer .view-heading h2{font-size:23px;overflow-wrap:anywhere}
 #viewer .view-section{padding:14px;min-width:0}
 #viewer .nh-card-tabs{overflow-x:auto;scrollbar-width:thin;flex-wrap:nowrap}
 #viewer .nh-card-tabs button{min-height:43px;white-space:nowrap}
 #editor{padding:18px 15px 10px!important}
 #editor .fields{grid-template-columns:minmax(0,1fr)!important;gap:12px}
 #editor .fields .wide{grid-column:1/-1}
 #editor .dialog-actions,.nh-key-dialog .dialog-actions{position:sticky;bottom:0;z-index:3;padding:12px 0 calc(10px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #edf0f4}
 #editor .dialog-actions>.btn,.nh-key-dialog .dialog-actions>.btn{min-height:46px;flex:1}
 #editor input:not([type="checkbox"]),#editor select,#editor textarea,.nh-key-dialog input,.nh-key-dialog select,.nh-key-dialog textarea{min-height:45px;font-size:16px}
 :is(#editor,#viewer,#main-content) input:focus-visible,:is(#editor,#viewer,#main-content) button:focus-visible,.nh-mobile-dock button:focus-visible,.nh-mobile-fab:focus-visible{outline:3px solid #d0a756;outline-offset:2px}
 .nh-doc-mobile-list{display:grid;gap:12px}
 .nh-doc-desktop-table{display:none}
 .nh-doc-mobile-card{padding:15px;border:1px solid #dee7ef;border-radius:13px;background:#fff;box-shadow:0 3px 15px #112b4807;min-width:0}
 .nh-doc-mobile-card h4{font-size:14px;margin:12px 0 10px;overflow-wrap:anywhere;color:#152b44}
 .nh-doc-mobile-card p{font-size:12px;margin:6px 0;overflow-wrap:anywhere;color:#556a81}
 .nh-doc-mobile-card p strong{color:#263d53;margin-right:5px}
 .nh-doc-mobile-head{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
 .nh-doc-mobile-type{color:#8e682d;background:#fff7e8;border:1px solid #e9d7b6;padding:4px 9px;border-radius:16px;font-size:11px;font-weight:750}
 .nh-doc-mobile-status{color:#4e6176;background:#eff4f7;padding:4px 9px;border-radius:16px;font-size:11px}
 .nh-doc-mobile-actions{display:flex;gap:8px;margin-top:13px}
 .nh-doc-mobile-actions>.btn{min-height:44px;flex:1 1 30%;font-size:12px}
 .nh-mobile-contact-link{color:#12619c;font-weight:700;text-decoration:underline;text-underline-offset:3px}
 .nh-mobile-directions{display:inline-flex;align-items:center;min-height:44px;padding:9px 13px;border:1px solid #ebd7ac;color:#815e24;background:#fff8e9;border-radius:9px;font-weight:800;font-size:12px;text-decoration:none;margin-top:8px}
 .nh-content .table-scroll{overflow-x:auto;max-width:100%;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
 .nh-content .table-scroll table{min-width:620px}
 .nh-content .nh-bulk-landlord .table-scroll table{min-width:1150px}
 .nh-content .nh-import-selection-controls{position:sticky;left:0;background:#f4f7fa;z-index:1}
 .nh-content .nh-bulk-landlord{overflow:hidden}
 .nh-content .nh-bulk-landlord .nh-import-review-footer{font-size:12px}
 .nh-content .nh-bulk-landlord #nh-import-confirm{min-height:46px;max-width:100%}
 #main-content:has(#nh-key-search) .nh-key-dashboard{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 #main-content:has(#nh-key-search) .nh-key-stat{padding:13px}
 #main-content:has(#nh-key-search) .nh-key-stat strong{font-size:24px}
 #main-content:has(#nh-key-search) .nh-key-filters{display:flex;flex-wrap:nowrap;overflow-x:auto;gap:7px;padding-bottom:5px;scrollbar-width:thin}
 #main-content:has(#nh-key-search) .nh-key-filters button{white-space:nowrap;min-height:42px;flex:none}
 #main-content:has(#nh-key-search) .nh-keys-table{overflow:visible;box-shadow:none;border:0;background:transparent}
 #main-content:has(#nh-key-search) .nh-keys-table table{display:block;min-width:0}
 #main-content:has(#nh-key-search) .nh-keys-table thead{display:none}
 #main-content:has(#nh-key-search) .nh-keys-table tbody{display:grid;gap:12px}
 #main-content:has(#nh-key-search) .nh-keys-table tbody tr{display:grid;grid-template-columns:auto 1fr;gap:9px 12px;padding:14px;background:white;border:1px solid #e0e7ee;border-radius:13px}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td{display:block;min-width:0;border:0;padding:0!important;overflow-wrap:anywhere;white-space:normal;text-align:left!important;font-size:12px}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:first-child{grid-row:1;grid-column:1}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(2){grid-column:2;grid-row:1;font-size:14px}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(3){grid-column:1/-1;color:#62748a}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(4){grid-column:1}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(5){grid-column:2;text-align:right!important}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:last-child{grid-column:1/-1;min-width:0;border-top:1px solid #e7ecf2;padding-top:9px!important}
 #main-content:has(#nh-key-search) .nh-key-row-actions{justify-content:flex-start;gap:7px}
 #main-content:has(#nh-key-search) .nh-key-row-actions>.btn{min-height:42px;flex:1 1 44%;font-size:11px}
 #main-content:has(#nh-key-search) .nh-key-import{grid-template-columns:1fr;gap:10px}
 .nh-mobile-dock{position:fixed;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));left:0;right:0;bottom:0;z-index:48;min-height:71px;padding:8px 7px calc(8px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid #dfe6ee;box-shadow:0 -5px 22px #09192d15}
 .nh-mobile-dock button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;border:0;background:transparent;color:#61758b;font-weight:700;font-size:10px;min-height:52px;border-radius:11px;cursor:pointer}
 .nh-mobile-dock button svg{height:23px;width:23px;stroke:currentColor;stroke-width:1.8;fill:none;stroke-linecap:round;stroke-linejoin:round}
 .nh-mobile-dock button[aria-current="page"]{color:#8d692d;background:#fff5e4}
 .nh-mobile-dock button:active{background:#f7e9cf}
 .nh-mobile-fab{display:grid;place-items:center;position:fixed;right:16px;bottom:calc(89px + env(safe-area-inset-bottom));z-index:46;height:55px;width:55px;border-radius:17px;border:1px solid #ad843b;background:#cba154;box-shadow:0 9px 26px #7a5a2b55;color:#112338;font-size:29px;font-weight:750;cursor:pointer}
 .nh-mobile-fab:active{transform:scale(.96)}
 .nh-toast,.toast{bottom:calc(94px + env(safe-area-inset-bottom));left:12px;right:12px;max-width:none}
 .nh-mobile-upload-options{display:flex!important;flex-direction:column;gap:10px;margin:13px 0}
 .nh-mobile-upload-options .nh-upload-source{display:flex;align-items:center;justify-content:flex-start;gap:12px;padding:14px 16px;min-height:54px;width:100%;border:1px solid #d9e3ed;background:#fff;border-radius:12px;color:#17334e;font-size:14px;font-weight:700;cursor:pointer}
 .nh-mobile-upload-options .nh-upload-source:active{background:#f7f0e4}
 .nh-mobile-upload-options .nh-upload-source span:first-child{font-size:22px}
 .nh-mobile-upload-options .nh-mobile-selected-files{padding:11px 13px;background:#f3f6fa;border:1px solid #dfe8f0;border-radius:10px;overflow-wrap:anywhere;font-size:12px;color:#465a72}
 .nh-mobile-upload-options .nh-mobile-clear-selection{border:0;background:transparent;color:#856022;text-decoration:underline;text-align:left;padding:8px;font-weight:700}
 #nh-production-uploader .nh-desktop-upload-field{display:none}
 #nh-production-uploader .nh-mobile-upload-options input[type=file]{position:absolute;width:1px;height:1px;opacity:0;overflow:hidden;clip-path:inset(50%)}
 #nh-production-uploader .nh-mobile-upload-options input[type=file]:focus-visible+.nh-upload-source{outline:3px solid #cba154}
 #nh-production-uploader .nh-live-declaration-wrap{margin-top:12px}
 #nh-production-uploader #nh-live-upload{width:100%;min-height:50px}
 #nh-production-uploader .ocr-correction-grid{display:grid;grid-template-columns:minmax(0,1fr)}
 .nh-content .file-warning{overflow-wrap:anywhere}
}
@media(min-width:961px){
 .nh-mobile-upload-options{display:none!important}
}
@media(max-width:390px){
 .nh-content .stats{grid-template-columns:1fr 1fr}
 .nh-content .stats .stat{padding:12px}
 .nh-mobile-brand{font-size:14px}
 .nh-mobile-dock button{font-size:9px}
 #main-content:has(#nh-key-search) .nh-keys-table tbody tr{grid-template-columns:1fr}
 #main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(1),#main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(2),#main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(4),#main-content:has(#nh-key-search) .nh-keys-table tbody td:nth-child(5){grid-row:auto;grid-column:1;text-align:left!important}
}
@media(prefers-reduced-motion:reduce){
 .nh-sidebar,.nh-mobile-fab{transition:none}
 html{scroll-behavior:auto}
}
