/* Social surfaces share NEXO's semantic paint tokens; no changes to media/layout outside social. */
.social-activity-host { position:fixed; inset:0; z-index:165; display:grid; place-items:center; padding:20px; animation:activity-surface-in .18s ease both; }
.social-activity-backdrop { position:absolute; inset:0; background:rgba(var(--theme-shadow-rgb,0,0,0),.35); }
.social-activity { position:relative; width:min(460px,100%); max-height:calc(100dvh - 40px); overflow:auto; padding:20px; border:1px solid var(--theme-border-subtle,#323740); border-radius:24px; background:rgb(var(--theme-surface-base-rgb,7,7,8)); color:var(--theme-text-primary,#f1f3f9); box-shadow:0 16px 48px rgba(var(--theme-shadow-rgb,0,0,0),.24); }
.social-activity svg { width:20px; height:20px; flex:none; }
.social-activity .social-header { gap:10px; margin:0; }
.social-activity h2 { font-size:21px; line-height:1.25; margin:0; }
.social-activity .social-header [data-social=activity-close] {width:32px; height:32px; padding:6px; border:1px solid rgba(var(--theme-text-primary-rgb,244,244,246),.14); border-radius:50%; background:transparent;}
.social-activity #activity-intro {margin:12px 0 16px;}
.social-activity>p,.social-blocked-intro { color:var(--theme-text-secondary,#adb6c6); font-size:13px; line-height:1.6; }
.social-blocked-intro { margin:16px 0 0; flex:none; }
.social-activity-options {display:grid; gap:4px;}
.social-activity-option,.social-room-visibility { display:flex; align-items:flex-start; gap:12px; width:100%; margin:0; padding:10px 12px; text-align:left; border:1px solid transparent; border-radius:14px; background:transparent; color:inherit; cursor:pointer; font:inherit; transition:background .18s,border-color .18s; }
.social-activity-option:hover,.social-room-visibility:not(:disabled):hover { background:rgba(var(--theme-surface-hover-rgb,43,43,47),.35); }
.social-activity-option[aria-checked=true] { background:color-mix(in srgb,var(--theme-functional,#3d9cff) 6%,rgb(var(--theme-surface-base-rgb,7,7,8))); border-color:color-mix(in srgb,var(--theme-functional,#3d9cff) 20%,var(--theme-border-subtle,#323740)); }
.social-activity-option>span,.social-room-visibility>span { flex:1; min-width:0; display:grid; gap:4px; }
.social-activity-option .activity-dot,.social-activity-option .activity-radio {margin-top:1px;}
.social-activity-visibility {display:grid; gap:4px; margin-top:14px; padding-top:10px; border-top:1px solid rgba(var(--theme-text-primary-rgb,244,244,246),.12);}
.social-activity .social-room-visibility {padding:10px 0; border:0; border-radius:10px;}
.social-activity .social-room-visibility>svg,.social-activity .social-room-visibility>.social-toggle {margin-top:1px;}
.social-activity .social-toggle,.social-activity .social-toggle:before {transition:background .18s,transform .18s;}
.social-activity .social-room-visibility:disabled {cursor:not-allowed;}
.social-game-credits { margin-top:12px; padding-top:12px; border-top:1px solid rgba(var(--theme-text-primary-rgb,244,244,246),.12); font-size:12px; color:var(--theme-text-muted,#adb3bd); }
.social-game-credits summary {cursor:pointer; width:fit-content;}
.social-activity-option:focus-visible,.social-room-visibility:focus-visible,.social-game-credits summary:focus-visible {outline:2px solid var(--theme-focus,#88baff); outline-offset:2px;}
.social-game-credits p { line-height:1.5; }
.social-presence>span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-game-context { display:flex; align-items:center; gap:5px; min-width:0; font-size:11px; color:var(--theme-text-muted,#adb3bd); }
.social-game-context svg {width:14px;height:14px;flex:none;}
.social-game-context span {min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
[data-activity-label] { max-width:250px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-activity strong { font-size:14px; line-height:1.4; }
.social-activity small { color:var(--theme-text-secondary,#adb6c6); font-size:13px; line-height:1.5; }
.activity-dot { width:20px; height:20px; flex:none; border-radius:50%; background:var(--theme-success,#29db91); }
.activity-dot.is-dnd { background:var(--theme-danger,#f04465); }
.activity-dot.is-offline { background:var(--theme-text-muted,#9aa1af); }
.activity-dot:not(.is-available):after { content:''; display:block; width:10px; height:2px; margin:9px auto; background:var(--theme-surface-card,#101216); }
.activity-radio { width:20px; height:20px; border-radius:50%; border:2px solid var(--theme-border-strong,#616b7d); flex:none; }
[aria-checked=true]>.activity-radio { border-color:var(--theme-functional,var(--theme-primary,#156cff)); box-shadow:inset 0 0 0 3px var(--theme-surface-interactive,#181c23); background:var(--theme-knob,#fff); }
.social-activity .social-activity-error { color:var(--theme-danger-text,#f16c7c); }
@keyframes activity-surface-in {from {opacity:0;} to {opacity:1;}}
@media(max-width:480px) {.social-activity-host {padding:12px;} .social-activity {padding:16px; max-height:calc(100dvh - 24px);} .social-activity h2 {font-size:19px;}}
@media(prefers-reduced-motion:reduce) {.social-activity-host,.social-activity,.social-activity * {animation:none!important; transition:none!important;}}
.social-settings-popover hr { margin:4px 8px; border:0; border-top:1px solid var(--theme-border-subtle,#323740); }
.social-presence.is-dnd.is-online:not(.is-in-room) { color:var(--theme-danger-text,#f16c7c); }
[data-own-activity][data-activity=available] { --own-activity-text:var(--theme-success-text,#82d7a9); --own-activity-dot:var(--theme-success,#48d38c); }
[data-own-activity][data-activity=dnd] { --own-activity-text:var(--theme-danger-text,#f16c7c); --own-activity-dot:var(--theme-danger,#f04465); }
[data-own-activity][data-activity=offline] { --own-activity-text:var(--theme-text-muted,#9aa1af); --own-activity-dot:var(--theme-text-muted,#9aa1af); }
[data-own-activity][data-activity=dnd] i { background:var(--theme-danger,#f04465); }
[data-own-activity][data-activity=offline] i { background:var(--theme-text-muted,#9aa1af); }
.social-menu>hr { margin:6px 8px; border:0; border-top:1px solid var(--theme-border-subtle,#323740); }
.social-friend-overlay { position:fixed; inset:0; z-index:160; display:grid; place-items:center; padding:16px; background:rgba(var(--theme-shadow-rgb,0,0,0),.35); }
.social-friend-confirm { position:relative; width:min(320px,100%); padding:18px 16px 16px; border:1px solid var(--theme-border-subtle,#323740); border-radius:12px; background:var(--theme-surface-card,#101216); color:var(--theme-text-primary,#f1f3f9); box-shadow:0 16px 48px rgba(var(--theme-shadow-rgb,0,0,0),.24); }
.social-friend-confirm h2 { display:flex; align-items:center; gap:8px; margin:0 26px 12px 0; font-size:14px; }
.social-friend-confirm svg { width:20px; height:20px; flex:none; }
.social-friend-confirm p { font-size:13px; line-height:1.45; color:var(--theme-text-secondary,#adb6c6); margin:0 0 20px; }
.social-friend-confirm footer { display:flex; gap:12px; }
.social-friend-confirm footer button { flex:1; min-height:40px; }
.social-friend-confirm .social-friend-close { position:absolute; top:8px; right:8px; min-height:26px; padding:3px; border:0; background:transparent; }
.social-friend-confirm .social-destructive { background:var(--theme-danger,#f04465); border-color:var(--theme-danger,#f04465); color:var(--theme-on-accent,#fff); }
.home-friends { border-top:1px solid var(--theme-border-subtle,#303642); margin-top:20px; padding-top:20px; }
.home-friends header,.home-social-invites>header { display:flex; align-items:center; justify-content:space-between; gap:12px; font-size:14px; }
.home-friends header button { display:flex; gap:5px; align-items:center; padding:4px 0; background:none; border:0; color:var(--theme-text-secondary,#adb6c6); font-size:12px; }
.home-friend-list { display:grid; gap:0; margin-top:12px; max-height:260px; overflow:auto; }
.home-friend-row { display:flex; align-items:center; gap:8px; min-width:0; padding:7px 0; border-bottom:1px solid var(--theme-border-subtle); }
.home-friend-row:last-child { border-bottom:0; }
.home-friend-identity { display:flex; align-items:center; gap:9px; flex:1; min-width:0; padding:0; border:0; background:none; color:var(--theme-text-primary); text-align:left; }
.home-friend-identity>span { display:grid; gap:4px; min-width:0; }
.home-friend-more { flex:none; display:grid; place-items:center; padding:3px; border:0; background:none; color:var(--theme-text-secondary); }
.social-room-join { display:flex; align-items:center; justify-content:center; gap:4px; flex:none; min-height:28px; padding:4px 7px; border:1px solid color-mix(in srgb,var(--theme-functional,var(--theme-primary,#0067d4)) 65%,transparent); border-radius:7px; background:color-mix(in srgb,var(--theme-functional,var(--theme-primary,#0067d4)) 20%,var(--theme-surface-card,#101216)); color:var(--theme-text-primary,#f1f3f9); font-size:10px; font-weight:700; white-space:nowrap; }
.social-room-join:hover { background:color-mix(in srgb,var(--theme-functional,var(--theme-primary,#0067d4)) 32%,var(--theme-surface-card,#101216)); }
.social-room-join:disabled { opacity:.6; }
.social-person .social-room-join svg,.home-friends .social-room-join svg { width:13px; height:13px; }
.social-person:has(.social-room-join) { gap:7px; }
.social-person:has(.social-room-join) .social-person-name { font-size:12px; }
.home-friend-list .home-friend-identity .avatar { width:36px; height:36px; flex-basis:36px; }
/* Keep the additional friend actions bounded by the existing Home card. */
.reference-home:has(.home-friend-row) .reference-entry-card { max-height:calc(100dvh - 160px); overflow:auto; }
.reference-home:has(.home-friend-row) .authenticated-home-card { padding-block:24px !important; gap:12px !important; }
.reference-home:has(.home-friend-row) .authenticated-welcome { margin-bottom:4px; }
@media(min-width:761px) and (max-width:1450px) {
  .reference-home:has(.home-friend-row) .reference-entry-content { grid-template-columns:minmax(0,1fr) minmax(160px,.65fr) minmax(320px,410px); }
  .reference-home:has(.home-friend-row) .nexo-orbit { width:100%; }
}
@media(min-width:761px) and (max-width:1050px) {
  .reference-home:has(.home-friend-row) .reference-entry-content { grid-template-columns:minmax(0,1fr) minmax(320px,45%); gap:20px; }
  .reference-home:has(.home-friend-row) .reference-benefits { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(max-width:760px) { .reference-home:has(.home-friend-row) .reference-entry-card { max-height:none; } }
.home-friend-list>button { display:grid; justify-items:center; align-content:start; gap:7px; min-width:0; padding:0; border:0; background:none; color:var(--theme-text-primary,#edf1f9); }
.home-friend-list .avatar { width:clamp(44px,4.5vw,64px); height:clamp(44px,4.5vw,64px); }
.home-friend-list strong { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:12px; }
.home-friend-list p { grid-column:1/-1; color:var(--theme-text-secondary,#adb6c6); font-size:12px; }
.social-presence { display:flex; align-items:center; min-width:0; gap:5px; font-size:11px; color:var(--theme-text-muted,#9aa1af); }
.social-presence i { width:6px; height:6px; flex:none; border-radius:50%; background:currentColor; }
.social-presence.is-online { color:var(--theme-success,#29db91); }
.social-presence.is-in-room { color:var(--theme-functional,#2f92ff); }
.social-backdrop { position:fixed; z-index:140; inset:0; background:rgba(var(--theme-shadow-rgb,0,0,0),.35); backdrop-filter:blur(4px); }
.social-panel { position:fixed; z-index:141; right:max(28px,calc((100vw - 1390px)/2)); top:120px; bottom:70px; width:min(560px,calc(100vw - 56px)); display:flex; flex-direction:column; padding:24px; min-height:0; border:1px solid var(--theme-border-subtle,#323740); border-radius:18px; background:var(--theme-surface-card,#101216); color:var(--theme-text-primary,#f1f3f9); box-shadow:0 16px 48px rgba(var(--theme-shadow-rgb,0,0,0),.24); }
.social-panel[hidden] { display:none; }
.social-panel.social-add { bottom:auto; }
.social-header { position:relative; display:flex; align-items:center; gap:12px; min-height:44px; flex:none; }
.social-header h2 { flex:1; margin:0; font-size:25px; letter-spacing:-.025em; }
.social-header>button:first-child:not(:only-child) { margin-left:-5px; }
.social-header .avatar { width:46px; height:46px; flex:none; }
.social-person-name { display:grid; grid-template-columns:minmax(0,1fr); flex:1; min-width:0; gap:5px; font-size:14px; }
.social-person-name>.social-profile-link { min-width:0; max-width:100%; }
.social-person-name strong { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-person-name small { font-size:12px; color:var(--theme-text-secondary,#adb6c6); }
.social-panel svg,.social-invite svg,.home-friends svg,.home-social-invites svg { width:20px; height:20px; flex:none; }
.social-panel input,.social-panel textarea { width:100%; min-width:0; background:var(--theme-input,#14171c); color:var(--theme-text-primary,#f1f3f9); border:1px solid var(--theme-border-subtle,#323740); border-radius:11px; padding:12px; font:inherit; }
.social-search { display:flex; align-items:stretch; gap:12px; margin:22px 0 10px; }
.social-search label { display:flex; flex:1; min-width:0; align-items:center; gap:10px; padding:0 12px; border:1px solid var(--theme-border-subtle,#323740); border-radius:11px; background:var(--theme-input,#14171c); color:var(--theme-text-secondary,#adb6c6); }
.social-search input { border:0; background:none; padding:14px 0; font-size:13px; }
.social-button,.social-invite-actions button { display:inline-flex; justify-content:center; align-items:center; gap:7px; min-width:38px; min-height:38px; padding:9px 12px; border:1px solid var(--theme-border-subtle,#323740); border-radius:10px; color:var(--theme-text-primary,#f1f3f9); background:var(--theme-surface-interactive,#181c23); font-size:12px; font-weight:600; white-space:nowrap; cursor:pointer; transition:background 120ms,border-color 120ms,transform 80ms; }
.social-header>.social-button { border:0; background:none; padding:8px; }
.social-button[data-primary],.social-invite-actions [data-primary] { background:var(--theme-primary,#156cff); border-color:var(--theme-primary,#156cff); color:var(--theme-on-primary,#fff); }
.social-button:hover,.social-invite-actions button:hover { background:var(--theme-surface-hover,#252b35); border-color:var(--theme-border-strong,#616b7d); }
.social-button[data-primary]:hover,.social-invite-actions [data-primary]:hover { background:var(--theme-primary-hover,#287cff); }
.social-button:active,.social-invite-actions button:active { transform:scale(.97); background:var(--theme-surface-pressed,#11151c); }
.social-button[data-primary]:active,.social-invite-actions [data-primary]:active { background:var(--theme-primary-pressed); }
.social-button:disabled,.social-invite-actions button:disabled { cursor:wait; opacity:.65; transform:none; }
.social-tabs { display:flex; flex:none; gap:26px; margin:0; border-bottom:1px solid var(--theme-border-subtle,#323740); }
.social-tabs button { padding:15px 0; border:0; border-bottom:2px solid transparent; background:none; color:var(--theme-text-secondary,#adb6c6); white-space:nowrap; font-size:12px; cursor:pointer; }
.social-tabs button[aria-pressed=true] { color:var(--theme-text-primary,#f1f3f9); border-bottom-color:var(--theme-functional,#248bff); }
.social-people { flex:1; overflow:auto; min-height:0; padding-top:12px; }
.social-person { position:relative; display:flex; align-items:center; gap:12px; padding:14px 0; border-bottom:1px solid var(--theme-border-subtle,#323740); }
.social-person .avatar { width:44px; height:44px; flex:none; }
.social-person>.social-button { flex-shrink:0; }
/* Keep presence inside its column. In a narrow rail, the join action gets
   a second line under the identity instead of covering the status. */
.social-people { container-type:inline-size; }
.social-person:has(>.social-room-join) { display:grid; grid-template-columns:44px minmax(0,1fr) 38px 38px; column-gap:8px; row-gap:5px; padding-top:10px; padding-bottom:10px; }
.social-person:has(>.social-room-join)>.avatar,.social-person:has(>.social-room-join)>.social-profile-link { grid-column:1; grid-row:1 / 3; }
.social-person:has(>.social-room-join)>.social-person-name { grid-column:2; grid-row:1; min-width:0; font-size:13px; }
.social-person:has(>.social-room-join)>.social-room-join { grid-column:2; grid-row:2; justify-self:start; max-width:100%; }
.social-person:has(>.social-room-join)>[data-social=chat] { grid-column:3; grid-row:1 / 3; }
.social-person:has(>.social-room-join)>[data-social=options] { grid-column:4; grid-row:1 / 3; }
.social-person:has(>.social-room-join)>.social-button { padding:7px; min-width:38px; }
@container(min-width:430px) { .social-person:has(>.social-room-join) { display:flex; gap:8px; } }
.social-panel:not(.is-docked) .social-person { margin:2px 0 10px; padding:14px; border:1px solid var(--theme-border-subtle); border-radius:12px; }
.social-person.is-request { margin:2px 0 8px; padding:16px; border:1px solid var(--theme-border-subtle,#323740); border-radius:12px; }
.social-person.is-request .social-button { min-height:42px; }
.social-menu { position:absolute; z-index:4; right:0; top:calc(100% - 6px); display:grid; min-width:170px; padding:6px; border:1px solid var(--theme-border-subtle,#323740); border-radius:12px; background:var(--theme-surface-elevated,#191d24); box-shadow:0 8px 24px rgba(var(--theme-shadow-rgb,0,0,0),.3); }
.social-menu .social-button { justify-content:flex-start; border:0; background:none; padding:10px; }
.social-person .social-menu.is-above { top:auto; bottom:calc(100% - 6px); }
.social-menu [data-social=block] { color:var(--theme-danger-text,#f16c7c); }
.social-empty { color:var(--theme-text-secondary,#adb6c6); font-size:13px; padding:18px 0; }
.social-chat .social-header { padding-bottom:16px; border-bottom:1px solid var(--theme-border-subtle,#323740); }
.social-expiry { display:flex; justify-content:center; align-items:center; gap:8px; flex:none; margin:12px 0 0; padding:10px; border:1px solid var(--theme-border-subtle,#323740); border-radius:10px; background:var(--theme-surface-interactive,#181c23); color:var(--theme-text-secondary,#adb6c6); font-size:11px; line-height:1.5; }
.social-expiry svg { width:16px; height:16px; }
.social-messages { position:relative; display:flex; flex-direction:column; flex:1; min-height:0; overflow:auto; padding:18px 0; gap:16px; }
.social-message { max-width:88%; align-self:flex-start; border:1px solid var(--theme-border-subtle,#323740); border-radius:12px; padding:10px 12px 6px; background:var(--theme-surface-interactive,#181c23); color:var(--theme-text-primary,#f1f3f9); }
.social-message.is-own { align-self:flex-end; background:var(--theme-surface-interactive,#1c1e24); color:var(--theme-text-primary,#f1f3f9); border-color:var(--theme-border-subtle,#323740); }
.social-message p { margin:0; font-size:13px; line-height:1.5; white-space:pre-wrap; overflow-wrap:anywhere; }
.social-message time { display:block; text-align:right; margin-top:5px; font-size:10px; opacity:.8; }
.social-empty-chat { display:grid; justify-items:center; align-content:center; flex:1; text-align:center; gap:16px; color:var(--theme-text-secondary,#adb6c6); }
.social-empty-chat>svg { width:70px; height:70px; stroke-width:1; }
.social-empty-chat strong { color:var(--theme-text-primary,#f1f3f9); font-size:17px; }
.social-empty-chat p { margin:0; font-size:14px; line-height:1.6; }
.social-loading { display:flex; align-items:center; gap:8px; justify-content:center; color:var(--theme-text-secondary,#adb6c6); font-size:12px; }
.social-composer { position:relative; display:flex; align-items:flex-end; gap:8px; padding-top:14px; border-top:1px solid var(--theme-border-subtle,#323740); }
.social-composer>.social-button { width:44px; height:44px; flex:none; }
.social-draft-wrap { display:flex; align-items:center; flex:1; min-width:0; border:1px solid var(--theme-border-subtle,#323740); border-radius:11px; background:var(--theme-input,#14171c); }
.social-draft-wrap textarea { padding:12px 10px; border:0; background:none; resize:none; max-height:100px; font-size:12px; line-height:18px; }
.social-draft-wrap .social-button { padding:6px; border:0; background:none; }
.social-attach-menu,.social-emoji { position:absolute; z-index:5; bottom:calc(100% + 10px); left:0; padding:12px; border:1px solid var(--theme-border-subtle,#323740); border-radius:13px; background:var(--theme-surface-elevated,#171b22); box-shadow:0 8px 24px rgba(var(--theme-shadow-rgb,0,0,0),.25); }
.social-attach-menu { display:grid; gap:4px; width:220px; }
.social-attach-menu button { display:flex; align-items:center; gap:12px; padding:8px; border:0; background:none; color:var(--theme-text-primary,#f1f3f9); cursor:pointer; }
.social-attach-menu small { color:var(--theme-text-secondary,#adb6c6); padding:8px; font-size:11px; line-height:1.5; }
.social-emoji { right:0; left:auto; width:min(320px,100%); }
.social-emoji>div { display:grid; grid-template-columns:repeat(7,1fr); gap:3px; max-height:220px; overflow:auto; margin-top:10px; }
.social-emoji button { border:0; border-radius:5px; background:none; font-size:22px; padding:4px; cursor:pointer; }
.social-emoji button:hover { background:var(--theme-surface-hover,#252b35); }
.social-pending { display:flex; align-items:center; gap:8px; padding:10px; border:1px solid var(--theme-border-subtle,#323740); border-radius:10px; background:var(--theme-surface-interactive,#181c23); font-size:12px; }
.social-pending span { display:flex; align-items:center; gap:8px; overflow:hidden; overflow-wrap:anywhere; flex:1; }
.social-pending small { color:var(--theme-text-secondary,#adb6c6); }
.social-attachment img,.social-attachment video { display:block; max-width:100%; max-height:250px; border-radius:7px; margin:6px 0; }
.social-attachment>a { display:flex; align-items:center; gap:8px; color:inherit; text-decoration:none; }
.social-attachment strong { font-size:12px; overflow-wrap:anywhere; }
.social-attachment small { font-size:10px; white-space:nowrap; }
.social-attachment>a:not(.chat-image-download) strong { min-width:0; flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-message:has(.chat-image-attachment) { width:min(320px,90%); }
.social-attachment .chat-image-attachment { width:100%; margin:0; }
.social-attachment .chat-image-open { min-height:84px; max-height:270px; background:var(--theme-surface-card,#1b253a); border-color:var(--theme-border-subtle,#343740); color:var(--theme-text-muted,#8b96ab); }
.social-attachment .chat-image-open img { margin:0; max-height:268px; border-radius:0; }
.social-attachment .chat-image-download { display:grid; background:var(--theme-surface-elevated,#1b1c20); border-color:var(--theme-border-subtle,#343740); color:var(--theme-text-primary,#f0f1f3); }
.social-attachment .chat-image-download svg { width:15px; height:15px; }
.social-attachment .chat-image-retry { color:var(--theme-text-primary,#f0f1f3); background:var(--theme-surface-interactive,#303239); border-color:var(--theme-border-subtle,#343740); }
.social-image-lightbox { z-index:170; }
.social-chat>.chat-pending-attachment { flex:none; margin-top:10px; }
.social-chat .chat-pending-remove { border:0; background:none; cursor:pointer; }
.social-send-status { font-size:11px; }
.room-chat-menu { z-index:155; width:max-content; right:auto; bottom:auto; max-width:calc(100vw - 16px); max-height:calc(100dvh - 16px); overflow:auto; }
.room-chat-menu [data-durations] { display:grid; border-top:1px solid var(--theme-border-subtle,#343740); }
.room-chat-menu svg { width:18px; height:18px; }
.social-add form { display:grid; gap:16px; margin-top:24px; font-size:13px; }
.social-badge { display:inline-grid; place-items:center; min-width:18px; height:18px; padding:0 4px; border-radius:10px; background:var(--theme-functional,#147cff); color:var(--theme-on-functional,#fff); font-size:10px; font-weight:600; }
.call-rail [data-social=friends] { position:relative; }
.call-rail [data-social=friends] .social-badge { position:absolute; top:10px; right:12px; }
.social-call-host { display:flex; flex-direction:column; padding:0; z-index:2; min-height:0; overflow:visible; }
.social-panel.is-docked { position:relative; inset:auto; z-index:auto; width:100%; height:100%; min-height:0; padding:16px; border:0; border-radius:inherit; box-shadow:none; background:var(--theme-surface-card,#101216); }
.is-docked .social-header h2 { font-size:21px; }
.is-docked .social-search { gap:8px; }
.is-docked .social-search [data-social=add] span { display:none; }
.is-docked .social-tabs { gap:20px; }
.is-docked .social-person { gap:9px; }
.is-docked .social-person.is-request { padding:12px 0; border:0; border-bottom:1px solid var(--theme-border-subtle,#323740); }
.is-docked .social-person.is-request .social-button { min-width:0; padding:8px; font-size:11px; }
.is-docked .social-expiry { font-size:10px; padding:8px; }
.is-docked .social-header .avatar { width:38px; height:38px; }
.is-docked .social-composer { gap:6px; }
.is-docked .social-composer>.social-button { width:36px; height:40px; }
.home-social-invites { margin-top:20px; border:1px solid var(--theme-border-subtle,#323740); border-radius:12px; background:var(--theme-surface-card,#101216); overflow:hidden; }
.home-social-invites>header { padding:12px 14px; border-bottom:1px solid var(--theme-border-subtle,#323740); font-size:12px; }
.social-invite-details { display:flex; gap:10px; align-items:center; padding:12px 14px; }
.social-invite-details .avatar { width:40px; height:40px; flex:none; }
.social-invite-details>div { display:grid; flex:1; min-width:0; gap:5px; font-size:12px; }
.social-invite-details small { color:var(--theme-text-secondary,#adb6c6); font-size:11px; }
.social-invite-actions { display:flex; gap:10px; padding:0 14px 14px; }
.home-social-invites .social-invite-actions>button { flex:1; }
.social-invite { position:fixed; z-index:139; right:24px; bottom:110px; display:flex; align-items:center; width:min(480px,calc(100vw - 48px)); border:1px solid var(--theme-functional,#248bff); border-radius:12px; background:var(--theme-surface-elevated,#171b22); color:var(--theme-text-primary,#f1f3f9); box-shadow:0 8px 28px rgba(var(--theme-shadow-rgb,0,0,0),.3); }
.social-invite>.social-invite-details { flex:1; min-width:0; }
.social-invite .social-invite-actions { padding:12px 10px 12px 0; align-items:center; }
.social-invite [data-social=dismiss-invite] { padding:6px; min-width:26px; border:0; background:none; }
.social-error { margin:10px 0 0; font-size:12px; color:var(--theme-danger-text,#ff8e99); }
.social-saved-invite { border:1px solid var(--theme-border-subtle); border-radius:12px; margin-bottom:12px; }
.social-header .social-invites-link { font-size:11px; color:var(--theme-functional); }
.social-spinner { display:inline-block; width:14px; height:14px; border:2px solid currentColor; border-right-color:transparent; border-radius:50%; animation:social-spin 700ms linear infinite; flex:none; }
.toast-avatar { width:36px; height:36px; border-radius:50%; object-fit:cover; flex:none; }
.toast:has(.toast-avatar) { grid-template-columns:36px minmax(0,1fr); }
.toast:has(.toast-action) { grid-template-columns:minmax(0,1fr) auto; }
.toast:has(.toast-avatar):has(.toast-action) { grid-template-columns:36px minmax(0,1fr) auto; }
.toast-action { border:1px solid var(--theme-functional,#248bff); border-radius:8px; padding:7px 12px; background:none; color:var(--theme-functional,#248bff); cursor:pointer; }
body:has(.social-panel:not([hidden])) .notification-host { z-index:142; }
.social-panel.is-file-over { outline:2px dashed var(--theme-focus,#63adff); outline-offset:-8px; }
.social-panel :focus-visible,.home-friends :focus-visible,.social-invite :focus-visible,.home-social-invites :focus-visible { outline:2px solid var(--theme-focus,#63adff); outline-offset:3px; }
@keyframes social-spin { to { transform:rotate(360deg); } }
/* Additions retain the existing row/button geometry. Popovers are positioned
   in the viewport by the social layer, not clipped by the scrollable list. */
.social-presence.is-online:not(.is-in-room) { color:var(--theme-success,#29db91); }
.social-presence.is-online.is-dnd { color:var(--theme-danger-text,#f16c7c); }
.social-button[data-social=chat] { position:relative; }
.social-unread { background:var(--theme-danger,#f04465); color:var(--theme-on-primary,#fff); }
.call-rail .social-unread { background:var(--theme-danger,#f04465); color:var(--theme-on-primary,#fff); }
.social-button[data-social=chat]>.social-badge { position:absolute; top:-6px; right:-6px; pointer-events:none; }
.social-tabs { position:relative; }
.social-tabs .social-settings { margin-left:auto; padding:0; display:grid; place-items:center; flex:none; width:24px; border:0; }
.social-settings-popover,.social-mute-submenu { position:fixed; z-index:150; display:grid; padding:6px; border:1px solid var(--theme-border-subtle,#323740); border-radius:10px; background:var(--theme-surface-elevated,#191d24); box-shadow:0 8px 24px rgba(var(--theme-shadow-rgb,0,0,0),.25); color:var(--theme-text-primary,#f1f3f9); }
.social-settings-popover { width:min(280px,calc(100vw - 24px)); }
.social-tabs .social-settings-popover button { display:flex; gap:10px; align-items:center; padding:9px; color:var(--theme-text-primary,#f1f3f9); border:0; font-size:11px; }
.social-settings-popover span { flex:1; text-align:left; }
.social-toggle { width:32px; height:18px; flex:none; border-radius:12px; background:var(--theme-border-strong,#616b7d); padding:2px; }
.social-toggle:before { content:''; display:block; width:14px; height:14px; border-radius:50%; background:var(--theme-text-primary,#f1f3f9); }
[aria-checked=true]>.social-toggle { background:var(--theme-functional,var(--theme-primary,#156cff)); }
[aria-checked=true]>.social-toggle:before { transform:translateX(14px); background:var(--theme-knob,#fff); }
.social-mute-submenu { min-width:175px; }
.social-menu { position:fixed; z-index:149; }
.social-dm-toasts { position:fixed; z-index:151; right:24px; bottom:64px; display:grid; gap:10px; width:min(390px,calc(100vw - 32px)); }
#social-layer:has(.social-invite) .social-dm-toasts { bottom:190px; }
.social-dm-toast { display:flex; align-items:center; gap:8px; padding:12px; border:1px solid var(--theme-functional,#248bff); border-radius:11px; background:var(--theme-surface-elevated,#191d24); color:var(--theme-text-primary,#f1f3f9); box-shadow:0 8px 24px rgba(var(--theme-shadow-rgb,0,0,0),.25); }
.social-dm-toast button { color:inherit; border:0; background:none; cursor:pointer; }
.social-dm-toast-open { display:flex; align-items:center; gap:12px; flex:1; min-width:0; text-align:left; padding:0; }
.social-dm-toast .avatar { width:40px; height:40px; flex:none; }
.social-dm-toast span { display:grid; gap:6px; min-width:0; }
.social-dm-toast strong { font-size:11px; }
.social-dm-toast small { font-size:11px; color:var(--theme-text-secondary,#adb6c6); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.social-message time button { border:0; padding:0 3px; background:none; color:inherit; text-decoration:underline; cursor:pointer; }
.social-switch-overlay { position:fixed; z-index:160; inset:0; display:grid; place-items:center; padding:18px; background:rgba(var(--theme-shadow-rgb,0,0,0),.65); }
.social-switch {--switch-background:var(--theme-surface-card,#11192a);--switch-text:var(--theme-text-primary,#edf3ff);--switch-secondary:var(--theme-text-secondary,#bdc9df);--switch-border:var(--theme-border-subtle,#354562);--switch-accent:var(--custom-panel-accent,var(--theme-primary,#7658f6));--switch-on-accent:var(--theme-on-primary,#fff);position:relative;width:min(480px,100%);max-height:calc(100dvh - 36px);overflow:auto;overscroll-behavior:contain;border:1px solid var(--switch-border);border-radius:16px;padding:24px;background:var(--switch-background);color:var(--switch-text);text-align:center;box-shadow:0 14px 40px rgba(var(--theme-shadow-rgb,0,0,0),.25);animation:social-switch-enter .18s cubic-bezier(.2,.8,.2,1) both}
:root[data-theme=dark] .social-switch {--switch-accent:#3498ff;--switch-on-accent:#fff}
.social-switch-header {display:flex;align-items:center;justify-content:space-between;gap:12px}
.social-switch .social-switch-header h2 {margin:0;font-size:20px;line-height:1.3;letter-spacing:-.02em;text-align:left}
.social-switch .social-switch-close {position:static;flex:none;display:grid;place-items:center;width:28px;height:28px;min-width:28px;min-height:28px;padding:5px;border:0;border-radius:8px;background:transparent;color:var(--switch-secondary);transition:background-color .15s,color .15s,transform .15s}
.social-switch .social-switch-close:hover {background:var(--theme-surface-hover,#252f51);color:var(--switch-text)}
.social-switch svg {width:18px;height:18px;flex:none}
.social-switch .social-switch-journey {display:flex;justify-content:center;align-items:center;gap:28px;margin:20px 0 0}
.social-switch .social-switch-journey>div {display:grid;justify-items:center;gap:5px;min-width:0;width:130px}
.social-switch .social-switch-journey .avatar {width:48px;height:48px;flex-basis:48px;margin:0 0 3px;font-size:16px}
.social-switch .social-switch-journey small {color:var(--switch-secondary);font-size:12px;line-height:1.4}
.social-switch .social-switch-journey strong {width:100%;max-width:130px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;line-height:1.4}
.social-switch-direction {display:grid;place-items:center;flex:none;color:var(--switch-secondary)}
.social-switch #social-switch-description {margin:20px 0 0;color:var(--switch-secondary);font-size:12px;line-height:1.6;overflow-wrap:anywhere}
.social-switch #social-switch-description strong {font-weight:500;color:inherit}
.social-switch footer {display:flex;gap:10px;margin-top:20px}
.social-switch footer .social-button {flex:1;min-width:0;min-height:41px;display:flex;justify-content:center;align-items:center;gap:8px;padding:10px 12px;border:1px solid var(--switch-border);border-radius:10px;background:transparent;color:var(--switch-text);font-size:12px;line-height:1.4;font-weight:650;transition:background-color .16s,border-color .16s,transform .16s,filter .16s}
.social-switch footer [data-social=cancel-switch]:hover {background:var(--theme-surface-hover,#252f51);border-color:var(--theme-border-strong,#647997);transform:translateY(-1px)}
.social-switch footer [data-social=confirm-switch] {background:var(--switch-accent);color:var(--switch-on-accent);border-color:var(--switch-accent)}
.social-switch footer [data-social=confirm-switch]:hover {filter:brightness(1.08);transform:translateY(-1px)}
.social-switch button:not(:disabled):active {transform:translateY(0) scale(.975)}
.social-switch button:focus-visible {outline:2px solid var(--theme-focus,#a296ff);outline-offset:3px}
.social-switch button:disabled {opacity:.6;cursor:wait;transform:none;filter:none}
.social-switch[aria-busy=true] {animation:none}
.social-switch .social-spinner {width:13px;height:13px;flex:none}
@keyframes social-switch-enter {from{opacity:0;transform:translateY(7px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@media(max-width:520px) {.social-switch{padding:20px}.social-switch .social-switch-header h2{font-size:18px}.social-switch .social-switch-journey{gap:15px}.social-switch .social-switch-journey>div{width:110px}.social-switch .social-switch-journey strong{max-width:110px}}
@media(prefers-reduced-motion:reduce) {.social-switch{animation:none}.social-switch button.social-button{transition:none}.social-switch button.social-button:hover,.social-switch button.social-button:active{transform:none}}
/* Invite-only constraints: the approved invitation-free Home is unaffected. */
.has-social-invites.reference-home { height:100dvh; grid-template-rows:auto minmax(0,1fr) auto; overflow:hidden; }
.has-social-invites .reference-entry-content { min-height:0; }
.has-social-invites .reference-entry-card { transform:none; min-height:0; max-height:calc(100dvh - 175px); overflow:hidden; }
.has-social-invites .authenticated-home-card { display:flex; flex-direction:column; min-height:0; max-height:inherit; overflow:auto; padding-block:20px !important; gap:12px !important; }
.has-social-invites .authenticated-home-card>* { flex-shrink:0; }
.has-social-invites .authenticated-welcome { margin-bottom:0; }
.has-social-invites .home-social-invites { margin-top:0; min-height:148px; max-height:190px; overflow:auto; }
.has-social-invites .home-social-invites>header { position:sticky; top:0; background:var(--theme-surface-card,#101216); z-index:1; padding:8px 12px; }
.has-social-invites .home-social-invites .social-invite-details { padding:9px 12px; }
.has-social-invites .home-social-invites .social-invite-actions { padding:0 12px 10px; }
.has-social-invites .home-friends { margin-top:0; padding-top:12px; }
@media(min-width:761px) and (max-height:760px) {
  .has-social-invites .reference-entry-card { max-height:calc(100dvh - 190px); }
  .has-social-invites .authenticated-home-card { overflow:auto; }
}
@media(min-width:761px) and (max-width:1780px) {
  .has-social-invites .reference-entry-content { grid-template-columns:minmax(0,1fr) minmax(230px,.75fr) minmax(340px,410px); gap:18px; }
  .has-social-invites .nexo-orbit { width:100%; }
}
@media(min-width:761px) and (max-width:1050px) {
  .has-social-invites .reference-entry-content { grid-template-columns:minmax(0,1fr) minmax(340px,410px); }
}
@media(max-width:760px) {
  .has-social-invites.reference-home { height:auto; overflow:auto; grid-template-rows:auto 1fr auto; }
  .has-social-invites .reference-entry-card { max-height:none; }




}
@media(prefers-reduced-motion:reduce) { .social-button,.social-invite-actions button { transition:none; }.social-spinner { animation:none; }.social-button:active,.social-invite-actions button:active { transform:none; } }
@media(max-width:700px) { .social-panel { right:12px; top:78px; bottom:30px; width:calc(100vw - 24px); padding:18px; }.social-panel.social-add { bottom:auto; }.social-person.is-request { gap:8px; padding:12px; flex-wrap:wrap; }.social-person-name { min-width:90px; }.social-tabs { gap:20px; }.social-search [data-social=add] span { display:none; }.social-invite { right:12px; bottom:100px; width:calc(100vw - 24px); flex-wrap:wrap; }.social-invite .social-invite-actions { padding:0 12px 12px; }.social-expiry { font-size:10px; }.social-panel.is-docked { padding:12px; }.is-docked .social-tabs { gap:14px; } }
