/* Плоское всплывающее уведомление о новом письме */
.crm-mail-toast-stack {
  position: fixed;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 101000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, calc(100vw - 20px));
  pointer-events: none;
}

.crm-mail-toast {
  position: relative;
  display: block;
  pointer-events: auto;
  padding: 10px 44px 10px 12px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  color: #0f172a;
  backdrop-filter: blur(8px);
  animation: crm-mail-toast-in 0.28s ease-out;
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.crm-mail-toast.out {
  animation: none;
}

.crm-mail-toast-close {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
  touch-action: manipulation;
}

.crm-mail-toast-close:hover,
.crm-mail-toast-close:focus {
  background: #f1f5f9;
  color: #0f172a;
}

.crm-mail-toast-body {
  min-width: 0;
  pointer-events: auto;
}

.crm-mail-toast-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.crm-mail-toast-icon {
  flex-shrink: 0;
  font-size: 15px;
  line-height: 1;
}

.crm-mail-toast-from {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.crm-mail-toast-subj {
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.crm-mail-toast-preview {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: #64748b;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@keyframes crm-mail-toast-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mail-notify-mount .crm-notify-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

.mail-notify-mount .crm-notify-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(252, 211, 77, 0.55);
}

.mail-notify-mount .crm-notify-badge {
  box-shadow: 0 0 0 2px #1e293b;
}
