.aibap-chat-inline,
.aibap-floating {
    --aibap-primary: #1f6feb;
    font-family: "Segoe UI", Tahoma, sans-serif;
}

.aibap-chat-window {
    width: 360px;
    max-width: calc(100vw - 24px);
    border: 1px solid #d0d7de;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.aibap-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--aibap-primary);
    color: #fff;
    padding: 12px;
}

.aibap-chat-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aibap-chat-header img {
    width: 22px;
    height: 22px;
}

.aibap-chat-controls {
    display: flex;
    gap: 6px;
}

.aibap-chat-controls button {
    width: 24px;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    background: rgba(0, 0, 0, 0.15);
    color: #fff;
    border-radius: 6px;
    line-height: 1;
    padding: 0;
    cursor: pointer;
}

.aibap-chat-window.aibap-minimized .aibap-chat-messages,
.aibap-chat-window.aibap-minimized .aibap-chat-typing,
.aibap-chat-window.aibap-minimized .aibap-chat-form {
    display: none !important;
}

.aibap-chat-messages {
    height: 340px;
    overflow-y: auto;
    padding: 12px;
    background: #f6f8fa;
}

.aibap-msg {
    max-width: 85%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    line-height: 1.35;
    font-size: 14px;
    white-space: pre-wrap;
}

.aibap-msg-user {
    margin-left: auto;
    background: var(--aibap-primary);
    color: #fff;
}

.aibap-msg-ai {
    background: #fff;
    color: #1f2328;
    border: 1px solid #d0d7de;
}

.aibap-chat-typing {
    padding: 0 12px 8px;
    color: #57606a;
    font-size: 12px;
}

.aibap-chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #d0d7de;
}

.aibap-chat-input {
    flex: 1;
    border: 1px solid #d0d7de;
    border-radius: 8px;
    padding: 8px 10px;
}

.aibap-chat-form button,
.aibap-lead-submit,
.aibap-fab {
    background: var(--aibap-primary);
    color: #fff;
    border: 0;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
}

.aibap-floating {
    position: fixed;
    bottom: 20px;
    z-index: 99999;
}

.aibap-pos-right {
    right: 20px;
}

.aibap-pos-left {
    left: 20px;
}

.aibap-floating .aibap-fab {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.aibap-floating .aibap-chat-window {
    margin-top: 10px;
}

.aibap-dark .aibap-chat-window {
    background: #0d1117;
    border-color: #30363d;
}

.aibap-dark .aibap-chat-messages {
    background: #161b22;
}

.aibap-dark .aibap-msg-ai {
    background: #21262d;
    color: #e6edf3;
    border-color: #30363d;
}

@media (max-width: 640px) {
    .aibap-chat-window {
        width: calc(100vw - 20px);
    }

    .aibap-floating {
        right: 10px;
        left: 10px;
    }

    .aibap-pos-left,
    .aibap-pos-right {
        right: 10px;
        left: 10px;
    }

    .aibap-floating .aibap-fab {
        position: fixed;
        bottom: 16px;
        right: 16px;
        left: auto;
    }
}
