/* ==========================================================================
   AnySync v2 — social group: Search · Friend requests & Notifications ·
   Profile & Privacy · QR (src/client/orbit-v2-social*.ts).
   Semantic tokens only (styles.css); class prefix v2-social-.
   ========================================================================== */

/* ------------------------------------------------------------ shared ---- */

.v2-social-online {
  display: inline-block;
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--callable);
  margin-right: 6px;
  vertical-align: middle;
}
.v2-social-online.is-closed { background: var(--muted); }
.v2-social-accent { color: var(--primary); font-weight: 550; }

.v2-social-input {
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--surface-glass);
  color: var(--foreground);
  font: inherit;
  font-size: 1rem;
  resize: vertical;
}
.v2-social-input::placeholder { color: var(--muted); }
.v2-social-input:focus-visible { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.v2-social-label { font-weight: 600; font-size: .875rem; }
.v2-social-hint { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .8125rem; }
.v2-social-code-input { font-size: 1.75rem; letter-spacing: .18em; text-align: center; font-variant-numeric: tabular-nums; }

kbd {
  font: inherit;
}
.v2-social-kbd,
.v2-social-hints kbd {
  display: inline-flex;
  gap: 3px;
}
.v2-social-kbd kbd,
.v2-social-hints kbd {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  background: var(--surface-glass-strong);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 550;
}

/* Person quick-look sheet (search results, requests). */
.v2-social-person { display: flex; align-items: center; gap: 16px; }
.v2-social-person-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-social-person-name { font-size: 1.25rem; font-weight: 650; }
.v2-social-person-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.v2-social-person-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ------------------------------------------------------------ search ---- */

.v2-social-overlay {
  position: fixed;
  inset: 0;
  z-index: 75;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 84px 16px 24px calc(var(--v2-nav-w) + 16px);
  background: color-mix(in srgb, var(--scrim) 55%, transparent);
}
.v2-social-overlay-panel {
  display: flex;
  width: min(680px, 100%);
  max-height: calc(100vh - 110px);
  max-height: calc(100dvh - 110px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass-strong);
  color: var(--foreground);
  -webkit-backdrop-filter: blur(calc(var(--blur) + 12px)) saturate(150%);
  backdrop-filter: blur(calc(var(--blur) + 12px)) saturate(150%);
  box-shadow: var(--shadow-lg);
  animation: v2-pop .16s ease-out;
  overflow: hidden;
}
@media (prefers-reduced-motion: reduce) { .v2-social-overlay-panel { animation: none; } }

.v2-social-search { display: flex; flex-direction: column; min-width: 0; width: 100%; }
.v2-social-search.is-overlay { padding: 16px 20px 14px; gap: 12px; }
.is-overlay .v2-social-search-results { gap: 8px; }
.is-overlay .v2-social-group { gap: 4px; }
.is-overlay .v2-social-group-head { min-height: 32px; }
.is-overlay .v2-social-result { min-height: 60px; padding: 8px 12px; }
.is-overlay .v2-social-result-art { width: 88px; height: 56px; }
.is-overlay .v2-social-result-art.is-place { width: 56px; }
.is-overlay .v2-social-result .v2-avatar { width: 48px; height: 48px; }
.v2-social-search-head { display: flex; align-items: center; gap: 10px; }
.v2-social-search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 52px;
  padding: 0 10px 0 16px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--surface-glass);
  color: var(--muted);
}
.v2-social-search-field:focus-within { border-color: var(--primary); box-shadow: var(--ring); }
.v2-social-search-field > svg { flex: none; color: var(--foreground); }
.v2-social-search-input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.v2-social-search-field .v2-social-search-input:focus,
.v2-social-search-field .v2-social-search-input:focus-visible { outline: none; box-shadow: none; border: 0; }
.v2-social-search-input::placeholder { color: var(--muted); font-weight: 500; }
.v2-social-search-input::-webkit-search-cancel-button { display: none; }
.v2-social-search-clear[hidden] { display: none; }
.v2-social-search-scopes { min-width: 0; }
.v2-social-search-scopes .v2-chip { min-height: 40px; }

.v2-social-search-scroll { min-height: 0; overflow: auto; margin: 0 -8px; padding: 0 8px 4px; }
.v2-social-search-results { display: flex; flex-direction: column; gap: 14px; }
.v2-social-group { display: flex; flex-direction: column; gap: 6px; }
.v2-social-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.v2-social-group-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; font-weight: 600; }
.v2-social-group-title > svg { color: var(--foreground); }
.v2-social-caret {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--foreground);
}
.v2-social-group .v2-link { min-height: 36px; font-size: .875rem; }
.v2-social-rows { display: flex; flex-direction: column; gap: 6px; }
.v2-social-tags { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.v2-social-result {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: color-mix(in srgb, var(--foreground) 3%, transparent);
  cursor: pointer;
}
.v2-social-result:hover { background: color-mix(in srgb, var(--foreground) 6%, transparent); }
.v2-social-result.is-active {
  border-color: color-mix(in srgb, var(--primary) 60%, transparent);
  background: var(--primary-soft);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 35%, transparent);
}
.v2-social-result-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.v2-social-result-title { font-weight: 600; font-size: 1rem; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-social-result-sub { display: block; color: var(--muted); font-size: .875rem; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-social-result-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 2px; }
.v2-social-result-meta .v2-meta svg { color: var(--primary); }
.v2-social-result-art { flex: none; width: 100px; height: 66px; border-radius: 12px; }
.v2-social-result-art.is-place { width: 66px; }
.v2-social-result-action { flex: none; }
.v2-social-result-action.v2-btn { min-width: 76px; color: var(--primary); }
.v2-social-result-action.is-on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.v2-social-hash {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}
.v2-social-result.is-hashtag { min-height: 72px; }

.v2-social-none { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 28px 12px; text-align: center; }
.v2-social-none-title { font-weight: 600; font-size: 1.0625rem; }
.v2-social-none p { margin: 0; }

.v2-social-search-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.v2-social-search-foot .v2-social-recent { flex: 1; }
.v2-social-hints { flex: none; padding-bottom: 8px; }
.is-overlay .v2-social-recent-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: -2px; }
.is-overlay .v2-social-recent-chips > * { flex: none; }
.is-overlay .v2-social-search-foot { padding-top: 12px; border-top: 1px solid var(--glass-border); }
.v2-social-recent { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.v2-social-recent-title { display: flex; align-items: center; gap: 8px; font-size: .875rem; font-weight: 550; color: var(--foreground); }
.v2-social-recent-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v2-social-recent-empty { font-size: .875rem; }
.v2-social-hints { display: flex; gap: 12px; color: var(--muted); font-size: .75rem; }
.v2-social-hints span { display: inline-flex; align-items: center; gap: 4px; }

/* Voice listening strip (phones). */
.v2-social-voice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 45%, var(--glass-border));
  border-radius: 16px;
  background: var(--primary-soft);
}
.v2-social-voice[hidden] { display: none; }
.v2-social-voice-orb {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 22%, transparent), 0 0 calc(18px * var(--glow-scale, 1)) var(--glow);
  animation: v2-social-pulse 1.4s ease-in-out infinite;
}
@keyframes v2-social-pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--primary) 10%, transparent), 0 0 calc(18px * var(--glow-scale, 1)) var(--glow); } }
.v2-social-voice-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.v2-social-voice-text { font-weight: 600; }
.v2-social-voice-meter { display: none; align-items: center; gap: 4px; height: 22px; }
.v2-social-voice.has-level .v2-social-voice-meter { display: flex; }
.v2-social-voice-meter span {
  width: 5px;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
  transform: scaleY(var(--l, .15));
  transition: transform .08s linear;
}
@media (prefers-reduced-motion: reduce) {
  .v2-social-voice-orb { animation: none; }
  .v2-social-voice-meter span { transition: none; }
}

/* The page (phones; on wider screens the route opens the overlay). */
.v2-social-search-screen .v2-social-search { gap: 12px; }
.v2-social-search.is-page .v2-social-search-field { min-height: 48px; border-radius: 999px; padding-left: 14px; }
.v2-social-search.is-page .v2-social-search-input { height: 44px; font-size: 1rem; }
.v2-social-search.is-page .v2-social-search-foot { padding-top: 6px; }
.v2-social-search.is-page .v2-social-recent-title { font-size: 1.0625rem; font-weight: 600; }
.v2-social-search.is-page .v2-social-recent-title svg { display: none; }
@media (max-width: 599px) {
  .v2-social-search.is-page { padding-top: max(6px, env(safe-area-inset-top)); }
  .v2-social-search.is-page .v2-social-result { padding: 10px; gap: 12px; background: var(--surface-glass); border-color: var(--glass-border); }
  .v2-social-search.is-page .v2-social-result.is-active { background: var(--primary-soft); border-color: var(--primary); }
  .v2-social-result-art { width: 84px; height: 72px; }
  .v2-social-result-art.is-place { width: 72px; height: 60px; }
  .v2-social-search.is-page .v2-social-tags { gap: 8px; }
  .v2-social-search.is-page .v2-social-result.is-hashtag { padding: 10px; gap: 10px; }
  .v2-social-search.is-page .v2-social-hash { width: 38px; height: 38px; border-radius: 12px; }
  .v2-social-search.is-page .v2-social-result.is-hashtag .v2-social-result-title { font-size: .9375rem; }
  .v2-social-search.is-page .v2-social-result-sub.is-split > span { display: block; overflow: hidden; text-overflow: ellipsis; }
  .v2-social-search.is-page .v2-social-result-sub.is-split > .v2-social-sep { display: none; }
}

/* ------------------------------------------------------------- inbox ---- */

.v2-social-pop { display: flex; flex-direction: column; gap: 10px; }
.v2-social-pop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.v2-social-pop-title { margin: 0; font-size: 1.1875rem; font-weight: 650; }
.v2-social-pop-sub { margin: 6px 0 0; font-size: 1rem; font-weight: 600; }
.v2-social-pop-list { display: flex; flex-direction: column; }
.v2-social-pop-list > * + * { border-top: 1px solid var(--glass-border); }
.v2-social-pop-empty { display: flex; align-items: center; gap: 8px; margin: 4px 0; color: var(--muted); }
.v2-social-pop .v2-link[disabled] { color: var(--muted); cursor: default; text-decoration: none; }
.v2-social-pop-foot { margin-top: 4px; }

.v2-social-req,
.v2-social-sugg { display: flex; align-items: center; gap: 12px; padding: 10px 0; min-width: 0; }
.v2-social-req-who {
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.v2-social-req-who:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-req-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.v2-social-req-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; min-width: 0; }
.v2-social-req-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9375rem; }
.v2-social-req-when { flex: none; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.v2-social-req-sub { color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.v2-social-req-actions { display: flex; gap: 8px; flex: none; }
.v2-social-req.is-inline .v2-btn { padding: 0 14px; }
.v2-social-req.is-stacked { align-items: flex-start; padding: 14px 6px; }
.v2-social-req.is-stacked .v2-social-req-name { font-size: 1.0625rem; }
.v2-social-req.is-stacked .v2-social-req-sub { font-size: .875rem; }
.v2-social-req.is-stacked .v2-social-req-actions { margin-top: 10px; }
.v2-social-req.is-stacked .v2-social-req-actions .v2-btn { min-width: 116px; }
.v2-social-req-list { display: flex; flex-direction: column; }
.v2-social-req-list > * + * { border-top: 1px solid var(--glass-border); }

.v2-social-notif {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 6px;
  border-radius: 14px;
}
.v2-social-notif:hover { background: color-mix(in srgb, var(--foreground) 5%, transparent); }
.v2-social-notif-hit { position: absolute; inset: 0; z-index: 1; width: 100%; padding: 0; border: 0; border-radius: inherit; background: none; cursor: pointer; }
.v2-social-notif-hit:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-notif-icon {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--tone-soft);
  color: var(--tone-ink);
}
.v2-social-notif-text { flex: 1; min-width: 0; }
.v2-social-notif-title { font-weight: 550; font-size: .9375rem; line-height: 1.3; }
.v2-social-notif.is-unread .v2-social-notif-title { font-weight: 600; }
.v2-social-notif-body { margin-top: 3px; color: var(--muted); font-size: .8125rem; line-height: 1.35; }
.v2-social-notif-side { display: flex; align-items: center; gap: 8px; flex: none; padding-top: 2px; }
.v2-social-notif-when { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.v2-social-unread {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 calc(8px * var(--glow-scale, 1)) var(--glow);
}

/* The page. */
.v2-social-inbox .v2-body { max-width: 1240px; }
.v2-social-inbox-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
@media (min-width: 1100px) {
  .v2-social-inbox-cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
  .v2-social-inbox-cols > .v2-section > .v2-section-head { margin-top: -44px; }
}
.v2-social-inbox-panel { display: flex; flex-direction: column; gap: 20px; }
.v2-social-inbox-seg .v2-seg { max-width: 560px; }
.v2-social-notif-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.v2-social-notif-list { display: flex; flex-direction: column; }
.v2-social-notif-list > .v2-social-notif + .v2-social-notif::before {
  content: "";
  position: absolute;
  top: 0;
  left: 62px;
  right: 6px;
  border-top: 1px solid var(--glass-border);
}
.v2-social-sugg-list { display: flex; flex-direction: column; }
.v2-social-sugg-list > .v2-social-sugg { padding: 10px 6px; }
.v2-social-sugg-list > * + * { border-top: 1px solid var(--glass-border); }
.v2-social-sugg-list .v2-social-req-name { font-size: 1rem; }
.v2-social-sugg .v2-btn { flex: none; min-width: 92px; }
@media (min-width: 600px) {
  .v2-social-req.is-stacked { align-items: center; }
  .v2-social-req.is-stacked .v2-social-req-body { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; }
  .v2-social-req.is-stacked .v2-social-req-body > :not(.v2-social-req-actions) { flex: 1 1 100%; }
  .v2-social-req.is-stacked .v2-social-req-actions { margin-top: 8px; }
}
@media (min-width: 900px) {
  .v2-social-req.is-stacked .v2-social-req-body { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; }
  .v2-social-req.is-stacked .v2-social-req-top { grid-column: 1; grid-row: 1; }
  .v2-social-req.is-stacked .v2-social-req-sub { grid-column: 1; grid-row: 2; }
  .v2-social-req.is-stacked .v2-social-req-actions { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
}
@media (max-width: 599px) {
  .v2-social-inbox-seg .v2-seg { max-width: none; }
  .v2-social-req.is-stacked .v2-social-req-actions .v2-btn { flex: 1; min-width: 0; }
  .v2-social-req.is-stacked .v2-social-req-actions { width: 100%; }
  .v2-social-sugg .v2-btn { min-width: 84px; }
}

/* ----------------------------------------------------------- profile ---- */

.v2-social-profile .v2-body { gap: 18px; }
.v2-social-profile-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 26px;
  overflow: hidden;
  isolation: isolate;
}
.v2-social-profile-glow {
  position: absolute;
  inset: 0 0 auto 0;
  height: 56%;
  z-index: -1;
  background:
    radial-gradient(60% 120% at 85% 0%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 70%),
    radial-gradient(40% 90% at 40% 0%, color-mix(in srgb, var(--violet) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.v2-social-profile-banner {
  position: absolute;
  inset: 0 0 auto 0;
  height: 52%;
  z-index: -2;
  opacity: .3;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .45) 40%, transparent 82%), linear-gradient(90deg, transparent 0%, #000 45%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .45) 40%, transparent 82%), linear-gradient(90deg, transparent 0%, #000 45%);
  mask-composite: intersect;
  pointer-events: none;
}
.v2-social-profile-banner .v2-art { position: absolute; inset: 0; background: none; }
.v2-social-profile-avatar .v2-avatar-online { width: 22px; height: 22px; right: 6px; bottom: 6px; box-shadow: 0 0 0 3px var(--surface-glass-strong); }
.v2-social-profile-avatar .v2-avatar.has-ring { box-shadow: 0 0 0 3px var(--surface-glass-strong), 0 0 0 5px var(--primary), 0 0 calc(24px * var(--glow-scale, 1)) var(--glow); }
.v2-social-profile-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v2-social-profile-name { margin: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.v2-social-profile-handle { color: var(--muted); font-size: 1rem; }
.v2-social-profile-bio { margin: 6px 0 0; color: var(--muted); }
.v2-social-profile-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.v2-social-profile-side { display: flex; flex-direction: column; align-items: stretch; gap: 18px; }
.v2-social-profile-stats { display: grid; grid-template-columns: repeat(3, auto); gap: 22px; justify-content: end; }
.v2-social-profile-stats .v2-stat > svg { color: var(--foreground); }
.v2-social-profile-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.v2-social-interest { min-height: 36px; padding: 0 12px; }
.v2-social-interest-x {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: inherit;
  cursor: pointer;
}
.v2-social-interest-x:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.v2-social-interest-x:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-interest-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.v2-social-interest-row .v2-social-interest { min-height: 40px; }

.v2-social-profile-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.v2-social-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.v2-social-card-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.v2-social-card-icon { display: inline-grid; place-items: center; color: var(--primary); padding-top: 2px; }
.v2-social-card-title { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -.01em; }
.v2-social-card-sub { margin: 4px 0 0; color: var(--muted); font-size: .9375rem; }

.v2-social-mode .v2-seg { width: 100%; }
.v2-social-mode .v2-seg.is-block .v2-seg-item { flex: 1 1 auto; min-width: 0; padding: 0 10px; }
.v2-social-mode-note { margin: 10px 2px 6px; color: var(--muted); font-size: .8125rem; }
.v2-social-toggles .v2-row { min-height: 64px; }

.v2-social-theme { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.v2-social-theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  padding: 10px 6px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--surface-glass);
  color: var(--foreground);
  font: inherit;
  font-size: .9375rem;
  font-weight: 550;
  cursor: pointer;
}
.v2-social-theme-opt:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--glass-border)); }
.v2-social-theme-opt:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-theme-opt.is-active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: 0 0 calc(14px * var(--glow-scale, 1)) var(--glow);
}

.v2-social-acct-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--foreground); }
.v2-social-account .v2-row { min-height: 64px; }
.v2-social-account .v2-row.is-danger .v2-row-title,
.v2-social-account .v2-row.is-danger .v2-social-acct-icon { color: var(--danger); }

.v2-social-confirm { align-items: flex-start; }
.v2-social-confirm p { margin: 0; font-weight: 550; }
.v2-social-confirm-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.v2-social-confirm-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; color: var(--muted); }
.v2-social-confirm-list li { display: flex; gap: 10px; align-items: flex-start; }
.v2-social-confirm-list svg { flex: none; margin-top: 2px; color: var(--primary); }

@media (max-width: 1099px) {
  .v2-social-profile-card { grid-template-columns: auto minmax(0, 1fr); }
  .v2-social-profile-side { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
  .v2-social-profile-stats { justify-content: start; }
}
@media (max-width: 1023px) {
  .v2-social-profile-cols { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  .v2-social-profile .v2-body { gap: 14px; }
  .v2-social-profile-card.pad-lg { padding: 16px; }
  .v2-social-profile-card { gap: 14px 16px; align-items: start; }
  /* avatar() sizes inline; scale the element itself. */
  .v2-social-profile-avatar .v2-avatar { width: 84px; height: 84px; font-size: 2rem; }
  .v2-social-profile-avatar .v2-avatar-online { width: 16px; height: 16px; right: 3px; bottom: 3px; }
  .v2-social-profile-name { font-size: 1.375rem; }
  .v2-social-profile-bio { font-size: .875rem; margin-top: 2px; }
  .v2-social-profile-tags { grid-column: 1 / -1; margin-top: 0; flex-wrap: nowrap; gap: 6px; }
  .v2-social-profile-tags > * { min-height: 32px; padding: 0 10px; gap: 5px; font-size: .8125rem; white-space: nowrap; }
  .v2-social-profile-tags svg { width: 15px; height: 15px; }
  .v2-social-profile-banner { height: 48%; }
  .v2-social-profile-main { display: contents; }
  .v2-social-profile-main > .v2-social-profile-name,
  .v2-social-profile-main > .v2-social-profile-handle,
  .v2-social-profile-main > .v2-social-profile-bio { grid-column: 2; }
  .v2-social-profile-card { grid-template-rows: auto; }
  .v2-social-profile-avatar { grid-row: 1 / span 3; }
  .v2-social-profile-side { flex-direction: column; align-items: stretch; gap: 14px; }
  .v2-social-profile-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .v2-social-profile-stats .v2-stat { gap: 6px; }
  .v2-social-profile-stats .v2-stat > svg { width: 20px; height: 20px; }
  .v2-social-profile-stats .v2-stat-value { font-size: 1rem; }
  .v2-social-profile-stats .v2-stat-label { font-size: .75rem; }
  .v2-social-profile-cols, .v2-social-col { gap: 14px; }
  .v2-social-col .v2-card.pad-lg { padding: 16px; }
  .v2-social-card-head { margin-bottom: 12px; }
  .v2-social-card-title { font-size: 1.125rem; }
  .v2-social-card-sub { font-size: .8125rem; }
  .v2-social-mode .v2-seg.is-block .v2-seg-item { padding: 0 6px; gap: 4px; font-size: .8125rem; }
  .v2-social-theme { gap: 6px; }
  .v2-social-theme-opt { min-height: 64px; padding: 8px 2px; gap: 4px; font-size: .8125rem; border-radius: 14px; }
  .v2-social-theme-opt svg { width: 20px; height: 20px; }
  .v2-social-toggles .v2-row, .v2-social-account .v2-row { min-height: 56px; }
  .v2-social-account .v2-row-sub,
  .v2-social-toggles .v2-row-sub { display: none; }
}

/* ---------------------------------------------------------------- QR ---- */

/* My code (popover · sheet · card). */
.v2-social-mycode { display: flex; flex-direction: column; gap: 14px; }
.v2-social-mycode-top { display: flex; align-items: center; gap: 18px; }
.v2-social-qr-frame {
  flex: none;
  width: 168px;
  height: 168px;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--glass-border), 0 0 calc(18px * var(--glow-scale, 1)) var(--glow);
}
.v2-social-qr-frame svg { display: block; width: 100%; height: 100%; stroke: none; border-radius: 10px; }
.v2-social-mycode-who { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.v2-social-mycode-who .v2-avatar { margin-bottom: 8px; }
.v2-social-mycode-name { font-size: 1.125rem; font-weight: 650; line-height: 1.2; }
.v2-social-mycode-online { display: inline-flex; align-items: center; color: var(--muted); font-size: .875rem; margin-top: 4px; }
.v2-social-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--surface-glass);
}
.v2-social-code-line { display: flex; align-items: center; gap: 6px; }
.v2-social-code-digits { font-size: 2rem; font-weight: 600; letter-spacing: .12em; font-variant-numeric: tabular-nums; color: var(--primary); }
.v2-social-code-sub { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8125rem; }
.v2-social-qr-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.v2-social-qr-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: 8px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: var(--surface-glass);
  color: var(--foreground);
  font: inherit;
  font-size: .875rem;
  font-weight: 550;
  cursor: pointer;
}
.v2-social-qr-tile > svg { width: 24px; height: 24px; color: var(--primary); }
.v2-social-qr-tile:hover { border-color: color-mix(in srgb, var(--primary) 55%, var(--glass-border)); }
.v2-social-qr-tile:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-qr-rows { display: flex; flex-direction: column; border-top: 1px solid var(--glass-border); }
.v2-social-qr-extra:empty { display: none; }
.v2-social-qr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 6px;
  border: 0;
  border-bottom: 1px solid var(--glass-border);
  border-radius: 0;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.v2-social-qr-row > span { flex: 1; }
.v2-social-qr-row > svg:last-child { color: var(--muted); }
.v2-social-qr-row:hover { background: color-mix(in srgb, var(--foreground) 5%, transparent); }
.v2-social-qr-row:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 10px; }
.v2-social-qr-extra .v2-social-qr-row { border: 1px solid var(--glass-border); border-radius: 14px; }
.v2-social-qr-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; color: var(--muted); font-size: .8125rem; }

/* The scanner page. */
.v2-social-qr { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); gap: 20px; align-items: start; }
.v2-social-qr-side:empty { display: none; }
.v2-social-qr-card .v2-social-card-title { margin-bottom: 14px; }
.v2-social-scanner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(var(--blur));
  backdrop-filter: blur(var(--blur));
  box-shadow: var(--shadow);
}
.v2-social-scan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.v2-social-scan-title { margin: 0; font-size: 1.25rem; font-weight: 600; text-align: center; flex: 1; }
.v2-social-scan-torch[hidden] { visibility: hidden; display: inline-grid; }
.v2-social-scan-view {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--avatar-base);
  isolation: isolate;
}
.v2-social-scan-view[data-state="denied"],
.v2-social-scan-view[data-state="unsupported"] { aspect-ratio: auto; background: none; overflow: visible; }
.v2-social-scan-zoom-layer { position: absolute; inset: 0; transform: scale(var(--zoom, 1)); transition: transform .2s; }
.v2-social-scan-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.v2-social-scan-video[hidden] { display: none; }
/* Simulated feed: a phone held up with a code, on a dim blurred room. (Drawn
   "photo" content, theme-independent like art().) */
.v2-social-scan-backdrop {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(60% 50% at 30% 30%, rgba(80, 110, 140, .55), transparent 70%),
    radial-gradient(50% 60% at 80% 80%, rgba(120, 90, 70, .45), transparent 70%),
    linear-gradient(160deg, #1d2733, #0c1118);
}
.v2-social-scan-phone {
  width: min(42%, 220px);
  aspect-ratio: 9 / 17;
  padding: 7px;
  border-radius: 26px;
  background: #0a0d12;
  box-shadow: 0 0 0 2px #2b323d, 0 18px 40px rgba(0, 0, 0, .55);
  transform: rotate(-12deg);
}
.v2-social-scan-phone-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12%;
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(170deg, #142738, #0a1622);
}
.v2-social-scan-phone-screen img { width: 30%; height: auto; }
.v2-social-scan-phone-qr { width: 72%; border-radius: 8px; overflow: hidden; }
.v2-social-scan-phone-qr svg { display: block; width: 100%; height: auto; stroke: none; }
.v2-social-scan-shade { position: absolute; inset: 0; background: radial-gradient(closest-side, transparent 62%, rgba(0, 0, 0, .35)); pointer-events: none; }
.v2-social-scan-brackets { position: absolute; inset: 14% 22%; pointer-events: none; }
.v2-social-scan-brackets span {
  position: absolute;
  width: 18%;
  height: 18%;
  /* Lifted toward white so the corners read on any camera feed, in every theme. */
  border: 4px solid color-mix(in srgb, var(--primary) 70%, var(--media-ink));
  filter: drop-shadow(0 0 calc(8px * var(--glow-scale, 1)) var(--glow));
}
.v2-social-scan-brackets span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 18px; }
.v2-social-scan-brackets span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 18px; }
.v2-social-scan-brackets span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 18px; }
.v2-social-scan-brackets span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 18px; }
.v2-social-scan-line {
  position: absolute;
  left: -14%;
  right: -14%;
  top: 50%;
  height: 3px;
  border-radius: 3px;
  background: var(--primary);
  box-shadow: 0 0 14px 3px var(--glow);
  animation: v2-social-scan 2.4s ease-in-out infinite alternate;
}
@keyframes v2-social-scan { from { top: 8%; } to { top: 92%; } }
@media (prefers-reduced-motion: reduce) {
  .v2-social-scan-line { animation: none; }
  .v2-social-scan-zoom-layer { transition: none; }
}
.v2-social-scan-start {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .62), transparent);
}
.v2-social-scan-note { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--media-muted); font-size: .8125rem; text-align: center; }
.v2-social-scan-hint {
  position: absolute;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .55);
  color: var(--media-ink);
  font-size: .875rem;
  font-weight: 550;
  white-space: nowrap;
}
.v2-social-scan-perm { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.v2-social-scan-zoom { align-self: center; }
.v2-social-scan-bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px; }
.v2-social-scan-ctl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: var(--foreground);
  font: inherit;
  font-size: .9375rem;
  font-weight: 550;
  cursor: pointer;
}
.v2-social-scan-ctl:focus-visible { outline: none; box-shadow: var(--ring); }
.v2-social-scan-ctl-icon {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--surface-glass-strong);
}
.v2-social-scan-ctl-icon svg { width: 26px; height: 26px; }
.v2-social-scan-ctl.is-primary .v2-social-scan-ctl-icon svg { width: 34px; height: 34px; }
.v2-social-scan-ctl.is-primary .v2-social-scan-ctl-icon {
  width: 84px;
  height: 84px;
  border-color: var(--primary);
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--primary) 22%, transparent), 0 0 calc(24px * var(--glow-scale, 1)) var(--glow);
}
.v2-social-scan-text { margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, monospace; }

@media (max-width: 1099px) {
  .v2-social-qr { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 599px) {
  /* Full screen: the scanner fills the viewport, controls float on it. */
  .v2-social-qr { display: block; }
  .v2-social-scanner {
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
    padding: max(10px, env(safe-area-inset-top)) 0 calc(14px + env(safe-area-inset-bottom));
    border: 0;
    border-radius: 0;
    background: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
  /* The camera fills the whole screen; title, zoom and the dock float on it (phone mockup). */
  .v2-social-scan-view { position: absolute; inset: -24px calc(-1 * var(--v2-gutter)); z-index: 0; aspect-ratio: auto; border-radius: 0; }
  .v2-social-scan-view[data-state="denied"],
  .v2-social-scan-view[data-state="unsupported"] { position: relative; inset: auto; z-index: 1; margin: 0; min-height: 0; }
  .v2-social-scan-top, .v2-social-scan-zoom, .v2-social-scan-bar { position: relative; z-index: 2; }
  .v2-social-scan-view:not([data-state="denied"]):not([data-state="unsupported"]) ~ .v2-social-scan-zoom { margin-top: auto; }
  .v2-social-scan-top { color: var(--media-ink); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
  .v2-social-scan-top::before {
    content: "";
    position: absolute;
    inset: calc(-1 * max(10px, env(safe-area-inset-top))) calc(-1 * var(--v2-gutter)) -24px;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent);
    pointer-events: none;
  }
  .v2-social-scan-brackets { inset: auto; left: 50%; top: 40%; width: 76%; aspect-ratio: 1; transform: translate(-50%, -50%); }
  .v2-social-scan-phone { width: 48%; transform: translateY(-10%) rotate(-12deg); }
  .v2-social-scan-start { bottom: 236px; padding: 0 16px; background: none; }
  .v2-social-scan-start .v2-social-scan-note { text-shadow: 0 1px 6px rgba(0, 0, 0, .7); }
  .v2-social-scan-hint { bottom: 236px; }
  .v2-social-scan-bar {
    padding: 14px 10px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    background: var(--surface-glass-strong);
    -webkit-backdrop-filter: blur(var(--blur));
    backdrop-filter: blur(var(--blur));
  }
  .v2-social-qr-frame { width: 140px; height: 140px; }
  .v2-social-mycode-top { gap: 14px; }
  .v2-social-code-digits { font-size: 1.75rem; }
}
