.toast-container {
    position: fixed;
    top: 84px;
    right: 20px;
    z-index: 9999;

    width:
        min(
            380px,
            calc(100vw - 32px)
        );

    display: grid;
    gap: 10px;

    pointer-events: none;
}

.toast {
    padding: 14px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: var(--surface);
    color: var(--text);

    box-shadow:
        0 16px 40px
        rgba(0, 0, 0, 0.14);

    display: grid;
    grid-template-columns:
        28px
        minmax(0, 1fr)
        28px;
    align-items: start;
    gap: 10px;

    pointer-events: auto;

    animation:
        toast-in
        0.18s
        ease-out;
}

.toast-icon {
    width: 24px;
    height: 24px;

    border-radius: 999px;

    display: grid;
    place-items: center;

    font-size: 13px;
    font-weight: 800;
}

.toast-message {
    padding-top: 2px;

    line-height: 1.45;
    font-size: 14px;
}

.toast-close {
    width: 28px;
    height: 28px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--muted);

    cursor: pointer;
}

.toast-close:hover {
    background: var(--surface-sub);
    color: var(--text);
}

.toast-success .toast-icon {
    color: var(--success);
    background: var(--success-bg);
}

.toast-info .toast-icon {
    color: var(--info);
    background: var(--info-bg);
}

.toast-warning .toast-icon {
    color: var(--warning);
    background: var(--warning-bg);
}

.toast-error .toast-icon {
    color: var(--danger);
    background: var(--danger-bg);
}

.toast-out {
    animation:
        toast-out
        0.15s
        ease-in
        forwards;
}

@keyframes toast-in {
    from {
        opacity: 0;

        transform:
            translateY(-8px)
            translateX(12px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateX(16px);
    }
}

@media (max-width: 720px) {
    .toast-container {
        top: 16px;
        left: 16px;
        right: 16px;

        width: auto;
    }
}
