/* v104 — Keep the favorites glow visible with reduced motion enabled.
   Keep their labels, dimensions, responsive rules and click handlers intact. */
body .nvl-banner .nvl-guide,
body > .mast #openGuide.mast-guide {
    --guide-surface: #2456e8;
    color: #fff;
    background: #2456e8;
    background-image: linear-gradient(135deg, #2d60ed 0%, #2456e8 55%, #2049ce 100%);
    border-color: #8ca8ff;
    box-shadow: 0 0 0 3px rgb(72 113 246 / 14%), 0 4px 18px rgb(22 56 161 / 32%);
    text-shadow: 0 1px 1px rgb(13 34 107 / 18%);
    transition: background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}

/* Retire the old rotating ring and its pale green cover. */
body .nvl-banner .nvl-guide::before,
body .nvl-banner .nvl-guide::after,
body > .mast #openGuide.mast-guide .guide-button-outline,
body > .mast #openGuide.mast-guide .guide-button-outline::before,
body > .mast #openGuide.mast-guide .guide-button-outline::after {
    content: none;
    display: none;
    animation: none;
}

@media (hover: hover) {
    body .nvl-banner .nvl-guide:not(:disabled):hover,
    body > .mast #openGuide.mast-guide:not(:disabled):hover {
        --guide-surface: #1947cc;
        color: #fff;
        background: #1947cc;
        background-image: linear-gradient(135deg, #2858df, #1947cc);
        border-color: #b0c3ff;
        box-shadow: 0 0 0 3px rgb(91 132 255 / 21%), 0 5px 20px rgb(22 56 161 / 40%);
    }
}

body .nvl-banner .nvl-guide:focus-visible,
body > .mast #openGuide.mast-guide:focus-visible {
    color: #fff;
    outline: 3px solid #ffd96a;
    outline-offset: 3px;
}

body .nvl-banner .nvl-guide:not(:disabled):active,
body > .mast #openGuide.mast-guide:not(:disabled):active {
    background: #173db1;
    border-color: #b0c3ff;
    box-shadow: 0 0 0 2px rgb(91 132 255 / 18%);
}

/* Suppress the old expanding outline; the button itself gets one soft halo. */
body .nvl-banner .nvl-saved.has-favorites::after {
    content: none;
    display: none;
    animation: none;
}

body .nvl-banner .nvl-saved-count,
body > .mast #favCount {
    transform: none !important;
}

/* Both existing controllers set has-favorites from the visible count (> 0).
   Always animate color and halo opacity, including under reduced motion.
   The halo keeps the same geometry; only its brightness changes slowly. */
body .nvl-banner .nvl-guide.has-active-conversation,
body > .mast #openGuide.mast-guide.has-active-conversation,
body .nvl-banner .nvl-saved.has-favorites,
body.selector-page #saved.has-favorites {
    --nvl-favorites-peak-scale: 1.025;
    --nvl-favorites-halo-width: 3px;
    --nvl-favorites-halo-blur: 16px;
    animation: nvl-favorites-glow 4s ease-in-out infinite;
}

/* Animate the actual control. The accent theme disables its decorative pseudo-elements. */
body .nvl-banner .nvl-guide.has-active-conversation,
body > .mast #openGuide.mast-guide.has-active-conversation {
    --nvl-pulse-surface: #2456e8;
    --nvl-pulse-peak: #326bd7;
    --nvl-pulse-border: #8ca8ff;
    --nvl-pulse-border-peak: #9af5e2;
    --nvl-pulse-ring-peak: rgb(101 228 206 / 68%);
    --nvl-pulse-halo-peak: rgb(101 228 206 / 68%);
    background-image: none;
    animation-delay: -1s;
}

body .nvl-banner .nvl-guide-status,
body > .mast #openGuide.mast-guide .guide-conversation-status {
    display: none;
}

/* Add the size change only when the visitor has not requested reduced motion.
   The two animations share the same cycle, and the right edge stays anchored. */
@media (prefers-reduced-motion: no-preference) {
    body .nvl-banner .nvl-guide.has-active-conversation,
    body > .mast #openGuide.mast-guide.has-active-conversation,
    body .nvl-banner .nvl-saved.has-favorites,
    body.selector-page #saved.has-favorites {
        transform-origin: right center;
        animation-name: nvl-favorites-glow, nvl-favorites-breath;
    }
}

/* Keep enough clearance beside the assistant on narrow headers. */
@media (max-width: 600px) {
    body .nvl-banner .nvl-guide.has-active-conversation,
    body > .mast #openGuide.mast-guide.has-active-conversation,
    body .nvl-banner .nvl-saved.has-favorites,
    body.selector-page #saved.has-favorites {
        --nvl-favorites-peak-scale: 1.015;
        --nvl-favorites-halo-width: 3px;
        --nvl-favorites-halo-blur: 12px;
    }
}

@keyframes nvl-favorites-glow {
    0%, 100% {
        background-color: var(--nvl-pulse-surface, #143e35);
        border-color: var(--nvl-pulse-border, #779189);
        box-shadow: 0 0 0 var(--nvl-favorites-halo-width, 4px) rgb(82 151 255 / 0%), 0 0 var(--nvl-favorites-halo-blur, 16px) rgb(82 151 255 / 0%);
    }
    50% {
        background-color: var(--nvl-pulse-peak, #1b4b72);
        border-color: var(--nvl-pulse-border-peak, #78a9e8);
        box-shadow: 0 0 0 var(--nvl-favorites-halo-width, 4px) var(--nvl-pulse-ring-peak, rgb(82 151 255 / 14%)), 0 0 var(--nvl-favorites-halo-blur, 16px) var(--nvl-pulse-halo-peak, rgb(82 151 255 / 22%));
    }
}

@keyframes nvl-favorites-breath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(var(--nvl-favorites-peak-scale, 1.08)); }
}

@media (prefers-reduced-motion: reduce) {
    body .nvl-banner .nvl-guide,
    body > .mast #openGuide.mast-guide {
        transition: none;
    }
}

@media (forced-colors: active) {
    body .nvl-banner .nvl-guide.has-active-conversation,
    body > .mast #openGuide.mast-guide.has-active-conversation {
        animation: none;
        border: 2px dashed Highlight;
    }
    body .nvl-banner .nvl-saved.has-favorites,
    body.selector-page #saved.has-favorites {
        animation: none;
    }
    body .nvl-banner .nvl-guide,
    body > .mast #openGuide.mast-guide {
        color: ButtonText;
        background: ButtonFace;
        border-color: ButtonText;
        box-shadow: none;
        text-shadow: none;
    }
    body .nvl-banner .nvl-guide:focus-visible,
    body > .mast #openGuide.mast-guide:focus-visible {
        outline-color: Highlight;
    }
}
