/* ═══════════════════════════════════════════════════════════
   Night Square — Page Amis
   Palette: night black · champagne gold · soft glass
   Type: Montserrat
   ═══════════════════════════════════════════════════════════ */

html:has(body.friends-page) {
  background: #070707 !important;
  background-color: #070707 !important;
  background-image: none !important;
}

.friends-page {
  --fr-ink: #070707;
  --fr-gold: #c5a572;
  --fr-gold-bright: #e8d4a8;
  --fr-gold-dim: #8a7048;
  --fr-glass: rgba(255, 255, 255, 0.04);
  --fr-glass-border: rgba(255, 255, 255, 0.1);
  --fr-text: #eaeaea;
  --fr-muted: rgba(255, 255, 255, 0.48);
  --fr-font: 'Montserrat', system-ui, sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: clip;
  background: transparent;
  color: var(--fr-text);
  font-family: var(--fr-font);
}

/* ── Ambient ── */
.friends-ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.friends-wash {
  position: absolute;
  width: min(70vw, 520px);
  height: min(70vw, 520px);
  top: -12%;
  right: -18%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(197, 165, 114, 0.16) 0%, transparent 68%);
  filter: blur(40px);
}

.friends-noise {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── Layout ── */
.friends-main {
  flex: 1;
  position: relative;
  z-index: 1;
  width: 100%;
  padding: max(6.5rem, calc(4.75rem + env(safe-area-inset-top))) 0 calc(5rem + env(safe-area-inset-bottom));
}

.friends-wrap {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 max(1rem, env(safe-area-inset-left)) 0 max(1rem, env(safe-area-inset-right));
}

.friends-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  min-height: 36px;
  margin: 0 0 1.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 600;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.friends-back:hover {
  color: var(--fr-gold);
  border-color: rgba(197, 165, 114, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

/* ── Hero ── */
.friends-hero {
  margin-bottom: 1.5rem;
  animation: friends-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.friends-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.friends-eyebrow {
  margin: 0 0 0.4rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fr-gold);
}

.friends-hero-title {
  margin: 0 0 0.4rem;
  font-family: var(--fr-font);
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--fr-text);
}

.friends-hero-sub {
  margin: 0;
  max-width: 36ch;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--fr-muted);
}

.friends-btn-hero {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Meta strip — not dashboard cards */
.friends-meta {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  border: 1px solid var(--fr-glass-border);
  background: var(--fr-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.friends-meta-item {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.friends-meta-sep {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.1);
}

.friends-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.friends-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

/* ── Buttons ── */
.friends-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.65rem 1.15rem;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #e0c99a 0%, #c5a572 50%, #a88b5c 100%);
  color: #0a0a0a;
  font-family: var(--fr-font);
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
  box-shadow: 0 4px 18px rgba(197, 165, 114, 0.28);
}

.friends-btn-primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 8px 24px rgba(197, 165, 114, 0.36);
}

.friends-btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.friends-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  filter: none;
  box-shadow: none;
}

.friends-btn-block {
  width: 100%;
}

.friends-btn-sm {
  min-height: 36px;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-family: var(--fr-font);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, border-color 0.2s;
}

.friends-btn-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

.friends-btn-sm--gold {
  background: rgba(197, 165, 114, 0.16);
  border-color: rgba(197, 165, 114, 0.4);
  color: var(--fr-gold-bright);
}

.friends-btn-sm--gold:hover {
  background: rgba(197, 165, 114, 0.24);
}

/* ── Panel ── */
.friends-panel {
  border-radius: 22px;
  border: 1px solid var(--fr-glass-border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055) 0%, rgba(255, 255, 255, 0.02) 100%);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: friends-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) 0.08s both;
}

.friends-panel-head {
  padding: 1rem 1rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Segmented */
.friends-segmented {
  position: relative;
  display: flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.friends-segment-glider {
  position: absolute;
  top: 4px;
  left: 4px;
  width: calc(50% - 4px);
  height: calc(100% - 8px);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.friends-segmented[data-active="pending"] .friends-segment-glider {
  transform: translateX(100%);
}

.friends-segment {
  position: relative;
  z-index: 1;
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 40px;
  padding: 0.4rem 0.55rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(255, 255, 255, 0.42);
  font-family: var(--fr-font);
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s;
}

.friends-segment.is-active {
  color: #fff;
}

.friends-segment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--fr-gold);
  color: #0a0a0a;
  font-size: 0.65rem;
  font-weight: 800;
}

.friends-segment-badge[hidden] {
  display: none;
}

/* Search */
.friends-search-wrap {
  position: relative;
  display: block;
}

.friends-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.32);
  pointer-events: none;
}

.friends-search {
  width: 100%;
  min-height: 46px;
  padding: 0.65rem 1rem 0.65rem 2.55rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-family: var(--fr-font);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.friends-search::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.friends-search:focus {
  outline: none;
  border-color: rgba(197, 165, 114, 0.45);
  box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

.friends-panel-body {
  padding: 0.85rem 1rem 1.15rem;
}

.friends-toast {
  min-height: 1.2rem;
  margin-bottom: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: #7ee8a0;
  background: rgba(126, 232, 160, 0.08);
  border: 1px solid rgba(126, 232, 160, 0.2);
}

.friends-toast:empty {
  display: none;
}

.friends-toast.is-error {
  color: #ff9b9b;
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.2);
}

/* Loading */
.friends-loading {
  padding: 0.5rem 0 1rem;
}

.friends-loading[hidden],
.friends-empty-state[hidden],
.friends-tab-panel[hidden] {
  display: none !important;
}

.friends-skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.friends-skeleton-card {
  height: 68px;
  border-radius: 14px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.03) 0%,
    rgba(255, 255, 255, 0.07) 50%,
    rgba(255, 255, 255, 0.03) 100%
  );
  background-size: 200% 100%;
  animation: friends-shimmer 1.4s ease-in-out infinite;
}

.friends-skeleton-card:nth-child(2) { animation-delay: 0.12s; }
.friends-skeleton-card:nth-child(3) { animation-delay: 0.24s; }

@keyframes friends-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.friends-loading-text {
  margin: 0;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.38);
}

/* Friend cards */
.friends-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.friends-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s, background 0.2s, transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  animation: friends-card-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.friends-card:hover {
  border-color: rgba(197, 165, 114, 0.22);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

@keyframes friends-card-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.friends-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.friends-avatar-ring {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 1.5px solid rgba(197, 165, 114, 0.35);
  pointer-events: none;
}

.friends-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--fr-font);
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.friends-avatar--0 { background: linear-gradient(135deg, #c5a572, #8a7048); }
.friends-avatar--1 { background: linear-gradient(135deg, #5a6a7a, #3a4550); }
.friends-avatar--2 { background: linear-gradient(135deg, #8b6b5c, #5c4338); }
.friends-avatar--3 { background: linear-gradient(135deg, #4a7a72, #2f524c); }
.friends-avatar--4 { background: linear-gradient(135deg, #b08a4a, #7a5e2e); }
.friends-avatar--5 { background: linear-gradient(135deg, #6a7a8c, #44505c); }

.friends-card-body {
  flex: 1;
  min-width: 0;
}

.friends-card-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friends-card-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.42);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friends-card-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.friends-card-badge--pending {
  background: rgba(197, 165, 114, 0.12);
  color: var(--fr-gold-bright);
  border: 1px solid rgba(197, 165, 114, 0.28);
}

.friends-card-badge--sent {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.friends-card-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.friends-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.friends-icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.friends-icon-btn--danger:hover {
  background: rgba(255, 69, 58, 0.14);
  border-color: rgba(255, 69, 58, 0.32);
  color: #ff8f8f;
}

/* Pending */
.friends-pending-sections {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.friends-pending-section h3 {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.friends-section-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.friends-section-dot--in {
  background: var(--fr-gold);
}

.friends-section-dot--out {
  background: rgba(255, 255, 255, 0.45);
}

/* Empty */
.friends-empty-state {
  text-align: center;
  padding: 2.25rem 1.1rem 1.85rem;
}

.friends-empty-state--compact {
  padding: 1rem 0.5rem;
}

.friends-empty-state--compact p {
  margin: 0;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.38);
}

.friends-empty-visual {
  margin: 0 auto 1.1rem;
  width: fit-content;
}

.friends-empty-stack {
  display: flex;
  align-items: center;
  padding-left: 0.65rem;
}

.friends-empty-stack span {
  width: 36px;
  height: 36px;
  margin-left: -0.65rem;
  border-radius: 50%;
  border: 2px solid #121212;
  background: linear-gradient(135deg, rgba(197, 165, 114, 0.45), rgba(197, 165, 114, 0.15));
}

.friends-empty-stack span:nth-child(2) {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
}

.friends-empty-stack span:nth-child(3) {
  background: linear-gradient(135deg, rgba(197, 165, 114, 0.28), rgba(90, 90, 90, 0.35));
}

.friends-empty-state h3 {
  margin: 0 0 0.4rem;
  font-family: var(--fr-font);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.friends-empty-state p {
  margin: 0 auto 1.15rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
  max-width: 32ch;
}

/* FAB */
.friends-fab {
  display: none;
  position: fixed;
  right: max(1.1rem, env(safe-area-inset-right));
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 500;
  width: 54px;
  height: 54px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0c99a, #c5a572);
  color: #0a0a0a;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(197, 165, 114, 0.4);
  transition: transform 0.2s ease;
}

.friends-fab:hover {
  transform: scale(1.06);
}

.friends-fab:active {
  transform: scale(0.96);
}

/* Modal */
.friends-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.friends-modal-backdrop.is-visible {
  opacity: 1;
}

.friends-modal-backdrop[hidden] {
  display: none !important;
}

.friends-modal {
  width: min(440px, 100%);
  max-height: min(90vh, 640px);
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(165deg, #161616 0%, #0c0c0c 100%);
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.55);
  position: relative;
  transform: scale(0.96) translateY(12px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.friends-modal-backdrop.is-visible .friends-modal {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.friends-modal-header {
  padding: 1.4rem 1.35rem 0;
  position: relative;
  padding-right: 3rem;
}

.friends-modal-kicker {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fr-gold);
}

.friends-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.15rem;
  height: 2.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.friends-modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.friends-modal-title {
  margin: 0 0 0.35rem;
  font-family: var(--fr-font);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.friends-modal-sub {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.45);
}

.friends-modal-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 1.1rem 1.35rem 0;
  padding: 4px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.friends-modal-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 0.5rem;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: rgba(255, 255, 255, 0.4);
  font-family: var(--fr-font);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.friends-modal-tab.is-active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.friends-modal-body {
  padding: 1.1rem 1.35rem 1.4rem;
}

.friends-modal-panel[hidden] {
  display: none !important;
}

.friends-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.8rem;
}

.friends-field label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.friends-field-opt {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.3);
}

.friends-field input {
  min-height: 46px;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
  font-family: var(--fr-font);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.friends-field input:focus {
  outline: none;
  border-color: rgba(197, 165, 114, 0.45);
  box-shadow: 0 0 0 3px rgba(197, 165, 114, 0.1);
}

.friends-modal-feedback {
  min-height: 1.1rem;
  margin: 0.6rem 0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #7ee8a0;
}

.friends-modal-feedback:empty {
  display: none;
}

.friends-modal-feedback.is-error {
  color: #ff9b9b;
}

.friends-result-card {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.friends-result-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.friends-link-box {
  margin-top: 0.8rem;
  padding: 0.95rem;
  border-radius: 14px;
  border: 1px dashed rgba(197, 165, 114, 0.35);
  background: rgba(197, 165, 114, 0.06);
}

.friends-link-box code {
  display: block;
  word-break: break-all;
  font-size: 0.78rem;
  color: var(--fr-gold-bright);
  margin-bottom: 0.6rem;
  line-height: 1.45;
}

/* Animations */
@keyframes friends-fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Invite page compat */
.invite-card {
  max-width: 640px;
  margin: 0 auto;
}

.invite-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 0.9rem;
  flex-wrap: wrap;
}

#invite-status.is-error {
  color: #ff9b9b;
}

/* Responsive */
@media (max-width: 560px) {
  .friends-btn-hero {
    display: none;
  }

  .friends-fab {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .friends-card {
    flex-wrap: wrap;
  }

  .friends-card-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .friends-skeleton-card,
  .friends-card,
  .friends-hero,
  .friends-panel {
    animation: none !important;
  }

  .friends-modal,
  .friends-modal-backdrop {
    transition: none !important;
  }
}
