
/* Space 2047 Chatbot mobile fit + close toggle fix */
html, body{
    overflow-x:hidden !important;
}

/* Try to catch the common chatbot panel names used in the Space 2047 theme/plugin */
#space2047-chatbot,
.space2047-chatbot,
.space2047-chatbot-box,
.space2047-chatbot-panel,
.space2047-chatbot-window,
.space2047-chatbot-wrap,
.space2047-chatbot-container,
.s2047-chatbot,
.s2047-chatbot-panel,
.s2047-chat-window{
    box-sizing:border-box !important;
    max-width:calc(100vw - 20px) !important;
    width:calc(100vw - 20px) !important;
    left:10px !important;
    right:10px !important;
    top:72px !important;
    bottom:82px !important;
    max-height:calc(100dvh - 154px) !important;
    height:auto !important;
    overflow:hidden !important;
    border-radius:18px !important;
    z-index:999998 !important;
}

.space2047-chatlog,
.space2047-chat-messages,
.space2047-chatbot-messages,
.space2047-chatbot-body,
.s2047-chatlog,
.s2047-messages{
    box-sizing:border-box !important;
    max-height:calc(100dvh - 265px) !important;
    overflow-y:auto !important;
    -webkit-overflow-scrolling:touch !important;
    padding-bottom:12px !important;
}

.space2047-chatbot input,
.space2047-chatbot textarea,
.space2047-chatbot-box input,
.space2047-chatbot-box textarea,
.space2047-chatbot-panel input,
.space2047-chatbot-panel textarea,
.space2047-chatbot-window input,
.space2047-chatbot-window textarea,
#space2047-chatbot input,
#space2047-chatbot textarea{
    min-width:0 !important;
    box-sizing:border-box !important;
    font-size:16px !important;
}

.space2047-chatbot-toggle,
.space2047-chatbot-icon,
#space2047-chatbot-toggle,
#space2047-chatbot-icon,
.s2047-chatbot-toggle,
.s2047-chatbot-icon{
    cursor:pointer !important;
    z-index:1000000 !important;
    touch-action:manipulation !important;
}

/* Class added by the repair script when the icon is clicked */
.space2047-chatbot-closed{
    display:none !important;
}

/* Strudelhofen animation */
#strudelhofen-animation{
    position:fixed;
    left:0;
    top:20%;
    font-size:92px;
    z-index:999999;
    animation:strudelBounce 8s linear forwards;
    pointer-events:none;
}

@keyframes strudelBounce{
    0%{left:4vw;top:20dvh;transform:rotate(0deg);}
    25%{left:68vw;top:12dvh;transform:rotate(95deg);}
    50%{left:36vw;top:62dvh;transform:rotate(180deg);}
    75%{left:74vw;top:34dvh;transform:rotate(270deg);}
    100%{left:8vw;top:56dvh;transform:rotate(360deg);}
}

#strudelhofen-speech{
    position:fixed;
    top:15%;
    right:5%;
    background:#fff;
    color:#000;
    padding:14px;
    border-radius:20px;
    font-weight:bold;
    z-index:999999;
    max-width:min(280px, 82vw);
    box-shadow:0 0 20px rgba(0,0,0,0.4);
}

.space2047-bubble{
    background:#101820;
    color:#7df9ff;
    margin:10px;
    padding:12px;
    border-radius:14px;
    font-family:Arial,sans-serif;
}

@media (min-width: 768px){
    #space2047-chatbot,
    .space2047-chatbot,
    .space2047-chatbot-box,
    .space2047-chatbot-panel,
    .space2047-chatbot-window,
    .space2047-chatbot-wrap,
    .space2047-chatbot-container,
    .s2047-chatbot,
    .s2047-chatbot-panel,
    .s2047-chat-window{
        width:min(460px, calc(100vw - 32px)) !important;
        max-width:min(460px, calc(100vw - 32px)) !important;
        left:auto !important;
        right:18px !important;
        top:auto !important;
        bottom:96px !important;
        max-height:calc(100dvh - 130px) !important;
    }
}
