#friends-screen { max-width: 720px; width: 100%; margin-inline: auto; }
.friend-page-actions, .friend-row-actions, .friend-byline, .friend-code {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.friend-body, .friend-sheet, .friend-share-form, .friend-invite-form { display: grid; gap: 18px; min-width: 0; }
.friend-sheet, .friend-share-form { gap: 16px; }
.friend-sheet h3, .friend-group h2 { margin-block-end: 6px; }
.friend-sheet .sheet-head h2 { margin: 0; }
.friend-sheet p, .friend-body p { margin: 0; }
.friend-count {
  display: inline-grid; place-items: center; min-width: 20px; padding-inline: 4px;
  border-radius: 20px; font-size: var(--fs-small); background: var(--btn-soft); color: var(--ink);
}
.friend-empty {
  display: grid; justify-items: center; gap: 10px; padding: 36px 20px;
  background: var(--sand-soft); border-radius: var(--r-card); text-align: center;
}
.friend-empty p { margin: 0; max-width: 36ch; color: var(--text-2); font-size: var(--fs-secondary); }
.friend-empty-icon { display: grid; place-items: center; height: 40px; width: 40px; }
.friend-empty-icon svg { width: 32px; height: 32px; }
.friend-group { min-width: 0; }
.friend-list, .friend-pieces { list-style: none; margin: 0; padding: 0; }
.friend-list li {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0;
  border-block-end: 1px solid var(--line);
}
.friend-list .member-name { flex: 1; min-width: min(150px, 100%); }
.friend-list .member-name strong { font-weight: 500; }
.friend-row-actions { margin-inline-start: auto; gap: 4px; }
.friend-avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px;
  border-radius: 50%; background: var(--sand-soft); color: var(--ink); font-family: var(--f-display);
}
.friend-post { display: grid; gap: 12px; border-block-end: 1px solid var(--line); padding-block-end: 22px; min-width: 0; }
.friend-byline { flex-wrap: nowrap; gap: 10px; }
.friend-byline > div { min-width: 0; }
.friend-byline strong, span.friend-piece-name { font-size: var(--fs-label); font-weight: 600; overflow-wrap: anywhere; }
.friend-post-meta { display: flex; flex-wrap: wrap; gap: 5px; color: var(--text-2); font-size: var(--fs-small); }
.friend-post h2, .friend-preview h3 { overflow-wrap: anywhere; }
.friend-pieces { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr)); gap: 14px 10px; }
.friend-pieces li { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.friend-post .friend-pieces { grid-template-columns: repeat(auto-fit, minmax(min(146px, 100%), 1fr)); }
.friend-post .friend-pieces li { max-width: 248px; width: 100%; }
.friend-pieces small { font-size: var(--fs-small); overflow-wrap: anywhere; }
.friend-photo {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--r-tile); background: var(--sand-soft); margin-block-end: 4px;
}
.friend-photo img { width: 100%; height: 100%; object-fit: contain; }
.friend-photo svg { width: 32px; height: 32px; color: var(--text-2); }
.friend-preview .friend-pieces { grid-template-columns: repeat(auto-fill, minmax(min(95px, 100%), 1fr)); }
.friend-preview .friend-pieces:has(> li:only-child) { grid-template-columns: minmax(0, min(100%, 170px)); }
.friend-photo-draft { justify-self: center; max-width: 100%; max-height: 28vh; object-fit: contain; border-radius: var(--r-tile); }
.friend-sheet [role="status"]:empty { display: none; }
.friend-code {
  justify-content: space-between; margin-block-start: 10px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: var(--r-tile);
}
.friend-code code { font-size: var(--fs-secondary); letter-spacing: .1em; user-select: all; overflow-wrap: anywhere; }
.friend-share-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.friend-share-form legend { margin-block-end: 6px; font-weight: 600; }
.friend-recipient {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding-block: 7px;
  cursor: pointer; border-block-end: 1px solid var(--line); overflow-wrap: anywhere;
}
.friend-invite-form { gap: 10px; padding-block-start: 16px; border-block-start: 1px solid var(--line); }
.friend-invite-form button { justify-self: start; }
.friend-error:empty { display: none; }
.friend-error { color: var(--blush-ink); font-size: var(--fs-label); }
