.app-toast-stack {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    width: min(22rem, calc(100vw - 2.5rem));
    pointer-events: none;
}

.app-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 0.875rem 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.04),
        0 8px 24px rgba(15, 23, 42, 0.08);
    color: #0f172a;
    font-size: 0.875rem;
    line-height: 1.45;
    animation: app-toast-enter 0.32s cubic-bezier(0.21, 1, 0.32, 1);
    overflow: hidden;
}

.app-toast.is-leaving {
    animation: app-toast-leave 0.2s ease-in forwards;
}

.app-toast__accent {
    width: 3px;
    align-self: stretch;
    border-radius: 999px;
    flex-shrink: 0;
    margin-block: 0.125rem;
}

.app-toast--success .app-toast__accent {
    background: #10b981;
}

.app-toast--error .app-toast__accent {
    background: #ef4444;
}

.app-toast--warning .app-toast__accent {
    background: #f59e0b;
}

.app-toast--info .app-toast__accent {
    background: #6366f1;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
    padding-top: 0.0625rem;
}

.app-toast__title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
    margin-bottom: 0.125rem;
}

.app-toast__message {
    font-weight: 500;
    color: #1e293b;
    word-break: break-word;
}

.app-toast__close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #94a3b8;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    font-size: 1.125rem;
    line-height: 1;
    padding: 0;
    margin: -0.125rem -0.125rem 0 0;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.app-toast__close:hover {
    color: #475569;
    background: rgba(15, 23, 42, 0.05);
}

.app-toast__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    background: currentColor;
    opacity: 0.35;
    transform-origin: left center;
    animation: app-toast-progress linear forwards;
}

.app-toast {
    position: relative;
}

.app-toast--success {
    color: #10b981;
}

.app-toast--error {
    color: #ef4444;
}

.app-toast--warning {
    color: #f59e0b;
}

.app-toast--info {
    color: #6366f1;
}

@keyframes app-toast-enter {
    from {
        opacity: 0;
        transform: translateX(1rem) scale(0.98);
    }

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

@keyframes app-toast-leave {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(0.75rem) scale(0.98);
    }
}

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

    to {
        transform: scaleX(0);
    }
}

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