.ks-ai-widget,
.ks-ai-widget * {
    box-sizing: border-box;
}

.ks-ai-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: inherit;
}

.ks-ai-widget__robot {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #111827, #1DBFC1);
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
	position: fixed!important;
    right: 20px;
    bottom: 85px;
	padding: 0px;
}

.ks-ai-widget__robot:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 24px 55px rgba(37, 99, 235, 0.45);
}

.ks-ai-widget__robot-icon {
    position: relative;
    z-index: 2;
    font-size: 34px;
    line-height: 1;
}

.ks-ai-widget__pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid rgba(37, 99, 235, 0.35);
    animation: ksAiPulse 1.8s infinite;
}

@keyframes ksAiPulse {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

.ks-ai-widget__popup {
    position: absolute;
    right: 0;
    bottom: 90px;
    width: 380px;
    max-width: calc(100vw - 32px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: right bottom;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.ks-ai-widget.is-open .ks-ai-widget__popup {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ks-ai-chat {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22);
    font-family: inherit;
}

.ks-ai-chat__header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #111827, #1DBFC1);
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.ks-ai-chat__header strong {
    display: block;
    font-size: 18px;
}

.ks-ai-chat__header span {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.85;
}

.ks-ai-chat__close {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ks-ai-chat__close:hover {
    background: rgba(255, 255, 255, 0.24);
}

.ks-ai-chat__messages {
    height: 360px;
    overflow-y: auto;
    padding: 18px;
    background: #f9fafb;
}

.ks-ai-message {
    max-width: 85%;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.ks-ai-message--bot {
    background: #ffffff;
    color: #111827;
    border: 1px solid #e5e7eb;
}

.ks-ai-message--user {
    margin-left: auto;
    background: #2563eb;
    color: #ffffff;
}

.ks-ai-message--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.ks-ai-message--loading {
    opacity: 0.7;
    font-style: italic;
}

.ks-ai-chat__form {
    display: flex;
    gap: 10px;
    padding: 14px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.ks-ai-chat__input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 12px 14px;
    font-size: 14px;
    outline: none;
}

.ks-ai-chat__input:focus {
    border-color: #2563eb;
}

.ks-ai-chat__form button {
    border: none;
    border-radius: 999px;
    padding: 12px 18px;
    background: #1DBFC1;
    color: #ffffff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease;
}

.ks-ai-chat__form button:hover {
    background: #1d4ed8;
}

.ks-ai-chat__form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.ks-ai-typing {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.ks-ai-typing__dots {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.ks-ai-typing__dots span {
    width: 6px !important;
    height: 6px !important;
    display: block !important;
    border-radius: 50% !important;
    background: #6b7280 !important;
    animation: ksAiTypingDot 1.2s infinite ease-in-out !important;
}

.ks-ai-typing__dots span:nth-child(1) {
    animation-delay: 0s !important;
}

.ks-ai-typing__dots span:nth-child(2) {
    animation-delay: 0.2s !important;
}

.ks-ai-typing__dots span:nth-child(3) {
    animation-delay: 0.4s !important;
}

@keyframes ksAiTypingDot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.35;
    }

    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .ks-ai-widget {
        right: 16px;
        bottom: 16px;
    }

    .ks-ai-widget__robot {
        width: 64px;
        height: 64px;
    }

    .ks-ai-widget__robot-icon {
        font-size: 30px;
    }

    .ks-ai-widget__popup {
        right: 0;
        bottom: 82px;
        width: calc(100vw - 32px);
    }

    .ks-ai-chat {
        border-radius: 18px;
    }

    .ks-ai-chat__messages {
        height: 340px;
    }

    .ks-ai-chat__form {
        gap: 8px;
    }

    .ks-ai-chat__form button {
        padding: 12px 14px;
    }
}