/* Existing horizontal ledgers stay ledgers. Give each field enough room so a
   status or action no longer wraps into a tall column of individual characters. */
body.mobile-ui-active .mobile-system-shell :is(.purchase-list-table,.receivable-main-table){
  width:max-content;min-width:100%;table-layout:auto;
}
body.mobile-ui-active .mobile-system-shell :is(.purchase-list-table,.receivable-main-table)>tbody>tr[data-row-id]>td{
  vertical-align:top;max-width:220px;overflow-wrap:normal;
}
body.mobile-ui-active .mobile-system-shell .purchase-list-table>tbody>tr[data-row-id]>td:is(:nth-child(3),:nth-child(4),:nth-child(15)){
  min-width:120px;
}
body.mobile-ui-active .mobile-system-shell .purchase-list-table>tbody>tr[data-row-id]>td:is(:nth-child(6),:nth-child(7),:nth-child(8),:nth-child(9),:nth-child(10),:nth-child(11),:nth-child(16),:nth-child(17)){
  white-space:nowrap;
}
body.mobile-ui-active .mobile-system-shell .receivable-main-table>tbody>.receivable-main-row>td{padding:8px 10px;}
body.mobile-ui-active .mobile-system-shell .receivable-main-table>tbody>.receivable-main-row>td:is(:nth-child(2),:nth-child(4),:nth-child(5)){
  min-width:120px;
}
body.mobile-ui-active .mobile-system-shell .receivable-main-table>tbody>.receivable-main-row>td:is(:nth-child(3),:nth-child(6),:nth-child(8),:nth-child(9)){
  white-space:nowrap;
}
body.mobile-ui-active .mobile-system-shell :is(.purchase-table-actions,.receivable-table-actions)>.table-action-group{
  display:flex;flex-flow:row nowrap;gap:4px;
}
body.mobile-ui-active .mobile-system-shell :is(.purchase-table-actions,.receivable-table-actions)>.table-action-group>button{
  flex:0 0 auto;width:auto;white-space:nowrap;min-height:30px;padding:4px 6px;font-size:12px;line-height:20px;
}
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row) :is(.client-detail-panel,.receivable-detail-panel){
  width:calc(100vw - 66px);max-width:calc(100vw - 66px);box-sizing:border-box;scroll-margin-top:70px;
}
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row){scroll-margin-top:70px;}
/* Keep the existing detail summary readable inside the phone-width body. */
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row) .cards{gap:6px;}
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row) .cards>.stat{padding:7px 8px;min-width:0;}
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row) .cards>.stat>.stat-label{font-size:11px;line-height:16px;}
body.mobile-ui-active .mobile-system-shell :is(.purchase-detail-row,.receivable-detail-row) .cards>.stat>.num{font-size:14px;line-height:20px;margin-top:2px;}
/* Keep the event name and date together; the complete explanation follows. */
body.mobile-ui-active .receivable-detail-row .receivable-timeline-item[data-mcd-tall-history]{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:3px 8px;padding:8px 10px;align-items:baseline;}
body.mobile-ui-active .receivable-detail-row [data-mcd-tall-history]>.receivable-timeline-time{grid-column:2;grid-row:1;margin:0;font-size:11px;line-height:16px;white-space:nowrap;}
body.mobile-ui-active .receivable-detail-row [data-mcd-tall-history]>.receivable-timeline-body{display:contents;}
body.mobile-ui-active .receivable-detail-row [data-mcd-tall-history]>.receivable-timeline-body>.receivable-timeline-title{grid-column:1;grid-row:1;margin:0;font-size:14px;line-height:20px;}
body.mobile-ui-active .receivable-detail-row [data-mcd-tall-history]>.receivable-timeline-body>.muted{grid-column:1/-1;margin:0;font-size:12px;line-height:17px;}
/* Reimbursement paging: one compact row, with the original paging controls. */
/* Phone cards use page scrolling; a desktop fixed table height must not let
   the last card flow underneath the paging row. */
body.mobile-ui-active #content .reimbursements-page .reim-table-wrap{height:auto!important;min-height:0!important;max-height:none;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination{display:flex!important;align-items:center;justify-content:flex-end;gap:0;min-height:0;padding:6px 0;margin:0;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination>[data-page-summary],
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-jump{display:none!important;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-pagination-controls{display:flex;flex-wrap:nowrap;align-items:center;justify-content:flex-end;gap:5px;margin:0;width:auto;min-width:0;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-size{display:flex;flex:none;align-items:center;gap:3px;font-size:11px;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-size>span{display:none;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-size select{width:78px;min-width:0;min-height:32px;height:32px;margin:0;padding:4px;font-size:11px;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-turns{display:flex;flex:none;flex-wrap:nowrap;align-items:center;gap:5px;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination .list-page-turns button{min-height:32px;width:auto;padding:4px 7px;font-size:11px;}
body.mobile-ui-active .reimbursements-page .customer-fixed-pagination [data-page-current]{white-space:nowrap;font-size:11px;}
