$debugStoppers: false;

.rst-container {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  clip-path: content-box;
  height: 100%;
  box-sizing: border-box;

  table {
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
  }
}

.rst-body, .rst-head {
  table {
    width: 100%;
  }
}

.rst-spacer .rst-columnResizer {
  max-width: unset;
  transform: none;
}

.rst-search {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-flow: column;
  align-items: center;

  .rst-separator {
    align-self: stretch;
  }
}

.rst-searchContainer {
  position: absolute;
  z-index: 2;
  transition: transform 0.25s;
  transform: translateY(-100%);

  &[#{flag-attr('visible')}] {
    transform: translateY(0);
  }
}

.rst-scrollingContainer {
  display: flex;
  flex-direction: column;
  position: relative;
  flex: auto;
  overflow: auto;
  touch-action: pan-x pan-y;

  &[data-drag-mode=resize] {
    cursor: col-resize;
    user-select: none;

    .rst-body {
      max-width: 0;
      position: sticky;
      left: negative(var(--rst-content-width));
    }

    .rst-body .rst-spacer {
      width: 100vw;
    }
  }

  &[data-drag-mode=select] {
    cursor: default;
  }

  &[#{flag-attr('placeholder-shown')}] .rst-clippingContainer {
    flex: none;
  }
}

.rst-clippingContainer {
  flex: auto;
}

.rst-clippingContainer[#{flag-attr('clipping')}] {
  contain: paint;
  min-width: min-content;

  .rst-resizingContainer {
    min-width: min-content;
  }
}

.rst-resizingContainer {
  contain: paint;
  min-width: fit-content;
  min-height: 100%;

  display: flex;
  flex-direction: column;
}

.rst-placeholder {
  flex: auto;
  box-sizing: border-box;
  width: 100%;
  left: -1px;
  margin-left: -1px;
  position: sticky;
}

.rst-head {
  position: sticky;
  top: 0;
  margin: 0;
  z-index: 1;

  th {
    overflow: visible;
    position: relative;
  }
}

.rst-chunk[#{flag-attr('hidden')}] {
  display: table-row;
  height: var(--rst-intrinsic-height);

  & > * {
    display: none;
  }
}

.rst-body {
  flex: auto;

  td, th {
    overflow: hidden;
  }
}

.rst-headerText {
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: none;
}

.rst-headerContent {
  display: flex;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;

  .rst-icon {
    flex: 0 0 1rem;
  }
}

.rst-header[#{flag-attr('sortable')}] .rst-headerContent {
  cursor: pointer;
}

.rst-columnResizer {
  position: absolute;
  top: 0;
  right: 100%;
  cursor: col-resize;
  touch-action: none;
  height: 100%;
  z-index: 3;
  max-width: 100%; //To not overflow when column is collapsed
}

.rst-stoppers > * {
  overflow: hidden;
  height: 0;

  @if $debugStoppers {
    height: 10px;
  }
}

.rst-clippingStopper {
  white-space: nowrap;
  line-height: 0;

  & > div {
    display: inline-block;
    height: 100%;
    background-color: darkcyan;
  }
}

.rst-resizingStopper {
  background-color: darkred;
}

.rst-icon {
  height: 1rem;
  fill: currentColor;
}

.rst-loadingIcon {
  display: none;

  &[#{flag-attr("loading")}] {
    display: initial;

    & + .rst-icon {
      display: none;
    }
  }
}

.rst-loading {
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.rst-dragSelection {
  position: absolute;
  pointer-events: none;
  box-sizing: border-box;
  contain: strict;
}

.rst-paginationContainer {
  flex: none;
}

.rst-pagination {
  display: grid;
  justify-content: start;
  grid-auto-flow: column;
}

.rst-page {
  text-align: center;
  box-sizing: content-box;
  color: inherit;
  display: block;
  line-height: 1.25rem;

  .rst-icon {
    vertical-align: text-top;
  }
}
