.kbc-root {
  --kbc-accent: #1f6feb;
  --kbc-bg: #ffffff;
  --kbc-fg: #1b1f24;
  --kbc-muted: #6b7280;
  --kbc-bot: #f2f4f7;
  --kbc-border: #e5e7eb;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--kbc-fg);
}
.kbc-root *, .kbc-root *::before, .kbc-root *::after { box-sizing: border-box; }
.kbc-launch {
  width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--kbc-accent); color: #fff; display: grid; place-items: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); transition: transform .15s;
}
.kbc-launch:hover { transform: scale(1.06); }
.kbc-open .kbc-launch { display: none; }
.kbc-panel {
  display: none; flex-direction: column;
  width: 380px; height: min(600px, calc(100vh - 40px));
  background: var(--kbc-bg); border: 1px solid var(--kbc-border); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25); overflow: hidden;
}
.kbc-open .kbc-panel { display: flex; }
.kbc-head { display: flex; align-items: center; gap: 4px; padding: 12px 12px 12px 16px; background: var(--kbc-accent); color: #fff; }
.kbc-title { flex: 1; font-weight: 600; font-size: 16px; }
.kbc-icon { background: transparent; border: 0; color: #fff; font-size: 17px; width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.kbc-icon:hover { background: rgba(255,255,255,.18); }
.kbc-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.kbc-msg { max-width: 86%; padding: 9px 13px; border-radius: 14px; overflow-wrap: anywhere; }
.kbc-msg p { margin: 0 0 .5em; } .kbc-msg p:last-child { margin-bottom: 0; }
.kbc-msg ul, .kbc-msg ol { margin: .2em 0 .5em; padding-left: 1.3em; }
.kbc-msg a { color: inherit; text-decoration: underline; }
.kbc-msg code { font-size: .9em; background: rgba(0,0,0,.08); padding: 0 4px; border-radius: 4px; }
.kbc-user { align-self: flex-end; background: var(--kbc-accent); color: #fff; border-bottom-right-radius: 4px; }
.kbc-bot { align-self: flex-start; background: var(--kbc-bot); border-bottom-left-radius: 4px; }
.kbc-error { background: #fdecec; color: #8a1c1c; }
.kbc-notice { align-self: center; font-size: 12px; color: var(--kbc-muted); text-align: center; }
.kbc-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--kbc-border); }
.kbc-input {
  flex: 1; resize: none; border: 1px solid var(--kbc-border); border-radius: 12px; padding: 9px 12px;
  font: inherit; color: var(--kbc-fg); background: var(--kbc-bg); max-height: 120px; outline: none;
}
.kbc-input:focus { border-color: var(--kbc-accent); }
.kbc-send { width: 42px; border: 0; border-radius: 12px; background: var(--kbc-accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.kbc-send:disabled { opacity: .5; cursor: default; }
.kbc-foot { font-size: 11px; color: var(--kbc-muted); text-align: center; padding: 0 10px 8px; }
.kbc-dots { display: inline-flex; gap: 4px; padding: 4px 0; }
.kbc-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--kbc-muted); animation: kbc-b 1.2s infinite ease-in-out; }
.kbc-dots i:nth-child(2) { animation-delay: .15s; } .kbc-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes kbc-b { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (max-width: 480px) {
  .kbc-root { right: 12px; bottom: 12px; }
  .kbc-open { left: 0; right: 0; top: 0; bottom: 0; }
  .kbc-open .kbc-panel { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
}
