#sysdx-lc-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    font-family: Arial, Helvetica, sans-serif;
}

#sysdx-lc-launcher {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: var(--sysdx-lc-color, #1f714f);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    position: relative;
}

.sysdx-lc-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #dc3545;
    color: #fff;
    border-radius: 10px;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    font-weight: bold;
}

.sysdx-lc-panel {
    position: absolute;
    right: 0;
    bottom: 68px;
    width: 320px;
    max-height: 480px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sysdx-lc-header {
    background: var(--sysdx-lc-color, #1f714f);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sysdx-lc-title {
    font-weight: bold;
    font-size: 15px;
    display: block;
}

.sysdx-lc-agent-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    opacity: 0.9;
}

.sysdx-lc-agent-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}

.sysdx-lc-agent-dot-online {
    background: #2ecc71;
    box-shadow: 0 0 0 2px rgba(46, 204, 113, 0.3);
}

.sysdx-lc-agent-dot-offline {
    background: #bbb;
}

#sysdx-lc-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

.sysdx-lc-body {
    padding: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    box-sizing: border-box;
}

.sysdx-lc-footer {
    flex-shrink: 0;
    padding: 10px 14px;
    border-top: 1px solid #e4e6e9;
    background: #fff;
}

.sysdx-lc-footer .sysdx-lc-btn-secondary {
    margin-top: 0;
}

.sysdx-lc-welcome {
    margin: 0 0 12px;
    font-size: 13px;
    color: #333;
}

.sysdx-lc-departments,
.sysdx-lc-faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sysdx-lc-faq-thread:empty {
    display: none;
}

.sysdx-lc-faq-label {
    margin: 0 0 8px;
    font-size: 13px;
    color: #333;
}

.sysdx-lc-departments button,
.sysdx-lc-faq-list button {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid #dcdcdc;
    background: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.sysdx-lc-departments button:hover,
.sysdx-lc-faq-list button:hover {
    background: #eef1f5;
}

.sysdx-lc-faq-back {
    background: transparent !important;
    border-style: dashed !important;
    color: #666;
    font-style: italic;
}

#sysdx-lc-step-guest input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 13px;
}

.sysdx-lc-btn-primary,
.sysdx-lc-btn-secondary {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}

.sysdx-lc-btn-primary {
    background: var(--sysdx-lc-color, #1f714f);
    color: #fff;
}

.sysdx-lc-btn-secondary {
    background: #1f714f;
    color: #fff;
    width: 100%;
    margin-top: 8px;
}

.sysdx-lc-btn-secondary:hover {
    filter: brightness(0.92);
}

.sysdx-lc-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 10px;
}

.sysdx-lc-msg {
    max-width: 85%;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.sysdx-lc-msg-customer {
    align-self: flex-end;
    background: var(--sysdx-lc-color, #1f714f);
    color: #fff;
}

.sysdx-lc-msg-agent {
    align-self: flex-start;
    background: #1f714f;
    color: #fff;
}

.sysdx-lc-msg-bot {
    align-self: flex-start;
    background: #eef3fb;
    color: #1a3a5c;
    border: 1px solid #d3e2f5;
}

.sysdx-lc-system-notice {
    align-self: center;
    max-width: 90%;
    padding: 6px 12px;
    border-radius: 12px;
    background: #f1f1f1;
    color: #666;
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

#sysdx-lc-input:disabled,
.sysdx-lc-btn-send:disabled,
.sysdx-lc-icon-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sysdx-lc-msg-author {
    display: block;
    font-size: 10px;
    opacity: 0.7;
    margin-bottom: 2px;
}

.sysdx-lc-typing {
    font-size: 11px;
    color: #888;
    font-style: italic;
    padding: 0 2px 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.sysdx-lc-typing-dots {
    display: inline-flex;
    gap: 2px;
}

.sysdx-lc-typing-dots span {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #888;
    animation: sysdx-lc-typing-blink 1.2s infinite ease-in-out both;
}

.sysdx-lc-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.sysdx-lc-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes sysdx-lc-typing-blink {
    0%, 80%, 100% { opacity: 0.25; }
    40% { opacity: 1; }
}

.sysdx-lc-form {
    display: flex;
    gap: 6px;
    align-items: center;
    position: relative;
    max-width: 100%;
}

.sysdx-lc-icon-btn,
.sysdx-lc-attach-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border: none;
    border-radius: 50%;
    background: #f1f1f1;
    color: #65676b;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    margin: 0;
    transition: background .15s;
}

.sysdx-lc-icon-btn:hover,
.sysdx-lc-attach-btn:hover {
    background: #e5e5e5;
}

.sysdx-lc-btn-send {
    background: var(--sysdx-lc-color, #1f714f);
    color: #fff;
}

.sysdx-lc-btn-send:hover {
    filter: brightness(0.92);
    background: var(--sysdx-lc-color, #1f714f);
}

.sysdx-lc-emoji-picker {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: 240px;
    max-height: 160px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    padding: 8px;
    z-index: 5;
}

.sysdx-lc-emoji-item {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    border-radius: 4px;
}

.sysdx-lc-emoji-item:hover {
    background: #f1f1f1;
}

.sysdx-lc-msg img.sysdx-lc-attachment-image {
    max-width: 160px;
    max-height: 160px;
    border-radius: 6px;
    display: block;
    margin-top: 4px;
    cursor: pointer;
}

.sysdx-lc-msg a.sysdx-lc-attachment-file {
    display: inline-block;
    max-width: 100%;
    margin-top: 4px;
    color: inherit;
    text-decoration: underline;
    overflow-wrap: anywhere;
}

#sysdx-lc-input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
}

@media (max-width: 400px) {
    .sysdx-lc-panel {
        width: 92vw;
        right: -6px;
    }
}
