.messages {
    position: fixed;
    right: clamp(16px, 2vw, 32px);
    bottom: clamp(16px, 2vw, 28px);
    z-index: 1200;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 32px));
    margin: 0;
    pointer-events: none;
}

.message {
    position: relative;
    margin: 0;
    padding: 13px 42px 13px 15px;
    border-radius: 11px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
    pointer-events: auto;
    animation: toast-in .18s ease-out both;
}

.message.is-closing {
    animation: toast-out .18s ease-in both;
}

.toast-close {
    position: absolute;
    top: 50%;
    right: 9px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    opacity: .72;
    transform: translateY(-50%);
}

.toast-close:hover {
    background: rgba(255, 255, 255, .18);
    opacity: 1;
}

.toast-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

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

@keyframes toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(8px) scale(.98); }
}

@media (prefers-reduced-motion: reduce) {
    .message,
    .message.is-closing { animation: none; }
}

@media (max-width: 620px) {
    .messages {
        left: 14px;
        right: 14px;
        bottom: 14px;
        width: auto;
    }
}
