/* ============================================================
   PANCHAMI LIVE CLIENT CHAT WIDGET STYLES (v4.3 Professional)
   Enterprise-grade glassmorphism, responsive micro-interactions,
   animated typing wave, accessibility, and high-DPI polish.
   ============================================================ */

:root {
    --chat-gold: #f5b942;
    --chat-gold-light: #ffd978;
    --chat-gold-dark: #d99b26;
    --chat-midnight: #081220;
    --chat-surface: rgba(11, 25, 44, 0.94);
    --chat-surface-card: #132438;
    --chat-navy: #15273b;
    --chat-navy-dark: #091322;
    --chat-bubble-client: linear-gradient(135deg, #2563eb, #1d4ed8);
    --chat-bubble-admin: linear-gradient(145deg, #16263b, #0e1b2b);
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-gold-border: rgba(245, 185, 66, 0.22);
    --chat-shadow: 0 24px 64px rgba(0, 0, 0, 0.65), 0 0 24px rgba(245, 185, 66, 0.08);
}

/* ================= 1. FLOATING TRIGGER BUTTON ================= */
.panchami-chat-trigger {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
    right: 24px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 9px;
    background: linear-gradient(135deg, #ffd978 0%, #f5b942 50%, #e5a730 100%);
    color: #07111f;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 36px;
    padding: 13px 22px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 32px rgba(245, 185, 66, 0.45), 0 0 20px rgba(245, 185, 66, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.panchami-chat-trigger:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 16px 40px rgba(245, 185, 66, 0.6), 0 0 32px rgba(245, 185, 66, 0.35);
    color: #000000;
}

.panchami-chat-trigger:active {
    transform: translateY(-1px) scale(0.97);
}

/* Pulsing Beacon Live Dot */
.chat-pulse-beacon {
    position: relative;
    width: 10px;
    height: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: -1px;
}

.beacon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    z-index: 2;
}

.beacon-ring {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(16, 185, 129, 0.85);
    animation: beaconPulseWave 1.8s cubic-bezier(0.24, 0, 0.38, 1) infinite;
    z-index: 1;
}

@keyframes beaconPulseWave {
    0% {
        transform: scale(0.6);
        opacity: 1;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

.chat-trigger-icon {
    font-size: 19px;
    display: flex;
    align-items: center;
    line-height: 1;
}

.chat-trigger-text {
    letter-spacing: -0.01em;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.chat-trigger-sub {
    font-size: 11px;
    font-weight: 700;
    opacity: 0.85;
    letter-spacing: 0.02em;
}

.chat-unread-badge {
    background: #ef4444;
    color: #ffffff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.5);
    display: none;
}

/* Active / Ongoing Open State: Transforms into Round "✕" Mark */
.panchami-chat-trigger.is-open {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    max-width: 52px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    background: linear-gradient(135deg, var(--chat-gold), var(--chat-gold-dark)) !important;
    color: #0b192c !important;
    box-shadow: 0 12px 32px rgba(245, 185, 66, 0.5) !important;
    border: 2px solid rgba(255, 255, 255, 0.45) !important;
    z-index: 99999 !important;
}

.panchami-chat-trigger.is-open .chat-trigger-text,
.panchami-chat-trigger.is-open .chat-pulse-beacon,
.panchami-chat-trigger.is-open .chat-unread-badge {
    display: none !important;
}

.panchami-chat-trigger.is-open .chat-trigger-icon {
    font-size: 22px !important;
    font-weight: 800 !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.panchami-chat-trigger.is-open:hover {
    transform: translateY(-2px) scale(1.08) !important;
    box-shadow: 0 16px 36px rgba(245, 185, 66, 0.65) !important;
}

.panchami-chat-trigger.is-open:hover .chat-trigger-icon {
    transform: rotate(90deg) !important;
}

/* ================= 1.1 DUAL-PERSONA SWITCHER BAR ================= */
.chat-assistant-switch-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(7, 18, 33, 0.9);
    border-bottom: 1px solid var(--chat-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.chat-switch-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04);
    color: #94a3b8;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: left;
}

.chat-switch-btn:hover {
    background: rgba(245, 185, 66, 0.08);
    border-color: rgba(245, 185, 66, 0.3);
    color: #ffffff;
    transform: translateY(-1px);
}

.chat-switch-btn.active {
    background: linear-gradient(135deg, rgba(245, 185, 66, 0.18), rgba(62, 207, 142, 0.14));
    border-color: var(--chat-gold);
    color: #ffffff;
    box-shadow: 0 0 14px rgba(245, 185, 66, 0.16);
}

.chat-switch-btn .switch-icon {
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-switch-btn .switch-label {
    display: flex;
    flex-direction: column;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.15;
    min-width: 0;
}

.chat-switch-btn .switch-label small {
    font-size: 9px;
    font-weight: 500;
    color: var(--chat-gold-light);
    opacity: 0.85;
    letter-spacing: 0.02em;
}

.chat-switch-btn.active .switch-label small {
    color: var(--chat-gold);
    opacity: 1;
}

/* ================= 2. CHAT DRAWER / WINDOW ================= */
.panchami-chat-drawer {
    position: fixed;
    bottom: 88px;
    right: 24px;
    width: 390px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 110px);
    background: var(--chat-surface);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--chat-gold-border);
    border-top: 3px solid var(--chat-gold);
    border-radius: 20px;
    box-shadow: var(--chat-shadow);
    display: none;
    flex-direction: column;
    z-index: 99995;
    overflow: hidden;
    animation: chatSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.panchami-chat-drawer.open {
    display: flex;
}

@keyframes chatSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Grab Handle Bar (Hidden on desktop) */
.chat-mobile-handle {
    display: none;
}

/* ================= 3. CHAT DRAWER HEADER ================= */
.chat-drawer-header {
    background: var(--chat-navy-dark);
    padding: 14px 18px;
    border-bottom: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: var(--chat-midnight);
    font-weight: 800;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(245, 185, 66, 0.35);
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-header-text {
    min-width: 0;
}

.chat-header-text h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--chat-gold);
    color: var(--chat-midnight);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    flex-shrink: 0;
}

.chat-status-indicator {
    font-size: 11px;
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

.chat-status-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 8px #4ade80;
    display: inline-block;
    animation: pulseDotLive 2s infinite ease-in-out;
}

@keyframes pulseDotLive {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.6; }
}

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

.chat-header-action-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--chat-border);
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 9px;
    border-radius: 7px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-header-action-btn:hover {
    background: rgba(245, 185, 66, 0.2);
    border-color: var(--chat-gold);
    color: #ffffff;
    transform: translateY(-1px);
}

.chat-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    line-height: 1;
}

.chat-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* ================= 4. CLIENT IDENTITY / AUTH PROMPT ================= */
.chat-auth-prompt {
    padding: 30px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--chat-midnight);
    flex: 1;
    justify-content: center;
    text-align: center;
}

.chat-auth-prompt h4 {
    margin: 0;
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
}

.chat-auth-prompt p {
    margin: 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.5;
}

.chat-auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--chat-border);
    border-radius: 10px;
    padding: 12px 14px;
    color: #ffffff;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
}

.chat-auth-input:focus {
    border-color: var(--chat-gold);
    box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.15);
}

.chat-auth-btn {
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: var(--chat-midnight);
    font-weight: 800;
    border: none;
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.chat-auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(245, 185, 66, 0.35);
}

/* ================= 5. MESSAGES STREAM & BUBBLES ================= */
.chat-messages-stream {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #08111e;
    scroll-behavior: smooth;
}

/* Custom Sleek Scrollbar */
.chat-messages-stream::-webkit-scrollbar {
    width: 5px;
}

.chat-messages-stream::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages-stream::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.chat-messages-stream::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 185, 66, 0.4);
}

/* Individual Message Row */
.chat-bubble-row {
    display: flex;
    flex-direction: column;
    max-width: 84%;
    animation: messageSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chat-bubble-row.client {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-bubble-row.admin {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble-sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--chat-gold);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.chat-bubble-avatar-mini {
    font-size: 12px;
}

.chat-bubble {
    padding: 11px 15px;
    font-size: 13.5px;
    line-height: 1.5;
    word-break: break-word;
    border-radius: 16px;
}

.chat-bubble a {
    color: var(--chat-gold-light);
    text-decoration: underline;
    font-weight: 600;
    word-break: break-all;
}

.chat-bubble strong {
    color: #ffffff;
    font-weight: 700;
}

.chat-bubble-row.client .chat-bubble {
    background: var(--chat-bubble-client);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
    box-shadow: 0 4px 14px rgba(29, 78, 216, 0.28);
}

.chat-bubble-row.admin .chat-bubble {
    background: var(--chat-bubble-admin);
    border: 1px solid var(--chat-gold-border);
    color: #e2e8f0;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.chat-bubble-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.chat-bubble-time {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.45);
}

.chat-bubble-status {
    font-size: 10px;
    color: #60a5fa;
    font-weight: 700;
    letter-spacing: -1px;
}

/* System Notifications */
.chat-system-notice {
    align-self: center;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 5px 14px;
    border-radius: 14px;
    margin: 4px 0;
    text-align: center;
}

/* Resolution Banner */
.chat-resolution-banner {
    background: rgba(22, 101, 52, 0.25);
    border: 1px solid rgba(74, 222, 128, 0.35);
    border-radius: 12px;
    padding: 14px 16px;
    margin: 8px 12px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.chat-star-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 8px 0;
}

.chat-star-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--chat-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.chat-star-btn:hover {
    background: rgba(245, 185, 66, 0.25);
    border-color: var(--chat-gold);
    transform: scale(1.06);
}

/* ================= 6. ANIMATED TYPING WAVE INDICATOR ================= */
.chat-typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px;
    align-self: flex-start;
    animation: messageSlideIn 0.2s ease;
}

.chat-typing-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--chat-gold);
    color: var(--chat-midnight);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-typing-bubble {
    background: var(--chat-surface-card);
    border: 1px solid var(--chat-gold-border);
    border-radius: 14px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
}

.chat-typing-dots {
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-gold);
    display: inline-block;
    animation: typingBounce 1.4s infinite ease-in-out both;
}

.chat-typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.chat-typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes typingBounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.35;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.chat-typing-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

/* ================= 7. QUICK REPLY CHIPS ================= */
.chat-quick-suggestions {
    display: flex;
    gap: 6px;
    padding: 9px 14px;
    background: var(--chat-navy-dark);
    border-top: 1px solid var(--chat-border);
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.chat-quick-suggestions::-webkit-scrollbar {
    display: none;
}

.chat-chip {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--chat-border);
    color: #cbd5e1;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-chip:hover {
    background: rgba(245, 185, 66, 0.18);
    border-color: var(--chat-gold);
    color: #ffffff;
    transform: translateY(-1px);
}

.chat-chip-whatsapp {
    background: rgba(37, 211, 102, 0.14) !important;
    border-color: rgba(37, 211, 102, 0.45) !important;
    color: #25d366 !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.chat-chip-whatsapp:hover {
    background: rgba(37, 211, 102, 0.28) !important;
    border-color: #25d366 !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(37, 211, 102, 0.35) !important;
    transform: translateY(-2px) scale(1.03) !important;
}

/* ================= 8. INPUT AREA ================= */
.chat-input-row {
    padding: 12px 14px;
    background: var(--chat-navy-dark);
    border-top: 1px solid var(--chat-border);
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-input-row input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--chat-border);
    border-radius: 24px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 13.5px;
    font-family: inherit;
    outline: none;
    transition: all 0.2s ease;
}

.chat-input-row input:focus {
    border-color: var(--chat-gold);
    background: rgba(255, 255, 255, 0.09);
    box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.18);
}

.chat-send-btn {
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: var(--chat-midnight);
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(245, 185, 66, 0.3);
}

.chat-send-btn:hover {
    background: #ffffff;
    color: #07111f;
    transform: scale(1.06);
    box-shadow: 0 6px 16px rgba(255, 255, 255, 0.4);
}

.chat-send-btn:active {
    transform: scale(0.95);
}

/* ================= 9. PROACTIVE AUTO-CHAT SPEECH BUBBLE ================= */
.chat-proactive-bubble {
    position: fixed;
    bottom: 86px;
    right: 24px;
    z-index: 99991;
    background: #0f2238;
    border: 1px solid rgba(245, 185, 66, 0.4);
    border-radius: 18px;
    padding: 16px 18px;
    max-width: 330px;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55), 0 0 16px rgba(245, 185, 66, 0.12);
    display: none;
    animation: bubblePop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Speech bubble pointer arrow pointing to trigger button */
.chat-proactive-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 32px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #0f2238;
}

.chat-proactive-bubble.show {
    display: block;
}

@keyframes bubblePop {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.94);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.proactive-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}

.proactive-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.proactive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.proactive-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--chat-gold);
    color: var(--chat-midnight);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.proactive-name {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
}

.proactive-text {
    font-size: 13px;
    color: #cbd5e1;
    line-height: 1.45;
    margin: 0 0 12px 0;
}

.proactive-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.proactive-btn {
    background: rgba(245, 185, 66, 0.15);
    border: 1px solid var(--chat-gold);
    color: var(--chat-gold);
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.proactive-btn:hover {
    background: var(--chat-gold);
    color: var(--chat-midnight);
}

.proactive-btn-primary {
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: var(--chat-midnight);
    border: none;
}

.proactive-btn-primary:hover {
    background: #ffffff;
    color: #07111f;
}

/* ================= 9. AI AGENT REASONING, ACTIONS & SETTINGS ================= */
.chat-ai-badge {
    background: linear-gradient(135deg, rgba(62, 207, 142, 0.2), rgba(245, 185, 66, 0.2));
    border: 1px solid rgba(62, 207, 142, 0.4);
    color: #3ecf8e;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 6px;
    letter-spacing: 0.05em;
    margin-left: 6px;
}

.agent-thought-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(245, 185, 66, 0.12);
    border: 1px solid rgba(245, 185, 66, 0.3);
    color: var(--chat-gold-light);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 8px;
    animation: thoughtPulse 1.8s ease-in-out infinite;
}

@keyframes thoughtPulse {
    0%, 100% { opacity: 0.8; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.02); }
}

/* AI Action Buttons underneath bot bubbles */
.chat-bubble-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    padding-left: 4px;
}

.chat-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--chat-border);
    background: rgba(255, 255, 255, 0.06);
    color: #cbd5e1;
    font-family: inherit;
}

.chat-action-btn:hover {
    transform: translateY(-1px);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

.chat-action-copy {
    border-color: rgba(245, 185, 66, 0.35);
    color: var(--chat-gold-light);
}

.chat-action-copy:hover,
.chat-action-copy.copied {
    background: rgba(245, 185, 66, 0.2);
    border-color: var(--chat-gold);
    color: #ffffff;
}

.chat-action-commission {
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: #07111f !important;
    border: none;
}

.chat-action-commission:hover {
    background: #ffffff;
    box-shadow: 0 4px 14px rgba(245, 185, 66, 0.4);
}

.chat-action-whatsapp {
    background: rgba(37, 211, 102, 0.15);
    border-color: rgba(37, 211, 102, 0.45);
    color: #25d366;
}

.chat-action-whatsapp:hover {
    background: #25d366;
    color: #07111f;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35);
}

/* Markdown typography in chat messages */
.chat-md-h2 {
    margin: 10px 0 6px 0;
    font-size: 13.5px;
    font-weight: 800;
    color: var(--chat-gold);
    letter-spacing: -0.01em;
}

.chat-md-h3 {
    margin: 8px 0 4px 0;
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
}

.chat-md-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(245, 185, 66, 0.35), transparent);
    margin: 10px 0;
}

/* In-Drawer AI Settings Overlay Modal */
.chat-ai-settings-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 18, 33, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: fadeIn 0.2s ease;
}

.chat-ai-settings-card {
    width: 100%;
    max-width: 340px;
    background: #0d1e34;
    border: 1px solid var(--chat-gold-border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.chat-ai-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #081322;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-ai-settings-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 800;
    color: #ffffff;
}

.chat-ai-settings-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ai-status-card {
    background: rgba(62, 207, 142, 0.08);
    border: 1px solid rgba(62, 207, 142, 0.25);
    border-radius: 10px;
    padding: 10px 12px;
}

.ai-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.ai-status-indicator strong {
    font-size: 12px;
    color: #3ecf8e;
}

.ai-status-card p {
    margin: 0;
    font-size: 10.5px;
    color: #94a3b8;
    line-height: 1.4;
}

.ai-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-input-group label {
    font-size: 11px;
    font-weight: 700;
    color: #e2e8f0;
}

.ai-input-group input,
.ai-input-group select {
    background: #07111f;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    outline: none;
    font-family: inherit;
}

.ai-input-group input:focus,
.ai-input-group select:focus {
    border-color: var(--chat-gold);
}

.ai-input-group small {
    font-size: 9.5px;
    color: #94a3b8;
}

.ai-settings-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.btn-ai-save {
    flex: 1;
    background: linear-gradient(135deg, var(--chat-gold), #e5a730);
    color: #07111f;
    border: none;
    border-radius: 8px;
    padding: 8px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-ai-save:hover {
    transform: translateY(-1px);
    background: #ffffff;
}

.btn-ai-clear {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #ef4444;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ai-clear:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ================= 10. MOBILE RESPONSIVE ADAPTATIONS ================= */
@media (max-width: 768px) {
    .panchami-chat-trigger {
        bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        right: 18px !important;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        max-width: 52px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 10px 28px rgba(245, 185, 66, 0.5), 0 0 16px rgba(245, 185, 66, 0.3) !important;
        border: 2px solid rgba(255, 255, 255, 0.5) !important;
        z-index: 99990 !important;
        transform: translateZ(0);
    }

    .panchami-chat-trigger .chat-trigger-text {
        display: none !important;
    }

    .panchami-chat-trigger .chat-pulse-beacon {
        position: absolute !important;
        top: 3px !important;
        right: 3px !important;
        margin: 0 !important;
    }

    .panchami-chat-trigger .chat-trigger-icon {
        font-size: 24px !important;
        margin: 0 !important;
        line-height: 1 !important;
    }

    .panchami-chat-trigger .chat-unread-badge {
        position: absolute !important;
        top: -4px !important;
        left: -4px !important;
        min-width: 18px !important;
        height: 18px !important;
        padding: 0 5px !important;
        font-size: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .chat-proactive-bubble {
        bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important;
        right: 14px !important;
        left: 14px !important;
        max-width: calc(100vw - 28px) !important;
    }

    .panchami-chat-drawer {
        bottom: 0 !important;
        right: 0 !important;
        left: 0 !important;
        top: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        border: none !important;
        z-index: 9999999 !important;
    }

    .chat-mobile-handle {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: rgba(255, 255, 255, 0.25);
        margin: 8px auto 4px auto;
    }

    .chat-drawer-header {
        padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px 16px !important;
    }

    .chat-input-row {
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 14px)) 14px !important;
    }
}
