.ckb-widget { position: fixed; right: 15px; bottom: 25px; z-index: 950; font-family: inherit; --ckb-main: #0067dc; --ckb-main-light: #2f85e8; --ckb-main-dark: #00509e; }

.ckb-icon {
    position: relative;
    width: 58px; height: 58px; border-radius: 50%;
    background-color: var(--ckb-main); color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: background-color .25s;
    animation: fc-pulse 2.4s infinite, fc-fab-shake 6s ease-in-out infinite;
}
.ckb-icon:hover { background-color: var(--ckb-main-light); }

.ckb-icon-dot {
    position: absolute; top: 50%; right: -5px;
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--ckb-main-light); border: 2px solid #fff;
    animation: fc-dot-pulse 2s infinite;
}

.ckb-widget.ckb-open .ckb-icon { animation: none; }

@keyframes fc-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0,103,220,.7), 0 0 0 0 rgba(47,157,105,.4); }
    50% { box-shadow: 0 0 0 12px rgba(0,103,220,.2), 0 0 0 0 rgba(47,157,105,.4); }
    100% { box-shadow: 0 0 0 22px rgba(0,103,220,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); }
}

.ckb-bubble {
    position: absolute; right: 60px; bottom: 0px; width: 200px;
    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: 480px; 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(--ckb-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; }

.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(--ckb-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(--ckb-main-light); }

.ckb-contact-row {
    display: flex; gap: 8px; margin-bottom: 8px;
}
.ckb-btn-contact {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
    border: 1.5px solid; border-radius: 8px; padding: 9px 8px;
    font-size: 13px; font-weight: 600; text-decoration: none;
    background: #fff; cursor: pointer; transition: background-color .2s;
}
.ckb-btn-zalo { color: #fff; background: #16b2e9; }
.ckb-btn-zalo:hover { background: #e8f2ff; color: #0068ff; }
.ckb-btn-call { color: #fff; background: #e0332e; }
.ckb-btn-call:hover { background: #fdecea; color: #e0332e; }

.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(--ckb-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(--ckb-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(--ckb-main); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.ckb-btn-send:hover { background-color: var(--ckb-main-light); }

@media (max-width: 480px) {
    .ckb-panel { width: calc(100vw - 20px); right: -6px; }
    .ckb-widget { right: 10px; }
}
