/* POS 0.7.1: bounded workspaces, editable order content and touch layouts. */
html,body{min-width:0;width:100%;-webkit-text-size-adjust:100%}
#shell,main,#cashier-view,.cashier-layout,.check,.check-content,.heading>div{min-width:0;max-width:100%}
header{flex-wrap:wrap}header>div:first-child{flex:0 1 auto;min-width:0}.header-actions{flex:1 1 320px;flex-wrap:wrap;max-width:100%}
#shell>nav{max-width:100%;overscroll-behavior-x:contain}#shell>nav #sync{flex-shrink:0}
#cashier-view>.heading{height:auto;min-height:44px;align-self:start;flex-wrap:wrap}
#cashier-view{grid-template-rows:auto minmax(0,1fr)}.heading h1{overflow-wrap:anywhere}.heading>div{flex-wrap:wrap}
.check-content{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;touch-action:pan-y}
.check-content .lines{overflow:visible;min-height:80px}.check-content .lines-head{position:sticky;top:0;z-index:1}
#captain-requests{margin:12px;padding:14px;min-width:0;max-width:100%;text-align:start;direction:inherit}
html[dir=rtl] #captain-requests{direction:rtl}
#captain-requests h3{font-size:16px;line-height:1.5}#captain-requests p{line-height:1.5}
.captain-request-line{grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:14px 0;min-width:0}
.captain-request-line>strong{grid-column:1;grid-row:1;min-width:0;overflow-wrap:anywhere;font-size:14px;line-height:1.5}
.captain-request-line>span{grid-column:2;grid-row:1;font-size:13px;align-self:start}
.captain-request-line>label{grid-column:1/-1;min-width:0;display:grid;grid-template-columns:80px minmax(0,1fr);margin:0;font-size:13px}
.captain-request-line>small{grid-column:1/-1;grid-row:auto;overflow-wrap:anywhere}
.captain-request-line input[data-captain-remark]{width:100%;max-width:none;min-width:0}
.captain-request-line input[type=number]{width:96px;max-width:100%;font-size:16px}
.captain-request-line>label:last-child{display:flex;gap:8px;min-height:44px;justify-content:flex-start;color:var(--danger)}
.captain-request-line input[type=checkbox]{flex:none;margin:0}
#captain-confirm{min-height:48px;white-space:normal}
.check-heading{flex-wrap:wrap}.check-heading h2{min-width:0}.line-name{min-width:0}
#wf-actions,.order-actions{grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
#wf-actions button,.order-actions button{white-space:normal;overflow-wrap:anywhere;min-height:44px}
#rq-view{width:100%;min-width:0}.rq-card-head>*,.rq-files>div>*,#rm-content article>*{min-width:0}
.rq-card-total{gap:12px;flex-wrap:wrap}.rq-files>div{grid-template-columns:minmax(0,1fr) auto}
.wf-page .check-heading{gap:8px}.wf-page .check-heading h2{overflow-wrap:anywhere}
.wf-page input,.wf-page select,.wf-page textarea{min-width:0}
.wf-page-actions label{flex-wrap:wrap;min-width:0}#rm-sales>*{min-width:0}
#rm-content article>div:first-child{min-width:0}.wf-page td{overflow-wrap:anywhere}
@media(min-width:720px) and (max-width:1100px){
 .products{grid-template-columns:repeat(2,minmax(0,1fr))}
 .lines-head,.line{grid-template-columns:minmax(0,1fr) 104px 70px;gap:4px}
 .line-qty{gap:0}.line-qty button{min-width:36px;width:36px}.qty-value{min-width:26px}
 .header-actions{flex-basis:300px}#account-name{width:auto}
}
@media(max-width:719px){
 body[data-view=cashier] #shell:not([hidden]){height:auto;min-height:100dvh;overflow:visible}
 body[data-view=cashier] main{display:block;overflow:visible;padding:10px}
 header{padding:10px 12px;gap:8px;align-items:center}header>div:first-child{padding:0;flex:1 1 120px}
 .header-actions{flex:1 1 185px;max-width:100%;gap:6px}#account-name{width:100%;font-size:11px}
 #workspace-title{max-width:none;font-size:16px}.brand{letter-spacing:2px;font-size:10px}.brand .brand-logo{width:18px;height:29px;margin-inline-end:6px}
 .header-actions button{min-height:44px}#shift-label{max-width:none}#shell>nav{padding:6px 10px}#shell>nav button{min-height:44px}
 #cashier-view,body[data-role=captain] #cashier-view{display:flex;flex-direction:column;gap:10px}
 #cashier-view>.heading{width:100%;gap:8px}.heading h1{font-size:18px}.heading button{min-height:44px}.heading>div{gap:6px}
 .cashier-layout{display:flex;flex-direction:column;flex:none;min-height:0;gap:12px}
 .check,body[data-role=captain] .check{order:0;flex:none;height:auto;min-height:0;width:100%}
 .check-content{flex:none;max-height:52dvh;min-height:100px}
 .catalog,body[data-role=captain] .catalog{order:1;flex:none;width:100%;height:58dvh;min-height:330px;grid-template-columns:minmax(0,1fr);grid-template-rows:46px 48px minmax(0,1fr)}
 .products{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.product,body[data-role=captain] .product{min-height:104px;padding:12px}
 .product strong,body[data-role=captain] .product strong{font-size:14px}.product .price{font-size:13px}
 .lines-head,.line{grid-template-columns:minmax(0,1fr) 104px 68px;gap:4px}.line-qty button{min-width:36px;width:36px}.qty-value{min-width:26px}.line-amount{font-size:11px}
 .lines{padding-inline:8px}.check-heading{padding:10px}.check-heading h2{font-size:14px}
 #wf-actions,body[data-role=captain] #wf-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));padding:6px 8px}
 .order-actions{grid-template-columns:repeat(4,minmax(0,1fr))}
 body[data-role=captain] #wf-actions [data-wf=fire-all]{grid-column:1/-1}
 #captain-requests{margin:8px;padding:12px}.checkout{padding:12px}.checkout .primary{min-height:46px}
 #rq-form{padding:12px}.rq-filters{grid-template-columns:minmax(0,1fr)}.rq-filters input{grid-column:1}
 .wf-page{padding:12px;padding-bottom:max(16px,env(safe-area-inset-bottom));width:100%;max-width:100%}
 .wf-page>.check-heading{top:-12px;flex-wrap:wrap}.wf-page>.check-heading h2{flex:1 1 140px;font-size:17px}
 .wf-page>.check-heading .ux-tools{order:3;flex:1 0 100%;justify-content:flex-end}
 .wf-page>.check-heading>button:last-child{min-width:44px;min-height:44px}
 #rm-content .rq-list article,.rq-list article{padding:12px}.rq-list .rm-tabs button{min-height:46px}
 #rm-sales{grid-template-columns:minmax(0,1fr)}#rm-fields fieldset>label{min-width:0;flex-basis:100%}
 .table{min-width:0;min-height:140px}.table strong{font-size:28px}.table-toolbar{min-width:0}.table-search-row{min-width:0}
 dialog{max-width:calc(100vw - 16px)}.wf-page,#rm-form-dialog{max-width:100vw}
}
@media(max-width:359px){.header-actions{flex-basis:100%;justify-content:flex-start}#account-name{text-align:start}.line-qty button{min-width:32px;width:32px}.lines-head,.line{grid-template-columns:minmax(0,1fr) 94px 64px}.order-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-height:540px) and (min-width:720px){body[data-view=cashier] #shell:not([hidden]){height:auto;min-height:100dvh;overflow:visible}body[data-view=cashier] main{min-height:560px;overflow:visible}#cashier-view{min-height:530px}}
@media print{.check-content{overflow:visible;max-height:none}}

/* 0.8.1: work-first touch surfaces. Financial and dispatch actions keep their existing handlers. */
#shell>header{padding-block:8px;gap:12px}.header-actions{gap:8px}
#shell>nav button{min-height:44px}#sync[data-health=error]{color:var(--danger)}
#sync[data-health=error]::before{background:var(--danger)}#sync[data-health=pending]::before{background:var(--gold)}
#cashier-view>.heading{direction:inherit}.heading h1{font-size:19px;line-height:1.35}
.check-heading{padding:10px 12px}#review-check{min-height:44px;padding:8px 12px}
.lines-head{padding-block:8px;font-size:11px}.line{padding-block:9px}.line-name{font-size:13px}.line-remark{font-size:11px}
.order-actions{grid-template-columns:repeat(4,minmax(0,1fr));padding:6px 8px;gap:6px}
.order-actions button{font-size:11px;min-height:44px;padding:7px 4px}
#wf-actions,body[data-role=captain] #wf-actions{grid-template-columns:repeat(4,minmax(0,1fr));padding:0 8px 8px;gap:6px}
#wf-actions button{font-size:11px;min-height:44px;line-height:1.35}
body[data-role=captain] #wf-actions [data-wf=fire-all]{grid-column:auto;grid-row:auto;min-height:44px}
.checkout{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;padding:10px 12px}
.checkout .total,.checkout #preview-note{grid-column:1/-1;margin:0}.checkout #preview-note{font-size:12px;line-height:1.5}
.checkout .primary{min-height:46px}.checkout #clear-table{font-size:11px;min-height:44px;color:var(--muted)}
body[data-role=captain] .checkout #clear-table{grid-column:2}.total strong{font-size:22px}
.product,body[data-role=captain] .product{min-height:100px;padding:12px;gap:10px}
.product strong,body[data-role=captain] .product strong{font-size:14px;line-height:1.45}
.product.category-card,body[data-role=captain] .product.category-card{min-height:82px;gap:6px}
.catalog,body[data-role=captain] .catalog{gap:8px;grid-template-rows:46px 46px minmax(0,1fr)}
.catalog>.filters button,body[data-role=captain] .catalog>.filters button{min-height:44px}
.table-grid{gap:12px}.table{min-height:138px;padding:16px}.table strong{margin:10px 0;font-size:30px}
.table .amount{font-size:15px}.table-toolbar{padding-bottom:16px}
#rq-form{max-width:1100px;margin-inline:auto}#rq-items .rq-item{display:grid;grid-template-columns:minmax(0,1fr) 152px;align-items:center;gap:12px;padding:10px}
#rq-items .rq-item small{display:block}#rq-items .rq-stepper{margin:0;gap:4px;grid-template-columns:44px minmax(0,1fr) 44px}
#rq-items .rq-stepper input{font-size:16px;padding:6px 2px;min-height:46px}
#rq-items .rq-lane-items{gap:6px}#rq-items .rq-lane h2{font-size:16px}
.rq-submit-bar{z-index:2;border-top:1px solid var(--line);padding:12px 0 max(10px,env(safe-area-inset-bottom));gap:10px}
.rq-list{gap:12px}.rq-card-head h3 small{display:block;font-size:12px;font-weight:400;color:var(--muted);margin-top:6px}
.rq-detail summary{min-height:44px;display:flex;align-items:center;font-size:13px}.rq-detail summary::before{content:'▸';margin-inline-end:8px}.rq-detail[open] summary::before{content:'▾'}
.rq-list .rm-tabs{gap:8px}.rq-list .rm-tabs button{min-height:46px}.rq-badge{line-height:1.5}
.rq-live-status{font-size:12px;color:var(--muted);margin:8px 0}.rq-live-status[data-health=error]{color:var(--danger)}
@media(min-width:1101px){.products{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:720px) and (max-width:1100px){
 .products{grid-template-columns:repeat(3,minmax(0,1fr))}
 .product,body[data-role=captain] .product{padding:9px;min-height:104px}.product strong,body[data-role=captain] .product strong{font-size:13px}
 .lines-head,.line{grid-template-columns:minmax(0,1fr) 116px 66px}.line-qty button{min-width:44px;width:44px}.qty-value{min-width:24px}
 #wf-actions,body[data-role=captain] #wf-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
 .check-content{scroll-padding-block:36px}.checkout #clear-table{padding-inline:8px}
 #rq-items{grid-template-columns:1fr}.rq-lane-items{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:719px){
 .product,body[data-role=captain] .product{min-height:96px}.product.category-card,body[data-role=captain] .product.category-card{min-height:78px}
 #wf-actions,body[data-role=captain] #wf-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-role=captain] #wf-actions [data-wf=fire-all]{grid-column:auto;grid-row:auto}
 .checkout #clear-table{padding-inline:8px}.checkout{gap:8px}.checkout #preview-note{font-size:11px}
 #rq-title{font-size:20px}#rq-items .rq-item{grid-template-columns:minmax(0,1fr) 148px;gap:8px;padding:9px}
 #rq-items .rq-item>label{font-size:13px}#rq-items .rq-lane{padding:10px}.rq-submit-bar{flex-wrap:wrap}#rq-submit{flex:1 1 160px}
 #rq-items .rq-lane-items{max-height:46dvh}.rq-filters{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.rq-filters input{grid-column:1/-1}
 .rq-card-head{flex-wrap:nowrap}.rq-badge{white-space:normal;flex:0 0 auto;max-width:42%;text-align:center}
 .rq-list .rm-tabs button{flex:1 1 135px}.wf-page>.check-heading .ux-tools{order:0;flex:0 0 auto}
 .wf-page>.check-heading{position:sticky;top:-12px;z-index:3;background:var(--paper)}
 #rm-content .rq-list article,.rq-list article{padding:14px}.rq-table-wrap{overscroll-behavior-x:contain}
}
@media(max-width:359px){#rq-items .rq-item{grid-template-columns:minmax(0,1fr)}.rq-stepper{max-width:190px}.order-actions{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* 0.8.2: multi-check item allocation */
.split-targets{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:8px;position:sticky;top:0;background:var(--bg,#10211b);padding:8px 0;z-index:1}.split-target{border:1px solid #b99857;border-radius:10px;padding:12px;display:grid;gap:8px}.split-item{border-bottom:1px solid #53665b;padding:16px 0;display:grid;gap:10px}.split-item>strong{font-size:16px;overflow-wrap:anywhere}.split-quantities{display:grid;grid-template-columns:repeat(auto-fit,minmax(90px,1fr));gap:8px}.split-quantities input,.split-item select{min-height:44px;width:100%;box-sizing:border-box}.split-item[draggable=true]{cursor:grab}

/* QR visits: consistent touch targets and compact bill details. */
.qr-grid{grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:12px}
.qr-table{gap:8px;min-height:190px;align-items:flex-start}
.qr-table strong{font-size:2rem}.qr-view{font-size:.85rem;opacity:.8}
#qr-details{width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 32px);box-sizing:border-box;padding:24px;overflow:auto}
#qr-details-close{position:absolute;inset-inline-end:12px;top:12px;width:44px;height:44px;padding:0}
#qr-details h2{padding-inline-end:44px;margin:8px 0}
.qr-summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:20px 0}
.qr-summary>div{display:flex;flex-direction:column;gap:8px;min-width:0}
.qr-summary span{font-size:.85rem;opacity:.75}.qr-summary strong{white-space:nowrap}
.qr-lines>div{display:flex;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid var(--border,#294036)}
.qr-lines>div>span{overflow-wrap:anywhere}.qr-lines strong{white-space:nowrap}
.qr-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px}
.qr-actions button{flex:1;min-height:48px}
.qr-confirm{margin-top:16px;padding:16px;border:1px solid #b69a54;border-radius:14px}
.qr-confirm button{margin:4px;min-height:48px}
.split-targets{max-height:180px;overflow:auto}
@media(max-width:600px){.qr-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.qr-table{padding:14px;min-height:185px}#qr-details{padding:16px}.qr-summary{font-size:.9rem}}

/* Captain order entry: readable check, compact controls, no command menu. */
body[data-role=captain] .line-name,body[data-role=captain] .line-amount,body[data-role=captain] .qty-value{font-size:16px}
body[data-role=captain] .line-remark{font-size:12px}
body[data-role=captain] .check-heading h2{font-size:18px}
body[data-role=captain] #line-count{font-size:13px}
body[data-role=captain] #wf-actions [data-wf=more]{display:none}
@media(min-width:720px){
 body[data-role=captain] #cashier-view{grid-template-columns:minmax(0,0.44fr) minmax(0,0.56fr)}
 body[data-role=captain] .order-actions,body[data-role=captain] #wf-actions{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px;padding:4px 8px}
 body[data-role=captain] .order-actions button,body[data-role=captain] #wf-actions button{font-size:12px;min-height:44px;padding:6px 3px}
 body[data-role=captain] .check-heading{padding:10px 12px}
 body[data-role=captain] .checkout{padding:8px 12px}
 body[data-role=captain] .lines-head{font-size:12px;padding-block:7px}
 body[data-role=captain] .line{padding-block:9px;min-height:62px}
 body[data-role=captain] .check-content{min-height:240px}
 body[data-role=captain][data-view=cashier] #shell{min-height:760px;height:max(100dvh,760px);overflow:visible}
 body[data-role=captain][data-view=cashier] main{overflow:visible}
}
@media(max-width:719px){
 body[data-role=captain] .check-content{min-height:220px;max-height:52dvh}
}

/* Captain: keep the order dominant, with only essential controls at its foot. */
body[data-role=captain] #quantity-edit,body[data-role=captain] #remove-line,
body[data-role=captain] #wf-actions [data-wf=hold],
body[data-role=captain] #wf-actions [data-wf=fire],
body[data-role=captain] #wf-actions [data-wf=more]{display:none!important}
body[data-role=captain] .line-name,body[data-role=captain] .line-amount,body[data-role=captain] .qty-value{font-size:18px}
body[data-role=captain] .check-heading{order:0}
body[data-role=captain] .check-content{order:1;flex:1 1 auto}
body[data-role=captain] .order-actions{order:2}
body[data-role=captain] #wf-actions{order:3}
body[data-role=captain] .checkout{order:4}
body[data-role=captain] .order-actions,body[data-role=captain] #wf-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
@media(min-width:720px){
 body[data-role=captain] .check-content{min-height:300px}
 body[data-role=captain] .line{min-height:68px}
 body[data-role=captain] .check-heading{padding:8px 12px}
 body[data-role=captain] #cashier-view{grid-template-columns:minmax(0,0.4fr) minmax(0,0.6fr)}
 body[data-role=captain][data-view=cashier] #shell{height:max(100dvh,840px);min-height:840px}
 body[data-role=captain] .checkout #preview-note{font-size:12px}
}

/* Essential captain actions: remark and prebill, then full-width kitchen send. */
body[data-role=captain] .order-actions{display:none}
body[data-role=captain] #wf-actions{grid-template-columns:repeat(2,minmax(0,1fr));padding:8px;gap:8px}
body[data-role=captain] #wf-actions #remark-edit{grid-column:1;grid-row:1}
body[data-role=captain] #wf-actions [data-wf=prebill]{grid-column:2;grid-row:1}
body[data-role=captain] #wf-actions [data-wf=fire-all]{grid-column:1/-1;grid-row:2;min-height:56px;font-size:16px}

/* POS146: compact, predictable account header on phone and tablet. */
#shell>header .header-session{display:grid;gap:4px;min-width:0;text-align:end}
#shell>header .header-session #account-name{width:auto;max-width:260px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#shell>header .header-session #shift-label{max-width:none;white-space:nowrap;font-variant-numeric:tabular-nums}
#shell>header .header-tools{display:flex;align-items:center;gap:6px;min-width:0}
#shell>header .header-tools>*{flex:none}
@media(max-width:1100px){
 #shell>header{display:grid;grid-template-columns:minmax(130px,.8fr) minmax(110px,.7fr) auto;align-items:center;gap:12px;padding:12px 16px}
 #shell>header .header-brand{min-width:0;padding:0}
 #shell>header .header-actions{display:contents}
 #shell>header .brand{display:flex;align-items:center;gap:6px;margin:0 0 3px;font-size:10px;letter-spacing:2px;line-height:1}
 #shell>header .brand-logo{width:18px;height:29px;margin:0}
 #shell>header #workspace-title{display:block;font-size:14px;line-height:1.3}
 #shell>header #account-name{font-size:12px;line-height:1.4}
 #shell>header #shift-label{font-size:10px;line-height:1.4}
 #shell>header .header-tools{justify-content:flex-end;gap:6px}
 #shell>header .header-tools button{min-width:44px;min-height:44px;padding:8px;font-size:12px;white-space:nowrap}
 #shell>header #theme{width:44px;font-size:20px}
 #shell>header #shift-select{width:114px;min-width:0;min-height:44px;padding:8px;font-size:13px}
}
@media(max-width:719px){
 #shell>header{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px;padding:10px 12px}
 #shell>header .header-session{align-self:center}
 #shell>header #workspace-title{font-size:13px}
 #shell>header .header-tools{grid-column:1/-1;border-top:1px solid var(--line);padding-top:8px}
 #shell>header #shift-select{flex:1 1 0;min-width:74px;width:0;margin-inline-end:auto}
 #shell>header .header-tools button{font-size:11px;padding:8px}
 #shell>header #theme{font-size:20px}
 #shell>header .header-session #account-name{max-width:100%}
}
@media(max-width:359px){
 #shell>header .header-tools{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
 #shell>header #shift-select{grid-column:1/-1;width:100%;min-height:40px;margin:0}
 #shell>header #theme{width:100%}
 #shell>header .header-tools button{padding:6px}
}

/* Safari native select must retain a full touch target. */
#shell>header #shift-select{appearance:none;-webkit-appearance:none;height:44px;min-height:44px;padding-inline-end:26px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:right 14px top 52%,right 10px top 52%;background-size:4px 4px;background-repeat:no-repeat}
html[dir=rtl] #shell>header #shift-select{background-position:left 10px top 52%,left 14px top 52%}

/* Supplier invoice capture */
.invoice-capture-actions{display:grid;grid-template-columns:1fr 1fr;gap:12px}.invoice-capture-actions button{min-height:56px;border-color:var(--gold,#d2ae6b)}#invoice-selected{overflow-wrap:anywhere}#rm-fields [data-scan-line]{min-width:0}#rm-fields [data-scan-line] legend{max-width:100%;overflow-wrap:anywhere}#rm-fields [data-scan-line] p{font-size:.85rem;overflow-wrap:anywhere}.invoice-review-note{border-inline-start:3px solid #d2ae6b;padding-inline-start:12px}
@media(max-width:380px){.invoice-capture-actions{grid-template-columns:1fr}}

/* Supplier invoice reading — gold scanner, scoped to the active modal. */
#rm-form-dialog.invoice-reading{width:min(520px,calc(100vw - 24px));padding:26px;border:1px solid #bd9b5f;border-radius:24px;box-shadow:0 24px 90px #0006;outline:none}
#rm-form-dialog.invoice-reading #rm-form-title{text-align:center;font-size:1.2rem;margin:0 0 8px}
#rm-form-dialog.invoice-reading .dialog-actions,#rm-form-dialog.invoice-reading #rm-error{display:none}
.invoice-reader{text-align:center;display:grid;justify-items:center;gap:18px;padding:10px 0}
.invoice-reader-tag{color:#bd9b5f;letter-spacing:.14em;font-size:.7rem;font-weight:700}
.invoice-scan-window{position:relative;overflow:hidden;width:164px;height:202px;border:1px solid #bd9b5f88;border-radius:16px;background:linear-gradient(145deg,#d8b87418,#d8b87404);padding:17px;box-shadow:0 12px 35px #0002}
.invoice-scan-sheet{height:100%;border:1px solid #bd9b5f66;border-radius:6px;background:var(--panel,var(--bg));display:flex;flex-direction:column;gap:12px;padding:17px 14px;transform:rotate(-4deg)}
.invoice-scan-sheet i{display:block;height:5px;background:#d2ae6b66;border-radius:3px}
.invoice-scan-sheet i:first-child{width:65%;height:9px;background:#d2ae6b}
.invoice-scan-sheet i:nth-child(3){width:75%}.invoice-scan-sheet i:last-child{margin-top:auto;width:55%;align-self:flex-end;background:#d2ae6b}
.invoice-scan-beam{position:absolute;inset:15px 10px auto;height:2px;background:#e6c781;box-shadow:0 0 12px #e6c781,0 -20px 28px 8px #d2ae6b26;animation:invoice-scan 2.6s ease-in-out infinite alternate}
.invoice-reader-status{max-width:350px;margin:0;line-height:1.65}
.invoice-reader-file{max-width:100%;color:var(--muted);font-size:.8rem;overflow-wrap:anywhere;margin:0}
.invoice-reader-progress{display:flex;align-items:center;justify-content:center;gap:12px;color:#bd9b5f;font-size:.82rem}
.invoice-reader-dots{display:flex;gap:5px}.invoice-reader-dots i{width:5px;height:5px;border-radius:50%;background:currentColor;animation:invoice-dot 1.2s ease-in-out infinite}.invoice-reader-dots i:nth-child(2){animation-delay:.15s}.invoice-reader-dots i:nth-child(3){animation-delay:.3s}
.invoice-reader-next{border-top:1px solid var(--line);padding-top:16px;margin:0;width:100%;font-size:.8rem;color:var(--muted)}
.invoice-reader-elapsed{font-variant-numeric:tabular-nums;direction:ltr}
.invoice-review-warning{padding:14px;border:1px solid #bd9b5f88;border-radius:12px;background:#d2ae6b10;font-size:.9rem;line-height:1.6}
.invoice-unit-warning{color:var(--muted);border-inline-start:3px solid #bd9b5f;padding-inline-start:10px}
#rm-fields .invoice-review-check{display:flex;align-items:flex-start;gap:10px;line-height:1.5}
#rm-fields .invoice-review-check input{width:22px;height:22px;flex:none;margin:0}
@keyframes invoice-scan{from{transform:translateY(0)}to{transform:translateY(171px)}}
@keyframes invoice-dot{0%,100%{opacity:.3;transform:translateY(0)}50%{opacity:1;transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.invoice-scan-beam,.invoice-reader-dots i{animation:none}.invoice-scan-beam{transform:translateY(86px)}}
@media(max-height:600px){.invoice-scan-window{width:106px;height:128px}.invoice-reader{gap:10px}.invoice-scan-sheet{gap:7px;padding:10px}.invoice-scan-beam{animation-name:invoice-scan-small}@keyframes invoice-scan-small{to{transform:translateY(95px)}}}

/* Supplier invoice review: items first, bounded body, always reachable actions. */
#rm-form-dialog.invoice-review{width:min(760px,96vw);height:min(900px,94dvh);max-height:94dvh;overflow:hidden;padding:20px}
.invoice-review #rm-form{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto auto;gap:10px}
.invoice-review #rm-form-title{font-size:1.25rem;margin:0;padding:2px 0 8px}
.invoice-review #rm-fields{overflow:auto;min-height:0;overscroll-behavior:contain;padding:2px 4px 16px;align-content:start;gap:14px}
.invoice-review #rm-error{margin:0;max-height:70px;overflow:auto}
.invoice-review .dialog-actions{position:static;margin:0;padding:10px 0 0;bottom:auto;gap:10px}
.invoice-review .dialog-actions button{min-height:48px;padding:12px}
.invoice-review-summary{display:grid;grid-template-columns:1fr auto;gap:5px 12px;font-size:.88rem}
.invoice-review-summary strong{grid-column:1/-1;overflow-wrap:anywhere}
.invoice-review-summary span{color:var(--muted);overflow-wrap:anywhere}
.invoice-items-heading{display:flex;align-items:center;justify-content:space-between;margin:4px 0;font-size:1.1rem}
.invoice-items-heading span,.invoice-line-number{background:var(--gold,#d4b16e);color:#142b24;border-radius:8px;padding:3px 10px}
#rm-fields [data-scan-line]{display:grid;min-width:0;gap:10px;padding:14px;border:1px solid var(--line,#3c5448);border-radius:14px}
#rm-fields [data-scan-line] legend{font-weight:700;padding:0 6px;max-width:100%;overflow-wrap:anywhere}
#rm-fields [data-scan-line]>label{min-width:0}
.invoice-source-quantity{display:grid;grid-template-columns:1fr auto;gap:5px 12px;font-size:.85rem}
.invoice-source-quantity small{grid-column:1/-1;color:var(--muted)}
.invoice-line-values{display:grid;grid-template-columns:1fr 1fr;gap:10px;min-width:0}
.invoice-line-values label{min-width:0;font-size:.8rem}
.invoice-review input,.invoice-review select{min-width:0;width:100%;min-height:46px;padding:10px;font-size:16px}
.invoice-line-prices{font-size:.82rem}
.invoice-metadata>label{display:grid;gap:6px;margin-top:14px}
.invoice-review .invoice-review-warning{padding:12px;font-size:.85rem}
.invoice-review-check{font-size:.85rem}
.invoice-review .invoice-review-check input{width:22px;min-height:22px;flex:0 0 22px}
.invoice-review small{font-size:.8rem}
.purchase-filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.purchase-filters label{min-width:0;display:grid;gap:6px}
.purchase-filters input,.purchase-filters select{width:100%;min-width:0;font-size:16px}
.purchase-tools{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0}
.purchase-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin:18px 0}
.purchase-summary>div{border:1px solid var(--line,#3c5448);border-radius:12px;padding:14px;display:grid;gap:8px;overflow-wrap:anywhere}
.purchase-table-wrap{overflow:auto;max-width:100%;margin:14px 0 24px}
.purchase-table-wrap table{width:100%;border-collapse:collapse;min-width:620px}
.purchase-table-wrap th,.purchase-table-wrap td{padding:12px;text-align:start;border-bottom:1px solid var(--line,#3c5448);vertical-align:top}
.purchase-table-wrap tfoot{font-weight:700}
.purchase-report-note{font-size:.85rem;color:var(--muted)}
@media(max-width:700px){
 #rm-form-dialog.invoice-review{width:100vw;height:94dvh;max-height:94dvh;padding:14px;border-radius:20px 20px 0 0}
 .invoice-review #rm-fields{gap:12px}
 .invoice-review-summary{font-size:.8rem}
 .invoice-source-quantity{grid-template-columns:1fr}
 .invoice-source-quantity small{grid-column:auto}
 .purchase-filters,.purchase-summary{grid-template-columns:1fr 1fr}
 .purchase-filters button{grid-column:1/-1}
}

#rm-form-dialog.invoice-review select{height:46px;min-height:46px;appearance:none;-webkit-appearance:none;padding-inline-end:30px;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:right 15px top 52%,right 10px top 52%;background-size:5px 5px;background-repeat:no-repeat}
html[dir=rtl] #rm-form-dialog.invoice-review select{background-position:left 10px top 52%,left 15px top 52%}

#invoice-review-lines{display:grid;gap:16px}
.rq-purchase-total{display:grid;grid-template-columns:1fr auto;gap:8px;padding:16px;margin:16px 0;border:1px solid var(--gold,#d4b16e);border-radius:12px}
.rq-purchase-total strong{font-size:1.2rem}.rq-purchase-total small{grid-column:1/-1;color:var(--muted)}
.rq-invoice-file{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 0;border-bottom:1px solid var(--line)}
#rm-fields .purchase-delivery-row{display:grid;gap:8px}.purchase-delivery-row p{margin:4px 0}
@media(max-width:480px){.rq-purchase-total{grid-template-columns:1fr}.rq-purchase-total small{grid-column:auto}}

/* Purchasing actions: one card per attachment, aligned controls and distinct request actions. */
#rm-content .rq-invoice-file{display:grid;gap:14px;padding:16px;margin:14px 0;border:1px solid var(--line);border-radius:14px;background:var(--paper)}
.rq-invoice-meta{display:flex;align-items:center;justify-content:space-between;gap:14px;min-width:0}
.rq-invoice-meta>a{display:grid;gap:5px;min-width:0;flex:1;text-decoration:none;font-size:14px;font-weight:600;overflow-wrap:anywhere}
.rq-invoice-meta>a>span:last-child{text-decoration:underline;text-underline-offset:4px}
.rq-invoice-file-label{font-size:11px;font-weight:400;color:var(--muted)}
.rq-invoice-status{flex:0 0 auto;max-width:48%;padding:8px 10px;border-radius:9px;background:var(--soft);font-size:12px;font-weight:600;text-align:center;line-height:1.4}
.rq-invoice-status.is-reviewed{white-space:nowrap;color:var(--ink)}
.rq-invoice-status.is-pending{color:var(--gold)}
.rq-invoice-actions,.rq-request-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rq-invoice-actions>button,.rq-request-actions>button{width:100%;min-width:0;min-height:48px;margin:0;padding:12px 10px;font-size:13px;line-height:1.45;white-space:normal;overflow-wrap:anywhere;display:flex;align-items:center;justify-content:center;text-align:center}
.rq-invoice-actions>button:only-child,.rq-request-actions>button:only-child{grid-column:1/-1}
.rq-request-actions{margin-top:18px;padding-top:16px;border-top:1px solid var(--line)}
.rq-request-actions>[data-rm=deliver],.rq-request-actions>[data-rm=accept],.rq-invoice-file[data-reviewed=false] .rq-invoice-actions>[data-rm^="scan:"]{background:var(--accent);color:var(--accent-ink);border-color:var(--accent)}
.rq-invoice-actions>button:focus-visible,.rq-request-actions>button:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
@media(max-width:480px){
 #rm-content .rq-invoice-file{padding:12px;gap:12px}
 .rq-invoice-meta{gap:8px}.rq-invoice-meta>a{font-size:13px}
 .rq-invoice-status{padding:7px 8px;font-size:11px}
 .rq-invoice-actions,.rq-request-actions{gap:8px}
 .rq-invoice-actions>button,.rq-request-actions>button{padding:11px 7px;font-size:12px;min-height:52px}
}

/* POS153: explicit, touch-friendly account approvals and cash change. */
#user-approvals{min-width:0;border:1px solid var(--border);border-radius:12px;padding:12px}
#user-approvals label{display:flex;align-items:center;gap:12px;min-height:48px;padding:8px 0;line-height:1.6}
#user-approvals input[type=checkbox]{flex:0 0 22px;width:22px;height:22px;margin:0}
#wf-credit-approval{display:block;padding:12px;border:1px solid var(--border);border-radius:12px;line-height:1.7}
#wf-credit-approval[hidden],#user-approvals[hidden]{display:none}
.wf-change{font-weight:700;align-self:center;line-height:1.7}

/* Recipe workspace */
.recipe-workspace{max-width:1400px;margin:auto}.recipe-heading{display:flex;align-items:start;justify-content:space-between;gap:16px}.recipe-heading h2,.recipe-heading h3{margin:0 0 8px}.recipe-heading p{max-width:65ch}.recipe-badge{display:inline-block;border:1px solid var(--line,#536761);border-radius:20px;padding:5px 10px;font-size:12px;white-space:normal}.recipe-badge[data-state=active]{color:#48bfa1}.recipe-stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:18px 0}.recipe-stats>div{display:flex;flex-direction:column;gap:6px;padding:16px;border:1px solid var(--line,#536761);border-radius:12px}.recipe-stats strong{font-size:22px}.recipe-stats span{font-size:13px}.recipe-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin-bottom:20px}.recipe-workspace label{display:flex;flex-direction:column;gap:7px;font-size:13px;min-width:0}.recipe-workspace input,.recipe-workspace select,.recipe-workspace textarea{width:100%;min-width:0;max-width:100%;box-sizing:border-box}.recipe-layout{display:grid;grid-template-columns:260px minmax(0,1fr);gap:20px;align-items:start}.recipe-list{display:grid;gap:8px;max-height:640px;overflow:auto}.recipe-list button{display:flex;align-items:start;flex-direction:column;text-align:start;gap:6px;padding:14px;width:100%;min-width:0;white-space:normal}.recipe-list button[aria-pressed=true]{border-color:#48bfa1;box-shadow:inset 3px 0 #48bfa1}.recipe-list small{opacity:.75}.recipe-editor{min-width:0;border:1px solid var(--line,#536761);border-radius:16px;padding:20px}.recipe-editor form{display:block}.recipe-fields{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:20px 0}.recipe-fields>div{display:flex;flex-direction:column;gap:10px}.recipe-picker{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:16px 0}.recipe-picker-select{grid-column:1/-1}.recipe-line{padding:16px!important;margin:12px 0!important;border:1px solid var(--line,#536761);border-radius:12px;display:block!important}.recipe-line-title{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.recipe-line-title button{margin-inline-start:auto}.recipe-line-fields{display:grid;grid-template-columns:1.3fr 1fr 1fr;gap:10px;margin:12px 0}.recipe-line small,.recipe-footnote,.recipe-approval small{font-size:12px;line-height:1.7;opacity:.8}.recipe-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:16px 0}.recipe-notice{border-inline-start:3px solid #c09b5a;padding:10px 14px;line-height:1.65}.recipe-approval{margin:22px 0;border-top:1px solid var(--line,#536761);padding-top:20px}.recipe-approval label{display:flex;flex-direction:row;align-items:start;line-height:1.7}.recipe-approval input{width:20px;flex-shrink:0;margin-top:5px}.recipe-empty{padding:28px 12px;line-height:1.8}.recipe-editor textarea{resize:vertical;min-height:100px}.recipe-editor details p{font-size:12px;overflow-wrap:anywhere}.recipe-workspace button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:1000px){.recipe-layout{grid-template-columns:210px minmax(0,1fr)}.recipe-line-fields{grid-template-columns:1fr 1fr}.recipe-editor{padding:14px}}
@media(max-width:680px){.recipe-layout{grid-template-columns:1fr}.recipe-list{max-height:220px;grid-template-columns:1fr 1fr}.recipe-filters{grid-template-columns:1fr 1fr}.recipe-filters>label:first-child{grid-column:1/-1}.recipe-stats{gap:6px}.recipe-stats>div{padding:10px}.recipe-stats strong{font-size:18px}.recipe-heading{flex-wrap:wrap}.recipe-picker{grid-template-columns:1fr}.recipe-fields{grid-template-columns:1fr}.recipe-list button{padding:10px}.recipe-editor{padding:12px}.recipe-actions button{width:100%}}

/* MacBook desktop: reserve bill-item space in shorter browser windows. */
@media screen and (min-width:1024px) and (max-width:1800px) and (min-height:541px) and (max-height:1000px) and (pointer:fine){
 html[data-pos-mac=true] body[data-view=cashier] #shell:not([hidden]){height:100dvh;min-height:0;overflow:hidden}
 html[data-pos-mac=true] body[data-view=cashier] #shell>header{padding:6px 14px;gap:8px}
 html[data-pos-mac=true] body[data-view=cashier] #shell>header .brand-logo{width:19px;height:30px}
 html[data-pos-mac=true] body[data-view=cashier] #workspace-title{font-size:14px}
 html[data-pos-mac=true] body[data-view=cashier] #shell>nav{padding:4px 14px;min-height:42px}
 html[data-pos-mac=true] body[data-view=cashier] #shell>nav button{min-height:34px;padding:6px 12px}
 html[data-pos-mac=true] body[data-view=cashier] #kot-delivery-status{max-height:44px!important;margin:4px 14px!important;padding:6px 10px!important;font-size:12px!important;overflow:auto}
 html[data-pos-mac=true] body[data-view=cashier] main{padding:10px 14px;overflow:auto}
 html[data-pos-mac=true] body[data-view=cashier] #cashier-view{min-height:490px;gap:8px 14px}
 html[data-pos-mac=true] body[data-view=cashier] .check-content{min-height:180px;flex:1 1 180px;overflow:auto}
 html[data-pos-mac=true] body[data-view=cashier] .check-heading{padding:6px 10px;flex-wrap:nowrap}
 html[data-pos-mac=true] body[data-view=cashier] #review-check{min-height:32px;padding:5px 9px}
 html[data-pos-mac=true] body[data-view=cashier] #check-print-meta{padding:5px 10px}
 html[data-pos-mac=true] body[data-view=cashier] #selection-bar{padding:4px 10px}
 html[data-pos-mac=true] body[data-view=cashier] #selection-bar button{min-height:30px;padding:4px 8px}
 html[data-pos-mac=true] body[data-view=cashier] .order-actions{padding:4px 8px;gap:5px}
 html[data-pos-mac=true] body[data-view=cashier] .order-actions button{min-height:32px;padding:5px 4px}
 html[data-pos-mac=true] body[data-view=cashier] #wf-actions{padding:0 8px 5px;gap:5px}
 html[data-pos-mac=true] body[data-view=cashier] #wf-actions button{min-height:34px;padding:5px 6px;font-size:12px}
 html[data-pos-mac=true] body[data-view=cashier] .wf-send-stack{gap:4px}
 html[data-pos-mac=true] body[data-view=cashier] .checkout{padding:6px 10px;gap:5px}
 html[data-pos-mac=true] body[data-view=cashier] .checkout .primary,html[data-pos-mac=true] body[data-view=cashier] .checkout #clear-table{min-height:36px;padding:6px 10px}
 html[data-pos-mac=true] body[data-view=cashier] .total strong{font-size:20px}
 html[data-pos-mac=true] body[data-view=cashier] .line{min-height:52px}
}

/* Android landscape tablet154: keep bill items readable with touch-sized controls. */
@media screen and (min-width:900px) and (max-height:1000px) and (orientation:landscape){
 html[data-pos-android=true] body[data-view=cashier] #shell:not([hidden]){height:100dvh;min-height:0;overflow:hidden}
 html[data-pos-android=true] body[data-view=cashier] #shell>header{padding:6px 14px;gap:8px}
 html[data-pos-android=true] body[data-view=cashier] #shell>header .brand-logo{width:19px;height:30px}
 html[data-pos-android=true] body[data-view=cashier] #workspace-title{font-size:14px}
 html[data-pos-android=true] body[data-view=cashier] #shell>nav{padding:4px 14px;min-height:42px}
 html[data-pos-android=true] body[data-view=cashier] #shell>nav button{min-height:44px;padding:6px 12px}
 html[data-pos-android=true] body[data-view=cashier] #kot-delivery-status{max-height:44px!important;margin:4px 14px!important;padding:6px 10px!important;font-size:13px!important;overflow:auto}
 html[data-pos-android=true] body[data-view=cashier] main{padding:10px 14px;overflow:auto}
 html[data-pos-android=true] body[data-view=cashier] #cashier-view{min-height:580px;gap:8px 14px}
 html[data-pos-android=true] body[data-view=cashier] .check-content{min-height:200px;flex:1 1 200px;overflow:auto}
 html[data-pos-android=true] body[data-view=cashier] .check-heading{padding:6px 10px;flex-wrap:nowrap}
 html[data-pos-android=true] body[data-view=cashier] #review-check{min-height:44px;padding:5px 9px}
 html[data-pos-android=true] body[data-view=cashier] #check-print-meta{padding:5px 10px}
 html[data-pos-android=true] body[data-view=cashier] #selection-bar{padding:4px 10px}
 html[data-pos-android=true] body[data-view=cashier] #selection-bar button{min-height:44px;padding:4px 8px}
 html[data-pos-android=true] body[data-view=cashier] .order-actions{padding:4px 8px;gap:5px}
 html[data-pos-android=true] body[data-view=cashier] .order-actions button{min-height:44px;padding:5px 4px}
 html[data-pos-android=true] body[data-view=cashier] #wf-actions{padding:0 8px 5px;gap:5px}
 html[data-pos-android=true] body[data-view=cashier] #wf-actions button{min-height:44px;padding:5px 6px;font-size:13px}
 html[data-pos-android=true] body[data-view=cashier] .wf-send-stack{gap:4px}
 html[data-pos-android=true] body[data-view=cashier] .checkout{padding:6px 10px;gap:5px}
 html[data-pos-android=true] body[data-view=cashier] .checkout .primary,html[data-pos-android=true] body[data-view=cashier] .checkout #clear-table{min-height:44px;padding:6px 10px}
 html[data-pos-android=true] body[data-view=cashier] .total strong{font-size:20px}
 html[data-pos-android=true] body[data-view=cashier] .line{min-height:56px}
 html[data-pos-android=true] body[data-view=cashier] .product{padding:10px 12px}
 html[data-pos-android=true] body[data-view=cashier] .product strong{font-size:14px;line-height:1.3}
 html[data-pos-android=true] body[data-view=cashier] .order-actions button{font-size:13px}
 html[data-pos-android=true] body[data-view=cashier] .check-heading h2{font-size:16px}
 html[data-pos-android=true] body[data-view=cashier] #products{overflow:auto;min-height:200px}
}
