/* Message presentation inspired by the Nexus UI Chat Messages reference.
   Both human room messages and private conversations use the active NEXO palette. */
.social-chat,.chat-hub {--nexo-message-sent:linear-gradient(130deg,var(--theme-primary,#f1f1f3),color-mix(in srgb,var(--theme-primary,#f1f1f3) 88%,var(--theme-accent,#f1f1f3)));--nexo-message-shadow:color-mix(in srgb,var(--theme-primary,#f1f1f3) 14%,transparent)}
.social-chat .social-messages {gap:14px}
.social-chat .social-message {position:relative;max-width:min(90%,370px);padding:0 0 0 36px;animation:nexo-message-enter .2s cubic-bezier(.2,.75,.3,1);transform-origin:bottom left}
.social-chat .social-message-author {margin:0 0 5px;font-size:10px;color:var(--theme-text-muted,#9d9da6)}
.social-chat .social-message-author .avatar {position:absolute;left:0;bottom:2px;width:28px;height:28px}
.social-chat .social-message-bubble {padding:10px 12px 6px;border-radius:16px 16px 16px 5px;background:linear-gradient(145deg,var(--theme-surface-interactive,#1c1c1f),var(--theme-surface-elevated,#111114));border-color:color-mix(in srgb,var(--theme-border-subtle,#45454a) 65%,transparent);box-shadow:0 2px 5px rgba(0,0,0,.08)}
.social-chat .social-message p {margin:0 0 4px;font-size:12px;line-height:1.55}
.social-chat .social-message time {font-size:9px;text-align:right;opacity:.7}
.social-chat .social-message.is-own {padding:0;transform-origin:bottom right}
.social-chat .social-message.is-own .social-message-bubble {border-radius:16px 16px 5px 16px;background:var(--nexo-message-sent);color:var(--theme-on-primary,#0e0e10);box-shadow:0 3px 12px var(--nexo-message-shadow)}
.social-chat .social-message.is-continuation .social-message-bubble {border-top-left-radius:6px}
.social-chat .social-message.is-own.is-continuation .social-message-bubble {border-top-left-radius:16px;border-top-right-radius:6px}
.chat-hub .chat-group {position:relative;padding-left:36px;gap:5px;margin-bottom:17px}
.chat-hub .chat-message-meta {font-size:10px;margin-bottom:2px;gap:6px}
.chat-hub .chat-message-meta>.avatar {position:absolute;left:0;bottom:2px;width:28px;height:28px}
.chat-hub .chat-message-meta time {font-size:9px}
.chat-hub .chat-message {max-width:min(90%,370px);padding:10px 12px;border-radius:16px 16px 16px 5px;background:linear-gradient(145deg,var(--theme-surface-interactive,#1c1c1f),var(--theme-surface-elevated,#111114));border-color:color-mix(in srgb,var(--theme-border-subtle,#45454a) 65%,transparent);box-shadow:0 2px 5px rgba(0,0,0,.08);transform-origin:bottom left}
.chat-hub .chat-message p {font-size:12px;line-height:1.55}
.chat-hub .chat-group.own-message {padding-left:0}
.chat-hub .own-message .chat-message-meta>.avatar,.chat-hub .own-message .chat-message-meta>span {display:none}
.chat-hub .own-message .chat-message {background:var(--nexo-message-sent);color:var(--theme-on-primary,#0e0e10);border-radius:16px 16px 5px 16px;box-shadow:0 3px 12px var(--nexo-message-shadow);transform-origin:bottom right}
.chat-hub .chat-group .chat-message+.chat-message {border-top-left-radius:6px}
.chat-hub .chat-group.own-message .chat-message+.chat-message {border-top-left-radius:16px;border-top-right-radius:6px}
@keyframes nexo-message-enter {from{opacity:0;transform:translateY(7px) scale(.985)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.social-chat .social-message {animation:none!important}}

.chat-typing-indicator{display:flex;align-items:center;gap:8px;padding:6px 0;min-height:30px;flex:none;animation:nexo-message-enter .18s ease-out;}
.chat-typing-indicator[hidden]{display:none!important;}
.chat-typing-dots{display:inline-flex;align-items:center;gap:4px;min-height:27px;padding:9px 12px;background:var(--theme-surface-interactive,#17171b);border:1px solid var(--theme-border-subtle,#36363c);border-radius:14px 14px 14px 5px;}
.chat-typing-dots i{display:block;width:4px;height:4px;border-radius:50%;background:var(--theme-text-muted,#a0a0aa);animation:nexo-typing-dot 1.2s ease-in-out infinite;}
.chat-typing-dots i:nth-child(2){animation-delay:.15s;}.chat-typing-dots i:nth-child(3){animation-delay:.3s;}
.chat-typing-label:not(.sr-only){font-size:10px;color:var(--theme-text-muted,#a0a0aa);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@keyframes nexo-typing-dot{0%,60%,100%{opacity:.4;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
@media(prefers-reduced-motion:reduce){.chat-typing-indicator,.chat-typing-dots i{animation:none!important;}}
