:root{
    --footer-h: 70px;   /* fallback if JS not loaded yet */
    --chat-gap: 8px;    /* gap above footer */
    --btn-size: 56px;
}
    
    
/* Floating button */
#floating-chat-btn{
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: calc(var(--footer-h) + var(--chat-gap));
    width: var(--btn-size);
    height: var(--btn-size);
    background-color: #0b5c50;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
    z-index: 9999;
}

#floating-chat-btn:hover { background-color: #094a41; }

/* Overlay */
#chat-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 9998;
    display: none;
}

/* Chat panel */
#chat-panel{
    position: fixed;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    bottom: calc(var(--footer-h) + var(--chat-gap) + var(--btn-size) + 10px);
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 560px;
    max-height: calc(100vh - var(--footer-h) - 140px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.28);
    overflow: hidden;
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transition: transform 160ms ease, opacity 160ms ease;
}

/* show state */
#chat-panel.is-open{
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Header */
#chat-panel-header{
    height: 44px;
    background: #0b5c50;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 12px;
    font-size: 14px;
}

#chat-close-btn{
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 8px;
}

/* Iframe */
#chat-iframe{
    width: 100%;
    height: calc(100% - 44px);
    border: 0;
    display: block;
}

/* Mobile: full width, docked */
@media (max-width: 576px){
    #chat-panel{
        left: 0;
        right: 0;
        bottom: calc(var(--footer-h) + var(--chat-gap));
        width: auto;
        height: 70vh;
        max-height: calc(100vh - var(--footer-h) - 40px);
        border-radius: 14px 14px 0 0;
        transform: translateY(20px); /* no translateX on mobile full-width */
    }
    #chat-panel.is-open{
        transform: translateY(0);
    }
    #floating-chat-btn{
        left: 50%;
        transform: translateX(-50%);
    }
}
