<style type="text/css">
    #custom-gladly-chat-button #gladly-not-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button #gladly-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button.gladly-show {
        visibility: visible;
    }

    #custom-gladly-chat-button.gladly-show #gladly-not-authenticated {
        visibility: hidden;
    }

    #custom-gladly-chat-button.gladly-show.gladly-has-authenticated #gladly-authenticated {
        visibility: visible;
    }

    /* TODO Check what the class name should be for when chat is unavailable */
    .chat-unavailable {
        width: 254px;
        height: 108px;
        flex-shrink: 0;
        border-radius: 8px;
        background: var(--primary-light, #FFF);
        box-shadow: 0px 6px 10px 0px rgba(34, 34, 34, 0.20), 0px -4px 10px 0px rgba(34, 34, 34, 0.05);
        color: var(--primary-dark, #222);
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px;
    }

    .campaign-message {
        font-family: var(--webfont-primary, sans-serif);
        font-weight: 400;
        font-size: 14px;
        line-height: 1.428571429;
        color: #222;
        box-sizing: content-box;
        position: fixed;
        width: 167px;
        bottom: 26px;
        right: 26px;
        border-radius: 8px;
        z-index: 999;
        /* to show over the chat button */
        cursor: pointer;
        height: auto;
        padding-bottom: 30px;
    }

    .campaign-message-close-button {
        display: inline-flex;
        width: 10px;
        height: 10px;
        padding: 8px;
        justify-content: center;
        align-items: center;
        flex-shrink: 0;
        border-radius: 50%;
        background: var(--primary-dark, #222);
        cursor: pointer;
        position: absolute;
        top: -12px;
        left: 148px;
        border: 2px solid var(--primary-dark, #222);
    }

    .campaign-message-text {
        background-color: var(--primary-light, #FFF);
        color: var(--primary-dark, #222);
        font-size: 14px;
        font-style: normal;
        font-weight: 400;
        line-height: 20px;
        padding: 12px 16px;
        display: block;
        border-radius: 8px;
        box-shadow: 0px 6px 10px 0px rgba(34, 34, 34, 0.20), 0px -4px 10px 0px rgba(34, 34, 34, 0.05);
    }

    .campaign-message-svg {
        width: 16px;
        height: 10px;
        flex-shrink: 0;
        fill: var(--primary-light, #FFF);
        bottom: 7px;
        left: 127px;
        position: relative;
        z-index: 104;
    }

    #custom-gladly-chat-button {
        display: inline-flex;
        padding: 10px 14px;
        justify-content: center;
        align-items: center;
        border-radius: 260px;
        background: var(--primary-dark, #222);
        box-shadow: 0px 4px 10px 0px rgba(0, 0, 0, 0.15);
        width: auto !important;
        height: auto !important;
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 998;
        cursor: pointer;
        border: 1px solid var(--primary-light, #FFF);
    }

    #custom-gladly-chat-button:hover {
        background: var(--primary-dark, #222);
        /* overrides uber styles */
    }

    #custom-gladly-chat-button:focus,
    .campaign-message-close-button:focus {
        outline: dotted 1px;
        outline-offset: -4px;
        outline-color: white;
    }


    .gladly-text {
        color: var(--primary-light, #FFF) !important;
        text-align: center;
        font-family: var(--webfont-primary, sans-serif);
        font-size: 14px;
        font-style: normal;
        font-weight: 700;
        line-height: 20px;
    }

    .unread-dot {
        display: inline;
        position: absolute;
        bottom: 29px;
        right: 3px;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"] .overrideStyle-sc-10heg51-0.ewrblv {
        display: none;
    }

    #gladlyChat_container .animateChatButton-appear-done {
        display: flex;
        justify-content: center;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"],
    #gladlyChat_container button[data-aid="selfService-chatButton"]:hover {
        background: var(--primary-dark, #222) !important;
        display: flex !important;
        width: auto !important;
        height: auto !important;
        justify-content: center !important;
        align-items: center;
        gap: 12px;
        flex-shrink: 0;
        min-width: 89% !important;
        min-height: 49px !important;
        margin: auto 24px 24px 24px !important;
    }

    .chat-button-icon,
    .chat-button-text {
        z-index: 2;
    }

    .chat-button-text {
        text-transform: uppercase;
    }

    /* for focus border */
    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
        border-color: #222;
        background: #222;
        color: #fff;
        box-shadow: none;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus::before {
        display: block;
        content: "";
        border-color: #aaa;
        border-width: 1px;
        border-radius: 0;
        border-style: solid;
        position: absolute;
        top: 1px;
        right: 1px;
        bottom: 1px;
        left: 1px;
        z-index: 1;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"] div {
        display: none !important;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"]::after {
        content: "Chat With Us";
        text-transform: uppercase;
        color: var(--white, #FFF);
        text-align: center;
        font-size: 12px;
        font-style: normal;
        font-weight: 600;
        line-height: 12px;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    #gladlyChat_container button[data-aid="selfService-chatButton"],
    #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
        padding: 18px 24px;
    }

    #gladlyChat_container .QHDDO {
        stroke: #222 !important;
    }

    @media screen and (max-width: 768px) {
        .unread-dot {
            bottom: 25px;
        }

        .campaign-message {
            bottom: 20px;
            right: 17px;
            padding-bottom: 32px;
        }

        #custom-gladly-chat-button {
            padding: 8px 14px;
            bottom: 24px;
            right: 16px;
        }

        .gladly-text {
            font-size: 12px;
        }

        #gladlyChat_container button[data-aid="selfService-chatButton"],
        #gladlyChat_container button[data-aid="selfService-chatButton"]:hover,
        #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
            margin: auto 16px 16px 16px !important;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="collapsed banner"] #custom-gladly-chat-button {
            bottom: 86px;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="medium banner"] #custom-gladly-chat-button {
            bottom: 171px;
        }

        body[data-is-interrupter-on="true"][data-interrupter-variation="collapsed banner"] .campaign-message {
            bottom: 83px;
        }


        body[data-is-interrupter-on="true"][data-interrupter-variation="medium banner"] .campaign-message {
            bottom: 167px;
        }
    }

    @media screen and (max-width: 932px) and (orientation: landscape) {

        #gladlyChat_container button[data-aid="selfService-chatButton"],
        #gladlyChat_container button[data-aid="selfService-chatButton"]:hover,
        #gladlyChat_container button[data-aid="selfService-chatButton"]:focus {
            min-width: 95% !important;
            margin: 24px !important;
        }
    }
</style>
<button id="custom-gladly-chat-button" aria-describedby="gladly-campaign-message" onclick="gladlyChatOnClick()" class="gladly-show">
    <span class="gladly-text">Chat With Us</span>
    <div id="gladly-not-authenticated">
        <span class="gladly-text sr-only">Chat With Us</span>
    </div>
    <div id="gladly-authenticated">
        <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" fill="none" class="unread-dot">
            <circle cx="8" cy="8" r="7" fill="#BB0000" stroke="white" stroke-width="2"></circle>
        </svg>
    </div>
</button>