

/* =========================================================
   SCROLL BUTTONS (phones only): "Back to top" pill and the
   conversation's round "latest message" arrow. js/scroll_buttons.js
   ========================================================= */
[data-scroll-host] { position: relative; }
.scroll-btn { display: none; }
@media (max-width: 767.98px) {
    .scroll-btn {
        display: inline-flex; align-items: center; justify-content: center; gap: 6px;
        background: #fff; color: var(--text-color, #17211E); border: 1px solid var(--border-color, #dfe5df);
        box-shadow: 0 6px 18px rgba(23, 33, 30, .16); cursor: pointer; z-index: 1035;
        font: 700 .875rem/1 var(--font-body, inherit);
        opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility 0s linear .18s;
    }
    .scroll-btn.is-visible { opacity: 1; visibility: visible; transition-delay: 0s; }
    .scroll-btn svg { fill: none; stroke: var(--primary-color, #087F5B); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; flex: none; }
    .scroll-btn:focus-visible { outline: 3px solid var(--primary-color, #087F5B); outline-offset: 2px; }

    .scroll-btn--page, .scroll-btn--box { min-height: 44px; padding: 0 16px; border-radius: 999px; left: 50%; transform: translateX(-50%); }
    .scroll-btn--page { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom)); }
    /* clear of the floating "Publish" button */
    .scroll-btn--page.scroll-btn--above-fab { bottom: calc(76px + env(safe-area-inset-bottom)); }
    .scroll-btn--box { position: absolute; bottom: 14px; }

    .scroll-btn--latest { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; border-radius: 50%; padding: 0; }
    .scroll-btn__badge {
        position: absolute; top: -6px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
        background: var(--primary-color, #087F5B); color: #fff; border: 2px solid #fff;
        font: 700 11px/16px var(--font-body, inherit); text-align: center;
    }
    .scroll-btn__badge[hidden] { display: none; }

    /* never on top of a modal, the cookie banner or the app banner */
    .modal-open .scroll-btn, .ga4-consent:not([hidden]) ~ .scroll-btn, .app-banner:not([hidden]) ~ .scroll-btn { display: none; }
}
@media (prefers-reduced-motion: reduce) { .scroll-btn { transition: none; } }

/* the conversation's messages sit in a box of their own so the arrow can float over them, above the composer */
.chat-thread__scroll { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.chat-thread__scroll > .chat-thread__messages { min-height: 0; }
