/* ============================================
   Custlo AI Drawer — Light Theme + Centered Layout
============================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&amp;display=swap');

#custlo_app {
    display: block !important;
    position: relative !important;
    margin: 0 !important;
    padding: 0 !important;
}


#custlo_app * { box-sizing: border-box; }

/* ─── Drawer Base ─── */
#custlo_app .custlo_drawer {
    position: fixed !important;
    top: 0 !important; right: 0 !important; bottom: 0 !important; left: auto !important;
    width: var(--custlo-drawer-width, 420px) !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100% !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    padding: 0;
    transition: opacity 0.28s cubic-bezier(0.4,0,0.2,1), transform 0.28s cubic-bezier(0.4,0,0.2,1), visibility 0.28s;
    z-index: 999 !important;
    box-shadow: -8px 0 48px rgba(0,0,0,0.18), -2px 0 12px rgba(0,0,0,0.08) !important;
    overflow: hidden;
    display: flex !important;
    flex-direction: column !important;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    opacity: 1;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
}

#custlo_app .custlo_drawer.custlo_open {
    opacity: 1 !important;
    transform: translateX(0) !important;
    visibility: visible !important;
    pointer-events: all !important;
    z-index: 2147483647 !important;
}

/* ─── Mobile ─── */
@media (max-width: 768px) {
    #custlo_app .custlo_drawer {
        top: auto !important; bottom: 0 !important; right: 0 !important; left: 0 !important;
        width: 100% !important; height: 92% !important; max-height: 92% !important;
        border-radius: 22px 22px 0 0 !important;
        box-shadow: 0 -4px 40px rgba(0,0,0,0.18) !important;
        transform: translateY(100%);
        visibility: hidden; pointer-events: none;
        transition: transform 0.35s cubic-bezier(0.32,0.72,0,1), visibility 0.35s, opacity 0s 0.35s;
    }
    #custlo_app .custlo_drawer.custlo_open {
        transform: translateY(0) !important;
        opacity: 1 !important; visibility: visible !important; pointer-events: all !important;
        z-index: 2147483647 !important;
        transition: transform 0.35s cubic-bezier(0.32,0.72,0,1), visibility 0s, opacity 0s !important;
    }
    #custlo_app .custlo_mcp_drawer_sectionheading::before {
        content: '';
        display: block; position: absolute;
        top: 8px; left: 50%; transform: translateX(-50%);
        width: 36px; height: 4px;
        background: rgba(255,255,255,0.3); border-radius: 2px;
    }
}

/* ─── Backdrops ─── */
#custlo_app .custlo_backdrop { display: none; }

@media (max-width: 768px) {
    #custlo_app .custlo_backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(0,0,0,0.5); z-index: 9997;
        opacity: 0; pointer-events: none; transition: opacity 0.3s;
    }
    #custlo_app .custlo_backdrop.custlo_backdrop_visible { opacity: 1; pointer-events: all; }
}
@media (min-width: 769px) {
    #custlo_app .custlo_backdrop {
        display: block; position: fixed; inset: 0;
        background: rgba(0,0,0,0.25); z-index: 2147483640;
        opacity: 0; pointer-events: none; transition: opacity 0.28s;
    }
    #custlo_app .custlo_backdrop.custlo_backdrop_visible { opacity: 1; pointer-events: all; }
}

#custlo_mcp_drawer_icon.custlo_floating_launcher { z-index: 2147483645 !important; }

/* Ensure drawer is above ALL third-party widgets (Rewards, chat widgets etc.) */
#custlo_app .custlo_drawer.custlo_open {
    z-index: 2147483647 !important;
}
#custlo_app .custlo_backdrop.custlo_backdrop_visible {
    z-index: 2147483640 !important;
}

/* ─── Close Button ─── */
#custlo_app .custlo_close_btn {
    position: absolute; top: 14px; right: 14px;
    background: #1e293b; border: none;
    font-size: 14px; cursor: pointer; color: #fff;
    padding: 0; line-height: 1; z-index: 2147483647;
    border-radius: 8px; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.15s; font-weight: 600;
}
#custlo_app .custlo_close_btn:hover { background: #0f172a; transform: scale(1.05); }

/* ─── Refresh Button ─── */
#custlo_app .custlo_refresh_btn {
    position: absolute; top: 14px; right: 52px;
    background: rgba(255,255,255,0.15); border: none;
    cursor: pointer; color: #fff;
    padding: 0; line-height: 1; z-index: 2147483647;
    border-radius: 8px; width: 30px; height: 30px;
    display: none; align-items: center; justify-content: center;
    transition: background 0.2s, transform 0.3s; overflow: hidden;
}
#custlo_app .custlo_refresh_btn:hover { background: rgba(255,255,255,0.25); transform: rotate(180deg); }
#custlo_app .custlo_refresh_btn:active { transform: rotate(360deg); transition: transform 0.4s; }

/* ─── Body scroll lock when drawer open ─── */
body.custlo_drawer_open,
html.custlo_drawer_open {
    overflow: hidden !important;
    touch-action: none !important;
    overscroll-behavior: none !important;
}

/* Ensure only drawer content scrolls */
#custlo_app .custlo_drawer {
    overscroll-behavior: contain;
}

#custlo_app #custlo_mcp_drawer_content {
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

#custlo_app #custlo_mcp_drawer_chatContainer {
    flex: 1; display: flex; flex-direction: column; height: 100%; overflow: hidden;
}

/* ─── Header ─── */
#custlo_app .custlo_mcp_drawer_sectionheading {
    display: flex; align-items: center; justify-content: space-between;
    padding: 18px 20px 14px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-bottom: none; flex-shrink: 0; position: relative;
}

#custlo_app .custlo_header_brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -0.01em;
}

#custlo_app .custlo_header_brand_icon {
    width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

#custlo_app .custlo_header_brand_icon svg { display: block; flex-shrink: 0; }

#custlo_app .custlo_header_text { display: flex; flex-direction: column; gap: 2px; }
#custlo_app .custlo_header_title { font-size: 14px; font-weight: 700; color: #fff; line-height: 1.2; }
#custlo_app .custlo_header_status {
    font-size: 11px; color: rgba(255,255,255,0.55); font-weight: 400;
    display: flex; align-items: center; gap: 4px;
}
#custlo_app .custlo_header_dot {
    width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
    box-shadow: 0 0 8px rgba(34,197,94,0.7);
    animation: custlo_pulse_dot 2s ease-in-out infinite; flex-shrink: 0;
}
@keyframes custlo_pulse_dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.85); }
}

#custlo_app .custlo_header_icon_btn { display: none !important; }

/* ════════════════════════════════════════════
   CONTENT AREA
   No messages  → justify-content: center  (welcome + center input in middle)
   Has messages → justify-content: flex-start (normal scroll)
════════════════════════════════════════════ */
#custlo_app #custlo_mcp_drawer_content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    justify-content: center; /* ← default: center */
}

#custlo_app #custlo_mcp_drawer_content.has-messages {
    justify-content: flex-start; /* ← after first message: top */
}

/* ─── Chat Messages ─── */
#custlo_app #custlo_mcp_drawer_chatMessages {
    padding: 12px 14px 8px;
    display: flex; flex-direction: column; gap: 12px;
}

#custlo_app .custlo_mcp_drawer_message {
    padding: 11px 15px; border-radius: 18px;
    max-width: 83%; word-wrap: break-word; overflow-wrap: break-word;
    font-size: 15px; line-height: 1.65; position: relative;
    animation: custlo_msg_in 0.22s ease-out;
}
@keyframes custlo_msg_in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

#custlo_app .custlo_mcp_drawer_user-message {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #fff; align-self: flex-end; border-bottom-right-radius: 5px;
    box-shadow: 0 2px 10px rgba(30,41,59,0.2);
}

#custlo_app .custlo_mcp_drawer_ai-message {
    background: #ffffff; border: 1px solid #e2e8f0;
    color: #1e293b; align-self: flex-start; border-bottom-left-radius: 5px;
    max-width: 90%; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* ─── Timestamps ─── */
#custlo_app .custlo_msg_time { font-size: 10px; color: rgba(100,116,139,0.7); margin-top: 4px; display: block; }
#custlo_app .custlo_msg_time_user { text-align: right; color: rgba(255,255,255,0.5); }

/* ─── Typing Indicator ─── */
#custlo_app .custlo_typing_indicator {
    display: flex; align-items: center; gap: 4px;
    padding: 14px 18px; background: #fff; border: 1px solid #e2e8f0;
    border-radius: 18px; border-bottom-left-radius: 5px;
    align-self: flex-start; max-width: 80px; margin-bottom: 4px;
}
#custlo_app .custlo_typing_indicator span {
    width: 6px; height: 6px; border-radius: 50%; background: #94a3b8;
    animation: custlo_typing_bounce 1.2s ease-in-out infinite;
}
#custlo_app .custlo_typing_indicator span:nth-child(2) { animation-delay: 0.2s; }
#custlo_app .custlo_typing_indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes custlo_typing_bounce {
    0%, 60%, 100% { transform: translateY(0); background: #94a3b8; }
    30% { transform: translateY(-6px); background: #0ea5e9; }
}

/* ════════════════════════════════════════════
   WELCOME SECTION — CENTERED
════════════════════════════════════════════ */
#custlo_app .custlo_mcp_drawer_welcome {
    padding: 0 24px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When has-messages: hide welcome entirely */
#custlo_app #custlo_mcp_drawer_content.has-messages .custlo_mcp_drawer_welcome {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#custlo_app .custlo_welcome_text_wrapper {
    display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 20px; width: 100%;
}

/* (welcome text wrapper, title, subtitle rules under has-messages removed — entire welcome is hidden) */

/* Title */
#custlo_app .custlo_mcp_drawer_welcome-title {
    font-size: 24px; font-weight: 800; color: #1e293b;
    line-height: 1.25; letter-spacing: -0.02em;
    animation: custlo_fade_up 0.4s ease both;
}

#custlo_app .custlo_mcp_drawer_welcome-title span.highlight {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* Subtitle */
#custlo_app .custlo_mcp_drawer_welcome-subtitle {
    font-size: 13.5px; color: #64748b; line-height: 1.6;
    animation: custlo_fade_up 0.4s 0.07s ease both;
}

#custlo_app #custlo_mcp_drawer_content.has-messages .custlo_mcp_drawer_welcome-subtitle {
    display: none;
}

#custlo_app .custlo_mcp_drawer_welcome-subtitle span.highlight { color: #0ea5e9; font-weight: 500; }

@keyframes custlo_fade_up {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   CENTER INPUT — visible only when no messages
════════════════════════════════════════════ */
#custlo_app .custlo_center_input_wrapper {
    width: 100%;
    display: block;
    animation: custlo_fade_up 0.4s 0.12s ease both;
}

/* ── FIX: Hide center input immediately (no transition) when chat starts ── */
#custlo_app #custlo_mcp_drawer_content.has-messages .custlo_center_input_wrapper {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#custlo_app .custlo_center_input_box {
    display: flex; align-items: center;
    background: #f1f5f9; border-radius: 50px;
    padding: 5px 6px 5px 18px;
    border: 1.5px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

#custlo_app .custlo_center_input_box:focus-within {
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(30,41,59,0.07);
    background: #fff;
}

#custlo_app #custlo_center_userInput {
    flex: 1; border: none !important; background: transparent !important;
    padding: 9px 0; font-size: 13.5px; outline: none !important;
    color: #1e293b; box-shadow: none !important; font-family: inherit; font-weight: 400;
}
#custlo_app #custlo_center_userInput::placeholder { color: #94a3b8; }
#custlo_app #custlo_center_userInput:disabled { opacity: 0.4; }

#custlo_app .custlo_center_icon_group {
    display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

#custlo_app .custlo_center_voice_btn {
    background: transparent; border: none; color: #94a3b8;
    cursor: pointer; padding: 8px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; transition: color 0.2s, background 0.2s;
}
#custlo_app .custlo_center_voice_btn:hover { color: #475569; background: #e2e8f0; }

#custlo_app .custlo_center_send_btn {
    background: #1e293b; border: none; color: #fff;
    cursor: pointer; padding: 0;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; width: 38px; height: 38px;
    transition: transform 0.15s, box-shadow 0.2s, background 0.2s; flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(30,41,59,0.25);
}
#custlo_app .custlo_center_send_btn:hover:not(:disabled) {
    transform: scale(1.08); background: #0f172a;
    box-shadow: 0 4px 14px rgba(30,41,59,0.35);
}
#custlo_app .custlo_center_send_btn:disabled {
    background: #e2e8f0; color: #94a3b8; cursor: not-allowed; transform: none; box-shadow: none;
}

/* ─── Quick Reply Buttons ─── */
#custlo_app .custlo_quick_replies {
    display: flex; gap: 8px; flex-wrap: wrap;
    width: 100%; margin-top: 16px; margin-bottom: 0;
    justify-content: center;
    position: sticky; top: -1px; z-index: 10;
    padding: 4px 0;
    transition: all 0.25s;
    animation: custlo_fade_up 0.4s 0.18s ease both;
}

/* ── FIX: Hide quick replies immediately (no transition) when chat starts ── */
#custlo_app #custlo_mcp_drawer_content.has-messages .custlo_quick_replies {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

#custlo_app .custlo_quick_replies.stuck {
    background: rgba(248,250,252,0.97); backdrop-filter: blur(12px);
    width: calc(100% + 48px); margin-left: -24px;
    padding: 10px 24px; border-bottom: 1px solid #f1f5f9;
}

#custlo_app .custlo_quick_reply_btn {
    background: #fff; color: #475569;
    border: 1.5px solid #e2e8f0; padding: 7px 14px;
    border-radius: 20px; font-size: 12px; cursor: pointer;
    transition: all 0.2s; white-space: nowrap;
    font-family: inherit; font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
#custlo_app .custlo_quick_reply_btn:hover {
    background: #1e293b; border-color: #1e293b; color: #fff;
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(30,41,59,0.15);
}

/* ════════════════════════════════════════════
   BOTTOM INPUT — hidden until chat starts
════════════════════════════════════════════ */
#custlo_app .custlo_mcp_drawer_chat-input-wrapper {
    padding: 10px 14px 12px;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    display: none; /* hidden by default */
}

/* Show bottom input when chat starts */
#custlo_app .custlo_drawer.custlo_has_messages .custlo_mcp_drawer_chat-input-wrapper {
    display: block;
}

#custlo_app .custlo_mcp_drawer_chat-input {
    display: flex; align-items: center;
    background: #f8fafc; border-radius: 14px;
    padding: 5px 6px 5px 14px; border: 1.5px solid #e2e8f0;
    transition: border-color 0.2s, box-shadow 0.2s;
}
#custlo_app .custlo_mcp_drawer_chat-input:focus-within,
#custlo_app .custlo_mcp_drawer_chat-input.has-text {
    border-color: #1e293b; box-shadow: 0 0 0 3px rgba(30,41,59,0.06); background: #fff;
}

#custlo_app #custlo_mcp_drawer_userInput {
    flex: 1; border: none !important; background: transparent !important;
    padding: 8px 0; font-size: 13.5px; outline: none !important;
    color: #1e293b; box-shadow: none !important; font-family: inherit;
}
#custlo_app #custlo_mcp_drawer_userInput::placeholder { color: #94a3b8; }
#custlo_app #custlo_mcp_drawer_userInput:disabled { opacity: 0.5; }

#custlo_app .custlo_mcp_drawer_icon-btn {
    background: transparent; border: none; color: #94a3b8; cursor: pointer;
    padding: 8px; display: flex; align-items: center; justify-content: center;
    border-radius: 8px; transition: color 0.2s, background 0.2s; flex-shrink: 0;
}
#custlo_app .custlo_mcp_drawer_icon-btn:hover:not(:disabled) { color: #475569; background: #f1f5f9; }
#custlo_app .custlo_mcp_drawer_icon-btn svg,
#custlo_app .custlo_mcp_drawer_send-btn svg { display: block; flex-shrink: 0; }

#custlo_app .custlo_mcp_drawer_send-btn {
    background: #1e293b; border: none; color: #fff; cursor: pointer;
    padding: 8px; display: flex; align-items: center; justify-content: center;
    border-radius: 10px; transition: opacity 0.2s, transform 0.15s, background 0.2s;
    flex-shrink: 0; width: 36px; height: 36px; overflow: hidden;
}
#custlo_app .custlo_mcp_drawer_send-btn:hover:not(:disabled) { background: #0f172a; transform: scale(1.05); }
#custlo_app .custlo_mcp_drawer_send-btn:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; transform: none; }

/* ─── Input Footer ─── */
#custlo_app .custlo_input_footer { display: flex; justify-content: center; margin-top: 6px; }
#custlo_app .custlo_powered_by { font-size: 10px; color: #cbd5e1; letter-spacing: 0.03em; }
#custlo_app .custlo_powered_by strong { color: #94a3b8; }

/* ─── Error Messages ─── */
#custlo_app .custlo_backend_error {
    background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; padding: 10px 14px; border-radius: 10px;
}
#custlo_app .custlo_backend_error p { margin: 0 0 6px 0; }
#custlo_app .custlo_backend_error p:last-child { margin: 0; }
#custlo_app .custlo_backend_error a { color: #dc2626; text-decoration: underline; }

/* ─── Login CTA ─── */
#custlo_app .custlo_inline_login_btn {
    display: inline-block; margin-top: 10px; padding: 8px 16px;
    background: #1e293b; color: white; text-decoration: none;
    border-radius: 8px; font-size: 13px; font-weight: 500; transition: background 0.2s;
}
#custlo_app .custlo_inline_login_btn:hover { background: #0f172a; }

/* ─── Text Formatting ─── */
#custlo_app .custlo_heading { font-size: 14px; font-weight: 600; color: #1e293b; margin: 8px 0 4px; }
#custlo_app .custlo_paragraph { margin: 0 0 8px 0; color: #1e293b; }
#custlo_app .custlo_paragraph:last-child { margin-bottom: 0; }
#custlo_app .custlo_list { margin: 4px 0 8px 0; padding-left: 18px; color: #1e293b; }
#custlo_app .custlo_list li { margin-bottom: 4px; }
#custlo_app .custlo_code_block {
    background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px;
    padding: 10px; overflow-x: auto; font-size: 12.5px; color: #475569;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}
#custlo_app .custlo_mcp_drawer_ai-message a { color: #0ea5e9; text-decoration: underline; }
#custlo_app .custlo_mcp_drawer_ai-message strong { color: #1e293b; }

/* ─── Chat History Sidebar ─── */
#custlo_app .custlo_history_sidebar {
    position: absolute; top: 0; left: -100%; width: 82%; height: 100%;
    background: #f8fafc; box-shadow: 4px 0 24px rgba(0,0,0,0.10);
    z-index: 2147483647; transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column; border-radius: 0; overflow: hidden;
}
#custlo_app .custlo_history_sidebar.open { left: 0; }

#custlo_app .custlo_sidebar_header {
    padding: 16px 16px 14px; background: #fff; border-bottom: 1px solid #f1f5f9;
    display: flex; justify-content: space-between; align-items: center;
}
#custlo_app .custlo_sidebar_header h3 { margin: 0; font-size: 14px; font-weight: 700; color: #1e293b; }

#custlo_app .custlo_new_chat_btn {
    margin: 10px 12px; padding: 10px 14px; background: #1e293b; color: #fff; border: none;
    border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 13px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    transition: background 0.2s; font-family: inherit;
}
#custlo_app .custlo_new_chat_btn svg { display: block; flex-shrink: 0; }
#custlo_app .custlo_new_chat_btn:hover { background: #0f172a; }

#custlo_app .custlo_history_list {
    flex: 1; overflow-y: auto; padding: 6px 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
}
#custlo_app .custlo_history_empty { text-align: center; color: #94a3b8; font-size: 13px; margin-top: 24px; }

#custlo_app .custlo_history_card {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 10px 12px; cursor: pointer; transition: all 0.18s;
    display: flex; justify-content: space-between; align-items: center; outline: none;
}
#custlo_app .custlo_history_card:hover { border-color: #1e293b; box-shadow: 0 2px 8px rgba(30,41,59,0.08); }
#custlo_app .custlo_history_card.active { border-color: #1e293b; background: #f1f5f9; }
#custlo_app .custlo_history_info { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: hidden; }
#custlo_app .custlo_history_title { font-size: 12.5px; font-weight: 500; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#custlo_app .custlo_history_date { font-size: 10.5px; color: #94a3b8; }

#custlo_app .custlo_history_delete_btn {
    background: transparent; border: none; color: #cbd5e1; cursor: pointer;
    padding: 5px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: color 0.2s, background 0.2s; flex-shrink: 0;
}
#custlo_app .custlo_history_delete_btn:hover { color: #ef4444; background: #fef2f2; }

#custlo_app .custlo_icon_btn {
    background: transparent; border: none; cursor: pointer; font-size: 14px;
    color: #94a3b8; padding: 5px; display: flex; align-items: center; justify-content: center;
    border-radius: 6px; transition: color 0.2s, background 0.2s;
}
#custlo_app .custlo_icon_btn:hover { color: #1e293b; background: #f1f5f9; }

/* ─── Sidebar Footer ─── */
#custlo_app .custlo_sidebar_footer { padding: 12px; background: #fff; border-top: 1px solid #f1f5f9; margin-top: auto; }
#custlo_app .custlo_profile_row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
#custlo_app .custlo_profile_avatar {
    width: 34px; height: 34px; border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; flex-shrink: 0;
}
#custlo_app .custlo_profile_info { flex: 1; overflow: hidden; }
#custlo_app .custlo_profile_name { font-weight: 600; font-size: 12.5px; color: #1e293b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#custlo_app .custlo_profile_email { font-size: 10.5px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

#custlo_app .custlo_sidebar_btn {
    display: flex; align-items: center; justify-content: center; width: 100%; padding: 9px;
    text-decoration: none; border-radius: 8px; font-size: 13px; font-weight: 500;
    cursor: pointer; transition: background 0.2s; font-family: inherit; border: none;
}
#custlo_app .custlo_logout_btn { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
#custlo_app .custlo_logout_btn:hover { background: #e2e8f0; }
#custlo_app .custlo_login_btn { background: #1e293b; color: #fff; }
#custlo_app .custlo_login_btn:hover { background: #0f172a; }

/* ─── Voice ─── */
#custlo_app #custlo_mcp_drawer_voiceBtn.listening,
#custlo_app #custlo_center_voiceBtn.listening {
    color: #ef4444 !important; animation: custlo_pulse 1.2s ease-in-out infinite;
}
@keyframes custlo_pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ─── History Loader ─── */
#custlo_app .custlo_history_loader {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; height: 100%; color: #94a3b8; font-size: 13px; gap: 10px;
}
#custlo_app .custlo_history_spinner {
    width: 26px; height: 26px; border: 2.5px solid #e2e8f0; border-top: 2.5px solid #1e293b;
    border-radius: 50%; animation: custlo_spin 0.8s linear infinite;
}
@keyframes custlo_spin { to { transform: rotate(360deg); } }

/* ─── Guest Forms ─── */
#custlo_app .custlo_guest_verify_form {
    background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 14px;
    padding: 18px; width: 100%; display: flex; flex-direction: column; gap: 12px;
}
#custlo_app .custlo_guest_verify_title { font-size: 14px; font-weight: 700; color: #1e293b; margin: 0; }
#custlo_app .custlo_guest_verify_sub { font-size: 12.5px; color: #64748b; margin: 0; line-height: 1.5; }
#custlo_app .custlo_guest_verify_error { font-size: 12.5px; color: #dc2626; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 8px 12px; }
#custlo_app .custlo_guest_field { display: flex; flex-direction: column; gap: 5px; }
#custlo_app .custlo_guest_field label { font-size: 10.5px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: 0.07em; }
#custlo_app .custlo_guest_field input {
    background: #fff; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 10px 14px; font-size: 13.5px; color: #1e293b; outline: none;
    transition: border-color 0.2s, box-shadow 0.2s; width: 100%; font-family: inherit;
}
#custlo_app .custlo_guest_field input:focus { border-color: #1e293b; box-shadow: 0 0 0 3px rgba(30,41,59,0.08); }
#custlo_app .custlo_guest_field input::placeholder { color: #94a3b8; }
#custlo_app .custlo_guest_submit_btn {
    background: #1e293b; color: #fff; border: none; border-radius: 10px;
    padding: 11px 20px; font-size: 13.5px; font-weight: 600; cursor: pointer;
    transition: background 0.2s, transform 0.15s; width: 100%; font-family: inherit;
}
#custlo_app .custlo_guest_submit_btn:hover:not(:disabled) { background: #0f172a; transform: translateY(-1px); }
#custlo_app .custlo_guest_submit_btn:disabled { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
#custlo_app .custlo_guest_resend_btn {
    background: transparent; color: #64748b; border: 1.5px solid #e2e8f0; border-radius: 10px;
    padding: 10px 20px; font-size: 12.5px; cursor: pointer; transition: all 0.2s; width: 100%; font-family: inherit;
}
#custlo_app .custlo_guest_resend_btn:hover:not(:disabled) { border-color: #1e293b; color: #1e293b; }
#custlo_app .custlo_guest_resend_btn:disabled { opacity: 0.4; cursor: not-allowed; }
#custlo_app #custlo_guest_code { font-size: 22px; letter-spacing: 0.3em; text-align: center; font-weight: 800; color: #1e293b; }

/* ─── Mobile ─── */
@media (max-width: 500px) {
    #custlo_app .custlo_history_sidebar { width: 100%; border-radius: 0; }
    #custlo_app #custlo_mcp_drawer_userInput, #custlo_app #custlo_center_userInput { font-size: 16px; }
    #custlo_app .custlo_mcp_drawer_message { font-size: 14px; max-width: 88%; }
    #custlo_app .custlo_mcp_drawer_sectionheading { padding: 14px 16px; }
    #custlo_app .custlo_mcp_drawer_welcome { padding: 0 18px; }
    #custlo_app .custlo_mcp_drawer_welcome-title { font-size: 20px; }
    #custlo_app .custlo_new_chat_btn, #custlo_app .custlo_sidebar_btn { min-height: 44px; }
}

/* ─── Scrollbar ─── */
#custlo_app #custlo_mcp_drawer_content::-webkit-scrollbar,
#custlo_app .custlo_history_list::-webkit-scrollbar { width: 4px; }
#custlo_app #custlo_mcp_drawer_content::-webkit-scrollbar-track,
#custlo_app .custlo_history_list::-webkit-scrollbar-track { background: transparent; }
#custlo_app #custlo_mcp_drawer_content::-webkit-scrollbar-thumb,
#custlo_app .custlo_history_list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }

/* ─── Date Divider ─── */
#custlo_app .custlo_date_divider { text-align: center; font-size: 10.5px; color: #cbd5e1; margin: 4px 0; position: relative; }
#custlo_app .custlo_date_divider::before, #custlo_app .custlo_date_divider::after { content: ''; position: absolute; top: 50%; width: 35%; height: 1px; background: #f1f5f9; }
#custlo_app .custlo_date_divider::before { left: 0; }
#custlo_app .custlo_date_divider::after { right: 0; }
/* ─── Recently Viewed Products ─── */
#custlo_app .custlo_rv_heading {
    font-size: 13px; font-weight: 600; color: #475569;
    margin-bottom: 10px; padding: 0 2px;
}
#custlo_app .custlo_rv_list {
    display: flex; flex-direction: column; gap: 10px;
}
#custlo_app .custlo_mcp_drawer_ai-message  .custlo_rv_card {
    display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid #e2e8f0;
    border-radius: 14px; padding: 10px 12px;
    text-decoration: none; color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
    cursor: pointer; position: relative;
}
#custlo_app .custlo_rv_card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    border-color: #cbd5e1;
}
#custlo_app .custlo_rv_img_wrap {
    width: 62px; height: 62px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden;
    background: #f8fafc; display: flex;
    align-items: center; justify-content: center;
}
#custlo_app .custlo_rv_img {
    width: 100%; height: 100%; object-fit: cover;
}
#custlo_app .custlo_rv_img_placeholder {
    font-size: 26px; color: #cbd5e1;
}
#custlo_app .custlo_rv_info {
    flex: 1; min-width: 0; display: flex;
    flex-direction: column; gap: 4px;
    text-decoration: none;
}
#custlo_app .custlo_rv_title {
    font-size: 13.5px; font-weight: 600; color: #1e293b;
    line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
#custlo_app .custlo_rv_price {
    font-size: 13px; font-weight: 700; color: #0f172a;
}
#custlo_app .custlo_rv_badge {
    display: inline-block; font-size: 11px; font-weight: 600;
    padding: 2px 8px; border-radius: 20px; width: fit-content;
}
#custlo_app .custlo_rv_badge_instock {
    background: #dcfce7; color: #16a34a;
}
#custlo_app .custlo_rv_badge_outofstock {
    background: #fee2e2; color: #dc2626;
}
#custlo_app .custlo_rv_arrow {
    font-size: 20px; color: #94a3b8; flex-shrink: 0;
    line-height: 1; padding-right: 2px;
}
#custlo_app .custlo_rv_followup {
    margin-top: 10px;
    font-size: 13px;
    color: #475569;
    padding: 2px 2px 0;
    line-height: 1.5;
}

/* ─── PRODUCT DETAIL CARD (get_product_details) ─── */
#custlo_app .custlo_pd_card {
    background: #fff;
    border: 1px solid #e8edf3;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.07);
    margin-top: 2px;
}
#custlo_app .custlo_pd_img_wrap {
    width: 100%; height: 220px; overflow: hidden;
    background: #f1f5f9; display: flex;
    align-items: center; justify-content: center;
    position: relative;
}
#custlo_app .custlo_pd_img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.3s ease;
}
#custlo_app .custlo_pd_img_placeholder {
    font-size: 52px; color: #cbd5e1;
}
#custlo_app .custlo_pd_body {
    padding: 16px 16px 18px;
    display: flex; flex-direction: column; gap: 10px;
}
#custlo_app .custlo_pd_header {
    display: flex; align-items: flex-start;
    justify-content: space-between; gap: 8px;
}
#custlo_app .custlo_pd_title {
    font-size: 16px; font-weight: 700; color: #0f172a;
    line-height: 1.3; flex: 1;
}
#custlo_app .custlo_pd_price {
    font-size: 18px; font-weight: 800; color: #0f172a;
    letter-spacing: -0.3px;
}
#custlo_app .custlo_pd_desc {
    font-size: 12.5px; color: #64748b; line-height: 1.6;
}
/* Variant pills */
#custlo_app .custlo_pd_variant_section {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 0 2px;
    border-top: 1px solid #f1f5f9;
}
#custlo_app .custlo_pd_pill_group {
    display: flex; flex-direction: column; gap: 5px;
}
#custlo_app .custlo_pd_pill_label {
    font-size: 11px; font-weight: 700; color: #94a3b8;
    text-transform: uppercase; letter-spacing: 0.5px;
}
#custlo_app .custlo_pd_pills {
    display: flex; flex-wrap: wrap; gap: 5px;
}
#custlo_app .custlo_pd_pill {
    display: inline-block;
    padding: 4px 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 12px; font-weight: 500; color: #334155;
}
/* CTA Button */
#custlo_app .custlo_pd_btn {
    display: flex; align-items: center;
    justify-content: center; gap: 6px;
    margin-top: 4px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    color: #fff;
    font-size: 13.5px; font-weight: 600;
    padding: 11px 20px; border-radius: 12px;
    text-decoration: none; text-align: center;
    transition: opacity 0.2s, transform 0.15s;
    box-shadow: 0 2px 8px rgba(30,41,59,0.25);
}
#custlo_app .custlo_pd_btn:hover {
    opacity: 0.92; transform: translateY(-1px);
}
#custlo_app .custlo_pd_btn_arrow {
    font-size: 15px; transition: transform 0.2s;
}
#custlo_app .custlo_pd_btn:hover .custlo_pd_btn_arrow {
    transform: translateX(3px);
}

/* ─── AI Message Table ─── */
#custlo_app .custlo_table_wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 8px 0;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
}

#custlo_app .custlo_table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
    line-height: 1.5;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
}

#custlo_app .custlo_table thead tr {
    background: linear-gradient(135deg, #f1f5f9 0%, #e8eef5 100%);
}

#custlo_app .custlo_table th {
    padding: 9px 12px;
    text-align: left;
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #475569;
    border-bottom: 1.5px solid rgba(0,0,0,0.08);
    white-space: nowrap;
}

#custlo_app .custlo_table td {
    padding: 9px 12px;
    color: #1e293b;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    vertical-align: middle;
}

#custlo_app .custlo_table tbody tr:last-child td {
    border-bottom: none;
}

#custlo_app .custlo_table tbody tr:hover {
    background: #f8fafc;
    transition: background 0.15s;
}

#custlo_app .custlo_table .custlo_td_primary {
    font-weight: 700;
    color: #0ea5e9;
    white-space: nowrap;
}

/* Zebra stripe for readability */
#custlo_app .custlo_table tbody tr:nth-child(even) {
    background: #fafbfc;
}
#custlo_app .custlo_table tbody tr:nth-child(even):hover {
    background: #f1f5f9;
}
/* ── Clickable chat links ── */
#custlo_app .custlo_chat_link {
    color: #0ea5e9;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    word-break: break-word;
    cursor: pointer;
}
#custlo_app .custlo_chat_link:hover {
    color: #0284c7;
    text-decoration: none;
}