@media screen {
.kp-embedded #content>h1:first-child{display:none}
.kp-screen .topbar,.main>.topbar{background:#fff!important}.kp-screen .page-head{background:#f1f5fc!important}
.kp-screen .content>.card,.kp-screen .content .stat{margin-top:0}.kp-screen .welcome{padding:16px}.kp-screen h1:not(dialog h1){font-size:21px;margin:7px 0 10px}
.kp-screen .table,.kp-screen .scroll,.kp-screen .table-wrap{border-radius:8px;margin:8px 0;max-height:calc(100dvh - var(--kp-header) - var(--kp-nav) - 110px)}
.kp-screen table:not(dialog table):not(form table) th,.kp-screen table:not(dialog table):not(form table) td,.kp-screen table th,.kp-screen table td{padding:6px 8px;font-size:12px;line-height:1.4;vertical-align:middle}
.kp-screen table th{font-weight:800;white-space:normal}.kp-screen table small{display:block;font-size:10px;line-height:1.4;color:#63756b}.kp-screen table button,.kp-screen table .button{font-size:11px!important;min-height:28px!important;padding:5px 7px!important;margin:2px!important;white-space:nowrap}
.kp-screen table input:not([type=checkbox]),.kp-screen table select,.kp-screen table textarea{padding:6px 7px;font-size:12px;min-height:32px;border-radius:6px;min-width:65px}
.kp-screen table input[type=number]{width:78px}.kp-screen table input[type=date]{min-width:126px}.kp-screen table details>summary{cursor:pointer;font-size:12px;white-space:nowrap;font-weight:700;color:#155b46}.kp-screen table details>div,.kp-screen table details>p{padding:5px 0;border-bottom:1px solid #dce4df;margin:0}
.kp-screen table .number{text-align:right;font-variant-numeric:tabular-nums}.kp-screen table .kp24-product{min-width:180px;max-width:230px}.kp24-dealers{min-width:140px;max-width:190px}.kp24-product b{display:block;font-size:12px;line-height:1.35}
#dialog{width:calc(100vw - 28px);max-width:1540px;max-height:94dvh;padding:14px;border-radius:12px;overflow:auto}#dialog h2{font-size:20px;margin:0}#dialog>.actions,#dialog-body>.actions{position:sticky;top:-14px;z-index:9;background:#fff;padding:7px 0}
#dialog-body>.actions [data-act=close]{padding:5px 12px;min-height:32px;font-size:21px}#dialog .grid{gap:6px 12px}#dialog label{font-size:12px;margin:6px 0}#dialog input,#dialog select,#dialog textarea{padding:7px 9px;font-size:13px}#dialog .card{padding:10px;margin:8px 0}
.kp24-table.ops-compact{max-height:61dvh;overflow:auto;border:1px solid #cfddd5;max-width:100%;min-height:90px;border-radius:7px}.kp24-table.ops-compact table{width:max-content;min-width:100%;border-collapse:separate;border-spacing:0}.kp24-table.ops-compact th,.kp24-table.ops-compact td{padding:5px 7px;min-width:62px;font-size:12px;vertical-align:middle}.kp24-table.ops-compact th{position:sticky;top:0;z-index:4;background:#deede5;font-weight:800;max-width:110px}.kp24-table.ops-compact th:first-child,.kp24-table.ops-compact td:first-child{position:sticky;left:0;min-width:185px;max-width:225px;background:#f3f8f5;z-index:3;border-right:2px solid #c9dbcf}.kp24-table.ops-compact th:first-child{z-index:6;background:#deede5}.kp24-table.ops-compact td input[name=reason],.kp24-table.ops-compact td input[name=note]{min-width:145px;width:170px}.kp24-table.ops-compact td input[name=lot_code]{min-width:110px;width:115px}.kp24-table.ops-compact td input[type=number]{min-width:62px;width:68px}.kp24-table.ops-compact td:first-child label{margin:0}
.kp24-docbar,.kp24-finance-toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0}.kp24-docbar .button,.kp24-docbar button{padding:6px 9px;font-size:12px}.kp24-note{white-space:pre-line;overflow-wrap:anywhere;font-size:13px;background:#fff5df;border-left:3px solid #d8b56a;padding:7px 10px;margin:6px 0}.kp24-finance-toolbar>label{width:min(440px,100%);margin:0}.kp24-finance-toolbar>span{font-size:13px}.kp24-finance-toolbar>button{margin-left:auto}
.kp24-payment-fields{grid-template-columns:repeat(4,minmax(140px,1fr));gap:9px;margin-top:10px}.kp24-payment-fields label{font-size:12px}body:has(form[data-action="receipt.save"]) [name=alloc_amount]{min-width:110px!important;width:125px}body:has(form[data-action="receipt.save"]) [data-total]{font-weight:800;background:#e9f4ed;padding:6px 10px;border-radius:7px}#opening-editor{scroll-margin-top:calc(var(--kp-header) + 8px)}#opening-editor h2{font-size:17px;margin:0 0 8px}
.extra-line,.ingredient-line{display:grid!important;grid-template-columns:minmax(180px,2fr) 90px minmax(140px,1.5fr) auto;gap:7px;align-items:end}.extra-line label,.ingredient-line label{margin:0!important}.kp-screen .actions{gap:6px}.kp-screen .actions button,.kp-screen .actions .button{padding:7px 10px;font-size:12px}
.ship-quantity-table{max-height:52dvh;overflow:auto}.ship-quantity-table th{position:sticky;top:0;background:#deede5;z-index:3}.ship-quantity-table table{min-width:650px}.ship-extra-row{grid-template-columns:minmax(180px,2fr) 80px minmax(140px,1fr) minmax(140px,1fr) auto;gap:6px}
[hidden]{display:none!important}dialog fieldset{border:1px solid #d5e1d9;border-radius:8px;font-size:12px;padding:9px;margin:8px 0}
@media(max-width:800px){.kp24-payment-fields{grid-template-columns:1fr 1fr}.extra-line,.ingredient-line{grid-template-columns:minmax(130px,1fr) 72px}.extra-line>label:nth-child(3){grid-column:1}.kp24-finance-toolbar>button{margin-left:0}.kp-screen .page-head h1{font-size:18px}#dialog{width:calc(100vw - 12px);max-height:96dvh;padding:9px}#dialog h2{font-size:17px}.kp24-table.ops-compact{max-height:58dvh}.kp24-table.ops-compact td:first-child,.kp24-table.ops-compact th:first-child{min-width:140px;max-width:155px}.kp24-table.ops-compact td,.kp24-table.ops-compact th{font-size:11px;padding:5px}.kp24-product b{font-size:11px}.ship-extra-row{grid-template-columns:1fr 80px}.ship-extra-row label:first-child{grid-column:1/-1}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto}}
}
@media screen {
form[data-action="receipt.save"] .table>table{min-width:850px}form[data-action="receipt.save"] .table>table>tbody>tr>td:nth-child(2){min-width:220px;max-width:270px}form[data-action="receipt.save"] .table>table>tbody>tr>td:nth-child(3),form[data-action="receipt.save"] .table>table>tbody>tr>td:nth-child(4){white-space:nowrap;min-width:88px}.table:has([data-act="inventory-dispatch"])>table{min-width:850px}
}

@media screen {
.kp-screen table th,.kp-screen table td,.kp-screen table .number,.kp24-table.ops-compact th,.kp24-table.ops-compact td{text-align:center!important;font-variant-numeric:tabular-nums}
.kp-screen table input:not([type=checkbox]),.kp-screen table select{text-align:center}
.kp-screen table td.kp24-product,.kp-screen table td.kp24-dealers,form[data-action="receipt.save"] .table>table>tbody>tr>td:nth-child(2){text-align:left!important}
.kp-screen table td:not(.kp24-product) small{white-space:normal}
.kp25-proof{padding:12px;background:#eef5fc;border:1px solid #c8dbee;border-radius:10px;margin:12px 0}.kp25-proof h2{font-size:16px;margin:0 0 8px}.kp25-proof p,.kp25-proof small{font-size:12px}.kp25-proof summary,.kp25-history summary{cursor:pointer;font-weight:700}.kp25-proof .grid{grid-template-columns:repeat(2,minmax(120px,1fr))}.kp25-proof [data-proof-status]{margin:7px 0}.kp25-history{margin-top:12px}
.kp-screen td:has([data-act="inventory-lots"]){white-space:nowrap}.kp-screen .kp24-finance-toolbar>button{margin-left:0;background:#155b46;color:white;font-weight:700;white-space:normal}.kp-screen .kp24-finance-toolbar>label{width:min(320px,100%)}
@media(max-width:520px){.kp25-proof .grid{grid-template-columns:1fr}.kp24-finance-toolbar>button{width:100%}}
}

/* SAFE026: distinguish package sizes without moving existing controls. */
@media screen {.kp-screen table tr.sku-pate400>td{background:#eaf2ff!important}.kp-screen table tr.sku-pate900>td{background:#fff0df!important}.sku-legend .sku-pate400{background:#eaf2ff}.sku-legend .sku-pate900{background:#fff0df}.kp-screen table tr.sku-pate900>td:first-child{border-left:3px solid #dba665}.kp-screen table tr.sku-pate400>td:first-child{border-left:3px solid #82a9dc}[data-material-map] .grid{grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}[data-receive-lines] table{min-width:760px}[data-material-preview] table{min-width:900px}[data-return-row] select{min-width:190px}#review-box{scroll-margin-top:60px}#report-result table{min-width:850px}}

/* SAFE027: size colors extend the existing compact tables. */
@media screen {
.kp-screen table tr.sku-jerky50>td{background:#e3f4ed!important}
.kp-screen table tr.sku-jerky250>td{background:#fff6d9!important}
.kp-screen table tr.sku-jerky50>td:first-child{border-left:3px solid #68a58b}
.kp-screen table tr.sku-jerky250>td:first-child{border-left:3px solid #c4a549}
.sku-legend .sku-jerky50{background:#e3f4ed}.sku-legend .sku-jerky250{background:#fff6d9}
}
