.messages {
  position: fixed !important;
  left: auto !important;
  right: 24px !important;
  top: auto !important;
  bottom: 24px !important;
  z-index: 99999 !important;
  width: auto !important;
  max-width: min(440px, calc(100vw - 32px)) !important;
  pointer-events: none !important;
}

.messages .msg-wrapper {
  margin: 0 0 14px 0 !important;
  padding: 0 !important;
  pointer-events: none !important;
}

.messages .msg {
  position: relative !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 28px !important;
  border: none !important;
  overflow: hidden !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25) !important;
  transform: translateY(24px);
  opacity: 0;
  animation: sgToastIn 320ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: auto !important;
  backdrop-filter: blur(12px) !important;
}

.messages .msg .container {
  width: auto !important;
  max-width: none !important;
  min-height: auto !important;
  padding: 20px 54px 20px 60px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}

.messages .msg .container br { display: none !important; }

.messages .msg::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.2;
  pointer-events: none;
}

.messages .msg .sg-icon {
  position: absolute !important;
  left: 18px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 999px !important;
  z-index: 2 !important;
  pointer-events: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.messages .msg.msg-success .sg-icon::before { content: "✓"; }
.messages .msg.msg-error .sg-icon::before { content: "!"; }
.messages .msg.msg-info .sg-icon::before, .messages .msg:not(.msg-success):not(.msg-error) .sg-icon::before { content: "i"; }

.messages .msg::after {
  content: "×";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-52%);
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.65;
  cursor: pointer;
}

.messages .msg:hover::after { opacity: 1; }

.messages .msg.sg-hide { animation: sgToastOut 240ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes sgToastIn {
  from { opacity: 0; transform: translateY(24px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes sgToastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(19px) scale(0.98); }
}

@media (max-width: 767px) {
  .messages {
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important; top: auto !important;
    max-width: none !important;
    width: auto !important;
  }
  .messages .msg { border-radius: 22px !important; }
  .messages .msg .container { padding: 18px 50px 18px 56px !important; }
  .messages .msg::before, .messages .msg .sg-icon {
    width: 28px !important;
    height: 28px !important;
  }
}
