/* Silent Stories final messaging layout overrides */
.ss-chat-fullscreen { position:fixed!important; inset:0!important; z-index:13000!important; width:100vw!important; height:100dvh!important; overflow:hidden!important; background:#101014!important; }
.ss-chat-fullscreen > .chat-dialog { width:100%!important; max-width:none!important; height:100dvh!important; min-height:0!important; margin:0!important; padding:12px clamp(12px,2vw,26px)!important; border:0!important; border-radius:0!important; display:flex!important; flex-direction:column!important; overflow:hidden!important; background:#101014!important; box-sizing:border-box!important; }
.ss-chat-topbar { flex:0 0 auto; min-height:58px; gap:12px; }
.ss-chat-topbar h3 { margin:0!important; }
.ss-inbox-search-button { border:1px solid #51436b; border-radius:12px; padding:9px 14px; background:#211d2d; color:#e6d8ff; cursor:pointer; }
.ss-chat-layout { flex:1 1 auto!important; min-height:0!important; overflow:hidden!important; }
.ss-chat-sidebar { display:flex; flex-direction:column; min-height:0!important; }
.ss-inbox-tabs { display:flex; gap:8px; margin:2px 0 14px; padding:4px; border-radius:13px; background:#121119; }
.ss-inbox-tabs button { flex:1; border:0; border-radius:10px; padding:10px 8px; color:#bdb4cb; background:transparent; font:inherit; cursor:pointer; }
.ss-inbox-tabs button.active { color:#17131f; background:#c9a7ff; font-weight:700; }
.ss-conversation-list { gap:8px!important; }
.ss-conversation-row { min-width:0; padding:12px!important; border:1px solid #393044!important; border-radius:15px!important; background:#211b2c!important; }
.ss-conversation-row:hover,.ss-conversation-row:focus-visible { background:#2b2339!important; }
.ss-conversation-time { flex:0 0 auto; }
.ss-message-requests-panel { padding:28px 14px; text-align:center; color:#aaa8b6; border:1px solid #393747; border-radius:15px; background:#211d2d; }
.ss-message-requests-panel strong { display:block; color:#e6d8ff; margin:8px 0; }
.ss-message-requests-panel p { margin:0; font-size:13px; line-height:1.5; }
.ss-requests-empty-icon { font-size:30px; }
.ss-message-requests-panel[hidden],.ss-message-search-screen[hidden] { display:none!important; }
.ss-message-search-screen { position:fixed; inset:0; z-index:14000; overflow-y:auto; padding:16px; color:#f5f1ff; background:#101014; }
.ss-message-search-header { display:flex; align-items:center; gap:14px; max-width:900px; margin:0 auto 20px; padding:8px 0 16px; border-bottom:1px solid #393747; }
.ss-message-search-header h2 { margin:0; color:#e6d8ff; font-size:21px; }
.ss-message-search-back { width:42px; height:42px; border:1px solid #51436b; border-radius:50%; color:#e6d8ff; background:#211d2d; font-size:24px; cursor:pointer; }
.ss-message-search-content { width:min(900px,100%); margin:0 auto; }
.ss-message-search-content .chat-search-bar { display:flex; gap:8px; margin:12px 0 18px; }
.ss-message-search-content .chat-search-bar input { flex:1; min-width:0; }
.ss-message-search-content #userSearchResult { display:grid; gap:10px; }
.ss-chat-main { min-width:0; min-height:0; overflow:hidden; }
.ss-chat-main #activeChatBox { flex:1 1 auto; min-height:0; height:100%; }
.ss-chat-main #activeChatBox[hidden] { display:none!important; }
.chat-dialog .chat-window-header { justify-content:space-between; align-items:center!important; }
.ss-chat-header-actions { display:flex; align-items:center; justify-content:center; align-self:center; }
.ss-chat-more { display:grid; place-items:center; line-height:1; padding:0 0 5px; }
.ss-chat-menu { top:calc(100% + 8px)!important; }
@media(max-width:700px) {
 .ss-chat-fullscreen > .chat-dialog { padding:8px 10px max(8px,env(safe-area-inset-bottom))!important; }
 .ss-chat-topbar { min-height:52px; padding:4px 0 10px; gap:8px; }
 .ss-chat-topbar h3 { font-size:20px; }
 .ss-chat-refresh,.ss-inbox-search-button { padding:8px 10px; }
 .ss-chat-layout { display:block!important; width:100%; height:calc(100dvh - 72px); }
 .ss-chat-sidebar { width:100%; height:100%; padding:12px!important; border:0!important; border-radius:0!important; background:#101014!important; }
 .ss-chat-sidebar > h4:first-child { display:none; }
 .ss-chat-sidebar > h4.ss-sidebar-section-title:last-of-type,.ss-chat-sidebar .ss-social-tabs,.ss-chat-sidebar .ss-social-list { display:none!important; }
 .ss-chat-main { display:none!important; width:100%; height:100%; border:0!important; border-radius:0!important; background:#101014!important; }
 .ss-chat-fullscreen.ss-chat-has-active .ss-chat-sidebar { display:none!important; }
 .ss-chat-fullscreen.ss-chat-has-active .ss-chat-main { display:flex!important; }
 .chat-dialog .chat-window-header { min-height:64px; padding:8px 10px; gap:8px; }
 .ss-chat-back { display:inline-flex!important; align-items:center; justify-content:center; width:38px; height:42px; flex:0 0 38px; }
 .ss-chat-identity { gap:9px; }
 .ss-chat-partner-avatar { width:40px; height:40px; flex-basis:40px; }
 .ss-chat-header-actions { margin-left:auto; }
 .ss-chat-more { width:42px; height:42px; }
 .chat-dialog .chat-messages-area { min-height:0; padding:12px 10px; }
 .chat-dialog .chat-input-form { padding:10px; padding-bottom:max(10px,env(safe-area-inset-bottom)); }
 .ss-message-line { max-width:94%; }
 .ss-message-line .chat-bubble { max-width:78vw; }
 .ss-conversation-row { padding:12px 10px!important; }
 .ss-message-search-screen { padding:12px; }
}

/* Personal messages: align visually with Social Groups chat bubbles. */
.chat-dialog .chat-messages-area{flex:1 1 auto;min-height:0;height:auto;overflow-y:auto;display:flex;flex-direction:column;gap:14px;padding:18px clamp(10px,3vw,28px);background:#101014;border-radius:0;margin:0}
.ss-message-line{display:flex;align-items:flex-end;gap:9px;max-width:min(84%,760px)}
.ss-message-line.mine{align-self:flex-end;flex-direction:row-reverse}
.ss-message-line.theirs{align-self:flex-start}
.ss-message-content{display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:4px}
.ss-message-line.mine .ss-message-content{align-items:flex-end}
.ss-message-sender{padding:0 5px;color:#c9a7ff;font-size:11px;font-weight:700}
.ss-message-line .chat-bubble{max-width:min(560px,72vw);padding:11px 14px;border-radius:16px 16px 16px 4px;line-height:1.5;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere}
.ss-message-line .chat-bubble.mine{border-radius:16px 16px 4px 16px;background:#573b7b;color:#fff}
.ss-message-time{padding:0 5px;color:#91889f;font-size:10px}
@media(max-width:700px){.chat-dialog .chat-messages-area{padding:12px 10px}.ss-message-line{max-width:94%}.ss-message-line .chat-bubble{max-width:76vw}}

social group.js


/* Final phone alignment: center the full-screen conversation in the viewport. */
@media (max-width:700px) {
  #chatModal.ss-chat-fullscreen {
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    height:100dvh!important;
    max-width:100vw!important;
    margin:0!important;
    padding:0!important;
    display:flex!important;
    align-items:stretch!important;
    justify-content:center!important;
    overflow:hidden!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen > .chat-dialog {
    position:relative!important;
    inset:auto!important;
    flex:0 0 100vw!important;
    width:100vw!important;
    min-width:100vw!important;
    max-width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    transform:none!important;
    left:auto!important;
    right:auto!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-layout,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-main,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-main #activeChatBox {
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-main {
    position:relative!important;
    left:0!important;
    right:0!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-window-header,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-messages-area,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-input-form {
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
}


/* FINAL MOBILE CHAT FIT: keep every message and control inside the phone viewport. */
@media (max-width:700px) {
  #chatModal.ss-chat-fullscreen.ss-chat-has-active,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active > .chat-dialog {
    width:100vw!important;
    min-width:0!important;
    max-width:100vw!important;
    margin:0!important;
    padding:0!important;
    left:0!important;
    right:0!important;
    transform:none!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active > .chat-dialog {
    display:flex!important;
    flex-direction:column!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-layout,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-main,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active #activeChatBox {
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    flex:1 1 auto!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    box-sizing:border-box!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-window-header {
    flex:0 0 auto!important;
    min-width:0!important;
    gap:7px!important;
    padding:8px 12px!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-identity {
    flex:1 1 0!important;
    min-width:0!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-partner-labels {
    min-width:0!important;
    overflow:hidden!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-partner-labels strong,
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-partner-labels small {
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-chat-header-actions {
    flex:0 0 auto!important;
    gap:6px!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-messages-area {
    flex:1 1 0!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    padding:12px 12px!important;
    overflow-x:hidden!important;
    overflow-y:auto!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-message-line {
    display:flex!important;
    width:auto!important;
    max-width:100%!important;
    min-width:0!important;
    flex:0 1 auto!important;
    gap:7px!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-message-avatar {
    width:26px!important;
    height:26px!important;
    flex:0 0 26px!important;
    max-width:26px!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-message-content {
    flex:0 1 auto!important;
    min-width:0!important;
    max-width:calc(100% - 33px)!important;
    overflow-wrap:anywhere!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-message-line .chat-bubble {
    width:fit-content!important;
    max-width:100%!important;
    min-width:0!important;
    padding:10px 12px!important;
    white-space:pre-wrap!important;
    overflow-wrap:anywhere!important;
    word-break:break-word!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-input-form {
    display:flex!important;
    flex:0 0 auto!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    gap:8px!important;
    padding:10px 12px max(10px,env(safe-area-inset-bottom))!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-input-form input {
    flex:1 1 0!important;
    width:1px!important;
    min-width:0!important;
    max-width:100%!important;
    box-sizing:border-box!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .chat-input-form button {
    flex:0 0 auto!important;
    min-width:68px!important;
  }
}


/* People search is visible in the inbox sidebar again. */
.ss-chat-sidebar .chat-search-bar{display:flex!important;gap:8px!important;width:100%;margin:8px 0 12px!important}
.ss-chat-sidebar .chat-search-bar input{flex:1 1 auto!important;min-width:0!important;width:0!important;box-sizing:border-box!important}
.ss-chat-sidebar .chat-search-bar button{flex:0 0 auto!important}
.ss-chat-sidebar #userSearchResult{display:grid;gap:8px;max-height:24vh;overflow:auto;margin-bottom:10px}
.ss-chat-sidebar #userSearchResult:empty{display:none}


/* Private-message overflow control: reserve text space instead of covering message content. */
#chatModal .ss-private-message-bubble-wrap {
  position:relative!important;
  display:inline-block!important;
  vertical-align:top!important;
  width:fit-content!important;
  max-width:100%!important;
  min-width:0!important;
  box-sizing:border-box!important;
}
#chatModal .ss-private-message-bubble-wrap.has-message-actions .chat-bubble {
  box-sizing:border-box!important;
  padding-right:44px!important;
  max-width:100%!important;
  white-space:pre-wrap!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
}
#chatModal .ss-private-message-bubble-wrap .ss-private-message-actions {
  position:absolute!important;
  top:6px!important;
  right:6px!important;
  z-index:3!important;
  display:inline-flex!important;
  align-items:center!important;
  margin:0!important;
  flex:0 0 auto!important;
}
#chatModal .ss-private-message-bubble-wrap .ss-private-message-more {
  display:grid!important;
  place-items:center!important;
  width:25px!important;
  height:23px!important;
  padding:0!important;
  line-height:1!important;
}
#chatModal .ss-private-message-bubble-wrap .ss-private-message-menu {
  top:calc(100% + 5px)!important;
  right:0!important;
}
@media(max-width:700px) {
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-private-message-bubble-wrap {
    max-width:100%!important;
  }
  #chatModal.ss-chat-fullscreen.ss-chat-has-active .ss-private-message-bubble-wrap.has-message-actions .chat-bubble {
    padding-right:42px!important;
  }
}
