/* V175 — isolated runtime styling for BJAS process notifications.
 *
 * The approved shell runs ux_foundation.js without loading the complete
 * ux_foundation.css visual system. Keep this file deliberately limited to
 * toast markup so process feedback never falls back to a normal page section.
 */

#bjasUxToastRegion.ux-toast-region {
    position: fixed !important;
    z-index: var(--bjas-z-toast, 1900) !important;
    top: calc(var(--shell-header-height, 72px) + 14px) !important;
    right: 14px !important;
    bottom: auto !important;
    left: auto !important;
    box-sizing: border-box !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-content: start !important;
    gap: 9px !important;
    width: min(380px, calc(100vw - 28px)) !important;
    min-width: 0 !important;
    max-width: calc(100vw - 28px) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - var(--shell-header-height, 72px) - 28px) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #172033 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: none !important;
    isolation: isolate !important;
    font-family: var(--font-app, "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif) !important;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast,
:where(#bjasUxToastRegion).ux-toast-region > .ux-toast * {
    box-sizing: border-box;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast {
    position: relative;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: start;
    gap: 10px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    margin: 0;
    padding: 12px;
    border: 1px solid #dfe5ee;
    border-left: 4px solid #28597a;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(16, 24, 40, 0.14);
    color: #172033;
    overflow: visible;
    pointer-events: auto;
    font-family: inherit;
    animation: bjas-toast-v175-in 180ms ease-out both;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast[data-tone="success"] {
    border-color: #166534;
    background: #166534;
    box-shadow: 0 18px 38px rgba(22, 101, 52, 0.3);
    color: #ffffff;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast[data-tone="warning"] {
    border-left-color: #9a5a00;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast[data-tone="error"] {
    border-color: #b42318;
    background: #b42318;
    box-shadow: 0 18px 38px rgba(180, 35, 24, 0.3);
    color: #ffffff;
}

:where(#bjasUxToastRegion).ux-toast-region > .ux-toast.is-leaving {
    animation: bjas-toast-v175-out 150ms ease-in both;
}

:where(#bjasUxToastRegion) .ux-toast__icon {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: #eef6fb;
    color: #28597a;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="success"] .ux-toast__icon,
:where(#bjasUxToastRegion) .ux-toast[data-tone="error"] .ux-toast__icon {
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="warning"] .ux-toast__icon {
    background: #fff7e8;
    color: #9a5a00;
}

:where(#bjasUxToastRegion) .ux-toast__copy {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
}

:where(#bjasUxToastRegion) .ux-toast__title {
    display: block;
    margin: 0 0 2px;
    padding: 0;
    color: #172033;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

:where(#bjasUxToastRegion) .ux-toast__message {
    display: block;
    margin: 0;
    padding: 0;
    color: #667085;
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="success"] :is(.ux-toast__title, .ux-toast__message),
:where(#bjasUxToastRegion) .ux-toast[data-tone="error"] :is(.ux-toast__title, .ux-toast__message) {
    color: #ffffff;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="success"] .ux-toast__message,
:where(#bjasUxToastRegion) .ux-toast[data-tone="error"] .ux-toast__message {
    color: rgba(255, 255, 255, 0.92);
}

:where(#bjasUxToastRegion) .ux-toast__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

:where(#bjasUxToastRegion) .ux-toast__action,
:where(#bjasUxToastRegion) .ux-toast__close {
    position: static;
    display: inline-grid;
    place-items: center;
    width: auto;
    min-width: 0;
    max-width: none;
    min-height: 28px;
    height: auto;
    margin: 0;
    padding: 5px 8px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    box-shadow: none;
    color: #153153;
    opacity: 1;
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    text-transform: none;
    transform: none;
}

:where(#bjasUxToastRegion) .ux-toast__close {
    width: 28px;
    padding: 0;
    color: #667085;
    font-size: 16px;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="success"] :is(.ux-toast__action, .ux-toast__close),
:where(#bjasUxToastRegion) .ux-toast[data-tone="error"] :is(.ux-toast__action, .ux-toast__close) {
    color: #ffffff;
}

:where(#bjasUxToastRegion) .ux-toast[data-tone="success"] :is(.ux-toast__action, .ux-toast__close):hover,
:where(#bjasUxToastRegion) .ux-toast[data-tone="error"] :is(.ux-toast__action, .ux-toast__close):hover {
    background: rgba(255, 255, 255, 0.14);
}

@keyframes bjas-toast-v175-in {
    from { opacity: 0; transform: translate3d(12px, -4px, 0); }
    to { opacity: 1; transform: translate3d(0, 0, 0); }
}

@keyframes bjas-toast-v175-out {
    from { opacity: 1; transform: translate3d(0, 0, 0); }
    to { opacity: 0; transform: translate3d(12px, -4px, 0); }
}

@media (max-width: 640px) {
    #bjasUxToastRegion.ux-toast-region {
        top: calc(var(--shell-header-height, 64px) + 10px) !important;
        right: 10px !important;
        bottom: auto !important;
        width: calc(100vw - 20px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100dvh - var(--shell-header-height, 64px) - 20px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    :where(#bjasUxToastRegion).ux-toast-region > .ux-toast {
        animation: none;
    }
}
