@media (max-width: 320px) {
  .messages {
    min-width: unset;
  }
}

/* Hide donation bar in private DM, keep in chat rooms */
#main-private .chat-donation-topbar {
  display: none !important;
}

/* Enhanced Hover Effects and Accessibility */
.channel-item,
.room-item,
.private-item {
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  border-radius: 6px;
}

.channel-item:hover,
.room-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  transform: translateX(2px);
}

.channel-item.active,
.room-item.active {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  padding-left: calc(0.75rem - 3px);
}

/* Focus indicators for keyboard navigation */
.nav-link:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Loading skeleton animation */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.dm-conversation-count-badge {
  position: absolute;
  top: -8px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
  z-index: 3;
  pointer-events: none;
}

.navbar.topbar .open-inbox-middle,
.room-bar .open-inbox-middle,
.mobile-bottom-nav .open-inbox-middle {
  position: relative;
}

.dm-conversation-count-badge[hidden] {
  display: none !important;
}

@keyframes dmUnreadIconPulse {
  0% {
    transform: scale(1);
  }

  45% {
    transform: scale(1.18);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes dmUnreadBadgePulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.15);
  }

  100% {
    transform: scale(1);
  }
}

.mobile-swipe-edge-hint {
  display: none;
}

.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .message-html,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-text,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .chat-txt,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .chat-code,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .chat-link,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .chat-link-block,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .link-meta-desc,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .file-caption,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble p,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble a {
  max-width: 100%;
  min-width: 0;
  display: block;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: normal;
  line-height: 1.45;
  letter-spacing: normal;
}

.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .message-html {
  overflow: visible;
}

.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content *,
.mobile-dm-mini-chat .mobile-dm-mini-msg-bubble .message-html * {
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  line-height: inherit;
  letter-spacing: normal;
}

/* Chat notices: stronger success tone and link color inheritance */
.group-chat .main-panel>.general-notice.alert.alert-important.alert-success,
.private-chat .main-panel>.general-notice.alert.alert-important.alert-success,
#main-room #room-notice-class.alert.alert-important.alert-success,
#main-private #room-notice-class.alert.alert-important.alert-success {
  background: linear-gradient(160deg, #14532d 0%, #166534 100%) !important;
  border-color: #0f3f23 !important;
  color: #ecfdf5 !important;
}

.group-chat .main-panel>.general-notice.alert.alert-important a,
.private-chat .main-panel>.general-notice.alert.alert-important a,
#main-room #room-notice-class.alert.alert-important a,
#main-private #room-notice-class.alert.alert-important a,
.group-chat .main-panel>.general-notice.alert.alert-important a:visited,
.private-chat .main-panel>.general-notice.alert.alert-important a:visited,
#main-room #room-notice-class.alert.alert-important a:visited,
#main-private #room-notice-class.alert.alert-important a:visited,
.group-chat .main-panel>.general-notice.alert.alert-important a:hover,
.private-chat .main-panel>.general-notice.alert.alert-important a:hover,
#main-room #room-notice-class.alert.alert-important a:hover,
#main-private #room-notice-class.alert.alert-important a:hover,
.group-chat .main-panel>.general-notice.alert.alert-important a:focus,
.private-chat .main-panel>.general-notice.alert.alert-important a:focus,
#main-room #room-notice-class.alert.alert-important a:focus,
#main-private #room-notice-class.alert.alert-important a:focus {
  color: inherit !important;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.group-chat .main-panel>.general-notice.alert.alert-important .btn-close,
.private-chat .main-panel>.general-notice.alert.alert-important .btn-close,
#main-room #room-notice-class.alert.alert-important .btn-close,
#main-private #room-notice-class.alert.alert-important .btn-close {
  position: absolute;
  top: 6px !important;
  right: 6px !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px;
  min-height: 20px;
  padding: 3px !important;
  border-radius: 999px;
  background-color: rgba(15, 23, 42, 0.56) !important;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 2px 6px rgba(15, 23, 42, 0.32);
  opacity: 1 !important;
  transform: none !important;
  filter: invert(1) grayscale(100%) brightness(220%);
  cursor: pointer;
}

.group-chat .main-panel>.general-notice.alert.alert-important .btn-close:hover,
.private-chat .main-panel>.general-notice.alert.alert-important .btn-close:hover,
#main-room #room-notice-class.alert.alert-important .btn-close:hover,
#main-private #room-notice-class.alert.alert-important .btn-close:hover {
  background-color: rgba(15, 23, 42, 0.72) !important;
  opacity: 1 !important;
}

.group-chat .main-panel>.general-notice.alert.alert-important .btn-close:focus,
.private-chat .main-panel>.general-notice.alert.alert-important .btn-close:focus,
#main-room #room-notice-class.alert.alert-important .btn-close:focus,
#main-private #room-notice-class.alert.alert-important .btn-close:focus {
  opacity: 1 !important;
  outline: none;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.36),
    0 0 0 2px rgba(255, 255, 255, 0.24),
    0 0 0 4px rgba(15, 23, 42, 0.28);
}

.group-chat .main-panel>.general-notice.alert.alert-important.alert-success .btn-close,
.private-chat .main-panel>.general-notice.alert.alert-important.alert-success .btn-close,
#main-room #room-notice-class.alert.alert-important.alert-success .btn-close,
#main-private #room-notice-class.alert.alert-important.alert-success .btn-close {
  background-color: rgba(236, 253, 245, 0.22) !important;
  box-shadow:
    inset 0 0 0 1px rgba(236, 253, 245, 0.58),
    0 2px 6px rgba(6, 78, 59, 0.45);
}

@keyframes mobileSwipeHintNudgeLeft {

  0%,
  100% {
    transform: translateX(0);
    opacity: 0.72;
  }

  50% {
    transform: translateX(-3px);
    opacity: 1;
  }
}

@media (max-width: 991.98px) {

  html.mobile-native-swipe-guard,
  body.mobile-native-swipe-guard {
    overscroll-behavior-x: none;
  }

  html.mobile-native-swipe-guard,
  html.mobile-native-swipe-guard body {
    touch-action: pan-y pinch-zoom;
  }

  body.mobile-native-swipe-guard #wrapper {
    overscroll-behavior-x: contain;
    touch-action: pan-y;
  }

  .mobile-swipe-edge-hint {
    position: fixed;
    top: calc(50% - 10px);
    width: 24px;
    height: 88px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 1085;
    opacity: 0;
    transform: translateY(-50%) scale(0.94);
    transition:
      opacity 0.24s ease,
      transform 0.24s ease;
    color: rgba(226, 232, 240, 0.94);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.26);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }

  .mobile-swipe-edge-hint-right {
    right: 2px;
    background: linear-gradient(270deg,
        rgba(56, 189, 248, 0.36) 0%,
        rgba(56, 189, 248, 0.08) 100%);
  }

  body.mobile-android-swipe-safezone .mobile-swipe-edge-hint-right {
    right: 48px;
  }

  html.mobile-android-swipe-safezone body.mobile-android-swipe-safezone .mobile-swipe-edge-hint-right {
    right: 48px;
  }

  .mobile-swipe-edge-hint-right .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-swipe-edge-hint-right .ti {
    animation: mobileSwipeHintNudgeLeft 1.1s ease-in-out infinite;
    animation-delay: 0.18s;
  }

  body.show-mobile-swipe-hints .mobile-swipe-edge-hint {
    opacity: 0.9;
    transform: translateY(-50%) scale(1);
  }

  body.mobile-swipe-hint-no-right .mobile-swipe-edge-hint-right {
    opacity: 0;
    visibility: hidden;
  }

  .rtl .mobile-swipe-edge-hint-right {
    right: auto;
    left: calc(var(--chat-left-rail-width-mobile, 4.5rem) + 2px);
  }

  .rtl body.mobile-android-swipe-safezone .mobile-swipe-edge-hint-right {
    left: calc(var(--chat-left-rail-width-mobile, 4.5rem) + 48px);
  }

  .rtl html.mobile-android-swipe-safezone body.mobile-android-swipe-safezone .mobile-swipe-edge-hint-right {
    left: calc(var(--chat-left-rail-width-mobile, 4.5rem) + 48px);
  }
}

@media (max-width: 991.98px) and (prefers-reduced-motion: reduce) {
  .mobile-swipe-edge-hint {
    transition: opacity 0.01s linear;
  }

  .mobile-swipe-edge-hint-right .ti {
    animation: none;
  }
}

.mobile-dm-bubble-trigger.dm-unread-pulse .ti,
.navbar.topbar .open-inbox-middle.dm-unread-pulse .ti {
  animation: dmUnreadIconPulse 0.92s ease-in-out 2;
}

.mobile-dm-bubble-trigger.dm-unread-pulse .dm-conversation-count-badge,
.mobile-dm-bubble-trigger.dm-unread-pulse .mobile-dm-bubble-count,
.navbar.topbar .open-inbox-middle.dm-unread-pulse .dm-conversation-count-badge {
  animation: dmUnreadBadgePulse 0.92s ease-in-out 2;
}

@media (prefers-reduced-motion: reduce) {

  .mobile-dm-bubble-trigger.dm-unread-pulse .ti,
  .navbar.topbar .open-inbox-middle.dm-unread-pulse .ti,
  .mobile-dm-bubble-trigger.dm-unread-pulse .dm-conversation-count-badge,
  .mobile-dm-bubble-trigger.dm-unread-pulse .mobile-dm-bubble-count,
  .navbar.topbar .open-inbox-middle.dm-unread-pulse .dm-conversation-count-badge {
    animation: none;
  }
}

@media (max-width: 991.98px) {
  .rightbar-wrapper {
    display: none;
    position: absolute;
    top: 0;
    bottom: var(--mobile-bottom-nav-visible-height,
        calc(61px + (env(safe-area-inset-bottom, 0px) * 2)));
    height: auto;
    max-height: calc(100vh - var(--mobile-bottom-nav-visible-height,
          calc(61px + (env(safe-area-inset-bottom, 0px) * 2))));
    max-height: calc(100dvh - var(--mobile-bottom-nav-visible-height,
          calc(61px + (env(safe-area-inset-bottom, 0px) * 2))));
    overflow: hidden;
    overscroll-behavior: contain;
    transition: all 0.5s ease-in;
  }

  body.sb-rightnav-toggled #wrapper .rightbar-wrapper {
    display: block;
    right: 0rem;
    margin-right: 0rem;
  }

  body.sb-rightnav-toggled #wrapper .private-right-panel {
    bottom: var(--mobile-bottom-nav-visible-height,
        calc(61px + (env(safe-area-inset-bottom, 0px) * 2)));
    height: auto !important;
    max-height: calc(100vh - var(--mobile-bottom-nav-visible-height,
          calc(61px + (env(safe-area-inset-bottom, 0px) * 2))));
    max-height: calc(100dvh - var(--mobile-bottom-nav-visible-height,
          calc(61px + (env(safe-area-inset-bottom, 0px) * 2))));
  }

  .rtl body.sb-rightnav-toggled #wrapper .rightbar-wrapper {
    left: 0rem;
    margin-left: 0rem;
    margin-right: auto;
    right: auto;
  }

  .main-block-padding {
    padding: 0.5rem;
  }
}

@media (max-width: 991.98px) {

  #wrapper .room-bar {
    width: var(--chat-left-rail-width-mobile, 4.5rem);
    min-width: var(--chat-left-rail-width-mobile, 4.5rem);
    max-width: var(--chat-left-rail-width-mobile, 4.5rem);
  }

  #wrapper .sidebar-wrapper {
    width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
    min-width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
    max-width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
  }

  body:not(.sb-sidenav-toggled) #wrapper .channel-bar {
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  #wrapper .room-bar,
  #wrapper .sidebar-wrapper,
  #wrapper .main-container,
  #wrapper .page-content-wrapper {
    transition:
      width 0.24s ease,
      min-width 0.24s ease,
      max-width 0.24s ease,
      margin 0.24s ease,
      opacity 0.18s ease;
  }

  body.sb-sidenav-toggled #wrapper .room-bar {
    display: flex !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    border-right: 0 !important;
    overflow: hidden !important;
    opacity: 0;
    pointer-events: none;
  }

  body:not(.sb-sidenav-toggled) #wrapper .room-bar {
    opacity: 1;
    pointer-events: auto;
  }

  body.sb-sidenav-toggled #wrapper .sidebar-wrapper {
    margin-left: 0 !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    border-right: 0 !important;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
  }

  body:not(.sb-sidenav-toggled) #wrapper .sidebar-wrapper {
    opacity: 1;
    pointer-events: auto;
  }

  .rtl body.sb-sidenav-toggled #wrapper .sidebar-wrapper {
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  body.sb-sidenav-toggled #wrapper .main-container,
  body.sb-sidenav-toggled #wrapper .page-content-wrapper {
    width: 100%;
    max-width: 100%;
  }

  body.mobile-sidebar-transitioning #wrapper .room-bar,
  body.mobile-sidebar-transitioning #wrapper .sidebar-wrapper {
    pointer-events: none;
  }
}

.sb-sidenav-toggled .sidebar-wrapper {
  margin-left: calc(-1 * var(--chat-left-panel-effective-width,
        var(--chat-left-panel-width, 15rem)));
}

.dating-cta .icon-wrap img {
  width: 22px;
  height: 22px;
  display: block;
}

.rtl .sb-sidenav-toggled .sidebar-wrapper {
  margin-right: calc(-1 * var(--chat-left-panel-effective-width,
        var(--chat-left-panel-width, 15rem)));
  margin-left: 0rem;
}

@media (max-width: 425px) {
  #wrapper .sidebar-wrapper {
    width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
    min-width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
    max-width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
  }

  .sb-sidenav-toggled .sidebar-wrapper {
    margin-left: calc(-1 * (100vw - var(--chat-left-rail-width-mobile, 4.5rem)));
  }

  .rtl .sb-sidenav-toggled .sidebar-wrapper {
    margin-right: calc(-1 * (100vw - var(--chat-left-rail-width-mobile, 4.5rem)));
    margin-left: 0rem;
  }

  body:not(.sb-sidenav-toggled) .channel-bar {
    width: calc(100vw - var(--chat-left-rail-width-mobile, 4.5rem));
  }
}

@media (max-width: 320px) {
  .notifications-panel-card {
    min-width: 250px;
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card {
    width: min(264px, calc(100vw - 10px));
    max-width: calc(100vw - 10px);
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card .noti-item {
    margin: 4px;
    padding: 6px 7px;
  }
}

@media (max-width: 991.98px) {
  :root {
    --mobile-bottom-nav-space: 60px;
    --mobile-bottom-nav-peek: 10px;
    --mobile-bottom-nav-height: calc(52px + env(safe-area-inset-bottom, 0px));
    --mobile-bottom-nav-visible-height: calc(var(--mobile-bottom-nav-height) + 9px + env(safe-area-inset-bottom, 0px));
    --mobile-dm-surface: var(--surface-bg, #ffffff);
    --mobile-dm-surface-2: rgba(248, 250, 252, 0.96);
    --mobile-dm-border: rgba(148, 163, 184, 0.35);
    --mobile-dm-text: var(--default-text-color, #0f172a);
    --mobile-dm-muted: var(--muted-text-color, #64748b);
    --mobile-dm-accent-rgb: var(--tblr-primary-rgb, 32, 107, 196);
    --mobile-dm-accent-soft: rgba(var(--mobile-dm-accent-rgb), 0.14);
    --mobile-dm-accent-strong: rgb(var(--mobile-dm-accent-rgb));
    --mobile-dm-row-height: 70px;
  }

  body.mobile-bottom-nav-collapsed {
    --mobile-bottom-nav-space: var(--mobile-bottom-nav-peek);
    --mobile-bottom-nav-visible-height: calc(var(--mobile-bottom-nav-peek) + 9px + env(safe-area-inset-bottom, 0px));
  }

  body.mobile-bottom-nav-keyboard-active {
    --mobile-bottom-nav-space: 0px;
    --mobile-bottom-nav-peek: 0px;
    --mobile-bottom-nav-visible-height: 0px;
  }

  html.mobile-bottom-nav-keyboard-active,
  html.mobile-bottom-nav-keyboard-active body {
    height: var(--app-vh, calc(var(--vh, 1vh) * 100));
    max-height: var(--app-vh, calc(var(--vh, 1vh) * 100));
    overflow: hidden;
    overscroll-behavior: none;
  }

  html.theme-dark,
  html.dark,
  body.theme-dark,
  body.dark,
  html.theme-trueblue,
  html.trueblue,
  body.theme-trueblue,
  body.trueblue {
    --mobile-dm-surface: rgba(15, 23, 42, 0.96);
    --mobile-dm-surface-2: rgba(30, 41, 59, 0.94);
    --mobile-dm-border: rgba(125, 211, 252, 0.3);
    --mobile-dm-text: #e2e8f0;
    --mobile-dm-muted: #a5b4cc;
    --mobile-dm-accent-soft: rgba(var(--mobile-dm-accent-rgb), 0.22);
  }

  #main-private {
    --mobile-dm-accent-soft: rgba(var(--mobile-dm-accent-rgb), 0.22);
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--mobile-bottom-nav-height);
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-bg, #ffffff);
    border-top: 1px solid var(--border-color, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4px;
    z-index: 1030;
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.08);
    transition:
      transform 0.22s ease,
      box-shadow 0.2s ease;
    will-change: transform;
  }

  body.mobile-bottom-nav-keyboard-active .mobile-bottom-nav {
    transform: translateY(calc(100% + env(safe-area-inset-bottom, 0px)));
    box-shadow: none;
    pointer-events: none;
  }

  body.mobile-bottom-nav-keyboard-active .mobile-bottom-nav-toggle {
    opacity: 0;
    pointer-events: none;
  }

  .mobile-bottom-nav-toggle {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 14px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(248, 250, 252, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.55);
    color: rgba(71, 85, 105, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 1031;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1);
    opacity: 0.7;
    touch-action: manipulation;
    transition:
      opacity 0.2s ease,
      color 0.2s ease,
      border-color 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav-toggle::before {
    content: "";
    position: absolute;
    inset: -9px -12px;
  }

  .mobile-bottom-nav-toggle .ti {
    font-size: 10px;
    line-height: 1;
  }

  .mobile-bottom-nav-toggle:focus-visible,
  .mobile-bottom-nav-toggle:active {
    opacity: 1;
    color: rgba(51, 65, 85, 0.9);
    border-color: rgba(100, 116, 139, 0.7);
  }

  body.mobile-bottom-nav-collapsed .mobile-bottom-nav {
    transform: translateY(calc(var(--mobile-bottom-nav-height) - var(--mobile-bottom-nav-peek)));
    box-shadow: 0 -2px 6px rgba(15, 23, 42, 0.1);
  }

  body.mobile-bottom-nav-collapsed .mobile-bottom-nav>.nav-link,
  body.mobile-bottom-nav-collapsed .mobile-bottom-nav>.btn,
  body.mobile-bottom-nav-collapsed .mobile-bottom-nav>.nav-item {
    opacity: 0.08;
    pointer-events: none;
  }

  body.mobile-bottom-nav-collapsed .mobile-bottom-nav>.mobile-bottom-nav-toggle {
    opacity: 0.86;
    pointer-events: auto;
  }

  .mobile-bottom-nav>.nav-link,
  .mobile-bottom-nav>.btn,
  .mobile-bottom-nav>.nav-item {
    flex: 1 1 0;
    min-width: 0;
  }

  .mobile-bottom-nav .nav-item>.nav-link {
    width: 100%;
  }

  .mobile-bottom-nav .nav-link,
  .mobile-bottom-nav .btn {
    padding: 4px 4px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    touch-action: manipulation;
  }

  .btn-sm-round.sidebarToggle,
  .btn-sm-round.rightbarToggle,
  .mobile-rightbar-toggle {
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
  }

  .mobile-bottom-nav .nav-link i,
  .mobile-bottom-nav .btn i {
    font-size: 20px;
  }

  .mobile-bottom-nav small {
    font-size: 9px;
    margin-top: 2px;
  }

  #main-room .topbar {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    position: relative;
  }

  #main-room .topbar .me-auto {
    min-width: 0;
    flex: 1 1 auto !important;
    overflow: hidden;
    gap: 0.35rem;
    padding-left: 0.35rem !important;
  }

  #main-room .topbar .top-channel-icon,
  #main-room .topbar .chat-mode-pill-room,
  #main-room .topbar .leave-room-topbar-desktop {
    display: none !important;
  }

  #main-room .topbar .top-channel-pill,
  #main-room .topbar .top-channel-pill-room {
    padding: 1px 5px;
    min-height: 20px;
    border-radius: 999px;
  }

  #main-room .topbar .top-channel-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.64rem;
    line-height: 1.05;
  }

  #main-room .topbar .leave-room-topbar-mobile {
    position: relative;
    margin-left: 0;
    margin-right: 0.35rem;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    border-color: rgba(220, 38, 38, 0.62);
    color: #dc2626;
    background: rgba(220, 38, 38, 0.08);
    z-index: 2;
  }

  #main-room .topbar .leave-room-topbar-mobile .ti {
    font-size: 17px;
  }

  #main-room .topbar .leave-room-topbar-mobile:active {
    transform: translateY(1px);
  }

  #main-room .topbar .mobile-top-shortcut-trigger,
  #main-private .topbar .mobile-top-shortcut-trigger {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin-left: 0;
    margin-right: 0.35rem;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(100, 116, 139, 0.38);
    background: rgba(148, 163, 184, 0.12);
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  #main-room .topbar .mobile-top-shortcut-trigger .ti,
  #main-private .topbar .mobile-top-shortcut-trigger .ti {
    font-size: 17px;
    line-height: 1;
  }

  #main-room .topbar .mobile-top-shortcut-trigger:active,
  #main-private .topbar .mobile-top-shortcut-trigger:active {
    background: rgba(148, 163, 184, 0.2);
    transform: translateY(1px);
  }

  #main-room .topbar .mobile-dm-topbar-trigger,
  #main-private .topbar .mobile-dm-topbar-trigger {
    position: relative;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    -webkit-tap-highlight-color: transparent;
    z-index: 2;
  }

  #main-room .topbar .mobile-dm-topbar-trigger.is-hidden,
  #main-private .topbar .mobile-dm-topbar-trigger.is-hidden {
    display: none !important;
  }

  #main-room .topbar .mobile-dm-topbar-trigger .mobile-dm-topbar-icon-img,
  #main-private .topbar .mobile-dm-topbar-trigger .mobile-dm-topbar-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
  }

  #main-room .topbar .mobile-dm-topbar-trigger:active,
  #main-room .topbar .mobile-dm-topbar-trigger.is-active,
  #main-private .topbar .mobile-dm-topbar-trigger:active,
  #main-private .topbar .mobile-dm-topbar-trigger.is-active {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none;
  }

  #main-room .topbar .mobile-notification-top-trigger,
  #main-private .topbar .mobile-notification-top-trigger {
    margin-left: 0;
    position: relative;
  }

  #main-room .topbar .mobile-notification-top-trigger .noti-count,
  #main-private .topbar .mobile-notification-top-trigger .noti-count {
    position: absolute;
    top: auto;
    bottom: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 16px;
    font-size: 10px;
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card,
  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card {
    width: min(292px, calc(100vw - 14px));
    min-width: 0;
    max-width: calc(100vw - 14px);
    right: 0;
    left: auto;
    padding: 0;
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card .notification-list,
  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card .notification-list {
    max-height: 52vh;
    overflow-y: auto;
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card .noti-item,
  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card .noti-item {
    margin: 6px;
    padding: 7px 8px;
  }

  #main-room .topbar .mobile-notification-top-trigger+.notifications-panel-card .noti-content,
  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card .noti-content {
    font-size: 13px;
    line-height: 1.25;
  }

  #main-room .topbar .mobile-rightbar-top-toggle,
  #main-private .topbar .mobile-rightbar-top-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid rgba(var(--mobile-dm-accent-rgb), 0.44);
    background: var(--mobile-dm-accent-soft);
    color: var(--mobile-dm-accent-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
  }

  #main-room .topbar .mobile-rightbar-top-toggle {
    margin-left: 0;
    margin-right: 0.35rem;
  }

  #main-private .topbar .mobile-rightbar-top-toggle {
    margin-left: auto;
    margin-right: 0.35rem;
  }

  #main-room .topbar .mobile-rightbar-top-toggle .ti,
  #main-private .topbar .mobile-rightbar-top-toggle .ti {
    font-size: 17px;
    line-height: 1;
  }

  #main-room .topbar .mobile-rightbar-top-toggle:active,
  #main-private .topbar .mobile-rightbar-top-toggle:active {
    background: rgba(var(--mobile-dm-accent-rgb), 0.24);
    transform: translateY(1px);
  }

  #main-room .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle,
  #main-private .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle {
    border-color: rgba(47, 179, 68, 0.34);
    background: linear-gradient(155deg, #f3fff5 0%, #dcfce7 100%);
    box-shadow:
      0 8px 18px rgba(22, 101, 52, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.55);
    color: #2f9e44;
  }

  #main-room .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle .ti,
  #main-private .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle .ti {
    font-size: 18px;
    color: #2f9e44;
    filter: drop-shadow(0 1px 2px rgba(34, 139, 56, 0.3));
  }

  #main-room .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle:active,
  #main-private .topbar .mobile-rightbar-top-toggle.is-mobile-back-toggle:active {
    background: linear-gradient(155deg, #ecfdf1 0%, #d1fae5 100%);
    transform: translateY(1px);
  }

  .group-chat .main-panel>.general-notice.alert.alert-important,
  .private-chat .main-panel>.general-notice.alert.alert-important {
    margin-bottom: 4px !important;
    padding: 6px 34px 6px 10px !important;
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.25;
  }

  #main-room #room-notice-class.alert.alert-important,
  #main-private #room-notice-class.alert.alert-important {
    margin-bottom: 4px !important;
    padding: 6px 30px 6px 10px !important;
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.25;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important .d-flex,
  .private-chat .main-panel>.general-notice.alert.alert-important .d-flex,
  #room-notice-class.alert.alert-important .d-flex {
    align-items: flex-start;
    gap: 0.25rem;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important p,
  .private-chat .main-panel>.general-notice.alert.alert-important p,
  #room-notice-class.alert.alert-important p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important .general-notice-message>*,
  .private-chat .main-panel>.general-notice.alert.alert-important .general-notice-message>*,
  #room-notice-class.alert.alert-important #room-notice-message>* {
    margin-top: 0;
    margin-bottom: 0;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important h1,
  .group-chat .main-panel>.general-notice.alert.alert-important h2,
  .group-chat .main-panel>.general-notice.alert.alert-important h3,
  .group-chat .main-panel>.general-notice.alert.alert-important h4,
  .group-chat .main-panel>.general-notice.alert.alert-important h5,
  .group-chat .main-panel>.general-notice.alert.alert-important h6,
  .private-chat .main-panel>.general-notice.alert.alert-important h1,
  .private-chat .main-panel>.general-notice.alert.alert-important h2,
  .private-chat .main-panel>.general-notice.alert.alert-important h3,
  .private-chat .main-panel>.general-notice.alert.alert-important h4,
  .private-chat .main-panel>.general-notice.alert.alert-important h5,
  .private-chat .main-panel>.general-notice.alert.alert-important h6,
  #room-notice-class.alert.alert-important h1,
  #room-notice-class.alert.alert-important h2,
  #room-notice-class.alert.alert-important h3,
  #room-notice-class.alert.alert-important h4,
  #room-notice-class.alert.alert-important h5,
  #room-notice-class.alert.alert-important h6 {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important ul,
  .group-chat .main-panel>.general-notice.alert.alert-important ol,
  .private-chat .main-panel>.general-notice.alert.alert-important ul,
  .private-chat .main-panel>.general-notice.alert.alert-important ol,
  #room-notice-class.alert.alert-important ul,
  #room-notice-class.alert.alert-important ol {
    margin: 0;
    padding-left: 1rem;
    line-height: inherit;
  }

  #room-notice-class.alert.alert-important .btn-close {
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    padding: 4px;
    transform: scale(0.78);
    opacity: 0.86;
  }

  .group-chat .main-panel .room-notice,
  .private-chat .main-panel .room-notice {
    display: block;
    margin: 0;
    padding: 0;
  }

  .mobile-dm-bubble-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.35);
  }

  .mobile-dm-bubble-count[hidden] {
    display: none !important;
  }

  .mobile-dm-bubble-panel {
    position: fixed;
    top: 56px;
    right: 8px;
    width: min(340px, calc(100vw - 16px));
    z-index: 1041;
  }

  .mobile-dm-bubble-panel[hidden] {
    display: none !important;
  }

  .mobile-dm-bubble-panel-inner {
    border-radius: 18px;
    border: 1px solid var(--mobile-dm-border);
    background: linear-gradient(170deg,
        var(--mobile-dm-surface),
        var(--mobile-dm-surface-2));
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 8px;
  }

  .mobile-dm-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 2px 8px;
  }

  .mobile-dm-bubble-title {
    font-size: 1.45rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--mobile-dm-text);
    letter-spacing: 0.01em;
  }

  .mobile-dm-bubble-head-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-dm-bubble-head-btn .ti {
    font-size: 16px;
    line-height: 1;
  }

  .mobile-dm-bubble-head-btn:active {
    background: rgba(var(--mobile-dm-accent-rgb), 0.2);
    transform: translateY(1px);
  }

  .mobile-dm-bubble-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.12);
  }

  .mobile-dm-bubble-search .ti {
    color: var(--mobile-dm-muted);
    font-size: 14px;
    line-height: 1;
  }

  #mobile-dm-bubble-search {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--mobile-dm-text);
    font-size: 13px;
    padding: 0;
  }

  .mobile-dm-bubble-search:focus-within {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.5);
    background: rgba(var(--mobile-dm-accent-rgb), 0.12);
  }

  #mobile-dm-bubble-search::placeholder {
    color: var(--mobile-dm-muted);
  }

  .mobile-dm-bubble-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 2px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-dm-bubble-filters::-webkit-scrollbar {
    display: none;
  }

  .mobile-dm-bubble-filter {
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 11px;
  }

  .mobile-dm-bubble-filter.is-active {
    color: #fff;
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.55);
    background: linear-gradient(180deg,
        rgba(var(--mobile-dm-accent-rgb), 1),
        rgba(var(--mobile-dm-accent-rgb), 0.84));
  }

  .mobile-dm-bubble-filter:active {
    transform: translateY(1px);
  }

  .mobile-dm-bubble-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc((var(--mobile-dm-row-height, 70px) * 3) + 16px);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 2px;
  }

  .mobile-dm-bubble-recent-list::-webkit-scrollbar {
    width: 6px;
  }

  .mobile-dm-bubble-recent-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.45);
  }

  .mobile-dm-conversation-row {
    position: relative;
  }

  .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 44px;
  }

  .mobile-dm-conversation-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
  }

  .mobile-dm-conversation-menu-toggle {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-dm-conversation-menu-toggle .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-dm-conversation-actions.show .mobile-dm-conversation-menu-toggle,
  .mobile-dm-conversation-menu-toggle:active {
    color: var(--mobile-dm-accent-strong);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.4);
    background: rgba(var(--mobile-dm-accent-rgb), 0.16);
  }

  .mobile-dm-avatar-btn {
    position: relative;
    width: 100%;
    min-height: var(--mobile-dm-row-height, 70px);
    border: 1px solid transparent;
    padding: 10px 8px;
    border-radius: 13px;
    background: transparent;
    color: var(--mobile-dm-text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition:
      background-color 0.18s ease,
      border-color 0.18s ease,
      transform 0.12s ease;
  }

  .mobile-dm-avatar-wrap {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
  }

  .mobile-dm-avatar-btn img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  }

  .mobile-dm-conversation-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-dm-conversation-name-row,
  .mobile-dm-conversation-sub-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .mobile-dm-conversation-name {
    min-width: 0;
    color: var(--mobile-dm-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-conversation-time {
    flex: 0 0 auto;
    color: var(--mobile-dm-muted);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
  }

  .mobile-dm-conversation-preview {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--mobile-dm-muted);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-open-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
  }

  .mobile-dm-open-icon .ti {
    font-size: 12px;
    line-height: 1;
  }

  .mobile-dm-avatar-btn:hover,
  .mobile-dm-avatar-btn:active {
    background: var(--mobile-dm-accent-soft);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.3);
    transform: translateY(1px);
  }

  .mobile-dm-avatar-btn:hover .mobile-dm-open-icon,
  .mobile-dm-avatar-btn:active .mobile-dm-open-icon,
  .mobile-dm-avatar-btn.is-active .mobile-dm-open-icon {
    color: var(--mobile-dm-accent-strong);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.4);
    background: rgba(var(--mobile-dm-accent-rgb), 0.16);
  }

  .mobile-dm-avatar-btn.is-unread {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.32);
    background: rgba(var(--mobile-dm-accent-rgb), 0.08);
  }

  .mobile-dm-avatar-btn.is-unread img {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.76);
  }

  .mobile-dm-avatar-btn.is-active {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.5);
    background: rgba(var(--mobile-dm-accent-rgb), 0.18);
  }

  .mobile-dm-avatar-btn.is-active .mobile-dm-conversation-name {
    color: var(--mobile-dm-accent-strong);
  }

  .mobile-dm-avatar-btn.is-active img {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.82);
  }

  .mobile-dm-avatar-status {
    position: absolute;
    left: 1px;
    bottom: 1px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 2px solid var(--mobile-dm-surface);
    background: #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.45);
  }

  .mobile-dm-bubble-empty {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--mobile-dm-muted);
    padding: 8px 0;
  }

  .dm-loading-indicator {
    width: 100%;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--mobile-dm-muted);
    font-size: 12px;
    padding: 8px 0;
  }

  .dm-loading-spinner {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    border: 2px solid rgba(100, 116, 139, 0.3);
    border-top-color: rgba(var(--mobile-dm-accent-rgb), 0.95);
    animation: dmLoadingSpin 0.85s linear infinite;
  }

  @keyframes dmLoadingSpin {
    to {
      transform: rotate(360deg);
    }
  }

  .mobile-dm-mini-chat {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--mobile-bottom-nav-space, 60px) + env(safe-area-inset-bottom, 0px) + 8px);
    border-radius: 16px;
    border: 1px solid var(--mobile-dm-border);
    background: linear-gradient(180deg,
        var(--mobile-dm-surface),
        var(--mobile-dm-surface-2));
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
    z-index: 1040;
    overflow: hidden;
  }

  .mobile-dm-mini-chat[hidden] {
    display: none !important;
  }

  .mobile-dm-mini-chat.is-minimized {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .mobile-dm-mini-chat.is-minimized .mobile-dm-mini-chat-body,
  .mobile-dm-mini-chat.is-minimized .mobile-dm-mini-chat-form {
    display: none;
  }

  #mobile-dm-mini-name {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  #mobile-dm-mini-name .mobile-dm-mini-name-text {
    display: block;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #mobile-dm-mini-name .guest-user-badge {
    margin-left: 0;
    margin-top: 0;
  }

  .mobile-dm-mini-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--mobile-dm-border);
    background: linear-gradient(160deg,
        var(--mobile-dm-accent-soft),
        rgba(var(--mobile-dm-accent-rgb), 0.06));
  }

  .mobile-dm-mini-chat-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #mobile-dm-mini-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(var(--mobile-dm-accent-rgb), 0.42);
  }

  .mobile-dm-mini-chat-meta {
    min-width: 0;
  }

  .mobile-dm-mini-chat-name {
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mobile-dm-text);
  }

  .mobile-dm-mini-chat-sub {
    font-size: 10px;
    color: var(--mobile-dm-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-mini-chat-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
  }

  .mobile-dm-mini-actions-menu {
    display: inline-flex;
    align-items: center;
  }

  .mobile-dm-mini-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-dm-mini-btn:active {
    background: rgba(var(--mobile-dm-accent-rgb), 0.2);
  }

  .mobile-dm-mini-btn .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-dm-mini-chat-body {
    max-height: 300px;
    min-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 12px;
    background: rgba(148, 163, 184, 0.08);
  }

  .mobile-dm-mini-msg {
    max-width: 100%;
    width: 100%;
    align-self: flex-start;
    display: flex;
    align-items: flex-end;
    gap: 7px;
  }

  .mobile-dm-mini-avatar-wrap {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    overflow: hidden;
    align-self: flex-end;
    background: rgba(148, 163, 184, 0.2);
  }

  .mobile-dm-mini-msg-avatar {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }

  .mobile-dm-mini-msg-main {
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .mobile-dm-mini-msg-author {
    font-size: 10px;
    line-height: 1.1;
    color: var(--mobile-dm-muted);
    padding: 0 4px;
  }

  .mobile-dm-mini-msg-bubble {
    display: inline-block;
    width: auto;
    min-width: 4.5rem;
    max-width: 100%;
    padding: 8px 11px;
    border-radius: 18px;
    border: 1px solid var(--mobile-dm-border);
    background: var(--mobile-dm-surface);
    color: var(--mobile-dm-text);
  }

  .mobile-dm-mini-msg.has-media .mobile-dm-mini-msg-bubble {
    display: block;
    padding: 6px;
    max-width: min(240px, 74vw);
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-grp,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-duo,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-sgl,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-video-block {
    max-width: 100%;
    margin: 0;
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-sgl img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-duo img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-grp img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .video-thumb,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-gif img {
    max-width: 100%;
    border-radius: 12px;
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .file-caption {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.3;
  }

  .mobile-dm-mini-msg-text {
    min-width: 0;
    display: block;
    font-size: 12px;
    line-height: 1.36;
    white-space: pre-line;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .mobile-dm-mini-msg-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
  }

  .mobile-dm-mini-msg-time,
  .mobile-dm-mini-msg-since,
  .mobile-dm-mini-msg-status {
    color: var(--mobile-dm-muted);
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.88;
  }

  .mobile-dm-mini-msg.is-own {
    align-self: flex-end;
    flex-direction: row-reverse;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-main {
    align-items: stretch;
    margin-left: auto;
    max-width: 100%;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    align-self: flex-end;
    width: auto;
    min-width: 4.5rem;
    max-width: 100%;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-author {
    display: none;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    background: var(--mobile-dm-accent-soft);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.42);
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-time,
  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-since,
  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-status {
    color: rgba(var(--mobile-dm-accent-rgb), 0.92);
  }

  .mobile-dm-mini-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--mobile-dm-border);
    background: var(--mobile-dm-surface-2);
  }

  .mobile-dm-mini-attach {
    width: 33px;
    height: 33px;
    min-width: 33px;
    border: 1px solid var(--mobile-dm-border);
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-dm-mini-attach .ti {
    font-size: 14px;
    line-height: 1;
  }

  #mobile-dm-mini-chat.is-uploading-media .mobile-dm-mini-attach,
  #mobile-dm-mini-chat.is-uploading-media .mobile-dm-mini-send {
    opacity: 0.55;
    pointer-events: none;
  }

  #mobile-dm-mini-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.52);
    border-radius: 14px;
    min-height: 34px;
    max-height: 180px;
    padding: 7px 11px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--mobile-dm-text);
    background: var(--mobile-dm-surface);
    resize: none;
    overflow-y: hidden;
    white-space: pre-wrap;
  }

  #mobile-dm-mini-input::placeholder {
    color: var(--mobile-dm-muted);
  }

  #mobile-dm-mini-input:focus {
    outline: 0;
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.64);
    box-shadow: 0 0 0 3px rgba(var(--mobile-dm-accent-rgb), 0.2);
  }

  .mobile-dm-mini-send {
    width: 33px;
    height: 33px;
    min-width: 33px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg,
        rgba(var(--mobile-dm-accent-rgb), 1),
        rgba(var(--mobile-dm-accent-rgb), 0.84));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--mobile-dm-accent-rgb), 0.38);
  }

  .mobile-dm-mini-send .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-dm-mini-empty {
    text-align: center;
    color: var(--mobile-dm-muted);
    font-size: 12px;
    padding: 8px;
  }

  .mobile-dm-bubble-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: rgba(2, 6, 23, 0.26);
    margin: 0;
    padding: 0;
    z-index: 1034;
  }

  .mobile-dm-bubble-backdrop[hidden] {
    display: none !important;
  }

  .rtl .mobile-dm-bubble-panel {
    right: auto;
    left: 8px;
  }

  .rtl .mobile-dm-conversation-actions {
    right: auto;
    left: 8px;
  }

  .rtl .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 8px;
    padding-left: 44px;
  }

  .rtl .mobile-dm-mini-chat {
    direction: rtl;
  }

  #main-private .topbar {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    position: relative;
  }

  #main-private .topbar .me-auto {
    min-width: 0;
    flex: 1 1 auto !important;
    overflow: hidden;
  }

  #main-private .topbar .top-channel-name {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #main-private .topbar .dating-cta--top {
    flex: 0 0 auto;
    min-width: 40px;
    max-width: none;
    padding: 7px 8px;
  }

  #main-private .topbar .dating-cta--top small {
    display: none;
  }

  #main-private .topbar .dating-cta--top .icon-wrap,
  #main-private .topbar .dating-cta--top .icon-wrap img {
    display: inline-flex;
    visibility: visible;
    opacity: 1;
  }

  .mobile-bottom-nav .icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-bottom-nav .noti-count {
    position: absolute;
    top: -6px;
    right: -8px;
  }

  .dating-cta {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 56px;
    padding: 4px 6px;
    border-radius: 12px;
    background: linear-gradient(180deg, #f43f5e, #e11d48);
    color: #fff;
    border: 1px solid #be123c;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35);
    animation: dating-glow 2.6s ease-in-out infinite;
  }

  .dating-cta .icon-wrap {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .dating-cta .icon-wrap img {
    display: block;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .dating-cta i {
    font-size: 21px;
    animation: dating-bob 1.8s ease-in-out infinite;
  }

  .dating-cta small {
    font-size: 11px;
    margin-top: 2px;
    font-weight: 700;
    color: #fff;
  }

  .topbar .dating-cta {
    min-width: 52px;
    padding: 7px 10px;
    background: linear-gradient(180deg, #f43f5e, #e11d48) !important;
    border: 1px solid #be123c !important;
    box-shadow: 0 2px 8px rgba(225, 29, 72, 0.35) !important;
    color: #fff !important;
    gap: 6px;
    flex-direction: row;
    align-items: center;
    min-width: 0;
    white-space: nowrap;
    line-height: 1.2;
    min-height: 32px;
  }

  .topbar .dating-cta small {
    font-size: 11px;
    margin-top: 0;
    line-height: 1.2;
    display: block;
    padding: 1px 0;
  }

  .dark .dating-cta,
  .trueblue .dating-cta,
  .dark .topbar .dating-cta,
  .trueblue .topbar .dating-cta {
    color: #fff !important;
  }

  .dark .dating-cta small,
  .trueblue .dating-cta small {
    color: #fff !important;
  }

  .theme-light .dating-cta,
  .theme-light .topbar .dating-cta {
    color: #fff !important;
  }

  .theme-light .dating-cta small {
    color: #fff !important;
  }

  @keyframes dating-bob {
    0% {
      transform: translateY(0) scale(1);
    }

    50% {
      transform: translateY(-2px) scale(1.08);
    }

    100% {
      transform: translateY(0) scale(1);
    }
  }

  @keyframes dating-glow {
    0% {
      box-shadow: 0 2px 8px rgba(225, 29, 72, 0.28);
    }

    50% {
      box-shadow: 0 5px 14px rgba(225, 29, 72, 0.5);
    }

    100% {
      box-shadow: 0 2px 8px rgba(225, 29, 72, 0.28);
    }
  }

  @media (prefers-reduced-motion: reduce) {

    .dating-cta,
    .dating-cta i {
      animation: none;
    }
  }

  .mobile-hidden {
    display: none !important;
  }

  .page-content-wrapper {
    padding-bottom: calc(var(--mobile-bottom-nav-space, 60px) + env(safe-area-inset-bottom, 0px));
  }

  /* Chat tabs already reserve bottom-nav space via .main-panel height.
     Avoid double spacing between composer and mobile nav/toggle area. */
  #main-room>.page-content-wrapper,
  #main-private>.page-content-wrapper {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .main-panel {
    height: calc(var(--app-vh, (var(--vh, 1vh) * 100)) - 50px - var(--mobile-bottom-nav-space, 60px) - env(safe-area-inset-bottom, 0px));
  }

  .action-list {
    padding-bottom: calc((var(--mobile-bottom-nav-space, 60px) + 10px) + env(safe-area-inset-bottom, 0px));
  }

  .room-users-row,
  .group-users-row {
    padding-bottom: calc((var(--mobile-bottom-nav-space, 60px) + 10px) + env(safe-area-inset-bottom, 0px));
  }

  .user-list-load-more,
  .user-list-load-all {
    margin-bottom: 8px;
  }
}

@media (min-width: 992px) {
  :root {
    --mobile-dm-surface: var(--surface-bg, #ffffff);
    --mobile-dm-surface-2: rgba(248, 250, 252, 0.96);
    --mobile-dm-border: rgba(148, 163, 184, 0.35);
    --mobile-dm-text: var(--default-text-color, #0f172a);
    --mobile-dm-muted: var(--muted-text-color, #64748b);
    --mobile-dm-accent-rgb: var(--tblr-primary-rgb, 32, 107, 196);
    --mobile-dm-accent-soft: rgba(var(--mobile-dm-accent-rgb), 0.14);
    --mobile-dm-accent-strong: rgb(var(--mobile-dm-accent-rgb));
    --mobile-dm-row-height: 70px;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important,
  .private-chat .main-panel>.general-notice.alert.alert-important {
    margin-bottom: 4px !important;
    padding: 6px 34px 6px 10px !important;
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.25;
  }

  #main-room #room-notice-class.alert.alert-important,
  #main-private #room-notice-class.alert.alert-important {
    margin-bottom: 4px !important;
    padding: 6px 30px 6px 10px !important;
    border-left-width: 3px;
    border-radius: 8px;
    box-shadow: none;
    font-size: 12px;
    line-height: 1.25;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important .d-flex,
  .private-chat .main-panel>.general-notice.alert.alert-important .d-flex,
  #room-notice-class.alert.alert-important .d-flex {
    align-items: flex-start;
    gap: 0.25rem;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important p,
  .private-chat .main-panel>.general-notice.alert.alert-important p,
  #room-notice-class.alert.alert-important p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important .general-notice-message>*,
  .private-chat .main-panel>.general-notice.alert.alert-important .general-notice-message>*,
  #room-notice-class.alert.alert-important #room-notice-message>* {
    margin-top: 0;
    margin-bottom: 0;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important h1,
  .group-chat .main-panel>.general-notice.alert.alert-important h2,
  .group-chat .main-panel>.general-notice.alert.alert-important h3,
  .group-chat .main-panel>.general-notice.alert.alert-important h4,
  .group-chat .main-panel>.general-notice.alert.alert-important h5,
  .group-chat .main-panel>.general-notice.alert.alert-important h6,
  .private-chat .main-panel>.general-notice.alert.alert-important h1,
  .private-chat .main-panel>.general-notice.alert.alert-important h2,
  .private-chat .main-panel>.general-notice.alert.alert-important h3,
  .private-chat .main-panel>.general-notice.alert.alert-important h4,
  .private-chat .main-panel>.general-notice.alert.alert-important h5,
  .private-chat .main-panel>.general-notice.alert.alert-important h6,
  #room-notice-class.alert.alert-important h1,
  #room-notice-class.alert.alert-important h2,
  #room-notice-class.alert.alert-important h3,
  #room-notice-class.alert.alert-important h4,
  #room-notice-class.alert.alert-important h5,
  #room-notice-class.alert.alert-important h6 {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
  }

  .group-chat .main-panel>.general-notice.alert.alert-important ul,
  .group-chat .main-panel>.general-notice.alert.alert-important ol,
  .private-chat .main-panel>.general-notice.alert.alert-important ul,
  .private-chat .main-panel>.general-notice.alert.alert-important ol,
  #room-notice-class.alert.alert-important ul,
  #room-notice-class.alert.alert-important ol {
    margin: 0;
    padding-left: 1rem;
    line-height: inherit;
  }

  #room-notice-class.alert.alert-important .btn-close {
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    padding: 4px;
    transform: scale(0.78);
    opacity: 0.86;
  }

  .group-chat .main-panel .room-notice,
  .private-chat .main-panel .room-notice {
    display: block;
    margin: 0;
    padding: 0;
  }

  html.theme-dark,
  html.dark,
  body.theme-dark,
  body.dark,
  html.theme-trueblue,
  html.trueblue,
  body.theme-trueblue,
  body.trueblue {
    --mobile-dm-surface: rgba(15, 23, 42, 0.96);
    --mobile-dm-surface-2: rgba(30, 41, 59, 0.94);
    --mobile-dm-border: rgba(125, 211, 252, 0.3);
    --mobile-dm-text: #e2e8f0;
    --mobile-dm-muted: #a5b4cc;
    --mobile-dm-accent-soft: rgba(var(--mobile-dm-accent-rgb), 0.22);
  }

  .navbar.topbar .topbar-beskeder-trigger.is-active {
    background: transparent !important;
    box-shadow: none !important;
  }

  .navbar.topbar .topbar-beskeder-trigger.mobile-hidden {
    position: relative;
    margin-bottom: 8px !important;
    min-width: 50px !important;
    width: auto;
    height: auto;
    min-height: auto;
    padding: 4px !important;
    border-radius: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none;
    z-index: auto;
    right: auto;
    bottom: auto;
    left: auto;
    transform: none;
  }

  .navbar.topbar .topbar-beskeder-trigger.mobile-hidden:hover,
  .navbar.topbar .topbar-beskeder-trigger.mobile-hidden:focus,
  .navbar.topbar .topbar-beskeder-trigger.mobile-hidden:active,
  .navbar.topbar .topbar-beskeder-trigger.mobile-hidden.show {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .navbar.topbar .topbar-beskeder-trigger .topbar-beskeder-icon-img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    display: block;
  }

  .navbar.topbar .topbar-beskeder-trigger .topbar-beskeder-label {
    display: block;
    line-height: 1.1;
    white-space: nowrap;
    margin-top: 1px !important;
  }

  #main-room .topbar .nav-item.dropdown.me-3.mobile-hidden,
  #main-private .topbar .nav-item.dropdown.me-3.mobile-hidden {
    margin-bottom: 8px !important;
    min-width: 50px;
    padding: 4px;
  }

  #main-room .topbar .nav-item.dropdown.me-3.mobile-hidden>.nav-link,
  #main-private .topbar .nav-item.dropdown.me-3.mobile-hidden>.nav-link {
    width: 100%;
    min-width: 50px;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .mobile-dm-bubble-backdrop {
    position: fixed;
    inset: 0;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 0;
    z-index: 1034;
  }

  body.mobile-dm-bubble-open .mobile-dm-bubble-backdrop {
    background: rgba(2, 6, 23, 0.18);
  }

  .mobile-dm-bubble-backdrop[hidden] {
    display: none !important;
  }

  .mobile-dm-bubble-panel {
    position: fixed;
    top: 56px;
    right: calc(var(--chat-right-panel-width, 20rem) + 12px);
    width: min(360px,
        calc(100vw - var(--chat-right-panel-width, 20rem) - 24px));
    z-index: 1041;
  }

  body.sb-rightnav-toggled .mobile-dm-bubble-panel {
    right: 12px;
    width: min(360px, calc(100vw - 24px));
  }

  .mobile-dm-bubble-panel[hidden] {
    display: none !important;
  }

  .mobile-dm-bubble-panel-inner {
    border-radius: 18px;
    border: 1px solid var(--mobile-dm-border);
    background: linear-gradient(170deg,
        var(--mobile-dm-surface),
        var(--mobile-dm-surface-2));
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 8px;
  }

  .mobile-dm-bubble-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 2px 8px;
  }

  .mobile-dm-bubble-title {
    font-size: 1.45rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--mobile-dm-text);
    letter-spacing: 0.01em;
  }

  .mobile-dm-bubble-head-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-dm-bubble-head-btn .ti {
    font-size: 16px;
    line-height: 1;
  }

  .mobile-dm-bubble-search {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.12);
  }

  .mobile-dm-bubble-search .ti {
    color: var(--mobile-dm-muted);
    font-size: 14px;
    line-height: 1;
  }

  #mobile-dm-bubble-search {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--mobile-dm-text);
    font-size: 13px;
    padding: 0;
  }

  #mobile-dm-bubble-search::placeholder {
    color: var(--mobile-dm-muted);
  }

  .mobile-dm-bubble-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 2px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mobile-dm-bubble-filters::-webkit-scrollbar {
    display: none;
  }

  .mobile-dm-bubble-filter {
    flex: 0 0 auto;
    border: 1px solid transparent;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    padding: 7px 11px;
  }

  .mobile-dm-bubble-filter.is-active {
    color: #fff;
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.55);
    background: linear-gradient(180deg,
        rgba(var(--mobile-dm-accent-rgb), 1),
        rgba(var(--mobile-dm-accent-rgb), 0.84));
  }

  .mobile-dm-bubble-recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(320px, 52vh);
    overflow-y: auto;
    scrollbar-width: thin;
    padding: 2px;
  }

  .mobile-dm-conversation-row {
    position: relative;
  }

  .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 44px;
  }

  .mobile-dm-conversation-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
  }

  .mobile-dm-conversation-menu-toggle {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-dm-conversation-menu-toggle .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-dm-conversation-actions.show .mobile-dm-conversation-menu-toggle,
  .mobile-dm-conversation-menu-toggle:active {
    color: var(--mobile-dm-accent-strong);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.4);
    background: rgba(var(--mobile-dm-accent-rgb), 0.16);
  }

  .mobile-dm-avatar-btn {
    position: relative;
    width: 100%;
    min-height: var(--mobile-dm-row-height, 70px);
    border: 1px solid transparent;
    padding: 10px 8px;
    border-radius: 13px;
    background: transparent;
    color: var(--mobile-dm-text);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition:
      background-color 0.18s ease,
      border-color 0.18s ease,
      transform 0.12s ease;
  }

  .mobile-dm-avatar-wrap {
    position: relative;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
  }

  .mobile-dm-avatar-btn img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
  }

  .mobile-dm-avatar-status {
    position: absolute;
    left: 1px;
    bottom: 1px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 2px solid var(--mobile-dm-surface);
    background: #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.45);
  }

  .mobile-dm-conversation-meta {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-dm-conversation-name-row,
  .mobile-dm-conversation-sub-row {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .mobile-dm-conversation-name {
    min-width: 0;
    color: var(--mobile-dm-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-conversation-time {
    flex: 0 0 auto;
    color: var(--mobile-dm-muted);
    font-size: 11px;
    line-height: 1;
    font-weight: 600;
    white-space: nowrap;
  }

  .mobile-dm-conversation-preview {
    min-width: 0;
    flex: 1 1 auto;
    color: var(--mobile-dm-muted);
    font-size: 11px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-open-icon {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(148, 163, 184, 0.14);
    color: var(--mobile-dm-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
  }

  .mobile-dm-open-icon .ti {
    font-size: 12px;
    line-height: 1;
  }

  .mobile-dm-avatar-btn:hover,
  .mobile-dm-avatar-btn:active {
    background: var(--mobile-dm-accent-soft);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.3);
    transform: translateY(1px);
  }

  .mobile-dm-avatar-btn.is-active {
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.5);
    background: rgba(var(--mobile-dm-accent-rgb), 0.18);
  }

  .mobile-dm-bubble-empty {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: var(--mobile-dm-muted);
    padding: 8px 0;
  }

  .mobile-dm-mini-chat {
    position: fixed;
    left: auto;
    right: calc(var(--chat-right-panel-width, 20rem) + 12px);
    width: min(360px,
        calc(100vw - var(--chat-right-panel-width, 20rem) - 24px));
    bottom: 12px;
    border-radius: 16px;
    border: 1px solid var(--mobile-dm-border);
    background: linear-gradient(180deg,
        var(--mobile-dm-surface),
        var(--mobile-dm-surface-2));
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.22);
    z-index: 1040;
    overflow: hidden;
  }

  body.sb-rightnav-toggled .mobile-dm-mini-chat {
    right: 12px;
    width: min(360px, calc(100vw - 24px));
  }

  .mobile-dm-mini-chat[hidden] {
    display: none !important;
  }

  .mobile-dm-mini-chat.is-minimized {
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .mobile-dm-mini-chat.is-minimized .mobile-dm-mini-chat-body,
  .mobile-dm-mini-chat.is-minimized .mobile-dm-mini-chat-form {
    display: none;
  }

  .mobile-dm-mini-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid var(--mobile-dm-border);
    background: linear-gradient(160deg,
        var(--mobile-dm-accent-soft),
        rgba(var(--mobile-dm-accent-rgb), 0.06));
  }

  .mobile-dm-mini-chat-user {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }

  #mobile-dm-mini-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
    border: 2px solid rgba(var(--mobile-dm-accent-rgb), 0.42);
  }

  .mobile-dm-mini-chat-meta {
    min-width: 0;
  }

  .mobile-dm-mini-chat-name {
    min-width: 0;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--mobile-dm-text);
  }

  .mobile-dm-mini-chat-sub {
    font-size: 10px;
    color: var(--mobile-dm-muted);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-dm-mini-chat-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
  }

  .mobile-dm-mini-actions-menu {
    display: inline-flex;
    align-items: center;
  }

  .mobile-dm-mini-btn {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border);
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-dm-mini-chat-body {
    max-height: 300px;
    min-height: 220px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 10px 12px;
    background: rgba(148, 163, 184, 0.08);
  }

  .mobile-dm-mini-msg {
    max-width: 100%;
    width: 100%;
    align-self: flex-start;
    display: flex;
    align-items: flex-end;
    gap: 7px;
  }

  .mobile-dm-mini-avatar-wrap {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    overflow: hidden;
    align-self: flex-end;
    background: rgba(148, 163, 184, 0.2);
  }

  .mobile-dm-mini-msg-avatar {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
  }

  .mobile-dm-mini-msg-main {
    max-width: 100%;
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }

  .mobile-dm-mini-msg-author {
    font-size: 10px;
    line-height: 1.1;
    color: var(--mobile-dm-muted);
    padding: 0 4px;
  }

  .mobile-dm-mini-msg-bubble {
    display: inline-block;
    width: auto;
    min-width: 4.5rem;
    max-width: 100%;
    padding: 8px 11px;
    border-radius: 18px;
    border: 1px solid var(--mobile-dm-border);
    background: var(--mobile-dm-surface);
    color: var(--mobile-dm-text);
  }

  .mobile-dm-mini-msg-text {
    min-width: 0;
    display: block;
    font-size: 12px;
    line-height: 1.36;
    white-space: pre-line;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .mobile-dm-mini-msg-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 4px;
  }

  .mobile-dm-mini-msg-time,
  .mobile-dm-mini-msg-since,
  .mobile-dm-mini-msg-status {
    color: var(--mobile-dm-muted);
    font-size: 10px;
    line-height: 1;
    white-space: nowrap;
    opacity: 0.88;
  }

  .mobile-dm-mini-msg.is-own {
    align-self: flex-end;
    flex-direction: row-reverse;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-main {
    align-items: stretch;
    margin-left: auto;
    max-width: 100%;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    align-self: flex-end;
    width: auto;
    min-width: 4.5rem;
    max-width: 100%;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-author {
    display: none;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    background: var(--mobile-dm-accent-soft);
    border-color: rgba(var(--mobile-dm-accent-rgb), 0.42);
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-time,
  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-since,
  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-status {
    color: rgba(var(--mobile-dm-accent-rgb), 0.92);
  }

  .mobile-dm-mini-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px;
    border-top: 1px solid var(--mobile-dm-border);
    background: var(--mobile-dm-surface-2);
  }

  #mobile-dm-mini-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.52);
    border-radius: 14px;
    min-height: 34px;
    max-height: 180px;
    padding: 7px 11px;
    font-size: 13px;
    line-height: 1.35;
    color: var(--mobile-dm-text);
    background: var(--mobile-dm-surface);
    resize: none;
    overflow-y: hidden;
    white-space: pre-wrap;
  }

  .mobile-dm-mini-send {
    width: 33px;
    height: 33px;
    min-width: 33px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(180deg,
        rgba(var(--mobile-dm-accent-rgb), 1),
        rgba(var(--mobile-dm-accent-rgb), 0.84));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(var(--mobile-dm-accent-rgb), 0.38);
  }

  .mobile-dm-mini-msg.has-media .mobile-dm-mini-msg-bubble {
    display: block;
    padding: 6px;
    max-width: min(260px, 28vw);
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-grp,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-duo,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-sgl,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-video-block {
    max-width: 100%;
    margin: 0;
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-sgl img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-duo img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-img-grp img,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .video-thumb,
  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .chat-gif img {
    max-width: 100%;
    border-radius: 12px;
  }

  .mobile-dm-mini-msg .mobile-dm-mini-msg-bubble .file-caption {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.3;
  }

  .mobile-dm-mini-attach {
    width: 33px;
    height: 33px;
    min-width: 33px;
    border: 1px solid var(--mobile-dm-border);
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb), 0.1);
    color: var(--mobile-dm-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .mobile-dm-mini-attach .ti {
    font-size: 14px;
    line-height: 1;
  }

  #mobile-dm-mini-chat.is-uploading-media .mobile-dm-mini-attach,
  #mobile-dm-mini-chat.is-uploading-media .mobile-dm-mini-send {
    opacity: 0.55;
    pointer-events: none;
  }

  .rtl .mobile-dm-bubble-panel {
    left: calc(var(--chat-right-panel-width, 20rem) + 12px);
    right: auto;
  }

  .rtl .mobile-dm-conversation-actions {
    right: auto;
    left: 8px;
  }

  .rtl .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 8px;
    padding-left: 44px;
  }

  .rtl body.sb-rightnav-toggled .mobile-dm-bubble-panel {
    left: 12px;
  }

  .rtl .mobile-dm-mini-chat {
    direction: rtl;
    left: calc(var(--chat-right-panel-width, 20rem) + 12px);
    right: auto;
  }

  .rtl body.sb-rightnav-toggled .mobile-dm-mini-chat {
    left: 12px;
  }
}

@media (min-width: 992px) {
  .desktop-dm-dock {
    position: fixed;
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: 12px;
    max-width: calc(100vw - 24px - env(safe-area-inset-right, 0px));
    z-index: 2210;
    pointer-events: none;
  }

  .desktop-dm-dock-track {
    display: flex;
    flex-direction: row-reverse;
    align-items: flex-end;
    gap: 10px;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    pointer-events: none;
    scrollbar-width: auto;
  }

  .desktop-dm-dock-track::-webkit-scrollbar {
    height: auto;
  }

  .desktop-dm-dock-track::-webkit-scrollbar-thumb {
    background: transparent;
  }

  .mobile-dm-bubble-panel {
    top: 66px;
    right: max(18px, env(safe-area-inset-right, 0px));
    width: min(340px, calc(100vw - 16px - env(safe-area-inset-right, 0px)));
    z-index: 1060;
  }

  body.sb-rightnav-toggled .mobile-dm-bubble-panel {
    right: max(18px, env(safe-area-inset-right, 0px));
    width: min(340px, calc(100vw - 16px - env(safe-area-inset-right, 0px)));
  }

  .mobile-dm-bubble-panel-inner {
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 18px;
    background: var(--mobile-dm-surface, #ffffff);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 0;
    overflow: hidden;
  }

  .mobile-dm-bubble-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
  }

  .mobile-dm-bubble-title {
    font-size: 1.45rem;
    line-height: 1.1;
    font-weight: 800;
    color: var(--mobile-dm-text, #0f172a);
    letter-spacing: normal;
  }

  .mobile-dm-bubble-head-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.1);
    color: var(--mobile-dm-text, #0f172a);
  }

  .mobile-dm-bubble-search {
    margin: 0 10px 8px;
  }

  .mobile-dm-bubble-filters {
    margin: 0 10px 8px;
  }

  .mobile-dm-bubble-recent-list {
    max-height: 280px;
    padding: 8px;
    gap: 0;
  }

  .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 8px;
  }

  .mobile-dm-conversation-actions {
    position: static;
  }

  .mobile-dm-conversation-menu-toggle {
    display: none;
  }

  .mobile-dm-avatar-btn {
    min-height: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--mobile-dm-text, #0f172a);
    align-items: center;
    padding: 8px;
  }

  .mobile-dm-avatar-wrap {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
  }

  .mobile-dm-avatar-btn img {
    border: 0;
    box-shadow: none;
  }

  .mobile-dm-avatar-status {
    position: absolute;
    left: 1px;
    bottom: 1px;
    width: 11px;
    height: 11px;
    border-radius: 999px;
    border: 2px solid var(--mobile-dm-surface, #ffffff);
    background: #22c55e;
    box-shadow: 0 2px 6px rgba(34, 197, 94, 0.45);
  }

  .mobile-dm-avatar-status.is-away {
    background: #f59e0b;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.45);
  }

  .mobile-dm-avatar-status.is-busy {
    background: #ef4444;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
  }

  .mobile-dm-open-icon {
    display: none;
  }

  .mobile-dm-avatar-btn:hover,
  .mobile-dm-avatar-btn:active {
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.12);
    border-color: transparent;
    transform: none;
  }

  .mobile-dm-avatar-btn.is-active {
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.12);
    border-color: transparent;
  }

  .mobile-dm-conversation-name {
    font-size: 13px;
    font-weight: 700;
  }

  .mobile-dm-conversation-time,
  .mobile-dm-conversation-preview {
    color: var(--mobile-dm-muted, #64748b);
    font-size: 11px;
    font-weight: 400;
  }

  .desktop-dm-chat-window {
    width: 320px;
    height: 430px;
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 14px;
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    pointer-events: auto;
  }

  .desktop-dm-chat-window.has-active-call {
    overflow: visible;
    z-index: 1070;
  }

  .desktop-dm-chat-window .desktop-dm-chat-call-host {
    display: none;
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    width: 100%;
    z-index: 2230;
    pointer-events: auto;
  }

  .desktop-dm-chat-window.has-active-call .desktop-dm-chat-call-host {
    display: block;
  }

  .desktop-dm-chat-window .desktop-dm-chat-call-host .video-call-container {
    margin: 0;
  }

  .desktop-dm-chat-window .mobile-dm-mini-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border-bottom: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
  }

  .desktop-dm-chat-toggle {
    border: 0;
    margin: 0;
    padding: 0;
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar {
    width: 30px;
    height: 30px;
    border: 0;
    display: block;
    border-radius: 999px;
    object-fit: cover;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-wrap {
    position: relative;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 999px;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-status {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 2px solid var(--panel-bg, var(--mobile-dm-surface, #ffffff));
    background: #9ca3af;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.1);
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-status.is-online {
    background: #22c55e;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-status.is-away {
    background: #f59e0b;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-status.is-busy {
    background: #ef4444;
  }

  .desktop-dm-chat-window .desktop-dm-mini-avatar-status.is-offline {
    background: #9ca3af;
  }

  .desktop-dm-chat-window .mobile-dm-mini-chat-sub {
    font-size: 11px;
  }

  .desktop-dm-chat-window .mobile-dm-mini-chat-actions {
    margin-left: 6px;
    gap: 6px;
    display: inline-flex;
    align-items: center;
  }

  .desktop-dm-chat-window .desktop-dm-chat-actions-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
  }

  .desktop-dm-chat-window .desktop-dm-chat-menu-toggle {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--mobile-dm-surface, var(--dark-bg, #ffffff));
    color: var(--mobile-dm-muted, var(--muted-text-color, #64748b));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  .desktop-dm-chat-window .desktop-dm-chat-menu-toggle:hover,
  .desktop-dm-chat-window .desktop-dm-chat-menu-toggle:focus {
    color: var(--mobile-dm-text, var(--default-text-color, #1f2937));
    border-color: var(--mobile-dm-border, rgba(29, 78, 216, 0.35));
    background: var(--mobile-dm-soft,
        var(--received-background, rgba(29, 78, 216, 0.12)));
  }

  .desktop-dm-chat-window .desktop-dm-chat-menu-toggle .ti {
    font-size: 14px;
    line-height: 1;
  }

  .desktop-dm-chat-window .mobile-dm-mini-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.08);
    color: var(--mobile-dm-text, #0f172a);
  }

  .desktop-dm-chat-window .mobile-dm-mini-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.05);
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg {
    max-width: 100%;
    width: 100%;
    align-self: flex-start;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 7px;
  }

  .desktop-dm-chat-window .mobile-dm-mini-avatar-wrap {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    overflow: hidden;
    align-self: flex-end;
    background: rgba(148, 163, 184, 0.2);
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-main {
    max-width: calc(100% - 8px);
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .desktop-dm-day-stamp {
    display: flex;
    justify-content: center;
    margin: 8px 0 10px;
  }

  .desktop-dm-day-stamp span {
    font-size: 11px;
    font-weight: 600;
    color: var(--mobile-dm-muted, #64748b);
    padding: 2px 10px;
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.08);
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-author {
    display: none;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    width: auto;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 16px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--mobile-dm-surface, #ffffff);
    color: var(--mobile-dm-text, #0f172a);
    font-size: 13px;
    line-height: 1.45;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    overflow: visible;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .message-html,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-text,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .chat-txt,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .chat-code,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .chat-link,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .chat-link-block,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .link-meta-desc,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .file-caption,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble p,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble a {
    display: block;
    max-width: 100%;
    min-width: 0;
    white-space: pre-line;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    overflow-wrap: break-word;
    word-break: normal;
    line-height: 1.45;
    letter-spacing: normal;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .message-html {
    overflow: visible;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .mobile-dm-mini-msg-content *,
  .desktop-dm-chat-window .mobile-dm-mini-msg-bubble .message-html * {
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    line-height: inherit;
    letter-spacing: normal;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-meta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
    padding: 0 4px;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-time,
  .desktop-dm-chat-window .mobile-dm-mini-msg-since,
  .desktop-dm-chat-window .mobile-dm-mini-msg-status {
    color: var(--mobile-dm-muted, #64748b);
    font-size: 11px;
    line-height: 1;
    opacity: 1;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg-time {
    display: block;
    margin-top: 3px;
    padding: 0 4px;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg.is-own {
    align-self: flex-end;
    flex-direction: row;
    justify-content: flex-end;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg.is-own .mobile-dm-mini-avatar-wrap {
    display: none;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-main {
    max-width: 100%;
    align-items: flex-end;
    margin-left: auto;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    align-self: flex-end;
    width: auto;
    max-width: 100%;
  }

  .desktop-dm-chat-window .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.14);
    border-color: var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
  }

  .desktop-dm-chat-window .mobile-dm-mini-chat-form {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
  }

  .desktop-dm-chat-window .desktop-dm-mini-attach,
  .desktop-dm-chat-window .mobile-dm-mini-send {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .desktop-dm-chat-window .desktop-dm-mini-attach {
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.1);
    color: var(--mobile-dm-text, #0f172a);
  }

  .desktop-dm-chat-window .desktop-dm-mini-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 14px;
    min-height: 34px;
    max-height: 180px;
    padding: 7px 10px;
    background: var(--mobile-dm-surface, #ffffff);
    font-size: 13px;
    line-height: 1.35;
    color: var(--mobile-dm-text, #0f172a);
    resize: none;
    overflow-y: hidden;
    white-space: pre-wrap;
  }

  .desktop-dm-chat-window .desktop-dm-mini-input::placeholder {
    color: var(--mobile-dm-muted, #64748b);
  }

  .desktop-dm-chat-window .desktop-dm-mini-input:focus {
    outline: 0;
    border-color: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.64);
    box-shadow: 0 0 0 3px rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.2);
  }

  .desktop-dm-chat-window .mobile-dm-mini-send {
    border-radius: 999px;
    border: 0;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.9);
    box-shadow: none;
    color: #fff;
  }

  .desktop-dm-chat-window .mobile-dm-mini-send .ti,
  .desktop-dm-chat-window .desktop-dm-mini-attach .ti {
    font-size: 14px;
    line-height: 1;
  }

  .desktop-dm-chat-window.is-minimized {
    width: 268px;
    height: auto;
  }

  .desktop-dm-chat-window.is-minimized .mobile-dm-mini-chat-body,
  .desktop-dm-chat-window.is-minimized .mobile-dm-mini-chat-form {
    display: none;
  }

  .desktop-dm-chat-window.is-uploading-media .desktop-dm-mini-attach,
  .desktop-dm-chat-window.is-uploading-media .mobile-dm-mini-send {
    opacity: 0.55;
    pointer-events: none;
  }
}

/* Chatroom Facebook DM username colors (top dropdown + bottom dock). */
.mobile-dm-conversation-name.username-gender-male,
.desktop-dm-mini-name.username-gender-male {
  color: #2196f3 !important;
}

.mobile-dm-conversation-name.username-gender-female,
.desktop-dm-mini-name.username-gender-female {
  color: #f06595 !important;
}

.mobile-dm-conversation-name.username-gender-trans,
.desktop-dm-mini-name.username-gender-trans {
  color: #c026d3 !important;
}

.mobile-dm-conversation-name.username-gender-couple,
.desktop-dm-mini-name.username-gender-couple {
  color: #22c55e !important;
}

.mobile-dm-conversation-name.username-gender-other,
.desktop-dm-mini-name.username-gender-other {
  color: #14b8a6 !important;
}

.mobile-dm-conversation-name.username-gender-admin,
.desktop-dm-mini-name.username-gender-admin {
  color: #ff8c00 !important;
}

.mobile-dm-conversation-name.username-gender-unknown,
.desktop-dm-mini-name.username-gender-unknown {
  color: var(--mobile-dm-text, #0f172a) !important;
}

@media (max-width: 991.98px) {
  .mobile-dm-bubble-panel {
    top: 66px;
    right: 18px;
    width: min(340px, calc(100vw - 16px));
    z-index: 1060;
  }

  #main-private .page-content-wrapper>.navbar.topbar {
    position: relative;
    z-index: 1065;
  }

  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card,
  #main-private .topbar .mobile-notification-top-trigger+.notifications-panel-card.show {
    z-index: 1066 !important;
  }

  body.sb-rightnav-toggled .mobile-dm-bubble-panel {
    right: 18px;
    width: min(340px, calc(100vw - 16px));
  }

  .mobile-dm-bubble-panel-inner {
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 18px;
    background: var(--mobile-dm-surface, #ffffff);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.2);
    padding: 0;
    overflow: hidden;
  }

  .mobile-dm-bubble-head {
    padding: 8px 10px;
    border-bottom: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
  }

  .mobile-dm-bubble-head-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.1);
    color: var(--mobile-dm-text, #0f172a);
  }

  .mobile-dm-bubble-search {
    margin: 0 10px 8px;
  }

  .mobile-dm-bubble-filters {
    margin: 0 10px 8px;
  }

  .mobile-dm-bubble-recent-list {
    max-height: 280px;
    padding: 8px;
    gap: 0;
  }

  .mobile-dm-conversation-row .mobile-dm-avatar-btn {
    padding-right: 8px;
  }

  .mobile-dm-conversation-actions {
    position: static;
  }

  .mobile-dm-conversation-menu-toggle {
    display: none;
  }

  .mobile-dm-avatar-btn {
    min-height: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--mobile-dm-text, #0f172a);
    align-items: center;
    padding: 8px;
  }

  .mobile-dm-avatar-wrap {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
  }

  .mobile-dm-avatar-btn img {
    border: 0;
    box-shadow: none;
  }

  .mobile-dm-open-icon {
    display: none;
  }

  .mobile-dm-avatar-btn:hover,
  .mobile-dm-avatar-btn:active {
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.12);
    border-color: transparent;
    transform: none;
  }

  .mobile-dm-avatar-btn.is-active {
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.12);
    border-color: transparent;
  }

  .mobile-dm-conversation-time,
  .mobile-dm-conversation-preview {
    color: var(--mobile-dm-muted, #64748b);
    font-size: 11px;
    font-weight: 400;
  }

  .mobile-dm-mini-chat {
    position: fixed;
    right: 12px;
    left: auto;
    display: flex;
    flex-direction: column;
    width: 320px;
    min-width: 320px;
    max-width: calc(100vw - 24px);
    bottom: 12px;
    height: 430px;
    min-height: 430px;
    max-height: 430px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 14px;
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    z-index: 1060;
  }

  body.sb-rightnav-toggled .mobile-dm-mini-chat {
    right: 12px;
    width: 320px;
    min-width: 320px;
    max-width: calc(100vw - 24px);
    height: 430px;
    min-height: 430px;
    max-height: 430px;
  }

  .mobile-dm-mini-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 9px;
    border-bottom: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
  }

  #mobile-dm-mini-avatar {
    width: 30px;
    height: 30px;
    border: 0;
  }

  .mobile-dm-mini-chat-sub {
    font-size: 11px;
  }

  .mobile-dm-mini-chat-actions {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    gap: 6px;
    flex: 0 0 auto;
  }

  #mobile-dm-mini-actions-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    order: 1;
  }

  #mobile-dm-mini-call {
    order: 2;
  }

  #mobile-dm-mini-minimize {
    order: 3;
  }

  #mobile-dm-mini-close {
    order: 4;
  }

  #mobile-dm-mini-actions-toggle,
  #mobile-dm-mini-call,
  #mobile-dm-mini-minimize,
  #mobile-dm-mini-close {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  #mobile-dm-mini-actions-toggle {
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--mobile-dm-surface, #ffffff);
    color: var(--mobile-dm-muted, #64748b);
  }

  .mobile-dm-mini-btn {
    width: 26px;
    height: 26px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.08);
    color: var(--mobile-dm-text, #0f172a);
  }

  #mobile-dm-mini-actions-toggle .ti,
  #mobile-dm-mini-call .ti,
  #mobile-dm-mini-minimize .ti,
  #mobile-dm-mini-close .ti {
    font-size: 14px;
    line-height: 1;
  }

  .mobile-dm-mini-chat-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    padding: 8px;
    gap: 6px;
    background: rgba(148, 163, 184, 0.08);
  }

  .mobile-dm-mini-msg {
    max-width: 100%;
    width: 100%;
    align-self: flex-start;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 7px;
    flex-direction: row;
    justify-content: flex-start;
  }

  .mobile-dm-mini-avatar-wrap {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 999px;
    overflow: hidden;
    align-self: flex-end;
    background: rgba(148, 163, 184, 0.2);
  }

  .mobile-dm-mini-msg-main {
    max-width: calc(100% - 8px);
    min-width: 0;
    display: flex;
    flex: 1 1 auto;
    width: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .mobile-dm-mini-msg-author {
    display: none;
  }

  .mobile-dm-mini-msg-bubble {
    display: inline-flex;
    flex-direction: column;
    gap: 6px;
    width: auto;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 16px;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--mobile-dm-surface, #ffffff);
    color: var(--mobile-dm-text, #0f172a);
    font-size: 13px;
    line-height: 1.45;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    overflow: visible;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .mobile-dm-mini-msg-time,
  .mobile-dm-mini-msg-since {
    display: none !important;
  }

  .mobile-dm-mini-msg.is-own {
    align-self: flex-end;
    flex-direction: row;
    justify-content: flex-end;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-avatar-wrap {
    display: none;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-main {
    max-width: 100%;
    align-items: flex-end;
    margin-left: auto;
  }

  .mobile-dm-mini-msg.is-own .mobile-dm-mini-msg-bubble {
    align-self: flex-end;
    width: auto;
    max-width: 100%;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.14);
    border-color: var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
  }

  .mobile-dm-mini-chat-form {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 8px;
    border-top: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    background: var(--panel-bg, var(--mobile-dm-surface, #ffffff));
  }

  .mobile-dm-mini-attach,
  .mobile-dm-mini-send {
    width: 32px;
    height: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-dm-mini-attach {
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 999px;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.1);
    color: var(--mobile-dm-text, #0f172a);
  }

  #mobile-dm-mini-input {
    flex: 1 1 auto;
    min-width: 0;
    border: 1px solid var(--mobile-dm-border, rgba(148, 163, 184, 0.35));
    border-radius: 14px;
    min-height: 34px;
    max-height: 180px;
    padding: 7px 10px;
    background: var(--mobile-dm-surface, #ffffff);
    font-size: 13px;
    line-height: 1.35;
    color: var(--mobile-dm-text, #0f172a);
    resize: none;
    overflow-y: hidden;
    white-space: pre-wrap;
  }

  .mobile-dm-mini-send {
    border-radius: 999px;
    border: 0;
    background: rgba(var(--mobile-dm-accent-rgb, 32, 107, 196), 0.9);
    box-shadow: none;
    color: #fff;
  }

  .mobile-dm-mini-send .ti,
  .mobile-dm-mini-attach .ti {
    font-size: 14px;
    line-height: 1;
  }

  .rtl .mobile-dm-bubble-panel {
    left: 18px;
    right: auto;
  }

  .rtl body.sb-rightnav-toggled .mobile-dm-bubble-panel {
    left: 18px;
  }

  .rtl .mobile-dm-mini-chat {
    left: 12px;
    right: auto;
  }

  .rtl body.sb-rightnav-toggled .mobile-dm-mini-chat {
    left: 12px;
  }
}