.system-toast-stack {
    position: fixed;
    top: 84px;
    right: 20px;
    z-index: 11000;
    display: flex;
    width: min(390px, calc(100vw - 32px));
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.system-toast {
    --toast-accent: #64748b;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    width: 100%;
    height: auto;
    padding: 12px 10px 12px 12px;
    color: #1f2937;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-left: 4px solid var(--toast-accent);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
    animation: system-toast-in 260ms cubic-bezier(.21, .9, .3, 1) both;
    backdrop-filter: blur(12px);
}

.system-toast--success { --toast-accent: #16a34a; }
.system-toast--info { --toast-accent: #2563eb; }
.system-toast--warning { --toast-accent: #d97706; }
.system-toast--error { --toast-accent: #dc2626; }

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

.system-toast__content {
    min-width: 0;
    padding-top: 1px;
}

.system-toast__title {
    display: block;
    margin-bottom: 2px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
}

.system-toast__message {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

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

.system-toast__close:hover,
.system-toast__close:focus-visible {
    color: #0f172a;
    background: #f1f5f9;
    outline: none;
}

.system-toast.is-leaving {
    animation: system-toast-out 200ms ease-in both;
}

@keyframes system-toast-in {
    from { opacity: 0; transform: translateX(calc(100% + 30px)); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes system-toast-out {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(calc(100% + 30px)); }
}

@media (max-width: 575.98px) {
    .system-toast-stack {
        top: 70px;
        right: 12px;
        width: calc(100vw - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .system-toast,
    .system-toast.is-leaving {
        animation-duration: 1ms;
    }
}
