.pedia-table-scroll {
  position: relative;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin: 24px 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--rule, #ded2b4);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(10, 30, 63, 0.08);
  scrollbar-color: var(--gold-deep, #9a7734) var(--cream, #f7f2e7);
}

.pedia-table-scroll:focus-visible {
  outline: 3px solid var(--gold-deep, #9a7734);
  outline-offset: 3px;
}

.pedia-table-scroll[data-overflow="true"][data-scroll-end="false"]::after {
  position: sticky;
  right: 0;
  display: block;
  float: right;
  width: 28px;
  height: 0;
  content: "";
  pointer-events: none;
  box-shadow: 12px 0 26px 18px rgba(10, 30, 63, 0.18);
}

.pedia-table-scroll .pedia-table {
  display: table;
  width: 100%;
  min-width: 100%;
  max-width: none;
  margin: 0;
  overflow: visible;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
  table-layout: auto;
  font-family: var(--f-sans, Arial, sans-serif);
  font-size: 14px;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: normal;
}

.pedia-table-scroll[data-pedia-table-mode="scroll"] .pedia-table,
.pedia-table-scroll[data-pedia-table-mode="matrix"] .pedia-table {
  width: var(--pedia-table-min-width);
  min-width: var(--pedia-table-min-width);
  table-layout: fixed;
}

.pedia-table-scroll[data-pedia-table-mode="fit"] .pedia-table {
  width: 100%;
  min-width: 100%;
  table-layout: fixed;
}

.pedia-table-scroll[data-pedia-table-mode="fit"] .pedia-table col {
  width: var(--pedia-column-share);
}

.pedia-table-scroll[data-pedia-table-mode="fit"] .pedia-table th,
.pedia-table-scroll[data-pedia-table-mode="fit"] .pedia-table td {
  overflow-wrap: break-word;
}

.pedia-table-scroll .pedia-table col {
  width: var(--pedia-column-width);
}

.pedia-table-scroll .pedia-table thead {
  color: var(--cream, #f7f2e7);
  background: var(--navy-deep, #0a1e3f);
}

.pedia-table-scroll .pedia-table th,
.pedia-table-scroll .pedia-table td {
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--rule, #ded2b4);
  border-right: 1px solid var(--rule, #ded2b4);
  color: var(--ink-soft, #45506a);
  background-clip: padding-box;
  -webkit-hyphens: manual;
  hyphens: manual;
  word-break: normal;
  overflow-wrap: normal;
}

.pedia-table-scroll .pedia-table th {
  padding: 12px 14px;
  border-top: 0;
  border-right-color: rgba(154, 119, 52, 0.38);
  color: var(--cream, #f7f2e7);
  background: var(--navy-deep, #0a1e3f);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.045em;
  white-space: normal;
}

.pedia-table-scroll .pedia-table :is(th, td):last-child {
  border-right: 0;
}

.pedia-table-scroll .pedia-table tbody tr:nth-child(even) td {
  background-color: color-mix(in srgb, var(--cream, #f7f2e7) 55%, white);
}

.pedia-table-scroll .pedia-table tbody tr:hover td {
  background-color: color-mix(in srgb, var(--cream, #f7f2e7) 82%, white);
}

.pedia-table-scroll .pedia-table :is(a, code) {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.pedia-table-scroll[data-pedia-table-key-first="true"] .pedia-table :is(th, td):first-child {
  min-width: 0;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.pedia-table-scroll[data-pedia-table-mode="matrix"][data-pedia-table-key-first="true"] .pedia-table :is(th, td):first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1px 0 0 var(--rule, #ded2b4);
}

.pedia-table-scroll[data-pedia-table-mode="matrix"][data-pedia-table-key-first="true"] .pedia-table td:first-child {
  background: #fff;
}

.pedia-table-scroll[data-pedia-table-mode="matrix"][data-pedia-table-key-first="true"] .pedia-table tbody tr:nth-child(even) td:first-child {
  background: color-mix(in srgb, var(--cream, #f7f2e7) 55%, white);
}

.pedia-table-scroll[data-pedia-table-mode="matrix"][data-pedia-table-key-first="true"] .pedia-table tbody tr:hover td:first-child {
  background: color-mix(in srgb, var(--cream, #f7f2e7) 82%, white);
}

.pedia-table-scroll[data-pedia-table-mode="matrix"][data-pedia-table-key-first="true"] .pedia-table th:first-child {
  z-index: 2;
  background: var(--navy-deep, #0a1e3f);
}

@media (max-width: 720px) {
  .pedia-table-scroll {
    margin: 20px 0;
    border-radius: 8px;
  }

  .pedia-table-scroll .pedia-table {
    font-size: 13px;
  }

  .pedia-table-scroll .pedia-table th,
  .pedia-table-scroll .pedia-table td {
    padding: 10px 11px;
  }

  .pedia-table-scroll .pedia-table th {
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pedia-table-scroll {
    scroll-behavior: auto;
  }
}
