/**
* UX2 notification — appjs/common/ux2/notify.js (skoNotify). A dark bar at the bottom centre with a round mark, the
 * Activities notch's look (LXP-2655, LXP-2656): a green ✓ for done and a red ✕ for a problem that draw themselves, a
 * blue i for a note, an amber ! for a warning. Above drawers and windows. Replaces toastr's top-right boxes and the
 * page-only toasts (hj-, ds-, dk-…) as pages are touched.
 */
.ux2-notify-stack {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: max-content;
    max-width: calc(100vw - 32px);
    transform: translateX(-50%);
    pointer-events: none;
    transition: bottom .2s ease; /* above a selection bar while one shows (notify.js place(); LXP-2668) */
}

.ux2-notify {
    --ux2-notify-c: #16a34a;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 560px;
    min-height: 48px;
    padding: 8px 8px 8px 10px;
    border-radius: 24px;
    background: #0b0d10;
    color: #fff;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .55);
    pointer-events: auto;
    animation: ux2-notify-in .2s ease-out;
}

.ux2-notify.is-err { --ux2-notify-c: #dc2626; }
.ux2-notify.is-info { --ux2-notify-c: #3b82f6; }
.ux2-notify.is-warn { --ux2-notify-c: #f59e0b; }

.ux2-notify.is-leaving {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
}

/* The round mark: the circle pops in, then the ✓ or ✕ draws itself */
.ux2-notify-dot {
    position: relative;
    flex: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--ux2-notify-c);
    animation: ux2-notify-pop .3s cubic-bezier(.34, 1.2, .64, 1) both;
}

.ux2-notify-dot::before,
.ux2-notify-dot::after {
    position: absolute;
    content: "";
}

/* ✓: an L turned 45°; the short stroke draws first, then the long one upwards */
.ux2-notify.is-ok .ux2-notify-dot::after {
    top: 8px;
    left: 12px;
    width: 8px;
    height: 14px;
    border-right: 2.5px solid #fff;
    border-bottom: 2.5px solid #fff;
    border-radius: 1px;
    transform: rotate(45deg);
    animation: ux2-notify-tick .4s ease-out .18s both;
}

/* ✕: two strokes, one after the other */
.ux2-notify.is-err .ux2-notify-dot::before,
.ux2-notify.is-err .ux2-notify-dot::after {
    top: 15px;
    left: 9px;
    width: 14px;
    height: 2.5px;
    background: #fff;
    border-radius: 2px;
    transform: rotate(45deg) scaleX(0);
    animation: ux2-notify-cross .2s ease-out .2s forwards;
}

.ux2-notify.is-err .ux2-notify-dot::after {
    --ux2-notify-turn: -45deg;
    transform: rotate(-45deg) scaleX(0);
    animation-delay: .34s;
}

/* i and !: a calm letter in the app's font, no drawing */
.ux2-notify.is-info .ux2-notify-dot::after,
.ux2-notify.is-warn .ux2-notify-dot::after {
    inset: 0;
    display: grid;
    place-items: center;
    font-family: inherit;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    content: "i";
}

/* White on amber is too faint (2.2:1); dark reads clearly (6.8:1) */
.ux2-notify.is-warn .ux2-notify-dot::after {
    color: #1f2937;
    content: "!";
}

.ux2-notify-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ux2-notify-x {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: none;
    color: rgba(255, 255, 255, .7);
    font-size: 11px;
}

.ux2-notify-x:hover,
.ux2-notify-x:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

.ux2-notify-x:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .6);
}

@keyframes ux2-notify-pop {
    from { transform: scale(.3); opacity: 0; }
}

@keyframes ux2-notify-tick {
    0% { clip-path: inset(calc(100% - 3px) 100% 0 0); }
    40% { clip-path: inset(calc(100% - 3px) 0 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}

@keyframes ux2-notify-cross {
    to { transform: rotate(var(--ux2-notify-turn, 45deg)) scaleX(1); }
}

@keyframes ux2-notify-in {
    from { opacity: 0; transform: translateY(8px); }
}

@media (prefers-reduced-motion: reduce) {
    .ux2-notify,
    .ux2-notify-dot,
    .ux2-notify.is-ok .ux2-notify-dot::after,
    .ux2-notify.is-err .ux2-notify-dot::before,
    .ux2-notify.is-err .ux2-notify-dot::after {
        animation: none;
    }

    .ux2-notify.is-err .ux2-notify-dot::before {
        transform: rotate(45deg);
    }

    .ux2-notify.is-err .ux2-notify-dot::after {
        transform: rotate(-45deg);
    }

    .ux2-notify.is-leaving {
        transition: none;
    }
}

/* Calm (Display and accessibility): the mark shows at once */
html.ux2-calm .ux2-notify,
html.ux2-calm .ux2-notify-dot,
html.ux2-calm .ux2-notify.is-ok .ux2-notify-dot::after,
html.ux2-calm .ux2-notify.is-err .ux2-notify-dot::before,
html.ux2-calm .ux2-notify.is-err .ux2-notify-dot::after {
    animation: none;
}

html.ux2-calm .ux2-notify.is-err .ux2-notify-dot::before {
    transform: rotate(45deg);
}

html.ux2-calm .ux2-notify.is-err .ux2-notify-dot::after {
    transform: rotate(-45deg);
}

/* Pages without components.css still hide the screen-reader label */
.ux2-notify .ux2-vh {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}
