.ai-coal-widget {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9998;
    font-family: Arial, sans-serif;
}

.ai-coal-toggle {
    width: 64px;
    height: 64px;
    border: 0;
    border-radius: 50%;
    background: #ffc400;
    color: #101820;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ai-coal-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.42);
}

.ai-coal-toggle i {
    font-size: 26px;
}

.ai-coal-panel {
    position: absolute;
    right: 0;
    bottom: 78px;
    width: 380px;
    max-width: calc(100vw - 28px);
    height: 540px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    color: #1f2933;
    border: 1px solid rgba(16, 24, 32, 0.12);
    border-radius: 10px;
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.ai-coal-widget.is-open .ai-coal-panel {
    display: flex;
}

.ai-coal-header {
    background: #101820;
    color: #ffffff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ai-coal-title {
    font-weight: 800;
    font-size: 18px;
    line-height: 1.1;
}

.ai-coal-subtitle {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 3px;
}

.ai-coal-close {
    width: 34px;
    height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    background: transparent;
    color: #ffffff;
    cursor: pointer;
}

.ai-coal-status {
    padding: 8px 14px;
    background: #fff7d6;
    color: #5b4300;
    font-size: 12px;
    border-bottom: 1px solid #f1df96;
}

.ai-coal-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #f5f7fa;
}

.ai-coal-message {
    margin-bottom: 10px;
    display: flex;
}

.ai-coal-message.user {
    justify-content: flex-end;
}

.ai-coal-bubble {
    max-width: 86%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-coal-message.bot .ai-coal-bubble {
    background: #ffffff;
    border: 1px solid #e1e6ec;
    color: #1f2933;
}

.ai-coal-message.user .ai-coal-bubble {
    background: #ffc400;
    color: #101820;
}

.ai-coal-quick {
    padding: 10px 12px 2px;
    background: #f5f7fa;
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.ai-coal-quick button {
    border: 1px solid #d3dae3;
    background: #ffffff;
    color: #25313f;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
    cursor: pointer;
}

.ai-coal-form {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e1e6ec;
    background: #ffffff;
}

.ai-coal-input {
    min-width: 0;
    flex: 1;
    height: 42px;
    border: 1px solid #cbd4df;
    border-radius: 8px;
    padding: 0 12px;
    font-size: 14px;
    outline: none;
}

.ai-coal-input:focus {
    border-color: #ffc400;
    box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.22);
}

.ai-coal-send {
    width: 46px;
    height: 42px;
    border: 0;
    border-radius: 8px;
    background: #ffc400;
    color: #101820;
    cursor: pointer;
}

.ai-coal-send:disabled,
.ai-coal-input:disabled {
    opacity: 0.65;
    cursor: wait;
}

body.bvi-active .ai-coal-panel,
body.bvi-active .ai-coal-toggle {
    filter: none !important;
}

@media (max-width: 576px) {
    .ai-coal-widget {
        right: 14px;
        bottom: 14px;
    }

    .ai-coal-toggle {
        width: 58px;
        height: 58px;
    }

    .ai-coal-panel {
        position: fixed;
        right: 10px;
        left: 10px;
        bottom: 82px;
        width: auto;
        height: min(560px, calc(100vh - 110px));
        max-width: none;
    }
}
