/* Global toast notifications
   Converts top-level .alert success/error/warning/info messages into fixed toasts via layout footer JS.
   Inline .alert boxes inside content cards remain unchanged for diagnostic/detail content. */
.toast-stack {
    position: fixed;
    top: 18px;
    right: 18px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(420px, calc(100vw - 28px));
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: start;
    padding: 12px 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-left-width: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.98);
   
    color: #0f172a;
    opacity: 0;
    transform: translateY(-8px) translateX(8px);
    transition: opacity 180ms ease, transform 180ms ease;
    overflow: hidden;
}

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

.toast.is-leaving {
    opacity: 0;
    transform: translateY(-6px) translateX(12px);
}

.toast-icon {
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    line-height: 1;
}

.toast-body {
    min-width: 0;
}

.toast-title {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #334155;
}

.toast-message {
    font-size: 14px;
    line-height: 1.42;
    color: #0f172a;
    overflow-wrap: anywhere;
}

.toast-message a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.toast-close {
    appearance: none;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.toast-close:hover,
.toast-close:focus-visible {
    color: #0f172a;
    background: rgba(15, 23, 42, 0.06);
    outline: none;
}

.toast-success {
    border-left-color: #16a34a;
}

.toast-success .toast-icon {
    background: #dcfce7;
    color: #166534;
}

.toast-error {
    border-left-color: #dc2626;
}

.toast-error .toast-icon {
    background: #fee2e2;
    color: #991b1b;
}

.toast-warning {
    border-left-color: #d97706;
}

.toast-warning .toast-icon {
    background: #fef3c7;
    color: #92400e;
}

.toast-info {
    border-left-color: #2563eb;
}

.toast-info .toast-icon {
    background: #dbeafe;
    color: #1e40af;
}

@media (max-width: 640px) {
    .toast-stack {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .toast {
        grid-template-columns: 26px minmax(0, 1fr) 26px;
        padding: 11px 10px;
    }
}
