:root {
  --mp-mobile-nav-height: 64px;
  --mp-chat-composer-height: 72px;
  --mp-keyboard-inset: 0px;
  --mp-visual-viewport-height: 100dvh;
  --mp-press-scale: 0.992;
  --mp-press-opacity: 0.96;
}

[data-mp-pressable="1"],
[data-mp-conversation-row="1"] {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transform: translateZ(0);
  backface-visibility: hidden;
  transition:
    transform 0.035s ease-out,
    opacity 0.035s ease-out,
    background-color 0.035s ease-out,
    box-shadow 0.035s ease-out;
  will-change: transform;
}

[data-mp-mobile-nav="1"] {
  padding-bottom: max(env(safe-area-inset-bottom), 0px);
  transform: translateZ(0);
  backface-visibility: hidden;
  contain: layout paint style;
}

[data-mp-mobile-nav="1"] [data-mp-pressable="1"] {
  min-width: 44px;
  min-height: 44px;
  touch-action: manipulation;
}

[data-mp-mobile-nav="1"] [data-mp-pressable="1"],
[data-mp-conversation-row="1"] {
  cursor: pointer;
}

@media (hover: none) and (pointer: coarse) {
  [data-mp-mobile-nav="1"] [data-mp-pressable="1"] {
    transition-duration: 0.025s;
  }
}

[data-mp-pressable="1"].mp-is-pressing,
[data-mp-conversation-row="1"].mp-is-pressing {
  transform: scale(var(--mp-press-scale));
  opacity: var(--mp-press-opacity);
}

[data-mp-conversation-row="1"] {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

[data-mp-conversation-row="1"] *,
[data-mp-conversation-row="1"]::before,
[data-mp-conversation-row="1"]::after {
  -webkit-user-select: none;
  user-select: none;
}

[data-mp-conversation-row="1"] input,
[data-mp-conversation-row="1"] textarea,
[data-mp-conversation-row="1"] [contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

[data-mp-conversation-row="1"]::after {
  content: "";
  position: absolute;
  inset-inline-end: 12px;
  top: 50%;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  border: 2px solid currentColor;
  opacity: 0;
  transform: translateY(-50%) scale(0.84);
  transition:
    opacity 0.1s ease,
    transform 0.1s ease,
    background-color 0.1s ease,
    border-color 0.1s ease;
  pointer-events: none;
}

.mp-selection-mode [data-mp-conversation-row="1"]::after {
  opacity: 0.22;
}

[data-mp-conversation-row="1"].mp-is-selected {
  box-shadow: inset 0 0 0 2px rgba(15, 23, 42, 0.14);
}

[data-mp-conversation-row="1"].mp-is-selected::after {
  opacity: 0.88;
  background: currentColor;
  transform: translateY(-50%) scale(1);
}

body.mp-has-mobile-nav [data-mp-conversation-list="1"],
body.mp-has-mobile-nav [data-conversation-list],
body.mp-has-mobile-nav .conversation-list,
body.mp-has-mobile-nav .chat-list,
body.mp-has-mobile-nav .dialog-list,
body.mp-has-mobile-nav .admin-chat-list,
body.mp-has-mobile-nav .conversations-list,
body.mp-has-mobile-nav .dialogs-list,
body.mp-has-mobile-nav .inbox-list,
body.mp-has-mobile-nav .threads-list {
  padding-bottom: calc(var(--mp-mobile-nav-height) + max(env(safe-area-inset-bottom), 0px) + 12px);
  scroll-padding-bottom: calc(var(--mp-mobile-nav-height) + max(env(safe-area-inset-bottom), 0px) + 12px);
}

body.mp-chat-detail-page [data-mp-mobile-nav-hidden="true"] {
  display: none !important;
}

body.mp-chat-detail-page [data-mp-chat-scroll="1"],
body.mp-chat-detail-page [data-chat-scroll],
body.mp-chat-detail-page .chat-messages,
body.mp-chat-detail-page .dialog-messages,
body.mp-chat-detail-page .messages-scroller,
body.mp-chat-detail-page .messages-list,
body.mp-chat-detail-page .chat-thread,
body.mp-chat-detail-page .dialog-thread,
body.mp-chat-detail-page .thread-messages {
  padding-bottom: calc(var(--mp-chat-composer-height) + max(env(safe-area-inset-bottom), var(--mp-keyboard-inset)) + 12px) !important;
  scroll-padding-bottom: calc(var(--mp-chat-composer-height) + max(env(safe-area-inset-bottom), var(--mp-keyboard-inset)) + 12px);
  overscroll-behavior-y: contain;
  scrollbar-gutter: auto;
  scroll-behavior: auto;
  min-height: 0;
}

body.mp-chat-detail-page [data-mp-chat-composer="1"],
body.mp-chat-detail-page [data-chat-composer],
body.mp-chat-detail-page .chat-composer,
body.mp-chat-detail-page .dialog-composer,
body.mp-chat-detail-page .message-composer,
body.mp-chat-detail-page .chat-input-bar,
body.mp-chat-detail-page .composer-bar {
  padding-bottom: max(env(safe-area-inset-bottom), var(--mp-keyboard-inset));
  z-index: 30;
  transform: translateZ(0);
  backface-visibility: hidden;
}

body.mp-chat-detail-page .chat-layout,
body.mp-chat-detail-page .dialog-layout,
body.mp-chat-detail-page .messages-layout,
body.mp-chat-detail-page main,
body.mp-chat-detail-page .page-content,
body.mp-chat-detail-page .dashboard-content {
  min-height: 0;
}

body.mp-chat-detail-page textarea,
body.mp-chat-detail-page input,
body.mp-chat-detail-page button {
  transform: translateZ(0);
}

@media (max-width: 900px) {
  body.mp-chat-detail-page {
    min-height: var(--mp-visual-viewport-height);
  }
}

/* Contacts mobile page: insert the real chat header code, then only bind search to contacts. */
@media (max-width: 900px) {
  body.mp-contacts-page [data-mp-contacts-header-host="1"] {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    flex: 0 0 100% !important;
    align-self: stretch !important;
    order: -1000 !important;
    clear: both !important;
    float: none !important;
  }

  body.mp-contacts-page [data-mp-contacts-native-chat-header="1"] {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
  }

  body.mp-contacts-page [data-mp-contacts-departments-line="1"] {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    grid-column: 1 / -1 !important;
    flex: 0 0 100% !important;
    align-self: stretch !important;
    order: -999 !important;
    clear: both !important;
    float: none !important;
  }

  body.mp-contacts-page [data-mp-contacts-above-departments-hidden="1"],
  body.mp-contacts-page [data-mp-contact-hidden] {
    display: none !important;
  }

  body.mp-contacts-page [data-mp-contacts-list="1"] {
    padding-bottom: calc(var(--mp-mobile-nav-height) + max(env(safe-area-inset-bottom), 0px) + 14px);
    scroll-padding-bottom: calc(var(--mp-mobile-nav-height) + max(env(safe-area-inset-bottom), 0px) + 14px);
  }

  body.mp-contacts-page [data-mp-contact-row="1"] {
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    backface-visibility: hidden;
  }
}

body.mp-chat-detail-page,
body.mp-chat-detail-page [data-mp-chat-scroll="1"],
body.mp-chat-detail-page [data-chat-scroll],
body.mp-chat-detail-page .chat-messages,
body.mp-chat-detail-page .dialog-messages,
body.mp-chat-detail-page .messages-scroller,
body.mp-chat-detail-page .messages-list,
body.mp-chat-detail-page .chat-thread,
body.mp-chat-detail-page .dialog-thread,
body.mp-chat-detail-page .thread-messages,
body.mp-chat-detail-page .realtime-chat-thread {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  scrollbar-gutter: auto !important;
}

body.mp-chat-detail-page::-webkit-scrollbar,
body.mp-chat-detail-page [data-mp-chat-scroll="1"]::-webkit-scrollbar,
body.mp-chat-detail-page [data-chat-scroll]::-webkit-scrollbar,
body.mp-chat-detail-page .chat-messages::-webkit-scrollbar,
body.mp-chat-detail-page .dialog-messages::-webkit-scrollbar,
body.mp-chat-detail-page .messages-scroller::-webkit-scrollbar,
body.mp-chat-detail-page .messages-list::-webkit-scrollbar,
body.mp-chat-detail-page .chat-thread::-webkit-scrollbar,
body.mp-chat-detail-page .dialog-thread::-webkit-scrollbar,
body.mp-chat-detail-page .thread-messages::-webkit-scrollbar,
body.mp-chat-detail-page .realtime-chat-thread::-webkit-scrollbar {
  width: 0 !important;
  height: 0 !important;
  display: none !important;
}

