/* Contact shortcuts and visible actions, scoped to the contact list. */
.stat.stat-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
  transition: background-color .15s, border-color .15s, box-shadow .15s;
}

.stat-link:hover {
  background: #f7faf2;
  border-color: #94ae80;
}

.stat-link.is-active,
.stat-link[aria-current="true"] {
  background: #eff6e8;
  border-color: #78985e;
  box-shadow: inset 0 0 0 1px #78985e;
}

.stat-link.is-active .stat-label,
.stat-link[aria-current="true"] .stat-label {
  color: #365729;
}

.stat-link:focus-visible,
.contact-row-actions .button:focus-visible,
#clear-contact-filters:focus-visible {
  outline: 3px solid #527b36;
  outline-offset: 3px;
}

#contact-list {
  scroll-margin-top: 24px;
}

.contact-list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: -4px 0 14px;
  min-height: 44px;
}

#contact-results-count {
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

#clear-contact-filters {
  min-height: 44px;
  padding: 10px 0;
  color: #365729;
  text-decoration: underline;
  text-underline-offset: 3px;
}

#clear-contact-filters[hidden] {
  display: none;
}

.contacts-table th,
.contacts-table td {
  padding-left: 14px;
  padding-right: 14px;
}

.contacts-table .contact-cell {
  min-width: 160px;
}

.contacts-table .name-button {
  width: 100%;
  min-height: 44px;
}

.contacts-table .name-button > span:last-child {
  min-width: 0;
}

.contacts-table .name-button strong,
.contacts-table .name-button small,
.contacts-table .company-cell {
  overflow-wrap: anywhere;
}

.contacts-table .contact-actions-heading,
.contacts-table .contact-actions-cell {
  text-align: right;
}

.capture-state.reading {
  background: #eef0ed;
  color: #53645b;
}

.capture-state.complete {
  background: #e8f1f5;
  color: #315f73;
}

.capture-state.checked {
  background: #e9f4e2;
  color: #386232;
}

.capture-state.attention,
.capture-state.missing {
  background: #fff2d5;
  color: #816014;
}

.capture-state-detail {
  display: block;
  max-width: 210px;
  margin-top: 5px;
  line-height: 1.35;
  white-space: normal;
}

.contacts-table .contact-actions-cell {
  width: 1%;
  white-space: nowrap;
}

.contact-row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.contact-row-actions .button {
  min-height: 44px;
  padding: 10px 12px;
  font-size: .8rem;
  gap: 6px;
}

.contact-row-actions .row-edit:hover {
  background: #f1f6eb;
  border-color: #94ae80;
}

.contact-row-actions .row-delete {
  color: #a13535;
  background: #fff6f4;
  border: 1px solid #ebd0cb;
}

.contact-row-actions .row-delete:hover {
  background: #fde9e7;
  border-color: #c38179;
}

@media (max-width: 1100px) {
  .contacts-table,
  .contacts-table tbody {
    display: block;
    width: 100%;
  }

  .contacts-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .contacts-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    row-gap: 8px;
    padding: 20px;
    border-bottom: 1px solid #edf0e9;
  }

  .contacts-table tbody tr:last-child {
    border-bottom: 0;
  }

  .contacts-table td {
    display: block;
    min-width: 0;
    padding: 0;
    border: 0;
  }

  .contacts-table .contact-cell {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .contacts-table .company-cell {
    grid-column: 1;
    grid-row: 2;
    margin-left: 50px;
    font-size: .8rem;
    color: var(--muted);
    line-height: 1.5;
  }

  .contacts-table td.company-cell {
    max-width: none;
  }

  .contacts-table .initial {
    display: grid;
  }

  .contacts-table .company-cell::before {
    content: "Company: ";
  }

  .contacts-table .status-cell {
    grid-column: 1;
    grid-row: 3;
    margin-left: 50px;
  }

  .contacts-table .hide-mobile {
    display: none;
  }

  .contacts-table .contact-actions-cell {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    width: auto;
  }
}

@media (max-width: 620px) {
  .contacts-table tbody tr {
    padding: 16px;
    column-gap: 12px;
  }

  .contacts-table .name-button {
    align-items: flex-start;
    gap: 9px;
  }

  .contacts-table .initial {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .contacts-table .name-button strong {
    line-height: 1.4;
  }

  .contacts-table .company-cell,
  .contacts-table .status-cell {
    margin-left: 41px;
  }

  .contacts-table .status {
    white-space: normal;
    line-height: 1.4;
  }

  .contact-row-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-row-actions .button {
    min-width: 64px;
    padding: 10px;
  }

  .stat-link .stat-label {
    align-items: flex-start;
    min-height: 2.8em;
    line-height: 1.4;
    gap: 3px;
  }

  .stat-link .stat-label > span {
    flex-shrink: 0;
  }
}
