.root {
  border-width: 0;
  width: 100%;
  border-spacing: 0;
  empty-cells: show;
  background: var(--color-background);
  text-align: left;
}

.root th,
.root td {
  border: 1px solid var(--color-outline);
  border-width: 1px 0 0;
  padding: var(--space-small);
}

.root thead th {
  border-width: 0 0 1px;
  text-transform: uppercase;
  vertical-align: top;
  background: var(--color-highlight);
}

.root thead th:empty {
  display: none;
}

.root tbody th {
  font-weight: normal;
}

.root tbody tr:first-child td,
.root tbody tr:first-child th {
  border-top: 0;
}

.root tbody td a {
  color: inherit;
  text-decoration: none;
}

.root tbody td a:hover,
.root tbody td a:focus,
.root tbody td a:active {
  color: var(--color-primary);
  text-decoration: underline;
}

.root tbody tr:hover th,
.root tbody tr:hover td {
  background-color: var(--color-highlight-warning);
}

.empty {
  border: 1px solid var(--color-outline);
  border-width: 1px 0;
  padding: var(--space-xlarge) var(--space-medium);
  background: var(--color-background) !important;
  text-align: center;
}

/* outline variation */
.outline {
  --table-radius: var(--radius-medium);
  border: 1px solid var(--color-outline);
  border-radius: var(--table-radius);
}

.outline thead:first-child tr:first-child th:first-child,
.outline tbody:first-child tr:first-child td:first-child {
  border-top-left-radius: var(--table-radius);
}

.outline thead tr:first-child th:last-child,
.outline tbody:first-child tr:first-child td:last-child {
  border-top-right-radius: var(--table-radius);
}

.outline tbody:last-child tr:last-child td:first-child {
  border-bottom-left-radius: var(--table-radius);
}

.outline tbody:last-child tr:last-child td:last-child {
  border-bottom-right-radius: var(--table-radius);
}

.outline.empty {
  border-width: 1px;
}

/** cascade border radius */
.root thead,
.root thead tr:first-child {
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.root thead tr:first-child th:first-child {
  border-top-left-radius: inherit;
}

.root thead tr:first-child th:last-child {
  border-top-right-radius: inherit;
}

.root tbody:last-child,
.root tbody:last-child tr:last-child {
  border-bottom-left-radius: inherit;
  border-bottom-right-radius: inherit;
}

.root tbody:last-child tr:last-child th:first-child,
.root tbody:last-child tr:last-child td:first-child {
  border-bottom-left-radius: inherit;
}

.root tbody:last-child tr:last-child td:last-child {
  border-bottom-right-radius: inherit;
}

/* compact variation */
.compact td,
.compact th {
  padding-top: var(--space-xsmall);
  padding-bottom: var(--space-xsmall);
}
