/* One sizing policy for every renderer, including tables inside portals/dialogs.
   The distributed frontend contains legacy pixel/percentage widths in several
   bundles. Override those constraints here instead of measuring or rewriting the
   React/DOM table trees. Native auto layout recalculates on data and size changes. */
body table {
  table-layout: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

body table :is(colgroup, col, th, td) {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
}

body table th {
  white-space: nowrap;
  overflow-wrap: normal;
}

body table td {
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

body table td[data-table-compact] {
  white-space: nowrap !important;
  overflow-wrap: normal;
}

/* Short controls and status chips must stay recognizable as columns shrink.
   Text inside copy fields keeps the workbench's existing character limits. */
body table :is(button, .button, .badge, .capture-status, .finance-state) {
  white-space: nowrap;
}
