/* Touch layout and installed-app safe areas; desktop layout remains unchanged. */
body.finance-shell dialog.app-install-dialog{max-width:440px;width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid #ddd;border-radius:16px;color:#20242a}
body.finance-shell dialog.app-install-dialog header{display:flex;align-items:start;justify-content:space-between;gap:16px}body.finance-shell dialog.app-install-dialog h2{font-size:20px;margin:0}body.finance-shell dialog.app-install-dialog p{line-height:1.6}body.finance-shell dialog.app-install-dialog img{border-radius:16px;margin-top:20px}
@media(max-width:760px){
 :root{--os-mobile-bar-height:64px;--os-mobile-safe-bottom:env(safe-area-inset-bottom,0px);--os-mobile-clearance:calc(var(--os-mobile-bar-height) + var(--os-mobile-safe-bottom))}
 html:has(body.finance-shell){scroll-padding-bottom:calc(var(--os-mobile-clearance) + 12px)}
 body.finance-shell{box-sizing:border-box;min-height:100dvh;padding-bottom:calc(var(--os-mobile-clearance) + 12px)!important}
 body.finance-shell :is(button,a).os-button{min-height:44px}
 body.finance-shell .os-mobile{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));height:var(--os-mobile-clearance);min-height:var(--os-mobile-clearance);padding:6px max(6px,env(safe-area-inset-right,0px)) calc(6px + var(--os-mobile-safe-bottom)) max(6px,env(safe-area-inset-left,0px));gap:2px}
 body.finance-shell .os-mobile a,body.finance-shell .os-mobile button{min-width:0;font-size:10px!important;gap:4px;padding:4px 2px;min-height:48px}
 body.finance-shell .os-mobile .os-icon{width:21px;height:21px}
 body.finance-shell .os-topbar{min-height:56px;padding:calc(6px + env(safe-area-inset-top,0px)) max(14px,env(safe-area-inset-right,0px)) 6px max(14px,env(safe-area-inset-left,0px))}
 body.finance-shell main,body.finance-shell>.wrap{padding-left:max(14px,env(safe-area-inset-left,0px))!important;padding-right:max(14px,env(safe-area-inset-right,0px))!important}
 body.finance-shell aside.os-sidebar{max-height:100dvh;padding-top:max(24px,env(safe-area-inset-top,0px));padding-bottom:calc(var(--os-mobile-clearance) + 12px)}
 body.finance-shell .os-refresh-status{bottom:calc(var(--os-mobile-clearance) + 12px)}
 body.finance-shell dialog.finance-dialog:not(.app-install-dialog):not(.os-account-dialog):not(.fa-dialog):not(.mail-flow-dialog):not(.credit-recovery-dialog):not(.cash-buffer-dialog):not(.bank-work-dialog):not(.discount-dialog){box-sizing:border-box;width:100%;max-width:100%;height:100dvh;max-height:100dvh;margin:0;border-radius:0;padding:16px;padding-top:max(16px,env(safe-area-inset-top));padding-bottom:max(20px,env(safe-area-inset-bottom));overflow:auto;overscroll-behavior:contain}
 body.finance-shell dialog .dialog-head{position:sticky;top:0;background:#fff;z-index:2;display:flex;align-items:center;justify-content:space-between;padding:8px 0 12px;gap:12px}
 body.finance-shell dialog .dialog-body{padding:12px 0}
 body.finance-shell dialog h2{font-size:20px}body.finance-shell dialog h3{font-size:16px}
 body.finance-shell dialog .ar-detail-grid{gap:16px;margin:12px 0;padding:0}body.finance-shell dialog .ar-detail-grid dd{font-size:18px}
 body.finance-shell dialog .os-button{min-height:44px}
 body.finance-shell dialog :is(input:not([type=checkbox]),textarea,select){font-size:16px!important;max-width:100%;box-sizing:border-box}
 body.finance-shell .ar-table tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:5px 12px;padding:16px}
 body.finance-shell .ar-table td{min-width:0;padding:0;margin:0!important}
 body.finance-shell .ar-table td:nth-child(1){grid-column:1;grid-row:1}
 body.finance-shell .ar-table td:nth-child(2){grid-column:1/-1;grid-row:2}
 body.finance-shell .ar-table td:nth-child(3){grid-column:1;grid-row:3;font-size:12px}
 body.finance-shell .ar-table td:nth-child(4){grid-column:2;grid-row:3;text-align:right}
 body.finance-shell .ar-table td:nth-child(5){grid-column:2;grid-row:1;text-align:right}
 body.finance-shell .ar-table td:nth-child(5) strong{font-size:17px}
 body.finance-shell .ar-table td:nth-child(5)::before{font-size:10px}
 body.finance-shell .ar-table td:nth-child(6){grid-column:1;grid-row:4;margin-top:8px!important}
 body.finance-shell .ar-table td:nth-child(7){grid-column:2;grid-row:4;align-self:end}
 body.finance-shell .ar-table td:nth-child(6)::before{display:none}
 body.finance-shell .ar-table td .os-button{min-height:44px;padding:8px 10px;font-size:12px!important}
 body.finance-shell .ar-document-link{min-height:36px!important;padding:4px 0!important;border-radius:3px!important}
 body.finance-shell .ar-table small{font-size:11px!important}
}

.ar-mobile-filters{display:none}
@media(max-width:700px){
 body.finance-shell .ar-mobile-filters{display:block;margin:0 16px 8px}
 body.finance-shell .ar-toolbar:not(.ar-expanded)>label:nth-child(1),body.finance-shell .ar-toolbar:not(.ar-expanded)>label:nth-child(3),body.finance-shell .ar-toolbar:not(.ar-expanded)>label:nth-child(4){display:none}
 body.finance-shell .ar-toolbar{padding-top:4px;gap:8px}
 body.finance-shell .ar-source-summary p{display:none}body.finance-shell .ar-source-summary{padding:12px 16px;margin-bottom:8px;gap:8px}
 body.finance-shell .ar-read-actions:has(#arReadAll:disabled){display:none}
 body.finance-shell #arPagingTop:empty{display:none}
}

@media(min-width:701px){body.finance-shell .ar-mobile-filters{display:none!important}}
body.finance-shell dialog.app-install-dialog header button{flex:none;min-width:36px;min-height:36px;justify-content:center}
@media(max-width:760px){body.finance-shell dialog.app-install-dialog{padding:20px}body.finance-shell dialog.app-install-dialog header button{min-width:44px;min-height:44px}}
