.toast-stack {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: grid;
    gap: 10px;
    width: min(380px, calc(100vw - 24px));
}

.toast {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #d1d9e6;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
    color: #0f172a;
    transform: translateY(-8px);
    opacity: 0;
    animation: toast-in .2s ease forwards;
}

.toast.hide {
    animation: toast-out .18s ease forwards;
}

.toast-body {
    display: grid;
    gap: 4px;
    padding: 14px 16px 15px;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.toast-message {
    font-size: 12px;
    line-height: 1.45;
    color: #475569;
}

.toast-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    transform-origin: left;
    animation: toast-progress linear forwards;
}

.toast.success {
    border-color: #d1d9e6;
}

.toast.success .toast-progress {
    background: #22c55e;
}

.toast.error {
    border-color: #d1d9e6;
}

.toast.error .toast-progress {
    background: #ef4444;
}

.toast.info {
    border-color: #d1d9e6;
}

.toast.info .toast-progress {
    background: #0ea5e9;
}

.toast.warning {
    border-color: #d1d9e6;
}

.toast.warning .toast-progress {
    background: #f59e0b;
}

@keyframes toast-in {
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes toast-out {
    to {
        transform: translateY(-8px);
        opacity: 0;
    }
}

@keyframes toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (max-width: 700px) {
    .toast-stack {
        top: 12px;
        right: 12px;
        left: 12px;
        width: auto;
    }
}
