.ss-no-scroll { overflow: hidden !important; }

.ss-fullscreen-page,
.ss-search-results {
  position: fixed; inset: 0; z-index: 1200; overflow: auto;
  background: #101014; color: #f5f1ff; padding: 20px;
}
.ss-screen-topbar {
  display: flex; align-items: center; gap: 14px;
  max-width: 1400px; margin: 0 auto 18px; padding: 8px 0 16px;
  border-bottom: 1px solid #393747;
}
.ss-screen-topbar h2 { color: #e6d8ff; margin: 0; font-size: 24px; }
.ss-screen-topbar .small-heading { margin: 0; }
.ss-close-screen, .ss-chat-refresh {
  border: 1px solid #51436b; background: #211d2d; color: #e6d8ff;
  border-radius: 12px; padding: 9px 13px; cursor: pointer;
}
.ss-close-screen { margin-left: auto; font-size: 22px; line-height: 1; }
.ss-chat-refresh { margin-left: auto; }
.ss-chat-topbar .ss-chat-refresh { margin-left: auto; }
.ss-chat-topbar #closeChatModal { position: static; margin-left: 0; }

.ss-chat-fullscreen { position: fixed !important; inset: 0 !important; z-index: 1300 !important;
  display: block !important; overflow: auto !important; background: #101014 !important; }
.ss-chat-fullscreen > .chat-dialog {
  width: min(1500px, 100%) !important; max-width: none !important; height: 100dvh;
  min-height: 560px; margin: 0 auto !important; padding: 22px clamp(14px, 3vw, 36px) !important;
  border: 0 !important; border-radius: 0 !important; background: #101014 !important;
  display: flex; flex-direction: column; text-align: left;
}
.ss-chat-layout {
  width: 100%; max-width: 1500px; min-height: 0; flex: 1;
  margin: 0 auto; display: grid; grid-template-columns: minmax(280px, 350px) minmax(0, 1fr);
  gap: 18px;
}
.ss-chat-sidebar {
  min-height: 0; overflow-y: auto; padding: 16px;
  border: 1px solid #393747; border-radius: 18px; background: #191923;
}
.ss-chat-sidebar h4 { color: #c9a7ff; margin: 10px 0; font-size: 15px; }
.ss-sidebar-section-title { margin-top: 20px !important; }
.ss-chat-sidebar .chat-search-bar { margin: 10px 0; }
.ss-chat-sidebar .chat-search-bar input { min-width: 0; }
.ss-chat-sidebar #userSearchResult { margin-bottom: 12px; }
.ss-chat-main {
  min-width: 0; min-height: 0; position: relative; overflow: hidden;
  border: 1px solid #393747; border-radius: 18px; background: #191923;
  display: flex; flex-direction: column;
}
.ss-chat-empty-state {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 12px; padding: 30px; color: #aaa8b6;
}
.ss-chat-empty-state h3 { color: #e6d8ff; margin: 0; }
.ss-chat-empty-icon { font-size: 48px; }
.ss-conversation-list { display: grid; gap: 5px; }
.ss-conversation-row {
  width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px;
  border: 0; border-radius: 12px; background: transparent; color: #f5f1ff;
  text-align: left; cursor: pointer;
}
.ss-conversation-row:hover, .ss-conversation-row:focus-visible { background: #292238; }
.ss-conversation-avatar, .ss-person-avatar, .ss-chat-partner-avatar, .ss-message-avatar {
  width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover;
  background: #30263e; border: 1px solid #51436b;
}
.ss-conversation-details { min-width: 0; flex: 1; display: grid; gap: 4px; }
.ss-conversation-details strong, .ss-conversation-details small {
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.ss-conversation-details small { color: #aaa8b6; font-size: 12px; }
.ss-conversation-time { color: #898596; font-size: 10px; }
.ss-social-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.ss-social-tabs button {
  background: #211d2d; color: #c9c1d8; border: 1px solid #51436b;
  border-radius: 20px; padding: 7px 10px; cursor: pointer; font-size: 12px;
}
.ss-social-tabs button.active { background: #c9a7ff; color: #17131f; }
.ss-social-list { display: grid; gap: 8px; }
.ss-person-row { display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid #393747; border-radius: 12px; background: #211d2d; }
.ss-person-name { min-width: 0; flex: 1; display: flex; align-items: center; gap: 9px; }
.ss-person-name > div { display: grid; gap: 3px; }
.ss-person-name strong, .ss-person-name small { overflow-wrap: anywhere; }
.ss-person-name small { color: #aaa8b6; font-size: 12px; }

.chat-dialog .chat-window { display: flex; flex: 1; min-height: 0; flex-direction: column; padding: 0; }
.chat-window-header {
  min-height: 72px; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid #393747;
}
.ss-chat-back { display: none; border: 0; background: transparent; color: #e6d8ff; font-size: 24px; cursor: pointer; }
.ss-chat-identity { display: flex; align-items: center; gap: 11px; min-width: 0; flex: 1; }
.ss-chat-partner-avatar { width: 44px; height: 44px; flex-basis: 44px; }
.ss-chat-partner-labels { display: grid; gap: 4px; }
.ss-chat-partner-labels strong { color: #f5f1ff; }
.ss-chat-partner-labels small { color: #aaa8b6; }
.ss-chat-header-actions { position: relative; }
.ss-chat-more { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #51436b;
  background: #211d2d; color: #e6d8ff; font-size: 25px; cursor: pointer; }
.ss-chat-menu { position: absolute; z-index: 5; right: 0; top: 46px; min-width: 150px;
  padding: 6px; border: 1px solid #51436b; border-radius: 10px; background: #24202e; box-shadow: 0 12px 30px #0008; }
.ss-chat-menu button { width: 100%; padding: 10px; border: 0; border-radius: 7px;
  text-align: left; color: #ffb4bd; background: transparent; cursor: pointer; }
.ss-chat-menu button:hover { background: #39232e; }
.chat-dialog .chat-messages-area {
  flex: 1; height: auto; min-height: 180px; margin: 0; padding: 18px;
  border-radius: 0; background: #121119; overflow-y: auto;
}
.ss-message-line { display: flex; align-items: flex-end; gap: 8px; max-width: 85%; }
.ss-message-line.mine { align-self: flex-end; flex-direction: row-reverse; }
.ss-message-line.theirs { align-self: flex-start; }
.ss-message-avatar { width: 28px; height: 28px; flex-basis: 28px; }
.ss-message-line .chat-bubble { max-width: min(560px, 78vw); padding: 10px 13px; line-height: 1.45; font-size: 14px; }
.chat-dialog .chat-input-form {
  padding: 14px; border-top: 1px solid #393747; background: #191923;
}
.chat-dialog .chat-input-form input { min-width: 0; }

.ss-search-titlebar { display: flex; align-items: center; justify-content: space-between; max-width: 1100px; margin: auto; }
.ss-search-list { max-width: 1100px; margin: 20px auto; display: grid; gap: 10px; }
.ss-search-result { text-align: left; padding: 15px; border-radius: 12px; border: 1px solid #393747; background: #191923; color: white; cursor: pointer; }
.ss-search-result span { display: grid; gap: 6px; }
.ss-search-result small, .ss-search-desc { color: #aaa8b6; }
.ss-recent-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px; border-bottom: 1px solid #393747; }

@media (max-width: 720px) {
  .ss-chat-fullscreen > .chat-dialog { height: 100dvh; min-height: 0; padding: 12px !important; }
  .ss-chat-topbar { gap: 8px; padding: 6px 0 12px; }
  .ss-chat-topbar h3 { font-size: 20px; }
  .ss-chat-layout { display: block; position: relative; }
  .ss-chat-sidebar { height: 100%; border-radius: 14px; }
  .ss-chat-main { display: none; height: 100%; border-radius: 14px; }
  .ss-chat-has-active .ss-chat-sidebar { display: none; }
  .ss-chat-has-active .ss-chat-main { display: flex; }
  .ss-chat-back { display: inline-block; }
  .ss-chat-has-active .ss-chat-layout { height: 100%; }
  .ss-chat-has-active .ss-chat-main { min-height: 0; }
  .ss-chat-has-active .chat-dialog .chat-window { height: 100%; }
  .ss-chat-has-active .chat-dialog .chat-messages-area { min-height: 0; }
  .ss-person-row { flex-wrap: wrap; }
}


/* Home page universal search: visible, responsive and above surrounding content. */
.ss-global-search-wrap {
  position: relative;
  z-index: 2;
  width: min(920px, 100%);
  margin: -34px auto 54px;
  padding: 18px;
  border: 1px solid rgba(201, 167, 255, .28);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(35, 29, 48, .98), rgba(24, 21, 33, .98));
  box-shadow: 0 16px 38px rgba(0, 0, 0, .22);
  box-sizing: border-box;
}
.ss-global-search-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ss-global-search-main .ss-search-icon {
  color: #c9a7ff;
  font-size: 26px;
  line-height: 1;
}
.ss-global-search-main input {
  flex: 1 1 auto;
  width: 0;
  min-width: 0;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid #594773;
  border-radius: 11px;
  outline: none;
  background: #17131f;
  color: #f4edff;
  font: inherit;
}
.ss-global-search-main input:focus,
.ss-global-search-filters select:focus {
  border-color: #c9a7ff;
  box-shadow: 0 0 0 3px rgba(201, 167, 255, .13);
}
.ss-global-search-main button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 20px;
  border: 0;
  border-radius: 11px;
  background: #c9a7ff;
  color: #17131f;
  font-weight: 700;
  cursor: pointer;
}
.ss-global-search-main button:hover { background: #e2d1ff; }
.ss-global-search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 11px;
}
.ss-global-search-filters select {
  min-height: 38px;
  min-width: 150px;
  padding: 7px 10px;
  border: 1px solid #514064;
  border-radius: 9px;
  background: #211b2c;
  color: #e8ddf7;
}
.ss-global-search-filters p {
  flex: 1 1 100%;
  margin: 0;
  color: #b9a9d0;
  font-size: 12px;
}
.ss-search-results[hidden] { display: none !important; }
.ss-search-results { z-index: 15000 !important; }
.ss-search-titlebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ss-search-list { display: grid; gap: 10px; max-width: 920px; margin: 18px auto 0; }
.ss-search-result { width: 100%; }
.ss-search-result:focus-visible,
.ss-global-search-main button:focus-visible,
.back-button:focus-visible { outline: 2px solid #e2ccff; outline-offset: 3px; }

/* Keep Back buttons clear of the heading text in art sub-sections. */
#sketches > .back-button,
#digital-art > .back-button,
#paintings > .back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin: 0 auto 22px;
  line-height: 1.35;
  white-space: normal;
}
#sketches > .section-heading,
#digital-art > .section-heading,
#paintings > .section-heading { margin-top: 0; }

@media (max-width: 600px) {
  .ss-global-search-wrap { margin: -28px auto 38px; padding: 13px; }
  .ss-global-search-main { gap: 7px; }
  .ss-global-search-main button { padding: 9px 13px; }
  .ss-global-search-filters select { flex: 1 1 45%; min-width: 0; }
  #sketches > .back-button,
  #digital-art > .back-button,
  #paintings > .back-button { margin-bottom: 20px; }
}


/* Logged-in header shortcuts: Writer Request -> Messages -> Profile. */
.writer-header-button {
  position: absolute;
  top: 22px;
  right: clamp(122px, 16vw, 154px);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #8065a8;
  background: linear-gradient(145deg, #30263e, #191720);
  color: #e6d8ff;
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: .25s ease;
}
.writer-header-button[hidden] { display: none !important; }
.writer-header-button:hover { transform: translateY(-2px); border-color: #c9a7ff; }
@media (max-width: 520px) {
  .writer-header-button { top: 12px; right: 108px; width: 40px; height: 40px; }
  .chat-header-button { right: 60px; }
}

/* Profile avatar alignment fix */
#profileAvatarImg {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  border-radius: 50%;
}


/* Messages: clean top bar and full-screen workspace without page chrome. */
.ss-chat-topbar {
  justify-content: flex-start;
  min-height: 42px;
}
.ss-chat-topbar .small-heading,
.ss-chat-topbar .ss-chat-refresh,
.ss-chat-topbar #closeChatModal {
  display: none !important;
}
.ss-chat-fullscreen > .chat-dialog {
  min-height: 100dvh;
  height: 100dvh;
}
.ss-inbox-search-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 10px;
  padding: 5px 11px;
  border: 1px solid #51436b;
  border-radius: 10px;
  background: #211d2d;
  color: #e6d8ff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.ss-message-search-header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ss-message-search-header h2 {
  flex: 1;
}
.ss-message-search-cancel {
  border: 1px solid #51436b;
  border-radius: 10px;
  padding: 8px 14px;
  background: #211d2d;
  color: #e6d8ff;
  font: inherit;
  cursor: pointer;
}


/* Messages is an uncluttered full-screen workspace: only the top-right close control remains. */
.ss-chat-topbar { min-height: 0 !important; height: auto !important; padding: 0 0 10px !important; margin: 0 !important; justify-content: flex-end !important; border: 0 !important; }
.ss-chat-topbar #closeChatModal { display: grid !important; position: relative !important; inset: auto !important; margin: 0 0 0 auto !important; width: 42px; height: 42px; padding: 0; place-items: center; border: 1px solid #51436b; border-radius: 50%; background: #211d2d; color: #e6d8ff; font-size: 27px; line-height: 1; cursor: pointer; }
.ss-chat-topbar h3, .ss-chat-topbar .small-heading { display: none !important; }
.ss-chat-fullscreen > .chat-dialog { padding-top: 12px !important; }
.ss-chat-sidebar > h4:first-child { margin-top: 8px; }
.ss-profile-stat-link { cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.ss-profile-stat-link:hover, .ss-profile-stat-link:focus-visible { color: #e6d8ff; text-decoration-color: currentColor; outline: none; }
.ss-profile-social-dialog { position: fixed; inset: 0; z-index: 15900; display: grid; place-items: center; padding: 16px; background: #000b; }
.ss-profile-social-dialog[hidden] { display: none !important; }
.ss-profile-social-panel { width: min(520px, 100%); max-height: min(82dvh, 760px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #51436b; border-radius: 20px; background: #17151e; color: #eee7fa; box-shadow: 0 20px 70px #0009; }
.ss-profile-social-header { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid #393747; }
.ss-profile-social-header h2 { flex: 1; margin: 0; color: #e6d8ff; font-size: 19px; }
.ss-profile-social-close { width: 38px; height: 38px; border: 1px solid #51436b; border-radius: 50%; background: #211d2d; color: #e6d8ff; font-size: 25px; line-height: 1; cursor: pointer; }
.ss-profile-social-tabs { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid #393747; }
.ss-profile-social-tabs button { flex: 1; padding: 9px 12px; border: 1px solid #51436b; border-radius: 12px; background: #211d2d; color: #d8cce9; cursor: pointer; }
.ss-profile-social-tabs button.active { background: #c9a7ff; border-color: #c9a7ff; color: #17131f; }
.ss-profile-social-list { min-height: 100px; overflow: auto; padding: 10px 14px 16px; }
.ss-profile-social-person { display: flex; align-items: center; gap: 10px; padding: 10px 2px; border-bottom: 1px solid #393747; }
.ss-profile-social-person-main { min-width: 0; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.ss-profile-social-avatar { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 50%; object-fit: cover; background: #30263e; }
.ss-profile-social-labels { min-width: 0; display: grid; gap: 4px; }
.ss-profile-social-labels strong, .ss-profile-social-labels small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-profile-social-labels small { color: #aaa3b6; font-size: 12px; }
.ss-profile-social-message { flex: 0 0 auto; padding: 8px 12px; }
@media (max-width: 700px) {
  .ss-chat-fullscreen > .chat-dialog { height: 100dvh; min-height: 0; padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom)) !important; }
  .ss-chat-topbar { padding: 0 0 6px !important; }
  .ss-chat-topbar #closeChatModal { width: 38px; height: 38px; }
  .ss-chat-has-active .ss-chat-topbar { display: none; }
  .ss-chat-back { display: inline-grid !important; place-items: center; width: 38px; height: 38px; padding: 0; font-size: 27px; }
}


/* Inbox layout follows the supplied PC/phone Message screenshots. */
.ss-chat-topbar { position:relative!important; }
.ss-chat-screen-title { display:none; margin:0; color:#f2eaff; font-size:21px; font-weight:750; }
.ss-messages-sidebar-title { margin:10px 0 22px!important; color:#f2eaff!important; font-size:21px!important; font-weight:750!important; letter-spacing:.1px; }
.ss-chat-sidebar > .ss-sidebar-section-title { margin-top:0!important; }
@media (max-width:700px) {
  .ss-chat-topbar { display:flex!important; align-items:center!important; justify-content:center!important; min-height:52px!important; height:52px!important; padding:2px 0 8px!important; }
  .ss-chat-topbar h3.ss-chat-screen-title { display:block!important; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); font-size:20px; }
  .ss-chat-topbar #closeChatModal { position:absolute!important; right:0!important; top:50%!important; transform:translateY(-50%); margin:0!important; }
  .ss-messages-sidebar-title { display:none!important; }
  .ss-chat-layout { height:calc(100dvh - 60px)!important; }
  .ss-chat-sidebar { padding:8px 12px 12px!important; }
}


/* Personal chat view: full-height conversation with controls in the chat header. */
.ss-chat-has-active .ss-chat-topbar { display:none!important; }
.ss-chat-header-actions { display:flex!important; align-items:center!important; gap:10px!important; margin-left:auto!important; }
.ss-chat-cancel { flex:0 0 auto; min-height:38px; padding:7px 15px; border:1px solid #66527f; border-radius:11px; background:#211d2d; color:#e6d8ff; font:inherit; font-size:14px; cursor:pointer; }
.ss-chat-cancel:hover,.ss-chat-cancel:focus-visible { background:#392d4b; outline:2px solid #c9a7ff; outline-offset:2px; }
.ss-chat-has-active .ss-chat-layout { min-height:0!important; }
.ss-chat-has-active .ss-chat-main { min-height:0!important; height:100%!important; }
.ss-chat-has-active .ss-chat-main #activeChatBox { display:flex!important; flex-direction:column!important; min-height:0!important; height:100%!important; width:100%!important; }
.ss-chat-has-active .chat-dialog .chat-window-header { flex:0 0 auto; width:100%; box-sizing:border-box; }
.ss-chat-has-active .chat-dialog .chat-messages-area { flex:1 1 auto!important; min-height:0!important; width:100%; box-sizing:border-box; }
.ss-chat-has-active .chat-dialog .chat-input-form { flex:0 0 auto; display:flex; align-items:center; gap:10px; width:100%; box-sizing:border-box; }
.ss-chat-has-active .chat-dialog .chat-input-form input { flex:1 1 auto; width:0; min-width:0; }
.ss-chat-has-active .chat-dialog .chat-input-form button { flex:0 0 auto; min-width:76px; }
@media(max-width:700px) {
  .ss-chat-fullscreen.ss-chat-has-active > .chat-dialog { height:100dvh!important; width:100vw!important; max-height:100dvh!important; padding:0!important; }
  .ss-chat-fullscreen.ss-chat-has-active .ss-chat-layout { display:block!important; width:100%!important; height:100dvh!important; max-height:100dvh!important; margin:0!important; }
  .ss-chat-fullscreen.ss-chat-has-active .ss-chat-main { display:flex!important; width:100%!important; height:100dvh!important; min-height:0!important; max-height:100dvh!important; margin:0!important; padding:0!important; border:0!important; border-radius:0!important; }
  .ss-chat-fullscreen.ss-chat-has-active .ss-chat-main #activeChatBox { width:100%!important; height:100%!important; max-height:100dvh!important; border:0!important; border-radius:0!important; }
  .ss-chat-fullscreen.ss-chat-has-active .chat-dialog .chat-window-header { min-height:64px; padding:8px max(12px,env(safe-area-inset-right)) 8px max(12px,env(safe-area-inset-left)); border-radius:0!important; }
  .ss-chat-fullscreen.ss-chat-has-active .chat-dialog .chat-messages-area { padding:12px max(10px,env(safe-area-inset-right))!important; }
  .ss-chat-fullscreen.ss-chat-has-active .chat-dialog .chat-input-form { padding:10px max(10px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left))!important; border-radius:0!important; }
  .ss-chat-cancel { min-height:36px; padding:6px 11px; }
}


/* Cross-browser in-page PDF reader: avoids relying on mobile browser PDF iframe plugins. */
#reader .pdf-container {
    width: min(1100px, 100%);
    height: min(78vh, 900px);
    min-height: 480px;
    overflow: auto;
    background: #17151f;
    border: 1px solid #49405d;
    border-radius: 14px;
    padding: 10px;
}
.book-pdf-viewer {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #eee8f8;
}
.book-pdf-controls {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 10px;
    background: rgba(25, 22, 34, .96);
    border: 1px solid #49405d;
    border-radius: 10px;
}
.book-pdf-controls button,
.book-pdf-open-link {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid #8065a8;
    border-radius: 9px;
    background: #30263e;
    color: #fff;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.book-pdf-controls button:disabled { opacity: .45; cursor: not-allowed; }
.book-pdf-controls span { color: #e8dcfa; font-size: 13px; }
.book-pdf-control-spacer { flex: 1 1 12px; }
.book-pdf-page {
    display: block;
    max-width: none;
    background: #fff;
    box-shadow: 0 5px 24px rgba(0,0,0,.35);
}
.book-pdf-status {
    padding: 24px 14px;
    text-align: center;
    color: #d9c8f2;
}
.book-pdf-status.is-error { color: #ffd1d1; }
@media (max-width: 600px) {
    #reader .pdf-container { height: 72vh; min-height: 420px; padding: 6px; }
    .book-pdf-controls { gap: 6px; padding: 7px; }
    .book-pdf-controls button, .book-pdf-open-link { min-height: 36px; padding: 7px 9px; font-size: 12px; }
    .book-pdf-control-spacer { display: none; }
}


/* Visitor profiles opened from Messages must sit above the full-screen chat. */
#visitorProfileModal { z-index: 16000 !important; position: fixed !important; inset: 0 !important; }
#visitorProfileModal .auth-dialog { max-height: min(86dvh, 760px); overflow-y: auto; overscroll-behavior: contain; }
#visitorProfileModal .profile-action-buttons { gap: 8px; }
#visitorProfileModal .profile-action-buttons button { min-width: 92px; }
@media (max-width: 600px) { #visitorProfileModal { padding: 10px !important; } #visitorProfileModal .auth-dialog { max-height: 90dvh; padding: 28px 16px 20px; } }

/* Private-message own-message controls: compact three-dots menu, matching Social Chat. */
.ss-message-bubble-row{display:flex;align-items:center;gap:5px;max-width:100%;}
.ss-message-bubble-row .chat-bubble{flex:0 1 auto;min-width:0;}
.ss-private-message-actions{position:relative;display:flex;align-items:center;align-self:center;flex:0 0 auto;margin:0}
.ss-private-message-more{width:28px;height:24px;padding:0;border:1px solid #51436b;border-radius:8px;background:#211d2d;color:#e6d8ff;font-size:20px;line-height:1;cursor:pointer}
.ss-private-message-menu{position:absolute;right:0;top:calc(100% + 5px);z-index:80;min-width:112px;padding:5px;border:1px solid #51436b;border-radius:10px;background:#211d2d;box-shadow:0 10px 28px #0009}
.ss-private-message-menu[hidden]{display:none!important}
.ss-private-message-menu button{display:block;width:100%;padding:8px 10px;border:0;border-radius:7px;background:transparent;color:#eee7fa;text-align:left;font-size:12px;cursor:pointer}
.ss-private-message-menu button:hover{background:#393044}
.ss-private-message-menu button.danger{color:#ffb9c4}
.ss-private-message-actions{z-index:2}


/* Private message overflow button sits inside the message bubble, like Social Groups. */
.ss-private-message-bubble-wrap{position:relative;display:inline-flex;align-items:flex-start;max-width:100%;min-width:0}
.ss-private-message-bubble-wrap>.chat-bubble{max-width:100%;padding-right:43px!important;box-sizing:border-box}
.ss-private-message-bubble-wrap>.ss-private-message-actions{position:absolute;top:5px;right:5px;display:flex;align-items:flex-start;z-index:4}
.ss-private-message-bubble-wrap .ss-private-message-more{width:25px;height:23px;padding:0;border:1px solid #74608e;border-radius:7px;background:#211d2d;color:#eee7fa;font-size:19px;line-height:16px;cursor:pointer}
.ss-private-message-bubble-wrap .ss-private-message-menu{top:calc(100% + 4px);right:0}
.ss-message-line.mine .ss-private-message-bubble-wrap{align-self:flex-end}
@media(max-width:700px){
 .ss-private-message-bubble-wrap>.chat-bubble{padding-right:40px!important}
 .ss-private-message-bubble-wrap>.ss-private-message-actions{top:4px;right:4px}
}
