#wmr-banner-stack {
    position: fixed;
    z-index: 1090;
    inset: auto max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: .6rem;
    pointer-events: none;
}

#wmr-banner-stack > * { pointer-events: auto; }
#wmr-banner-stack[data-demo] > :not([data-demo-notice], #wmrUpdateBanner),
#wmr-banner-stack:has(> #wmrUpdateBanner:not([hidden])) > :not(#wmrUpdateBanner),
body:has(#notif-bell[aria-expanded="true"]) .wmr-personal-notice,
.desktop-embedded #wmr-banner-stack,
.desktop-embedded #wmr-chip-stack { display: none; }

.wmr-notice-card {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 1rem;
    width: min(28rem, calc(100vw - 2rem));
    box-sizing: border-box;
    padding: 1.2rem;
    isolation: isolate;
    color: #f2f7ff;
    animation: wmr-update-arrive .32s ease-out both;
    --wmr-notice-accent: #a4f5df;
    --wmr-notice-edge: #70e9f5;
    --wmr-notice-edge-mid: #42648d;
    --wmr-notice-edge-end: #ad62cc;
    --wmr-notice-shade: #131c34;
    --wmr-notice-shade-end: #1a1631;
    --wmr-notice-glow: rgb(38 145 199 / .25);
    --wmr-notice-grid: rgb(131 196 248 / .12);
    --wmr-notice-dark: #111b30;
    --wmr-notice-grid-base: #263957;
    --wmr-notice-cut: polygon(0 16px, 16px 0, calc(100% - 23px) 0, 100% 23px,
        100% calc(100% - 16px), calc(100% - 16px) 100%, 22px 100%, 0 calc(100% - 22px));
    --wmr-update-top-rail: polygon(0 16px, 16px 0, 38% 0, 38% 2px,
        17px 2px, 2px 17px, 2px 43%, 0 43%);
    --wmr-update-bottom-rail: polygon(100% calc(100% - 16px), calc(100% - 16px) 100%,
        63% 100%, 63% calc(100% - 2px), calc(100% - 17px) calc(100% - 2px),
        calc(100% - 2px) calc(100% - 17px), calc(100% - 2px) 67%, 100% 67%);
}

.wmr-update-banner {
    position: fixed;
    z-index: 1090;
    inset: auto max(1.25rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) auto;
}

#wmr-banner-stack > .wmr-update-banner {
    position: relative;
    inset: auto;
}

.wmr-notice-card[hidden],
.wmr-notice-card [hidden] { display: none; }

.wmr-notice-card[data-tone="red"] {
    --wmr-notice-accent: #ffc1ca;
    --wmr-notice-edge: #ff9a9d;
    --wmr-notice-edge-mid: #844354;
    --wmr-notice-edge-end: #b45c80;
    --wmr-notice-shade: #2d1724;
    --wmr-notice-shade-end: #231323;
    --wmr-notice-glow: rgb(222 60 81 / .26);
    --wmr-notice-grid: rgb(255 148 156 / .13);
    --wmr-notice-dark: #2b1520;
    --wmr-notice-grid-base: #482533;
}

.wmr-notice-card[data-tone="amber"] {
    --wmr-notice-accent: #ffcf95;
    --wmr-notice-edge: #ffc17e;
    --wmr-notice-edge-mid: #8d5c3a;
    --wmr-notice-edge-end: #bd7456;
    --wmr-notice-shade: #2d201b;
    --wmr-notice-shade-end: #271920;
    --wmr-notice-glow: rgb(231 129 42 / .25);
    --wmr-notice-grid: rgb(255 184 115 / .14);
    --wmr-notice-dark: #2b1d1b;
    --wmr-notice-grid-base: #463128;
}

.wmr-notice-card[data-tone="green"] {
    --wmr-notice-accent: #a0f2c5;
    --wmr-notice-edge: #7ee6ad;
    --wmr-notice-edge-mid: #396e62;
    --wmr-notice-edge-end: #539c90;
    --wmr-notice-shade: #152a28;
    --wmr-notice-shade-end: #17242c;
    --wmr-notice-glow: rgb(34 174 124 / .26);
    --wmr-notice-grid: rgb(127 226 175 / .13);
    --wmr-notice-dark: #132821;
    --wmr-notice-grid-base: #26423a;
}

.wmr-notice-surface {
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    filter: drop-shadow(0 12px 22px rgb(7 15 38 / .38));
}

.wmr-notice-surface::before,
.wmr-notice-surface::after {
    position: absolute;
    content: "";
    clip-path: var(--wmr-notice-cut);
}

.wmr-notice-surface::before {
    inset: 0;
    background: linear-gradient(128deg, var(--wmr-notice-edge), var(--wmr-notice-edge-mid) 23%,
        var(--wmr-notice-edge-mid) 61%, var(--wmr-notice-edge-end));
}

.wmr-notice-surface::after {
    inset: 1px;
    background:
        linear-gradient(108deg, transparent 1.5rem, var(--wmr-notice-shade) 55%, var(--wmr-notice-shade-end)),
        radial-gradient(ellipse at 15% 34%, var(--wmr-notice-glow), transparent 60%),
        repeating-linear-gradient(90deg, transparent 0 14px, var(--wmr-notice-grid) 14px 15px),
        repeating-linear-gradient(0deg, var(--wmr-notice-dark) 0 14px, var(--wmr-notice-grid-base) 14px 15px);
}

.wmr-alert-banner,
.wmr-personal-notice {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .75rem;
    width: min(25rem, calc(100vw - 2rem));
    padding: .9rem 1rem;
    font-size: .84rem;
    line-height: 1.4;
}

.wmr-alert-banner:not(.is-open) { display: none; }

.wmr-notice-symbol {
    display: grid;
    place-items: center;
    width: 2.45rem;
    height: 2.45rem;
    border: 1px solid var(--wmr-notice-edge-mid);
    border-radius: 0 .58rem;
    background: linear-gradient(145deg, var(--wmr-notice-glow), var(--wmr-notice-dark));
    color: var(--wmr-notice-accent);
    font-size: 1.2rem;
    animation: wmr-notice-pulse 2.6s ease-in-out infinite;
}

@keyframes wmr-notice-pulse {
    0%, 100% { box-shadow: inset 0 0 .45rem var(--wmr-notice-glow); }
    50% { box-shadow: inset 0 0 .9rem var(--wmr-notice-glow), 0 0 .65rem var(--wmr-notice-glow); }
}

.wmr-notice-copy,
.wmr-alert-banner__msg { overflow-wrap: anywhere; }
.wmr-alert-banner__msg { align-self: center; }
.wmr-notice-copy strong,
.wmr-notice-copy p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.wmr-notice-copy strong { -webkit-line-clamp: 3; font-size: .91rem; }
.wmr-notice-copy p { -webkit-line-clamp: 2; margin: .2rem 0 0; color: #e2e8f4; }
.wmr-notice-copy p:empty { display: none; }

.wmr-notice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem .85rem;
    margin-top: .48rem;
}

.wmr-notice-actions a,
.wmr-notice-actions button,
.wmr-alert-banner__action,
.wmr-alert-banner__link {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--wmr-notice-accent);
    font: inherit;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: .15em;
    cursor: pointer;
}

.wmr-alert-banner__action {
    display: block;
    margin-top: .4rem;
}
.wmr-alert-banner__sep { margin-inline: .4rem; }

.wmr-notice-actions a:hover,
.wmr-notice-actions button:hover,
.wmr-alert-banner__action:hover,
.wmr-alert-banner__link:hover { color: #fff; }

.wmr-update-banner[data-outcome="running"]::before,
.wmr-update-banner[data-outcome="running"]::after {
    position: absolute;
    z-index: 1;
    inset: 0;
    content: "";
    background: currentColor;
    pointer-events: none;
    opacity: 0;
    animation: wmr-update-edge-glitch 5.8s linear infinite;
}

.wmr-update-banner[data-outcome="running"]::before {
    color: #68f5e8;
    --glitch-offset: -3px;
}

.wmr-update-banner[data-outcome="running"]::after {
    color: #ff76cf;
    --glitch-offset: 3px;
    animation-delay: .13s;
}

.wmr-update-orbit {
    position: relative;
    display: grid;
    place-items: center;
    width: 4.65rem;
    height: 4.65rem;
    border: 1px solid #4d83a4;
    border-radius: 0 .72rem;
    background:
        radial-gradient(ellipse, rgb(51 111 165 / .55), transparent 70%),
        linear-gradient(150deg, #182a4a, #101426 74%);
    box-shadow: inset 0 0 1rem rgb(66 197 239 / .12), 0 0 .8rem rgb(74 214 244 / .14);
}

.wmr-update-banner[data-outcome="running"] {
    width: min(31rem, calc(100vw - 2rem));
}

.wmr-update-banner[data-outcome="running"] .wmr-update-status { align-self: center; }

.wmr-update-banner[data-outcome="running"] .wmr-update-orbit {
    align-self: center;
    width: 7.6rem;
    height: 7.6rem;
    background:
        repeating-linear-gradient(0deg, transparent 0 3px, rgb(105 182 249 / .06) 3px 4px),
        radial-gradient(ellipse at 42% 52%, #192953, #131c39 64%, #0c142a);
}

.wmr-update-orbit::before,
.wmr-update-orbit::after {
    position: absolute;
    content: "";
    border-radius: 50%;
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 1px));
}

.wmr-update-orbit::before {
    inset: .27rem;
    background: conic-gradient(from 25deg, #7dfff2 0deg 66deg, #4676ac 66deg 89deg,
        transparent 89deg 155deg, #ff73cf 155deg 193deg, transparent 193deg 224deg,
        #5973c2 224deg 280deg, transparent 280deg);
    animation: wmr-update-spin 3s linear infinite;
}

.wmr-update-orbit::after {
    inset: .58rem;
    background: conic-gradient(from 120deg, #98a7ff 0deg 47deg, transparent 47deg 95deg,
        #4decdc 95deg 156deg, transparent 156deg 230deg, #ff90d7 230deg 251deg, transparent 251deg);
    animation: wmr-update-spin 4.4s linear infinite reverse;
}

.wmr-update-orbit canvas {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
}

.wmr-update-orbit canvas:not([hidden]) + span { display: none; }

.wmr-update-orbit > span {
    position: relative;
    z-index: 1;
    width: 1.36rem;
    height: 1.36rem;
    background: linear-gradient(145deg, #e0fffc 0%, #57f4e3 38%, #a693ff 68%, #ff8ad7 100%);
    --orbit-diamond: polygon(50% 3%, 65% 20%, 80% 34%, 97% 50%, 80% 66%, 65% 80%,
        50% 97%, 35% 80%, 20% 66%, 3% 50%, 20% 34%, 35% 20%);
    clip-path: var(--orbit-diamond);
    animation: wmr-update-morph 3.7s ease-in-out infinite;
}

.wmr-update-status strong { font-size: 1.05rem; }
.wmr-update-status p { margin: .2rem 0 0; font-size: .82rem; line-height: 1.45; color: #c6d6ee; }
.wmr-update-status .wmr-update-stage { margin-top: .65rem; color: #a4f5df; }
.wmr-update-stage:empty { display: none; }

.wmr-update-track {
    height: .3rem;
    margin-top: .45rem;
    overflow: hidden;
    border-radius: .1rem;
    background: repeating-linear-gradient(90deg, #354968 0 9px, #2a3551 9px 10px);
}

.wmr-update-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(95deg, #75a6ff, #7cf9f0, #ac88fe, #75a6ff);
    background-size: 200% 100%;
    transition: width .45s ease-out;
    animation: wmr-update-shimmer 2.8s linear infinite;
}

.wmr-update-preview {
    margin-top: .75rem;
    padding: .38rem .65rem;
    border: 1px solid #638db0;
    border-radius: .22rem .58rem;
    background: linear-gradient(115deg, #254a61, #32294f);
    color: #f2f7ff;
    font: inherit;
    font-size: .82rem;
    font-weight: 650;
    cursor: pointer;
}

.wmr-update-preview:hover { background: #324f73; }

.wmr-update-banner[data-outcome="failed"],
.wmr-update-banner[data-banner-preview="1"] { grid-template-columns: auto minmax(0, 1fr) auto; }
.wmr-update-banner[data-outcome="failed"] .wmr-update-orbit::before,
.wmr-update-banner[data-outcome="failed"] .wmr-update-orbit::after { display: none; }
.wmr-update-banner[data-outcome="failed"] .wmr-update-orbit > span {
    width: .62rem;
    height: .62rem;
    background: #ffcd8d;
    border-radius: 50%;
    clip-path: none;
    animation: none;
}
.wmr-notice-dismiss {
    border: 0;
    border-radius: .35rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 1.25rem;
    line-height: 1.2;
    min-width: 1.75rem;
    min-height: 1.75rem;
    cursor: pointer;
}

.wmr-notice-dismiss:hover { background: rgb(255 255 255 / .12); }

.wmr-release-notes {
    width: min(35rem, calc(100vw - 2rem));
    max-height: min(42rem, calc(100dvh - 2rem));
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--border-default, #dbe4f3);
    border-radius: 1.35rem;
    background: var(--bg-elevated, #fff);
    color: var(--text-primary, #253449);
    box-shadow: 0 1.5rem 5rem rgb(7 20 48 / .35);
}

.wmr-release-notes[open] {
    display: flex;
    flex-direction: column;
    animation: wmr-update-arrive .3s ease-out both;
}

.wmr-release-notes::backdrop { background: rgb(10 19 39 / .55); }

.wmr-release-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: .85rem;
    padding: 1.35rem 1.5rem;
    color: #f5f9ff;
    background: radial-gradient(ellipse at 100% 0, #325780, transparent 70%), #182747;
}

.wmr-release-check {
    display: grid;
    place-items: center;
    grid-row: span 2;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid #619ab0;
    border-radius: .85rem;
    background: #254760;
    color: #a4f5df;
    font-size: 1.4rem;
}

.wmr-release-version { color: #b7cdef; font-size: .8rem; }
.wmr-release-header h2 { margin: 0; color: inherit; font-size: clamp(1.25rem, 5vw, 1.6rem); font-weight: 700; }

.wmr-release-body {
    min-height: 0;
    padding: 1.15rem 1.5rem;
    overflow: auto;
    overscroll-behavior: contain;
    font-size: .9rem;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.wmr-release-body section + section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-default, #dbe4f3);
}

.wmr-release-warning {
    margin: 0 0 1rem;
    padding: .6rem .75rem;
    border-inline-start: .2rem solid #b77916;
    border-radius: .4rem;
    background: var(--bg-tinted-warning, #fef3c7);
    color: var(--text-strong, #51360c);
}

.wmr-release-body h3 { margin: 0 0 .3rem; font-size: .98rem; font-weight: 700; }
.wmr-release-body ul { margin: 0; padding-inline-start: 1.25rem; }
.wmr-release-body li + li { margin-top: .3rem; }
.wmr-release-body p:last-child { margin-bottom: 0; }
.wmr-release-body img { max-width: 100%; }

.wmr-release-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .9rem 1.5rem;
    border-top: 1px solid var(--border-default, #dbe4f3);
    font-size: .85rem;
}

.wmr-release-footer form { margin: 0 0 0 auto; }
.wmr-release-footer a { color: var(--text-link, #234fb5); }
.wmr-release-footer button {
    padding: .6rem .9rem;
    border: 0;
    border-radius: .55rem;
    background: var(--accent-primary, #234fb5);
    color: var(--accent-primary-text, #fff);
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

@keyframes wmr-update-arrive {
    from { opacity: 0; transform: translateY(.65rem) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes wmr-update-spin { to { transform: rotate(1turn); } }
@keyframes wmr-update-morph {
    0%, 100% { clip-path: var(--orbit-diamond); transform: rotate(0) scale(.9); }
    31% {
        clip-path: polygon(40% 4%, 60% 4%, 60% 40%, 96% 40%, 96% 60%, 60% 60%,
            60% 96%, 40% 96%, 40% 60%, 4% 60%, 4% 40%, 40% 40%);
        transform: rotate(45deg) scale(1.09);
    }
    58% {
        clip-path: polygon(33% 7%, 67% 7%, 83% 19%, 93% 36%, 93% 64%, 83% 81%,
            67% 93%, 33% 93%, 17% 81%, 7% 64%, 7% 36%, 17% 19%);
        transform: rotate(83deg) scale(.81);
    }
    79% { clip-path: var(--orbit-diamond); transform: rotate(93deg) scale(1.02); }
}

@keyframes wmr-update-edge-glitch {
    0%, 66%, 100% {
        opacity: 0;
        clip-path: var(--wmr-update-top-rail);
        transform: translateX(0);
    }
    68%, 70% {
        opacity: .8;
        clip-path: var(--wmr-update-top-rail);
        transform: translate(var(--glitch-offset), -1px);
    }
    73%, 75% {
        opacity: .7;
        clip-path: var(--wmr-update-bottom-rail);
        transform: translate(var(--glitch-offset), 1px);
    }
    78% {
        opacity: 0;
        clip-path: var(--wmr-update-bottom-rail);
    }
}

@keyframes wmr-update-shimmer { to { background-position: -200% 0; } }

@media (max-width: 600px) {
    #wmr-banner-stack,
    .wmr-update-banner {
        inset: max(.75rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right)) auto auto;
        gap: .75rem;
    }

    .wmr-update-orbit { width: 3.9rem; height: 3.9rem; }
    .wmr-update-banner[data-outcome="running"] .wmr-update-orbit {
        width: clamp(4.6rem, 23vw, 5.35rem);
        height: clamp(4.6rem, 23vw, 5.35rem);
    }
    .wmr-release-header, .wmr-release-body, .wmr-release-footer { padding-inline: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    .wmr-notice-card, .wmr-notice-symbol, .wmr-update-banner[data-outcome="running"]::before,
    .wmr-update-banner[data-outcome="running"]::after, .wmr-update-orbit::before,
    .wmr-update-orbit::after, .wmr-update-orbit > span, .wmr-update-track > span, .wmr-release-notes[open] {
        animation: none;
        transition: none;
    }
}
