.chat-hub{display:flex;flex-direction:column;min-width:0;min-height:0;color:var(--theme-text-primary,#f1f3f9);background:var(--theme-surface-elevated,#101216);overflow:hidden}
.chat-hub>.panel-header>span{display:flex;gap:10px;align-items:center}.chat-hub .panel-header svg{width:22px;height:22px}
.chat-hub-tabs{display:flex;border-bottom:1px solid var(--theme-border-subtle,#323740);flex:none;padding:0 16px;gap:8px}
.chat-hub-tabs>button{display:flex;align-items:center;justify-content:center;gap:8px;padding:13px 18px;background:transparent;color:var(--theme-text-secondary,#adb6c6);border:0;border-bottom:2px solid transparent;font:inherit;cursor:pointer}
.chat-hub-tabs>button[aria-pressed=true]{border-bottom-color:var(--theme-accent,#725bff);color:var(--theme-text-primary,#f1f3f9);font-weight:700}
.chat-hub-badge{display:inline-grid;place-items:center;min-width:21px;height:21px;border-radius:12px;padding:0 4px;background:var(--theme-primary,#725bff);color:var(--theme-on-primary,#fff);font-size:11px;box-sizing:border-box}
.chat-hub-friends{display:flex;flex:1;min-height:0;overflow:hidden}
.chat-conversations{display:flex;flex:1;flex-direction:column;min-height:0;min-width:0;padding:12px;gap:10px}
.chat-conversation-search{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid var(--theme-border-subtle,#323740);border-radius:10px;background:var(--theme-surface-card,#101216)}
.chat-conversation-search svg{width:17px;height:17px;flex:none;color:var(--theme-text-secondary,#adb6c6)}
.chat-conversation-search input{min-width:0;width:100%;border:0;background:transparent;color:var(--theme-text-primary,#f1f3f9);font:inherit;font-size:12px}
#chat-conversation-list{overflow:auto;min-height:0}
.chat-conversation{display:flex;align-items:center;gap:10px;width:100%;min-width:0;padding:12px 9px;text-align:left;background:transparent;color:inherit;border:1px solid transparent;border-radius:10px;font:inherit;cursor:pointer}
.chat-conversation:hover{background:var(--theme-surface-hover,#252b35)}.chat-conversation.is-selected{background:var(--theme-surface-interactive,#181c23);border-color:var(--theme-accent,#725bff)}
.chat-conversation>.avatar{width:38px;height:38px;flex:none}.chat-conversation>span:not(.avatar){display:grid;gap:5px;min-width:0;flex:1}.chat-conversation strong,.chat-conversation small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-conversation strong{font-size:13px}.chat-conversation small,.chat-conversation time{font-size:11px;color:var(--theme-text-secondary,#adb6c6)}
.chat-conversation>.chat-conversation-meta{flex:none!important;justify-items:end}
/* Separate profile targets from the conversation's full-row selection target. */
.chat-conversation{position:relative;isolation:isolate}
.chat-conversation-select{position:absolute;inset:0;z-index:0;border:0;border-radius:inherit;background:transparent;cursor:pointer}
.chat-conversation>span{pointer-events:none}
.chat-profile-link{display:inline-flex;align-items:center;min-width:0;padding:0;border:0;border-radius:5px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;pointer-events:auto}
.chat-conversation .chat-profile-link{position:relative;z-index:1}
.chat-profile-avatar{flex:none;border-radius:50%}
.chat-conversation .chat-profile-avatar>.avatar{width:38px;height:38px;flex:none}
.chat-profile-name{max-width:100%;width:max-content}
.chat-profile-name strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chat-profile-name:hover strong{text-decoration:underline;text-underline-offset:3px}
.chat-profile-link:focus-visible,.chat-conversation-select:focus-visible{outline:2px solid var(--theme-focus,var(--theme-accent,#725bff));outline-offset:2px}
@media(max-width:760px){.chat-conversation .chat-profile-avatar>.avatar{width:28px;height:28px}}
.chat-dm-area{position:relative;flex:1;min-width:0;min-height:0;display:flex}.chat-hub-empty{display:flex;flex:1;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px;text-align:center;color:var(--theme-text-secondary,#adb6c6);min-width:0}.chat-hub-empty strong{color:var(--theme-text-primary,#f1f3f9);font-size:16px}.chat-hub-empty p{margin:0;font-size:13px;line-height:1.6}.chat-hub-empty svg{width:30px;height:30px;color:var(--theme-accent,#725bff)}.chat-hub-empty[hidden]{display:none}
#chat-dm-host{width:100%;min-width:0;min-height:0}#chat-dm-host:empty{display:none}
#chat-dm-host>.social-panel{position:relative;inset:auto!important;transform:none!important;width:100%;height:100%;max-height:none;margin:0;border:0;border-radius:0;box-shadow:none;padding:16px;background:var(--theme-surface-elevated,#101216)}
#chat-dm-host .social-header>[data-social=close]{display:none}
.chat-hub-room{display:flex;flex:1;min-height:0}.chat-hub-room>.chat-panel{position:relative;width:100%;height:100%;border:0;border-radius:0;box-shadow:none}.chat-hub-room>.chat-panel>.panel-header{display:none}
.home-conversations{display:grid;grid-template-columns:var(--app-rail-width) minmax(0,clamp(430px,31vw,500px)) minmax(0,1fr);gap:16px;height:calc(100dvh - 140px);min-height:320px;margin:10px 40px 20px}.home-conversations>.chat-hub{height:min(100%,740px);border:1px solid var(--theme-border-subtle,#323740);border-radius:16px}
.home-conversations>.call-rail{grid-column:1;grid-row:1;width:100%;min-width:0;margin:0}.home-conversations>.chat-hub{grid-column:2;grid-row:1}
:root[data-theme=custom] .chat-conversation:is(:hover,.is-selected){background:transparent}
:root[data-theme=custom] .chat-conversation-search{border-color:var(--custom-card-border);color:var(--custom-card-text);--theme-text-secondary:var(--custom-card-secondary)}
:root[data-theme=custom] .chat-hub :is(.social-message,.social-expiry,.social-button:not([data-primary])){color:var(--custom-card-text);--theme-text-primary:var(--custom-card-text);--theme-text-secondary:var(--custom-card-secondary);--theme-border-subtle:var(--custom-card-border)}
@media(min-width:761px){.call-workspace.panel-open:has(>.chat-hub){grid-template-columns:clamp(12px,2.8vw,40px) var(--app-rail-width) 14px clamp(430px,31vw,500px) 14px minmax(0,1fr) 20px}.call-workspace>.chat-hub{grid-column:4;grid-row:1;height:min(100%,740px);z-index:1}}
@media(max-width:760px){.home-conversations{margin:8px;height:calc(100dvh - 100px);gap:8px}.call-workspace.chat-hub-open>.chat-hub{position:fixed;inset:100px 12px 100px;z-index:8}.chat-hub-friends{grid-template-columns:130px minmax(0,1fr)}.chat-conversations{padding:6px}.chat-conversation{gap:6px;padding:10px 5px}.chat-conversation>.avatar{width:28px;height:28px}.chat-conversation-meta time{display:none}.chat-conversation-search svg{display:none}.chat-conversation-search{padding:6px}.chat-conversation-meta .chat-hub-badge{min-width:18px}#chat-dm-host>.social-panel{padding:10px}}
.reference-home:has(>.home-conversations){display:flex;flex-direction:column;width:100%;max-width:none;height:100dvh;min-height:0;padding:30px 40px;box-sizing:border-box;overflow:hidden}.reference-home:has(>.home-conversations)>.entry-header{display:flex;width:100%;justify-content:space-between;align-items:center;margin:0;flex:none}.home-conversations{width:100%;height:auto;flex:1;min-height:0;margin:24px 0 0}.chat-hub-room>.chat-panel{grid-template-rows:minmax(0,1fr) auto}
@media(max-width:760px){.reference-home:has(>.home-conversations){padding:16px 12px}.home-conversations{margin-top:16px}.home-conversations .call-rail{align-self:stretch;height:100%}.home-conversations>.chat-hub{border-radius:12px}}
/* Single internal surface; the outer panel dimensions below remain unchanged. */
.chat-hub{container-type:inline-size}.chat-hub .chat-conversations{padding:8px}.chat-hub #chat-dm-host>.social-panel{padding:10px}.chat-hub .chat-conversation-search input{padding:0;height:24px;min-height:0}
@container(max-width:500px){.chat-conversation{gap:6px;padding:10px 5px}.chat-conversation>.avatar{width:30px;height:30px}.chat-conversation-meta time{display:none}.chat-conversation-search{padding:8px 6px}.chat-conversation-search svg{display:none}}
@media(max-width:760px){.home-conversations{grid-template-columns:var(--app-rail-width) minmax(0,1fr)}.call-workspace.panel-open>.chat-hub{width:min(500px,calc(100vw - 80px));left:auto;right:68px;height:auto}}
/* Only the nonmaximized Desktop main window: reserve a real lateral area.
   Maximized/fullscreen and browser layouts retain their existing dimensions. */
@media(min-width:761px){
 :root[data-desktop-window=windowed]{--windowed-chat-width:clamp(430px,calc(100vw - var(--app-rail-width) - 420px),580px)}
 :root[data-desktop-window=windowed] .home-conversations{grid-template-columns:var(--app-rail-width) minmax(0,var(--windowed-chat-width)) minmax(0,1fr)}
 :root[data-desktop-window=windowed] .call-workspace.panel-open:has(>.chat-hub){grid-template-columns:clamp(12px,2.8vw,40px) var(--app-rail-width) 14px var(--windowed-chat-width) 14px minmax(0,1fr) 20px}
 :root[data-desktop-window=windowed] .call-workspace.panel-open:has(>.chat-hub)>.call-main{display:grid;grid-column:6;grid-row:1;min-width:0}
 :root[data-desktop-window=windowed] .call-workspace.panel-open:has(>.chat-hub)>.call-main>.participant-stage{grid-column:auto;grid-row:auto;min-width:0;padding:12px;overflow:clip}
}
.chat-hub-friends>.chat-conversations,.chat-hub-friends>.chat-dm-area{animation:chat-surface-enter 110ms ease-out}
.chat-hub .chat-conversation-meta time{display:block}
.chat-hub .chat-conversation-search svg{display:block}
.chat-hub .chat-conversation .chat-profile-avatar>.avatar{width:38px;height:38px}
@keyframes chat-surface-enter{from{opacity:.65;transform:translateX(3px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.chat-hub-friends>.chat-conversations,.chat-hub-friends>.chat-dm-area{animation:none}}

/* Chat reserves its column; the shared stage owns card dimensions and wrapping. */
@media(min-width:761px){
 :root[data-desktop-window=windowed] .call-workspace.panel-open:has(>.chat-hub)>.call-main {min-height:0;overflow:clip}
}
