.bwd-toast-wrap {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.bwd-toast {
    --toast-color: #0a7450;
    --toast-bg: #ffffff;
    --toast-text: #1f2937;
    --toast-shadow: 0 14px 34px rgba(0, 0, 0, 0.12);

    min-width: 300px;
    max-width: 420px;
    background: var(--toast-bg);
    color: var(--toast-text);
    border-radius: 16px;
    box-shadow: var(--toast-shadow);
    border: 1px solid rgba(0, 0, 0, 0.06);
    overflow: hidden;
    position: relative;
    pointer-events: auto;

    display: flex;
    align-items: stretch;

    opacity: 0;
    transform: translateX(40px) scale(0.96);
    animation: bwdToastIn 0.45s cubic-bezier(.22, 1, .36, 1) forwards;
}

.bwd-toast.is-hiding {
    animation: bwdToastOut 0.35s cubic-bezier(.55, 0, .75, 0) forwards;
}

.bwd-toast::before {
    content: "";
    width: 5px;
    background: var(--toast-color);
    flex: 0 0 5px;
}

.bwd-toast__inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px 16px;
    width: 100%;
    position: relative;
}

.bwd-toast__icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--toast-color) 14%, white);
    color: var(--toast-color);
    font-size: 18px;
    font-weight: 700;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--toast-color) 18%, white);
    padding-top: 7px;
}

.bwd-toast__content {
    flex: 1;
    min-width: 0;
}

.bwd-toast__title {
    font-size: 14px;
    line-height: 1.2;
    font-weight: 700;
    margin: 1px 0 5px;
}

.bwd-toast__message {
    font-size: 13px;
    line-height: 1.55;
    opacity: 0.85;
    word-break: break-word;
}

.bwd-toast__close {
    border: 0 !important;
    background: transparent;
    color: #6b7280 !important;
    cursor: pointer !important;
    font-size: 18px !important;
    line-height: 1 !important;
    padding: 4px !important;
    margin: -2px -2px 0 0 !important;
    border-radius: 8px !important;
    transition: all 0.2s ease;
}

.bwd-toast__close:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #111827;
    transform: rotate(90deg);
}

.bwd-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: color-mix(in srgb, var(--toast-color) 18%, white);
    overflow: hidden;
}

.bwd-toast__progress-bar {
    height: 100%;
    width: 100%;
    background: var(--toast-color);
    transform-origin: left center;
    animation: bwdToastProgress linear forwards;
}

/* states */
.bwd-toast--done {
    --toast-color: #0a7450;
}

.bwd-toast--problem {
    --toast-color: #a35400;
}

.bwd-toast--incorrect {
    --toast-color: #c4281c;
}

/* animations */
@keyframes bwdToastIn {
    0% {
        opacity: 0;
        transform: translateX(40px) scale(0.96);
    }

    60% {
        opacity: 1;
        transform: translateX(-4px) scale(1.01);
    }

    100% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes bwdToastOut {
    0% {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translateX(38px) scale(0.96);
    }
}

@keyframes bwdToastProgress {
    from {
        transform: scaleX(1);
    }

    to {
        transform: scaleX(0);
    }
}

@media (max-width: 640px) {
    .bwd-toast-wrap {
        top: 14px;
        right: 14px;
        left: 14px;
    }

    .bwd-toast {
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
}