.EmbeddedMessage {
  display: flex;
  align-items: center;
  font-size: calc(var(--message-text-size, 1rem) - 0.125rem);
  line-height: 1.125rem;
  margin: 0 -0.25rem 0.0625rem;
  padding: 0.1875rem 0.25rem 0.1875rem 0.4375rem;
  border-radius: var(--border-radius-messages-small);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  direction: ltr;

  body.animation-level-1 & {
    .ripple-container {
      display: none;
    }
  }

  .custom-shape & {
    max-width: 15rem;
    padding: 0.5rem;
    margin: 0;
    background-color: var(--background-color);
    box-shadow: 0 1px 2px var(--color-default-shadow);

    &::before {
      left: 0.625rem;
      top: 0.625rem;
      bottom: 0.625rem;
    }

    img:not(.emoji) {
      margin-inline-start: 0.5rem;
    }

    &:dir(rtl) {
      padding: 0.5rem;
    }
  }

  &::before {
    content: "";
    display: block;
    position: absolute;
    top: 0.3125rem;
    bottom: 0.3125rem;
    left: 0.3125rem;
    width: 2px;
    background: var(--accent-color);
    border-radius: 2px;
  }

  &:hover {
    background-color: var(--hover-color);
  }

  &:active {
    background-color: var(--active-color);
  }

  .message-title {
    font-size: calc(var(--message-text-size, 1rem) - 0.125rem);
  }

  .message-text {
    overflow: hidden;
    margin-inline-start: 0.5rem;
    display: flex;
    flex-direction: column-reverse;

    .message-title {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      margin-bottom: 0.125rem;
      flex: 1;
      display: block;
    }

    p {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      height: 1.125rem;
      margin-bottom: 0;
      flex: 1;

      &::after {
        content: none;
        display: none;
      }
    }

    .emoji {
      width: calc(1.125 * var(--message-text-size, 1rem)) !important;
      height: calc(1.125 * var(--message-text-size, 1rem)) !important;
      vertical-align: text-bottom !important;
    }
  }

  .embedded-action-message {
    color: var(--accent-color);
    opacity: 0.75;
  }

  img:not(.emoji) {
    width: 2rem;
    height: 2rem;
    object-fit: cover;
    border-radius: 0.25rem;
    margin-left: 0.25rem;
    flex-shrink: 0;

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

  &.inside-input {
    padding-inline-start: 0.5625rem;
    margin: 0 0 -0.125rem -0.1875rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: 1fr;
    width: 100%;
    --accent-color: var(--color-primary);
    --hover-color: var(--color-interactive-element-hover);

    &::before {
      bottom: 0.3125rem;
    }

    img:not(.emoji) {
      margin-left: 0.125rem;
    }

    .message-text {
      margin-inline-start: 0.375rem;
    }

    .message-title {
      font-weight: 500;
      color: var(--accent-color);
    }
  }
}
