:root {
    --toast-success: #393;
    --toast-info: #36f;
    --toast-warning: #f93;
    --toast-error: #f33;
    --toast-color: var(--toast-info);
}
.toast {
    display: none;
    min-width: 16rem;
    width: calc(100% - 3rem);
    max-width: 25rem;
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translate(-50%, 0);
    background-color: #fff;
    box-shadow: 0 0.1rem 1rem #3338;
    border-radius: 0.3rem;
    overflow: hidden;
}
.toast[data-state='success'] {
    --toast-color: var(--toast-success);
}
.toast[data-state='info'] {
    --toast-color: var(--toast-info);
}
.toast[data-state='warning'] {
    --toast-color: var(--toast-warning);
}
.toast[data-state='error'] {
    --toast-color: var(--toast-error);
}
.toast.show {
    display: inline-block;
}
.toast .content {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}
.toast .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--toast-color);
}
.toast .icon > svg {
    display: none;
    width: 3rem;
    height: 3rem;
    padding: 0.5rem;
    color: #fff;
}
.toast[data-state='success'] .icon > svg.success,
.toast[data-state='info'] .icon > svg.info,
.toast[data-state='warning'] .icon > svg.warning,
.toast[data-state='error'] .icon > svg.error {
    display: block;
}
.toast .close {
    display: flex;
    margin-left: auto;
    align-items: flex-start;
    justify-content: center;
    width: 3rem;
    color: #444;
    cursor: pointer;
}
.toast .close:hover {
    color: #222;
}
.toast .close > svg {
    display: inline-block;
    width: 2.4rem;
    height: 3.4rem;
    padding: 1rem 0.5rem;
}
.toast p {
    padding: 1rem 0;
    font-size: 1rem;
    line-height: 1.2rem;
    color: #444;
}
.toast .progress {
    width: 100%;
    height: 0.3rem;
    background-color: #ccc;
}
.toast .progress > .bar {
    width: 100%;
    height: 100%;
    background-color: var(--toast-color);
}
.toast .progress > .bar.animate {
    animation: toasting 10s linear forwards;
}
.toast .progress > .bar.animate.fast {
    animation: toasting 2s linear forwards;
}
.toast.pause > .progress > .bar.animate {
    animation-play-state: paused;
}

@media (min-height: 600px) {
    .toast {
        bottom: 3rem;
    }
}

@keyframes toasting {
    0% {
        width: 100%;
    }
    100% {
        width: 0;
    }
}
