/* Offline counting screens. The floating dock inherits the existing app-shell style. */
body.offline-counting{background:#f7f9fb;padding-bottom:150px!important;color:#172b3a}
.offline-counting .app-shell-brand,.offline-counting .app-shell-dock:not(.offline-count-dock){display:none!important}
#offlineIdentity{position:sticky;top:0;z-index:20;padding:14px 16px;background:#eff8f4;border-bottom:1px solid #d9e7e3;font-size:14px;font-weight:700;overflow-wrap:anywhere}
.offline-counting main{max-width:900px;padding:12px;margin:auto}
.offline-counting #scanPanel{background:white;border:1px solid #e3e9e8;border-radius:18px;min-height:65vh;padding:16px}
.offline-counting #scanTitle{text-align:center;font-size:19px;margin:4px 0 22px;overflow-wrap:anywhere}
.offline-counting .count-operator,.offline-counting #switchSession,.offline-counting #catalogState,.offline-counting #scanPanel>h3,.offline-counting #reloadOwn{display:none}
.scanner-summary-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:16px 0 24px}
.scanner-summary-cards>div{text-align:center;background:#eff7f4;border:1px solid #d9e7e3;border-radius:12px;padding:18px 3px}
.scanner-summary-cards strong{display:block;font-size:30px;margin:8px 0}.scanner-summary-cards small{font-size:13px;color:inherit}.scanner-summary-cards span{font-size:13px}
.offline-counting .count-table-wrap{overflow:auto;min-height:40vh}.offline-counting th{color:#172b3a}.offline-counting td{overflow-wrap:anywhere;font-size:13px}
#offlineBoxSelection{border:0;padding:0;margin:0}#offlineBoxSelection select{width:100%}#offlineBoxSelection .toolbar{display:grid;grid-template-columns:1fr 1fr}
.offline-counting #capture>.toolbar,.offline-counting #capture>p:not(#scannerStatus){display:none}
.offline-counting #capture>.offline-camera-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.offline-counting #capture .camera-shell{max-width:none;width:100%}.offline-counting #video{display:block;width:100%;height:clamp(170px,46vw,350px);object-fit:cover;max-height:none}
.offline-counting #reticle{inset:12% 12%;height:auto;border:2px solid white;border-radius:16px}
.offline-counting #scannerStatus{text-align:center;font-weight:600;color:#166534;margin:16px 0}
#offlineScanHeading{text-align:center;font-size:clamp(20px,5vw,28px);margin:24px 0}
.offline-counting #barcodeForm{display:none}.offline-counting #capture .table-scroll{min-height:32vh;max-height:50vh;border:1px solid #e3e9e8}
.offline-counting[data-offline-input=bluetooth] .camera-shell,.offline-counting[data-offline-input=bluetooth] #capture>.offline-camera-actions{display:none!important}
#offlineCatalogTotals{position:fixed;bottom:96px;left:12px;right:12px;text-align:center;font-size:13px;font-weight:700;margin:0;background:#f7f9fb;padding:8px;z-index:25}
.offline-count-dock>button{position:relative}.offline-upload-badge{position:absolute;right:-3px;top:-5px;border-radius:20px;background:white;color:#c2410c;min-width:18px;font-size:11px;padding:1px 3px}
.offline-count-dock[hidden],#offlineCatalogTotals[hidden],#offlineIdentity[hidden]{display:none!important}
@media(max-width:360px){.offline-count-dock{gap:7px;padding:10px}.offline-count-dock>button{width:44px;min-width:44px;flex-basis:44px}.offline-counting main{padding:8px}.offline-counting #scanPanel{padding:12px}}

#offlineReadyStatus{text-align:center;color:#166534;font-weight:650;margin:20px 0} .offline-counting #scanPanel>h2#scanTitle{margin-bottom:16px}

/* Summary occupies the viewport; only the count-sheet table scrolls. */
.offline-counting #scanTitle{display:none!important}
body.offline-counting[data-offline-view="summary"]{height:100dvh;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;padding-bottom:calc(138px + env(safe-area-inset-bottom,0px))!important}
.offline-counting[data-offline-view="summary"] #offlineIdentity{position:relative;flex:none}
.offline-counting[data-offline-view="summary"] main{flex:1;min-height:0;overflow:hidden;width:100%;box-sizing:border-box;margin:0 auto;display:flex;flex-direction:column}
.offline-counting[data-offline-view="summary"] #message{flex:none;max-height:64px;overflow:auto;margin:0 0 8px}
.offline-counting[data-offline-view="summary"] #scanPanel{flex:1;min-height:0;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;margin:0}
.offline-counting[data-offline-view="summary"] #offlineReadyStatus{flex:none;margin:8px 0 12px}
.offline-counting[data-offline-view="summary"] #ownSheets{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
.offline-counting[data-offline-view="summary"] .scanner-summary-cards{flex:none;margin:8px 0 16px}
.offline-counting[data-offline-view="summary"] .count-table-wrap{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.offline-counting[data-offline-view="summary"] .count-table-wrap th{position:sticky;top:0;z-index:1}
@media(max-height:650px){.offline-counting[data-offline-view="summary"] .scanner-summary-cards>div{padding:8px 3px}.offline-counting[data-offline-view="summary"] .scanner-summary-cards strong{font-size:24px;margin:4px 0}}

/* Camera capture follows the reference: edge-to-edge preview, no outer card. */
body.offline-counting[data-offline-view="capture"][data-offline-input="camera"]{height:100dvh;overflow:hidden;display:flex;flex-direction:column;box-sizing:border-box;padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important;background:white}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #offlineIdentity{position:relative;flex:none}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] main{flex:1;min-height:0;overflow:hidden;width:100%;max-width:none;box-sizing:border-box;margin:0;padding:8px;display:flex;flex-direction:column}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #scanPanel{flex:1;min-height:0;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;display:flex;flex-direction:column;overflow:hidden}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #capture{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #capture .scanner-capability-controls,
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #capture>div:has(>.scanner-control-button){display:none!important}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] .camera-shell{flex:none;border:0;border-radius:0;overflow:hidden}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #video{height:min(27dvh,46vw);min-height:100px}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] .offline-camera-actions{flex:none;margin:8px 0}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #scannerStatus{flex:none;margin:4px 0;font-size:13px}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #offlineScanHeading{flex:none;margin:10px 0;font-size:22px}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #capture>label{flex:none;margin:8px 0}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #capture .table-scroll{flex:1;min-height:0;max-height:none;overflow:auto;margin:8px 0 0;overscroll-behavior:contain}

/* Transient messages float above the app and never change its layout. */
body[data-app-shell="PCOUNT Standalone"] #message:not(:empty){position:fixed!important;top:16px;left:50%;transform:translateX(-50%);width:min(440px,calc(100vw - 32px));box-sizing:border-box;z-index:22000;margin:0!important;padding:14px 18px;border:1px solid #fed7aa;border-radius:14px;background:#fff7ed;color:#7c2d12;box-shadow:0 8px 28px #0f172a26;font-size:14px;line-height:1.45;max-height:25vh;overflow:auto;pointer-events:none}

/* Keep the viewfinder anchored to video, not to dynamically added photo controls. */
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] .scanner-qr-photo-actions{display:none!important}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] .camera-shell{position:relative!important;height:max(100px,min(27dvh,46vw));min-height:0;overflow:hidden!important;isolation:isolate}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #video{position:absolute;inset:0;width:100%!important;height:100%!important;min-height:0;object-fit:cover}
.offline-counting[data-offline-view="capture"][data-offline-input="camera"] #reticle{position:absolute!important;inset:12% 12%!important;width:auto!important;height:auto!important;max-width:none;max-height:none;margin:0!important;transform:none!important;box-sizing:border-box;z-index:2;pointer-events:none}

/* Summary and Bluetooth capture share a full-page surface, not an outer card. */
body.offline-counting #scanPanel{border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;padding:0!important}
.offline-counting[data-offline-input="bluetooth"] #capture>div:has(>input[aria-label="Bluetooth barcode"]){display:flex!important;width:100%;box-sizing:border-box;margin:8px 0!important}
.offline-counting[data-offline-input="bluetooth"] #capture>div:has(>input[aria-label="Bluetooth barcode"])>button{display:none!important}
.offline-counting #capture input[aria-label="Bluetooth barcode"]{width:100%!important;min-width:0!important;flex:1 1 100%!important;box-sizing:border-box;font-size:16px}
@media(max-width:768px){
 body.offline-counting{height:100dvh;overflow:hidden!important;display:flex;flex-direction:column;box-sizing:border-box;padding-bottom:calc(94px + env(safe-area-inset-bottom,0px))!important}
 body.offline-counting[data-offline-view="summary"]{padding-bottom:calc(138px + env(safe-area-inset-bottom,0px))!important}
 .offline-counting #offlineIdentity{position:relative;flex:none}
 .offline-counting main{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;width:100%;box-sizing:border-box;margin:0 auto;padding:8px}
 .offline-counting #scanPanel{display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden;margin:0}
 .offline-counting #capture:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0;overflow:hidden}
 .offline-counting #capture>.table-scroll{flex:1;min-height:0!important;max-height:none!important;overflow:auto;overscroll-behavior:contain;margin:8px 0 0}
 .offline-counting #capture>label,.offline-counting #scannerStatus,.offline-counting #offlineScanHeading{flex:none;margin:8px 0}
 .offline-counting #ownSheets{min-height:0;overflow:hidden}
 .offline-counting #offlineBoxSelection{margin:0;padding:8px 0}
}

.offline-counting #capture .scanner-capability-controls,.offline-counting #capture .scanner-qr-photo-actions,.offline-counting #capture>div>.scanner-control-button{display:none!important}

#ownSheets .sheet-action{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;padding:8px;margin:3px;vertical-align:middle}#ownSheets .sheet-action svg{pointer-events:none}

.offline-camera-actions{display:none!important}.offline-counting[data-offline-input="camera"] #scannerStatus{display:none!important}.offline-count-dock button{min-width:0!important}.offline-count-dock{gap:8px!important}

.offline-counting #capture th,.offline-counting #capture td{padding:4px 8px!important;font-size:13px;line-height:1.25}.offline-counting #scanRows button[data-row]{border:0!important;background:transparent!important;box-shadow:none!important;border-radius:0;padding:4px 8px!important;margin:0;min-height:32px;min-width:36px;font-size:14px;font-weight:600;color:inherit}.offline-counting #scanRows button[data-row]:focus-visible{outline:2px solid #f97316;outline-offset:-2px}

#ownSheets .sheet-action{width:32px;height:32px;min-width:32px;min-height:32px;padding:5px;margin:2px}#ownSheets .sheet-action svg{width:18px;height:18px}

body[data-app-shell="PCOUNT Standalone"] #message[data-tone="success"]{background:#ecfdf5;color:#166534;border-color:#86efac}body[data-app-shell="PCOUNT Standalone"] #message[data-tone="error"]{background:#fef2f2;color:#991b1b;border-color:#fca5a5}body[data-app-shell="PCOUNT Standalone"] #message[data-tone="info"]{background:#eff6ff;color:#1e40af;border-color:#93c5fd}

#offlineIdentity{text-align:center!important;justify-content:center!important}

body[data-app-shell="PCOUNT Standalone"] #message:not(:empty){padding-right:48px;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);pointer-events:auto}
body[data-app-shell="PCOUNT Standalone"] #message[data-tone="success"]{background:rgba(220,252,231,.72)}
body[data-app-shell="PCOUNT Standalone"] #message[data-tone="error"]{background:rgba(254,226,226,.72)}
body[data-app-shell="PCOUNT Standalone"] #message[data-tone="info"]{background:rgba(219,234,254,.72)}
#message .toast-close{position:absolute;right:5px;top:5px;width:34px;height:34px;min-width:34px;min-height:34px;padding:0;margin:0;border:0;background:transparent;box-shadow:none;color:inherit;font-size:25px;line-height:1;cursor:pointer}
#message .toast-close:focus-visible{outline:2px solid currentColor;outline-offset:-4px}

/* COLEROSH orange palette; black installed-app status bar remains unchanged. */
body[data-app-shell="PCOUNT Standalone"]{background:#fff7ed;color:#1d293d;accent-color:#f97316}
body[data-app-shell="PCOUNT Standalone"] main button:not(.secondary):not(.danger):not([data-row]),body[data-app-shell="PCOUNT Standalone"] dialog button:not(.secondary):not(.danger){background:#f97316;border-color:#ea580c;color:#fff}
body[data-app-shell="PCOUNT Standalone"] main button.secondary:not([data-row]),body[data-app-shell="PCOUNT Standalone"] dialog button.secondary{background:#fff;border-color:#fdba74;color:#9a3412}
body[data-app-shell="PCOUNT Standalone"] main button:not([data-row]):not(.danger):hover,body[data-app-shell="PCOUNT Standalone"] dialog button:not(.danger):hover{background:#ea580c;color:#fff}
body[data-app-shell="PCOUNT Standalone"] input:not([type="checkbox"]):not([type="radio"]),body[data-app-shell="PCOUNT Standalone"] select,body[data-app-shell="PCOUNT Standalone"] textarea{border-color:#fdba74;background:#fff;color:#1d293d}
body[data-app-shell="PCOUNT Standalone"] input:focus,body[data-app-shell="PCOUNT Standalone"] select:focus,body[data-app-shell="PCOUNT Standalone"] textarea:focus{outline:2px solid #fb923c;outline-offset:1px;border-color:#f97316}
body[data-app-shell="PCOUNT Standalone"] button:focus-visible{outline:2px solid #f97316;outline-offset:3px}
body[data-app-shell="PCOUNT Standalone"] #offlineIdentity{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
body[data-app-shell="PCOUNT Standalone"] .scanner-summary-cards>div{background:#fff7ed;border-color:#fed7aa}
body[data-app-shell="PCOUNT Standalone"] .scanner-summary-cards strong{color:#9a3412}
body[data-app-shell="PCOUNT Standalone"] th{background:#fff7ed;color:#9a3412;border-color:#fed7aa}
body[data-app-shell="PCOUNT Standalone"] td{border-color:#ffedd5}
body[data-app-shell="PCOUNT Standalone"] #offlineCatalogTotals{background:#fff7ed;color:#9a3412}
body[data-app-shell="PCOUNT Standalone"] dialog{border:1px solid #fed7aa}
body[data-app-shell="PCOUNT Standalone"] .department-choice{background:#fff7ed!important;color:#ea580c!important;border-color:#fed7aa!important}
body[data-app-shell="PCOUNT Standalone"] .department-choice:hover{background:#ffedd5!important}
body[data-app-shell="PCOUNT Standalone"] progress{accent-color:#f97316}
body[data-app-shell="PCOUNT Standalone"] progress::-webkit-progress-value{background:#f97316}
body[data-app-shell="PCOUNT Standalone"] progress::-moz-progress-bar{background:#f97316}
