.nx-chatbot {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    font-family: "Manrope", "Segoe UI", sans-serif;
}

.nx-chatbot-launcher {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(120deg, #1f7fe2, #2bb8da);
    color: #fff;
    padding: 12px 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 14px 30px rgba(21, 85, 170, 0.35);
}

.nx-chatbot-launcher:hover {
    filter: brightness(1.03);
}

.nx-chatbot-panel {
    width: min(390px, calc(100vw - 20px));
    max-height: min(80vh, 720px);
    margin-top: 10px;
    background: #fff;
    border: 1px solid #d1e2f4;
    border-radius: 18px;
    box-shadow: 0 28px 50px rgba(10, 45, 85, 0.26);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.nx-chatbot.open .nx-chatbot-panel {
    display: flex;
}

.nx-chatbot-header {
    padding: 14px 16px;
    background: linear-gradient(135deg, #103f77, #1f7fe2);
    color: #ebf4ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.nx-chatbot-header h3 {
    margin: 0;
    font-size: 1rem;
}

.nx-chatbot-header p {
    margin: 2px 0 0;
    font-size: 0.78rem;
    color: #d8e8ff;
}

.nx-chatbot-header button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.nx-chatbot-messages {
    padding: 12px;
    overflow-y: auto;
    background: linear-gradient(180deg, #f5faff, #edf5ff);
    display: grid;
    gap: 8px;
    min-height: 180px;
    max-height: 300px;
}

.nx-chat-msg {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.nx-chat-msg-user {
    background: #1f7fe2;
    color: #fff;
    margin-left: 36px;
    border-bottom-right-radius: 4px;
}

.nx-chat-msg-assistant {
    background: #ffffff;
    color: #15385c;
    border: 1px solid #d3e4f3;
    margin-right: 36px;
    border-bottom-left-radius: 4px;
}

.nx-chatbot-form {
    padding: 10px 12px;
    border-top: 1px solid #deebf8;
    display: flex;
    gap: 8px;
}

.nx-chatbot-form input {
    flex: 1;
    border: 1px solid #cfe2f2;
    border-radius: 10px;
    min-height: 42px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.nx-chatbot-form button,
.nx-lead-form button {
    border: 0;
    border-radius: 10px;
    background: #1f7fe2;
    color: #fff;
    font-weight: 700;
    padding: 0 14px;
    min-height: 42px;
}

.nx-chatbot-form button:disabled,
.nx-lead-form button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.nx-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding: 8px 12px 2px;
    border-top: 1px solid #deebf8;
    background: #ffffff;
}

.nx-quick-reply {
    border: 1px solid #cfe0f2;
    background: #f7fbff;
    color: #1a446f;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 6px 10px;
    line-height: 1.2;
}

.nx-quick-reply:hover {
    background: #edf5ff;
}

.nx-chatbot-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 12px;
}

.nx-chat-link {
    border: 1px solid #cddff1;
    background: #fff;
    color: #1a446f;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 6px 11px;
}

.nx-lead-form {
    border-top: 1px solid #deebf8;
    background: #ffffff;
    padding: 12px;
    display: none;
}

.nx-lead-form.visible {
    display: block;
}

.nx-lead-form h4 {
    margin: 0 0 10px;
    font-size: 0.92rem;
    color: #173a60;
}

.nx-lead-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.nx-lead-form input,
.nx-lead-form select,
.nx-lead-form textarea {
    width: 100%;
    border: 1px solid #cfe2f2;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.nx-lead-form textarea {
    resize: vertical;
    min-height: 84px;
}

.nx-chat-error {
    color: #9a1a2d;
    font-size: 0.8rem;
    margin-top: -3px;
    margin-bottom: 8px;
}

.nx-chatbot-form input:focus,
.nx-lead-form input:focus,
.nx-lead-form select:focus,
.nx-lead-form textarea:focus,
.nx-quick-reply:focus {
    outline: none;
    border-color: #478fe6;
    box-shadow: 0 0 0 3px rgba(71, 143, 230, 0.2);
}

@media (max-width: 760px) {
    .nx-chatbot {
        right: 10px;
        bottom: 10px;
    }

    .nx-chatbot-launcher {
        padding: 10px 14px;
        font-size: 0.86rem;
    }

    .nx-chatbot-panel {
        width: calc(100vw - 20px);
    }

    .nx-chatbot-messages {
        max-height: 280px;
    }

    .nx-lead-grid {
        grid-template-columns: 1fr;
    }
}
