/* Przycisk ChatBot Buildera */
.ktt10-btn {
    width: 70px !important;
    height: 70px !important;
    background: linear-gradient(45deg, #244bb5, #40b9bb) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: fixed !important;
    bottom: 130px !important;
    right: 20px !important;
    z-index: 9999 !important;
    animation: kx-pulse-btn 2s infinite ease-in-out !important;
}
.ktt10-btn img {
    width: 60% !important;
    height: 60% !important;
    object-fit: cover !important;
}
.ktt10-flt { z-index: 9996 !important; }
@media screen and (min-width: 992px) {
    .ktt10-btn { bottom: 20px !important; }
}
@media (prefers-reduced-motion: reduce) {
    .ktt10-btn, .kx-bubble, .kx-wait-icon { animation: none !important; }
}

/* Wspolne dla dymka i popupu (prefiks kx-, zeby nie gryzlo sie z CSS strony) */
.kx-bubble, .kx-wait {
    position: fixed;
    right: 20px;
    bottom: 215px; /* mobile/tablet: nad przyciskiem (przycisk 130-200px) */
    z-index: 9998;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    display: none;
    opacity: 0;
    transition: opacity .3s ease, transform .3s ease;
    transform: translateY(8px);
}
.kx-bubble.kx-show, .kx-wait.kx-show { opacity: 1; transform: translateY(0); }

/* Dymek zachety */
.kx-bubble {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    border-radius: 12px;
    padding: 15px 34px 15px 15px;
    width: 260px;
    max-width: calc(100vw - 40px);
    cursor: pointer;
}
.kx-bubble.kx-show { animation: kx-float 2s ease-in-out infinite alternate; }
.kx-bubble-content { display: flex; align-items: center; }
.kx-icon {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(45deg, #244bb5, #40b9bb);
    overflow: hidden; flex-shrink: 0; margin-right: 12px;
}
.kx-icon img, .kx-wait-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kx-text h4 { margin: 0 0 5px; font-size: 16px; font-weight: 600; color: #333; line-height: 1.3; }
.kx-text p { margin: 0; font-size: 14px; color: #666; line-height: 1.4; }
.kx-close {
    position: absolute; top: 6px; right: 6px;
    width: 26px; height: 26px; padding: 0; margin: 0;
    border: 0; background: transparent; cursor: pointer;
    font-size: 15px; line-height: 26px; color: #999; border-radius: 50%;
}
.kx-close:hover, .kx-close:focus-visible { color: #333; background: #f0f0f0; }
/* strzalka w dol, do przycisku */
.kx-bubble:after {
    content: ''; position: absolute; right: 25px; bottom: -10px;
    border-left: 10px solid transparent; border-right: 10px solid transparent;
    border-top: 10px solid #fff;
}

/* Popup "Pan Kleks juz pisze" */
.kx-wait {
    background: linear-gradient(to right, #f8f9fa, #fff);
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0,0,0,.15);
    border: 1px solid rgba(64,185,187,.2);
    padding: 8px 16px 8px 8px;
    width: 280px;
    max-width: calc(100vw - 40px);
}
.kx-wait-content { display: flex; align-items: center; }
.kx-wait-icon {
    width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
    flex-shrink: 0; margin-right: 8px;
    animation: kx-pulse 2s infinite ease-in-out;
}
.kx-wait-text { font-size: 13px; font-weight: 500; color: #333; line-height: 1.3; }
.kx-dots span { opacity: 0; animation: kx-dot 1.4s infinite; color: #40b9bb; }
.kx-dots span:nth-child(2) { animation-delay: .2s; }
.kx-dots span:nth-child(3) { animation-delay: .4s; }
.kx-bar-wrap { height: 3px; background: #f0f0f0; border-radius: 10px; margin-top: 6px; overflow: hidden; }
.kx-bar { height: 100%; width: 0; background: linear-gradient(90deg, #244bb5, #40b9bb); border-radius: 10px; }
.kx-wait.kx-show .kx-bar { width: 100%; transition: width 4s linear; }

/* Desktop: dymek i popup obok przycisku */
@media screen and (min-width: 992px) {
    .kx-bubble, .kx-wait { right: 100px; bottom: 20px; }
    .kx-bubble:after {
        right: -10px; bottom: 25px;
        border-top: 10px solid transparent; border-bottom: 10px solid transparent;
        border-left: 10px solid #fff; border-right: 0;
    }
}

@keyframes kx-float { from { transform: translateY(0); } to { transform: translateY(-5px); } }
@keyframes kx-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes kx-pulse-btn { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes kx-dot { 0%,100% { opacity: 0; } 50% { opacity: 1; } }
