@media screen{
 .workspace-header{position:sticky;top:var(--sticky-nav,0px);z-index:20;background:white;box-shadow:0 3px 10px #4d344808}.workspace-header .workspace-tabs{position:static}.workspace-header .topbar{position:static}
 .workspace:has(.document-editor){padding-top:14px;padding-bottom:12px}.workspace:has(.document-editor) .heading{margin-bottom:10px}.workspace:has(.document-editor) .heading h1{font-size:23px}.workspace:has(.document-editor) .heading p{margin-top:3px;font-size:11px}
 .document-editor{height:var(--entry-height,calc(100dvh - 210px));min-height:260px;min-width:0;padding:12px!important}.document-editor form{display:flex;flex-direction:column;height:100%;min-height:0;gap:8px}.entry-body{min-height:0;flex:1;overflow:auto;scrollbar-width:thin;padding-right:2px}.document-editor .document-fields{gap:8px;align-items:end}.document-editor .field{min-width:0}.document-editor .field>label{min-height:0!important;line-height:15px;font-size:11px}.document-editor input:not([type=checkbox]):not([type=file]),.document-editor select{min-height:30px;height:30px;font-size:13px;padding:5px 7px;width:100%;min-width:0}.document-editor .contact-picker{grid-template-rows:auto!important;gap:3px}.document-editor .contact-picker>label{min-height:0!important}.document-editor .document-fields>.field:has(.contact-picker){grid-template-rows:auto!important}
 #sale-form>.entry-body>.document-fields{grid-template-columns:repeat(5,minmax(0,1fr))}#bill-form>.entry-body>.document-fields{grid-template-columns:2fr 1fr 1fr}.document-editor .entry-table{max-height:clamp(120px,calc(var(--entry-height) - 230px),400px);margin-top:10px}.document-editor .entry-table input,.document-editor .entry-table select{height:25px;min-height:25px;padding:2px 4px;font-size:12px}.document-editor .bill-tools{height:32px;margin-top:7px}.document-editor .bill-tools .btn{min-height:28px;padding:4px 10px}
 .document-editor .document-footer{flex-shrink:0;margin:0;padding-top:8px;border-top:1px solid var(--line);grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;background:#fff}.document-editor .document-footer>.entry-total,.document-editor .document-footer>.issued-credit-note,.document-editor #negative-stock-warning{grid-column:1/-1}.document-editor #negative-stock-warning:empty{display:none}.document-editor .entry-total{justify-content:flex-end;gap:6px 12px;min-height:36px}.document-editor .entry-total strong{font-size:17px}.document-editor .entry-total .btn{flex-basis:auto;min-height:36px;margin-left:8px}.entry-extra{margin-top:8px}.entry-extra summary,.document-editor .payment-splits summary{font-size:11px;cursor:pointer;color:#735780;padding:5px 0}.entry-extra-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;padding:7px 0}.document-editor .payment-splits{margin:6px 0}.document-editor .issued-credit-note{margin:0;font-size:11px;line-height:1.4}.document-editor #form-error:empty{display:none}.document-editor .entry-body>p.tiny{font-size:10px;margin:4px 0}.contact-summary{max-height:var(--entry-height,calc(100dvh - 200px));overflow:auto}.entry-with-summary{gap:10px}
 .home-launcher{height:var(--home-launcher-height,calc(100dvh - 160px));min-height:430px;padding:16px 22px;gap:12px}.home-launcher-heading{flex-shrink:0}.home-launcher h1{font-size:23px}.home-app-grid{flex:1;min-height:0;overflow:auto;scrollbar-width:thin;gap:8px 12px;grid-auto-rows:minmax(84px,1fr)}.home-app{min-height:84px;padding:8px}.home-app small{display:none}.home-app-icon{width:44px;height:44px;border-radius:12px;margin-bottom:3px}.home-app-icon svg{width:25px;height:25px}.home-action-dock{margin-top:0;flex-shrink:0;padding:8px}.home-dashboard-link{flex-shrink:0;padding:6px 12px;min-height:32px}.home-overview-details{margin-top:26px}
}
@media screen and (min-width:1000px){.home-app-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media screen and (min-width:1001px){#sale-form>.entry-body>.document-fields{grid-template-columns:repeat(6,minmax(0,1fr))}#sale-form>.entry-body>.document-fields:has(#printed-customer-field[hidden]){grid-template-columns:repeat(5,minmax(0,1fr))}#sale-form .document-fields>.field:has(.contact-picker){grid-column:span 2}}
@media screen and (min-width:761px){#bill-form .document-footer{grid-template-columns:repeat(3,minmax(0,1fr))}#sale-form .document-footer{grid-template-columns:repeat(2,minmax(0,1fr))}.entry-extra-fields>p{grid-column:1/-1}}
@media screen and (max-width:1249px){.entry-with-summary .contact-summary{padding:9px 12px;max-height:180px}.contact-summary>details>summary{margin-bottom:0;font-size:12px}.contact-summary>details[open]>summary{margin-bottom:8px}}
@media screen and (max-width:1000px){#sale-form>.entry-body>.document-fields{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media screen and (max-width:760px){
 .workspace-header .topbar{padding:10px 12px;min-height:72px;gap:8px}.workspace-header .company-name{font-size:13px}.workspace-header .company-name small{font-size:10px}.workspace-header .top-actions{gap:5px}.workspace-header .top-actions .btn{font-size:10px;min-height:32px;padding:7px 9px}.workspace-header .workspace-tab [role=tab]{padding-top:10px;padding-bottom:10px}
 .home-launcher{padding:14px 12px;min-height:390px;gap:10px}.home-launcher-heading{gap:8px}.home-launcher h1{font-size:20px}.home-search input{padding:9px 0}.home-app-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.home-app{min-height:90px;padding:7px 2px}.home-app strong{font-size:10px}.home-app-icon{width:39px;height:39px;border-radius:10px}.home-action-dock{padding:7px;gap:6px}.home-action{min-height:36px;font-size:10px;padding:7px 5px}.home-dashboard-link{min-height:34px}
 .workspace:has(.document-editor){padding-top:10px}.document-editor{padding:9px!important}.document-editor form{gap:6px}#sale-form>.entry-body>.document-fields,#bill-form>.entry-body>.document-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.document-editor .document-fields>.field:first-child{grid-column:1/-1}.document-editor input:not([type=checkbox]):not([type=file]),.document-editor select{font-size:16px;min-height:34px;height:34px}.document-editor .entry-table input,.document-editor .entry-table select{font-size:14px;min-height:28px;height:28px}.document-editor .document-footer{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.document-editor .entry-total{flex-wrap:nowrap;justify-content:space-between;gap:5px}.document-editor .entry-total small{font-size:10px}.document-editor .entry-total strong{font-size:14px}.document-editor .entry-total .btn{margin-left:0;font-size:11px;min-height:38px;padding:7px 10px}.entry-extra-fields{grid-template-columns:1fr}.document-editor .bill-tools .tiny{font-size:10px}.document-editor .entry-table{max-height:160px}
}

/* Short screens (e.g. 1366x768 at 125-150% scaling, unmaximised windows): never squeeze the item list into the payment row; let the page scroll instead. */
@media screen and (max-height:720px){.entry-with-summary.invoice-workbench-layout,.document-editor .entry-with-summary{grid-template-rows:auto!important;height:auto!important;max-height:none!important}.document-editor .entry-table,.invoice-workbench .entry-table{height:auto!important;min-height:150px!important;max-height:none!important;overflow:visible!important}.document-editor form,.invoice-workbench form{height:auto!important;max-height:none!important}.document-editor .entry-body,.invoice-workbench .entry-body{flex:none!important;height:auto!important;min-height:0!important;max-height:none!important}.document-editor .document-footer,.invoice-workbench .document-footer{flex:none!important;overflow:visible!important}}
