/* friends — the friends group on a profile, the full list behind View all, and the answer to a
   friend request in the inbox. Tokens and shared components only (docs/DESIGN.md). */
@layer pages {
  /* On the profile: at most nine, three to a row on a phone. */
  .friend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: var(--sp-3); margin: 0; padding: 0; list-style: none; }
  .friend-tile { display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); min-width: 0; padding: var(--sp-3) var(--sp-2); border-radius: var(--r-md);
    border: 1px solid transparent; transition: background-color var(--t-fast), border-color var(--t-fast); }
  .friend-tile:hover { background: var(--surface-2); border-color: var(--border-subtle); }
  .friend-tile .pic { width: 56px; height: 56px; }
  .friend-tile .pic .initials { font-size: var(--fs-h3); }
  .friend-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text); }
  .friends-card .card-head .btn { flex: none; }
  .friend-badge { align-self: center; }

  /* The full list: the ranking table, with a message button on the right of each row. */
  .friends-list .table-wrap { overflow-x: auto; }
  .friends-table th.lb-rank, .friends-table td.lb-rank { width: 76px; }
  .friends-table .friend-cell { display: inline-flex; align-items: center; gap: var(--sp-3); min-width: 0; }
  .friends-table .who-cell { display: flex; flex-direction: column; min-width: 0; }
  .friends-table a.who { font-weight: var(--fw-semibold); color: var(--text); }
  .friends-table a.who:hover { color: var(--brand-text); }
  .friends-table .place-cell { display: inline-flex; align-items: center; gap: var(--sp-2); min-width: 0; color: var(--text-2); }
  .friends-table .only-phone { display: none; }
  .friends-table td.act, .friends-table th:last-child { width: 56px; text-align: right; }

  @media (max-width: 560px) {
    .friend-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .friends-table .col-country { display: none; }
    .friends-table .only-phone { display: inline-flex; font-size: var(--fs-xs); color: var(--text-2); }
    .friends-table th.lb-rank, .friends-table td.lb-rank { width: 44px; padding-left: var(--sp-1); }
    .friends-table th, .friends-table td { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  }
}
