.toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    z-index: 21000;
    display: grid;
    gap: 9px;
    width: fit-content;
    max-width: min(500px, 90vw);
    pointer-events: none;
    transform: translateX(-50%);
}

.toast {
    --toast-color: #168c50;
    --toast-soft-color: #e9f8ef;
    --toast-border-color: #78d9a2;
    --toast-progress-track-color: rgba(22, 140, 80, 0.16);
    position: relative;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 20px;
    align-items: center;
    gap: 8px;
    min-height: 58px;
    overflow: hidden;
    padding: 9px 9px 17px 11px;
    border: 1px solid var(--toast-border-color);
    border-radius: 11px;
    background: linear-gradient(112deg, #ffffff 0%, var(--toast-soft-color) 155%);
    box-shadow: 0 8px 20px rgba(23, 42, 71, 0.16);
    color: var(--toast-color);
    font-family: inherit;
    opacity: 0;
    pointer-events: auto;
    transform: translateY(16px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.toast--hiding {
    opacity: 0;
    transform: translateY(16px);
}

.toast--error {
    --toast-color: #e73d46;
    --toast-soft-color: #fff0f1;
    --toast-border-color: #ff8f96;
    --toast-progress-track-color: rgba(231, 61, 70, 0.16);
}

.toast--warning {
    --toast-color: #d98209;
    --toast-soft-color: #fff7e9;
    --toast-border-color: #ffc76a;
    --toast-progress-track-color: rgba(217, 130, 9, 0.16);
}

.toast__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--toast-color);
    color: #ffffff;
    font-size: 14px;
}

.toast__message {
    margin: 0;
    color: var(--toast-color);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.4;
}

.toast__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    transition: background-color 150ms ease, color 150ms ease;
}

.toast__close:hover,
.toast__close:focus-visible {
    background: rgba(100, 116, 139, 0.12);
    color: #334155;
    outline: none;
}

.toast__progress-track {
    position: absolute;
    right: 14px;
    bottom: 6px;
    left: 51px;
    height: 4px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--toast-progress-track-color);
}

.toast__progress {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: var(--toast-color);
    transform-origin: left center;
}

.toast--timed .toast__progress {
    animation: toast-progress var(--toast-duration) linear forwards;
}

@keyframes toast-progress {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 640px) {
    .toast-container {
        bottom: 14px;
        max-width: 90vw;
    }

    .toast {
        min-height: 56px;
        border-radius: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast__progress {
        transition: none;
        animation: none;
    }
}
