.Chat {
  --background-color: var(--color-background);

  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  width: 100%;

  &.animate-opacity {
    will-change: opacity;
    transition: opacity .2s ease-out;
  }

  &.animate-transform {
    will-change: transform;
    transition: transform .2s ease-out;
  }

  &:hover, &.ListItem.has-menu-open {
    .Avatar.online::after {
      border-color: var(--color-chat-hover);
    }
  }

  &.selected,
  &.selected:hover {
    --background-color: var(--color-chat-active) !important;

    .Avatar.online::after {
      border-color: var(--color-chat-active) !important;
      background: var(--color-white);
    }

    .ListItem-button {
      --background-color: var(--color-chat-active) !important;
      --color-text: var(--color-white);
      --color-text-meta-colored: var(--color-white);
      --color-text-meta: var(--color-white);
      --color-text-secondary: var(--color-white);
      --color-error: var(--color-white);
      --color-pinned: var(--color-white);
    }

    .icon-muted-chat {
      color: var(--color-white) !important;
    }

    .Badge:not(.pinned) {
      background: var(--color-white);
      color: var(--color-chat-active);
    }
  }

  .status {
    position: relative;
    flex-shrink: 0;
  }

  .info {
    .title, .subtitle {
      padding-right: .125rem;
    }

    h3 {
      width: auto;
      max-width: 80%;
    }

    .icon-muted-chat {
      font-size: 1.25rem;
      margin-left: 0.25rem;
      margin-top: -.0625rem;
      color: #C6C8CA;
    }

    .LastMessageMeta {
      margin-left: auto;
    }

    .last-message, .typing-status {
      padding-right: 0.25rem;
      flex-grow: 1;
      color: var(--color-text-secondary);
      unicode-bidi: plaintext;
      &[dir=ltr] {
        text-align: left;
      }

      .sender-name {
        color: var(--color-text);
      }

      .draft {
        color: var(--color-error);
      }
    }

    .last-message {
      .draft {
        &::after {
          content: ': ';
        }
      }
      .colon {
        margin-inline-end: .25rem;
      }

      .media-preview {
        position: relative;
      }

      img {
        width: 1.25rem;
        height: 1.25rem;
        object-fit: cover;
        border-radius: .125rem;
        vertical-align: -.25rem;
        margin-inline-end: .25rem;

        &.round {
          border-radius: .625rem;
        }
      }

      .emoji-small {
        width: 1rem;
        height: 1rem;
        vertical-align: -.125rem;
      }

      .icon-play {
        font-size: .75rem;
        color: #fff;
        position: absolute;
        top: .1875rem;
        margin-inline-start: -1.25rem;
      }
    }
  }

  &[dir=rtl] {
    .info {
      .LastMessageMeta {
        margin-left: 0;
        margin-right: auto;
      }

      .title, .subtitle {
        padding-left: .15rem;
        padding-right: 0;
      }

      .icon-muted-chat {
        margin-left: 0;
        margin-right: 0.25rem;
      }

      .last-message, .typing-status {
        padding-left: 0.5rem;
        padding-right: 0;
        text-align: right;
        unicode-bidi: plaintext;
      }
    }
  }
}
