#crm-tuvan-root {
    --crm-chat-primary: #c41e3a;
    --crm-chat-bg: #fff;
    --crm-chat-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    z-index: 99999;
}

#crm-tuvan-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 58px;
    height: 58px;
    border: none;
    border-radius: 50%;
    background: var(--crm-chat-primary);
    color: #fff;
    box-shadow: var(--crm-chat-shadow);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

#crm-tuvan-panel {
    position: fixed;
    right: 18px;
    bottom: 86px;
    width: 340px;
    max-width: calc(100vw - 24px);
    height: 480px;
    max-height: calc(100vh - 110px);
    background: var(--crm-chat-bg);
    border-radius: 14px;
    box-shadow: var(--crm-chat-shadow);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

#crm-tuvan-panel.open {
    display: flex;
}

#crm-tuvan-header {
    background: var(--crm-chat-primary);
    color: #fff;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#crm-tuvan-header h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}

#crm-tuvan-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}

#crm-tuvan-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f7f7f8;
}

.crm-tuvan-msg {
    margin-bottom: 10px;
    max-width: 88%;
    clear: both;
}

.crm-tuvan-msg.user {
    margin-left: auto;
    text-align: right;
}

.crm-tuvan-msg .bubble {
    display: inline-block;
    padding: 8px 11px;
    border-radius: 12px;
    line-height: 1.45;
    word-break: break-word;
}

.crm-tuvan-msg.bot .bubble,
.crm-tuvan-msg.staff .bubble {
    background: #fff;
    border: 1px solid #e5e5e5;
}

.crm-tuvan-msg.user .bubble {
    background: var(--crm-chat-primary);
    color: #fff;
}

.crm-tuvan-msg .time {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

#crm-tuvan-form {
    border-top: 1px solid #eee;
    padding: 10px;
    background: #fff;
}

#crm-tuvan-form textarea {
    width: 100%;
    resize: none;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 8px;
    font: inherit;
    box-sizing: border-box;
}

#crm-tuvan-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 6px;
}

#crm-tuvan-meta input {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 8px;
    font: inherit;
}

#crm-tuvan-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

#crm-tuvan-send {
    background: var(--crm-chat-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    cursor: pointer;
    font-weight: 600;
}

#crm-tuvan-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

#crm-tuvan-hotline {
    font-size: 12px;
    color: #666;
}

#crm-tuvan-hotline a {
    color: var(--crm-chat-primary);
    text-decoration: none;
}

#crm-tuvan-loading {
    font-size: 12px;
    color: #888;
    padding: 4px 0;
    display: none;
}
