/* ============================================================================
   Tables, part badges and proportion bars. Used by home, break and results.
   ========================================================================== */

/* --------------------------------------------------------------- Tables --- */

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
caption {
  text-align: left;
  font-weight: 620;
  font-size: .9375rem;
  padding-bottom: var(--sp-2);
}
thead th {
  text-align: left;
  font-size: .6875rem;
  font-weight: 620;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody th, tbody td {
  text-align: left;
  font-weight: 400;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--fast) var(--ease); }
tbody tr:hover { background: var(--surface-2); }
td { font-variant-numeric: tabular-nums; }

.part-badge {
  display: inline-block;
  font-size: .6875rem;
  font-weight: 680;
  letter-spacing: .01em;
  padding: .1rem .4rem;
  border-radius: 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  color: var(--accent);
  vertical-align: 1px;
}

.bar {
  display: inline-block;
  vertical-align: middle;
  width: 5.5rem;
  height: 6px;
  background: var(--surface-3);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-right: var(--sp-2);
}
/* `display: block` is load-bearing: the fill is a <span>, and height has no
   effect on an inline box, so without it the bar renders empty at every value. */
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.bar-value { font-variant-numeric: tabular-nums; font-size: .85rem; color: var(--text-muted); }

/* Bar plus its percentage, kept together so the number never wraps away from
   the bar it describes. */
.meter { display: inline-flex; align-items: center; gap: var(--sp-2); }
.meter .bar-value { font-family: var(--font-mono); font-size: .75rem; }
