.mobile-conversation-back {
  display: none;
}

@media (max-width: 800px) {
  html.mobile-messages-enhanced:not(.mobile-conversation-view)
    .messages-page
    .conversation-thread {
    display: none;
  }

  html.mobile-messages-enhanced:not(.mobile-conversation-view)
    .messages-page
    .conversation-card--selected {
    background: #fff;
    box-shadow: none;
  }

  html.mobile-conversation-view,
  html.mobile-conversation-view body {
    overflow: hidden !important;
  }

  html.mobile-conversation-view .messages-page .conversation-thread {
    position: fixed;
    z-index: 90;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    display: flex;
    overflow: hidden;
    background: #fff;
  }

  html.mobile-conversation-view .conversation-thread__heading {
    position: relative;
    flex: 0 0 auto;
    min-height: 74px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: normal;
    gap: 11px;
    padding: max(12px, env(safe-area-inset-top)) 14px 12px;
    background: #fff;
    box-shadow: 0 4px 16px rgba(16, 33, 49, 0.08);
  }

  html.mobile-conversation-view .conversation-thread__heading > div {
    min-width: 0;
  }

  html.mobile-conversation-view .conversation-thread__heading h2,
  html.mobile-conversation-view .conversation-thread__heading p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html.mobile-conversation-view
    .conversation-thread__heading
    > .text-button:not(.mobile-conversation-back) {
    display: none;
  }

  html.mobile-conversation-view .mobile-conversation-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    padding: 8px 10px;
    background: #eef5fc;
    color: #124f87;
    font: 750 14px/1.2 var(--body);
    cursor: pointer;
  }

  html.mobile-conversation-view .mobile-conversation-back:focus-visible {
    outline: 3px solid var(--verified-blue);
    outline-offset: 2px;
  }

  html.mobile-conversation-view .message-history {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  html.mobile-conversation-view .reply-composer {
    flex: 0 0 auto;
    max-height: 46vh;
    overflow-y: auto;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    background: #fff;
  }

  html.mobile-conversation-view .conversation-thread > .message-limit-notice {
    flex: 0 0 auto;
    margin-bottom: max(18px, env(safe-area-inset-bottom));
  }
}
