#tablepress-dt-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 24px;
  background: rgb(0 0 0 / 0.35);
}

#tablepress-dt-modal[hidden] {
  display: none;
}

#tablepress-dt-modal .tablepress-dt-modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--wp--preset--color--base, white);
  box-shadow: 0 20px 80px rgb(0 0 0 / 0.35);
}

#tablepress-dt-modal .tablepress-dt-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
}

#tablepress-dt-modal .tablepress-dt-modal-body > .dt-container {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

#tablepress-dt-modal
  .tablepress-dt-modal-body
  > .dt-container
  > .dt-layout-row {
  flex: 0 0 auto;
}

#tablepress-dt-modal
  .tablepress-dt-modal-body
  > .dt-container
  > .dt-layout-row.dt-layout-table {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#tablepress-dt-modal
  .tablepress-dt-modal-body
  > .dt-container
  > .dt-layout-row.dt-layout-table
  > .dt-layout-cell {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#tablepress-dt-modal .tablepress-dt-modal-body .dt-scroll {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

#tablepress-dt-modal .tablepress-dt-modal-body .dt-scroll-head,
#tablepress-dt-modal .tablepress-dt-modal-body .dt-scroll-foot {
  flex: 0 0 auto;
}

#tablepress-dt-modal .tablepress-dt-modal-body .dt-scroll-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: auto;
  overflow-y: auto;
}

.dt-container .dt-search {
  margin-left: auto;
  justify-content: flex-end;
  gap: 8px;
}

.tablepress-dt-control-button {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  color: currentColor;
  font: inherit;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.tablepress-dt-control-button:hover,
.tablepress-dt-control-button:focus-visible {
  opacity: 1;
  outline: none;
}

.tablepress-dt-control-button .dashicons {
  width: 20px;
  height: 20px;
  font-size: 20px;
}

.tablepress.dataTable thead tr > .dtfc-fixed-start,
.tablepress.dataTable thead tr > .dtfc-fixed-end,
.tablepress.dataTable tfoot tr > .dtfc-fixed-start,
.tablepress.dataTable tfoot tr > .dtfc-fixed-end,
.tablepress.dataTable tbody tr > .dtfc-fixed-start,
.tablepress.dataTable tbody tr > .dtfc-fixed-end {
  background-color: var(--head-bg-color) !important;
  color: var(--head-text-color);
}

.tablepress.dataTable {
  --head-active-bg-color: oklch(from var(--head-bg-color) calc(l - 0.04) c h);
}

.tablepress.dataTable thead tr > .dtfc-fixed-start.dt-orderable-asc:hover,
.tablepress.dataTable thead tr > .dtfc-fixed-start.dt-orderable-desc:hover,
.tablepress.dataTable thead tr > .dtfc-fixed-start.dt-ordering-asc,
.tablepress.dataTable thead tr > .dtfc-fixed-start.dt-ordering-desc,
.tablepress.dataTable thead tr > .dtfc-fixed-end.dt-orderable-asc:hover,
.tablepress.dataTable thead tr > .dtfc-fixed-end.dt-orderable-desc:hover,
.tablepress.dataTable thead tr > .dtfc-fixed-end.dt-ordering-asc,
.tablepress.dataTable thead tr > .dtfc-fixed-end.dt-ordering-desc {
  background-color: var(--head-active-bg-color) !important;
  color: var(--head-active-text-color);
}

.tablepress.dataTable thead tr > .tablepress-column-hover {
  background-color: var(--head-active-bg-color) !important;
  color: var(--head-active-text-color);
}

.tablepress.dataTable
  > tbody:not(.row-striping)
  > tr:not(.child):not(.dtrg-group)
  > th:not(.dtfc-fixed-start):nth-child(even),
.tablepress.dataTable
  > tbody:not(.row-striping)
  > tr:not(.child):not(.dtrg-group)
  > td:not(.dtfc-fixed-start):nth-child(even) {
  background-color: color-mix(
    in oklch,
    var(--head-bg-color) 50%,
    white 50%
  ) !important;
}

.tablepress.dataTable
  > tbody.row-hover
  > tr:not(.child):not(.dtrg-group):hover
  > th:not(.dtfc-fixed-start),
.tablepress.dataTable
  > tbody.row-hover
  > tr:not(.child):not(.dtrg-group):hover
  > td:not(.dtfc-fixed-start) {
  background-color: oklch(
    from color-mix(in oklch, var(--head-bg-color) 50%, white 50%)
    calc(l - 0.04)
    c
    h
  ) !important;
}

.tablepress.dataTable
  > tbody.row-hover
  > tr:not(.child):not(.dtrg-group):hover
  > .dtfc-fixed-start,
.tablepress.dataTable
  > tbody.row-hover
  > tr:not(.child):not(.dtrg-group):hover
  > .dtfc-fixed-end {
  background-color: oklch(from var(--head-bg-color) calc(l - 0.04) c h) !important;
}

@media screen and (max-width: 767px) {
  /* Fix wonky search and pagination on mobile */
  .dt-container > .dt-layout-row:first-of-type,
  .dt-container > .dt-layout-row:last-of-type {
    align-items: flex-start;
  }

  .dt-container > .dt-layout-row:first-of-type .dt-layout-cell,
  .dt-container > .dt-layout-row:last-of-type .dt-layout-cell {
    margin-left: 0;
  }
}
