.lx-readable-table {
  table-layout: fixed;
  width: max(100%, var(--lx-table-width));
  min-width: 0;
  font-size: 0.875rem;
}

.lx-readable-table th,
.lx-readable-table td { padding: 10px 14px; }
.lx-readable-table tbody th,
.lx-readable-table thead th:first-child {
  width: auto;
  min-width: 0;
  max-width: none;
}
.lx-readable-table .list-item-head { gap: 10px; }
.lx-readable-table .list-item-copy { flex: 1 1 auto; }
.lx-readable-table .list-item-thumb { flex: 0 0 36px; width: 36px; height: 36px; }
.lx-readable-table .list-item-copy strong,
.lx-readable-table .list-item-copy small,
.lx-readable-table .lx-cell-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  line-height: 1.4;
}
.lx-readable-table .list-item-copy:has(small) strong,
.lx-readable-table .list-item-copy small { -webkit-line-clamp: 1; line-clamp: 1; }
.lx-readable-table .list-item-copy small { margin-top: 3px; }
.lx-readable-table .lx-cell-text.is-number,
.lx-readable-table .purchase-links a { white-space: nowrap; }
.lx-readable-table thead th { padding-right: 22px; }
.lx-readable-table thead .lx-sort { min-height: 32px; }
.lx-readable-table .lx-sort > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lx-readable-table .lx-sort::after { right: 16px; }
.lx-readable-table tbody td { color: var(--muted); }
.lx-readable-table tbody [data-lx-rank] { white-space: nowrap; }
.lx-readable-table .purchase-links { gap: 5px; }
.lx-readable-table .purchase-links a { min-height: 32px; padding: 5px 10px; font-size: 0.8125rem; }

.lx-table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.lx-full-text { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--muted); font-size: 0.8125rem; cursor: pointer; }
.lx-full-text input { width: 16px; height: 16px; accent-color: var(--blue); }
.lx-table-tools button { min-height: 32px; padding: 4px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.8125rem; cursor: pointer; }
.lx-table-tools button[hidden] { display: none; }
.lx-main:has([data-lx-full-text]:checked) .lx-readable-table .list-item-copy strong,
.lx-main:has([data-lx-full-text]:checked) .lx-readable-table .list-item-copy small,
.lx-main:has([data-lx-full-text]:checked) .lx-readable-table .lx-cell-text {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
  white-space: normal;
}

.lx-column-resize {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 1;
  width: 16px;
  cursor: col-resize;
  touch-action: none;
  user-select: none;
}
.lx-column-resize::before { content: ""; position: absolute; inset: 8px 6px; border-radius: 2px; background: var(--line); }
.lx-column-resize:hover::before,
.lx-column-resize:focus-visible::before { background: var(--blue-bright); }
.lx-column-resize:focus-visible { outline: 2px solid var(--blue-bright); outline-offset: -2px; }
.lx-readable-table.is-resizing,
.lx-readable-table.is-resizing * { cursor: col-resize !important; user-select: none !important; }

@media (max-width: 720px) {
  /* Let the full table scroll when a pinned column would fill the viewport. */
  .lx-readable-table thead th:first-child,
  .lx-readable-table tbody th { position: static; }
  .lx-readable-table thead th:first-child { position: sticky; left: auto; }
  .lx-readable-table .list-item-copy strong { font-size: 0.875rem; }
  .lx-table-tools { width: 100%; }
}
