.mrcd-chat-root {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999998;
    font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

.mrcd-chat-bubble {
    border: none;
    border-radius: 999px;
    background: #0c8f56;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    padding: 14px 18px;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

.mrcd-chat-bubble:hover {
    background: #0a7748;
}

.mrcd-chat-bubble.is-hidden {
    display: none;
}

.mrcd-chat-panel {
    width: 370px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 28px);
    background: #ffffff;
    border: 1px solid #d8e1e5;
    border-radius: 14px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.24);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.mrcd-chat-panel.is-open {
    display: flex;
}

.mrcd-chat-header {
    background: linear-gradient(135deg, #0c8f56, #137f89);
    color: #ffffff;
    padding: 12px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mrcd-chat-title {
    font-size: 14px;
    font-weight: 700;
}

.mrcd-chat-close {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
}

.mrcd-chat-messages {
    flex: 1;
    padding: 12px;
    overflow-y: auto;
    background: #f4f7f8;
}

.mrcd-chat-message {
    margin-bottom: 10px;
}

.mrcd-chat-badge {
    font-size: 11px;
    font-weight: 700;
    color: #51636d;
    margin-bottom: 4px;
}

.mrcd-chat-message.user .mrcd-chat-badge {
    color: #0d6c43;
}

.mrcd-chat-content {
    display: inline-block;
    max-width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.mrcd-chat-message.user .mrcd-chat-content {
    background: #d7f3e6;
    color: #083d28;
}

.mrcd-chat-message.assistant .mrcd-chat-content {
    background: #ffffff;
    color: #243036;
    border: 1px solid #d7e0e4;
}

.mrcd-chat-status {
    min-height: 18px;
    font-size: 12px;
    color: #7a8a93;
    padding: 0 12px 6px 12px;
}

.mrcd-chat-footer {
    border-top: 1px solid #e1e8eb;
    padding: 10px;
    background: #ffffff;
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 8px;
    align-items: center;
}

.mrcd-chat-input {
    width: 100%;
    min-height: 60px;
    resize: vertical;
    border: 1px solid #c6d3d9;
    border-radius: 8px;
    padding: 8px;
    font-size: 13px;
    outline: none;
}

.mrcd-chat-input:focus {
    border-color: #149164;
    box-shadow: 0 0 0 2px rgba(20, 145, 100, 0.15);
}

.mrcd-chat-send {
    border: none;
    background: #0c8f56;
    color: #ffffff;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    padding: 10px 14px;
    cursor: pointer;
}

.mrcd-chat-send:disabled {
    opacity: 0.6;
    cursor: default;
}

@media screen and (max-width: 640px) {
    .mrcd-chat-root {
        right: 10px;
        left: 10px;
        bottom: 10px;
    }

    .mrcd-chat-panel {
        width: 100%;
        height: calc(100vh - 20px);
        max-height: calc(100vh - 20px);
    }

    .mrcd-chat-bubble {
        width: 100%;
    }
}
