.friends-page {
  width: 100%;
  max-width: 1400px;
  margin: 10px auto 0;
  padding: 0 30px;
  display: flow-root;
}
.friends-page h1 {
  letter-spacing: -1.5px;
  margin: 60px 0 30px;
  font-size: 48px;
  line-height: 1.2;
}
.friend-actions {
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 60px;
  display: flex;
}
.friend-action {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  font-size: 15px;
  line-height: 24px;
  transition:
    background-color 0.2s,
    color 0.2s;
  display: inline-flex;
  box-shadow: 0 8px 16px -4px #2c2d300c;
}
.friend-action.primary {
  background: var(--text);
  color: var(--surface);
}
.friend-action.primary:hover,
.friend-action:hover {
  background: var(--accent);
  color: #fff;
}
.friend-section {
  margin-bottom: 48px;
}
.friend-section-heading {
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 40px;
  display: flex;
}
.friend-section-heading h2 {
  align-items: center;
  gap: 10px;
  font-size: 24px;
  line-height: 1.4;
  display: flex;
}
.friend-section-heading h2 > span {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 12px;
}
.friend-section-heading .friend-action {
  padding: 8px 24px;
  font-size: 13px;
}
.friend-section-description {
  color: var(--muted);
  margin: 4px 0 16px;
  font-size: 15px;
}
.friend-sponsors {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 16px;
  display: grid;
}
.friend-sponsor {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  min-width: 0;
  transition:
    transform 0.2s,
    border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.friend-sponsor:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.friend-tag {
  z-index: 1;
  color: #fff;
  background: #4259ef;
  border-radius: 0 0 12px;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 18px;
  position: absolute;
  top: 0;
  left: 0;
}
.friend-cover {
  -o-object-fit: cover;
  object-fit: cover;
  background: var(--surface-soft);
  width: 100%;
  height: 120px;
  display: block;
}
.friend-sponsor-info {
  gap: 8px;
  min-height: 78px;
  padding: 12px 10px;
  display: flex;
}
.friend-sponsor-info > img {
  -o-object-fit: cover;
  object-fit: cover;
  border-radius: 50%;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}
.friend-card > div,
.friend-sponsor-info > div {
  min-width: 0;
}
.friends-page h3 {
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.3;
  overflow: hidden;
}
.friend-card p,
.friend-sponsor-info p {
  -webkit-line-clamp: 2;
  color: var(--muted);
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
}
.friend-grid {
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  grid-template-rows: repeat(5, 90px);
  grid-auto-columns: 260px;
  grid-auto-flow: column;
  gap: 12px;
  padding: 2px 2px 8px;
  scroll-padding-inline: 2px;
  display: grid;
  overflow-x: auto;
}
.friend-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 16px;
  transition:
    background-color 0.2s,
    color 0.2s;
  display: flex;
}
.friend-card > img {
  -o-object-fit: cover;
  object-fit: cover;
  background: var(--surface-soft);
  border-radius: 50%;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
}
.friend-card h3 {
  margin-bottom: 6px;
}
.friend-card:hover {
  background: var(--accent);
  color: #fff;
}
.friend-card:hover p {
  color: #fff;
}
.friend-group-heading {
  align-items: flex-end;
  margin-bottom: 16px;
}
.friend-group-heading .friend-section-description {
  margin-bottom: 0;
}
.friend-controls {
  flex-shrink: 0;
  align-items: center;
  gap: 6px;
  display: flex;
}
.friend-scroll {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  display: inline-flex;
}
.friend-scroll-left {
  transform: rotate(180deg);
}
.friend-scroll:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.friend-scroll:not(:disabled):hover,
.friend-sort:hover {
  color: #fff;
  background: var(--accent);
}
.friend-sort {
  color: var(--muted);
  border-radius: 20px;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  display: inline-flex;
}
.friend-search,
.friend-sort {
  background: var(--surface);
  align-items: center;
}
.friend-search {
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
  gap: 12px;
  margin: -36px 0 36px;
  padding: 16px;
  display: flex;
}
.friend-search input {
  border: 1px solid var(--border);
  background: var(--surface-soft);
  min-width: 100px;
  color: var(--text);
  border-radius: 8px;
  flex: 1;
  padding: 10px 12px;
}
.friend-search button {
  padding: 8px;
  display: flex;
}
.friend-search [role="status"] {
  width: 100%;
  color: var(--muted);
  font-size: 13px;
}
.friend-empty {
  margin-bottom: 48px;
}
.friend-disclaimer {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 16px 20px;
}
.friend-disclaimer summary {
  cursor: pointer;
  font-weight: 600;
}
.friend-disclaimer p {
  margin-top: 12px;
  line-height: 1.8;
}
.friend-snapshot-note {
  color: var(--muted);
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.8;
}
.friends-page :is(a, button, input, summary, .friend-grid):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
@media (width<=1200px) {
  .friend-sponsors {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
@media (width<=900px) {
  .friend-sponsors {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (width<=650px) {
  .friends-page {
    padding: 0 16px;
  }
  .friends-page h1 {
    letter-spacing: -0.8px;
    margin-top: 36px;
    font-size: 32px;
  }
  .friend-actions {
    gap: 8px;
    margin-bottom: 36px;
  }
  .friend-action {
    padding: 8px 12px;
    font-size: 13px;
  }
  .friend-sponsors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .friend-group-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .friend-controls {
    align-self: flex-end;
  }
  .friend-section-heading h2 {
    font-size: 22px;
  }
  .friend-section-description {
    font-size: 13px;
  }
  .friend-search {
    margin-top: -12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .friends-page *,
  .friends-page :after,
  .friends-page :before {
    transition: none !important;
  }
  .friend-sponsor:hover {
    transform: none;
  }
}
