:root{color-scheme:light;--ink:#13243a;--muted:#5a6b7f;--navy:#10243a;--blue:#1167df;--blue-bg:#e8f1ff;--green:#14734d;--line:#dce4ed;--canvas:#f4f7fb;--surface:#fff;--danger:#b23a42;--radius:14px;--shadow:0 12px 32px #162c441f;font-family:system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;-webkit-tap-highlight-color:transparent}
*{box-sizing:border-box}html{height:100%;background:var(--canvas)}body{min-height:100%;margin:0;color:var(--ink)}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation}button:disabled{opacity:.5;cursor:not-allowed}button:focus-visible,input:focus-visible{outline:3px solid #8ac2ff;outline-offset:2px}svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}h1,h2,p{margin-top:0}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}[hidden]{display:none!important}
.topbar{position:sticky;top:0;z-index:5;background:var(--navy);color:#fff;padding:calc(10px + env(safe-area-inset-top)) 14px 12px;box-shadow:0 5px 20px #10243a2a}.brandline{display:flex;align-items:center;gap:9px;margin-bottom:12px}.brandmark{display:grid;place-items:center;background:#43c8a4;color:var(--navy);width:37px;height:37px;border-radius:11px;font-weight:900;font-size:24px}.brandline strong{display:block;font-size:16px;letter-spacing:-.2px;line-height:1.12}.brandline small{display:block;font-size:11px;color:#b8cbe0;margin-top:2px}.connection{margin-left:auto;background:#243e58;border-radius:30px;font-size:11px;font-weight:800;padding:6px 10px;white-space:nowrap}.connection.online{background:#145e4e;color:#c5ffeb}.connection.offline{background:#693b36;color:#ffe6cf}.searchline{display:flex;gap:9px}.searchbox{display:flex;align-items:center;gap:8px;flex:1;min-width:0;border-radius:12px;background:#fff;color:#4c637b;padding:0 11px;height:49px}.searchbox input{width:100%;min-width:0;border:none;outline:none!important;font-size:16px;color:#10243a;background:transparent}.searchbox input::placeholder{color:#77899b}.search-hint{font-size:14px;color:#9faabb}.iconbutton{border:0;border-radius:12px;min-height:49px;min-width:52px;display:grid;place-items:center;background:#31aeca;color:#fff}.iconbutton svg{width:28px;height:28px}.syncline{display:flex;gap:8px;justify-content:space-between;align-items:center;margin-top:11px;flex-wrap:wrap}.sync-label{font-size:11px;color:#b9cde0}.sync-actions{display:flex;gap:6px;flex-wrap:wrap}.smallbutton{border:1px solid #55728c;background:#203f60;color:#fff;border-radius:8px;padding:7px 9px;font-size:11px;font-weight:750;min-height:35px}.smallbutton.secondary{background:transparent;border-color:#7590a8}.smallbutton.busy{opacity:.55}
.content{padding:16px 12px calc(144px + env(safe-area-inset-bottom));max-width:1050px;margin:0 auto}.catalog-header{background:var(--surface);padding:14px;border:1px solid var(--line);border-radius:var(--radius);margin-bottom:12px}.catalog-heading{display:flex;align-items:baseline;gap:10px;margin-bottom:12px}.catalog-heading h1{font-size:19px;letter-spacing:-.3px;margin:0}.catalog-heading span{font-size:12px;color:var(--muted)}.filter-label{font-size:11px;color:#5e7085;font-weight:850;text-transform:uppercase;letter-spacing:.7px;margin:10px 0 6px}.chips{display:flex;gap:7px;overflow-x:auto;scrollbar-width:none;padding-bottom:3px}.chips::-webkit-scrollbar{display:none}.chip{flex:0 0 auto;border:1px solid #cad9e8;background:#f9fbfe;border-radius:30px;padding:8px 12px;min-height:35px;font-size:12px;color:#374e69;font-weight:700}.chip.active{background:var(--navy);border-color:var(--navy);color:#fff}.products{display:grid;gap:9px}.product-card{min-height:102px;display:grid;grid-template-columns:66px minmax(0,1fr) auto;gap:10px;align-items:center;border:1px solid var(--line);background:var(--surface);padding:10px;border-radius:13px;box-shadow:0 2px 10px #10243a05}.product-thumb{width:66px;height:66px;object-fit:contain;border-radius:10px;background:#edf3f8}.product-info{min-width:0}.product-title{font-weight:800;font-size:13.5px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.product-variant{margin-top:4px;font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.product-metadata{display:flex;align-items:center;flex-wrap:wrap;gap:5px;margin-top:6px;font-size:10.5px;color:#496176}.stock{border-radius:30px;font-weight:800;padding:3px 7px;background:#e8f8ef;color:#126d45}.stock.out{background:#fff0ed;color:#b34434}.product-right{display:flex;flex-direction:column;align-items:end;gap:9px;padding-left:3px;white-space:nowrap}.price{font-size:15px;font-weight:900;letter-spacing:-.4px;font-variant-numeric:tabular-nums}.add-button{min-width:72px;min-height:39px;background:var(--blue);border:0;border-radius:10px;color:#fff;font-weight:800;font-size:13px}.add-button:disabled{background:#8798a9}.product-limit{text-align:center;color:var(--muted);font-size:12px;margin:16px auto}.empty-state{border:1px dashed #b6c7da;background:#fff;border-radius:15px;text-align:center;padding:35px 18px;color:var(--muted)}.empty-state strong{color:var(--ink);display:block;font-size:17px;margin-bottom:7px}
.bottom-shell{position:fixed;bottom:0;left:0;right:0;padding:8px 12px calc(10px + env(safe-area-inset-bottom));background:linear-gradient(0deg,#fff 77%,#fffF);border-top:1px solid var(--line);z-index:8}.utility-actions{max-width:1050px;margin:0 auto 8px;display:flex;justify-content:space-between;align-items:center;gap:8px}.utility-button{background:transparent;border:0;color:#3d536a;font-size:12px;font-weight:750;padding:4px 2px}.utility-note{color:#7c8a9b;font-size:11px;text-align:right}.cart-summary{max-width:1050px;margin:auto;display:flex;width:100%;align-items:center;gap:10px;color:#fff;background:#1167df;border:0;border-radius:14px;padding:13px 13px;min-height:65px;box-shadow:0 8px 20px #1167df55}.cart-icon{font-size:21px;position:relative;width:35px;text-align:left}.cart-icon b{position:absolute;right:-2px;top:-7px;display:grid;place-items:center;min-width:20px;height:20px;border-radius:15px;background:#fff;color:var(--blue);font-size:11px}.cart-label{text-align:left;display:flex;flex-direction:column}.cart-label strong{font-size:14px}.cart-label small{font-size:11px;opacity:.85}.cart-total{font-size:19px;letter-spacing:-.4px;font-weight:900;margin-left:auto;font-variant-numeric:tabular-nums}.chevron{font-size:18px;font-weight:800}
dialog{border:0;padding:0;color:var(--ink);background:#fff}dialog::backdrop{background:#0817299e}.sheet{position:fixed;margin:0;top:auto;left:0;right:0;bottom:0;width:100%;max-width:760px;max-height:min(91dvh,910px);border-radius:18px 18px 0 0;overflow:auto;overscroll-behavior:contain;box-shadow:var(--shadow);padding-bottom:env(safe-area-inset-bottom)}.sheet-header{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);padding:13px 17px;display:flex;align-items:center;justify-content:space-between;gap:8px;z-index:2}.sheet-header h2{font-size:18px;letter-spacing:-.3px;margin:0}.closebutton{width:37px;height:37px;border:1px solid var(--line);border-radius:10px;background:#f5f8fb;color:var(--ink);font-size:26px;display:grid;place-items:center;line-height:1}.cart-items{padding:12px 15px;max-height:37dvh;overflow-y:auto}.cart-line{border-bottom:1px solid #e9edf2;padding:11px 0}.cart-line:last-child{border-bottom:0}.cart-line-top{display:flex;align-items:flex-start;gap:8px}.cart-line-name{flex:1;min-width:0;font-size:13px;font-weight:750}.cart-line-name small{display:block;font-size:10px;color:var(--muted);font-weight:450;margin-top:3px}.remove-button{font-size:12px;color:var(--danger);background:transparent;border:0;padding:3px 5px}.cart-editor{display:grid;grid-template-columns:105px 1fr 1fr;gap:9px;align-items:end;margin-top:9px}.cart-editor label,.cash-box label,.credit-box label{display:block;font-weight:750;font-size:11px;color:#42566e}.cart-editor input,.cash-box input,.credit-box input{display:block;width:100%;min-width:0;border:1px solid #bbcbdc;border-radius:9px;padding:10px 8px;font-size:16px;min-height:41px;margin-top:5px;color:var(--ink);background:#fff}.stepper{display:flex;align-items:center;margin-top:5px;border:1px solid #bbcbdc;border-radius:9px;overflow:hidden;height:41px}.stepper button{flex:0 0 35px;height:41px;border:0;background:#f0f5fc;font-weight:900;font-size:19px}.stepper span{min-width:0;flex:1;text-align:center;font-size:14px;font-weight:850}.line-total{font-size:12px;font-weight:850;text-align:right;margin-top:6px}.checkout-area{padding:12px 15px 18px;border-top:1px solid var(--line);background:#fafcff}.cart-totals{display:grid;gap:6px;margin-bottom:12px}.total-row{display:flex;align-items:baseline;justify-content:space-between;font-size:13px;color:#5a687b}.total-row.grand{padding-top:9px;border-top:1px solid #dbe4ee;font-weight:900;font-size:19px;color:var(--ink)}.total-row strong{font-variant-numeric:tabular-nums}.payment-types{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;border:0;padding:0;margin:10px 0}.payment-types legend{font-size:11px;font-weight:800;color:#42566e;margin-bottom:6px}.payment-types label{min-width:0}.payment-types input{position:absolute;opacity:0;pointer-events:none}.payment-types span{display:grid;place-items:center;padding:12px 5px;border:1px solid #b5c7db;border-radius:10px;color:#51657a;background:white;font-weight:850;font-size:12px}.payment-types input:checked+span{border-color:var(--blue);color:var(--blue);background:var(--blue-bg)}.payment-types input:focus-visible+span{outline:3px solid #8ac2ff}.cash-box,.credit-box{margin:13px 0}.cash-box p{margin:6px 0;color:#136c49;font-size:13px;font-weight:800}.primary-button{display:block;width:100%;border:0;border-radius:12px;padding:14px 12px;min-height:49px;background:#0e7452;color:white;font-weight:900;font-size:15px}.hint{margin:10px 0 0;font-size:11px;color:#758495;line-height:1.5}.modal{position:fixed;max-width:min(95vw,560px);width:100%;border-radius:16px;margin:auto;top:0;bottom:0;left:0;right:0;padding-bottom:16px;max-height:90dvh;overflow:auto}.modal>.hint{padding:0 16px}.scan-message{margin:12px 16px;color:#52677f;font-size:13px;min-height:22px}.scanner-view{position:relative;margin:0 12px;border-radius:12px;min-height:235px;background:#091624;overflow:hidden}.scanner-view video{width:100%;height:260px;display:block;object-fit:cover}.scanner-view #html5-reader{display:none;min-height:250px}.target-frame{position:absolute;pointer-events:none;left:13%;top:25%;width:74%;height:50%;border:3px solid #25dcaa;border-radius:14px;box-shadow:0 0 0 900px #0001}.history-actions{padding:12px 16px;display:flex;justify-content:space-between;align-items:center;font-size:12px;color:#697c8d}.history-actions .smallbutton{color:var(--ink);background:#f0f6fb;border-color:#cfdae6}.history-items{max-height:65dvh;overflow:auto;padding:0 16px 12px}.history-card{border:1px solid var(--line);border-radius:12px;padding:12px;margin-bottom:9px}.history-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:13px;font-weight:900}.history-card small{color:var(--muted);display:block;font-size:11px;margin-top:4px}.history-card p{font-size:12px;margin:8px 0;color:#4d6075}.history-card button{margin-top:7px;border:1px solid #cbd8e5;border-radius:8px;background:white;padding:8px 11px;color:#2b4f7c;font-size:12px;font-weight:800}.toast{position:fixed;bottom:calc(135px + env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);max-width:min(90vw,420px);min-width:200px;text-align:center;background:#142f46;color:#fff;padding:11px 15px;border-radius:11px;z-index:30;box-shadow:var(--shadow);font-size:13px;font-weight:750}.toast.error{background:#9e353d}.toast.success{background:#126a4d}#receiptPrint{display:none}
@media(min-width:680px){.topbar{padding-left:max(20px,calc((100vw - 1024px)/2));padding-right:max(20px,calc((100vw - 1024px)/2))}.content{padding:19px 20px 144px}.products{grid-template-columns:repeat(2,minmax(0,1fr))}.product-card{min-height:108px}.product-title{font-size:14px}.cart-summary{padding-left:18px;padding-right:18px}.sheet{bottom:3vh;border-radius:18px;margin:auto;max-height:88dvh}.cart-items{max-height:40dvh}}
@media(max-width:370px){.syncline{align-items:flex-start}.sync-actions{width:100%}.smallbutton{flex:1}.product-card{grid-template-columns:55px minmax(0,1fr) auto;gap:7px;padding:8px}.product-thumb{width:55px;height:55px}.price{font-size:13px}.add-button{min-width:56px}.cart-editor{grid-template-columns:99px 1fr 1fr;gap:5px}}
@media print{
 @page{margin:0}
 html,body{width:auto!important;background:white!important;margin:0!important;padding:0!important;font-family:Arial,sans-serif!important;color:black!important;font-size:10pt!important}
 #app,dialog,.toast{display:none!important}
 #receiptPrint{display:block!important;width:var(--receipt-width,80mm)!important;max-width:100%!important;padding:4mm 3mm!important;font-family:monospace!important;color:#000!important;background:#fff!important;white-space:normal!important}
 .receipt-title{text-align:center;font-weight:900;font-size:13pt;margin-bottom:3mm}.receipt-center{text-align:center}.receipt-small{font-size:8pt}.receipt-rule{border-bottom:1px dashed #000;margin:2mm 0}.receipt-row{display:flex;justify-content:space-between;gap:3mm}.receipt-row span:last-child{text-align:right;white-space:nowrap}.receipt-product{margin:2mm 0}.receipt-grand{font-weight:900;font-size:11pt}
}

.print-options{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:12px 0;color:#415a73;font-size:12px;font-weight:750}.print-options select{border:1px solid #bdcbdc;border-radius:8px;padding:7px;background:#fff;color:var(--ink);font-size:14px}.print-options .autoprint{margin-left:auto;font-size:11px}.print-options input{vertical-align:middle}

.stepper input{min-width:0;width:100%;height:40px;text-align:center;border:0;background:white;font-weight:900;font-size:15px;appearance:textfield;-moz-appearance:textfield}.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* Local Excel import — narrow mobile POS controls and preview */
.sync-actions{flex-wrap:wrap}.template-link{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;color:#fff}
.excel-button{background:#167454;border-color:#259b74;color:#fff}
.excel-sheet{max-height:82dvh}.excel-import-body{padding:14px 16px 24px}
.excel-import-body>.hint:first-child{margin-top:2px}.excel-summary{font-size:14px;font-weight:850;padding:12px 0}
.excel-summary.error{color:#9e353d}.excel-errors{background:#fff1f0;color:#943b42;border:1px solid #f2c1c5;border-radius:10px;padding:12px;margin:6px 0 14px;font-size:12px;max-height:150px;overflow:auto}
.excel-errors p{margin:6px 0 0}.excel-preview{margin:6px 0 14px;max-height:32dvh;overflow:auto}
.excel-preview-line{border-bottom:1px solid #dce4ed;padding:10px 0}.excel-preview-line strong{display:block;font-size:12px}
.excel-preview-line small{display:block;color:var(--muted);margin-top:4px;font-size:11px}
@media(max-width:480px){.sync-actions{gap:6px}.sync-actions .smallbutton,.sync-actions .template-link{font-size:11px;padding:8px 9px}}

/* Image diagnostics are visible without covering the POS controls. */
.catalog-heading{flex-wrap:wrap}.image-health{margin-left:auto;font-weight:750;color:#476d88;font-size:11px}
.product-thumb[title]{cursor:help}

.excel-preview-thumb { width: 48px; height: 48px; object-fit: contain; border-radius: 8px; background: #f3f6fa; flex: 0 0 48px; margin-right: 8px; }

/* v1.5 — storefront-inspired, collapsed category navigation for a mobile POS. */
.quick-actions{display:flex;align-items:stretch;gap:8px;margin-top:10px;min-height:43px}
.excel-quick{flex:1;min-width:0;border:1px solid #56d3a8;border-radius:11px;background:#0b9569;color:#fff;font-size:13px;font-weight:900;padding:10px 12px;box-shadow:0 3px 10px #042e242e}
.excel-quick:active,.browse-menu-button:active{transform:translateY(1px)}
.manage-details{flex:0 0 auto;position:relative;min-width:145px}
.manage-details>summary{display:flex;align-items:center;justify-content:center;list-style:none;cursor:pointer;height:100%;min-height:43px;border:1px solid #7393b1;border-radius:11px;padding:8px 10px;background:#203f60;color:white;font-size:12px;font-weight:750}
.manage-details>summary::-webkit-details-marker{display:none}
.manage-details[open]>summary{border-bottom-left-radius:0;border-bottom-right-radius:0}
.manage-details>.sync-actions{display:flex;gap:7px;position:absolute;right:0;top:100%;z-index:6;flex-direction:column;align-items:stretch;width:min(280px,84vw);padding:12px;background:#10243a;border:1px solid #7393b1;border-radius:10px 0 12px 12px;box-shadow:0 15px 28px #0005}
.manage-details>.sync-actions>*{text-align:center;width:100%;min-height:41px;display:flex;align-items:center;justify-content:center}
.syncline{margin-top:8px;min-height:16px}
.browse-buttons{display:flex;gap:8px;align-items:center}
.browse-buttons>button{min-height:44px;border-radius:12px;font-size:13px;font-weight:850}
.browse-menu-button{border:0;background:#13243a;color:#fff;padding:11px 16px;box-shadow:0 4px 10px #13243a20}
.browse-all-button{border:1px solid #c8d8e8;color:#284867;padding:9px 15px;background:#f4f7fb}
.catalog-header .catalog-heading{margin-bottom:12px;display:flex;justify-content:space-between;align-items:center}
.catalog-header .catalog-heading h1{font-size:17px}
.browse-welcome{background:#fff;text-align:center;padding:42px 20px 48px;border:1px solid #dce4ed;border-radius:18px;box-shadow:0 8px 24px #10243a08}
.browse-welcome .welcome-icon{display:grid;place-items:center;margin:0 auto 18px;width:72px;height:72px;border-radius:19px;background:#ebf3fd;color:#153657;font-size:33px}
.browse-welcome h2{margin:0 0 7px;font-size:21px}
.browse-welcome p{max-width:420px;margin:0 auto 20px;color:#576c82;font-size:13px;line-height:1.6}
.browse-welcome button{min-height:48px;font-size:14px;padding:12px 20px}
.category-dialog{position:fixed;inset:0 auto 0 0;margin:0;width:min(88vw,440px);height:100dvh;max-height:100dvh;max-width:none;overflow:hidden;border:0;border-radius:0;background:#fff;padding:0;box-shadow:10px 0 35px #0003}
.category-dialog::backdrop{background:#0a1422aa}
.category-panel{display:flex;flex-direction:column;height:100%;min-height:0;background:white}
.category-panel-top{background:#0e1117;color:#fff;min-height:83px;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 16px 14px}
.category-panel-top strong{font-size:18px;letter-spacing:-.4px}
.category-close{font-size:36px;font-weight:300;line-height:1;border:0;color:white;background:transparent;min-width:43px;min-height:45px}
.category-excel{border:0;border-radius:10px;background:white;color:#1b384f;min-height:43px;padding:0 13px;font-size:12px;font-weight:900}
.category-search-wrap{background:#0e1117;padding:0 17px 16px}
.category-search-wrap input{height:48px;width:100%;border:0;border-radius:13px;padding:12px 18px;background:#fff;color:#12263e;font-size:16px;outline-offset:3px}
.category-nav{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-bottom:calc(25px + env(safe-area-inset-bottom))}
.menu-all-products{display:flex;align-items:center;justify-content:space-between;width:100%;padding:18px 19px;font-size:15px;font-weight:900;color:#0f304b;background:#eff5fd;border:0;border-bottom:1px solid #dbe7f5;text-align:left}
.menu-all-products span{font-size:23px;font-weight:500;color:#768da7}
.category-tree{padding:8px 0}
.category-node{min-width:0}
.category-node-row{display:flex;align-items:stretch;min-height:52px;border-bottom:1px solid #e8edf2}
.category-select{flex:1;min-width:0;border:0;background:#fff;text-align:left;display:flex;gap:10px;align-items:center;justify-content:space-between;padding:12px 4px 12px 19px;color:#15191e;font-size:16px;font-weight:600;line-height:1.3}
.category-select.selected{background:#eaf2ff;color:#0752b4;font-weight:900}
.category-select small{font-size:11px;color:#6d8094;font-weight:700}
.category-expand{width:54px;flex:0 0 54px;border:0;background:#fff;color:#15283a;font-size:26px;line-height:1.1;transition:transform .14s}
.category-expand[aria-expanded="true"]{transform:rotate(90deg)}
.category-children{border-left:3px solid #dfe9f6;margin-left:18px;background:#f8fafd}
.category-children .category-select,.category-children .category-expand{background:#f8fafd}
.category-children .category-select{padding-left:15px;font-size:14px}
.category-children .category-children{margin-left:12px}
.category-empty{padding:20px;color:#667a8e;font-size:13px}
.menu-brands{margin:8px 14px 0;border:1px solid #dde5ee;border-radius:12px}
.menu-brands summary{padding:16px;cursor:pointer;color:#213b58;font-size:14px;font-weight:850}
.drawer-chips{display:flex;flex-wrap:wrap;gap:6px;padding:5px 12px 14px}
.drawer-chips .chip{white-space:normal;max-width:100%}
.category-dialog button:focus-visible,.category-dialog input:focus-visible{outline:3px solid #63a3ff;outline-offset:2px}
@media(max-width:390px){.manage-details{min-width:120px}.manage-details>summary{font-size:11px;padding:7px}.excel-quick{font-size:12px;padding:7px}.catalog-header .catalog-heading{gap:6px}.catalog-header .catalog-heading h1{font-size:16px}.browse-buttons>button{flex:1}}
@media(min-width:680px){.category-dialog{width:min(410px,90vw)}.browse-welcome{padding:72px 26px 85px}.browse-welcome h2{font-size:24px}}
@media print{.category-dialog{display:none!important}}
/* Hizlisatis v1.7 — original mobile POS interface. All sale & print logic retained. */
:root{--navy:#10243a;--blue:#176af5;--ink:#172b41;--canvas:#f2f6fb;--line:#e0e9f2;--shadow:0 8px 30px #172c440d}
body{background:var(--canvas)}
.topbar{padding:calc(12px + env(safe-area-inset-top)) 16px 13px;box-shadow:none;border-bottom:1px solid #23415b}
.brandline{margin-bottom:13px}.brandmark{background:#56dec1;border-radius:14px}.brandline strong{font-size:17px}.brandline small{font-size:11px}
.searchbox{border-radius:14px;height:52px}.iconbutton{border-radius:14px}
.barcode-launch-row{margin-top:10px}
.barcode-launch{width:100%;display:flex;align-items:center;gap:12px;min-height:50px;background:#1c3955;border:1px solid #42617c;border-radius:12px;color:#fff;padding:7px 12px;text-align:left}
.barcode-launch-icon{font-size:25px;width:31px;text-align:center;color:#69dec9}.barcode-launch strong{display:block;font-size:13px;line-height:1.35}.barcode-launch small{display:block;font-size:10px;color:#c6d8e8;line-height:1.5}.launch-chevron{margin-left:auto;font-size:21px;color:#b6d2e8}.barcode-launch[aria-expanded="true"] .launch-chevron{transform:rotate(180deg)}
.barcode-panel{display:flex;gap:7px;background:#112c48;border:1px solid #476780;border-radius:12px;padding:9px;margin-top:6px}.barcode-panel[hidden]{display:none}.barcode-panel input{width:100%;min-width:0;flex:1;font-size:16px;border-radius:9px;padding:10px 8px;border:0;background:white;color:#172a3d;min-height:43px}.barcode-panel button{border:0;border-radius:9px;color:white;font-weight:850;white-space:nowrap;padding:0 11px}.barcode-manual-add{background:#14a57d}.barcode-camera{background:#245986;font-size:22px}
.quick-actions{margin-top:9px}.excel-quick{min-height:40px;background:#0e9076;border:1px solid #5fd0b4;border-radius:11px;font-size:13px}.manage-details>summary{min-height:40px;border-radius:11px}
.syncline{margin-top:7px}.sync-label{font-size:10px}
.content{max-width:1120px;margin:0 auto;padding:17px 13px calc(194px + env(safe-area-inset-bottom))}
.home-hero{position:relative;overflow:hidden;border-radius:22px;background:linear-gradient(116deg,#122b48,#0d5e85 80%);padding:25px 23px 26px;color:#fff;min-height:215px;box-shadow:0 16px 35px #13456a24}
.hero-eyebrow{display:block;font-size:10px;letter-spacing:1.4px;font-weight:900;color:#88e4d5;position:relative;z-index:1}.home-hero h1{position:relative;z-index:1;font-size:clamp(25px,5.8vw,37px);font-weight:900;letter-spacing:-1px;line-height:1.14;margin:14px 0 10px;max-width:370px}.home-hero p{position:relative;z-index:1;color:#e0edf6;font-size:12px;line-height:1.5;max-width:300px;margin:0 0 21px}.hero-orb{position:absolute;right:-56px;top:-55px;width:235px;height:235px;background:radial-gradient(circle at 30% 30%,#4de0b655,transparent 68%);border:1px solid #ffffff24;border-radius:50%}.hero-actions{display:flex;gap:9px;position:relative;z-index:1}.hero-actions button{min-height:44px;border-radius:11px;border:0;padding:10px 16px;font-weight:900;font-size:13px}.hero-primary{background:#fff;color:#104264;flex:1;display:flex;justify-content:space-between;align-items:center}.hero-primary span{font-size:22px}.hero-secondary{background:#ffffff22;color:#fff;border:1px solid #ffffff70!important}
.home-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-top:12px}.stat-tile{background:#fff;padding:15px 11px;border:1px solid var(--line);border-radius:15px;box-shadow:0 4px 15px #0c315308;min-width:0}.stat-tile span{display:block;color:#76889b;font-weight:900;font-size:9px;letter-spacing:.3px;line-height:1.4}.stat-tile strong{display:block;font-size:clamp(19px,5vw,25px);font-weight:950;line-height:1.6;letter-spacing:-.5px;font-variant-numeric:tabular-nums}.stat-tile small{display:block;color:#8a99a9;font-size:10px}
.section-heading{display:flex;justify-content:space-between;align-items:end;gap:12px;margin:24px 1px 12px}.section-kicker{font-size:10px;letter-spacing:1px;font-weight:900;color:#1474ab}.section-heading h2{font-size:20px;letter-spacing:-.5px;margin:5px 0 0}.section-subtle{font-size:11px;color:#92a2b3}.text-action{border:none;background:transparent;color:#0f6acc;font-size:12px;font-weight:800;padding:6px}
.dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.dashboard-tile{background:#fff;border:1px solid var(--line);border-radius:17px;padding:17px 15px;min-height:129px;display:flex;flex-direction:column;align-items:start;text-align:left;gap:5px;color:var(--ink);box-shadow:0 5px 17px #10243a0b}.dashboard-tile strong{font-size:14px;font-weight:900;margin-top:5px}.dashboard-tile small{color:#7a8d9f;font-size:11px}.tile-icon{width:38px;height:38px;border-radius:11px;display:grid;place-items:center;font-size:23px;font-weight:800}.tile-icon.blue{background:#e6f0ff;color:#176cf2}.tile-icon.teal{background:#dff8f1;color:#0d9270}.tile-icon.orange{background:#fff0df;color:#b56a13}.tile-icon.purple{background:#efebff;color:#7957bb}
.home-category-heading{margin-top:25px}.home-category-shortcuts{display:flex;gap:9px;overflow-x:auto;padding:2px 0 8px;scrollbar-width:none}.home-category-tile{border:1px solid #dfebf6;min-width:130px;max-width:160px;display:flex;flex-direction:column;align-items:start;gap:5px;text-align:left;flex:0 0 auto;background:white;padding:13px;border-radius:13px}.category-shortcut-icon{display:grid;place-items:center;font-size:22px;width:37px;height:37px;border-radius:12px;background:#e8f5fa;color:#17629b}.home-category-tile>span:nth-child(2){font-size:12px;font-weight:850;line-height:1.3;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-category-tile small{font-size:10px;color:#899aaa}.home-empty{font-size:12px;color:#7d91a4}.home-footer-note{margin:23px 0;text-align:center;color:#8093a7;font-size:11px}
.catalog-header{padding:17px 14px;margin-bottom:12px;border-radius:17px;box-shadow:0 4px 12px #10243a0a}.catalog-heading{margin-top:7px;align-items:center;justify-content:space-between;margin-bottom:15px!important}.catalog-heading>div{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}.catalog-heading h1{font-size:20px!important;max-width:55vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.catalog-heading #resultCount{color:#788aa0;font-size:12px}.image-health{font-size:10px;max-width:43%;text-align:right}
.catalog-toolbar{display:flex;align-items:center;gap:7px}.catalog-toolbar .browse-menu-button{min-height:42px;padding:10px 12px;font-size:12px;background:#123b60}.catalog-toolbar .browse-all-button{min-height:42px;padding:10px 12px;font-size:12px;background:#eaf2fd}.view-switch{margin-left:auto;display:flex;gap:3px;border:1px solid #cbdcee;background:#eef4fc;border-radius:11px;padding:3px}.view-switch button{width:37px;height:35px;min-height:35px;border:0;border-radius:8px;background:transparent;color:#46647e;font-size:23px}.view-switch button.active{background:#fff;color:#1364cb;box-shadow:0 2px 7px #153f6720}
.catalog-filter-row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:11px}.stock-filter{font-size:11px;border-radius:999px;background:#fff;border:1px solid #bbd6c9;color:#257d61;min-height:35px;padding:5px 12px;font-weight:800}.stock-filter.active{background:#d8f5e8;border-color:#0e9b69}.sort-label{font-size:11px;color:#8191a3;display:flex;align-items:center;gap:5px}.sort-label select{max-width:156px;min-height:35px;border-radius:10px;border:1px solid #d5e2ec;background:white;color:#39536e;padding:5px;font-size:11px}.active-filters{display:flex;gap:6px;overflow:auto;padding-top:10px}.active-filters span{background:#e6f0ff;color:#1a62b2;border-radius:20px;padding:6px 10px;font-size:11px;font-weight:850;white-space:nowrap}
.products{display:grid;gap:11px}.products.grid-view{grid-template-columns:repeat(2,minmax(0,1fr))}.product-card{min-width:0;background:#fff;border:1px solid #e0e7ef;border-radius:17px;padding:0;display:flex;flex-direction:column;align-items:stretch;gap:0;overflow:hidden;box-shadow:0 4px 15px #13243a0b;min-height:270px}.product-photo{position:relative;display:grid;place-items:center;min-width:0;min-height:144px;background:#fff;padding:9px}.product-thumb{width:100%;height:133px;max-width:100%;object-fit:contain;border-radius:10px;background:#fff}.product-photo-badge{position:absolute;left:10px;bottom:8px;font-size:8px;font-weight:850;color:#55708b;background:#f3f7fbdb;border:1px solid #e1e9f4;border-radius:20px;padding:3px 7px;max-width:80%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.product-info{padding:10px 12px 3px;min-width:0;flex:1}.product-title{font-size:12.5px;font-weight:900;line-height:1.36;height:auto;min-height:34px;cursor:pointer}.product-variant{font-size:10px;margin-top:6px;color:#91a0b0;line-height:1.3;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.product-metadata{font-size:9px;gap:4px;margin-top:7px}.product-metadata .stock{padding:4px 7px;font-size:10px}.product-right{display:flex;align-items:center;flex-direction:row;justify-content:space-between;gap:8px;padding:8px 11px 12px;white-space:normal}.price{font-size:15px;font-weight:950;color:#15539b;line-height:1.2}.add-button{width:39px;min-width:39px;height:39px;min-height:39px;border-radius:12px;background:#1169e3;font-size:23px;padding:0;display:grid;place-items:center}.add-button .add-label{display:none}.add-button:disabled{font-size:11px;padding:0 4px}
.products.list-view{grid-template-columns:minmax(0,1fr)}.products.list-view .product-card{min-height:116px;display:grid;grid-template-columns:88px minmax(0,1fr) auto;align-items:center;padding:9px;gap:8px}.products.list-view .product-photo{height:88px;min-height:88px;padding:2px;grid-row:1;grid-column:1}.products.list-view .product-thumb{height:82px}.products.list-view .product-photo-badge{display:none}.products.list-view .product-info{grid-column:2;grid-row:1;padding:0}.products.list-view .product-title{font-size:13px;min-height:0}.products.list-view .product-right{grid-column:3;grid-row:1;min-width:86px;flex-direction:column;align-items:end;padding:0;gap:7px}.products.list-view .price{font-size:14px}.products.list-view .add-button{min-width:40px}.products.list-view .product-variant{max-width:100%}
.load-more{display:block;margin:14px auto 5px;min-height:44px;background:#fff;border:1px solid #c6daed;border-radius:11px;padding:10px 21px;font-weight:850;color:#165c99}.load-more[hidden]{display:none}.product-limit{font-size:11px;color:#8597ab;margin:8px auto 5px}
.bottom-shell{border-top:1px solid #e6ecf5;background:#fff;padding:9px 10px calc(7px + env(safe-area-inset-bottom));box-shadow:0 -5px 24px #10243a12}.cart-summary{min-height:53px;border-radius:13px;padding:9px 13px;background:linear-gradient(102deg,#126ce4,#0d579d);box-shadow:0 4px 15px #1461c044}.cart-icon{font-size:20px}.cart-label strong{font-size:12px}.cart-label small{font-size:10px}.cart-total{font-size:18px}.chevron{font-size:25px}.bottom-nav{max-width:1050px;margin:5px auto 0;display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.nav-item{border:0;background:transparent;color:#879aad;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1px;padding:5px 0 1px;min-height:45px;border-radius:9px}.nav-item span{font-size:23px;line-height:1.1;font-weight:800}.nav-item small{font-size:10px;font-weight:750}.nav-item.active{color:#1769cd;background:#edf5ff}.nav-sale.active{color:#097b5f;background:#e1f7ed}.sr-only-action{position:absolute!important;left:-9999px!important;width:1px!important;height:1px!important;overflow:hidden!important}
.sale-sheet{max-height:95dvh;border-radius:22px 22px 0 0}.sale-sheet-header{background:linear-gradient(110deg,#124b52,#18815e);color:#fff;padding:18px 17px}.sale-sheet-header h2{color:#fff;font-size:22px;margin:2px 0 0}.sale-eyebrow{font-size:10px;letter-spacing:1px;color:#b8f2d8;font-weight:900}.sale-sheet-header .closebutton{background:#ffffff29;border:1px solid #ffffff6a;color:#fff}.sale-scanner{display:flex;gap:7px;padding:12px 14px;background:#fff;position:sticky;top:66px;z-index:1;border-bottom:1px solid #eff2f6}.sale-scanner input{height:46px;flex:1;min-width:0;background:#f7f9fb;border:1px solid #d9e3ec;border-radius:11px;padding:10px;font-size:14px}.sale-scanner button{border:0;min-height:46px;border-radius:11px;padding:0 11px;font-size:12px;font-weight:900;color:#fff;background:#157d67}.sale-scanner button:last-child{background:#19548a;font-size:24px}.sale-count-strip{display:flex;justify-content:space-between;padding:9px 16px;background:#ecf8f2;color:#17654e;font-weight:850;font-size:11px}.sale-count-strip strong{font-weight:950}.sale-count-strip span:last-child{font-size:14px}.sale-sheet .cart-items{max-height:37dvh;min-height:85px;padding:4px 15px}.sale-sheet .cart-line{padding:11px 0}.sale-sheet .cart-line-top{gap:9px}.sale-sheet .cart-line-name{font-size:14px}.sale-sheet .checkout-area{background:#fff}.sale-sheet .payment-types{gap:8px}.sale-sheet .payment-types span{min-height:69px;border-radius:13px;line-height:1.4}.sale-sheet .payment-types input:checked+span{background:#e9f8f0;border-color:#1c9971;color:#156b52}.sale-sheet .total-row.grand{font-size:21px;color:#17745a}.sale-sheet #completeSale{background:#19835d;border-radius:13px;min-height:54px;box-shadow:0 7px 16px #19835d35}
.product-detail-sheet{max-height:85dvh}.detail-body{padding:15px;display:flex;flex-direction:column;gap:8px}.detail-body>img{width:100%;height:220px;object-fit:contain;border:1px solid #e3edf5;background:#f9fbfd;border-radius:16px}.detail-brand{color:#218a76;font-size:11px;font-weight:800;letter-spacing:.3px}.detail-body h3{font-size:19px;margin:0;line-height:1.35}.detail-barcode{font-size:12px;color:#7c8da1;margin:0}.detail-meta{color:#5c7489;font-size:12px}.detail-footer{border-top:1px solid #e5ebf4;display:flex;align-items:center;gap:20px;padding-top:14px}.detail-footer>strong{font-size:21px;color:#145baf;white-space:nowrap}.detail-footer .primary-button{flex:1;font-size:13px}
@media(min-width:600px){.home-view{max-width:890px;margin:auto}.products.grid-view{grid-template-columns:repeat(3,minmax(0,1fr))}.dashboard-grid{grid-template-columns:repeat(4,minmax(0,1fr))}.product-photo,.product-thumb{min-height:168px}.products.list-view{grid-template-columns:1fr}.hero-orb{width:310px;height:310px}.catalog-header{padding:22px}}
@media(min-width:900px){.products.grid-view{grid-template-columns:repeat(4,minmax(0,1fr))}.home-hero{padding:35px}.content{padding-bottom:190px}}
@media(max-width:380px){.home-hero{padding:22px 18px}.stat-tile{padding:10px 7px}.stat-tile span{font-size:8px}.stat-tile small{font-size:9px}.dashboard-tile{padding:13px}.product-photo{min-height:119px}.product-thumb{height:112px}.product-right{padding:7px}.price{font-size:13px}.product-info{padding:7px}.product-title{font-size:11.5px}.view-switch button{width:32px}.sort-label select{max-width:125px}.catalog-toolbar .browse-menu-button{padding:9px}.catalog-toolbar .browse-all-button{padding:9px}.sale-scanner{gap:5px;padding:9px}.sale-scanner button{padding:0 7px}}
@media print{.bottom-shell,.barcode-panel,.barcode-launch-row,.topbar,.content,.category-dialog,.product-detail-sheet,.sale-sheet{display:none!important}}

/* v1.8 - handheld barcode scanner: camera, image and manual fallback */
#scanDialog{width:min(96vw,560px);max-height:92dvh;overflow:auto}
#scanDialog .scanner-view{min-height:265px}
#scanDialog #html5-reader{min-height:265px;background:#101c2b;color:white}
#scanDialog #html5-reader video{display:block!important;width:100%!important;max-height:360px!important;object-fit:contain!important}
#scanDialog .target-frame{box-shadow:none;opacity:.45;pointer-events:none}
.scan-manual{padding:15px 16px 0}
.scan-manual label{display:block;color:#284359;font-size:13px;font-weight:800;margin-bottom:7px}
.scan-manual-row{display:flex;gap:7px}
.scan-manual-row input{flex:1;min-width:0;border:1px solid #b7c6d6;border-radius:10px;padding:12px 10px;font-size:16px}
.scan-manual-row button{border:0;border-radius:10px;background:#0b7655;color:#fff;font-size:13px;font-weight:850;padding:10px 14px;min-height:45px}
.scan-tools{display:flex;gap:7px;padding:12px 16px 0;flex-wrap:wrap}
.scan-tools button,.scan-photo-button{display:grid;place-items:center;cursor:pointer;border-radius:9px;border:1px solid #c4d4e5;background:#f3f8fd;color:#163950;font-size:12px;font-weight:750;padding:10px 12px;min-height:43px;flex:1}
#scanDialog>.hint{padding:0 16px;margin-bottom:15px}


/* v1.9 — one-hand checkout: no duplicate totals or always-visible advanced fields. */
.sale-sheet[open]{display:flex;flex-direction:column;overflow:hidden;height:100dvh;max-height:100dvh;max-width:min(100vw,560px);border-radius:0;padding:0;overscroll-behavior:contain}
.sale-sheet-header{position:relative;flex:none;min-height:54px;padding:8px 14px;background:#156b52}
.sale-sheet-header h2{display:flex;align-items:center;gap:9px;margin:0;font-size:18px}
.sale-count{display:grid;place-items:center;min-width:24px;height:24px;padding:0 6px;border-radius:13px;background:#ffffff2b;font-size:12px}
.sale-sheet-header .closebutton{min-width:40px;min-height:40px;border-radius:11px}
.sale-scanner{flex:none;position:relative;top:auto;padding:9px 11px;gap:6px;border-bottom:1px solid #e4e9ed}
.sale-scanner input{height:44px;padding:0 12px;font-size:16px}
.sale-scanner button{height:44px;min-height:44px;min-width:44px;padding:0 7px;font-size:21px}
.sale-scanner .sale-manual-add{background:#1c8b68}
.sale-sheet .cart-items{flex:1 1 auto;overflow-y:auto;min-height:0;max-height:none;padding:0 13px;overscroll-behavior:contain}
.sale-empty{padding:34px 10px;text-align:center;color:#7a8796;font-size:14px}
.sale-sheet .cart-line{padding:10px 0;border-bottom:1px solid #e8edf2}
.sale-product-row{display:flex;justify-content:space-between;align-items:start;gap:8px}
.sale-product-row .cart-line-name{min-width:0;flex:1;font-size:13px;font-weight:750;line-height:1.35;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.sale-line-price{font-size:14px;white-space:nowrap;font-weight:900;color:#146b54;font-variant-numeric:tabular-nums}
.sale-line-actions{display:flex;align-items:center;gap:7px;margin-top:7px}
.sale-line-actions .stepper{width:114px;height:37px;margin:0;flex:none}
.sale-line-actions .stepper button{flex:0 0 35px;height:37px;font-size:20px}
.sale-line-actions .stepper input{width:100%;min-width:0;flex:1;border:0;padding:0;text-align:center;font-size:15px;font-weight:850;appearance:textfield;-moz-appearance:textfield;background:#fff;color:#13243a}
.sale-line-actions .stepper input::-webkit-outer-spin-button,.sale-line-actions .stepper input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.sale-line-more{position:relative;flex:1;min-width:0}
.sale-line-more>summary{display:grid;place-items:center;list-style:none;margin-left:auto;width:40px;height:37px;border:1px solid #dbe5ed;border-radius:9px;background:#f4f7fa;color:#4c6074;font-size:23px;font-weight:800;cursor:pointer}
.sale-line-more>summary::-webkit-details-marker{display:none}
.sale-line-edit{display:flex;gap:8px;padding:9px 0 1px}
.sale-line-edit label{flex:1;min-width:0;font-size:11px;color:#546b7a;font-weight:800}
.sale-line-edit input{display:block;width:100%;height:39px;margin-top:4px;border:1px solid #bfcddd;border-radius:8px;padding:7px 9px;background:#fff;font-size:16px;color:#13243a}
.sale-line-actions .remove-button{flex:none;width:37px;height:37px;margin:0;border:1px solid #f1dfdd;background:#fff6f5;border-radius:9px;color:#ba4140;font-size:23px;line-height:1}
.sale-sheet .checkout-area{flex:0 0 auto;padding:10px 13px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #dfe8ee;box-shadow:0 -7px 24px #15283a0e;max-height:58dvh;overflow-y:auto;overscroll-behavior:contain;background:#fff}
.sale-sheet .cart-totals{margin:0 0 9px;display:block}
.sale-sheet .total-row.grand{display:flex;justify-content:space-between;align-items:baseline;padding:0;border:0;font-size:18px;color:#10243a}
.sale-sheet .total-row.grand strong{font-size:24px;color:#16704f}
.sale-sheet .payment-types{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 8px}
.sale-sheet .payment-types span{min-height:45px;padding:8px 3px;border-radius:10px;font-size:12px}
.sale-sheet .sale-option{margin:2px 0 8px;border:0}
.sale-option>summary{list-style:none;display:inline-flex;align-items:center;gap:5px;color:#53697e;font-size:12px;font-weight:750;min-height:32px;padding:4px 5px;cursor:pointer}
.sale-option>summary::-webkit-details-marker{display:none}
.sale-option>summary::after{content:'⌄';font-size:14px}
.sale-option[open]>summary::after{content:'⌃'}
.sale-sheet .cash-box{display:grid;grid-template-columns:1fr 1fr;align-items:end;gap:8px;margin:2px 0 7px}
.sale-sheet .cash-box label{grid-column:1;grid-row:1;font-size:11px}
.sale-sheet .cash-box input{grid-column:1;grid-row:2;height:41px;min-height:41px;margin:0}
.sale-sheet .cash-box p{grid-column:2;grid-row:2;margin:0;font-size:12px}
.sale-sheet .credit-box{margin:0 0 9px}
.sale-sheet .credit-box input{margin:0;min-height:43px}
.sale-sheet .print-options{margin:3px 0 5px;gap:8px}
.sale-sheet #completeSale{min-height:50px;margin-top:3px;box-shadow:none;border-radius:11px;font-size:15px}
@media(min-width:680px){.sale-sheet[open]{height:min(90dvh,730px);max-height:90dvh;bottom:5dvh;border-radius:18px;margin:auto}}
@media(max-height:650px){.sale-sheet .checkout-area{max-height:62dvh}.sale-sheet .payment-types span{min-height:42px}.sale-sheet-header{min-height:48px}.sale-scanner{padding:6px 11px}}
@media print{.sale-sheet[open]{display:none!important}}

/* v2.0: photo-grid categories modelled after the supplied grocery category tiles. */
.home-category-shortcuts,.category-photo-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px 9px;padding:12px 2px}
.photo-category-tile{background:transparent;border:0;display:flex;flex-direction:column;align-items:center;gap:0;padding:0;min-width:0;color:#142b3d;cursor:pointer;text-align:center}
.photo-category-image{aspect-ratio:1;width:100%;max-width:none;display:grid;place-items:center;background:#fff;border:1px solid #e4e9ef;box-shadow:0 8px 24px #1a354014;border-radius:19px;position:relative;overflow:hidden}
.photo-category-image img{width:100%;height:100%;object-fit:cover;background:#fff;position:absolute;inset:0;padding:0}
.photo-category-fallback{font-size:clamp(36px,10vw,62px)}
.photo-category-name{display:none!important}
.photo-category-badge{position:absolute;right:9px;bottom:9px;width:24px;height:24px;border-radius:999px;background:#ffffffd9;border:1px solid #d6e4ee;color:#2f5f7b;font-size:18px;font-weight:700;display:grid;place-items:center;z-index:3;box-shadow:0 3px 8px #17314714}
.photo-category-tile:focus-visible .photo-category-image{outline:3px solid #208be3;outline-offset:2px}
@media(max-width:339px){.home-category-shortcuts,.category-photo-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:680px){.home-category-shortcuts,.category-photo-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:20px 14px}}
.category-dialog{width:min(100vw,650px)!important;max-width:min(100vw,650px);border-radius:0}
.category-photo-grid{padding:15px 12px 42px}
.category-nav{background:#fafbfd}
.category-trail{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#f2f6fa;border-bottom:1px solid #e0e7ef}
.category-trail strong{font-size:13px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.category-trail button{min-height:40px;min-width:80px;background:white;color:#16476d;border-radius:11px;border:1px solid #d1deeb;font-weight:800}
.menu-all-products{min-height:45px;padding:10px 16px;font-size:13px}
.home-category-shortcuts{margin-top:3px}

/* Bigger one-hand barcode scanner with hardware-conditional torch. */
#scanDialog{position:fixed;inset:0;max-width:100vw;width:100%;max-height:100dvh;height:100dvh;border-radius:0;margin:0;padding:0;background:#f7f9fc;display:flex;flex-direction:column;overflow-y:auto}
#scanDialog:not([open]){display:none}
#scanDialog .sheet-header{flex:none}
.scan-header-actions{display:flex;gap:9px;align-items:center}
.scan-torch{background:#f0f6ff;border:1px solid #c7d8e9;color:#164367;font-weight:850;min-height:42px;border-radius:12px;padding:8px 11px;font-size:12px}
.scan-torch[aria-pressed="true"]{background:#fff6c5;color:#6b4b08;border-color:#f9db59}
.scan-torch:disabled{opacity:.42}
#scanDialog .scan-message{flex:none;min-height:0;margin:8px 16px;font-size:13px}
#scanDialog .scanner-view{flex:1 1 auto;min-height:280px;height:min(58dvh,550px);max-height:62dvh;border-radius:17px;background:#081a2b;margin:0 11px;overflow:hidden}
#scanDialog .scanner-view video,#scanDialog #html5-reader video{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important}
#scanDialog #html5-reader{width:100%;height:100%;min-height:280px;overflow:hidden;background:#081a2b}
#scanDialog #html5-reader>div{width:100%!important;max-width:none!important}
#scanDialog .target-frame{left:6%;top:30%;width:88%;height:40%;border-radius:14px;border-width:3px;opacity:.8;pointer-events:none}
#scanDialog .scan-tools{margin-top:8px;flex:none;padding:0 12px}
#scanDialog .scan-manual{flex:none;padding:8px 12px calc(14px + env(safe-area-inset-bottom))}
#scanDialog .scan-manual>label{display:none}
@media(max-height:660px){#scanDialog .scanner-view{max-height:50dvh;min-height:220px}}

/* Product picker: '+' with no barcode is never a dead button. */
.product-picker{max-height:90dvh}
.picker-search{padding:10px 14px;position:sticky;top:57px;background:white;border-bottom:1px solid #e1e8ef;z-index:1}
.picker-search input{width:100%;min-height:49px;border:1px solid #c8d8e6;border-radius:11px;padding:10px 14px;font-size:16px}
.picker-results{max-height:70dvh;overflow-y:auto;padding:10px 14px}
.picker-product{width:100%;display:flex;align-items:center;gap:9px;padding:8px;background:white;color:#122c43;border:0;border-bottom:1px solid #ecf0f4;text-align:left;min-height:65px}
.picker-product img{width:45px;height:45px;object-fit:contain;border-radius:9px;background:#f6f9fc}
.picker-product span{flex:1;min-width:0;font-weight:750;font-size:12px}
.picker-product strong{white-space:nowrap;font-size:13px;color:#176a51}

/* Receipt is a separate post-sale choice, never cluttering the actual checkout. */
.receipt-actions-dialog{max-width:min(100vw,520px);max-height:80dvh;border-radius:18px 18px 0 0}
.receipt-actions-body{padding:19px 15px calc(22px + env(safe-area-inset-bottom))}
.receipt-actions-total{text-align:center;font-size:28px;font-weight:950;color:#167453;margin:7px 0 22px}
.receipt-actions-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.receipt-actions-grid button{border:1px solid #d2dfe9;border-radius:14px;background:#f5f9fe;color:#143d5c;padding:16px 3px;min-height:100px;font-size:26px;font-weight:850;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px}
.receipt-actions-grid button span{font-size:11px;font-weight:800}
.receipt-actions-grid button:disabled{opacity:.5}
.receipt-action-status{color:#6b4858;font-size:12px;line-height:1.4;min-height:20px;margin:14px 3px}
.receipt-action-close{width:100%;border-radius:12px;min-height:48px;border:0;background:#156f53;color:white;font-size:15px;font-weight:850}

/* v3 — clean storefront shell. Never steal space from the one-hand sale sheet. */
.clean-topbar{padding:11px 13px 10px!important;box-shadow:0 2px 10px #071d2810}
.clean-topbar .brandline{padding:0!important;margin-bottom:8px;min-height:37px;gap:8px}
.clean-topbar .brandmark{width:36px;height:36px;font-size:18px;border-radius:11px}
.clean-topbar .brandline strong{font-size:17px}
.clean-topbar .brandline small{font-size:10px}
.clean-topbar .searchline{margin:0!important;gap:8px}
.clean-topbar .searchbox{min-width:0;flex:1}
.clean-topbar .searchbox input{height:43px;min-height:43px;font-size:16px}
.clean-topbar .scanbutton{height:43px;width:47px;min-width:47px;font-size:23px}
.clean-content{padding:12px 13px 120px!important;max-width:840px;margin:auto}
.clean-home{padding:4px 0 0!important;margin:0!important}
.clean-home-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:2px 0 17px}
.clean-home-actions button{border:0;border-radius:12px;height:49px;font-size:14px;font-weight:850}
.clean-primary{background:#157554;color:#fff}.clean-secondary{background:#edf5fb;color:#20445e;border:1px solid #cee0ed!important}
.clean-section-title{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0 10px}
.clean-section-title h1,.settings-view h1{font-size:20px;line-height:1.25;margin:0;font-weight:850;color:#183248}
.clean-section-title button{background:transparent;color:#176d52;border:0;font-size:13px;font-weight:750;padding:8px}
.clean-see-all{display:block;width:100%;margin:20px 0 12px;min-height:45px;padding:10px;border-radius:11px;border:1px solid #d5e2ee;background:#f5f9fc;color:#204863;font-size:13px;font-weight:800}
.clean-catalog{padding:0!important}
.clean-page-head{display:flex;align-items:center;gap:10px;min-height:49px;margin:0 0 10px}
.clean-page-head h1{font-size:20px;line-height:1.25;margin:0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#19384d;font-weight:850}
.clean-back{flex:none;min-width:43px;height:43px;padding:0;background:#fff;border:1px solid #dbe7ef;border-radius:12px;color:#1f4861;font-size:30px;line-height:1}
.clean-back[hidden]{display:none!important}
.clean-category-search{width:100%;height:45px;border-radius:11px;border:1px solid #d5e2eb;padding:10px 14px;font-size:16px;background:#fff;color:#1a2a3c}
.category-grid-page{padding:17px 0!important;gap:17px 9px!important}
.home-category-shortcuts{padding:0!important;gap:15px 9px!important;margin-top:0}
.clean-result-count{color:#7890a0;font-size:12px;white-space:nowrap;font-weight:700}
.clean-catalog-tools{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:0 0 13px;min-height:43px}
.clean-catalog-tools .view-switch{margin:0 auto 0 0;display:flex;align-items:center}
.clean-catalog-tools #sortProducts{height:40px;border-radius:10px;border:1px solid #d8e4eb;background:#fff;color:#355065;padding:0 9px;font-size:12px;font-weight:700}
.clean-catalog-tools .stock-filter{min-height:40px;border-radius:10px;padding:0 9px;white-space:nowrap;font-size:12px}
.clean-empty{padding:35px 10px;text-align:center;color:#78899b;font-size:13px}
.clean-catalog .products{padding:0!important;gap:10px!important}
.clean-catalog .product-card{min-width:0;position:relative}
.clean-catalog .product-photo{position:relative;overflow:hidden;background:#f4f8fa;border-radius:12px;display:grid;place-items:center}
.clean-catalog .product-photo img{z-index:2;position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#fff}
.clean-catalog .product-emoji{z-index:1;font-size:clamp(38px,10vw,70px);display:grid;place-items:center;width:100%;height:100%;background:linear-gradient(140deg,#f6fbfd,#e6f2ee)}
.clean-catalog .product-card .product-info{min-width:0}
.clean-catalog .product-card .product-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.35;font-size:12px;font-weight:750}
.clean-catalog .product-card .price{font-size:14px;font-weight:900;color:#14684e}
.clean-catalog .product-card .add-button{min-height:36px;min-width:38px;width:38px;font-size:22px;border-radius:11px;padding:0}
.clean-catalog .product-card .add-button:disabled{opacity:.35}
.clean-catalog .product-card .product-right{gap:5px}
.settings-view{max-width:640px;margin:0 auto;padding:4px 0 60px}
.settings-view h1{margin-bottom:15px}
.settings-links{background:#fff;border:1px solid #e1e9ee;border-radius:15px;overflow:hidden}
.settings-links>button,.settings-links>a{display:flex;align-items:center;gap:12px;min-height:62px;width:100%;border:0;border-bottom:1px solid #e8edf1;background:#fff;color:#183950;padding:10px 15px;text-align:left;font-size:14px;font-weight:750;text-decoration:none}
.settings-links>*:last-child{border-bottom:0!important}
.settings-links>button span,.settings-links>a span{width:34px;flex:none;text-align:center;color:#117257;font-size:22px}
.settings-links b{margin-left:auto;color:#91a3b1;font-size:20px;font-weight:400}
.settings-options{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#fff;border:1px solid #e1e9ee;border-radius:13px;padding:14px 15px;margin-top:13px;font-size:13px;font-weight:750}
.settings-options select{min-height:40px;border-radius:10px;border:1px solid #d2e0e8;padding:5px 9px;background:#fff;color:#203e55}
.settings-catalog-count{font-size:12px;text-align:center;margin:24px 0;color:#8b99a4}
.manage-body{padding:16px;overflow-y:auto;max-height:78dvh}
.manage-body>input{width:100%;height:49px;border-radius:12px;border:1px solid #d8e4eb;padding:12px;font-size:16px}
.manage-results{margin-top:8px;max-height:55dvh;overflow:auto;font-size:13px;color:#7c8a98}
.manage-results>button{display:flex;gap:10px;width:100%;align-items:center;justify-content:space-between;min-height:55px;border:0;border-bottom:1px solid #eaf0f4;background:white;color:#254258;text-align:left;font-size:13px;font-weight:700;padding:8px 2px}
.manage-results>button span{min-width:0;flex:1}.manage-results>button small{font-weight:500;max-width:95px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.manage-body form h3{font-size:15px}.manage-body form>p{color:#82919e;font-size:11px}
.manage-body form label{display:block;margin:10px 0;font-size:12px;color:#344e60;font-weight:750}
.manage-body form label input{display:block;width:100%;height:43px;border:1px solid #d6e3eb;border-radius:10px;padding:9px 11px;font-size:16px;margin-top:5px;color:#122d41}
.manage-form-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}
.manage-form-actions button{height:46px;border-radius:10px;border:1px solid #cfe0ea;background:#eef5fb;color:#1b4861;font-weight:800}
.manage-form-actions button:last-child{background:#167955;border-color:#167955;color:#fff}
@media(max-width:360px){.clean-content{padding-left:10px!important;padding-right:10px!important}.category-grid-page,.home-category-shortcuts{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media print{.settings-view,.clean-content,.clean-topbar{display:none!important}}
.cart-summary.is-empty{display:none!important}
[hidden]{display:none!important}
.detail-media{width:100%;position:relative;max-height:260px;display:grid;place-items:center;background:linear-gradient(140deg,#edf7f5,#e3eef7);border-radius:15px;overflow:hidden}
.detail-media .detail-emoji{font-size:96px;min-height:180px;display:grid;place-items:center}
.detail-media #detailImage:not([hidden]){position:absolute;inset:0;width:100%;height:100%;max-height:260px;object-fit:contain;background:white}
.picker-product .picker-emoji{flex:0 0 45px;width:45px;height:45px;display:grid;place-items:center;background:#eef7f6;border-radius:10px;font-size:27px}

/* v3.1: three-column photo categories at every mobile hierarchy level. */
@media(max-width:679px){
  .home-category-shortcuts,.category-photo-grid,.category-grid-page{
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    column-gap:9px!important;row-gap:14px!important;
  }
}
@media(min-width:680px){
  .home-category-shortcuts,.category-photo-grid,.category-grid-page{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
}
.sale-line-brand{font-size:11px;color:#167a65;font-weight:850;display:inline;margin-right:5px}
/* Mobile compositor can skip painting offscreen cards until they approach view. */
.clean-catalog .product-card{content-visibility:auto;contain-intrinsic-size:auto 245px}
.clean-catalog .product-photo img,.photo-category-image img{object-fit:contain;aspect-ratio:1/1}
@media print{
  html,body{width:var(--receipt-width,80mm)!important;min-width:0!important;max-width:var(--receipt-width,80mm)!important;}
  #receiptPrint{box-sizing:border-box!important;width:var(--receipt-width,80mm)!important;min-width:0!important;max-width:var(--receipt-width,80mm)!important;margin:0!important;padding:2mm 2mm!important;font-size:9pt!important;}
  .receipt-row span{min-width:0;overflow-wrap:anywhere}
  .receipt-product{overflow-wrap:anywhere}
}

/* v3.2: home is only pictorial category tiles (brand/nav shell remains). */
body.view-home .clean-topbar .searchline{display:none!important}
body.view-home .clean-topbar{padding-bottom:9px!important}
body.view-home .clean-topbar .brandline{margin-bottom:0!important}

/* v3.3: readable, photo-backed hierarchy and safe product management. */
body.view-home .clean-topbar .searchline{display:flex!important}
.home-category-shortcuts,.category-photo-grid,.category-grid-page{align-items:stretch}
.photo-category-tile{background:#fff;border:1px solid #dfe7ef;border-radius:19px;padding:8px;box-shadow:0 6px 20px #132d4312;display:flex;align-items:stretch;text-align:left;overflow:hidden}
.photo-category-image{width:100%;aspect-ratio:1.38;border:0;box-shadow:none;border-radius:13px;overflow:hidden}
.photo-category-image img{object-fit:contain!important;padding:4px!important}
.photo-category-name{display:block!important;font-size:clamp(12px,3.5vw,16px);font-weight:850;color:#183249;padding:8px 4px 3px;line-height:1.2;min-height:42px;overflow-wrap:anywhere}
.photo-category-badge{right:6px;bottom:6px;top:auto;width:26px;height:26px}
@media(max-width:679px){
 .home-category-shortcuts,.category-photo-grid,.category-grid-page{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:12px!important;padding:14px 3px 32px!important;
 }
}
@media(max-width:360px){
 .home-category-shortcuts,.category-photo-grid,.category-grid-page{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
 .photo-category-name{font-size:12px}
}
.manage-body label{display:block;font-weight:750;color:#334e61;font-size:12px;margin:10px 0 5px}
.manage-body input,.manage-body select{box-sizing:border-box;max-width:100%;min-width:0}
.manage-body input[type=search],.manage-body input[type=text],.manage-body input[type=url],.manage-body input[type=number],.manage-body input[type=file],.manage-body select{
 display:block;width:100%;padding:10px;border-radius:10px;border:1px solid #d0deea;background:white;color:#172f45;min-height:43px;font-size:16px;margin-top:5px
}
.manage-body input[type=file]{font-size:12px;height:auto}
.manage-status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
.manage-status-card{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;min-height:90px;border:1px solid #dbe6ef;border-radius:13px;background:#f9fcff;padding:12px;color:#254059}
.manage-status-card.selected{background:#e8f8f1;border:2px solid #24b48c}
.manage-status-card strong{font-size:25px;font-weight:900;font-variant-numeric:tabular-nums}
.manage-status-card small{font-size:12px;font-weight:750;line-height:1.25}
.manage-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:15px 0}
.manage-actions button,.manage-inline-action,.manage-state-actions button,.passive-product-body button:not(.primary-button){
 min-height:44px;border:1px solid #c9dbe7;background:#f4f9fc;border-radius:11px;font-size:12px;color:#184259;font-weight:800;padding:9px
}
.manage-actions .manage-main-action{background:#147c5d;border-color:#147c5d;color:white}
.manage-result-count{font-size:12px;text-align:right;color:#60788a;margin-top:10px}
.manage-results>button span{display:grid;gap:4px}
.manage-results>button strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.manage-results>button small{max-width:none;text-align:left;font-size:11px}
.manage-results>p{font-size:11px;color:#617789}
.manage-danger-zone{border:1px solid #f1d1c9;border-radius:14px;padding:12px;margin-top:17px;background:#fffaf8}
.manage-danger-zone h3{margin:0 0 5px;font-size:14px}
.manage-danger-zone p,.manage-danger-zone small{color:#6d717c;font-size:11px;line-height:1.55}
.manage-danger-button{display:block;min-height:44px;padding:9px;width:100%;background:#a83d3f!important;border:1px solid #a83d3f!important;border-radius:10px;color:white!important;font-size:12px;font-weight:850}
.manage-danger-button:disabled{opacity:.6}
.manage-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.manage-scan-row{display:flex;gap:8px;align-items:end}
.manage-scan-row label{flex:1;min-width:0}
.manage-scan-row button{height:43px;min-width:78px;margin-bottom:5px;border:0;border-radius:10px;background:#2ca9c0;color:#fff;font-weight:850}
.manage-body form label.manage-checkbox{display:flex;align-items:center;gap:9px;font-size:13px;margin-top:14px}
.manage-checkbox input[type=checkbox]{width:20px;height:20px}
.manage-body .manage-help{font-size:11px;color:#6f8393;margin:2px 0 8px;line-height:1.35}
.manage-image-preview{display:block;width:116px;height:116px;object-fit:contain;border:1px solid #dce7ee;border-radius:12px;margin:10px 0;background:#fff}
.manage-image-preview[hidden]{display:none}
.manage-state-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:10px}
.manage-inline-action{width:100%;background:#e8f8ef;color:#127154;margin-top:9px}
.manage-body form h4{font-size:13px;margin:20px 0 8px}
.manage-history p{font-size:11px;color:#60788b;margin:6px 0;padding-bottom:5px;border-bottom:1px solid #e6eef3}
.passive-product-dialog{padding:0;width:min(92vw,430px);overflow:hidden}
.passive-product-body{padding:18px;display:grid;gap:11px}
.passive-product-body strong{font-size:17px;color:#172e43}
.passive-product-body p{margin:0;font-size:13px;color:#567086}
.passive-product-body button{width:100%}
@media print{.manage-sheet,.passive-product-dialog{display:none!important}}

/* v3.5: compact image-only home: twelve category tiles fit in four rows. */
.home-category-shortcuts{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:7px!important;padding:4px 0 6px!important;margin:0!important}
.home-category-shortcuts .photo-category-tile{padding:3px!important;border-radius:11px!important;gap:0!important}
.home-category-shortcuts .photo-category-image{aspect-ratio:1.4!important;border-radius:9px!important}
.home-category-shortcuts .photo-category-image img{padding:1px!important;object-fit:cover!important}
.home-category-shortcuts .photo-category-name{display:none!important}
.home-category-shortcuts .photo-category-badge{width:19px;height:19px;font-size:13px;right:3px;bottom:3px}
@media(min-width:720px){.home-category-shortcuts{max-width:560px;margin:0 auto!important}}
/* Subcategories are navigational illustrations rather than purchasable item photos. */
.category-grid-page .photo-category-tile{background:#f9fbfe;box-shadow:0 3px 13px #122b4310}
.category-grid-page .photo-category-image{background:linear-gradient(140deg,#e8f6f1,#e9f0ff);aspect-ratio:1.45!important}
.category-grid-page .photo-category-image img{object-fit:contain!important;padding:8px!important}
.brand-home{display:flex;align-items:center;gap:9px;border:0;background:transparent;color:inherit;text-align:left;padding:0;min-height:40px}
.brand-home:focus-visible{outline:2px solid white;outline-offset:3px;border-radius:8px}
.sale-quick-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 0}
.sale-quick-nav button{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  border:1px solid #d6e4ec;background:white;border-radius:12px;color:#204963;font-size:11px;
  font-weight:850;min-height:61px;padding:8px 2px}
.sale-quick-nav button span{font-size:21px}
.sale-secondary-button{border:1px solid #cee0e8;background:#f4f8fb;color:#184661;font-size:13px;
  border-radius:11px;min-height:45px;padding:10px 14px;font-weight:850}
.quantity-body,.cash-payment-body,.activation-choice-body{padding:18px;display:grid;gap:13px}
.quantity-body>strong,.activation-choice-body>strong{font-size:15px;color:#153c53;line-height:1.4}
.quantity-stepper{display:flex;align-items:center;justify-content:center;gap:12px}
.quantity-stepper button{width:60px;height:54px;border-radius:12px;border:1px solid #c9dce8;background:#edf7f3;
  font-size:28px;font-weight:900;color:#157456}
.quantity-stepper input{width:100px;height:55px;min-width:0;border:1px solid #bbccdb;border-radius:12px;
  text-align:center;font-size:23px;font-weight:900}
.cash-payment-body>p{margin:0;color:#617487;font-size:13px;text-align:center}
.cash-payment-body>strong{display:block;text-align:center;color:#176e56;font-size:32px;font-weight:900}
.cash-payment-body>label{font-weight:800;font-size:14px;color:#243e50}
.cash-payment-body>input{height:57px;padding:12px;border-radius:12px;border:1px solid #adcbdb;
  font-size:24px;text-align:center;font-weight:900}
.cash-change{text-align:center;background:#e9f8f2;border-radius:11px;padding:17px;font-size:19px;font-weight:900;color:#0f7553}
.activation-choice-body p{font-size:13px;line-height:1.5;color:#445b6a}
.settings-receipt{background:#fff;border:1px solid #dce5ed;border-radius:14px;padding:15px;margin:15px 0}
.settings-receipt h2{font-size:16px;margin:0 0 13px;color:#183a51}
.settings-receipt label,.customer-form label,.customer-account label{display:block;font-weight:800;font-size:12px;color:#355269;margin:9px 0}
.settings-receipt input,.settings-receipt select,.customer-form input,.customer-account input,.customer-account select{
  width:100%;height:43px;margin-top:5px;padding:9px;border:1px solid #bdcedc;border-radius:10px;
  font-size:15px;background:#fff;color:#172d42}
.settings-receipt small{font-size:11px;color:#597186}
.customer-body{padding:14px 16px 24px;max-height:77dvh;overflow-y:auto}
.customer-toolbar{display:flex;gap:8px}
.customer-toolbar input{min-width:0;flex:1;border:1px solid #d5e2ea;border-radius:10px;padding:11px;font-size:15px}
.customer-toolbar button,.customer-account-actions button{border:0;border-radius:10px;background:#14795a;
  color:#fff;padding:9px 13px;font-weight:800}
.customer-list{display:grid;gap:7px;margin-top:12px}
.customer-list button{display:flex;justify-content:space-between;text-align:left;gap:9px;padding:12px;border-radius:11px;
  border:1px solid #dce5ed;background:white}
.customer-list button span{display:grid;gap:5px;min-width:0}.customer-list button small{color:#647a8b}
.customer-list button b{white-space:nowrap;color:#185d4d;font-variant-numeric:tabular-nums}
.customer-two-col{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.customer-form h3,.customer-account h3{font-size:16px;margin:18px 0 10px}
.customer-form .sale-secondary-button,.customer-account>.sale-secondary-button{width:100%;margin-top:9px}
.customer-account>strong{display:block;font-size:26px;color:#146b4f;padding:11px 0}
.customer-account-actions{display:flex;gap:9px;margin:10px 0}
.customer-account-entries{display:grid;gap:6px}
.customer-account-entries>div{display:flex;justify-content:space-between;border-bottom:1px solid #e1e9ef;
  padding:9px 0;font-size:12px;gap:9px}
.credit-customer-results{display:grid;gap:6px;max-height:170px;overflow:auto;margin-top:7px}
.credit-customer-results button{padding:10px;text-align:left;border:1px solid #d4e3ea;border-radius:9px;background:white;
  color:#23475d;font-size:12px}
.credit-box .sale-secondary-button{margin-top:8px;width:100%}
/* Thermal slips: dark bold print, dense lines, no artificial product spacing. */
@media print{
  #receiptPrint{font-family:Arial,sans-serif!important;font-weight:750!important;line-height:1.14!important;
    padding:1mm 2mm!important}
  #receiptPrint .receipt-product{margin:0!important;padding:0!important;line-height:1.14!important}
  #receiptPrint .receipt-rule{margin:1mm 0!important}
}

.category-grid-page .photo-category-tile.is-return-target{border-color:#158e70!important;
  box-shadow:0 0 0 2px #40b99a55!important}

/* v3.5.1 — approved category-label and vivid subcategory card refresh.
 * Scoped overrides win over the older mobile two-column and image-only rules. */
#homeCategoryShortcuts{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  grid-auto-rows:1fr;
  gap:clamp(5px,1.4vw,9px)!important;
  padding:5px 0 8px!important;
  margin:0 auto!important;
  width:100%;
  max-width:560px;
}
#homeCategoryShortcuts .photo-category-tile{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  min-width:0!important;
  min-height:0!important;
  padding:clamp(3px,0.9vw,6px)!important;
  border-radius:clamp(10px,2.8vw,16px)!important;
  border:1px solid #e0e6ed!important;
  box-shadow:0 2px 9px #122b4310!important;
  text-align:center!important;
  background:#fff!important;
}
#homeCategoryShortcuts .photo-category-image{
  flex:none!important;
  width:100%!important;
  height:clamp(58px,calc((100dvh - 470px)/4),90px)!important;
  aspect-ratio:auto!important;
  background:#fff!important;
  border-radius:clamp(7px,2vw,12px)!important;
}
#homeCategoryShortcuts .photo-category-image img{
  object-fit:contain!important;
  padding:0!important;
}
#homeCategoryShortcuts .photo-category-name{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:3!important;
  width:100%;
  flex:1 0 auto;
  padding:3px 1px 1px!important;
  margin:0!important;
  min-height:37px!important;
  max-height:43px!important;
  overflow:hidden!important;
  line-height:1.1!important;
  font-size:clamp(9.5px,2.75vw,13px)!important;
  font-weight:850!important;
  letter-spacing:-.1px!important;
  text-align:center!important;
  color:#10283f!important;
  overflow-wrap:normal!important;
  word-break:normal!important;
  hyphens:auto;
}
#homeCategoryShortcuts .photo-category-badge{display:none!important}
#homeCategoryShortcuts .photo-category-tile:active{background:#f0faf6!important}
#homeCategoryShortcuts .photo-category-tile:focus-visible{outline:3px solid #148e72;outline-offset:2px}

/* Subcategories are illustrated category destinations, not product photos.
 * Render emoji in the document, never inside SVG images (Safari loses glyphs). */
#categoryTree .photo-category-tile{
  background:#fff!important;
  border:1px solid #dce6ed!important;
  border-radius:17px!important;
  box-shadow:0 3px 12px #17344810!important;
  padding:7px!important;
  text-align:center!important;
}
#categoryTree .photo-subcategory-image{
  position:relative;
  aspect-ratio:1.5!important;
  border-radius:13px!important;
  background:#ecf7f3!important;
  isolation:isolate;
  overflow:hidden!important;
}
#categoryTree .photo-subcategory-image>img{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  object-fit:cover!important;
  padding:0!important;
  z-index:0;
}
#categoryTree .photo-subcategory-image>.photo-category-fallback{display:none!important}
#categoryTree .photo-category-symbols{
  position:absolute;
  inset:0;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:5px;
  overflow:hidden;
  pointer-events:none;
}
#categoryTree .photo-category-symbol{
  display:inline-block;
  flex:none;
  font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;
  font-size:clamp(35px,10.3vw,67px);
  line-height:1.1;
  filter:drop-shadow(0 5px 3px #142e3c24);
  will-change:auto;
}
#categoryTree .photo-category-symbol:first-child{transform:translate(7%,7%) rotate(-7deg) scale(1.05)}
#categoryTree .photo-category-symbol:nth-child(2){margin-left:-17px;transform:translateY(-7%) rotate(6deg) scale(.95)}
#categoryTree .photo-category-symbol:nth-child(3){margin-left:-15px;transform:translateY(13%) rotate(-4deg) scale(.86)}
#categoryTree .photo-category-name{
  display:block!important;
  width:100%;
  min-height:31px!important;
  max-height:none!important;
  padding:8px 3px 3px!important;
  font-size:clamp(12px,3.4vw,16px)!important;
  font-weight:850!important;
  line-height:1.23!important;
  text-align:center!important;
  color:#152e43!important;
}
@media(max-width:365px){
  #homeCategoryShortcuts{gap:5px!important}
  #homeCategoryShortcuts .photo-category-name{font-size:9.5px!important;min-height:37px!important}
  #homeCategoryShortcuts .photo-category-image{height:clamp(54px,calc((100dvh - 470px)/4),84px)!important}
  #categoryTree .photo-category-symbol{font-size:clamp(32px,10.8vw,49px)!important}
}
@media(min-width:680px){
  #homeCategoryShortcuts{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #homeCategoryShortcuts .photo-category-image{height:clamp(80px,10dvh,112px)!important}
  #homeCategoryShortcuts .photo-category-name{font-size:clamp(11px,1.6vw,14px)!important}
  #categoryTree .photo-category-symbol{font-size:clamp(48px,6.5vw,70px)!important}
}

/* v3.5.2: slightly larger category visuals without changing the 3x4 home order. */
#homeCategoryShortcuts .photo-category-image{
  height:clamp(75px,calc((100dvh - 435px)/4),108px)!important;
}
#homeCategoryShortcuts .photo-category-image img{
  transform:scale(1.19);
  transform-origin:center;
}
#homeCategoryShortcuts .photo-category-tile{
  padding:3px!important;
}
#homeCategoryShortcuts .photo-category-name{
  min-height:36px!important;
  padding-top:4px!important;
  font-size:clamp(10px,2.8vw,13.5px)!important;
}

/* 3-column clean vector icon category browser on phones and tablets. */
#categoryTree.category-grid-page{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:9px!important;
  padding:9px 0 16px!important;
  align-items:stretch;
}
#categoryTree .photo-category-tile{
  border-radius:13px!important;
  padding:5px!important;
  box-shadow:0 2px 7px #13283c12!important;
  border:1px solid #dce5eb!important;
  background:#fff!important;
}
#categoryTree .photo-category-image{
  aspect-ratio:1.18!important;
  background:#f7f9fb!important;
  border-radius:9px!important;
}
#categoryTree .photo-subcategory-image>img{
  display:block!important;
  object-fit:cover!important;
  width:100%!important;
  height:100%!important;
  visibility:visible!important;
  padding:0!important;
}
#categoryTree .photo-category-symbols{display:none!important}
#categoryTree .photo-category-name{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:3!important;
  margin:0!important;
  padding:6px 2px 4px!important;
  min-height:34px!important;
  font-size:clamp(10px,2.8vw,13px)!important;
  line-height:1.16!important;
  font-weight:800!important;
}
@media(min-width:680px){
  #homeCategoryShortcuts .photo-category-image{height:clamp(90px,12dvh,128px)!important}
  #homeCategoryShortcuts .photo-category-name{font-size:clamp(12px,1.7vw,15px)!important}
  #categoryTree.category-grid-page{grid-template-columns:repeat(3,minmax(0,1fr))!important}
  #categoryTree .photo-category-name{font-size:14px!important}
}
@media(max-width:350px){
  #homeCategoryShortcuts .photo-category-image{height:clamp(67px,calc((100dvh - 450px)/4),95px)!important}
  #homeCategoryShortcuts .photo-category-name{font-size:9.8px!important}
  #categoryTree.category-grid-page{gap:6px!important}
  #categoryTree .photo-category-name{font-size:9.5px!important}
}

/* Product management: same visual language as the home screen, but filtered
   by lifecycle state so only the selected inactive product can be reactivated. */
.manage-category-browser{
  margin:10px 0 12px;
  padding:8px 0;
  border-top:1px solid #dce5ed;
}
.manage-category-heading{
  display:flex;
  align-items:center;
  gap:10px;
  margin:3px 0 10px;
  font-size:16px;
  color:#1b3b50;
}
.manage-category-heading strong{font-weight:900}
.manage-category-heading .clean-back{min-width:40px;height:40px;font-size:26px}
.manage-category-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  align-items:stretch;
}
.manage-category-tile{
  border:1px solid #dce6ee;
  border-radius:12px;
  background:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:5px 4px 8px;
  gap:4px;
  min-width:0;
  box-shadow:0 2px 7px #11284012;
  text-align:center;
}
.manage-category-tile img{
  display:block;
  width:100%;
  aspect-ratio:1.28;
  object-fit:contain;
  border-radius:8px;
}
.manage-category-tile strong{
  font-size:clamp(10px,2.8vw,13px);
  font-weight:850;
  color:#122f42;
  line-height:1.17;
  overflow-wrap:anywhere;
}
.manage-category-tile small{font-size:9px;color:#617789}
.manage-category-tile:disabled{opacity:.42}
.manage-category-help{margin:8px 0;color:#516a7d;font-size:11px}
.manage-category-tile:focus-visible{outline:3px solid #26a185;outline-offset:2px}

/* Explicit durable save feedback on printer and business details. */
#settingsReceiptSave{margin-top:13px}
.receipt-save-status{
  min-height:34px;
  margin:10px 0 0!important;
  padding:9px 10px;
  font-size:12px;
  color:#476279;
  border-radius:9px;
  background:#f4f8fb;
}
.receipt-save-status.pending{color:#80550b;background:#fff6e3;font-weight:800}
.receipt-save-status.saved{color:#0d644b;background:#e5f8ec;font-weight:850}
.receipt-save-status.error{color:#a62c33;background:#fff0ef;font-weight:800}

/* Incremental product browsing for large inactive categories. */
.manage-results .manage-more-button{width:100%;padding:13px 12px;margin:10px 0 2px;background:#e9f5f2;
  color:#11654e;border:1px solid #9bcdbc;border-radius:11px;font-size:13px;font-weight:850;min-height:47px}


/* v3.6 design refresh — premium orange brand and photographic subcategories. */
:root{--brand-orange:#ff6a00;--brand-orange-deep:#ed5100}
.brand-home{gap:10px}
.brandmark{display:grid;place-items:center;width:42px;height:42px;min-width:42px;
  padding:4px;border-radius:13px;background:linear-gradient(145deg,#ff8a00,#f04b00);
  box-shadow:0 4px 12px #ff6a0038}
.brandmark img{display:block;width:100%;height:100%;object-fit:contain}
.brandline strong{font-size:18px;letter-spacing:-.65px;font-weight:900}
.brandline strong span{color:#ff7900}
.brandline small{font-size:9px;letter-spacing:1.5px;color:#f7b27b;font-weight:800}
#categoryTree.category-grid-page{gap:10px!important}
#categoryTree .photo-category-tile{
  padding:5px!important;border:1px solid #e7e9ed!important;border-radius:14px!important;
  background:#fff!important;box-shadow:0 4px 13px #1717170c!important;
  transition:transform .16s ease,box-shadow .16s ease
}
#categoryTree .photo-category-tile:active{transform:scale(.975)}
#categoryTree .photo-category-image{
  aspect-ratio:1.12!important;border-radius:10px!important;
  background:#f3f3f3!important;overflow:hidden!important
}
#categoryTree .photo-subcategory-image>img{
  object-fit:cover!important;object-position:center!important;padding:0!important;
  transform:none!important
}
#categoryTree .photo-category-name{
  padding:7px 2px 4px!important;color:#20252b!important;
  font-size:clamp(10.5px,2.9vw,13px)!important;font-weight:850!important
}
@media(min-width:680px){
  #categoryTree.category-grid-page{gap:13px!important}
  #categoryTree .photo-category-image{aspect-ratio:1.2!important}
}


/* v3.7 — approved 4-across photographic product cards, ONLY in an opened
   passive product subcategory. Existing management category screens are untouched. */
#manageResults.manage-photo-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  align-items:start;
  gap:7px!important;
  overflow-y:auto;
  max-height:56dvh;
  padding:5px 0 8px;
}
#manageResults.manage-photo-grid>button.manage-product-card{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  justify-content:flex-start!important;
  width:100%!important;
  min-width:0!important;
  min-height:0!important;
  height:auto!important;
  padding:3px 3px 7px!important;
  gap:4px!important;
  border:1px solid #e3e7ed!important;
  border-radius:10px!important;
  box-shadow:0 2px 5px #18263c0b!important;
  color:#26313e!important;
  background:#fff!important;
  text-align:center!important;
}
#manageResults .manage-product-photo{
  display:block!important;
  width:100%!important;
  flex:none!important;
  position:relative;
  aspect-ratio:1/1;
  min-height:0;
  overflow:hidden;
  border-radius:8px;
  background:#f7f8fa;
}
#manageResults .manage-product-photo img{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:contain;
  background:#fff;
}
#manageResults .manage-product-photo-empty{
  display:grid;place-items:center;
  width:100%;height:100%;
  font-size:24px;color:#c7cdd4;
}
#manageResults .manage-product-badge{
  position:absolute;
  left:2px;top:2px;
  z-index:1;
  flex:none!important;
  min-width:0!important;
  border-radius:5px;
  background:#f9dfd6;color:#a33e23;
  padding:2px 3px;
  font-size:clamp(7px,1.75vw,9px);
  font-weight:900;
  line-height:1.15;
}
#manageResults .manage-product-name{
  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:3;
  min-height:32px;
  max-height:38px;
  overflow:hidden;
  font-size:clamp(8px,2.05vw,10px);
  font-weight:800;
  line-height:1.22;
  color:#182636;
  overflow-wrap:anywhere;
}
#manageResults .manage-product-barcode{
  width:100%!important;
  max-width:100%!important;
  display:block;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
  font-size:clamp(7px,1.75vw,9px);
  color:#75808b;
  font-weight:500;
}
#manageResults .manage-product-price{
  display:block;
  width:100%;
  font-size:clamp(9px,2.35vw,12px);
  line-height:1.25;
  color:#f26a14;
  font-weight:900;
}
#manageResults.manage-photo-grid .manage-more-button{
  grid-column:1/-1;
}
#manageResults.manage-photo-grid>button.manage-product-card:focus-visible{
  outline:2px solid #ff7a20;
  outline-offset:2px;
}
@media(max-width:360px){
  #manageResults.manage-photo-grid{gap:5px!important}
  #manageResults.manage-photo-grid>button.manage-product-card{padding:2px 2px 6px!important}
  #manageResults .manage-product-name{font-size:8px}
}


/* v3.8 — isolated settings modal for central category photo replacements.
   Existing storefront, management, receipts and settings layouts untouched. */
.category-image-sheet{max-width:680px}
.category-image-body{padding:16px;max-height:80dvh;overflow-y:auto}
.category-image-body>p:first-child{margin:0 0 13px;color:#596f7e;font-size:12px;line-height:1.5}
.category-image-tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:14px}
.category-image-tabs button{border:1px solid #d5e1e9;background:#f7f9fb;color:#1b364e;
  border-radius:11px;min-height:43px;padding:9px 6px;font-size:13px;font-weight:850}
.category-image-tabs button[aria-pressed="true"]{background:#fff0e5;color:#bd4d07;border-color:#ffb47d}
.category-image-body label:not(.category-image-upload){display:block;margin:9px 0;color:#203c52;font-weight:850;font-size:12px}
.category-image-body select{display:block;box-sizing:border-box;width:100%;margin-top:6px;padding:10px 12px;min-height:46px;
  background:white;border:1px solid #d2e0e9;border-radius:10px;color:#21384b;font-size:15px}
.category-image-sizes{background:#f3f7fb;border-radius:10px;padding:10px;margin:12px 0!important;
  color:#496477;font-size:12px;font-weight:700}
.category-image-previews{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px;margin:12px 0 17px}
.category-image-previews figure{min-width:0;margin:0;border:1px solid #e0e7ee;border-radius:12px;padding:7px;text-align:center}
.category-image-frame{aspect-ratio:1.125;background:#f6f8fb;border-radius:8px;display:grid;place-items:center;overflow:hidden}
.category-image-frame img{width:100%;height:100%;object-fit:contain}
.category-image-previews figcaption{font-size:11px;font-weight:800;color:#455c70;min-height:32px;padding-top:7px}
.category-image-upload{display:flex;align-items:center;justify-content:center;min-height:46px;padding:10px;
  border-radius:10px;border:1px dashed #ee8e48;background:#fff5eb;color:#a94a0b;font-size:13px;
  text-align:center;font-weight:850;cursor:pointer}
#imageEditFile{width:100%;margin:8px 0 0;font-size:12px;color:#40586c}
.category-image-hint{font-size:11px!important;color:#698090;margin:5px 0 12px!important}
.category-image-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}
.category-image-actions button{min-height:46px;min-width:0;padding:8px;border-radius:10px;
  border:1px solid #cbdce7;background:#eef4f8;color:#28475b;font-size:12px;font-weight:850}
.category-image-actions .primary-button{background:#ed660d;color:white;border-color:#ed660d}
.category-image-actions button:disabled{opacity:.45;cursor:not-allowed}
.category-image-status{background:#f4f8fb;border-radius:9px;padding:11px 10px;margin:11px 0 4px!important;
  min-height:40px;color:#48647a;font-size:12px;line-height:1.4}
.category-image-status.success{background:#eaf7ed;color:#176346;font-weight:850}
.category-image-status.error{background:#fff0ee;color:#a5392b;font-weight:800}
@media(max-width:350px){.category-image-body{padding:12px}.category-image-previews{gap:7px}}


/* v3.9 approved improvements: tight mobile cards, tappable category trail,
   and cart-only confirmation below the sticky search. Bottom bar unchanged. */
#productResults .products.grid-view .product-card{
  min-height:0!important;
  height:auto!important;
  align-self:start!important;
  gap:0!important;
}
#productResults .products.grid-view .product-photo{
  height:clamp(112px,35vw,150px)!important;
  min-height:0!important;
  flex:none!important;
  padding:6px!important;
}
#productResults .products.grid-view .product-info{
  flex:0 0 auto!important;
  min-height:0!important;
  padding:7px 9px 2px!important;
}
#productResults .products.grid-view .product-title{
  min-height:0!important;
  line-height:1.3!important;
  margin:0!important;
}
#productResults .products.grid-view .product-right{
  margin-top:0!important;
  padding:5px 9px 9px!important;
  gap:4px!important;
}
#browseHeading{
  display:flex!important;align-items:center;gap:4px;
  min-width:0;overflow-x:auto!important;
  text-overflow:clip!important;white-space:nowrap!important;
  user-select:none;-webkit-user-select:none;scrollbar-width:none;
}
#browseHeading::-webkit-scrollbar{display:none}
#browseHeading .catalog-breadcrumb-button{
  appearance:none;border:0;background:transparent;color:#19384d;
  font:inherit;font-size:inherit;font-weight:850;
  padding:6px 3px;line-height:1.25;min-height:40px;
  max-width:57vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  flex:0 0 auto;touch-action:manipulation;
  user-select:none;-webkit-user-select:none;cursor:pointer;
}
#browseHeading .catalog-breadcrumb-button:not([aria-current="page"]){
  color:#14689d;text-decoration:underline;text-decoration-thickness:1px;
  text-underline-offset:4px;
}
#browseHeading .catalog-breadcrumb-button:focus-visible{
  outline:2px solid #ff8a30;outline-offset:1px;border-radius:6px;
}
#browseHeading .catalog-breadcrumb-separator{
  flex:0 0 auto;color:#93a4b2;font-weight:700;pointer-events:none;
}
#categoryTrailName{user-select:none;-webkit-user-select:none}
/* This banner is an absolute child of the existing sticky header:
   it stays below the search at any page scroll position. */
.clean-topbar .cart-confirm-toast{
  position:absolute;top:calc(100% + 7px);bottom:auto;
  left:50%;transform:translateX(-50%);
  display:flex;align-items:center;justify-content:center;gap:9px;
  box-sizing:border-box;
  width:max-content;max-width:calc(100vw - 26px);min-width:min(280px,calc(100vw - 26px));
  background:#087546;color:#fff;
  border:1px solid #48b685;border-radius:11px;
  padding:10px 12px;box-shadow:0 5px 17px #102f2699;
  font-size:clamp(11px,3vw,13px);font-weight:800;
  line-height:1.25;text-align:center;z-index:15;
}
.clean-topbar .cart-confirm-toast[hidden]{display:none!important}
.cart-confirm-check{
  display:grid;place-items:center;flex:0 0 auto;
  width:21px;height:21px;border-radius:50%;
  color:#087546;background:#fff;font-size:15px;font-weight:900;
}
.cart-confirm-text{
  flex:1 1 auto;min-width:0;
  overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;
  -webkit-line-clamp:2;overflow-wrap:anywhere;
}
.cart-confirm-close{
  flex:0 0 auto;display:grid;place-items:center;
  width:26px;height:27px;min-height:27px;
  border:0;border-radius:6px;background:transparent;color:#fff;
  font-size:20px;line-height:1;padding:0;cursor:pointer;
}


/* v4.0 — approved dedicated home dashboard. The original 12 main-category
   cards retain their existing layout, now inside the Products tab. No CSS
   changes to product-management, checkout, customer or settings dialogs. */
#homeView.dashboard-home{
  padding:4px 0 24px!important;
  max-width:840px;
  margin-inline:auto!important;
}
.dashboard-hero{
  display:flex;
  align-items:center;
  position:relative;
  overflow:hidden;
  width:100%;
  min-height:clamp(155px,35vw,242px);
  margin:0 0 clamp(14px,3vw,21px);
  border:1px solid #f8e5d4;
  border-radius:clamp(21px,4.5vw,29px);
  background:
    radial-gradient(circle at 93% 100%,#ffc8a5cc 0%,transparent 39%),
    radial-gradient(circle at 0% 100%,#d6e6ff 0%,transparent 45%),
    linear-gradient(110deg,#f2f6ff 0%,#fff9ee 64%,#ffeddf 100%);
  box-shadow:0 6px 20px #132a4012;
}
.dashboard-hero-copy{
  position:relative;
  z-index:2;
  width:59%;
  flex:none;
  padding:clamp(16px,4vw,30px) 0 clamp(16px,4vw,30px) clamp(17px,4.4vw,34px);
}
.dashboard-hero h1{
  color:#11243e;
  font-size:clamp(22px,5.5vw,41px);
  line-height:1.08;
  letter-spacing:-.03em;
  font-weight:950;
  margin:0 0 clamp(8px,2vw,14px);
}
.dashboard-hero h1 span{
  display:inline-block;
  font-size:.72em;
  vertical-align:middle;
}
.dashboard-hero p{
  color:#425b76;
  font-size:clamp(12px,2.9vw,18px);
  line-height:1.35;
  font-weight:500;
  margin:0;
  max-width:330px;
}
.dashboard-hero-art{
  position:absolute;
  right:-1.5%;
  bottom:-5%;
  width:55%;
  height:106%;
  object-fit:contain;
  object-position:right bottom;
  pointer-events:none;
}
.dashboard-actions{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(8px,2vw,16px);
  margin-bottom:clamp(20px,4vw,35px);
}
.dashboard-action{
  border:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  width:100%;
  min-width:0;
  min-height:clamp(117px,27vw,185px);
  padding:clamp(9px,2.6vw,18px) 5px;
  border-radius:clamp(17px,4vw,25px);
  text-align:center;
  gap:2px;
  box-shadow:0 3px 13px #1529420e;
  color:#132842;
  transition:transform .12s ease,box-shadow .12s ease;
}
.dashboard-action:active{transform:scale(.965)}
.dashboard-action:focus-visible,.dashboard-metric:focus-visible{
  outline:3px solid #267ad6;outline-offset:2px;
}
.dashboard-action-icon{
  display:block;
  width:clamp(43px,11vw,75px);
  height:clamp(43px,11vw,75px);
  stroke:none;
  fill:none;
  margin-bottom:clamp(3px,1vw,9px);
  filter:drop-shadow(0 3px 2px #16294913);
}
.dashboard-action strong{
  display:block;
  max-width:100%;
  font-size:clamp(13px,3.7vw,22px);
  line-height:1.12;
  letter-spacing:-.025em;
  font-weight:900;
}
.dashboard-action small{
  display:block;
  font-size:clamp(9px,2.5vw,15px);
  line-height:1.2;
  color:#405b74;
  font-weight:500;
}
.dashboard-action-categories{background:linear-gradient(132deg,#e3f5ff,#bfe9fd)}
.dashboard-action-categories .dashboard-action-icon{color:#0479d9}
.dashboard-action-sale{background:linear-gradient(130deg,#e3ffe9,#cbffd1)}
.dashboard-action-sale .dashboard-action-icon{color:#09aa23}
.dashboard-action-products{background:linear-gradient(132deg,#fff3d9,#ffe6b4)}
.dashboard-action-products .dashboard-action-icon{color:#efa018}
.dashboard-action-barcode{background:linear-gradient(132deg,#ffedf3,#ffcee4)}
.dashboard-action-barcode .dashboard-action-icon{color:#c41469}
.dashboard-action-stock{background:linear-gradient(130deg,#f2e7ff,#e1ccff)}
.dashboard-action-stock .dashboard-action-icon{color:#9c3bcf}
.dashboard-action-reports{background:linear-gradient(130deg,#e4faff,#b5f0fa)}
.dashboard-action-reports .dashboard-action-icon{color:#02a8c7}
.dashboard-metrics{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:clamp(8px,2vw,16px);
  padding-top:clamp(12px,3vw,20px);
  border-top:1px solid #e5eaf0;
}
.dashboard-metric{
  width:100%;min-width:0;
  min-height:clamp(88px,20vw,119px);
  padding:clamp(11px,3vw,20px);
  display:flex;align-items:center;
  gap:clamp(8px,2vw,16px);
  border:1px solid #e7e9ed;
  border-radius:clamp(17px,4vw,24px);
  background:#fff;color:#16304d;
  text-align:left;
  box-shadow:0 3px 14px #12294310;
}
/* Both summary cards share the same neutral surface. No filled blue sales tile. */
.dashboard-metric-sales{
  color:#16304d;
  border-color:#e7e9ed;
  background:#fff;
}
.dashboard-metric-icon{
  flex:none;
  display:grid;place-items:center;
  width:clamp(37px,10vw,66px);
  height:clamp(37px,10vw,66px);
  background:#eaf2fc;color:#1b66b7;
  border-radius:50%;font-size:clamp(27px,7vw,42px);font-weight:900;
}
.dashboard-metric-sales .dashboard-metric-icon{
  background:#22b0f1;color:#fff;
}
.dashboard-metric-body{
  flex:1;min-width:0;
  display:flex;flex-direction:column;
  gap:2px;
}
.dashboard-metric-body>span{
  font-size:clamp(11px,3.1vw,17px);
  font-weight:700;
  white-space:nowrap;
}
.dashboard-metric-body>strong{
  font-size:clamp(16px,5vw,30px);
  font-weight:950;line-height:1.22;
  letter-spacing:-.025em;
  font-variant-numeric:tabular-nums;
  overflow-wrap:anywhere;
}
.dashboard-metric-body>small{
  font-size:clamp(8px,2.1vw,12px);
  opacity:.78;
  line-height:1.18;
}
.dashboard-metric-arrow{
  flex:none;
  font-size:clamp(21px,5vw,34px);
  font-weight:600;
}
#productCategoryHome{
  padding:0 0 12px;
}
#productCategoryHome[hidden],#catalogCategoryNavigator[hidden]{
  display:none!important;
}
/* Match the approved five-item footer without changing its position,
   fixed behavior, cart bar, or sale-dialog controls. */
.bottom-shell .bottom-nav{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:clamp(2px,.8vw,5px);
}
.bottom-shell .bottom-nav .nav-item{
  padding:6px 1px 3px;
  min-width:0;
  min-height:49px;
}
.bottom-shell .bottom-nav .nav-item small{
  font-size:clamp(9px,2.45vw,12px);
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.bottom-shell .bottom-nav .nav-item span{
  font-size:clamp(23px,6vw,28px);
}
@media(max-width:360px){
  .dashboard-hero{min-height:148px}
  .dashboard-hero-copy{width:62%}
  .dashboard-hero h1{font-size:21px}
  .dashboard-actions{gap:7px}
  .dashboard-action{min-height:106px}
  .dashboard-action small{font-size:9px}
  .dashboard-metric{gap:6px;padding:10px 8px}
  .dashboard-metric-icon{width:34px;height:34px;font-size:25px}
  .dashboard-metric-arrow{font-size:20px}
}
@media(min-width:700px){
  #homeView.dashboard-home{padding-top:14px!important}
  .dashboard-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){
  .dashboard-action{transition:none}
}


/* v4.1 adaptive shell — phone, portrait tablet, landscape tablet and Full HD.
   Width/orientation media queries, not browser or device-brand sniffing.
   Mobile's approved 3×4 Products gallery remains untouched below 600px.
   Stock, receipt and D1 controls do not change. */
.desktop-home-categories{display:none}
.desktop-only-nav{display:none!important}
.bottom-shell .bottom-nav{
  grid-template-columns:repeat(4,minmax(0,1fr));
}
/* Portrait tablet: same familiar footer and 3×4 product categories, enlarged
   touch targets. Avoid the desktop sidebar in portrait even at 1024px. */
@media (min-width:600px) and (orientation:portrait){
  #homeView.dashboard-home{
    max-width:840px!important;
    padding-inline:clamp(10px,2.4vw,26px)!important;
  }
  #productCategoryHome{max-width:920px;margin-inline:auto}
  #homeCategoryShortcuts{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    max-width:860px!important;
    gap:clamp(10px,2vw,20px)!important;
  }
  #homeCategoryShortcuts .photo-category-image{
    height:clamp(110px,15vw,185px)!important;
  }
  #homeCategoryShortcuts .photo-category-name{
    font-size:clamp(13px,1.8vw,17px)!important;
  }
  #categoryTree.category-grid-page{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .bottom-shell .bottom-nav .nav-item{min-height:58px}
}
/* Tablet landscape (>=900px wide and >=600px high) or wide desktop (>=1440px):
   left navigation, top search, real live metrics and 4×3 categories.
   All content uses the same DOM and shared D1 data as mobile. */
@media (min-width:900px) and (min-height:600px) and (orientation:landscape), (min-width:1440px){
  :root{--hizli-sidebar:clamp(206px,16vw,260px)}
  #app::before{
    content:"";display:block;
    position:fixed;inset:0 auto 0 0;
    width:var(--hizli-sidebar);
    background:linear-gradient(160deg,#0c2442,#112c4b 65%,#0b233e);
    z-index:10;
    pointer-events:none;
  }
  .clean-topbar{
    width:calc(100% - var(--hizli-sidebar));
    min-height:82px;
    margin:0 0 0 var(--hizli-sidebar)!important;
    padding:12px clamp(16px,2vw,34px)!important;
    display:flex;align-items:center;
    background:#0b2443!important;
    position:sticky;top:0;z-index:13;
  }
  .clean-topbar .brandline{
    width:0;height:0;min-height:0!important;
    margin:0!important;padding:0!important;
    overflow:visible;
  }
  .clean-topbar .brand-home{
    position:fixed;
    z-index:18;
    top:18px;left:15px;
    width:calc(var(--hizli-sidebar) - 30px);
    padding:4px 0;
    color:#fff;
    min-height:54px;
  }
  .clean-topbar .brandmark{
    width:47px;height:47px;border-radius:13px;flex:none;
  }
  .clean-topbar .brandline strong{font-size:clamp(17px,1.32vw,21px)}
  .clean-topbar .brandline small{font-size:clamp(8px,.7vw,11px)}
  .clean-topbar #connectionStatus{
    position:fixed;
    bottom:22px;left:15px;z-index:18;
    margin:0;
    width:calc(var(--hizli-sidebar) - 30px);
    text-align:center;
    border:1px solid #3b5a75;
    padding:12px 9px;
    background:#1f3c58;
    border-radius:12px;
    color:#dffcef;
  }
  .clean-topbar .searchline{
    width:min(920px,100%);
    margin:0!important;gap:14px;
  }
  .clean-topbar .searchbox input{
    height:54px;min-height:54px;
    font-size:clamp(15px,1.4vw,20px);
  }
  .clean-topbar .scanbutton{
    width:57px;min-width:57px;height:54px;
    border-radius:12px;
  }
  .clean-topbar .cart-confirm-toast{
    left:50%;max-width:min(560px,calc(100vw - var(--hizli-sidebar) - 48px));
  }
  .clean-content{
    width:calc(100% - var(--hizli-sidebar));
    max-width:none!important;
    margin:0 0 0 var(--hizli-sidebar)!important;
    padding:clamp(16px,1.7vw,32px) clamp(16px,1.65vw,32px) 104px!important;
    min-width:0;
  }
  #homeView.dashboard-home{
    display:grid;
    width:100%;
    max-width:none!important;
    margin:0!important;
    padding:0 0 20px!important;
    grid-template-columns:minmax(0,1fr);
    grid-template-areas:"hero" "metrics" "actions" "categories";
    gap:clamp(12px,1.1vw,22px);
  }
  .dashboard-hero{
    grid-area:hero;
    width:100%;
    margin:0!important;
    min-height:178px;
    border-radius:19px;
  }
  .dashboard-hero-copy{padding:18px 0 18px 25px}
  .dashboard-hero h1{font-size:clamp(25px,2.7vw,39px)}
  .dashboard-hero p{font-size:clamp(13px,1.3vw,18px)}
  .dashboard-metrics{
    grid-area:metrics;
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    margin:0;padding:0;border:0;
    gap:clamp(10px,1vw,18px);
  }
  .dashboard-metric{
    min-height:105px;
    padding:14px;
    border-radius:16px;
  }
  .dashboard-metric-icon{
    width:clamp(37px,4vw,62px);
    height:clamp(37px,4vw,62px);
    font-size:clamp(25px,3vw,38px);
  }
  .dashboard-metric-body>span{font-size:clamp(12px,1.1vw,16px)}
  .dashboard-metric-body>strong{font-size:clamp(18px,1.8vw,29px)}
  .dashboard-actions{
    grid-area:actions;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:clamp(7px,.9vw,14px);
    margin:0!important;
  }
  .dashboard-action{
    min-height:70px;
    flex-direction:row;
    justify-content:center;
    text-align:left;
    gap:clamp(5px,.6vw,12px);
    padding:8px 7px;
    border-radius:14px;
  }
  .dashboard-action-icon{
    flex:none;width:clamp(25px,2.7vw,40px);
    height:clamp(25px,2.7vw,40px);margin:0;
  }
  .dashboard-action strong{
    font-size:clamp(11px,1.1vw,16px);
    letter-spacing:-.02em;
  }
  .dashboard-action small{display:none}
  #desktopHomeCategories{
    grid-area:categories;display:block;
    min-width:0;
  }
  #desktopHomeCategories h2{
    font-size:clamp(21px,1.65vw,30px);
    font-weight:900;
    color:#132b46;
    margin:0 0 16px;
  }
  #desktopHomeCategoryGrid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:clamp(9px,1vw,17px);
    align-items:stretch;
  }
  #desktopHomeCategoryGrid .photo-category-tile{
    position:relative;
    width:100%;min-width:0;
    height:clamp(95px,9.4vw,135px);
    min-height:0;
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:flex-start!important;
    gap:8px!important;
    border-radius:16px!important;
    background:#fff!important;
    padding:10px!important;
    box-shadow:0 3px 14px #182c4915;
    text-align:left!important;
  }
  #desktopHomeCategoryGrid .photo-category-image{
    position:relative;
    width:43%!important;
    height:100%!important;
    aspect-ratio:auto!important;
    flex:0 0 43%;
    overflow:hidden;
    background:transparent!important;
    border-radius:10px!important;
  }
  #desktopHomeCategoryGrid .photo-category-image img{
    width:100%;height:100%;
    object-fit:contain!important;
    transform:none!important;
    padding:0!important;
  }
  #desktopHomeCategoryGrid .photo-category-badge{display:none!important}
  #desktopHomeCategoryGrid .photo-category-name{
    display:block!important;
    flex:1;
    min-width:0;min-height:0;
    padding:0!important;
    line-height:1.2;
    font-size:clamp(11px,1.11vw,17px)!important;
    font-weight:850;
    color:#142744;
    overflow-wrap:anywhere;
  }
  #desktopHomeCategoryGrid .desktop-home-chevron{
    display:grid;place-items:center;
    flex:0 0 25px;
    height:27px;width:25px;
    border:1px solid #deebf6;
    border-radius:50%;
    color:#17456d;
    background:#f5faff;
    font-size:25px;
    line-height:1;
  }
  /* The existing 12-card Products view, and its nested category browser,
     also switch to 4 columns while retaining original images and behavior. */
  #homeCategoryShortcuts{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    max-width:none!important;
    width:100%!important;
    gap:clamp(9px,1vw,17px)!important;
    padding:5px 0 20px!important;
  }
  #homeCategoryShortcuts .photo-category-image{
    height:clamp(90px,10vw,160px)!important;
  }
  #homeCategoryShortcuts .photo-category-name{
    font-size:clamp(12px,1.1vw,16px)!important;
  }
  #categoryTree.category-grid-page{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(9px,1vw,16px)!important;
  }
  /* Keep cart accessible, but make the existing mobile bottom menu into a
     fixed dark sidebar. No duplicate navigation or second listeners. */
  .bottom-shell{
    position:fixed!important;
    top:auto!important;
    left:calc(var(--hizli-sidebar) + 12px)!important;
    right:clamp(12px,2vw,34px)!important;
    bottom:16px!important;
    width:auto!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    z-index:16!important;
    pointer-events:none;
  }
  .bottom-shell .cart-summary{
    max-width:410px;
    width:min(410px,100%);
    margin:0 0 0 auto!important;
    border-radius:14px;
    pointer-events:auto;
  }
  .bottom-shell .bottom-nav{
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch;
    justify-content:flex-start;
    position:fixed!important;
    top:110px;bottom:110px;
    left:11px;
    width:calc(var(--hizli-sidebar) - 22px);
    height:auto;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    gap:8px;
    overflow-y:auto;
    background:transparent;
    z-index:17;
    pointer-events:auto;
  }
  .bottom-shell .bottom-nav .nav-item{
    display:flex!important;
    min-width:0;
    min-height:50px;
    flex:0 0 auto;
    flex-direction:row;
    align-items:center;
    justify-content:flex-start;
    gap:14px;
    padding:9px 15px;
    border-radius:11px;
    background:transparent;
    color:#e7f0fb;
  }
  .bottom-shell .bottom-nav .nav-item.active{
    background:linear-gradient(105deg,#0568d7,#0551ac);
    color:#fff;
  }
  .bottom-shell .bottom-nav .nav-item span{
    min-width:28px;
    font-size:27px;
    text-align:center;
  }
  .bottom-shell .bottom-nav .nav-item small{
    font-size:clamp(12px,1vw,16px);
    font-weight:800;
    white-space:nowrap;
    color:inherit;
  }
  .bottom-shell .bottom-nav .desktop-only-nav{
    display:flex!important;
  }
  #navHome{order:1}
  #navProducts{order:2}
  #navSale{order:3}
  #sidebarStock{order:4}
  #sidebarReports{order:5}
  #navSettings{order:6;margin-top:14px}
  /* Desktop forms and stock search must fit the available main column. */
  .settings-view,.clean-categories,#productResults{
    width:100%;max-width:1100px;margin-inline:auto;
  }
  .clean-page-head{min-width:0}
  #browseHeading .catalog-breadcrumb-button{max-width:28vw}
}
/* Smaller landscape tablets keep the sidebar and 4×3 categories but use
   a more comfortable 3×2 quick-action grid. */
@media (min-width:900px) and (max-width:1100px) and (min-height:600px) and (orientation:landscape){
  .dashboard-actions{grid-template-columns:repeat(3,minmax(0,1fr))}
  .dashboard-action{min-height:56px}
  #desktopHomeCategoryGrid .photo-category-tile{padding:6px!important;gap:4px!important}
  #desktopHomeCategoryGrid .photo-category-image{flex-basis:39%;width:39%!important}
  #desktopHomeCategoryGrid .desktop-home-chevron{flex-basis:19px;width:19px;height:22px;font-size:20px}
}
/* Full-HD desktop: hero and two metrics share the first row like the
   approved 1920×1080 mockup, then compact actions and four-by-three cards. */
@media (min-width:1440px){
  #homeView.dashboard-home{
    grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    grid-template-areas:"hero metrics" "actions actions" "categories categories";
    align-items:stretch;
  }
  .dashboard-hero{min-height:166px}
  .dashboard-metrics{align-items:stretch}
  .dashboard-metric{
    padding:clamp(10px,1.1vw,18px);
    min-height:0;
    gap:clamp(5px,.7vw,13px);
  }
  .dashboard-metric-icon{
    width:clamp(36px,3.5vw,58px);height:clamp(36px,3.5vw,58px);
  }
  .dashboard-metric-body>strong{font-size:clamp(17px,1.55vw,27px)}
  #desktopHomeCategoryGrid .photo-category-tile{
    height:clamp(100px,8.3vw,136px);
  }
}
/* When users shrink a desktop browser, the media queries drop the sidebar
   automatically and restore the mobile/tablet bottom bar. */

/* v4.4 — Four equal-sized, individually colorful premium iOS navigation tiles.
   Selected tile is emphasized without changing its geometry or moving it up.
   Desktop/tablet landscape sidebar keeps its established layout. */
.bottom-shell .bottom-nav .nav-glyph svg{
  width:25px;height:25px;display:block;fill:none;stroke:currentColor;
  stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round;
}
@media (max-width:899px), (min-width:900px) and (max-width:1439px) and (orientation:portrait){
  .bottom-shell{
    background:linear-gradient(180deg,rgba(255,255,255,.95),rgba(248,250,255,.97));
    -webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px);
    border-top:1px solid rgba(209,220,236,.78);
    box-shadow:0 -8px 26px rgba(15,36,76,.07);
  }
  .bottom-shell .bottom-nav{
    display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
    align-items:stretch;gap:clamp(5px,1.4vw,10px);
    width:100%;max-width:680px;margin:0 auto;
  }
  .bottom-shell .bottom-nav .nav-item,
  .bottom-shell .bottom-nav .nav-item.active,
  .bottom-shell .bottom-nav .nav-sale,
  .bottom-shell .bottom-nav .nav-sale.active{
    box-sizing:border-box;width:100%;min-width:0;
    height:68px;min-height:68px;max-height:68px;
    margin:0;padding:7px 2px 6px;
    border:1px solid rgba(255,255,255,.87);border-radius:17px;
    display:flex;flex-direction:column;
    justify-content:center;align-items:center;gap:3px;
    color:var(--tab-ink);background:var(--tab-bg);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 3px 8px rgba(22,48,83,.07);
    transform:none;transition:background .18s,color .18s,box-shadow .18s;
  }
  .bottom-shell .bottom-nav #navHome{
    --tab-ink:#0961b7;--tab-bg:linear-gradient(145deg,#eaf5ff,#cee6ff);
    --tab-active:linear-gradient(145deg,#2795f8,#0763cf);
  }
  .bottom-shell .bottom-nav #navSale{
    --tab-ink:#a43d16;--tab-bg:linear-gradient(145deg,#fff0d8,#ffd5c6);
    --tab-active:linear-gradient(145deg,#ffad31,#f05236);
  }
  .bottom-shell .bottom-nav #navProducts{
    --tab-ink:#673bb7;--tab-bg:linear-gradient(145deg,#f2ecff,#ddceff);
    --tab-active:linear-gradient(145deg,#956af0,#673bd0);
  }
  .bottom-shell .bottom-nav #navSettings{
    --tab-ink:#087b68;--tab-bg:linear-gradient(145deg,#e6fff7,#bcefe3);
    --tab-active:linear-gradient(145deg,#18b8a0,#087f73);
  }
  .bottom-shell .bottom-nav .nav-item.active,
  .bottom-shell .bottom-nav .nav-item.active:not(.nav-sale),
  .bottom-shell .bottom-nav .nav-sale.active{
    color:#fff;background:var(--tab-active);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.34),0 4px 12px rgba(34,65,106,.18);
    transform:none;
  }
  .bottom-shell .bottom-nav .nav-glyph{
    display:grid;place-items:center;flex:none;
    width:30px;height:29px;min-width:0;
    color:inherit;
  }
  .bottom-shell .bottom-nav .nav-item .nav-glyph svg,
  .bottom-shell .bottom-nav .nav-sale .nav-glyph svg{
    width:25px;height:25px;stroke-width:2;display:block;
  }
  .bottom-shell .bottom-nav .nav-item small,
  .bottom-shell .bottom-nav .nav-sale small{
    display:block;max-width:100%;overflow:visible;
    color:inherit;font-size:clamp(10px,2.6vw,12px);
    line-height:1.12;font-weight:800;letter-spacing:-.01em;
    white-space:nowrap;text-overflow:clip;
  }
  .bottom-shell .bottom-nav .nav-item:focus-visible{
    outline:3px solid #73b8ff;outline-offset:2px;
  }
}
@media (prefers-reduced-motion:reduce){
  .bottom-shell .bottom-nav .nav-item{transition:none}
}

/* Premium electric-blue camera reader; all visual layers are pointer transparent. */
#scanDialog.premium-scanner{
  position:fixed;inset:0;box-sizing:border-box;width:100%;max-width:100vw;
  height:100dvh;max-height:100dvh;margin:0;padding:0;
  display:flex;flex-direction:column;gap:0;overflow-y:auto;
  border:0;border-radius:0;color:#f4f8ff;
  background:linear-gradient(155deg,#101a2c 0%,#070c16 53%,#111e35 100%);
  -webkit-overflow-scrolling:touch;
}
#scanDialog.premium-scanner:not([open]){display:none}
#scanDialog .scanner-topbar{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:calc(15px + env(safe-area-inset-top)) 17px 12px;flex:none;
}
#scanDialog .scanner-heading{display:flex;align-items:center;gap:11px;min-width:0}
#scanDialog .scanner-heading-icon{
  display:grid;place-items:center;flex:none;width:42px;height:42px;
  border-radius:14px;background:linear-gradient(135deg,#11b2ff,#065ce6);
  box-shadow:0 6px 20px #0075ff55;color:#fff;font-size:27px;
}
#scanDialog .scanner-eyebrow{
  display:block;margin-bottom:3px;color:#7fb2e6;
  font-size:9px;font-weight:850;letter-spacing:.14em;
}
#scanDialog #scanTitle{
  color:#fff;font-size:21px;font-weight:880;line-height:1.2;margin:0;letter-spacing:-.035em;
}
#scanDialog .scan-header-actions{display:flex;gap:8px;align-items:center}
#scanDialog .scan-torch,#scanDialog .scanner-close{
  width:45px;height:45px;min-height:45px;display:grid;place-items:center;
  flex:none;border:1px solid #52648079;border-radius:14px;
  background:#ffffff13;color:#ecf5ff;font-size:21px;
  -webkit-backdrop-filter:blur(13px);backdrop-filter:blur(13px);
}
#scanDialog .scan-torch span{display:none}
#scanDialog .scan-torch[aria-pressed="true"]{
  background:#ffdd71;color:#443104;border-color:#ffe99b;
  box-shadow:0 0 20px #ffcc3270;
}
#scanDialog .scan-torch:disabled{opacity:.36}
#scanDialog .scanner-close{font-size:29px;font-weight:300}
#scanDialog .scan-instruction{
  flex:none;margin:7px 20px 15px;text-align:center;color:#c3d5ed;
  font-size:14px;font-weight:650;line-height:1.35;
}
#scanDialog #scannerView.scanner-view{
  flex:1 0 auto;position:relative;isolation:isolate;width:calc(100% - 24px);
  min-height:260px;height:clamp(260px,50dvh,570px);max-height:57dvh;
  margin:0 12px;border-radius:24px;border:1px solid #417ab74a;
  overflow:hidden;background:#040912;
  box-shadow:0 18px 40px #0007,inset 0 0 25px #0008;
}
#scanDialog #html5-reader,#scanDialog #scanVideo{
  position:absolute;inset:0;width:100%;height:100%;border:0;
  object-fit:cover;overflow:hidden;background:#050a12;
}
#scanDialog #html5-reader{min-height:0}
#scanDialog #html5-reader video,#scanDialog #scanVideo{
  width:100%!important;height:100%!important;max-height:none!important;
  object-fit:cover!important;border:0!important;
}
#scanDialog #html5-reader>div{max-width:none!important;width:100%!important}
#scanDialog .target-frame{
  position:absolute;z-index:6;inset:auto auto auto 7%;top:50%;
  transform:translateY(-50%);width:86%;
  height:clamp(125px,38vw,205px);max-height:50%;
  border:0;border-radius:19px;opacity:1;pointer-events:none;
  box-shadow:0 0 0 900px rgba(1,5,13,.43),0 0 29px #008ff51b;
  background:linear-gradient(180deg,#16a9ff08,#0c7fff03);
}
#scanDialog .scan-corner{
  position:absolute;display:block;width:37px;height:37px;
  border:4px solid #19b5ff;filter:drop-shadow(0 0 5px #00aaff)
    drop-shadow(0 0 12px #178cffaa);
  border-radius:10px;
}
#scanDialog .scan-corner-tl{top:-1px;left:-1px;border-right:0;border-bottom:0;border-radius:13px 0 0 0}
#scanDialog .scan-corner-tr{top:-1px;right:-1px;border-left:0;border-bottom:0;border-radius:0 13px 0 0}
#scanDialog .scan-corner-bl{bottom:-1px;left:-1px;border-right:0;border-top:0;border-radius:0 0 0 13px}
#scanDialog .scan-corner-br{bottom:-1px;right:-1px;border-left:0;border-top:0;border-radius:0 0 13px 0}
#scanDialog .scan-laser{
  position:absolute;left:5%;right:5%;height:2px;top:10%;
  background:linear-gradient(90deg,transparent,#4be5ff 17%,#0f97ff 50%,#4be5ff 83%,transparent);
  box-shadow:0 0 9px 3px #009dffb8,0 0 27px #0085ff;
  animation:premium-laser 2.4s ease-in-out infinite alternate;
}
@keyframes premium-laser{from{top:9%}to{top:90%}}
#scanDialog .scan-confirm{
  position:absolute;top:50%;left:50%;display:grid;place-items:center;
  transform:translate(-50%,-50%) scale(.65);opacity:0;
  width:78px;height:78px;border-radius:50%;background:#0e9e5cbb;
  border:2px solid #9cffc9;box-shadow:0 0 38px #00ed79aa;
  font-size:44px;color:#fff;transition:opacity .18s,transform .24s;
}
#scanDialog.is-success .scan-corner{
  border-color:#44ff9d;filter:drop-shadow(0 0 10px #17ea78);
}
#scanDialog.is-success .scan-laser{animation-play-state:paused;opacity:0}
#scanDialog.is-success .scan-confirm{opacity:1;transform:translate(-50%,-50%) scale(1)}
#scanDialog .scan-message{
  flex:none;min-height:22px;margin:13px 14px 8px;text-align:center;
  font-size:13px;font-weight:780;color:#70ceff;line-height:1.35;
}
#scanDialog.is-success .scan-message{color:#70ffaf}
#scanDialog .scan-tools{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;padding:7px 15px;flex:none;margin:0;
}
#scanDialog .scan-tools button,#scanDialog .scan-tools .scan-photo-button{
  display:flex;align-items:center;justify-content:center;gap:8px;min-width:0;
  height:53px;min-height:53px;border-radius:16px;border:1px solid #536881;
  background:linear-gradient(140deg,#263956,#1c293e);
  box-shadow:inset 0 1px 0 #ffffff15;color:#f6faff;font-size:14px;font-weight:800;
  cursor:pointer;
}
#scanDialog .scan-tools button span,#scanDialog .scan-tools label span{font-size:19px;color:#67bdff}
#scanDialog .scan-manual{flex:none;padding:8px 15px 0}
#scanDialog .scan-manual>label{display:block;color:#a2b9d3;font-size:11px;font-weight:750;margin-bottom:6px}
#scanDialog .scan-manual-row{display:flex;gap:8px}
#scanDialog .scan-manual-row input{
  min-width:0;flex:1;height:46px;background:#131f32;color:white;border:1px solid #3e526c;
  border-radius:13px;padding:0 12px;font-size:15px;
}
#scanDialog .scan-manual-row input::placeholder{color:#849ab4}
#scanDialog .scan-manual-row button{
  min-height:46px;min-width:71px;background:linear-gradient(140deg,#0789ff,#075bd5);
  color:#fff;border:0;border-radius:13px;font-size:13px;
}
#scanDialog .scan-footer{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 16px calc(15px + env(safe-area-inset-bottom));flex:none;
}
#scanDialog .scan-footer button{
  min-height:37px;color:#89c8ff;border:0;background:transparent;
  font-size:12px;font-weight:800;text-align:left;padding:0;
}
#scanDialog .scan-footer small{color:#7289a5;text-align:right;font-size:10px}
#scanDialog .scan-history-panel{
  flex:1 0 auto;min-height:240px;max-height:57dvh;
  margin:0 12px;border-radius:22px;border:1px solid #3d5777;
  padding:17px;overflow:auto;background:#121f31;
}
#scanDialog .scan-history-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:12px}
#scanDialog .scan-history-title strong{font-size:17px}
#scanDialog .scan-history-title button{color:#6bc6ff;background:#193653;border:1px solid #355c88;padding:8px 12px;border-radius:10px;font-size:12px}
#scanDialog .scan-history-list{display:grid;gap:8px}
#scanDialog .scan-history-entry{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;border-radius:12px;border:1px solid #3c5370;background:#1d3046;color:#fff;text-align:left;padding:11px 13px}
#scanDialog .scan-history-entry strong{display:block;font-size:13px;word-break:break-all}
#scanDialog .scan-history-entry small{display:block;color:#9eb5cf;font-size:11px;margin-top:3px}
#scanDialog .scan-history-empty{color:#a4b7ce;font-size:13px;line-height:1.5}
@media (max-height:700px){
  #scanDialog .scanner-topbar{padding-top:calc(8px + env(safe-area-inset-top))}
  #scanDialog .scan-instruction{margin:3px 15px 8px}
  #scanDialog #scannerView.scanner-view{height:40dvh;min-height:210px;max-height:44dvh}
  #scanDialog .scan-tools button,#scanDialog .scan-tools .scan-photo-button{min-height:45px;height:45px}
  #scanDialog .scan-footer{padding-top:3px}
}
@media (prefers-reduced-motion:reduce){
  #scanDialog .scan-laser{animation:none;top:50%}
  #scanDialog .scan-confirm{transition:none}
}

/* v4.5 — five sale payment methods, balanced into 3 + 2 touch-friendly rows.
   Radio value becomes part of the existing sale / print / PDF / export records. */
.sale-sheet .payment-types{
  display:grid;grid-template-columns:repeat(6,minmax(0,1fr));
  gap:7px;margin:0 0 8px;
}
.sale-sheet .payment-types label{
  grid-column:span 2;min-width:0;
}
.sale-sheet .payment-types label:nth-of-type(n+4){
  grid-column:span 3;
}
.sale-sheet .payment-types span{
  display:flex;align-items:center;justify-content:center;gap:4px;
  min-height:45px;padding:8px 4px;
  border-radius:12px;font-size:clamp(11px,3vw,13px);font-weight:850;
  white-space:nowrap;
}
.sale-sheet .payment-types .payment-transfer span{
  color:#176c89;background:#ecfaff;border-color:#b6e0ef;
}
.sale-sheet .payment-types .payment-fast span{
  color:#7651a5;background:#f6f0ff;border-color:#d9c8f2;
}
.sale-sheet .payment-types .payment-transfer input:checked+span{
  color:#075d7b;background:#d7f2fb;border:2px solid #2093b3;
  box-shadow:0 0 0 2px #1c9eb91a;
}
.sale-sheet .payment-types .payment-fast input:checked+span{
  color:#6133a2;background:#ebe0ff;border:2px solid #9562d8;
  box-shadow:0 0 0 2px #9562d81c;
}
.sale-sheet .bank-payment-notice{
  margin:2px 1px 10px;padding:9px 12px;border-radius:11px;
  background:#fff9e9;color:#77551b;border:1px solid #ecd6a1;
  font-size:11px;font-weight:700;line-height:1.4;
}

/* v4.6 — owner-approved premium sales screen: one-line four-method checkout,
   secure close/cancel actions, visual empty cart, compact multi-device layout. */
.sale-sheet[open]{
  background:linear-gradient(180deg,#f8faff 0%,#ffffff 30%);
}
.sale-sheet .sale-sheet-header{
  display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;
  column-gap:11px;row-gap:9px;flex:none;min-height:78px;
  padding:calc(14px + env(safe-area-inset-top)) 13px 13px;
  background:linear-gradient(115deg,#078275,#075c53 78%,#064d4e);
  color:white;border:0;
}
.sale-sheet .sale-heading{display:flex;align-items:center;gap:7px;min-width:0}
.sale-sheet .sale-heading-icon{font-size:25px;display:grid;place-items:center}
.sale-sheet .sale-heading h2{display:inline;font-size:clamp(19px,5vw,24px);font-weight:900;color:#fff;margin:0}
.sale-sheet .sale-count-pill{
  display:flex;gap:5px;align-items:center;justify-content:center;
  white-space:nowrap;background:#ffffff2b;border-radius:30px;
  padding:5px 9px;font-size:12px;font-weight:850;color:#f2fff9;
}
.sale-sheet .sale-count{background:transparent;min-width:0;width:auto;height:auto;padding:0;font-size:14px}
.sale-sheet .sale-header-actions{display:flex;align-items:center;gap:5px;margin-left:auto;flex-wrap:nowrap}
.sale-sheet .sale-header-actions button{
  display:inline-flex;justify-content:center;align-items:center;gap:4px;
  min-height:39px;height:39px;padding:5px 8px;border-radius:13px;
  border:1px solid #d6ffefe0;background:#ffffff16;
  color:white;font-size:12px;font-weight:820;white-space:nowrap;
  -webkit-backdrop-filter:blur(11px);backdrop-filter:blur(11px);
}
.sale-sheet .sale-header-actions .sale-header-back{font-size:19px}
.sale-sheet .sale-header-actions .sale-header-back span{font-size:12px}
.sale-sheet .sale-header-actions .sale-header-close{font-size:24px}
.sale-sheet .sale-header-actions .sale-header-close span{font-size:12px}
.sale-sheet .sale-header-actions .sale-header-cancel{
  background:linear-gradient(130deg,#d94f61,#ad3450);
  border-color:#ffb8b8;box-shadow:0 3px 10px #7d182740;
}
.sale-sheet .sale-scanner{
  position:relative;display:flex;gap:7px;align-items:center;
  padding:11px 12px 12px;background:#fff;border-bottom:1px solid #e4ebf6;
}
.sale-sheet .sale-scanner input{
  flex:1;min-width:0;height:51px;min-height:51px;
  border:1px solid #d5e2ef;border-radius:16px;background:#f6f9fe;
  box-shadow:inset 0 1px 2px #0b36670a;color:#14263f;
  padding:0 11px 0 38px;font-size:clamp(13px,3.6vw,16px);
}
.sale-sheet .sale-search-symbol{
  position:absolute;left:22px;top:50%;transform:translateY(-50%);
  color:#7186a4;font-size:28px;pointer-events:none;line-height:1;
}
.sale-sheet .sale-scanner button{
  display:flex;align-items:center;justify-content:center;gap:5px;
  flex:none;height:51px;min-height:51px;min-width:47px;
  border-radius:14px;padding:3px 11px;font-weight:850;
  border:1px solid #ffffffbc;color:white;font-size:13px;
}
.sale-sheet .sale-scanner button b{font-size:23px;font-weight:850;line-height:1}
.sale-sheet .sale-scanner .sale-manual-add{
  background:linear-gradient(155deg,#17cc7a,#007e52);box-shadow:0 5px 13px #009b5840;
}
.sale-sheet .sale-scanner #saleScanButton{
  background:linear-gradient(150deg,#168fff,#0654aa);box-shadow:0 5px 13px #006bd03d;
}
.sale-sheet .sale-scanner button span{font-size:12px}
.sale-sheet .cart-items{
  flex:1 1 auto;min-height:0;max-height:none;overflow-y:auto;
  background:linear-gradient(170deg,#f9fbff,#fff);
}
.sale-sheet .sale-empty-premium{
  min-height:100%;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:7px;
  text-align:center;padding:18px 5px;color:#173758;
}
.sale-sheet .sale-empty-basket{
  display:grid;place-items:center;width:clamp(92px,23vw,132px);
  aspect-ratio:1;margin-bottom:2px;
  filter:drop-shadow(0 8px 12px #145abd29);
}
.sale-sheet .sale-empty-basket svg{width:100%;height:100%;stroke:none}
.sale-sheet .sale-empty-premium strong{
  font-size:clamp(19px,5.5vw,26px);font-weight:940;
  line-height:1.15;letter-spacing:-.035em;color:#152f50;
}
.sale-sheet .sale-empty-premium p{
  color:#657b97;font-size:clamp(11px,3vw,13px);
  margin:0 0 5px;line-height:1.35;
}
.sale-sheet .sale-empty-actions{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;width:100%;max-width:450px;margin-top:4px;
}
.sale-sheet .sale-empty-actions button{
  min-width:0;display:flex;justify-content:center;align-items:center;gap:4px;
  min-height:43px;padding:5px 4px;border-radius:13px;
  background:linear-gradient(150deg,#eff6ff,#e4efff);
  border:1px solid #d7e7ff;color:#1760ac;
  font-size:clamp(9px,2.7vw,12px);font-weight:850;white-space:nowrap;
}
.sale-sheet .sale-empty-actions span{font-size:19px}
.sale-sheet .checkout-area{
  flex:0 0 auto;background:#fff;max-height:60dvh;
  padding:11px 12px calc(13px + env(safe-area-inset-bottom));
  border:1px solid #e2ecf6;border-bottom:0;border-radius:23px 23px 0 0;
  box-shadow:0 -12px 28px #254b7410;overflow-y:auto;
}
.sale-sheet .total-row.grand{
  display:flex;align-items:center;gap:8px;
  font-size:clamp(18px,5vw,24px);font-weight:940;
  color:#102845;margin-bottom:6px;
}
.sale-sheet .total-row.grand strong{
  margin-left:auto;padding:5px 10px;border-radius:17px;
  font-size:clamp(22px,6vw,30px);color:#078044;
  background:#e6f8ef;font-variant-numeric:tabular-nums;
}
.sale-sheet .payment-types{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px;margin:7px 0 9px;padding:0;border:0;
}
.sale-sheet .payment-types label,
.sale-sheet .payment-types label:nth-of-type(n+4){
  grid-column:auto;min-width:0;display:block;
}
.sale-sheet .payment-types .payment-cash{
  --pay-ink:#006b45;--pay-light:#ddfae9;--pay-border:#78caaa;
  --pay-strong:linear-gradient(150deg,#00bc6a,#007c47);
}
.sale-sheet .payment-types .payment-card{
  --pay-ink:#1167ae;--pay-light:#e3f3ff;--pay-border:#a9d7ff;
  --pay-strong:linear-gradient(155deg,#339fff,#0963bb);
}
.sale-sheet .payment-types .payment-credit{
  --pay-ink:#bf650b;--pay-light:#fff1dd;--pay-border:#f6cc9a;
  --pay-strong:linear-gradient(155deg,#ffa337,#cf6b12);
}
.sale-sheet .payment-types .payment-transfer{
  --pay-ink:#6932b0;--pay-light:#edddff;--pay-border:#d4b9ff;
  --pay-strong:linear-gradient(155deg,#a36ef3,#6830b9);
}
.sale-sheet .payment-types label span,
.sale-sheet .payment-types .payment-transfer span{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  width:100%;height:72px;min-height:72px;box-sizing:border-box;
  gap:3px;margin:0;padding:6px 1px;border-radius:15px;
  border:1px solid var(--pay-border);background:var(--pay-light);
  box-shadow:inset 0 1px 0 #ffffffb0;color:var(--pay-ink);
  white-space:normal;text-align:center;
}
.sale-sheet .payment-types label span b{font-size:22px;line-height:1.05;font-weight:850}
.sale-sheet .payment-types label span small{
  display:block;font-size:clamp(9px,2.55vw,12px);font-weight:870;
  line-height:1.12;max-width:100%;white-space:normal;color:inherit;
}
.sale-sheet .payment-types label input:checked+span,
.sale-sheet .payment-types .payment-transfer input:checked+span{
  background:var(--pay-strong);color:#fff;
  border:2px solid #ffffffd0;box-shadow:0 4px 10px #1a51842b,0 0 0 2px var(--pay-border);
}
.sale-sheet .sale-quick-nav{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:8px 0 9px}
.sale-sheet .sale-quick-nav button{
  flex-direction:row;gap:6px;min-height:49px;padding:7px 4px;
  border:1px solid #d9e8f4;border-radius:14px;
  background:linear-gradient(150deg,#fff,#f3f7ff);
  box-shadow:0 3px 9px #2b589210;color:#285579;
  font-size:clamp(10px,2.85vw,13px);
}
.sale-sheet .sale-quick-nav button span{font-size:21px}
.sale-sheet #completeSale{
  min-height:55px;margin-top:4px;border-radius:16px;
  background:linear-gradient(110deg,#07c976,#007957);
  color:#fff;font-size:clamp(15px,4.2vw,19px);
  box-shadow:0 7px 17px #008d5750;
}
.sale-sheet #completeSale:disabled{
  background:#92c5b3;color:#effaf6;box-shadow:none;
}
.sale-exit-dialog{
  max-width:min(92vw,420px);width:100%;padding:20px;border-radius:23px;
  background:linear-gradient(155deg,#ffffff,#f3f8ff);border:1px solid #d6e6f4;
  box-shadow:0 18px 55px #061f4560;
}
.sale-exit-head{display:flex;align-items:center;gap:10px}
.sale-exit-head span{font-size:28px}
.sale-exit-head h2{font-size:20px;font-weight:900;color:#102b46;margin:0}
.sale-exit-dialog p{color:#586f84;font-size:13px;line-height:1.55;margin:13px 0}
.sale-exit-actions{display:grid;gap:9px}
.sale-exit-actions button{
  min-height:48px;border-radius:13px;border:1px solid #cfdeec;
  background:#f1f6fb;color:#214d6b;font-size:13px;font-weight:850;
}
.sale-exit-actions #saleExitStay{background:linear-gradient(130deg,#17a875,#08734f);color:white;border:0}
.sale-exit-actions #saleExitDiscard{background:#fff0f0;color:#aa3943;border-color:#f5caca}
@media(max-width:420px){
  .sale-sheet .sale-header-actions{gap:4px}
  .sale-sheet .sale-header-actions button{padding:4px 6px;font-size:11px;min-height:36px;height:36px}
  .sale-sheet .sale-header-actions .sale-header-back span,
  .sale-sheet .sale-header-actions .sale-header-close span{font-size:11px}
  .sale-sheet .sale-scanner button{width:49px;padding:2px;flex-direction:column}
  .sale-sheet .sale-scanner button span{display:none}
  .sale-sheet .sale-scanner button b{font-size:27px}
}
@media(max-height:690px){
  .sale-sheet .sale-sheet-header{padding-top:calc(6px + env(safe-area-inset-top));padding-bottom:6px}
  .sale-sheet .sale-empty-basket{width:80px}
  .sale-sheet .sale-empty-premium{padding:9px 4px}
  .sale-sheet .checkout-area{max-height:64dvh}
  .sale-sheet .payment-types label span{height:58px;min-height:58px}
}
@media(min-width:680px){
  .sale-sheet[open]{height:min(90dvh,790px);max-height:90dvh}
}

/* v4.7 — approved settings 2-by-4 tile grid and product-image sale layout. */
body.view-settings .settings-view{
  width:100%;max-width:760px;margin:0 auto;
  padding:16px 12px 26px;border-radius:22px;
  background:linear-gradient(142deg,#0f304f 0%,#0b5378 55%,#1b568c 100%);
  box-shadow:0 12px 28px #173d5a19;
}
body.view-settings .settings-view>h1{
  color:#fff;font-size:clamp(21px,5vw,27px);margin:4px 4px 17px;
  letter-spacing:-.03em;
}
.settings-view .settings-card-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;background:transparent;border:0;border-radius:0;overflow:visible;
}
.settings-view .settings-card-grid>.settings-tile{
  --tile-ink:#177e5a;--tile-start:#f2fff8;--tile-end:#c9f4db;
  --tile-edge:#46c986;
  box-sizing:border-box;min-width:0;width:100%;height:clamp(151px,43vw,191px);
  min-height:0;display:flex;flex-direction:column;align-items:center;
  justify-content:center;position:relative;isolation:isolate;
  text-align:center;gap:7px;padding:13px 13px 22px;
  color:#142d49;background:linear-gradient(146deg,var(--tile-start),var(--tile-end));
  border:2px solid #ffffffed;border-radius:22px;
  box-shadow:0 8px 15px #051f3c2a,inset 0 1px #ffffffc8;
  overflow:hidden;transition:transform .15s ease,filter .15s ease;
}
.settings-view .settings-card-grid>.settings-tile::after{
  content:'';position:absolute;z-index:-1;left:-10%;right:-10%;bottom:-34px;
  height:51px;background:var(--tile-edge);border-radius:60% 45% 0 0;
  transform:rotate(-3deg);opacity:.7;
}
.settings-view .settings-card-grid>.settings-tile:active{transform:scale(.975)}
.settings-view .settings-card-grid>.settings-tile:focus-visible{outline:3px solid #7bd8ff;outline-offset:3px}
.settings-view .settings-card-grid>.settings-tile .settings-tile-icon{
  display:grid;place-items:center;flex:0 0 auto;
  width:clamp(43px,12vw,59px);height:clamp(43px,12vw,59px);
  color:var(--tile-ink);text-align:center;
}
.settings-view .settings-card-grid>.settings-tile .settings-tile-icon svg{
  width:100%;height:100%;display:block;fill:none;stroke:none;
}
.settings-view .settings-card-grid>.settings-tile strong{
  width:100%;font-size:clamp(13px,3.65vw,17px);
  font-weight:920;line-height:1.17;letter-spacing:-.025em;
  overflow-wrap:break-word;text-wrap:balance;color:#18314a;
}
.settings-view .settings-card-grid>.settings-tile small{
  display:block;width:100%;font-size:clamp(10px,2.7vw,12px);
  font-weight:600;line-height:1.2;color:#526c81;
  text-wrap:balance;
}
.settings-view .settings-card-grid>.settings-tile b{
  position:absolute;right:9px;bottom:10px;display:grid;place-items:center;
  width:26px;height:26px;border-radius:50%;margin:0;
  background:color-mix(in srgb,var(--tile-edge) 33%,white);
  color:var(--tile-ink);font-size:24px;line-height:1;font-weight:700;
}
.settings-view .settings-card-grid>.settings-tile-excel{
  --tile-ink:#0d9d54;--tile-start:#f5fff9;--tile-end:#dcf9e7;--tile-edge:#37c977;
}
.settings-view .settings-card-grid>.settings-tile-add{
  --tile-ink:#1188e4;--tile-start:#f1faff;--tile-end:#d8eeff;--tile-edge:#11b8f3;
}
.settings-view .settings-card-grid>.settings-tile-manage{
  --tile-ink:#ec880b;--tile-start:#fff8ef;--tile-end:#ffebd7;--tile-edge:#ffad36;
}
.settings-view .settings-card-grid>.settings-tile-category{
  --tile-ink:#8047db;--tile-start:#f8f2ff;--tile-end:#e8d9ff;--tile-edge:#a16aee;
}
.settings-view .settings-card-grid>.settings-tile-customer{
  --tile-ink:#ec4877;--tile-start:#fff5f8;--tile-end:#ffdeea;--tile-edge:#f6719c;
}
.settings-view .settings-card-grid>.settings-tile-history{
  --tile-ink:#009cba;--tile-start:#f0fbff;--tile-end:#daf6ff;--tile-edge:#24c1e9;
}
.settings-view .settings-card-grid>.settings-tile-csv{
  --tile-ink:#1d9c69;--tile-start:#f2fff8;--tile-end:#d9f7e5;--tile-edge:#62cda0;
}
.settings-view .settings-card-grid>.settings-tile-backup{
  --tile-ink:#a9672a;--tile-start:#fff9ef;--tile-end:#ffe8cf;--tile-edge:#e7a96e;
}
.settings-view .settings-template-link{
  display:flex;align-items:center;justify-content:space-between;
  gap:8px;min-height:44px;padding:10px 13px;margin-top:13px;
  border:1px solid #bad0e8;border-radius:13px;
  text-decoration:none;font-size:12px;font-weight:750;color:#fff;
  background:#ffffff1b;
}
.settings-view .settings-template-link span{font-size:20px}
body.view-settings .settings-view .settings-receipt{
  margin-top:17px;border-color:#d9e4ec;
}
body.view-settings .settings-view .settings-catalog-count{color:#d3e7f2}
@media(max-width:359px){
  .settings-view .settings-card-grid{gap:8px}
  .settings-view .settings-card-grid>.settings-tile{
    height:160px;border-radius:17px;padding:10px 7px 20px;
  }
  .settings-view .settings-card-grid>.settings-tile strong{font-size:12px}
  .settings-view .settings-card-grid>.settings-tile small{font-size:10px}
}
@media(prefers-reduced-motion:reduce){
  .settings-view .settings-card-grid>.settings-tile{transition:none}
}

/* Sales header is deliberately a SINGLE ROW across compact phones. */
.sale-sheet .sale-sheet-header{
  display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;
  justify-content:space-between;gap:clamp(3px,1vw,9px);
  min-width:0;min-height:70px;padding:calc(11px + env(safe-area-inset-top)) 9px 10px;
}
.sale-sheet .sale-heading{display:flex;flex:0 1 auto;align-items:center;gap:4px;min-width:0;white-space:nowrap}
.sale-sheet .sale-heading-icon{font-size:clamp(16px,3.8vw,23px);line-height:1;flex:none}
.sale-sheet .sale-heading h2{font-size:clamp(16px,4.15vw,23px);white-space:nowrap}
.sale-sheet .sale-count-pill{font-size:clamp(9px,2.45vw,12px);padding:5px 6px;gap:3px;flex:none}
.sale-sheet .sale-count{font-size:inherit}
.sale-sheet .sale-header-actions{display:flex;flex:0 0 auto;gap:clamp(2px,.7vw,6px);align-items:center;min-width:0;margin-left:auto}
.sale-sheet .sale-header-actions button{
  box-sizing:border-box;min-width:0;min-height:36px;height:36px;
  padding:3px clamp(4px,1.1vw,9px);
  font-size:clamp(12px,3vw,16px);border-radius:14px;gap:3px;
  white-space:nowrap;line-height:1;
}
.sale-sheet .sale-header-actions .sale-header-back span,
.sale-sheet .sale-header-actions .sale-header-close span,
.sale-sheet .sale-header-actions .sale-header-cancel span{
  font-size:clamp(9px,2.45vw,12px);font-weight:850;
}
.sale-sheet .sale-header-actions .sale-header-cancel{
  border-radius:13px;background:linear-gradient(140deg,#d84f60,#ae3653);
}
@media(max-width:369px){
  .sale-sheet .sale-heading-icon{display:none}
  .sale-sheet .sale-header-actions .sale-header-back span,
  .sale-sheet .sale-header-actions .sale-header-close span{display:none}
  .sale-sheet .sale-header-actions button{min-width:34px;padding:3px 5px}
}
@media(min-width:500px){
  .sale-sheet .sale-sheet-header{gap:10px;padding-left:15px;padding-right:15px}
  .sale-sheet .sale-header-actions button{min-height:43px;height:43px;padding:5px 10px}
}
/* Product photos and editing buttons remain in a scrollable central list.
   Only real catalog image sources are used; category emoji remains fallback. */
.sale-sheet .cart-items{
  display:block;min-height:0;overflow-y:auto;
  padding:10px 11px 14px;
  background:linear-gradient(170deg,#f7faff,#edf3fa);
}
.sale-sheet .cart-line{
  display:grid;grid-template-columns:clamp(68px,20vw,98px) minmax(0,1fr);
  align-items:center;gap:10px;padding:10px;
  margin:0 0 8px;border:1px solid #dce7f3;border-radius:17px;
  background:#fff;box-shadow:0 3px 12px #153d5b0d;
}
.sale-sheet .sale-cart-media{
  position:relative;display:grid;place-items:center;
  width:100%;height:clamp(77px,22vw,108px);
  border-radius:12px;background:linear-gradient(140deg,#f5f9fe,#fff);
  overflow:hidden;
}
.sale-sheet .sale-cart-emoji{font-size:35px;line-height:1}
.sale-sheet .sale-cart-product-image{
  position:absolute;inset:0;width:100%;height:100%;
  object-fit:contain;border-radius:11px;background:#fff;
}
.sale-sheet .sale-cart-info{min-width:0}
.sale-sheet .sale-product-row{
  display:flex;align-items:flex-start;justify-content:space-between;
  gap:6px;min-width:0;
}
.sale-sheet .sale-product-row .cart-line-name{
  font-size:clamp(11px,3.25vw,14px);font-weight:850;
  line-height:1.22;min-width:0;flex:1;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;
}
.sale-sheet .sale-line-price{
  font-size:clamp(11px,3.1vw,15px);flex:none;white-space:nowrap;
  color:#08754f;font-weight:950;
}
.sale-sheet .sale-line-actions{display:flex;align-items:center;gap:7px;margin-top:9px;min-width:0}
.sale-sheet .sale-line-actions .stepper{
  width:clamp(112px,33vw,145px);max-width:58%;
  height:38px;flex:0 1 auto;border-radius:10px;
  border:1px solid #bacddd;
}
.sale-sheet .sale-line-actions .stepper button{flex:0 0 33px;height:37px;min-width:30px}
.sale-sheet .sale-line-actions .stepper input{font-size:14px}
.sale-sheet .sale-line-actions .sale-line-more{
  display:flex;justify-content:flex-end;min-width:37px;
}
.sale-sheet .sale-line-more>summary{
  height:38px;width:38px;margin-left:auto;
  border-radius:11px;font-size:23px;
}
.sale-sheet .sale-line-actions .remove-button{
  flex:none;width:38px;height:38px;margin:0;
  border:1px solid #f3d8d8;border-radius:11px;
  background:#fff2f2;color:#b92a32;font-size:24px;
}
/* Keep the approved four payment tiles and large checkout CTA, without
   duplicating Home/Products/Settings navigation inside the sale modal. */
.sale-sheet .checkout-area{padding-bottom:calc(15px + env(safe-area-inset-bottom))}
.sale-sheet #completeSale{margin-top:11px}
@media(max-width:410px){
  .sale-sheet .cart-line{gap:7px;padding:8px}
  .sale-sheet .sale-line-actions{gap:4px}
  .sale-sheet .sale-line-actions .stepper{max-width:55%;width:108px}
  .sale-sheet .sale-line-more>summary{width:33px}
  .sale-sheet .sale-line-actions .remove-button{width:33px}
}
.device-backup-dialog{max-width:min(93vw,480px);width:100%;padding:0 0 17px;max-height:88dvh;overflow-y:auto}
.device-backup-body{padding:16px;display:grid;gap:12px}
.device-backup-body>p{font-size:12px;line-height:1.5;color:#4d647b;margin:0}
.device-backup-body>label{font-size:13px;font-weight:800;color:#1f4862}
.device-backup-body>input{font-size:13px;max-width:100%;border:1px solid #cfdeea;padding:12px;border-radius:10px}
.device-backup-body>#backupStatus{font-weight:750;color:#146955}

/* v4.8 — Approved dual-action sale footer: return home on an empty cart,
   complete the sale after an item is added. Keep dimensions and position fixed. */
.sale-sheet #completeSale{
  display:flex;align-items:center;justify-content:center;gap:11px;
  width:100%;min-height:55px;cursor:pointer;
  transition:background .16s ease,box-shadow .16s ease,color .16s ease;
}
.sale-sheet #completeSale svg{
  width:25px;height:25px;flex:0 0 auto;stroke:currentColor;
  stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;fill:none;
}
.sale-sheet #completeSale .checkout-home-icon{display:none}
.sale-sheet #completeSale .checkout-complete-icon{display:block}
.sale-sheet #completeSale.is-empty-cart{
  background:linear-gradient(140deg,#eef7ff 0%,#c9e2ff 100%);
  color:#075bae;border:2px solid #1987ed;
  box-shadow:inset 0 1px 0 #fff,0 4px 14px #1772c02d;
}
.sale-sheet #completeSale.is-empty-cart .checkout-home-icon{display:block}
.sale-sheet #completeSale.is-empty-cart .checkout-complete-icon{display:none}
.sale-sheet #completeSale.is-empty-cart:not(:disabled):active{
  background:linear-gradient(140deg,#d4e9ff,#b0d5fc);
}
.sale-sheet #completeSale:focus-visible{outline:3px solid #62b4ff;outline-offset:2px}
.sale-sheet #completeSale:disabled{cursor:wait;opacity:.68}
@media(prefers-reduced-motion:reduce){.sale-sheet #completeSale{transition:none}}

/* v4.9 — approved device-specific Settings grid:
   phones and touch tablets: 3 x 3 actions + one full-width Home control;
   mouse/trackpad desktops: 5 x 2 equal actions.
   Printer configuration is not removed; it is collapsed by default. */
body.view-settings .settings-view{max-width:1040px}
.settings-view .settings-card-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(6px,1.75vw,13px);
}
.settings-view .settings-card-grid>.settings-tile{
  width:100%;min-width:0;min-height:0;
  height:clamp(123px,34vw,167px);
  padding:clamp(7px,1.6vw,13px) clamp(4px,1.2vw,11px) 18px;
  gap:clamp(4px,.9vw,8px);
  border-radius:clamp(13px,2.6vw,22px);
  text-decoration:none;
}
.settings-view .settings-card-grid>.settings-tile .settings-tile-icon{
  width:clamp(34px,9.2vw,58px);
  height:clamp(34px,9.2vw,58px);
  flex:none;
}
.settings-view .settings-card-grid>.settings-tile strong{
  color:#18314a;
  font-size:clamp(10px,2.75vw,16px);
  line-height:1.14;
  font-weight:900;
  overflow-wrap:anywhere;
}
.settings-view .settings-card-grid>.settings-tile small{
  color:#587086;font-size:clamp(9px,2.25vw,11px);
  line-height:1.15;overflow-wrap:anywhere;
}
.settings-view .settings-card-grid>.settings-tile b{
  width:clamp(21px,5.4vw,27px);height:clamp(21px,5.4vw,27px);
  right:7px;bottom:7px;
  font-size:clamp(17px,4.7vw,23px);
}
.settings-view .settings-card-grid>.settings-tile-template{
  --tile-ink:#7242c5;--tile-start:#f7f1ff;--tile-end:#e8d9ff;--tile-edge:#9c69e7;
}
.settings-view .settings-card-grid>.settings-tile-home{
  --tile-ink:#1263b2;--tile-start:#eaf6ff;--tile-end:#c9e7ff;--tile-edge:#55b1f1;
  grid-column:1/-1;
  height:clamp(52px,14vw,67px);
  flex-direction:row;justify-content:center;
  padding:7px 46px 7px 16px;
  gap:11px;
}
.settings-view .settings-card-grid>.settings-tile-home::after{display:none}
.settings-view .settings-card-grid>.settings-tile-home .settings-tile-icon{
  width:30px;height:30px;
}
.settings-view .settings-card-grid>.settings-tile-home strong{
  width:auto;max-width:calc(100% - 75px);
  font-size:clamp(13px,3.5vw,17px);white-space:nowrap;
}
.settings-view .settings-card-grid>.settings-tile-home small{display:none}
.settings-view .settings-card-grid>.settings-tile-home b{
  right:10px;bottom:auto;top:50%;transform:translateY(-50%);
}
/* Keep the receipt/thermal printer controls working, but not visible until
   the operator explicitly expands advanced settings. */
.settings-view .settings-printer-details{
  margin:12px 0 0;
  border:1px solid #ffffff56;
  border-radius:13px;
  overflow:hidden;
  background:#0e325288;
}
.settings-view .settings-printer-details>summary{
  display:flex;justify-content:space-between;align-items:center;
  gap:9px;min-height:44px;padding:11px 14px;
  color:#d5e8fa;font-size:12px;font-weight:760;
  cursor:pointer;list-style:none;
}
.settings-view .settings-printer-details>summary::-webkit-details-marker{display:none}
.settings-view .settings-printer-details>summary span{transition:transform .18s ease}
.settings-view .settings-printer-details[open]>summary span{transform:rotate(180deg)}
body.view-settings .settings-view .settings-printer-details .settings-receipt{
  margin:0;border:0;border-radius:0;
}
@media (max-width:359px){
  .settings-view .settings-card-grid{gap:5px}
  .settings-view .settings-card-grid>.settings-tile:not(.settings-tile-home){
    height:122px;padding:8px 3px 16px;border-radius:12px;
  }
  .settings-view .settings-card-grid>.settings-tile:not(.settings-tile-home) strong{
    font-size:10px;
  }
  .settings-view .settings-card-grid>.settings-tile:not(.settings-tile-home) small{
    font-size:9px;
  }
}
@media (min-width:600px) and (pointer:coarse){
  .settings-view .settings-card-grid{
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:clamp(12px,1.6vw,18px);
  }
  .settings-view .settings-card-grid>.settings-tile:not(.settings-tile-home){
    height:clamp(156px,17vw,192px);padding:15px 10px 21px;
  }
  .settings-view .settings-card-grid>.settings-tile strong{
    font-size:clamp(14px,1.7vw,18px);
  }
  .settings-view .settings-card-grid>.settings-tile small{
    font-size:clamp(10px,1.15vw,13px);
  }
  .settings-view .settings-card-grid>.settings-tile .settings-tile-icon{
    width:clamp(49px,6vw,68px);height:clamp(49px,6vw,68px);
  }
  .settings-view .settings-card-grid>.settings-tile-home{
    height:65px;
  }
  .settings-view .settings-card-grid>.settings-tile-home .settings-tile-icon{
    width:31px;height:31px;
  }
}
@media (min-width:900px) and (hover:hover) and (pointer:fine){
  body.view-settings .settings-view{
    max-width:1320px;
    width:100%;
    padding:clamp(18px,2vw,30px);
  }
  .settings-view .settings-card-grid{
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:clamp(10px,1vw,18px);
  }
  .settings-view .settings-card-grid>.settings-tile,
  .settings-view .settings-card-grid>.settings-tile-home{
    height:clamp(154px,14vw,205px);
    grid-column:auto;
    padding:17px 9px 24px;
    flex-direction:column;
    gap:8px;
    justify-content:center;
  }
  .settings-view .settings-card-grid>.settings-tile-home::after{display:block}
  .settings-view .settings-card-grid>.settings-tile-home .settings-tile-icon{
    width:clamp(43px,4.6vw,62px);height:clamp(43px,4.6vw,62px);
  }
  .settings-view .settings-card-grid>.settings-tile-home strong{
    width:100%;max-width:100%;white-space:normal;
  }
  .settings-view .settings-card-grid>.settings-tile-home small{
    display:block;
  }
  .settings-view .settings-card-grid>.settings-tile-home b{
    right:9px;top:auto;bottom:10px;transform:none;
  }
  .settings-view .settings-card-grid>.settings-tile strong{
    font-size:clamp(13px,1.1vw,17px);
  }
  .settings-view .settings-card-grid>.settings-tile small{
    font-size:clamp(10px,.85vw,12px);
  }
  .settings-view .settings-card-grid>.settings-tile .settings-tile-icon{
    width:clamp(42px,4.5vw,63px);height:clamp(42px,4.5vw,63px);
  }
}
/* A landscape tablet with coarse/touch input retains the 3x3 layout even
   though the surrounding PWA may use its existing desktop-style sidebar. */
@media (min-width:900px) and (pointer:coarse){
  body.view-settings .settings-view{width:100%;max-width:1040px}
  .settings-view .settings-card-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(prefers-reduced-motion:reduce){
  .settings-view .settings-printer-details>summary span{transition:none}
}

/* v5.0 — Thermal printer fallback: the 80/58 mm media size is NOT necessarily
 * the printer's writable width. Reserve physical room on the right for values.
 * Popup print uses the matching independently generated safe-width rules.
 */
@media print {
  #receiptPrint {
    box-sizing:border-box!important;
    width:var(--receipt-content-width,70mm)!important;
    min-width:0!important;
    max-width:var(--receipt-content-width,70mm)!important;
    margin:0 0 0 var(--receipt-left-inset,2mm)!important;
    padding:1mm 2mm!important;
    overflow:hidden!important;
  }
  #receiptPrint .receipt-row {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:1mm;
    min-width:0;
  }
  #receiptPrint .receipt-row span:first-child {
    min-width:0;
    overflow-wrap:anywhere;
  }
  #receiptPrint .receipt-row span:last-child {
    flex:0 0 auto;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
    text-align:right;
  }
  #receiptPrint .receipt-grand {
    font-size:11pt!important;
  }
}

/* v5.1 — quick cash tender: three explicit choices, no unwanted cash modal on
 * payment radio selection, responsive and accessible touch-sized controls. */
.cash-payment-dialog{max-width:min(95vw,460px);border-radius:22px}
.cash-payment-dialog .cash-payment-body{padding:17px;display:flex;flex-direction:column;gap:10px}
.cash-payment-body #cashPayTotal{
  display:block;text-align:center;font-weight:950;
  font-size:clamp(28px,7vw,39px);color:#103451;font-variant-numeric:tabular-nums;
}
.cash-payment-body>p{margin:0;text-align:center;font-size:12px;font-weight:800;color:#71859b}
.cash-mode-buttons{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.cash-mode-button{
  display:flex;align-items:flex-start;flex-direction:column;
  width:100%;min-height:75px;text-align:left;gap:6px;
  padding:14px 16px;border-radius:16px;
  border:1px solid #d0dfec;background:#fff;
  color:#193955;
  box-shadow:0 4px 12px #193c6810;
}
.cash-mode-button strong{font-size:clamp(15px,3.8vw,18px);font-weight:900;line-height:1.2}
.cash-mode-button small{font-size:clamp(11px,2.85vw,13px);line-height:1.32;font-weight:680}
.cash-mode-button b{font-variant-numeric:tabular-nums;font-weight:900}
.cash-mode-direct{background:#e7f9ec;border-color:#85d9a8;color:#126b42}
.cash-mode-manual{background:#e9f3ff;border-color:#a7cff8;color:#155e9c}
.cash-mode-round{background:#f3eaff;border-color:#d1b6f0;color:#6b349f}
.cash-payment-dialog .cash-manual-panel{display:grid;gap:11px;padding-top:4px}
.cash-manual-panel label{font-weight:850;color:#304a65;font-size:13px}
.cash-manual-panel input{
  width:100%;min-width:0;height:49px;
  border:1px solid #bccfe2;border-radius:12px;
  padding:10px 13px;font-size:19px;font-weight:820;
  color:#183e61;background:white;font-variant-numeric:tabular-nums;
}
.cash-manual-panel .cash-change{
  border-radius:10px;padding:12px;background:#e9f8ee;
  font-size:15px;font-weight:850;
}
.cash-payment-dialog #cashCancel{min-height:46px;margin-top:3px}
.cash-payment-dialog button:focus-visible{outline:3px solid #70b8ef;outline-offset:2px}
@media(max-width:360px){
  .cash-payment-dialog .cash-payment-body{padding:12px;gap:7px}
  .cash-mode-button{padding:11px 12px;min-height:67px}
}

/* v5.2 — User-uploaded product image readiness and D1 upload feedback. */
.manage-body .manage-image-status{
  margin:5px 0 10px;padding:9px 12px;border-radius:10px;
  border:1px solid #cbddea;background:#f0f7ff;
  font-size:12px;font-weight:750;line-height:1.4;color:#265374;
}
.manage-body .manage-image-status[data-status="pending"]{
  border-color:#e9d4a8;background:#fff8e8;color:#8b611d;
}
.manage-body .manage-image-status[data-status="ready"]{
  border-color:#a4dec0;background:#ecfbf3;color:#176b4a;
}
.manage-body .manage-image-status[data-status="error"]{
  border-color:#f0b8b8;background:#fff0f0;color:#a12e39;
}
.manage-body #manageImagePreview:not([hidden]){
  display:block;max-width:min(100%,260px);max-height:240px;
  object-fit:contain;margin:7px auto 12px;
  background:#fff;border:1px solid #d4e3ee;border-radius:13px;
}
.manage-body #manageEditForm button:disabled{
  cursor:wait;opacity:.7;
}

/* v5.3 — CAS/RS-232 desktop weighing and mobile manual gram entry.
   Do not show hardware connection on phones/tablets. */
.weight-dialog{
  width:min(94vw,460px);max-height:min(91dvh,850px);padding:0;
  border:1px solid #d4e4f0;border-radius:22px;background:#fff;
  color:#1b344e;box-shadow:0 18px 65px #0a2d5060;
  overflow-y:auto;
}
.weight-dialog .weight-sheet-header{
  display:flex;align-items:center;justify-content:space-between;
  background:linear-gradient(110deg,#087569,#0d536a);
  color:#fff;padding:15px 17px;
}
.weight-dialog .weight-sheet-header h2{color:#fff;font-size:21px;margin:0;font-weight:900}
.weight-dialog .weight-sheet-header button{background:#ffffff22;color:#fff;border:1px solid #fff6}
.weight-dialog .weight-body{display:flex;flex-direction:column;gap:11px;padding:16px}
.weight-product-name{font-size:19px;font-weight:900;color:#1b3555}
.weight-unit-price{margin:-5px 0 3px;font-size:13px;font-weight:770;color:#647f95}
.weight-serial-panel{
  display:grid;gap:10px;padding:12px;
  border:1px solid #bcdce8;background:#f4fbff;border-radius:14px;
}
.weight-serial-panel[hidden],.weight-error[hidden]{display:none!important}
.weight-connection-head{
  display:flex;justify-content:space-between;gap:9px;flex-wrap:wrap;
  font-size:11px;font-weight:780;color:#336985;
}
.weight-connection-head strong{color:#096d58}
.weight-connection-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.weight-connection-actions button{
  min-height:42px;border-radius:10px;border:1px solid #95c4da;
  background:#e3f4ff;color:#145981;font-size:12px;font-weight:850;
}
.weight-connection-actions #weightConnect{background:#0b7380;color:#fff;border-color:#0b7380}
.weight-connection-actions button:disabled{opacity:.5}
.weight-serial-options{border:1px solid #c3d5e2;background:#fff;border-radius:11px;padding:8px}
.weight-serial-options summary{font-size:12px;font-weight:820;color:#3b5872;cursor:pointer}
.weight-serial-settings{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:11px 0}
.weight-serial-settings label{display:grid;gap:5px;font-size:11px;color:#536b81;font-weight:800}
.weight-serial-settings select{
  min-width:0;width:100%;padding:7px 8px;border-radius:9px;border:1px solid #c5d6e3;background:#fff;
}
.weight-serial-options>small{font-size:10px;color:#6e8191;line-height:1.35}
.weight-live-panel{display:grid;justify-items:center;gap:6px;background:#e4f6ec;padding:13px;border-radius:13px}
.weight-live-panel>span{font-size:12px;font-weight:820;color:#30644d}
.weight-live-panel>strong{
  color:#0c6943;font-size:clamp(29px,8vw,42px);
  font-weight:950;font-variant-numeric:tabular-nums;
}
.weight-live-panel .weight-live-help{
  display:block;text-align:center;font-size:12px;font-weight:850;
  color:#0c6943;line-height:1.35;
}
.weight-raw{display:block;max-width:100%;font:10px ui-monospace,monospace;color:#53697b;overflow-wrap:anywhere}
.weight-serial-panel>p{margin:0;font-size:11px;font-weight:750;color:#4c6478;line-height:1.45}
.weight-manual-panel{display:grid;gap:6px}
.weight-manual-panel label{font-size:13px;color:#314b63;font-weight:850}
.weight-manual-panel input{
  width:100%;height:55px;font-size:24px;font-weight:900;font-variant-numeric:tabular-nums;
  padding:10px 15px;border:1px solid #bfd2e3;border-radius:13px;color:#173a55;background:#f8fbff;
}
.weight-manual-panel small{font-size:11px;color:#738495;line-height:1.3}
.weight-total-panel{display:grid;gap:8px;border-top:1px solid #dce8f1;padding-top:12px}
.weight-total-panel>div{display:flex;justify-content:space-between;align-items:center;gap:10px}
.weight-total-panel span{font-size:12px;color:#6b7e90;font-weight:780}
.weight-total-panel strong{font-variant-numeric:tabular-nums;font-size:18px;font-weight:910;color:#1a4161}
.weight-total-panel #weightTotalPreview{font-size:25px;color:#0a885a}
.weight-error{margin:0;border-radius:9px;padding:8px;color:#ac3844;background:#fff1f0;font-size:12px;font-weight:790}
.weight-body #weightAdd{min-height:53px;font-weight:900;border-radius:13px;background:#07865d;color:#fff}
.weight-body #weightAdd:disabled{opacity:.5;cursor:not-allowed}
.weight-body #weightCancel{min-height:44px;border-radius:12px}
.weight-body button:focus-visible,.weight-body input:focus-visible{
  outline:3px solid #52b8d6;outline-offset:2px;
}
.cart-weight-badge{display:block;font-size:11px;color:#177d66;font-weight:820;margin:3px 0 4px}

/* v52 — Cashier-visible per-line price edit, cart discount and per-device receipt preference */
.sale-sheet .sale-price-actions{display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex:none}
.sale-sheet .sale-edit-price{
  border:1px solid #bfd9ea;background:#eff8ff;color:#14577d;border-radius:8px;
  font-size:11px;font-weight:850;padding:5px 8px;min-height:29px;
  white-space:nowrap;cursor:pointer;
}
.sale-sheet .basket-discount-control{
  margin:8px 0 10px;padding:10px 12px;border:1px solid #cfe2ed;
  border-radius:12px;background:#f6fbff;
}
.sale-sheet .basket-discount-control label{display:block;font-size:13px;font-weight:850;color:#173c55;margin-bottom:6px}
.sale-sheet .basket-discount-input{display:flex;align-items:center;gap:10px}
.sale-sheet .basket-discount-input input{
  width:100%;min-width:0;max-width:170px;height:42px;
  border:1px solid #b9d3e4;border-radius:9px;padding:8px 11px;
  font-size:18px;font-weight:800;background:white;color:#11334e;
}
.sale-sheet .basket-discount-input strong{font-size:17px;color:#176b55}
.sale-sheet .basket-discount-control small{display:block;margin-top:5px;font-size:11px;color:#607487}
.sale-sheet #basketDiscountError{color:#b43c46;font-size:12px;font-weight:700;margin:5px 0 0}
.sale-sheet .basket-discount-input input[aria-invalid="true"]{border-color:#cb4d57}
.sale-sheet .total-row.summary{display:flex;justify-content:space-between;gap:8px;font-size:12px;color:#466077;margin-bottom:4px}
.sale-sheet .total-row.summary strong{font-size:13px;color:#2b4e62}
.receipt-actions-grid.single-action{grid-template-columns:minmax(0,1fr)}
.receipt-actions-grid button[hidden]{display:none!important}
.receipt-actions-grid.single-action button{min-height:110px;max-width:100%;font-size:30px}
.settings-view .settings-device-receipt{
  background:#fff;border:1px solid #d5e3ee;border-radius:15px;
  padding:15px;margin:14px 0;color:#173851;display:grid;gap:8px;
}
.settings-view .settings-device-receipt h2{font-size:16px;margin:0}
.settings-view .settings-device-receipt label{font-size:12px;font-weight:850}
.settings-view .settings-device-receipt select{
  width:100%;min-height:45px;padding:9px 12px;border:1px solid #c0d4e3;
  border-radius:9px;font-size:15px;background:#fff;color:#173851;
}
.settings-view .settings-device-receipt small{font-size:11px;color:#4e687b;line-height:1.45}
.settings-view #settingsReceiptActionStatus{margin:0;font-size:12px;font-weight:800;color:#18714e}

/* Active and passive management cards share the exact approved layout.
   Only the active status badge has a distinct color. */
#manageResults .manage-product-badge.is-active{
  background:#d8f3e5;color:#126340;
}

/* v54: compact checkout — only Nakit, Kart, Sepet İndirimi and Diğer Ödeme. */
.sale-sheet .payment-types.checkout-shortcuts{
  display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:7px!important;align-items:stretch;
}
.sale-sheet .checkout-shortcuts .payment-shortcut{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:5px;min-width:0;width:100%;min-height:72px;height:72px;
  padding:6px 3px;margin:0;box-sizing:border-box;border-radius:15px;
  font:inherit;cursor:pointer;line-height:1.1;text-align:center;
  box-shadow:inset 0 1px 0 #ffffffb0;
}
.sale-sheet .checkout-shortcuts .payment-shortcut b{font-size:24px;line-height:1}
.sale-sheet .checkout-shortcuts .payment-shortcut small{
  font-size:clamp(10px,2.6vw,12px);font-weight:850;line-height:1.12;overflow-wrap:anywhere;
}
.sale-sheet .checkout-shortcuts .payment-discount{
  color:#7238a5;border:1px solid #d9b9f2;background:#f2e5ff;
}
.sale-sheet .checkout-shortcuts .payment-other{
  color:#ac5406;border:1px solid #edc58e;background:#fff1df;
}
.sale-sheet .checkout-shortcuts .payment-discount.has-discount,
.sale-sheet .checkout-shortcuts .payment-other.is-selected{
  box-shadow:0 0 0 2px currentColor,inset 0 1px 0 #fff8;
}
.sale-sheet .basket-discount-control[hidden],.payment-hidden-options[hidden]{display:none!important}
.sale-sheet .basket-discount-control{margin:8px 0 6px}
.sale-sheet .sale-edit-price{display:none!important} /* Price and line discount remain in ⋯ */
.other-payment-dialog{
  width:min(93vw,490px);max-width:490px;max-height:85dvh;overflow-y:auto;
  border-radius:20px;border:0;padding:0;background:#fff;color:#132c44;
}
.other-payment-options{display:grid;gap:9px;padding:14px}
.other-payment-options button{
  width:100%;display:grid;grid-template-columns:45px 1fr;
  grid-template-rows:auto auto;column-gap:11px;text-align:left;
  align-items:center;padding:12px;min-height:70px;border-radius:13px;
  border:1px solid #d7e4f1;background:#f7fbff;color:#123952;cursor:pointer;
}
.other-payment-options button span{
  grid-row:1/3;display:grid;place-items:center;
  width:43px;height:43px;border-radius:11px;
  background:#e3eefc;color:#1761a8;font-size:24px;
}
.other-payment-options button strong{font-size:15px}
.other-payment-options button small{font-size:12px;color:#597285}
.other-payment-note{margin:0;padding:0 18px 20px;font-size:12px;color:#657789;line-height:1.5}
.picker-mode-tabs{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;padding:12px 14px 6px;background:#fff;
}
.picker-mode-tabs button{
  border:1px solid #d4e2ef;border-radius:11px;padding:11px 4px;
  background:#f0f6ff;color:#2d4d6c;
  font-size:clamp(11px,2.8vw,14px);font-weight:850;min-height:44px;cursor:pointer;
}
.picker-mode-tabs button[aria-pressed="true"]{
  border-color:#069c62;background:linear-gradient(145deg,#04bc76,#078450);color:#fff;
}
#pickProductSearchWrap[hidden],#pickerCategoryBrowser[hidden],#pickerLoadMore[hidden]{
  display:none!important;
}
.product-picker .picker-search{position:static;top:auto;padding:8px 14px;background:#fff}
.product-picker .picker-results{max-height:min(53dvh,560px);overflow-y:auto;padding-bottom:12px}
.picker-category-browser{padding:6px 13px 8px;background:#fff}
.picker-category-heading{
  display:flex;align-items:center;gap:10px;min-height:39px;
  padding:3px 1px 9px;color:#153955;
}
.picker-category-heading strong{font-size:15px}
#pickerCategoryBack{
  border:1px solid #cbdce9;border-radius:9px;
  background:#f0f7fd;color:#1e5d82;font-size:12px;
  font-weight:850;padding:8px 10px;
}
.picker-category-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;max-height:48dvh;overflow-y:auto;
}
.picker-category-tile{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:6px;min-width:0;padding:11px 7px;border-radius:14px;
  border:1px solid #dce6ef;background:#f8fbff;color:#183954;
  text-align:center;cursor:pointer;
}
.picker-category-tile img{width:100%;max-width:125px;height:88px;object-fit:contain}
.picker-category-tile strong{font-size:13px;font-weight:850;line-height:1.2}
.picker-category-tile small{font-size:11px;color:#657a8d}
.picker-load-more{
  display:block;width:calc(100% - 28px);margin:4px 14px 15px;
  padding:12px;border:1px solid #b9d7ee;border-radius:11px;
  background:#edf6ff;color:#16598a;font-weight:850;
}
.settings-view .settings-preference-group{
  border:1px solid #d1dfed;border-radius:16px;
  background:#fff;margin:14px 0;overflow:hidden;
}
.settings-view .settings-preference-group>summary{
  display:block;list-style:none;padding:16px;
  background:#eff6fd;color:#143e5b;
  font-size:15px;font-weight:850;cursor:pointer;
}
.settings-view .settings-preference-group>summary::-webkit-details-marker{display:none}
.settings-view .settings-mode-section{padding:13px 15px 16px}
.settings-view .settings-mode-section label{
  display:block;font-size:13px;font-weight:800;color:#234b63;margin-bottom:8px;
}
.settings-view .settings-mode-section select{
  display:block;width:100%;min-height:45px;border:1px solid #b8d1e3;
  border-radius:9px;background:white;padding:8px 12px;color:#173851;font-size:15px;
}
.settings-view .settings-mode-section p{font-size:12px;font-weight:750;color:#18714e}
.settings-view .settings-preference-group .settings-device-receipt{
  margin:12px;border-radius:12px;
}
.settings-view .settings-preference-group #settingsPrinterDetails{
  margin:12px;border:1px solid #d6e3ee;border-radius:12px;
}
@media(max-width:360px){
  .sale-sheet .checkout-shortcuts .payment-shortcut{min-height:62px;height:62px}
  .picker-category-grid{gap:6px}
  .picker-category-tile img{height:70px}
}

/* Direct settings access from main dashboard without replacing sales/reports. */
.dashboard-settings-shortcut{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  align-self:flex-start;margin-top:9px;min-height:35px;padding:6px 13px;
  border:1px solid #b9ddcd;border-radius:10px;background:#e3f7ed;
  color:#126344;font-size:13px;font-weight:850;cursor:pointer;
}

/* v55: approved two-column main menu, gear beside Backup.
   Native Settings navigation remains available; only the obsolete
   "Ana Sayfaya Git" menu tile is removed. */
.settings-view #settingsMainMenu.settings-card-grid{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:clamp(8px,1.25vw,15px)!important;
  max-width:940px;margin:0 auto;
}
.settings-view #settingsMainMenu.settings-card-grid>.settings-tile{
  box-sizing:border-box;
  width:100%;min-width:0;
  height:clamp(125px,18vw,190px)!important;
  min-height:125px!important;
  grid-column:auto!important;
  flex-direction:column!important;
  align-items:center;justify-content:center;
  padding:12px 10px 22px!important;
  gap:6px!important;
  font-size:inherit;
}
.settings-view #settingsMainMenu.settings-card-grid>.settings-tile .settings-tile-icon{
  width:clamp(39px,6.5vw,60px)!important;
  height:clamp(39px,6.5vw,60px)!important;
}
.settings-view #settingsMainMenu.settings-card-grid>.settings-tile strong{
  font-size:clamp(12px,2.75vw,18px);line-height:1.18;
}
.settings-view #settingsMainMenu.settings-card-grid>.settings-tile small{
  font-size:clamp(10px,1.7vw,12px);
}
.settings-view #settingsMainMenu .settings-tile-config{
  --tile-ink:#1357a9;--tile-start:#eaf6ff;--tile-end:#cfeaff;--tile-edge:#86c9f8;
}
.settings-view #settingsMainMenu .settings-tile-config .settings-tile-icon svg{stroke:currentColor}
.settings-view #settingsMainMenu[hidden],
.settings-view #settingsPreferences[hidden],
.settings-view #settingsPageTitle[hidden]{display:none!important}
.settings-view #settingsPreferences{
  max-width:850px;width:100%;
  margin:0 auto;
  padding:clamp(12px,2vw,24px);
  box-sizing:border-box;
  border-radius:18px;
  background:#fff;
  color:#183750;
  box-shadow:0 8px 24px #09244135;
}
.settings-view .settings-inner-header{
  display:flex;align-items:center;
  justify-content:flex-start;gap:13px;
  padding:1px 0 17px;
  border-bottom:1px solid #dce6ef;
  margin-bottom:12px;
}
.settings-view .settings-inner-header h2{
  margin:0;color:#123d60;font-size:clamp(19px,3.5vw,26px);
  font-weight:900;
}
.settings-view #settingsBackToMenu{
  border:1px solid #b9d4e7;background:#edf7ff;
  padding:9px 14px;min-height:43px;
  border-radius:11px;color:#205c80;font-size:15px;
  font-weight:850;cursor:pointer;
}
.settings-view .settings-inner-list{
  display:grid;gap:9px;
}
.settings-view .settings-inner-section{
  border:1px solid #d4e1ee;
  border-radius:13px;background:#fff;
  overflow:hidden;
  box-shadow:0 2px 5px #1537530c;
}
.settings-view .settings-inner-section>summary{
  display:flex;align-items:center;gap:13px;
  list-style:none;cursor:pointer;
  padding:13px 14px;min-height:52px;
  color:#183951;background:#fcfeff;
}
.settings-view .settings-inner-section>summary::-webkit-details-marker{display:none}
.settings-view .settings-inner-section[open]>summary{
  background:#f1f8fd;border-bottom:1px solid #dce6ef;
}
.settings-view .settings-section-symbol{
  display:grid;place-items:center;
  flex:0 0 43px;width:43px;height:43px;
  border-radius:11px;background:#e7f3fc;
  color:#176da3;font-size:25px;font-weight:800;
}
.settings-view .settings-section-name{display:grid;gap:3px;flex:1;min-width:0}
.settings-view .settings-section-name strong{
  color:#15344f;font-weight:900;font-size:clamp(13px,2.6vw,16px);
}
.settings-view .settings-section-name small{font-size:11px;line-height:1.3;color:#5b7085}
.settings-view .settings-section-arrow{font-size:22px;font-weight:800;color:#456d8e}
.settings-view .settings-inner-section[open] .settings-section-arrow{transform:rotate(180deg)}
.settings-view .settings-inner-content{
  padding:14px;display:grid;gap:10px;
  background:#fff;
}
.settings-view .settings-inner-content p{
  margin:0;font-size:13px;line-height:1.5;color:#445e73;
}
.settings-view .settings-inner-actions{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;
}
.settings-view .settings-inner-action,
.settings-view .settings-inner-actions>a.settings-tile,
.settings-view .settings-inner-actions>button.settings-tile{
  display:flex;align-items:center;justify-content:space-between;
  width:100%;min-width:0;min-height:49px;
  border:1px solid #cbddeb;border-radius:11px;
  background:#f1f8ff;color:#164b74;
  padding:12px;font:inherit;font-size:13px;
  text-decoration:none;font-weight:800;text-align:left;cursor:pointer;
}
.settings-view .settings-inner-action>span{margin-left:auto;font-size:22px}
.settings-view #settingsCustomerGroup .settings-inner-actions,
.settings-view #settingsDataGroup .settings-inner-actions{
  grid-template-columns:1fr;
}
.settings-view #settingsCustomerGroup .settings-inner-actions>button.settings-tile{
  height:auto;flex-direction:row;gap:10px;text-align:left;
}
.settings-view #settingsCustomerGroup .settings-inner-actions .settings-tile-icon{
  width:34px;height:34px;flex:0 0 34px;
}
.settings-view #settingsCustomerGroup .settings-inner-actions .settings-tile-icon svg{
  width:100%;height:100%;
}
.settings-view #settingsCustomerGroup .settings-inner-actions small{display:none}
.settings-view #settingsCustomerGroup .settings-inner-actions b{margin-left:auto}
.settings-view .settings-inner-content #settingsPrinterDetails{
  border:1px solid #d9e5ed;border-radius:12px;margin:0;
}
.settings-view .settings-inner-content .settings-device-receipt{
  margin:0;padding:12px;border:1px solid #d9e5ed;
}
.settings-view #settingsPickerGroup .settings-mode-section{padding:0}
@media(max-width:390px){
  .settings-view #settingsMainMenu.settings-card-grid>.settings-tile{min-height:119px!important;height:130px!important}
  .settings-view .settings-inner-actions{grid-template-columns:1fr}
  .settings-view .settings-section-symbol{flex-basis:36px;width:36px;height:36px;font-size:22px}
  .settings-view .settings-inner-section>summary{gap:8px;padding:10px 9px}
}

/* Enlarge BOTH the dashboard's twelve categories and the Product tab's
   twelve category tiles. Never squeeze 12 cards to a single viewport. */
#homeCategoryShortcuts.category-photo-grid,
#categoryTree.category-grid-page,
#desktopHomeCategoryGrid.desktop-home-category-grid{
  display:grid!important;
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  gap:clamp(9px,1.9vw,20px)!important;
  align-items:stretch;
}
#homeCategoryShortcuts .photo-category-tile,
#categoryTree .photo-category-tile,
#desktopHomeCategoryGrid .photo-category-tile{
  display:flex!important;flex-direction:column!important;
  align-items:stretch;justify-content:flex-start;
  box-sizing:border-box;min-width:0;
  min-height:clamp(147px,34vw,200px)!important;
  height:auto!important;padding:6px!important;
  gap:4px;border-radius:15px!important;
}
#homeCategoryShortcuts .photo-category-image,
#categoryTree .photo-category-image,
#desktopHomeCategoryGrid .photo-category-image{
  box-sizing:border-box;display:block;width:100%!important;
  height:auto!important;min-height:90px!important;
  aspect-ratio:1.12!important;border-radius:11px!important;
  overflow:hidden!important;
}
#homeCategoryShortcuts .photo-category-image img,
#categoryTree .photo-category-image img,
#desktopHomeCategoryGrid .photo-category-image img{
  width:100%!important;height:100%!important;
  object-fit:cover!important;padding:0!important;
  transform:none!important;
}
#homeCategoryShortcuts .photo-category-name,
#categoryTree .photo-category-name,
#desktopHomeCategoryGrid .photo-category-name{
  display:block!important;width:100%;
  min-height:33px!important;font-size:clamp(11px,2.8vw,16px)!important;
  font-weight:850!important;line-height:1.24!important;
  text-align:center!important;padding:5px 2px!important;
}
body.view-home .desktop-home-categories{display:block!important}
@media(min-width:680px){
  #homeCategoryShortcuts.category-photo-grid,
  #categoryTree.category-grid-page,
  #desktopHomeCategoryGrid.desktop-home-category-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
  }
  #homeCategoryShortcuts .photo-category-tile,
  #categoryTree .photo-category-tile,
  #desktopHomeCategoryGrid .photo-category-tile{
    min-height:210px!important;padding:9px!important;border-radius:19px!important;
  }
  #homeCategoryShortcuts .photo-category-image,
  #categoryTree .photo-category-image,
  #desktopHomeCategoryGrid .photo-category-image{
    min-height:145px!important;aspect-ratio:1.2!important;
  }
  #homeCategoryShortcuts .photo-category-name,
  #categoryTree .photo-category-name,
  #desktopHomeCategoryGrid .photo-category-name{
    font-size:clamp(14px,1.7vw,19px)!important;min-height:40px!important;
  }
}
@media(min-width:1180px){
  #homeCategoryShortcuts.category-photo-grid,
  #categoryTree.category-grid-page,
  #desktopHomeCategoryGrid.desktop-home-category-grid{
    max-width:1320px!important;margin-inline:auto!important;
    gap:clamp(16px,2vw,27px)!important;
  }
  #homeCategoryShortcuts .photo-category-tile,
  #categoryTree .photo-category-tile,
  #desktopHomeCategoryGrid .photo-category-tile{
    min-height:245px!important;padding:12px!important;
  }
  #homeCategoryShortcuts .photo-category-image,
  #categoryTree .photo-category-image,
  #desktopHomeCategoryGrid .photo-category-image{min-height:185px!important}
}

/* v56 – access gate and full-sized category cards on all screens.
   Category count and the original picture mapping are unchanged. */
body.auth-locked #app{display:none!important}
.access-login-gate{
  position:fixed;inset:0;z-index:9000;display:flex;align-items:center;
  justify-content:center;overflow-y:auto;background:#e9f2f9;
  padding:24px 14px;box-sizing:border-box;
}
.access-login-gate[hidden]{display:none!important}
.access-login-card{
  width:min(100%,430px);border-radius:22px;padding:26px;
  background:#fff;border:1px solid #bfd5e5;
  box-shadow:0 20px 55px #122b4928;color:#152f47;
}
.access-login-brand{
  background:#102e50;color:#fff;border-radius:15px;padding:19px;text-align:center;
}
.access-login-brand>span{font-size:32px}
.access-login-brand h1{font-size:27px;margin:3px 0 0}
.access-login-brand p{margin:5px 0 0;color:#d1e3f7;font-size:13px}
.access-login-card form{display:grid;gap:8px;margin-top:20px}
.access-login-card form label{font-weight:800;margin-top:8px}
.access-login-card form input{
  width:100%;box-sizing:border-box;border:1px solid #b8cede;
  border-radius:11px;min-height:49px;padding:10px 13px;font-size:16px;
  background:#fff;color:#17344d;
}
.access-login-card form button,
.access-users-dialog #accessSaveUser{
  min-height:47px;border:0;background:#114a81;color:#fff;
  border-radius:11px;font-size:15px;font-weight:850;cursor:pointer;margin-top:12px;
}
.access-login-card #loginError{color:#a32635;font-size:13px;line-height:1.45}
.access-login-note{font-size:12px;color:#647a8d;text-align:center;line-height:1.4}
.access-identity-actions{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12px}
.access-identity-actions>button{
  border:1px solid #bdd4e7;border-radius:8px;min-height:32px;
  background:#f2f8ff;color:#224d6f;padding:5px 9px;
  font:inherit;font-weight:800;cursor:pointer;
}
.access-identity-actions [hidden],
.settings-view .settings-inner-section[hidden]{display:none!important}
.access-users-dialog{
  width:min(96vw,650px);max-height:90dvh;overflow:auto;
  border:0;border-radius:17px;padding:clamp(14px,3vw,25px);
  background:#fff;color:#17344d;box-shadow:0 20px 60px #0005;
}
.access-users-dialog::backdrop{background:#0b1e32aa}
.access-users-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}
.access-users-heading h2{margin:0;font-size:20px}
.access-users-heading button{border:1px solid #b6cbd9;border-radius:9px;background:#eef4fa;min-width:40px;min-height:39px;font-size:23px}
.access-user-list{display:grid;gap:6px;margin:15px 0;padding:10px;border:1px solid #e0eaf2;border-radius:12px;max-height:195px;overflow:auto}
.access-user-line{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px}
.access-user-line button,.access-secondary-button{
  border:1px solid #accce5;border-radius:9px;padding:8px 11px;
  background:#e9f5ff;color:#175782;font-weight:750;cursor:pointer;
}
.access-users-dialog #accessUserForm{margin-top:17px;display:grid;gap:10px}
.access-users-dialog #accessUserForm>label{display:grid;gap:5px;font-size:14px;font-weight:750}
.access-users-dialog input:not([type="checkbox"]),.access-users-dialog select{
  box-sizing:border-box;width:100%;min-height:43px;padding:9px;
  border-radius:9px;border:1px solid #b9cbd9;font-size:16px;
}
.access-users-dialog fieldset{border:1px solid #d8e5ef;border-radius:10px;display:grid;gap:8px}
.access-users-dialog fieldset[hidden]{display:none!important}
.access-users-dialog fieldset label{font-weight:600;font-size:14px}
.access-users-dialog #accessUserFormStatus{font-size:13px;color:#246548}
.access-users-dialog .access-active-label{display:flex!important;flex-direction:row!important;align-items:center;gap:10px!important}


/* A hidden, unauthorized control must remain hidden even when the responsive
   tiles/sidebar define display:flex!important. Server checks remain primary. */
#app .settings-view #settingsMainMenu.settings-card-grid > .settings-tile[hidden],
#app .settings-view .settings-inner-actions > [hidden],
#app .dashboard-actions > .dashboard-action[hidden],
#app .bottom-shell .bottom-nav .nav-item[hidden],
#app .access-identity-actions > [hidden]{display:none!important}

#app #checkoutDiscountToggle[hidden],
#app #homeTodaySalesButton[hidden],
#app .sale-cart-item .sale-edit-price[hidden],
#app .sale-cart-item .sale-line-more[hidden]{display:none!important}


/* v58 — approved large-screen POS redesign.
   Scoped to mouse-and-keyboard desktop widths: mobile 3-across categories,
   touch tablets, phone checkout, CAS scale and receipt printing are unchanged.
   Put after earlier v4/v56 rules so the desktop layout is deterministic. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  :root { --hizli-desktop-gap:clamp(11px,1.05vw,20px); }
  .clean-topbar {
    min-height:72px!important;
    padding-top:8px!important;
    padding-bottom:8px!important;
  }
  .clean-topbar .searchline {max-width:1000px;width:100%;gap:11px}
  .clean-topbar .searchbox input {height:49px;min-height:49px}
  .clean-content {
    padding:clamp(14px,1.45vw,25px) clamp(15px,1.45vw,28px) 88px!important;
  }

  /* Home: real metrics and all twelve existing photographs, never placeholder
     category data or a second product catalog. */
  #homeView.dashboard-home {
    max-width:none!important;width:100%!important;
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-areas:"hero" "metrics" "actions" "categories"!important;
    gap:var(--hizli-desktop-gap)!important;
    padding:0 0 35px!important;
  }
  #homeView .dashboard-hero {
    min-height:133px!important;
    max-height:170px;
    margin:0!important;
    border-radius:17px!important;
  }
  #homeView .dashboard-hero-copy {padding:13px 12px 13px 22px!important}
  #homeView .dashboard-hero h1 {font-size:clamp(24px,2.4vw,34px)!important;margin-bottom:6px}
  #homeView .dashboard-hero p {font-size:clamp(12px,1vw,15px)!important}
  #homeView .dashboard-hero-art {max-height:148px}
  #homeView .dashboard-metrics {
    grid-area:metrics;display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    margin:0!important;gap:12px!important;
  }
  #homeView .dashboard-metric {
    min-height:100px!important;padding:11px 14px!important;
    border-radius:15px!important;
  }
  #homeView .dashboard-actions {
    grid-area:actions;
    display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:clamp(6px,.75vw,13px)!important;
    margin:0!important;
  }
  #homeView .dashboard-action {
    display:flex!important;align-items:center;justify-content:center;
    flex-direction:row!important;min-height:67px!important;
    padding:9px 7px!important;gap:8px!important;border-radius:12px!important;
    text-align:left!important;
  }
  #homeView .dashboard-action-icon {width:31px!important;height:31px!important;flex:none}
  #homeView .dashboard-action strong {font-size:clamp(11px,.94vw,15px)!important}
  #homeView .dashboard-action small {display:none!important}
  #desktopHomeCategories {
    display:block!important;grid-area:categories;
    width:100%;max-width:none!important;min-width:0;
    margin:0!important;padding:0!important;
  }
  #desktopHomeCategories h2 {
    font-size:clamp(19px,1.55vw,26px)!important;
    margin:3px 0 12px!important;
  }

  /* Four columns x three rows, full usable width. Keep image centered and
     contained — grocery cut-outs are transparent and must not be cropped. */
  #desktopHomeCategoryGrid.desktop-home-category-grid,
  #homeCategoryShortcuts.category-photo-grid,
  #categoryTree.category-grid-page {
    box-sizing:border-box;width:100%!important;
    max-width:none!important;margin:0!important;
    padding:0 0 16px!important;
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(10px,.95vw,17px)!important;align-items:stretch!important;
  }
  #desktopHomeCategoryGrid .photo-category-tile,
  #homeCategoryShortcuts .photo-category-tile,
  #categoryTree .photo-category-tile {
    box-sizing:border-box!important;width:100%!important;
    height:clamp(151px,11.9vw,188px)!important;
    min-height:151px!important;max-height:188px!important;
    min-width:0;display:flex!important;flex-direction:column!important;
    align-items:center!important;justify-content:flex-start!important;
    padding:9px 9px 8px!important;gap:6px!important;
    border:1px solid #dce6f0!important;border-radius:15px!important;
    background:#fff!important;text-align:center!important;
    box-shadow:0 4px 13px #142d4b12!important;
    transition:transform .15s ease,box-shadow .15s ease;
  }
  #desktopHomeCategoryGrid .photo-category-tile:hover,
  #homeCategoryShortcuts .photo-category-tile:hover,
  #categoryTree .photo-category-tile:hover {
    transform:translateY(-2px);
    box-shadow:0 8px 19px #132e4a23!important;
  }
  #desktopHomeCategoryGrid .photo-category-image,
  #homeCategoryShortcuts .photo-category-image,
  #categoryTree .photo-category-image {
    box-sizing:border-box!important;
    position:relative;display:grid!important;place-items:center;
    flex:1 1 auto!important;width:100%!important;
    height:calc(100% - 37px)!important;min-height:0!important;
    max-height:none!important;aspect-ratio:auto!important;
    border:0!important;border-radius:11px!important;
    background:linear-gradient(135deg,#fcfdff,#f3f8ff)!important;
    box-shadow:none!important;overflow:hidden!important;
  }
  #desktopHomeCategoryGrid .photo-category-image img,
  #homeCategoryShortcuts .photo-category-image img,
  #categoryTree .photo-category-image img {
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;max-height:100%!important;
    object-fit:contain!important;object-position:center!important;
    padding:4px!important;background:transparent!important;
    transform:none!important;
  }
  #desktopHomeCategoryGrid .photo-category-name,
  #homeCategoryShortcuts .photo-category-name,
  #categoryTree .photo-category-name {
    display:block!important;box-sizing:border-box;
    flex:0 0 auto!important;width:100%!important;max-width:none!important;
    min-height:26px!important;height:auto!important;
    margin:0!important;padding:0 2px!important;
    color:#142f4c!important;font-size:clamp(12px,1.13vw,17px)!important;
    font-weight:900!important;line-height:1.18!important;
    text-align:center!important;overflow-wrap:anywhere;
  }
  #desktopHomeCategoryGrid .desktop-home-chevron,
  #desktopHomeCategoryGrid .photo-category-badge {display:none!important}
  #homeCategoryShortcuts .photo-category-badge,
  #categoryTree .photo-category-badge {width:22px;height:22px;right:6px;bottom:6px}

  /* Products: categories, subcategories and product cards share a wide,
     tidy workplace rather than a narrow centered column. */
  #catalogView.clean-catalog,
  #catalogView .clean-categories,
  #catalogView #productResults,
  #catalogView #productCategoryHome,
  #catalogView #catalogCategoryNavigator {
    box-sizing:border-box;width:100%!important;max-width:none!important;
    margin:0!important;min-width:0!important;
  }
  #catalogView .clean-page-head {
    margin:0 0 12px!important;min-height:45px;
  }
  #categoryTrailName,#browseHeading {
    font-size:clamp(21px,1.65vw,28px)!important;
    line-height:1.2;color:#142c47;
  }
  #categorySearch.clean-category-search {
    height:49px;margin-bottom:13px;
    border-radius:12px;background:#fff;
  }
  #categoryAllProducts {min-height:45px;margin:4px 0 16px}
  #productList.products.grid-view {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:clamp(10px,1vw,18px)!important;
  }
  #productResults .products.grid-view .product-card {
    border-radius:15px!important;
    border:1px solid #dce6f0!important;
    box-shadow:0 3px 12px #0b2e4a10!important;
  }
  #productResults .products.grid-view .product-photo {
    height:clamp(134px,10vw,176px)!important;
    background:#f9fbff;
  }
  #productResults .products.grid-view .product-title {
    font-size:clamp(12px,1vw,16px)!important;
  }
  #productResults .products.list-view {
    width:100%;gap:8px!important;
  }
  #productResults .products.list-view .product-card {
    min-height:76px;grid-template-columns:75px minmax(0,1fr) minmax(190px,.42fr);
    padding:8px 14px;border:1px solid #dce6f0;border-radius:12px;
    box-shadow:0 2px 8px #1235510a;
  }
  #productResults .products.list-view .product-photo {
    height:65px;min-height:65px;width:70px;
  }
  #productResults .products.list-view .product-thumb{height:62px;min-height:0}
  #productResults .products.list-view .product-title{font-size:14px}
  #productResults .products.list-view .product-right{
    flex-direction:row;align-items:center;justify-content:flex-end;
    gap:16px;min-width:190px;
  }
  #productResults .products.list-view .product-stock-details{
    font-size:12px;white-space:nowrap;color:#446680;
  }

  /* Sale: full working area, left scanner + scrolling cart, right checkout.
     The existing barcode/scale/customer/discount/print logic is untouched. */
  #cartDialog.sale-sheet[open] {
    box-sizing:border-box!important;
    position:fixed!important;
    top:50dvh!important;left:calc(var(--hizli-sidebar) + 17px)!important;
    right:auto!important;bottom:auto!important;
    transform:translateY(-50%)!important;
    margin:0!important;
    width:calc(100vw - var(--hizli-sidebar) - 34px)!important;
    max-width:none!important;
    height:min(900px,calc(100dvh - 30px))!important;
    max-height:calc(100dvh - 30px)!important;
    min-height:0!important;
    padding:0!important;
    display:grid!important;
    grid-template-columns:minmax(0,1.65fr) minmax(325px,.87fr);
    grid-template-rows:auto auto minmax(0,1fr);
    grid-template-areas:"saleheader saleheader" "salesearch payment" "salelist payment";
    align-items:stretch;gap:0!important;
    background:#f6f9fe!important;border-radius:20px!important;
    overflow:hidden!important;box-shadow:0 28px 70px #0b234460;
  }
  #cartDialog.sale-sheet .sale-sheet-header {
    grid-area:saleheader;
    position:relative!important;top:auto!important;
    min-height:66px!important;max-height:none!important;
    padding:11px 17px!important;
    background:linear-gradient(105deg,#103e68,#0d294c)!important;
    border:0!important;box-shadow:none!important;
  }
  #cartDialog.sale-sheet .sale-scanner {
    grid-area:salesearch;position:relative!important;top:auto!important;
    z-index:1;min-width:0;min-height:75px!important;
    padding:13px 15px!important;
    border-right:1px solid #dae6f0!important;
    border-bottom:1px solid #e4ebf3!important;
    background:white!important;
  }
  #cartDialog.sale-sheet .sale-scanner input {
    height:48px!important;min-height:48px!important;
    font-size:15px!important;
  }
  #cartDialog.sale-sheet .cart-items {
    grid-area:salelist;
    box-sizing:border-box;min-width:0;min-height:0!important;
    max-height:none!important;height:100%!important;
    overflow-y:auto!important;
    padding:15px!important;
    background:#f5f8fd!important;
    overscroll-behavior:contain;
  }
  #cartDialog.sale-sheet .cart-line {
    grid-template-columns:clamp(76px,7.5vw,98px) minmax(0,1fr)!important;
    gap:13px!important;padding:11px 13px!important;
    margin-bottom:9px!important;border-radius:13px!important;
  }
  #cartDialog.sale-sheet .sale-cart-media {
    height:clamp(76px,7.5vw,98px)!important;
    min-height:0!important;
  }
  #cartDialog.sale-sheet .checkout-area {
    grid-area:payment;
    box-sizing:border-box;min-width:0;min-height:0!important;
    height:100%!important;max-height:none!important;
    display:flex!important;flex-direction:column;
    overflow-y:auto!important;
    gap:9px;
    padding:18px!important;
    background:#fff!important;border:0!important;
    border-left:1px solid #d8e4ee!important;
    border-radius:0!important;box-shadow:none!important;
  }
  #cartDialog.sale-sheet .cart-totals {
    flex:0 0 auto;
    margin:0 0 7px!important;
    padding:14px 12px!important;border-radius:15px;
    border:1px solid #e1eaf2;background:#f4faff;
  }
  #cartDialog.sale-sheet .total-row.grand {font-size:18px!important}
  #cartDialog.sale-sheet .total-row.grand strong {
    font-size:clamp(24px,2.25vw,33px)!important;
    color:#07844a!important;
  }
  #cartDialog.sale-sheet .payment-types {
    flex:0 0 auto;display:grid!important;
    grid-template-columns:1fr!important;gap:8px!important;
    padding:0!important;margin:2px 0 9px!important;border:0!important;
  }
  #cartDialog.sale-sheet .payment-types label,
  #cartDialog.sale-sheet .payment-types .payment-shortcut {
    box-sizing:border-box;grid-column:auto!important;
    display:block!important;width:100%!important;min-width:0!important;
    margin:0!important;
  }
  #cartDialog.sale-sheet .payment-types label span,
  #cartDialog.sale-sheet .payment-types .payment-shortcut {
    box-sizing:border-box;height:58px!important;min-height:58px!important;
    padding:10px 15px!important;
    border-radius:12px!important;
    display:flex!important;flex-direction:row!important;
    align-items:center!important;justify-content:center!important;
    gap:12px!important;text-align:center!important;
  }
  #cartDialog.sale-sheet .payment-types small {font-size:14px!important;font-weight:850}
  #cartDialog.sale-sheet .payment-types b {font-size:24px!important}
  #cartDialog.sale-sheet #completeSale {
    flex:none;min-height:61px!important;width:100%;
    margin-top:auto!important;border-radius:13px!important;
    font-size:17px!important;
  }
  #cartDialog.sale-sheet #creditBox,
  #cartDialog.sale-sheet #basketDiscountPanel,
  #cartDialog.sale-sheet #bankPaymentNotice {flex:0 0 auto;max-width:100%}

  /* Settings: the eight original operations stay together, with Backup and
     Settings adjacent. Nested preferences become a three-column control hub. */
  body.view-settings .settings-view {
    width:100%!important;max-width:none!important;
    margin:0!important;padding:18px!important;border-radius:19px!important;
  }
  .settings-view #settingsMainMenu.settings-card-grid {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    width:100%;max-width:none!important;
    gap:14px!important;margin:0!important;
  }
  .settings-view #settingsMainMenu.settings-card-grid>.settings-tile {
    height:clamp(142px,11vw,170px)!important;
    min-height:142px!important;padding:13px!important;
    border-radius:15px!important;
  }
  .settings-view #settingsMainMenu.settings-card-grid>.settings-tile strong{
    font-size:clamp(13px,1.05vw,17px)!important;
  }
  .settings-view #settingsPreferences {
    max-width:none!important;width:100%!important;
    padding:20px!important;border-radius:16px!important;
  }
  .settings-view .settings-inner-list {
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:12px!important;
  }
  .settings-view .settings-inner-section {
    min-width:0;align-self:start;border-radius:13px!important;
  }
  .settings-view .settings-inner-section>summary {
    padding:13px 11px!important;min-height:86px!important;
    gap:8px!important;
  }
  .settings-view .settings-inner-section>summary .settings-section-symbol {
    width:39px;height:39px;flex:0 0 39px!important;
    font-size:22px;
  }
  .settings-view .settings-section-name strong {
    font-size:clamp(12px,1vw,16px)!important;
  }
  .settings-view .settings-inner-section[open] {grid-column:1/-1}
  #settingsAdminGroup:not([hidden]) {display:block}
  #settingsAdminGroup>summary {
    background:linear-gradient(130deg,#f5f1ff,#edf5ff);
  }

  /* Actual users, stock and history retain their original data + listeners.
     Make dialogs comfortable workspaces without fabricating chart values. */
  #accessUsersDialog[open] {
    box-sizing:border-box;width:min(1000px,calc(100vw - 80px))!important;
    max-width:1000px!important;max-height:88dvh!important;
    display:grid;grid-template-columns:minmax(240px,.86fr) minmax(350px,1.14fr);
    grid-template-areas:"heading heading" "description description" "accounts editor" "new editor";
    grid-template-rows:auto auto minmax(0,1fr) auto;
    column-gap:25px;row-gap:12px;padding:24px!important;align-items:start;
  }
  #accessUsersDialog .access-users-heading{grid-area:heading}
  #accessUsersDialog>p{grid-area:description;margin:0 0 5px}
  #accessUserList{grid-area:accounts;margin:0!important;max-height:430px!important}
  #accessNewUser{grid-area:new;justify-self:start}
  #accessUserForm{grid-area:editor;margin:0!important;padding:17px!important;border:1px solid #dfe8f0;border-radius:14px;background:#f9fbfe}
  #manageDialog.sheet,#historyDialog.sheet,
  #pickProductDialog.sheet,#excelDialog.sheet,
  #categoryImageDialog.sheet,#customerDialog.sheet {
    box-sizing:border-box;
    top:50%!important;bottom:auto!important;left:50%!important;right:auto!important;
    transform:translate(-50%,-50%)!important;
    margin:0!important;padding-bottom:0!important;
    width:min(1050px,calc(100vw - var(--hizli-sidebar) - 76px))!important;
    max-width:1050px!important;max-height:87dvh!important;
    border-radius:18px!important;box-shadow:0 23px 65px #0e28443b;
  }
  #historyDialog.sheet {width:min(1180px,calc(100vw - var(--hizli-sidebar) - 76px))!important;max-width:1180px!important}
  #historyDialog .history-items {padding:8px 18px 22px}
  #historyDialog .history-card {border-radius:12px}
  #historyDialog .history-actions{padding:13px 18px}
  #historyDialog .history-summary {margin:13px 18px 0!important}
  #pickProductDialog.product-picker {width:min(1060px,calc(100vw - var(--hizli-sidebar) - 76px))!important}
  #pickProductDialog .picker-category-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
  #pickProductDialog .picker-category-tile img{height:108px!important}
  #manageDialog .manage-sheet-body {max-height:75dvh;overflow:auto}
}
/* Desktop/phone accessibility: hidden controls remain hidden despite
   display:flex !important in legacy photo and payment rules. */
#app .settings-inner-section[hidden],
#app #accessLogout[hidden],
#app .sale-line-more[hidden],
#app #checkoutDiscountToggle[hidden] {display:none!important}


/* v58 report widgets use real device-local history; hide on mobile. */
.history-summary{display:none!important}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  .history-summary:not([hidden]) {
    display:grid!important;gap:12px;
    padding:0;border:0;background:transparent;
  }
  .history-summary-metrics {
    display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;
  }
  .history-summary-metrics>div {
    display:flex;flex-direction:column;gap:7px;
    min-height:81px;padding:12px 15px;
    border:1px solid #dfeaf4;border-radius:12px;
    background:linear-gradient(145deg,#f0f8ff,#fff);
  }
  .history-summary-metrics>div:first-child{background:#eafbf1}
  .history-summary-metrics>div:nth-child(2){background:#ebf5ff}
  .history-summary-metrics>div:nth-child(3){background:#f4efff}
  .history-summary-metrics span {font-size:12px;font-weight:800;color:#5f7890}
  .history-summary-metrics strong{font-size:clamp(21px,1.7vw,29px);font-weight:950;color:#113451}
  #historyDialog .history-summary h3 {
    font-size:15px;color:#1c3c59;margin:4px 0 0;font-weight:900;
  }
  .history-summary h3 small{color:#647f93;font-weight:600;font-size:11px}
  .history-summary-chart {
    display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
    gap:9px;align-items:end;min-height:140px;
    padding:12px;border:1px solid #e2eaf4;border-radius:13px;background:#fbfdff;
  }
  .history-summary-day {
    display:grid;grid-template-rows:auto 94px auto;
    gap:5px;justify-items:center;align-items:end;
    min-width:0;
  }
  .history-summary-value {
    font-size:10px;color:#365f7c;
    font-variant-numeric:tabular-nums;
    max-width:100%;overflow:hidden;text-overflow:ellipsis;
    white-space:nowrap;
  }
  .history-summary-track {
    width:100%;height:94px;display:flex;align-items:flex-end;justify-content:center;
    background:#edf4fb;border-radius:8px 8px 2px 2px;
    overflow:hidden;
  }
  .history-summary-bar {
    display:block;width:min(38px,82%);min-height:3px;
    border-radius:7px 7px 2px 2px;background:linear-gradient(180deg,#3797f2,#1262b8);
  }
  .history-summary-day small {font-size:11px;color:#526e85}
  .desktop-stock-hint:not([hidden]) {
    display:block;margin:0 0 12px;padding:10px 15px;
    border-radius:11px;border:1px solid #d9e6f5;
    background:#edf6ff;color:#315676;font-size:13px;font-weight:800;
  }
  #productResults .products.list-view .product-stock-details{
    display:block;margin-top:7px;
    color:#496b85;font-size:12px;font-weight:750;white-space:normal;
  }
}
@media (min-width:1280px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #homeView.dashboard-home{
    grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr)!important;
    grid-template-areas:"hero metrics" "actions actions" "categories categories"!important;
    align-items:stretch;
  }
  #homeView .dashboard-hero{min-height:143px!important;max-height:none}
  #homeView .dashboard-metrics{min-height:143px!important;align-items:stretch}
  #homeView .dashboard-metric{min-height:0!important}
}
@media (prefers-reduced-motion:reduce){
  #desktopHomeCategoryGrid .photo-category-tile,
  #homeCategoryShortcuts .photo-category-tile,
  #categoryTree .photo-category-tile{transition:none!important}
}


/* v59 — Approved separate desktop layouts: Home is SIX across/TWO rows,
   Products remains FOUR across/THREE rows with larger artwork.  All tiles
   reuse the existing category tree and original category photos.  Restricted
   to the same mouse + landscape desktop breakpoint as the v58 redesign. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  /* Reserve space for the complete two-row gallery on typical 768px screens.
     Keep the existing welcome, shortcuts and *real* device statistics visible. */
  #homeView.dashboard-home {
    display:grid!important;max-width:none!important;width:100%!important;
    grid-template-columns:minmax(0,1.17fr) minmax(0,.83fr)!important;
    grid-template-rows:auto auto auto!important;
    grid-template-areas:"hero metrics" "actions actions" "categories categories"!important;
    gap:clamp(7px,1vh,12px)!important;
    padding:0 0 10px!important;margin:0!important;
    align-items:stretch;
  }
  #homeView .dashboard-hero {
    min-height:108px!important;height:108px!important;max-height:108px!important;
    padding:0!important;margin:0!important;border-radius:12px!important;
  }
  #homeView .dashboard-hero-copy {
    box-sizing:border-box;width:65%!important;
    padding:10px 8px 9px 15px!important;
  }
  #homeView .dashboard-hero h1 {
    font-size:clamp(20px,1.8vw,25px)!important;
    line-height:1.03!important;margin:0 0 3px!important;
  }
  #homeView .dashboard-hero p {
    font-size:clamp(11px,.83vw,13px)!important;
    line-height:1.23!important;margin:0 0 6px!important;
  }
  #homeView .dashboard-settings-shortcut {
    min-height:25px!important;padding:4px 9px!important;
    font-size:11px!important;border-radius:8px!important;
  }
  #homeView .dashboard-hero-art {
    max-height:104px!important;width:auto!important;
    object-fit:contain!important;object-position:right bottom;
  }
  #homeView .dashboard-metrics {
    display:grid!important;grid-area:metrics;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    padding:0!important;margin:0!important;min-height:0!important;
    height:108px!important;gap:8px!important;border:0!important;
  }
  #homeView .dashboard-metric {
    min-height:0!important;height:108px!important;max-height:108px!important;
    padding:8px!important;border-radius:12px!important;gap:7px!important;
    overflow:hidden;
  }
  #homeView .dashboard-metric-icon {
    width:31px!important;height:31px!important;
    flex:0 0 31px!important;font-size:21px!important;
  }
  #homeView .dashboard-metric-body>span {
    font-size:clamp(10px,.78vw,12px)!important;
  }
  #homeView .dashboard-metric-body>strong {
    font-size:clamp(16px,1.35vw,23px)!important;
    white-space:nowrap;
  }
  #homeView .dashboard-metric-body small,
  #homeView .dashboard-metric-arrow {display:none!important}
  #homeView .dashboard-actions {
    display:grid!important;grid-area:actions;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    gap:8px!important;margin:0!important;padding:0!important;
    height:49px!important;min-height:49px!important;
  }
  #homeView .dashboard-action {
    min-height:49px!important;height:49px!important;max-height:49px!important;
    padding:5px!important;border-radius:10px!important;gap:6px!important;
    flex-direction:row!important;overflow:hidden;
  }
  #homeView .dashboard-action-icon {
    width:24px!important;height:24px!important;flex:0 0 24px!important;
  }
  #homeView .dashboard-action strong {
    font-size:clamp(10px,.80vw,13px)!important;line-height:1.15!important;
  }
  #homeView .dashboard-action small {display:none!important}
  #desktopHomeCategories {
    grid-area:categories!important;
    min-width:0!important;width:100%!important;max-width:none!important;
    margin:0!important;padding:0!important;display:block!important;
  }
  #desktopHomeCategories h2 {
    font-size:clamp(17px,1.30vw,21px)!important;
    line-height:1.18!important;margin:0 0 7px!important;
  }
  /* Only Home gets six columns. Do not group this selector with
     #categoryTree or #homeCategoryShortcuts: Products needs four columns. */
  #desktopHomeCategoryGrid.desktop-home-category-grid {
    display:grid!important;box-sizing:border-box!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:clamp(132px,18vh,172px)!important;
    gap:clamp(7px,.75vw,12px)!important;
    padding:0!important;margin:0!important;align-items:stretch!important;
  }
  #desktopHomeCategoryGrid .photo-category-tile {
    box-sizing:border-box!important;min-width:0!important;
    height:clamp(132px,18vh,172px)!important;
    min-height:0!important;max-height:172px!important;
    padding:7px 6px 6px!important;gap:4px!important;
    border-radius:12px!important;justify-content:flex-start!important;
    box-shadow:0 3px 9px #122e4a12!important;
  }
  #desktopHomeCategoryGrid .photo-category-image {
    position:relative!important;display:grid!important;place-items:center!important;
    width:100%!important;height:calc(100% - 28px)!important;
    min-height:0!important;max-height:none!important;
    flex:1 1 auto!important;aspect-ratio:auto!important;
    overflow:hidden!important;border-radius:9px!important;
  }
  #desktopHomeCategoryGrid .photo-category-image img {
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;
    object-fit:contain!important;object-position:center!important;
    padding:0!important;background:transparent!important;
    transform:scale(1.18)!important;transform-origin:center!important;
  }
  #desktopHomeCategoryGrid .photo-category-name {
    flex:0 0 auto!important;min-height:24px!important;
    height:auto!important;max-width:100%!important;
    font-size:clamp(10px,.83vw,13px)!important;
    line-height:1.15!important;white-space:normal!important;
    overflow-wrap:break-word;display:block!important;
  }

  /* Product categories: 4x3, larger cards and genuinely enlarged pictures.
     Many original .webp photos have transparent padding; mild zoom avoids
     the tiny floating icon look without changing image data or labels. */
  #categoryTree.category-grid-page,
  #homeCategoryShortcuts.category-photo-grid {
    display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-auto-rows:auto!important;
    width:100%!important;max-width:none!important;
    padding:0 0 22px!important;
    gap:clamp(12px,1.05vw,19px)!important;
  }
  #categoryTree .photo-category-tile,
  #homeCategoryShortcuts .photo-category-tile {
    box-sizing:border-box!important;
    height:clamp(220px,20vw,280px)!important;
    min-height:220px!important;max-height:280px!important;
    padding:10px!important;gap:7px!important;
    border-radius:16px!important;
  }
  #categoryTree .photo-category-image,
  #homeCategoryShortcuts .photo-category-image {
    position:relative!important;
    flex:1 1 auto!important;height:calc(100% - 37px)!important;
    min-height:0!important;max-height:none!important;
    aspect-ratio:auto!important;
    width:100%!important;overflow:hidden!important;
    border-radius:12px!important;
  }
  #categoryTree .photo-category-image img,
  #homeCategoryShortcuts .photo-category-image img {
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;
    object-fit:contain!important;object-position:center!important;
    padding:0!important;background:transparent!important;
    transform:scale(1.38)!important;transform-origin:center!important;
  }
  #categoryTree .photo-category-name,
  #homeCategoryShortcuts .photo-category-name {
    flex:0 0 auto!important;min-height:31px!important;
    height:auto!important;font-size:clamp(14px,1.2vw,18px)!important;
    line-height:1.2!important;
  }
}
/* Touch tablets and phones keep their approved layouts and original tile sizes. */
@media(prefers-reduced-motion:reduce){
  #desktopHomeCategoryGrid .photo-category-tile,
  #categoryTree .photo-category-tile,
  #homeCategoryShortcuts .photo-category-tile {transition:none!important}
}


/* v60: Fix the screen-leak root cause.
   The desktop rule #homeView.dashboard-home { display:grid!important }
   defeated the generic [hidden] rule, leaving Home underneath Settings, Stock
   and Sales. Explicit ID-level hidden always wins on every form factor. */
#app #mainContent > #homeView[hidden],
#app #mainContent > #catalogView[hidden],
#app #mainContent > #settingsView[hidden],
#app #mainContent > #stockView[hidden],
#app #catalogView #categoryBrowser[hidden],
#app #catalogView #catalogCategoryNavigator[hidden],
#app #catalogView #productCategoryHome[hidden],
#app #catalogView #productResults[hidden],
#app #settingsView #settingsMainMenu[hidden],
#app #settingsView #settingsPreferences[hidden],
#app #settingsView #settingsPageTitle[hidden],
#app #homeDesktopInsights #homeRecentSalesCard[hidden],
#historyDialog #historySummaryPlot[hidden],
#historyDialog #historySummaryEmpty[hidden],
#app #stockOverviewMore[hidden] {display:none!important}

/* Home extra space is useful only on desktop; mobile keeps its approved home
   and three-across/touch categories. These are real device-local values. */
.home-desktop-insights{display:none}
.home-insight-card{
  min-width:0;padding:17px 19px;border:1px solid #d7e5f1;
  border-radius:16px;background:#fff;
  box-shadow:0 5px 15px #163a5312;
  display:flex;flex-direction:column;gap:10px;
}
.home-insight-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.home-insight-heading h3{font-size:18px;color:#153a57;margin:0;font-weight:900}
.home-insight-heading span{font-size:12px;color:#657e92;font-weight:700}
.home-insight-count{font-size:14px;font-weight:850;color:#a15e18;margin:0}
.home-insight-list{display:grid;gap:7px;list-style:none;margin:0;padding:0;flex:1}
.home-insight-list li{
  display:flex;align-items:start;justify-content:space-between;
  gap:12px;font-size:14px;color:#28485f;
  padding:7px 0;border-bottom:1px solid #edf2f7;line-height:1.35;
}
.home-insight-list li strong{flex:none;font-size:14px;color:#175a7e;white-space:nowrap}
.home-insight-list li span{overflow-wrap:anywhere}
.home-insight-link{
  margin-top:auto;align-self:flex-start;cursor:pointer;
  padding:9px 13px;border-radius:9px;
  border:1px solid #bad5ea;background:#eaf5ff;
  color:#175c8a;font-size:13px;font-weight:850;
}

/* Dedicated stock status, with real inventory counts and read-only rows.
   The table scrolls horizontally instead of squeezing labels on narrow screens. */
.stock-overview{
  box-sizing:border-box;width:100%;max-width:1400px;margin:0 auto;
  padding:clamp(12px,1.7vw,27px);background:#fff;color:#18354d;
  border:1px solid #dce6ef;border-radius:18px;
  box-shadow:0 7px 25px #112d4b12;
}
.stock-overview-header{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:18px}
.stock-overview-header h1{font-size:clamp(23px,2vw,30px);font-weight:950;margin:0 0 5px}
.stock-overview-header p{font-size:13px;line-height:1.4;margin:0;color:#5e758b}
.stock-overview-back{padding:11px 14px;border-radius:10px;border:1px solid #c5d9eb;background:#f0f7ff;color:#184e7a;min-height:44px;font-weight:850}
.stock-overview-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:11px;margin-bottom:20px}
.stock-overview-metrics>div{display:flex;flex-direction:column;gap:9px;min-height:85px;background:#f3f8ff;border:1px solid #deeaf5;border-radius:13px;padding:13px}
.stock-overview-metrics>div:nth-child(2){background:#fff1ef;border-color:#f5d6d2}
.stock-overview-metrics>div:nth-child(3){background:#fff8e9;border-color:#f3e2bb}
.stock-overview-metrics span{font-size:13px;color:#506e85;font-weight:750}
.stock-overview-metrics strong{font-size:27px;font-weight:950;color:#173855;font-variant-numeric:tabular-nums}
.stock-overview-controls{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
#stockOverviewSearch{
  box-sizing:border-box;flex:1 1 280px;min-width:160px;
  min-height:49px;padding:11px 15px;
  border:1px solid #cbdce9;background:#fff;border-radius:11px;
  font-size:16px;color:#19354e;
}
.stock-overview-filters{display:flex;gap:7px;flex-wrap:wrap}
.stock-overview-filters button{
  cursor:pointer;min-height:43px;border-radius:10px;padding:7px 14px;
  border:1px solid #cbdbe8;background:#f1f6fa;color:#2b5577;
  font-size:14px;font-weight:850;
}
.stock-overview-filters button[aria-pressed=true]{border-color:#126fc1;background:#1768bb;color:#fff}
.stock-overview-count{font-size:13px;color:#587187;font-weight:700;margin:6px 0 11px}
.stock-overview-table-wrap{width:100%;overflow-x:auto;border:1px solid #d9e4ef;border-radius:13px}
.stock-overview-table{width:100%;min-width:770px;border-collapse:collapse;text-align:left}
.stock-overview-table thead{background:#eaf2fb}
.stock-overview-table th{padding:14px 16px;font-size:13px;font-weight:900;color:#28516d}
.stock-overview-table td{border-top:1px solid #e8eef5;padding:13px 16px;font-size:14px;line-height:1.35;vertical-align:middle}
.stock-overview-table tbody tr:nth-child(even){background:#fafcff}
.stock-overview-table tbody tr:hover{background:#edf6ff}
.stock-overview-table td:first-child{width:36%}
.stock-overview-table td:first-child strong{display:block;font-size:15px;color:#173950;overflow-wrap:anywhere}
.stock-overview-table td:first-child small{display:block;font-size:12px;color:#658098;margin-top:4px}
.stock-overview-table .stock-quantity{font-weight:850;font-variant-numeric:tabular-nums}
.stock-status{display:inline-flex;align-items:center;justify-content:center;border-radius:8px;min-width:82px;padding:7px 10px;font-weight:850;font-size:12px}
.stock-status-empty{background:#ffe8e6;color:#a33131}
.stock-status-low{background:#fff3d5;color:#966116}
.stock-status-ok{background:#e2f8eb;color:#216c45}
.stock-status-unknown{background:#edf1f5;color:#627589}
.stock-overview-no-results{text-align:center!important;padding:45px 18px!important;color:#667e94!important}
.stock-overview-more{display:block;margin:16px auto 0;padding:12px 22px;border-radius:11px;background:#176cc2;color:#fff;border:0;font-weight:850;cursor:pointer}
@media(max-width:650px){
  .stock-overview-metrics{gap:6px}
  .stock-overview-metrics>div{padding:9px 8px;min-height:85px}
  .stock-overview-metrics span{font-size:11px}
  .stock-overview-metrics strong{font-size:21px}
  .stock-overview{padding:12px 8px}
}

@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  /* Add a complete fourth grid row, not an implicit half-width column. */
  #homeView.dashboard-home{
    grid-template-rows:auto auto auto auto!important;
    grid-template-areas:"hero metrics" "actions actions" "categories categories" "insights insights"!important;
  }
  #homeDesktopInsights.home-desktop-insights{
    display:grid;grid-area:insights;
    grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;
    align-items:stretch;width:100%;margin:10px 0 20px;
  }
  #homeDesktopInsights.home-desktop-insights:has(#homeRecentSalesCard[hidden]){grid-template-columns:1fr}

  /* Settings occupy the clean content area with only their own tiles.
     Do not show Home or Products behind the settings work area. */
  body.view-settings #settingsView.settings-view{
    min-height:calc(100dvh - 160px)!important;
    background:linear-gradient(145deg,#103b64,#0d567a)!important;
    padding:22px!important;
  }
  #settingsView #settingsMainMenu.settings-card-grid{gap:clamp(12px,1.2vw,20px)!important}
  #settingsView .settings-inner-list{align-items:start}

  /* History: typography, meaningful empty state, useful per-device graph,
     scrollable recent receipts below. */
  #historyDialog.sheet[open]{
    display:flex!important;flex-direction:column;
    box-sizing:border-box!important;
    width:min(1120px,calc(100vw - var(--hizli-sidebar) - 64px))!important;
    max-width:1120px!important;
    max-height:90dvh!important;
    padding:0!important;
    border-radius:18px!important;
    overflow:hidden!important;background:#f8fbff;
  }
  #historyDialog .sheet-header{
    flex:none;position:relative!important;top:auto!important;
    background:linear-gradient(100deg,#123c63,#0a6289)!important;
    color:#fff;padding:17px 22px!important;border:0;
  }
  #historyDialog .sheet-header h2{font-size:22px!important}
  #historyDialog .closebutton{color:#123c63;background:#fff}
  #historyDialog .history-actions{
    flex:none;display:flex;align-items:center;gap:14px;flex-wrap:wrap;
    padding:14px 21px!important;background:#fff;border-bottom:1px solid #e0e9f2;
  }
  #historyDialog #historyCount{font-size:15px!important;font-weight:900}
  #historyDialog .history-device-note{color:#638097;font-size:12px;font-weight:700}
  #historyDialog #exportSales{margin-left:auto;min-height:41px;font-size:13px}
  #historyDialog #historySummary.history-summary:not([hidden]){
    display:grid!important;flex:none;
    gap:13px!important;margin:0!important;padding:17px 20px 12px!important;
    border:0!important;background:#f8fbff!important;
  }
  #historyDialog .history-summary-metrics{gap:11px!important}
  #historyDialog .history-summary-metrics>div{
    min-height:76px!important;padding:12px 15px!important;
    gap:6px!important;
  }
  #historyDialog .history-summary-metrics span{font-size:13px!important}
  #historyDialog .history-summary-metrics strong{font-size:clamp(22px,2.1vw,29px)!important}
  #historyDialog .history-summary-empty{
    border:1px dashed #c8dced;border-radius:12px;
    padding:25px 18px;margin:0;
    text-align:center;background:#fff;color:#506e86;
    font-size:15px;font-weight:750;line-height:1.6;
  }
  #historyDialog #historySummaryPlot h3{margin:0 0 9px!important;font-size:16px!important}
  #historyDialog .history-summary-chart{min-height:130px!important;gap:10px}
  #historyDialog .history-summary-value{font-size:12px!important}
  #historyDialog .history-summary-day small{font-size:12px!important}
  #historyDialog #historyItems.history-items{
    box-sizing:border-box;flex:1 1 auto;min-height:90px;max-height:none!important;
    overflow-y:auto!important;padding:13px 20px 20px!important;
    border-top:1px solid #e2eaf3;background:#fff;
  }
  #historyDialog .history-card{
    padding:13px 16px!important;margin-bottom:8px!important;
    border:1px solid #e0eaf2;border-radius:12px!important;
  }
  #historyDialog .history-head{font-size:15px!important}
  #historyDialog .history-card small{font-size:12px!important}
  #historyDialog .history-card p{font-size:14px!important;line-height:1.45!important}
  #historyDialog .history-card button{font-size:13px!important;min-height:38px}

  /* Sale uses the already approved left cart/right payment layout.
     Make primary actions readable instead of tiny in a large blank workspace. */
  #cartDialog.sale-sheet .sale-empty-premium{
    box-sizing:border-box;min-height:0!important;height:auto!important;
    width:min(580px,94%)!important;
    margin:auto!important;padding:24px 26px!important;
    gap:10px!important;border:1px dashed #bbd6ec;
    border-radius:19px;background:#fff;
    box-shadow:0 5px 18px #113d5e0c;
  }
  #cartDialog.sale-sheet .sale-empty-basket{width:145px!important}
  #cartDialog.sale-sheet .sale-empty-premium strong{font-size:27px!important}
  #cartDialog.sale-sheet .sale-empty-premium p{font-size:15px!important;line-height:1.5!important}
  #cartDialog.sale-sheet .sale-empty-actions{gap:10px!important;max-width:480px!important}
  #cartDialog.sale-sheet .sale-empty-actions button{
    min-height:51px!important;padding:9px 11px!important;
    border-radius:12px!important;font-size:13px!important;
  }
  #cartDialog.sale-sheet .sale-empty-actions span{font-size:22px!important}
  #cartDialog.sale-sheet .cart-items{padding:20px!important}
  #cartDialog.sale-sheet .sale-scanner{padding:16px 20px!important}
  #cartDialog.sale-sheet .sale-scanner input{font-size:17px!important}
  #cartDialog.sale-sheet .sale-scanner button{
    font-size:14px!important;min-height:50px!important;padding:8px 12px!important;
  }
  #cartDialog.sale-sheet .checkout-area{padding:22px!important;gap:14px!important}
  #cartDialog.sale-sheet .cart-totals{
    padding:17px!important;border-radius:14px!important;
  }
  #cartDialog.sale-sheet .payment-types{gap:11px!important}
  #cartDialog.sale-sheet .payment-types label span,
  #cartDialog.sale-sheet .payment-types .payment-shortcut{
    min-height:64px!important;height:64px!important;font-size:16px!important;
    justify-content:flex-start!important;padding:12px 20px!important;
  }
  #cartDialog.sale-sheet .payment-types small{font-size:16px!important}
  #cartDialog.sale-sheet #completeSale{min-height:66px!important;font-size:18px!important}
}


/* v61: Desktop account controls live in the top-right on EVERY route.
   The same original nodes drive mobile and desktop: no stale duplicate
   connectivity indicator, user name or logout button. */
.topbar-account-panel { display:contents; }
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  .clean-topbar .brandline .topbar-account-panel {
    position:fixed!important;
    top:12px!important;
    right:clamp(16px,2vw,34px)!important;
    left:auto!important;bottom:auto!important;
    z-index:22;
    display:flex!important;align-items:center!important;justify-content:flex-end!important;
    flex-wrap:nowrap!important;gap:clamp(7px,.7vw,14px)!important;
    min-width:0;max-width:min(400px,44vw);
    height:48px;box-sizing:border-box;
  }
  /* Cancel the previous fixed BOTTOM-LEFT sidebar badge styling. */
  .clean-topbar .brandline #connectionStatus {
    position:static!important;top:auto!important;right:auto!important;
    bottom:auto!important;left:auto!important;z-index:auto!important;
    display:inline-flex!important;align-items:center;justify-content:center;
    flex:0 0 auto!important;width:auto!important;min-width:0!important;
    margin:0!important;padding:9px 12px!important;
    border-radius:999px!important;
    font-size:clamp(11px,.83vw,14px)!important;font-weight:850;
    white-space:nowrap;text-align:center;
  }
  .clean-topbar .brandline #connectionStatus.online {
    color:#d7ffe7!important;background:#126b4d!important;
    border-color:#23866b!important;
  }
  .clean-topbar .brandline #connectionStatus.offline {
    color:#fff3e5!important;background:#763c43!important;
    border-color:#914f53!important;
  }
  .clean-topbar .brandline .access-identity-actions {
    display:flex!important;flex-direction:row!important;flex-wrap:nowrap!important;
    align-items:center!important;justify-content:flex-end!important;
    gap:clamp(6px,.65vw,12px)!important;min-width:0;margin:0!important;
    font-size:clamp(11px,.92vw,15px)!important;
  }
  .clean-topbar #accessIdentity:not([hidden]) {
    display:block!important;
    max-width:clamp(92px,11vw,170px);min-width:0;overflow:hidden;
    white-space:nowrap;text-overflow:ellipsis;
    color:#f1f7ff;font-size:inherit;font-weight:850;
  }
  .clean-topbar #accessLogout:not([hidden]) {
    display:inline-flex!important;align-items:center;justify-content:center;
    flex:0 0 auto;min-height:39px!important;min-width:64px;
    margin:0;padding:7px 12px!important;border:1px solid #c4d6eb;
    border-radius:10px!important;background:#f5faff!important;
    color:#164368!important;font-size:clamp(12px,.9vw,15px)!important;
    font-weight:850;cursor:pointer;
  }
  .clean-topbar #accessLogout:focus-visible,
  .clean-topbar #accessIdentity:focus-visible {
    outline:3px solid #77c9ff;outline-offset:2px;
  }
  /* The scan box contracts before account actions do. */
  .clean-topbar .searchline {
    flex:0 1 auto!important;
    width:min(920px,calc(100% - 405px))!important;
    max-width:min(920px,calc(100% - 405px))!important;
    min-width:0!important;margin:0 auto 0 0!important;
  }
  .clean-topbar .searchbox {min-width:0!important;flex:1 1 auto!important}
  .clean-topbar .searchbox input {min-width:0!important;width:100%!important}
}
/* Never override the auth module's permission and visibility decisions. */
#app .topbar-account-panel [hidden] { display:none!important; }


/* v62: Give Sales and Reports the full *desktop working height*.
   Keep the existing cashier/payment flow and history API unchanged.
   The old centered-dialog max-height/margin rules left wide dead space on
   16:9 PC monitors; these two overlays now use the area beside the sidebar. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  /* Main sale panel spans from the blue title bar down to the bottom edge,
     with a small safety margin above the Windows taskbar/browser viewport. */
  #cartDialog.sale-sheet[open] {
    position:fixed!important;
    top:9px!important;
    right:auto!important;
    bottom:9px!important;
    left:calc(var(--hizli-sidebar) + 9px)!important;
    transform:none!important;
    margin:0!important;
    box-sizing:border-box!important;
    width:calc(100vw - var(--hizli-sidebar) - 18px)!important;
    max-width:none!important;
    height:calc(100dvh - 18px)!important;
    max-height:none!important;
    min-height:0!important;
    border-radius:16px!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
    overflow:hidden!important;
  }
  #cartDialog.sale-sheet .cart-items {
    min-height:0!important;
    max-height:none!important;
    height:100%!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }
  #cartDialog.sale-sheet .checkout-area {
    box-sizing:border-box!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }
  #cartDialog.sale-sheet .sale-empty-premium {
    max-width:min(580px,94%)!important;
    margin:auto!important;
  }

  /* Reports/History occupies the same desktop canvas as Sales.
     The receipt list scrolls independently; the blue header, totals,
     CSV export and seven-day chart remain visible at the top. */
  #historyDialog.sheet[open] {
    position:fixed!important;
    top:10px!important;
    right:auto!important;
    bottom:10px!important;
    left:calc(var(--hizli-sidebar) + 11px)!important;
    transform:none!important;
    margin:0!important;
    box-sizing:border-box!important;
    width:calc(100vw - var(--hizli-sidebar) - 22px)!important;
    max-width:none!important;
    height:calc(100dvh - 20px)!important;
    max-height:none!important;
    min-height:0!important;
    border-radius:16px!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }
  #historyDialog .sheet-header,
  #historyDialog .history-actions {flex:0 0 auto!important}
  #historyDialog #historySummary.history-summary:not([hidden]) {
    flex:0 0 auto!important;
    padding:clamp(14px,1.35vw,22px)!important;
  }
  #historyDialog .history-summary-metrics {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:clamp(10px,1vw,17px)!important;
  }
  #historyDialog .history-summary-metrics>div {
    min-height:96px!important;
    padding:clamp(13px,1.2vw,20px)!important;
    border-radius:14px!important;
  }
  #historyDialog .history-summary-metrics strong {
    font-size:clamp(23px,2.3vw,35px)!important;
  }
  #historyDialog #historyItems.history-items {
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }
  #historyDialog .history-summary-empty {
    display:grid;place-items:center;
    min-height:clamp(170px,28dvh,300px);
    padding:22px!important;
    font-size:clamp(15px,1.25vw,19px)!important;
  }
  /* A register with no sales gets one useful empty state, not a duplicate
     second empty-state panel below it. This only affects desktop display. */
  #historyDialog:has(#historySummaryEmpty:not([hidden])) #historyItems {
    display:none!important;
  }
  #historyDialog:has(#historySummaryEmpty:not([hidden]))
  #historySummary.history-summary:not([hidden]) {
    flex:1 1 auto!important;
    align-content:start;
  }
}


/* v63 desktop dialog positioning superseded by native v65 workspace pages. */

/* v64 — approved Products workspace: six main categories across × two rows.
   The existing original category photography, palette, main Home design,
   stock reports, desktop checkout, touch and mobile category screens stay intact. */
#productSubcategoriesPanel[hidden] {display:none!important}
.product-category-quickbar {
  display:none;box-sizing:border-box;align-items:center;justify-content:space-between;
  gap:12px;flex-wrap:wrap;margin:13px 0 5px;padding:12px 15px;
  border:1px solid #d9e7f5;border-radius:12px;background:#f5faff;
}
.product-category-quickbar p {margin:0;color:#476b86;font-size:13px;font-weight:700}
.product-category-quick-actions {display:flex;gap:8px;flex-wrap:wrap}
.product-category-quick-actions button {
  border:1px solid #bbd7f2;border-radius:10px;padding:9px 13px;
  background:#e6f2ff;color:#15598d;font:inherit;font-size:13px;font-weight:850;cursor:pointer;
}
.product-category-quick-actions button:first-child {
  background:#176dbe;border-color:#176dbe;color:#fff;
}
.product-inline-subcategories {
  margin:13px 0 25px;padding:17px;
  border-radius:16px;border:1px solid #c5dbf0;
  background:linear-gradient(135deg,#e8f3ff 0%,#f6fbff 100%);
  box-shadow:0 5px 15px #193f6812;
}
.product-inline-subcategories-head {
  display:flex;justify-content:space-between;align-items:start;gap:15px;
  margin-bottom:14px;
}
.product-inline-subcategories-head h2 {
  font-size:clamp(17px,1.4vw,22px);color:#153b5a;font-weight:900;margin:0 0 4px;
}
.product-inline-subcategories-head p {
  font-size:12px;font-weight:700;color:#57758d;margin:0;
}
.product-inline-close {
  flex:none;border:1px solid #cbdff1;border-radius:10px;
  width:38px;height:38px;background:#fff;color:#315c7b;
  font-size:24px;font-weight:750;cursor:pointer;
}
.product-inline-subcategory-grid {
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;
}
.product-inline-subcategory-grid .photo-category-tile {
  box-sizing:border-box;min-width:0;min-height:115px;
  height:auto;padding:11px 8px!important;border-radius:12px;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:#fff;border:1px solid #dbe7f4;box-shadow:0 2px 8px #193c5d0b;
  cursor:pointer;text-align:center;gap:5px;
}
.product-inline-subcategory-grid .photo-category-image {
  position:relative;flex:none;width:100%;height:70px!important;
  max-height:70px!important;aspect-ratio:auto!important;
  display:grid;place-items:center;overflow:hidden;border-radius:9px;
}
.product-inline-subcategory-grid .photo-category-image img {
  position:absolute;inset:0;width:100%!important;height:100%!important;
  object-fit:contain!important;object-position:center!important;
  padding:0!important;background:transparent!important;transform:scale(1.05)!important;
}
.product-inline-subcategory-grid .photo-category-name {
  color:#173b59;font-size:13px!important;line-height:1.22;font-weight:850;
  min-height:0!important;max-width:100%;overflow-wrap:anywhere;
}
.product-inline-all {
  display:block;margin:14px 0 0 auto;min-height:43px;
  padding:10px 16px;border:0;border-radius:10px;
  color:white;background:#176dbe;font:inherit;font-size:13px;
  font-weight:900;cursor:pointer;
}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #productCategoryHome .product-category-quickbar {display:flex}
  /* Override the old 4-column Products tiles only, not the Home 6×2 gallery. */
  #productCategoryHome #homeCategoryShortcuts.category-photo-grid {
    display:grid!important;width:100%!important;
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-template-rows:repeat(2,minmax(0,1fr))!important;
    grid-auto-rows:clamp(137px,18dvh,177px)!important;
    gap:clamp(7px,.75vw,13px)!important;
    padding:0!important;margin:0!important;align-items:stretch!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-tile {
    box-sizing:border-box!important;min-width:0!important;
    height:clamp(137px,18dvh,177px)!important;
    min-height:0!important;max-height:177px!important;
    padding:7px 7px 6px!important;gap:4px!important;border-radius:13px!important;
    justify-content:flex-start!important;
    box-shadow:0 3px 11px #122e4a12!important;
    transition:border-color .16s ease,box-shadow .16s ease;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-image {
    position:relative!important;display:grid!important;place-items:center!important;
    flex:1 1 auto!important;width:100%!important;
    height:calc(100% - 28px)!important;min-height:0!important;
    max-height:none!important;aspect-ratio:auto!important;
    overflow:hidden!important;border-radius:9px!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-image img {
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;
    object-fit:contain!important;object-position:center!important;
    padding:0!important;background:transparent!important;
    transform:scale(1.18)!important;transform-origin:center!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-name {
    flex:0 0 auto!important;min-height:24px!important;max-width:100%!important;
    font-size:clamp(10px,.84vw,14px)!important;line-height:1.17!important;
    height:auto!important;white-space:normal!important;overflow-wrap:break-word;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-tile.is-inline-selected {
    border:2px solid #2575d1!important;background:#f0f7ff!important;
    box-shadow:0 4px 15px #2671bb29!important;
  }
}
@media (max-width:700px) {
  .product-inline-subcategory-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (prefers-reduced-motion:reduce) {
  #productCategoryHome #homeCategoryShortcuts .photo-category-tile {transition:none!important}
}


/* v65 — Native desktop Sale & Reports pages.
   Unlike v58-v63 dialog overlays, #saleView and #reportsView are direct
   siblings of Home, Products, Stock and Settings in #mainContent.
   Their original controls are MOVED (not cloned) from the mobile dialog.
   This also keeps the global catalog/connection warning in document flow. */
#app #mainContent > #saleView[hidden],
#app #mainContent > #reportsView[hidden] {display:none!important}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #app #mainContent > #saleView.workspace-page:not([hidden]),
  #app #mainContent > #reportsView.workspace-page:not([hidden]) {
    box-sizing:border-box!important;
    position:relative!important;inset:auto!important;transform:none!important;
    width:100%!important;max-width:none!important;min-width:0!important;
    margin:0!important;padding:0!important;
    color:#173952;background:#fff!important;
    border:1px solid #dce6ef!important;border-radius:18px!important;
    box-shadow:0 6px 22px #112d4b12!important;
    overflow:hidden!important;
  }
  /* Same outer canvas and spacing as the other four content sections;
     this is not fixed to the viewport, so no second window overlays Home. */
  #app #mainContent > #saleView.sale-sheet:not([hidden]) {
    display:grid!important;
    grid-template-columns:minmax(0,1.65fr) minmax(290px,.86fr)!important;
    grid-template-rows:auto auto minmax(0,1fr)!important;
    grid-template-areas:"saleheader saleheader" "salesearch payment" "salelist payment"!important;
    height:calc(100dvh - 121px)!important;
    min-height:510px!important;
    max-height:none!important;
    gap:0!important;align-items:stretch!important;
  }
  #saleView .sale-sheet-header {
    grid-area:saleheader!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;
    flex-wrap:wrap!important;gap:12px!important;
    min-height:67px!important;height:auto!important;max-height:none!important;
    position:relative!important;top:auto!important;
    margin:0!important;padding:11px 18px!important;
    background:linear-gradient(105deg,#103e68,#0d294c)!important;
    color:#fff!important;border:0!important;border-radius:0!important;
    box-shadow:none!important;
  }
  #saleView .sale-heading h2 {color:#fff!important}
  #saleView .sale-scanner {
    grid-area:salesearch!important;position:relative!important;top:auto!important;
    display:flex!important;align-items:center!important;gap:11px!important;
    min-height:75px!important;padding:12px 15px!important;margin:0!important;
    border-right:1px solid #dae6f0!important;border-bottom:1px solid #e4ebf3!important;
    background:#fff!important;
  }
  #saleView .sale-scanner input {flex:1 1 auto;min-width:0;min-height:47px;font-size:15px}
  #saleView .cart-items {
    grid-area:salelist!important;min-width:0!important;min-height:0!important;
    height:auto!important;max-height:none!important;overflow-y:auto!important;
    padding:16px!important;margin:0!important;background:#fff!important;
    overscroll-behavior:contain;
  }
  #saleView .sale-empty-premium {
    display:flex;flex-direction:column;align-items:center;
    justify-content:center;max-width:min(560px,100%);
    margin:auto!important;min-height:0;
  }
  #saleView .checkout-area {
    grid-area:payment!important;display:flex!important;flex-direction:column!important;
    gap:8px!important;min-width:0!important;min-height:0!important;
    height:auto!important;max-height:none!important;
    overflow-y:auto!important;overscroll-behavior:contain;
    margin:0!important;padding:17px!important;
    border-left:1px solid #dae6f0!important;background:#f3f8ff!important;
  }
  #saleView .cart-totals {flex:none!important;width:100%!important}
  #saleView .payment-types.checkout-shortcuts {
    display:grid!important;grid-template-columns:1fr!important;
    gap:8px!important;flex:0 0 auto!important;margin:2px 0 9px!important;
    padding:0!important;border:0!important;
  }
  #saleView .payment-types label,#saleView .payment-types .payment-shortcut {
    display:block!important;width:100%!important;min-width:0!important;margin:0!important;
  }
  #saleView .payment-types label span,
  #saleView .payment-types .payment-shortcut {
    box-sizing:border-box!important;
    height:58px!important;min-height:58px!important;
    padding:9px 13px!important;
    border-radius:12px!important;
    display:flex!important;flex-direction:row!important;
    align-items:center!important;justify-content:center!important;
    gap:12px!important;text-align:center!important;
  }
  #saleView .payment-types small {font-size:14px!important;font-weight:850!important}
  #saleView .payment-types b{font-size:24px!important}
  #saleView #completeSale {
    flex:none!important;width:100%!important;min-height:61px!important;
    margin-top:auto!important;border-radius:13px!important;font-size:17px!important;
  }
  #saleView #creditBox,#saleView #basketDiscountPanel,#saleView #bankPaymentNotice {
    flex:0 0 auto!important;max-width:100%;
  }
  #app #mainContent > #reportsView.reports-page:not([hidden]) {
    display:flex!important;flex-direction:column!important;
    min-height:calc(100dvh - 121px)!important;
    height:auto!important;max-height:none!important;
  }
  #reportsView .sheet-header {
    flex:0 0 auto!important;display:flex!important;
    justify-content:space-between!important;align-items:center!important;
    padding:16px 20px!important;min-height:67px!important;
    background:linear-gradient(105deg,#103e68,#0d294c)!important;
    border-radius:0!important;color:#fff!important;
  }
  #reportsView .sheet-header h2 {color:#fff!important;font-size:23px!important}
  #reportsView .sheet-header .closebutton {color:#fff!important}
  #reportsView .history-actions {
    display:flex!important;flex:0 0 auto!important;align-items:center!important;
    justify-content:space-between!important;flex-wrap:wrap!important;
    gap:10px!important;padding:15px 20px!important;
    border-bottom:1px solid #e0eaf3!important;background:#f8fbff!important;
  }
  #reportsView #historySummary.history-summary:not([hidden]) {
    display:grid!important;flex:0 0 auto!important;
    gap:14px!important;margin:0!important;padding:18px 20px!important;
    background:transparent!important;border:0!important;
  }
  #reportsView .history-summary-metrics {
    display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:clamp(10px,1vw,17px)!important;
  }
  #reportsView .history-summary-metrics>div {
    display:flex;flex-direction:column;gap:8px;
    min-height:94px!important;padding:15px!important;
    border-radius:13px!important;background:#eff7ff!important;
    border:1px solid #dceaf4!important;
  }
  #reportsView .history-summary-metrics>div:first-child {background:#eafbf1!important}
  #reportsView .history-summary-metrics>div:nth-child(3) {background:#f4efff!important}
  #reportsView .history-summary-metrics strong {font-size:clamp(22px,2.1vw,33px)!important}
  #reportsView .history-summary h3 {
    margin:8px 0!important;font-size:17px!important;font-weight:900!important;color:#153b5d!important;
  }
  #reportsView .history-summary-chart {
    display:grid;grid-template-columns:repeat(7,minmax(0,1fr));
    gap:9px;min-height:140px;padding:12px;
    border:1px solid #e2eaf4;border-radius:13px;background:#fbfdff;
  }
  #reportsView .history-summary-empty {
    display:grid!important;place-items:center;
    min-height:clamp(170px,26dvh,285px);
    padding:24px!important;font-size:clamp(15px,1.25vw,19px)!important;
  }
  #reportsView #historyItems.history-items {
    flex:1 1 auto!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:16px 20px 24px!important;
    overflow-y:auto!important;overscroll-behavior:contain;
  }
  #reportsView:has(#historySummaryEmpty:not([hidden])) #historyItems {display:none!important}
  #reportsView:has(#historySummaryEmpty:not([hidden]))
  #historySummary.history-summary:not([hidden]) {flex:1 1 auto!important;align-content:start}
}
@media print {
  #saleView,#reportsView {display:none!important}
}


/* Desktop report navigation is a real page Back action; touch keeps its
   familiar close symbol instead of introducing a new mobile layout. */
.report-back-label{display:none}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #reportsView .report-close-symbol{display:none!important}
  #reportsView .report-back-label{display:inline!important}
  #reportsView .sheet-header .closebutton {
    display:inline-flex!important;justify-content:center;align-items:center!important;
    min-width:86px!important;width:auto!important;min-height:37px!important;
    padding:7px 13px!important;border-radius:9px!important;
    border:1px solid #7aa0c0!important;background:#244e70!important;
    color:#fff!important;font-size:13px!important;font-weight:850!important;
  }
}


/* v66 — compact, even mobile Sale controls.
   Visual-only: preserve the four approved payment methods, checked states,
   basket totals, discount/other-payment actions, and all desktop rules. */
@media (max-width:679px) {
  /* Three header actions share the available width and the same touch height.
     Narrow phones allow the header to wrap instead of overlapping the title. */
  #cartDialog.sale-sheet .sale-header-actions {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    flex:1 1 225px!important;
    min-width:210px!important;
    max-width:100%!important;
    margin-left:auto!important;
    align-items:stretch!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button {
    box-sizing:border-box!important;
    width:100%!important;min-width:0!important;
    height:40px!important;min-height:40px!important;
    max-height:40px!important;
    padding:3px 4px!important;
    border-radius:11px!important;
    justify-content:center!important;
    align-items:center!important;
    flex-wrap:wrap!important;
    gap:2px!important;
    line-height:1.08!important;
    text-align:center!important;
    white-space:normal!important;
    font-size:11px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions .sale-header-back,
  #cartDialog.sale-sheet .sale-header-actions .sale-header-close {
    font-size:16px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button span {
    font-size:10px!important;line-height:1.1!important;
    white-space:normal!important;
  }

  /* Empty-basket quick actions: three equal targets without wasted height. */
  #cartDialog.sale-sheet .sale-empty-actions {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    width:100%!important;
  }
  #cartDialog.sale-sheet .sale-empty-actions button {
    box-sizing:border-box!important;
    width:100%!important;min-width:0!important;
    min-height:45px!important;height:45px!important;
    padding:5px 3px!important;
    border-radius:11px!important;
    font-size:clamp(10px,2.55vw,12px)!important;
  }
  #cartDialog.sale-sheet .sale-empty-actions button span {
    font-size:18px!important;
  }

  /* Four payment choices: 6px gutters and exactly 68px tall, including
     Nakit/Kart labels and Sepet İndirimi/Diğer Ödeme buttons. */
  #cartDialog.sale-sheet .payment-types.checkout-shortcuts {
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:6px!important;
    align-items:stretch!important;
    padding:0!important;
    margin:7px 0 9px!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label {
    display:block!important;
    box-sizing:border-box!important;
    min-width:0!important;width:100%!important;
    margin:0!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut {
    box-sizing:border-box!important;
    display:flex!important;flex-direction:column!important;
    align-items:center!important;justify-content:center!important;
    width:100%!important;min-width:0!important;
    height:68px!important;min-height:68px!important;max-height:68px!important;
    padding:5px 3px!important;margin:0!important;
    gap:3px!important;
    border-radius:12px!important;
    text-align:center!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span b,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut b {
    font-size:21px!important;line-height:1!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span small,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut small {
    display:block!important;
    font-size:clamp(10px,2.5vw,11px)!important;
    font-weight:850!important;
    line-height:1.08!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    text-align:center!important;
  }
}
@media (max-width:359px) {
  #cartDialog.sale-sheet .sale-header-actions {
    flex:1 1 100%!important;
    width:100%!important;
    margin-left:0!important;
  }
}


/* v67 — Desktop stock table: real per-product replenishment and price editing.
   Existing home/category/Sale/Reports layouts and mobile navigation stay intact. */
.stock-overview .stock-overview-metric-link {
  display:inline-flex;align-items:center;justify-content:center;align-self:flex-start;
  margin-top:auto;padding:5px 9px;border:1px solid #e2c98a;border-radius:8px;
  background:#fff4d6;color:#8d5c13;font:inherit;font-size:12px;font-weight:850;cursor:pointer;
}
.stock-overview .stock-overview-edit-button {
  display:inline-flex;align-items:center;justify-content:center;
  min-height:36px;min-width:105px;padding:7px 10px;
  border:1px solid #a9d1ee;border-radius:9px;
  background:#e6f3ff;color:#155b95;font:inherit;font-size:12px;font-weight:850;
  white-space:nowrap;cursor:pointer;
}
.stock-overview .stock-status-editable {
  border:1px solid #dfc382;cursor:pointer;
  font:inherit;font-weight:850;font-size:12px;
  transition:filter .15s ease;
}
.stock-overview .stock-status-editable:hover,
.stock-overview .stock-overview-edit-button:hover {filter:brightness(.96)}
.stock-overview .stock-status-editable:focus-visible,
.stock-overview .stock-overview-edit-button:focus-visible,
.stock-overview .stock-overview-metric-link:focus-visible {
  outline:3px solid #187ad2;outline-offset:2px;
}
.stock-overview .stock-overview-table {min-width:880px}
.stock-overview .stock-overview-table td:last-child,
.stock-overview .stock-overview-table th:last-child {white-space:nowrap;text-align:center}
.stock-edit-dialog {
  box-sizing:border-box;width:min(94vw,485px);max-width:485px;
  max-height:min(90dvh,760px);padding:0;margin:auto;
  border:1px solid #d0e3ef;border-radius:18px;
  background:#fff;color:#163651;
  box-shadow:0 24px 65px #071d3659;overflow-y:auto;
}
.stock-edit-dialog::backdrop {background:#0b203b99}
.stock-edit-dialog form {display:grid;gap:13px;padding:21px}
.stock-edit-heading {display:flex;justify-content:space-between;gap:12px;align-items:flex-start}
.stock-edit-heading h2 {margin:0 0 6px;font-size:22px;font-weight:950;color:#133856}
.stock-edit-heading p {margin:0 0 3px;font-size:14px;font-weight:850}
.stock-edit-heading small {font-size:12px;color:#678199}
.stock-edit-heading button {
  width:38px;height:38px;flex:none;border:1px solid #cee0ec;
  border-radius:11px;color:#285676;background:#f2f8fe;font-size:25px;cursor:pointer;
}
.stock-edit-present {
  display:flex;flex-wrap:wrap;justify-content:space-between;gap:7px;
  margin:0;padding:12px 13px;background:#e9f6ee;border:1px solid #c7e6d3;
  border-radius:12px;font-size:13px;font-weight:750;color:#255b3e;
}
.stock-edit-present strong {font-size:17px;font-weight:950}
.stock-edit-field {display:grid;gap:6px;font-size:13px;font-weight:850;color:#2a5068}
.stock-edit-field input {
  box-sizing:border-box;width:100%;min-height:45px;
  border:1px solid #bad0e1;border-radius:10px;
  background:#fbfdff;color:#183951;padding:10px 12px;
  font:inherit;font-size:16px;
}
.stock-edit-field input:disabled {opacity:.65;background:#eef2f6}
.stock-edit-set99 {
  padding:11px 13px;min-height:43px;border:1px solid #9ebff2;
  border-radius:11px;background:#eff6ff;color:#145e9d;
  font:inherit;font-size:13px;font-weight:900;cursor:pointer;
}
.stock-edit-set99[aria-pressed="true"] {color:white;background:#216ac0;border-color:#216ac0}
.stock-edit-hint {font-size:12px;color:#607991;line-height:1.5;margin:0}
.stock-edit-message {font-size:12px;color:#a04424;min-height:16px;margin:0}
.stock-edit-actions {display:grid;grid-template-columns:1fr 1.2fr;gap:9px}
.stock-edit-actions button {min-height:44px;border-radius:11px;font:inherit;font-size:14px;font-weight:900;cursor:pointer}
.stock-edit-actions #stockEditCancel {border:1px solid #cedee9;background:#edf3f8;color:#294c68}
.stock-edit-actions #stockEditSave {border:0;background:#128257;color:#fff}
.stock-edit-actions #stockEditSave:disabled {opacity:.55;cursor:wait}
@media (prefers-reduced-motion:reduce) {
  .stock-overview .stock-status-editable {transition:none}
}


/* v68 — approved 3 across × 4 rows for the DESKTOP Products category
   landing only. Images/cards visibly larger; the existing Home dashboard,
   mobile/tablet categories and nested-category interactions do not change.
   The four rows scroll naturally on smaller desktop screens. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #productCategoryHome #homeCategoryShortcuts.category-photo-grid {
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    grid-template-rows:repeat(4,clamp(240px,22vw,315px))!important;
    grid-auto-rows:clamp(240px,22vw,315px)!important;
    gap:clamp(12px,1.1vw,20px)!important;
    width:100%!important;max-width:none!important;
    padding:0 0 12px!important;margin:0!important;
    align-items:stretch!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-tile {
    box-sizing:border-box!important;
    display:flex!important;flex-direction:column!important;
    width:100%!important;min-width:0!important;
    height:clamp(240px,22vw,315px)!important;
    min-height:240px!important;max-height:315px!important;
    padding:12px!important;gap:10px!important;
    border-radius:17px!important;
    justify-content:flex-start!important;
    box-shadow:0 5px 18px #122e4a16!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-image {
    box-sizing:border-box!important;
    flex:1 1 auto!important;min-height:0!important;
    width:100%!important;
    height:calc(100% - 43px)!important;
    max-height:none!important;aspect-ratio:auto!important;
    border-radius:13px!important;
    overflow:hidden!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-image img {
    position:absolute!important;inset:0!important;
    width:100%!important;height:100%!important;
    object-fit:contain!important;object-position:center!important;
    padding:0!important;background:transparent!important;
    transform:scale(1.30)!important;
    transform-origin:center!important;
  }
  #productCategoryHome #homeCategoryShortcuts .photo-category-name {
    display:block!important;flex:0 0 auto!important;
    width:100%!important;max-width:100%!important;
    min-height:36px!important;height:auto!important;
    padding:2px 4px!important;
    font-size:clamp(15px,1.22vw,19px)!important;
    font-weight:900!important;line-height:1.2!important;
    text-align:center!important;white-space:normal!important;
    overflow-wrap:anywhere!important;
  }
}


/* v70 — approved compact mobile Sale header only.
   Existing checkout, basket, product screens and desktop labels stay intact. */
.sale-sheet .sale-mobile-count,
.sale-sheet .sale-cancel-short {display:none}
@media (max-width:679px) {
  #cartDialog.sale-sheet .sale-heading-icon {display:none!important}
  #cartDialog.sale-sheet .sale-desktop-count {display:none!important}
  #cartDialog.sale-sheet .sale-mobile-count {display:inline!important}
  #cartDialog.sale-sheet .sale-cancel-long {display:none!important}
  #cartDialog.sale-sheet .sale-cancel-short {display:inline!important}
  #cartDialog.sale-sheet .sale-sheet-header {
    gap:3px!important;padding-left:6px!important;padding-right:6px!important;
  }
  #cartDialog.sale-sheet .sale-heading {
    flex:0 1 auto!important;gap:5px!important;white-space:nowrap!important;
  }
  #cartDialog.sale-sheet .sale-heading h2 {
    font-size:clamp(16px,4vw,19px)!important;
  }
  #cartDialog.sale-sheet .sale-count-pill {
    flex:0 0 auto!important;
    font-size:clamp(13px,3.5vw,15px)!important;
    font-weight:900!important;line-height:1.1!important;
    padding:7px 8px!important;white-space:nowrap!important;
  }
  #cartDialog.sale-sheet .sale-header-actions {
    flex:0 1 168px!important;min-width:0!important;
    max-width:calc(100% - 170px)!important;
    margin-left:auto!important;gap:4px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button {
    font-size:11px!important;padding:2px 2px!important;
    white-space:nowrap!important;flex-wrap:nowrap!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button span {
    font-size:10px!important;white-space:nowrap!important;
  }
}
@media (max-width:379px) {
  #cartDialog.sale-sheet .sale-sheet-header {
    flex-wrap:wrap!important;row-gap:6px!important;
  }
  #cartDialog.sale-sheet .sale-heading {
    flex:1 1 100%!important;
  }
  #cartDialog.sale-sheet .sale-header-actions {
    flex:1 1 100%!important;max-width:100%!important;
    width:100%!important;margin-left:0!important;
  }
}


/* v71 — approved framed mobile Sale design.
   Only the existing mobile sale dialog is styled: a soft blue outer frame,
   a separate framed basket area and a framed checkout area. All actions,
   totals, item cards and previously approved compact payment sizes remain. */
@media (max-width:679px) {
  #cartDialog.sale-sheet[open] {
    box-sizing:border-box!important;
    border:3px solid #90b9e9!important;
    border-radius:22px 22px 18px 18px!important;
    background:#f5f9ff!important;
    box-shadow:inset 0 0 0 1px #fff,0 5px 20px #1b52852b!important;
  }
  /* The border encloses the empty state or the current product list
     without replacing its scroll container or making the basket fixed. */
  #cartDialog.sale-sheet .cart-items {
    box-sizing:border-box!important;
    margin:8px 8px 7px!important;
    min-width:0!important;
    min-height:0!important;
    border:2px solid #96bbe9!important;
    border-radius:21px!important;
    padding:10px!important;
    background:linear-gradient(155deg,#f7faff 0%,#e7f1ff 100%)!important;
    box-shadow:inset 0 0 0 3px #ffffffbf,0 4px 13px #286bad1b!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }
  #cartDialog.sale-sheet .sale-empty-premium {
    box-sizing:border-box!important;
    min-height:100%!important;
    margin:0 auto!important;
    padding:12px 4px!important;
    gap:8px!important;
  }
  /* Keep the blue outline visible around the totals, four payment tiles
     and primary action, while preserving the original compact button height. */
  #cartDialog.sale-sheet .checkout-area {
    box-sizing:border-box!important;
    align-self:stretch!important;
    width:calc(100% - 16px)!important;
    margin:0 8px 8px!important;
    padding:11px 10px calc(12px + env(safe-area-inset-bottom))!important;
    border:2px solid #8eb8ec!important;
    border-radius:22px!important;
    background:linear-gradient(165deg,#fff 0%,#fafdff 100%)!important;
    box-shadow:inset 0 0 0 3px #eff6ff,0 4px 13px #286bad1f!important;
    overflow-y:auto!important;
    overscroll-behavior:contain;
  }
}


/* v72 — approved unified mobile Sale toolbar, replacing the cramped
   single-line header. Logo row + equal-height labeled controls; visually
   separate live variety/item counters. Basket and payment are unchanged. */
.mobile-sale-brand {display:none}
/* Set explicit desktop icon dimensions too; an SVG with no dimensions
   otherwise uses the browser's large intrinsic default size. */
.sale-sheet .sale-top-icon {display:inline-flex;align-items:center;justify-content:center;flex:none}
.sale-sheet .sale-top-icon svg {display:block;width:20px;height:20px}
@media (max-width:679px) {
  #cartDialog.sale-sheet .sale-sheet-header {
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) minmax(0,1.08fr)!important;
    grid-template-rows:auto auto!important;
    gap:10px 7px!important;
    align-items:stretch!important;
    justify-content:stretch!important;
    min-width:0!important;
    padding:8px 8px 12px!important;
    background:linear-gradient(115deg,#078b7b 0%,#057365 62%,#06534e 100%)!important;
  }
  #cartDialog.sale-sheet .mobile-sale-brand {
    display:flex!important;grid-column:1/-1;grid-row:1;
    align-items:center;justify-content:center;gap:7px;
    min-height:37px;color:#fff;white-space:nowrap;
  }
  #cartDialog.sale-sheet .mobile-sale-brand svg {
    width:34px;height:32px;flex:none;
  }
  #cartDialog.sale-sheet .mobile-sale-brand strong {
    font-size:clamp(21px,5.5vw,27px);font-style:italic;
    font-weight:950;letter-spacing:-.04em;line-height:1;
    text-shadow:0 1px 2px #064a4936;
  }
  #cartDialog.sale-sheet .sale-heading {
    grid-column:1;grid-row:2;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:clamp(43px,12.5vw,53px) minmax(0,1fr)!important;
    gap:5px!important;
    flex:none!important;align-items:stretch!important;
    width:100%!important;min-width:0!important;
    white-space:normal!important;
  }
  #cartDialog.sale-sheet .sale-heading-icon {display:none!important}
  #cartDialog.sale-sheet .sale-heading h2 {
    box-sizing:border-box!important;
    display:flex!important;flex-direction:column;
    align-items:center!important;justify-content:center!important;
    gap:2px!important;
    margin:0!important;padding:3px 0!important;
    min-width:0!important;width:100%!important;height:64px!important;
    border:1.5px solid #d9fff9!important;
    border-radius:13px!important;
    font-size:clamp(11px,3vw,13px)!important;
    font-weight:900!important;line-height:1.1!important;
    white-space:nowrap!important;color:white!important;
  }
  #cartDialog.sale-sheet .sale-heading h2::before {
    content:"▣";display:block;
    font-size:clamp(17px,4.7vw,21px);
    font-weight:800;line-height:1.1;
  }
  #cartDialog.sale-sheet .sale-count-pill {
    box-sizing:border-box!important;
    display:block!important;
    min-width:0!important;width:100%!important;height:64px!important;
    margin:0!important;padding:0!important;
    border-radius:13px!important;
    color:#102f4c!important;background:#eaf5ff!important;
    overflow:hidden!important;white-space:normal!important;
  }
  #cartDialog.sale-sheet .sale-desktop-count {display:none!important}
  #cartDialog.sale-sheet .sale-mobile-count {
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    width:100%!important;height:100%!important;min-width:0!important;
    align-items:stretch!important;
    font-size:clamp(9px,2.55vw,12px)!important;
    font-weight:900!important;line-height:1.1!important;
  }
  #cartDialog.sale-sheet .sale-mobile-count > span {
    display:flex;flex-direction:column;
    align-items:center;justify-content:center;
    min-width:0;gap:4px;padding:4px 1px;box-sizing:border-box;
    text-align:center;white-space:nowrap;
  }
  #cartDialog.sale-sheet .sale-mobile-count > span + span {
    border-left:1px solid #a6c5e0;
  }
  #cartDialog.sale-sheet .sale-mobile-count .sale-count-icon {
    display:block;font-size:18px;line-height:1;color:#1d5c91;
  }
  #cartDialog.sale-sheet .sale-mobile-count b {font:inherit}
  #cartDialog.sale-sheet .sale-header-actions {
    grid-column:2;grid-row:2;
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    align-items:stretch!important;
    gap:5px!important;
    width:100%!important;max-width:100%!important;min-width:0!important;
    height:64px!important;
    margin:0!important;padding:0!important;
    flex:none!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button {
    box-sizing:border-box!important;
    display:flex!important;flex-direction:column!important;
    align-items:center!important;justify-content:center!important;
    gap:2px!important;
    width:100%!important;min-width:0!important;
    height:64px!important;min-height:64px!important;max-height:64px!important;
    margin:0!important;padding:4px 2px!important;
    border:1.5px solid #e1fff9!important;
    border-radius:13px!important;
    color:#fff!important;
    background:#ffffff12!important;
    font-size:12px!important;line-height:1.1!important;
    white-space:nowrap!important;flex-wrap:nowrap!important;
  }
  #cartDialog.sale-sheet .sale-header-actions .sale-header-cancel {
    background:linear-gradient(135deg,#ed4258,#ba1731)!important;
    border-color:#ffced7!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-icon {
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;justify-content:center!important;
    height:25px!important;min-height:25px!important;
    font-size:clamp(22px,5.5vw,26px)!important;
    line-height:1!important;
    color:#fff!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-icon svg {
    display:block;width:23px;height:23px;
    color:inherit;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-text,
  #cartDialog.sale-sheet .sale-header-actions button .sale-cancel-short {
    display:block!important;
    font-size:clamp(11px,2.8vw,13px)!important;
    line-height:1.1!important;
    font-weight:900!important;white-space:nowrap!important;
    color:#fff!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-cancel-long {
    display:none!important;
  }
  #cartDialog.sale-sheet .sale-scanner {
    gap:6px!important;
    padding:9px 9px 11px!important;
  }
  #cartDialog.sale-sheet .sale-scanner input {
    box-sizing:border-box!important;
    flex:1 1 auto!important;
    width:0!important;min-width:0!important;
    height:58px!important;min-height:58px!important;
    padding-left:30px!important;
    font-size:clamp(11px,3vw,15px)!important;
  }
  #cartDialog.sale-sheet .sale-search-symbol {
    left:20px!important;font-size:22px!important;
  }
  #cartDialog.sale-sheet .sale-scanner .sale-manual-add,
  #cartDialog.sale-sheet .sale-scanner #saleScanButton {
    box-sizing:border-box!important;
    display:flex!important;flex-direction:column!important;
    justify-content:center!important;align-items:center!important;
    flex:0 0 clamp(60px,16.8vw,75px)!important;
    width:clamp(60px,16.8vw,75px)!important;
    min-width:0!important;
    height:58px!important;min-height:58px!important;max-height:58px!important;
    padding:3px 2px!important;gap:2px!important;
    border-radius:14px!important;
  }
  #cartDialog.sale-sheet .sale-scanner button b {
    font-size:clamp(22px,5.5vw,27px)!important;line-height:1!important;
  }
  #cartDialog.sale-sheet .sale-scanner button span {
    display:block!important;
    font-size:clamp(9px,2.4vw,11px)!important;
    font-weight:900!important;line-height:1.05!important;
    text-align:center!important;white-space:normal!important;
  }
}
@media (max-width:340px) {
  #cartDialog.sale-sheet .sale-sheet-header {padding:7px 5px 10px!important;gap:8px 4px!important}
  #cartDialog.sale-sheet .sale-heading {gap:3px!important}
  #cartDialog.sale-sheet .sale-header-actions {gap:3px!important}
  #cartDialog.sale-sheet .sale-mobile-count {font-size:9px!important}
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-text,
  #cartDialog.sale-sheet .sale-header-actions button .sale-cancel-short {
    font-size:10px!important;
  }
}


/* v73 — compact phone Sale: four visible standard cart products at typical
   mobile visual viewport heights. Keep the approved colors, borders and
   every sale/payment action. Only mobile #cartDialog is affected.
   Scrolling stays enabled for long names, discounts and smaller devices. */
@media (max-width:679px) {
  /* Remove the redundant logo row from the already branded application. */
  #cartDialog.sale-sheet .mobile-sale-brand {display:none!important}
  #cartDialog.sale-sheet .sale-sheet-header {
    display:grid!important;
    grid-template-columns:minmax(0,1.05fr) minmax(0,1fr)!important;
    grid-template-rows:56px!important;
    align-items:stretch!important;
    column-gap:6px!important;row-gap:0!important;
    min-height:0!important;height:auto!important;
    padding:6px 7px!important;
  }
  #cartDialog.sale-sheet .sale-heading {
    grid-column:1!important;grid-row:1!important;
    grid-template-columns:clamp(43px,12vw,49px) minmax(0,1fr)!important;
    gap:4px!important;min-width:0!important;
    align-self:stretch!important;
  }
  #cartDialog.sale-sheet .sale-heading h2,
  #cartDialog.sale-sheet .sale-count-pill {
    height:56px!important;min-height:56px!important;
  }
  #cartDialog.sale-sheet .sale-heading h2 {
    font-size:clamp(11px,3vw,12px)!important;
  }
  #cartDialog.sale-sheet .sale-heading h2::before {
    font-size:17px!important;
  }
  #cartDialog.sale-sheet .sale-mobile-count {
    font-size:clamp(9px,2.6vw,11px)!important;
  }
  #cartDialog.sale-sheet .sale-mobile-count > span {
    gap:2px!important;padding:3px 0!important;
  }
  #cartDialog.sale-sheet .sale-mobile-count .sale-count-icon {
    font-size:15px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions {
    grid-column:2!important;grid-row:1!important;
    height:56px!important;gap:4px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button {
    height:56px!important;min-height:56px!important;max-height:56px!important;
    gap:1px!important;padding:3px 1px!important;
    border-radius:12px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-icon {
    height:21px!important;min-height:21px!important;
    font-size:22px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-icon svg {
    width:20px!important;height:20px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions button .sale-top-text,
  #cartDialog.sale-sheet .sale-header-actions button .sale-cancel-short {
    font-size:clamp(10px,2.7vw,12px)!important;
  }

  /* Gain vertical space above the cart without removing scan labels. */
  #cartDialog.sale-sheet .sale-scanner {
    padding:6px 7px!important;gap:5px!important;
  }
  #cartDialog.sale-sheet .sale-scanner input {
    height:45px!important;min-height:45px!important;
    font-size:clamp(11px,2.9vw,14px)!important;
    padding-left:28px!important;
  }
  #cartDialog.sale-sheet .sale-search-symbol {
    left:17px!important;font-size:20px!important;
  }
  #cartDialog.sale-sheet .sale-scanner .sale-manual-add,
  #cartDialog.sale-sheet .sale-scanner #saleScanButton {
    flex-basis:clamp(57px,16.3vw,70px)!important;
    width:clamp(57px,16.3vw,70px)!important;
    height:45px!important;min-height:45px!important;max-height:45px!important;
    padding:2px 1px!important;gap:1px!important;
    border-radius:12px!important;
  }
  #cartDialog.sale-sheet .sale-scanner button b {
    font-size:21px!important;
  }
  #cartDialog.sale-sheet .sale-scanner button span {
    font-size:clamp(9px,2.35vw,10px)!important;
    line-height:1.05!important;
  }

  /* Keep four normal rows visible in a compact phone viewport by reducing needless padding.
     Expanded per-product details remain in document flow and can be scrolled. */
  #cartDialog.sale-sheet .cart-items {
    flex:1 1 auto!important;min-height:0!important;
    margin:4px 5px!important;padding:5px 6px!important;
    border-radius:17px!important;
    overflow-y:auto!important;overscroll-behavior:contain;
  }
  #cartDialog.sale-sheet .cart-line {
    box-sizing:border-box!important;
    display:grid!important;
    grid-template-columns:64px minmax(0,1fr)!important;
    gap:7px!important;
    min-height:82px!important;
    padding:5px 6px!important;
    margin:0 0 5px!important;
    border-radius:13px!important;
  }
  #cartDialog.sale-sheet .cart-line:last-child {margin-bottom:0!important}
  #cartDialog.sale-sheet .sale-cart-media {
    height:65px!important;min-height:0!important;
    border-radius:10px!important;
  }
  #cartDialog.sale-sheet .sale-cart-emoji {
    font-size:28px!important;
  }
  #cartDialog.sale-sheet .sale-product-row {
    gap:4px!important;
  }
  #cartDialog.sale-sheet .sale-product-row .cart-line-name {
    font-size:clamp(11px,3.0vw,12px)!important;
    line-height:1.16!important;
    -webkit-line-clamp:2;
  }
  #cartDialog.sale-sheet .sale-line-price {
    font-size:clamp(11px,2.9vw,13px)!important;
  }
  #cartDialog.sale-sheet .sale-line-actions {
    gap:4px!important;margin-top:4px!important;
  }
  #cartDialog.sale-sheet .sale-line-actions .stepper {
    flex:0 1 auto!important;
    width:clamp(96px,29vw,112px)!important;
    max-width:56%!important;
    height:34px!important;margin:0!important;
  }
  #cartDialog.sale-sheet .sale-line-actions .stepper button {
    min-width:29px!important;height:33px!important;
    flex-basis:31px!important;font-size:18px!important;
  }
  #cartDialog.sale-sheet .sale-line-actions .stepper input {
    font-size:13px!important;
  }
  #cartDialog.sale-sheet .sale-line-more>summary,
  #cartDialog.sale-sheet .sale-line-actions .remove-button {
    width:34px!important;height:34px!important;
    min-width:34px!important;font-size:21px!important;
  }
  #cartDialog.sale-sheet .sale-line-actions .sale-line-more {
    min-width:34px!important;
  }

  /* Reserve less vertical space for checkout and keep it scrollable if a
     customer/discount panel is expanded. Do not collapse those controls. */
  #cartDialog.sale-sheet .checkout-area {
    flex:0 0 auto!important;
    box-sizing:border-box!important;
    width:calc(100% - 10px)!important;
    max-height:min(190px,30dvh)!important;
    min-height:0!important;
    margin:0 5px 5px!important;
    padding:7px 8px calc(7px + env(safe-area-inset-bottom))!important;
    border-radius:17px!important;
    overflow-y:auto!important;
  }
  #cartDialog.sale-sheet .cart-totals {
    margin:0 0 4px!important;
    padding:0!important;
  }
  #cartDialog.sale-sheet .total-row.summary {
    font-size:12px!important;line-height:1.18!important;
  }
  #cartDialog.sale-sheet .total-row.grand {
    font-size:clamp(15px,4vw,18px)!important;
    margin:0 0 3px!important;gap:5px!important;
    line-height:1.12!important;
  }
  #cartDialog.sale-sheet .total-row.grand strong {
    font-size:clamp(20px,5.5vw,24px)!important;
    padding:3px 6px!important;
    border-radius:13px!important;
    line-height:1.12!important;
  }
  #cartDialog.sale-sheet .payment-types.checkout-shortcuts {
    gap:5px!important;margin:4px 0 5px!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut {
    height:50px!important;min-height:50px!important;max-height:50px!important;
    padding:3px 2px!important;gap:2px!important;
    border-radius:11px!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span b,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut b {
    font-size:17px!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts > label > span small,
  #cartDialog.sale-sheet .checkout-shortcuts > .payment-shortcut small {
    font-size:clamp(9px,2.5vw,10px)!important;line-height:1.03!important;
  }
  /* Short visual captions on idle payment tiles; JS text, accessible names,
     dynamic selected transfer type and applied discount remain unchanged. */
  #cartDialog.sale-sheet .checkout-shortcuts .payment-discount:not(.has-discount) #checkoutDiscountLabel,
  #cartDialog.sale-sheet .checkout-shortcuts .payment-other:not(.is-selected) #checkoutOtherLabel {
    font-size:0!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts .payment-discount:not(.has-discount) #checkoutDiscountLabel::after {
    content:"İndirim";font-size:10px!important;
  }
  #cartDialog.sale-sheet .checkout-shortcuts .payment-other:not(.is-selected) #checkoutOtherLabel::after {
    content:"Diğer";font-size:10px!important;
  }
  #cartDialog.sale-sheet #completeSale {
    box-sizing:border-box!important;
    min-height:45px!important;height:45px!important;
    margin-top:5px!important;padding:7px 9px!important;
    border-radius:13px!important;
    font-size:clamp(14px,4vw,17px)!important;
    line-height:1.1!important;
  }
}
@media (max-width:359px) {
  #cartDialog.sale-sheet .sale-sheet-header {
    padding:5px 4px!important;column-gap:4px!important;
  }
  #cartDialog.sale-sheet .sale-heading {
    grid-template-columns:39px minmax(0,1fr)!important;
    gap:3px!important;
  }
  #cartDialog.sale-sheet .sale-heading h2 {
    font-size:10px!important;
  }
  #cartDialog.sale-sheet .sale-header-actions {gap:3px!important}
}


/* v74 — Taslak 3 product picker: 4 main / 4 sub / 2 product cards.
   Only the Ürün Ekle modal is affected; the sale, cart and product data stay unchanged. */
#pickProductDialog.product-picker .picker-category-grid{
  display:grid!important;
  grid-template-columns:repeat(4,minmax(0,1fr))!important;
  gap:clamp(4px,1.4vw,9px)!important;
  align-content:start;
  max-height:min(54dvh,570px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
#pickProductDialog.product-picker .picker-category-tile{
  box-sizing:border-box;
  width:100%;min-width:0;min-height:125px;
  padding:8px 3px;gap:5px;
  display:flex;flex-direction:column;
  align-items:center;justify-content:flex-start;
  border-radius:13px;
}
#pickProductDialog.product-picker .picker-category-tile img{
  box-sizing:border-box;
  display:block;
  width:100%;max-width:85px;height:64px;
  object-fit:contain;flex:none;
}
#pickProductDialog.product-picker .picker-category-tile strong{
  display:block;min-width:0;width:100%;
  font-size:clamp(10px,2.65vw,13px);font-weight:850;
  line-height:1.15;overflow-wrap:anywhere;
  text-align:center;
}
#pickProductDialog.product-picker .picker-category-tile small{
  display:block;min-width:0;width:100%;
  font-size:clamp(9px,2.35vw,11px);line-height:1.1;
  text-align:center;margin-top:auto;
}
#pickProductDialog.product-picker #pickProductResults.picker-results{
  display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-content:start;
  gap:10px;
  padding:8px 12px 14px;
  max-height:min(56dvh,600px);
  overflow-y:auto;
  overscroll-behavior:contain;
}
#pickProductDialog.product-picker #pickProductResults.picker-results:empty{
  display:none!important;
}
#pickProductDialog.product-picker .picker-product{
  box-sizing:border-box;
  width:100%;min-width:0;min-height:210px;
  display:flex!important;flex-direction:column;
  align-items:center;justify-content:flex-start;
  gap:6px;padding:10px 7px;
  background:#fff;color:#122c43;
  border:1px solid #dce6ef;border-radius:14px;
  text-align:center;
}
#pickProductDialog.product-picker .picker-product img{
  display:block;flex:none;
  width:100%;max-width:118px;height:94px;
  border-radius:10px;object-fit:contain;
}
#pickProductDialog.product-picker .picker-product .picker-emoji{
  display:flex;flex:0 0 auto;
  width:100%;height:94px;
  align-items:center;justify-content:center;
  font-size:48px;line-height:1;
}
#pickProductDialog.product-picker .picker-product span:not(.picker-emoji){
  display:-webkit-box;flex:0 0 auto;
  -webkit-box-orient:vertical;-webkit-line-clamp:3;
  overflow:hidden;min-width:0;width:100%;
  min-height:30px;
  font-size:clamp(11px,2.85vw,13px);line-height:1.16;
  font-weight:800;text-align:center;overflow-wrap:anywhere;
}
#pickProductDialog.product-picker .picker-product strong{
  display:block;flex:0 0 auto;
  font-size:clamp(13px,3.4vw,16px);
  color:#167451;font-weight:900;
  white-space:normal;text-align:center;
}
#pickProductDialog.product-picker .picker-product::after{
  content:"+ Ekle";
  display:block;flex:none;
  margin-top:auto;
  padding:7px 15px;
  border-radius:9px;background:#079b5c;color:white;
  font-size:12px;font-weight:900;line-height:1.2;
}
#pickProductDialog.product-picker .picker-product:focus-visible,
#pickProductDialog.product-picker .picker-category-tile:focus-visible{
  outline:3px solid #2588f3;outline-offset:2px;
}
@media(max-width:359px){
  #pickProductDialog.product-picker .picker-category-tile{min-height:113px;padding:6px 2px}
  #pickProductDialog.product-picker .picker-category-tile img{height:53px}
  #pickProductDialog.product-picker .picker-product{min-height:188px}
  #pickProductDialog.product-picker .picker-product img,
  #pickProductDialog.product-picker .picker-product .picker-emoji{height:75px}
}


/* v74 — focused account / logout flow. Keeps every dashboard, Settings,
   category, sale, stock, report and navigation layout unchanged. */
#app .clean-topbar .access-identity-actions.has-session #accessIdentity:not([hidden]) {
  display:none!important;
}
#app .clean-topbar .access-identity-actions.has-session {
  position:relative;
  flex-wrap:nowrap;
  z-index:25;
}
#app .clean-topbar #accessLogout:not([hidden]) {
  min-height:42px;
  border:1px solid #bdcfe2;
  border-radius:11px;
  background:#f6faff;
  color:#183955;
  font-size:13px;
  font-weight:900;
  padding:8px 12px;
  white-space:nowrap;
}
#app .clean-topbar #accessLogout[aria-expanded="true"] {
  background:#e4f1ff!important;
  border-color:#71ade5!important;
}
#app .access-account-menu[hidden] {display:none!important}
#app .access-account-menu {
  box-sizing:border-box;
  position:absolute;
  top:calc(100% + 10px);
  right:0;
  width:min(304px,calc(100vw - 24px));
  min-width:0;
  z-index:50;
  display:grid;
  gap:13px;
  padding:19px;
  border:1px solid #d5e4f0;
  border-radius:19px;
  background:#fff;
  color:#132f4d;
  box-shadow:0 14px 40px #0b254b44;
  text-align:left;
}
#app .access-account-menu::before {
  content:"";position:absolute;
  top:-8px;right:29px;
  width:14px;height:14px;
  transform:rotate(45deg);
  background:#fff;
  border-left:1px solid #d5e4f0;border-top:1px solid #d5e4f0;
}
#app .access-account-person {
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  padding-bottom:15px;
  border-bottom:1px solid #dce7f2;
}
#app .access-account-avatar {
  display:grid;place-items:center;
  width:49px;height:49px;flex:0 0 49px;
  border-radius:13px;
  color:#1c5986;background:#dcedff;
}
#app .access-account-avatar svg {width:29px;height:29px}
#app .access-account-person>div {display:grid;gap:3px;min-width:0}
#app .access-account-person strong {
  color:#142f4e;font-size:17px;font-weight:900;line-height:1.16;
}
#app .access-account-person #accessMenuUsername {
  font-size:14px;color:#5e7390;
  overflow-wrap:anywhere;
}
#app .access-account-logout-action {
  box-sizing:border-box;
  display:flex;align-items:center;gap:11px;
  width:100%;min-height:46px;
  margin:0;padding:7px 8px;
  background:#fff;
  border:0;border-radius:10px;
  color:#193754;font-weight:900;font-size:16px;
  text-align:left;cursor:pointer;
}
#app .access-account-logout-action:hover,
#app .access-account-logout-action:focus-visible {
  background:#fff0f2;
}
#app .access-account-logout-action>span {
  font-size:26px;line-height:1;color:#d52343;
}
.access-logout-confirm {
  box-sizing:border-box;
  position:fixed;
  top:0;left:0;right:0;bottom:0;
  margin:auto;
  width:min(92vw,430px);
  max-width:430px;max-height:min(85dvh,560px);
  padding:24px 22px 22px;
  border:1px solid #d9e5ef;border-radius:22px;
  background:#fff;color:#122c4d;
  box-shadow:0 22px 70px #091e3d66;
  text-align:center;
  overflow-y:auto;
}
.access-logout-confirm::backdrop {background:#0c203b99;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px)}
.access-logout-confirm .access-logout-confirm-icon {
  display:grid;place-items:center;
  margin:0 auto 12px;
  width:65px;height:65px;
  border-radius:19px;background:#ffebed;color:#cf2748;
  font-size:40px;font-weight:900;line-height:1;
}
.access-logout-confirm h2 {
  margin:0 0 8px;
  font-size:clamp(20px,5.5vw,25px);
  font-weight:950;line-height:1.24;
}
.access-logout-confirm p {
  margin:0;color:#597089;font-size:14px;line-height:1.5;
}
.access-logout-confirm #accessLogoutError {
  min-height:0;
  margin:7px 0 0;
  color:#ad263c;
  font-weight:750;
}
.access-logout-confirm #accessLogoutError:empty {display:none}
.access-logout-confirm-actions {
  display:grid;
  grid-template-columns:1fr 1fr;gap:11px;
  margin-top:22px;
}
.access-logout-confirm-actions button {
  min-width:0;min-height:47px;
  padding:10px 7px;
  border:0;border-radius:13px;
  font:inherit;font-size:15px;font-weight:900;
  cursor:pointer;
}
.access-logout-confirm-actions #accessLogoutCancel {
  background:#e8edf4;color:#19354e;
}
.access-logout-confirm-actions #accessLogoutApprove {
  background:#db2844;color:#fff;
}
.access-logout-confirm-actions button:disabled {opacity:.55;cursor:wait}
@media (max-width:430px) {
  /* Only the account/header row needs to fit the narrow phone viewport. */
  #app .clean-topbar .brandline {gap:6px}
  #app .clean-topbar .brand-home {min-width:0;gap:5px}
  #app .clean-topbar .brandmark {
    width:clamp(31px,9vw,36px);height:clamp(31px,9vw,36px);
    min-width:clamp(31px,9vw,36px);padding:3px;
  }
  #app .clean-topbar .brandline strong {font-size:clamp(14px,4vw,17px)}
  #app .clean-topbar .brandline small {font-size:clamp(6px,1.8vw,9px);letter-spacing:.65px}
  #app .clean-topbar #connectionStatus {
    flex:0 0 auto;
    padding:5px 7px;
    margin-left:auto;
    font-size:clamp(9px,2.6vw,11px);
  }
  #app .clean-topbar .access-identity-actions {flex:0 0 auto}
  #app .clean-topbar #accessLogout:not([hidden]) {
    min-width:60px;min-height:39px;
    font-size:12px;padding:6px 8px;
  }
  #app .access-account-menu {width:min(294px,calc(100vw - 22px));padding:16px}
  .access-logout-confirm {padding:21px 17px 19px}
}
@media (prefers-reduced-motion:reduce) {
  .access-logout-confirm::backdrop {backdrop-filter:none;-webkit-backdrop-filter:none}
}


/* v75 — compact mobile navigation and single-line home totals.
   Keep touch targets usable, leave room to scroll content above the fixed bar,
   and prevent currency values from splitting into two rows on narrow phones. */
@media (max-width:679px) {
  #app .bottom-shell {
    padding:5px 8px calc(5px + env(safe-area-inset-bottom));
  }
  #app .bottom-shell .bottom-nav {
    gap:6px;
    margin-top:0;
  }
  #app .bottom-shell .bottom-nav .nav-item,
  #app .bottom-shell .bottom-nav .nav-item.active,
  #app .bottom-shell .bottom-nav .nav-sale,
  #app .bottom-shell .bottom-nav .nav-sale.active {
    height:54px;
    min-height:54px;
    max-height:54px;
    padding:4px 2px 3px;
    gap:1px;
    border-radius:13px;
  }
  #app .bottom-shell .bottom-nav .nav-glyph {
    width:25px;
    height:24px;
  }
  #app .bottom-shell .bottom-nav .nav-item .nav-glyph svg,
  #app .bottom-shell .bottom-nav .nav-sale .nav-glyph svg {
    width:21px;
    height:21px;
  }
  #app .bottom-shell .bottom-nav .nav-item small,
  #app .bottom-shell .bottom-nav .nav-sale small {
    font-size:clamp(9px,2.45vw,11px);
  }
  #app .clean-content {
    padding-bottom:calc(130px + env(safe-area-inset-bottom));
  }

  /* Approved two-card mobile summary: no icons, equal-width side-by-side
     cards, values and captions kept on a single readable line. */
  #homeView .dashboard-metrics {
    grid-template-columns:repeat(2,minmax(0,1fr));
    align-items:stretch;
    gap:clamp(7px,2vw,12px);
  }
  #homeView .dashboard-metric {
    position:relative;
    display:flex;
    align-items:center;
    width:100%;
    min-width:0;
    min-height:110px;
    padding:clamp(10px,2.7vw,14px);
    gap:0;
    overflow:hidden;
    border-radius:clamp(14px,3.7vw,20px);
  }
  #homeView .dashboard-metric-body {
    display:flex;
    flex:1 1 auto;
    flex-direction:column;
    justify-content:center;
    gap:5px;
    width:100%;
    min-width:0;
    padding-right:12px;
  }
  #homeView .dashboard-metric-body>span {
    min-width:0;
    padding-right:0;
    font-size:clamp(11px,3.25vw,16px);
    line-height:1.18;
    white-space:nowrap;
  }
  #homeView .dashboard-metric-body>strong {
    display:block;
    width:100%;
    min-width:0;
    font-size:clamp(15px,5vw,24px);
    font-weight:950;
    line-height:1.18;
    letter-spacing:-.04em;
    font-variant-numeric:tabular-nums;
    white-space:nowrap;
    overflow-wrap:normal;
    overflow:visible;
  }
  #homeView .dashboard-metric-products .dashboard-metric-body>strong {
    font-size:clamp(17px,5vw,26px);
  }
  #homeView .dashboard-metric-body>small {
    min-width:0;
    font-size:clamp(9px,2.45vw,11px);
    line-height:1.18;
    white-space:nowrap;
  }
  #homeView .dashboard-metric-arrow {
    position:absolute;
    top:50%;
    right:8px;
    display:block;
    transform:translateY(-50%);
    font-size:clamp(18px,4.2vw,23px);
    line-height:1;
  }
}


/* v79 — desktop payment-stack continue button.
   Relocate the ORIGINAL live cart action under Other Payment; mobile retains
   its existing bottom bar. Exact 58px geometry matches the checkout controls. */
.desktop-continue-slot{display:none}
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #saleView .desktop-continue-slot{
    display:block;
    width:100%;
    min-width:0;
    flex:0 0 auto;
    margin:-1px 0 0;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary{
    display:grid;
    grid-template-columns:minmax(0,1fr) auto 13px;
    align-items:center;
    column-gap:7px;
    width:100%!important;
    max-width:none!important;
    height:58px!important;
    min-height:58px!important;
    max-height:58px!important;
    margin:0!important;
    padding:7px 12px!important;
    border:0;
    border-radius:12px!important;
    color:#fff;
    background:linear-gradient(112deg,#198cf0,#0862dc)!important;
    box-shadow:0 3px 10px #0c5cbe22;
    pointer-events:auto;
    text-align:left;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .cart-icon{
    display:none!important;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .cart-label{
    min-width:0;
    margin:0;
    gap:2px;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .cart-label strong{
    font-size:clamp(12px,.98vw,15px);
    line-height:1.1;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .cart-label small{
    font-size:10px;
    line-height:1.15;
    white-space:nowrap;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .cart-total{
    margin-left:0;
    font-size:clamp(12px,.98vw,17px);
    font-weight:900;
    white-space:nowrap;
    font-variant-numeric:tabular-nums;
    letter-spacing:-.04em;
  }
  #saleView .desktop-continue-slot > #openCart.cart-summary .chevron{
    justify-self:end;
    font-size:20px;
    line-height:1;
  }
}


/* Central Sales Reports v81 — read-only filters & matching payment summaries.
   Same controls move between desktop #reportsView and mobile #historyDialog. */
.history-filters{
  display:grid;gap:11px;padding:15px 18px;
  background:#f7faff;border-bottom:1px solid #e0e8f2;color:#203b56;
}
.history-filters-heading{font-size:14px;font-weight:900;color:#143656}
.history-filters label{display:grid;gap:5px;min-width:0;color:#61758b;font-size:12px;font-weight:800}
.history-filters input,.history-filters select{
  box-sizing:border-box;width:100%;min-width:0;min-height:42px;padding:9px 10px;
  border:1px solid #cbd9e9;border-radius:10px;background:#fff;color:#19354d;
  font:inherit;font-size:14px;font-weight:650;
}
.history-filter-dates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.history-filter-presets{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.history-filter-presets button{
  min-width:0;min-height:39px;border:1px solid #cbd9e9;border-radius:10px;
  background:#ecf2fa;color:#27415d;font-size:13px;font-weight:800;
}
.history-filter-presets button.is-active,.history-filter-presets button[aria-pressed="true"]{
  border-color:#1760c9;background:#d8e9ff;color:#0d4da7;
}
.history-filter-primary{display:grid;grid-template-columns:1fr minmax(180px,1.7fr) 1fr;gap:10px}
.history-filter-more{font-size:12px;color:#385777;font-weight:800}
.history-filter-more summary{cursor:pointer;padding:5px 0}
.history-filter-amounts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding-top:8px}
.history-filter-actions{display:grid;grid-template-columns:minmax(0,2fr) minmax(100px,1fr);gap:10px}
.history-filter-actions button{min-height:43px;border-radius:10px;font-size:14px;font-weight:900}
.history-filter-apply{background:#195dcc;color:#fff;border:1px solid #195dcc}
.history-filter-reset{background:#fff;color:#435f79;border:1px solid #cbd9e9}
.history-payment-summary{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;
}
.history-payment-summary>div{
  display:flex;flex-direction:column;gap:5px;min-width:0;padding:11px 14px;
  border:1px solid #e0e8f1;border-radius:11px;background:#f8fbff;
}
.history-payment-summary span{font-size:11px;font-weight:850;color:#55718d}
.history-payment-summary strong{font-size:clamp(16px,1.7vw,25px);font-weight:950;color:#133857;overflow-wrap:anywhere}
.history-payment-summary>div:first-child{background:#f0fbf5}
.history-payment-summary>div:nth-child(3){background:#fff8eb}
.history-list-title{font-weight:950;font-size:17px;color:#163958;margin-right:auto}
#historyDialog .history-summary:not([hidden]){
  display:grid!important;gap:11px;padding:12px 16px!important;margin:0!important;
}
#historyDialog .history-summary-metrics{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;
}
#historyDialog .history-summary-metrics>div{
  min-width:0;padding:11px;border:1px solid #dce7f2;border-radius:11px;
  background:#f0f7ff;
}
#historyDialog .history-summary-metrics span{display:block;font-size:10px;font-weight:800;color:#607994}
#historyDialog .history-summary-metrics strong{display:block;font-size:clamp(16px,4vw,23px);font-weight:950;color:#133857;overflow-wrap:anywhere}
#historyDialog .history-summary-chart{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
#historyDialog .history-summary-day{min-width:0;display:grid;grid-template-rows:auto 65px auto;gap:4px;text-align:center}
#historyDialog .history-summary-track{height:65px}
#historyDialog .history-summary-value{font-size:9px}
#historyDialog .history-summary h3{font-size:14px;margin:4px 0;color:#163958}
#historyDialog .history-summary-empty{padding:20px;text-align:center;color:#627a91;font-size:13px}
#reportsView .history-summary-empty[hidden], #historyDialog .history-summary-empty[hidden]{display:none!important}
#reportsView .history-summary-metrics>div,#reportsView .history-payment-summary>div{min-width:0}
#reportsView .history-summary-metrics>div strong{overflow-wrap:anywhere}
#reportsView .history-actions{gap:10px!important}
#reportsView #historyItems.history-items{flex:1 1 auto!important}
@media(max-width:700px){
  #historyDialog.sheet{max-height:94dvh;overflow-y:auto}
  #historyDialog .history-filters{padding:13px 14px}
  #historyDialog .history-filter-primary{grid-template-columns:repeat(2,minmax(0,1fr))}
  #historyDialog .history-filter-primary label:nth-child(2){grid-column:1/-1;grid-row:1}
  #historyDialog .history-payment-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  #historyDialog .history-summary-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
  #historyDialog .history-summary-metrics>div:first-child{grid-column:1/-1}
  #historyDialog .history-actions{gap:9px;flex-wrap:wrap}
  #historyDialog .history-list-title{width:100%}
  #historyDialog .history-items{max-height:none;overflow:visible}
}
@media(min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine){
  #reportsView .history-filter-primary{grid-template-columns:minmax(140px,1fr) minmax(220px,2fr) minmax(140px,1fr)}
  #reportsView .history-filters{flex:0 0 auto!important;padding:13px 20px}
  #reportsView #historySummary.history-summary:not([hidden]){gap:10px!important;padding:13px 20px!important}
  #reportsView .history-summary-chart{min-height:112px!important}
}

/* v82: Stock is not a cashier sale prerequisite. Keep legacy stock tools in the DOM
 * for compatibility, but hide stock queries/filters from everyday POS screens. */
#homeQuickStock[hidden], #homeStockInsight[hidden], #sidebarStock[hidden],
#onlyInStock[hidden] { display: none !important; }

/* Auditable central test receipt cancellation (v83). */
.history-card-voided { border: 1px dashed #b6becb !important; background: #f4f6f9 !important; }
.history-card-voided .history-head > span:first-child { text-decoration: line-through; color: #697281; }
.history-voided-note { color: #8c3940; font-weight: 700; margin: 9px 0 0; }
.history-void-button { display: inline-flex; align-items: center; margin: 10px 0 0; padding: 8px 12px; border: 1px solid #bc6670; border-radius: 8px; color: #8e2b39; background: #fff; cursor: pointer; font-weight: 650; }
.history-void-button:disabled { opacity: .55; cursor: wait; }

/* v84: Full sale cancellation requires explicit reason and a second confirmation. */
.sale-void-dialog { box-sizing:border-box; width:min(440px,calc(100vw - 32px)); max-width:100%; padding:24px; border:1px solid #d6dce5; border-radius:16px; color:#14243b; background:white; box-shadow:0 16px 50px #14243b44; }
.sale-void-dialog::backdrop { background:#081a34a6; }
.sale-void-dialog h2 { margin:0 0 12px; font-size:21px; }
.sale-void-info { font-weight:750; font-size:17px; margin:8px 0 16px; }
.sale-void-field { display:flex; flex-direction:column; gap:7px; font-weight:650; }
.sale-void-field select { width:100%; height:45px; padding:0 10px; background:white; border:1px solid #bdc7d5; border-radius:9px; font-size:16px; }
.sale-void-warning { color:#7a4a17; background:#fff8ed; border-radius:9px; padding:12px; margin:14px 0; line-height:1.45; }
.sale-void-error { color:#ae2435; font-weight:700; line-height:1.4; }
.sale-void-error:empty { display:none; }
.sale-void-actions { display:flex; gap:10px; justify-content:flex-end; }
.sale-void-actions button { flex:1; min-height:43px; padding:8px; border-radius:9px; font-weight:750; border:1px solid #bbc4ce; background:#fff; cursor:pointer; }
#saleVoidConfirm { border-color:#b53143; background:#b53143; color:#fff; }
.sale-void-actions button:disabled { cursor:wait; opacity:.6; }

/* v102 — PC Products root only: fit all 12 cards in 4 columns × 3 rows.
   Preserve existing images, labels, category actions and all touch layouts.
   Reserve vertical room for the existing top bar, padding and quick actions;
   do not hide overflow, so expanded subcategories remain reachable. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #catalogView #productCategoryHome #homeCategoryShortcuts.category-photo-grid {
    --root-gap-v102:clamp(8px,1vw,16px);
    --root-row-v102:calc((100dvh - 182px - 2 * var(--root-gap-v102)) / 3);
    display:grid!important;
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:repeat(3,minmax(0,var(--root-row-v102)))!important;
    grid-auto-rows:var(--root-row-v102)!important;
    gap:var(--root-gap-v102)!important;
    padding:0!important;
    margin:0!important;
    align-items:stretch!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-tile {
    height:var(--root-row-v102)!important;
    min-height:0!important;max-height:none!important;
    padding:clamp(5px,.65vw,10px)!important;
    gap:4px!important;
    border-radius:14px!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-image {
    flex:1 1 0!important;height:auto!important;
    min-height:0!important;max-height:none!important;
    aspect-ratio:auto!important;
    background:#fff!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-image img {
    object-fit:contain!important;
    transform:none!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-name {
    min-height:0!important;
    padding:2px 1px!important;
    font-size:clamp(11px,1.02vw,17px)!important;
    line-height:1.15!important;
  }
}

/* v103 — PC Products root only: enlarge existing art and category labels.
   Keep v102 grid geometry, card dimensions, ordering and all other screens. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-image img {
    object-fit:contain!important;
    object-position:center!important;
    transform:scale(1.55)!important;
    transform-origin:center!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-name {
    font-size:clamp(15px,1.55vw,25px)!important;
    font-weight:900!important;
    line-height:1.12!important;
    padding:2px 1px!important;
    min-height:0!important;
    white-space:normal!important;
    overflow-wrap:break-word!important;
  }
}

/* v104 — approved PC-only root labels + navigable category paths.
   Do not change 4x3 geometry, photos, product cards or mobile layout. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-tile {
    gap:0!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-image {
    flex:1 1 0!important;
    min-height:0!important;
  }
  #catalogView #productCategoryHome #homeCategoryShortcuts .photo-category-name {
    display:block!important;
    flex:0 0 auto!important;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    -webkit-line-clamp:unset!important;
    font-size:clamp(14px,1.42vw,23px)!important;
    line-height:1.12!important;
    padding:0 1px 2px!important;
    margin:0!important;
    white-space:normal!important;
  }
  #catalogView #browseHeading,#catalogView #categoryTrailName {
    display:flex!important;align-items:center;gap:5px;
    min-width:0;overflow-x:auto!important;white-space:nowrap!important;
    scrollbar-width:none;
  }
  #catalogView #browseHeading .catalog-breadcrumb-button,
  #catalogView #categoryTrailName .catalog-breadcrumb-button {
    border:0;background:transparent;font:inherit;font-weight:850;
    color:#14689d;cursor:pointer;padding:4px 3px;flex:0 0 auto;
    max-width:none!important;min-height:32px;text-decoration:underline;
    text-underline-offset:3px;
  }
  #catalogView #browseHeading .catalog-breadcrumb-button[aria-current="page"],
  #catalogView #categoryTrailName .catalog-breadcrumb-button[aria-current="page"] {
    color:#19384d;text-decoration:none;
  }
  #catalogView .catalog-breadcrumb-separator {color:#93a4b2;flex:0 0 auto}
}
@media print {
  #receiptPrint[data-paper-mm="80"] {padding:1mm 0!important;}
}

/* v105: dedicated desktop subcategory page, not an inline root expansion.
   Existing root grid, photos, product cards and mobile styles are preserved. */
@media (min-width:1024px) and (min-height:600px) and (orientation:landscape) and (hover:hover) and (pointer:fine) {
  #catalogView #catalogCategoryNavigator #categoryTree.category-grid-page {
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-template-rows:none!important;
    grid-auto-rows:clamp(125px,21dvh,230px)!important;
    gap:clamp(8px,1vw,16px)!important;
    align-items:stretch!important;
    padding:0 0 10px!important;
  }
  #catalogView #catalogCategoryNavigator #categoryTree .photo-category-tile {
    height:100%!important;min-height:0!important;max-height:none!important;
    padding:8px!important;gap:3px!important;
  }
  #catalogView #catalogCategoryNavigator #categoryTree .photo-category-image {
    flex:1 1 0!important;height:auto!important;min-height:0!important;
    max-height:none!important;aspect-ratio:auto!important;
  }
  #catalogView #catalogCategoryNavigator #categoryTree .photo-category-image img {
    object-fit:contain!important;transform:none!important;padding:0!important;
  }
  #catalogView #catalogCategoryNavigator #categoryTree .photo-category-name {
    flex:0 0 auto!important;min-height:0!important;max-height:none!important;height:auto!important;
    overflow:visible!important;-webkit-line-clamp:unset!important;
    font-size:clamp(13px,1.15vw,19px)!important;line-height:1.15!important;
    padding:0 2px 2px!important;
  }
}


/* Keep the mobile product picker aligned when switching tabs. */
@media (max-width: 679px) {
  #pickProductDialog.product-picker[open] {
    box-sizing: border-box;
    height: 90dvh;
  }
}
