#aifc-widget-root, #aifc-widget-root * { box-sizing: border-box; }

.aifc-toggle {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ff00ff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(79,124,255,0.4);
    cursor: pointer;
    z-index: 999998;
    transition: transform 0.2s ease;
}
.aifc-toggle:hover { transform: scale(1.08); }
.aifc-toggle-icon { font-size: 26px; }

.aifc-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.18);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.aifc-panel.aifc-open { display: flex; }

.aifc-header {
    background: linear-gradient(135deg, #ff00ff, #7c4fff);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.aifc-header-title { font-weight: 600; font-size: 15px; }
.aifc-header-status { font-size: 12px; opacity: 0.9; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.aifc-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }
.aifc-close { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; line-height: 1; padding: 0; }

.aifc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f7f8fa;
}

.aifc-msg {
    max-width: 82%;
    padding: 9px 13px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.aifc-msg-user {
    align-self: flex-end;
    background: #4f7cff;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.aifc-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}

.aifc-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #888;
    font-style: italic;
}
.aifc-dots { display: inline-flex; gap: 3px; }
.aifc-dots span {
    width: 5px; height: 5px; border-radius: 50%;
    background: #999;
    animation: aifc-bounce 1.2s infinite ease-in-out;
}
.aifc-dots span:nth-child(2) { animation-delay: 0.15s; }
.aifc-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aifc-bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.5; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.aifc-contact-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: -2px;
}
.aifc-btn {
    display: inline-block;
    padding: 8px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
}
.aifc-btn-call { background: #22c55e; color: #fff; }
.aifc-btn-contact { background: #4f7cff; color: #fff; }

.aifc-input-row {
    display: flex;
    padding: 10px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    gap: 8px;
}
.aifc-input-row input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 9px 14px;
    font-size: 13.5px;
    outline: none;
}
.aifc-input-row input:focus { border-color: #4f7cff; }
.aifc-send-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #333;
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    flex-shrink: 0;
}
.aifc-send-btn:disabled { opacity: 0.5; cursor: default; }

@media (max-width: 480px) {
    .aifc-panel { right: 12px; bottom: 84px; width: calc(100vw - 24px); }
    .aifc-toggle { right: 16px; bottom: 16px; }
}
