.root {
  scroll-margin-block: 0.25rem;

  position: relative;

  overflow: hidden;
  display: grid;
  grid-template-columns: min-content min-content 1fr min-content;
  grid-template-rows: 1fr 1fr;
  align-items: center;

  min-height: 2.5rem;
  padding: 0.25rem;
  border-radius: 1.25rem;

  line-height: 1.25;
  color: var(--color-text);
  text-align: initial;

  background-color: var(--background-color);

  transition-duration: 150ms;
  transition-property: background-color, opacity;

  :global(body.is-ios) &,
  :global(body.is-android) & {
    padding-inline-start: 0.75rem;
    border-radius: 0;
  }

  :global(body.is-ios) & {
    padding-inline-end: 0;
  }

  @media (max-width: 600px) {
    padding-inline-start: 0.5rem !important;
    border-radius: 0;
  }
}

.clickable {
  cursor: var(--custom-cursor, pointer);

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

    &:focus-visible {
      z-index: 1;
      outline: 2px solid var(--color-borders);
    }
  }
}

.separator {
  grid-column: 3;
  grid-row: 2;
  align-self: end;
  /* stylelint-disable-next-line plugin/whole-pixel */
  height: 0.5px;
  margin-bottom: -0.1875rem;

  background-color: var(--color-dividers);
}

.disabled {
  cursor: unset;
  opacity: 0.5;
}

.title {
  grid-column: 3;
  grid-row: 1 / 3;
}

.subtitle {
  grid-column: 3;
  grid-row: 2;

  padding-bottom: 0.3125rem;

  font-size: 0.875rem;
  color: var(--color-text-secondary);
}

.title, .subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.withAvatar, .multiline {
  height: 3.5rem; // Force chat item height
}

.multiline {
  .title {
    grid-row: 1;
    align-self: end;
  }
}

.input {
  padding-inline: 0.75rem;
}

.startInput {
  grid-column: 1;
  grid-row: 1 / 3;
  margin-inline-end: 1.1875rem;
}

.endInput {
  grid-column: 4;
  grid-row: 1 / 3;
  margin-inline-start: 1.25rem;
}

.avatarElement {
  grid-column: 2;
  grid-row: 1 / 3;
  margin-inline-end: 0.75rem;
}
