/* Cloudflare UI v1.3: scoped to existing components. */
#modalOverlay{-webkit-backdrop-filter:none;backdrop-filter:none;background:rgba(16,38,29,.48)}
#modalOverlay .modal{background:#fff;max-height:94vh;max-height:94dvh}
#qrReaderBox{background:#f4f8f5;border:1px solid #c9ded3;border-radius:12px;overflow:hidden}
#qrReader{background:#eef4f0;min-height:80px}
#qrReader video{display:block;width:100%;height:300px;height:min(38dvh,340px);min-height:140px;max-height:340px;object-fit:contain;background:#183d30}
.camera-placeholder{padding:24px 16px;color:#355548;line-height:1.6;margin:0;text-align:center}
#qrMessage{color:#254c3a;line-height:1.5}
#satelliteHelp{max-width:min(92vw,440px);font-size:13px;line-height:1.5}
#satelliteHelp button{margin-top:6px}
.manage-shortcuts{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:10px 0}
.release-tag{font-size:11px;color:#577063;white-space:nowrap}
@media(max-width:600px){#qrReader video{height:230px;height:32dvh;min-height:130px}.manage-shortcuts .btn{font-size:12px;padding:8px 10px}}

.gps-status{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#fff;color:#254d38;border:1px solid #c8dbcd;border-radius:10px;box-shadow:0 4px 16px #1b35251a;font-size:13px;line-height:1.5;max-width:360px;z-index:1000}
#mapView>.gps-status{position:absolute;left:12px;bottom:20px;max-width:calc(100% - 78px)}
#mapView{position:relative}
#modalOverlay .gps-status{flex-basis:100%;margin-top:8px;box-shadow:none}
.gps-status button{flex-shrink:0;min-height:36px}
@media(max-width:600px){.gps-status{font-size:12px}#mapView>.gps-status{bottom:20px;left:8px;max-width:calc(100% - 72px)}}

/* Location controls and field actions. */
.signed-staff-entry{display:flex;justify-content:flex-end;padding:8px 0}
#streetChoice{width:100%;min-height:44px;border:1px solid #c6d6cc;border-radius:9px;padding:10px;background:#fff;color:#234b37}
#satelliteHelp{max-height:25vh;overflow:auto;font-size:12px;padding:8px 10px}
#satelliteHelp button{display:inline-block;margin:5px 12px 0 0;min-height:32px;font-size:12px}
.mobile-survey-actions{display:none}
@media(max-width:820px){
 body:not(.is-picking) .maplayout{height:auto;min-height:0;display:flex;flex-direction:column}
 body:not(.is-picking) .mapleft,body:not(.is-picking) .mapleft.collapsed{height:auto;max-height:none;flex-shrink:0}
 body:not(.is-picking) .mapleft .selectors{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 body:not(.is-picking) .mapleft .records{max-height:200px;overflow:auto}
 body:not(.is-picking) .mapleft.collapsed .records{display:none}
 body:not(.is-picking) .maparea{height:52vh;height:52dvh;min-height:320px;flex:none}
 .mobile-survey-actions:not(.hidden){display:flex;position:fixed;bottom:0;left:0;right:0;z-index:1200;gap:8px;padding:9px 12px calc(9px + env(safe-area-inset-bottom,0px));background:#fffffff5;border-top:1px solid #d3e1d7;box-shadow:0 -4px 18px #193b2310}
 .mobile-survey-actions .btn{min-height:44px;font-size:13px;text-align:center;text-decoration:none;justify-content:center;flex:1}
 body.workspace-mode[data-role="staff"],body.workspace-mode[data-role="admin"]{padding-bottom:80px}
 body.is-picking .mobile-survey-actions{display:none!important}
 #modalOverlay:not(.hidden)~.mobile-survey-actions{display:none!important}
 .pagehead .actions{width:100%;flex-wrap:wrap}
 #newBtn{width:100%;min-height:46px}
 body.is-picking #satelliteHelp{max-width:calc(100% - 70px);max-height:22vh}
}

/* Keep popup actions reachable in phone WebViews. */
.house-popup .popup-button{min-height:44px;touch-action:manipulation}
.house-popup .leaflet-popup-content{max-width:calc(100vw - 84px);overflow-wrap:anywhere}


/* GOVTECH DESIGN SYSTEM — UI only; runtime classes and visibility are retained. */
:root{--ink:#0f172a;--soft:#64748b;--nav:#0f172a;--accent:#2563eb;--accent-dark:#1d4ed8;--accent-soft:#eff6ff;--bg:#f8fafc;--line:#e2e8f0;--card:#fff;--blue:#2563eb;--warn:#f59e0b;--danger:#ef4444;--ui-sidebar:250px;--ui-shadow:0 8px 28px #0f172a0a;--ui-radius:14px}
html{scroll-padding-top:96px}
html,body{background:var(--bg);color:var(--ink);font-family:Inter,"Be Vietnam Pro","Segoe UI",sans-serif;font-size:14px;line-height:1.5}
button,input,select,textarea{font:inherit}
button,a,input,select,summary,label{touch-action:manipulation}
button,a{transition:background .16s,border-color .16s,box-shadow .16s}
:is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid #2563eb;outline-offset:3px}
[hidden],.hidden{display:none!important}
/* SIDEBAR */
.app{display:grid;grid-template-columns:var(--ui-sidebar) minmax(0,1fr);min-height:100dvh;height:auto;overflow:visible}
.sidenav{display:flex;flex-direction:column;position:sticky;top:0;height:100dvh;min-height:0;overflow:auto;background:#0f172a;padding:28px 16px 20px;gap:28px;z-index:1050;border-right:1px solid #1e293b}
.brand{padding:0 4px;gap:12px}.brandmark{background:#2563eb;box-shadow:none;border-radius:12px;width:40px;height:40px}
.brand strong{font-size:16px}.brand small{font-size:9px;letter-spacing:.8px;color:#94a3b8;line-height:1.6;display:block;margin-top:4px}
.navtitle{font-size:10px;letter-spacing:1px;color:#94a3b8;margin:0 12px 12px}
.navgroup{display:grid;gap:6px}.navlink,.ui-nav-link{min-height:46px;display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:9px;color:#cbd5e1;font-size:13px;font-weight:500;text-decoration:none;white-space:nowrap}
.navlink.active{background:#2563eb;color:#fff;box-shadow:0 4px 12px #2563eb33}.navlink:hover,.ui-nav-link:hover{background:#1e293b;color:#fff}.navlink.active:hover{background:#1d4ed8}
.navicon{width:20px;flex:none;font-size:19px;display:grid;place-items:center}.navicon svg{width:20px;height:20px}
.navfoot{background:#1e293b60;border-color:#334155;margin-top:auto}.navfoot small{font-size:11px;color:#94a3b8}.navfoot b{color:#cbd5e1;font-weight:500}
.ui-nav-checkbox{position:absolute;opacity:0;width:1px;height:1px;top:8px;left:8px}
.ui-nav-toggle{display:flex;gap:10px;align-items:center;order:2;color:#94a3b8;cursor:pointer;border:1px solid #334155;border-radius:8px;padding:8px 12px;font-size:12px}
.ui-nav-checkbox:focus-visible+.ui-nav-toggle{outline:3px solid #60a5fa;outline-offset:3px}
.app:has(#uiNavCollapsed:checked){--ui-sidebar:76px}
.app:has(#uiNavCollapsed:checked) .sidenav{padding:28px 10px 16px;align-items:center}
.app:has(#uiNavCollapsed:checked) .sidenav :is(.brand>div:last-child,.navtext,.navtitle,.navfoot,.ui-nav-toggle-text){display:none}
.app:has(#uiNavCollapsed:checked) .navlink,.app:has(#uiNavCollapsed:checked) .ui-nav-link{justify-content:center;padding:12px}
.app:has(#uiNavCollapsed:checked) .brand{padding:0}.app:has(#uiNavCollapsed:checked) .ui-nav-toggle{padding:8px 12px}
/* TOP HEADER */
.main{min-width:0;padding:0 28px 28px;gap:20px;display:flex;flex-direction:column;overflow:visible}
.pagehead{position:sticky;top:0;z-index:1040;min-height:64px;padding:8px 0;display:flex;align-items:center;gap:18px;background:#f8fafc;border-bottom:1px solid var(--line)}
.pagehead>div:first-child{flex:1;min-width:240px}.pagehead h1{font-size:20px;line-height:1.3;font-weight:700;letter-spacing:-.4px;margin:2px 0}.subtitle{font-size:12px;line-height:1.6;color:#64748b}.ui-context-row{display:flex;gap:12px;align-items:center;justify-content:space-between}.ui-context-row .actions{gap:8px}
.ui-breadcrumb{font-size:11px;color:#64748b}.ui-breadcrumb span{padding:0 8px;color:#cbd5e1}
.pagehead .actions{gap:8px;flex-wrap:wrap}.sync-pill{font-size:11px;font-weight:500;background:#d1fae5;color:#065f46;border:0;padding:6px 10px}.sync-pill.offline{background:#fef3c7;color:#92400e}
.btn{font-weight:600;font-size:13px;border:1px solid #cbd5e1;border-radius:8px;min-height:40px;box-shadow:0 1px 2px #0f172a05;text-decoration:none;padding:9px 13px;color:#334155;background:#fff}
.btn:hover{background:#f1f5f9;border-color:#94a3b8}.btn.primary,.btn.blue{background:#2563eb;border-color:#2563eb;color:#fff}.btn.primary:hover,.btn.blue:hover{background:#1d4ed8;border-color:#1d4ed8}.btn.danger{background:#fef2f2;color:#991b1b;border-color:#fecaca}.btn.small{min-height:36px;font-size:12px}
.ui-account{position:relative;flex:none;margin:0}.ui-account>summary{list-style:none;cursor:pointer;border:1px solid var(--line);border-radius:9px;padding:9px 12px;background:#fff;font-size:12px;color:#334155;display:flex;gap:8px;align-items:center;min-height:40px}.ui-account>summary::-webkit-details-marker{display:none}
.ui-account .auth-card{position:absolute;right:0;top:calc(100% + 8px);width:260px;z-index:1100;padding:16px;background:white;border:1px solid var(--line);box-shadow:0 12px 36px #0f172a20;border-radius:12px;gap:12px}.auth-name{color:#0f172a;font-size:13px}.auth-badge.admin{background:#eff6ff;color:#1d4ed8;border-color:#bfdbfe}.auth-btn,.auth-btn.login-primary{background:#f8fafc;border:1px solid var(--line);color:#334155}.auth-btn:hover{background:#eff6ff;color:#1d4ed8}
/* KPI CARDS */
.stats{grid-template-columns:repeat(4,minmax(0,1fr));gap:16px}.stat{border:1px solid var(--line);border-radius:var(--ui-radius);padding:18px 20px;box-shadow:0 2px 6px #0f172a03;background:#fff}.stathead{font-size:12px;font-weight:500;gap:8px;color:#64748b}.stathead>span{width:30px;height:30px;display:grid;place-items:center;background:#eff6ff;border-radius:8px;font-size:18px;color:#2563eb}.statnum{font-size:30px;line-height:1.3;font-weight:700;color:#0f172a;margin-top:8px;font-variant-numeric:tabular-nums;letter-spacing:-.8px}.stathint{font-size:11px;color:#64748b;margin-top:4px}.stat:nth-child(2) .stathead>span{background:#d1fae5;color:#065f46}.stat:nth-child(3) .stathead>span{background:#fef3c7;color:#92400e}.stat:nth-child(4) .stathead>span{background:#fee2e2;color:#991b1b}
/* AUXILIARY TOOLS: preserve every synchronization, approval and import control. */
.ui-tools{border:1px solid var(--line);background:#fff;border-radius:10px;margin:0}.ui-tools>summary{padding:12px 16px;cursor:pointer;font-size:12px;font-weight:600;color:#475569}.ui-tools-content{padding:0 16px 16px;display:grid;gap:14px}.ui-tools .connection-panel{position:static;margin:0;max-width:none;background:#f8fafc}.ui-tools .sync-result{margin:0;box-shadow:none}.ui-tools .contentpanel{margin:0}.ui-tools .manage-shortcuts{margin:0;gap:8px}.ui-tools .sheet-status{font-size:12px}.ui-tools .test-banner{flex-wrap:wrap}.ui-tools .test-banner>div{min-width:0}.ui-tools .release-tag{margin-left:auto;color:#64748b}.source-status{margin:0;color:#64748b;font-size:12px}.source-status:empty{display:none}
/* MAIN WORKSPACE: map 58%, results 42%, with map first. */
.panel{border:1px solid var(--line);border-radius:var(--ui-radius);box-shadow:var(--ui-shadow)}
.maplayout{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(320px,1fr);height:calc(100dvh - 340px);min-height:540px;position:relative;isolation:isolate}
.maparea{grid-column:1;grid-row:1;background:#e2e8f0;min-height:0}.mapleft{grid-column:2;grid-row:1;border-right:0;border-left:1px solid var(--line);display:flex;flex-direction:column;min-height:0;max-height:none;height:auto;background:#fff;z-index:600}
.mapcorner{top:16px;left:16px;right:16px;gap:8px}.mapcorner .btn,.basemap-select{box-shadow:0 3px 10px #0f172a15;border:1px solid #dbe3ed;background:#fffffff2;color:#334155;min-height:38px}.mapcorner .btn.primary{background:#2563eb;color:#fff}.basemap-select{border-radius:8px;font-weight:500}.legend{box-shadow:0 4px 16px #0f172a10;border:1px solid var(--line);font-weight:500;font-size:11px;background:#ffffffeb}
/* FILTER BAR */
.filterbox{padding:20px;border-bottom:1px solid var(--line)}.sectionheading{margin-bottom:14px}.sectionheading h2{font-size:16px;font-weight:600;color:#0f172a}.smallcounter{background:#eff6ff;color:#1d4ed8;font-weight:600;font-size:11px}.search-mode-row{margin-bottom:10px;gap:8px}.searchwrap input{background:#f8fafc;border:1px solid #cbd5e1;border-radius:8px;min-height:42px;font-size:14px}.searchwrap input:focus{background:#fff;border-color:#2563eb;box-shadow:0 0 0 3px #2563eb18}.fieldselect,#streetChoice{border:1px solid #cbd5e1;border-radius:8px;color:#334155;background:#fff;min-height:40px;font-size:12px}.selectors{gap:8px;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:10px}.search-feedback{background:#f8fafc;border-bottom:1px solid var(--line);padding:10px 20px;color:#64748b;font-size:11px;line-height:1.6}.search-feedback button{color:#2563eb;min-height:32px}.records{padding:8px 12px;min-height:0;overflow:auto;overscroll-behavior:contain}.record{padding:12px;border:1px solid var(--line);margin:6px 0;border-radius:10px}.record:hover,.record.selected{background:#eff6ff;border-color:#93c5fd}.record-info strong{font-weight:600}.numtile{background:#eff6ff;color:#1d4ed8;border-color:#dbeafe;font-weight:700}.status{padding:3px 8px;border-radius:999px;font-size:11px;font-weight:500;white-space:nowrap}.status.verified{color:#065f46;background:#d1fae5}.status.pending{color:#92400e;background:#fef3c7}.status.review{color:#991b1b;background:#fee2e2}.status:before{width:5px;height:5px}.verified{color:#10b981}.pending{color:#f59e0b}.review{color:#ef4444}.dot.verified,.pin.verified{background:#10b981}.dot.pending,.pin.pending{background:#f59e0b}.dot.review,.pin.review{background:#ef4444}
/* DATA TABLE */
.contentpanel{padding:20px}.tabletop{margin-bottom:18px;align-items:center}.tabletop h2,h2{font-size:16px;font-weight:600}.tablewrap{max-height:65dvh;overflow:auto;isolation:isolate;border:1px solid var(--line);border-radius:10px}.datatable{min-width:1060px;border-collapse:separate;border-spacing:0}.datatable th{position:sticky;top:0;z-index:2;background:#f8fafc;color:#64748b;padding:13px 16px;border-bottom:1px solid var(--line);text-transform:none;font-size:12px;font-weight:600;white-space:nowrap}.datatable td{font-size:14px;line-height:1.55;padding:14px 16px;border-bottom:1px solid #f1f5f9;vertical-align:middle;background:#fff}.datatable tbody tr:hover td{background:#f8fafc}.datatable :is(th,td):nth-child(7){text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;font-size:12px}.datatable :is(th,td):nth-child(6){text-align:center}.datatable :is(th,td):last-child{position:sticky;right:0;z-index:1;white-space:nowrap;border-left:1px solid var(--line);background:#fff;box-shadow:-6px 0 10px #0f172a04}.datatable th:last-child{z-index:3;background:#f8fafc}.datatable td[colspan]{position:static;text-align:center}.tableaction{min-height:36px;padding:7px 10px;border:1px solid var(--line);border-radius:7px;background:#fff;color:#334155;font-size:12px;font-weight:500}.tableaction:hover{border-color:#93c5fd;background:#eff6ff}.settingsgrid{gap:20px}.settingscard{padding:24px;border:1px solid var(--line);box-shadow:none;border-radius:14px}.settingscard h3,.chartbox h3{font-size:16px;font-weight:600}.settingscard p{font-size:13px;color:#64748b}.barfill{background:#2563eb}
/* MODAL / SLIDE-OVER: original close, save, QR and map picking hooks unchanged. */
#modalOverlay{padding:0;align-items:stretch;justify-content:flex-end;background:#0f172a66;backdrop-filter:blur(2px)}
#modalOverlay .modal{width:min(720px,100%);height:100dvh;max-height:100dvh;border-radius:18px 0 0 18px;box-shadow:-12px 0 48px #0f172a25;animation:ui-drawer-in .2s ease-out}
@keyframes ui-drawer-in{from{transform:translateX(32px);opacity:.5}to{transform:translateX(0);opacity:1}}
.modalhead{padding:18px 24px;background:#fff}.modalhead h2{font-size:18px;font-weight:600}.modalbody{padding:20px 24px;background:#f8fafc;gap:20px}.modalfoot{padding:16px 24px;background:#fff;box-shadow:0 -6px 18px #0f172a05}.form-section{border:1px solid var(--line);border-radius:12px;padding:18px;background:#fff}.form-section-title{color:#0f172a;font-size:14px;font-weight:600;text-transform:none;letter-spacing:0;flex-wrap:wrap;gap:10px;margin-bottom:16px}.control label{font-size:12px;font-weight:500;color:#475569}.control input,.control select,.control textarea{background:#fff;border:1px solid #cbd5e1;border-radius:8px;font-size:14px;min-height:42px}.control :is(input,select,textarea):focus{border-color:#2563eb;box-shadow:0 0 0 3px #2563eb15}.control input[type=number]{font-variant-numeric:tabular-nums}.closebtn{width:40px;height:40px;background:#f1f5f9;border-radius:8px}.closebtn:hover{background:#e2e8f0}.gps-status{color:#334155;border-color:var(--line);box-shadow:var(--ui-shadow)}#qrReaderBox{background:#f8fafc;border-color:var(--line)}#qrMessage{color:#334155}
/* LEAFLET DETAIL CARD — leave popup buttons and click propagation intact. */
.leaflet-popup-content-wrapper{border-radius:14px;border:1px solid var(--line);box-shadow:0 12px 36px #0f172a24;padding:3px}.leaflet-popup-content{font-family:Inter,"Segoe UI",sans-serif;font-size:13px;line-height:1.6;margin:16px!important}.popup-title{font-size:17px;font-weight:700}.popup-sub{font-size:12px;color:#64748b}.popup-owner{background:#eff6ff;color:#1e40af;border-radius:8px;padding:8px 10px}.popup-btns{gap:8px;margin-top:14px}.popup-button{background:#2563eb;border-radius:8px;min-height:40px}.popup-button.nav{background:#0f172a}.house-popup .popup-button{min-height:44px}
/* PUBLIC / FIELD MAP: floating search, about 80% viewport for the map. */
body[data-role=guest] .app{display:flex;min-height:100dvh;height:auto;overflow:visible}
body[data-role=guest] .sidenav{height:auto;position:static;display:flex;flex-direction:row;padding:12px 24px;gap:16px;background:#0f172a;overflow:visible}
body[data-role=guest] .sidenav :is(.ui-nav-checkbox,.ui-nav-toggle){display:none}
body[data-role=guest] .main{padding:0 20px 20px;gap:10px}
body[data-role=guest] .pagehead{position:static;min-height:64px;padding:10px 0;background:transparent;backdrop-filter:none;border:0}
body[data-role=guest] .pagehead h1{font-size:18px}body[data-role=guest] .ui-breadcrumb,body[data-role=guest] .ui-account{display:none}
body[data-role=guest] .maplayout{display:block;position:relative;min-height:540px;height:calc(100dvh - 178px);overflow:hidden}
body[data-role=guest] .maparea{height:100%;width:100%}
body[data-role=guest] .mapleft{position:absolute;left:18px;top:18px;bottom:auto;width:min(360px,calc(100% - 36px));max-height:calc(100% - 100px);height:auto;z-index:650;border:1px solid #ffffffd9;border-radius:14px;background:#fffffff0;backdrop-filter:blur(16px);box-shadow:0 10px 36px #0f172a20;overflow:hidden}
body[data-role=guest] .filterbox{padding:16px;background:transparent}body[data-role=guest] .mapleft .sectionheading h2{font-size:15px}
body[data-role=guest] .selectors{grid-template-columns:1fr 1fr}
body[data-role=guest] .records{flex:0 1 auto;max-height:26dvh;padding:6px 10px;min-height:0}
body[data-role=guest] .mapcorner{left:auto;right:16px;max-width:calc(100% - 420px);justify-content:flex-end;z-index:700}
body[data-role=guest] .search-feedback{padding:8px 16px;background:#f8fafcb3}
body[data-role=guest] .signed-staff-entry{position:absolute;right:20px;top:15px;padding:0;z-index:1200}
body[data-role=guest] .unit-footer{font-size:11px;background:#f8fafc;color:#64748b;padding:8px}
body:not([data-role=admin]) .ui-admin-only,body[data-role=guest] .ui-workspace-only{display:none!important}
/* MEDIUM SCREENS */
@media(min-width:821px) and (max-width:1250px){.main{padding-inline:20px}.pagehead{gap:10px}.pagehead>div:first-child{flex-basis:100%}.pagehead .actions{flex:1}.maplayout{grid-template-columns:minmax(0,1.15fr) minmax(300px,1fr)}.stat{padding:14px}.stathead{font-size:11px}.statnum{font-size:26px}}
/* MOBILE: native menu, reachable controls, scrollable table, full-width drawer. */
@media(max-width:820px){
 html{scroll-padding-top:12px}.app{display:flex;flex-direction:column;min-height:100dvh;height:auto;overflow:visible}.sidenav{position:relative;top:auto;height:auto;min-height:0;padding:14px 16px;display:grid;grid-template-columns:1fr auto;gap:12px;overflow:visible}.brand{grid-column:1;grid-row:1}.brand strong{font-size:14px}.brandmark{width:34px;height:34px}.brand small{font-size:8px}.ui-nav-toggle{grid-column:2;grid-row:1;order:0;min-height:40px}.ui-nav-toggle-text{display:none}.sidenav>div:not(.brand),.sidenav>.navfoot{display:none}.sidenav:has(#uiNavCollapsed:checked)>div:not(.brand){display:block;grid-column:1/-1}.sidenav:has(#uiNavCollapsed:checked) .navfoot{display:none}.app:has(#uiNavCollapsed:checked) .sidenav{display:grid;align-items:stretch;padding:14px 16px}.app:has(#uiNavCollapsed:checked) .sidenav .brand>div:last-child{display:block}.app:has(#uiNavCollapsed:checked) .sidenav .navtext{display:block}.app:has(#uiNavCollapsed:checked) .navlink,.app:has(#uiNavCollapsed:checked) .ui-nav-link{justify-content:flex-start;padding:10px 12px}
 .main{padding:0 12px 20px;gap:14px;overflow:visible}.pagehead{position:relative;top:auto;padding:14px 0;gap:10px;min-height:0;flex-wrap:wrap;background:transparent;backdrop-filter:none}.pagehead>div:first-child{min-width:0;flex-basis:100%}.pagehead h1{font-size:18px}.ui-breadcrumb{font-size:10px}.pagehead .actions{width:auto;flex:1;gap:6px}.pagehead .actions .btn{min-height:40px;padding:8px;font-size:11px}#newBtn{width:auto;min-height:40px}.ui-account{margin-left:auto}.ui-account>summary{font-size:11px;padding:8px}.sync-pill{font-size:10px;padding:5px 8px}.stats,.stats.hide-on-mobile-map{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:12px}.stathead{font-size:11px}.statnum{font-size:25px}.stathint{font-size:10px}.stathead>span{width:24px;height:24px;font-size:14px}
 .ui-tools>summary{padding:12px;font-size:11px}.ui-tools-content{padding:0 10px 10px}.ui-tools .actions{gap:6px}.ui-tools .test-banner .btn{white-space:normal}.ui-tools .test-banner>div{max-width:100%}.ui-tools .release-tag{margin-left:0}.ui-tools .sheet-status{overflow-wrap:anywhere}
 body:not(.is-picking) .maplayout{position:relative;display:flex;flex-direction:column;min-height:0;height:auto;overflow:hidden}
 body:not(.is-picking) .maparea{order:0;min-height:380px;height:56dvh;flex:none;grid-column:auto}
 body:not(.is-picking) .mapleft,body:not(.is-picking) .mapleft.collapsed{order:1;position:relative;top:auto;left:auto;bottom:auto;width:100%;max-height:none;height:auto;min-height:0;border-left:0;border-top:1px solid var(--line);border-radius:0;background:white;box-shadow:none;backdrop-filter:none;grid-column:auto}
 .filterbox{padding:14px}.sectionheading{margin-bottom:10px}.sectionheading h2{font-size:14px}.mobile-drawer-toggle{display:inline-flex;align-items:center;min-height:36px;padding:6px 8px;font-size:11px;border:1px solid var(--line);background:#f8fafc;color:#475569;border-radius:7px}
 body:not(.is-picking) .mapleft .selectors,body:not(.is-picking) .mapleft.collapsed .selectors{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr));margin-top:8px;gap:8px}
 body:not(.is-picking) .mapleft.collapsed .search-feedback{display:block}.search-mode-row{margin:0 0 8px}.fieldselect{font-size:12px;min-height:42px}.searchwrap input{font-size:16px;min-height:44px}.search-feedback{padding:8px 14px}body:not(.is-picking) .mapleft .records{max-height:260px;min-height:0}body:not(.is-picking) .mapleft.collapsed .records{display:none}
 .mapcorner{top:12px;left:12px;right:12px;gap:6px}.mapcorner .btn,.basemap-select{min-height:40px;padding:8px;font-size:11px}.legend{bottom:14px;font-size:10px;gap:8px;padding:8px}.contentpanel{padding:14px}.tabletop h2{font-size:15px}.tabletop .actions{width:100%}#tableSearch{min-width:0!important;width:100%;font-size:16px}.tablewrap{max-height:68dvh}.datatable th,.datatable td{padding:12px}.datatable :is(th,td):last-child{white-space:normal;min-width:90px}.tableaction{margin:3px 0;min-height:40px}.settingsgrid,.charts{grid-template-columns:minmax(0,1fr)}.settingscard{padding:16px}.settingscard .twocol{grid-template-columns:1fr}
 #modalOverlay .modal{width:100%;max-height:100dvh;height:100dvh;border-radius:0}.modalhead{padding:14px 16px}.modalhead h2{font-size:16px}.modalbody{padding:14px;gap:14px}.modalfoot{padding:12px 14px calc(12px + env(safe-area-inset-bottom,0px));gap:8px}.modalfoot .btn{font-size:12px;min-height:44px}.modalfoot>div{gap:8px!important}.form-section{padding:14px}.form-section-title{font-size:13px;align-items:flex-start;gap:10px}.form-section-title>div{flex-wrap:wrap}.twocol,.threecol{grid-template-columns:1fr}.control input,.control select,.control textarea{min-height:44px;font-size:16px}
 body[data-role=guest] .sidenav{padding:12px 16px}body[data-role=guest] .main{padding:0 10px 12px;gap:8px}body[data-role=guest] .pagehead{padding:10px 2px;min-height:60px}body[data-role=guest] .pagehead h1{font-size:16px}body[data-role=guest] .signed-staff-entry{position:static;align-self:flex-end;padding:0;margin-top:10px}body[data-role=guest] .signed-staff-entry .btn{font-size:12px}
 body[data-role=guest]:not(.is-picking) .maplayout{display:block;height:calc(100dvh - 170px);min-height:620px}body[data-role=guest]:not(.is-picking) .maparea{height:100%;min-height:0}
 body[data-role=guest]:not(.is-picking) .mapleft,body[data-role=guest]:not(.is-picking) .mapleft.collapsed{position:absolute;top:12px;left:12px;width:calc(100% - 24px);max-height:52%;height:auto;border:1px solid #ffffffd9;border-radius:12px;background:#fffffff0;backdrop-filter:blur(16px);box-shadow:0 8px 28px #0f172a1a}
 body[data-role=guest] .filterbox{padding:12px}body[data-role=guest] .sectionheading{margin-bottom:8px}body[data-role=guest] .sectionheading h2{font-size:14px}body[data-role=guest] .mapcorner{top:auto;bottom:24px;left:12px;right:12px;max-width:none;justify-content:flex-start}.mobile-survey-actions .btn{border-radius:8px;font-size:12px}.mobile-survey-actions{background:#fffffff5;border-color:var(--line)}
}
@media(min-width:821px) and (max-width:1100px){body[data-role=guest] .mapcorner{left:auto;right:16px;max-width:180px;flex-direction:column;align-items:stretch}}
@media(min-width:1600px){.main{padding-inline:36px}.maplayout{grid-template-columns:minmax(0,1.4fr) minmax(380px,1fr)}.filterbox .selectors{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;scroll-behavior:auto!important;transition:none!important}}
/* Existing fullscreen map-picking mode has priority over the workspace layout. */
body.is-picking .ui-account,body.is-picking .ui-tools{display:none!important}

@media(max-width:820px){.ui-context-row{align-items:flex-start;flex-wrap:wrap}.ui-context-row .actions .btn{min-height:40px;font-size:11px}.ui-context-row .subtitle{flex:1;min-width:160px}}

/* Existing action text remains in the accessibility tree; icons receive tooltips. */
.tableaction{position:relative;display:inline-grid;place-items:center;width:36px;height:36px;padding:0;font-size:0;vertical-align:middle;margin-right:4px}
.tableaction::before{font-size:18px;line-height:1}
.tableaction[data-focus-id]::before{content:"⌖"}.tableaction[data-edit-id]::before{content:"✎"}.tableaction[data-req-login]::before{content:"↪"}
.tableaction::after{position:absolute;right:0;bottom:calc(100% + 6px);padding:5px 8px;border-radius:5px;color:white;background:#0f172a;white-space:nowrap;font-size:11px;font-weight:400;opacity:0;pointer-events:none;z-index:8}
.tableaction[data-focus-id]::after{content:"Xem trên bản đồ"}.tableaction[data-edit-id]::after{content:"Sửa hồ sơ"}.tableaction[data-req-login]::after{content:"Đăng nhập để sửa"}
.tableaction:is(:hover,:focus-visible)::after{opacity:1}
body .unit-footer{background:#f8fafc;color:#64748b;border-top:1px solid #e2e8f0;font-size:12px;font-weight:400}
@media(max-width:820px){.tableaction{width:42px;height:44px}}


/* Compact address lookup: one disclosure controls filters and results on every screen. */
body:not(.is-picking) #mapView.maplayout{display:block;position:relative;isolation:isolate;overflow:hidden}
body:not(.is-picking) #mapView .maparea{width:100%;height:100%;min-height:0}
body:not(.is-picking) #mapLeftDrawer.mapleft{position:absolute;top:12px;left:12px;bottom:auto;width:340px;max-width:calc(100% - 72px);height:auto;min-height:0;max-height:calc(100% - 88px);display:flex;flex-direction:column;border:1px solid #dbe3ed;border-radius:12px;background:#fff;box-shadow:0 6px 24px #0f172a20;overflow:hidden;z-index:650;backdrop-filter:none}
body:not(.is-picking) #mapLeftDrawer.mapleft.collapsed{width:fit-content;max-width:calc(100% - 72px)}
.address-search-heading{display:flex;align-items:center;gap:8px;padding:6px 10px;flex:none;min-height:52px}
.address-search-heading h2{font-size:14px;margin:0;flex:1;white-space:nowrap}
.address-search-heading .smallcounter{white-space:nowrap;font-size:10px}
#toggleDrawerBtn{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 10px;font-size:13px;font-weight:600;white-space:nowrap;background:#eff6ff;color:#1d4ed8;border:1px solid #bfdbfe;border-radius:8px;cursor:pointer}
#mapLeftDrawer.collapsed .address-search-heading{padding:4px;min-height:52px}
#mapLeftDrawer.collapsed .address-search-heading :is(h2,.smallcounter){display:none}
.address-search-content{min-height:0;overflow:auto;overscroll-behavior:contain;border-top:1px solid var(--line)}
#mapLeftDrawer .filterbox{padding:10px;border:0}
#mapLeftDrawer .search-mode-row{margin:0 0 8px;gap:6px}
#mapLeftDrawer .selectors{margin-top:8px;gap:6px;grid-template-columns:repeat(2,minmax(0,1fr))}
#mapLeftDrawer .fieldselect{min-width:0;width:100%;min-height:40px}
#mapLeftDrawer .search-feedback{padding:6px 10px;line-height:1.4}
#mapLeftDrawer .records{max-height:none;overflow:visible;padding:4px 8px;flex:none}
#mapLeftDrawer .record{padding:8px;margin:4px 0}
body:not(.is-picking) #mapView .mapcorner{left:auto;right:12px;top:64px;bottom:auto;max-width:180px;flex-direction:column;align-items:stretch;gap:6px}
@media(max-width:820px){
 body:not(.is-picking) #mapView.maplayout{height:calc(100dvh - 210px);min-height:360px}
 body:not(.is-picking) #mapLeftDrawer.mapleft{top:8px;left:8px;width:340px;max-width:calc(100% - 60px);max-height:min(42dvh,320px)}
 .address-search-heading{gap:6px;padding:4px 8px}
 .address-search-heading h2{font-size:13px}
 .address-search-heading .smallcounter{display:none}
 #toggleDrawerBtn{min-height:44px}
 #mapLeftDrawer :is(input,select){font-size:16px;min-height:44px}
 #mapLeftDrawer #searchAddressBtn{min-height:44px}
 body:not(.is-picking) #mapView .mapcorner{top:auto;bottom:38px;left:8px;right:8px;max-width:none;flex-direction:row;flex-wrap:wrap;gap:6px}
 #mapView .mapcorner :is(.btn,.basemap-select){min-height:44px;padding:7px 9px;font-size:12px}
}

.unit-footer{padding:14px 20px;background:#e7f1ee;color:#153c35;font:600 13px system-ui;text-align:center}body.map-pick-mode .unit-footer{display:none}
