.flash-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1000011;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(420px, calc(100vw - 2.5rem));
    pointer-events: none;
}

.flash-toast {
    --toast-duration: 3s;
    position: relative;
    pointer-events: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
    will-change: transform, opacity;
    transition:
        transform 0.55s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.45s ease;
}

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

.flash-toast--leaving {
    transform: translateX(calc(100% + 2rem));
    opacity: 0;
}

.flash-toast__accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.flash-toast--success .flash-toast__accent {
    background: #16a34a;
}

.flash-toast--error .flash-toast__accent {
    background: #dc2626;
}

.flash-toast__body {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1rem 1.1rem 1.15rem;
}

.flash-toast__icon {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.flash-toast--success .flash-toast__icon {
    background: #dcfce7;
    color: #16a34a;
}

.flash-toast--error .flash-toast__icon {
    background: #fee2e2;
    color: #dc2626;
}

.flash-toast__content {
    flex: 1;
    min-width: 0;
    padding-top: 0.1rem;
}

.flash-toast__title {
    margin: 0 0 0.2rem;
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
}

.flash-toast__message {
    margin: 0;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.45;
    word-break: break-word;
}

.flash-toast__close {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #94a3b8;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s ease;
}

.flash-toast__close:hover {
    color: #475569;
}

.flash-toast__timer {
    height: 3px;
    background: #f1f5f9;
    overflow: hidden;
}

.flash-toast__timer-line {
    display: block;
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation: flashToastTimer var(--toast-duration) linear forwards;
}

.flash-toast--success .flash-toast__timer-line {
    background: #16a34a;
}

.flash-toast--error .flash-toast__timer-line {
    background: #dc2626;
}

.flash-toast--soft-success {
    background: #ecfdf5;
    border-color: #bbf7d0;
    box-shadow: 0 14px 36px rgba(26, 107, 60, 0.12);
}

.flash-toast--soft-success .flash-toast__body {
    padding: 1rem 1rem 1.1rem;
}

.flash-toast--soft-success .flash-toast__icon {
    background: #d1fae5;
    color: #15803d;
}

.flash-toast--soft-success .flash-toast__title {
    color: #14532d;
}

.flash-toast--soft-success .flash-toast__close {
    color: #6b9080;
}

.flash-toast--soft-success .flash-toast__close:hover {
    color: #14532d;
}

.flash-toast--soft-success .flash-toast__timer {
    background: #dcfce7;
}

.flash-toast--soft-success .flash-toast__timer-line {
    background: #86efac;
}

@keyframes flashToastTimer {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

@media (max-width: 575.98px) {
    .flash-toast-stack {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
        width: auto;
    }
}
