:root {
    --mm-notification-duration: 10s;
    --mm-notification-left: max(12px, env(safe-area-inset-left));
    --mm-notification-top: max(12px, env(safe-area-inset-top));
    --mm-notification-width: min(520px, calc(100vw - 24px));
}

.mm-notification-source-hidden {
    display: none !important;
}

.mm-notification-stack {
    position: fixed;
    z-index: 1090;
    top: var(--mm-notification-top);
    left: var(--mm-notification-left);
    display: flex;
    width: var(--mm-notification-width);
    max-height: calc(100dvh - var(--mm-notification-top) - 12px);
    flex-direction: column;
    gap: 10px;
    overflow-x: hidden;
    overflow-y: auto;
    pointer-events: none;
    overscroll-behavior: contain;
}

.mm-notification {
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 30px;
    gap: 10px;
    align-items: start;
    border: 1px solid #cbd5e1;
    border-left-width: 5px;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
    padding: 12px 10px 14px 12px;
    color: #172033;
    pointer-events: auto;
    overflow: hidden;
    animation: mm-notification-enter 220ms ease-out both;
}

.mm-notification::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    content: "";
    opacity: 0.3;
    transform-origin: left center;
    animation: mm-notification-timer var(--mm-notification-duration) linear both;
}

.mm-notification[data-tone="success"] {
    border-color: #78b895;
    border-left-color: #198754;
}

.mm-notification[data-tone="danger"] {
    border-color: #dfa1a8;
    border-left-color: #c92a3a;
}

.mm-notification[data-tone="warning"] {
    border-color: #d8b55c;
    border-left-color: #b77900;
}

.mm-notification[data-tone="info"] {
    border-color: #83b7d2;
    border-left-color: #1674a5;
}

.mm-notification-icon {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #e9eef5;
    color: #334155;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1;
}

.mm-notification[data-tone="success"] .mm-notification-icon {
    background: #e3f3e9;
    color: #146c43;
}

.mm-notification[data-tone="danger"] .mm-notification-icon {
    background: #f9e3e6;
    color: #a61e2d;
}

.mm-notification[data-tone="warning"] .mm-notification-icon {
    background: #fff0c9;
    color: #855900;
}

.mm-notification[data-tone="info"] .mm-notification-icon {
    background: #e0f1f8;
    color: #0f638d;
}

.mm-notification-content {
    min-width: 0;
    padding-top: 2px;
    overflow-wrap: anywhere;
}

.mm-notification-content > :last-child {
    margin-bottom: 0 !important;
}

.mm-notification-content a {
    color: inherit;
    font-weight: 700;
}

.mm-notification-close {
    display: inline-flex;
    width: 30px;
    height: 30px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    font-size: 1.25rem;
    line-height: 1;
}

.mm-notification-close:hover,
.mm-notification-close:focus-visible {
    background: #edf1f6;
    color: #172033;
}

.mm-notification.is-leaving {
    animation: mm-notification-leave 220ms ease-in both;
}

html[data-pro-theme="dark"] .mm-notification,
.backoffice-shell-super-admin .mm-notification {
    border-color: #4b5567;
    background: #24272d;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
    color: #edf2fb;
}

html[data-pro-theme="dark"] .mm-notification-close,
.backoffice-shell-super-admin .mm-notification-close {
    color: #bac5d6;
}

html[data-pro-theme="dark"] .mm-notification-close:hover,
html[data-pro-theme="dark"] .mm-notification-close:focus-visible,
.backoffice-shell-super-admin .mm-notification-close:hover,
.backoffice-shell-super-admin .mm-notification-close:focus-visible {
    background: #343943;
    color: #ffffff;
}

@keyframes mm-notification-enter {
    from {
        opacity: 0;
        transform: translateY(-14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mm-notification-leave {
    from {
        max-height: 240px;
        opacity: 1;
        transform: translateY(0);
    }
    to {
        max-height: 0;
        margin-bottom: -10px;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
        transform: translateY(-18px);
    }
}

@keyframes mm-notification-timer {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 575.98px) {
    :root {
        --mm-notification-left: max(8px, env(safe-area-inset-left));
        --mm-notification-top: max(8px, env(safe-area-inset-top));
        --mm-notification-width: calc(100vw - 16px);
    }

    .mm-notification-stack {
        max-height: calc(100dvh - var(--mm-notification-top) - 8px);
        gap: 8px;
    }

    .mm-notification {
        grid-template-columns: 28px minmax(0, 1fr) 28px;
        gap: 8px;
        padding: 10px 8px 13px 10px;
    }

    .mm-notification-icon,
    .mm-notification-close {
        width: 28px;
        height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mm-notification,
    .mm-notification.is-leaving,
    .mm-notification::after {
        animation-duration: 1ms !important;
    }
}
