table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

thead {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
}

th {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 16px;
  text-align: left;
}

td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 140ms var(--ease);
}
tbody tr:hover { background: var(--bg-hover); }

.td-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.table-row--subdued {
  opacity: 0.78;
}

.table-muted {
  color: var(--text-muted);
}

.table-action-disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 29px;
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: not-allowed;
  user-select: none;
}

@media (max-width: 860px) {
  table {
    display: block;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 12px;
  }

  tr,
  tr:last-child {
    display: grid;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  tbody tr:hover {
    background: var(--bg-surface);
  }

  td {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 11px 14px;
    border-bottom: 1px solid var(--border-subtle);
  }

  td::before {
    content: attr(data-label);
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--text-muted);
  }

  tr:last-child td {
    border-bottom: 1px solid var(--border-subtle);
  }

  td:last-child {
    border-bottom: none;
  }

  .td-actions {
    display: grid;
    grid-template-columns: minmax(96px, 34%) minmax(0, 1fr);
    justify-content: stretch;
    white-space: normal;
  }

  .td-actions::before {
    align-self: center;
  }

  .td-actions > a,
  .td-actions > form,
  .td-actions > .table-action-disabled {
    justify-self: start;
  }

  .td-actions > form {
    display: inline-flex;
  }

  td .control-stack {
    min-width: 0;
  }

  td .copyable-input {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 430px) {
  td,
  .td-actions {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  td::before {
    margin-bottom: 1px;
  }
}
