{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/Inter-VariableFont_opsz,wght.ttf') format('truetype-variations');
}
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    background: transparent;
}

/* ========== ANIMATIONS ========== */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

@keyframes widgetEntrance {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes launcherHide {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.7); pointer-events: none; }
}

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

/* ========== LAUNCHER BUTTON ========== */
.launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: all 0.2s ease;
    overflow: visible;
    padding: 0;
    box-shadow: none;
    animation: float 4s ease-in-out infinite;
}

.launcher:not(.has-avatar) {
    background: var(--theme-color, #4F46E5);
}

.launcher.has-avatar {
    background: white;
}

.launcher:hover {
    transform: scale(1.05);
}

.launcher-img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.launcher.open .launcher-img {
    opacity: 0;
}

.launcher-close-icon {
    position: absolute;
    width: 20px;
    height: 20px;
    stroke: var(--theme-color, #4F46E5);
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
    transition: all 0.2s ease;
}

.launcher.open .launcher-close-icon {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* ========== HELP MESSAGE TOOLTIP ========== */
.help-message {
    position: absolute;
    right: 68px;
    top: 50%;
    background: white;
    color: #1a202c;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: none;
    border: 1px solid #eef2f6;
    pointer-events: none;
    z-index: 9997;
    transform: translateY(-50%);
    animation: fadeInRight 0.4s ease forwards;
}

.help-message::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 7px solid white;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
}

.launcher.open .help-message,
.help-message.hidden {
    display: none;
}

/* ========== WIDGET - COMPACT SIZE ========== */
.widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 360px;
    height: 500px;
    max-height: calc(100vh - 40px);
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100%);
    transform-origin: bottom right;
    box-shadow: none;
    border: 1px solid #eef2f6;
    overflow: hidden;
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.25s ease;
}

.force-show-widget {
    display: flex !important;
    visibility: visible !important;
    animation: widgetEntrance 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards;
    pointer-events: auto !important;
}

.force-hide-widget {
    display: none !important;
}

/* Hide launcher when chat is open */
.launcher.open {
    opacity: 0 !important;
    pointer-events: none !important;
    visibility: hidden !important;
    transform: scale(0.7) !important;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease !important;
    animation: none !important;
}

/* ── MOBILE: full chatbot visible, responsive, centered ── */
@media (max-width: 320px) {
    .widget {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        bottom: auto !important;
        right: auto !important;
        transform: translate(-50%, -50%) translateY(30px) !important;
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 150px) !important;
        max-height: calc(100vh - 150px) !important;
        border-radius: 20px !important;
        opacity: 0;
        visibility: hidden;
    }

    .force-show-widget {
        animation: widgetEntranceMobile 0.35s cubic-bezier(0.32, 0.72, 0, 1) forwards !important;
    }

    .force-hide-widget {
        display: none !important;
    }
}

@keyframes widgetEntranceMobile {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(30px);
        visibility: visible;
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
        visibility: visible;
    }
}

/* ========== HEADER ========== */
.header {
    padding: 12px 16px;
    background-color: var(--theme-color, #4F46E5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: none;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar svg {
    width: 28px;
    height: 28px;
}

.header-text h3 {
    font-size: 13px;
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.2px;
}

.header-text p {
    font-size: 10px;
    opacity: 0.85;
    margin: 2px 0 0 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    box-shadow: none;
}

.close-btn svg {
    width: 16px;
    height: 16px;
}

/* ========== LIVE BANNER ========== */
.live-banner {
    background: linear-gradient(90deg, #4F46E5, #7C3AED);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    display: none;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    box-shadow: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.live-banner.visible {
    display: flex;
}

.live-banner-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.live-banner-dot {
    width: 6px;
    height: 6px;
    background: #68d391;
    border-radius: 50%;
    animation: lbPulse 2s infinite;
}

@keyframes lbPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(104, 211, 145, 0.5); }
    50% { box-shadow: 0 0 0 4px rgba(104, 211, 145, 0); }
}

.btn-end-live {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}

/* ========== MESSAGES ========== */
.messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: var(--chat-bg, #F7FAFC);
    display: flex;
    flex-direction: column;
}

.messages::-webkit-scrollbar {
    width: 4px;
}

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

.messages::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

.msg-row {
    display: flex;
    margin-bottom: 12px;
    width: 100%;
    align-items: flex-end;
    animation: msgSlideIn 0.2s ease-out;
}

.msg-bot {
    justify-content: flex-start;
}

.msg-user {
    justify-content: flex-end;
}

.msg-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 8px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}

.msg-avatar svg {
    width: 100%;
    height: 100%;
}

.bubble-bot {
    background: var(--bot-bg, #ffffff);
    color: var(--bot-text, #1a202c);
    padding: 8px 12px;
    border-radius: 14px 14px 14px 4px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: none;
    max-width: 60%;
    border: 1px solid rgba(0, 0, 0, 0.04);
    word-wrap: break-word;
}

.bubble-user {
    background: var(--theme-color, #4F46E5);
    color: var(--user-text, #ffffff);
    padding: 8px 12px;
    border-radius: 14px 14px 4px 14px;
    font-size: 12px;
    line-height: 1.4;
    box-shadow: none;
    max-width: 85%;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.bubble-time {
    display: block;
    font-size: 9px;
    opacity: 0.65;
    margin-top: 3px;
    text-align: right;
}

/* ========== INPUT AREA ========== */
.input-area {
    padding: 10px 12px;
    background: white;
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

#input {
    flex: 1;
    padding: 8px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 24px;
    font-size: 12px;
    background: #f9fafb;
    outline: none;
    font-family: inherit;
}

#input:focus {
    border-color: var(--theme-color, #4F46E5);
    background: white;
}

#sendBtn {
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    background: var(--theme-color, #4F46E5);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: none;
}

#sendBtn svg {
    width: 16px;
    height: 16px;
}

#sendBtn:hover {
    transform: scale(1.05);
}

/* ========== TYPING INDICATOR & BUTTONS ========== */
.typing-dots {
    display: flex;
    align-items: center;
    height: 18px;
    gap: 3px;
    padding: 0 2px;
}

.typing-dots span {
    width: 5px;
    height: 5px;
    background-color: var(--bot-text, #1a202c);
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out both;
    opacity: 0.6;
}

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

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

.flow-btn-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
}

.flow-btn {
    background: var(--theme-color, #4F46E5);
    color: #fff;
    border: none;
    padding: 7px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: none;
    text-align: center;
}

.flow-btn:hover {
    filter: brightness(0.9);
}

.sys-divider {
    text-align: center;
    font-size: 11px;
    color: #a0aec0;
    padding: 4px 0;
    margin: 4px 0;
}