.messengers {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 2001;
  font-size: 14px;
  line-height: 22px;
  background: var(--main-bg);
  box-shadow: var(--box-shadow);
  border: 2px solid var(--accent-color);
  border-radius: 10px;
  width: 360px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100svh - 40px);
  transition:
    width 0.25s ease-in-out,
    opacity 0.25s ease-in-out,
    visibility 0.25s ease-in-out;
}

.messengers.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.messengers__header {
  flex-shrink: 0;
  display: block;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  padding: 8px;
  position: relative;
}

.messengers__header-inner {
  display: flex;
  align-items: center;
  column-gap: 16px;
}

.messengers__header-image {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
}

.messengers__header-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
}

.messengers__header-content {
  flex-grow: 1;
  min-width: 1px;
}

.messengers.is-visible .messengers__header-closed-content,
.messengers:not(.is-visible) .messengers__header-opened-content {
  display: none;
}

.messengers__title {
  font-size: 16px;
  line-height: 24px;
  font-weight: 700;
}

.messengers__subtitle {
  font-size: 14px;
  line-height: 22px;
  color: var(--secondary-color);
}

.messengers__subtitle-divider {
  display: inline-block;
  vertical-align: middle;
  width: 5px;
  height: 5px;
  background: var(--accent-color);
  border-radius: 50%;
  margin: 0 0.5em;
}

.messengers__header-button {
  flex-shrink: 0;
  align-self: flex-start;
}

.messengers__toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--main-bg);
  border-radius: 5px;
  box-shadow: var(--box-shadow);
}

.messengers__toggle-btn-icon {
  width: 14px;
  height: 14px;
  background: var(--accent-color);
  mask: url('data:image/svg+xml;charset=utf-8,<svg viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M6.144 10.852 1.148 5.861a.505.505 0 0 1 .713-.713L6.5 9.783l4.639-4.635a.505.505 0 0 1 .713.713l-4.995 4.991a.505.505 0 0 1-.713 0Z"/></svg>') no-repeat center / 100% 100%;
}

.messengers.is-visible .messengers__toggle-btn-icon {
  transform: rotate(180deg);
}

.messengers__content {
  height: 0;
  min-height: 0;
  overflow: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  display: none;
  interpolate-size: allow-keywords;
  transition:
    height 0.25s ease-in-out,
    display 0.25s ease-in-out allow-discrete;
}

.messengers.is-visible .messengers__content {
  display: block;
  height: auto;
}

@starting-style {
  .messengers.is-visible .messengers__content {
    height: 0;
  }
}

.messengers__content-inner {
  padding: 8px;
  padding-top: 0;
}

.messengers__text {
  margin-bottom: 16px;
}

.messengers__list {
  display: flex;
  flex-direction: column;
  row-gap: 10px;
}

.messengers__item-inner {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  column-gap: 10px;
  padding: 6px 10px;
  border-radius: 5px;
  box-shadow: var(--box-shadow);
}

.messengers__item-inner:hover {
  background-color: var(--light-blue-bg);
}

.messengers__item-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.messengers__item-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.messengers__item-content {
  flex-grow: 1;
  min-width: 1px;
}

.messengers__item-title {
  font-size: 14px;
  line-height: 22px;
  font-weight: bold;
}

.messengers__item-subtitle {
  font-size: 13px;
  line-height: 20px;
  color: var(--secondary-color);
}

@media (max-width: 1199.98px) {
  .messengers {
    right: 15px;
    bottom: calc(var(--mobile-footer-space) + 15px);
    max-height: calc(100svh - var(--mobile-footer-space) - 30px);
    max-width: calc(100vw - 30px);
  }
}

@media (max-width: 575.98px) {
  .messengers:not(.is-visible) {
    width: 156px;
  }

  .messengers:not(.is-visible) .messengers__header {
    padding: 4px;
  }

  .messengers:not(.is-visible) .messengers__header-inner {
    column-gap: 10px;
  }

  .messengers:not(.is-visible) .messengers__header-image {
    width: 50px;
    height: 50px;
  }

  .messengers:not(.is-visible) .messengers__title {
    font-size: 14px;
    line-height: 22px;
  }

  .messengers:not(.is-visible) .messengers__subtitle {
    display: none;
  }

  .messengers:not(.is-visible) .messengers__header-button {
    position: absolute;
    right: 4px;
    bottom: 4px;
  }

  .messengers:not(.is-visible) .messengers__toggle-btn {
    width: 20px;
    height: 20px;
  }

  .messengers:not(.is-visible) .messengers__toggle-btn-icon {
    width: 10px;
    height: 10px;
  }
}
