/* Tablet layouts: keep page controls within the viewport; wide tables scroll inside it.
   Screen-only rules preserve print output and desktop layout above 1100px. */
@media screen and (max-width:1100px) {
  .workflow-split > *, .billing-workspace > *,
  .workflow-records, .workflow-records > form,
  .billing-history, .billing-history > form, .find-patient,
  .settings-shell > section, .settings-pane {
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .settings-shell > section, .settings-pane {
    width:100%!important;
  }
  .workflow-table, .billing-history .desktop-table,
  .settings-pane .table-scroll {
    min-width:0!important;
    max-width:100%!important;
    width:100%!important;
    box-sizing:border-box!important;
    overflow-x:auto!important;
    -webkit-overflow-scrolling:touch;
  }
  #billingForm, #billingForm .billing-editor-fieldset,
  #billingForm .billing-entry-layout, #billingForm .billing-entry-layout > main,
  #billingForm .desktop-panel, #billingForm .billing-overview-summary {
    min-width:0!important;
    min-inline-size:0!important;
    max-width:100%!important;
    width:100%!important;
    box-sizing:border-box!important;
  }
  #billingForm .billing-editor-fieldset {
    margin-left:0!important;
    margin-right:0!important;
  }
  #billingForm .billing-entry-header {
    flex-wrap:wrap!important;
    gap:12px!important;
  }
  #billingForm .billing-entry-header > div:first-child {
    flex:1 1 320px!important;
    min-width:0!important;
    overflow-wrap:anywhere;
  }
  #billingForm .billing-entry-header > .actions {
    flex:0 1 auto!important;
    display:flex!important;
    flex-wrap:wrap!important;
    justify-content:flex-end!important;
    gap:8px!important;
    max-width:100%!important;
    margin-left:auto!important;
  }
  #billingForm .billing-entry-header .actions .button,
  #billingForm .sticky-action-bar .button {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    flex:0 0 auto!important;
    height:auto!important;
    min-height:36px!important;
    padding:7px 10px!important;
    line-height:1.3!important;
    white-space:normal!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  .workflow-record-head, .billing-patient-head,
  .settings-pane .section-title-actions, .settings-pane .cpt-actions {
    flex-wrap:wrap!important;
    gap:10px!important;
    min-width:0!important;
  }
}
