.data-table {
  width: 100%;
  font-size: var(--text-sm);
}

.data-head {
  padding: var(--space-1) var(--space-2);
  border-bottom: var(--line-width) solid var(--line);
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.data-head-number {
  text-align: right;
}

.data-cell {
  padding: var(--space-1) var(--space-2);
  border-bottom: var(--line-width) solid var(--line);
  vertical-align: top;
}

.data-cell-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* A sortable heading (DataTable.new(sortable: true), heading(sort:)): the
   whole heading is the button, in the heading's own type, with a mark for
   the current order. */
.data-head-sort {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-dense);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.data-head-sort:hover {
  color: var(--ink);
}

.data-head-sort:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.data-head-sort-mark {
  min-width: 0.75em;
  color: var(--accent-ink);
}

/* A group heading row (Components::Table group_by:): one cell across the
   table on a sunken ground, so it divides the groups without a stripe. Its
   padding is a data cell's, so the title lines up with the first column. */
.data-group {
  padding: var(--space-1) var(--space-2);
  border-top: var(--line-width) solid var(--line);
  border-bottom: var(--line-width) solid var(--line);
  background: var(--surface-sunken);
  text-align: left;
  font-weight: 600;
}

/* The cell is a table cell, so the flex line sits inside it. */
.data-group-line {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.data-group-title {
  min-width: 0;
}

.data-group-note {
  font-size: var(--text-xs);
  font-weight: 400;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}

/* Pushed to the right edge of the heading. */
.data-group-end {
  margin-left: auto;
  font-weight: 400;
}
