/* ── Chatbot Widget ── */
#cb-root *,
#cb-root *::before,
#cb-root *::after { box-sizing: border-box; }

.cb-float {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 998;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(4, 102, 180, .4);
    transition: transform .2s ease, box-shadow .2s ease;
}
.cb-float:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(4, 102, 180, .5);
}
.cb-float:focus-visible {
    outline: 3px solid var(--ink);
    outline-offset: 3px;
}
.cb-float svg {
    display: block;
}

.cb-panel {
    position: fixed;
    bottom: 100px;
    left: 24px;
    z-index: 999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 540px;
    max-height: calc(100vh - 140px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, .18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.cb-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.cb-head {
    background: var(--ink);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.cb-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--green);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    font-size: 15px;
}
.cb-head-info { flex: 1; min-width: 0; }
.cb-head-info strong {
    display: block;
    font: 700 15px/1.3 Manrope, sans-serif;
}
.cb-head-info span {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, .75);
}
.cb-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
}
.cb-close:hover { background: rgba(255, 255, 255, .15); }

.cb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: var(--cream);
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.cb-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.cb-msg--bot {
    align-self: flex-start;
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
    color: var(--ink);
}
.cb-msg--user {
    align-self: flex-end;
    background: var(--green);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.cb-source {
    align-self: flex-start;
    font-size: 12px;
    margin: -4px 0 2px;
}
.cb-source a {
    color: var(--green);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.cb-source a:hover { text-decoration: underline; }

.cb-links {
    align-self: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: -2px 0 2px;
}
.cb-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--line);
    background: var(--mint);
    color: var(--green);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    text-decoration: none;
    transition: background .15s ease;
}
.cb-link:hover { background: #d6e9f8; }
.cb-link[href^="https"]::after {
    content: '↗';
    font-size: 11px;
}

.cb-typing {
    align-self: flex-start;
    display: inline-flex;
    gap: 4px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}
.cb-typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9bb3c6;
    animation: cb-blink 1.2s infinite;
}
.cb-typing i:nth-child(2) { animation-delay: .2s; }
.cb-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes cb-blink {
    0%, 80%, 100% { opacity: .3; }
    40% { opacity: 1; }
}

.cb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 8px;
    background: #fff;
}
.cb-chip {
    border: 1px solid var(--line);
    background: var(--mint);
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .15s ease;
}
.cb-chip:hover { background: #d6e9f8; }

.cb-inputrow {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
    background: #fff;
    border-top: 1px solid var(--line);
}
.cb-input {
    flex: 1;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 16px;
    font: 400 14px/1.4 Manrope, sans-serif;
    color: var(--ink);
    outline: none;
}
.cb-input:focus { border-color: var(--green); }
.cb-send {
    border: none;
    background: var(--green);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background .15s ease;
}
.cb-send:hover { background: #035494; }
.cb-send:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
    .cb-panel {
        left: 12px;
        right: 12px;
        width: auto;
        bottom: 88px;
    }
    .cb-float { bottom: 16px; left: 16px; }
}
