:root {
  --global-table-sticky-top: 0px;
}

/*
 * The real table header remains in the document for semantics, sorting and
 * column sizing. JavaScript presents a synchronized copy only while the real
 * header is above the active scroll boundary.
 */
.global-table-sticky-header {
  background: var(--tb-body-bg, #fff);
  box-shadow: 0 7px 15px rgba(15, 23, 42, 0.14);
  contain: layout paint style;
  display: none;
  left: 0;
  overflow: hidden;
  pointer-events: auto;
  position: fixed;
  top: var(--global-table-sticky-top);
  width: 0;
  z-index: 95;
}

.global-table-sticky-header.is-visible {
  display: block;
}

.global-table-sticky-header.is-modal-context {
  z-index: 1065;
}

.global-table-sticky-header__table {
  border-spacing: 0;
  margin: 0 !important;
  max-width: none !important;
  position: relative;
}

.global-table-sticky-header__table > thead,
.global-table-sticky-header__table > thead > tr,
.global-table-sticky-header__table > thead > tr > th,
.global-table-sticky-header__table > thead > tr > td {
  opacity: 1;
  visibility: visible;
}

.global-table-sticky-header__table > thead > tr > th,
.global-table-sticky-header__table > thead > tr > td {
  box-sizing: border-box;
  position: static !important;
}

.global-table-sticky-header__table :is(a, button, input, select, [role="button"], [data-sort], .sort) {
  cursor: pointer;
}

/*
 * Existing page-specific headers use several incompatible top offsets. Once
 * a table is managed globally, neutralize only the vertical inset. Horizontal
 * sticky columns (left/right) continue to work on the source table.
 */
@media screen {
  table.global-table-sticky-source > thead,
  table.global-table-sticky-source > thead > tr > th,
  table.global-table-sticky-source > thead > tr > td {
    top: auto !important;
  }
}

@media print {
  .global-table-sticky-header {
    display: none !important;
  }

  table.global-table-sticky-source > thead,
  table.global-table-sticky-source > thead > tr > th,
  table.global-table-sticky-source > thead > tr > td {
    position: static !important;
    top: auto !important;
  }
}
