.tags-panel__body {
  overflow-y: auto;
}

.tags-table {
  width: 100%;
  overflow: auto;
}

.tags-table table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.tags-table th,
.tags-table td {
  padding: 0.45rem 0.6rem;
  text-align: left;
  font-size: 0.85rem;
}

.tags-table th.numeric,
.tags-table td.numeric {
  text-align: right;
}

.tags-table th.actions,
.tags-table td.actions {
  text-align: right;
  width: 0;
}

.tags-table tbody tr:hover {
  background: var(--surface-subtle);
}

.tags-table tr.editing {
  background: var(--sidebar-hover-bg);
}

.tags-table__label {
  max-width: 24rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tags-table__swatch {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px var(--shadow-faint);
}

.tags-panel__error {
  margin: 0.5rem 0;
  color: var(--danger);
  font-size: 0.8rem;
}

.tags-table__label-input {
  width: 100%;
}

.tags-table__color-editor {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tags-table__color-picker {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: none;
  cursor: pointer;
}

.tags-table__edit-controls {
  display: flex;
  justify-content: flex-start;
  padding: 0.25rem;
  gap: 0.4rem;
}

.tags-table__row-actions {
  display: flex;
  justify-content: flex-start;
  padding: 0.25rem;
  gap: 0.4rem;
}

.correspondents-panel .header-actions {
  gap: 0.5rem;
}

.tags-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.tags-actions__form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.tags-actions__form input[type='text'] {
  min-width: 14rem;
}

.correspondents-actions__form {
  display: flex;
  gap: 0.4rem;
}

.correspondents-actions__form input {
  min-width: 14rem;
}



.correspondent-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-subtle);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  font-size: 0.9rem;
  border: none;
}

.correspondent-pill__label {
  line-height: 1.2;
}

.correspondent-pill__label strong {
  font-size: 0.8rem;
  text-transform: capitalize;
  color: var(--muted);
}

.correspondent-pill__remove {
  border: none;
  background: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  padding: 0;
}

.correspondent-pill__remove:hover {
  color: var(--danger);
}

.correspondent-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.correspondent-form input,
.correspondent-form select {
  min-height: 32px;
}
