/* ---------- Table ---------- */

.board { margin-bottom: 64px; }

.board-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: -1px; }

.board-tab {
  padding: 9px 18px;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--color-text-tertiary);
  border: 1px solid transparent;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: color var(--motion-fast) var(--ease-out);
}
.board-tab:hover { color: var(--color-text-primary); }
.board-tab.is-active {
  color: var(--color-text-primary);
  background: var(--color-surface);
  border-color: var(--color-border-subtle);
  border-bottom-color: var(--color-surface);
}

/* The chip strip that picks which slice of a benchmark the table shows:
   leetcode difficulty, or robloxqa split. */
.view-select { display: inline-flex; gap: 4px; margin-left: 12px; }

.table-scroll {
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border-subtle);
  border-radius: 0 var(--radius-md) var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-1);
}

/* A narrow window can still outrun the widest column set. Shade whichever edge
   has columns behind it so the cut reads as "scroll me", not as a clipped
   layout. Inset by the 1px border, and rounded to match the corners it sits in. */
.table-frame { position: relative; }
.table-frame::before,
.table-frame::after {
  content: "";
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 44px;
  z-index: 2; /* over the sticky header */
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out);
}
.table-frame::before {
  left: 1px;
  border-radius: 0 0 0 var(--radius-md);
  background: linear-gradient(to right, var(--scroll-shadow), transparent);
}
.table-frame::after {
  right: 1px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: linear-gradient(to left, var(--scroll-shadow), transparent);
}
.table-frame.can-scroll-left::before,
.table-frame.can-scroll-right::after { opacity: 1; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

/* Headers wrap to a second line rather than force the table wider than the
   page. Left-aligned and bottom-aligned so a wrapped label reads normally and
   still sits on one baseline with its single-line neighbours. */
thead th {
  position: sticky;
  top: 0;
  padding: 8px 10px;
  color: var(--color-text-tertiary);
  text-align: left;
  vertical-align: bottom;
  text-wrap: balance;
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
  user-select: none;
  transition: color var(--motion-fast) var(--ease-out);
}
thead th:hover { color: var(--color-text-primary); }
thead th.sorted { color: var(--color-primary-bright); }
thead th .arrow { display: inline-block; width: 0.7em; }

tbody td {
  padding: 8px 10px;
  text-align: right;
  white-space: nowrap;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid var(--color-border-subtle);
}
tbody tr:last-child > td { border-bottom: none; }

tbody tr.model-row { cursor: pointer; transition: background var(--motion-fast) var(--ease-out); }
tbody tr.model-row:hover { background: var(--color-primary-soft); }
tbody tr.model-row.expanded { background: var(--color-primary-soft); }

/* Rank sits left, under its header; the model column's own padding is all the
   gap the pair needs, so the rank cell gives up its right padding. */
th.col-rank, td.col-rank { width: 30px; padding-right: 0; }
td.col-rank { color: var(--color-text-tertiary); text-align: left; }
td.col-rank .medal {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
}
tr[data-rank="1"] .medal { color: var(--color-accent); }
tr[data-rank="2"] .medal { color: var(--color-text-secondary); }
tr[data-rank="3"] .medal { color: var(--color-text-tertiary); }

td.col-model { text-align: left; }
td.col-model .model-name { font-weight: 600; color: var(--color-text-primary); }
td.col-model .model-name:hover { color: var(--color-primary-bright); text-decoration: none; }
td.col-model .provider { display: block; font-size: 12px; color: var(--color-text-tertiary); }
td.col-model .provider .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: var(--radius-full);
}
/* Provider badge: the same disc-and-logo the charts plot. The span is the disc,
   the logo sits inset inside it. Glyphs ship white, so .ink-dark burns them
   down to near-black for the paler discs; .is-badge logos (Torpedo's) are
   already finished circular marks and fill the badge on their own. */
td.col-model .provider .provider-mark {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -3px;
  border-radius: var(--radius-full);
  overflow: hidden;
}
td.col-model .provider .provider-mark img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 21%;
  object-fit: contain;
}
td.col-model .provider .provider-mark.ink-dark img { filter: brightness(0.08); }
td.col-model .provider .provider-mark.is-badge img { padding: 0; }

/* Score cells: brand-purple tint whose opacity tracks the value (--pct is 0-1). */
td.cell-score {
  font-weight: 500;
  background-color: rgba(var(--score-tint), calc(var(--pct, 0) * var(--score-tint-max)));
}

td.cell-dim { color: var(--color-text-secondary); }

/* The 95% margin rides alongside the number it qualifies, set back far enough
   that the column still scans as a column of values. */
td .ci {
  color: var(--color-text-tertiary);
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
}

/* Expanded detail row */
tr.detail-row > td {
  padding: 16px 20px 20px;
  text-align: left;
  background: var(--color-surface-sunken);
}
.detail-grid { display: flex; flex-wrap: wrap; gap: 28px 48px; }
.detail-grid h4 { margin: 0 0 8px; color: var(--color-text-tertiary); font-family: var(--font-sans); }
.detail-grid table { font-size: 13px; width: auto; }
.detail-grid td, .detail-grid th {
  padding: 3px 12px 3px 0;
  border: none;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.detail-grid th { color: var(--color-text-tertiary); font-weight: 500; font-size: 12px; }
.detail-grid td:first-child, .detail-grid th:first-child { text-align: left; color: var(--color-text-secondary); }
.detail-grid .kv { margin: 0; font-size: 14px; }
.detail-grid .kv span { color: var(--color-text-tertiary); }

.board-note { color: var(--color-text-tertiary); font-size: 13px; line-height: 20px; margin: 10px 2px; }

.empty-note { padding: 28px; text-align: center; color: var(--color-text-tertiary); font-size: 13px; }
