#lc-widget-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b85c38, #9a4a2c);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(184,92,56,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: transform 0.3s, box-shadow 0.3s;
}
#lc-widget-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(184,92,56,0.5);
}
#lc-widget-btn svg {
    width: 28px;
    height: 28px;
    fill: #fff;
}
#lc-widget-btn .lc-close-icon { display: none; }
#lc-widget-btn.lc-open .lc-chat-icon { display: none; }
#lc-widget-btn.lc-open .lc-close-icon { display: block; }

#lc-widget-btn .lc-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

#lc-chat-window {
    position: fixed;
    bottom: 96px;
    right: 24px;
    width: 380px;
    max-height: 560px;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.08);
    animation: lcSlideUp 0.3s ease;
}
#lc-chat-window.lc-visible {
    display: flex;
}

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

.lc-header {
    background: linear-gradient(135deg, #b85c38, #9a4a2c);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    flex-shrink: 0;
}
.lc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.lc-header-info { flex: 1; }
.lc-header-name {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}
.lc-header-status {
    font-size: 0.72rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 4px;
}
.lc-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #27ae60;
    display: inline-block;
}
.lc-header-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.8;
    padding: 4px;
    transition: opacity 0.2s;
}
.lc-header-close:hover { opacity: 1; }

.lc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 280px;
    max-height: 360px;
    background: #0f0f23;
}

.lc-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.86rem;
    line-height: 1.5;
    word-wrap: break-word;
}
.lc-msg-ai {
    align-self: flex-start;
    background: #1e1e3a;
    color: #e0e0e0;
    border: 1px solid rgba(255,255,255,0.06);
    border-bottom-left-radius: 4px;
}
.lc-msg-visitor {
    align-self: flex-end;
    background: linear-gradient(135deg, #b85c38, #9a4a2c);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.lc-msg-agent {
    align-self: flex-start;
    background: rgba(39,174,96,0.15);
    color: #e0e0e0;
    border: 1px solid rgba(39,174,96,0.15);
    border-bottom-left-radius: 4px;
}
.lc-msg-time {
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 4px;
}

.lc-typing {
    align-self: flex-start;
    padding: 10px 16px;
    background: #1e1e3a;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    display: none;
    gap: 4px;
    align-items: center;
    border: 1px solid rgba(255,255,255,0.06);
}
.lc-typing.lc-show { display: flex; }
.lc-typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b85c38;
    animation: lcBounce 1.4s infinite ease-in-out both;
}
.lc-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.lc-typing-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes lcBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.lc-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    gap: 8px;
    align-items: flex-end;
    background: #1a1a2e;
    flex-shrink: 0;
}
.lc-input {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 0.86rem;
    background: #0f0f23;
    color: #e0e0e0;
    outline: none;
    resize: none;
    max-height: 80px;
    min-height: 42px;
    line-height: 1.4;
    font-family: inherit;
    transition: border-color 0.2s;
}
.lc-input::placeholder { color: rgba(255,255,255,0.3); }
.lc-input:focus { border-color: rgba(184,92,56,0.5); }
.lc-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #b85c38, #9a4a2c);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s, opacity 0.2s;
}
.lc-send-btn:hover { transform: scale(1.05); }
.lc-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.lc-send-btn svg {
    width: 18px;
    height: 18px;
    fill: #fff;
}

.lc-info-bar {
    padding: 10px 16px;
    background: rgba(184,92,56,0.08);
    border-top: 1px solid rgba(184,92,56,0.1);
    display: none;
    flex-shrink: 0;
}
.lc-info-bar.lc-show { display: block; }
.lc-info-bar p {
    font-size: 0.75rem;
    color: #b85c38;
    margin: 0 0 8px 0;
}
.lc-info-form {
    display: flex;
    gap: 6px;
}
.lc-info-input {
    flex: 1;
    border: 1px solid rgba(184,92,56,0.2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.78rem;
    background: transparent;
    color: #e0e0e0;
    outline: none;
}
.lc-info-input::placeholder { color: rgba(255,255,255,0.3); }
.lc-info-submit {
    border: none;
    background: #b85c38;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    white-space: nowrap;
}

.lc-powered {
    text-align: center;
    padding: 6px;
    font-size: 0.62rem;
    opacity: 0.3;
    background: #1a1a2e;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    #lc-chat-window {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
    }
    #lc-widget-btn.lc-open { display: none; }
    .lc-messages { max-height: none; flex: 1; }
}
