:root{font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172b4d;background:#fbfcf8;font-size:15px;--pink:#bd4507;--border:#dce4df;--muted:#607067}*{box-sizing:border-box}body{margin:0}button,input,select,textarea{font:inherit}button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}button{cursor:pointer;border:1px solid var(--border);background:white;border-radius:10px;padding:10px 16px;color:inherit;font-weight:600;min-height:42px}button:hover{border-color:var(--pink)}button:disabled{opacity:.5;cursor:wait}button.primary,.primary{background:var(--pink);color:white;border-color:var(--pink)}a{color:var(--pink);text-decoration:none}header{background:white;display:flex;justify-content:space-between;align-items:center;padding:20px max(20px,calc((100vw - 1280px)/2));border-bottom:1px solid var(--border);gap:15px}.brand{display:flex;align-items:center;gap:12px;color:#091f59;font-weight:850;letter-spacing:.05em}.brand small{display:block;font-size:11px;font-weight:500;color:var(--muted);letter-spacing:.02em;margin-top:4px}.mark{border-radius:14px;background:#f8dce7;color:#126b35;padding:12px;font-size:20px}header>div{display:flex;align-items:center;gap:12px;font-size:12px}main{max-width:1280px;margin:0 auto;padding:30px 24px}h1{font-size:30px;letter-spacing:-.04em;margin:5px 0 18px}h2{font-size:19px;margin:0 0 14px}h3{font-size:16px}.eyebrow{color:var(--pink);font-size:11px;letter-spacing:.14em;font-weight:750}.intro{display:flex;justify-content:space-between;align-items:center;gap:12px}.badge{background:#eaf6ed;padding:8px 12px;border-radius:20px;font-size:12px;color:#126b35}nav{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:22px}nav button{background:transparent;border-color:transparent;color:var(--muted)}nav button.active{background:#091f59;color:white}.notice{background:#fff2da;border:1px solid #f3dfb9;padding:12px 16px;border-radius:12px;margin-bottom:18px}.notice:empty{display:none}.card{background:white;border:1px solid var(--border);border-radius:16px;padding:22px}.login{max-width:480px;margin:6vh auto}.login h1{font-size:36px;margin-top:14px}.login p{color:var(--muted)}label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:650}input,select,textarea{min-width:0;width:100%;padding:11px 12px;border:1px solid #cad9d0;border-radius:9px;background:white;color:inherit;min-height:43px}textarea{min-height:80px;resize:vertical}input:focus,select:focus,textarea:focus{outline:2px solid #f28a38;outline-offset:1px}form{display:grid;gap:15px}.split{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,1fr);gap:22px}.toolbar{display:flex;gap:9px;align-items:end;flex-wrap:wrap;margin-bottom:18px}.toolbar>label{flex:1;min-width:130px}.toolbar input.search{flex:1;min-width:140px}.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.product{padding:15px;text-align:left;border-radius:12px;display:flex;flex-direction:column;gap:9px;min-height:125px}.product strong{font-size:13px}.product small,.muted,small{color:var(--muted)}.product .price{font-size:20px;color:var(--pink);font-weight:750}.product .qty{font-size:11px}.scroll{overflow-x:auto;max-width:100%}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;color:var(--muted);font-size:11px;font-weight:650;padding:11px 9px;border-bottom:1px solid var(--border);white-space:nowrap}td{padding:13px 9px;border-bottom:1px solid #f0e9eb;vertical-align:middle;overflow-wrap:anywhere}td input{width:75px;padding:7px;min-height:35px}.row-actions{display:flex;gap:7px;flex-wrap:wrap}.row-actions button{font-size:12px;padding:7px 10px;min-height:34px}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:20px}.stat{padding:18px;border:1px solid var(--border);background:white;border-radius:13px}.stat small{font-size:11px}.stat strong{display:block;font-size:24px;margin-top:7px;letter-spacing:-.03em}.stat.accent{background:#fff1df;border-color:#f7d4ad;color:#953b08}.negative,.danger{color:#b33747}.good{color:#287958}.total{display:flex;justify-content:space-between;align-items:center;padding:18px 0;border-top:1px solid var(--border);margin-top:15px;font-weight:700}.total strong{font-size:28px;color:var(--pink)}.empty{padding:32px 10px;text-align:center;color:var(--muted);font-size:13px}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.full{grid-column:1/-1}.wide{width:100%}.chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}.chip{font-size:11px;background:#edf5ee;padding:6px 9px;border-radius:15px}.item-name{max-width:260px}.section-gap{margin-top:24px}.icon-button{border:0;font-size:18px;padding:7px 12px;background:transparent}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:18px}.dialog-head h2{margin:0}dialog{border:1px solid var(--border);border-radius:18px;width:min(600px,calc(100vw - 24px));max-height:90vh;padding:22px;color:inherit}dialog::backdrop{background:#2c172b88}dialog video{width:100%;max-height:50vh;border-radius:10px;background:#222}#toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:#091f59;color:white;box-shadow:0 6px 28px #251b2933;max-width:calc(100vw - 32px);width:max-content;padding:13px 20px;border-radius:12px;z-index:100}#login-error{color:#b33747}.help{font-size:12px;line-height:1.6;color:var(--muted)}[hidden]{display:none!important}@media(max-width:760px){header{padding:14px 16px}header .brand{font-size:13px}#account{max-width:95px;overflow-wrap:anywhere}.mark{padding:9px}main{padding:23px 14px}.split{grid-template-columns:1fr}.card{padding:16px}.intro{align-items:start}h1{font-size:27px}nav{gap:3px}nav button{font-size:12px;padding:9px 11px;min-height:38px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stats{grid-template-columns:1fr 1fr;gap:8px}.stat{padding:13px}.stat strong{font-size:20px}.badge{font-size:10px;padding:8px}.form-grid{gap:10px}.toolbar{gap:7px}th,td{padding:9px 6px;font-size:11px}.item-name{max-width:130px}.login{margin:2vh auto}.product{min-height:110px;padding:12px}.product .price{font-size:18px}}@media print{header,nav,.toolbar,button,#cash-banner,#toast,.intro{display:none!important}main{padding:0;max-width:none}body{background:white;font-size:11px}.card{border:0;padding:0}.stats{grid-template-columns:repeat(3,1fr)}.stat{break-inside:avoid}.scroll{overflow:visible}table{font-size:10px}tr{break-inside:avoid}h1{display:block}.print-title{display:block!important}}

@media(max-width:760px){#buy-lines .scroll{overflow:visible}#buy-lines table,#buy-lines tbody{display:block}#buy-lines thead{display:none}#buy-lines tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;border:1px solid var(--border);border-radius:12px;padding:12px;margin-bottom:12px}#buy-lines td{display:block;padding:0;border:0}#buy-lines td:first-child{grid-column:1/-1;font-weight:700;max-width:none;margin-bottom:5px}#buy-lines td[data-label]:before{content:attr(data-label);display:block;font-size:11px;color:var(--muted);margin-bottom:5px}#buy-lines input{width:100%;font-size:14px;min-height:40px}#buy-lines td:last-child{text-align:right;grid-column:1/-1}}

/* Espacio de trabajo compacto y adaptable. */
header{padding:12px clamp(12px,2vw,28px);gap:12px}.mark{padding:9px;font-size:17px;border-radius:11px}.brand{gap:9px;font-size:14px}.brand small{font-size:10px;margin-top:2px}
main{max-width:1700px;padding:20px clamp(12px,2vw,28px)}.intro h1{font-size:27px;margin:4px 0 12px}.eyebrow{font-size:10px}.badge{padding:7px 10px}.card{padding:17px;border-radius:13px}h2{font-size:17px;margin-bottom:12px}nav{gap:5px;margin-bottom:15px}nav button{padding:9px 14px;font-size:13px;min-height:40px}.notice{padding:10px 13px;margin-bottom:14px;font-size:13px}.split{grid-template-columns:minmax(0,1.8fr) minmax(320px,1fr);gap:16px}.toolbar{gap:8px;margin-bottom:13px}.grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:9px}.product{padding:12px;min-height:110px;gap:7px}.product .price{font-size:19px}.stats{grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px;margin-bottom:15px}.stat{padding:14px}.stat strong{font-size:22px}.section-gap{margin-top:17px}form{gap:12px}.total{padding:13px 0;margin-top:10px}.total strong{font-size:25px}.chips{gap:6px;margin-bottom:12px}.chip{padding:6px 9px}th{padding:9px 7px}td{padding:10px 7px}.scroll{min-width:0}.split>*,.toolbar>*,.form-grid>*{min-width:0}.login{max-width:440px;margin:clamp(16px,4vh,44px) auto}.login h1{font-size:31px}.form-grid{gap:12px}
@media(min-width:1400px){.grid{grid-template-columns:repeat(auto-fill,minmax(155px,1fr))}}
@media(max-width:1000px){.split{grid-template-columns:minmax(0,1fr) minmax(280px,.85fr);gap:12px}.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.card{padding:14px}nav button{padding-inline:12px}}
@media(max-width:760px){header{padding:10px 12px}.brand{font-size:12px}.mark{padding:8px;font-size:16px}header>div{gap:7px}#account{max-width:90px;font-size:10px}#logout{padding:8px 11px;min-height:38px;font-size:12px}main{padding:15px 12px}.intro h1{font-size:24px}.eyebrow{font-size:9px}.badge{font-size:10px;max-width:145px;text-align:right}.split{grid-template-columns:minmax(0,1fr)}nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}nav button{padding:9px 3px;min-height:42px;font-size:11px}.toolbar{gap:7px}.toolbar button{padding:10px 12px;font-size:12px}.toolbar>label{min-width:120px}.card{padding:13px}.product{min-height:100px;padding:11px;gap:6px}.product strong{font-size:12px}.product .price{font-size:18px}.product small{font-size:10px}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat{padding:12px}.stat strong{font-size:20px}.stat small{font-size:10px}.form-grid{gap:10px}.section-gap{margin-top:13px}#cart td{padding:8px 4px}#cart .item-name{max-width:none;width:45%;font-size:12px}#cart td input{width:58px;padding:6px;min-height:40px}#cart td:last-child{width:32px}#cart .icon-button{padding:5px 8px;min-width:30px;min-height:40px}#cart th{padding-inline:4px;font-size:10px}dialog{padding:16px;max-height:calc(100dvh - 20px)}#report-form{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}#report-form>label{min-width:0}#report-form>button{min-width:0;white-space:normal}#report-body .scroll{overflow:visible}#report-body table,#report-body tbody{display:block}#report-body thead{display:none}#report-body tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;border-bottom:1px solid var(--border);padding:12px 0}#report-body td{display:block;border:0;padding:0;min-width:0;font-size:12px}#report-body td:before{content:attr(data-label);display:block;color:var(--muted);font-size:10px;margin-bottom:4px}#report-body td:first-child{grid-column:1/-1;font-weight:650}#stock-list td{font-size:11px;padding-inline:4px}#stock-list th{padding-inline:4px;font-size:10px}#stock-list td:first-child{width:47%}#stock-list button{padding:7px 9px;min-height:40px;font-size:11px}}
@media(max-width:380px){.form-grid{grid-template-columns:minmax(0,1fr)}.toolbar>label{min-width:100px}.brand{letter-spacing:.02em}.badge{max-width:125px;font-size:9px}#account{max-width:65px}nav{grid-template-columns:repeat(3,minmax(0,1fr))}.stat strong{font-size:18px}.login h1{font-size:27px}}
@media print{#report-body table{display:table}#report-body thead{display:table-header-group}#report-body tbody{display:table-row-group}#report-body tr{display:table-row}#report-body td{display:table-cell;padding:8px}#report-body td:before{display:none}#report-body .scroll{overflow:visible}}

/* Billetita para cambiar de sistema, sin ocupar espacio del contenido. */
#dm-systems{position:fixed;left:env(safe-area-inset-left,0px);top:calc(12px + env(safe-area-inset-top,0px));z-index:10040;margin:0}
#dm-systems>summary{list-style:none;display:grid;place-items:center;width:24px;height:32px;border:1px solid #8fa6bf80;border-radius:0 9px 9px 0;background:#eef4fa;color:#18324c;box-shadow:0 1px 4px #0001;cursor:pointer;opacity:.7}
#dm-systems>summary::-webkit-details-marker{display:none}#dm-systems>summary svg{width:14px;height:14px}#dm-systems[open]>summary svg{transform:rotate(180deg)}#dm-systems>summary:hover,#dm-systems>summary:focus-visible,#dm-systems[open]>summary{opacity:1}#dm-systems>summary:focus-visible{outline:2px solid #78b4ff;outline-offset:3px}
#dm-systems nav{position:absolute;top:40px;left:12px;display:block;width:min(300px,calc(100vw - 24px));max-height:calc(100dvh - 80px);overflow:auto;margin:0;padding:10px;background:white;color:#18324c;border:1px solid #9db0c4;border-radius:12px;box-shadow:0 12px 32px #0004}
#dm-systems:not([open]) nav{display:none}#dm-systems .dm-system-row{display:flex;gap:8px;align-items:center;margin:3px 0}#dm-systems a{color:inherit;display:block;padding:11px 9px;min-height:42px;border-radius:7px;flex:1;min-width:0;overflow-wrap:anywhere;font-size:14px}#dm-systems a:hover,#dm-systems a:focus-visible{background:#e9f1f8}#dm-systems .dm-system-new{flex:0 0 38px;text-align:center}#dm-systems .dm-system-current{background:#e7f2ef;border-radius:7px;font-weight:700}#dm-systems small{display:block;padding:6px;font-size:12px}header .brand{margin-left:16px}
@media print{#dm-systems{display:none!important}}


/* Vistas de trabajo y permisos de Dulce Mundo. */
.view-switch{display:flex;flex-wrap:wrap;gap:6px;padding:5px;margin:0 0 13px;width:max-content;max-width:100%;border:1px solid var(--border);border-radius:12px;background:#fff}.view-switch button{padding:9px 18px;border-color:transparent;min-height:42px;font-size:13px}.view-switch button[aria-pressed=true]{background:#091f59;color:white}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:14px 0}.permission-check{display:flex;flex-direction:row;align-items:center;gap:9px;min-height:42px;border:1px solid var(--border);border-radius:9px;padding:10px;font-size:12px}.permission-check input{width:18px;min-height:18px;height:18px;flex:0 0 18px}.permission-check span{min-width:0}#scan-message{font-size:13px}#scan-manual{border-top:1px solid var(--border);padding-top:12px}#camera{min-height:120px}#access-content td{max-width:330px}#cash-body details{margin-top:18px}@media(max-width:600px){.view-switch{width:100%;display:grid;grid-template-columns:1fr 1fr}.view-switch button{padding-inline:8px}.permission-grid{grid-template-columns:minmax(0,1fr)}#access-content .scroll{overflow:visible}#access-content table,#access-content tbody{display:block}#access-content thead{display:none}#access-content tr{display:grid;grid-template-columns:1fr 1fr;gap:9px;border-bottom:1px solid var(--border);padding:13px 0}#access-content td{display:block;border:0;padding:0;max-width:none}#access-content td:first-child,#access-content td:nth-child(4){grid-column:1/-1}#access-content td:before{content:attr(data-label);display:block;font-size:10px;color:var(--muted);margin-bottom:4px}#sale-reader,#sale-scan{flex:1}}
@media print{.view-switch{display:none!important}}

/* Cambio de vista junto al nombre; el ingreso comienza en Vendedor. */
header .account-actions{min-width:0;flex-wrap:wrap;justify-content:flex-end;gap:6px 9px}
.account-view-button{padding:8px 12px;min-height:40px;border:1px solid #bcd9c5;background:#eef8f0;color:#126b35;font-size:12px;font-weight:650}
.account-view-button:hover,.account-view-button[aria-pressed=true]{border-color:#bd4507;background:#e0f2e5}
@media(max-width:760px){header .account-actions{flex:1}.account-view-button{font-size:11px;min-height:38px;padding:8px 10px}}
@media print{.account-view-button{display:none!important}}

/* Evita el aumento automático de Safari al enfocar campos pequeños. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
@media(max-width:760px),(pointer:coarse){
 body input:not([type=checkbox]):not([type=radio]),body select,body textarea,
 body .dm-users input,body .dm-users select{font-size:16px}
}
@media(max-width:760px){
 header,main,#app,#workspace,.card,.split,.grid,.toolbar,.form-grid{min-width:0;max-width:100%}
 .brand{min-width:0}.brand>span:last-child{overflow-wrap:anywhere}
 .toolbar input.search{flex:1 0 100%;width:100%;min-width:0}
 .toolbar>label{min-width:0;flex-basis:140px}
 .chips{gap:5px}.chip{min-height:36px;font-size:11px;padding:7px 9px;max-width:100%;white-space:normal;overflow-wrap:anywhere}
 .product{min-width:0}.product strong,.product small,.product .qty{overflow-wrap:anywhere}
 #cart td input{width:60px}
}

/* Formulario de producto: código y cámara alineados, lectura cómoda en móvil. */
.product-form .form-grid{align-items:start;row-gap:16px}
.product-code{display:grid;gap:6px;min-width:0}
.product-code-row{display:flex;align-items:center;gap:8px;min-width:0}
.product-code-row input{flex:1;min-width:0}
#product-scan{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:0 0 auto;padding:10px 12px;min-height:43px;font-size:12px;white-space:nowrap}
#product-scan svg{flex:none}
@media(max-width:760px){
 .product-form .form-grid{grid-template-columns:minmax(0,1fr);gap:14px}
 .product-form>button.primary{margin-top:4px}
 .product-form label{font-size:13px}
 #modal:has(.product-form){width:calc(100vw - 24px);padding:18px;max-height:calc(100dvh - 32px);overflow-y:auto}
 #modal:has(.product-form) .dialog-head{margin-bottom:20px}
}

/* Mostrador en lista y confirmación obligatoria de cantidad. */
.sale-list{display:flex;flex-direction:column;gap:0}
.sale-product-row{display:flex;align-items:center;justify-content:space-between;gap:16px;width:100%;min-width:0;min-height:58px;padding:11px 4px;text-align:left;border:0;border-bottom:1px solid var(--border);border-radius:0;background:white}
.sale-product-row:hover{background:#fff6e9}
.sale-product-row:disabled{cursor:default}
.sale-product-info{display:flex;flex-direction:column;gap:4px;min-width:0}
.sale-product-info strong{font-size:13px;overflow-wrap:anywhere}
.sale-product-info small{font-size:11px;font-weight:400}
.sale-product-price{flex:none;color:var(--pink);font-size:17px;font-weight:750}
.sale-quantity-form p{margin:0}
.sale-quantity-form input{font-size:18px}
.quantity-actions{display:flex;gap:9px;flex-wrap:wrap;margin-top:6px}
.quantity-actions button{flex:1}
@media(max-width:760px){.sale-product-row{gap:10px;min-height:56px}.sale-product-price{font-size:16px}.sale-product-info strong{font-size:12px}}

/* Aviso visible de existencias mínimas en el mostrador. */
.sale-product-row.stock-low{background:#fff4da;border-left:3px solid #c58216;padding-left:10px}.sale-product-row.stock-low:hover{background:#ffebbd}.sale-product-row.stock-low .sale-product-info small{color:#80500b;font-weight:650}

/* Identidad Karli Juice · EMI 811 S.A. */
header{border-bottom:3px solid #ed730d}
h1,h2,h3,.brand{color:#091f59}
.brand-logo{display:block;width:112px;height:64px;object-fit:contain;background:white;flex:none}
.login-brand-logo{display:block;width:min(100%,330px);height:auto;margin:0 auto 18px}
.login{max-width:480px;border-top:4px solid #ed730d}
.login .eyebrow{color:#126b35}
.badge{color:#126b35;background:#eaf6ed}
button.primary:hover{background:#963b07;border-color:#963b07}
.sale-product-price,.total strong{color:#b64308}
.account-view-button{color:#126b35;border-color:#bcd9c5;background:#eef8f0}
.account-view-button:hover,.account-view-button[aria-pressed=true]{border-color:#16843e;background:#e0f2e5}
.dm-users button{background:#bd4507;border-color:#bd4507}
.dm-user-actions [data-reset]{background:white;color:#126b35;border-color:#bcd9c5}
.dm-users .dm-user-form{background:#f4faf5;border-color:#d1e3d5}
.dm-users a,.dm-users .dm-user-status{color:#126b35}
@media(max-width:760px){.brand-logo{width:74px;height:43px}.brand small{font-size:9px}.login-brand-logo{width:min(100%,300px)}}
@media print{.login-brand-logo{display:none}}

/* Controles alineados y filtros sin desbordamiento en teléfonos. */
#history-form{display:grid;grid-template-columns:minmax(130px,.7fr) minmax(180px,1fr) auto;align-items:end;gap:12px}
#history-form>label{min-width:0;align-self:stretch}
#history-form input,#history-form select{display:block;min-width:0;max-width:100%;width:100%;min-height:44px}
#history-form>button{min-height:44px;white-space:nowrap}
@media(max-width:760px){
 header{display:grid;grid-template-columns:minmax(0,1fr);gap:10px;padding:10px 12px}
 header .brand{margin-left:16px;width:max-content;max-width:calc(100% - 16px)}
 header .account-actions{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;width:100%;align-items:center;justify-content:stretch}
 header #account{max-width:none;font-size:12px;line-height:1.3}
 header .account-view-button,header #logout{min-height:38px;padding:8px 11px;font-size:12px}
 #tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
 #tabs button{display:flex;align-items:center;justify-content:center;min-height:42px;padding:8px 5px;font-size:12px;line-height:1.25;border-radius:9px;overflow-wrap:anywhere}
 #tabs button:not(.active){border-color:var(--border);background:#fff}
 #history-form{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-bottom:0}
 #history-form>label{font-size:12px;gap:6px;justify-content:flex-end}
 #history-form>button{grid-column:1/-1;width:100%;min-height:42px;padding:10px 12px;font-size:13px}
 #history-form input[type=date],#history-form input[type=month]{box-sizing:border-box;min-width:0;max-width:100%;width:100%;padding-inline:8px}
 #history-form input::-webkit-date-and-time-value{text-align:left;min-width:0}
}


/* Ventanas siempre visibles dentro del area util de la pantalla. */
dialog[open]{box-sizing:border-box;max-width:calc(100vw - 20px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;z-index:2147482000}
dialog[open] .dialog-head{position:sticky;top:-22px;z-index:2;margin-top:-2px;padding:2px 0 12px;background:inherit}
@media(max-width:760px){dialog[open]{width:calc(100vw - 20px);margin:auto;padding:18px;padding-bottom:max(18px,env(safe-area-inset-bottom));max-height:calc(100dvh - 20px)}dialog[open] .dialog-head{top:-18px}}

#buy-lines select{min-width:142px;font-size:14px}#buy-lines [data-unit-cost],#buy-lines [data-units]{display:block;font-weight:650;white-space:nowrap}#buy-lines input[data-key=packageCost]{width:110px}@media(max-width:760px){#buy-lines select{min-width:0;font-size:16px}#buy-lines input[data-key=packageCost]{width:100%}}

/* Avisos en la capa superior, visibles también sobre subventanas abiertas. */
#toast{inset:auto;top:calc(16px + env(safe-area-inset-top,0px));bottom:auto;left:50%;margin:0;transform:translateX(-50%);display:flex;align-items:center;gap:16px;width:max-content;max-width:min(620px,calc(100vw - 24px));padding:16px 18px;border:2px solid #52698d;background:#091f59;color:white;border-radius:12px;box-shadow:0 10px 34px #071b4f55;font-size:15px;font-weight:650;line-height:1.5;z-index:2147483647}
#toast.toast-warning{background:#fff0c7;color:#663e00;border-color:#db8b10}
#toast span{min-width:0;overflow-wrap:anywhere}
#toast button{flex:none;border:0;background:transparent;color:inherit;min-width:36px;min-height:36px;padding:0;font-size:24px;line-height:1}
#toast::backdrop{background:transparent;pointer-events:none}
@media(max-width:760px){#toast{font-size:14px;padding:13px 14px;gap:10px}}

#count-current{font-weight:700;margin:8px 0;color:#091f59}#stock-count-form .row-actions button{flex:1}@media(max-width:600px){#stock-count-form .form-grid{grid-template-columns:minmax(0,1fr)}}

.product-actions{min-width:44px}.product-actions summary{display:grid;place-items:center;cursor:pointer;list-style:none;width:44px;min-height:42px;border:1px solid var(--border);border-radius:10px;font-size:22px;background:#fff;color:#091f59}.product-actions summary::-webkit-details-marker{display:none}.product-actions summary:hover{border-color:var(--pink)}.product-menu{display:grid;gap:7px;margin-top:8px;min-width:155px}.product-menu button{text-align:left;white-space:normal}.delete-product{color:#a02532;border-color:#e6b9bf;background:#fff4f4}button.primary.delete-product{background:#a02532;border-color:#a02532;color:#fff}

.barcode-view{position:relative;background:#111;border-radius:12px;overflow:hidden}.barcode-view #camera{display:block;width:100%;max-height:42dvh;object-fit:contain;border-radius:0}.barcode-guide{position:absolute;pointer-events:none;left:8%;right:8%;top:32%;bottom:32%;border:2px solid #fff;border-radius:8px;box-shadow:0 0 0 100vmax #0003}.barcode-guide:after{content:"";position:absolute;left:4%;right:4%;top:50%;border-top:2px solid #ff8700}

#mobile-sale-bar{display:none}#sale-checkout-slot{min-width:0}#mobile-checkout-body .sale-checkout-panel{padding:0;border:0}#mobile-checkout-body #sale-checkout-panel>h2{display:none}#mobile-checkout-return{width:100%;margin-top:12px}
@media(max-width:760px){
 body.has-mobile-sale{padding-bottom:calc(86px + env(safe-area-inset-bottom))}
 #mobile-sale-bar:not([hidden]){display:block;position:fixed;bottom:0;left:0;right:0;z-index:1000;padding:10px 12px calc(10px + env(safe-area-inset-bottom));background:#fff;border-top:1px solid var(--border);box-shadow:0 -3px 14px #091f5910}
 #mobile-sale-open{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;text-align:left;padding:10px 14px;min-height:54px;font-size:14px}
 #mobile-sale-open>span:first-child{display:grid;gap:2px}#mobile-sale-count{font-size:11px;font-weight:500}#mobile-sale-total{font-size:20px}#mobile-sale-open:disabled{opacity:.65}
 #sale-checkout-slot:empty{display:none}
 #mobile-checkout[open]{position:fixed;inset:auto 0 0;width:100%;max-width:100%;max-height:92dvh;margin:0;border-radius:20px 20px 0 0;padding:16px 16px max(16px,env(safe-area-inset-bottom));border:1px solid var(--border)}
 #mobile-checkout[open] .dialog-head{top:-16px}#mobile-checkout h2{font-size:19px}#mobile-checkout #cart .item-name{overflow-wrap:anywhere;font-size:13px}#mobile-checkout .total{margin-top:4px;padding:10px 0}#mobile-checkout .total strong{font-size:25px}
 #mobile-checkout #pay-form{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}#mobile-checkout #pay-form label{font-size:12px;min-width:0}#mobile-checkout #pay-form input,#mobile-checkout #pay-form select{font-size:16px;min-height:44px;padding:9px;min-width:0}#mobile-checkout #change,#mobile-checkout #pay-form>button{grid-column:1/-1}#mobile-checkout #change{font-size:13px}#mobile-checkout #clear-cart{font-size:12px;min-height:38px}
}
@media print{#mobile-sale-bar,#mobile-checkout{display:none!important}body.has-mobile-sale{padding-bottom:0}}

/* Venta rápida: cantidad visible y controles directos, sin ventanas por producto. */
.sale-product-wrap{display:flex;align-items:center;border-bottom:1px solid var(--border);min-width:0}
.sale-product-wrap .sale-product-row{flex:1;min-width:0;border-bottom:0}
.sale-inline-quantity{display:none}
#exact-cash{justify-self:start;font-size:13px;padding:8px 12px}
@media(max-width:760px){
 .sale-inline-quantity{display:flex;align-items:center;gap:4px;padding-left:8px}
 .sale-inline-quantity button{min-width:44px;min-height:44px;padding:6px;font-size:23px;color:#126b35;border-color:#bcd9c5}
 .sale-inline-quantity output{min-width:22px;text-align:center;font-weight:750;font-size:16px}
 .sale-product-wrap.in-cart{background:#eef8f0;border-radius:9px}
 .sale-product-wrap.in-cart .sale-product-row{background:transparent}
 .sale-product-row{gap:6px;min-height:64px;padding:10px 4px}
 .sale-product-info strong{font-size:14px;line-height:1.3}
 .sale-product-price{font-size:15px}
 body.has-mobile-sale .intro{display:none}
 body.has-mobile-sale #workspace>.split>.card>.toolbar{position:sticky;top:0;z-index:3;background:white;padding:8px 0;margin-top:-8px}
 #mobile-checkout #exact-cash{grid-column:1/-1}
}

@media(max-width:760px){
 .sale-inline-quantity .sale-quantity-button{min-width:44px;min-height:44px;padding:6px;font-size:16px;font-weight:750;color:#091f59;background:white;border:1px dashed #8fa6bf;text-decoration:underline;text-underline-offset:4px}
}

.sale-product-wrap.has-roll{flex-wrap:wrap}.sale-add-roll{flex-basis:100%;margin:4px 0 10px}

/* Filtros de historial: una fila en escritorio y dos filas compactas en móvil. */
.history-filter-card{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:18px;padding:14px 16px}
.history-filter-card>h2{margin:0;font-size:17px}
#history-form{grid-template-columns:minmax(110px,.6fr) minmax(160px,1fr) max-content max-content;gap:10px;margin:0;align-items:end}
#history-form>label{gap:4px}
#history-form>button{grid-column:auto;min-height:44px;width:auto;padding:9px 14px}
@media(max-width:1000px){
 .history-filter-card{display:block}
 .history-filter-card>h2{margin-bottom:10px}
}
@media(max-width:760px){
 .history-filter-card{padding:12px}
 .history-filter-card>h2{font-size:16px;margin-bottom:10px}
 #history-form{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:8px}
 #history-form>label{font-size:11px;gap:4px}
 #history-form>button{grid-column:auto;width:100%;min-height:44px;margin:0;padding:8px 10px;font-size:13px}
 #history-form input,#history-form select{min-height:44px;padding:9px 8px;font-size:16px}
}

/* Shared actions stay within their card at every width. */
.toolbar>*,.row-actions>*,.form-grid>*,.stats>*,.section-heading>*{min-width:0}
button{max-width:100%;white-space:normal;overflow-wrap:anywhere}
.section-heading{display:flex;justify-content:space-between;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:14px}
.section-heading h2{margin-bottom:6px}.section-heading .help{margin:0}
.closing-panel .row-actions button{min-height:44px;font-size:13px}
.closing-panel .stats{grid-template-columns:repeat(auto-fit,minmax(155px,1fr));gap:10px;margin-bottom:12px}
.expense-filter{display:grid;grid-template-columns:minmax(160px,1fr) auto auto;max-width:650px}
.expense-filter>label{min-width:0}
@media(max-width:760px){
 header>div{flex-wrap:wrap;min-width:0}header .brand{min-width:0}
 .intro{align-items:flex-start;flex-wrap:wrap}.intro h1{margin-bottom:10px}
 #tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin-bottom:14px}
 #tabs>button{width:100%;min-width:0;min-height:44px;padding:8px;font-size:13px}
 .toolbar{gap:8px}.toolbar>label{min-width:0;flex-basis:100%}
 .toolbar>button{flex:1 1 120px;min-width:0;min-height:44px}
 .form-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}
 .form-grid label{min-width:0}.stats,.closing-panel .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}
 .stat{padding:12px}.stat strong{font-size:21px;overflow-wrap:anywhere}.stat small{line-height:1.3}
 .section-heading{display:block}.section-heading>.row-actions{margin-top:12px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}
 .section-heading>button{width:100%;margin-top:12px}.section-heading .row-actions>button:only-child{grid-column:1/-1}
 .row-actions button{min-height:44px}.card{padding:14px}.section-gap{margin-top:14px}
 input,select,textarea{font-size:16px;min-height:44px}
 .expense-filter{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:none}
 .expense-filter>label{grid-column:1/-1}
 #history-body table,#expense-body table,.closing-panel table{min-width:0}
 #history-body thead,#expense-body thead,.closing-panel thead{display:none}
 #history-body tbody,#expense-body tbody,.closing-panel tbody{display:grid;gap:10px}
 #history-body tr,#expense-body tr,.closing-panel tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px;border:1px solid var(--border);border-radius:10px;padding:12px}
 #history-body td,#expense-body td,.closing-panel td{display:block;border:0;padding:0;min-width:0}
 #history-body td::before,#expense-body td::before,.closing-panel td::before{content:attr(data-label);display:block;font-size:10px;color:var(--muted);font-weight:650;margin-bottom:4px}
 #history-body td[data-label="Productos vendidos"],#expense-body td[data-label="Motivo"],#history-body td.empty,#expense-body td.empty{grid-column:1/-1}
 #history-body td.empty::before,#expense-body td.empty::before{display:none}
}
@media(max-width:380px){.form-grid{grid-template-columns:minmax(0,1fr)}.full{grid-column:1}.stats .stat strong{font-size:19px}}

/* Daily close beside the history filters, within reach on mobile. */
#history-form{grid-template-columns:minmax(110px,.6fr) minmax(160px,1fr) auto auto auto}
#history-close-day{background:#091f59;border-color:#091f59}
@media(max-width:1180px){
 .history-filter-card{display:block}
 .history-filter-card>h2{margin-bottom:10px}
}
@media(max-width:760px){
 #history-form{grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr)}
 #history-form>#history-close-day{grid-column:1/-1;width:100%;min-height:44px}
}

/* Quantity controls for the current sale on desktop as well as mobile. */
@media(min-width:761px){#sale-products .sale-inline-quantity{display:flex;align-items:center;gap:6px;padding-left:10px}#sale-products .sale-inline-quantity button{min-width:42px;min-height:42px;padding:6px}#sale-products .sale-quantity-button{font-weight:750;border-style:dashed}}


.dm-chart-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px;margin:20px 0}.dm-chart{min-width:0}.dm-chart:last-child{grid-column:1/-1}.dm-chart-row{display:grid;grid-template-columns:minmax(100px,1.2fr) minmax(70px,2fr) minmax(90px,auto);align-items:center;gap:10px;margin:12px 0;font-size:.85rem}.dm-chart-label{overflow-wrap:anywhere}.dm-chart-row strong{text-align:right;white-space:nowrap}.dm-chart-track{height:17px;background:#edf1f6;position:relative;border-radius:3px}.dm-chart-bar{position:absolute;height:100%;background:#bd4507;border-radius:3px}.dm-chart-bar.loss{background:#b42318}.dm-chart-zero{position:absolute;top:-3px;bottom:-3px;border-left:1px solid #64748b}.dm-chart h2{font-size:1.1rem}.dm-chart-row:focus-within{outline:2px solid #091f59}@media(max-width:700px){.dm-chart-grid{grid-template-columns:1fr}.dm-chart-row{grid-template-columns:minmax(75px,1fr) minmax(40px,1fr) auto;gap:6px;font-size:.75rem}}@media print{.dm-chart{break-inside:avoid}.dm-chart-bar{print-color-adjust:exact}}

/* Selector de informe con el tamaño compacto de las acciones. */
select.report-format{width:112px;max-width:100%;min-height:42px;height:42px;flex:0 0 auto;padding:10px 12px;border-radius:10px;font-size:15px;font-weight:600;cursor:pointer}
.row-actions select.report-format{width:150px;min-height:34px;height:34px;padding:7px 10px;font-size:12px}
@media(max-width:760px){select.report-format{font-size:12px;width:104px;justify-self:start}}


/* Responsive viewport sizing: compact sign-in, fluid panels and reachable dialogs. */
@media screen{
 main,#app,#workspace,.card,.intro>*,.split>*,.form-grid>*,.toolbar>*{min-width:0;max-width:100%}
 .login{width:min(100%,480px);margin:clamp(0px,2svh,18px) auto;padding:clamp(14px,2vw,22px)}
 .login-brand-logo{width:min(100%,240px);max-height:clamp(64px,15svh,135px);object-fit:contain;margin:0 auto 10px}
 .login h1{font-size:clamp(23px,3vw,29px);line-height:1.12;margin:8px 0 10px}
 .login p{font-size:13px;line-height:1.4;margin:8px 0 12px}
 #login-form{gap:10px}
 #login-error:empty{display:none}
 #login-error{overflow-wrap:anywhere;margin-bottom:0}
 .brand span,#account,.dialog-head h2{min-width:0;overflow-wrap:anywhere}
 .intro{flex-wrap:wrap}
 dialog[open]{max-width:calc(100% - 20px);max-height:calc(100svh - 24px);max-height:calc(100dvh - 24px);overflow:auto}
 dialog[open] .dialog-head{background:#fff}
 .dialog-head .icon-button{flex-shrink:0}
 input,select,textarea{max-width:100%}
}
@media screen and (max-height:700px){
 body:has(#login:not([hidden])) header{padding-block:6px}
 body:has(#login:not([hidden])) header .brand-logo{width:76px;height:43px}
 body:has(#login:not([hidden])) main{padding-block:10px}
 .login{display:block;max-width:480px;margin:0 auto;padding:14px}
 .login-brand-logo{width:170px;max-height:80px;margin:0 auto 6px}
 .login h1{font-size:24px;margin:6px 0 8px}
 .login p{font-size:12px;margin:6px 0 10px}
 #login-form{gap:8px}
}
@media screen and (max-width:599px){
 .login{margin:0 auto;padding:14px}
 .login-brand-logo{width:190px;max-height:100px}
 .login h1{font-size:24px}
 .login p{font-size:12px}
 .form-grid{grid-template-columns:minmax(0,1fr)}
 .full{grid-column:1/-1}
 .toolbar input.search{min-width:0;flex-basis:100%}
 .total{gap:10px;flex-wrap:wrap}
}

/* Mobile section navigation, like workbook sheets. */
@media screen and (max-width:760px){
 #tabs{display:flex;flex-wrap:nowrap;gap:4px;width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;align-items:stretch;padding:4px 2px 7px;margin:0 0 14px;border-bottom:1px solid var(--border);overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity;scroll-padding-inline:4px;scrollbar-width:thin;scrollbar-color:#9baab8 #edf1f6}
 #tabs>button{flex:0 0 auto;width:auto;max-width:none;min-width:0;min-height:44px;padding:10px 14px;white-space:nowrap;overflow-wrap:normal;font-size:13px;line-height:1.2;border:1px solid var(--border);border-radius:9px 9px 0 0;background:#f0f3f6;color:#42526b;scroll-snap-align:start}
 #tabs>button.active{background:#fff;color:#091f59;border-color:#b8c6d6;border-bottom:3px solid #bd4507;font-weight:750}
 #tabs>button:focus-visible{outline:2px solid #bd4507;outline-offset:-3px}
 .mobile-tabs-help{display:block;margin:0 0 4px;font-size:11px;color:var(--muted)}
}
@media screen and (min-width:761px){.mobile-tabs-help{display:none}}
@media print{.mobile-tabs-help{display:none}}

/* Consistent cash date controls and action sizes. */
@media screen{
 .cash-filter-toolbar{display:grid;grid-template-columns:minmax(180px,240px) repeat(3,minmax(140px,180px));align-items:end;gap:12px;margin-bottom:18px}
 .cash-filter-toolbar>label{min-width:0;gap:6px}
 .cash-filter-toolbar input,.cash-filter-toolbar>button,.cash-filter-toolbar>select.report-format{width:100%;max-width:100%;min-width:0;height:48px;min-height:48px;box-sizing:border-box;padding:9px 12px;font-size:13px;line-height:1.25;margin:0}
 .cash-filter-toolbar>button{white-space:normal}
 .cash-filter-toolbar>select.report-format{justify-self:stretch}
}
@media screen and (max-width:1000px){
 .cash-filter-toolbar{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .cash-filter-toolbar>label{grid-column:1/-1}
}
@media screen and (max-width:760px){
 .cash-filter-toolbar{gap:10px;padding-bottom:4px}
 .cash-filter-toolbar input{font-size:16px}
 .cash-filter-toolbar>button,.cash-filter-toolbar>select.report-format{font-size:12px}
}

/* Compact, clearly separated expense actions. */
@media screen{
 .expense-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:16px}
 .expense-heading h2{margin-bottom:6px}
 .expense-heading>.expense-actions{display:flex;gap:8px;flex-wrap:wrap;margin:0}
 .expense-actions>button{min-height:44px;padding:9px 12px;font-size:13px;line-height:1.25}
 #expenses-filter{gap:10px;margin-bottom:16px}
}
@media screen and (max-width:760px){
 .expense-heading{display:block}
 .expense-heading>div:first-child>.help{display:none}
 .expense-heading>.expense-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
 .expense-heading>.expense-actions>button{grid-column:auto;width:100%;margin:0;min-width:0;min-height:44px;padding:8px;font-size:12px}
 .expense-heading>.expense-actions>button:only-child{grid-column:auto}
 #expenses-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:end;gap:8px;padding-top:12px;border-top:1px solid var(--border)}
 #expenses-filter>label{grid-column:1/-1}
 #expenses-filter>button,#expenses-filter>select.report-format{width:100%;height:44px;min-height:44px;padding:8px 10px;min-width:0;font-size:12px}
}


.report-disclosure>summary{cursor:pointer;font-size:17px;font-weight:700;color:#091f59;min-height:44px;display:list-item;align-content:center;padding:10px 0}.report-disclosure[open]>summary{margin-bottom:12px;border-bottom:1px solid var(--border)}
@media(max-width:760px){.report-disclosure>summary{font-size:15px}}

.login .login-code-preference{flex-direction:row;align-items:center;gap:9px;line-height:1.4}
.login .login-code-preference input{width:18px;min-height:18px;height:18px;flex:none;padding:0}

/* Cash payment actions and change stay side by side at every width. */
#pay-form .cash-payment-tools{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;grid-column:1/-1;align-items:stretch;min-width:0}
#pay-form .cash-payment-tools[hidden]{display:none}
#pay-form #exact-cash{justify-self:stretch;width:100%;min-height:76px;margin:0;padding:12px 8px;background:#091f59;color:#fff;border:2px solid #091f59;border-radius:12px;font-size:18px;font-weight:800;line-height:1.2;box-shadow:0 3px 8px #091f5926}
#pay-form #exact-cash:hover{background:#173e87;border-color:#173e87}
#pay-form #exact-cash:focus-visible{outline:3px solid #bd4507;outline-offset:3px}
#pay-form #change{grid-column:auto;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:76px;padding:10px 8px;border:2px solid #a7d9ba;border-radius:12px;background:#edf9f1;color:#126b35;line-height:1.2;text-align:center}
#pay-form #change span{font-size:17px;font-weight:700}
#pay-form #change-amount{font-size:clamp(23px,3vw,30px);font-weight:850;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#mobile-checkout #pay-form #exact-cash,#mobile-checkout #pay-form #change{grid-column:auto}

/* Desktop uses the connected barcode reader directly. */
@media screen and (min-width:761px){
 #sale-reader,#sale-scan{display:none}
}

/* The sale total leads; cash assistance stays compact. */
#cart .sale-total{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin:8px 0 16px;padding:18px 16px;background:#fff1df;border:2px solid #efb47a;border-radius:12px;color:#953b08}
#cart .sale-total span{font-size:19px;font-weight:800}
#cart .sale-total strong{font-size:clamp(32px,3.5vw,40px);font-weight:900;line-height:1.15;color:#b64308;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
#pay-form #exact-cash{min-height:56px;padding:8px;font-size:15px;font-weight:700;background:#eef2fb;color:#091f59;border:1px solid #c6d1e8;box-shadow:none}
#pay-form #exact-cash:hover{background:#e0e8f8;border-color:#91a5cd}
#pay-form #change{min-height:56px;padding:7px 8px;gap:2px;border-width:1px}
#pay-form #change span{font-size:14px;font-weight:650}
#pay-form #change-amount{font-size:22px;font-weight:750}

/* Both final actions fill the checkout width evenly. */
#pay-form .sale-final-actions{width:100%;min-width:0;justify-self:stretch}
#pay-form .sale-final-actions>button{width:100%;max-width:none;min-width:0;min-height:52px;align-self:stretch;margin:0;padding:10px 8px;box-sizing:border-box}
#mobile-checkout #pay-form .sale-final-actions{grid-column:1/-1;width:100%}
#mobile-checkout #pay-form .sale-final-actions>button{grid-column:auto;min-height:52px}

/* Keep checkout actions in one horizontal row without inline styles. */
#pay-form .sale-final-actions,#mobile-checkout #pay-form .sale-final-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);grid-auto-flow:row;gap:10px;grid-column:1/-1;align-items:stretch;width:100%}
#pay-form .sale-final-actions>button,#mobile-checkout #pay-form .sale-final-actions>button{grid-column:auto;grid-row:1;width:100%;min-width:0;min-height:52px}

/* Expiry picker: one selection step at a time, with direct buttons. */
.expiry-step-picker{width:min(600px,calc(100vw - 24px))}
.expiry-context{margin:0 0 14px;font-weight:650;color:#607067}
.expiry-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;max-height:45dvh;overflow-y:auto;padding:4px}
.expiry-options>button{min-height:46px;min-width:0;padding:9px 5px;font-size:16px}
.expiry-options>button:hover:not(:disabled),.expiry-options>button:focus-visible{background:#091f59;color:white;border-color:#091f59}
.expiry-options>button:disabled{cursor:default}
.expiry-actions{margin-top:16px;padding-top:12px;border-top:1px solid var(--border)}
@media(max-width:380px){.expiry-options{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* Sales and internal consumption share period filters. */
.history-filter-card>#history-kinds{grid-column:1/-1;margin:0;display:flex;gap:8px;flex-wrap:wrap}
.history-filter-card:has(#history-kinds)>#history-form{grid-column:1/-1}
#history-kinds>button{min-height:44px;padding:10px 14px;border:1px solid var(--border)}
#history-kinds>button.active{background:#091f59;color:#fff}
#pay-form select[name=payment],#pay-form select[name=payment] option{text-transform:uppercase}

/* Checkout first; exact amount remains a secondary action below it. */
#pay-form .cash-payment-tools>button[type=submit]{width:100%;min-width:0;min-height:56px;padding:8px;font-size:15px}
#pay-form .cash-payment-tools:has(#change[hidden]){grid-template-columns:minmax(0,1fr)}
#pay-form .sale-final-actions:has(#exact-cash[hidden]){grid-template-columns:minmax(0,1fr)}

/* The register action leads; clearing the draft stays compact. */
#pay-form .cash-payment-tools>button[type=submit]{min-height:60px;padding:13px 12px;font-size:18px;font-weight:800;box-shadow:0 3px 8px #bd45072b}
#pay-form #clear-cart,#mobile-checkout #pay-form #clear-cart{width:auto;max-width:100%;min-height:34px;justify-self:end;align-self:center;padding:6px 12px;font-size:12px;font-weight:500;background:transparent;color:#607067;border:1px solid #dce4df;box-shadow:none}
#pay-form #clear-cart:hover{color:#953b08;border-color:#bd4507;background:#fff8f0}

/* More readable date, time and cash status. */
#day.badge{font-size:15px;font-weight:650;padding:10px 14px;line-height:1.4}
@media(max-width:760px){#day.badge{font-size:13px;padding:9px 12px;max-width:100%;white-space:normal}}

/* Wi-Fi mayoreo keeps its payment and receipt separate from the store. */
.wifi-payment-amount{font-size:22px;font-weight:800;color:#091f59;padding:14px;background:#fff1df;border-radius:10px}
.wifi-cash-confirm{display:flex;flex-direction:row;align-items:center;gap:10px}
.wifi-cash-confirm input{width:20px;height:20px;min-height:20px;flex:none}
.wifi-connection-qr{display:block;width:220px;max-width:100%;margin:12px auto;background:white}
#history-kinds button,#wifi-new{min-height:44px}

/* Wi-Fi sale opens directly from the date and time area. */
.date-wifi-actions{display:flex;align-items:center;justify-content:flex-end;gap:10px;min-width:0;max-width:100%}
.wifi-quick-button{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;min-height:48px;flex:0 0 48px;padding:10px;border-radius:50%;border:1px solid #b9d2f5;background:#eaf2ff;color:#1756a9}
.wifi-quick-button svg{width:26px;height:26px}
.wifi-quick-button:hover{background:#d7e7ff;border-color:#1756a9}
.wifi-quick-button:focus-visible{outline:3px solid #bd4507;outline-offset:3px}
@media(max-width:760px){
 body.has-mobile-sale .intro:has(#wifi-quick-sale:not([hidden])){display:flex}
 body.has-mobile-sale .intro:has(#wifi-quick-sale:not([hidden]))>div:first-child{display:none}
 .date-wifi-actions{width:100%;gap:8px}
 .date-wifi-actions #day{min-width:0}
}

.wifi-qr-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:16px 0}
.wifi-qr-step{padding:14px;border:1px solid #cfdaea;border-radius:12px;min-width:0;text-align:center}
.wifi-qr-step h3{margin:0 0 10px;color:#091f59;font-size:17px}
.wifi-qr-step p{overflow-wrap:anywhere}
.wifi-qr-step .wifi-connection-qr{width:220px;height:auto}
@media(max-width:600px){.wifi-qr-steps{grid-template-columns:minmax(0,1fr)}}

/* Blue signal sweeps from the closest arc outward. */
.wifi-quick-button .wifi-wave{animation:wifi-signal-sweep 1.8s ease-in-out infinite;stroke:#a8c9f2}
.wifi-quick-button .wifi-wave-inner{animation-delay:0s}
.wifi-quick-button .wifi-wave-middle{animation-delay:.22s}
.wifi-quick-button .wifi-wave-outer{animation-delay:.44s}
@keyframes wifi-signal-sweep{0%,70%,100%{stroke:#a8c9f2}25%{stroke:#087de0}45%{stroke:#1756a9}}
@media(prefers-reduced-motion:reduce){.wifi-quick-button .wifi-wave{animation:none;stroke:currentColor}}

/* Opciones de cuenta: menú compacto en teléfono. */
#account-menu{position:relative}
#account-menu>summary{display:none;list-style:none;cursor:pointer}
#account-menu>summary::-webkit-details-marker{display:none}
.account-menu-items{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
@media(max-width:760px){
 header .account-actions{flex:0 1 auto;flex-wrap:nowrap;gap:8px}
 #account{max-width:110px}
 #account-menu:has(#logout[hidden]){display:none}
 #account-menu>summary{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--border);border-radius:10px;background:white;color:#091f59;font-size:24px}
 #account-menu>summary:focus-visible{outline:2px solid var(--pink);outline-offset:2px}
 #account-menu .account-menu-items{position:absolute;right:0;top:52px;z-index:10050;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:min(260px,calc(100vw - 24px));padding:12px;background:white;border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 28px #091f5933}
 #account-menu .account-menu-items button{width:100%;min-height:46px;text-align:left;padding:12px;font-size:14px;white-space:normal}
}
@media print{#account-menu{display:none!important}}

/* Menú de cuenta compacto en todos los dispositivos. */
header .account-actions{flex:0 1 auto;flex-wrap:nowrap;gap:8px}
#account-menu:has(#logout[hidden]){display:none}
#account-menu>summary{display:grid;place-items:center;width:44px;height:44px;border:1px solid var(--border);border-radius:10px;background:white;color:#091f59;font-size:24px}
#account-menu>summary:focus-visible{outline:2px solid var(--pink);outline-offset:2px}
#account-menu .account-menu-items{position:absolute;right:0;top:52px;z-index:10050;display:flex;flex-direction:column;align-items:stretch;gap:8px;width:min(260px,calc(100vw - 24px));padding:12px;background:white;border:1px solid var(--border);border-radius:12px;box-shadow:0 8px 28px #091f5933}
#account-menu .account-menu-items button{width:100%;min-height:46px;text-align:left;padding:12px;font-size:14px;white-space:normal}

/* Keep the previous screen visible until an automatic release is ready. */
.dm-update-restoring>body{visibility:hidden}
.dm-update-preview{position:fixed;inset:0;z-index:2147483647;overflow:auto;background:#fbfcf8;color:#172b4d}

body[data-pharmacy="1"] [data-tab="conteo"]{display:none}

/* Keep negative amounts red, including accented summary cards and charts. */
.stats .stat strong.negative,.dm-chart-row strong.negative,.chip .negative,td .negative{color:#b42318}

.report-subtabs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}.report-subtabs button{flex:1 1 145px}.report-subtabs button.active{background:var(--pink);border-color:var(--pink);color:#fff}

/* Shared navigation treatment for every secondary tab group. */
.report-navigation{padding:18px;border:1px solid #ccd6e2;border-radius:12px;background:#f0f3f7;margin-bottom:24px;box-shadow:0 2px 6px #142c4d06}
.report-navigation-heading{display:flex;justify-content:space-between;align-items:baseline;flex-wrap:wrap;gap:6px 18px;margin-bottom:14px}
.report-navigation-heading h2{margin:0;color:#142c4d;font-size:15px;font-weight:750}
.report-navigation-heading p{margin:0;color:#536376;font-size:12px;line-height:1.5}
:is(#report-subtabs,#inventory-subtabs,#history-kinds){display:flex;flex-wrap:wrap;margin:0;gap:8px}
:is(#report-subtabs,#inventory-subtabs,#history-kinds) button{position:relative;flex:1 1 145px;min-height:52px;padding:12px 16px;border:1px solid #c9d3df;border-radius:8px;background:#fff;color:#33465d;font-weight:650;box-shadow:0 1px 2px #142c4d08;transition:background .12s,border-color .12s}
:is(#report-subtabs,#inventory-subtabs,#history-kinds) button:hover{background:#e5ebf3;border-color:#7188a4}
:is(#report-subtabs,#inventory-subtabs,#history-kinds) button.active{background:#142c4d;border-color:#142c4d;color:#fff;box-shadow:0 2px 4px #142c4d22}
:is(#report-subtabs,#inventory-subtabs,#history-kinds) button.active::after{content:'';position:absolute;left:18px;right:18px;bottom:0;height:3px;background:#e79958;border-radius:3px 3px 0 0}
:is(#report-subtabs,#inventory-subtabs,#history-kinds) button:focus-visible{outline:3px solid #3269a9;outline-offset:3px}
.history-navigation{margin:0 0 20px}
@media(max-width:600px){.report-navigation{padding:14px;margin-bottom:20px}.report-navigation-heading{display:block}.report-navigation-heading p{margin-top:5px}:is(#report-subtabs,#inventory-subtabs,#history-kinds){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}:is(#report-subtabs,#inventory-subtabs,#history-kinds) button{min-width:0;min-height:56px;padding:10px 9px;font-size:12px;overflow-wrap:anywhere}}
@media print{.report-navigation{display:none!important}}
.credit-customer-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:14px}
.credit-customer-card{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:6px 10px;align-items:center;text-align:left;padding:12px 14px;border:1px solid #e7c9b3;border-left:3px solid var(--pink);border-radius:10px;background:#fffaf5;min-width:0}
.credit-customer-card:hover{background:#fff0e3;border-color:var(--pink)}
.credit-customer-name{font-size:14px;font-weight:750;overflow-wrap:anywhere}
.credit-customer-status{font-size:10px;color:#76300b;font-weight:500}
.credit-customer-balance{text-align:right;white-space:nowrap}.credit-customer-balance strong{font-size:18px;color:#091f59}
.credit-customer-link{font-size:10px;color:var(--pink);text-align:right;font-weight:600}
.credit-customer-card.settled{border-color:#d2e3d7;border-left-color:#287043;background:#f7fbf8}.credit-customer-card.settled .credit-customer-status{color:#245d36}
#credit-delete-customer:disabled{cursor:not-allowed}
@media(max-width:1000px){.credit-customer-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.credit-customer-grid{grid-template-columns:1fr;gap:8px}.credit-customer-card{padding:10px 12px;gap:4px 10px}.credit-customer-name{font-size:14px}.credit-customer-balance strong{font-size:17px}}

/* Fluid workspace and compact history controls across desktop, tablet and phone. */
@media screen{
 main{width:100%;padding-inline:clamp(14px,2.5vw,28px)}
 #app,#workspace,.card,.split,.grid,.stats,.form-grid,.toolbar,.row-actions{min-width:0;max-width:100%}
 .split>* ,.form-grid>* ,.stats>*{min-width:0}
 .toolbar{row-gap:12px}.toolbar>label{min-width:0;flex:1 1 150px}.toolbar>button,.toolbar>select{max-width:100%;white-space:normal}
 .row-actions{flex-wrap:wrap;gap:8px}.row-actions>button{max-width:100%;white-space:normal}
 .stats{grid-template-columns:repeat(auto-fit,minmax(min(100%,175px),1fr));gap:12px}
 .stat strong{font-size:clamp(20px,2vw,28px);overflow-wrap:anywhere}.stat small{line-height:1.5}
 .card p,.notice,.help,td{overflow-wrap:anywhere}
 .scroll{width:100%;min-width:0;overscroll-behavior-inline:contain}
 .history-filter-card{padding:16px}
 .history-filter-heading{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px 18px;margin-bottom:12px}
 .history-filter-heading h2{font-size:16px;margin:0}
 .history-filter-heading #history-kinds{width:auto;gap:6px;flex-wrap:wrap}
 .history-filter-heading #history-kinds button{flex:0 1 auto;min-height:42px;padding:8px 14px;font-size:13px}
 #history-form{margin:0;gap:10px;align-items:end}#history-form>label{flex:1 1 150px;max-width:240px}
 #history-form>button,#history-form>select{min-height:43px;font-size:13px}
 #office-preview{max-width:100%;white-space:normal;font-size:12px;padding:8px 12px}
 dialog{width:min(640px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}
}
@media screen and (min-width:761px) and (max-width:1050px){
 .split{grid-template-columns:minmax(0,1fr);gap:18px}
 .dm-chart-grid{grid-template-columns:minmax(0,1fr)}
 .card{padding:18px}.form-grid{gap:14px}
 .intro{flex-wrap:wrap}.intro>div{min-width:0;max-width:100%}
}
@media screen and (max-width:760px){
 header{flex-wrap:wrap;gap:10px;padding:12px 14px}header>.brand{flex:1 1 180px}header>.account-actions{flex:1 1 180px;justify-content:flex-end;flex-wrap:wrap}
 .intro{flex-wrap:wrap;gap:10px}.intro>div{min-width:0;max-width:100%}
 .history-filter-card{padding:12px}.history-filter-heading{gap:10px;margin-bottom:12px}
 .history-filter-heading #history-kinds{display:flex;width:100%}.history-filter-heading #history-kinds button{flex:1;min-height:42px;padding:8px;font-size:12px}
 #history-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}#history-form>label{max-width:none;min-width:0}
 #history-form>button,#history-form>select{width:100%;min-width:0;white-space:normal}
 .stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat{padding:13px}.stat strong{font-size:clamp(18px,4.8vw,24px)}
 .dm-chart-row{grid-template-columns:minmax(0,1fr) minmax(30px,1fr) auto}.dm-chart-row strong{font-size:12px}
}
@media screen and (max-width:380px){.stats{grid-template-columns:minmax(0,1fr)}.form-grid{grid-template-columns:minmax(0,1fr)}.dm-chart-row{grid-template-columns:minmax(0,1fr) auto}.dm-chart-track{grid-column:1/-1;grid-row:auto}}

/* Compact secondary navigation with reliable touch spacing. */
@media screen{
 .report-navigation{padding:12px;margin-bottom:16px}
 .report-navigation-heading{gap:4px 12px;margin-bottom:8px}
 .report-navigation-heading h2{font-size:13px}
 .report-navigation-heading p{font-size:11px}
 :is(#report-subtabs,#inventory-subtabs,#history-kinds){gap:6px}
 :is(#report-subtabs,#inventory-subtabs,#history-kinds) button{flex:1 1 125px;min-width:0;min-height:44px;padding:8px 11px;font-size:12px;line-height:1.35;height:auto;align-self:stretch}
 .row-actions{display:flex;flex-wrap:wrap;align-items:stretch;gap:8px}
 .row-actions>button{min-width:0;flex:1 1 140px;line-height:1.4}
}
@media screen and (max-width:760px){
 .report-navigation{padding:10px;margin-bottom:12px;border-radius:10px}
 .report-navigation-heading{margin-bottom:7px}.report-navigation-heading p{display:none}
 :is(#report-subtabs,#inventory-subtabs,#history-kinds){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;width:100%;align-items:stretch}
 :is(#report-subtabs,#inventory-subtabs,#history-kinds) button{margin:0;min-height:44px;padding:7px 8px;min-width:0;max-width:100%;font-size:12px;height:auto;white-space:normal;overflow-wrap:break-word}
 .history-filter-heading #history-kinds{display:grid;gap:6px}
 .history-filter-heading #history-kinds button{min-width:0;min-height:44px;padding:7px 8px;height:auto;line-height:1.35}
 .toolbar,.row-actions,.section-heading{gap:8px}
 .toolbar>button,.toolbar>select,.row-actions>button,.section-heading>button{height:auto;min-height:44px;min-width:0;max-width:100%;white-space:normal;overflow-wrap:break-word;line-height:1.4;margin:0;align-self:stretch}
 .toolbar>button{flex:1 1 130px}
 .section-heading>.row-actions{width:100%;gap:8px}
 .section-heading>.row-actions>button{width:100%;min-width:0}
 .cash-filter-toolbar>button,.cash-filter-toolbar>select.report-format,#expenses-filter>button,#expenses-filter>select.report-format{height:auto;min-height:44px;line-height:1.4;white-space:normal}
 .cash-filter-toolbar{align-items:stretch}
 #history-form>button,#history-form>select{grid-column:auto;min-width:0;width:100%;height:auto;min-height:44px;line-height:1.4}
 .dialog-head{gap:10px;align-items:flex-start}.dialog-head h2{flex:1;min-width:0;overflow-wrap:anywhere}.dialog-head>.icon-button{flex:0 0 40px;min-height:40px}
 dialog .row-actions{gap:8px}dialog .row-actions>button{min-width:0;max-width:100%;flex:1 1 120px}
}

/* Query filters: fluid columns and contained native date controls, including iOS. */
@media screen{
 .toolbar.auto-query-filter{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,180px),1fr));align-items:end;gap:12px;margin-bottom:12px}
 .toolbar.auto-query-filter>label{display:flex;flex-direction:column;gap:6px;min-width:0;margin:0}
 .toolbar.auto-query-filter input,.toolbar.auto-query-filter select,.toolbar.auto-query-filter>button{display:block;box-sizing:border-box;width:100%;min-width:0;max-width:100%;min-height:44px;margin:0;line-height:1.3}
 .toolbar.auto-query-filter input[type=date],.toolbar.auto-query-filter input[type=month]{appearance:none;-webkit-appearance:none}
 .toolbar.auto-query-filter input::-webkit-date-and-time-value{min-width:0;text-align:left}
 .toolbar.auto-query-filter>select,.toolbar.auto-query-filter>button{align-self:end}
 .toolbar.auto-query-filter>label[hidden],.toolbar.auto-query-filter>[hidden]{display:none}
 #expenses-filter.auto-query-filter>label{grid-column:auto}
}
@media screen and (max-width:600px){
 .toolbar.auto-query-filter{grid-template-columns:minmax(0,1fr);gap:10px}
 .toolbar.auto-query-filter input,.toolbar.auto-query-filter select{font-size:16px}
}

/* Every row shares the chart's columns; text length cannot shift the tracks. */
.dm-chart-rows{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(40px,2fr) max-content;align-items:center;gap:12px 10px;margin:12px 0}
.dm-chart-rows>.dm-chart-row{display:grid;grid-column:1/-1;grid-template-columns:subgrid;align-items:center;column-gap:inherit;row-gap:8px;margin:0;min-width:0}
.dm-chart-rows .dm-chart-label{grid-column:1;grid-row:1;min-width:0}
.dm-chart-rows .dm-chart-track{grid-column:2;grid-row:1;min-width:0;width:100%}
.dm-chart-rows .dm-chart-row>strong{grid-column:3;grid-row:1;font-variant-numeric:tabular-nums}
@media(max-width:700px){
 .dm-chart-rows{grid-template-columns:minmax(0,1.1fr) minmax(30px,1fr) max-content;column-gap:6px}
}
@media screen and (max-width:420px){
 .dm-chart-rows{grid-template-columns:minmax(0,1fr) max-content;row-gap:16px}
 .dm-chart-rows .dm-chart-label{grid-column:1;grid-row:1}
 .dm-chart-rows .dm-chart-row>strong{grid-column:2;grid-row:1}
 .dm-chart-rows .dm-chart-track{grid-column:1/-1;grid-row:2}
}


.barcode-selection-list{display:grid;gap:6px;max-height:52dvh;overflow:auto;padding:2px}
.barcode-selection-item{display:flex;flex-direction:row;align-items:center;gap:12px;padding:10px;border:1px solid var(--border);border-radius:8px;min-height:50px;cursor:pointer}
.barcode-selection-item input[type=checkbox]{width:20px;height:20px;min-height:20px;flex:0 0 20px;accent-color:#142c4d}
.barcode-selection-item span{display:flex;flex-direction:column;gap:4px;min-width:0}.barcode-selection-item small{font-weight:400;overflow-wrap:anywhere}.barcode-selection-item:has(input:checked){background:#eef3f9;border-color:#91a5c0}


/* Discreet provider identity and support contact on every screen. */
.dm-brand-watermark{position:fixed;right:20px;bottom:22px;z-index:5;pointer-events:none;user-select:none;color:#142c4d;opacity:.07;font-size:clamp(22px,3.5vw,38px);font-weight:850;letter-spacing:.07em;line-height:1}
.dm-support-footer{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:8px 18px;margin-top:28px;padding:16px 8px 10px;border-top:1px solid var(--border);font-size:11px;line-height:1.6;color:var(--muted);position:relative;z-index:6}
.dm-support-footer a{color:#334f73;overflow-wrap:anywhere}.dm-support-footer a:hover{text-decoration:underline}#dm-report-problem{border:1px solid #c8d3df;border-radius:7px;padding:6px 10px;font-weight:650}
@media(max-width:760px){.dm-support-footer{gap:7px 12px;padding:14px 4px;font-size:11px}.dm-support-footer>span{flex-basis:100%;text-align:center}.dm-brand-watermark{right:12px;bottom:18px}.has-mobile-sale .dm-brand-watermark{bottom:110px}}
@media print{.dm-brand-watermark,.dm-support-footer{display:none!important}}

/* Preserve original checkout layout; change clear-sale colors only. */
#pay-form #clear-cart,#mobile-checkout #pay-form #clear-cart{background:#151515;color:#fff}
#pay-form #clear-cart:hover,#mobile-checkout #pay-form #clear-cart:hover{background:#151515;color:#fff}

/* Account configuration stays grouped inside the existing menu. */
#dm-settings,#dm-support{width:100%;min-width:0}
#dm-settings>summary{cursor:pointer;border:1px solid var(--border);border-radius:9px;padding:12px;font-size:14px;font-weight:700;background:#f3f5f8;color:#172b4d}
#dm-settings .dm-settings-items{display:grid;gap:6px;padding:8px 0 0 10px}
#dm-settings .dm-settings-items button{font-size:13px}
#dm-support>summary{cursor:pointer;border:1px solid var(--border);border-radius:9px;padding:12px;font-size:14px;font-weight:700;background:#f3f5f8;color:#172b4d}
#dm-support .dm-support-items{display:grid;gap:6px;padding:8px 0 0 10px}
#dm-support .dm-support-items a{display:block;min-height:44px;padding:10px;border:1px solid var(--border);border-radius:7px;color:#334f73;font-size:13px;line-height:1.5;overflow-wrap:anywhere;text-decoration:none}
#dm-support .dm-support-items a:hover{background:#f3f5f8}
#dm-support .dm-support-items a:focus-visible{outline:2px solid var(--pink);outline-offset:2px}
.dm-mail-actions{margin-top:14px}
.dm-mail-check{display:flex;flex-direction:row;align-items:center;gap:9px}
.dm-mail-check input{width:18px;height:18px;min-height:18px;flex:none}
.dm-mail-help{margin-top:12px}
#dm-mail-status{overflow-wrap:anywhere}
#dm-mail-form [hidden]{display:none}



/* Initial loading only. Background updates keep the existing screen. */
#dm-initial-loading{position:fixed;inset:0;z-index:12000;display:grid;place-items:center;background:#fbfcf8;padding:24px}
#dm-initial-loading[hidden],.dm-update-restoring #dm-initial-loading{display:none}
.dm-loader-card{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:340px;text-align:center;color:#173a69}
.dm-loader-worker{width:min(260px,65vw);height:auto}
.dm-loader-card>strong{font-size:25px;font-weight:850}
.dm-loader-card>span{font-size:14px;color:#607067}
.dm-loader-card>small{font-size:11px;color:#607067;margin-top:8px}
.dm-loader-arm{transform-origin:109px 79px;animation:dm-worker-type .65s ease-in-out infinite alternate}
.dm-loader-code{animation:dm-code-pulse 1.3s ease-in-out infinite alternate}
.dm-loader-gear{transform-origin:219px 143px;animation:dm-gear-turn 5s linear infinite}
.dm-loader-progress{width:160px;height:4px;overflow:hidden;border-radius:4px;background:#e3e8ef}
.dm-loader-progress>span{display:block;width:45%;height:100%;border-radius:4px;background:#bd4507;animation:dm-load-progress 1.5s ease-in-out infinite alternate}
@keyframes dm-worker-type{to{transform:rotate(-7deg)}}
@keyframes dm-gear-turn{to{transform:rotate(360deg)}}
@keyframes dm-code-pulse{to{opacity:.4}}
@keyframes dm-load-progress{to{transform:translateX(125%)}}
@media(prefers-reduced-motion:reduce){
 .dm-loader-arm,.dm-loader-code,.dm-loader-gear,.dm-loader-progress>span{animation:none}
}
/* Desktop sales use the viewport; only the product list grows and scrolls.
   Phones, touch tablets and short windows retain normal document scrolling. */
@media screen and (min-width:1051px) and (min-height:620px) and (pointer:fine){
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace){height:100dvh;overflow:hidden;display:flex;flex-direction:column}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace)>header{flex:none}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace)>main{flex:1;min-height:0;display:flex;flex-direction:column;padding-block:12px 8px}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #app{flex:1;min-height:0;display:flex;flex-direction:column}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) .intro,
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #tabs,
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #cash-banner,
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) .dm-support-footer{flex:none}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #tabs{margin-bottom:12px}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #workspace{flex:1;min-height:0}
 .dm-sale-workspace{height:100%;min-height:0;grid-template-rows:minmax(0,1fr)}
 .dm-sale-workspace>.dm-sale-products-panel{min-height:0;display:flex;flex-direction:column;overflow:hidden}
 .dm-sale-products-panel>.toolbar,.dm-sale-products-panel>#daily-sales-summary{flex:none}
 .dm-sale-products-panel>#sale-products{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;padding-right:6px}
 .dm-sale-products-panel>#sale-products>*{flex-shrink:0}
 .dm-sale-products-panel>#sale-products>h2{position:sticky;top:0;z-index:1;background:#fff;padding:8px 0;margin-top:0}
 .dm-sale-workspace>#sale-checkout-slot{min-height:0}
 .dm-sale-workspace #sale-checkout-panel{height:100%;max-height:none;overflow:visible}
}
@media print{#dm-initial-loading{display:none!important}}

/* The phone page stays movable, with a bounded list that can follow new scans. */
@media screen and (max-width:1050px),screen and (max-height:619px){
 .dm-sale-products-panel>#sale-products{max-height:52dvh;overflow-y:auto;overscroll-behavior-y:contain}
 .dm-sale-products-panel>#sale-products>*{flex-shrink:0}
 .dm-sale-products-panel>#sale-products>h2{position:sticky;top:0;background:white;z-index:1;padding:6px 0}
}
#dm-support-form details{margin:8px 0}


/* Preserve the original brand and checkout sizes; compact only product headings. */
.dm-sale-products-panel>#daily-sales-summary{margin:0 0 6px;font-size:13px;line-height:1.4}
.dm-sale-products-panel>.toolbar{margin-bottom:8px}
.dm-sale-products-panel>#sale-list-title{flex:none;margin:0 0 8px;font-size:16px;line-height:1.3}
.dm-sale-products-panel #sale-search{min-height:44px;padding-block:9px}
.date-wifi-actions{flex-wrap:wrap}
.cash-clock-status{font-size:15px;font-weight:650;line-height:1.4;white-space:nowrap;padding:10px 14px}
.cash-clock-status.closed,.cash-clock-status.unopened{background:#fff1df;color:#953b08}
@media screen and (min-width:1051px) and (min-height:620px) and (pointer:fine){
 .dm-sale-products-panel{padding:14px}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) #cash-banner{display:none}
 body:has(#app:not([hidden])):has(#workspace>.dm-sale-workspace) .dm-support-footer{margin-top:8px}
}
@media(max-width:760px){.cash-clock-status{font-size:13px;padding:9px 12px}}
/* Photorealistic four-frame typing loop. */
.dm-loader-worker-real{position:relative;width:min(260px,55vw,45svh);aspect-ratio:1;overflow:hidden}
.dm-loader-sprite{position:absolute;left:0;top:0;width:200%;height:200%;max-width:none;animation:dm-real-technician-work 1.6s steps(1,end) infinite}
@keyframes dm-real-technician-work{0%,100%{transform:translate(0,0)}25%{transform:translate(-50%,0)}50%{transform:translate(0,-50%)}75%{transform:translate(-50%,-50%)}}
@media(prefers-reduced-motion:reduce){.dm-loader-sprite{animation:none}}

/* Keep name lookup separate from the scrolling sale list. */
.dm-product-search{display:flex;flex-direction:column;gap:10px}
.dm-product-search>label{margin:0}
#dm-product-query{width:100%;font-size:16px;min-height:46px}
#dm-product-results{overflow-y:auto;max-height:58dvh;overscroll-behavior:contain;padding-right:4px}
.dm-search-result{border:1px solid #c8d5df;border-left:3px solid #a7bcd0;border-radius:12px;padding:4px;margin:0 0 10px;background:#f5f8fb;overflow:hidden}
.dm-search-result:focus-within{border-color:#6d8dab;box-shadow:0 0 0 1px #6d8dab}
.dm-search-product{display:flex;align-items:center;justify-content:space-between;gap:14px;width:100%;text-align:left;padding:12px;min-height:66px;border:0;background:transparent;border-radius:8px}
.dm-search-product:hover,.dm-search-product:focus-visible{background:#fff4e4}
.dm-search-product>span{display:flex;flex-direction:column;gap:5px;min-width:0;overflow-wrap:anywhere}
.dm-search-product small{color:var(--muted);font-weight:400}
.dm-search-product>strong{white-space:nowrap;color:#bd4507}
.dm-search-pack{display:block;width:calc(100% - 16px);min-height:42px;margin:4px 8px 8px;font-size:13px;border:1px dashed #a7bcd0;border-radius:8px;background:#fff;color:#173a69}
@media(max-width:760px){#dm-product-results{max-height:52dvh}.dm-search-product{padding:10px 6px}.dm-search-product>strong{font-size:14px}}
/* Embedded WebP paints immediately: no separate image request or frame jumps. */
.dm-loader-worker-real{width:min(300px,65vw,46svh)}
.dm-loader-sprite{animation:dm-technician-breathe 2.4s ease-in-out infinite;transform:translate(0,0)}
@keyframes dm-technician-breathe{0%,100%{transform:translate(0,0)}50%{transform:translate(0,-1px)}}
@media(prefers-reduced-motion:reduce){.dm-loader-sprite{animation:none}}

