.qfw-ai-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #334155;
    background: #f8fafc;
    padding: 32px 16px;
    box-sizing: border-box;
    line-height: 1.5;
}

.qfw-ai-wrap * {
    box-sizing: border-box;
}

/* Layout */
.qfw-main-cols {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}
.qfw-col-left {
    flex: 0 0 calc(67% - 12px);
    max-width: calc(67% - 12px);
}
.qfw-col-right {
    flex: 0 0 calc(33% - 12px);
    max-width: calc(33% - 12px);
    position: sticky;
    top: 24px;
    align-self: flex-start;
}

@media (max-width: 992px) {
    .qfw-col-left, .qfw-col-right {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.qfw-main-card, .qfw-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid #e2e8f0;
}
.qfw-chat-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 65px);
    max-height: 800px;
    min-height: 500px;
}

/* Typography */
.qfw-title {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin: 16px 0 8px;
    line-height: 1.2;
}
.qfw-subtitle {
    font-size: 16px;
    color: #64748b;
    margin-bottom: 24px;
}
.qfw-text-muted {
    color: #94a3b8;
    font-size: 0.9em;
    font-weight: normal;
}
.qfw-text-green { color: #16a34a; }
.qfw-text-purple { color: #5b2cf4; }

/* Badges */
.qfw-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f3f0ff;
    color: #5b2cf4;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
}
.qfw-badge-center {
    margin: 0 auto;
    display: flex;
    width: max-content;
}

/* Buttons */
.qfw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    text-decoration: none;
}
.qfw-btn-primary {
    background: linear-gradient(135deg, #1463ff 0%, #5b2cf4 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(20, 99, 255, 0.25);
}
.qfw-btn-primary:hover {
    box-shadow: 0 6px 16px rgba(20, 99, 255, 0.35);
    transform: translateY(-1px);
}
.qfw-btn-full {
    width: 100%;
}
.qfw-icon-btn {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 4px;
}

/* Trust Row */
.qfw-trust-row {
    display: flex;
    gap: 24px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}
.qfw-trust-item {
    display: flex;
    align-items: center;
    gap: 12px;
}
.qfw-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1463ff;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}
img.qfw-avatar {
    object-fit: cover;
    background: transparent;
}
.qfw-trust-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #1463ff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.qfw-trust-text {
    display: flex;
    flex-direction: column;
}
.qfw-trust-text strong {
    font-size: 14px;
    color: #0f172a;
}
.qfw-trust-text span {
    font-size: 13px;
    color: #64748b;
}

/* Forms */
.qfw-scan-form {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}
.qfw-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}
.qfw-form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.qfw-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
}
.qfw-input-icon {
    position: relative;
    display: flex;
    align-items: center;
}
.qfw-input-icon svg {
    position: absolute;
    left: 12px;
    color: #94a3b8;
}
.qfw-input-icon input {
    padding-left: 36px !important;
}
.qfw-input-icon:focus-within svg {
    color: #1463ff;
    transition: color 0.2s ease;
}
.qfw-ai-wrap input[type="text"],
.qfw-ai-wrap input[type="url"],
.qfw-ai-wrap input[type="email"],
.qfw-ai-wrap input[type="date"],
.qfw-ai-wrap select,
.qfw-ai-wrap textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #0f172a;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.qfw-ai-wrap input:focus, .qfw-ai-wrap select:focus, .qfw-ai-wrap textarea:focus {
    border-color: #1463ff;
    box-shadow: 0 0 0 3px rgba(20, 99, 255, 0.1);
}
.qfw-ai-wrap textarea {
    min-height: 80px;
    resize: vertical;
}

@media (max-width: 600px) {
    .qfw-form-row {
        flex-direction: column;
        gap: 16px;
    }
}

/* Result Panel */
.qfw-result-panel {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    background: #ffffff;
}
.qfw-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}
.qfw-result-badge {
    width: 28px;
    height: 28px;
    background: #5b2cf4;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.qfw-result-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0f172a;
}
.qfw-result-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.qfw-stat-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}
.qfw-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}
.qfw-stat-value {
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    word-break: break-word;
    flex-wrap: wrap;
}
.qfw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}
.qfw-bg-green { background: #16a34a; }

.qfw-result-summary {
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}
.qfw-result-summary strong {
    display: block;
    margin-bottom: 6px;
    color: #0f172a;
}
.qfw-result-summary p {
    margin: 0;
    color: #475569;
    font-size: 14px;
}

.qfw-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.qfw-link {
    color: #5b2cf4;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.qfw-link:hover {
    text-decoration: underline;
}
.qfw-btn-book {
    min-width: 200px;
}

@media (max-width: 768px) {
    .qfw-result-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 500px) {
    .qfw-result-stats {
        grid-template-columns: 1fr;
    }
    .qfw-main-card, .qfw-modal-content {
        padding: 20px;
    }
    .qfw-result-panel {
        padding: 16px;
    }
}

/* Bottom Trust */
.qfw-bottom-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: space-between;
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
}
.qfw-bt-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #5b2cf4;
}
.qfw-bt-item div {
    display: flex;
    flex-direction: column;
}
.qfw-bt-item div strong {
    font-size: 13px;
    color: #0f172a;
}
.qfw-bt-item div span {
    font-size: 12px;
    color: #64748b;
}

/* Chat Card */
.qfw-chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 16px;
}
.qfw-chat-avatar {
    position: relative;
    width: 48px;
    height: 48px;
}
.qfw-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
.qfw-status-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #16a34a;
    border: 2px solid #fff;
    border-radius: 50%;
}
.qfw-chat-title {
    flex: 1;
}
.qfw-chat-title h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}
.qfw-chat-title span {
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qfw-chat-messages {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    padding-right: 8px;
}
.qfw-msg {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.qfw-msg-ai {
    align-self: flex-start;
}
.qfw-msg-user {
    align-self: flex-end;
    align-items: flex-end;
}
.qfw-msg-bubble {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
}
.qfw-msg-ai .qfw-msg-bubble {
    background: #f1f5f9;
    color: #0f172a;
    border-bottom-left-radius: 4px;
}
.qfw-msg-user .qfw-msg-bubble {
    background: #5b2cf4;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.qfw-msg-time {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
}

.qfw-chat-input-area {
    margin-bottom: 16px;
}
.qfw-chat-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
}
.qfw-chat-attach {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    padding: 8px;
}
.qfw-chat-form input {
    flex: 1;
    border: none !important;
    background: transparent !important;
    padding: 8px !important;
    font-size: 14px;
}
.qfw-chat-form input:focus {
    box-shadow: none !important;
}
.qfw-chat-send {
    padding: 8px 16px !important;
}
.qfw-chat-hint {
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
    margin-top: 8px;
}

.qfw-chat-trust {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    padding: 12px;
    border-radius: 8px;
}
.qfw-chat-trust div {
    display: flex;
    flex-direction: column;
}
.qfw-chat-trust div strong {
    font-size: 13px;
    color: #1e3a8a;
}
.qfw-chat-trust div span {
    font-size: 12px;
    color: #3b82f6;
}

/* Modal */
.qfw-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    animation: qfwFadeIn 0.3s ease forwards;
}

@keyframes qfwFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.qfw-modal {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    opacity: 0;
    transform: scale(0.95);
    animation: qfwZoomIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
}

@keyframes qfwZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.qfw-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
}
.qfw-modal-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin: 16px 0 8px;
}
.qfw-modal-subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 24px;
}

.qfw-time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.qfw-time-slot {
    cursor: pointer;
}
.qfw-time-slot input {
    display: none;
}
.qfw-time-slot span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 13px;
    color: #475569;
    transition: all 0.2s;
}
.qfw-time-slot input:checked + span {
    background: #f3f0ff;
    border-color: #5b2cf4;
    color: #5b2cf4;
    font-weight: 600;
}

.qfw-alert {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 500;
}
.qfw-alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

.qfw-modal-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: #94a3b8;
    margin-top: 16px;
}
.qfw-mt-4 { margin-top: 16px; }

/* Micro-Animations & Spinners */
@keyframes qfwSlideUpFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.qfw-fade-in-up {
    animation: qfwSlideUpFadeIn 0.5s ease forwards;
}

@keyframes qfwSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.qfw-spinner {
    animation: qfwSpin 1s linear infinite;
}

/* Typing Indicator */
.qfw-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 4px;
}
.qfw-dot-bounce {
    width: 6px;
    height: 6px;
    background-color: #94a3b8;
    border-radius: 50%;
    animation: qfwBounce 1.4s infinite ease-in-out both;
}
.qfw-dot-bounce:nth-child(1) { animation-delay: -0.32s; }
.qfw-dot-bounce:nth-child(2) { animation-delay: -0.16s; }

@keyframes qfwBounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}
