/* Distributor uses the live staff mobile.css. Only customer-only adapters below. */
body.distributor>header,body.distributor>main,body.distributor>footer,body.distributor>.mini-header,body.distributor>#mini-panel,body.distributor>.brand-strip{display:none!important}
body.distributor{background:var(--bg);color:var(--text);font:15px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
#app.distributor-app{width:100%;min-width:0;max-width:100%;margin:0;padding:0;color:var(--text)}
#app.distributor-app .dp-nav{display:flex;align-items:center}#app.distributor-app .dp-content{min-height:60vh}#app.distributor-app .cat-price{display:block!important;white-space:nowrap;color:var(--text);font-size:13px}#app.distributor-app .cat-name{min-width:0}#app.distributor-app .dp-availability{display:block;font-size:10px;color:var(--muted)}
#app.distributor-app .cat-add .icon{width:34px;min-height:36px;padding:0}#app.distributor-app .stock-badge:empty{display:none}
#app.distributor-app .dp-form{display:block}#app.distributor-app .dp-form .new-submit{width:100%}#app.distributor-app .dp-form input[type=hidden]{display:none!important}
#app.distributor-app .cart-tools .line-price-control{cursor:default}#app.distributor-app .cart-unit{font:inherit;font-size:11px}

#app.distributor-app #dp-recipient-results,#app.distributor-app #dp-product-results{display:grid;gap:3px;max-height:230px;overflow:auto}#app.distributor-app #dp-recipient-results button,#app.distributor-app #dp-product-results button{text-align:left;background:var(--surface);color:var(--text);font-size:13px}
#app.distributor-app .dp-consent{display:flex;align-items:center;gap:8px;font-size:11px}#app.distributor-app .dp-consent input{width:18px;min-height:18px;flex:0 0 18px;margin:0}#app.distributor-app .error{color:#d65050;font-size:12px}#app.distributor-app .error:empty{display:none}
#app.distributor-app .dp-recipient-detail summary{text-align:right;color:var(--muted);font-size:12px;cursor:pointer}#app.distributor-app .dp-recipient-detail p{white-space:pre-wrap}#app.distributor-app .customer-title{font-size:16px;margin:0}
body.distributor #modal{box-sizing:border-box;width:min(440px,calc(100vw - 24px));max-width:calc(100vw - 24px);max-height:calc(100dvh - 40px);margin:auto;padding:18px;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:18px;font:inherit}
body.distributor #modal-content{min-width:0}body.distributor #modal h2{font-size:18px;margin-bottom:12px}body.distributor #modal .dp-form{display:grid;gap:8px}body.distributor #modal .dp-danger{color:#d44;background:transparent}body.distributor #modal .dp-actions{display:grid;gap:6px}body.distributor #modal .dp-image{max-width:100%;max-height:75vh;object-fit:contain}
body.distributor #modal .dp-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}body.distributor #modal .inline-actions{display:flex;gap:8px;margin-top:12px}body.distributor #modal .inline-actions>*{flex:1;min-width:0}body.distributor #modal .dp-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;text-align:center}body.distributor #modal .dp-days button{padding:0;min-height:36px}body.distributor #modal .dp-days .selected{background:var(--accent);color:white}
body.distributor #modal .dp-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}body.distributor #modal .dp-filter label{margin:0}body.distributor #modal .dp-filter select{font-size:12px;padding:6px;min-height:36px}body.distributor #modal .dp-filter input{min-width:0}
#app.distributor-app [hidden],body.distributor #modal [hidden]{display:none!important}#app.distributor-app input[type=number]{appearance:textfield}#app.distributor-app input::-webkit-inner-spin-button{appearance:none}
#app.distributor-app #dp-selected{flex:1;min-width:0}#app.distributor-app #dp-selected .selected-customer-heading{display:flex;align-items:center;gap:8px}#app.distributor-app #dp-selected .change-customer{margin-left:auto}#app.distributor-app #dp-selected small{display:block}#app.distributor-app .identity-row{display:flex;align-items:center;gap:8px}#app.distributor-app .identity-row>input{flex:1;min-width:0}#app.distributor-app .shipment-calendar{margin-left:auto}#app.distributor-app .line-price-control.secondary{display:flex;align-items:center;background:var(--soft);color:var(--accent);border-radius:8px;font-weight:600}#app.distributor-app .cat-item{gap:8px}#app.distributor-app .cat-price{margin-left:auto}#app.distributor-app .cat-add{flex-shrink:0}#app.distributor-app .detail-body .pair{padding-block:6px}

.dp-profile{display:grid;grid-template-columns:1fr 1.4fr;gap:8px;font-size:14px}.dp-profile dd{margin:0;overflow-wrap:anywhere}.dp-profile dt{color:var(--muted)}

/* Staff primitives are the visual authority; no storefront typography. */
body.distributor #app.distributor-app{font:inherit}
body.distributor #modal{border:0;border-radius:20px;padding:18px;background:var(--surface);color:var(--text)}
#app.distributor-app .staff-tabs{overflow-x:auto;flex-wrap:nowrap}
#app.distributor-app .staff-tabs button{flex-shrink:0}
#app.distributor-app .cat-price{font-size:inherit;font-weight:600}
#app.distributor-app .cart-unit{font-family:inherit;font-weight:inherit}

/* Distributor constraints only: readonly prices and tenant recipients. Staff CSS owns layout. */
#app.distributor-app .delivery-cost-line .cart-tools{grid-column:2;display:flex;justify-content:flex-end}
#app.distributor-app .delivery-cost-line input{width:72px;min-width:0;text-align:center;font:inherit}
#app.distributor-app .delivery-cost-line .line-subtotal{min-width:74px;text-align:right}
#app.distributor-app .line-price-control{justify-content:center}
#app.distributor-app .client-row-name{font-weight:inherit}
#app.distributor-app .new-submit{width:100%}
#app.distributor-app .danger{color:var(--red,#ef4444)}
body.distributor #sheet,body.distributor #receiving-calendar{font:inherit;color:var(--text);box-sizing:border-box}
body.distributor #sheet [hidden]{display:none!important}
body.distributor #sheet .dp-image{max-width:100%;max-height:70dvh;object-fit:contain}

body.distributor #sheet .pay-file-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body.distributor #sheet .pay-file-actions button{width:100%;min-width:0}
body.distributor #sheet .dp-pdf{width:100%;height:65dvh;border:0}
body.distributor #sheet .inline-actions{display:flex;gap:8px}
body.distributor #sheet .inline-actions>*{flex:1;min-width:0;text-align:center}
body.distributor #sheet .order-menu{display:grid;gap:8px}
body.distributor #sheet .danger{color:var(--red,#ef4444)}
#app.distributor-app .detail-top .headline h1{flex:1;min-width:0}

body.distributor #sheet #simple-pay .pay-file-actions{grid-template-columns:repeat(2,minmax(0,1fr))}

/* A delivery is one editable amount, without a quantity/unit/removal column. */
#app.distributor-app #order-form .delivery-cost-line{grid-template-columns:minmax(0,1fr) 84px;align-items:center;gap:8px}
#app.distributor-app #order-form .delivery-cost-line .cart-tools{grid-column:2;grid-row:1;display:block;min-width:0}
#app.distributor-app #order-form .delivery-cost-line .line-subtotal{display:none}
#app.distributor-app #order-form .delivery-cost-line input{box-sizing:border-box;width:100%;max-width:100%;min-width:0;min-height:40px;padding:7px 9px;text-align:right;font:inherit;font-size:16px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:7px}

/* Distributor dialog content; shared mobile.css owns dialog positioning. */
body.distributor #sheet :is(form,fieldset,label,.sheet-head,.order-menu,.pay-file-actions,.inline-actions){min-width:0;max-width:100%;box-sizing:border-box}
body.distributor #sheet .sheet-head h2{min-width:0;overflow-wrap:anywhere}
body.distributor #sheet .sheet-head>.icon{flex:0 0 auto}
body.distributor #sheet input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=file]),body.distributor #sheet select,body.distributor #sheet textarea{max-width:100%;min-width:0;box-sizing:border-box}
body.distributor #sheet .inline-actions{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);align-items:stretch;gap:8px;width:100%;margin-top:8px}
body.distributor #sheet .inline-actions>*,body.distributor #sheet .pay-file-actions>button{display:flex;align-items:center;justify-content:center;width:100%;min-width:0;min-height:44px;height:auto;margin:0;padding:10px 12px;box-sizing:border-box;text-align:center;white-space:normal;overflow-wrap:anywhere;line-height:1.25;font-family:inherit;font-size:14px;text-decoration:none}
body.distributor #sheet .order-menu>button{width:100%;min-width:0;min-height:44px;margin:0;box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;text-align:center}
body.distributor #sheet>button[data-delete]{width:100%;min-height:44px;margin:8px 0 0;text-align:center;box-sizing:border-box}
body.distributor #sheet .dp-image{display:block;margin-inline:auto;max-width:100%;height:auto}
body.distributor #sheet .dp-pdf{display:block;max-width:100%;box-sizing:border-box}
body.distributor #sheet .attachment-feedback,body.distributor #sheet .pay-upload-list{max-width:100%;overflow-wrap:anywhere}
body.distributor #sheet .filter-footer{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-items:stretch}
body.distributor #sheet .filter-footer>button{width:100%;min-width:0;min-height:44px;margin:0;box-sizing:border-box}

/* Compact distributor navigation and contextual menus. */
body.distributor>.skip-link{display:none!important}
#app.distributor-app .dp-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr)) 44px 44px;gap:4px;align-items:stretch}
.distributor-app .dp-nav button{min-width:0;min-height:44px;padding:6px 4px;font-size:13px;position:relative}
.distributor-app .dp-nav svg{width:23px;height:23px;vertical-align:middle}
.dp-cart-count{position:absolute;top:0;right:0;min-width:16px;border-radius:9px;background:var(--accent);color:white;font-size:10px}
.dp-order-muted .order-heading,.dp-order-muted .order-info{opacity:.45;text-decoration:line-through}
.dp-notifications label{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0}
.dp-notifications input[type=checkbox]{width:20px;height:20px;flex:none}
body.distributor #compact-order-popover .cf-icon-row{grid-template-columns:repeat(5,minmax(0,1fr))}
body.distributor #compact-order-popover .cf-mini-row{display:grid;grid-template-columns:1fr 1fr 44px;gap:6px}
body.distributor #compact-order-popover button,body.distributor #compact-order-popover select{min-width:0;min-height:40px}
body.distributor #sheet.dp-filter-sheet{position:fixed;bottom:auto;margin:0 auto;left:8px;right:8px;width:min(440px,calc(100% - 16px));max-height:65dvh;border-radius:16px;padding:12px}
body.distributor .filter-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
body.distributor .filter-grid select{width:100%;min-width:0}
body.distributor .filter-footer{display:grid;grid-template-columns:1fr 1fr;gap:8px}
body.distributor .order-menu{display:grid;grid-template-columns:1fr;gap:6px}

body.distributor .profile-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}body.distributor .profile-actions button{width:100%;min-width:0;margin:0}
body.distributor .profile-payment{padding:10px 0;border-bottom:1px solid var(--line)}body.distributor .profile-payment-orders{display:flex;flex-wrap:wrap;gap:6px}body.distributor .profile-payment-orders button{font-size:12px;min-height:32px}
body.distributor .profile-toggle{display:flex;justify-content:space-between;align-items:center;gap:8px}body.distributor .profile-toggle input{width:20px;height:20px}
body.distributor #sheet input,body.distributor #sheet select,body.distributor #sheet textarea{box-sizing:border-box;max-width:100%;min-width:0}body.distributor .block>details>summary{cursor:pointer;padding:8px 0}body.distributor .pair>span{min-width:0;overflow-wrap:anywhere}

/* Equal navigation tabs, no empty icon columns when the basket is hidden. */
#app.distributor-app .dp-nav{display:flex;gap:4px;align-items:stretch}#app.distributor-app .dp-nav>[data-tab],#app.distributor-app .dp-nav>[data-profile]{flex:1 1 0;min-width:0;text-align:center}#app.distributor-app .dp-nav>[data-basket]{flex:0 0 44px;width:44px}#app.distributor-app .dp-nav>[hidden]{display:none!important}
