.ckb-widget { position: fixed; right: 15px; bottom: 20px; z-index: 950; font-family: inherit; }

.ckb-icon {
    position: relative;
    width: 58px; height: 58px; border-radius: 50%;
    background-color: var(--main); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 26px; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: background-color .25s;
    animation: fc-fab-shake 4s ease-in-out infinite;
}
.ckb-icon:hover { background-color: var(--main-light); }
.ckb-icon::before {
    content: ""; position: absolute; inset: 0; border-radius: 50%;
    animation: fc-pulse 2.5s ease-out infinite;
    pointer-events: none;
}

.ckb-icon-img { width: 42px; height: 42px; filter: brightness(0) invert(1); }

.ckb-icon-dot {
    position: absolute; bottom: 2px; right: 2px;
    width: 10px; height: 10px; border-radius: 50%;
    background: #4caf50;display:none;
    animation: fc-dot-pulse 1.8s infinite;
}

.ckb-bubble {
    position: absolute;
    right: 68px;
    bottom: 8px;
    width: 220px;
    background: #fff;
    color: #222;
    padding: 10px 26px 10px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    font-size: 14px;
    line-height: 1.4;
}
.ckb-bubble-close {
    position: absolute; top: 2px; right: 8px; cursor: pointer;
    color: #999; font-size: 16px;
}

.ckb-panel {
    position: absolute; right: 0; bottom: 72px;
    width: 340px; max-width: calc(100vw - 30px);
    height: 500px; max-height: 70vh;
    background: #fff; border-radius: 14px; overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,.28);
    display: flex; flex-direction: column;
}

.ckb-header {
    background-color: var(--main); color: #fff;
    padding: 14px 16px; font-weight: 600; font-size: 16px;
    display: flex; justify-content: space-between; align-items: center;
}
.ckb-close { cursor: pointer; font-size: 20px; line-height: 1; }

.ckb-body { flex: 1; overflow-y: auto; padding: 16px 16px 0; }

.ckb-form-info { display: flex; flex-direction: column; justify-content: center; }

.ckb-loichao { font-size: 14px; color: #555; margin-bottom: 14px; }

.ckb-input {
    width: 100%; border: 1px solid #ddd; border-radius: 8px;
    padding: 9px 12px; font-size: 14px; margin-bottom: 10px; box-sizing: border-box;
}
.ckb-textarea { resize: vertical; min-height: 70px; }

.ckb-btn-submit {
    width: 100%; background-color: var(--main); color: #fff; border: 0;
    border-radius: 8px; padding: 10px; font-size: 14px; font-weight: 600;
    cursor: pointer; margin-bottom: 8px;
}
.ckb-btn-submit:hover { background-color: var(--main-light); }

.ckb-btn-google {
    width: 100%; background: #fff; color: #444; border: 1px solid #ddd;
    border-radius: 8px; padding: 9px; font-size: 13px; cursor: pointer;
}
.ckb-btn-google:hover { background: #f5f5f5; }

.ckb-error { color: #e0332e; font-size: 13px; margin-top: 8px; }

.ckb-chat { display: flex; flex-direction: column; padding: 0; }

.ckb-lienhe-banner {
    background: #fff8e1; color: #7a5c00; font-size: 13px;
    padding: 10px 14px; border-bottom: 1px solid #f0e0a0;
}
.ckb-lienhe-banner a { color: var(--main-dark); font-weight: 600; }

.ckb-messages { flex: 1; overflow-y: auto; padding: 14px; }

.ckb-msg {
    max-width: 85%; padding: 9px 12px; border-radius: 12px;
    font-size: 14px; line-height: 1.45; margin-bottom: 10px; word-wrap: break-word;
}
.ckb-msg a { color: inherit; text-decoration: underline; font-weight: 600; }
.ckb-msg-khach {
    background-color: var(--main); color: #fff;
    margin-left: auto; border-bottom-right-radius: 2px;
}
.ckb-msg-ai {
    background: #f0f1f3; color: #222;
    margin-right: auto; border-bottom-left-radius: 2px;
}
.ckb-msg-admin {
    background: #e8f7ea; color: #1e5b2a;
    margin-right: auto; border-bottom-left-radius: 2px;
}
.ckb-msg-loi {
    background: #fdecea; color: #b3261e;
    margin-right: auto; border-bottom-left-radius: 2px;
}

.ckb-loading { padding: 0 14px 8px; font-size: 13px; color: #888; }

.ckb-dots { display: inline-block; margin-left: 3px; }
.ckb-dots span {
    display: inline-block; width: 4px; height: 4px; margin-left: 2px;
    border-radius: 50%; background: #888;
    animation: ckb-dot-bounce 1.2s infinite ease-in-out both;
}
.ckb-dots span:nth-child(2) { animation-delay: .2s; }
.ckb-dots span:nth-child(3) { animation-delay: .4s; }

@keyframes ckb-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .4; }
    30% { transform: translateY(-3px); opacity: 1; }
}

.ckb-inputrow {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-top: 1px solid #eee;
}
.ckb-inputrow .ckb-input { margin-bottom: 0; }
.ckb-btn-send {
    width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
    background-color: var(--main); color: #fff; cursor: pointer;
}
.ckb-btn-send:hover { background-color: var(--main-light); }

.ckb-contact-row { display: flex; justify-content: space-between; gap: 4px; margin: 4px 0 10px; }

.ckb-contact-item { display: flex; flex-direction: column; align-items: center; gap: 5px; flex: 1; text-decoration: none; }
.ckb-contact-item:hover { text-decoration: none; }

.ckb-contact-icon {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    background-color: #7c8fa6;
    display: flex; align-items: center; justify-content: center;
    transition: background-color .2s;
}
.zalo-contact .ckb-contact-icon{background:#0180c7}
.whats-contact .ckb-contact-icon{background:#3cba29}
.call-contact .ckb-contact-icon{background:#f50000}
.kakao-contact .ckb-contact-icon{background:#ffe812}
.mess-contact .ckb-contact-icon{background:#1c45dc}
.ckb-contact-icon svg { width: 16px; height: 16px; }
.ckb-contact-icon svg path { fill: #fff; }

.kakao-contact .ckb-contact-icon svg path{fill:#222;}
.ckb-contact-label { font-size: 10px; color: #333; text-align: center; line-height: 1.2; }
.zalo-contact.ckb-contact-item:hover .ckb-contact-label{color:#0180c7}
.whats-contact.ckb-contact-item:hover .ckb-contact-label{color:#3cba29}
.call-contact.ckb-contact-item:hover .ckb-contact-label{color:#f50000}
.kakao-contact.ckb-contact-item:hover .ckb-contact-label{color:#ffe812}
.mess-contact.ckb-contact-item:hover .ckb-contact-label{color:#1c45dc}
@keyframes ckb-shake {
    0%, 100% { transform: rotate(0); }
    15% { transform: rotate(-14deg); }
    30% { transform: rotate(12deg); }
    45% { transform: rotate(-10deg); }
    60% { transform: rotate(8deg); }
    75% { transform: rotate(-4deg); }
    90% { transform: rotate(2deg); }
}
.ckb-contact-item:hover .ckb-contact-icon { animation: ckb-shake .5s ease-in-out; }

@keyframes fc-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(47,157,105,.7),0 0 0 0 rgba(47,157,105,.4)
    }

    50% {
        box-shadow: 0 0 0 12px rgba(47,157,105,.2),0 0 0 0 rgba(47,157,105,.4)
    }

    100% {
        box-shadow: 0 0 0 22px rgba(47,157,105,0),0 0 0 12px rgba(47,157,105,0)
    }
}

@keyframes fc-dot-pulse {
    0%,100% {
        box-shadow: 0 0 0 0 rgba(76,175,80,.55)
    }

    50% {
        box-shadow: 0 0 0 5px rgba(76,175,80,0)
    }
}

@keyframes fc-fab-shake {
    0%,50%,100% {
        transform: rotate(0) skew(1deg)
    }

    10%,30% {
        transform: rotate(-22deg) skew(1deg)
    }

    20%,40% {
        transform: rotate(22deg) skew(1deg)
    }
}

@media (max-width: 480px) {
    .ckb-panel { width: calc(100vw - 20px); right: -6px; }
    .ckb-widget { right: 10px; }
    .ckb-contact-icon { width: 38px; height: 38px; }
    .ckb-contact-icon svg { width: 17px; height: 17px; }
    .ckb-contact-label { font-size: 10px; }
}
