.cb-trigger {
    position: fixed;
    bottom: 50%;
    right: 25px;
    transform: translateY(50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c8962e 0%, #a67a1e 100%);
    border: 3px solid rgba(255,255,255,0.3);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(200,150,46,0.5), 0 0 15px rgba(200,150,46,0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    animation: cb-glow 3s ease-in-out infinite;
}
@keyframes cb-glow {
    0%, 100% { box-shadow: 0 4px 20px rgba(200,150,46,0.5), 0 0 15px rgba(200,150,46,0.3); }
    50% { box-shadow: 0 4px 30px rgba(200,150,46,0.7), 0 0 30px rgba(200,150,46,0.5); }
}
.cb-trigger:hover {
    transform: translateY(50%) scale(1.12);
    box-shadow: 0 6px 35px rgba(200,150,46,0.7), 0 0 35px rgba(200,150,46,0.5);
    animation: none;
}
.cb-trigger-icon {
    font-size: 26px;
    color: #fff;
    transition: transform 0.3s ease;
}
.cb-trigger.cb-open .cb-trigger-icon {
    transform: rotate(90deg);
}
.cb-trigger.cb-open {
    transform: translateY(50%);
    background: linear-gradient(135deg, #1a2744 0%, #2a3d5e 100%);
    animation: none;
    box-shadow: 0 4px 20px rgba(26,39,68,0.4);
    border-color: rgba(200,150,46,0.4);
}
.cb-trigger.cb-open .cb-trigger-icon {
    color: #c8962e;
}
.cb-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #e74c3c;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    animation: cb-pulse 2s infinite;
}
@keyframes cb-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}
.cb-badge.cb-hidden { display: none; }

.cb-window {
    position: fixed;
    top: 50%;
    right: 100px;
    transform: translateY(-50%);
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-50%) translateX(20px) scale(0.95);
    pointer-events: none;
    transition: all 0.3s ease;
}
.cb-window.cb-visible {
    opacity: 1;
    transform: translateY(-50%) translateX(0) scale(1);
    pointer-events: auto;
}

.cb-header {
    background: linear-gradient(135deg, #1a2744 0%, #2a3d5e 100%);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.cb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(200,150,46,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8962e;
    font-size: 18px;
    flex-shrink: 0;
}
.cb-header-info h4 {
    margin: 0;
    color: #fff;
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    font-weight: 600;
}
.cb-header-info span {
    font-size: 12px;
    color: rgba(255,255,255,0.6);
}
.cb-close {
    margin-left: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.6);
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}
.cb-close:hover { color: #fff; }

.cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 280px;
    max-height: 340px;
    background: #f8f8fa;
}
.cb-messages::-webkit-scrollbar { width: 4px; }
.cb-messages::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.cb-msg {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    animation: cb-fadeIn 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
@keyframes cb-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.cb-msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border: 1px solid #e8e8e8;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.cb-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #1a2744, #2a3d5e);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.cb-msg-bot a {
    color: #c8962e;
    text-decoration: underline;
}

.cb-typing {
    align-self: flex-start;
    padding: 12px 20px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    display: flex;
    gap: 5px;
    animation: cb-fadeIn 0.3s ease;
}
.cb-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    animation: cb-bounce 1.4s infinite ease-in-out;
}
.cb-dot:nth-child(2) { animation-delay: 0.2s; }
.cb-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes cb-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

.cb-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
    animation: cb-fadeIn 0.4s ease;
}
.cb-opt-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1.5px solid #c8962e;
    background: transparent;
    color: #1a2744;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}
.cb-opt-btn:hover {
    background: #c8962e;
    color: #fff;
    border-color: #c8962e;
}

.cb-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 4px 0;
    animation: cb-fadeIn 0.3s ease;
}
.cb-form input {
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.cb-form input:focus {
    border-color: #c8962e;
}
.cb-form button {
    padding: 10px 14px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #c8962e, #a67a1e);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}
.cb-form button:hover { opacity: 0.9; }
.cb-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cb-input-area {
    padding: 10px 14px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.cb-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.cb-input-row input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 22px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #f8f8fa;
}
.cb-input-row input:focus {
    border-color: #c8962e;
    background: #fff;
}
.cb-input-row button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #c8962e, #a67a1e);
    color: #fff;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
    flex-shrink: 0;
}
.cb-input-row button:hover {
    opacity: 0.9;
}
.cb-input-row button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.cb-footer-text {
    font-size: 11px;
    color: #aaa;
    text-align: center;
    display: block;
}
.cb-footer-text a {
    color: #c8962e;
    text-decoration: none;
}

@media (max-width: 480px) {
    .cb-trigger {
        bottom: 24px;
        right: 16px;
        transform: none;
        width: 58px;
        height: 58px;
    }
    .cb-trigger:hover {
        transform: scale(1.08);
    }
    .cb-trigger.cb-open {
        transform: none;
    }
    .cb-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
        transform: none;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        overflow: hidden;
    }
    .cb-window.cb-visible {
        transform: none;
    }
    .cb-header {
        padding: 14px 16px;
    }
    .cb-messages {
        flex: 1;
        max-height: none;
        min-height: 0;
        overflow-y: auto;
        padding: 12px;
    }
    .cb-msg {
        max-width: 90%;
        font-size: 14px;
    }
    .cb-opt-btn {
        font-size: 12px;
        padding: 7px 12px;
    }
    .cb-input-area {
        flex-shrink: 0;
        padding: 8px 10px;
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    .cb-input-row input {
        padding: 9px 12px;
        font-size: 14px;
    }
    .cb-input-row button {
        width: 38px;
        height: 38px;
    }
}
