/* Nectra AI chat panel — opens from floating contact menu (no separate toggle) */
#nectra-chatbot-toggle {
    display: none !important;
}

#nectra-chatbot-panel {
    position: fixed;
    bottom: max(92px, calc(68px + env(safe-area-inset-bottom, 0px)));
    right: max(20px, env(safe-area-inset-right, 0px));
    z-index: 9989;
    width: min(360px, calc(100vw - 40px));
    height: min(480px, calc(100vh - 120px));
    background: #12121a;
    border: 1px solid #2a2a3a;
    border-radius: 16px;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

#nectra-chatbot-panel.open {
    display: flex;
}

.ncb-header {
    padding: 12px 16px;
    background: #1a1a24;
    border-bottom: 1px solid #2a2a3a;
    font-weight: 600;
    color: #00e5ff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}

.ncb-close {
    background: transparent;
    border: none;
    color: #888;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.ncb-close:hover {
    color: #fff;
}

.ncb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.ncb-msg {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    max-width: 90%;
    word-break: break-word;
}

.ncb-msg.bot {
    background: #1a1a24;
    color: #e8e8f0;
    align-self: flex-start;
}

.ncb-msg.user {
    background: rgba(0, 229, 255, 0.15);
    color: #00e5ff;
    align-self: flex-end;
}

.ncb-input-row {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #2a2a3a;
    flex-shrink: 0;
}

.ncb-input-row input {
    flex: 1;
    min-width: 0;
    background: #0a0a0f;
    border: 1px solid #2a2a3a;
    color: #fff;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.85rem;
}

.ncb-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ncb-icon-btn {
    background: transparent;
    border: 1px solid #333;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ncb-icon-btn:hover {
    color: #00e5ff;
    border-color: #00e5ff;
}

.ncb-msg a {
    color: #00e5ff;
    word-break: break-all;
}

.ncb-msg strong {
    color: #fff;
}

.ncb-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 12px 16px !important;
}

.ncb-typing span {
    width: 7px;
    height: 7px;
    background: #00e5ff;
    border-radius: 50%;
    animation: ncb-dot 1.2s infinite ease-in-out;
}

.ncb-typing span:nth-child(2) { animation-delay: 0.15s; }
.ncb-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes ncb-dot {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.ncb-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 8px;
    flex-shrink: 0;
}

.ncb-quick-btn {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.35);
    color: #00e5ff;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s;
}

.ncb-quick-btn:hover {
    background: rgba(0, 229, 255, 0.22);
}

.ncb-input-row button {
    background: #00e5ff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    flex-shrink: 0;
    color: #000;
    min-width: 44px;
}

@media (max-width: 576px) {
    #nectra-chatbot-panel {
        bottom: max(82px, calc(62px + env(safe-area-inset-bottom, 0px)));
        right: max(14px, env(safe-area-inset-right, 0px));
        width: calc(100vw - 28px);
        height: min(380px, calc(100vh - 100px));
        border-radius: 14px;
    }
}
