.cb-root { position: fixed; right: 22px; bottom: 22px; z-index: 900; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }

.cb-launcher { order: 2; width: 56px; height: 56px; border: 1px solid var(--accent-line); border-radius: 50%; background: linear-gradient(140deg, var(--accent) 0%, var(--accent-deep) 100%); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 14px 34px rgba(0,6,15,0.55), 0 0 0 6px rgba(60,132,216,0.10); transition: transform 0.22s ease, box-shadow 0.22s ease; }
.cb-launcher:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(0,6,15,0.6), 0 0 0 8px rgba(60,132,216,0.14); }
.cb-launcher:focus-visible { outline: 2px solid var(--accent-neon); outline-offset: 3px; }
.cb-launcher__icon { grid-area: 1 / 1; transition: opacity 0.18s ease, transform 0.18s ease; }
.cb-launcher__icon--close { opacity: 0; transform: rotate(-45deg) scale(0.7); }
.cb-root.is-open .cb-launcher__icon--open { opacity: 0; transform: rotate(45deg) scale(0.7); }
.cb-root.is-open .cb-launcher__icon--close { opacity: 1; transform: none; }

.cb-panel { order: 1; width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px)); display: flex; flex-direction: column; overflow: hidden; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: 0 26px 70px rgba(0,6,15,0.65); animation: cb-rise 0.24s ease both; }
.cb-panel[hidden] { display: none; }

@keyframes cb-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: none; }
}

.cb-panel__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 13px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%); }
.cb-panel__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 4px rgba(58,217,176,0.14); flex: none; }
.cb-panel__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cb-panel__title { font-family: 'Outfit', sans-serif; font-size: 15px; font-weight: 600; color: var(--text); letter-spacing: -0.01em; }
.cb-panel__sub { font-size: 11.5px; color: var(--text-3); }
.cb-panel__close { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--text-3); cursor: pointer; transition: color 0.18s ease, background 0.18s ease; }
.cb-panel__close:hover { color: var(--text); background: var(--elevated); }

.cb-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.cb-log::-webkit-scrollbar { width: 8px; }
.cb-log::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }

.cb-msg { max-width: 86%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; animation: cb-rise 0.2s ease both; }
.cb-msg--assistant { align-self: flex-start; background: var(--elevated); border: 1px solid var(--border); border-bottom-left-radius: 5px; color: var(--text); }
.cb-msg--user { align-self: flex-end; background: var(--accent-deep); border: 1px solid var(--accent-line); border-bottom-right-radius: 5px; color: #eaf3ff; }
.cb-msg--error { align-self: flex-start; background: transparent; border: 1px dashed var(--border-strong); color: var(--text-3); font-size: 12.5px; }

.cb-typing { display: flex; align-items: center; gap: 5px; align-self: flex-start; padding: 13px; border: 1px solid var(--border); border-radius: 14px; border-bottom-left-radius: 5px; background: var(--elevated); }
.cb-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bright); animation: cb-blink 1.2s infinite ease-in-out; }
.cb-typing span:nth-child(2) { animation-delay: 0.18s; }
.cb-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes cb-blink {
    0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

.cb-form { display: flex; align-items: flex-end; gap: 8px; padding: 11px; border-top: 1px solid var(--border); background: var(--surface-2); }
.cb-form__input { flex: 1; max-height: 116px; padding: 9px 11px; border: 1px solid var(--border-strong); border-radius: 11px; background: var(--bg); color: var(--text); font-family: inherit; font-size: 13.5px; line-height: 1.5; resize: none; }
.cb-form__input::placeholder { color: var(--text-3); }
.cb-form__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.cb-form__send { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--accent-line); border-radius: 11px; background: var(--accent); color: var(--on-accent); cursor: pointer; transition: background 0.18s ease, opacity 0.18s ease; }
.cb-form__send:hover:not(:disabled) { background: var(--accent-bright); }
.cb-form__send:disabled { opacity: 0.45; cursor: default; }

@media (max-width: 520px) {
    .cb-root { right: 14px; bottom: 14px; }
    .cb-panel { width: calc(100vw - 28px); height: min(70vh, calc(100vh - 110px)); }
}

@media (prefers-reduced-motion: reduce) {
    .cb-panel, .cb-msg { animation: none; }
    .cb-launcher, .cb-launcher__icon { transition: none; }
}
