.wcccqb-floating-root,
.wcccqb-inline-root {
  --wcccqb-accent: #111827;
  --wcccqb-radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #111827;
}

.wcccqb-floating-root *,
.wcccqb-inline-root * { box-sizing: border-box; }

.wcccqb-floating-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  width: 62px;
  height: 62px;
  border-radius: 999px;
  border: 0;
  background: var(--wcccqb-accent);
  color: #fff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2147483000;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.wcccqb-floating-button:hover { transform: translateY(-2px); box-shadow: 0 22px 55px rgba(15, 23, 42, 0.33); }
.wcccqb-floating-button svg { width: 28px; height: 28px; }
.wcccqb-floating-root.wcccqb-open .wcccqb-floating-button { opacity: 0; pointer-events: none; transform: scale(.92); }

.wcccqb-panel {
  width: min(410px, calc(100vw - 28px));
  max-width: 100%;
  background: #fff;
  border-radius: var(--wcccqb-radius);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.28);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  display: flex;
  flex-direction: column;
}

.wcccqb-floating-panel {
  position: fixed;
  right: 22px;
  bottom: 96px;
  z-index: 2147483001;
  transform-origin: bottom right;
}

.wcccqb-inline-root .wcccqb-panel {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.12);
  border-radius: 18px;
}

.wcccqb-hidden { display: none !important; }

.wcccqb-header {
  background: linear-gradient(135deg, var(--wcccqb-accent), #374151);
  color: #fff;
  padding: 16px 17px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.wcccqb-avatar {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: rgba(255,255,255,.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.wcccqb-avatar svg { width: 23px; height: 23px; }
.wcccqb-head-copy { min-width: 0; }
.wcccqb-header-title { font-weight: 800; font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wcccqb-header-subtitle { font-size: 12px; opacity: .86; margin-top: 2px; }
.wcccqb-close {
  margin-left: auto;
  background: rgba(255,255,255,.14);
  color: #fff;
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  flex: 0 0 auto;
}
.wcccqb-inline-root .wcccqb-close { display: none; }

.wcccqb-messages {
  height: 380px;
  overflow-y: auto;
  background: #f8fafc;
  padding: 16px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.wcccqb-inline-root .wcccqb-messages { height: 410px; }

.wcccqb-msg {
  display: flex;
  margin: 0 0 12px;
}
.wcccqb-msg.user { justify-content: flex-end; }
.wcccqb-bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 17px;
  font-size: 14px;
  line-height: 1.42;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}
.wcccqb-msg.bot .wcccqb-bubble {
  background: #fff;
  color: #111827;
  border: 1px solid rgba(148, 163, 184, .28);
  border-top-left-radius: 6px;
}
.wcccqb-msg.user .wcccqb-bubble {
  background: var(--wcccqb-accent);
  color: #fff;
  border-top-right-radius: 6px;
}

.wcccqb-chips {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0 16px 12px;
  background: #f8fafc;
  flex: 0 0 auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wcccqb-chips::-webkit-scrollbar { display: none; }
.wcccqb-chip {
  border: 1px solid rgba(148,163,184,.35);
  background: #fff;
  color: #111827;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.wcccqb-chip:hover { border-color: var(--wcccqb-accent); }

.wcccqb-inputbar {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 13px;
  background: #fff;
  border-top: 1px solid rgba(148, 163, 184, .25);
  flex: 0 0 auto;
}
.wcccqb-input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 46px;
  max-height: 116px;
  resize: none;
  border: 1px solid rgba(148, 163, 184, .55);
  border-radius: 14px;
  padding: 12px 13px;
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.wcccqb-input:focus { border-color: var(--wcccqb-accent); box-shadow: 0 0 0 3px rgba(17,24,39,.10); }
.wcccqb-send {
  width: 52px;
  min-width: 52px;
  height: 46px;
  border-radius: 14px;
  border: 0;
  background: var(--wcccqb-accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 17px;
  -webkit-tap-highlight-color: transparent;
}
.wcccqb-send:disabled { opacity: .55; cursor: not-allowed; }

.wcccqb-typing .wcccqb-bubble:after {
  content: '...';
  display: inline-block;
  animation: wcccqbDots 1s infinite;
}
@keyframes wcccqbDots { 0%,20%{opacity:.2} 50%{opacity:1} 100%{opacity:.2} }

.wcccqb-footer-note {
  padding: 0 16px 13px;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
  background: #fff;
  flex: 0 0 auto;
}

body.wcccqb-mobile-lock { overflow: hidden; touch-action: none; }

@media (max-width: 640px) {
  .wcccqb-floating-button {
    right: max(15px, env(safe-area-inset-right));
    bottom: max(15px, env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
  }

  .wcccqb-floating-root .wcccqb-floating-panel {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    box-shadow: 0 -18px 65px rgba(15, 23, 42, .25);
    transform-origin: bottom center;
  }

  @supports not (height: 100dvh) {
    .wcccqb-floating-root .wcccqb-floating-panel { height: 100vh; max-height: 100vh; }
  }

  .wcccqb-floating-root .wcccqb-header {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  .wcccqb-panel { width: 100%; }
  .wcccqb-messages { height: auto; flex: 1 1 auto; min-height: 0; padding: 14px 12px; }
  .wcccqb-inline-root .wcccqb-messages { height: 62vh; min-height: 340px; max-height: 560px; }
  .wcccqb-bubble { max-width: 90%; font-size: 14px; }
  .wcccqb-chips { padding: 0 12px 10px; }
  .wcccqb-inputbar { padding: 11px 12px max(11px, env(safe-area-inset-bottom)); gap: 8px; }
  .wcccqb-footer-note { padding: 0 12px 11px; }
}

@media (max-width: 380px) {
  .wcccqb-header { gap: 9px; padding-left: 12px; padding-right: 10px; }
  .wcccqb-avatar { width: 34px; height: 34px; border-radius: 12px; }
  .wcccqb-header-title { font-size: 15px; }
  .wcccqb-header-subtitle { font-size: 11px; }
  .wcccqb-close { width: 32px; height: 32px; }
  .wcccqb-send { width: 48px; min-width: 48px; }
}
