.crm-message {
  position: fixed;
  top: auto;
  right: auto;
  bottom: 32px;
  left: 50%;
  z-index: 100000;
  display: flex;
  gap: 14px;
  width: min(421px, calc(100% - 40px));
  padding: 20px 48px 20px 20px;
  border: 1px solid #e5e8ef;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(28, 39, 64, 0.18);
  box-sizing: border-box;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.crm-message.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.crm-message__icon {
  display: grid;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #748fff, #5578f6);
}

.crm-message--reminder .crm-message__icon {
  background: linear-gradient(135deg, #fb7c82, #c63ce5);
}

.crm-message__icon svg {
  width: 21px;
  height: 21px;
}

.crm-message__content {
  min-width: 0;
  color: #202638;
}

.crm-message__content strong {
  display: block;
  padding-top: 1px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.crm-message__content p {
  margin: 4px 0 12px;
  color: #6d7485;
  font-size: 14px;
  line-height: 1.45;
}

.crm-message__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 15px;
  border-radius: 8px;
  background: #315bea;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.crm-message--course {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 15px 34px -7px rgba(10, 13, 36, 0.2);
}

.crm-message__header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 11px;
  height: 76px;
  padding: 0 12px 0 20px;
  background: #fff;
}

.crm-message--course .crm-message__icon {
  width: 38px;
  height: 38px;
  border-radius: 13px;
}

.crm-message__title {
  overflow: hidden;
  color: #202239;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-message__course {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 122px;
  align-items: center;
  gap: 12px;
  height: 97px;
  padding: 0 16px 0 18px;
  border-top: 1px solid #ececf4;
  background: #fff;
}

.crm-message__thumb {
  display: block;
  width: 58px;
  height: 58px;
  border-radius: 15px;
  background: #f1f2f7;
  object-fit: cover;
}

.crm-message__thumb--empty {
  background: #f1f2f7 url('/resource/images/icon_toast.svg') no-repeat 50% 50%;
  background-size: 32px 32px;
}

.crm-message__course-info {
  min-width: 0;
}

.crm-message__center {
  overflow: hidden;
  margin: 0 0 5px;
  color: #74798e;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-message__brand {
  display: block;
  overflow: hidden;
  color: #202239;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crm-message--course .crm-message__link {
  gap: 5px;
  width: 122px;
  min-height: 44px;
  padding: 0 10px 0 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #748fff, #5578f6);
  box-sizing: border-box;
  font-size: 12px;
  font-weight: 700;
  transition: filter 0.16s ease, transform 0.16s ease;
}

.crm-message--course.crm-message--reminder .crm-message__link {
  background: linear-gradient(135deg, #fb7c82, #c63ce5);
}

.crm-message--course .crm-message__link:hover {
  filter: brightness(0.96) saturate(1.08);
  transform: translateX(2px);
}

.crm-message--course .crm-message__link span {
  font-size: 20px;
  font-weight: 400;
  line-height: 1;
}

.crm-message__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.crm-message--course .crm-message__close {
  position: relative;
  top: auto;
  right: auto;
}

.crm-message__close::before,
.crm-message__close::after {
  position: absolute;
  top: 13px;
  left: 6px;
  width: 16px;
  height: 1px;
  background: #6d7485;
  content: '';
}

.crm-message__close::before {
  transform: rotate(45deg);
}

.crm-message__close::after {
  transform: rotate(-45deg);
}

@media all and (max-width: 768px) {
  .crm-message {
    top: auto;
    right: 20px;
    bottom: 88px;
    left: 20px;
    width: auto;
    padding: 18px 44px 18px 18px;
    border-radius: 14px;
    transform: translateY(16px);
  }

  .crm-message.active {
    transform: translateY(0);
  }

  .crm-message__icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .crm-message__content strong {
    font-size: 15px;
  }

  .crm-message--course {
    right: 20px;
    left: 20px;
    padding: 0;
  }
}

@media all and (max-width: 470px) {
  .crm-message__header {
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    padding-left: 14px;
  }

  .crm-message--course .crm-message__icon {
    width: 34px;
    height: 34px;
    border-radius: 11px;
  }

  .crm-message__title,
  .crm-message__brand {
    font-size: 13px;
  }

  .crm-message__course {
    grid-template-columns: 52px minmax(0, 1fr) 105px;
    gap: 9px;
    padding: 0 14px;
  }

  .crm-message__thumb {
    width: 52px;
    height: 52px;
    border-radius: 13px;
  }

  .crm-message--course .crm-message__link {
    width: 105px;
    padding: 0 8px;
    font-size: 11px;
  }
}
