.atrium-ui-table-shell {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.atrium-ui-table-sticky > thead > tr > th {
  position: sticky;
  top: var(--atrium-ui-table-sticky-top, 0);
  z-index: var(--atrium-ui-table-sticky-z-index, 1);
}

:is(th, td).atrium-ui-table-numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.atrium-ui-table-sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  color: inherit;
  font: inherit;
}

.atrium-ui-table-sort-control:focus-visible {
  outline: 2px solid var(--atrium-ui-focus-color, currentColor);
  outline-offset: 2px;
}

.atrium-ui-status-region[hidden] {
  display: none !important;
}

/* Proxy horizontal scrollbar for a pane whose own bar is unreachable: the pane
   scrolls sideways but the page scrolls vertically, so the native bar sits
   below the whole table and a long list pushes it off-screen. The proxy sticks
   to the bottom of the viewport for as long as its section is on screen and
   settles into the native position — directly under the pane — once the reader
   reaches the end of it, so it never floats over anything below the table. Its
   only content is a spacer that JS keeps as wide as the pane's content, which
   is what gives the thumb the right size. Sizing ::-webkit-scrollbar is not
   decoration: it is what opts Chrome and Safari out of overlay scrollbars, so
   the bar is visible at rest on macOS instead of fading away unused. */
.atrium-ui-hscroll {
  position: sticky;
  bottom: 0;
  z-index: var(--atrium-ui-hscroll-z-index, 2);
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  background: var(--atrium-ui-hscroll-surface, #ffffff);
  border-top: 1px solid var(--atrium-ui-hscroll-track, rgba(15, 23, 42, 0.12));
}

/* Firefox has no ::-webkit-scrollbar, and the browsers that do drop the whole
   pseudo-element scheme for any element that also names a standard scrollbar
   property — which would leave them on the fading overlay bar this proxy exists
   to replace, and a proxy 2px tall. So each engine is handed only the syntax it
   honours, and neither is offered both. */
@supports not selector(::-webkit-scrollbar) {
  .atrium-ui-hscroll {
    scrollbar-width: thin;
    scrollbar-color:
      var(--atrium-ui-hscroll-thumb, rgba(15, 23, 42, 0.45))
      var(--atrium-ui-hscroll-track, rgba(15, 23, 42, 0.12));
  }
}

.atrium-ui-hscroll[hidden] {
  display: none !important;
}

.atrium-ui-hscroll::-webkit-scrollbar {
  height: 11px;
}

.atrium-ui-hscroll::-webkit-scrollbar-track {
  background: var(--atrium-ui-hscroll-track, rgba(15, 23, 42, 0.12));
  border-radius: 999px;
}

.atrium-ui-hscroll::-webkit-scrollbar-thumb {
  background: var(--atrium-ui-hscroll-thumb, rgba(15, 23, 42, 0.45));
  border-radius: 999px;
}

.atrium-ui-hscroll-spacer {
  height: 1px;
}

/* Once the proxy exists it is the only bar for that pane, at rest as well as
   while floating; the pane's own would otherwise stack a second one under it. */
.atrium-ui-hscroll-host {
  scrollbar-width: none;
}

.atrium-ui-hscroll-host::-webkit-scrollbar {
  display: none;
}

.atrium-ui-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  line-height: 1.2;
}

.atrium-ui-table-empty {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}
