/* ==========================================================================
   Toast notifications
   ========================================================================== */

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

.toast {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 13px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in 220ms var(--ease);
}

.toast.is-leaving {
    animation: toast-out 160ms var(--ease) forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes toast-out {
    to { opacity: 0; transform: translateX(14px); }
}

.toast-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand-text);
}

.toast-icon .icon {
    width: 15px;
    height: 15px;
}

.toast-copy {
    flex: 1;
    min-width: 0;
    padding-top: 1px;
}

.toast-title {
    display: block;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text);
    line-height: 1.4;
}

.toast-message {
    display: block;
    margin-top: 1px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.toast-close {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: var(--radius-xs);
    color: var(--text-faint);
}

.toast-close:hover {
    background: var(--surface-3);
    color: var(--text);
}

.toast-close .icon {
    width: 14px;
    height: 14px;
}

.toast--success { border-left-color: var(--accent); }
.toast--success .toast-icon { background: var(--accent-soft); color: var(--accent-text); }

.toast--warning { border-left-color: var(--warning); }
.toast--warning .toast-icon { background: var(--warning-soft); color: var(--warning-text); }

.toast--danger { border-left-color: var(--danger); }
.toast--danger .toast-icon { background: var(--danger-soft); color: var(--danger-text); }

.toast--info { border-left-color: var(--info); }
.toast--info .toast-icon { background: var(--info-soft); color: var(--info-text); }
