/* 1.7.2: scope writes to HomePro chat and To Top. TrustedSite is provider-owned. */
#hplc-widget.hplc-widget.hplc-viewport-ready {
    --hplc-edge: 22px;
    --hplc-safe-left: env(safe-area-inset-left, 0px);
    --hplc-safe-right: env(safe-area-inset-right, 0px);
    --hplc-safe-top: env(safe-area-inset-top, 0px);
    bottom: calc(var(--hplc-vv-bottom, 0px) + var(--hplc-edge) + var(--hplc-safe-bottom) + var(--hplc-widget-obstacle-lift, 0px)) !important;
    top: auto !important;
    right: calc(var(--hplc-vv-right, 0px) + var(--hplc-edge) + var(--hplc-safe-right)) !important;
    left: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    filter: none !important;
    max-width: calc(var(--hplc-vv-width, 100vw) - 24px) !important;
}
#hplc-widget.hplc-widget.hplc-left.hplc-viewport-ready {
    left: calc(var(--hplc-vv-left, 0px) + var(--hplc-edge) + var(--hplc-safe-left)) !important;
    right: auto !important;
}
#hplc-widget.hplc-viewport-ready .hplc-panel {
    width: min(430px, calc(var(--hplc-vv-width, 100vw) - 44px - var(--hplc-safe-left) - var(--hplc-safe-right))) !important;
    height: min(700px, calc(var(--hplc-vv-height, 100dvh) - 44px - var(--hplc-safe-bottom) - var(--hplc-safe-top))) !important;
    max-height: calc(var(--hplc-vv-height, 100dvh) - 44px - var(--hplc-safe-bottom) - var(--hplc-safe-top)) !important;
    min-height: 0 !important;
}
#hplc-widget.hplc-viewport-ready .hplc-messages { min-height: 0 !important; overscroll-behavior: contain; }
#hplc-widget.hplc-viewport-ready .hplc-panel__header,
#hplc-widget.hplc-viewport-ready .hplc-composer,
#hplc-widget.hplc-viewport-ready .hplc-transfer { flex-shrink: 0 !important; }
#hplc-widget.hplc-viewport-ready .hplc-start-form { min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; }
#hplc-widget.hplc-viewport-ready.hplc-is-starting .hplc-panel { height: auto !important; overflow-y: auto !important; }
#hplc-widget.hplc-viewport-ready .hplc-launcher__icon { flex-shrink: 0 !important; }

@media (max-width: 900px) {
    #hplc-widget.hplc-widget.hplc-viewport-ready { --hplc-edge: 12px; }
    #hplc-widget.hplc-widget.hplc-viewport-ready:not(.is-open) {
        left: auto !important;
        right: calc(var(--hplc-vv-right, 0px) + 12px + var(--hplc-safe-right)) !important;
    }
    #hplc-widget.hplc-viewport-ready .hplc-launcher {
        min-height: 48px !important;
        max-width: min(260px, var(--hplc-launcher-room, calc(100vw - 120px))) !important;
    }
    #hplc-widget.hplc-viewport-ready.hplc-compact-launcher .hplc-launcher { width: 48px !important; height: 48px !important; padding: 0 !important; justify-content: center !important; }
    #hplc-widget.hplc-viewport-ready.hplc-compact-launcher .hplc-launcher__label { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip-path: inset(50%) !important; white-space: nowrap !important; }
}
@media (max-width: 520px) {
    #hplc-widget.hplc-widget.hplc-viewport-ready.is-open {
        left: calc(var(--hplc-vv-left, 0px) + 12px + var(--hplc-safe-left)) !important;
        right: calc(var(--hplc-vv-right, 0px) + 12px + var(--hplc-safe-right)) !important;
    }
    #hplc-widget.hplc-viewport-ready .hplc-panel {
        width: 100% !important;
        height: min(700px, calc(var(--hplc-vv-height, 100dvh) - 24px - var(--hplc-safe-bottom) - var(--hplc-safe-top))) !important;
        max-height: calc(var(--hplc-vv-height, 100dvh) - 24px - var(--hplc-safe-bottom) - var(--hplc-safe-top)) !important;
    }
    #hplc-widget.hplc-viewport-ready textarea,
    #hplc-widget.hplc-viewport-ready input:not([type="file"]) { font-size: 16px !important; }
}

/* No TrustedSite bottom, transform, size, visibility or reparenting override. */
.hplc-safe-area-probe {
    position: fixed; width: 0; height: 0; top: 0; left: 0;
    visibility: hidden; pointer-events: none;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
#to_top_scrollup[data-hplc-top-spacing="1"] {
    position: fixed !important;
    top: auto !important;
    left: var(--hplc-top-left) !important;
    right: auto !important;
    bottom: var(--hplc-top-bottom) !important;
    /* Do not ease geometry behind a moving badge; retain vendor fades/autohide. */
    transition-property: opacity, background-color, color, box-shadow !important;
}
#to_top_scrollup[data-hplc-top-no-room="1"] {
    visibility: hidden !important;
    pointer-events: none !important;
}
