/* AKSMART v22 shared work-screen layout: one source for chrome/viewport behavior. */
#chromeToggles{position:fixed;right:max(6px,env(safe-area-inset-right));bottom:max(6px,env(safe-area-inset-bottom));z-index:99990;display:none;gap:4px;align-items:center;font-family:Inter,system-ui,sans-serif}
#chromeToggles button{width:29px;height:32px;border:1px solid rgba(18,89,80,.34);border-radius:9px;background:#f7fbfa;color:#17473f;font-weight:1000;font-size:12px;box-shadow:0 2px 8px rgba(0,0,0,.08)}
#chromeToggles button.is-hidden{background:#128474;color:#fff;border-color:#128474}
body.ak-work-route{overflow:hidden!important}
body.ak-work-route #app,body.ak-work-route .main,body.ak-work-route #view.view{min-width:0!important;max-width:100vw!important;overflow:hidden!important}
body.ak-work-route.topbar-hidden.bottombar-hidden #app,body.ak-work-route.topbar-hidden.bottombar-hidden .main,body.ak-work-route.topbar-hidden.bottombar-hidden #view.view{height:100dvh!important;max-height:100dvh!important;min-height:100dvh!important}
body.ak-work-route.sidebar-hidden .main{margin-left:0!important}
body.ak-work-route #view.view{padding:0!important;background:#f6efe4!important}
body.ak-work-route:not(.sidebar-hidden) .main{min-width:0!important}

/* Draw + Party share the same fixed-height anatomy. */
body.page-drawbill .db88,body.page-partybill .db88{height:100%!important;max-height:100%!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important}
body.page-drawbill .db88-body,body.page-partybill .db88-body{flex:1 1 auto!important;min-height:0!important;overflow:hidden!important;display:flex!important;flex-direction:column!important;gap:7px!important}
body.page-drawbill .db88-table-wrap,body.page-partybill .db88-table-wrap{flex:1 1 0!important;min-height:110px!important;max-height:none!important;overflow:auto!important;overscroll-behavior:contain!important;-webkit-overflow-scrolling:touch!important}
body.page-drawbill .db88-selected,body.page-partybill .db88-selected{flex:0 0 auto!important;min-height:32px!important}
body.page-drawbill .db88-toolbar,body.page-partybill .db88-toolbar{flex:0 0 auto!important;margin-top:0!important;position:static!important;grid-template-columns:repeat(8,minmax(0,1fr))!important;gap:7px!important;padding:8px!important}
body.page-drawbill .db88-table tfoot td,body.page-partybill .db88-table tfoot td{position:sticky!important;bottom:0!important;z-index:7!important}
body.page-drawbill .db88-table thead th,body.page-partybill .db88-table thead th{position:sticky!important;top:0!important;z-index:7!important;background:#173b57!important;color:#fff!important;text-shadow:none!important}

/* Date Bill: reserve room for Final + T/B/M and compact worst-case rows. */
body.page-billing-date .bd32-shell{height:100%!important;max-height:100%!important;min-height:0!important;padding-bottom:48px!important;overflow:hidden!important}
body.page-billing-date .bd32-work{min-height:0!important;height:calc(100% - 38px)!important}
body.page-billing-date .bd32-card,body.page-billing-date .bd32-side{min-height:0!important;overflow:auto!important;overscroll-behavior:contain!important}
body.page-billing-date .bd32-th{height:29px!important;font-size:12px!important}
body.page-billing-date .bd32-mark,body.page-billing-date .bd32-cell{height:30px!important;font-size:14px!important}
body.page-billing-date .bd32-total-box{height:30px!important;font-size:13px!important}
body.page-billing-date .bd32-line,body.page-billing-date .bd32-pay{min-height:29px!important;font-size:14px!important}
body.page-billing-date .bd32-line.big,body.page-billing-date .bd32-line.final{min-height:34px!important}
body.page-billing-date .bd32-line.big .k,body.page-billing-date .bd32-line.big .sign,body.page-billing-date .bd32-line.big .val,body.page-billing-date .bd32-line.final .k,body.page-billing-date .bd32-line.final .val{font-size:17px!important}
body.page-billing-date #chromeToggles{bottom:max(5px,env(safe-area-inset-bottom))!important}

@media(max-width:900px){
 #chromeToggles{right:5px;bottom:max(5px,env(safe-area-inset-bottom));gap:3px}
 #chromeToggles button{width:28px;height:31px;font-size:10px}
 body.page-drawbill .db88,body.page-partybill .db88{padding:6px!important;gap:5px!important}
 body.page-drawbill .db88-toolbar,body.page-partybill .db88-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important;padding:6px!important}
 body.page-drawbill .db88 .ak-btn,body.page-partybill .db88 .ak-btn{height:36px!important;font-size:10.5px!important;min-width:0!important;width:100%!important}
 body.page-drawbill .db88-table-wrap,body.page-partybill .db88-table-wrap{min-height:120px!important}
 body.page-billing-date .bd32-shell{padding-bottom:46px!important}
 body.page-billing-date .bd32-mark,body.page-billing-date .bd32-cell{height:28px!important;font-size:12px!important}
 body.page-billing-date .bd32-th{height:27px!important;font-size:10px!important}
 body.page-billing-date .bd32-line,body.page-billing-date .bd32-pay{min-height:27px!important;font-size:12px!important}
 body.page-billing-date .bd32-line.big,body.page-billing-date .bd32-line.final{min-height:31px!important}
 body.page-billing-date .bd32-line.big .k,body.page-billing-date .bd32-line.big .sign,body.page-billing-date .bd32-line.big .val,body.page-billing-date .bd32-line.final .k,body.page-billing-date .bd32-line.final .val{font-size:15px!important}
}
@media(max-width:520px){
 body.page-drawbill .db88-toolbar,body.page-partybill .db88-toolbar{grid-template-columns:repeat(4,minmax(0,1fr))!important}
 body.page-billing-date .bd32-shell{padding-bottom:44px!important}
}

/* v26 Sale-style mobile button rail. The controller is created by app.js only while this rail is visible. */
@media(max-width:760px){
 body.page-sale .ak-bottom-toolbar:not(.hidden){
   display:flex!important;grid-template-columns:none!important;flex-wrap:nowrap!important;
   justify-content:flex-start!important;overflow-x:auto!important;overflow-y:hidden!important;
   scrollbar-width:none!important;gap:7px!important;padding:7px!important;max-height:none!important;
 }
 body.page-sale .ak-bottom-toolbar::-webkit-scrollbar{display:none!important}
 body.page-sale .ak-bottom-toolbar .ak-btn{flex:0 0 108px!important;width:108px!important;min-width:108px!important;height:38px!important;font-size:12px!important}
 body.page-sale.sale-work-active .ak-bottom-toolbar,body.page-sale .ak-bottom-toolbar.hidden{display:none!important}
}
